@@ -1052,7 +1052,8 @@ namespace {
1052
1052
// where "p2A" and "p2B" differ only in the attributes.
1053
1053
//
1054
1054
void 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) {
1056
1057
Isolate* isolate = CcTest::i_isolate ();
1057
1058
1058
1059
Expectations expectations (isolate);
@@ -1121,24 +1122,29 @@ void TestReconfigureDataFieldAttribute_GeneralizeField(
1121
1122
CHECK_NE (*map2, *new_map);
1122
1123
CHECK (expectations2.Check (*map2));
1123
1124
1124
- // |map| should be deprecated and |new_map| should match new expectations.
1125
1125
for (int i = kSplitProp ; i < kPropCount ; i++) {
1126
1126
expectations.SetDataField (i, expected.constness , expected.representation ,
1127
1127
expected.type );
1128
1128
}
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);
1134
1136
1135
- CHECK (!new_map->is_deprecated ());
1136
- CHECK (expectations.Check (*new_map));
1137
+ CHECK (!new_map->is_deprecated ());
1138
+ CHECK (expectations.Check (*new_map));
1137
1139
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
+ }
1142
1148
}
1143
1149
1144
1150
// This test ensures that trivial field generalization (from HeapObject to
@@ -1254,22 +1260,22 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeSmiFieldToDouble) {
1254
1260
TestReconfigureDataFieldAttribute_GeneralizeField (
1255
1261
{PropertyConstness::kConst , Representation::Smi (), any_type},
1256
1262
{PropertyConstness::kConst , Representation::Double (), any_type},
1257
- {PropertyConstness::kConst , Representation::Double (), any_type});
1263
+ {PropertyConstness::kConst , Representation::Double (), any_type}, true );
1258
1264
1259
1265
TestReconfigureDataFieldAttribute_GeneralizeField (
1260
1266
{PropertyConstness::kConst , Representation::Smi (), any_type},
1261
1267
{PropertyConstness::kMutable , Representation::Double (), any_type},
1262
- {PropertyConstness::kMutable , Representation::Double (), any_type});
1268
+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
1263
1269
1264
1270
TestReconfigureDataFieldAttribute_GeneralizeField (
1265
1271
{PropertyConstness::kMutable , Representation::Smi (), any_type},
1266
1272
{PropertyConstness::kConst , Representation::Double (), any_type},
1267
- {PropertyConstness::kMutable , Representation::Double (), any_type});
1273
+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
1268
1274
1269
1275
TestReconfigureDataFieldAttribute_GeneralizeField (
1270
1276
{PropertyConstness::kMutable , Representation::Smi (), any_type},
1271
1277
{PropertyConstness::kMutable , Representation::Double (), any_type},
1272
- {PropertyConstness::kMutable , Representation::Double (), any_type});
1278
+ {PropertyConstness::kMutable , Representation::Double (), any_type}, true );
1273
1279
}
1274
1280
1275
1281
TEST (ReconfigureDataFieldAttribute_GeneralizeSmiFieldToTagged) {
@@ -1284,22 +1290,26 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeSmiFieldToTagged) {
1284
1290
TestReconfigureDataFieldAttribute_GeneralizeField (
1285
1291
{PropertyConstness::kConst , Representation::Smi (), any_type},
1286
1292
{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);
1288
1295
1289
1296
TestReconfigureDataFieldAttribute_GeneralizeField (
1290
1297
{PropertyConstness::kConst , Representation::Smi (), any_type},
1291
1298
{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);
1293
1301
1294
1302
TestReconfigureDataFieldAttribute_GeneralizeField (
1295
1303
{PropertyConstness::kMutable , Representation::Smi (), any_type},
1296
1304
{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);
1298
1307
1299
1308
TestReconfigureDataFieldAttribute_GeneralizeField (
1300
1309
{PropertyConstness::kMutable , Representation::Smi (), any_type},
1301
1310
{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);
1303
1313
}
1304
1314
1305
1315
TEST (ReconfigureDataFieldAttribute_GeneralizeDoubleFieldToTagged) {
@@ -1314,22 +1324,26 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeDoubleFieldToTagged) {
1314
1324
TestReconfigureDataFieldAttribute_GeneralizeField (
1315
1325
{PropertyConstness::kConst , Representation::Double (), any_type},
1316
1326
{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);
1318
1329
1319
1330
TestReconfigureDataFieldAttribute_GeneralizeField (
1320
1331
{PropertyConstness::kConst , Representation::Double (), any_type},
1321
1332
{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);
1323
1335
1324
1336
TestReconfigureDataFieldAttribute_GeneralizeField (
1325
1337
{PropertyConstness::kMutable , Representation::Double (), any_type},
1326
1338
{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);
1328
1341
1329
1342
TestReconfigureDataFieldAttribute_GeneralizeField (
1330
1343
{PropertyConstness::kMutable , Representation::Double (), any_type},
1331
1344
{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);
1333
1347
}
1334
1348
1335
1349
TEST (ReconfigureDataFieldAttribute_GeneralizeHeapObjFieldToHeapObj) {
@@ -1415,7 +1429,8 @@ TEST(ReconfigureDataFieldAttribute_GeneralizeHeapObjectFieldToTagged) {
1415
1429
TestReconfigureDataFieldAttribute_GeneralizeField (
1416
1430
{PropertyConstness::kMutable , Representation::HeapObject (), value_type},
1417
1431
{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);
1419
1434
}
1420
1435
1421
1436
// Checks that given |map| is deprecated and that it updates to given |new_map|
0 commit comments