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

Unified Diff: vm/stub_code_x64_test.cc

Issue 10592006: Rework leaf calls as just simple C calls with a signature and not the NativeArgumentDescriptor. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 6 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
« no previous file with comments | « vm/stub_code_x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/stub_code_x64_test.cc
===================================================================
--- vm/stub_code_x64_test.cc (revision 8859)
+++ vm/stub_code_x64_test.cc (working copy)
@@ -19,7 +19,7 @@
namespace dart {
DECLARE_RUNTIME_ENTRY(TestSmiSub);
-DECLARE_LEAF_RUNTIME_ENTRY(TestLeafSmiAdd);
+DECLARE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, RawObject*, RawObject*);
static Function* CreateFunction(const char* name) {
@@ -76,23 +76,17 @@
static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
int value1,
int value2) {
- 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));
- ASSERT(context.isolate() == Isolate::Current());
__ enter(Immediate(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(kTestLeafSmiAddRuntimeEntry.argument_count() == argc);
+ __ ReserveAlignedFrameSpace(2 * kWordSize);
+ __ LoadObject(RAX, smi1);
+ __ movq(Address(RSP, 0), EAX); // Push argument 1 smi1.
+ __ LoadObject(RAX, smi2);
+ __ movq(Address(RSP, kWordSize), EAX); // Push argument 2 smi2.
__ CallRuntime(kTestLeafSmiAddRuntimeEntry); // Call SmiAdd runtime func.
- __ AddImmediate(RSP, Immediate(argc * kWordSize));
- __ popq(RAX); // Pop return value from return slot.
__ leave();
- __ ret();
+ __ ret(); // Return value is in RAX.
}
« no previous file with comments | « vm/stub_code_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698