Index: test/cctest/test-migrations.cc |
diff --git a/test/cctest/test-migrations.cc b/test/cctest/test-migrations.cc |
index a5eee5d7df0079cb62f6f8815923f70a545f228d..e80ec7c06c948e61b25a92ab7d312bc295ebd2ef 100644 |
--- a/test/cctest/test-migrations.cc |
+++ b/test/cctest/test-migrations.cc |
@@ -20,11 +20,6 @@ |
using namespace v8::internal; |
-// TODO(ishell): fix this once ReconfigureProperty supports "non equivalent" |
-// transitions. |
-const bool IS_NON_EQUIVALENT_TRANSITION_SUPPORTED = false; |
- |
- |
// TODO(ishell): fix this once TransitionToPrototype stops generalizing |
// all field representations (similar to crbug/448711 where elements kind |
// and observed transitions caused generalization of all field representations). |
@@ -1591,7 +1586,14 @@ static void TestGeneralizeRepresentationWithSpecialTransition( |
CHECK(!new_map2->is_deprecated()); |
CHECK(!new_map2->is_dictionary_map()); |
- if (!IS_NON_EQUIVALENT_TRANSITION_SUPPORTED) { |
+ Handle<Map> tmp_map; |
+ if (Map::TryUpdate(map2).ToHandle(&tmp_map)) { |
+ // If Map::TryUpdate() manages to succeed the result must match the result |
+ // of Map::Update(). |
+ CHECK_EQ(*new_map2, *tmp_map); |
+ } |
+ |
+ if (config.is_non_equevalent_transition()) { |
// In case of non-equivalent transition currently we generalize all |
// representations. |
for (int i = 0; i < kPropCount; i++) { |
@@ -1600,7 +1602,8 @@ static void TestGeneralizeRepresentationWithSpecialTransition( |
CHECK(new_map2->GetBackPointer()->IsUndefined()); |
CHECK(expectations2.Check(*new_map2)); |
} else { |
- CHECK(expectations.Check(*new_map2)); |
+ CHECK(!new_map2->GetBackPointer()->IsUndefined()); |
+ CHECK(expectations2.Check(*new_map2)); |
} |
} |
@@ -1632,6 +1635,7 @@ TEST(ElementsKindTransitionFromMapOwningDescriptor) { |
} |
// TODO(ishell): remove once IS_PROTO_TRANS_ISSUE_FIXED is removed. |
bool generalizes_representations() const { return false; } |
+ bool is_non_equevalent_transition() const { return false; } |
}; |
TestConfig config; |
TestGeneralizeRepresentationWithSpecialTransition( |
@@ -1666,6 +1670,7 @@ TEST(ElementsKindTransitionFromMapNotOwningDescriptor) { |
} |
// TODO(ishell): remove once IS_PROTO_TRANS_ISSUE_FIXED is removed. |
bool generalizes_representations() const { return false; } |
+ bool is_non_equevalent_transition() const { return false; } |
}; |
TestConfig config; |
TestGeneralizeRepresentationWithSpecialTransition( |
@@ -1688,6 +1693,7 @@ TEST(ForObservedTransitionFromMapOwningDescriptor) { |
} |
// TODO(ishell): remove once IS_PROTO_TRANS_ISSUE_FIXED is removed. |
bool generalizes_representations() const { return false; } |
+ bool is_non_equevalent_transition() const { return true; } |
}; |
TestConfig config; |
TestGeneralizeRepresentationWithSpecialTransition( |
@@ -1721,6 +1727,7 @@ TEST(ForObservedTransitionFromMapNotOwningDescriptor) { |
} |
// TODO(ishell): remove once IS_PROTO_TRANS_ISSUE_FIXED is removed. |
bool generalizes_representations() const { return false; } |
+ bool is_non_equevalent_transition() const { return true; } |
}; |
TestConfig config; |
TestGeneralizeRepresentationWithSpecialTransition( |
@@ -1754,6 +1761,7 @@ TEST(PrototypeTransitionFromMapOwningDescriptor) { |
bool generalizes_representations() const { |
return !IS_PROTO_TRANS_ISSUE_FIXED; |
} |
+ bool is_non_equevalent_transition() const { return true; } |
}; |
TestConfig config; |
TestGeneralizeRepresentationWithSpecialTransition( |
@@ -1798,6 +1806,7 @@ TEST(PrototypeTransitionFromMapNotOwningDescriptor) { |
bool generalizes_representations() const { |
return !IS_PROTO_TRANS_ISSUE_FIXED; |
} |
+ bool is_non_equevalent_transition() const { return true; } |
}; |
TestConfig config; |
TestGeneralizeRepresentationWithSpecialTransition( |