Index: runtime/vm/stub_code_mips_test.cc |
=================================================================== |
--- runtime/vm/stub_code_mips_test.cc (revision 20788) |
+++ runtime/vm/stub_code_mips_test.cc (working copy) |
@@ -39,7 +39,23 @@ |
// Test calls to stub code which calls into the runtime. |
static void GenerateCallToCallRuntimeStub(Assembler* assembler, |
int value1, int value2) { |
- UNIMPLEMENTED(); |
+ const int argc = 2; |
+ const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1)); |
+ const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2)); |
+ const Object& result = Object::ZoneHandle(); |
+ const Context& context = Context::ZoneHandle(Context::New(0, Heap::kOld)); |
+ ASSERT(context.isolate() == Isolate::Current()); |
+ __ EnterDartFrame(0); |
+ __ LoadObject(CTX, context); |
+ __ PushObject(result); // Push Null object for return value. |
+ __ PushObject(smi1); // Push argument 1 smi1. |
+ __ PushObject(smi2); // Push argument 2 smi2. |
+ ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc); |
+ __ CallRuntime(kTestSmiSubRuntimeEntry); // Call SmiSub runtime func. |
+ __ addiu(SP, SP, Immediate(argc * kWordSize)); |
+ __ Pop(V0); // Pop return value from return slot. |
+ __ LeaveDartFrame(); |
+ __ Ret(); |
} |
@@ -64,7 +80,15 @@ |
static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler, |
int value1, |
int value2) { |
- UNIMPLEMENTED(); |
+ const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1)); |
+ const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2)); |
+ __ EnterDartFrame(0); |
+ __ ReserveAlignedFrameSpace(0); |
+ __ LoadObject(A0, smi1); // Set up argument 1 smi1. |
+ __ LoadObject(A1, smi2); // Set up argument 2 smi2. |
+ __ CallRuntime(kTestLeafSmiAddRuntimeEntry); // Call SmiAdd runtime func. |
+ __ LeaveDartFrame(); |
+ __ Ret(); // Return value is in R0. |
} |