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

Side by Side Diff: src/arm/assembler-arm.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 | « no previous file | src/arm/assembler-arm-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 5 // modification, are permitted provided that the following conditions
6 // are met: 6 // are 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 // embedded constant pool entry.  These only occur if 248 // embedded constant pool entry.  These only occur if
249 // FLAG_enable_embedded_constant_pool is true. 249 // FLAG_enable_embedded_constant_pool is true.
250 return FLAG_enable_embedded_constant_pool; 250 return FLAG_enable_embedded_constant_pool;
251 } 251 }
252 252
253 253
254 bool RelocInfo::IsInConstantPool() { 254 bool RelocInfo::IsInConstantPool() {
255 return Assembler::is_constant_pool_load(pc_); 255 return Assembler::is_constant_pool_load(pc_);
256 } 256 }
257 257
258 Address RelocInfo::wasm_memory_reference() {
259 DCHECK(IsWasmMemoryReference(rmode_));
260 return Assembler::target_address_at(pc_, host_);
261 }
262
263 uint32_t RelocInfo::wasm_memory_size_reference() {
264 DCHECK(IsWasmMemorySizeReference(rmode_));
265 return reinterpret_cast<uint32_t>(Assembler::target_address_at(pc_, host_));
266 }
267
268 void RelocInfo::update_wasm_memory_reference(
269 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size,
270 ICacheFlushMode icache_flush_mode) {
271 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_));
272 if (IsWasmMemoryReference(rmode_)) {
273 Address updated_memory_reference;
274 DCHECK(old_base <= wasm_memory_reference() &&
275 wasm_memory_reference() < old_base + old_size);
276 updated_memory_reference = new_base + (wasm_memory_reference() - old_base);
277 DCHECK(new_base <= updated_memory_reference &&
278 updated_memory_reference < new_base + new_size);
279 Assembler::set_target_address_at(
280 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode);
281 } else if (IsWasmMemorySizeReference(rmode_)) {
282 uint32_t updated_size_reference;
283 DCHECK(wasm_memory_size_reference() <= old_size);
284 updated_size_reference =
285 new_size + (wasm_memory_size_reference() - old_size);
286 DCHECK(updated_size_reference <= new_size);
287 Assembler::set_target_address_at(
288 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference),
289 icache_flush_mode);
290 } else {
291 UNREACHABLE();
292 }
293 }
258 294
259 // ----------------------------------------------------------------------------- 295 // -----------------------------------------------------------------------------
260 // Implementation of Operand and MemOperand 296 // Implementation of Operand and MemOperand
261 // See assembler-arm-inl.h for inlined constructors 297 // See assembler-arm-inl.h for inlined constructors
262 298
263 Operand::Operand(Handle<Object> handle) { 299 Operand::Operand(Handle<Object> handle) {
264 AllowDeferredHandleDereference using_raw_address; 300 AllowDeferredHandleDereference using_raw_address;
265 rm_ = no_reg; 301 rm_ = no_reg;
266 // Verify all Objects referred by code are NOT in new space. 302 // Verify all Objects referred by code are NOT in new space.
267 Object* obj = *handle; 303 Object* obj = *handle;
(...skipping 3960 matching lines...) Expand 10 before | Expand all | Expand 10 after
4228 DCHECK(is_uint12(offset)); 4264 DCHECK(is_uint12(offset));
4229 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); 4265 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset));
4230 } 4266 }
4231 } 4267 }
4232 4268
4233 4269
4234 } // namespace internal 4270 } // namespace internal
4235 } // namespace v8 4271 } // namespace v8
4236 4272
4237 #endif // V8_TARGET_ARCH_ARM 4273 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/assembler-arm-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698