@@ -1040,7 +1040,8 @@ namespace {
10401040// where "p2A" and "p2B" differ only in the attributes.
10411041//
10421042void TestReconfigureDataFieldAttribute_GeneralizeField (
1043- const CRFTData& from, const CRFTData& to, const CRFTData& expected) {
1043+ const CRFTData& from, const CRFTData& to, const CRFTData& expected,
1044+ bool expected_deprecation) {
10441045 Isolate* isolate = CcTest::i_isolate ();
10451046
10461047 Expectations expectations (isolate);
@@ -1109,24 +1110,29 @@ void TestReconfigureDataFieldAttribute_GeneralizeField(
11091110 CHECK_NE (*map2, *new_map);
11101111 CHECK (expectations2.Check (*map2));
11111112
1112- // |map| should be deprecated and |new_map| should match new expectations.
11131113 for (int i = kSplitProp ; i < kPropCount ; i++) {
11141114 expectations.SetDataField (i, expected.constness , expected.representation ,
11151115 expected.type );
11161116 }
1117- CHECK (map->is_deprecated ());
1118- CHECK (!code_field_type->marked_for_deoptimization ());
1119- CHECK (!code_field_repr->marked_for_deoptimization ());
1120- CHECK (!code_field_const->marked_for_deoptimization ());
1121- CHECK_NE (*map, *new_map);
1117+ if (expected_deprecation) {
1118+ // |map| should be deprecated and |new_map| should match new expectations.
1119+ CHECK (map->is_deprecated ());
1120+ CHECK (!code_field_type->marked_for_deoptimization ());
1121+ CHECK (!code_field_repr->marked_for_deoptimization ());
1122+ CHECK (!code_field_const->marked_for_deoptimization ());
1123+ CHECK_NE (*map, *new_map);
11221124
1123- CHECK (!new_map->is_deprecated ());
1124- CHECK (expectations.Check (*new_map));
1125+ CHECK (!new_map->is_deprecated ());
1126+ CHECK (expectations.Check (*new_map));
11251127
1126- // Update deprecated |map|, it should become |new_map|.
1127- Handle<Map> updated_map = Map::Update (isolate, map);
1128- CHECK_EQ (*new_map, *updated_map);
1129- CheckMigrationTarget (isolate, *map, *updated_map);
1128+ // Update deprecated |map|, it should become |new_map|.
1129+ Handle<Map> updated_map = Map::Update (isolate, map);
1130+ CHECK_EQ (*new_map, *updated_map);
1131+ CheckMigrationTarget (isolate, *map, *updated_map);
1132+ } else {
1133+ CHECK (!map->is_deprecated ());
1134+ CHECK (expectations.Check (*map));
1135+ }
11301136}
11311137
11321138// This test ensures that trivial field generalization (from HeapObject to
@@ -1242,22 +1248,22 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeSmiFieldToDouble) {
12421248 TestReconfigureDataFieldAttribute_GeneralizeField (
12431249 {PropertyConstness::kConst , Representation::Smi (), any_type},
12441250 {PropertyConstness::kConst , Representation::Double (), any_type},
1245- {PropertyConstness::kConst , Representation::Double (), any_type});
1251+ {PropertyConstness::kConst , Representation::Double (), any_type}, true );
12461252
12471253 TestReconfigureDataFieldAttribute_GeneralizeField (
12481254 {PropertyConstness::kConst , Representation::Smi (), any_type},
12491255 {PropertyConstness::kMutable , Representation::Double (), any_type},
1250- {PropertyConstness::kMutable , Representation::Double (), any_type});
1256+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
12511257
12521258 TestReconfigureDataFieldAttribute_GeneralizeField (
12531259 {PropertyConstness::kMutable , Representation::Smi (), any_type},
12541260 {PropertyConstness::kConst , Representation::Double (), any_type},
1255- {PropertyConstness::kMutable , Representation::Double (), any_type});
1261+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
12561262
12571263 TestReconfigureDataFieldAttribute_GeneralizeField (
12581264 {PropertyConstness::kMutable , Representation::Smi (), any_type},
12591265 {PropertyConstness::kMutable , Representation::Double (), any_type},
1260- {PropertyConstness::kMutable , Representation::Double (), any_type});
1266+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
12611267}
12621268
12631269TEST (ReconfigureDataFieldAttribute_GeneralizeSmiFieldToTagged) {
@@ -1272,22 +1278,26 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeSmiFieldToTagged) {
12721278 TestReconfigureDataFieldAttribute_GeneralizeField (
12731279 {PropertyConstness::kConst , Representation::Smi (), any_type},
12741280 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1275- {PropertyConstness::kConst , Representation::Tagged (), any_type});
1281+ {PropertyConstness::kConst , Representation::Tagged (), any_type},
1282+ !FLAG_modify_field_representation_inplace);
12761283
12771284 TestReconfigureDataFieldAttribute_GeneralizeField (
12781285 {PropertyConstness::kConst , Representation::Smi (), any_type},
12791286 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1280- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1287+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1288+ !FLAG_modify_field_representation_inplace);
12811289
12821290 TestReconfigureDataFieldAttribute_GeneralizeField (
12831291 {PropertyConstness::kMutable , Representation::Smi (), any_type},
12841292 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1285- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1293+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1294+ !FLAG_modify_field_representation_inplace);
12861295
12871296 TestReconfigureDataFieldAttribute_GeneralizeField (
12881297 {PropertyConstness::kMutable , Representation::Smi (), any_type},
12891298 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1290- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1299+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1300+ !FLAG_modify_field_representation_inplace);
12911301}
12921302
12931303TEST (ReconfigureDataFieldAttribute_GeneralizeDoubleFieldToTagged) {
@@ -1302,22 +1312,26 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeDoubleFieldToTagged) {
13021312 TestReconfigureDataFieldAttribute_GeneralizeField (
13031313 {PropertyConstness::kConst , Representation::Double (), any_type},
13041314 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1305- {PropertyConstness::kConst , Representation::Tagged (), any_type});
1315+ {PropertyConstness::kConst , Representation::Tagged (), any_type},
1316+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13061317
13071318 TestReconfigureDataFieldAttribute_GeneralizeField (
13081319 {PropertyConstness::kConst , Representation::Double (), any_type},
13091320 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1310- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1321+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1322+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13111323
13121324 TestReconfigureDataFieldAttribute_GeneralizeField (
13131325 {PropertyConstness::kMutable , Representation::Double (), any_type},
13141326 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1315- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1327+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1328+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13161329
13171330 TestReconfigureDataFieldAttribute_GeneralizeField (
13181331 {PropertyConstness::kMutable , Representation::Double (), any_type},
13191332 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1320- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1333+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1334+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13211335}
13221336
13231337TEST (ReconfigureDataFieldAttribute_GeneralizeHeapObjFieldToHeapObj) {
@@ -1403,7 +1417,8 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeHeapObjectFieldToTagged) {
14031417 TestReconfigureDataFieldAttribute_GeneralizeField (
14041418 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
14051419 {PropertyConstness::kMutable , Representation::Smi (), any_type},
1406- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1420+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1421+ !FLAG_modify_field_representation_inplace);
14071422}
14081423
14091424// Checks that given |map| is deprecated and that it updates to given |new_map|
0 commit comments