Commit b008859d authored by Ben L. Titzer's avatar Ben L. Titzer Committed by Commit Bot

[wasm] Remove dead WasmCompiledModule::ResetGCModel()

R=clemensh@chromium.org,mstarzinger@chromium.org

Bug: 
Change-Id: I1bc451f4d6f70f69e91217d3e44cecedcbdf07d4
Reviewed-on: https://chromium-review.googlesource.com/880951Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50806}
parent 79acf578
......@@ -1473,65 +1473,6 @@ wasm::NativeModule* WasmCompiledModule::GetNativeModule() const {
return Managed<wasm::NativeModule>::cast(native_module())->get();
}
void WasmCompiledModule::ResetGCModel(Isolate* isolate,
WasmCompiledModule* compiled_module) {
DisallowHeapAllocation no_gc;
TRACE("Resetting %d\n", compiled_module->instance_id());
Object* undefined = *isolate->factory()->undefined_value();
Object* fct_obj = compiled_module->code_table();
if (fct_obj != nullptr && fct_obj != undefined) {
// Patch code to update memory references, global references, and function
// table references.
Zone specialization_zone(isolate->allocator(), ZONE_NAME);
wasm::CodeSpecialization code_specialization(isolate, &specialization_zone);
// Reset function tables.
if (compiled_module->has_function_tables()) {
FixedArray* function_tables = compiled_module->function_tables();
FixedArray* empty_function_tables =
compiled_module->empty_function_tables();
if (function_tables != empty_function_tables) {
DCHECK_EQ(function_tables->length(), empty_function_tables->length());
for (int i = 0, e = function_tables->length(); i < e; ++i) {
GlobalHandleAddress func_addr =
WasmCompiledModule::GetTableValue(function_tables, i);
code_specialization.RelocatePointer(
func_addr,
WasmCompiledModule::GetTableValue(empty_function_tables, i));
}
compiled_module->set_function_tables(empty_function_tables);
}
}
// TODO(6792): No longer needed once WebAssembly code is off heap.
CodeSpaceMemoryModificationScope modification_scope(isolate->heap());
FixedArray* functions = FixedArray::cast(fct_obj);
for (int i = compiled_module->num_imported_functions(),
end = functions->length();
i < end; ++i) {
Code* code = Code::cast(functions->get(i));
// Skip lazy compile stubs.
if (code->builtin_index() == Builtins::kWasmCompileLazy) continue;
if (code->kind() != Code::WASM_FUNCTION) {
// From here on, there should only be wrappers for exported functions.
for (; i < end; ++i) {
DCHECK_EQ(Code::JS_TO_WASM_FUNCTION,
Code::cast(functions->get(i))->kind());
}
break;
}
bool changed = code_specialization.ApplyToWasmCode(
WasmCodeWrapper(handle(code)), SKIP_ICACHE_FLUSH);
// TODO(wasm): Check if this is faster than passing FLUSH_ICACHE_IF_NEEDED
// above.
if (changed) {
Assembler::FlushICache(isolate, code->instruction_start(),
code->instruction_size());
}
}
}
}
void WasmCompiledModule::InitId() {
#if DEBUG
static uint32_t instance_id_counter = 0;
......
......@@ -519,9 +519,6 @@ class WasmCompiledModule : public FixedArray {
Handle<WasmCompiledModule> module);
static void Reset(Isolate* isolate, WasmCompiledModule* module);
// TODO(mtrofin): delete this when we don't need FLAG_wasm_jit_to_native
static void ResetGCModel(Isolate* isolate, WasmCompiledModule* module);
wasm::NativeModule* GetNativeModule() const;
void InsertInChain(WasmModuleObject*);
void RemoveFromChain();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment