Skip to content

Commit

Permalink
[wasm] Use new names for instructions
Browse files Browse the repository at this point in the history
These instructions were renamed in the October 2, WebAssembly CG meeting. The
issue describing the change is here:

WebAssembly/spec#884

Change-Id: Ia9e8733156b5ed5db7fc9ab1681c1a51b874dd71
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1620681
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61711}
  • Loading branch information
binji authored and Commit Bot committed May 21, 2019
1 parent daa2667 commit 76537be
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 81 deletions.
74 changes: 37 additions & 37 deletions src/wasm/wasm-opcodes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ namespace wasm {
#define CASE_ALL_SIGN_OP(name, str) \
CASE_FLOAT_OP(name, str) CASE_SIGN_OP(INT, name, str)
#define CASE_CONVERT_OP(name, RES, SRC, src_suffix, str) \
CASE_##RES##_OP(U##name##SRC, str "_u/" src_suffix) \
CASE_##RES##_OP(S##name##SRC, str "_s/" src_suffix)
#define CASE_CONVERT_SAT_OP(name, RES, SRC, src_suffix, str) \
CASE_##RES##_OP(U##name##Sat##SRC, str "_u:sat/" src_suffix) \
CASE_##RES##_OP(S##name##Sat##SRC, str "_s:sat/" src_suffix)
CASE_##RES##_OP(U##name##SRC, str "_" src_suffix "_u") \
CASE_##RES##_OP(S##name##SRC, str "_" src_suffix "_s")
#define CASE_CONVERT_SAT_OP(name, RES, SRC, src_suffix, str) \
CASE_##RES##_OP(U##name##Sat##SRC, str "_sat_" src_suffix "_u") \
CASE_##RES##_OP(S##name##Sat##SRC, str "_sat_" src_suffix "_s")
#define CASE_L32_OP(name, str) \
CASE_SIGN_OP(I32, name##8, str "8") \
CASE_SIGN_OP(I32, name##16, str "16") \
Expand Down Expand Up @@ -108,23 +108,23 @@ const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) {
CASE_REF_OP(Null, "null")
CASE_REF_OP(IsNull, "is_null")
CASE_REF_OP(Func, "func")
CASE_I32_OP(ConvertI64, "wrap/i64")
CASE_I32_OP(ConvertI64, "wrap_i64")
CASE_CONVERT_OP(Convert, INT, F32, "f32", "trunc")
CASE_CONVERT_OP(Convert, INT, F64, "f64", "trunc")
CASE_CONVERT_OP(Convert, I64, I32, "i32", "extend")
CASE_CONVERT_OP(Convert, F32, I32, "i32", "convert")
CASE_CONVERT_OP(Convert, F32, I64, "i64", "convert")
CASE_F32_OP(ConvertF64, "demote/f64")
CASE_F32_OP(ConvertF64, "demote_f64")
CASE_CONVERT_OP(Convert, F64, I32, "i32", "convert")
CASE_CONVERT_OP(Convert, F64, I64, "i64", "convert")
CASE_F64_OP(ConvertF32, "promote/f32")
CASE_I32_OP(ReinterpretF32, "reinterpret/f32")
CASE_I64_OP(ReinterpretF64, "reinterpret/f64")
CASE_F32_OP(ReinterpretI32, "reinterpret/i32")
CASE_F64_OP(ReinterpretI64, "reinterpret/i64")
CASE_INT_OP(SExtendI8, "sign_extend8")
CASE_INT_OP(SExtendI16, "sign_extend16")
CASE_I64_OP(SExtendI32, "sign_extend32")
CASE_F64_OP(ConvertF32, "promote_f32")
CASE_I32_OP(ReinterpretF32, "reinterpret_f32")
CASE_I64_OP(ReinterpretF64, "reinterpret_f64")
CASE_F32_OP(ReinterpretI32, "reinterpret_i32")
CASE_F64_OP(ReinterpretI64, "reinterpret_i64")
CASE_INT_OP(SExtendI8, "extend8_s")
CASE_INT_OP(SExtendI16, "extend16_s")
CASE_I64_OP(SExtendI32, "extend32_s")
CASE_OP(Unreachable, "unreachable")
CASE_OP(Nop, "nop")
CASE_OP(Block, "block")
Expand All @@ -142,13 +142,13 @@ const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) {
CASE_OP(ReturnCallIndirect, "return_call_indirect")
CASE_OP(Drop, "drop")
CASE_OP(Select, "select")
CASE_OP(GetLocal, "get_local")
CASE_OP(SetLocal, "set_local")
CASE_OP(TeeLocal, "tee_local")
CASE_OP(GetGlobal, "get_global")
CASE_OP(SetGlobal, "set_global")
CASE_OP(GetTable, "get_table")
CASE_OP(SetTable, "set_table")
CASE_OP(GetLocal, "local.get")
CASE_OP(SetLocal, "local.set")
CASE_OP(TeeLocal, "local.tee")
CASE_OP(GetGlobal, "global.get")
CASE_OP(SetGlobal, "global.set")
CASE_OP(GetTable, "table.get")
CASE_OP(SetTable, "table.set")
CASE_ALL_OP(Const, "const")
CASE_OP(MemorySize, "memory.size")
CASE_OP(MemoryGrow, "memory.grow")
Expand Down Expand Up @@ -192,10 +192,10 @@ const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) {
CASE_I32_OP(AsmjsStoreMem16, "asmjs_store16")
CASE_SIGN_OP(I32, AsmjsDiv, "asmjs_div")
CASE_SIGN_OP(I32, AsmjsRem, "asmjs_rem")
CASE_I32_OP(AsmjsSConvertF32, "asmjs_convert_s/f32")
CASE_I32_OP(AsmjsUConvertF32, "asmjs_convert_u/f32")
CASE_I32_OP(AsmjsSConvertF64, "asmjs_convert_s/f64")
CASE_I32_OP(AsmjsUConvertF64, "asmjs_convert_u/f64")
CASE_I32_OP(AsmjsSConvertF32, "asmjs_convert_f32_s")
CASE_I32_OP(AsmjsUConvertF32, "asmjs_convert_f32_u")
CASE_I32_OP(AsmjsSConvertF64, "asmjs_convert_f64_s")
CASE_I32_OP(AsmjsUConvertF64, "asmjs_convert_f64_u")

// Numeric Opcodes.
CASE_CONVERT_SAT_OP(Convert, I32, F32, "f32", "trunc")
Expand Down Expand Up @@ -271,17 +271,17 @@ const char* WasmOpcodes::OpcodeName(WasmOpcode opcode) {
CASE_S1x16_OP(AllTrue, "all_true")

// Atomic operations.
CASE_OP(AtomicNotify, "atomic_notify")
CASE_INT_OP(AtomicWait, "atomic_wait")
CASE_UNSIGNED_ALL_OP(AtomicLoad, "atomic_load")
CASE_UNSIGNED_ALL_OP(AtomicStore, "atomic_store")
CASE_UNSIGNED_ALL_OP(AtomicAdd, "atomic_add")
CASE_UNSIGNED_ALL_OP(AtomicSub, "atomic_sub")
CASE_UNSIGNED_ALL_OP(AtomicAnd, "atomic_and")
CASE_UNSIGNED_ALL_OP(AtomicOr, "atomic_or")
CASE_UNSIGNED_ALL_OP(AtomicXor, "atomic_xor")
CASE_UNSIGNED_ALL_OP(AtomicExchange, "atomic_xchng")
CASE_UNSIGNED_ALL_OP(AtomicCompareExchange, "atomic_cmpxchng")
CASE_OP(AtomicNotify, "atomic.notify")
CASE_INT_OP(AtomicWait, "atomic.wait")
CASE_UNSIGNED_ALL_OP(AtomicLoad, "atomic.load")
CASE_UNSIGNED_ALL_OP(AtomicStore, "atomic.store")
CASE_UNSIGNED_ALL_OP(AtomicAdd, "atomic.add")
CASE_UNSIGNED_ALL_OP(AtomicSub, "atomic.sub")
CASE_UNSIGNED_ALL_OP(AtomicAnd, "atomic.and")
CASE_UNSIGNED_ALL_OP(AtomicOr, "atomic.or")
CASE_UNSIGNED_ALL_OP(AtomicXor, "atomic.xor")
CASE_UNSIGNED_ALL_OP(AtomicExchange, "atomic.xchng")
CASE_UNSIGNED_ALL_OP(AtomicCompareExchange, "atomic.cmpxchng")

default : return "unknown";
// clang-format on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ Requesting all breakable locations in wasm script 0
4 breakable location(s):
[0] 2:2 || >nop
[1] 3:2 || >i32.const 12
[2] 4:2 || >set_local 0
[2] 4:2 || >local.set 0
[3] 5:0 || >end
Requesting breakable locations in lines [0,3)
1 breakable location(s):
[0] 2:2 || >nop
Requesting breakable locations in lines [4,6)
2 breakable location(s):
[0] 4:2 || >set_local 0
[0] 4:2 || >local.set 0
[1] 5:0 || >end
Requesting all breakable locations in wasm script 1
7 breakable location(s):
[0] 1:2 || >get_local 0
[0] 1:2 || >local.get 0
[1] 2:2 || >if
[2] 3:4 || >block
[3] 4:6 || >call 0
Expand All @@ -31,7 +31,7 @@ Requesting all breakable locations in wasm script 1
[6] 7:0 || >end
Requesting breakable locations in lines [0,3)
2 breakable location(s):
[0] 1:2 || >get_local 0
[0] 1:2 || >local.get 0
[1] 2:2 || >if
Requesting breakable locations in lines [4,6)
2 breakable location(s):
Expand Down
48 changes: 24 additions & 24 deletions test/inspector/debugger/wasm-scope-info-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Setting breakpoint on line 2 (first instruction)
Paused:
(local i32 i64 f64)
#i32.const 11
set_local 0
local.set 0

Scope:
at func (2:2):
Expand All @@ -27,7 +27,7 @@ at (anonymous) (0:17):

Paused:
i32.const 11
#set_local 0
#local.set 0
i32.const 47

Scope:
Expand All @@ -42,9 +42,9 @@ at (anonymous) (0:17):
-- skipped globals

Paused:
set_local 0
local.set 0
#i32.const 47
set_local 1
local.set 1

Scope:
at func (4:2):
Expand All @@ -59,7 +59,7 @@ at (anonymous) (0:17):

Paused:
i32.const 47
#set_local 1
#local.set 1
i64.const 9223372036854775807

Scope:
Expand All @@ -74,9 +74,9 @@ at (anonymous) (0:17):
-- skipped globals

Paused:
set_local 1
local.set 1
#i64.const 9223372036854775807
set_local 2
local.set 2

Scope:
at func (6:2):
Expand All @@ -91,7 +91,7 @@ at (anonymous) (0:17):

Paused:
i64.const 9223372036854775807
#set_local 2
#local.set 2
i64.const -9223372036854775808

Scope:
Expand All @@ -106,9 +106,9 @@ at (anonymous) (0:17):
-- skipped globals

Paused:
set_local 2
local.set 2
#i64.const -9223372036854775808
set_local 2
local.set 2

Scope:
at func (8:2):
Expand All @@ -123,7 +123,7 @@ at (anonymous) (0:17):

Paused:
i64.const -9223372036854775808
#set_local 2
#local.set 2
i32.const 1

Scope:
Expand All @@ -138,9 +138,9 @@ at (anonymous) (0:17):
-- skipped globals

Paused:
set_local 2
local.set 2
#i32.const 1
f64.convert_u/i32
f64.convert_i32_u

Scope:
at func (10:2):
Expand All @@ -155,7 +155,7 @@ at (anonymous) (0:17):

Paused:
i32.const 1
#f64.convert_u/i32
#f64.convert_i32_u
i32.const 7

Scope:
Expand All @@ -170,9 +170,9 @@ at (anonymous) (0:17):
-- skipped globals

Paused:
f64.convert_u/i32
f64.convert_i32_u
#i32.const 7
f64.convert_u/i32
f64.convert_i32_u

Scope:
at func (12:2):
Expand All @@ -187,7 +187,7 @@ at (anonymous) (0:17):

Paused:
i32.const 7
#f64.convert_u/i32
#f64.convert_i32_u
f64.div

Scope:
Expand All @@ -202,9 +202,9 @@ at (anonymous) (0:17):
-- skipped globals

Paused:
f64.convert_u/i32
f64.convert_i32_u
#f64.div
set_local 3
local.set 3

Scope:
at func (14:2):
Expand All @@ -219,7 +219,7 @@ at (anonymous) (0:17):

Paused:
f64.div
#set_local 3
#local.set 3
i32.const 15

Scope:
Expand All @@ -234,9 +234,9 @@ at (anonymous) (0:17):
-- skipped globals

Paused:
set_local 3
local.set 3
#i32.const 15
set_global 0
global.set 0

Scope:
at func (16:2):
Expand All @@ -251,7 +251,7 @@ at (anonymous) (0:17):

Paused:
i32.const 15
#set_global 0
#global.set 0
end

Scope:
Expand All @@ -266,7 +266,7 @@ at (anonymous) (0:17):
-- skipped globals

Paused:
set_global 0
global.set 0
#end


Expand Down
6 changes: 3 additions & 3 deletions test/inspector/debugger/wasm-set-breakpoint-expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Source of script wasm://wasm/wasm-0c10a5fe/wasm-0c10a5fe-0:
Source of script wasm://wasm/wasm-0c10a5fe/wasm-0c10a5fe-1:
1: func $wasm_B (param i32)
2: loop
3: get_local 0
3: local.get 0
4: if
5: get_local 0
5: local.get 0
6: i32.const 1
7: i32.sub
8: set_local 0
8: local.set 0
9: call 0
10: br 1
11: end
Expand Down
Loading

0 comments on commit 76537be

Please sign in to comment.