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) |
11 | 11 |
12 // Only build the simulator if not compiling for real ARM hardware. | 12 // Only build the simulator if not compiling for real ARM hardware. |
13 #if !defined(HOST_ARCH_ARM) | 13 #if !defined(HOST_ARCH_ARM) |
14 | 14 |
15 #include "vm/simulator.h" | 15 #include "vm/simulator.h" |
16 | 16 |
17 #include "vm/assembler.h" | 17 #include "vm/assembler.h" |
18 #include "vm/constants_arm.h" | 18 #include "vm/constants_arm.h" |
19 #include "vm/cpu.h" | |
20 #include "vm/disassembler.h" | 19 #include "vm/disassembler.h" |
21 #include "vm/native_arguments.h" | 20 #include "vm/native_arguments.h" |
22 #include "vm/stack_frame.h" | 21 #include "vm/stack_frame.h" |
23 #include "vm/thread.h" | 22 #include "vm/thread.h" |
24 | 23 |
25 namespace dart { | 24 namespace dart { |
26 | 25 |
27 DEFINE_FLAG(bool, trace_sim, false, "Trace simulator execution."); | 26 DEFINE_FLAG(bool, trace_sim, false, "Trace simulator execution."); |
28 DEFINE_FLAG(int, stop_sim_at, 0, "Address to stop simulator at."); | 27 DEFINE_FLAG(int, stop_sim_at, 0, "Address to stop simulator at."); |
29 | 28 |
(...skipping 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2297 set_register(rd, ReadW(addr, instr)); | 2296 set_register(rd, ReadW(addr, instr)); |
2298 } else { | 2297 } else { |
2299 WriteW(addr, get_register(rd), instr); | 2298 WriteW(addr, get_register(rd), instr); |
2300 } | 2299 } |
2301 } | 2300 } |
2302 } | 2301 } |
2303 } | 2302 } |
2304 | 2303 |
2305 | 2304 |
2306 void Simulator::DoDivision(Instr* instr) { | 2305 void Simulator::DoDivision(Instr* instr) { |
2307 ASSERT(TargetCPUFeatures::integer_division_supported()); | 2306 ASSERT(CPUFeatures::integer_division_supported()); |
2308 Register rd = instr->DivRdField(); | 2307 Register rd = instr->DivRdField(); |
2309 Register rn = instr->DivRnField(); | 2308 Register rn = instr->DivRnField(); |
2310 Register rm = instr->DivRmField(); | 2309 Register rm = instr->DivRmField(); |
2311 | 2310 |
2312 // ARMv7-a does not trap on divide-by-zero. The destination register is just | 2311 // ARMv7-a does not trap on divide-by-zero. The destination register is just |
2313 // set to 0. | 2312 // set to 0. |
2314 if (get_register(rm) == 0) { | 2313 if (get_register(rm) == 0) { |
2315 set_register(rd, 0); | 2314 set_register(rd, 0); |
2316 return; | 2315 return; |
2317 } | 2316 } |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3725 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); | 3724 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); |
3726 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); | 3725 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); |
3727 buf->Longjmp(); | 3726 buf->Longjmp(); |
3728 } | 3727 } |
3729 | 3728 |
3730 } // namespace dart | 3729 } // namespace dart |
3731 | 3730 |
3732 #endif // !defined(HOST_ARCH_ARM) | 3731 #endif // !defined(HOST_ARCH_ARM) |
3733 | 3732 |
3734 #endif // defined TARGET_ARCH_ARM | 3733 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |