v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
wasm-value.h File Reference
#include "src/base/memory.h"
#include "src/common/simd128.h"
#include "src/handles/handles.h"
#include "src/utils/boxed-float.h"
#include "src/wasm/value-type.h"
#include "third_party/fp16/src/include/fp16.h"
Include dependency graph for wasm-value.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  v8::internal::wasm::WasmValue
 

Namespaces

namespace  v8
 
namespace  v8::internal
 
namespace  v8::internal::wasm
 

Macros

#define FOREACH_PRIMITIVE_WASMVAL_TYPE(V)
 
#define DEFINE_TYPE_SPECIFIC_METHODS(name, localtype, ctype)
 
#define DECLARE_CAST(name, localtype, ctype, ...)
 

Functions

 v8::internal::wasm::ASSERT_TRIVIALLY_COPYABLE (DirectHandle< Object >)
 

Macro Definition Documentation

◆ DECLARE_CAST

#define DECLARE_CAST ( name,
localtype,
ctype,
... )
Value:
template <> \
inline ctype WasmValue::to_unchecked() const { \
return to_##name##_unchecked(); \
} \
template <> \
inline ctype WasmValue::to() const { \
return to_##name(); \
}
const char * name
Definition builtins.cc:39

Definition at line 184 of file wasm-value.h.

◆ DEFINE_TYPE_SPECIFIC_METHODS

#define DEFINE_TYPE_SPECIFIC_METHODS ( name,
localtype,
ctype )
Value:
explicit WasmValue(ctype v) : type_(localtype), bit_pattern_{} { \
static_assert(sizeof(ctype) <= sizeof(bit_pattern_), \
"size too big for WasmValue"); \
base::WriteUnalignedValue<ctype>(reinterpret_cast<Address>(bit_pattern_), \
v); \
} \
ctype to_##name() const { \
DCHECK_EQ(localtype, type_); \
return to_##name##_unchecked(); \
} \
ctype to_##name##_unchecked() const { \
return base::ReadUnalignedValue<ctype>( \
reinterpret_cast<Address>(bit_pattern_)); \
}
const ObjectRef type_
uintptr_t Address
Definition memory.h:13

Definition at line 51 of file wasm-value.h.

◆ FOREACH_PRIMITIVE_WASMVAL_TYPE

#define FOREACH_PRIMITIVE_WASMVAL_TYPE ( V)
Value:
V(i8, kWasmI8, int8_t) \
V(i16, kWasmI16, int16_t) \
V(i32, kWasmI32, int32_t) \
V(u32, kWasmI32, uint32_t) \
V(i64, kWasmI64, int64_t) \
V(u64, kWasmI64, uint64_t) \
V(f16, kWasmF16, uint16_t) \
V(f32, kWasmF32, float) \
V(f32_boxed, kWasmF32, Float32) \
V(f64, kWasmF64, double) \
V(f64_boxed, kWasmF64, Float64) \
V(s128, kWasmS128, Simd128)
#define V(Name)

Definition at line 30 of file wasm-value.h.