Commit 2725f395 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Remove {WasmExportedFunction::GetWasmCode}

With lazy compilation, not every exported function has code assiciated
with it. {WasmExportedFunction} provides the function index though,
which can be used to check whether code exists and access that code.

R=mstarzinger@chromium.org

Bug: v8:7758
Change-Id: Id80285fec46bf5be4af49875734aa0fe28d732c9
Reviewed-on: https://chromium-review.googlesource.com/1090273Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53576}
parent 1e7d34b8
......@@ -1053,9 +1053,14 @@ RUNTIME_FUNCTION(Runtime_IsLiftoffFunction) {
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
CHECK(WasmExportedFunction::IsWasmExportedFunction(*function));
wasm::WasmCode* wasm_code =
WasmExportedFunction::cast(*function)->GetWasmCode();
return isolate->heap()->ToBoolean(wasm_code->is_liftoff());
Handle<WasmExportedFunction> exp_fun =
Handle<WasmExportedFunction>::cast(function);
wasm::NativeModule* native_module =
exp_fun->instance()->compiled_module()->GetNativeModule();
uint32_t func_index = exp_fun->function_index();
return isolate->heap()->ToBoolean(
native_module->has_code(func_index) &&
native_module->code(func_index)->is_liftoff());
}
RUNTIME_FUNCTION(Runtime_CompleteInobjectSlackTracking) {
......
......@@ -990,13 +990,6 @@ Handle<WasmExportedFunction> WasmExportedFunction::New(
return Handle<WasmExportedFunction>::cast(js_function);
}
wasm::WasmCode* WasmExportedFunction::GetWasmCode() {
Address target = GetWasmCallTarget();
wasm::WasmCode* wasm_code =
GetIsolate()->wasm_engine()->code_manager()->LookupCode(target);
return wasm_code;
}
Address WasmExportedFunction::GetWasmCallTarget() {
return instance()->GetCallTarget(function_index());
}
......
......@@ -393,11 +393,6 @@ class WasmExportedFunction : public JSFunction {
int func_index, int arity,
Handle<Code> export_wrapper);
// TODO(clemensh): Remove this. There might not be a WasmCode object available
// yet.
// TODO(all): Replace all uses by {GetWasmCallTarget()}.
wasm::WasmCode* GetWasmCode();
Address GetWasmCallTarget();
};
......
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