File tree Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Expand file tree Collapse file tree 2 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -1648,8 +1648,34 @@ class RootMarkingVisitor : public ObjectVisitor {
16481648  void  MarkObjectByPointer (Object** p) {
16491649    if  (!(*p)->IsHeapObject ()) return ;
16501650
1651-     //  Replace flat cons strings in place.
16521651    HeapObject* object = ShortCircuitConsString (p);
1652+ 
1653+     //  We cannot avoid stale handles to left-trimmed objects, but can only make
1654+     //  sure all handles still needed are updated. Filter out any stale pointers
1655+     //  and clear the slot to allow post processing of handles (needed because
1656+     //  the sweeper might actually free the underlying page).
1657+     if  (object->IsFiller ()) {
1658+ #ifdef  DEBUG
1659+       //  We need to find a FixedArrayBase map after walking the fillers.
1660+       Heap* heap = collector_->heap ();
1661+       HeapObject* current = object;
1662+       while  (current->IsFiller ()) {
1663+         Address next = reinterpret_cast <Address>(current);
1664+         if  (current->map () == heap->one_pointer_filler_map ()) {
1665+           next += kPointerSize ;
1666+         } else  if  (current->map () == heap->two_pointer_filler_map ()) {
1667+           next += 2  * kPointerSize ;
1668+         } else  {
1669+           next += current->Size ();
1670+         }
1671+         current = reinterpret_cast <HeapObject*>(next);
1672+       }
1673+       DCHECK (current->IsFixedArrayBase ());
1674+ #endif   //  DEBUG
1675+       *p = nullptr ;
1676+       return ;
1677+     }
1678+ 
16531679    MarkBit mark_bit = Marking::MarkBitFrom (object);
16541680    if  (Marking::IsBlackOrGrey (mark_bit)) return ;
16551681
Original file line number Diff line number Diff line change 1+ // Copyright 2016 the V8 project authors. All rights reserved. 
2+ // Use of this source code is governed by a BSD-style license that can be 
3+ // found in the LICENSE file. 
4+ 
5+ // Flags: --expose-gc 
6+ 
7+ var  o0  =  [ ] ; 
8+ var  o1  =  [ ] ; 
9+ var  cnt  =  0 ; 
10+ o1 . __defineGetter__ ( 0 ,  function ( )  { 
11+   if  ( cnt ++  >  2 )  return ; 
12+   o0 . shift ( ) ; 
13+   gc ( ) ; 
14+   o0 . push ( 0 ) ; 
15+   o0 . concat ( o1 ) ; 
16+ } ) ; 
17+ o1 [ 0 ] ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments