Index: src/arm64/lithium-codegen-arm64.cc |
diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc |
index 6fb1088efc71e9b6b27ff9e52c61e2b24369f44c..c4be83277a805fa51045443d99aa8f4a556d20c3 100644 |
--- a/src/arm64/lithium-codegen-arm64.cc |
+++ b/src/arm64/lithium-codegen-arm64.cc |
@@ -1933,8 +1933,12 @@ void LCodeGen::DoBranch(LBranch* instr) { |
if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
// SIMD value -> true. |
- __ CompareInstanceType(map, scratch, FLOAT32X4_TYPE); |
- __ B(eq, true_label); |
+ Label not_simd; |
+ __ CompareInstanceType(map, scratch, FIRST_SIMD_VALUE_TYPE); |
+ __ B(lt, ¬_simd); |
+ __ CompareInstanceType(map, scratch, LAST_SIMD_VALUE_TYPE); |
+ __ B(le, true_label); |
+ __ Bind(¬_simd); |
} |
if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
@@ -6002,6 +6006,60 @@ void LCodeGen::DoTypeofIsAndBranch(LTypeofIsAndBranch* instr) { |
__ CompareObjectType(value, map, scratch, FLOAT32X4_TYPE); |
EmitBranch(instr, eq); |
+ } else if (String::Equals(type_name, factory->int32x4_string())) { |
+ DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); |
+ Register map = ToRegister(instr->temp1()); |
+ Register scratch = ToRegister(instr->temp2()); |
+ |
+ __ JumpIfSmi(value, false_label); |
+ __ CompareObjectType(value, map, scratch, INT32X4_TYPE); |
+ EmitBranch(instr, eq); |
+ |
+ } else if (String::Equals(type_name, factory->bool32x4_string())) { |
+ DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); |
+ Register map = ToRegister(instr->temp1()); |
+ Register scratch = ToRegister(instr->temp2()); |
+ |
+ __ JumpIfSmi(value, false_label); |
+ __ CompareObjectType(value, map, scratch, BOOL32X4_TYPE); |
+ EmitBranch(instr, eq); |
+ |
+ } else if (String::Equals(type_name, factory->int16x8_string())) { |
+ DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); |
+ Register map = ToRegister(instr->temp1()); |
+ Register scratch = ToRegister(instr->temp2()); |
+ |
+ __ JumpIfSmi(value, false_label); |
+ __ CompareObjectType(value, map, scratch, INT16X8_TYPE); |
+ EmitBranch(instr, eq); |
+ |
+ } else if (String::Equals(type_name, factory->bool16x8_string())) { |
+ DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); |
+ Register map = ToRegister(instr->temp1()); |
+ Register scratch = ToRegister(instr->temp2()); |
+ |
+ __ JumpIfSmi(value, false_label); |
+ __ CompareObjectType(value, map, scratch, BOOL16X8_TYPE); |
+ EmitBranch(instr, eq); |
+ |
+ } else if (String::Equals(type_name, factory->int8x16_string())) { |
+ DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); |
+ Register map = ToRegister(instr->temp1()); |
+ Register scratch = ToRegister(instr->temp2()); |
+ |
+ __ JumpIfSmi(value, false_label); |
+ __ CompareObjectType(value, map, scratch, INT8X16_TYPE); |
+ EmitBranch(instr, eq); |
+ |
+ } else if (String::Equals(type_name, factory->bool8x16_string())) { |
+ DCHECK((instr->temp1() != NULL) && (instr->temp2() != NULL)); |
+ Register map = ToRegister(instr->temp1()); |
+ Register scratch = ToRegister(instr->temp2()); |
+ |
+ __ JumpIfSmi(value, false_label); |
+ __ CompareObjectType(value, map, scratch, BOOL8X16_TYPE); |
+ EmitBranch(instr, eq); |
+ |
} else { |
__ B(false_label); |
} |