#if !V8_ENABLE_WEBASSEMBLY
#error This header should only be included if WebAssembly is enabled.
#endif
#ifndef V8_DEBUG_DEBUG_WASM_OBJECTS_H_
#define V8_DEBUG_DEBUG_WASM_OBJECTS_H_
#include <memory>
#include "src/objects/js-objects.h"
#include "src/objects/object-macros.h"
namespace v8 {
namespace debug {
class ScopeIterator;
}
namespace internal {
namespace wasm {
class WasmValue;
}
#include "torque-generated/src/debug/debug-wasm-objects-tq.inc"
class ArrayList;
class WasmFrame;
class WasmInstanceObject;
class WasmModuleObject;
class WasmTableObject;
class WasmValueObject : public JSObject {
public:
DECL_CAST(WasmValueObject)
DECL_ACCESSORS(type, String)
DECL_ACCESSORS(value, Object)
DECL_PRINTER(WasmValueObject)
DECL_VERIFIER(WasmValueObject)
#define WASM_VALUE_FIELDS(V) \
V(kTypeOffset, kTaggedSize) \
V(kValueOffset, kTaggedSize) \
V(kSize, 0)
DEFINE_FIELD_OFFSET_CONSTANTS(JSObject::kHeaderSize, WASM_VALUE_FIELDS)
#undef WASM_VALUE_FIELDS
static constexpr int kTypeIndex = 0;
static constexpr int kValueIndex = 1;
static Handle<WasmValueObject> New(Isolate* isolate, Handle<String> type,
Handle<Object> value);
static Handle<WasmValueObject> New(Isolate* isolate,
const wasm::WasmValue& value,
Handle<WasmModuleObject> module);
OBJECT_CONSTRUCTORS(WasmValueObject, JSObject);
};
Handle<JSObject> GetWasmDebugProxy(WasmFrame* frame);
std::unique_ptr<debug::ScopeIterator> GetWasmScopeIterator(WasmFrame* frame);
Handle<String> GetWasmFunctionDebugName(Isolate* isolate,
Handle<WasmInstanceObject> instance,
uint32_t func_index);
Handle<ArrayList> AddWasmInstanceObjectInternalProperties(
Isolate* isolate, Handle<ArrayList> result,
Handle<WasmInstanceObject> instance);
Handle<ArrayList> AddWasmModuleObjectInternalProperties(
Isolate* isolate, Handle<ArrayList> result,
Handle<WasmModuleObject> module_object);
Handle<ArrayList> AddWasmTableObjectInternalProperties(
Isolate* isolate, Handle<ArrayList> result, Handle<WasmTableObject> table);
}
}
#include "src/objects/object-macros-undef.h"
#endif