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 <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_MIPS) | 9 #if defined(TARGET_ARCH_MIPS) |
10 | 10 |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 } | 692 } |
693 | 693 |
694 | 694 |
695 Simulator::Simulator() { | 695 Simulator::Simulator() { |
696 // Setup simulator support first. Some of this information is needed to | 696 // Setup simulator support first. Some of this information is needed to |
697 // setup the architecture state. | 697 // setup the architecture state. |
698 // We allocate the stack here, the size is computed as the sum of | 698 // We allocate the stack here, the size is computed as the sum of |
699 // the size specified by the user and the buffer space needed for | 699 // the size specified by the user and the buffer space needed for |
700 // handling stack overflow exceptions. To be safe in potential | 700 // handling stack overflow exceptions. To be safe in potential |
701 // stack underflows we also add some underflow buffer space. | 701 // stack underflows we also add some underflow buffer space. |
702 stack_ = new char[(Isolate::GetSpecifiedStackSize() + | 702 stack_ = new char[(OSThread::GetSpecifiedStackSize() + |
703 Isolate::kStackSizeBuffer + | 703 OSThread::kStackSizeBuffer + |
704 kSimulatorStackUnderflowSize)]; | 704 kSimulatorStackUnderflowSize)]; |
705 icount_ = 0; | 705 icount_ = 0; |
706 delay_slot_ = false; | 706 delay_slot_ = false; |
707 break_pc_ = NULL; | 707 break_pc_ = NULL; |
708 break_instr_ = 0; | 708 break_instr_ = 0; |
709 last_setjmp_buffer_ = NULL; | 709 last_setjmp_buffer_ = NULL; |
710 top_exit_frame_info_ = 0; | 710 top_exit_frame_info_ = 0; |
711 | 711 |
712 // Setup architecture state. | 712 // Setup architecture state. |
713 // All registers are initialized to zero to start with. | 713 // All registers are initialized to zero to start with. |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 FATAL("Cannot continue execution after unaligned access."); | 990 FATAL("Cannot continue execution after unaligned access."); |
991 } | 991 } |
992 | 992 |
993 | 993 |
994 // Returns the top of the stack area to enable checking for stack pointer | 994 // Returns the top of the stack area to enable checking for stack pointer |
995 // validity. | 995 // validity. |
996 uword Simulator::StackTop() const { | 996 uword Simulator::StackTop() const { |
997 // To be safe in potential stack underflows we leave some buffer above and | 997 // To be safe in potential stack underflows we leave some buffer above and |
998 // set the stack top. | 998 // set the stack top. |
999 return StackBase() + | 999 return StackBase() + |
1000 (Isolate::GetSpecifiedStackSize() + Isolate::kStackSizeBuffer); | 1000 (OSThread::GetSpecifiedStackSize() + OSThread::kStackSizeBuffer); |
1001 } | 1001 } |
1002 | 1002 |
1003 | 1003 |
1004 bool Simulator::IsTracingExecution() const { | 1004 bool Simulator::IsTracingExecution() const { |
1005 return icount_ > FLAG_trace_sim_after; | 1005 return icount_ > FLAG_trace_sim_after; |
1006 } | 1006 } |
1007 | 1007 |
1008 | 1008 |
1009 void Simulator::Format(Instr* instr, const char* format) { | 1009 void Simulator::Format(Instr* instr, const char* format) { |
1010 OS::PrintErr("Simulator - unknown instruction: %s\n", format); | 1010 OS::PrintErr("Simulator - unknown instruction: %s\n", format); |
(...skipping 1478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2489 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 2489 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
2490 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 2490 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
2491 buf->Longjmp(); | 2491 buf->Longjmp(); |
2492 } | 2492 } |
2493 | 2493 |
2494 } // namespace dart | 2494 } // namespace dart |
2495 | 2495 |
2496 #endif // defined(USING_SIMULATOR) | 2496 #endif // defined(USING_SIMULATOR) |
2497 | 2497 |
2498 #endif // defined TARGET_ARCH_MIPS | 2498 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |