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

Unified Diff: runtime/vm/parser.cc

Issue 18465007: Generate better debugging info for actor phase check (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | tools/coverage.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 24805)
+++ runtime/vm/parser.cc (working copy)
@@ -2349,6 +2349,7 @@
}
}
OpenBlock(); // Block to collect constructor body nodes.
+ intptr_t body_pos = TokenPos();
// Insert the implicit super call to the super constructor body.
if (super_call != NULL) {
@@ -2356,15 +2357,15 @@
const Function& super_ctor = super_call->function();
// Patch the initializer call so it only executes the super initializer.
initializer_args->SetNodeAt(1,
- new LiteralNode(TokenPos(),
+ new LiteralNode(body_pos,
Smi::ZoneHandle(Smi::New(Function::kCtorPhaseInit))));
- ArgumentListNode* super_call_args = new ArgumentListNode(TokenPos());
+ ArgumentListNode* super_call_args = new ArgumentListNode(body_pos);
// First argument is the receiver.
- super_call_args->Add(new LoadLocalNode(TokenPos(), receiver));
+ super_call_args->Add(new LoadLocalNode(body_pos, receiver));
// Second argument is the construction phase argument.
AstNode* phase_parameter =
- new LiteralNode(TokenPos(),
+ new LiteralNode(body_pos,
Smi::ZoneHandle(Smi::New(Function::kCtorPhaseBody)));
super_call_args->Add(phase_parameter);
super_call_args->set_names(initializer_args->names());
@@ -2372,15 +2373,15 @@
AstNode* arg = initializer_args->NodeAt(i);
if (arg->IsLiteralNode()) {
LiteralNode* lit = arg->AsLiteralNode();
- super_call_args->Add(new LiteralNode(TokenPos(), lit->literal()));
+ super_call_args->Add(new LiteralNode(body_pos, lit->literal()));
} else {
ASSERT(arg->IsLoadLocalNode() || arg->IsStoreLocalNode());
if (arg->IsLoadLocalNode()) {
const LocalVariable& temp = arg->AsLoadLocalNode()->local();
- super_call_args->Add(new LoadLocalNode(TokenPos(), &temp));
+ super_call_args->Add(new LoadLocalNode(body_pos, &temp));
} else if (arg->IsStoreLocalNode()) {
const LocalVariable& temp = arg->AsStoreLocalNode()->local();
- super_call_args->Add(new LoadLocalNode(TokenPos(), &temp));
+ super_call_args->Add(new LoadLocalNode(body_pos, &temp));
}
}
}
@@ -2388,7 +2389,7 @@
super_call_args->names(),
NULL));
current_block_->statements->Add(
- new StaticCallNode(TokenPos(), super_ctor, super_call_args));
+ new StaticCallNode(body_pos, super_ctor, super_call_args));
}
if (CurrentToken() == Token::kLBRACE) {
@@ -2410,19 +2411,19 @@
if (ctor_block->length() > 0) {
// Generate guard around the constructor body code.
LocalVariable* phase_param = LookupPhaseParameter();
- AstNode* phase_value = new LoadLocalNode(TokenPos(), phase_param);
+ AstNode* phase_value = new LoadLocalNode(body_pos, phase_param);
AstNode* phase_check =
- new BinaryOpNode(TokenPos(), Token::kBIT_AND,
+ new BinaryOpNode(body_pos, Token::kBIT_AND,
phase_value,
- new LiteralNode(TokenPos(),
+ new LiteralNode(body_pos,
Smi::ZoneHandle(Smi::New(Function::kCtorPhaseBody))));
AstNode* comparison =
- new ComparisonNode(TokenPos(), Token::kNE_STRICT,
+ new ComparisonNode(body_pos, Token::kNE_STRICT,
phase_check,
- new LiteralNode(TokenPos(),
+ new LiteralNode(body_pos,
Smi::ZoneHandle(Smi::New(0))));
AstNode* guarded_block_statements =
- new IfNode(TokenPos(), comparison, ctor_block, NULL);
+ new IfNode(body_pos, comparison, ctor_block, NULL);
current_block_->statements->Add(guarded_block_statements);
}
@@ -4880,6 +4881,8 @@
return from_scope->LookupVariable(Symbols::TypeArgumentsParameter(),
test_only);
}
+
+
LocalVariable* Parser::LookupPhaseParameter() {
const bool kTestOnly = false;
return current_block_->scope->LookupVariable(Symbols::PhaseParameter(),
« no previous file with comments | « no previous file | tools/coverage.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698