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) { ...@@ -135,7 +135,7 @@ void WasmCompilationUnit::SwitchMode(ExecutionTier new_mode) {
} }
// static // static
WasmCode* WasmCompilationUnit::CompileWasmFunction( bool WasmCompilationUnit::CompileWasmFunction(
Isolate* isolate, NativeModule* native_module, WasmFeatures* detected, Isolate* isolate, NativeModule* native_module, WasmFeatures* detected,
ErrorThrower* thrower, const WasmFunction* function, ExecutionTier mode) { ErrorThrower* thrower, const WasmFunction* function, ExecutionTier mode) {
ModuleWireBytes wire_bytes(native_module->wire_bytes()); ModuleWireBytes wire_bytes(native_module->wire_bytes());
...@@ -149,9 +149,9 @@ WasmCode* WasmCompilationUnit::CompileWasmFunction( ...@@ -149,9 +149,9 @@ WasmCode* WasmCompilationUnit::CompileWasmFunction(
unit.ExecuteCompilation(&env, detected); unit.ExecuteCompilation(&env, detected);
if (unit.failed()) { if (unit.failed()) {
unit.ReportError(thrower); unit.ReportError(thrower);
return nullptr; return false;
} }
return unit.result(); return true;
} }
void WasmCompilationUnit::SetResult(WasmCode* code) { void WasmCompilationUnit::SetResult(WasmCode* code) {
......
...@@ -55,10 +55,10 @@ class WasmCompilationUnit final { ...@@ -55,10 +55,10 @@ class WasmCompilationUnit final {
void ReportError(ErrorThrower* thrower) const; void ReportError(ErrorThrower* thrower) const;
static WasmCode* CompileWasmFunction( static bool CompileWasmFunction(Isolate* isolate, NativeModule* native_module,
Isolate* isolate, NativeModule* native_module, WasmFeatures* detected, WasmFeatures* detected, ErrorThrower* thrower,
ErrorThrower* thrower, const WasmFunction* function, const WasmFunction* function,
ExecutionTier = GetDefaultExecutionTier()); ExecutionTier = GetDefaultExecutionTier());
private: private:
friend class LiftoffCompilationUnit; friend class LiftoffCompilationUnit;
......
...@@ -652,9 +652,9 @@ void CompileSequentially(Isolate* isolate, NativeModule* native_module, ...@@ -652,9 +652,9 @@ void CompileSequentially(Isolate* isolate, NativeModule* native_module,
if (func.imported) continue; // Imports are compiled at instantiation time. if (func.imported) continue; // Imports are compiled at instantiation time.
// Compile the function. // Compile the function.
WasmCode* code = WasmCompilationUnit::CompileWasmFunction( bool success = WasmCompilationUnit::CompileWasmFunction(
isolate, native_module, &detected, thrower, &func); isolate, native_module, &detected, thrower, &func);
if (code == nullptr) { if (!success) {
TruncatedUserString<> name(wire_bytes.GetNameOrNull(&func, module)); TruncatedUserString<> name(wire_bytes.GetNameOrNull(&func, module));
thrower->CompileError("Compilation of #%d:%.*s failed.", i, name.length(), thrower->CompileError("Compilation of #%d:%.*s failed.", i, name.length(),
name.start()); name.start());
......
...@@ -176,10 +176,9 @@ bool WasmEngine::CompileFunction(Isolate* isolate, NativeModule* native_module, ...@@ -176,10 +176,9 @@ bool WasmEngine::CompileFunction(Isolate* isolate, NativeModule* native_module,
ErrorThrower thrower(isolate, "Manually requested tier up"); ErrorThrower thrower(isolate, "Manually requested tier up");
// Note we assume that "one-off" compilations can discard detected features. // Note we assume that "one-off" compilations can discard detected features.
WasmFeatures detected = kNoWasmFeatures; WasmFeatures detected = kNoWasmFeatures;
WasmCode* ret = WasmCompilationUnit::CompileWasmFunction( return WasmCompilationUnit::CompileWasmFunction(
isolate, native_module, &detected, &thrower, isolate, native_module, &detected, &thrower,
&native_module->module()->functions[function_index], tier); &native_module->module()->functions[function_index], tier);
return ret != nullptr;
} }
std::shared_ptr<NativeModule> WasmEngine::ExportNativeModule( 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