Index: runtime/vm/code_descriptors.cc |
diff --git a/runtime/vm/code_descriptors.cc b/runtime/vm/code_descriptors.cc |
index 7bccb7d2e3efc36dafaa4e52cc84c0c2fd4bf578..1eb2092a34609fc291a3ab2547e7c339caa4b343 100644 |
--- a/runtime/vm/code_descriptors.cc |
+++ b/runtime/vm/code_descriptors.cc |
@@ -315,6 +315,24 @@ RawCodeSourceMap* CodeSourceMapBuilder::Finalize() { |
} |
+void CodeSourceMapBuilder::WriteChangePosition(TokenPosition pos) { |
+ stream_.Write<uint8_t>(kChangePosition); |
+ if (FLAG_precompiled_mode) { |
+ intptr_t line = -1; |
+ intptr_t inline_id = buffered_inline_id_stack_.Last(); |
+ if (inline_id < inline_id_to_function_.length()) { |
+ const Function* function = inline_id_to_function_[inline_id]; |
+ Script& script = Script::Handle(function->script()); |
+ line = script.GetTokenLineUsingLineStarts(pos); |
+ } |
+ stream_.Write<int32_t>(static_cast<int32_t>(line)); |
+ } else { |
+ stream_.Write<int32_t>(static_cast<int32_t>(pos.value())); |
+ } |
+ written_token_pos_stack_.Last() = pos; |
+} |
+ |
+ |
void CodeSourceMapReader::GetInlinedFunctionsAt( |
int32_t pc_offset, |
GrowableArray<const Function*>* function_stack, |