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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 1739963002: Remember token position where a function was inlined (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months 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: runtime/vm/flow_graph_inliner.cc
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index 9c720a378130aab78966fb97ea608ea8d91a47dc..7a0808ecb94bcb39226d8ebe780b2f37eefdf19d 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -903,6 +903,7 @@ class CallSiteInliner : public ValueObject {
FlowGraphInliner::SetInliningId(callee_graph,
inliner_->NextInlineId(callee_graph->function(),
+ call_data->call->token_pos(),
call_data->caller_inlining_id_));
TRACE_INLINING(THR_Print(" Success\n"));
PRINT_INLINING_TREE(NULL,
@@ -1824,11 +1825,13 @@ static bool ShouldTraceInlining(FlowGraph* flow_graph) {
FlowGraphInliner::FlowGraphInliner(
FlowGraph* flow_graph,
GrowableArray<const Function*>* inline_id_to_function,
+ GrowableArray<TokenPosition>* inline_id_to_token_pos,
GrowableArray<intptr_t>* caller_inline_id,
bool use_speculative_inlining,
GrowableArray<intptr_t>* inlining_black_list)
: flow_graph_(flow_graph),
inline_id_to_function_(inline_id_to_function),
+ inline_id_to_token_pos_(inline_id_to_token_pos),
caller_inline_id_(caller_inline_id),
trace_inlining_(ShouldTraceInlining(flow_graph)),
use_speculative_inlining_(use_speculative_inlining),
@@ -1949,9 +1952,15 @@ void FlowGraphInliner::Inline() {
intptr_t FlowGraphInliner::NextInlineId(const Function& function,
+ TokenPosition tp,
intptr_t parent_id) {
const intptr_t id = inline_id_to_function_->length();
+ // TODO(johnmccutchan): Do not allow IsNoSource once all nodes have proper
+ // source positions.
+ ASSERT(tp.IsReal() || tp.IsSynthetic() || tp.IsNoSource());
inline_id_to_function_->Add(&function);
+ inline_id_to_token_pos_->Add(tp);
+ ASSERT(inline_id_to_token_pos_->length() == inline_id_to_function_->length());
caller_inline_id_->Add(parent_id);
return id;
}

Powered by Google App Engine
This is Rietveld 408576698