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

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

Issue 1921203002: Add new relocation type WASM_MEMORY_SIZE_REFERENCE, use relocatable pointers to update wasm memory … (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ben's review Created 4 years, 7 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/mips/assembler-mips-inl.h ('k') | src/mips64/assembler-mips64-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 (c) 1994-2006 Sun Microsystems Inc. 1 // Copyright (c) 1994-2006 Sun Microsystems Inc.
2 // All Rights Reserved. 2 // All Rights Reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // - Redistributions of source code must retain the above copyright notice, 8 // - Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer. 9 // this list of conditions and the following disclaimer.
10 // 10 //
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // specially coded on MIPS means that it is a lui/ori instruction, and that is 160 // specially coded on MIPS means that it is a lui/ori instruction, and that is
161 // always the case inside code objects. 161 // always the case inside code objects.
162 return true; 162 return true;
163 } 163 }
164 164
165 165
166 bool RelocInfo::IsInConstantPool() { 166 bool RelocInfo::IsInConstantPool() {
167 return false; 167 return false;
168 } 168 }
169 169
170 Address RelocInfo::wasm_memory_reference() {
171 DCHECK(IsWasmMemoryReference(rmode_));
172 return Assembler::target_address_at(pc_, host_);
173 }
174
175 uint32_t RelocInfo::wasm_memory_size_reference() {
176 DCHECK(IsWasmMemorySizeReference(rmode_));
177 return static_cast<uint32_t>(
178 reinterpret_cast<intptr_t>((Assembler::target_address_at(pc_, host_))));
179 }
180
181 void RelocInfo::update_wasm_memory_reference(
182 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size,
183 ICacheFlushMode icache_flush_mode) {
184 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_));
185 if (IsWasmMemoryReference(rmode_)) {
186 Address updated_memory_reference;
187 DCHECK(old_base <= wasm_memory_reference() &&
188 wasm_memory_reference() < old_base + old_size);
189 updated_memory_reference = new_base + (wasm_memory_reference() - old_base);
190 DCHECK(new_base <= updated_memory_reference &&
191 updated_memory_reference < new_base + new_size);
192 Assembler::set_target_address_at(
193 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode);
194 } else if (IsWasmMemorySizeReference(rmode_)) {
195 uint32_t updated_size_reference;
196 DCHECK(wasm_memory_size_reference() <= old_size);
197 updated_size_reference =
198 new_size + (wasm_memory_size_reference() - old_size);
199 DCHECK(updated_size_reference <= new_size);
200 Assembler::set_target_address_at(
201 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference),
202 icache_flush_mode);
203 } else {
204 UNREACHABLE();
205 }
206 }
170 207
171 // ----------------------------------------------------------------------------- 208 // -----------------------------------------------------------------------------
172 // Implementation of Operand and MemOperand. 209 // Implementation of Operand and MemOperand.
173 // See assembler-mips-inl.h for inlined constructors. 210 // See assembler-mips-inl.h for inlined constructors.
174 211
175 Operand::Operand(Handle<Object> handle) { 212 Operand::Operand(Handle<Object> handle) {
176 AllowDeferredHandleDereference using_raw_address; 213 AllowDeferredHandleDereference using_raw_address;
177 rm_ = no_reg; 214 rm_ = no_reg;
178 // Verify all Objects referred by code are NOT in new space. 215 // Verify all Objects referred by code are NOT in new space.
179 Object* obj = *handle; 216 Object* obj = *handle;
(...skipping 3233 matching lines...) Expand 10 before | Expand all | Expand 10 after
3413 if (icache_flush_mode != SKIP_ICACHE_FLUSH) { 3450 if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
3414 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize); 3451 Assembler::FlushICache(isolate, pc, 4 * Assembler::kInstrSize);
3415 } 3452 }
3416 } 3453 }
3417 3454
3418 3455
3419 } // namespace internal 3456 } // namespace internal
3420 } // namespace v8 3457 } // namespace v8
3421 3458
3422 #endif // V8_TARGET_ARCH_MIPS64 3459 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips/assembler-mips-inl.h ('k') | src/mips64/assembler-mips64-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698