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

Unified Diff: runtime/vm/precompiler.cc

Issue 1755353002: Fix precompiler (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/precompiler.cc
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
index 3743b1efe72e1f0904c7a17b47596758c05ab328..e61e916218cb9abe1876e1b26fdccf377f39076b 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -2013,7 +2013,12 @@ bool PrecompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) {
"OptimizationPasses");
#endif // !PRODUCT
inline_id_to_function.Add(&function);
- inline_id_to_token_pos.Add(function.token_pos());
+ // We do not add the token position now because we don't know the
+ // position of the inlined call until later. A side effect of this
+ // is that the length of |inline_id_to_function| is always larger
+ // than the length of |inline_id_to_token_pos| by one.
+ // Top scope function has no caller (-1). We do this because we expect
+ // all token positions to be at an inlined call.
// Top scope function has no caller (-1).
caller_inline_id.Add(-1);
CSTAT_TIMER_SCOPE(thread(), graphoptimizer_timer);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698