[testing][wasm] Inspector: Print 'null' for empty table entries

The wrapper obects for the debugger displayed e.g. in dev tools
contain a proper `null` value already.

Note: This only affects the printing of wasm tables in the test.
Change-Id: I3c2e9580b0a3983b66b9c3e2e16e5a2b322a9ff7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4020261
Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#84201}
This commit is contained in:
Matthias Liedtke 2022-11-10 17:28:57 +01:00 committed by V8 LUCI CQ
parent f3363e9412
commit 40a156813e
3 changed files with 68 additions and 64 deletions

View File

@ -17,7 +17,7 @@ Script wasm://wasm/739f5f0a byte offset 246: Wasm opcode 0x01 (kExprNop)
Scope:
at $main (0:246):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$anyref_local: Struct ((ref $type0))
$anyref_local2: Array ((ref $type1))
@ -28,11 +28,11 @@ at $main (0:246):
module: Module
functions: "$my_func": (Function), "$fill_tables": (Function), "$main": (Function)
globals: "$global0": function $my_func() { [native code] } (funcref)
tables:
$import.any_table: 0: Array(2) (anyref), 1: Struct ((ref $type0)), 2: undefined (anyref)
$import.func_table: 0: function () { [native code] } (funcref), 1: function $my_func() { [native code] } (funcref), 2: undefined (funcref)
$exported_ref_table: 0: Struct ((ref $type0)), 1: Array ((ref $type1)), 2: undefined (anyref), 3: undefined (anyref)
$exported_func_table: 0: function external_fct() { [native code] } (funcref), 1: function $my_func() { [native code] } (funcref), 2: undefined (funcref)
tables:
$import.any_table: 0: Array(2) (anyref), 1: Struct ((ref $type0)), 2: null (anyref)
$import.func_table: 0: function () { [native code] } (funcref), 1: function $my_func() { [native code] } (funcref), 2: null (funcref)
$exported_ref_table: 0: Struct ((ref $type0)), 1: Array ((ref $type1)), 2: null (anyref), 3: null (anyref)
$exported_func_table: 0: function external_fct() { [native code] } (funcref), 1: function $my_func() { [native code] } (funcref), 2: null (funcref)
at (anonymous) (0:17):
- scope (global):
-- skipped globals

View File

