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

Unified Diff: runtime/vm/stub_code_mips_test.cc

Issue 13473010: Adds native/leaf runtime call stub and redirection on MIPS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 months 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
« runtime/vm/assembler_mips.h ('K') | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
}
« runtime/vm/assembler_mips.h ('K') | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698