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

Unified Diff: runtime/vm/ast_transformer.cc

Issue 922603002: Fix another missing source location VM stacktrace with async code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast_transformer.cc
===================================================================
--- runtime/vm/ast_transformer.cc (revision 43679)
+++ runtime/vm/ast_transformer.cc (working copy)
@@ -136,10 +136,10 @@
AstNode* transformed_expr = Transform(node->expr());
preamble_->Add(new(Z) StoreLocalNode(
- Scanner::kNoSourcePos, result_param, transformed_expr));
+ node->token_pos(), result_param, transformed_expr));
LoadLocalNode* load_result_param = new(Z) LoadLocalNode(
- Scanner::kNoSourcePos, result_param);
+ node->token_pos(), result_param);
const Class& future_cls =
Class::ZoneHandle(Z, thread()->isolate()->object_store()->future_class());
@@ -150,7 +150,7 @@
LocalScope* is_not_future_scope = ChainNewScope(preamble_->scope());
SequenceNode* is_not_future_branch =
- new (Z) SequenceNode(Scanner::kNoSourcePos, is_not_future_scope);
+ new (Z) SequenceNode(node->token_pos(), is_not_future_scope);
hausner 2015/02/12 17:18:44 The reason why all these nodes that have no equiva
// if (:result_param is !Future) {
// :result_param = Future.value(:result_param);
@@ -158,21 +158,21 @@
const Function& value_ctor = Function::ZoneHandle(
Z, future_cls.LookupFunction(Symbols::FutureValue()));
ASSERT(!value_ctor.IsNull());
- ArgumentListNode* ctor_args = new (Z) ArgumentListNode(Scanner::kNoSourcePos);
- ctor_args->Add(new (Z) LoadLocalNode(Scanner::kNoSourcePos, result_param));
+ ArgumentListNode* ctor_args = new (Z) ArgumentListNode(node->token_pos());
+ ctor_args->Add(new (Z) LoadLocalNode(node->token_pos(), result_param));
ConstructorCallNode* ctor_call =
- new (Z) ConstructorCallNode(Scanner::kNoSourcePos,
+ new (Z) ConstructorCallNode(node->token_pos(),
TypeArguments::ZoneHandle(Z),
value_ctor,
ctor_args);
is_not_future_branch->Add(new (Z) StoreLocalNode(
- Scanner::kNoSourcePos, result_param, ctor_call));
+ node->token_pos(), result_param, ctor_call));
AstNode* is_not_future_test = new (Z) ComparisonNode(
- Scanner::kNoSourcePos,
+ node->token_pos(),
Token::kISNOT,
load_result_param,
- new (Z) TypeNode(Scanner::kNoSourcePos, future_type));
- preamble_->Add(new(Z) IfNode(Scanner::kNoSourcePos,
+ new (Z) TypeNode(node->token_pos(), future_type));
+ preamble_->Add(new(Z) IfNode(node->token_pos(),
is_not_future_test,
is_not_future_branch,
NULL));
@@ -180,13 +180,13 @@
AwaitMarkerNode* await_marker = new (Z) AwaitMarkerNode();
await_marker->set_scope(preamble_->scope());
preamble_->Add(await_marker);
- ArgumentListNode* args = new(Z) ArgumentListNode(Scanner::kNoSourcePos);
+ ArgumentListNode* args = new(Z) ArgumentListNode(node->token_pos());
- args->Add(new(Z) LoadLocalNode(Scanner::kNoSourcePos, async_op));
+ args->Add(new(Z) LoadLocalNode(node->token_pos(), async_op));
preamble_->Add(new (Z) StoreLocalNode(
- Scanner::kNoSourcePos,
+ node->token_pos(),
result_param,
- new(Z) InstanceCallNode(Scanner::kNoSourcePos,
+ new(Z) InstanceCallNode(node->token_pos(),
Florian Schneider 2015/02/13 10:25:27 To fix the bug it would be enough to record it her
load_result_param,
Symbols::FutureThen(),
args)));
@@ -195,19 +195,19 @@
Z, core_lib.LookupFunctionAllowPrivate(Symbols::AsyncCatchHelper()));
ASSERT(!async_catch_helper.IsNull());
ArgumentListNode* catch_helper_args = new (Z) ArgumentListNode(
- Scanner::kNoSourcePos);
+ node->token_pos());
InstanceGetterNode* catch_error_getter = new (Z) InstanceGetterNode(
- Scanner::kNoSourcePos,
+ node->token_pos(),
load_result_param,
Symbols::FutureCatchError());
catch_helper_args->Add(catch_error_getter);
catch_helper_args->Add(new (Z) LoadLocalNode(
- Scanner::kNoSourcePos, async_op));
+ node->token_pos(), async_op));
preamble_->Add(new (Z) StaticCallNode(
- Scanner::kNoSourcePos,
+ node->token_pos(),
async_catch_helper,
catch_helper_args));
- ReturnNode* continuation_return = new(Z) ReturnNode(Scanner::kNoSourcePos);
+ ReturnNode* continuation_return = new(Z) ReturnNode(node->token_pos());
continuation_return->set_return_type(ReturnNode::kContinuationTarget);
preamble_->Add(continuation_return);
@@ -219,35 +219,35 @@
LocalVariable* async_saved_try_ctx =
GetVariableInScope(preamble_->scope(), async_saved_try_ctx_name);
preamble_->Add(new (Z) StoreLocalNode(
- Scanner::kNoSourcePos,
+ node->token_pos(),
parsed_function_.saved_try_ctx(),
- new (Z) LoadLocalNode(Scanner::kNoSourcePos, async_saved_try_ctx)));
+ new (Z) LoadLocalNode(node->token_pos(), async_saved_try_ctx)));
}
LoadLocalNode* load_error_param = new (Z) LoadLocalNode(
- Scanner::kNoSourcePos, error_param);
+ node->token_pos(), error_param);
LoadLocalNode* load_stack_trace_param = new (Z) LoadLocalNode(
- Scanner::kNoSourcePos, stack_trace_param);
+ node->token_pos(), stack_trace_param);
SequenceNode* error_ne_null_branch = new (Z) SequenceNode(
- Scanner::kNoSourcePos, ChainNewScope(preamble_->scope()));
+ node->token_pos(), ChainNewScope(preamble_->scope()));
error_ne_null_branch->Add(new (Z) ThrowNode(
- Scanner::kNoSourcePos,
+ node->token_pos(),
load_error_param,
load_stack_trace_param));
preamble_->Add(new (Z) IfNode(
- Scanner::kNoSourcePos,
+ node->token_pos(),
new (Z) ComparisonNode(
- Scanner::kNoSourcePos,
+ node->token_pos(),
Token::kNE,
load_error_param,
- new (Z) LiteralNode(Scanner::kNoSourcePos,
+ new (Z) LiteralNode(node->token_pos(),
Object::null_instance())),
error_ne_null_branch,
NULL));
LocalVariable* result = AddToPreambleNewTempVar(new(Z) LoadLocalNode(
- Scanner::kNoSourcePos, result_param));
- result_ = new(Z) LoadLocalNode(Scanner::kNoSourcePos, result);
+ node->token_pos(), result_param));
hausner 2015/02/12 17:18:44 This is a good example of code that will most like
Florian Schneider 2015/02/13 10:21:06 I can only assign the tokenposition to the call in
+ result_ = new(Z) LoadLocalNode(node->token_pos(), result);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698