5#ifndef V8_WASM_COMPILATION_ENVIRONMENT_H_
6#define V8_WASM_COMPILATION_ENVIRONMENT_H_
8#if !V8_ENABLE_WEBASSEMBLY
9#error This header should only be included if WebAssembly is enabled.
32struct UnpublishedWasmCode;
43#if V8_TARGET_ARCH_ARM64 && !V8_OS_MACOS
106 kReleaseAfterFinalEvent =
true,
107 kKeepAfterFinalEvent =
false
115 return kReleaseAfterFinalEvent;
127 void operator delete(
void* ptr) { ::operator
delete(ptr); }
131 void InitCompileJob();
133 void CancelCompilation();
135 void CancelInitialCompilation();
139 void SetWireBytesStorage(std::shared_ptr<WireBytesStorage>);
141 std::shared_ptr<WireBytesStorage> GetWireBytesStorage()
const;
143 void AddCallback(std::unique_ptr<CompilationEventCallback>
callback);
151 void TierUpAllFunctions();
156 void AllowAnotherTopTierJob(uint32_t func_index);
157 void AllowAnotherTopTierJobForAllFunctions();
160 bool baseline_compilation_finished()
const;
162 void set_compilation_id(
int compilation_id);
164 size_t EstimateCurrentMemoryConsumption()
const;
166 std::vector<WasmCode*> PublishCode(
183 static std::unique_ptr<CompilationState> New(
184 const std::shared_ptr<NativeModule>&, std::shared_ptr<Counters>,
virtual void call(CompilationEvent event)=0
virtual ReleaseAfterFinalEvent release_after_final_event()
virtual ~CompilationEventCallback()=default
CompilationState()=delete
virtual ~WireBytesStorage()=default
virtual std::optional< ModuleWireBytes > GetModuleBytes() const =0
virtual base::Vector< const uint8_t > GetCode(WireBytesRef) const =0
@ kFinishedBaselineCompilation
@ kFinishedCompilationChunk
constexpr bool kPartialOOBWritesAreNoops
#define V8_EXPORT_PRIVATE
const WasmEnabledFeatures enabled_features
std::atomic< const MachineSignature * > * fast_api_signatures
const std::atomic< Address > * fast_api_targets
static CompilationEnv ForModule(const NativeModule *native_module)
constexpr CompilationEnv(const WasmModule *module, WasmEnabledFeatures enabled_features, std::atomic< Address > *fast_api_targets, std::atomic< const MachineSignature * > *fast_api_signatures)
static constexpr CompilationEnv NoModuleAllFeaturesForTesting()
const WasmModule *const module
#define V8_WARN_UNUSED_RESULT