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

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

Issue 2451853002: Uniform and precise source positions for inlining (Closed)
Patch Set: addressed comments 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
22 // Forward declarations.
vogelheim 2016/11/07 17:53:26 nitpick: Drop comment. It's indeed a forward decla
23 class CompilationInfo; 23 class CompilationInfo;
24 24
25 namespace compiler { 25 namespace compiler {
26 26
27 // Forward declarations.
28 class SourcePositionTable;
29
27 // The BytecodeGraphBuilder produces a high-level IR graph based on 30 // The BytecodeGraphBuilder produces a high-level IR graph based on
28 // interpreter bytecodes. 31 // interpreter bytecodes.
29 class BytecodeGraphBuilder { 32 class BytecodeGraphBuilder {
30 public: 33 public:
31 BytecodeGraphBuilder(Zone* local_zone, CompilationInfo* info, 34 BytecodeGraphBuilder(Zone* local_zone, CompilationInfo* info,
32 JSGraph* jsgraph, float invocation_frequency, 35 JSGraph* jsgraph, float invocation_frequency,
33 SourcePositionTable* source_positions); 36 SourcePositionTable* source_positions,
37 int inlining_id = SourcePosition::kNotInlined);
34 38
35 // Creates a graph by visiting bytecodes. 39 // Creates a graph by visiting bytecodes.
36 bool CreateGraph(bool stack_check = true); 40 bool CreateGraph(bool stack_check = true);
37 41
38 private: 42 private:
39 class Environment; 43 class Environment;
40 44
41 void VisitBytecodes(bool stack_check); 45 void VisitBytecodes(bool stack_check);
42 46
43 // Get or create the node that represents the outer function closure. 47 // Get or create the node that represents the outer function closure.
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 bool const is_liveness_analysis_enabled_; 314 bool const is_liveness_analysis_enabled_;
311 315
312 StateValuesCache state_values_cache_; 316 StateValuesCache state_values_cache_;
313 317
314 // Analyzer of register liveness. 318 // Analyzer of register liveness.
315 LivenessAnalyzer liveness_analyzer_; 319 LivenessAnalyzer liveness_analyzer_;
316 320
317 // The Turbofan source position table, to be populated. 321 // The Turbofan source position table, to be populated.
318 SourcePositionTable* source_positions_; 322 SourcePositionTable* source_positions_;
319 323
324 SourcePosition const start_position_;
325 int const inlining_id_;
alph 2016/11/07 22:38:39 Isn't inlining_id already a part of start_position
326
320 // Update [source_positions_]'s current position to that of the bytecode at 327 // Update [source_positions_]'s current position to that of the bytecode at
321 // [offset], if any. 328 // [offset], if any.
322 void UpdateCurrentSourcePosition(SourcePositionTableIterator* it, int offset); 329 void UpdateCurrentSourcePosition(SourcePositionTableIterator* it, int offset);
323 330
324 static int const kBinaryOperationHintIndex = 1; 331 static int const kBinaryOperationHintIndex = 1;
325 static int const kCountOperationHintIndex = 0; 332 static int const kCountOperationHintIndex = 0;
326 static int const kBinaryOperationSmiHintIndex = 2; 333 static int const kBinaryOperationSmiHintIndex = 2;
327 334
328 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder); 335 DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder);
329 }; 336 };
330 337
331 } // namespace compiler 338 } // namespace compiler
332 } // namespace internal 339 } // namespace internal
333 } // namespace v8 340 } // namespace v8
334 341
335 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_ 342 #endif // V8_COMPILER_BYTECODE_GRAPH_BUILDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698