Commit ec9cba98 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[liftoff] Make LiftoffAssembler independent of Isolate.

R=clemensh@chromium.org

Change-Id: Ia3856921a707e7d58d55a74d3f14cbdc0d69eaa5
Reviewed-on: https://chromium-review.googlesource.com/1124332
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54168}
parent 81186ff4
......@@ -336,12 +336,18 @@ void LiftoffAssembler::CacheState::Split(const CacheState& source) {
*this = source;
}
namespace {
constexpr Assembler::Options DefaultLiftoffOptions() {
return Assembler::Options{};
}
} // namespace
// TODO(clemensh): Provide a reasonably sized buffer, based on wasm function
// size.
// TODO(mstarzinger): The Isolate is not passed to the base class constructor
// and only used to derive the default options. Remove the Isolate entirely.
LiftoffAssembler::LiftoffAssembler(Isolate* isolate)
: TurboAssembler(nullptr, Assembler::DefaultOptions(isolate), nullptr, 0,
LiftoffAssembler::LiftoffAssembler()
: TurboAssembler(nullptr, DefaultLiftoffOptions(), nullptr, 0,
CodeObjectRequired::kNo) {
set_trap_on_abort(true); // Avoid calls to Abort.
}
......
......@@ -247,7 +247,7 @@ class LiftoffAssembler : public TurboAssembler {
CacheState(const CacheState&) = delete;
};
explicit LiftoffAssembler(Isolate* isolate);
LiftoffAssembler();
~LiftoffAssembler();
LiftoffRegister PopToRegister(LiftoffRegList pinned = {});
......
......@@ -18,7 +18,7 @@ namespace wasm {
class LiftoffCompilationUnit final {
public:
explicit LiftoffCompilationUnit(WasmCompilationUnit* wasm_unit)
: wasm_unit_(wasm_unit), asm_(wasm_unit->isolate_) {}
: wasm_unit_(wasm_unit) {}
bool ExecuteCompilation();
wasm::WasmCode* FinishCompilation(wasm::ErrorThrower*);
......
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