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

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

Issue 2451853002: Uniform and precise source positions for inlining (Closed)
Patch Set: fixed gcmole issue Created 4 years, 1 month 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
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-branch-analysis.h" 8 #include "src/compiler/bytecode-branch-analysis.h"
9 #include "src/compiler/bytecode-loop-analysis.h" 9 #include "src/compiler/bytecode-loop-analysis.h"
10 #include "src/compiler/js-graph.h" 10 #include "src/compiler/js-graph.h"
11 #include "src/compiler/liveness-analyzer.h" 11 #include "src/compiler/liveness-analyzer.h"
12 #include "src/compiler/source-position.h"
13 #include "src/compiler/state-values-utils.h" 12 #include "src/compiler/state-values-utils.h"
14 #include "src/compiler/type-hint-analyzer.h" 13 #include "src/compiler/type-hint-analyzer.h"
15 #include "src/interpreter/bytecode-array-iterator.h" 14 #include "src/interpreter/bytecode-array-iterator.h"
16 #include "src/interpreter/bytecode-flags.h" 15 #include "src/interpreter/bytecode-flags.h"
17 #include "src/interpreter/bytecodes.h" 16 #include "src/interpreter/bytecodes.h"
18 #include "src/source-position-table.h" 17 #include "src/source-position-table.h"
19 18
20 namespace v8 { 19 namespace v8 {
21 namespace internal { 20 namespace internal {
22 21
23 class CompilationInfo; 22 class CompilationInfo;
24 23
25 namespace compiler { 24 namespace compiler {
26 25
26 class SourcePositionTable;
27
27 // The BytecodeGraphBuilder produces a high-level IR graph based on 28 // The BytecodeGraphBuilder produces a high-level IR graph based on
28 // interpreter bytecodes. 29 // interpreter bytecodes.
29 class BytecodeGraphBuilder { 30 class BytecodeGraphBuilder {
30 public: 31 public:
31 BytecodeGraphBuilder(Zone* local_zone, CompilationInfo* info, 32 BytecodeGraphBuilder(Zone* local_zone, CompilationInfo* info,
32 JSGraph* jsgraph, float invocation_frequency, 33 JSGraph* jsgraph, float invocation_frequency,
33 SourcePositionTable* source_positions); 34 SourcePositionTable* source_positions,
35 int inlining_id = SourcePosition::kNotInlined);
34 36
35 // Creates a graph by visiting bytecodes. 37 // Creates a graph by visiting bytecodes.
36 bool CreateGraph(bool stack_check = true); 38 bool CreateGraph(bool stack_check = true);
37 39
38 private: 40 private:
39 class Environment; 41 class Environment;
40 42
41 void VisitBytecodes(bool stack_check); 43 void VisitBytecodes(bool stack_check);
42 44
43 // Get or create the node that represents the outer function closure. 45 // Get or create the node that represents the outer function closure.
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 bool const is_liveness_analysis_enabled_; 308 bool const is_liveness_analysis_enabled_;
307 309
308 StateValuesCache state_values_cache_; 310 StateValuesCache state_values_cache_;
309 311
310 // Analyzer of register liveness. 312 // Analyzer of register liveness.
311 LivenessAnalyzer liveness_analyzer_; 313 LivenessAnalyzer liveness_analyzer_;
312 314
313 // The Turbofan source position table, to be populated. 315 // The Turbofan source position table, to be populated.
314 SourcePositionTable* source_positions_; 316 SourcePositionTable* source_positions_;
315 317
318 SourcePosition const start_position_;
319
316 // Update [source_positions_]'s current position to that of the bytecode at 320 // Update [source_positions_]'s current position to that of the bytecode at
317 // [offset], if any. 321 // [offset], if any.
318 void UpdateCurrentSourcePosition(SourcePositionTableIterator* it, int offset); 322 void UpdateCurrentSourcePosition(SourcePositionTableIterator* it, int offset);
319 323
320 static int const kBinaryOperationHintIndex = 1; 324 static int const kBinaryOperationHintIndex = 1;
321 static int const kCountOperationHintIndex = 0; 325 static int const kCountOperationHintIndex = 0;
322 static int const kBinaryOperationSmiHintIndex = 2; 326 static int const kBinaryOperationSmiHintIndex = 2;
323 327
324 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); 328 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder);
325 }; 329 };
326 330
327 } // namespace compiler 331 } // namespace compiler
328 } // namespace internal 332 } // namespace internal
329 } // namespace v8 333 } // namespace v8
330 334
331 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ 335 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698