Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index cc6ae919a8a37927b840575a8ed9235b571bbdfb..67cba48414fba0ffa630654325a73fa580d977e1 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -11222,16 +11222,22 @@ static void ShrinkInstanceSize(Map* map, void* data) { |
void JSFunction::CompleteInobjectSlackTracking() { |
DCHECK(has_initial_map()); |
- Map* map = initial_map(); |
+ initial_map()->CompleteInobjectSlackTracking(); |
+} |
- DCHECK(map->counter() >= Map::kSlackTrackingCounterEnd - 1); |
- map->set_counter(Map::kRetainingCounterStart); |
- int slack = map->unused_property_fields(); |
- TransitionArray::TraverseTransitionTree(map, &GetMinInobjectSlack, &slack); |
+void Map::CompleteInobjectSlackTracking() { |
+ // Has to be an initial map. |
+ DCHECK(GetBackPointer()->IsUndefined()); |
+ |
+ DCHECK_GE(counter(), kSlackTrackingCounterEnd - 1); |
+ set_counter(kRetainingCounterStart); |
+ |
+ int slack = unused_property_fields(); |
+ TransitionArray::TraverseTransitionTree(this, &GetMinInobjectSlack, &slack); |
if (slack != 0) { |
// Resize the initial map and all maps in its transition tree. |
- TransitionArray::TraverseTransitionTree(map, &ShrinkInstanceSize, &slack); |
+ TransitionArray::TraverseTransitionTree(this, &ShrinkInstanceSize, &slack); |
} |
} |