Commit b38c1369 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[wasm][inspector][test] Print opcode names

It makes inspector tests a lot more readable if the opcode of the pause
location is being printed. Since we already have a list of all opcodes
available in wasm-module-builder.js, we can just reuse that to build a
reverse lookup map.

This CL implements this for single-byte opcodes only, which is enough
for all tests that we currently have. It will have to be extended for
prefixed opcodes once that is being used.

R=thibaudm@chromium.org, kimanh@chromium.org

Change-Id: I085fea99d2f5f2dc6cc084448e5f7444cce5c78b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2474789
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarKim-Anh Tran <kimanh@chromium.org>
Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70578}
parent 063d56e7
......@@ -3,7 +3,7 @@ Instantiating.
Waiting for wasm script (ignoring first non-wasm script).
Setting breakpoint.
Calling func.
Script wasm://wasm/8c388106 byte offset 33: Wasm opcode 0x01
Script wasm://wasm/8c388106 byte offset 33: Wasm opcode 0x01 (kExprNop)
func returned.
Restarting debugger.
Calling func.
......
......@@ -3,7 +3,7 @@ Waiting for wasm scripts to be parsed.
Ignoring script with url v8://test/instantiate
Got wasm script: wasm://wasm/7d022e0e
paused No 1
Script wasm://wasm/7d022e0e byte offset 35: Wasm opcode 0x20
Script wasm://wasm/7d022e0e byte offset 35: Wasm opcode 0x20 (kExprLocalGet)
Debugger.resume
exports.main returned!
Finished!
......@@ -4,11 +4,11 @@ Calling instantiate function for module A.
Waiting for wasm script to be parsed.
Got wasm script!
Setting breakpoint in line 1:
Script wasm://wasm/8c388106 byte offset 33: Wasm opcode 0x01
Script wasm://wasm/8c388106 byte offset 33: Wasm opcode 0x01 (kExprNop)
Calling instantiate function for module B.
Calling main function on module B.
Paused at 0:33.
Script wasm://wasm/8c388106 byte offset 33: Wasm opcode 0x01
Script wasm://wasm/8c388106 byte offset 33: Wasm opcode 0x01 (kExprNop)
Getting current stack trace via "new Error().stack".
Error
at v8://test/getStack:1:1
......
......@@ -10,7 +10,7 @@ Setting breakpoint on line 3 of wasm function
scriptId : <scriptId>
}
paused No 1
Script wasm://wasm/7d022e0e byte offset 39: Wasm opcode 0x6b
Script wasm://wasm/7d022e0e byte offset 39: Wasm opcode 0x6b (kExprI32Sub)
Remove breakpoint
Debugger.resume
exports.main returned!
......
......@@ -9,7 +9,7 @@ Setting breakpoint on first instruction of second function
scriptId : <scriptId>
}
Paused:
Script wasm://wasm/c723f83a byte offset 147: Wasm opcode 0x41
Script wasm://wasm/c723f83a byte offset 147: Wasm opcode 0x41 (kExprI32Const)
Scope:
at func (0:147):
- scope (module):
......@@ -43,7 +43,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 149: Wasm opcode 0x21
Script wasm://wasm/c723f83a byte offset 149: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at func (0:149):
- scope (module):
......@@ -78,7 +78,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 151: Wasm opcode 0x41
Script wasm://wasm/c723f83a byte offset 151: Wasm opcode 0x41 (kExprI32Const)
Scope:
at func (0:151):
- scope (module):
......@@ -112,7 +112,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 153: Wasm opcode 0x21
Script wasm://wasm/c723f83a byte offset 153: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at func (0:153):
- scope (module):
......@@ -147,7 +147,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 155: Wasm opcode 0x42
Script wasm://wasm/c723f83a byte offset 155: Wasm opcode 0x42 (kExprI64Const)
Scope:
at func (0:155):
- scope (module):
......@@ -181,7 +181,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 166: Wasm opcode 0x21
Script wasm://wasm/c723f83a byte offset 166: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at func (0:166):
- scope (module):
......@@ -216,7 +216,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 168: Wasm opcode 0x42
Script wasm://wasm/c723f83a byte offset 168: Wasm opcode 0x42 (kExprI64Const)
Scope:
at func (0:168):
- scope (module):
......@@ -250,7 +250,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 179: Wasm opcode 0x21
Script wasm://wasm/c723f83a byte offset 179: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at func (0:179):
- scope (module):
......@@ -285,7 +285,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 181: Wasm opcode 0x41
Script wasm://wasm/c723f83a byte offset 181: Wasm opcode 0x41 (kExprI32Const)
Scope:
at func (0:181):
- scope (module):
......@@ -319,7 +319,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 183: Wasm opcode 0xb8
Script wasm://wasm/c723f83a byte offset 183: Wasm opcode 0xb8 (kExprF64UConvertI32)
Scope:
at func (0:183):
- scope (module):
......@@ -354,7 +354,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 184: Wasm opcode 0x41
Script wasm://wasm/c723f83a byte offset 184: Wasm opcode 0x41 (kExprI32Const)
Scope:
at func (0:184):
- scope (module):
......@@ -389,7 +389,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 186: Wasm opcode 0xb8
Script wasm://wasm/c723f83a byte offset 186: Wasm opcode 0xb8 (kExprF64UConvertI32)
Scope:
at func (0:186):
- scope (module):
......@@ -425,7 +425,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 187: Wasm opcode 0xa3
Script wasm://wasm/c723f83a byte offset 187: Wasm opcode 0xa3 (kExprF64Div)
Scope:
at func (0:187):
- scope (module):
......@@ -461,7 +461,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 188: Wasm opcode 0x21
Script wasm://wasm/c723f83a byte offset 188: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at func (0:188):
- scope (module):
......@@ -496,7 +496,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 190: Wasm opcode 0x41
Script wasm://wasm/c723f83a byte offset 190: Wasm opcode 0x41 (kExprI32Const)
Scope:
at func (0:190):
- scope (module):
......@@ -530,7 +530,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 192: Wasm opcode 0xfd
Script wasm://wasm/c723f83a byte offset 192: Wasm opcode 0xfd (kSimdPrefix)
Scope:
at func (0:192):
- scope (module):
......@@ -565,7 +565,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 194: Wasm opcode 0x21
Script wasm://wasm/c723f83a byte offset 194: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at func (0:194):
- scope (module):
......@@ -600,7 +600,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 196: Wasm opcode 0x41
Script wasm://wasm/c723f83a byte offset 196: Wasm opcode 0x41 (kExprI32Const)
Scope:
at func (0:196):
- scope (module):
......@@ -634,7 +634,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 198: Wasm opcode 0xb3
Script wasm://wasm/c723f83a byte offset 198: Wasm opcode 0xb3 (kExprF32UConvertI32)
Scope:
at func (0:198):
- scope (module):
......@@ -669,7 +669,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 199: Wasm opcode 0x21
Script wasm://wasm/c723f83a byte offset 199: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at func (0:199):
- scope (module):
......@@ -704,7 +704,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 201: Wasm opcode 0x41
Script wasm://wasm/c723f83a byte offset 201: Wasm opcode 0x41 (kExprI32Const)
Scope:
at func (0:201):
- scope (module):
......@@ -738,7 +738,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 203: Wasm opcode 0x24
Script wasm://wasm/c723f83a byte offset 203: Wasm opcode 0x24 (kExprGlobalSet)
Scope:
at func (0:203):
- scope (module):
......@@ -773,7 +773,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 205: Wasm opcode 0x0b
Script wasm://wasm/c723f83a byte offset 205: Wasm opcode 0x0b (kExprEnd)
Scope:
at func (0:205):
- scope (module):
......@@ -807,7 +807,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/c723f83a byte offset 134: Wasm opcode 0x0b
Script wasm://wasm/c723f83a byte offset 134: Wasm opcode 0x0b (kExprEnd)
Scope:
at call_func (0:134):
- scope (module):
......
......@@ -9,7 +9,7 @@ Setting breakpoint on line 2 (first instruction) of third function
scriptId : <scriptId>
}
Paused:
Script wasm://wasm/e33badc2 byte offset 169: Wasm opcode 0x20
Script wasm://wasm/e33badc2 byte offset 169: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at C (interpreted) (0:169):
- scope (module):
......@@ -55,7 +55,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/e33badc2 byte offset 171: Wasm opcode 0x24
Script wasm://wasm/e33badc2 byte offset 171: Wasm opcode 0x24 (kExprGlobalSet)
Scope:
at C (interpreted) (0:171):
- scope (module):
......@@ -102,7 +102,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/e33badc2 byte offset 173: Wasm opcode 0x41
Script wasm://wasm/e33badc2 byte offset 173: Wasm opcode 0x41 (kExprI32Const)
Scope:
at C (interpreted) (0:173):
- scope (module):
......@@ -148,7 +148,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/e33badc2 byte offset 175: Wasm opcode 0x21
Script wasm://wasm/e33badc2 byte offset 175: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at C (interpreted) (0:175):
- scope (module):
......@@ -195,7 +195,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/e33badc2 byte offset 177: Wasm opcode 0x0b
Script wasm://wasm/e33badc2 byte offset 177: Wasm opcode 0x0b (kExprEnd)
Scope:
at C (interpreted) (0:177):
- scope (module):
......@@ -241,7 +241,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/e33badc2 byte offset 160: Wasm opcode 0x1a
Script wasm://wasm/e33badc2 byte offset 160: Wasm opcode 0x1a (kExprDrop)
Scope:
at B (liftoff) (0:160):
- scope (module):
......@@ -275,7 +275,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/e33badc2 byte offset 161: Wasm opcode 0x1a
Script wasm://wasm/e33badc2 byte offset 161: Wasm opcode 0x1a (kExprDrop)
Scope:
at B (liftoff) (0:161):
- scope (module):
......@@ -308,7 +308,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/e33badc2 byte offset 162: Wasm opcode 0x0b
Script wasm://wasm/e33badc2 byte offset 162: Wasm opcode 0x0b (kExprEnd)
Scope:
at B (liftoff) (0:162):
- scope (module):
......@@ -340,7 +340,7 @@ at (anonymous) (0:17):
-- skipped globals
Paused:
Script wasm://wasm/e33badc2 byte offset 130: Wasm opcode 0x0b
Script wasm://wasm/e33badc2 byte offset 130: Wasm opcode 0x0b (kExprEnd)
Scope:
at A (liftoff) (0:130):
- scope (module):
......
......@@ -4,7 +4,7 @@ Waiting for wasm script (ignoring first non-wasm script).
Setting breakpoint at offset 38 on script wasm://wasm/0c10a5fe
Calling main(4)
Paused:
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:38):
- scope (module):
......@@ -29,7 +29,7 @@ Setting breakpoint at offset 49 on script v8://test/runWasm
Setting breakpoint at offset 45 on script v8://test/runWasm
Setting breakpoint at offset 47 on script v8://test/runWasm
Paused:
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:39):
- scope (module):
......@@ -45,7 +45,7 @@ at wasm_B (0:56):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:45):
- scope (module):
......@@ -56,7 +56,7 @@ at wasm_B (0:45):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04 (kExprIf)
Scope:
at wasm_B (0:47):
- scope (module):
......@@ -68,7 +68,7 @@ at wasm_B (0:47):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 49: Wasm opcode 0x20
Script wasm://wasm/0c10a5fe byte offset 49: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:49):
- scope (module):
......@@ -79,7 +79,7 @@ at wasm_B (0:49):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 51: Wasm opcode 0x41
Script wasm://wasm/0c10a5fe byte offset 51: Wasm opcode 0x41 (kExprI32Const)
Scope:
at wasm_B (0:51):
- scope (module):
......@@ -91,7 +91,7 @@ at wasm_B (0:51):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 53: Wasm opcode 0x6b
Script wasm://wasm/0c10a5fe byte offset 53: Wasm opcode 0x6b (kExprI32Sub)
Scope:
at wasm_B (0:53):
- scope (module):
......@@ -104,7 +104,7 @@ at wasm_B (0:53):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 54: Wasm opcode 0x21
Script wasm://wasm/0c10a5fe byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at wasm_B (0:54):
- scope (module):
......@@ -116,7 +116,7 @@ at wasm_B (0:54):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:38):
- scope (module):
......@@ -132,7 +132,7 @@ at wasm_B (0:56):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:39):
- scope (module):
......@@ -148,7 +148,7 @@ at wasm_B (0:56):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:45):
- scope (module):
......@@ -159,7 +159,7 @@ at wasm_B (0:45):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04 (kExprIf)
Scope:
at wasm_B (0:47):
- scope (module):
......@@ -171,7 +171,7 @@ at wasm_B (0:47):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 49: Wasm opcode 0x20
Script wasm://wasm/0c10a5fe byte offset 49: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:49):
- scope (module):
......@@ -182,7 +182,7 @@ at wasm_B (0:49):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 51: Wasm opcode 0x41
Script wasm://wasm/0c10a5fe byte offset 51: Wasm opcode 0x41 (kExprI32Const)
Scope:
at wasm_B (0:51):
- scope (module):
......@@ -194,7 +194,7 @@ at wasm_B (0:51):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 53: Wasm opcode 0x6b
Script wasm://wasm/0c10a5fe byte offset 53: Wasm opcode 0x6b (kExprI32Sub)
Scope:
at wasm_B (0:53):
- scope (module):
......@@ -207,7 +207,7 @@ at wasm_B (0:53):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 54: Wasm opcode 0x21
Script wasm://wasm/0c10a5fe byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at wasm_B (0:54):
- scope (module):
......@@ -219,7 +219,7 @@ at wasm_B (0:54):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:38):
- scope (module):
......@@ -235,7 +235,7 @@ at wasm_B (0:56):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:39):
- scope (module):
......@@ -251,7 +251,7 @@ at wasm_B (0:56):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:45):
- scope (module):
......@@ -262,7 +262,7 @@ at wasm_B (0:45):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04 (kExprIf)
Scope:
at wasm_B (0:47):
- scope (module):
......@@ -274,7 +274,7 @@ at wasm_B (0:47):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 49: Wasm opcode 0x20
Script wasm://wasm/0c10a5fe byte offset 49: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:49):
- scope (module):
......@@ -285,7 +285,7 @@ at wasm_B (0:49):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 51: Wasm opcode 0x41
Script wasm://wasm/0c10a5fe byte offset 51: Wasm opcode 0x41 (kExprI32Const)
Scope:
at wasm_B (0:51):
- scope (module):
......@@ -297,7 +297,7 @@ at wasm_B (0:51):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 53: Wasm opcode 0x6b
Script wasm://wasm/0c10a5fe byte offset 53: Wasm opcode 0x6b (kExprI32Sub)
Scope:
at wasm_B (0:53):
- scope (module):
......@@ -310,7 +310,7 @@ at wasm_B (0:53):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 54: Wasm opcode 0x21
Script wasm://wasm/0c10a5fe byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
Scope:
at wasm_B (0:54):
- scope (module):
......@@ -322,7 +322,7 @@ at wasm_B (0:54):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01
Script wasm://wasm/0c10a5fe byte offset 38: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:38):
- scope (module):
......@@ -338,7 +338,7 @@ at wasm_B (0:56):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01
Script wasm://wasm/0c10a5fe byte offset 39: Wasm opcode 0x01 (kExprNop)
Scope:
at wasm_A (0:39):
- scope (module):
......@@ -354,7 +354,7 @@ at wasm_B (0:56):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20
Script wasm://wasm/0c10a5fe byte offset 45: Wasm opcode 0x20 (kExprLocalGet)
Scope:
at wasm_B (0:45):
- scope (module):
......@@ -365,7 +365,7 @@ at wasm_B (0:45):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04
Script wasm://wasm/0c10a5fe byte offset 47: Wasm opcode 0x04 (kExprIf)
Scope:
at wasm_B (0:47):
- scope (module):
......@@ -377,7 +377,7 @@ at wasm_B (0:47):
at (anonymous) (0:17):
-- skipped
Paused:
Script wasm://wasm/0c10a5fe byte offset 61: Wasm opcode 0x0b
Script wasm://wasm/0c10a5fe byte offset 61: Wasm opcode 0x0b (kExprEnd)
Scope:
at wasm_B (0:61):
- scope (module):
......
......@@ -3,7 +3,7 @@ Instantiating.
Calling div function.
Paused at:
--- 0 ---
Script wasm://wasm/a9a86c5e byte offset 46: Wasm opcode 0x6d
Script wasm://wasm/a9a86c5e byte offset 46: Wasm opcode 0x6d (kExprI32DivS)
scope at div (0:46):
a: 1
b: 0
......@@ -33,7 +33,7 @@ Paused at:
-> resume
Paused at:
--- 0 ---
Script wasm://wasm/a9a86c5e byte offset 46: Wasm opcode 0x6d
Script wasm://wasm/a9a86c5e byte offset 46: Wasm opcode 0x6d (kExprI32DivS)
scope at div (0:46):
a: -2147483648
b: -1
......
......@@ -3,10 +3,10 @@ Setting up global instance variable.
Got wasm script: wasm://wasm/4658c40e
Setting breakpoint on offset 44
Running main function.
Script wasm://wasm/4658c40e byte offset 44: Wasm opcode 0x10
Script wasm://wasm/4658c40e byte offset 44: Wasm opcode 0x10 (kExprCallFunction)
Debugger.stepInto called
Script wasm://wasm/4658c40e byte offset 40: Wasm opcode 0x0b
Script wasm://wasm/4658c40e byte offset 40: Wasm opcode 0x0b (kExprEnd)
Debugger.stepInto called
Script wasm://wasm/4658c40e byte offset 41: Wasm opcode 0x0b
Script wasm://wasm/4658c40e byte offset 41: Wasm opcode 0x0b (kExprEnd)
Debugger.resume called
exports.main returned.
......@@ -7,51 +7,51 @@ Setting breakpoint on offset 72 (should be propagated to 73, the offset of the c
lineNumber : 0
scriptId : <scriptId>
}
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10 (kExprCallFunction)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 52: Wasm opcode 0x01
Script wasm://wasm/42af3c82 byte offset 52: Wasm opcode 0x01 (kExprNop)
Debugger.stepOver called
Script wasm://wasm/42af3c82 byte offset 53: Wasm opcode 0x01
Script wasm://wasm/42af3c82 byte offset 53: Wasm opcode 0x01 (kExprNop)
Debugger.stepOut called
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0x0c
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0x0c (kExprBr)
Debugger.stepOut called
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10 (kExprCallFunction)
Debugger.stepOver called
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0x0c
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0x0c (kExprBr)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 59: Wasm opcode 0x20
Script wasm://wasm/42af3c82 byte offset 59: Wasm opcode 0x20 (kExprLocalGet)
Debugger.resume called
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10 (kExprCallFunction)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 52: Wasm opcode 0x01
Script wasm://wasm/42af3c82 byte offset 52: Wasm opcode 0x01 (kExprNop)
Debugger.stepOut called
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0x0c
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0x0c (kExprBr)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 59: Wasm opcode 0x20
Script wasm://wasm/42af3c82 byte offset 59: Wasm opcode 0x20 (kExprLocalGet)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 61: Wasm opcode 0x04
Script wasm://wasm/42af3c82 byte offset 61: Wasm opcode 0x04 (kExprIf)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 63: Wasm opcode 0x20
Script wasm://wasm/42af3c82 byte offset 63: Wasm opcode 0x20 (kExprLocalGet)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 65: Wasm opcode 0x41
Script wasm://wasm/42af3c82 byte offset 65: Wasm opcode 0x41 (kExprI32Const)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 67: Wasm opcode 0x6b
Script wasm://wasm/42af3c82 byte offset 67: Wasm opcode 0x6b (kExprI32Sub)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 68: Wasm opcode 0x21
Script wasm://wasm/42af3c82 byte offset 68: Wasm opcode 0x21 (kExprLocalSet)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 70: Wasm opcode 0x41
Script wasm://wasm/42af3c82 byte offset 70: Wasm opcode 0x41 (kExprI32Const)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10
Script wasm://wasm/42af3c82 byte offset 73: Wasm opcode 0x10 (kExprCallFunction)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 52: Wasm opcode 0x01
Script wasm://wasm/42af3c82 byte offset 52: Wasm opcode 0x01 (kExprNop)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 53: Wasm opcode 0x01
Script wasm://wasm/42af3c82 byte offset 53: Wasm opcode 0x01 (kExprNop)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 54: Wasm opcode 0x0b
Script wasm://wasm/42af3c82 byte offset 54: Wasm opcode 0x0b (kExprEnd)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0x0c
Script wasm://wasm/42af3c82 byte offset 75: Wasm opcode 0x0c (kExprBr)
Debugger.stepInto called
Script wasm://wasm/42af3c82 byte offset 59: Wasm opcode 0x20
Script wasm://wasm/42af3c82 byte offset 59: Wasm opcode 0x20 (kExprLocalGet)
Debugger.resume called
exports.main returned!
Test stepping over a recursive call
......@@ -61,9 +61,9 @@ Setting breakpoint on the recursive call instruction @+93, url wasm://wasm/42af3
lineNumber : 0
scriptId : <scriptId>
}
Script wasm://wasm/42af3c82 byte offset 93: Wasm opcode 0x10
Script wasm://wasm/42af3c82 byte offset 93: Wasm opcode 0x10 (kExprCallFunction)
Removing breakpoint
Debugger.stepOver called
Script wasm://wasm/42af3c82 byte offset 95: Wasm opcode 0x20
Script wasm://wasm/42af3c82 byte offset 95: Wasm opcode 0x20 (kExprLocalGet)
Debugger.resume called
Finished!
......@@ -22,10 +22,10 @@ paused
Debugger.stepInto
paused
Script wasm://wasm/7d022e0e byte offset 35: Wasm opcode 0x20
Script wasm://wasm/7d022e0e byte offset 35: Wasm opcode 0x20 (kExprLocalGet)
Debugger.resume
paused
Script wasm://wasm/7d022e0e byte offset 37: Wasm opcode 0x41
Script wasm://wasm/7d022e0e byte offset 37: Wasm opcode 0x41 (kExprI32Const)
Debugger.resume
exports.main returned!
Finished!
......@@ -17,7 +17,7 @@ function test() {
Debugger.resume
paused
Script wasm://wasm/242f4a16 byte offset 33: Wasm opcode 0x01
Script wasm://wasm/242f4a16 byte offset 33: Wasm opcode 0x01 (kExprNop)
Debugger.stepOut
paused
instance.exports.main();
......@@ -36,10 +36,10 @@ function test() {
Debugger.resume
paused
Script wasm://wasm/242f4a16 byte offset 33: Wasm opcode 0x01
Script wasm://wasm/242f4a16 byte offset 33: Wasm opcode 0x01 (kExprNop)
Debugger.stepOver
paused
Script wasm://wasm/242f4a16 byte offset 34: Wasm opcode 0x0b
Script wasm://wasm/242f4a16 byte offset 34: Wasm opcode 0x0b (kExprEnd)
Debugger.resume
exports.main returned!
Finished run 2!
......@@ -52,10 +52,10 @@ function test() {
Debugger.resume
paused
Script wasm://wasm/242f4a16 byte offset 33: Wasm opcode 0x01
Script wasm://wasm/242f4a16 byte offset 33: Wasm opcode 0x01 (kExprNop)
Debugger.stepInto
paused
Script wasm://wasm/242f4a16 byte offset 34: Wasm opcode 0x0b
Script wasm://wasm/242f4a16 byte offset 34: Wasm opcode 0x0b (kExprEnd)
Debugger.resume
exports.main returned!
Finished run 3!
......
......@@ -7,83 +7,83 @@ Got wasm script: wasm://wasm/befe41aa
scriptId : <scriptId>
}
Test with valid skip lists
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
Test: Stepping over without skip list
Testing stepOver with skipList: []
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20 (kExprLocalGet)
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41 (kExprI32Const)
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b (kExprI32Sub)
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21 (kExprLocalSet)
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41 (kExprI32Const)
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10 (kExprCallFunction)
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
Test: Stepping over with skip list
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":48},"end":{"lineNumber":0,"columnNumber":50}},{"scriptId":"4","start":{"lineNumber":0,"columnNumber":60},"end":{"lineNumber":0,"columnNumber":62}}]
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20 (kExprLocalGet)
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41 (kExprI32Const)
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b (kExprI32Sub)
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21 (kExprLocalSet)
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41 (kExprI32Const)
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
Test: Stepping over start location is inclusive
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":48},"end":{"lineNumber":0,"columnNumber":61}}]
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
Test: Stepping over end location is exclusive
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":49},"end":{"lineNumber":0,"columnNumber":62}}]
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
Test: Stepping into without skip list
Testing stepInto with skipList: []
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10
Script wasm://wasm/befe41aa byte offset 39: Wasm opcode 0x01
Script wasm://wasm/befe41aa byte offset 40: Wasm opcode 0x01
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20 (kExprLocalGet)
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41 (kExprI32Const)
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b (kExprI32Sub)
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21 (kExprLocalSet)
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41 (kExprI32Const)
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10 (kExprCallFunction)
Script wasm://wasm/befe41aa byte offset 39: Wasm opcode 0x01 (kExprNop)
Script wasm://wasm/befe41aa byte offset 40: Wasm opcode 0x01 (kExprNop)
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b (kExprEnd)
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
Test: Stepping into with skip list, while call itself is skipped
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":39},"end":{"lineNumber":0,"columnNumber":41}},{"scriptId":"4","start":{"lineNumber":0,"columnNumber":50},"end":{"lineNumber":0,"columnNumber":62}}]
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b (kExprEnd)
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
Test: Stepping into start location is inclusive
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":39},"end":{"lineNumber":0,"columnNumber":40}}]
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10
Script wasm://wasm/befe41aa byte offset 40: Wasm opcode 0x01
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20 (kExprLocalGet)
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41 (kExprI32Const)
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b (kExprI32Sub)
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21 (kExprLocalSet)
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41 (kExprI32Const)
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10 (kExprCallFunction)
Script wasm://wasm/befe41aa byte offset 40: Wasm opcode 0x01 (kExprNop)
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b (kExprEnd)
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
Test: Stepping into end location is exclusive
Testing stepInto with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":38},"end":{"lineNumber":0,"columnNumber":41}}]
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 48: Wasm opcode 0x04 (kExprIf)
Script wasm://wasm/befe41aa byte offset 50: Wasm opcode 0x20 (kExprLocalGet)
Script wasm://wasm/befe41aa byte offset 52: Wasm opcode 0x41 (kExprI32Const)
Script wasm://wasm/befe41aa byte offset 54: Wasm opcode 0x6b (kExprI32Sub)
Script wasm://wasm/befe41aa byte offset 55: Wasm opcode 0x21 (kExprLocalSet)
Script wasm://wasm/befe41aa byte offset 57: Wasm opcode 0x41 (kExprI32Const)
Script wasm://wasm/befe41aa byte offset 60: Wasm opcode 0x10 (kExprCallFunction)
Script wasm://wasm/befe41aa byte offset 41: Wasm opcode 0x0b (kExprEnd)
Script wasm://wasm/befe41aa byte offset 62: Wasm opcode 0x0c (kExprBr)
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
Test with invalid skip lists
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20
Script wasm://wasm/befe41aa byte offset 46: Wasm opcode 0x20 (kExprLocalGet)
Test: start position has invalid column number
Testing stepOver with skipList: [{"scriptId":"4","start":{"lineNumber":0,"columnNumber":-1},"end":{"lineNumber":0,"columnNumber":62}}]
Position missing 'column' or 'column' < 0.
......
......@@ -9,7 +9,7 @@ Setting breakpoint on offset 54 (on the setlocal before the call), url wasm://wa
lineNumber : 0
scriptId : <scriptId>
}
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
at wasm_B (0:54):
- scope (module):
-- skipped
......@@ -21,7 +21,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10 (kExprCallFunction)
at wasm_B (0:56):
- scope (module):
-- skipped
......@@ -33,7 +33,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x01
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x01 (kExprNop)
at wasm_A (0:38):
- scope (module):
-- skipped
......@@ -52,7 +52,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOver called
Script wasm://wasm/9b4bf87e byte offset 39: Wasm opcode 0x01
Script wasm://wasm/9b4bf87e byte offset 39: Wasm opcode 0x01 (kExprNop)
at wasm_A (0:39):
- scope (module):
-- skipped
......@@ -71,7 +71,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOut called
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c (kExprBr)
at wasm_B (0:58):
- scope (module):
-- skipped
......@@ -83,7 +83,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOut called
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
at wasm_B (0:54):
- scope (module):
-- skipped
......@@ -95,7 +95,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOver called
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10 (kExprCallFunction)
at wasm_B (0:56):
- scope (module):
-- skipped
......@@ -107,7 +107,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOver called
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c (kExprBr)
at wasm_B (0:58):
- scope (module):
-- skipped
......@@ -119,7 +119,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.resume called
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
at wasm_B (0:54):
- scope (module):
-- skipped
......@@ -131,7 +131,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10 (kExprCallFunction)
at wasm_B (0:56):
- scope (module):
-- skipped
......@@ -143,7 +143,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x01
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x01 (kExprNop)
at wasm_A (0:38):
- scope (module):
-- skipped
......@@ -162,7 +162,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepOut called
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c (kExprBr)
at wasm_B (0:58):
- scope (module):
-- skipped
......@@ -174,7 +174,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 45: Wasm opcode 0x20
Script wasm://wasm/9b4bf87e byte offset 45: Wasm opcode 0x20 (kExprLocalGet)
at wasm_B (0:45):
- scope (module):
-- skipped
......@@ -186,7 +186,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 47: Wasm opcode 0x04
Script wasm://wasm/9b4bf87e byte offset 47: Wasm opcode 0x04 (kExprIf)
at wasm_B (0:47):
- scope (module):
-- skipped
......@@ -198,7 +198,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 49: Wasm opcode 0x20
Script wasm://wasm/9b4bf87e byte offset 49: Wasm opcode 0x20 (kExprLocalGet)
at wasm_B (0:49):
- scope (module):
-- skipped
......@@ -210,7 +210,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 51: Wasm opcode 0x41
Script wasm://wasm/9b4bf87e byte offset 51: Wasm opcode 0x41 (kExprI32Const)
at wasm_B (0:51):
- scope (module):
-- skipped
......@@ -222,7 +222,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 53: Wasm opcode 0x6b
Script wasm://wasm/9b4bf87e byte offset 53: Wasm opcode 0x6b (kExprI32Sub)
at wasm_B (0:53):
- scope (module):
-- skipped
......@@ -234,7 +234,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21
Script wasm://wasm/9b4bf87e byte offset 54: Wasm opcode 0x21 (kExprLocalSet)
at wasm_B (0:54):
- scope (module):
-- skipped
......@@ -246,7 +246,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10
Script wasm://wasm/9b4bf87e byte offset 56: Wasm opcode 0x10 (kExprCallFunction)
at wasm_B (0:56):
- scope (module):
-- skipped
......@@ -258,7 +258,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x01
Script wasm://wasm/9b4bf87e byte offset 38: Wasm opcode 0x01 (kExprNop)
at wasm_A (0:38):
- scope (module):
-- skipped
......@@ -277,7 +277,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 39: Wasm opcode 0x01
Script wasm://wasm/9b4bf87e byte offset 39: Wasm opcode 0x01 (kExprNop)
at wasm_A (0:39):
- scope (module):
-- skipped
......@@ -296,7 +296,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 40: Wasm opcode 0x0b
Script wasm://wasm/9b4bf87e byte offset 40: Wasm opcode 0x0b (kExprEnd)
at wasm_A (0:40):
- scope (module):
-- skipped
......@@ -315,7 +315,7 @@ at (anonymous) (0:17):
- scope (global):
-- skipped
Debugger.stepInto called
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c
Script wasm://wasm/9b4bf87e byte offset 58: Wasm opcode 0x0c (kExprBr)
at wasm_B (0:58):
- scope (module):
-- skipped
......
......@@ -299,9 +299,14 @@ InspectorTest.Session = class {
if (location.lineNumber != 0) {
InspectorTest.log('Unexpected wasm line number: ' + location.lineNumber);
}
let wasm_opcode = script.bytecode[location.columnNumber].toString(16);
if (wasm_opcode.length % 2) wasm_opcode = '0' + wasm_opcode;
InspectorTest.log(`Script ${script.url} byte offset ${location.columnNumber}: Wasm opcode 0x${wasm_opcode}`);
let wasm_opcode = script.bytecode[location.columnNumber];
let opcode_str = wasm_opcode.toString(16);
if (opcode_str.length % 2) opcode_str = `0${opcode_str}`;
if (InspectorTest.getWasmOpcodeName) {
opcode_str += ` (${InspectorTest.getWasmOpcodeName(wasm_opcode)})`;
}
InspectorTest.log(`Script ${script.url} byte offset ${
location.columnNumber}: Wasm opcode 0x${opcode_str}`);
} else {
var lines = script.scriptSource.split('\n');
var line = lines[location.lineNumber];
......
......@@ -5,6 +5,7 @@
utils.load('test/mjsunit/wasm/wasm-module-builder.js');
WasmInspectorTest = {}
InspectorTest.getWasmOpcodeName = getOpcodeName;
WasmInspectorTest.evalWithUrl = (code, url) =>
Protocol.Runtime
......
......@@ -197,204 +197,226 @@ function makeSig_r_xx(r, x) {
}
// Opcodes
let kExprUnreachable = 0x00;
let kExprNop = 0x01;
let kExprBlock = 0x02;
let kExprLoop = 0x03;
let kExprIf = 0x04;
let kExprElse = 0x05;
let kExprTry = 0x06;
let kExprCatch = 0x07;
let kExprThrow = 0x08;
let kExprRethrow = 0x09;
let kExprBrOnExn = 0x0a;
let kExprEnd = 0x0b;
let kExprBr = 0x0c;
let kExprBrIf = 0x0d;
let kExprBrTable = 0x0e;
let kExprReturn = 0x0f;
let kExprCallFunction = 0x10;
let kExprCallIndirect = 0x11;
let kExprReturnCall = 0x12;
let kExprReturnCallIndirect = 0x13;
let kExprCallRef = 0x14;
let kExprReturnCallRef = 0x15;
let kExprDrop = 0x1a;
let kExprSelect = 0x1b;
let kExprSelectWithType = 0x1c;
let kExprLocalGet = 0x20;
let kExprLocalSet = 0x21;
let kExprLocalTee = 0x22;
let kExprGlobalGet = 0x23;
let kExprGlobalSet = 0x24;
let kExprTableGet = 0x25;
let kExprTableSet = 0x26;
let kExprI32LoadMem = 0x28;
let kExprI64LoadMem = 0x29;
let kExprF32LoadMem = 0x2a;
let kExprF64LoadMem = 0x2b;
let kExprI32LoadMem8S = 0x2c;
let kExprI32LoadMem8U = 0x2d;
let kExprI32LoadMem16S = 0x2e;
let kExprI32LoadMem16U = 0x2f;
let kExprI64LoadMem8S = 0x30;
let kExprI64LoadMem8U = 0x31;
let kExprI64LoadMem16S = 0x32;
let kExprI64LoadMem16U = 0x33;
let kExprI64LoadMem32S = 0x34;
let kExprI64LoadMem32U = 0x35;
let kExprI32StoreMem = 0x36;
let kExprI64StoreMem = 0x37;
let kExprF32StoreMem = 0x38;
let kExprF64StoreMem = 0x39;
let kExprI32StoreMem8 = 0x3a;
let kExprI32StoreMem16 = 0x3b;
let kExprI64StoreMem8 = 0x3c;
let kExprI64StoreMem16 = 0x3d;
let kExprI64StoreMem32 = 0x3e;
let kExprMemorySize = 0x3f;
let kExprMemoryGrow = 0x40;
let kExprI32Const = 0x41;
let kExprI64Const = 0x42;
let kExprF32Const = 0x43;
let kExprF64Const = 0x44;
let kExprI32Eqz = 0x45;
let kExprI32Eq = 0x46;
let kExprI32Ne = 0x47;
let kExprI32LtS = 0x48;
let kExprI32LtU = 0x49;
let kExprI32GtS = 0x4a;
let kExprI32GtU = 0x4b;
let kExprI32LeS = 0x4c;
let kExprI32LeU = 0x4d;
let kExprI32GeS = 0x4e;
let kExprI32GeU = 0x4f;
let kExprI64Eqz = 0x50;
let kExprI64Eq = 0x51;
let kExprI64Ne = 0x52;
let kExprI64LtS = 0x53;
let kExprI64LtU = 0x54;
let kExprI64GtS = 0x55;
let kExprI64GtU = 0x56;
let kExprI64LeS = 0x57;
let kExprI64LeU = 0x58;
let kExprI64GeS = 0x59;
let kExprI64GeU = 0x5a;
let kExprF32Eq = 0x5b;
let kExprF32Ne = 0x5c;
let kExprF32Lt = 0x5d;
let kExprF32Gt = 0x5e;
let kExprF32Le = 0x5f;
let kExprF32Ge = 0x60;
let kExprF64Eq = 0x61;
let kExprF64Ne = 0x62;
let kExprF64Lt = 0x63;
let kExprF64Gt = 0x64;
let kExprF64Le = 0x65;
let kExprF64Ge = 0x66;
let kExprI32Clz = 0x67;
let kExprI32Ctz = 0x68;
let kExprI32Popcnt = 0x69;
let kExprI32Add = 0x6a;
let kExprI32Sub = 0x6b;
let kExprI32Mul = 0x6c;
let kExprI32DivS = 0x6d;
let kExprI32DivU = 0x6e;
let kExprI32RemS = 0x6f;
let kExprI32RemU = 0x70;
let kExprI32And = 0x71;
let kExprI32Ior = 0x72;
let kExprI32Xor = 0x73;
let kExprI32Shl = 0x74;
let kExprI32ShrS = 0x75;
let kExprI32ShrU = 0x76;
let kExprI32Rol = 0x77;
let kExprI32Ror = 0x78;
let kExprI64Clz = 0x79;
let kExprI64Ctz = 0x7a;
let kExprI64Popcnt = 0x7b;
let kExprI64Add = 0x7c;
let kExprI64Sub = 0x7d;
let kExprI64Mul = 0x7e;
let kExprI64DivS = 0x7f;
let kExprI64DivU = 0x80;
let kExprI64RemS = 0x81;
let kExprI64RemU = 0x82;
let kExprI64And = 0x83;
let kExprI64Ior = 0x84;
let kExprI64Xor = 0x85;
let kExprI64Shl = 0x86;
let kExprI64ShrS = 0x87;
let kExprI64ShrU = 0x88;
let kExprI64Rol = 0x89;
let kExprI64Ror = 0x8a;
let kExprF32Abs = 0x8b;
let kExprF32Neg = 0x8c;
let kExprF32Ceil = 0x8d;
let kExprF32Floor = 0x8e;
let kExprF32Trunc = 0x8f;
let kExprF32NearestInt = 0x90;
let kExprF32Sqrt = 0x91;
let kExprF32Add = 0x92;
let kExprF32Sub = 0x93;
let kExprF32Mul = 0x94;
let kExprF32Div = 0x95;
let kExprF32Min = 0x96;
let kExprF32Max = 0x97;
let kExprF32CopySign = 0x98;
let kExprF64Abs = 0x99;
let kExprF64Neg = 0x9a;
let kExprF64Ceil = 0x9b;
let kExprF64Floor = 0x9c;
let kExprF64Trunc = 0x9d;
let kExprF64NearestInt = 0x9e;
let kExprF64Sqrt = 0x9f;
let kExprF64Add = 0xa0;
let kExprF64Sub = 0xa1;
let kExprF64Mul = 0xa2;
let kExprF64Div = 0xa3;
let kExprF64Min = 0xa4;
let kExprF64Max = 0xa5;
let kExprF64CopySign = 0xa6;
let kExprI32ConvertI64 = 0xa7;
let kExprI32SConvertF32 = 0xa8;
let kExprI32UConvertF32 = 0xa9;
let kExprI32SConvertF64 = 0xaa;
let kExprI32UConvertF64 = 0xab;
let kExprI64SConvertI32 = 0xac;
let kExprI64UConvertI32 = 0xad;
let kExprI64SConvertF32 = 0xae;
let kExprI64UConvertF32 = 0xaf;
let kExprI64SConvertF64 = 0xb0;
let kExprI64UConvertF64 = 0xb1;
let kExprF32SConvertI32 = 0xb2;
let kExprF32UConvertI32 = 0xb3;
let kExprF32SConvertI64 = 0xb4;
let kExprF32UConvertI64 = 0xb5;
let kExprF32ConvertF64 = 0xb6;
let kExprF64SConvertI32 = 0xb7;
let kExprF64UConvertI32 = 0xb8;
let kExprF64SConvertI64 = 0xb9;
let kExprF64UConvertI64 = 0xba;
let kExprF64ConvertF32 = 0xbb;
let kExprI32ReinterpretF32 = 0xbc;
let kExprI64ReinterpretF64 = 0xbd;
let kExprF32ReinterpretI32 = 0xbe;
let kExprF64ReinterpretI64 = 0xbf;
let kExprI32SExtendI8 = 0xc0;
let kExprI32SExtendI16 = 0xc1;
let kExprI64SExtendI8 = 0xc2;
let kExprI64SExtendI16 = 0xc3;
let kExprI64SExtendI32 = 0xc4;
let kExprRefNull = 0xd0;
let kExprRefIsNull = 0xd1;
let kExprRefFunc = 0xd2;
const kWasmOpcodes = {
'Unreachable': 0x00,
'Nop': 0x01,
'Block': 0x02,
'Loop': 0x03,
'If': 0x04,
'Else': 0x05,
'Try': 0x06,
'Catch': 0x07,
'Throw': 0x08,
'Rethrow': 0x09,
'BrOnExn': 0x0a,
'End': 0x0b,
'Br': 0x0c,
'BrIf': 0x0d,
'BrTable': 0x0e,
'Return': 0x0f,
'CallFunction': 0x10,
'CallIndirect': 0x11,
'ReturnCall': 0x12,
'ReturnCallIndirect': 0x13,
'CallRef': 0x14,
'ReturnCallRef': 0x15,
'Drop': 0x1a,
'Select': 0x1b,
'SelectWithType': 0x1c,
'LocalGet': 0x20,
'LocalSet': 0x21,
'LocalTee': 0x22,
'GlobalGet': 0x23,
'GlobalSet': 0x24,
'TableGet': 0x25,
'TableSet': 0x26,
'I32LoadMem': 0x28,
'I64LoadMem': 0x29,
'F32LoadMem': 0x2a,
'F64LoadMem': 0x2b,
'I32LoadMem8S': 0x2c,
'I32LoadMem8U': 0x2d,
'I32LoadMem16S': 0x2e,
'I32LoadMem16U': 0x2f,
'I64LoadMem8S': 0x30,
'I64LoadMem8U': 0x31,
'I64LoadMem16S': 0x32,
'I64LoadMem16U': 0x33,
'I64LoadMem32S': 0x34,
'I64LoadMem32U': 0x35,
'I32StoreMem': 0x36,
'I64StoreMem': 0x37,
'F32StoreMem': 0x38,
'F64StoreMem': 0x39,
'I32StoreMem8': 0x3a,
'I32StoreMem16': 0x3b,
'I64StoreMem8': 0x3c,
'I64StoreMem16': 0x3d,
'I64StoreMem32': 0x3e,
'MemorySize': 0x3f,
'MemoryGrow': 0x40,
'I32Const': 0x41,
'I64Const': 0x42,
'F32Const': 0x43,
'F64Const': 0x44,
'I32Eqz': 0x45,
'I32Eq': 0x46,
'I32Ne': 0x47,
'I32LtS': 0x48,
'I32LtU': 0x49,
'I32GtS': 0x4a,
'I32GtU': 0x4b,
'I32LeS': 0x4c,
'I32LeU': 0x4d,
'I32GeS': 0x4e,
'I32GeU': 0x4f,
'I64Eqz': 0x50,
'I64Eq': 0x51,
'I64Ne': 0x52,
'I64LtS': 0x53,
'I64LtU': 0x54,
'I64GtS': 0x55,
'I64GtU': 0x56,
'I64LeS': 0x57,
'I64LeU': 0x58,
'I64GeS': 0x59,
'I64GeU': 0x5a,
'F32Eq': 0x5b,
'F32Ne': 0x5c,
'F32Lt': 0x5d,
'F32Gt': 0x5e,
'F32Le': 0x5f,
'F32Ge': 0x60,
'F64Eq': 0x61,
'F64Ne': 0x62,
'F64Lt': 0x63,
'F64Gt': 0x64,
'F64Le': 0x65,
'F64Ge': 0x66,
'I32Clz': 0x67,
'I32Ctz': 0x68,
'I32Popcnt': 0x69,
'I32Add': 0x6a,
'I32Sub': 0x6b,
'I32Mul': 0x6c,
'I32DivS': 0x6d,
'I32DivU': 0x6e,
'I32RemS': 0x6f,
'I32RemU': 0x70,
'I32And': 0x71,
'I32Ior': 0x72,
'I32Xor': 0x73,
'I32Shl': 0x74,
'I32ShrS': 0x75,
'I32ShrU': 0x76,
'I32Rol': 0x77,
'I32Ror': 0x78,
'I64Clz': 0x79,
'I64Ctz': 0x7a,
'I64Popcnt': 0x7b,
'I64Add': 0x7c,
'I64Sub': 0x7d,
'I64Mul': 0x7e,
'I64DivS': 0x7f,
'I64DivU': 0x80,
'I64RemS': 0x81,
'I64RemU': 0x82,
'I64And': 0x83,
'I64Ior': 0x84,
'I64Xor': 0x85,
'I64Shl': 0x86,
'I64ShrS': 0x87,
'I64ShrU': 0x88,
'I64Rol': 0x89,
'I64Ror': 0x8a,
'F32Abs': 0x8b,
'F32Neg': 0x8c,
'F32Ceil': 0x8d,
'F32Floor': 0x8e,
'F32Trunc': 0x8f,
'F32NearestInt': 0x90,
'F32Sqrt': 0x91,
'F32Add': 0x92,
'F32Sub': 0x93,
'F32Mul': 0x94,
'F32Div': 0x95,
'F32Min': 0x96,
'F32Max': 0x97,
'F32CopySign': 0x98,
'F64Abs': 0x99,
'F64Neg': 0x9a,
'F64Ceil': 0x9b,
'F64Floor': 0x9c,
'F64Trunc': 0x9d,
'F64NearestInt': 0x9e,
'F64Sqrt': 0x9f,
'F64Add': 0xa0,
'F64Sub': 0xa1,
'F64Mul': 0xa2,
'F64Div': 0xa3,
'F64Min': 0xa4,
'F64Max': 0xa5,
'F64CopySign': 0xa6,
'I32ConvertI64': 0xa7,
'I32SConvertF32': 0xa8,
'I32UConvertF32': 0xa9,
'I32SConvertF64': 0xaa,
'I32UConvertF64': 0xab,
'I64SConvertI32': 0xac,
'I64UConvertI32': 0xad,
'I64SConvertF32': 0xae,
'I64UConvertF32': 0xaf,
'I64SConvertF64': 0xb0,
'I64UConvertF64': 0xb1,
'F32SConvertI32': 0xb2,
'F32UConvertI32': 0xb3,
'F32SConvertI64': 0xb4,
'F32UConvertI64': 0xb5,
'F32ConvertF64': 0xb6,
'F64SConvertI32': 0xb7,
'F64UConvertI32': 0xb8,
'F64SConvertI64': 0xb9,
'F64UConvertI64': 0xba,
'F64ConvertF32': 0xbb,
'I32ReinterpretF32': 0xbc,
'I64ReinterpretF64': 0xbd,
'F32ReinterpretI32': 0xbe,
'F64ReinterpretI64': 0xbf,
'I32SExtendI8': 0xc0,
'I32SExtendI16': 0xc1,
'I64SExtendI8': 0xc2,
'I64SExtendI16': 0xc3,
'I64SExtendI32': 0xc4,
'RefNull': 0xd0,
'RefIsNull': 0xd1,
'RefFunc': 0xd2
};
function defineWasmOpcode(name, value) {
if (globalThis.kWasmOpcodeNames === undefined) {
globalThis.kWasmOpcodeNames = {};
}
Object.defineProperty(globalThis, name, {value: value});
if (globalThis.kWasmOpcodeNames[value] !== undefined) {
throw new Error(`Duplicate wasm opcode: ${value}. Previous name: ${
globalThis.kWasmOpcodeNames[value]}, new name: ${name}`);
}
globalThis.kWasmOpcodeNames[value] = name;
}
for (let name in kWasmOpcodes) {
defineWasmOpcode(`kExpr${name}`, kWasmOpcodes[name]);
}
// Prefix opcodes
let kGCPrefix = 0xfb;
let kNumericPrefix = 0xfc;
let kSimdPrefix = 0xfd;
let kAtomicPrefix = 0xfe;
const kPrefixOpcodes = {
'GC': 0xfb,
'Numeric': 0xfc,
'Simd': 0xfd,
'Atomic': 0xfe
};
for (let prefix in kPrefixOpcodes) {
defineWasmOpcode(`k${prefix}Prefix`, kPrefixOpcodes[prefix]);
}
// GC opcodes
let kExprRttCanon = 0x30;
......@@ -1672,3 +1694,7 @@ function wasmS128Const(f) {
// Write in little-endian order at offset 0.
return [kSimdPrefix, kExprS128Const, ...f];
}
function getOpcodeName(opcode) {
return globalThis.kWasmOpcodeNames?.[opcode] ?? 'unknown';
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment