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

Unified 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 side-by-side diff with in-line comments
Download patch
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..46dcf4216d614e4b857172f7e78c38b20df2720f 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 = 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(), start_position_.InliningId())); \
+ AstGraphBuilder::Visit##type(node); \
+ }
+ AST_NODE_LIST(DEF_VISIT)
+#undef DEF_VISIT
+
+ private:
+ SourcePositionTable* const source_positions_;
+ SourcePosition const start_position_;
+};
+
} // namespace compiler
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698