1 // Copyright 2018 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_WASM_BASELINE_LIFTOFF_COMPILER_H_ 6 #define V8_WASM_BASELINE_LIFTOFF_COMPILER_H_ 7 8 #include "src/base/macros.h" 9 10 namespace v8 { 11 namespace internal { 12 namespace wasm { 13 14 struct WasmFeatures; 15 class ErrorThrower; 16 class WasmCode; 17 class WasmCompilationUnit; 18 19 class LiftoffCompilationUnit final { 20 public: LiftoffCompilationUnit(WasmCompilationUnit * wasm_unit)21 explicit LiftoffCompilationUnit(WasmCompilationUnit* wasm_unit) 22 : wasm_unit_(wasm_unit) {} 23 24 bool ExecuteCompilation(WasmFeatures* detected); 25 WasmCode* FinishCompilation(ErrorThrower*); 26 27 private: 28 WasmCompilationUnit* const wasm_unit_; 29 30 // Result of compilation: 31 WasmCode* code_; 32 33 DISALLOW_COPY_AND_ASSIGN(LiftoffCompilationUnit); 34 }; 35 36 } // namespace wasm 37 } // namespace internal 38 } // namespace v8 39 40 #endif // V8_WASM_BASELINE_LIFTOFF_COMPILER_H_ 41