@@ -1038,7 +1038,8 @@ namespace {
10381038// where "p2A" and "p2B" differ only in the attributes.
10391039//
10401040void TestReconfigureDataFieldAttribute_GeneralizeField (
1041- const CRFTData& from, const CRFTData& to, const CRFTData& expected) {
1041+ const CRFTData& from, const CRFTData& to, const CRFTData& expected,
1042+ bool expected_deprecation) {
10421043 Isolate* isolate = CcTest::i_isolate ();
10431044
10441045 Expectations expectations (isolate);
@@ -1107,24 +1108,29 @@ void TestReconfigureDataFieldAttribute_GeneralizeField(
11071108 CHECK_NE (*map2, *new_map);
11081109 CHECK (expectations2.Check (*map2));
11091110
1110- // |map| should be deprecated and |new_map| should match new expectations.
11111111 for (int i = kSplitProp ; i < kPropCount ; i++) {
11121112 expectations.SetDataField (i, expected.constness , expected.representation ,
11131113 expected.type );
11141114 }
1115- CHECK (map->is_deprecated ());
1116- CHECK (!code_field_type->marked_for_deoptimization ());
1117- CHECK (!code_field_repr->marked_for_deoptimization ());
1118- CHECK (!code_field_const->marked_for_deoptimization ());
1119- CHECK_NE (*map, *new_map);
1115+ if (expected_deprecation) {
1116+ // |map| should be deprecated and |new_map| should match new expectations.
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);
11201122
1121- CHECK (!new_map->is_deprecated ());
1122- CHECK (expectations.Check (*new_map));
1123+ CHECK (!new_map->is_deprecated ());
1124+ CHECK (expectations.Check (*new_map));
11231125
1124- // Update deprecated |map|, it should become |new_map|.
1125- Handle<Map> updated_map = Map::Update (isolate, map);
1126- CHECK_EQ (*new_map, *updated_map);
1127- CheckMigrationTarget (isolate, *map, *updated_map);
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);
1130+ } else {
1131+ CHECK (!map->is_deprecated ());
1132+ CHECK (expectations.Check (*map));
1133+ }
11281134}
11291135
11301136// This test ensures that trivial field generalization (from HeapObject to
@@ -1240,22 +1246,22 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeSmiFieldToDouble) {
12401246 TestReconfigureDataFieldAttribute_GeneralizeField (
12411247 {PropertyConstness::kConst , Representation::Smi (), any_type},
12421248 {PropertyConstness::kConst , Representation::Double (), any_type},
1243- {PropertyConstness::kConst , Representation::Double (), any_type});
1249+ {PropertyConstness::kConst , Representation::Double (), any_type}, true );
12441250
12451251 TestReconfigureDataFieldAttribute_GeneralizeField (
12461252 {PropertyConstness::kConst , Representation::Smi (), any_type},
12471253 {PropertyConstness::kMutable , Representation::Double (), any_type},
1248- {PropertyConstness::kMutable , Representation::Double (), any_type});
1254+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
12491255
12501256 TestReconfigureDataFieldAttribute_GeneralizeField (
12511257 {PropertyConstness::kMutable , Representation::Smi (), any_type},
12521258 {PropertyConstness::kConst , Representation::Double (), any_type},
1253- {PropertyConstness::kMutable , Representation::Double (), any_type});
1259+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
12541260
12551261 TestReconfigureDataFieldAttribute_GeneralizeField (
12561262 {PropertyConstness::kMutable , Representation::Smi (), any_type},
12571263 {PropertyConstness::kMutable , Representation::Double (), any_type},
1258- {PropertyConstness::kMutable , Representation::Double (), any_type});
1264+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
12591265}
12601266
12611267TEST (ReconfigureDataFieldAttribute_GeneralizeSmiFieldToTagged) {
@@ -1270,22 +1276,26 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeSmiFieldToTagged) {
12701276 TestReconfigureDataFieldAttribute_GeneralizeField (
12711277 {PropertyConstness::kConst , Representation::Smi (), any_type},
12721278 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1273- {PropertyConstness::kConst , Representation::Tagged (), any_type});
1279+ {PropertyConstness::kConst , Representation::Tagged (), any_type},
1280+ !FLAG_modify_field_representation_inplace);
12741281
12751282 TestReconfigureDataFieldAttribute_GeneralizeField (
12761283 {PropertyConstness::kConst , Representation::Smi (), any_type},
12771284 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1278- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1285+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1286+ !FLAG_modify_field_representation_inplace);
12791287
12801288 TestReconfigureDataFieldAttribute_GeneralizeField (
12811289 {PropertyConstness::kMutable , Representation::Smi (), any_type},
12821290 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1283- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1291+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1292+ !FLAG_modify_field_representation_inplace);
12841293
12851294 TestReconfigureDataFieldAttribute_GeneralizeField (
12861295 {PropertyConstness::kMutable , Representation::Smi (), any_type},
12871296 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1288- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1297+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1298+ !FLAG_modify_field_representation_inplace);
12891299}
12901300
12911301TEST (ReconfigureDataFieldAttribute_GeneralizeDoubleFieldToTagged) {
@@ -1300,22 +1310,26 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeDoubleFieldToTagged) {
13001310 TestReconfigureDataFieldAttribute_GeneralizeField (
13011311 {PropertyConstness::kConst , Representation::Double (), any_type},
13021312 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1303- {PropertyConstness::kConst , Representation::Tagged (), any_type});
1313+ {PropertyConstness::kConst , Representation::Tagged (), any_type},
1314+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13041315
13051316 TestReconfigureDataFieldAttribute_GeneralizeField (
13061317 {PropertyConstness::kConst , Representation::Double (), any_type},
13071318 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1308- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1319+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1320+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13091321
13101322 TestReconfigureDataFieldAttribute_GeneralizeField (
13111323 {PropertyConstness::kMutable , Representation::Double (), any_type},
13121324 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1313- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1325+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1326+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13141327
13151328 TestReconfigureDataFieldAttribute_GeneralizeField (
13161329 {PropertyConstness::kMutable , Representation::Double (), any_type},
13171330 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1318- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1331+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1332+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13191333}
13201334
13211335TEST (ReconfigureDataFieldAttribute_GeneralizeHeapObjFieldToHeapObj) {
@@ -1401,7 +1415,8 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeHeapObjectFieldToTagged) {
14011415 TestReconfigureDataFieldAttribute_GeneralizeField (
14021416 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
14031417 {PropertyConstness::kMutable , Representation::Smi (), any_type},
1404- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1418+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1419+ !FLAG_modify_field_representation_inplace);
14051420}
14061421
14071422// Checks that given |map| is deprecated and that it updates to given |new_map|
0 commit comments