[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/1026647
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Vincent Belliard <vincent.belliard@arm.com>
Cr-Commit-Position: refs/heads/master@{#52815}
This commit is contained in:
Vincent Belliard 2018-04-25 13:52:51 -07:00 committed by Commit Bot
parent b8166b34fd
commit 076ff421e5
3 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -22,6 +22,7 @@ class LiftoffCompilationUnit final {
bool ExecuteCompilation();
wasm::WasmCode* FinishCompilation(wasm::ErrorThrower*);
void AbortCompilation();
private:
WasmCompilationUnit* const wasm_unit_;

View File

@ -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;