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> | 5 #include <setjmp.h> |
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_ARM) | 9 #if defined(TARGET_ARCH_ARM) |
10 | 10 |
(...skipping 3563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3574 UnimplementedInstruction(instr); | 3574 UnimplementedInstruction(instr); |
3575 } | 3575 } |
3576 } | 3576 } |
3577 } | 3577 } |
3578 | 3578 |
3579 | 3579 |
3580 // Executes the current instruction. | 3580 // Executes the current instruction. |
3581 void Simulator::InstructionDecode(Instr* instr) { | 3581 void Simulator::InstructionDecode(Instr* instr) { |
3582 pc_modified_ = false; | 3582 pc_modified_ = false; |
3583 if (IsTracingExecution()) { | 3583 if (IsTracingExecution()) { |
3584 OS::Print("%u ", icount_); | 3584 OS::Print("%" Pd " ", icount_); |
3585 const uword start = reinterpret_cast<uword>(instr); | 3585 const uword start = reinterpret_cast<uword>(instr); |
3586 const uword end = start + Instr::kInstrSize; | 3586 const uword end = start + Instr::kInstrSize; |
3587 Disassembler::Disassemble(start, end); | 3587 Disassembler::Disassemble(start, end); |
3588 } | 3588 } |
3589 if (instr->ConditionField() == kSpecialCondition) { | 3589 if (instr->ConditionField() == kSpecialCondition) { |
3590 if (instr->InstructionBits() == static_cast<int32_t>(0xf57ff01f)) { | 3590 if (instr->InstructionBits() == static_cast<int32_t>(0xf57ff01f)) { |
3591 // Format(instr, "clrex"); | 3591 // Format(instr, "clrex"); |
3592 ClearExclusive(); | 3592 ClearExclusive(); |
3593 } else { | 3593 } else { |
3594 if (instr->IsSIMDDataProcessing()) { | 3594 if (instr->IsSIMDDataProcessing()) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3658 InstructionDecode(instr); | 3658 InstructionDecode(instr); |
3659 } | 3659 } |
3660 program_counter = get_pc(); | 3660 program_counter = get_pc(); |
3661 } | 3661 } |
3662 } else { | 3662 } else { |
3663 // FLAG_stop_sim_at is at the non-default value. Stop in the debugger when | 3663 // FLAG_stop_sim_at is at the non-default value. Stop in the debugger when |
3664 // we reach the particular instruction count or address. | 3664 // we reach the particular instruction count or address. |
3665 while (program_counter != kEndSimulatingPC) { | 3665 while (program_counter != kEndSimulatingPC) { |
3666 Instr* instr = reinterpret_cast<Instr*>(program_counter); | 3666 Instr* instr = reinterpret_cast<Instr*>(program_counter); |
3667 icount_++; | 3667 icount_++; |
3668 if (static_cast<intptr_t>(icount_) == FLAG_stop_sim_at) { | 3668 if (icount_ == FLAG_stop_sim_at) { |
3669 SimulatorDebugger dbg(this); | 3669 SimulatorDebugger dbg(this); |
3670 dbg.Stop(instr, "Instruction count reached"); | 3670 dbg.Stop(instr, "Instruction count reached"); |
3671 } else if (reinterpret_cast<intptr_t>(instr) == FLAG_stop_sim_at) { | 3671 } else if (reinterpret_cast<intptr_t>(instr) == FLAG_stop_sim_at) { |
3672 SimulatorDebugger dbg(this); | 3672 SimulatorDebugger dbg(this); |
3673 dbg.Stop(instr, "Instruction address reached"); | 3673 dbg.Stop(instr, "Instruction address reached"); |
3674 } else if (IsIllegalAddress(program_counter)) { | 3674 } else if (IsIllegalAddress(program_counter)) { |
3675 HandleIllegalAccess(program_counter, instr); | 3675 HandleIllegalAccess(program_counter, instr); |
3676 } else { | 3676 } else { |
3677 InstructionDecode(instr); | 3677 InstructionDecode(instr); |
3678 } | 3678 } |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3872 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 3872 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
3873 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3873 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
3874 buf->Longjmp(); | 3874 buf->Longjmp(); |
3875 } | 3875 } |
3876 | 3876 |
3877 } // namespace dart | 3877 } // namespace dart |
3878 | 3878 |
3879 #endif // !defined(HOST_ARCH_ARM) | 3879 #endif // !defined(HOST_ARCH_ARM) |
3880 | 3880 |
3881 #endif // defined TARGET_ARCH_ARM | 3881 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |