[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

@ -29,10 +29,10 @@ at $main (0:246):
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)
$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

@ -27,7 +27,7 @@ at $C (interpreted) (0:169):
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)
$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)
@ -45,7 +45,7 @@ at $B (liftoff) (0:158):
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)
$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:
@ -58,7 +58,7 @@ at $A (liftoff) (0:128):
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)
$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
@ -80,7 +80,7 @@ at $C (interpreted) (0:171):
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)
$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)
@ -98,7 +98,7 @@ at $B (liftoff) (0:158):
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)
$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:
@ -111,7 +111,7 @@ at $A (liftoff) (0:128):
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)
$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
@ -133,7 +133,7 @@ at $C (interpreted) (0:173):
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)
$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)
@ -151,7 +151,7 @@ at $B (liftoff) (0:158):
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)
$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:
@ -164,7 +164,7 @@ at $A (liftoff) (0:128):
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)
$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
@ -186,7 +186,7 @@ at $C (interpreted) (0:175):
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)
$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)
@ -204,7 +204,7 @@ at $B (liftoff) (0:158):
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)
$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:
@ -217,7 +217,7 @@ at $A (liftoff) (0:128):
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)
$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
@ -239,7 +239,7 @@ at $C (interpreted) (0:177):
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)
$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)
@ -257,7 +257,7 @@ at $B (liftoff) (0:158):
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)
$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:
@ -270,7 +270,7 @@ at $A (liftoff) (0:128):
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)
$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
@ -295,7 +295,7 @@ at $B (liftoff) (0:160):
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)
$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:
@ -308,7 +308,7 @@ at $A (liftoff) (0:128):
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)
$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
@ -333,7 +333,7 @@ at $B (liftoff) (0:161):
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)
$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:
@ -346,7 +346,7 @@ at $A (liftoff) (0:128):
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)
$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
@ -371,7 +371,7 @@ at $B (liftoff) (0:162):
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)
$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:
@ -384,7 +384,7 @@ at $A (liftoff) (0:128):
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)
$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
@ -404,7 +404,7 @@ at $A (liftoff) (0:130):
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)
$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}`);