diff options
Diffstat (limited to 'deps/v8/test/cctest/compiler/test-representation-change.cc')
-rw-r--r-- | deps/v8/test/cctest/compiler/test-representation-change.cc | 60 |
1 files changed, 15 insertions, 45 deletions
diff --git a/deps/v8/test/cctest/compiler/test-representation-change.cc b/deps/v8/test/cctest/compiler/test-representation-change.cc index b475e9a5b9..242793340e 100644 --- a/deps/v8/test/cctest/compiler/test-representation-change.cc +++ b/deps/v8/test/cctest/compiler/test-representation-change.cc @@ -493,9 +493,9 @@ static void CheckChange(IrOpcode::Value expected, MachineRepresentation from, TEST(SingleChanges) { CheckChange(IrOpcode::kChangeTaggedToBit, MachineRepresentation::kTagged, - Type::None(), MachineRepresentation::kBit); + Type::Boolean(), MachineRepresentation::kBit); CheckChange(IrOpcode::kChangeBitToTagged, MachineRepresentation::kBit, - Type::None(), MachineRepresentation::kTagged); + Type::Boolean(), MachineRepresentation::kTagged); CheckChange(IrOpcode::kChangeInt31ToTaggedSigned, MachineRepresentation::kWord32, Type::Signed31(), @@ -525,15 +525,11 @@ TEST(SingleChanges) { Type::Unsigned32(), MachineRepresentation::kWord32); CheckChange(IrOpcode::kChangeTaggedToFloat64, MachineRepresentation::kTagged, Type::Number(), MachineRepresentation::kFloat64); - CheckChange(IrOpcode::kChangeTaggedToFloat64, MachineRepresentation::kTagged, - Type::Number(), MachineRepresentation::kFloat64); CheckChange(IrOpcode::kTruncateTaggedToFloat64, MachineRepresentation::kTagged, Type::NumberOrUndefined(), MachineRepresentation::kFloat64); - CheckTwoChanges(IrOpcode::kChangeTaggedSignedToInt32, - IrOpcode::kChangeInt32ToFloat64, - MachineRepresentation::kTagged, Type::TaggedSigned(), - MachineRepresentation::kFloat64); + CheckChange(IrOpcode::kChangeTaggedToFloat64, MachineRepresentation::kTagged, + Type::Signed31(), MachineRepresentation::kFloat64); // Int32,Uint32 <-> Float64 are actually machine conversions. CheckChange(IrOpcode::kChangeInt32ToFloat64, MachineRepresentation::kWord32, @@ -546,7 +542,7 @@ TEST(SingleChanges) { Type::Unsigned32(), MachineRepresentation::kWord32); CheckChange(IrOpcode::kTruncateFloat64ToFloat32, - MachineRepresentation::kFloat64, Type::None(), + MachineRepresentation::kFloat64, Type::Number(), MachineRepresentation::kFloat32); // Int32,Uint32 <-> Float32 require two changes. @@ -570,11 +566,11 @@ TEST(SingleChanges) { // Float32 <-> Tagged require two changes. CheckTwoChanges(IrOpcode::kChangeFloat32ToFloat64, IrOpcode::kChangeFloat64ToTagged, - MachineRepresentation::kFloat32, Type::None(), + MachineRepresentation::kFloat32, Type::Number(), MachineRepresentation::kTagged); CheckTwoChanges(IrOpcode::kChangeTaggedToFloat64, IrOpcode::kTruncateFloat64ToFloat32, - MachineRepresentation::kTagged, Type::None(), + MachineRepresentation::kTagged, Type::Number(), MachineRepresentation::kFloat32); } @@ -587,7 +583,7 @@ TEST(SignednessInWord32) { CheckChange(IrOpcode::kChangeTaggedToUint32, MachineRepresentation::kTagged, Type::Unsigned32(), MachineRepresentation::kWord32); CheckChange(IrOpcode::kChangeInt32ToFloat64, MachineRepresentation::kWord32, - Type::None(), MachineRepresentation::kFloat64); + Type::Signed32(), MachineRepresentation::kFloat64); CheckChange(IrOpcode::kChangeFloat64ToInt32, MachineRepresentation::kFloat64, Type::Signed32(), MachineRepresentation::kWord32); CheckChange(IrOpcode::kTruncateFloat64ToWord32, @@ -600,7 +596,7 @@ TEST(SignednessInWord32) { CheckTwoChanges(IrOpcode::kChangeInt32ToFloat64, IrOpcode::kTruncateFloat64ToFloat32, - MachineRepresentation::kWord32, Type::None(), + MachineRepresentation::kWord32, Type::Signed32(), MachineRepresentation::kFloat32); CheckTwoChanges(IrOpcode::kChangeFloat32ToFloat64, IrOpcode::kTruncateFloat64ToWord32, @@ -614,13 +610,11 @@ TEST(Nops) { // X -> X is always a nop for any single representation X. for (size_t i = 0; i < arraysize(kMachineTypes); i++) { - r.CheckNop(kMachineTypes[i].representation(), Type::None(), + r.CheckNop(kMachineTypes[i].representation(), Type::Number(), kMachineTypes[i].representation()); } // 32-bit floats. - r.CheckNop(MachineRepresentation::kFloat32, Type::None(), - MachineRepresentation::kFloat32); r.CheckNop(MachineRepresentation::kFloat32, Type::Number(), MachineRepresentation::kFloat32); @@ -639,14 +633,6 @@ TEST(Nops) { MachineRepresentation::kWord32); // kRepBit (result of comparison) is implicitly a wordish thing. - r.CheckNop(MachineRepresentation::kBit, Type::None(), - MachineRepresentation::kWord8); - r.CheckNop(MachineRepresentation::kBit, Type::None(), - MachineRepresentation::kWord16); - r.CheckNop(MachineRepresentation::kBit, Type::None(), - MachineRepresentation::kWord32); - r.CheckNop(MachineRepresentation::kBit, Type::None(), - MachineRepresentation::kWord64); r.CheckNop(MachineRepresentation::kBit, Type::Boolean(), MachineRepresentation::kWord8); r.CheckNop(MachineRepresentation::kBit, Type::Boolean(), @@ -661,40 +647,24 @@ TEST(Nops) { TEST(TypeErrors) { RepresentationChangerTester r; - // Wordish cannot be implicitly converted to/from comparison conditions. - r.CheckTypeError(MachineRepresentation::kWord8, Type::None(), - MachineRepresentation::kBit); - r.CheckTypeError(MachineRepresentation::kWord16, Type::None(), - MachineRepresentation::kBit); - r.CheckTypeError(MachineRepresentation::kWord32, Type::None(), - MachineRepresentation::kBit); - r.CheckTypeError(MachineRepresentation::kWord64, Type::None(), - MachineRepresentation::kBit); - - // Floats cannot be implicitly converted to/from comparison conditions. - r.CheckTypeError(MachineRepresentation::kFloat64, Type::None(), - MachineRepresentation::kBit); - // Floats cannot be implicitly converted to/from comparison conditions. - r.CheckTypeError(MachineRepresentation::kFloat32, Type::None(), - MachineRepresentation::kBit); - r.CheckTypeError(MachineRepresentation::kBit, Type::None(), + r.CheckTypeError(MachineRepresentation::kBit, Type::Number(), MachineRepresentation::kFloat32); r.CheckTypeError(MachineRepresentation::kBit, Type::Boolean(), MachineRepresentation::kFloat32); // Word64 is internal and shouldn't be implicitly converted. - r.CheckTypeError(MachineRepresentation::kWord64, Type::None(), + r.CheckTypeError(MachineRepresentation::kWord64, Type::Internal(), MachineRepresentation::kTagged); - r.CheckTypeError(MachineRepresentation::kTagged, Type::None(), + r.CheckTypeError(MachineRepresentation::kTagged, Type::Number(), MachineRepresentation::kWord64); r.CheckTypeError(MachineRepresentation::kTagged, Type::Boolean(), MachineRepresentation::kWord64); // Word64 / Word32 shouldn't be implicitly converted. - r.CheckTypeError(MachineRepresentation::kWord64, Type::None(), + r.CheckTypeError(MachineRepresentation::kWord64, Type::Internal(), MachineRepresentation::kWord32); - r.CheckTypeError(MachineRepresentation::kWord32, Type::None(), + r.CheckTypeError(MachineRepresentation::kWord32, Type::Number(), MachineRepresentation::kWord64); r.CheckTypeError(MachineRepresentation::kWord32, Type::Signed32(), MachineRepresentation::kWord64); |