5#ifndef V8_WASM_INTERPRETER_WASM_INTERPRETER_RUNTIME_INL_H_
6#define V8_WASM_INTERPRETER_WASM_INTERPRETER_RUNTIME_INL_H_
8#if !V8_ENABLE_WEBASSEMBLY
9#error This header should only be included if WebAssembly is enabled.
27 DCHECK_GE(std::numeric_limits<uintptr_t>::max(),
36 uint64_t index, uint64_t* size,
Address* out_address)
const {
39 DCHECK_GE(std::numeric_limits<uintptr_t>::max(),
55 uint32_t index)
const {
60 uint32_t global_index = 0;
61 std::tie(global_buffer, global_index) =
72 uint32_t global_index = 0;
73 std::tie(global_buffer, global_index) =
75 global_buffer->set(global_index, *ref);
87 return !
module_->memories.empty() &&
module_->memories[0].is_memory64();
104 uint32_t func_index) {
129 return i::IsWasmNull(*obj, isolate);
140 uint32_t index)
const {
147 uint32_t array_index)
const {
157 const uint8_t* current_bytecode,
const uint8_t*& code) {
168 SetTrap(TrapReason::kTrapUnreachable, code);
176 SetTrap(TrapReason::kTrapUnreachable, code);
186 v8_flags.drumbrake_fuzzer_timeout_limit_ms))) {
190 SetTrap(TrapReason::kTrapUnreachable, code);
static constexpr TimeDelta FromMilliseconds(int64_t milliseconds)
StackGuard * stack_guard()
Tagged< Object > TerminateExecution()
v8::internal::Factory * factory()
Tagged< Object > StackOverflow()
bool HasTerminationRequest()
Tagged< Object > HandleInterrupts(InterruptLevel level=InterruptLevel::kAnyEffect)
V8_INLINE bool InterruptRequested()
bool HasOverflowed() const
V8_EXPORT_PRIVATE wasm::WasmValue GetElement(uint32_t index)
static DirectHandle< WasmFuncRef > GetOrCreateFuncRef(Isolate *isolate, DirectHandle< WasmTrustedInstanceData > trusted_instance_data, int function_index)
WasmInterpreter interpreter_
WasmInterpreterThread::State ContinueExecution(WasmInterpreterThread *thread, bool called_from_js)
constexpr bool is_reference() const
DirectHandle< Object > GetGlobalRef(uint32_t index) const
void SetTrap(TrapReason trap_reason, pc_t trap_pc)
Address EffectiveAddress(uint64_t index) const
DirectHandle< WasmTrustedInstanceData > wasm_trusted_instance_data() const
Tagged< Object > GetNullValue(const ValueType obj_type) const
uint64_t MemorySize() const
std::vector< uint8_t * > global_addresses_
DirectHandle< Object > GetFunctionRef(uint32_t index) const
IndirectHandle< WasmInstanceObject > instance_object_
WasmBytecode * GetFunctionBytecode(uint32_t func_index)
base::TimeTicks fuzzer_start_time_
WasmInterpreter::CodeMap * codemap_
const WasmModule * module_
static bool IsNull(Isolate *isolate, const WasmRef obj, const ValueType obj_type)
WasmInterpreterThread * current_thread_
DirectHandle< Object > GetWasmArrayRefElement(Tagged< WasmArray > array, uint32_t index) const
void InitMemoryAddresses()
void DataDrop(uint32_t index)
const ArrayType * GetArrayType(uint32_t array_index) const
bool WasmStackCheck(const uint8_t *current_bytecode, const uint8_t *&code)
void ElemDrop(uint32_t index)
FrameState current_frame_
bool BoundsCheckMemRange(uint64_t index, uint64_t *size, Address *out_address) const
bool IsRefNull(DirectHandle< Object > ref) const
void SetGlobalRef(uint32_t index, DirectHandle< Object > ref) const
size_t GetMemorySize() const
uint8_t * GetGlobalAddress(uint32_t index)
bool IsNullTypecheck(const WasmRef obj, const ValueType obj_type) const
void SetCurrentFrame(const FrameState &frame_state)
WasmBytecode * GetFunctionBytecode(uint32_t func_index)
WasmInterpreterThread::State ContinueExecution(WasmInterpreterThread *thread, bool called_from_js)
bool ClampToBounds(T index, T *length, T max)
constexpr IndependentHeapType kWasmNullExternRef
constexpr IndependentHeapType kWasmExternRef
constexpr size_t kWasmPageSize
V8_INLINE IndirectHandle< T > handle(Tagged< T > object, Isolate *isolate)
V8_INLINE DirectHandle< T > direct_handle(Tagged< T > object, Isolate *isolate)
V8_EXPORT_PRIVATE FlagValues v8_flags
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset IsNull(value)||IsJSProxy(value)||IsWasmObject(value)||(IsJSObject(value) &&(HeapLayout
#define DCHECK_GE(v1, v2)
#define DCHECK(condition)
#define DCHECK_LT(v1, v2)
#define V8_UNLIKELY(condition)