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/ast-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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_AST_GRAPH_BUILDER_H_ 5 #ifndef V8_COMPILER_AST_GRAPH_BUILDER_H_
6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_ 6 #define V8_COMPILER_AST_GRAPH_BUILDER_H_
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/compiler/compiler-source-position-table.h"
9 #include "src/compiler/js-graph.h" 10 #include "src/compiler/js-graph.h"
10 #include "src/compiler/liveness-analyzer.h" 11 #include "src/compiler/liveness-analyzer.h"
11 #include "src/compiler/state-values-utils.h" 12 #include "src/compiler/state-values-utils.h"
12 13
13 namespace v8 { 14 namespace v8 {
14 namespace internal { 15 namespace internal {
15 16
16 // Forward declarations. 17 // Forward declarations.
17 class BitVector; 18 class BitVector;
18 class CompilationInfo; 19 class CompilationInfo;
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 NodeVector* contexts() { return &contexts_; } 611 NodeVector* contexts() { return &contexts_; }
611 LivenessAnalyzerBlock* liveness_block() { return liveness_block_; } 612 LivenessAnalyzerBlock* liveness_block() { return liveness_block_; }
612 bool IsLivenessAnalysisEnabled(); 613 bool IsLivenessAnalysisEnabled();
613 bool IsLivenessBlockConsistent(); 614 bool IsLivenessBlockConsistent();
614 615
615 // Prepare environment to be used as loop header. 616 // Prepare environment to be used as loop header.
616 void PrepareForLoop(BitVector* assigned); 617 void PrepareForLoop(BitVector* assigned);
617 void PrepareForOsrEntry(); 618 void PrepareForOsrEntry();
618 }; 619 };
619 620
621 class AstGraphBuilderWithPositions final : public AstGraphBuilder {
622 public:
623 AstGraphBuilderWithPositions(Zone* local_zone, CompilationInfo* info,
624 JSGraph* jsgraph, float invocation_frequency,
625 LoopAssignmentAnalysis* loop_assignment,
626 TypeHintAnalysis* type_hint_analysis,
627 SourcePositionTable* source_positions,
628 int inlining_id = SourcePosition::kNotInlined);
629
630 bool CreateGraph(bool stack_check = true) {
631 SourcePositionTable::Scope pos_scope(source_positions_, start_position_);
632 return AstGraphBuilder::CreateGraph(stack_check);
633 }
634
635 #define DEF_VISIT(type) \
636 void Visit##type(type* node) override { \
637 SourcePositionTable::Scope pos( \
638 source_positions_, \
639 SourcePosition(node->position(), start_position_.InliningId())); \
640 AstGraphBuilder::Visit##type(node); \
641 }
642 AST_NODE_LIST(DEF_VISIT)
643 #undef DEF_VISIT
644
645 private:
646 SourcePositionTable* const source_positions_;
647 SourcePosition const start_position_;
648 };
649
620 } // namespace compiler 650 } // namespace compiler
621 } // namespace internal 651 } // namespace internal
622 } // namespace v8 652 } // namespace v8
623 653
624 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_ 654 #endif // V8_COMPILER_AST_GRAPH_BUILDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698