OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #ifndef VM_ASSEMBLER_IA32_H_ | 5 #ifndef VM_ASSEMBLER_IA32_H_ |
6 #define VM_ASSEMBLER_IA32_H_ | 6 #define VM_ASSEMBLER_IA32_H_ |
7 | 7 |
8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
9 #error Do not include assembler_ia32.h directly; use assembler.h instead. | 9 #error Do not include assembler_ia32.h directly; use assembler.h instead. |
10 #endif | 10 #endif |
11 | 11 |
12 #include "platform/assert.h" | 12 #include "platform/assert.h" |
13 #include "platform/utils.h" | 13 #include "platform/utils.h" |
14 #include "vm/constants_ia32.h" | 14 #include "vm/constants_ia32.h" |
15 | 15 |
16 namespace dart { | 16 namespace dart { |
17 | 17 |
18 // Forward declarations. | 18 // Forward declarations. |
19 class RuntimeEntry; | 19 class RuntimeEntry; |
20 | 20 |
21 | |
22 #if defined(TESTING) || defined(DEBUG) | |
23 | |
24 #if defined(TARGET_OS_WINDOWS) | |
25 // The compiler may dynamically align the stack on Windows, so do not check. | |
26 #define CHECK_STACK_ALIGNMENT { } | |
27 #else | |
28 #define CHECK_STACK_ALIGNMENT { \ | |
29 uword current_sp; \ | |
30 asm volatile("mov %%esp, %[current_sp]" : [current_sp] "=r" (current_sp)); \ | |
31 ASSERT((OS::ActivationFrameAlignment() == 0) || \ | |
32 (Utils::IsAligned(current_sp, OS::ActivationFrameAlignment()))); \ | |
33 } | |
34 #endif | |
35 | |
36 #else | |
37 | |
38 #define CHECK_STACK_ALIGNMENT { } | |
39 | |
40 #endif | |
41 | |
42 | |
43 class Immediate : public ValueObject { | 21 class Immediate : public ValueObject { |
44 public: | 22 public: |
45 explicit Immediate(int32_t value) : value_(value) { } | 23 explicit Immediate(int32_t value) : value_(value) { } |
46 | 24 |
47 int32_t value() const { return value_; } | 25 int32_t value() const { return value_; } |
48 | 26 |
49 bool is_int8() const { return Utils::IsInt(8, value_); } | 27 bool is_int8() const { return Utils::IsInt(8, value_); } |
50 bool is_uint8() const { return Utils::IsUint(8, value_); } | 28 bool is_uint8() const { return Utils::IsUint(8, value_); } |
51 bool is_uint16() const { return Utils::IsUint(16, value_); } | 29 bool is_uint16() const { return Utils::IsUint(16, value_); } |
52 | 30 |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 } | 645 } |
668 | 646 |
669 | 647 |
670 inline void Assembler::EmitOperandSizeOverride() { | 648 inline void Assembler::EmitOperandSizeOverride() { |
671 EmitUint8(0x66); | 649 EmitUint8(0x66); |
672 } | 650 } |
673 | 651 |
674 } // namespace dart | 652 } // namespace dart |
675 | 653 |
676 #endif // VM_ASSEMBLER_IA32_H_ | 654 #endif // VM_ASSEMBLER_IA32_H_ |
OLD | NEW |