5 #ifndef V8_COMPILER_ESCAPE_ANALYSIS_REDUCER_H_ 6 #define V8_COMPILER_ESCAPE_ANALYSIS_REDUCER_H_ 8 #include "src/base/compiler-specific.h" 9 #include "src/compiler/escape-analysis.h" 10 #include "src/compiler/graph-reducer.h" 11 #include "src/globals.h" 25 : graph_(graph), cache_(zone), temp_nodes_(zone) {}
33 : node_cache_(cache), from_(from), tmp_(
nullptr) {}
39 void ReplaceValueInput(
Node* input,
int i) {
40 if (!tmp_ && input == NodeProperties::GetValueInput(from_,
i))
return;
41 Node* node = MutableNode();
42 NodeProperties::ReplaceValueInput(node, input,
i);
44 void ReplaceInput(
Node* input,
int i) {
45 if (!tmp_ && input == from_->InputAt(
i))
return;
46 Node* node = MutableNode();
47 node->ReplaceInput(
i, input);
65 void Insert(
Node* node) { cache_.insert(node); }
69 bool operator()(
Node* a,
Node* b)
const {
70 return NodeProperties::Equals(a, b);
74 size_t operator()(Node* n)
const {
return NodeProperties::HashCode(n); }
76 ZoneUnorderedSet<Node*, NodeHashCode, NodeEquals> cache_;
78 ZoneVector<Node*> temp_nodes_;
83 :
public NON_EXPORTED_BASE(AdvancedReducer) {
89 const char* reducer_name()
const override {
return "EscapeAnalysisReducer"; }
90 void Finalize()
override;
94 void VerifyReplacement()
const;
97 void ReduceFrameStateInputs(
Node* node);
102 JSGraph* jsgraph()
const {
return jsgraph_; }
103 Isolate* isolate()
const {
return jsgraph_->isolate(); }
105 Zone* zone()
const {
return zone_; }
121 #endif // V8_COMPILER_ESCAPE_ANALYSIS_REDUCER_H_