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 | |
63 | 62 |
64 #define ARITY_0 0 | 63 #define ARITY_0 0 |
65 #define ARITY_1 1 | 64 #define ARITY_1 1 |
66 #define ARITY_2 2 | 65 #define ARITY_2 2 |
67 #define DEPTH_0 0 | 66 #define DEPTH_0 0 |
68 #define DEPTH_1 1 | 67 #define DEPTH_1 1 |
69 #define DEPTH_2 2 | 68 #define DEPTH_2 2 |
70 #define ARITY_2 2 | 69 #define ARITY_2 2 |
71 | 70 |
72 #define WASM_BLOCK(...) kExprBlock, kLocalVoid, __VA_ARGS__, kExprEnd | 71 #define WASM_BLOCK(...) kExprBlock, kLocalVoid, __VA_ARGS__, kExprEnd |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 #define WASM_BRV(depth, val) val, kExprBr, static_cast<byte>(depth) | 671 #define WASM_BRV(depth, val) val, kExprBr, static_cast<byte>(depth) |
673 #define WASM_BRV_IF(depth, val, cond) \ | 672 #define WASM_BRV_IF(depth, val, cond) \ |
674 val, cond, kExprBrIf, static_cast<byte>(depth) | 673 val, cond, kExprBrIf, static_cast<byte>(depth) |
675 #define WASM_BRV_IFD(depth, val, cond) \ | 674 #define WASM_BRV_IFD(depth, val, cond) \ |
676 val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop | 675 val, cond, kExprBrIf, static_cast<byte>(depth), kExprDrop |
677 #define WASM_IFB(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd | 676 #define WASM_IFB(cond, ...) cond, kExprIf, kLocalVoid, __VA_ARGS__, kExprEnd |
678 #define WASM_BR_TABLEV(val, key, count, ...) \ | 677 #define WASM_BR_TABLEV(val, key, count, ...) \ |
679 val, key, kExprBrTable, U32V_1(count), __VA_ARGS__ | 678 val, key, kExprBrTable, U32V_1(count), __VA_ARGS__ |
680 | 679 |
681 #endif // V8_WASM_MACRO_GEN_H_ | 680 #endif // V8_WASM_MACRO_GEN_H_ |
OLD | NEW |