 Chromium Code Reviews
 Chromium Code Reviews Issue 2740033002:
  [serializer] complete slack tracking when creating context snapshot.  (Closed)
    
  
    Issue 2740033002:
  [serializer] complete slack tracking when creating context snapshot.  (Closed) 
  | Index: src/objects.cc | 
| diff --git a/src/objects.cc b/src/objects.cc | 
| index 56b666fb8126f7b5d7512c310f3caf1354d620f0..cfc6fe35ae60a602f10229988778c658d4b6b760 100644 | 
| --- a/src/objects.cc | 
| +++ b/src/objects.cc | 
| @@ -13577,16 +13577,9 @@ void SetExpectedNofPropertiesFromEstimate(Handle<SharedFunctionInfo> shared, | 
| // to be added later. | 
| if (estimate == 0) estimate = 2; | 
| - // TODO(yangguo): check whether those heuristics are still up-to-date. | 
| - // We do not shrink objects that go into a snapshot (yet), so we adjust | 
| - // the estimate conservatively. | 
| - if (shared->GetIsolate()->serializer_enabled()) { | 
| - estimate += 2; | 
| - } else { | 
| - // Inobject slack tracking will reclaim redundant inobject space later, | 
| - // so we can afford to adjust the estimate generously. | 
| - estimate += 8; | 
| - } | 
| + // Inobject slack tracking will reclaim redundant inobject space later, | 
| + // so we can afford to adjust the estimate generously. | 
| + estimate += 8; | 
| shared->set_expected_nof_properties(estimate); | 
| } | 
| @@ -13639,13 +13632,8 @@ void SharedFunctionInfo::SetConstructStub(Code* code) { | 
| void Map::StartInobjectSlackTracking() { | 
| DCHECK(!IsInobjectSlackTrackingInProgress()); | 
| - | 
| - // No tracking during the snapshot construction phase. | 
| Isolate* isolate = GetIsolate(); | 
| 
Toon Verwaest
2017/03/15 12:20:09
unused variable?
 | 
| - if (isolate->serializer_enabled()) return; | 
| - | 
| if (unused_property_fields() == 0) return; | 
| - | 
| set_construction_counter(Map::kSlackTrackingCounterStart); | 
| } |