@@ -2288,11 +2288,45 @@ void MarkCompactCollector::ClearFullMapTransitions() {
2288
2288
}
2289
2289
}
2290
2290
2291
+ // Returns false if no maps have died, or if the transition array is
2292
+ // still being deserialized.
2293
+ bool MarkCompactCollector::TransitionArrayNeedsCompaction (
2294
+ TransitionArray transitions, int num_transitions) {
2295
+ for (int i = 0 ; i < num_transitions; ++i) {
2296
+ MaybeObject raw_target = transitions.GetRawTarget (i);
2297
+ if (raw_target.IsSmi ()) {
2298
+ // This target is still being deserialized,
2299
+ DCHECK (isolate ()->has_active_deserializer ());
2300
+ DCHECK_EQ (raw_target.ToSmi (), Deserializer::uninitialized_field_value ());
2301
+ #ifdef DEBUG
2302
+ // Targets can only be dead iff this array is fully deserialized.
2303
+ for (int i = 0 ; i < num_transitions; ++i) {
2304
+ DCHECK (!non_atomic_marking_state ()->IsWhite (transitions.GetTarget (i)));
2305
+ }
2306
+ #endif
2307
+ return false ;
2308
+ } else if (non_atomic_marking_state ()->IsWhite (
2309
+ TransitionsAccessor::GetTargetFromRaw (raw_target))) {
2310
+ #ifdef DEBUG
2311
+ // Targets can only be dead iff this array is fully deserialized.
2312
+ for (int i = 0 ; i < num_transitions; ++i) {
2313
+ DCHECK (!transitions.GetRawTarget (i).IsSmi ());
2314
+ }
2315
+ #endif
2316
+ return true ;
2317
+ }
2318
+ }
2319
+ return false ;
2320
+ }
2321
+
2291
2322
bool MarkCompactCollector::CompactTransitionArray (Map map,
2292
2323
TransitionArray transitions,
2293
2324
DescriptorArray descriptors) {
2294
2325
DCHECK (!map.is_prototype_map ());
2295
2326
int num_transitions = transitions.number_of_entries ();
2327
+ if (!TransitionArrayNeedsCompaction (transitions, num_transitions)) {
2328
+ return false ;
2329
+ }
2296
2330
bool descriptors_owner_died = false ;
2297
2331
int transition_index = 0 ;
2298
2332
// Compact all live transitions to the left.
0 commit comments