| Index: src/arm/simulator-arm.cc
|
| diff --git a/src/arm/simulator-arm.cc b/src/arm/simulator-arm.cc
|
| index 790b48a0c563974e948cad4e456dffd750c38ca5..c9db167b0e66ff644a3aa09b7df7c54dfa23c792 100644
|
| --- a/src/arm/simulator-arm.cc
|
| +++ b/src/arm/simulator-arm.cc
|
| @@ -1628,10 +1628,13 @@ typedef double (*SimulatorRuntimeFPIntCall)(double darg0, int32_t arg0);
|
| // This signature supports direct call in to API function native callback
|
| // (refer to InvocationCallback in v8.h).
|
| typedef v8::Handle<v8::Value> (*SimulatorRuntimeDirectApiCall)(int32_t arg0);
|
| +typedef void (*SimulatorRuntimeDirectApiCallNew)(int32_t arg0);
|
|
|
| // This signature supports direct call to accessor getter callback.
|
| typedef v8::Handle<v8::Value> (*SimulatorRuntimeDirectGetterCall)(int32_t arg0,
|
| int32_t arg1);
|
| +typedef void (*SimulatorRuntimeDirectGetterCallNew)(int32_t arg0,
|
| + int32_t arg1);
|
|
|
| // Software interrupt instructions are used by the simulator to call into the
|
| // C-based V8 runtime.
|
| @@ -1770,40 +1773,56 @@ void Simulator::SoftwareInterrupt(Instruction* instr) {
|
| break;
|
| }
|
| }
|
| - } else if (redirection->type() == ExternalReference::DIRECT_API_CALL) {
|
| - SimulatorRuntimeDirectApiCall target =
|
| - reinterpret_cast<SimulatorRuntimeDirectApiCall>(external);
|
| + } else if (
|
| + redirection->type() == ExternalReference::DIRECT_API_CALL ||
|
| + redirection->type() == ExternalReference::DIRECT_API_CALL_NEW) {
|
| if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
|
| PrintF("Call to host function at %p args %08x",
|
| - FUNCTION_ADDR(target), arg0);
|
| + reinterpret_cast<void*>(external), arg0);
|
| if (!stack_aligned) {
|
| PrintF(" with unaligned stack %08x\n", get_register(sp));
|
| }
|
| PrintF("\n");
|
| }
|
| CHECK(stack_aligned);
|
| - v8::Handle<v8::Value> result = target(arg0);
|
| - if (::v8::internal::FLAG_trace_sim) {
|
| - PrintF("Returned %p\n", reinterpret_cast<void *>(*result));
|
| + if (redirection->type() == ExternalReference::DIRECT_API_CALL) {
|
| + SimulatorRuntimeDirectApiCall target =
|
| + reinterpret_cast<SimulatorRuntimeDirectApiCall>(external);
|
| + v8::Handle<v8::Value> result = target(arg0);
|
| + if (::v8::internal::FLAG_trace_sim) {
|
| + PrintF("Returned %p\n", reinterpret_cast<void *>(*result));
|
| + }
|
| + set_register(r0, reinterpret_cast<int32_t>(*result));
|
| + } else {
|
| + SimulatorRuntimeDirectApiCallNew target =
|
| + reinterpret_cast<SimulatorRuntimeDirectApiCallNew>(external);
|
| + target(arg0);
|
| }
|
| - set_register(r0, reinterpret_cast<int32_t>(*result));
|
| - } else if (redirection->type() == ExternalReference::DIRECT_GETTER_CALL) {
|
| - SimulatorRuntimeDirectGetterCall target =
|
| - reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external);
|
| + } else if (
|
| + redirection->type() == ExternalReference::DIRECT_GETTER_CALL ||
|
| + redirection->type() == ExternalReference::DIRECT_GETTER_CALL_NEW) {
|
| if (::v8::internal::FLAG_trace_sim || !stack_aligned) {
|
| PrintF("Call to host function at %p args %08x %08x",
|
| - FUNCTION_ADDR(target), arg0, arg1);
|
| + reinterpret_cast<void*>(external), 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));
|
| + if (redirection->type() == ExternalReference::DIRECT_GETTER_CALL) {
|
| + SimulatorRuntimeDirectGetterCall target =
|
| + reinterpret_cast<SimulatorRuntimeDirectGetterCall>(external);
|
| + 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, reinterpret_cast<int32_t>(*result));
|
| + } else {
|
| + SimulatorRuntimeDirectGetterCallNew target =
|
| + reinterpret_cast<SimulatorRuntimeDirectGetterCallNew>(external);
|
| + target(arg0, arg1);
|
| }
|
| - set_register(r0, reinterpret_cast<int32_t>(*result));
|
| } else {
|
| // builtin call.
|
| ASSERT(redirection->type() == ExternalReference::BUILTIN_CALL);
|
|
|