Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: test/cctest/test-migrations.cc

Issue 1181163002: Map::TryUpdate() must be in sync with Map::Update(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/regress/regress-4121.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/regress/regress-4121.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698