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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 1569213003: Eliminate phase parameter in constructors (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/dart_entry_test.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 2e451e1780721aad4d49a1dda2f7547ed1cdf363..dd929056af58256a31283c2b90763204a9d92ca4 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -2801,14 +2801,10 @@ Value* EffectGraphVisitor::BuildObjectAllocation(ConstructorCallNode* node) {
void EffectGraphVisitor::BuildConstructorCall(
ConstructorCallNode* node,
PushArgumentInstr* push_alloc_value) {
- Value* ctor_arg = Bind(new(Z) ConstantInstr(
- Smi::ZoneHandle(Z, Smi::New(Function::kCtorPhaseAll))));
- PushArgumentInstr* push_ctor_arg = PushArgument(ctor_arg);
ZoneGrowableArray<PushArgumentInstr*>* arguments =
new(Z) ZoneGrowableArray<PushArgumentInstr*>(2);
arguments->Add(push_alloc_value);
- arguments->Add(push_ctor_arg);
BuildPushArguments(*node->arguments(), arguments);
Do(new(Z) StaticCallInstr(node->token_pos(),
@@ -4100,12 +4096,11 @@ void EffectGraphVisitor::VisitSequenceNode(SequenceNode* node) {
if (Isolate::Current()->flags().type_checks() && is_top_level_sequence) {
const int num_params = function.NumParameters();
int pos = 0;
- if (function.IsGenerativeConstructor()) {
- // Skip type checking of receiver and phase for constructor functions.
- pos = 2;
- } else if (function.IsFactory() || function.IsDynamicFunction()) {
+ if (function.IsFactory() ||
+ function.IsDynamicFunction() ||
+ function.IsGenerativeConstructor()) {
// Skip type checking of type arguments for factory functions.
- // Skip type checking of receiver for instance functions.
+ // Skip type checking of receiver for instance functions and constructors.
pos = 1;
}
while (pos < num_params) {
« no previous file with comments | « runtime/vm/dart_entry_test.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698