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

Unified Diff: src/objects.cc

Issue 2044003003: [runtime] Don't use ElementsTransitionAndStoreStub for transitions that involve instance rewriting. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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.h ('k') | test/mjsunit/regress/regress-crbug-617524.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 3be25f274d35850541732db7416d90882214fa96..3160fe647f2e77bcf0d7025cf448661c5b6181db 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2762,6 +2762,16 @@ const char* Representation::Mnemonic() const {
}
}
+bool Map::InstancesNeedRewriting(Map* target) {
+ int target_number_of_fields = target->NumberOfFields();
+ int target_inobject = target->GetInObjectProperties();
+ int target_unused = target->unused_property_fields();
+ int old_number_of_fields;
+
+ return InstancesNeedRewriting(target, target_number_of_fields,
+ target_inobject, target_unused,
+ &old_number_of_fields);
+}
bool Map::InstancesNeedRewriting(Map* target, int target_number_of_fields,
int target_inobject, int target_unused,
@@ -4799,12 +4809,14 @@ Map* Map::FindElementsKindTransitionedMap(MapHandleList* candidates) {
root_map = root_map->LookupElementsTransitionMap(kind);
DCHECK_NOT_NULL(root_map);
// Starting from the next existing elements kind transition try to
- // replay the property transitions.
+ // replay the property transitions that does not involve instance rewriting
+ // (ElementsTransitionAndStoreStub does not support that).
for (root_map = root_map->ElementsTransitionMap();
root_map != nullptr && root_map->has_fast_elements();
root_map = root_map->ElementsTransitionMap()) {
Map* current = root_map->TryReplayPropertyTransitions(this);
if (current == nullptr) continue;
+ if (InstancesNeedRewriting(current)) continue;
if (ContainsMap(candidates, current) &&
(packed || !IsFastPackedElementsKind(current->elements_kind()))) {
« no previous file with comments | « src/objects.h ('k') | test/mjsunit/regress/regress-crbug-617524.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698