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/zone-containers.h" | 10 #include "src/zone/zone-containers.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 static_cast<byte>((((x) >> 14) & MASK_7) | 0x80), \ | 52 static_cast<byte>((((x) >> 14) & MASK_7) | 0x80), \ |
53 static_cast<byte>((((x) >> 21) & MASK_7) | 0x80), \ | 53 static_cast<byte>((((x) >> 21) & MASK_7) | 0x80), \ |
54 static_cast<byte>((((x) >> 28) & MASK_7)) | 54 static_cast<byte>((((x) >> 28) & MASK_7)) |
55 | 55 |
56 // Convenience macros for building Wasm bytecode directly into a byte array. | 56 // Convenience macros for building Wasm bytecode directly into a byte array. |
57 | 57 |
58 //------------------------------------------------------------------------------ | 58 //------------------------------------------------------------------------------ |
59 // Control. | 59 // Control. |
60 //------------------------------------------------------------------------------ | 60 //------------------------------------------------------------------------------ |
61 #define WASM_NOP kExprNop | 61 #define WASM_NOP kExprNop |
| 62 #define WASM_END kExprEnd |
62 | 63 |
63 #define ARITY_0 0 | 64 #define ARITY_0 0 |
64 #define ARITY_1 1 | 65 #define ARITY_1 1 |
65 #define ARITY_2 2 | 66 #define ARITY_2 2 |
66 #define DEPTH_0 0 | 67 #define DEPTH_0 0 |
67 #define DEPTH_1 1 | 68 #define DEPTH_1 1 |
68 #define DEPTH_2 2 | 69 #define DEPTH_2 2 |
69 #define ARITY_2 2 | 70 #define ARITY_2 2 |
70 | 71 |
71 #define WASM_BLOCK(...) kExprBlock, kLocalVoid, __VA_ARGS__, kExprEnd | 72 #define WASM_BLOCK(...) kExprBlock, kLocalVoid, __VA_ARGS__, kExprEnd |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 #define WASM_BRV(depth, val) val, kExprBr, static_cast<byte>(depth) | 672 #define WASM_BRV(depth, val) val, kExprBr, static_cast<byte>(depth) |
672 #define WASM_BRV_IF(depth, val, cond) \ | 673 #define WASM_BRV_IF(depth, val, cond) \ |
673 val, cond, kExprBrIf, static_cast<byte>(depth) | 674 val, cond, kExprBrIf, static_cast<byte>(depth) |
674 #define WASM_BRV_IFD(depth, val, cond) \ | 675 #define WASM_BRV_IFD(depth, val, cond) \ |
675 val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop | 676 val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop |
676 #define WASM_IFB(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd | 677 #define WASM_IFB(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd |
677 #define WASM_BR_TABLEV(val, key, count, ...) \ | 678 #define WASM_BR_TABLEV(val, key, count, ...) \ |
678 val, key, kExprBrTable, U32V_1(count), __VA_ARGS__ | 679 val, key, kExprBrTable, U32V_1(count), __VA_ARGS__ |
679 | 680 |
680 #endif // V8_WASM_MACRO_GEN_H_ | 681 #endif // V8_WASM_MACRO_GEN_H_ |
OLD | NEW |