5#ifndef V8_WASM_WASM_IMPORT_WRAPPER_CACHE_H_
6#define V8_WASM_WASM_IMPORT_WRAPPER_CACHE_H_
8#if !V8_ENABLE_WEBASSEMBLY
9#error This header should only be included if WebAssembly is enabled.
12#include <unordered_map>
46 key.type_index.index,
key.expected_arity);
54 : cache_(cache), guard_(&cache->
mutex_) {}
71 void Free(std::vector<WasmCode*>& wrappers);
93 int expected_arity,
Suspend suspend);
98 std::unordered_map<CacheKey, WasmCode*, CacheKeyHash>
entry_map_;
size_t operator()(const CacheKey &key) const
ModificationScope(WasmImportWrapperCache *cache)
WasmImportWrapperCache *const cache_
WasmCode * Lookup(Address pc) const
std::unordered_map< CacheKey, WasmCode *, CacheKeyHash > entry_map_
size_t EstimateCurrentMemoryConsumption() const
V8_EXPORT_PRIVATE WasmCode * MaybeGet(ImportCallKind kind, CanonicalTypeIndex type_index, int expected_arity, Suspend suspend) const
WasmCode * CompileWasmImportCallWrapper(Isolate *isolate, ImportCallKind kind, const CanonicalSig *sig, CanonicalTypeIndex sig_index, bool source_positions, int expected_arity, Suspend suspend)
void Free(std::vector< WasmCode * > &wrappers)
void LazyInitialize(Isolate *triggering_isolate)
WasmImportWrapperCache()=default
V8_EXPORT_PRIVATE WasmCode * FindWrapper(WasmCodePointer call_target)
std::map< Address, WasmCode * > codes_
~WasmImportWrapperCache()=default
std::unique_ptr< WasmCodeAllocator > code_allocator_
void LogForIsolate(Isolate *isolate)
SourcePositionTable * source_positions
ZoneVector< RpoNumber > & result
V8_INLINE size_t hash_combine(size_t seed, size_t hash)
kWasmInternalFunctionIndirectPointerTag kProtectedInstanceDataOffset sig
#define V8_EXPORT_PRIVATE
bool operator==(const CacheKey &rhs) const =default
CanonicalTypeIndex type_index
CacheKey(ImportCallKind kind, CanonicalTypeIndex type_index, int expected_arity, Suspend suspend)
std::unique_ptr< ValueMirror > key