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

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

Issue 2062003002: [wasm] Relocatable Globals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: {float|double}_t -> {float|double} 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 | « no previous file | src/arm64/assembler-arm64.cc » ('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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 Address RelocInfo::wasm_memory_reference() { 242 Address RelocInfo::wasm_memory_reference() {
243 DCHECK(IsWasmMemoryReference(rmode_)); 243 DCHECK(IsWasmMemoryReference(rmode_));
244 return Assembler::target_address_at(pc_, host_); 244 return Assembler::target_address_at(pc_, host_);
245 } 245 }
246 246
247 uint32_t RelocInfo::wasm_memory_size_reference() { 247 uint32_t RelocInfo::wasm_memory_size_reference() {
248 DCHECK(IsWasmMemorySizeReference(rmode_)); 248 DCHECK(IsWasmMemorySizeReference(rmode_));
249 return reinterpret_cast<uint32_t>(Assembler::target_address_at(pc_, host_)); 249 return reinterpret_cast<uint32_t>(Assembler::target_address_at(pc_, host_));
250 } 250 }
251 251
252 Address RelocInfo::wasm_global_reference() {
253 DCHECK(IsWasmGlobalReference(rmode_));
254 return Assembler::target_address_at(pc_, host_);
255 }
256
252 void RelocInfo::update_wasm_memory_reference( 257 void RelocInfo::update_wasm_memory_reference(
253 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size, 258 Address old_base, Address new_base, uint32_t old_size, uint32_t new_size,
254 ICacheFlushMode icache_flush_mode) { 259 ICacheFlushMode icache_flush_mode) {
255 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_)); 260 DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_));
256 if (IsWasmMemoryReference(rmode_)) { 261 if (IsWasmMemoryReference(rmode_)) {
257 Address updated_memory_reference; 262 Address updated_memory_reference;
258 DCHECK(old_base <= wasm_memory_reference() && 263 DCHECK(old_base <= wasm_memory_reference() &&
259 wasm_memory_reference() < old_base + old_size); 264 wasm_memory_reference() < old_base + old_size);
260 updated_memory_reference = new_base + (wasm_memory_reference() - old_base); 265 updated_memory_reference = new_base + (wasm_memory_reference() - old_base);
261 DCHECK(new_base <= updated_memory_reference && 266 DCHECK(new_base <= updated_memory_reference &&
262 updated_memory_reference < new_base + new_size); 267 updated_memory_reference < new_base + new_size);
263 Assembler::set_target_address_at( 268 Assembler::set_target_address_at(
264 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode); 269 isolate_, pc_, host_, updated_memory_reference, icache_flush_mode);
265 } else if (IsWasmMemorySizeReference(rmode_)) { 270 } else if (IsWasmMemorySizeReference(rmode_)) {
266 uint32_t updated_size_reference; 271 uint32_t updated_size_reference;
267 DCHECK(wasm_memory_size_reference() <= old_size); 272 DCHECK(wasm_memory_size_reference() <= old_size);
268 updated_size_reference = 273 updated_size_reference =
269 new_size + (wasm_memory_size_reference() - old_size); 274 new_size + (wasm_memory_size_reference() - old_size);
270 DCHECK(updated_size_reference <= new_size); 275 DCHECK(updated_size_reference <= new_size);
271 Assembler::set_target_address_at( 276 Assembler::set_target_address_at(
272 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference), 277 isolate_, pc_, host_, reinterpret_cast<Address>(updated_size_reference),
273 icache_flush_mode); 278 icache_flush_mode);
274 } else { 279 } else {
275 UNREACHABLE(); 280 UNREACHABLE();
276 } 281 }
277 } 282 }
278 283
284 void RelocInfo::update_wasm_global_reference(
285 Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) {
286 DCHECK(IsWasmGlobalReference(rmode_));
287 Address updated_reference;
288 DCHECK(old_base <= wasm_global_reference());
289 updated_reference = new_base + (wasm_global_reference() - old_base);
290 DCHECK(new_base <= updated_reference);
291 Assembler::set_target_address_at(isolate_, pc_, host_, updated_reference,
292 icache_flush_mode);
293 }
294
279 // ----------------------------------------------------------------------------- 295 // -----------------------------------------------------------------------------
280 // Implementation of Operand and MemOperand 296 // Implementation of Operand and MemOperand
281 // See assembler-arm-inl.h for inlined constructors 297 // See assembler-arm-inl.h for inlined constructors
282 298
283 Operand::Operand(Handle<Object> handle) { 299 Operand::Operand(Handle<Object> handle) {
284 AllowDeferredHandleDereference using_raw_address; 300 AllowDeferredHandleDereference using_raw_address;
285 rm_ = no_reg; 301 rm_ = no_reg;
286 // Verify all Objects referred by code are NOT in new space. 302 // Verify all Objects referred by code are NOT in new space.
287 Object* obj = *handle; 303 Object* obj = *handle;
288 if (obj->IsHeapObject()) { 304 if (obj->IsHeapObject()) {
(...skipping 3986 matching lines...) Expand 10 before | Expand all | Expand 10 after
4275 DCHECK(is_uint12(offset)); 4291 DCHECK(is_uint12(offset));
4276 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset)); 4292 instr_at_put(pc, SetLdrRegisterImmediateOffset(instr, offset));
4277 } 4293 }
4278 } 4294 }
4279 4295
4280 4296
4281 } // namespace internal 4297 } // namespace internal
4282 } // namespace v8 4298 } // namespace v8
4283 4299
4284 #endif // V8_TARGET_ARCH_ARM 4300 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/assembler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698