1 // Copyright 2018 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_COMPILER_JS_HEAP_COPY_REDUCER_H_ 6 #define V8_COMPILER_JS_HEAP_COPY_REDUCER_H_ 7 8 #include "src/compiler/graph-reducer.h" 9 10 namespace v8 { 11 namespace internal { 12 namespace compiler { 13 14 class JSHeapBroker; 15 16 // The heap copy reducer makes sure that the relevant heap data referenced 17 // by handles embedded in the graph is copied to the heap broker. 18 // TODO(jarin) This is just a temporary solution until the graph uses only 19 // ObjetRef-derived reference to refer to the heap data. 20 class JSHeapCopyReducer : public Reducer { 21 public: 22 explicit JSHeapCopyReducer(JSHeapBroker* broker); 23 reducer_name()24 const char* reducer_name() const override { return "JSHeapCopyReducer"; } 25 26 Reduction Reduce(Node* node) override; 27 28 private: 29 JSHeapBroker* broker(); 30 31 JSHeapBroker* broker_; 32 }; 33 34 } // namespace compiler 35 } // namespace internal 36 } // namespace v8 37 38 #endif // V8_COMPILER_JS_HEAP_COPY_REDUCER_H_ 39