5#ifndef V8_COMPILER_TURBOSHAFT_WASM_ASSEMBLER_HELPERS_H_
6#define V8_COMPILER_TURBOSHAFT_WASM_ASSEMBLER_HELPERS_H_
8#if !V8_ENABLE_WEBASSEMBLY
9#error This header should only be included if WebAssembly is enabled.
18#define DEFINE_TYPE(type, name, CamelName) using k##CamelName##Type = type;
23template <
typename AssemblerT>
28 return assembler.Load(
32 return assembler.BitcastWordPtrToTagged(assembler.Load(
38#define LOAD_INSTANCE_FIELD(instance, name, representation) \
39 __ Load(instance, LoadOp::Kind::TaggedBase(), representation, \
40 WasmTrustedInstanceData::k##name##Offset)
42#define LOAD_PROTECTED_INSTANCE_FIELD(instance, name, type) \
43 V<type>::Cast(__ LoadProtectedPointerField( \
44 instance, LoadOp::Kind::TaggedBase(), \
45 WasmTrustedInstanceData::kProtected##name##Offset))
47#define LOAD_IMMUTABLE_PROTECTED_INSTANCE_FIELD(instance, name, type) \
48 V<type>::Cast(__ LoadProtectedPointerField( \
49 instance, LoadOp::Kind::TaggedBase().Immutable(), \
50 WasmTrustedInstanceData::kProtected##name##Offset))
52#define LOAD_IMMUTABLE_INSTANCE_FIELD(instance, name, representation) \
53 __ Load(instance, LoadOp::Kind::TaggedBase().Immutable(), representation, \
54 WasmTrustedInstanceData::k##name##Offset)
56#define LOAD_ROOT(name) \
57 V<compiler::turboshaft::RootTypes::k##name##Type>::Cast( \
58 LoadRootHelper(Asm(), RootIndex::k##name))
static constexpr int root_slot_offset(RootIndex root_index)
static constexpr bool IsImmortalImmovable(RootIndex root_index)
static constexpr MemoryRepresentation UintPtr()
OpIndex LoadRootHelper(AssemblerT &&assembler, RootIndex index)
static constexpr Kind RawAligned()
constexpr Kind Immutable() const
#define DEFINE_TYPE(type, name, CamelName)