OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_X64_ASSEMBLER_X64_INL_H_ | 5 #ifndef V8_X64_ASSEMBLER_X64_INL_H_ |
6 #define V8_X64_ASSEMBLER_X64_INL_H_ | 6 #define V8_X64_ASSEMBLER_X64_INL_H_ |
7 | 7 |
8 #include "src/x64/assembler-x64.h" | 8 #include "src/x64/assembler-x64.h" |
9 | 9 |
10 #include "src/base/cpu.h" | 10 #include "src/base/cpu.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } else { | 71 } else { |
72 code_targets_.Add(target); | 72 code_targets_.Add(target); |
73 emitl(current); | 73 emitl(current); |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 | 77 |
78 void Assembler::emit_runtime_entry(Address entry, RelocInfo::Mode rmode) { | 78 void Assembler::emit_runtime_entry(Address entry, RelocInfo::Mode rmode) { |
79 DCHECK(RelocInfo::IsRuntimeEntry(rmode)); | 79 DCHECK(RelocInfo::IsRuntimeEntry(rmode)); |
80 RecordRelocInfo(rmode); | 80 RecordRelocInfo(rmode); |
81 emitl(static_cast<uint32_t>(entry - isolate()->code_range()->start())); | 81 emitl(static_cast<uint32_t>( |
| 82 entry - isolate()->heap()->memory_allocator()->code_range()->start())); |
82 } | 83 } |
83 | 84 |
84 | 85 |
85 void Assembler::emit_rex_64(Register reg, Register rm_reg) { | 86 void Assembler::emit_rex_64(Register reg, Register rm_reg) { |
86 emit(0x48 | reg.high_bit() << 2 | rm_reg.high_bit()); | 87 emit(0x48 | reg.high_bit() << 2 | rm_reg.high_bit()); |
87 } | 88 } |
88 | 89 |
89 | 90 |
90 void Assembler::emit_rex_64(XMMRegister reg, Register rm_reg) { | 91 void Assembler::emit_rex_64(XMMRegister reg, Register rm_reg) { |
91 emit(0x48 | (reg.code() & 0x8) >> 1 | rm_reg.code() >> 3); | 92 emit(0x48 | (reg.code() & 0x8) >> 1 | rm_reg.code() >> 3); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 return pc - kCallTargetAddressOffset; | 293 return pc - kCallTargetAddressOffset; |
293 } | 294 } |
294 | 295 |
295 | 296 |
296 Handle<Object> Assembler::code_target_object_handle_at(Address pc) { | 297 Handle<Object> Assembler::code_target_object_handle_at(Address pc) { |
297 return code_targets_[Memory::int32_at(pc)]; | 298 return code_targets_[Memory::int32_at(pc)]; |
298 } | 299 } |
299 | 300 |
300 | 301 |
301 Address Assembler::runtime_entry_at(Address pc) { | 302 Address Assembler::runtime_entry_at(Address pc) { |
302 return Memory::int32_at(pc) + isolate()->code_range()->start(); | 303 return Memory::int32_at(pc) + |
| 304 isolate()->heap()->memory_allocator()->code_range()->start(); |
303 } | 305 } |
304 | 306 |
305 // ----------------------------------------------------------------------------- | 307 // ----------------------------------------------------------------------------- |
306 // Implementation of RelocInfo | 308 // Implementation of RelocInfo |
307 | 309 |
308 // The modes possibly affected by apply must be in kApplyMask. | 310 // The modes possibly affected by apply must be in kApplyMask. |
309 void RelocInfo::apply(intptr_t delta) { | 311 void RelocInfo::apply(intptr_t delta) { |
310 if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) { | 312 if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) { |
311 Memory::int32_at(pc_) -= static_cast<int32_t>(delta); | 313 Memory::int32_at(pc_) -= static_cast<int32_t>(delta); |
312 } else if (IsCodeAgeSequence(rmode_)) { | 314 } else if (IsCodeAgeSequence(rmode_)) { |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 void Operand::set_disp64(int64_t disp) { | 630 void Operand::set_disp64(int64_t disp) { |
629 DCHECK_EQ(1, len_); | 631 DCHECK_EQ(1, len_); |
630 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]); | 632 int64_t* p = reinterpret_cast<int64_t*>(&buf_[len_]); |
631 *p = disp; | 633 *p = disp; |
632 len_ += sizeof(disp); | 634 len_ += sizeof(disp); |
633 } | 635 } |
634 } // namespace internal | 636 } // namespace internal |
635 } // namespace v8 | 637 } // namespace v8 |
636 | 638 |
637 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 639 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
OLD | NEW |