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_H_ | 5 #ifndef V8_COMPILER_ESCAPE_ANALYSIS_H_ |
6 #define V8_COMPILER_ESCAPE_ANALYSIS_H_ | 6 #define V8_COMPILER_ESCAPE_ANALYSIS_H_ |
7 | 7 |
8 #include "src/compiler/graph.h" | 8 #include "src/compiler/graph.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 // EscapeObjectAnalysis simulates stores to determine values of loads if | 22 // EscapeObjectAnalysis simulates stores to determine values of loads if |
23 // an object is virtual and eliminated. | 23 // an object is virtual and eliminated. |
24 class V8_EXPORT_PRIVATE EscapeAnalysis { | 24 class V8_EXPORT_PRIVATE EscapeAnalysis { |
25 public: | 25 public: |
26 EscapeAnalysis(Graph* graph, CommonOperatorBuilder* common, Zone* zone); | 26 EscapeAnalysis(Graph* graph, CommonOperatorBuilder* common, Zone* zone); |
27 ~EscapeAnalysis(); | 27 ~EscapeAnalysis(); |
28 | 28 |
29 bool Run(); | 29 bool Run(); |
30 | 30 |
31 Node* GetReplacement(Node* node); | 31 Node* GetReplacement(Node* node); |
| 32 Node* ResolveReplacement(Node* node); |
32 bool IsVirtual(Node* node); | 33 bool IsVirtual(Node* node); |
33 bool IsEscaped(Node* node); | 34 bool IsEscaped(Node* node); |
34 bool CompareVirtualObjects(Node* left, Node* right); | 35 bool CompareVirtualObjects(Node* left, Node* right); |
35 Node* GetOrCreateObjectState(Node* effect, Node* node); | 36 Node* GetOrCreateObjectState(Node* effect, Node* node); |
36 bool IsCyclicObjectState(Node* effect, Node* node); | 37 bool IsCyclicObjectState(Node* effect, Node* node); |
37 bool ExistsVirtualAllocate(); | 38 bool ExistsVirtualAllocate(); |
38 bool SetReplacement(Node* node, Node* rep); | 39 bool SetReplacement(Node* node, Node* rep); |
39 | 40 |
40 private: | 41 private: |
41 void RunObjectAnalysis(); | 42 void RunObjectAnalysis(); |
(...skipping 11 matching lines...) Expand all Loading... |
53 bool ProcessEffectPhi(Node* node); | 54 bool ProcessEffectPhi(Node* node); |
54 void ProcessLoadFromPhi(int offset, Node* from, Node* node, | 55 void ProcessLoadFromPhi(int offset, Node* from, Node* node, |
55 VirtualState* states); | 56 VirtualState* states); |
56 | 57 |
57 void ForwardVirtualState(Node* node); | 58 void ForwardVirtualState(Node* node); |
58 VirtualState* CopyForModificationAt(VirtualState* state, Node* node); | 59 VirtualState* CopyForModificationAt(VirtualState* state, Node* node); |
59 VirtualObject* CopyForModificationAt(VirtualObject* obj, VirtualState* state, | 60 VirtualObject* CopyForModificationAt(VirtualObject* obj, VirtualState* state, |
60 Node* node); | 61 Node* node); |
61 | 62 |
62 Node* replacement(Node* node); | 63 Node* replacement(Node* node); |
63 Node* ResolveReplacement(Node* node); | |
64 bool UpdateReplacement(VirtualState* state, Node* node, Node* rep); | 64 bool UpdateReplacement(VirtualState* state, Node* node, Node* rep); |
65 | 65 |
66 VirtualObject* GetVirtualObject(VirtualState* state, Node* node); | 66 VirtualObject* GetVirtualObject(VirtualState* state, Node* node); |
67 | 67 |
68 void DebugPrint(); | 68 void DebugPrint(); |
69 void DebugPrintState(VirtualState* state); | 69 void DebugPrintState(VirtualState* state); |
70 | 70 |
71 Graph* graph() const; | 71 Graph* graph() const; |
72 Zone* zone() const { return zone_; } | 72 Zone* zone() const { return zone_; } |
73 CommonOperatorBuilder* common() const { return common_; } | 73 CommonOperatorBuilder* common() const { return common_; } |
74 | 74 |
75 Zone* const zone_; | 75 Zone* const zone_; |
76 Node* const slot_not_analyzed_; | 76 Node* const slot_not_analyzed_; |
77 CommonOperatorBuilder* const common_; | 77 CommonOperatorBuilder* const common_; |
78 EscapeStatusAnalysis* status_analysis_; | 78 EscapeStatusAnalysis* status_analysis_; |
79 ZoneVector<VirtualState*> virtual_states_; | 79 ZoneVector<VirtualState*> virtual_states_; |
80 ZoneVector<Node*> replacements_; | 80 ZoneVector<Node*> replacements_; |
81 ZoneSet<VirtualObject*> cycle_detection_; | 81 ZoneSet<VirtualObject*> cycle_detection_; |
82 MergeCache* cache_; | 82 MergeCache* cache_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis); | 84 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace compiler | 87 } // namespace compiler |
88 } // namespace internal | 88 } // namespace internal |
89 } // namespace v8 | 89 } // namespace v8 |
90 | 90 |
91 #endif // V8_COMPILER_ESCAPE_ANALYSIS_H_ | 91 #endif // V8_COMPILER_ESCAPE_ANALYSIS_H_ |
OLD | NEW |