Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Side by Side Diff: src/compiler/escape-analysis.h

Issue 1527533002: [turbofan] Move replacements out of virtual object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@fix-cluster-3
Patch Set: Address comment Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/escape-analysis.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 // EscapeObjectAnalysis simulates stores to determine values of loads if 101 // EscapeObjectAnalysis simulates stores to determine values of loads if
102 // an object is virtual and eliminated. 102 // an object is virtual and eliminated.
103 class EscapeAnalysis { 103 class EscapeAnalysis {
104 public: 104 public:
105 EscapeAnalysis(Graph* graph, CommonOperatorBuilder* common, Zone* zone); 105 EscapeAnalysis(Graph* graph, CommonOperatorBuilder* common, Zone* zone);
106 ~EscapeAnalysis(); 106 ~EscapeAnalysis();
107 107
108 void Run(); 108 void Run();
109 109
110 Node* GetReplacement(Node* at, NodeId id); 110 Node* GetReplacement(Node* node);
111 bool IsVirtual(Node* node); 111 bool IsVirtual(Node* node);
112 bool IsEscaped(Node* node); 112 bool IsEscaped(Node* node);
113 113
114 private: 114 private:
115 void RunObjectAnalysis(); 115 void RunObjectAnalysis();
116 bool Process(Node* node); 116 bool Process(Node* node);
117 void ProcessLoadField(Node* node); 117 void ProcessLoadField(Node* node);
118 void ProcessStoreField(Node* node); 118 void ProcessStoreField(Node* node);
119 void ProcessLoadElement(Node* node); 119 void ProcessLoadElement(Node* node);
120 void ProcessStoreElement(Node* node); 120 void ProcessStoreElement(Node* node);
121 void ProcessAllocationUsers(Node* node); 121 void ProcessAllocationUsers(Node* node);
122 void ProcessAllocation(Node* node); 122 void ProcessAllocation(Node* node);
123 void ProcessFinishRegion(Node* node); 123 void ProcessFinishRegion(Node* node);
124 void ProcessCall(Node* node); 124 void ProcessCall(Node* node);
125 void ProcessStart(Node* node); 125 void ProcessStart(Node* node);
126 bool ProcessEffectPhi(Node* node); 126 bool ProcessEffectPhi(Node* node);
127 void ProcessLoadFromPhi(int offset, Node* from, Node* node, 127 void ProcessLoadFromPhi(int offset, Node* from, Node* node,
128 VirtualState* states); 128 VirtualState* states);
129 129
130 void ForwardVirtualState(Node* node); 130 void ForwardVirtualState(Node* node);
131 131
132 bool IsEffectBranchPoint(Node* node); 132 bool IsEffectBranchPoint(Node* node);
133 bool IsDanglingEffectNode(Node* node); 133 bool IsDanglingEffectNode(Node* node);
134 int OffsetFromAccess(Node* node); 134 int OffsetFromAccess(Node* node);
135 135
136 VirtualObject* GetVirtualObject(Node* at, NodeId id); 136 VirtualObject* GetVirtualObject(Node* at, NodeId id);
137 VirtualObject* ResolveVirtualObject(VirtualState* state, Node* node);
138 Node* GetReplacementIfSame(ZoneVector<VirtualObject*>& objs);
137 139
138 bool SetEscaped(Node* node); 140 bool SetEscaped(Node* node);
141 Node* replacement(NodeId id);
142 Node* replacement(Node* node);
143 Node* ResolveReplacement(Node* node);
144 Node* GetReplacement(NodeId id);
145 bool SetReplacement(Node* node, Node* rep);
146 bool UpdateReplacement(VirtualState* state, Node* node, Node* rep);
139 147
140 void DebugPrint(); 148 void DebugPrint();
141 void DebugPrintState(VirtualState* state); 149 void DebugPrintState(VirtualState* state);
142 void DebugPrintObject(VirtualObject* state, NodeId id); 150 void DebugPrintObject(VirtualObject* state, NodeId id);
143 151
144 Graph* graph() const { return graph_; } 152 Graph* graph() const { return graph_; }
145 CommonOperatorBuilder* common() const { return common_; } 153 CommonOperatorBuilder* common() const { return common_; }
146 Zone* zone() const { return zone_; } 154 Zone* zone() const { return zone_; }
147 155
148 Graph* const graph_; 156 Graph* const graph_;
149 CommonOperatorBuilder* const common_; 157 CommonOperatorBuilder* const common_;
150 Zone* const zone_; 158 Zone* const zone_;
151 ZoneVector<VirtualState*> virtual_states_; 159 ZoneVector<VirtualState*> virtual_states_;
160 ZoneVector<Node*> replacements_;
152 EscapeStatusAnalysis escape_status_; 161 EscapeStatusAnalysis escape_status_;
153 MergeCache cache_; 162 MergeCache cache_;
154 163
155 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis); 164 DISALLOW_COPY_AND_ASSIGN(EscapeAnalysis);
156 }; 165 };
157 166
158 } // namespace compiler 167 } // namespace compiler
159 } // namespace internal 168 } // namespace internal
160 } // namespace v8 169 } // namespace v8
161 170
162 #endif // V8_COMPILER_ESCAPE_ANALYSIS_H_ 171 #endif // V8_COMPILER_ESCAPE_ANALYSIS_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/escape-analysis.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698