Commit 2949e05d authored by titzer's avatar titzer Committed by Commit bot

[wasm] Remove unnecessary kExprNop from WASM_BR and other macros.

R=ahaas@chromium.org,binji@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/1942873002
Cr-Commit-Position: refs/heads/master@{#35964}
parent fa570e55
......@@ -64,23 +64,20 @@
#define DEPTH_1 1
#define WASM_BLOCK(count, ...) kExprBlock, __VA_ARGS__, kExprEnd
#define WASM_INFINITE_LOOP \
kExprLoop, kExprNop, kExprBr, ARITY_0, DEPTH_0, kExprEnd
#define WASM_INFINITE_LOOP kExprLoop, kExprBr, ARITY_0, DEPTH_0, kExprEnd
#define WASM_LOOP(count, ...) kExprLoop, __VA_ARGS__, kExprEnd
#define WASM_IF(cond, tstmt) cond, kExprIf, tstmt, kExprEnd
#define WASM_IF_ELSE(cond, tstmt, fstmt) \
cond, kExprIf, tstmt, kExprElse, fstmt, kExprEnd
#define WASM_SELECT(tval, fval, cond) tval, fval, cond, kExprSelect
#define WASM_BR(depth) kExprNop, kExprBr, ARITY_0, static_cast<byte>(depth)
#define WASM_BR(depth) kExprBr, ARITY_0, static_cast<byte>(depth)
#define WASM_BR_IF(depth, cond) \
cond, kExprBrIf, ARITY_0, static_cast<byte>(depth)
#define WASM_BRV(depth, val) val, kExprBr, ARITY_1, static_cast<byte>(depth)
#define WASM_BRV_IF(depth, val, cond) \
val, cond, kExprBrIf, ARITY_1, static_cast<byte>(depth)
#define WASM_BREAK(depth) \
kExprNop, kExprBr, ARITY_0, static_cast<byte>(depth + 1)
#define WASM_CONTINUE(depth) \
kExprNop, kExprBr, ARITY_0, static_cast<byte>(depth)
#define WASM_BREAK(depth) kExprBr, ARITY_0, static_cast<byte>(depth + 1)
#define WASM_CONTINUE(depth) kExprBr, ARITY_0, static_cast<byte>(depth)
#define WASM_BREAKV(depth, val) \
val, kExprBr, ARITY_1, static_cast<byte>(depth + 1)
#define WASM_RETURN0 kExprReturn, ARITY_0
......
......@@ -64,19 +64,19 @@ TEST_F(WasmMacroGenTest, Statements) {
EXPECT_SIZE(5, WASM_SELECT(WASM_ZERO, WASM_NOP, WASM_NOP));
EXPECT_SIZE(4, WASM_BR(0));
EXPECT_SIZE(3, WASM_BR(0));
EXPECT_SIZE(5, WASM_BR_IF(0, WASM_ZERO));
EXPECT_SIZE(3, WASM_BLOCK(1, WASM_NOP));
EXPECT_SIZE(4, WASM_BLOCK(2, WASM_NOP, WASM_NOP));
EXPECT_SIZE(5, WASM_BLOCK(3, WASM_NOP, WASM_NOP, WASM_NOP));
EXPECT_SIZE(6, WASM_INFINITE_LOOP);
EXPECT_SIZE(5, WASM_INFINITE_LOOP);
EXPECT_SIZE(3, WASM_LOOP(1, WASM_NOP));
EXPECT_SIZE(4, WASM_LOOP(2, WASM_NOP, WASM_NOP));
EXPECT_SIZE(5, WASM_LOOP(3, WASM_NOP, WASM_NOP, WASM_NOP));
EXPECT_SIZE(6, WASM_LOOP(1, WASM_BR(0)));
EXPECT_SIZE(5, WASM_LOOP(1, WASM_BR(0)));
EXPECT_SIZE(7, WASM_LOOP(1, WASM_BR_IF(0, WASM_ZERO)));
EXPECT_SIZE(2, WASM_RETURN0);
......@@ -91,8 +91,8 @@ TEST_F(WasmMacroGenTest, MacroStatements) {
EXPECT_SIZE(7, WASM_INC_LOCAL(0));
EXPECT_SIZE(7, WASM_INC_LOCAL_BY(0, 3));
EXPECT_SIZE(4, WASM_BREAK(0));
EXPECT_SIZE(4, WASM_CONTINUE(0));
EXPECT_SIZE(3, WASM_BREAK(0));
EXPECT_SIZE(3, WASM_CONTINUE(0));
}
TEST_F(WasmMacroGenTest, BrTable) {
......
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