Commit 9aee9ff8 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Remove unused WasmCode* return

For implementing wasm GC we need to revisit all places where we hold
WasmCode*. This CL reduces these places.

R=mstarzinger@chromium.org

Bug: v8:8217
Change-Id: I869e3c1817a3b9a24ab6aa281c0688bdf890dd33
Reviewed-on: https://chromium-review.googlesource.com/c/1297951Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56942}
parent 7103cd8b
......@@ -135,7 +135,7 @@ void WasmCompilationUnit::SwitchMode(ExecutionTier new_mode) {
}
// static
WasmCode* WasmCompilationUnit::CompileWasmFunction(
bool WasmCompilationUnit::CompileWasmFunction(
Isolate* isolate, NativeModule* native_module, WasmFeatures* detected,
ErrorThrower* thrower, const WasmFunction* function, ExecutionTier mode) {
ModuleWireBytes wire_bytes(native_module->wire_bytes());
......@@ -149,9 +149,9 @@ WasmCode* WasmCompilationUnit::CompileWasmFunction(
unit.ExecuteCompilation(&env, detected);
if (unit.failed()) {
unit.ReportError(thrower);
return nullptr;
return false;
}
return unit.result();
return true;
}
void WasmCompilationUnit::SetResult(WasmCode* code) {
......
......@@ -55,10 +55,10 @@ class WasmCompilationUnit final {
void ReportError(ErrorThrower* thrower) const;
static WasmCode* CompileWasmFunction(
Isolate* isolate, NativeModule* native_module, WasmFeatures* detected,
ErrorThrower* thrower, const WasmFunction* function,
ExecutionTier = GetDefaultExecutionTier());
static bool CompileWasmFunction(Isolate* isolate, NativeModule* native_module,
WasmFeatures* detected, ErrorThrower* thrower,
const WasmFunction* function,
ExecutionTier = GetDefaultExecutionTier());
private:
friend class LiftoffCompilationUnit;
......
......@@ -652,9 +652,9 @@ void CompileSequentially(Isolate* isolate, NativeModule* native_module,
if (func.imported) continue; // Imports are compiled at instantiation time.
// Compile the function.
WasmCode* code = WasmCompilationUnit::CompileWasmFunction(
bool success = WasmCompilationUnit::CompileWasmFunction(
isolate, native_module, &detected, thrower, &func);
if (code == nullptr) {
if (!success) {
TruncatedUserString<> name(wire_bytes.GetNameOrNull(&func, module));
thrower->CompileError("Compilation of #%d:%.*s failed.", i, name.length(),
name.start());
......
......@@ -176,10 +176,9 @@ bool WasmEngine::CompileFunction(Isolate* isolate, NativeModule* native_module,
ErrorThrower thrower(isolate, "Manually requested tier up");
// Note we assume that "one-off" compilations can discard detected features.
WasmFeatures detected = kNoWasmFeatures;
WasmCode* ret = WasmCompilationUnit::CompileWasmFunction(
return WasmCompilationUnit::CompileWasmFunction(
isolate, native_module, &detected, &thrower,
&native_module->module()->functions[function_index], tier);
return ret != nullptr;
}
std::shared_ptr<NativeModule> WasmEngine::ExportNativeModule(
......
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