v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
debug-wasm-objects.h
Go to the documentation of this file.
1// Copyright 2021 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_DEBUG_DEBUG_WASM_OBJECTS_H_
6#define V8_DEBUG_DEBUG_WASM_OBJECTS_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
12#include <memory>
13
15
16// Has to be the last include (doesn't have include guards):
18
19namespace v8 {
20namespace debug {
21class ScopeIterator;
22} // namespace debug
23
24namespace internal {
25namespace wasm {
26class WasmValue;
27} // namespace wasm
28
29#include "torque-generated/src/debug/debug-wasm-objects-tq.inc"
30
31class ArrayList;
32class WasmFrame;
33class WasmInstanceObject;
34#if V8_ENABLE_DRUMBRAKE
35class WasmInterpreterEntryFrame;
36#endif // V8_ENABLE_DRUMBRAKE
37class WasmModuleObject;
38class WasmTableObject;
39
40class WasmValueObject : public JSObject {
41 public:
44
45 // Dispatched behavior.
48
49// Layout description.
50#define WASM_VALUE_FIELDS(V) \
51 V(kTypeOffset, kTaggedSize) \
52 V(kValueOffset, kTaggedSize) \
53 V(kSize, 0)
55#undef WASM_VALUE_FIELDS
56
57 // Indices of in-object properties.
58 static constexpr int kTypeIndex = 0;
59 static constexpr int kValueIndex = 1;
60
65 const wasm::WasmValue& value);
66
68};
69
71
72std::unique_ptr<debug::ScopeIterator> GetWasmScopeIterator(WasmFrame* frame);
73
74#if V8_ENABLE_DRUMBRAKE
75std::unique_ptr<debug::ScopeIterator> GetWasmInterpreterScopeIterator(
76 WasmInterpreterEntryFrame* frame);
77#endif // V8_ENABLE_DRUMBRAKE
78
81 uint32_t func_index);
82
86
89 DirectHandle<WasmModuleObject> module_object);
90
94
95} // namespace internal
96} // namespace v8
97
99
100#endif // V8_DEBUG_DEBUG_WASM_OBJECTS_H_
static DirectHandle< WasmValueObject > New(Isolate *isolate, DirectHandle< String > type, DirectHandle< Object > value)
OBJECT_CONSTRUCTORS(WasmValueObject, JSObject)
#define WASM_VALUE_FIELDS(V)
ZoneVector< RpoNumber > & result
DirectHandle< ArrayList > AddWasmModuleObjectInternalProperties(Isolate *isolate, DirectHandle< ArrayList > result, DirectHandle< WasmModuleObject > module_object)
std::unique_ptr< debug::ScopeIterator > GetWasmScopeIterator(WasmFrame *frame)
kWasmInternalFunctionIndirectPointerTag instance_data
DirectHandle< JSObject > GetWasmDebugProxy(WasmFrame *frame)
DirectHandle< ArrayList > AddWasmInstanceObjectInternalProperties(Isolate *isolate, DirectHandle< ArrayList > result, DirectHandle< WasmInstanceObject > instance)
DirectHandle< ArrayList > AddWasmTableObjectInternalProperties(Isolate *isolate, DirectHandle< ArrayList > result, DirectHandle< WasmTableObject > table)
DirectHandle< String > GetWasmFunctionDebugName(Isolate *isolate, DirectHandle< WasmTrustedInstanceData > instance_data, uint32_t func_index)
Definition c-api.cc:87
#define DECL_ACCESSORS(name,...)
#define DECL_VERIFIER(Name)
#define DECL_PRINTER(Name)
#define DEFINE_FIELD_OFFSET_CONSTANTS(StartOffset, LIST_MACRO)
Definition utils.h:242