Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: runtime/vm/simulator_arm.cc

Issue 120723003: Refactors CPU feature detection. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
19 #include "vm/disassembler.h" 20 #include "vm/disassembler.h"
20 #include "vm/native_arguments.h" 21 #include "vm/native_arguments.h"
21 #include "vm/stack_frame.h" 22 #include "vm/stack_frame.h"
22 #include "vm/thread.h" 23 #include "vm/thread.h"
23 24
24 namespace dart { 25 namespace dart {
25 26
26 DEFINE_FLAG(bool, trace_sim, false, "Trace simulator execution."); 27 DEFINE_FLAG(bool, trace_sim, false, "Trace simulator execution.");
27 DEFINE_FLAG(int, stop_sim_at, 0, "Address to stop simulator at."); 28 DEFINE_FLAG(int, stop_sim_at, 0, "Address to stop simulator at.");
28 29
(...skipping 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after
2296 set_register(rd, ReadW(addr, instr)); 2297 set_register(rd, ReadW(addr, instr));
2297 } else { 2298 } else {
2298 WriteW(addr, get_register(rd), instr); 2299 WriteW(addr, get_register(rd), instr);
2299 } 2300 }
2300 } 2301 }
2301 } 2302 }
2302 } 2303 }
2303 2304
2304 2305
2305 void Simulator::DoDivision(Instr* instr) { 2306 void Simulator::DoDivision(Instr* instr) {
2306 ASSERT(CPUFeatures::integer_division_supported()); 2307 ASSERT(TargetCPUFeatures::integer_division_supported());
2307 Register rd = instr->DivRdField(); 2308 Register rd = instr->DivRdField();
2308 Register rn = instr->DivRnField(); 2309 Register rn = instr->DivRnField();
2309 Register rm = instr->DivRmField(); 2310 Register rm = instr->DivRmField();
2310 2311
2311 // ARMv7-a does not trap on divide-by-zero. The destination register is just 2312 // ARMv7-a does not trap on divide-by-zero. The destination register is just
2312 // set to 0. 2313 // set to 0.
2313 if (get_register(rm) == 0) { 2314 if (get_register(rm) == 0) {
2314 set_register(rd, 0); 2315 set_register(rd, 0);
2315 return; 2316 return;
2316 } 2317 }
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after
3724 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); 3725 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
3725 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); 3726 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
3726 buf->Longjmp(); 3727 buf->Longjmp();
3727 } 3728 }
3728 3729
3729 } // namespace dart 3730 } // namespace dart
3730 3731
3731 #endif // !defined(HOST_ARCH_ARM) 3732 #endif // !defined(HOST_ARCH_ARM)
3732 3733
3733 #endif // defined TARGET_ARCH_ARM 3734 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698