| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_COMPILER_ESCAPE_ANALYSIS_REDUCER_H_ | 5 #ifndef V8_COMPILER_ESCAPE_ANALYSIS_REDUCER_H_ |
| 6 #define V8_COMPILER_ESCAPE_ANALYSIS_REDUCER_H_ | 6 #define V8_COMPILER_ESCAPE_ANALYSIS_REDUCER_H_ |
| 7 | 7 |
| 8 #include "src/bit-vector.h" | 8 #include "src/bit-vector.h" |
| 9 #include "src/compiler/escape-analysis.h" | 9 #include "src/compiler/escape-analysis.h" |
| 10 #include "src/compiler/graph-reducer.h" | 10 #include "src/compiler/graph-reducer.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // Forward declarations. | 22 // Forward declarations. |
| 23 class JSGraph; | 23 class JSGraph; |
| 24 | 24 |
| 25 | 25 |
| 26 class EscapeAnalysisReducer final : public AdvancedReducer { | 26 class EscapeAnalysisReducer final : public AdvancedReducer { |
| 27 public: | 27 public: |
| 28 EscapeAnalysisReducer(Editor* editor, JSGraph* jsgraph, | 28 EscapeAnalysisReducer(Editor* editor, JSGraph* jsgraph, |
| 29 EscapeAnalysis* escape_analysis, Zone* zone); | 29 EscapeAnalysis* escape_analysis, Zone* zone); |
| 30 | 30 |
| 31 Reduction Reduce(Node* node) final; | 31 Reduction Reduce(Node* node) final; |
| 32 void SetExistsVirtualAllocate(bool exists) { |
| 33 exists_virtual_allocate_ = exists; |
| 34 } |
| 32 | 35 |
| 33 private: | 36 private: |
| 34 Reduction ReduceLoad(Node* node); | 37 Reduction ReduceLoad(Node* node); |
| 35 Reduction ReduceStore(Node* node); | 38 Reduction ReduceStore(Node* node); |
| 36 Reduction ReduceAllocate(Node* node); | 39 Reduction ReduceAllocate(Node* node); |
| 37 Reduction ReduceFinishRegion(Node* node); | 40 Reduction ReduceFinishRegion(Node* node); |
| 38 Reduction ReduceReferenceEqual(Node* node); | 41 Reduction ReduceReferenceEqual(Node* node); |
| 39 Reduction ReduceObjectIsSmi(Node* node); | 42 Reduction ReduceObjectIsSmi(Node* node); |
| 40 Reduction ReduceFrameStateUses(Node* node); | 43 Reduction ReduceFrameStateUses(Node* node); |
| 41 Node* ReduceFrameState(Node* node, Node* effect, bool multiple_users); | 44 Node* ReduceDeoptState(Node* node, Node* effect, bool multiple_users); |
| 42 Node* ReduceStateValueInputs(Node* node, Node* effect, bool multiple_users); | |
| 43 Node* ReduceStateValueInput(Node* node, int node_index, Node* effect, | 45 Node* ReduceStateValueInput(Node* node, int node_index, Node* effect, |
| 46 bool node_multiused, bool already_cloned, |
| 44 bool multiple_users); | 47 bool multiple_users); |
| 45 | 48 |
| 46 JSGraph* jsgraph() const { return jsgraph_; } | 49 JSGraph* jsgraph() const { return jsgraph_; } |
| 47 EscapeAnalysis* escape_analysis() const { return escape_analysis_; } | 50 EscapeAnalysis* escape_analysis() const { return escape_analysis_; } |
| 48 Zone* zone() const { return zone_; } | 51 Zone* zone() const { return zone_; } |
| 49 Counters* counters() const; | 52 Counters* counters() const; |
| 50 | 53 |
| 51 JSGraph* const jsgraph_; | 54 JSGraph* const jsgraph_; |
| 52 EscapeAnalysis* escape_analysis_; | 55 EscapeAnalysis* escape_analysis_; |
| 53 Zone* const zone_; | 56 Zone* const zone_; |
| 57 // _visited marks nodes we already processed (allocs, loads, stores) |
| 58 // and nodes that do not need a visit from ReduceDeoptState etc. |
| 54 BitVector visited_; | 59 BitVector visited_; |
| 60 bool exists_virtual_allocate_; |
| 55 | 61 |
| 56 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysisReducer); | 62 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysisReducer); |
| 57 }; | 63 }; |
| 58 | 64 |
| 59 } // namespace compiler | 65 } // namespace compiler |
| 60 } // namespace internal | 66 } // namespace internal |
| 61 } // namespace v8 | 67 } // namespace v8 |
| 62 | 68 |
| 63 #endif // V8_COMPILER_ESCAPE_ANALYSIS_REDUCER_H_ | 69 #endif // V8_COMPILER_ESCAPE_ANALYSIS_REDUCER_H_ |
| OLD | NEW |