| Index: runtime/vm/disassembler.cc
|
| diff --git a/runtime/vm/disassembler.cc b/runtime/vm/disassembler.cc
|
| index b2d20e8698838ab0c7ce464d257ad4455b9f63d8..142f42ee8edd555b65df6c18d70d43625231f77a 100644
|
| --- a/runtime/vm/disassembler.cc
|
| +++ b/runtime/vm/disassembler.cc
|
| @@ -20,6 +20,7 @@ namespace dart {
|
| #ifndef PRODUCT
|
|
|
| DECLARE_FLAG(bool, trace_inlining_intervals);
|
| +DEFINE_FLAG(bool, trace_source_positions, false, "Source position diagnostics");
|
|
|
| void DisassembleToStdout::ConsumeInstruction(const Code& code,
|
| char* hex_buffer,
|
| @@ -112,7 +113,8 @@ void Disassembler::Disassemble(uword start,
|
| char human_buffer[kUserReadableBufferSize]; // Human-readable instruction.
|
| uword pc = start;
|
| intptr_t comment_finger = 0;
|
| - GrowableArray<Function*> inlined_functions;
|
| + GrowableArray<const Function*> inlined_functions;
|
| + GrowableArray<TokenPosition> token_positions;
|
| while (pc < end) {
|
| const intptr_t offset = pc - start;
|
| const intptr_t old_comment_finger = comment_finger;
|
| @@ -127,10 +129,10 @@ void Disassembler::Disassemble(uword start,
|
| char str[4000];
|
| BufferFormatter f(str, sizeof(str));
|
| // Comment emitted, emit inlining information.
|
| - code.GetInlinedFunctionsAt(offset, &inlined_functions);
|
| + code.GetInlinedFunctionsAt(offset, &inlined_functions, &token_positions);
|
| // Skip top scope function printing (last entry in 'inlined_functions').
|
| bool first = true;
|
| - for (intptr_t i = inlined_functions.length() - 2; i >= 0; i--) {
|
| + for (intptr_t i = 1; i < inlined_functions.length(); i++) {
|
| const char* name = inlined_functions[i]->ToQualifiedCString();
|
| if (first) {
|
| f.Print(" ;; Inlined [%s", name);
|
| @@ -290,7 +292,10 @@ void Disassembler::DisassembleCodeHelper(const char* function_fullname,
|
| THR_Print("}\n");
|
| }
|
| if (optimized && FLAG_trace_inlining_intervals) {
|
| - code.DumpInlinedIntervals();
|
| + code.DumpInlineIntervals();
|
| + }
|
| + if (FLAG_trace_source_positions) {
|
| + code.DumpSourcePositions();
|
| }
|
| }
|
|
|
|
|