Commits

Armin Rigo committed ecd5a39

(fijal, arigo)

Pass the flag "is_minor" around.

Comments (0)

Files changed (9)

pypy/rpython/memory/gc/base.py

         # list of last generation roots
         callback2, attrname = _convert_callback_formats(callback)    # :-/
         setattr(self, attrname, arg)
-        self.root_walker.walk_roots(callback2, callback2, callback2)
+        self.root_walker.walk_roots(callback2, callback2, callback2,
+                                    is_minor=False)
         self.run_finalizers.foreach(callback, arg)
     enumerate_all_roots._annspecialcase_ = 'specialize:arg(1)'
 

pypy/rpython/memory/gc/generation.py

         self.root_walker.walk_roots(
             SemiSpaceGC._collect_root,  # stack roots
             SemiSpaceGC._collect_root,  # static in prebuilt non-gc structures
-            None)   # we don't need the static in prebuilt gc objects
+            None,   # we don't need the static in prebuilt gc objects
+            is_minor=False)
 
     def collect_last_generation_roots(self):
         stack = self.last_generation_root_objects
         self.root_walker.walk_roots(
             GenerationGC._collect_root_in_nursery,  # stack roots
             GenerationGC._collect_root_in_nursery,  # static in prebuilt non-gc
-            None)                                   # static in prebuilt gc
+            None,                                   # static in prebuilt gc
+            is_minor=True)
 
     def _collect_root_in_nursery(self, root):
         obj = root.address[0]

pypy/rpython/memory/gc/hybrid.py

             self.root_walker.walk_roots(
                 SemiSpaceGC._collect_root,  # stack roots
                 SemiSpaceGC._collect_root,  # static in prebuilt non-gc structs
-                SemiSpaceGC._collect_root)  # static in prebuilt gc objects
+                SemiSpaceGC._collect_root,  # static in prebuilt gc objects
+                is_minor=False)
 
     def surviving(self, obj):
         # To use during a collection.  The objects that survive are the

pypy/rpython/memory/gc/markcompact.py

         self.root_walker.walk_roots(
             MarkCompactGC._mark_root,  # stack roots
             MarkCompactGC._mark_root,  # static in prebuilt non-gc structures
-            MarkCompactGC._mark_root)  # static in prebuilt gc objects
+            MarkCompactGC._mark_root,  # static in prebuilt gc objects
+            is_minor=False)
         if (self.objects_with_finalizers.non_empty() or
             self.run_finalizers.non_empty()):
             self.trace_from_objects_with_finalizers()
         self.root_walker.walk_roots(
             MarkCompactGC._update_ref,  # stack roots
             MarkCompactGC._update_ref,  # static in prebuilt non-gc structures
-            MarkCompactGC._update_ref)  # static in prebuilt gc objects
+            MarkCompactGC._update_ref,  # static in prebuilt gc objects
+            is_minor=False)
         self.walk_marked_objects(MarkCompactGC.trace_and_update_ref)
 
     def walk_marked_objects(self, callback):

pypy/rpython/memory/gc/marksweep.py

         self.root_walker.walk_roots(
             MarkSweepGC._mark_root,  # stack roots
             MarkSweepGC._mark_root,  # static in prebuilt non-gc structures
-            MarkSweepGC._mark_root)  # static in prebuilt gc objects
+            MarkSweepGC._mark_root,  # static in prebuilt gc objects
+            is_minor=False)
 
         # from this point onwards, no more mallocs should be possible
         old_malloced = self.bytes_malloced

pypy/rpython/memory/gc/minimark.py

         self.root_walker.walk_roots(
             MiniMarkGC._trace_drag_out1,  # stack roots
             MiniMarkGC._trace_drag_out1,  # static in prebuilt non-gc
-            None)                         # static in prebuilt gc
+            None,                         # static in prebuilt gc
+            is_minor=True)
         debug_stop("gc-minor-walkroots")
 
     def collect_cardrefs_to_nursery(self):
         self.root_walker.walk_roots(
             MiniMarkGC._collect_ref_stk, # stack roots
             MiniMarkGC._collect_ref_stk, # static in prebuilt non-gc structures
-            None)   # we don't need the static in all prebuilt gc objects
+            None,   # we don't need the static in all prebuilt gc objects
+            is_minor=False)
         #
         # If we are in an inner collection caused by a call to a finalizer,
         # the 'run_finalizers' objects also need to be kept alive.

pypy/rpython/memory/gc/semispace.py

         self.root_walker.walk_roots(
             SemiSpaceGC._collect_root,  # stack roots
             SemiSpaceGC._collect_root,  # static in prebuilt non-gc structures
-            SemiSpaceGC._collect_root)  # static in prebuilt gc objects
+            SemiSpaceGC._collect_root,  # static in prebuilt gc objects
+            is_minor=False)
 
     def _collect_root(self, root):
         root.address[0] = self.copy(root.address[0])

pypy/rpython/memory/gctransform/framework.py

 
     def walk_roots(self, collect_stack_root,
                    collect_static_in_prebuilt_nongc,
-                   collect_static_in_prebuilt_gc):
+                   collect_static_in_prebuilt_gc,
+                   is_minor):
         gcdata = self.gcdata
         gc = self.gc
         if collect_static_in_prebuilt_nongc:
                     collect_static_in_prebuilt_gc(gc, result)
                 addr += sizeofaddr
         if collect_stack_root:
-            self.walk_stack_roots(collect_stack_root)     # abstract
+            self.walk_stack_roots(collect_stack_root,     # abstract
+                                  is_minor=is_minor)
 
     def need_stacklet_support(self):
         raise Exception("%s does not support stacklets" % (

pypy/rpython/memory/gctransform/shadowstack.py

         self.shadow_stack_pool.initial_setup()
         BaseRootWalker.setup_root_walker(self)
 
-    def walk_stack_roots(self, collect_stack_root):
+    def walk_stack_roots(self, collect_stack_root, is_minor):
         gcdata = self.gcdata
         self.rootstackhook(collect_stack_root,
-                           gcdata.root_stack_base, gcdata.root_stack_top)
+                           gcdata.root_stack_base, gcdata.root_stack_top,
+                           is_minor=is_minor)
 
     def need_thread_support(self, gctransformer, getfn):
         from pypy.module.thread import ll_thread    # xxx fish