| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <math.h> // for isnan. | 5 #include <math.h> // for isnan. |
| 6 #include <setjmp.h> | 6 #include <setjmp.h> |
| 7 #include <stdlib.h> | 7 #include <stdlib.h> |
| 8 | 8 |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #if defined(TARGET_ARCH_ARM) | 10 #if defined(TARGET_ARCH_ARM) |
| (...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 if (!setjmp(buffer.buffer_)) { | 1480 if (!setjmp(buffer.buffer_)) { |
| 1481 int32_t saved_lr = get_register(LR); | 1481 int32_t saved_lr = get_register(LR); |
| 1482 Redirection* redirection = Redirection::FromSvcInstruction(instr); | 1482 Redirection* redirection = Redirection::FromSvcInstruction(instr); |
| 1483 uword external = redirection->external_function(); | 1483 uword external = redirection->external_function(); |
| 1484 if (FLAG_trace_sim) { | 1484 if (FLAG_trace_sim) { |
| 1485 OS::Print("Call to host function at 0x%"Pd"\n", external); | 1485 OS::Print("Call to host function at 0x%"Pd"\n", external); |
| 1486 } | 1486 } |
| 1487 | 1487 |
| 1488 if ((redirection->call_kind() == kRuntimeCall) || | 1488 if ((redirection->call_kind() == kRuntimeCall) || |
| 1489 (redirection->call_kind() == kNativeCall)) { | 1489 (redirection->call_kind() == kNativeCall)) { |
| 1490 // The top_exit_frame_info of the current isolate points to the top of | |
| 1491 // the simulator stack. | |
| 1492 ASSERT((StackTop() - Isolate::Current()->top_exit_frame_info()) < | |
| 1493 Isolate::GetSpecifiedStackSize()); | |
| 1494 // Set the top_exit_frame_info of this simulator to the native stack. | 1490 // Set the top_exit_frame_info of this simulator to the native stack. |
| 1495 set_top_exit_frame_info(reinterpret_cast<uword>(&buffer)); | 1491 set_top_exit_frame_info(reinterpret_cast<uword>(&buffer)); |
| 1496 } | 1492 } |
| 1497 if (redirection->call_kind() == kRuntimeCall) { | 1493 if (redirection->call_kind() == kRuntimeCall) { |
| 1498 NativeArguments arguments; | 1494 NativeArguments arguments; |
| 1499 ASSERT(sizeof(NativeArguments) == 4*kWordSize); | 1495 ASSERT(sizeof(NativeArguments) == 4*kWordSize); |
| 1500 arguments.isolate_ = reinterpret_cast<Isolate*>(get_register(R0)); | 1496 arguments.isolate_ = reinterpret_cast<Isolate*>(get_register(R0)); |
| 1501 arguments.argc_tag_ = get_register(R1); | 1497 arguments.argc_tag_ = get_register(R1); |
| 1502 arguments.argv_ = reinterpret_cast<RawObject*(*)[]>(get_register(R2)); | 1498 arguments.argv_ = reinterpret_cast<RawObject*(*)[]>(get_register(R2)); |
| 1503 arguments.retval_ = reinterpret_cast<RawObject**>(get_register(R3)); | 1499 arguments.retval_ = reinterpret_cast<RawObject**>(get_register(R3)); |
| (...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3118 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 3114 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
| 3119 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3115 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
| 3120 buf->Longjmp(); | 3116 buf->Longjmp(); |
| 3121 } | 3117 } |
| 3122 | 3118 |
| 3123 } // namespace dart | 3119 } // namespace dart |
| 3124 | 3120 |
| 3125 #endif // !defined(HOST_ARCH_ARM) | 3121 #endif // !defined(HOST_ARCH_ARM) |
| 3126 | 3122 |
| 3127 #endif // defined TARGET_ARCH_ARM | 3123 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |