OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_WASM_MACRO_GEN_H_ | 5 #ifndef V8_WASM_MACRO_GEN_H_ |
6 #define V8_WASM_MACRO_GEN_H_ | 6 #define V8_WASM_MACRO_GEN_H_ |
7 | 7 |
8 #include "src/wasm/wasm-opcodes.h" | 8 #include "src/wasm/wasm-opcodes.h" |
9 | 9 |
10 #define U32_LE(v) \ | 10 #define U32_LE(v) \ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Control. | 57 // Control. |
58 //------------------------------------------------------------------------------ | 58 //------------------------------------------------------------------------------ |
59 #define WASM_NOP kExprNop | 59 #define WASM_NOP kExprNop |
60 | 60 |
61 #define ARITY_0 0 | 61 #define ARITY_0 0 |
62 #define ARITY_1 1 | 62 #define ARITY_1 1 |
63 #define DEPTH_0 0 | 63 #define DEPTH_0 0 |
64 #define DEPTH_1 1 | 64 #define DEPTH_1 1 |
65 | 65 |
66 #define WASM_BLOCK(count, ...) kExprBlock, __VA_ARGS__, kExprEnd | 66 #define WASM_BLOCK(count, ...) kExprBlock, __VA_ARGS__, kExprEnd |
67 #define WASM_INFINITE_LOOP \ | 67 #define WASM_INFINITE_LOOP kExprLoop, kExprBr, ARITY_0, DEPTH_0, kExprEnd |
68 kExprLoop, kExprNop, kExprBr, ARITY_0, DEPTH_0, kExprEnd | |
69 #define WASM_LOOP(count, ...) kExprLoop, __VA_ARGS__, kExprEnd | 68 #define WASM_LOOP(count, ...) kExprLoop, __VA_ARGS__, kExprEnd |
70 #define WASM_IF(cond, tstmt) cond, kExprIf, tstmt, kExprEnd | 69 #define WASM_IF(cond, tstmt) cond, kExprIf, tstmt, kExprEnd |
71 #define WASM_IF_ELSE(cond, tstmt, fstmt) \ | 70 #define WASM_IF_ELSE(cond, tstmt, fstmt) \ |
72 cond, kExprIf, tstmt, kExprElse, fstmt, kExprEnd | 71 cond, kExprIf, tstmt, kExprElse, fstmt, kExprEnd |
73 #define WASM_SELECT(tval, fval, cond) tval, fval, cond, kExprSelect | 72 #define WASM_SELECT(tval, fval, cond) tval, fval, cond, kExprSelect |
74 #define WASM_BR(depth) kExprNop, kExprBr, ARITY_0, static_cast<byte>(depth) | 73 #define WASM_BR(depth) kExprBr, ARITY_0, static_cast<byte>(depth) |
75 #define WASM_BR_IF(depth, cond) \ | 74 #define WASM_BR_IF(depth, cond) \ |
76 cond, kExprBrIf, ARITY_0, static_cast<byte>(depth) | 75 cond, kExprBrIf, ARITY_0, static_cast<byte>(depth) |
77 #define WASM_BRV(depth, val) val, kExprBr, ARITY_1, static_cast<byte>(depth) | 76 #define WASM_BRV(depth, val) val, kExprBr, ARITY_1, static_cast<byte>(depth) |
78 #define WASM_BRV_IF(depth, val, cond) \ | 77 #define WASM_BRV_IF(depth, val, cond) \ |
79 val, cond, kExprBrIf, ARITY_1, static_cast<byte>(depth) | 78 val, cond, kExprBrIf, ARITY_1, static_cast<byte>(depth) |
80 #define WASM_BREAK(depth) \ | 79 #define WASM_BREAK(depth) kExprBr, ARITY_0, static_cast<byte>(depth + 1) |
81 kExprNop, kExprBr, ARITY_0, static_cast<byte>(depth + 1) | 80 #define WASM_CONTINUE(depth) kExprBr, ARITY_0, static_cast<byte>(depth) |
82 #define WASM_CONTINUE(depth) \ | |
83 kExprNop, kExprBr, ARITY_0, static_cast<byte>(depth) | |
84 #define WASM_BREAKV(depth, val) \ | 81 #define WASM_BREAKV(depth, val) \ |
85 val, kExprBr, ARITY_1, static_cast<byte>(depth + 1) | 82 val, kExprBr, ARITY_1, static_cast<byte>(depth + 1) |
86 #define WASM_RETURN0 kExprReturn, ARITY_0 | 83 #define WASM_RETURN0 kExprReturn, ARITY_0 |
87 #define WASM_RETURN1(val) val, kExprReturn, ARITY_1 | 84 #define WASM_RETURN1(val) val, kExprReturn, ARITY_1 |
88 #define WASM_RETURNN(count, ...) __VA_ARGS__, kExprReturn, count | 85 #define WASM_RETURNN(count, ...) __VA_ARGS__, kExprReturn, count |
89 #define WASM_UNREACHABLE kExprUnreachable | 86 #define WASM_UNREACHABLE kExprUnreachable |
90 | 87 |
91 #define WASM_BR_TABLE(key, count, ...) \ | 88 #define WASM_BR_TABLE(key, count, ...) \ |
92 key, kExprBrTable, ARITY_0, U32V_1(count), __VA_ARGS__ | 89 key, kExprBrTable, ARITY_0, U32V_1(count), __VA_ARGS__ |
93 | 90 |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 #define SIG_ENTRY_x(r) kWasmFunctionTypeForm, 0, 1, r | 574 #define SIG_ENTRY_x(r) kWasmFunctionTypeForm, 0, 1, r |
578 #define SIG_ENTRY_x_x(r, a) kWasmFunctionTypeForm, 1, a, 1, r | 575 #define SIG_ENTRY_x_x(r, a) kWasmFunctionTypeForm, 1, a, 1, r |
579 #define SIG_ENTRY_x_xx(r, a, b) kWasmFunctionTypeForm, 2, a, b, 1, r | 576 #define SIG_ENTRY_x_xx(r, a, b) kWasmFunctionTypeForm, 2, a, b, 1, r |
580 #define SIG_ENTRY_x_xxx(r, a, b, c) kWasmFunctionTypeForm, 3, a, b, c, 1, r | 577 #define SIG_ENTRY_x_xxx(r, a, b, c) kWasmFunctionTypeForm, 3, a, b, c, 1, r |
581 #define SIZEOF_SIG_ENTRY_x 4 | 578 #define SIZEOF_SIG_ENTRY_x 4 |
582 #define SIZEOF_SIG_ENTRY_x_x 5 | 579 #define SIZEOF_SIG_ENTRY_x_x 5 |
583 #define SIZEOF_SIG_ENTRY_x_xx 6 | 580 #define SIZEOF_SIG_ENTRY_x_xx 6 |
584 #define SIZEOF_SIG_ENTRY_x_xxx 7 | 581 #define SIZEOF_SIG_ENTRY_x_xxx 7 |
585 | 582 |
586 #endif // V8_WASM_MACRO_GEN_H_ | 583 #endif // V8_WASM_MACRO_GEN_H_ |
OLD | NEW |