Index: runtime/vm/stub_code_ia32.cc |
=================================================================== |
--- runtime/vm/stub_code_ia32.cc (revision 34916) |
+++ runtime/vm/stub_code_ia32.cc (working copy) |
@@ -700,82 +700,6 @@ |
} |
-// Input parameters: |
-// EDX: Arguments descriptor array. |
-// Note: The closure object is the first argument to the function being |
-// called, the stub accesses the closure from this location directly |
-// when trying to resolve the call. |
-// Uses EDI. |
-void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) { |
- const Immediate& raw_null = |
- Immediate(reinterpret_cast<intptr_t>(Object::null())); |
- |
- // Load num_args. |
- __ movl(EAX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); |
- // Load closure object in EDI. |
- __ movl(EDI, Address(ESP, EAX, TIMES_2, 0)); // EAX is a Smi. |
- |
- // Verify that EDI is a closure by checking its class. |
- Label not_closure; |
- __ cmpl(EDI, raw_null); |
- // Not a closure, but null object. |
- __ j(EQUAL, ¬_closure, Assembler::kNearJump); |
- __ testl(EDI, Immediate(kSmiTagMask)); |
- __ j(ZERO, ¬_closure, Assembler::kNearJump); // Not a closure, but a smi. |
- // Verify that the class of the object is a closure class by checking that |
- // class.signature_function() is not null. |
- __ LoadClass(EAX, EDI, ECX); |
- __ movl(EAX, FieldAddress(EAX, Class::signature_function_offset())); |
- __ cmpl(EAX, raw_null); |
- // Actual class is not a closure class. |
- __ j(EQUAL, ¬_closure, Assembler::kNearJump); |
- |
- // EAX is just the signature function. Load the actual closure function. |
- __ movl(EAX, FieldAddress(EDI, Closure::function_offset())); |
- |
- // Load closure context in CTX; note that CTX has already been preserved. |
- __ movl(CTX, FieldAddress(EDI, Closure::context_offset())); |
- |
- // EBX: Code (compiled code or lazy compile stub). |
- __ movl(EBX, FieldAddress(EAX, Function::code_offset())); |
- |
- // EAX: Function. |
- // EDX: Arguments descriptor array. |
- // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value). |
- __ xorl(ECX, ECX); |
- __ movl(EBX, FieldAddress(EBX, Code::instructions_offset())); |
- __ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); |
- __ jmp(EBX); |
- |
- __ Bind(¬_closure); |
- // Call runtime to attempt to resolve and invoke a call method on a |
- // non-closure object, passing the non-closure object and its arguments array, |
- // returning here. |
- // If no call method exists, throw a NoSuchMethodError. |
- // EDI: non-closure object. |
- // EDX: arguments descriptor array. |
- |
- // Create a stub frame as we are pushing some objects on the stack before |
- // calling into the runtime. |
- __ EnterStubFrame(); |
- |
- __ pushl(raw_null); // Setup space on stack for result from error reporting. |
- __ pushl(EDX); // Arguments descriptor. |
- // Load smi-tagged arguments array length, including the non-closure. |
- __ movl(EDX, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); |
- PushArgumentsArray(assembler); |
- |
- __ CallRuntime(kInvokeNonClosureRuntimeEntry, 2); |
- // Remove arguments. |
- __ Drop(2); |
- __ popl(EAX); // Get result into EAX. |
- |
- // Remove the stub frame as we are about to return. |
- __ LeaveFrame(); |
- __ ret(); |
-} |
- |
- |
// Called when invoking dart code from C++ (VM code). |
// Input parameters: |
// ESP : points to return address. |