@@ -1052,7 +1052,8 @@ namespace {
10521052// where "p2A" and "p2B" differ only in the attributes.
10531053//
10541054void TestReconfigureDataFieldAttribute_GeneralizeField (
1055- const CRFTData& from, const CRFTData& to, const CRFTData& expected) {
1055+ const CRFTData& from, const CRFTData& to, const CRFTData& expected,
1056+ bool expected_deprecation) {
10561057 Isolate* isolate = CcTest::i_isolate ();
10571058
10581059 Expectations expectations (isolate);
@@ -1121,24 +1122,29 @@ void TestReconfigureDataFieldAttribute_GeneralizeField(
11211122 CHECK_NE (*map2, *new_map);
11221123 CHECK (expectations2.Check (*map2));
11231124
1124- // |map| should be deprecated and |new_map| should match new expectations.
11251125 for (int i = kSplitProp ; i < kPropCount ; i++) {
11261126 expectations.SetDataField (i, expected.constness , expected.representation ,
11271127 expected.type );
11281128 }
1129- CHECK (map->is_deprecated ());
1130- CHECK (!code_field_type->marked_for_deoptimization ());
1131- CHECK (!code_field_repr->marked_for_deoptimization ());
1132- CHECK (!code_field_const->marked_for_deoptimization ());
1133- CHECK_NE (*map, *new_map);
1129+ if (expected_deprecation) {
1130+ // |map| should be deprecated and |new_map| should match new expectations.
1131+ CHECK (map->is_deprecated ());
1132+ CHECK (!code_field_type->marked_for_deoptimization ());
1133+ CHECK (!code_field_repr->marked_for_deoptimization ());
1134+ CHECK (!code_field_const->marked_for_deoptimization ());
1135+ CHECK_NE (*map, *new_map);
11341136
1135- CHECK (!new_map->is_deprecated ());
1136- CHECK (expectations.Check (*new_map));
1137+ CHECK (!new_map->is_deprecated ());
1138+ CHECK (expectations.Check (*new_map));
11371139
1138- // Update deprecated |map|, it should become |new_map|.
1139- Handle<Map> updated_map = Map::Update (isolate, map);
1140- CHECK_EQ (*new_map, *updated_map);
1141- CheckMigrationTarget (isolate, *map, *updated_map);
1140+ // Update deprecated |map|, it should become |new_map|.
1141+ Handle<Map> updated_map = Map::Update (isolate, map);
1142+ CHECK_EQ (*new_map, *updated_map);
1143+ CheckMigrationTarget (isolate, *map, *updated_map);
1144+ } else {
1145+ CHECK (!map->is_deprecated ());
1146+ CHECK (expectations.Check (*map));
1147+ }
11421148}
11431149
11441150// This test ensures that trivial field generalization (from HeapObject to
@@ -1254,22 +1260,22 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeSmiFieldToDouble) {
12541260 TestReconfigureDataFieldAttribute_GeneralizeField (
12551261 {PropertyConstness::kConst , Representation::Smi (), any_type},
12561262 {PropertyConstness::kConst , Representation::Double (), any_type},
1257- {PropertyConstness::kConst , Representation::Double (), any_type});
1263+ {PropertyConstness::kConst , Representation::Double (), any_type}, true );
12581264
12591265 TestReconfigureDataFieldAttribute_GeneralizeField (
12601266 {PropertyConstness::kConst , Representation::Smi (), any_type},
12611267 {PropertyConstness::kMutable , Representation::Double (), any_type},
1262- {PropertyConstness::kMutable , Representation::Double (), any_type});
1268+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
12631269
12641270 TestReconfigureDataFieldAttribute_GeneralizeField (
12651271 {PropertyConstness::kMutable , Representation::Smi (), any_type},
12661272 {PropertyConstness::kConst , Representation::Double (), any_type},
1267- {PropertyConstness::kMutable , Representation::Double (), any_type});
1273+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
12681274
12691275 TestReconfigureDataFieldAttribute_GeneralizeField (
12701276 {PropertyConstness::kMutable , Representation::Smi (), any_type},
12711277 {PropertyConstness::kMutable , Representation::Double (), any_type},
1272- {PropertyConstness::kMutable , Representation::Double (), any_type});
1278+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
12731279}
12741280
12751281TEST (ReconfigureDataFieldAttribute_GeneralizeSmiFieldToTagged) {
@@ -1284,22 +1290,26 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeSmiFieldToTagged) {
12841290 TestReconfigureDataFieldAttribute_GeneralizeField (
12851291 {PropertyConstness::kConst , Representation::Smi (), any_type},
12861292 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1287- {PropertyConstness::kConst , Representation::Tagged (), any_type});
1293+ {PropertyConstness::kConst , Representation::Tagged (), any_type},
1294+ !FLAG_modify_field_representation_inplace);
12881295
12891296 TestReconfigureDataFieldAttribute_GeneralizeField (
12901297 {PropertyConstness::kConst , Representation::Smi (), any_type},
12911298 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1292- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1299+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1300+ !FLAG_modify_field_representation_inplace);
12931301
12941302 TestReconfigureDataFieldAttribute_GeneralizeField (
12951303 {PropertyConstness::kMutable , Representation::Smi (), any_type},
12961304 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1297- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1305+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1306+ !FLAG_modify_field_representation_inplace);
12981307
12991308 TestReconfigureDataFieldAttribute_GeneralizeField (
13001309 {PropertyConstness::kMutable , Representation::Smi (), any_type},
13011310 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1302- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1311+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1312+ !FLAG_modify_field_representation_inplace);
13031313}
13041314
13051315TEST (ReconfigureDataFieldAttribute_GeneralizeDoubleFieldToTagged) {
@@ -1314,22 +1324,26 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeDoubleFieldToTagged) {
13141324 TestReconfigureDataFieldAttribute_GeneralizeField (
13151325 {PropertyConstness::kConst , Representation::Double (), any_type},
13161326 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1317- {PropertyConstness::kConst , Representation::Tagged (), any_type});
1327+ {PropertyConstness::kConst , Representation::Tagged (), any_type},
1328+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13181329
13191330 TestReconfigureDataFieldAttribute_GeneralizeField (
13201331 {PropertyConstness::kConst , Representation::Double (), any_type},
13211332 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1322- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1333+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1334+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13231335
13241336 TestReconfigureDataFieldAttribute_GeneralizeField (
13251337 {PropertyConstness::kMutable , Representation::Double (), any_type},
13261338 {PropertyConstness::kConst , Representation::HeapObject (), value_type},
1327- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1339+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1340+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13281341
13291342 TestReconfigureDataFieldAttribute_GeneralizeField (
13301343 {PropertyConstness::kMutable , Representation::Double (), any_type},
13311344 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1332- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1345+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1346+ FLAG_unbox_double_fields || !FLAG_modify_field_representation_inplace);
13331347}
13341348
13351349TEST (ReconfigureDataFieldAttribute_GeneralizeHeapObjFieldToHeapObj) {
@@ -1415,7 +1429,8 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeHeapObjectFieldToTagged) {
14151429 TestReconfigureDataFieldAttribute_GeneralizeField (
14161430 {PropertyConstness::kMutable , Representation::HeapObject (), value_type},
14171431 {PropertyConstness::kMutable , Representation::Smi (), any_type},
1418- {PropertyConstness::kMutable , Representation::Tagged (), any_type});
1432+ {PropertyConstness::kMutable , Representation::Tagged (), any_type},
1433+ !FLAG_modify_field_representation_inplace);
14191434}
14201435
14211436// Checks that given |map| is deprecated and that it updates to given |new_map|
0 commit comments