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

Unified Diff: runtime/vm/code_generator_ia32.cc

Issue 8440014: Two-phase constructors (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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/lib/isolate.cc ('k') | runtime/vm/dart_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator_ia32.cc
===================================================================
--- runtime/vm/code_generator_ia32.cc (revision 1098)
+++ runtime/vm/code_generator_ia32.cc (working copy)
@@ -2315,13 +2315,20 @@
if (IsResultNeeded(node)) {
__ pushl(EAX); // Set up return value from allocate.
}
- __ pushl(EAX); // First argument(this) for constructor call which follows.
+ // First argument(this) for constructor call which follows.
+ __ pushl(EAX);
+ // Second argument is the implicit constructor phase parameter.
+ // Run both the constructor initializer list and the constructor body.
+ __ PushObject(Smi::ZoneHandle(Smi::New(Function::kCtorPhaseAll)));
+
+
// Now setup rest of the arguments for the constructor call.
node->arguments()->Visit(this);
// Call the constructor.
- int num_args = node->arguments()->length() + 1; // +1 to include receiver.
+ // +2 to include implicit receiver and phase arguments.
+ int num_args = node->arguments()->length() + 2;
__ LoadObject(ECX, node->constructor());
__ LoadObject(EDX, ArgumentsDescriptor(num_args, node->arguments()->names()));
GenerateCall(node->token_index(), &StubCode::CallStaticFunctionLabel());
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/dart_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698