OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_ARM64_INSTRUCTIONS_ARM64_H_ | 5 #ifndef V8_ARM64_INSTRUCTIONS_ARM64_H_ |
6 #define V8_ARM64_INSTRUCTIONS_ARM64_H_ | 6 #define V8_ARM64_INSTRUCTIONS_ARM64_H_ |
7 | 7 |
8 #include "src/arm64/constants-arm64.h" | 8 #include "src/arm64/constants-arm64.h" |
9 #include "src/arm64/utils-arm64.h" | 9 #include "src/arm64/utils-arm64.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 130 } |
131 | 131 |
132 #define DEFINE_GETTER(Name, HighBit, LowBit, Func) \ | 132 #define DEFINE_GETTER(Name, HighBit, LowBit, Func) \ |
133 int64_t Name() const { return Func(HighBit, LowBit); } | 133 int64_t Name() const { return Func(HighBit, LowBit); } |
134 INSTRUCTION_FIELDS_LIST(DEFINE_GETTER) | 134 INSTRUCTION_FIELDS_LIST(DEFINE_GETTER) |
135 #undef DEFINE_GETTER | 135 #undef DEFINE_GETTER |
136 | 136 |
137 // ImmPCRel is a compound field (not present in INSTRUCTION_FIELDS_LIST), | 137 // ImmPCRel is a compound field (not present in INSTRUCTION_FIELDS_LIST), |
138 // formed from ImmPCRelLo and ImmPCRelHi. | 138 // formed from ImmPCRelLo and ImmPCRelHi. |
139 int ImmPCRel() const { | 139 int ImmPCRel() const { |
140 ASSERT(IsPCRelAddressing()); | 140 DCHECK(IsPCRelAddressing()); |
141 int const offset = ((ImmPCRelHi() << ImmPCRelLo_width) | ImmPCRelLo()); | 141 int const offset = ((ImmPCRelHi() << ImmPCRelLo_width) | ImmPCRelLo()); |
142 int const width = ImmPCRelLo_width + ImmPCRelHi_width; | 142 int const width = ImmPCRelLo_width + ImmPCRelHi_width; |
143 return signed_bitextract_32(width - 1, 0, offset); | 143 return signed_bitextract_32(width - 1, 0, offset); |
144 } | 144 } |
145 | 145 |
146 uint64_t ImmLogical(); | 146 uint64_t ImmLogical(); |
147 float ImmFP32(); | 147 float ImmFP32(); |
148 double ImmFP64(); | 148 double ImmFP64(); |
149 | 149 |
150 LSDataSize SizeLSPair() const { | 150 LSDataSize SizeLSPair() const { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 return reinterpret_cast<uint8_t*>(this) + offset; | 357 return reinterpret_cast<uint8_t*>(this) + offset; |
358 } | 358 } |
359 | 359 |
360 enum CheckAlignment { NO_CHECK, CHECK_ALIGNMENT }; | 360 enum CheckAlignment { NO_CHECK, CHECK_ALIGNMENT }; |
361 | 361 |
362 V8_INLINE Instruction* InstructionAtOffset( | 362 V8_INLINE Instruction* InstructionAtOffset( |
363 int64_t offset, | 363 int64_t offset, |
364 CheckAlignment check = CHECK_ALIGNMENT) { | 364 CheckAlignment check = CHECK_ALIGNMENT) { |
365 Address addr = reinterpret_cast<Address>(this) + offset; | 365 Address addr = reinterpret_cast<Address>(this) + offset; |
366 // The FUZZ_disasm test relies on no check being done. | 366 // The FUZZ_disasm test relies on no check being done. |
367 ASSERT(check == NO_CHECK || IsAddressAligned(addr, kInstructionSize)); | 367 DCHECK(check == NO_CHECK || IsAddressAligned(addr, kInstructionSize)); |
368 return Cast(addr); | 368 return Cast(addr); |
369 } | 369 } |
370 | 370 |
371 template<typename T> V8_INLINE static Instruction* Cast(T src) { | 371 template<typename T> V8_INLINE static Instruction* Cast(T src) { |
372 return reinterpret_cast<Instruction*>(src); | 372 return reinterpret_cast<Instruction*>(src); |
373 } | 373 } |
374 | 374 |
375 V8_INLINE ptrdiff_t DistanceTo(Instruction* target) { | 375 V8_INLINE ptrdiff_t DistanceTo(Instruction* target) { |
376 return reinterpret_cast<Address>(target) - reinterpret_cast<Address>(this); | 376 return reinterpret_cast<Address>(target) - reinterpret_cast<Address>(this); |
377 } | 377 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 TRACE_ENABLE = 1 << 6, | 500 TRACE_ENABLE = 1 << 6, |
501 TRACE_DISABLE = 2 << 6, | 501 TRACE_DISABLE = 2 << 6, |
502 TRACE_OVERRIDE = 3 << 6 | 502 TRACE_OVERRIDE = 3 << 6 |
503 }; | 503 }; |
504 | 504 |
505 | 505 |
506 } } // namespace v8::internal | 506 } } // namespace v8::internal |
507 | 507 |
508 | 508 |
509 #endif // V8_ARM64_INSTRUCTIONS_ARM64_H_ | 509 #endif // V8_ARM64_INSTRUCTIONS_ARM64_H_ |
OLD | NEW |