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

Unified Diff: runtime/vm/simulator_arm.cc

Issue 22303002: Auto create ApiLocalScope before calling native functions, this ensures that (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 4 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/simulator_mips.h » ('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 25822)
+++ runtime/vm/simulator_arm.cc (working copy)
@@ -1491,7 +1491,8 @@
typedef double (*SimulatorLeafFloatRuntimeCall)(double d0, double d1);
// Calls to native Dart functions are based on this interface.
-typedef void (*SimulatorNativeCall)(NativeArguments* arguments);
+typedef void (*SimulatorBootstrapNativeCall)(NativeArguments* arguments);
+typedef void (*SimulatorNativeCall)(NativeArguments* arguments, uword target);
void Simulator::SupervisorCall(Instr* instr) {
@@ -1509,6 +1510,7 @@
}
if ((redirection->call_kind() == kRuntimeCall) ||
+ (redirection->call_kind() == kBootstrapNativeCall) ||
(redirection->call_kind() == kNativeCall)) {
// Set the top_exit_frame_info of this simulator to the native stack.
set_top_exit_frame_info(reinterpret_cast<uword>(&buffer));
@@ -1548,13 +1550,21 @@
double d1 = get_dregister(D1);
d0 = target(d0, d1);
set_dregister(D0, d0);
+ } else if (redirection->call_kind() == kBootstrapNativeCall) {
+ NativeArguments* arguments;
+ arguments = reinterpret_cast<NativeArguments*>(get_register(R0));
+ SimulatorBootstrapNativeCall target =
+ reinterpret_cast<SimulatorBootstrapNativeCall>(external);
+ target(arguments);
+ set_register(R0, icount_); // Zap result register from void function.
} else {
ASSERT(redirection->call_kind() == kNativeCall);
NativeArguments* arguments;
arguments = reinterpret_cast<NativeArguments*>(get_register(R0));
+ uword target_func = get_register(R1);
SimulatorNativeCall target =
reinterpret_cast<SimulatorNativeCall>(external);
- target(arguments);
+ target(arguments, target_func);
set_register(R0, icount_); // Zap result register from void function.
}
set_top_exit_frame_info(0);
« no previous file with comments | « runtime/vm/simulator_arm.h ('k') | runtime/vm/simulator_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698