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 #include "src/zone-containers.h" | 10 #include "src/zone-containers.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 //------------------------------------------------------------------------------ | 58 //------------------------------------------------------------------------------ |
59 // Control. | 59 // Control. |
60 //------------------------------------------------------------------------------ | 60 //------------------------------------------------------------------------------ |
61 #define WASM_NOP kExprNop | 61 #define WASM_NOP kExprNop |
62 | 62 |
63 #define ARITY_0 0 | 63 #define ARITY_0 0 |
64 #define ARITY_1 1 | 64 #define ARITY_1 1 |
65 #define DEPTH_0 0 | 65 #define DEPTH_0 0 |
66 #define DEPTH_1 1 | 66 #define DEPTH_1 1 |
67 | 67 |
68 #define WASM_BLOCK(count, ...) kExprBlock, __VA_ARGS__, kExprEnd | 68 #define WASM_BLOCK(...) kExprBlock, __VA_ARGS__, kExprEnd |
69 #define WASM_INFINITE_LOOP kExprLoop, kExprBr, ARITY_0, DEPTH_0, kExprEnd | 69 #define WASM_INFINITE_LOOP kExprLoop, kExprBr, ARITY_0, DEPTH_0, kExprEnd |
70 #define WASM_LOOP(count, ...) kExprLoop, __VA_ARGS__, kExprEnd | 70 #define WASM_LOOP(...) kExprLoop, __VA_ARGS__, kExprEnd |
71 #define WASM_IF(cond, tstmt) cond, kExprIf, tstmt, kExprEnd | 71 #define WASM_IF(cond, tstmt) cond, kExprIf, tstmt, kExprEnd |
72 #define WASM_IF_ELSE(cond, tstmt, fstmt) \ | 72 #define WASM_IF_ELSE(cond, tstmt, fstmt) \ |
73 cond, kExprIf, tstmt, kExprElse, fstmt, kExprEnd | 73 cond, kExprIf, tstmt, kExprElse, fstmt, kExprEnd |
74 #define WASM_SELECT(tval, fval, cond) tval, fval, cond, kExprSelect | 74 #define WASM_SELECT(tval, fval, cond) tval, fval, cond, kExprSelect |
75 #define WASM_BR(depth) kExprBr, ARITY_0, static_cast<byte>(depth) | 75 #define WASM_BR(depth) kExprBr, ARITY_0, static_cast<byte>(depth) |
76 #define WASM_BR_IF(depth, cond) \ | 76 #define WASM_BR_IF(depth, cond) \ |
77 cond, kExprBrIf, ARITY_0, static_cast<byte>(depth) | 77 cond, kExprBrIf, ARITY_0, static_cast<byte>(depth) |
78 #define WASM_BRV(depth, val) val, kExprBr, ARITY_1, static_cast<byte>(depth) | 78 #define WASM_BRV(depth, val) val, kExprBr, ARITY_1, static_cast<byte>(depth) |
79 #define WASM_BRV_IF(depth, val, cond) \ | 79 #define WASM_BRV_IF(depth, val, cond) \ |
80 val, cond, kExprBrIf, ARITY_1, static_cast<byte>(depth) | 80 val, cond, kExprBrIf, ARITY_1, static_cast<byte>(depth) |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 #define SIG_ENTRY_x(r) kWasmFunctionTypeForm, 0, 1, r | 599 #define SIG_ENTRY_x(r) kWasmFunctionTypeForm, 0, 1, r |
600 #define SIG_ENTRY_x_x(r, a) kWasmFunctionTypeForm, 1, a, 1, r | 600 #define SIG_ENTRY_x_x(r, a) kWasmFunctionTypeForm, 1, a, 1, r |
601 #define SIG_ENTRY_x_xx(r, a, b) kWasmFunctionTypeForm, 2, a, b, 1, r | 601 #define SIG_ENTRY_x_xx(r, a, b) kWasmFunctionTypeForm, 2, a, b, 1, r |
602 #define SIG_ENTRY_x_xxx(r, a, b, c) kWasmFunctionTypeForm, 3, a, b, c, 1, r | 602 #define SIG_ENTRY_x_xxx(r, a, b, c) kWasmFunctionTypeForm, 3, a, b, c, 1, r |
603 #define SIZEOF_SIG_ENTRY_x 4 | 603 #define SIZEOF_SIG_ENTRY_x 4 |
604 #define SIZEOF_SIG_ENTRY_x_x 5 | 604 #define SIZEOF_SIG_ENTRY_x_x 5 |
605 #define SIZEOF_SIG_ENTRY_x_xx 6 | 605 #define SIZEOF_SIG_ENTRY_x_xx 6 |
606 #define SIZEOF_SIG_ENTRY_x_xxx 7 | 606 #define SIZEOF_SIG_ENTRY_x_xxx 7 |
607 | 607 |
608 #endif // V8_WASM_MACRO_GEN_H_ | 608 #endif // V8_WASM_MACRO_GEN_H_ |
OLD | NEW |