Commit c037a7fe authored by verwaest@chromium.org's avatar verwaest@chromium.org

Clear the EnumLength fields of maps that lose their enumeration cache.

Review URL: https://chromiumcodereview.appspot.com/10905262

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12498 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8db20006
......@@ -1813,6 +1813,18 @@ MaybeObject* JSObject::ConvertTransitionToMapTransition(
old_map->transitions()->set_descriptors(new_map->instance_descriptors());
new_map->ClearTransitions(GetHeap());
old_map->set_owns_descriptors(false);
Map* map;
JSGlobalPropertyCell* pointer =
old_map->transitions()->descriptors_pointer();
for (Object* current = old_map;
!current->IsUndefined();
current = map->GetBackPointer()) {
map = Map::cast(current);
if (!map->HasTransitionArray()) break;
TransitionArray* transitions = map->transitions();
if (transitions->descriptors_pointer() != pointer) break;
map->SetEnumLength(Map::kInvalidEnumCache);
}
} else if (old_target->instance_descriptors() ==
old_map->instance_descriptors()) {
// Since the conversion above generated a new fast map with an additional
......@@ -1831,6 +1843,7 @@ MaybeObject* JSObject::ConvertTransitionToMapTransition(
if (!map->HasTransitionArray()) break;
TransitionArray* transitions = map->transitions();
if (transitions->descriptors_pointer() != old_pointer) break;
map->SetEnumLength(Map::kInvalidEnumCache);
transitions->set_descriptors_pointer(new_pointer);
}
new_map->ClearTransitions(GetHeap());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment