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/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/compiler/graph.h" | 9 #include "src/compiler/graph.h" |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 bool CheckUsesForEscape(Node* node, bool phi_escaping = false) { | 52 bool CheckUsesForEscape(Node* node, bool phi_escaping = false) { |
53 return CheckUsesForEscape(node, node, phi_escaping); | 53 return CheckUsesForEscape(node, node, phi_escaping); |
54 } | 54 } |
55 bool CheckUsesForEscape(Node* node, Node* rep, bool phi_escaping = false); | 55 bool CheckUsesForEscape(Node* node, Node* rep, bool phi_escaping = false); |
56 void RevisitUses(Node* node); | 56 void RevisitUses(Node* node); |
57 void RevisitInputs(Node* node); | 57 void RevisitInputs(Node* node); |
58 bool SetEscaped(Node* node); | 58 bool SetEscaped(Node* node); |
59 bool HasEntry(Node* node); | 59 bool HasEntry(Node* node); |
60 void Resize(); | 60 void Resize(); |
61 size_t size(); | 61 size_t size(); |
| 62 bool IsAllocationPhi(Node* node); |
62 | 63 |
63 Graph* graph() const { return graph_; } | 64 Graph* graph() const { return graph_; } |
64 Zone* zone() const { return zone_; } | 65 Zone* zone() const { return zone_; } |
65 | 66 |
66 EscapeAnalysis* object_analysis_; | 67 EscapeAnalysis* object_analysis_; |
67 Graph* const graph_; | 68 Graph* const graph_; |
68 Zone* const zone_; | 69 Zone* const zone_; |
69 ZoneVector<EscapeStatusFlags> info_; | 70 ZoneVector<EscapeStatusFlags> info_; |
70 ZoneDeque<Node*> queue_; | 71 ZoneDeque<Node*> queue_; |
71 | 72 |
(...skipping 13 matching lines...) Expand all Loading... |
85 class EscapeAnalysis { | 86 class EscapeAnalysis { |
86 public: | 87 public: |
87 EscapeAnalysis(Graph* graph, CommonOperatorBuilder* common, Zone* zone); | 88 EscapeAnalysis(Graph* graph, CommonOperatorBuilder* common, Zone* zone); |
88 ~EscapeAnalysis(); | 89 ~EscapeAnalysis(); |
89 | 90 |
90 void Run(); | 91 void Run(); |
91 | 92 |
92 Node* GetReplacement(Node* node); | 93 Node* GetReplacement(Node* node); |
93 bool IsVirtual(Node* node); | 94 bool IsVirtual(Node* node); |
94 bool IsEscaped(Node* node); | 95 bool IsEscaped(Node* node); |
| 96 bool CompareVirtualObjects(Node* left, Node* right); |
| 97 Node* GetOrCreateObjectState(Node* effect, Node* node); |
95 | 98 |
96 private: | 99 private: |
97 void RunObjectAnalysis(); | 100 void RunObjectAnalysis(); |
98 bool Process(Node* node); | 101 bool Process(Node* node); |
99 void ProcessLoadField(Node* node); | 102 void ProcessLoadField(Node* node); |
100 void ProcessStoreField(Node* node); | 103 void ProcessStoreField(Node* node); |
101 void ProcessLoadElement(Node* node); | 104 void ProcessLoadElement(Node* node); |
102 void ProcessStoreElement(Node* node); | 105 void ProcessStoreElement(Node* node); |
103 void ProcessAllocationUsers(Node* node); | 106 void ProcessAllocationUsers(Node* node); |
104 void ProcessAllocation(Node* node); | 107 void ProcessAllocation(Node* node); |
105 void ProcessFinishRegion(Node* node); | 108 void ProcessFinishRegion(Node* node); |
106 void ProcessCall(Node* node); | 109 void ProcessCall(Node* node); |
107 void ProcessStart(Node* node); | 110 void ProcessStart(Node* node); |
108 bool ProcessEffectPhi(Node* node); | 111 bool ProcessEffectPhi(Node* node); |
109 void ProcessLoadFromPhi(int offset, Node* from, Node* node, | 112 void ProcessLoadFromPhi(int offset, Node* from, Node* node, |
110 VirtualState* states); | 113 VirtualState* states); |
111 | 114 |
112 void ForwardVirtualState(Node* node); | 115 void ForwardVirtualState(Node* node); |
113 | |
114 bool IsEffectBranchPoint(Node* node); | 116 bool IsEffectBranchPoint(Node* node); |
115 bool IsDanglingEffectNode(Node* node); | 117 bool IsDanglingEffectNode(Node* node); |
116 int OffsetFromAccess(Node* node); | 118 int OffsetFromAccess(Node* node); |
117 | 119 |
118 VirtualObject* GetVirtualObject(Node* at, NodeId id); | 120 VirtualObject* GetVirtualObject(Node* at, NodeId id); |
119 VirtualObject* ResolveVirtualObject(VirtualState* state, Node* node); | 121 VirtualObject* ResolveVirtualObject(VirtualState* state, Node* node); |
120 Node* GetReplacementIfSame(ZoneVector<VirtualObject*>& objs); | 122 Node* GetReplacementIfSame(ZoneVector<VirtualObject*>& objs); |
121 | 123 |
122 bool SetEscaped(Node* node); | 124 bool SetEscaped(Node* node); |
123 Node* replacement(NodeId id); | 125 Node* replacement(NodeId id); |
(...skipping 20 matching lines...) Expand all Loading... |
144 MergeCache* cache_; | 146 MergeCache* cache_; |
145 | 147 |
146 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis); | 148 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis); |
147 }; | 149 }; |
148 | 150 |
149 } // namespace compiler | 151 } // namespace compiler |
150 } // namespace internal | 152 } // namespace internal |
151 } // namespace v8 | 153 } // namespace v8 |
152 | 154 |
153 #endif // V8_COMPILER_ESCAPE_ANALYSIS_H_ | 155 #endif // V8_COMPILER_ESCAPE_ANALYSIS_H_ |
OLD | NEW |