Chromium Code Reviews| Index: src/compiler/ast-graph-builder.h |
| diff --git a/src/compiler/ast-graph-builder.h b/src/compiler/ast-graph-builder.h |
| index e6cb52f839754dea48930a6fd4eebf49d335df7e..28f6e29af43d9397d23290df7fce8ce88ff1ec42 100644 |
| --- a/src/compiler/ast-graph-builder.h |
| +++ b/src/compiler/ast-graph-builder.h |
| @@ -6,6 +6,7 @@ |
| #define V8_COMPILER_AST_GRAPH_BUILDER_H_ |
| #include "src/ast/ast.h" |
| +#include "src/compiler/compiler-source-position-table.h" |
| #include "src/compiler/js-graph.h" |
| #include "src/compiler/liveness-analyzer.h" |
| #include "src/compiler/state-values-utils.h" |
| @@ -617,6 +618,35 @@ class AstGraphBuilder::Environment : public ZoneObject { |
| void PrepareForOsrEntry(); |
| }; |
| +class AstGraphBuilderWithPositions final : public AstGraphBuilder { |
| + public: |
| + AstGraphBuilderWithPositions(Zone* local_zone, CompilationInfo* info, |
| + JSGraph* jsgraph, float invocation_frequency, |
| + LoopAssignmentAnalysis* loop_assignment, |
| + TypeHintAnalysis* type_hint_analysis, |
| + SourcePositionTable* source_positions, |
| + int inlining_id = -1); |
|
alph
2016/11/07 22:38:39
nit: = SourcePosition::kNotInlined
|
| + |
| + bool CreateGraph(bool stack_check = true) { |
| + SourcePositionTable::Scope pos_scope(source_positions_, start_position_); |
| + return AstGraphBuilder::CreateGraph(stack_check); |
| + } |
| + |
| +#define DEF_VISIT(type) \ |
| + void Visit##type(type* node) override { \ |
| + SourcePositionTable::Scope pos( \ |
| + source_positions_, SourcePosition(node->position(), inlining_id_)); \ |
| + AstGraphBuilder::Visit##type(node); \ |
| + } |
| + AST_NODE_LIST(DEF_VISIT) |
| +#undef DEF_VISIT |
| + |
| + private: |
| + SourcePositionTable* const source_positions_; |
| + SourcePosition const start_position_; |
| + int const inlining_id_; |
| +}; |
| + |
| } // namespace compiler |
| } // namespace internal |
| } // namespace v8 |