summaryrefslogtreecommitdiff
path: root/chromium/v8/src/wasm/wasm-opcodes.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/v8/src/wasm/wasm-opcodes.h
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/v8/src/wasm/wasm-opcodes.h')
-rw-r--r--chromium/v8/src/wasm/wasm-opcodes.h127
1 files changed, 71 insertions, 56 deletions
diff --git a/chromium/v8/src/wasm/wasm-opcodes.h b/chromium/v8/src/wasm/wasm-opcodes.h
index 8a17b9984e8..4728ee76b0c 100644
--- a/chromium/v8/src/wasm/wasm-opcodes.h
+++ b/chromium/v8/src/wasm/wasm-opcodes.h
@@ -38,7 +38,8 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmFeatures&);
V(BrIf, 0x0d, _) \
V(BrTable, 0x0e, _) \
V(Return, 0x0f, _) \
- V(BrOnNull, 0xd4, _) /* gc prototype */
+ V(Let, 0x17, _ /* gc prototype */) \
+ V(BrOnNull, 0xd4, _ /* gc prototype */)
// Constants, locals, globals, and calls.
#define FOREACH_MISC_OPCODE(V) \
@@ -61,6 +62,7 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmFeatures&);
V(F32Const, 0x43, _) \
V(F64Const, 0x44, _) \
V(RefNull, 0xd0, _) \
+ V(RefIsNull, 0xd1, _) \
V(RefFunc, 0xd2, _) \
V(RefAsNonNull, 0xd3, _)
@@ -229,9 +231,7 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmFeatures&);
V(I64SExtendI16, 0xc3, l_l) \
V(I64SExtendI32, 0xc4, l_l)
-#define FOREACH_SIMPLE_PROTOTYPE_OPCODE(V) \
- V(RefIsNull, 0xd1, i_r) \
- V(RefEq, 0xd5, i_rr) // made-up opcode, guessing future spec (GC)
+#define FOREACH_SIMPLE_PROTOTYPE_OPCODE(V) V(RefEq, 0xd5, i_qq)
// For compatibility with Asm.js.
// These opcodes are not spec'ed (or visible) externally; the idea is
@@ -343,8 +343,8 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmFeatures&);
V(S128Select, 0xfd52, s_sss) \
V(I8x16Abs, 0xfd60, s_s) \
V(I8x16Neg, 0xfd61, s_s) \
- V(S1x16AnyTrue, 0xfd62, i_s) \
- V(S1x16AllTrue, 0xfd63, i_s) \
+ V(V8x16AnyTrue, 0xfd62, i_s) \
+ V(V8x16AllTrue, 0xfd63, i_s) \
V(I8x16SConvertI16x8, 0xfd65, s_ss) \
V(I8x16UConvertI16x8, 0xfd66, s_ss) \
V(I8x16Shl, 0xfd6b, s_si) \
@@ -363,8 +363,8 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmFeatures&);
V(I8x16RoundingAverageU, 0xfd7b, s_ss) \
V(I16x8Abs, 0xfd80, s_s) \
V(I16x8Neg, 0xfd81, s_s) \
- V(S1x8AnyTrue, 0xfd82, i_s) \
- V(S1x8AllTrue, 0xfd83, i_s) \
+ V(V16x8AnyTrue, 0xfd82, i_s) \
+ V(V16x8AllTrue, 0xfd83, i_s) \
V(I16x8SConvertI32x4, 0xfd85, s_ss) \
V(I16x8UConvertI32x4, 0xfd86, s_ss) \
V(I16x8SConvertI8x16Low, 0xfd87, s_s) \
@@ -388,8 +388,8 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmFeatures&);
V(I16x8RoundingAverageU, 0xfd9b, s_ss) \
V(I32x4Abs, 0xfda0, s_s) \
V(I32x4Neg, 0xfda1, s_s) \
- V(S1x4AnyTrue, 0xfda2, i_s) \
- V(S1x4AllTrue, 0xfda3, i_s) \
+ V(V32x4AnyTrue, 0xfda2, i_s) \
+ V(V32x4AllTrue, 0xfda3, i_s) \
V(I32x4SConvertI16x8Low, 0xfda7, s_s) \
V(I32x4SConvertI16x8High, 0xfda8, s_s) \
V(I32x4UConvertI16x8Low, 0xfda9, s_s) \
@@ -439,8 +439,8 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmFeatures&);
V(I8x16BitMask, 0xfd64, i_s) \
V(I16x8BitMask, 0xfd84, i_s) \
V(I32x4BitMask, 0xfda4, i_s) \
- V(S1x2AnyTrue, 0xfdc2, i_s) \
- V(S1x2AllTrue, 0xfdc3, i_s) \
+ V(V64x2AnyTrue, 0xfdc2, i_s) \
+ V(V64x2AllTrue, 0xfdc3, i_s) \
V(I64x2Eq, 0xfdc0, s_ss) \
V(I64x2Ne, 0xfdc4, s_ss) \
V(I64x2LtS, 0xfdc5, s_ss) \
@@ -453,21 +453,30 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmFeatures&);
V(I64x2GeU, 0xfdd0, s_ss) \
V(I64x2MinS, 0xfdd6, s_ss) \
V(I64x2MinU, 0xfdd7, s_ss) \
- V(I64x2MaxS, 0xfdd8, s_ss) \
- V(I64x2MaxU, 0xfdd9, s_ss) \
+ V(I64x2MaxS, 0xfde2, s_ss) \
+ V(I64x2MaxU, 0xfdee, s_ss) \
V(F32x4Qfma, 0xfdfc, s_sss) \
V(F32x4Qfms, 0xfdfd, s_sss) \
V(F64x2Qfma, 0xfdfe, s_sss) \
V(F64x2Qfms, 0xfdff, s_sss) \
V(I16x8AddHoriz, 0xfdaf, s_ss) \
V(I32x4AddHoriz, 0xfdb0, s_ss) \
+ V(I32x4DotI16x8S, 0xfdba, s_ss) \
V(F32x4AddHoriz, 0xfdb2, s_ss) \
V(F32x4RecipApprox, 0xfdb3, s_s) \
- V(F32x4RecipSqrtApprox, 0xfdba, s_s) \
- V(F32x4Pmin, 0xfdda, s_ss) \
- V(F32x4Pmax, 0xfddb, s_ss) \
- V(F64x2Pmin, 0xfddc, s_ss) \
- V(F64x2Pmax, 0xfddd, s_ss)
+ V(F32x4RecipSqrtApprox, 0xfdbc, s_s) \
+ V(F32x4Pmin, 0xfdea, s_ss) \
+ V(F32x4Pmax, 0xfdeb, s_ss) \
+ V(F32x4Ceil, 0xfdd8, s_s) \
+ V(F32x4Floor, 0xfdd9, s_s) \
+ V(F32x4Trunc, 0xfdda, s_s) \
+ V(F32x4NearestInt, 0xfddb, s_s) \
+ V(F64x2Pmin, 0xfdf6, s_ss) \
+ V(F64x2Pmax, 0xfdf7, s_ss) \
+ V(F64x2Ceil, 0xfddc, s_s) \
+ V(F64x2Floor, 0xfddd, s_s) \
+ V(F64x2Trunc, 0xfdde, s_s) \
+ V(F64x2NearestInt, 0xfddf, s_s)
#define FOREACH_SIMD_1_OPERAND_1_PARAM_OPCODE(V) \
V(I8x16ExtractLaneS, 0xfd15, _) \
@@ -495,25 +504,28 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmFeatures&);
FOREACH_SIMD_1_OPERAND_1_PARAM_OPCODE(V) \
FOREACH_SIMD_1_OPERAND_2_PARAM_OPCODE(V)
-#define FOREACH_NUMERIC_OPCODE(V) \
- V(I32SConvertSatF32, 0xfc00, i_f) \
- V(I32UConvertSatF32, 0xfc01, i_f) \
- V(I32SConvertSatF64, 0xfc02, i_d) \
- V(I32UConvertSatF64, 0xfc03, i_d) \
- V(I64SConvertSatF32, 0xfc04, l_f) \
- V(I64UConvertSatF32, 0xfc05, l_f) \
- V(I64SConvertSatF64, 0xfc06, l_d) \
- V(I64UConvertSatF64, 0xfc07, l_d) \
- V(MemoryInit, 0xfc08, v_iii) \
- V(DataDrop, 0xfc09, v_v) \
- V(MemoryCopy, 0xfc0a, v_iii) \
- V(MemoryFill, 0xfc0b, v_iii) \
- V(TableInit, 0xfc0c, v_iii) \
- V(ElemDrop, 0xfc0d, v_v) \
- V(TableCopy, 0xfc0e, v_iii) \
- V(TableGrow, 0xfc0f, i_ai) \
- V(TableSize, 0xfc10, i_v) \
- /*TableFill is polymorph in the second parameter. It's anyref or funcref.*/ \
+#define FOREACH_NUMERIC_OPCODE(V) \
+ V(I32SConvertSatF32, 0xfc00, i_f) \
+ V(I32UConvertSatF32, 0xfc01, i_f) \
+ V(I32SConvertSatF64, 0xfc02, i_d) \
+ V(I32UConvertSatF64, 0xfc03, i_d) \
+ V(I64SConvertSatF32, 0xfc04, l_f) \
+ V(I64UConvertSatF32, 0xfc05, l_f) \
+ V(I64SConvertSatF64, 0xfc06, l_d) \
+ V(I64UConvertSatF64, 0xfc07, l_d) \
+ V(MemoryInit, 0xfc08, v_iii) \
+ V(DataDrop, 0xfc09, v_v) \
+ V(MemoryCopy, 0xfc0a, v_iii) \
+ V(MemoryFill, 0xfc0b, v_iii) \
+ V(TableInit, 0xfc0c, v_iii) \
+ V(ElemDrop, 0xfc0d, v_v) \
+ V(TableCopy, 0xfc0e, v_iii) \
+ /* TableGrow is polymorphic in the first parameter. */ \
+ /* It's whatever the table type is. */ \
+ V(TableGrow, 0xfc0f, i_ci) \
+ V(TableSize, 0xfc10, i_v) \
+ /* TableFill is polymorphic in the second parameter. */ \
+ /* It's whatever the table type is. */ \
V(TableFill, 0xfc11, v_iii)
#define FOREACH_ATOMIC_OPCODE(V) \
@@ -605,7 +617,7 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmFeatures&);
V(I31New, 0xfb20, _) \
V(I31GetS, 0xfb21, _) \
V(I31GetU, 0xfb22, _) \
- V(RttGet, 0xfb30, _) \
+ V(RttCanon, 0xfb30, _) \
V(RttSub, 0xfb31, _) \
V(RefTest, 0xfb40, _) \
V(RefCast, 0xfb41, _) \
@@ -674,9 +686,9 @@ bool IsJSCompatibleSignature(const FunctionSig* sig, const WasmFeatures&);
V(l_ill, kWasmI64, kWasmI32, kWasmI64, kWasmI64) \
V(i_iil, kWasmI32, kWasmI32, kWasmI32, kWasmI64) \
V(i_ill, kWasmI32, kWasmI32, kWasmI64, kWasmI64) \
- V(i_r, kWasmI32, kWasmAnyRef) \
- V(i_ai, kWasmI32, kWasmFuncRef, kWasmI32) \
- V(i_rr, kWasmI32, kWasmEqRef, kWasmEqRef)
+ V(i_e, kWasmI32, kWasmExternRef) \
+ V(i_ci, kWasmI32, kWasmFuncRef, kWasmI32) \
+ V(i_qq, kWasmI32, kWasmEqRef, kWasmEqRef)
#define FOREACH_SIMD_SIGNATURE(V) \
V(s_s, kWasmS128, kWasmS128) \
@@ -716,21 +728,21 @@ enum TrapReason {
// A collection of opcode-related static methods.
class V8_EXPORT_PRIVATE WasmOpcodes {
public:
- static const char* OpcodeName(WasmOpcode);
- static const FunctionSig* Signature(WasmOpcode);
- static const FunctionSig* AsmjsSignature(WasmOpcode);
- static bool IsPrefixOpcode(WasmOpcode);
- static bool IsControlOpcode(WasmOpcode);
- static bool IsAnyRefOpcode(WasmOpcode);
- static bool IsThrowingOpcode(WasmOpcode);
- static bool IsSimdPostMvpOpcode(WasmOpcode);
+ static constexpr const char* OpcodeName(WasmOpcode);
+ static constexpr const FunctionSig* Signature(WasmOpcode);
+ static constexpr const FunctionSig* AsmjsSignature(WasmOpcode);
+ static constexpr bool IsPrefixOpcode(WasmOpcode);
+ static constexpr bool IsControlOpcode(WasmOpcode);
+ static constexpr bool IsExternRefOpcode(WasmOpcode);
+ static constexpr bool IsThrowingOpcode(WasmOpcode);
+ static constexpr bool IsSimdPostMvpOpcode(WasmOpcode);
// Check whether the given opcode always jumps, i.e. all instructions after
// this one in the current block are dead. Returns false for |end|.
- static bool IsUnconditionalJump(WasmOpcode);
- static bool IsBreakable(WasmOpcode);
+ static constexpr bool IsUnconditionalJump(WasmOpcode);
+ static constexpr bool IsBreakable(WasmOpcode);
- static MessageTemplate TrapReasonToMessageId(TrapReason);
- static const char* TrapReasonMessage(TrapReason);
+ static constexpr MessageTemplate TrapReasonToMessageId(TrapReason);
+ static inline const char* TrapReasonMessage(TrapReason);
};
// Representation of an initializer expression.
@@ -760,13 +772,16 @@ struct WasmInitExpr {
explicit WasmInitExpr(int64_t v) : kind(kI64Const) { val.i64_const = v; }
explicit WasmInitExpr(float v) : kind(kF32Const) { val.f32_const = v; }
explicit WasmInitExpr(double v) : kind(kF64Const) { val.f64_const = v; }
+
+ explicit WasmInitExpr(WasmInitKind kind) : kind(kind) {
+ DCHECK_EQ(kind, kRefNullConst);
+ }
+
WasmInitExpr(WasmInitKind kind, uint32_t index) : kind(kind) {
if (kind == kGlobalIndex) {
val.global_index = index;
} else if (kind == kRefFuncConst) {
val.function_index = index;
- } else if (kind == kRefNullConst) {
- // Nothing to do.
} else {
// For the other types, the other initializers should be used.
UNREACHABLE();