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

Unified Diff: runtime/vm/compiler.cc

Issue 2603383004: Sane asynchronous debugging and stack traces (Closed)
Patch Set: rebase Created 3 years, 11 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/bootstrap_natives.h ('k') | runtime/vm/debugger.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 fee4b89553a3717ade51339da924ae6c515c8232..2548c354bc785c4029a32337b05ff3ac7ea0b67c 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -549,6 +549,30 @@ void CompileParsedFunctionHelper::FinalizeCompilation(
function.set_usage_counter(INT_MIN);
}
+#if !defined(PRODUCT)
+ ZoneGrowableArray<TokenPosition>* await_token_positions =
+ flow_graph->await_token_positions();
+ if (await_token_positions != NULL) {
+ Smi& token_pos_value = Smi::Handle(zone);
+ if (await_token_positions->length() > 0) {
+ const Array& await_to_token_map = Array::Handle(
+ zone, Array::New(await_token_positions->length(), Heap::kOld));
+ ASSERT(!await_to_token_map.IsNull());
+ for (intptr_t i = 0; i < await_token_positions->length(); i++) {
+ TokenPosition token_pos = await_token_positions->At(i).FromSynthetic();
+ if (!token_pos.IsReal()) {
+ // Some async machinary uses kNoSourcePos. Skip these.
+ continue;
+ }
+ ASSERT(token_pos.IsReal());
+ token_pos_value = Smi::New(token_pos.value());
+ await_to_token_map.SetAt(i, token_pos_value);
+ }
+ code.SetAwaitTokenPositions(await_to_token_map);
+ }
+ }
+#endif // !defined(PRODUCT)
+
const Array& intervals = graph_compiler->inlined_code_intervals();
INC_STAT(thread(), total_code_size, intervals.Length() * sizeof(uword));
code.SetInlinedIntervals(intervals);
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/debugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698