| Index: runtime/vm/stub_code_arm.cc
|
| ===================================================================
|
| --- runtime/vm/stub_code_arm.cc (revision 34916)
|
| +++ runtime/vm/stub_code_arm.cc (working copy)
|
| @@ -729,83 +729,6 @@
|
| }
|
|
|
|
|
| -// Input parameters:
|
| -// LR: return address.
|
| -// SP: address of last argument.
|
| -// R4: 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.
|
| -void StubCode::GenerateCallClosureFunctionStub(Assembler* assembler) {
|
| - // Load num_args.
|
| - __ ldr(R0, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
|
| - __ sub(R0, R0, ShifterOperand(Smi::RawValue(1)));
|
| - // Load closure object in R1.
|
| - __ ldr(R1, Address(SP, R0, LSL, 1)); // R0 (num_args - 1) is a Smi.
|
| -
|
| - // Verify that R1 is a closure by checking its class.
|
| - Label not_closure;
|
| - __ LoadImmediate(R8, reinterpret_cast<intptr_t>(Object::null()));
|
| - __ cmp(R1, ShifterOperand(R8));
|
| - // Not a closure, but null object.
|
| - __ b(¬_closure, EQ);
|
| - __ tst(R1, ShifterOperand(kSmiTagMask));
|
| - __ b(¬_closure, EQ); // 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(R0, R1, R2);
|
| - __ ldr(R0, FieldAddress(R0, Class::signature_function_offset()));
|
| - __ cmp(R0, ShifterOperand(R8)); // R8 is raw null.
|
| - // Actual class is not a closure class.
|
| - __ b(¬_closure, EQ);
|
| -
|
| - // R0 is just the signature function. Load the actual closure function.
|
| - __ ldr(R0, FieldAddress(R1, Closure::function_offset()));
|
| -
|
| - // Load closure context in CTX; note that CTX has already been preserved.
|
| - __ ldr(CTX, FieldAddress(R1, Closure::context_offset()));
|
| -
|
| - // R4: Arguments descriptor.
|
| - // R0: Function.
|
| - __ ldr(R2, FieldAddress(R0, Function::code_offset()));
|
| -
|
| - // R2: code.
|
| - // R5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value).
|
| - __ LoadImmediate(R5, 0);
|
| - __ ldr(R2, FieldAddress(R2, Code::instructions_offset()));
|
| - __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
|
| - __ bx(R2);
|
| -
|
| - __ 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.
|
| - // R1: non-closure object.
|
| - // R4: arguments descriptor array.
|
| -
|
| - // Create a stub frame as we are pushing some objects on the stack before
|
| - // calling into the runtime.
|
| - __ EnterStubFrame();
|
| -
|
| - // Setup space on stack for result from error reporting.
|
| - __ PushList((1 << R4) | (1 << R8)); // Arguments descriptor and raw null.
|
| -
|
| - // Load smi-tagged arguments array length, including the non-closure.
|
| - __ ldr(R2, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
|
| - PushArgumentsArray(assembler);
|
| -
|
| - __ CallRuntime(kInvokeNonClosureRuntimeEntry, 2);
|
| - // Remove arguments.
|
| - __ Drop(2);
|
| - __ Pop(R0); // Get result into R0.
|
| -
|
| - // Remove the stub frame as we are about to return.
|
| - __ LeaveStubFrame();
|
| - __ Ret();
|
| -}
|
| -
|
| -
|
| // Called when invoking Dart code from C++ (VM code).
|
| // Input parameters:
|
| // LR : points to return address.
|
|
|