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

Unified Diff: vm/stub_code_ia32.cc

Issue 8965071: Push raw_null instead of smi 0 in all places were we setup the return value location before calli... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years 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 | vm/stub_code_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/stub_code_ia32.cc
===================================================================
--- vm/stub_code_ia32.cc (revision 2842)
+++ vm/stub_code_ia32.cc (working copy)
@@ -420,8 +420,7 @@
__ pushl(ECX); // Preserve ic-data array.
// First resolve the function to get the function object.
- // Setup space for return value on stack by pushing smi 0.
- __ pushl(Immediate(0));
+ __ pushl(raw_null); // Setup space on stack for return value.
__ pushl(EAX); // Push receiver.
__ CallRuntimeFromStub(kResolveCompileInstanceFunctionRuntimeEntry);
__ popl(EAX); // Remove receiver pushed earlier.
@@ -456,7 +455,7 @@
__ pushl(EDX); // Preserve ic-data array.
__ pushl(EDI); // Preserve arguments descriptor array.
- __ pushl(Immediate(0));
+ __ pushl(raw_null); // Setup space on stack for return value.
__ pushl(EAX); // Push receiver.
__ pushl(EDX); // Ic-data array.
__ CallRuntimeFromStub(kResolveImplicitClosureFunctionRuntimeEntry);
@@ -491,7 +490,7 @@
__ pushl(EDX); // Preserve ic-data array.
__ pushl(EDI); // Preserve arguments descriptor array.
- __ pushl(Immediate(0));
+ __ pushl(raw_null); // Setup space on stack for return value.
__ pushl(EAX); // Push receiver.
__ pushl(EDX); // Ic-data array.
__ CallRuntimeFromStub(kResolveImplicitClosureThroughGetterRuntimeEntry);
@@ -510,7 +509,7 @@
// ECX: Closure object.
// EDI: Arguments descriptor array.
- __ pushl(Immediate(0)); // Result from invoking Closure.
+ __ pushl(raw_null); // Setup space on stack for result from invoking Closure.
__ pushl(ECX); // Closure object.
__ pushl(EDI); // Arguments descriptor.
__ movl(EDI, FieldAddress(EDI, Array::data_offset()));
@@ -546,8 +545,7 @@
// ECX: raw_null.
// EDI: argument descriptor array.
- // Setup space for return value on stack by pushing smi 0.
- __ pushl(Immediate(0)); // Result from noSuchMethod.
+ __ pushl(raw_null); // Setup space on stack for result from noSuchMethod.
__ pushl(EAX); // Receiver.
__ pushl(EDX); // IC-data array.
__ pushl(EDI); // Argument descriptor array.
@@ -702,7 +700,7 @@
// into the runtime.
__ Bind(&slow_case);
__ EnterFrame(0);
- __ pushl(raw_null); // Push Null object for return value.
+ __ pushl(raw_null); // Setup space on stack for return value.
__ pushl(EDX); // Array length as Smi.
__ pushl(ECX); // Element type.
__ pushl(raw_null); // Null instantiator.
@@ -794,8 +792,7 @@
// calling into the runtime.
__ EnterFrame(0);
- // Setup space for return value on stack by pushing smi 0.
- __ pushl(Immediate(0)); // Result from reporting the error.
+ __ pushl(raw_null); // Setup space on stack for result from error reporting.
__ pushl(EDI); // Non-closure object.
// Total number of args is the first Smi in args descriptor array (EDX).
__ movl(EDI, FieldAddress(EDX, Array::data_offset())); // Load num_args.
@@ -938,6 +935,8 @@
// EAX: new allocated RawContext object.
// EBX and EDX are destroyed.
void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
+ const Immediate raw_null =
+ Immediate(reinterpret_cast<intptr_t>(Object::null()));
if (FLAG_inline_alloc) {
const Class& context_class = Class::ZoneHandle(Object::context_class());
Label slow_case;
@@ -1024,8 +1023,7 @@
}
// Create a stub frame.
__ EnterFrame(0);
- const Context& new_context = Context::ZoneHandle();
- __ PushObject(new_context); // Push Null context for return value.
+ __ pushl(raw_null); // Setup space on stack for return value.
__ SmiTag(EDX);
__ pushl(EDX);
__ CallRuntimeFromStub(kAllocateContextRuntimeEntry); // Allocate context.
@@ -1205,8 +1203,7 @@
}
// Create a stub frame.
__ EnterFrame(0);
- const Object& new_object = Object::ZoneHandle();
- __ PushObject(new_object); // Push Null object for return value.
+ __ pushl(raw_null); // Setup space on stack for return value.
__ PushObject(cls); // Push class of object to be allocated.
if (is_cls_parameterized) {
__ pushl(EAX); // Push type arguments of object to be allocated.
@@ -1354,8 +1351,7 @@
}
// Create a stub frame.
__ EnterFrame(0);
- const Closure& new_closure = Closure::ZoneHandle();
- __ PushObject(new_closure); // Push Null closure for return value.
+ __ pushl(raw_null); // Setup space on stack for return value.
__ PushObject(func);
if (is_implicit_static_closure) {
__ CallRuntimeFromStub(kAllocateImplicitStaticClosureRuntimeEntry);
@@ -1408,13 +1404,14 @@
// noSuchMethod(InvocationMirror call).
// Also, the class NoSuchMethodException has to be modified accordingly.
// Total number of args is the first Smi in args descriptor array (EDX).
+ const Immediate raw_null =
+ Immediate(reinterpret_cast<intptr_t>(Object::null()));
__ movl(EDI, FieldAddress(EDX, Array::data_offset()));
__ SmiUntag(EDI);
__ movl(EAX, Address(EBP, EDI, TIMES_4, kWordSize)); // Get receiver.
__ EnterFrame(0);
- // Setup space for return value on stack by pushing smi 0.
- __ pushl(Immediate(0)); // Result from noSuchMethod.
+ __ pushl(raw_null); // Setup space on stack for result from noSuchMethod.
__ pushl(EAX); // Receiver.
__ pushl(ECX); // IC data array.
__ pushl(EDX); // Arguments descriptor array.
@@ -1532,10 +1529,9 @@
__ movl(EAX, FieldAddress(EDX, Array::data_offset()));
__ leal(EAX, Address(ESP, EAX, TIMES_2, 0)); // EAX is Smi.
__ EnterFrame(0);
- // Setup space for return value on stack by pushing smi 0.
__ pushl(EDX); // Preserve arguments array.
__ pushl(ECX); // Preserve IC data array
- __ pushl(Immediate(0)); // Space for result (target code object).
+ __ pushl(raw_null); // Setup space on stack for result (target code object).
__ movl(EDX, FieldAddress(EDX, Array::data_offset()));
// Push call arguments.
for (intptr_t i = 0; i < num_args; i++) {
« no previous file with comments | « no previous file | vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698