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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 a, b, kExprCallImport, 2, static_cast<byte>(index) | 396 a, b, kExprCallImport, 2, static_cast<byte>(index) |
397 #define WASM_CALL_IMPORT3(index, a, b, c) \ | 397 #define WASM_CALL_IMPORT3(index, a, b, c) \ |
398 a, b, c, kExprCallImport, 3, static_cast<byte>(index) | 398 a, b, c, kExprCallImport, 3, static_cast<byte>(index) |
399 #define WASM_CALL_IMPORT4(index, a, b, c, d) \ | 399 #define WASM_CALL_IMPORT4(index, a, b, c, d) \ |
400 a, b, c, d, kExprCallImport, 4, static_cast<byte>(index) | 400 a, b, c, d, kExprCallImport, 4, static_cast<byte>(index) |
401 #define WASM_CALL_IMPORT5(index, a, b, c, d, e) \ | 401 #define WASM_CALL_IMPORT5(index, a, b, c, d, e) \ |
402 a, b, c, d, e, kExprCallImport, 5, static_cast<byte>(index) | 402 a, b, c, d, e, kExprCallImport, 5, static_cast<byte>(index) |
403 #define WASM_CALL_IMPORTN(arity, index, ...) \ | 403 #define WASM_CALL_IMPORTN(arity, index, ...) \ |
404 __VA_ARGS__, kExprCallImport, U32V_1(arity), static_cast<byte>(index), | 404 __VA_ARGS__, kExprCallImport, U32V_1(arity), static_cast<byte>(index), |
405 | 405 |
406 #define WASM_CALL_INDIRECT0(index, func) \ | 406 #define WASM_CALL_INDIRECT0(index, table, func) \ |
407 func, kExprCallIndirect, 0, static_cast<byte>(index) | 407 func, kExprCallIndirect, 0, static_cast<byte>(index), table |
408 #define WASM_CALL_INDIRECT1(index, func, a) \ | 408 #define WASM_CALL_INDIRECT1(index, table, func, a) \ |
409 func, a, kExprCallIndirect, 1, static_cast<byte>(index) | 409 func, a, kExprCallIndirect, 1, static_cast<byte>(index), table |
410 #define WASM_CALL_INDIRECT2(index, func, a, b) \ | 410 #define WASM_CALL_INDIRECT2(index, table, func, a, b) \ |
411 func, a, b, kExprCallIndirect, 2, static_cast<byte>(index) | 411 func, a, b, kExprCallIndirect, 2, static_cast<byte>(index), table |
412 #define WASM_CALL_INDIRECT3(index, func, a, b, c) \ | 412 #define WASM_CALL_INDIRECT3(index, table, func, a, b, c) \ |
413 func, a, b, c, kExprCallIndirect, 3, static_cast<byte>(index) | 413 func, a, b, c, kExprCallIndirect, 3, static_cast<byte>(index), table |
414 #define WASM_CALL_INDIRECT4(index, func, a, b, c, d) \ | 414 #define WASM_CALL_INDIRECT4(index, table, func, a, b, c, d) \ |
415 func, a, b, c, d, kExprCallIndirect, 4, static_cast<byte>(index) | 415 func, a, b, c, d, kExprCallIndirect, 4, static_cast<byte>(index), table |
416 #define WASM_CALL_INDIRECT5(index, func, a, b, c, d, e) \ | 416 #define WASM_CALL_INDIRECT5(index, table, func, a, b, c, d, e) \ |
417 func, a, b, c, d, e, kExprCallIndirect, 5, static_cast<byte>(index) | 417 func, a, b, c, d, e, kExprCallIndirect, 5, static_cast<byte>(index), table |
418 #define WASM_CALL_INDIRECTN(arity, index, func, ...) \ | 418 #define WASM_CALL_INDIRECTN(arity, table, index, func, ...) \ |
419 func, __VA_ARGS__, kExprCallIndirect, U32V_1(arity), static_cast<byte>(index) | 419 func, __VA_ARGS__, kExprCallIndirect, U32V_1(arity), \ |
| 420 static_cast<byte>(index), table |
420 | 421 |
421 #define WASM_NOT(x) x, kExprI32Eqz | 422 #define WASM_NOT(x) x, kExprI32Eqz |
422 #define WASM_SEQ(...) __VA_ARGS__ | 423 #define WASM_SEQ(...) __VA_ARGS__ |
423 | 424 |
424 //------------------------------------------------------------------------------ | 425 //------------------------------------------------------------------------------ |
425 // Constructs that are composed of multiple bytecodes. | 426 // Constructs that are composed of multiple bytecodes. |
426 //------------------------------------------------------------------------------ | 427 //------------------------------------------------------------------------------ |
427 #define WASM_WHILE(x, y) \ | 428 #define WASM_WHILE(x, y) \ |
428 kExprLoop, x, kExprIf, y, kExprBr, ARITY_1, DEPTH_1, kExprEnd, kExprEnd | 429 kExprLoop, x, kExprIf, y, kExprBr, ARITY_1, DEPTH_1, kExprEnd, kExprEnd |
429 #define WASM_INC_LOCAL(index) \ | 430 #define WASM_INC_LOCAL(index) \ |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 //------------------------------------------------------------------------------ | 583 //------------------------------------------------------------------------------ |
583 // Simd Operations. | 584 // Simd Operations. |
584 //------------------------------------------------------------------------------ | 585 //------------------------------------------------------------------------------ |
585 #define WASM_SIMD_I32x4_SPLAT(x) x, kSimdPrefix, kExprI32x4Splat & 0xff | 586 #define WASM_SIMD_I32x4_SPLAT(x) x, kSimdPrefix, kExprI32x4Splat & 0xff |
586 #define WASM_SIMD_I32x4_EXTRACT_LANE(x, y) \ | 587 #define WASM_SIMD_I32x4_EXTRACT_LANE(x, y) \ |
587 x, y, kSimdPrefix, kExprI32x4ExtractLane & 0xff | 588 x, y, kSimdPrefix, kExprI32x4ExtractLane & 0xff |
588 | 589 |
589 #define SIG_ENTRY_v_v kWasmFunctionTypeForm, 0, 0 | 590 #define SIG_ENTRY_v_v kWasmFunctionTypeForm, 0, 0 |
590 #define SIZEOF_SIG_ENTRY_v_v 3 | 591 #define SIZEOF_SIG_ENTRY_v_v 3 |
591 | 592 |
| 593 #define SIG_ENTRY_ANYFUNC kWasmFunctionTypeForm, 1, kLocalVoid, 0 |
| 594 #define SIZEOF_SIG_ENTRY_ANYFUNC 3 |
| 595 |
592 #define SIG_ENTRY_v_x(a) kWasmFunctionTypeForm, 1, a, 0 | 596 #define SIG_ENTRY_v_x(a) kWasmFunctionTypeForm, 1, a, 0 |
593 #define SIG_ENTRY_v_xx(a, b) kWasmFunctionTypeForm, 2, a, b, 0 | 597 #define SIG_ENTRY_v_xx(a, b) kWasmFunctionTypeForm, 2, a, b, 0 |
594 #define SIG_ENTRY_v_xxx(a, b, c) kWasmFunctionTypeForm, 3, a, b, c, 0 | 598 #define SIG_ENTRY_v_xxx(a, b, c) kWasmFunctionTypeForm, 3, a, b, c, 0 |
595 #define SIZEOF_SIG_ENTRY_v_x 4 | 599 #define SIZEOF_SIG_ENTRY_v_x 4 |
596 #define SIZEOF_SIG_ENTRY_v_xx 5 | 600 #define SIZEOF_SIG_ENTRY_v_xx 5 |
597 #define SIZEOF_SIG_ENTRY_v_xxx 6 | 601 #define SIZEOF_SIG_ENTRY_v_xxx 6 |
598 | 602 |
599 #define SIG_ENTRY_x(r) kWasmFunctionTypeForm, 0, 1, r | 603 #define SIG_ENTRY_x(r) kWasmFunctionTypeForm, 0, 1, r |
600 #define SIG_ENTRY_x_x(r, a) kWasmFunctionTypeForm, 1, a, 1, r | 604 #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 | 605 #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 | 606 #define SIG_ENTRY_x_xxx(r, a, b, c) kWasmFunctionTypeForm, 3, a, b, c, 1, r |
603 #define SIZEOF_SIG_ENTRY_x 4 | 607 #define SIZEOF_SIG_ENTRY_x 4 |
604 #define SIZEOF_SIG_ENTRY_x_x 5 | 608 #define SIZEOF_SIG_ENTRY_x_x 5 |
605 #define SIZEOF_SIG_ENTRY_x_xx 6 | 609 #define SIZEOF_SIG_ENTRY_x_xx 6 |
606 #define SIZEOF_SIG_ENTRY_x_xxx 7 | 610 #define SIZEOF_SIG_ENTRY_x_xxx 7 |
607 | 611 |
608 #endif // V8_WASM_MACRO_GEN_H_ | 612 #endif // V8_WASM_MACRO_GEN_H_ |
OLD | NEW |