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

Unified Diff: runtime/vm/compiler.cc

Issue 1740503002: Build CodeSourceMap for each code object (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 | « runtime/vm/code_descriptors.cc ('k') | 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 f1ba14b8912319b2be09ccdd26696e5ab8bb51cd..5d5be9a44306b5900749c8b5337106e77c1c8013 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -59,6 +59,7 @@ DEFINE_FLAG(bool, print_flow_graph_optimized, false,
"Print the IR flow graph when optimizing.");
DEFINE_FLAG(bool, print_ic_data_map, false,
"Print the deopt-id to ICData map in optimizing compiler.");
+DEFINE_FLAG(bool, print_code_source_map, false, "Print code source map.");
DEFINE_FLAG(bool, range_analysis, true, "Enable range analysis");
DEFINE_FLAG(bool, reorder_basic_blocks, true, "Enable basic-block reordering.");
DEFINE_FLAG(bool, trace_compiler, false, "Trace compiler operations.");
@@ -471,6 +472,18 @@ void CompileParsedFunctionHelper::FinalizeCompilation(
graph_compiler->FinalizeExceptionHandlers(code);
graph_compiler->FinalizeStaticCallTargetsTable(code);
+NOT_IN_PRODUCT(
+ // Set the code source map after setting the inlined information because
+ // we use the inlined information when printing.
+ const CodeSourceMap& code_source_map =
+ CodeSourceMap::Handle(
+ zone,
+ graph_compiler->code_source_map_builder()->Finalize());
+ code.set_code_source_map(code_source_map);
+ if (FLAG_print_code_source_map) {
+ CodeSourceMap::Dump(code_source_map, code, function);
+ }
+);
if (optimized()) {
// Installs code while at safepoint.
if (thread()->IsMutatorThread()) {
« no previous file with comments | « runtime/vm/code_descriptors.cc ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698