diff --git a/include/js_protocol.pdl b/include/js_protocol.pdl index 7f096cf90a..3231e11c9d 100644 --- a/include/js_protocol.pdl +++ b/include/js_protocol.pdl @@ -1043,6 +1043,7 @@ domain Runtime typedarray arraybuffer dataview + webassemblymemory i32 i64 f32 diff --git a/include/v8.h b/include/v8.h index d1e326f6f1..a46e30459f 100644 --- a/include/v8.h +++ b/include/v8.h @@ -91,6 +91,7 @@ class Private; class Uint32; class Utils; class Value; +class WasmMemoryObject; class WasmModuleObject; template class Local; template @@ -2962,6 +2963,11 @@ class V8_EXPORT Value : public Data { */ bool IsProxy() const; + /** + * Returns true if this value is a WasmMemoryObject. + */ + bool IsWasmMemoryObject() const; + /** * Returns true if this value is a WasmModuleObject. */ @@ -4980,6 +4986,22 @@ class V8_EXPORT CompiledWasmModule { const std::string source_url_; }; +// An instance of WebAssembly.Memory. +class V8_EXPORT WasmMemoryObject : public Object { + public: + WasmMemoryObject() = delete; + + /** + * Returns underlying ArrayBuffer. + */ + Local Buffer(); + + V8_INLINE static WasmMemoryObject* Cast(Value* obj); + + private: + static void CheckCast(Value* object); +}; + // An instance of WebAssembly.Module. class V8_EXPORT WasmModuleObject : public Object { public: @@ -11956,6 +11978,13 @@ Proxy* Proxy::Cast(v8::Value* value) { return static_cast(value); } +WasmMemoryObject* WasmMemoryObject::Cast(v8::Value* value) { +#ifdef V8_ENABLE_CHECKS + CheckCast(value); +#endif + return static_cast(value); +} + WasmModuleObject* WasmModuleObject::Cast(v8::Value* value) { #ifdef V8_ENABLE_CHECKS CheckCast(value); diff --git a/src/api/api.cc b/src/api/api.cc index 70d4d0223e..16ca1fa7e1 100644 --- a/src/api/api.cc +++ b/src/api/api.cc @@ -3583,6 +3583,7 @@ VALUE_IS_SPECIFIC_TYPE(SymbolObject, SymbolWrapper) VALUE_IS_SPECIFIC_TYPE(Date, JSDate) VALUE_IS_SPECIFIC_TYPE(Map, JSMap) VALUE_IS_SPECIFIC_TYPE(Set, JSSet) +VALUE_IS_SPECIFIC_TYPE(WasmMemoryObject, WasmMemoryObject) VALUE_IS_SPECIFIC_TYPE(WasmModuleObject, WasmModuleObject) VALUE_IS_SPECIFIC_TYPE(WeakMap, JSWeakMap) VALUE_IS_SPECIFIC_TYPE(WeakSet, JSWeakSet) @@ -3903,6 +3904,11 @@ void v8::Proxy::CheckCast(Value* that) { Utils::ApiCheck(that->IsProxy(), "v8::Proxy::Cast", "Value is not a Proxy"); } +void v8::WasmMemoryObject::CheckCast(Value* that) { + Utils::ApiCheck(that->IsWasmMemoryObject(), "v8::WasmMemoryObject::Cast", + "Value is not a WasmMemoryObject"); +} + void v8::WasmModuleObject::CheckCast(Value* that) { Utils::ApiCheck(that->IsWasmModuleObject(), "v8::WasmModuleObject::Cast", "Value is not a WasmModuleObject"); @@ -7502,6 +7508,12 @@ MemorySpan CompiledWasmModule::GetWireBytesRef() { return {bytes_vec.begin(), bytes_vec.size()}; } +Local v8::WasmMemoryObject::Buffer() { + i::Handle obj = Utils::OpenHandle(this); + i::Handle buffer(obj->array_buffer(), obj->GetIsolate()); + return Utils::ToLocal(buffer); +} + CompiledWasmModule WasmModuleObject::GetCompiledModule() { i::Handle obj = i::Handle::cast(Utils::OpenHandle(this)); diff --git a/src/api/api.h b/src/api/api.h index 66896a3e1f..27e686c5ad 100644 --- a/src/api/api.h +++ b/src/api/api.h @@ -136,7 +136,8 @@ class RegisteredExtension { V(BigInt, BigInt) \ V(ScriptOrModule, Script) \ V(FixedArray, FixedArray) \ - V(ModuleRequest, ModuleRequest) + V(ModuleRequest, ModuleRequest) \ + V(WasmMemoryObject, WasmMemoryObject) class Utils { public: diff --git a/src/inspector/value-mirror.cc b/src/inspector/value-mirror.cc index 8487c507a0..603720fd52 100644 --- a/src/inspector/value-mirror.cc +++ b/src/inspector/value-mirror.cc @@ -22,6 +22,10 @@ using protocol::Runtime::PropertyPreview; using protocol::Runtime::RemoteObject; namespace { + +// WebAssembly memory is organized in pages of size 64KiB. +const size_t kWasmPageSize = 64 * 1024; + V8InspectorClient* clientFor(v8::Local context) { return static_cast( v8::debug::GetInspector(context->GetIsolate())) @@ -1909,6 +1913,13 @@ std::unique_ptr ValueMirror::create(v8::Local context, value, RemoteObject::SubtypeEnum::Dataview, descriptionForCollection(isolate, view, view->ByteLength())); } + if (value->IsWasmMemoryObject()) { + v8::Local memory = value.As(); + return std::make_unique( + value, RemoteObject::SubtypeEnum::Webassemblymemory, + descriptionForCollection( + isolate, memory, memory->Buffer()->ByteLength() / kWasmPageSize)); + } V8InternalValueType internalType = v8InternalValueTypeFrom(context, value.As()); if (value->IsArray() && internalType == V8InternalValueType::kScopeList) { diff --git a/src/wasm/wasm-debug.cc b/src/wasm/wasm-debug.cc index 78dc0ed587..a809bc6199 100644 --- a/src/wasm/wasm-debug.cc +++ b/src/wasm/wasm-debug.cc @@ -211,11 +211,8 @@ Handle GetModuleScopeObject(Handle instance) { const char* label = "memory%d"; name = PrintFToOneByteString(isolate, label, memory_index); } - Handle memory_buffer( - instance->memory_object().array_buffer(), isolate); - Handle uint8_array = isolate->factory()->NewJSTypedArray( - kExternalUint8Array, memory_buffer, 0, memory_buffer->byte_length()); - JSObject::AddProperty(isolate, module_scope_object, name, uint8_array, + Handle memory_object(instance->memory_object(), isolate); + JSObject::AddProperty(isolate, module_scope_object, name, memory_object, NONE); } diff --git a/test/inspector/debugger/wasm-scope-info-expected.txt b/test/inspector/debugger/wasm-scope-info-expected.txt index 834121fef1..1287e12ba5 100644 --- a/test/inspector/debugger/wasm-scope-info-expected.txt +++ b/test/inspector/debugger/wasm-scope-info-expected.txt @@ -14,7 +14,7 @@ Scope: at func (0:147): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -28,7 +28,7 @@ at func (0:147): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -44,7 +44,7 @@ Scope: at func (0:149): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -59,7 +59,7 @@ at func (0:149): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -75,7 +75,7 @@ Scope: at func (0:151): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -89,7 +89,7 @@ at func (0:151): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -105,7 +105,7 @@ Scope: at func (0:153): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -120,7 +120,7 @@ at func (0:153): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -136,7 +136,7 @@ Scope: at func (0:155): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -150,7 +150,7 @@ at func (0:155): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -166,7 +166,7 @@ Scope: at func (0:166): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -181,7 +181,7 @@ at func (0:166): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -197,7 +197,7 @@ Scope: at func (0:168): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -211,7 +211,7 @@ at func (0:168): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -227,7 +227,7 @@ Scope: at func (0:179): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -242,7 +242,7 @@ at func (0:179): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -258,7 +258,7 @@ Scope: at func (0:181): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -272,7 +272,7 @@ at func (0:181): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -288,7 +288,7 @@ Scope: at func (0:183): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -303,7 +303,7 @@ at func (0:183): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -319,7 +319,7 @@ Scope: at func (0:184): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -334,7 +334,7 @@ at func (0:184): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -350,7 +350,7 @@ Scope: at func (0:186): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -366,7 +366,7 @@ at func (0:186): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -382,7 +382,7 @@ Scope: at func (0:187): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -398,7 +398,7 @@ at func (0:187): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -414,7 +414,7 @@ Scope: at func (0:188): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -429,7 +429,7 @@ at func (0:188): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -445,7 +445,7 @@ Scope: at func (0:190): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -459,7 +459,7 @@ at func (0:190): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -475,7 +475,7 @@ Scope: at func (0:192): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -490,7 +490,7 @@ at func (0:192): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -506,7 +506,7 @@ Scope: at func (0:194): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -521,7 +521,7 @@ at func (0:194): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -537,7 +537,7 @@ Scope: at func (0:196): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -551,7 +551,7 @@ at func (0:196): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -567,7 +567,7 @@ Scope: at func (0:198): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -582,7 +582,7 @@ at func (0:198): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -598,7 +598,7 @@ Scope: at func (0:199): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -613,7 +613,7 @@ at func (0:199): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -629,7 +629,7 @@ Scope: at func (0:201): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -643,7 +643,7 @@ at func (0:201): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -659,7 +659,7 @@ Scope: at func (0:203): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f64) @@ -674,7 +674,7 @@ at func (0:203): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 4 (i32) @@ -690,7 +690,7 @@ Scope: at func (0:205): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 15 (i32) - scope (local): 0: 0 (f64) @@ -704,7 +704,7 @@ at func (0:205): at call_func (0:132): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 15 (i32) - scope (local): var0: 4 (i32) @@ -720,7 +720,7 @@ Scope: at call_func (0:134): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 15 (i32) - scope (local): var0: 4 (i32) diff --git a/test/inspector/debugger/wasm-scope-info-liftoff-expected.txt b/test/inspector/debugger/wasm-scope-info-liftoff-expected.txt index b5a50d57e7..be93f1ad59 100644 --- a/test/inspector/debugger/wasm-scope-info-liftoff-expected.txt +++ b/test/inspector/debugger/wasm-scope-info-liftoff-expected.txt @@ -14,7 +14,7 @@ Scope: at C (interpreted) (0:169): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): i32_arg: 42 (i32) @@ -24,7 +24,7 @@ at C (interpreted) (0:169): at B (liftoff) (0:158): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f32) @@ -39,7 +39,7 @@ at B (liftoff) (0:158): at A (liftoff) (0:128): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 42 (i32) @@ -54,7 +54,7 @@ Scope: at C (interpreted) (0:171): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): i32_arg: 42 (i32) @@ -65,7 +65,7 @@ at C (interpreted) (0:171): at B (liftoff) (0:158): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): 0: 0 (f32) @@ -80,7 +80,7 @@ at B (liftoff) (0:158): at A (liftoff) (0:128): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 0 (i32) - scope (local): var0: 42 (i32) @@ -95,7 +95,7 @@ Scope: at C (interpreted) (0:173): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): i32_arg: 42 (i32) @@ -105,7 +105,7 @@ at C (interpreted) (0:173): at B (liftoff) (0:158): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): 0: 0 (f32) @@ -120,7 +120,7 @@ at B (liftoff) (0:158): at A (liftoff) (0:128): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): var0: 42 (i32) @@ -135,7 +135,7 @@ Scope: at C (interpreted) (0:175): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): i32_arg: 42 (i32) @@ -146,7 +146,7 @@ at C (interpreted) (0:175): at B (liftoff) (0:158): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): 0: 0 (f32) @@ -161,7 +161,7 @@ at B (liftoff) (0:158): at A (liftoff) (0:128): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): var0: 42 (i32) @@ -176,7 +176,7 @@ Scope: at C (interpreted) (0:177): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): i32_arg: 42 (i32) @@ -186,7 +186,7 @@ at C (interpreted) (0:177): at B (liftoff) (0:158): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): 0: 0 (f32) @@ -201,7 +201,7 @@ at B (liftoff) (0:158): at A (liftoff) (0:128): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): var0: 42 (i32) @@ -216,7 +216,7 @@ Scope: at B (liftoff) (0:160): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): 0: 0 (f32) @@ -231,7 +231,7 @@ at B (liftoff) (0:160): at A (liftoff) (0:128): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): var0: 42 (i32) @@ -246,7 +246,7 @@ Scope: at B (liftoff) (0:161): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): 0: 0 (f32) @@ -260,7 +260,7 @@ at B (liftoff) (0:161): at A (liftoff) (0:128): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): var0: 42 (i32) @@ -275,7 +275,7 @@ Scope: at B (liftoff) (0:162): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): 0: 0 (f32) @@ -288,7 +288,7 @@ at B (liftoff) (0:162): at A (liftoff) (0:128): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): var0: 42 (i32) @@ -303,7 +303,7 @@ Scope: at A (liftoff) (0:130): - scope (module): instance: exports: "exported_global" (Global), "exported_memory" (Memory), "exported_table" (Table), "main" (Function) - exported_memory: Uint8Array(65536) + exported_memory: Memory(1) globals: "exported_global": 42 (i32) - scope (local): var0: 42 (i32) diff --git a/test/inspector/wasm-inspector-test.js b/test/inspector/wasm-inspector-test.js index 8c3f87084b..490b6906a9 100644 --- a/test/inspector/wasm-inspector-test.js +++ b/test/inspector/wasm-inspector-test.js @@ -50,7 +50,7 @@ function printIfFailure(message) { async function getScopeValues(name, value) { if (value.type == 'object') { - if (value.subtype == 'typedarray') return value.description; + if (value.subtype === 'typedarray' || value.subtype == 'webassemblymemory') return value.description; if (name == 'instance') return dumpInstanceProperties(value); let msg = await Protocol.Runtime.getProperties({objectId: value.objectId});