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

Unified Diff: runtime/vm/simulator_arm.cc

Issue 12439005: Implement leaf runtime call stub on ARM and corresponding call redirection (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
« no previous file with comments | « runtime/vm/simulator_arm.h ('k') | runtime/vm/stub_code_arm_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_arm.cc
===================================================================
--- runtime/vm/simulator_arm.cc (revision 19723)
+++ runtime/vm/simulator_arm.cc (working copy)
@@ -1301,6 +1301,9 @@
// Calls into the Dart runtime are based on this interface.
typedef void (*SimulatorRuntimeCall)(NativeArguments arguments);
+// Calls to leaf Dart runtime functions are based on this interface.
+typedef int32_t (*SimulatorLeafRuntimeCall)(
+ int32_t r0, int32_t r1, int32_t r2, int32_t r3);
// Calls to native Dart functions are based on this interface.
typedef void (*SimulatorNativeCall)(NativeArguments* arguments);
@@ -1329,6 +1332,16 @@
SimulatorRuntimeCall target =
reinterpret_cast<SimulatorRuntimeCall>(external);
target(arguments);
+ set_register(R0, icount_); // Zap result register from void function.
+ } else if (redirection->call_kind() == kLeafRuntimeCall) {
+ int32_t r0 = get_register(R0);
+ int32_t r1 = get_register(R1);
+ int32_t r2 = get_register(R2);
+ int32_t r3 = get_register(R3);
+ SimulatorLeafRuntimeCall target =
+ reinterpret_cast<SimulatorLeafRuntimeCall>(external);
+ r0 = target(r0, r1, r2, r3);
+ set_register(R0, r0); // Set returned result from function.
} else {
ASSERT(redirection->call_kind() == kNativeCall);
NativeArguments* arguments;
@@ -1336,10 +1349,12 @@
SimulatorNativeCall target =
reinterpret_cast<SimulatorNativeCall>(external);
target(arguments);
+ set_register(R0, icount_); // Zap result register from void function.
}
// Zap caller-saved registers, since the actual runtime call could have
// used them.
+ set_register(R1, icount_);
set_register(R2, icount_);
set_register(R3, icount_);
set_register(IP, icount_);
@@ -1355,9 +1370,7 @@
}
#endif // VFPv3_D32
- // Zap result register pair R0:R1 and return.
- set_register(R0, icount_);
- set_register(R1, icount_);
+ // Return.
set_pc(saved_lr);
}
« no previous file with comments | « runtime/vm/simulator_arm.h ('k') | runtime/vm/stub_code_arm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698