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_X64_H_ | 5 #ifndef VM_ASSEMBLER_X64_H_ |
6 #define VM_ASSEMBLER_X64_H_ | 6 #define VM_ASSEMBLER_X64_H_ |
7 | 7 |
8 #ifndef VM_ASSEMBLER_H_ | 8 #ifndef VM_ASSEMBLER_H_ |
9 #error Do not include assembler_x64.h directly; use assembler.h instead. | 9 #error Do not include assembler_x64.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_x64.h" | 14 #include "vm/constants_x64.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 %%rsp, %[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(int64_t value) : value_(value) { } | 23 explicit Immediate(int64_t value) : value_(value) { } |
46 | 24 |
47 int64_t value() const { return value_; } | 25 int64_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 bool is_int32() const { return Utils::IsInt(32, value_); } | 30 bool is_int32() const { return Utils::IsInt(32, value_); } |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 } | 651 } |
674 | 652 |
675 | 653 |
676 inline void Assembler::EmitOperandSizeOverride() { | 654 inline void Assembler::EmitOperandSizeOverride() { |
677 EmitUint8(0x66); | 655 EmitUint8(0x66); |
678 } | 656 } |
679 | 657 |
680 } // namespace dart | 658 } // namespace dart |
681 | 659 |
682 #endif // VM_ASSEMBLER_X64_H_ | 660 #endif // VM_ASSEMBLER_X64_H_ |
OLD | NEW |