v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
wasm-interpreter-objects-inl.h
Go to the documentation of this file.
1// Copyright 2024 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_WASM_INTERPRETER_WASM_INTERPRETER_OBJECTS_INL_H_
6#define V8_WASM_INTERPRETER_WASM_INTERPRETER_OBJECTS_INL_H_
7
8#if !V8_ENABLE_WEBASSEMBLY
9#error This header should only be included if WebAssembly is enabled.
10#endif // !V8_ENABLE_WEBASSEMBLY
11
13// Include the non-inl header before the rest of the headers.
14
17#include "src/objects/cell.h"
22
23namespace v8 {
24namespace internal {
25
26// static
28 Tagged<Tuple2> interpreter_object) {
29 return Cast<WasmInstanceObject>(interpreter_object->value1());
30}
31// static
33 Tagged<Tuple2> interpreter_object,
34 Tagged<WasmInstanceObject> wasm_instance) {
35 return interpreter_object->set_value1(wasm_instance);
36}
37
38// static
40 Tagged<Tuple2> interpreter_object) {
41 return interpreter_object->value2();
42}
43
44// static
46 Tagged<Tuple2> interpreter_object, Tagged<Object> interpreter_handle) {
47 DCHECK(IsForeign(interpreter_handle));
48 return interpreter_object->set_value2(interpreter_handle);
49}
50
51} // namespace internal
52} // namespace v8
53
54#endif // V8_WASM_INTERPRETER_WASM_INTERPRETER_OBJECTS_INL_H_
static Tagged< Object > get_interpreter_handle(Tagged< Tuple2 > interpreter_object)
static void set_interpreter_handle(Tagged< Tuple2 > interpreter_object, Tagged< Object > interpreter_handle)
static Tagged< WasmInstanceObject > get_wasm_instance(Tagged< Tuple2 > interpreter_object)
static void set_wasm_instance(Tagged< Tuple2 > interpreter_object, Tagged< WasmInstanceObject > wasm_instance)
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
Definition casting.h:150
#define DCHECK(condition)
Definition logging.h:482