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

Unified Diff: runtime/vm/kernel_binary_flowgraph.cc

Issue 2944433003: [kernel] Add TokenPosition to AllocateObject, fix some cc tests (Closed)
Patch Set: Created 3 years, 6 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
Index: runtime/vm/kernel_binary_flowgraph.cc
diff --git a/runtime/vm/kernel_binary_flowgraph.cc b/runtime/vm/kernel_binary_flowgraph.cc
index 33c85883c08dca768e4f896411db799a63c561f3..499b4b09e3f8ed617d2a7c0d63a9d2e98b3131da 100644
--- a/runtime/vm/kernel_binary_flowgraph.cc
+++ b/runtime/vm/kernel_binary_flowgraph.cc
@@ -4578,9 +4578,10 @@ Fragment StreamingFlowGraphBuilder::StrictCompare(Token::Kind kind,
return flow_graph_builder_->StrictCompare(kind, number_check);
}
-Fragment StreamingFlowGraphBuilder::AllocateObject(const dart::Class& klass,
+Fragment StreamingFlowGraphBuilder::AllocateObject(TokenPosition position,
+ const dart::Class& klass,
intptr_t argument_count) {
- return flow_graph_builder_->AllocateObject(klass, argument_count);
+ return flow_graph_builder_->AllocateObject(position, klass, argument_count);
}
Fragment StreamingFlowGraphBuilder::InstanceCall(TokenPosition position,
@@ -5219,9 +5220,9 @@ Fragment StreamingFlowGraphBuilder::BuildStaticInvocation(bool is_const,
PeekArgumentsInstantiatedType(klass);
instructions += TranslateInstantiatedTypeArguments(type_arguments);
instructions += PushArgument();
- instructions += AllocateObject(klass, 1);
+ instructions += AllocateObject(position, klass, 1);
} else {
- instructions += AllocateObject(klass, 0);
+ instructions += AllocateObject(position, klass, 0);
}
instance_variable = MakeTemporary();
@@ -5339,9 +5340,9 @@ Fragment StreamingFlowGraphBuilder::BuildConstructorInvocation(
}
instructions += PushArgument();
- instructions += AllocateObject(klass, 1);
+ instructions += AllocateObject(position, klass, 1);
} else {
- instructions += AllocateObject(klass, 0);
+ instructions += AllocateObject(position, klass, 0);
}
LocalVariable* variable = MakeTemporary();
@@ -5918,7 +5919,7 @@ Fragment StreamingFlowGraphBuilder::BuildAssertStatement() {
// Create instance of _AssertionError
Fragment otherwise_fragment(otherwise);
- otherwise_fragment += AllocateObject(klass, 0);
+ otherwise_fragment += AllocateObject(TokenPosition::kNoSource, klass, 0);
LocalVariable* instance = MakeTemporary();
// Call _AssertionError._create constructor.
@@ -6238,7 +6239,7 @@ Fragment StreamingFlowGraphBuilder::BuildSwitchStatement() {
Heap::kOld);
// Create instance of _FallThroughError
- body_fragment += AllocateObject(klass, 0);
+ body_fragment += AllocateObject(TokenPosition::kNoSource, klass, 0);
Vyacheslav Egorov (Google) 2017/06/16 11:09:18 I guess this needs some informative position event
jensj 2017/06/16 11:39:07 I'll give parser.cc an extra look to see if I can
jensj 2017/06/16 11:55:33 Actually, this gives us the excellent exception ``
LocalVariable* instance = MakeTemporary();
// Call _FallThroughError._create constructor.

Powered by Google App Engine
This is Rietveld 408576698