@ -15,7 +15,7 @@ Script wasm://wasm/e33badc2 byte offset 169: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at $C (interpreted) (0:169):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$i32_arg: 42 (i32)
$i32_local: 0 (i32)
@ -26,8 +26,8 @@ at $C (interpreted) (0:169):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 0 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $B (liftoff) (0:158):
- scope (wasm-expression-stack):
stack: "0": 42 (i32), "1": 3 (i32)
@ -44,11 +44,11 @@ at $B (liftoff) (0:158):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 0 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$var0: 42 (i32)
- scope (module):
@ -57,8 +57,8 @@ at $A (liftoff) (0:128):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 0 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at (anonymous) (0:17):
- scope (global):
-- skipped globals
@ -79,8 +79,8 @@ at $C (interpreted) (0:171):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 0 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $B (liftoff) (0:158):
- scope (wasm-expression-stack):
stack: "0": 42 (i32), "1": 3 (i32)
@ -97,11 +97,11 @@ at $B (liftoff) (0:158):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 0 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$var0: 42 (i32)
- scope (module):
@ -110,8 +110,8 @@ at $A (liftoff) (0:128):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 0 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at (anonymous) (0:17):
- scope (global):
-- skipped globals
@ -121,7 +121,7 @@ Script wasm://wasm/e33badc2 byte offset 173: Wasm opcode 0x41 (kExprI32Const)
Scope:
at $C (interpreted) (0:173):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$i32_arg: 42 (i32)
$i32_local: 0 (i32)
@ -132,8 +132,8 @@ at $C (interpreted) (0:173):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $B (liftoff) (0:158):
- scope (wasm-expression-stack):
stack: "0": 42 (i32), "1": 3 (i32)
@ -150,11 +150,11 @@ at $B (liftoff) (0:158):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$var0: 42 (i32)
- scope (module):
@ -163,8 +163,8 @@ at $A (liftoff) (0:128):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at (anonymous) (0:17):
- scope (global):
-- skipped globals
@ -185,8 +185,8 @@ at $C (interpreted) (0:175):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $B (liftoff) (0:158):
- scope (wasm-expression-stack):
stack: "0": 42 (i32), "1": 3 (i32)
@ -203,11 +203,11 @@ at $B (liftoff) (0:158):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$var0: 42 (i32)
- scope (module):
@ -216,8 +216,8 @@ at $A (liftoff) (0:128):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at (anonymous) (0:17):
- scope (global):
-- skipped globals
@ -227,7 +227,7 @@ Script wasm://wasm/e33badc2 byte offset 177: Wasm opcode 0x0b (kExprEnd)
Scope:
at $C (interpreted) (0:177):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$i32_arg: 42 (i32)
$i32_local: 47 (i32)
@ -238,8 +238,8 @@ at $C (interpreted) (0:177):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $B (liftoff) (0:158):
- scope (wasm-expression-stack):
stack: "0": 42 (i32), "1": 3 (i32)
@ -256,11 +256,11 @@ at $B (liftoff) (0:158):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$var0: 42 (i32)
- scope (module):
@ -269,8 +269,8 @@ at $A (liftoff) (0:128):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at (anonymous) (0:17):
- scope (global):
-- skipped globals
@ -294,11 +294,11 @@ at $B (liftoff) (0:160):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$var0: 42 (i32)
- scope (module):
@ -307,8 +307,8 @@ at $A (liftoff) (0:128):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at (anonymous) (0:17):
- scope (global):
-- skipped globals
@ -332,11 +332,11 @@ at $B (liftoff) (0:161):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$var0: 42 (i32)
- scope (module):
@ -345,8 +345,8 @@ at $A (liftoff) (0:128):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at (anonymous) (0:17):
- scope (global):
-- skipped globals
@ -356,7 +356,7 @@ Script wasm://wasm/e33badc2 byte offset 162: Wasm opcode 0x0b (kExprEnd)
Scope:
at $B (liftoff) (0:162):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$i32_arg: 42 (i32)
$i32_local: 0 (i32)
@ -370,11 +370,11 @@ at $B (liftoff) (0:162):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at $A (liftoff) (0:128):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$var0: 42 (i32)
- scope (module):
@ -383,8 +383,8 @@ at $A (liftoff) (0:128):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at (anonymous) (0:17):
- scope (global):
-- skipped globals
@ -394,7 +394,7 @@ Script wasm://wasm/e33badc2 byte offset 130: Wasm opcode 0x0b (kExprEnd)
Scope:
at $A (liftoff) (0:130):
- scope (wasm-expression-stack):
stack:
stack:
- scope (local):
$var0: 42 (i32)
- scope (module):
@ -403,8 +403,8 @@ at $A (liftoff) (0:130):
functions: "$A (liftoff)": (Function), "$B (liftoff)": (Function), "$C (interpreted)": (Function)
globals: "$exported_global": 42 (i32)
memories: "$exported_memory": (Memory)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: undefined (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
tables:
$exported_table: 0: function js_func() { [native code] } (funcref), 1: function () { [native code] } (funcref), 2: null (funcref), 3: function $A (liftoff)() { [native code] } (funcref)
at (anonymous) (0:17):
- scope (global):
-- skipped globals

View File

@ -160,7 +160,11 @@ async function dumpTables(tablesObj) {
let referencedObj = await Protocol.Runtime.getProperties(
{objectId: entry.value.objectId});
let value = referencedObj.result.result
.filter(prop => prop.name == "value")[0].value.description;
.filter(prop => prop.name == "value")[0].value;
// If the value doesn't have a description, fall back to its value
// property. (For null this makes sure to print "null", as the null
// value doesn't have a description.)
value = value.description ?? value.value;
description = `${value} (${description})`;
}
functions.push(`${entry.name}: ${description}`);