diff --git a/src/wasm/wasm-code-specialization.cc b/src/wasm/wasm-code-specialization.cc index cd1d901d6f..112907a7f0 100644 --- a/src/wasm/wasm-code-specialization.cc +++ b/src/wasm/wasm-code-specialization.cc @@ -55,16 +55,6 @@ class PatchDirectCallsHelper { comp_mod->shared()->module()->functions[func_index].code.offset(); } - PatchDirectCallsHelper(NativeModule* native_module, Code* code) - : source_pos_it(code->SourcePositionTable()), decoder(nullptr, nullptr) { - FixedArray* deopt_data = code->deoptimization_data(); - DCHECK_EQ(2, deopt_data->length()); - WasmSharedModuleData* shared = native_module->compiled_module()->shared(); - int func_index = Smi::ToInt(deopt_data->get(1)); - func_bytes = shared->module_bytes()->GetChars() + - shared->module()->functions[func_index].code.offset(); - } - SourcePositionTableIterator source_pos_it; Decoder decoder; const byte* func_bytes; @@ -88,12 +78,6 @@ void CodeSpecialization::RelocateDirectCalls(NativeModule* native_module) { relocate_direct_calls_module_ = native_module; } -void CodeSpecialization::RelocatePointer(Address old_ptr, Address new_ptr) { - DCHECK_EQ(0, pointers_to_relocate_.count(old_ptr)); - DCHECK_EQ(0, pointers_to_relocate_.count(new_ptr)); - pointers_to_relocate_.insert(std::make_pair(old_ptr, new_ptr)); -} - bool CodeSpecialization::ApplyToWholeModule(NativeModule* native_module, ICacheFlushMode icache_flush_mode) { DisallowHeapAllocation no_gc; @@ -168,14 +152,12 @@ bool CodeSpecialization::ApplyToWasmCode(wasm::WasmCode* code, DCHECK_EQ(wasm::WasmCode::kFunction, code->kind()); bool reloc_direct_calls = relocate_direct_calls_module_ != nullptr; - bool reloc_pointers = pointers_to_relocate_.size() > 0; int reloc_mode = 0; auto add_mode = [&reloc_mode](bool cond, RelocInfo::Mode mode) { if (cond) reloc_mode |= RelocInfo::ModeMask(mode); }; add_mode(reloc_direct_calls, RelocInfo::WASM_CALL); - add_mode(reloc_pointers, RelocInfo::WASM_GLOBAL_HANDLE); base::Optional patch_direct_calls_helper; bool changed = false; @@ -209,16 +191,6 @@ bool CodeSpecialization::ApplyToWasmCode(wasm::WasmCode* code, icache_flush_mode); changed = true; } break; - case RelocInfo::WASM_GLOBAL_HANDLE: { - DCHECK(reloc_pointers); - Address old_ptr = it.rinfo()->global_handle(); - auto entry = pointers_to_relocate_.find(old_ptr); - if (entry != pointers_to_relocate_.end()) { - Address new_ptr = entry->second; - it.rinfo()->set_global_handle(new_ptr, icache_flush_mode); - changed = true; - } - } break; default: UNREACHABLE(); } diff --git a/src/wasm/wasm-code-specialization.h b/src/wasm/wasm-code-specialization.h index a8f0a76010..927e3ed800 100644 --- a/src/wasm/wasm-code-specialization.h +++ b/src/wasm/wasm-code-specialization.h @@ -32,9 +32,6 @@ class CodeSpecialization { void RelocateWasmContextReferences(Address new_context); // Update all direct call sites based on the code table in the given instance. void RelocateDirectCalls(NativeModule* module); - // Relocate an arbitrary object (e.g. function table). - void RelocatePointer(Address old_obj, Address new_obj); - // Apply all relocations and patching to all code in the instance (wasm code // and exported functions). bool ApplyToWholeModule(NativeModule*, @@ -47,8 +44,6 @@ class CodeSpecialization { Address new_wasm_context_address_ = 0; NativeModule* relocate_direct_calls_module_ = nullptr; - - std::unordered_map pointers_to_relocate_; }; } // namespace wasm