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

Unified Diff: src/assembler.cc

Issue 2056633002: [wasm] Separate compilation from instantiation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: feedback 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/assembler.h ('k') | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.cc
diff --git a/src/assembler.cc b/src/assembler.cc
index fa2d38fed2231689a7abe13b2387250ce18c5342..49ac6774e018d25f03c8e026f381a4c6ab6b42a9 100644
--- a/src/assembler.cc
+++ b/src/assembler.cc
@@ -372,6 +372,49 @@ const int kNonstatementPositionTag = 1;
const int kStatementPositionTag = 2;
const int kDeoptReasonTag = 3;
+void RelocInfo::update_wasm_memory_reference(
+ Address old_base, Address new_base, uint32_t old_size, uint32_t new_size,
+ ICacheFlushMode icache_flush_mode) {
+ DCHECK(IsWasmMemoryReference(rmode_) || IsWasmMemorySizeReference(rmode_));
+ if (IsWasmMemoryReference(rmode_)) {
+ Address updated_reference;
+ DCHECK(old_size == 0 || Memory::IsAddressInRange(
+ old_base, wasm_memory_reference(), old_size));
+ updated_reference = new_base + (wasm_memory_reference() - old_base);
+ DCHECK(new_size == 0 ||
+ Memory::IsAddressInRange(new_base, updated_reference, new_size));
+ unchecked_update_wasm_memory_reference(updated_reference,
+ icache_flush_mode);
+ } else if (IsWasmMemorySizeReference(rmode_)) {
+ uint32_t updated_size_reference;
+ DCHECK(old_size == 0 || wasm_memory_size_reference() <= old_size);
+ updated_size_reference =
+ new_size + (wasm_memory_size_reference() - old_size);
+ DCHECK(updated_size_reference <= new_size);
+ unchecked_update_wasm_memory_size(updated_size_reference,
+ icache_flush_mode);
+ } else {
+ UNREACHABLE();
+ }
+ if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
+ Assembler::FlushICache(isolate_, pc_, sizeof(int64_t));
+ }
+}
+
+void RelocInfo::update_wasm_global_reference(
+ Address old_base, Address new_base, ICacheFlushMode icache_flush_mode) {
+ DCHECK(IsWasmGlobalReference(rmode_));
+ Address updated_reference;
+ DCHECK(reinterpret_cast<uintptr_t>(old_base) <=
+ reinterpret_cast<uintptr_t>(wasm_global_reference()));
+ updated_reference = new_base + (wasm_global_reference() - old_base);
+ DCHECK(reinterpret_cast<uintptr_t>(new_base) <=
+ reinterpret_cast<uintptr_t>(updated_reference));
+ unchecked_update_wasm_memory_reference(updated_reference, icache_flush_mode);
+ if (icache_flush_mode != SKIP_ICACHE_FLUSH) {
+ Assembler::FlushICache(isolate_, pc_, sizeof(int32_t));
+ }
+}
uint32_t RelocInfoWriter::WriteLongPCJump(uint32_t pc_delta) {
// Return if the pc_delta can fit in kSmallPCDeltaBits bits.
« no previous file with comments | « src/assembler.h ('k') | src/ia32/assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698