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

Side by Side Diff: src/compiler/bytecode-graph-builder.h

Issue 2523893003: Reland of [ignition/turbo] Perform liveness analysis on the bytecodes (Closed)
Patch Set: Export handler table for tests Created 4 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 | « src/compiler/bytecode-analysis.cc ('k') | src/compiler/bytecode-graph-builder.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_BYTECODE_GRAPH_BUILDER_H_ 5 #ifndef V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ 6 #define V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
7 7
8 #include "src/compiler/bytecode-analysis.h" 8 #include "src/compiler/bytecode-analysis.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/liveness-analyzer.h" 10 #include "src/compiler/liveness-analyzer.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Prepare information for eager deoptimization. This information is carried 128 // Prepare information for eager deoptimization. This information is carried
129 // by dedicated {Checkpoint} nodes that are wired into the effect chain. 129 // by dedicated {Checkpoint} nodes that are wired into the effect chain.
130 // Conceptually this frame state is "before" a given operation. 130 // Conceptually this frame state is "before" a given operation.
131 void PrepareEagerCheckpoint(); 131 void PrepareEagerCheckpoint();
132 132
133 // Prepare information for lazy deoptimization. This information is attached 133 // Prepare information for lazy deoptimization. This information is attached
134 // to the given node and the output value produced by the node is combined. 134 // to the given node and the output value produced by the node is combined.
135 // Conceptually this frame state is "after" a given operation. 135 // Conceptually this frame state is "after" a given operation.
136 void PrepareFrameState(Node* node, OutputFrameStateCombine combine); 136 void PrepareFrameState(Node* node, OutputFrameStateCombine combine);
137 137
138 // Computes register liveness and replaces dead ones in frame states with the
139 // undefined values.
140 void ClearNonLiveSlotsInFrameStates();
141
142 void BuildCreateArguments(CreateArgumentsType type); 138 void BuildCreateArguments(CreateArgumentsType type);
143 Node* BuildLoadGlobal(Handle<Name> name, uint32_t feedback_slot_index, 139 Node* BuildLoadGlobal(Handle<Name> name, uint32_t feedback_slot_index,
144 TypeofMode typeof_mode); 140 TypeofMode typeof_mode);
145 void BuildStoreGlobal(LanguageMode language_mode); 141 void BuildStoreGlobal(LanguageMode language_mode);
146 void BuildNamedStore(LanguageMode language_mode); 142 void BuildNamedStore(LanguageMode language_mode);
147 void BuildKeyedStore(LanguageMode language_mode); 143 void BuildKeyedStore(LanguageMode language_mode);
148 void BuildLdaLookupSlot(TypeofMode typeof_mode); 144 void BuildLdaLookupSlot(TypeofMode typeof_mode);
149 void BuildLdaLookupContextSlot(TypeofMode typeof_mode); 145 void BuildLdaLookupContextSlot(TypeofMode typeof_mode);
150 void BuildLdaLookupGlobalSlot(TypeofMode typeof_mode); 146 void BuildLdaLookupGlobalSlot(TypeofMode typeof_mode);
151 void BuildStaLookupSlot(LanguageMode language_mode); 147 void BuildStaLookupSlot(LanguageMode language_mode);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 249 }
254 250
255 const BytecodeAnalysis* bytecode_analysis() const { 251 const BytecodeAnalysis* bytecode_analysis() const {
256 return bytecode_analysis_; 252 return bytecode_analysis_;
257 } 253 }
258 254
259 void set_bytecode_analysis(const BytecodeAnalysis* bytecode_analysis) { 255 void set_bytecode_analysis(const BytecodeAnalysis* bytecode_analysis) {
260 bytecode_analysis_ = bytecode_analysis; 256 bytecode_analysis_ = bytecode_analysis;
261 } 257 }
262 258
263 LivenessAnalyzer* liveness_analyzer() { return &liveness_analyzer_; }
264
265 bool IsLivenessAnalysisEnabled() const { 259 bool IsLivenessAnalysisEnabled() const {
266 return this->is_liveness_analysis_enabled_; 260 return this->is_liveness_analysis_enabled_;
267 } 261 }
268 262
269 #define DECLARE_VISIT_BYTECODE(name, ...) void Visit##name(); 263 #define DECLARE_VISIT_BYTECODE(name, ...) void Visit##name();
270 BYTECODE_LIST(DECLARE_VISIT_BYTECODE) 264 BYTECODE_LIST(DECLARE_VISIT_BYTECODE)
271 #undef DECLARE_VISIT_BYTECODE 265 #undef DECLARE_VISIT_BYTECODE
272 266
273 Zone* local_zone_; 267 Zone* local_zone_;
274 JSGraph* jsgraph_; 268 JSGraph* jsgraph_;
(...skipping 25 matching lines...) Expand all
300 SetOncePointer<Node> function_closure_; 294 SetOncePointer<Node> function_closure_;
301 SetOncePointer<Node> new_target_; 295 SetOncePointer<Node> new_target_;
302 296
303 // Control nodes that exit the function body. 297 // Control nodes that exit the function body.
304 ZoneVector<Node*> exit_controls_; 298 ZoneVector<Node*> exit_controls_;
305 299
306 bool const is_liveness_analysis_enabled_; 300 bool const is_liveness_analysis_enabled_;
307 301
308 StateValuesCache state_values_cache_; 302 StateValuesCache state_values_cache_;
309 303
310 // Analyzer of register liveness.
311 LivenessAnalyzer liveness_analyzer_;
312
313 // The Turbofan source position table, to be populated. 304 // The Turbofan source position table, to be populated.
314 SourcePositionTable* source_positions_; 305 SourcePositionTable* source_positions_;
315 306
316 SourcePosition const start_position_; 307 SourcePosition const start_position_;
317 308
318 // Update [source_positions_]'s current position to that of the bytecode at 309 // Update [source_positions_]'s current position to that of the bytecode at
319 // [offset], if any. 310 // [offset], if any.
320 void UpdateCurrentSourcePosition(SourcePositionTableIterator* it, int offset); 311 void UpdateCurrentSourcePosition(SourcePositionTableIterator* it, int offset);
321 312
322 static int const kBinaryOperationHintIndex = 1; 313 static int const kBinaryOperationHintIndex = 1;
323 static int const kCountOperationHintIndex = 0; 314 static int const kCountOperationHintIndex = 0;
324 static int const kBinaryOperationSmiHintIndex = 2; 315 static int const kBinaryOperationSmiHintIndex = 2;
325 316
326 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); 317 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder);
327 }; 318 };
328 319
329 } // namespace compiler 320 } // namespace compiler
330 } // namespace internal 321 } // namespace internal
331 } // namespace v8 322 } // namespace v8
332 323
333 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ 324 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
OLDNEW
« no previous file with comments | « src/compiler/bytecode-analysis.cc ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698