| 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 #include "src/x64/assembler-x64.h" | 5 #include "src/x64/assembler-x64.h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
| 10 | 10 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 Address RelocInfo::wasm_memory_reference() { | 120 Address RelocInfo::wasm_memory_reference() { |
| 121 DCHECK(IsWasmMemoryReference(rmode_)); | 121 DCHECK(IsWasmMemoryReference(rmode_)); |
| 122 return Memory::Address_at(pc_); | 122 return Memory::Address_at(pc_); |
| 123 } | 123 } |
| 124 | 124 |
| 125 uint32_t RelocInfo::wasm_memory_size_reference() { | 125 uint32_t RelocInfo::wasm_memory_size_reference() { |
| 126 DCHECK(IsWasmMemorySizeReference(rmode_)); | 126 DCHECK(IsWasmMemorySizeReference(rmode_)); |
| 127 return Memory::uint32_at(pc_); | 127 return Memory::uint32_at(pc_); |
| 128 } | 128 } |
| 129 | 129 |
| 130 uint32_t RelocInfo::wasm_function_index() { |
| 131 DCHECK(IsWasmDirectCall(rmode_)); |
| 132 return Memory::uint32_at(pc_); |
| 133 } |
| 134 |
| 130 void RelocInfo::update_wasm_memory_reference( | 135 void RelocInfo::update_wasm_memory_reference( |
| 131 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, | 136 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, |
| 132 ICacheFlushMode icache_flush_mode) { | 137 ICacheFlushMode icache_flush_mode) { |
| 133 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); | 138 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); |
| 134 if (IsWasmMemoryReference(rmode_)) { | 139 if (IsWasmMemoryReference(rmode_)) { |
| 135 Address updated_reference; | 140 Address updated_reference; |
| 136 DCHECK(old_base <= wasm_memory_reference() && | 141 DCHECK(old_base <= wasm_memory_reference() && |
| 137 wasm_memory_reference() < old_base + old_size); | 142 wasm_memory_reference() < old_base + old_size); |
| 138 updated_reference = new_base + (wasm_memory_reference() - old_base); | 143 updated_reference = new_base + (wasm_memory_reference() - old_base); |
| 139 DCHECK(new_base <= updated_reference && | 144 DCHECK(new_base <= updated_reference && |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 void Assembler::call(Handle<Code> target, | 886 void Assembler::call(Handle<Code> target, |
| 882 RelocInfo::Mode rmode, | 887 RelocInfo::Mode rmode, |
| 883 TypeFeedbackId ast_id) { | 888 TypeFeedbackId ast_id) { |
| 884 positions_recorder()->WriteRecordedPositions(); | 889 positions_recorder()->WriteRecordedPositions(); |
| 885 EnsureSpace ensure_space(this); | 890 EnsureSpace ensure_space(this); |
| 886 // 1110 1000 #32-bit disp. | 891 // 1110 1000 #32-bit disp. |
| 887 emit(0xE8); | 892 emit(0xE8); |
| 888 emit_code_target(target, rmode, ast_id); | 893 emit_code_target(target, rmode, ast_id); |
| 889 } | 894 } |
| 890 | 895 |
| 896 void Assembler::wasm_direct_call(uint32_t index) { |
| 897 positions_recorder()->WriteRecordedPositions(); |
| 898 EnsureSpace ensure_space(this); |
| 899 emit(0xE8); |
| 900 RecordRelocInfo(RelocInfo::WASM_DIRECT_CALL); |
| 901 |
| 902 emitl(index); |
| 903 } |
| 891 | 904 |
| 892 void Assembler::call(Register adr) { | 905 void Assembler::call(Register adr) { |
| 893 positions_recorder()->WriteRecordedPositions(); | 906 positions_recorder()->WriteRecordedPositions(); |
| 894 EnsureSpace ensure_space(this); | 907 EnsureSpace ensure_space(this); |
| 895 // Opcode: FF /2 r64. | 908 // Opcode: FF /2 r64. |
| 896 emit_optional_rex_32(adr); | 909 emit_optional_rex_32(adr); |
| 897 emit(0xFF); | 910 emit(0xFF); |
| 898 emit_modrm(0x2, adr); | 911 emit_modrm(0x2, adr); |
| 899 } | 912 } |
| 900 | 913 |
| (...skipping 3696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4597 | 4610 |
| 4598 bool RelocInfo::IsInConstantPool() { | 4611 bool RelocInfo::IsInConstantPool() { |
| 4599 return false; | 4612 return false; |
| 4600 } | 4613 } |
| 4601 | 4614 |
| 4602 | 4615 |
| 4603 } // namespace internal | 4616 } // namespace internal |
| 4604 } // namespace v8 | 4617 } // namespace v8 |
| 4605 | 4618 |
| 4606 #endif // V8_TARGET_ARCH_X64 | 4619 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |