Commit 076ff421 authored by Vincent Belliard's avatar Vincent Belliard Committed by Commit Bot

[arm64][Liftoff] add AbortCompilation

When a liftoff function bails out after generating some constant pool,
this avoids to trigger a check in the Assembler destructor.

Bug: v8:6600

Change-Id: I79c595605bc0add1f3f5617ac7feedf162081d8a
Reviewed-on: https://chromium-review.googlesource.com/1026647Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Vincent Belliard <vincent.belliard@arm.com>
Cr-Commit-Position: refs/heads/master@{#52815}
parent b8166b34
......@@ -1839,6 +1839,12 @@ wasm::WasmCode* LiftoffCompilationUnit::FinishCompilation(
return code;
}
void LiftoffCompilationUnit::AbortCompilation() {
// The compilation is aborted. Put the assembler in a clean mode before
// its deletion.
asm_.FinishCode();
}
#undef __
#undef TRACE
#undef WASM_INSTANCE_OBJECT_OFFSET
......
......@@ -22,6 +22,7 @@ class LiftoffCompilationUnit final {
bool ExecuteCompilation();
wasm::WasmCode* FinishCompilation(wasm::ErrorThrower*);
void AbortCompilation();
private:
WasmCompilationUnit* const wasm_unit_;
......
......@@ -117,6 +117,7 @@ void WasmCompilationUnit::SwitchMode(CompilationMode new_mode) {
return;
case CompilationMode::kTurbofan:
DCHECK(!turbofan_unit_);
if (liftoff_unit_ != nullptr) liftoff_unit_->AbortCompilation();
liftoff_unit_.reset();
turbofan_unit_.reset(new compiler::TurbofanWasmCompilationUnit(this));
return;
......
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