Index: src/arm/simulator-arm.cc |
=================================================================== |
--- src/arm/simulator-arm.cc (revision 6858) |
+++ src/arm/simulator-arm.cc (working copy) |
@@ -1531,8 +1531,12 @@ |
// This signature supports direct call in to API function native callback |
// (refer to InvocationCallback in v8.h). |
-typedef v8::Handle<v8::Value> (*SimulatorRuntimeApiCall)(int32_t arg0); |
+typedef v8::Handle<v8::Value> (*SimulatorRuntimeDirectApiCall)(int32_t arg0); |
+// This signature supports direct call to accessor getter callback. |
+typedef v8::Handle<v8::Value> (*SimulatorRuntimeDirectGetterCall)(int32_t arg0, |
+ int32_t arg1); |
+ |
// Software interrupt instructions are used by the simulator to call into the |
// C-based V8 runtime. |
void Simulator::SoftwareInterrupt(Instruction* instr) { |
@@ -1572,14 +1576,12 @@ |
CHECK(stack_aligned); |
double result = target(arg0, arg1, arg2, arg3); |
SetFpResult(result); |
- } else if (redirection->type() == ExternalReference::DIRECT_CALL) { |
- SimulatorRuntimeApiCall target = |
- reinterpret_cast<SimulatorRuntimeApiCall>(external); |
+ } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) { |
+ SimulatorRuntimeDirectApiCall target = |
+ reinterpret_cast<SimulatorRuntimeDirectApiCall>(external); |
if (::v8::internal::FLAG_trace_sim || !stack_aligned) { |
- PrintF( |
- "Call to host function at %p args %08x", |
- FUNCTION_ADDR(target), |
- arg0); |
+ PrintF("Call to host function at %p args %08x", |
+ FUNCTION_ADDR(target), arg0); |
if (!stack_aligned) { |
PrintF(" with unaligned stack %08x\n", get_register(sp)); |
} |
@@ -1591,6 +1593,23 @@ |
PrintF("Returned %p\n", reinterpret_cast<void *>(*result)); |
} |
set_register(r0, (int32_t) *result); |
+ } else if (redirection->type() == ExternalReference::DIRECT_GETTER_CALL) { |
+ SimulatorRuntimeDirectGetterCall target = |
+ reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external); |
+ if (::v8::internal::FLAG_trace_sim || !stack_aligned) { |
+ PrintF("Call to host function at %p args %08x %08x", |
+ FUNCTION_ADDR(target), arg0, arg1); |
+ if (!stack_aligned) { |
+ PrintF(" with unaligned stack %08x\n", get_register(sp)); |
+ } |
+ PrintF("\n"); |
+ } |
+ CHECK(stack_aligned); |
+ v8::Handle<v8::Value> result = target(arg0, arg1); |
+ if (::v8::internal::FLAG_trace_sim) { |
+ PrintF("Returned %p\n", reinterpret_cast<void *>(*result)); |
+ } |
+ set_register(r0, (int32_t) *result); |
} else { |
// builtin call. |
ASSERT(redirection->type() == ExternalReference::BUILTIN_CALL); |