OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 <setjmp.h> // NOLINT | 5 #include <setjmp.h> // NOLINT |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 #if defined(TARGET_ARCH_ARM64) | 9 #if defined(TARGET_ARCH_ARM64) |
10 | 10 |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 } | 739 } |
740 | 740 |
741 | 741 |
742 Simulator::Simulator() { | 742 Simulator::Simulator() { |
743 // Setup simulator support first. Some of this information is needed to | 743 // Setup simulator support first. Some of this information is needed to |
744 // setup the architecture state. | 744 // setup the architecture state. |
745 // We allocate the stack here, the size is computed as the sum of | 745 // We allocate the stack here, the size is computed as the sum of |
746 // the size specified by the user and the buffer space needed for | 746 // the size specified by the user and the buffer space needed for |
747 // handling stack overflow exceptions. To be safe in potential | 747 // handling stack overflow exceptions. To be safe in potential |
748 // stack underflows we also add some underflow buffer space. | 748 // stack underflows we also add some underflow buffer space. |
749 stack_ = new char[(Isolate::GetSpecifiedStackSize() + | 749 stack_ = new char[(OSThread::GetSpecifiedStackSize() + |
750 Isolate::kStackSizeBuffer + | 750 OSThread::kStackSizeBuffer + |
751 kSimulatorStackUnderflowSize)]; | 751 kSimulatorStackUnderflowSize)]; |
752 pc_modified_ = false; | 752 pc_modified_ = false; |
753 icount_ = 0; | 753 icount_ = 0; |
754 break_pc_ = NULL; | 754 break_pc_ = NULL; |
755 break_instr_ = 0; | 755 break_instr_ = 0; |
756 last_setjmp_buffer_ = NULL; | 756 last_setjmp_buffer_ = NULL; |
757 top_exit_frame_info_ = 0; | 757 top_exit_frame_info_ = 0; |
758 | 758 |
759 // Setup architecture state. | 759 // Setup architecture state. |
760 // All registers are initialized to zero to start with. | 760 // All registers are initialized to zero to start with. |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 FATAL("Cannot continue execution after unimplemented instruction."); | 1048 FATAL("Cannot continue execution after unimplemented instruction."); |
1049 } | 1049 } |
1050 | 1050 |
1051 | 1051 |
1052 // Returns the top of the stack area to enable checking for stack pointer | 1052 // Returns the top of the stack area to enable checking for stack pointer |
1053 // validity. | 1053 // validity. |
1054 uword Simulator::StackTop() const { | 1054 uword Simulator::StackTop() const { |
1055 // To be safe in potential stack underflows we leave some buffer above and | 1055 // To be safe in potential stack underflows we leave some buffer above and |
1056 // set the stack top. | 1056 // set the stack top. |
1057 return StackBase() + | 1057 return StackBase() + |
1058 (Isolate::GetSpecifiedStackSize() + Isolate::kStackSizeBuffer); | 1058 (OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer); |
1059 } | 1059 } |
1060 | 1060 |
1061 | 1061 |
1062 bool Simulator::IsTracingExecution() const { | 1062 bool Simulator::IsTracingExecution() const { |
1063 return icount_ > FLAG_trace_sim_after; | 1063 return icount_ > FLAG_trace_sim_after; |
1064 } | 1064 } |
1065 | 1065 |
1066 | 1066 |
1067 intptr_t Simulator::ReadX(uword addr, Instr* instr) { | 1067 intptr_t Simulator::ReadX(uword addr, Instr* instr) { |
1068 if ((addr & 7) == 0) { | 1068 if ((addr & 7) == 0) { |
(...skipping 2467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3536 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); | 3536 set_register(NULL, kExceptionObjectReg, bit_cast<int64_t>(raw_exception)); |
3537 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); | 3537 set_register(NULL, kStackTraceObjectReg, bit_cast<int64_t>(raw_stacktrace)); |
3538 buf->Longjmp(); | 3538 buf->Longjmp(); |
3539 } | 3539 } |
3540 | 3540 |
3541 } // namespace dart | 3541 } // namespace dart |
3542 | 3542 |
3543 #endif // !defined(USING_SIMULATOR) | 3543 #endif // !defined(USING_SIMULATOR) |
3544 | 3544 |
3545 #endif // defined TARGET_ARCH_ARM64 | 3545 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |