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

Unified Diff: runtime/vm/compiler.cc

Issue 1268783002: Fix inlining information: (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: sync Created 5 years, 5 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 | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 491b57111b6186f7ec4de1ca443f4250e0b9d9b4..c5cdd42b29ef0c11ac785836c2a4a4ae0d68cfe6 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -744,6 +744,12 @@ static bool CompileParsedFunctionHelper(CompilationPipeline* pipeline,
inlined_id_array.Length() * sizeof(uword));
code.SetInlinedIdToFunction(inlined_id_array);
+ const Array& caller_inlining_id_map_array =
+ Array::Handle(isolate, graph_compiler.CallerInliningIdMap());
+ INC_STAT(isolate, total_code_size,
+ caller_inlining_id_map_array.Length() * sizeof(uword));
+ code.SetInlinedCallerIdMap(caller_inlining_id_map_array);
+
graph_compiler.FinalizePcDescriptors(code);
code.set_deopt_info_array(deopt_info_array);
@@ -971,6 +977,27 @@ static void DisassembleCode(const Function& function, bool optimized) {
}
+#if defined(DEBUG)
+// Verifies that the inliner is always in the list of inlined functions.
+// If this fails run with --trace-inlining-intervals to get more information.
+static void CheckInliningIntervals(const Function& function) {
+ const Code& code = Code::Handle(function.CurrentCode());
+ const Array& intervals = Array::Handle(code.GetInlinedIntervals());
+ if (intervals.IsNull() || (intervals.Length() == 0)) return;
+ Smi& start = Smi::Handle();
+ GrowableArray<Function*> inlined_functions;
+ for (intptr_t i = 0; i < intervals.Length(); i += Code::kInlIntNumEntries) {
+ start ^= intervals.At(i + Code::kInlIntStart);
+ ASSERT(!start.IsNull());
+ if (start.IsNull()) continue;
+ code.GetInlinedFunctionsAt(start.Value(), &inlined_functions);
+ ASSERT(inlined_functions[inlined_functions.length() - 1]->raw() ==
+ function.raw());
+ }
+}
+#endif
+
+
static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
const Function& function,
bool optimized,
@@ -1059,6 +1086,9 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline,
DisassembleCode(function, true);
ISL_Print("*** END CODE\n");
}
+#if defined(DEBUG)
+ CheckInliningIntervals(function);
+#endif
return Error::null();
} else {
Thread* const thread = Thread::Current();
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698