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

Unified Diff: pkg/kernel/lib/transformations/continuation.dart

Issue 2690873005: Enable causal stacktrace in kernel (Closed)
Patch Set: Created 3 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 | « no previous file | runtime/vm/kernel_to_il.cc » ('j') | runtime/vm/kernel_to_il.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/transformations/continuation.dart
diff --git a/pkg/kernel/lib/transformations/continuation.dart b/pkg/kernel/lib/transformations/continuation.dart
index 112ea43b8274b3f3e182cc2e99039834e589fcb6..6c0f0f10c721a957e9448e91ccdd2c38cc86842b 100644
--- a/pkg/kernel/lib/transformations/continuation.dart
+++ b/pkg/kernel/lib/transformations/continuation.dart
@@ -198,6 +198,8 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase {
new VariableDeclaration(":async_op_then");
final VariableDeclaration catchErrorContinuationVariable =
new VariableDeclaration(":async_op_error");
+ final VariableDeclaration asyncStackTrace =
+ new VariableDeclaration(":async_stack_trace");
LabeledStatement labeledBody;
@@ -215,6 +217,9 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase {
// var :async_op_error;
statements.add(catchErrorContinuationVariable);
+ // var :async_stack_trace;
+ statements.add(asyncStackTrace);
+
// :async_op([:result, :exception, :stack_trace]) {
// modified <node.body>;
// }
@@ -258,6 +263,13 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase {
new VariableSet(
catchErrorContinuationVariable, boundCatchErrorClosure));
statements.add(catchErrorClosureVariableAssign);
+
+ // :async_stack_trace = _asyncStackTraceHelper();
kustermann 2017/02/14 14:45:53 nit: double space after =
jensj 2017/02/15 11:29:53 Done.
+ final boundAsyncStackTrace = new StaticInvocation(
+ helper.asyncStackTraceHelper, new Arguments.empty());
+ final asyncStackTraceVariableAssign = new ExpressionStatement(
+ new VariableSet(asyncStackTrace, boundAsyncStackTrace));
+ statements.add(asyncStackTraceVariableAssign);
}
Statement buildWrappedBody() {
@@ -874,6 +886,7 @@ class HelperNodes {
final Constructor streamIteratorConstructor;
final Procedure asyncThenWrapper;
final Procedure asyncErrorWrapper;
+ final Procedure asyncStackTraceHelper;
final Procedure awaitHelper;
final CoreTypes coreTypes;
@@ -891,6 +904,7 @@ class HelperNodes {
this.streamControllerConstructor,
this.asyncThenWrapper,
this.asyncErrorWrapper,
+ this.asyncStackTraceHelper,
this.awaitHelper,
this.coreTypes);
@@ -973,6 +987,7 @@ class HelperNodes {
findConstructor(streamControllerClass, ''),
findProcedure(asyncLibrary, '_asyncThenWrapperHelper'),
findProcedure(asyncLibrary, '_asyncErrorWrapperHelper'),
+ findProcedure(asyncLibrary, '_asyncStackTraceHelper'),
findProcedure(asyncLibrary, '_awaitHelper'),
new CoreTypes(program));
}
« no previous file with comments | « no previous file | runtime/vm/kernel_to_il.cc » ('j') | runtime/vm/kernel_to_il.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698