Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Side by Side Diff: src/x64/assembler-x64.cc

Issue 2021323003: [wasm] remove faux code objects Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/assembler-x64-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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(IsWasmCall(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
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_call(uint32_t index, RelocInfo::Mode rmode) {
897 DCHECK(RelocInfo::IsWasmCall(rmode));
898 positions_recorder()->WriteRecordedPositions();
899 EnsureSpace ensure_space(this);
900 emit(0xE8);
901 RecordRelocInfo(rmode);
902
903 emitl(index);
904 }
891 905
892 void Assembler::call(Register adr) { 906 void Assembler::call(Register adr) {
893 positions_recorder()->WriteRecordedPositions(); 907 positions_recorder()->WriteRecordedPositions();
894 EnsureSpace ensure_space(this); 908 EnsureSpace ensure_space(this);
895 // Opcode: FF /2 r64. 909 // Opcode: FF /2 r64.
896 emit_optional_rex_32(adr); 910 emit_optional_rex_32(adr);
897 emit(0xFF); 911 emit(0xFF);
898 emit_modrm(0x2, adr); 912 emit_modrm(0x2, adr);
899 } 913 }
900 914
(...skipping 3696 matching lines...) Expand 10 before | Expand all | Expand 10 after
4597 4611
4598 bool RelocInfo::IsInConstantPool() { 4612 bool RelocInfo::IsInConstantPool() {
4599 return false; 4613 return false;
4600 } 4614 }
4601 4615
4602 4616
4603 } // namespace internal 4617 } // namespace internal
4604 } // namespace v8 4618 } // namespace v8
4605 4619
4606 #endif // V8_TARGET_ARCH_X64 4620 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/assembler-x64.h ('k') | src/x64/assembler-x64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698