[pypy-commit] pypy stacklet: Get rid of really old code: the 'gc_x_*' operations in the Mark&Sweep

arigo noreply at buildbot.pypy.org
Sat Aug 6 12:31:13 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: stacklet
Changeset: r46308:0fcce6fcc501
Date: 2011-08-06 10:02 +0200
http://bitbucket.org/pypy/pypy/changeset/0fcce6fcc501/

Log:	Get rid of really old code: the 'gc_x_*' operations in the
	Mark&Sweep GC, and the 'can_collect' argument to malloc_fixedsize()
	and malloc_varsize().

diff --git a/pypy/jit/backend/llsupport/gc.py b/pypy/jit/backend/llsupport/gc.py
--- a/pypy/jit/backend/llsupport/gc.py
+++ b/pypy/jit/backend/llsupport/gc.py
@@ -551,7 +551,7 @@
             check_typeid(type_id)
             try:
                 res = llop1.do_malloc_fixedsize_clear(llmemory.GCREF,
-                                                      type_id, size, True,
+                                                      type_id, size,
                                                       has_finalizer, False)
             except MemoryError:
                 fatalerror("out of memory (from JITted code)")
@@ -575,7 +575,7 @@
                 return llop1.do_malloc_varsize_clear(
                     llmemory.GCREF,
                     type_id, num_elem, self.array_basesize, itemsize,
-                    self.array_length_ofs, True)
+                    self.array_length_ofs)
             except MemoryError:
                 fatalerror("out of memory (from JITted code)")
                 return lltype.nullptr(llmemory.GCREF.TO)
@@ -595,7 +595,7 @@
                 return llop1.do_malloc_varsize_clear(
                     llmemory.GCREF,
                     str_type_id, length, str_basesize, str_itemsize,
-                    str_ofs_length, True)
+                    str_ofs_length)
             except MemoryError:
                 fatalerror("out of memory (from JITted code)")
                 return lltype.nullptr(llmemory.GCREF.TO)
@@ -604,7 +604,7 @@
                 return llop1.do_malloc_varsize_clear(
                     llmemory.GCREF,
                     unicode_type_id, length, unicode_basesize,unicode_itemsize,
-                    unicode_ofs_length, True)
+                    unicode_ofs_length)
             except MemoryError:
                 fatalerror("out of memory (from JITted code)")
                 return lltype.nullptr(llmemory.GCREF.TO)
@@ -634,7 +634,7 @@
                 # also use it to allocate varsized objects.  The tid
                 # and possibly the length are both set afterward.
                 gcref = llop1.do_malloc_fixedsize_clear(llmemory.GCREF,
-                                            0, size, True, False, False)
+                                            0, size, False, False)
             except MemoryError:
                 fatalerror("out of memory (from JITted code)")
                 return 0
diff --git a/pypy/jit/backend/llsupport/test/test_gc.py b/pypy/jit/backend/llsupport/test/test_gc.py
--- a/pypy/jit/backend/llsupport/test/test_gc.py
+++ b/pypy/jit/backend/llsupport/test/test_gc.py
@@ -246,9 +246,8 @@
     def __init__(self):
         self.record = []
 
-    def do_malloc_fixedsize_clear(self, RESTYPE, type_id, size, can_collect,
+    def do_malloc_fixedsize_clear(self, RESTYPE, type_id, size,
                                   has_finalizer, contains_weakptr):
-        assert can_collect
         assert not contains_weakptr
         p = llmemory.raw_malloc(size)
         p = llmemory.cast_adr_to_ptr(p, RESTYPE)
@@ -258,8 +257,7 @@
         return p
 
     def do_malloc_varsize_clear(self, RESTYPE, type_id, length, size,
-                                itemsize, offset_to_length, can_collect):
-        assert can_collect
+                                itemsize, offset_to_length):
         p = llmemory.raw_malloc(size + itemsize * length)
         (p + offset_to_length).signed[0] = length
         p = llmemory.cast_adr_to_ptr(p, RESTYPE)
diff --git a/pypy/rlib/rgc.py b/pypy/rlib/rgc.py
--- a/pypy/rlib/rgc.py
+++ b/pypy/rlib/rgc.py
@@ -15,132 +15,8 @@
     pass
 
 # ____________________________________________________________
-# Framework GC features
-
-class GcPool(object):
-    pass
-
-def gc_swap_pool(newpool):
-    """Set newpool as the current pool (create one if newpool is None).
-    All malloc'ed objects are put into the current pool;this is a
-    way to separate objects depending on when they were allocated.
-    """
-    raise NotImplementedError("only works in stacklessgc translated versions")
-
-def gc_clone(gcobject, pool):
-    """Recursively clone the gcobject and everything it points to,
-    directly or indirectly -- but stops at objects that are not
-    in the specified pool.  Pool can be None to mean the current one.
-    A new pool is built to contain the copies.  Return (newobject, newpool).
-    """
-    raise NotImplementedError("only works in stacklessgc translated versions")
-
-# ____________________________________________________________
 # Annotation and specialization
 
-class GcPoolEntry(ExtRegistryEntry):
-    "Link GcPool to its Repr."
-    _type_ = GcPool
-
-    def get_repr(self, rtyper, s_pool):
-        config = rtyper.getconfig()
-        # if the gc policy doesn't support allocation pools, lltype
-        # pools as Void.
-        if config.translation.gc != 'marksweep':
-            from pypy.annotation.model import s_None
-            return rtyper.getrepr(s_None)
-        else:
-            from pypy.rpython.rmodel import SimplePointerRepr
-            from pypy.rpython.memory.gc.marksweep import X_POOL_PTR
-            return SimplePointerRepr(X_POOL_PTR)
-
-
-class SwapPoolFnEntry(ExtRegistryEntry):
-    "Annotation and specialization of gc_swap_pool()."
-    _about_ = gc_swap_pool
-
-    def compute_result_annotation(self, s_newpool):
-        from pypy.annotation import model as annmodel
-        return annmodel.SomeExternalObject(GcPool)
-
-    def specialize_call(self, hop):
-        from pypy.annotation import model as annmodel
-        s_pool_ptr = annmodel.SomeExternalObject(GcPool)
-        r_pool_ptr = hop.rtyper.getrepr(s_pool_ptr)
-
-        opname = 'gc_x_swap_pool'
-        config = hop.rtyper.getconfig()
-        if config.translation.gc != 'marksweep':
-            # when the gc policy doesn't support pools, just return
-            # the argument (which is lltyped as Void anyway)
-            opname = 'same_as'
-            
-        s_pool_ptr = annmodel.SomeExternalObject(GcPool)
-        r_pool_ptr = hop.rtyper.getrepr(s_pool_ptr)
-        vlist = hop.inputargs(r_pool_ptr)
-        return hop.genop(opname, vlist, resulttype = r_pool_ptr)
-
-def _raise():
-    raise RuntimeError
-
-class CloneFnEntry(ExtRegistryEntry):
-    "Annotation and specialization of gc_clone()."
-    _about_ = gc_clone
-
-    def compute_result_annotation(self, s_gcobject, s_pool):
-        from pypy.annotation import model as annmodel
-        return annmodel.SomeTuple([s_gcobject,
-                                   annmodel.SomeExternalObject(GcPool)])
-
-    def specialize_call(self, hop):
-        from pypy.rpython.error import TyperError
-        from pypy.rpython.lltypesystem import rtuple
-        from pypy.annotation import model as annmodel
-        from pypy.rpython.memory.gc.marksweep import X_CLONE, X_CLONE_PTR
-
-        config = hop.rtyper.getconfig()
-        if config.translation.gc != 'marksweep':
-            # if the gc policy does not support allocation pools,
-            # gc_clone always raises RuntimeError
-            hop.exception_is_here()
-            hop.gendirectcall(_raise)
-            s_pool_ptr = annmodel.SomeExternalObject(GcPool)
-            r_pool_ptr = hop.rtyper.getrepr(s_pool_ptr)
-            r_tuple = hop.r_result
-            v_gcobject, v_pool = hop.inputargs(hop.args_r[0], r_pool_ptr)
-            return rtuple.newtuple(hop.llops, r_tuple, [v_gcobject, v_pool])
-
-        r_gcobject = hop.args_r[0]
-        if (not isinstance(r_gcobject.lowleveltype, lltype.Ptr) or
-            r_gcobject.lowleveltype.TO._gckind != 'gc'):
-            raise TyperError("gc_clone() can only clone a dynamically "
-                             "allocated object;\ngot %r" % (r_gcobject,))
-        s_pool_ptr = annmodel.SomeExternalObject(GcPool)
-        r_pool_ptr = hop.rtyper.getrepr(s_pool_ptr)
-        r_tuple = hop.r_result
-
-        c_CLONE       = hop.inputconst(lltype.Void, X_CLONE)
-        c_flags       = hop.inputconst(lltype.Void, {'flavor': 'gc'})
-        c_gcobjectptr = hop.inputconst(lltype.Void, "gcobjectptr")
-        c_pool        = hop.inputconst(lltype.Void, "pool")
-
-        v_gcobject, v_pool = hop.inputargs(hop.args_r[0], r_pool_ptr)
-        v_gcobjectptr = hop.genop('cast_opaque_ptr', [v_gcobject],
-                                  resulttype = llmemory.GCREF)
-        v_clonedata = hop.genop('malloc', [c_CLONE, c_flags],
-                                resulttype = X_CLONE_PTR)
-        hop.genop('setfield', [v_clonedata, c_gcobjectptr, v_gcobjectptr])
-        hop.genop('setfield', [v_clonedata, c_pool, v_pool])
-        hop.exception_is_here()
-        hop.genop('gc_x_clone', [v_clonedata])
-        v_gcobjectptr = hop.genop('getfield', [v_clonedata, c_gcobjectptr],
-                                  resulttype = llmemory.GCREF)
-        v_pool        = hop.genop('getfield', [v_clonedata, c_pool],
-                                  resulttype = r_pool_ptr)
-        v_gcobject = hop.genop('cast_opaque_ptr', [v_gcobjectptr],
-                               resulttype = r_tuple.items_r[0])
-        return rtuple.newtuple(hop.llops, r_tuple, [v_gcobject, v_pool])
-
 # Support for collection.
 
 class CollectEntry(ExtRegistryEntry):
diff --git a/pypy/rpython/lltypesystem/lloperation.py b/pypy/rpython/lltypesystem/lloperation.py
--- a/pypy/rpython/lltypesystem/lloperation.py
+++ b/pypy/rpython/lltypesystem/lloperation.py
@@ -482,12 +482,6 @@
     'gc_adr_of_root_stack_top': LLOp(),
     # ^^^ returns the address of gcdata.root_stack_top (for shadowstack only)
 
-    # experimental operations in support of thread cloning, only
-    # implemented by the Mark&Sweep GC
-    'gc_x_swap_pool':       LLOp(canmallocgc=True),
-    'gc_x_clone':           LLOp(canraise=(RuntimeError,), canmallocgc=True),
-    'gc_x_size_header':     LLOp(),
-
     # for asmgcroot support to get the address of various static structures
     # see translator/c/src/mem.h for the valid indices
     'gc_asmgcroot_static':  LLOp(sideeffects=False),
diff --git a/pypy/rpython/lltypesystem/test/test_lloperation.py b/pypy/rpython/lltypesystem/test/test_lloperation.py
--- a/pypy/rpython/lltypesystem/test/test_lloperation.py
+++ b/pypy/rpython/lltypesystem/test/test_lloperation.py
@@ -144,6 +144,4 @@
     for opname, llop in LL_OPERATIONS.items():
         if llop.canrun:
             continue
-        if opname.startswith('gc_x_'):
-            continue   # ignore experimental stuff
         assert opname in LL_INTERP_OPERATIONS
diff --git a/pypy/rpython/memory/gc/base.py b/pypy/rpython/memory/gc/base.py
--- a/pypy/rpython/memory/gc/base.py
+++ b/pypy/rpython/memory/gc/base.py
@@ -145,13 +145,13 @@
             else:
                 malloc_varsize = self.malloc_varsize
             ref = malloc_varsize(typeid, length, size, itemsize,
-                                 offset_to_length, True)
+                                 offset_to_length)
         else:
             if zero or not hasattr(self, 'malloc_fixedsize'):
                 malloc_fixedsize = self.malloc_fixedsize_clear
             else:
                 malloc_fixedsize = self.malloc_fixedsize
-            ref = malloc_fixedsize(typeid, size, True, needs_finalizer,
+            ref = malloc_fixedsize(typeid, size, needs_finalizer,
                                    contains_weakptr)
         # lots of cast and reverse-cast around...
         return llmemory.cast_ptr_to_adr(ref)
diff --git a/pypy/rpython/memory/gc/generation.py b/pypy/rpython/memory/gc/generation.py
--- a/pypy/rpython/memory/gc/generation.py
+++ b/pypy/rpython/memory/gc/generation.py
@@ -166,9 +166,9 @@
                 return False
         return self.nursery <= addr < self.nursery_top
 
-    def malloc_fixedsize_clear(self, typeid, size, can_collect,
+    def malloc_fixedsize_clear(self, typeid, size,
                                has_finalizer=False, contains_weakptr=False):
-        if (has_finalizer or not can_collect or
+        if (has_finalizer or
             (raw_malloc_usage(size) > self.lb_young_fixedsize and
              raw_malloc_usage(size) > self.largest_young_fixedsize)):
             # ^^^ we do two size comparisons; the first one appears redundant,
@@ -178,7 +178,6 @@
             ll_assert(not contains_weakptr, "wrong case for mallocing weakref")
             # "non-simple" case or object too big: don't use the nursery
             return SemiSpaceGC.malloc_fixedsize_clear(self, typeid, size,
-                                                      can_collect,
                                                       has_finalizer,
                                                       contains_weakptr)
         size_gc_header = self.gcheaderbuilder.size_gc_header
@@ -195,7 +194,7 @@
         return llmemory.cast_adr_to_ptr(result+size_gc_header, llmemory.GCREF)
 
     def malloc_varsize_clear(self, typeid, length, size, itemsize,
-                             offset_to_length, can_collect):
+                             offset_to_length):
         # Only use the nursery if there are not too many items.
         if not raw_malloc_usage(itemsize):
             too_many_items = False
@@ -214,8 +213,7 @@
             maxlength = maxlength_for_minimal_nursery << self.nursery_scale
             too_many_items = length > maxlength
 
-        if (not can_collect or
-            too_many_items or
+        if (too_many_items or
             (raw_malloc_usage(size) > self.lb_young_var_basesize and
              raw_malloc_usage(size) > self.largest_young_var_basesize)):
             # ^^^ we do two size comparisons; the first one appears redundant,
@@ -223,8 +221,7 @@
             #     it almost always folds down to False, which kills the
             #     second comparison as well.
             return SemiSpaceGC.malloc_varsize_clear(self, typeid, length, size,
-                                                    itemsize, offset_to_length,
-                                                    can_collect)
+                                                    itemsize, offset_to_length)
         # with the above checks we know now that totalsize cannot be more
         # than about half of the nursery size; in particular, the + and *
         # cannot overflow
diff --git a/pypy/rpython/memory/gc/hybrid.py b/pypy/rpython/memory/gc/hybrid.py
--- a/pypy/rpython/memory/gc/hybrid.py
+++ b/pypy/rpython/memory/gc/hybrid.py
@@ -129,11 +129,7 @@
     # 'large'.
 
     def malloc_varsize_clear(self, typeid, length, size, itemsize,
-                             offset_to_length, can_collect):
-        if not can_collect:
-            return SemiSpaceGC.malloc_varsize_clear(self, typeid, length, size,
-                                                    itemsize, offset_to_length,
-                                                    can_collect)
+                             offset_to_length):
         size_gc_header = self.gcheaderbuilder.size_gc_header
         nonvarsize = size_gc_header + size
 
@@ -225,9 +221,9 @@
             totalsize)
         return result
 
-    def _check_rawsize_alloced(self, size_estimate, can_collect=True):
+    def _check_rawsize_alloced(self, size_estimate):
         self.large_objects_collect_trigger -= size_estimate
-        if can_collect and self.large_objects_collect_trigger < 0:
+        if self.large_objects_collect_trigger < 0:
             debug_start("gc-rawsize-collect")
             debug_print("allocated", (self._initial_trigger -
                                       self.large_objects_collect_trigger),
diff --git a/pypy/rpython/memory/gc/markcompact.py b/pypy/rpython/memory/gc/markcompact.py
--- a/pypy/rpython/memory/gc/markcompact.py
+++ b/pypy/rpython/memory/gc/markcompact.py
@@ -177,14 +177,14 @@
         return llmemory.cast_adr_to_ptr(result+size_gc_header, llmemory.GCREF)
     _setup_object._always_inline_ = True
 
-    def malloc_fixedsize(self, typeid16, size, can_collect,
+    def malloc_fixedsize(self, typeid16, size,
                          has_finalizer=False, contains_weakptr=False):
         size_gc_header = self.gcheaderbuilder.size_gc_header
         totalsize = size_gc_header + size
         result = self._get_memory(totalsize)
         return self._setup_object(result, typeid16, has_finalizer)
 
-    def malloc_fixedsize_clear(self, typeid16, size, can_collect,
+    def malloc_fixedsize_clear(self, typeid16, size,
                                has_finalizer=False, contains_weakptr=False):
         size_gc_header = self.gcheaderbuilder.size_gc_header
         totalsize = size_gc_header + size
@@ -193,7 +193,7 @@
         return self._setup_object(result, typeid16, has_finalizer)
 
     def malloc_varsize_clear(self, typeid16, length, size, itemsize,
-                             offset_to_length, can_collect):
+                             offset_to_length):
         size_gc_header = self.gcheaderbuilder.size_gc_header
         nonvarsize = size_gc_header + size
         totalsize = self._get_totalsize_var(nonvarsize, itemsize, length)
diff --git a/pypy/rpython/memory/gc/marksweep.py b/pypy/rpython/memory/gc/marksweep.py
--- a/pypy/rpython/memory/gc/marksweep.py
+++ b/pypy/rpython/memory/gc/marksweep.py
@@ -13,14 +13,14 @@
 
 import sys, os
 
-X_POOL = lltype.GcOpaqueType('gc.pool')
-X_POOL_PTR = lltype.Ptr(X_POOL)
-X_CLONE = lltype.GcStruct('CloneData', ('gcobjectptr', llmemory.GCREF),
-                                       ('pool',        X_POOL_PTR))
-X_CLONE_PTR = lltype.Ptr(X_CLONE)
+##X_POOL = lltype.GcOpaqueType('gc.pool')
+##X_POOL_PTR = lltype.Ptr(X_POOL)
+##X_CLONE = lltype.GcStruct('CloneData', ('gcobjectptr', llmemory.GCREF),
+##                                       ('pool',        X_POOL_PTR))
+##X_CLONE_PTR = lltype.Ptr(X_CLONE)
 
 FL_WITHHASH = 0x01
-FL_CURPOOL  = 0x02
+##FL_CURPOOL  = 0x02
 
 memoryError = MemoryError()
 class MarkSweepGC(GCBase):
@@ -92,10 +92,9 @@
     def write_free_statistics(self, typeid16, result):
         pass
 
-    def malloc_fixedsize(self, typeid16, size, can_collect,
+    def malloc_fixedsize(self, typeid16, size,
                          has_finalizer=False, contains_weakptr=False):
-        if can_collect:
-            self.maybe_collect()
+        self.maybe_collect()
         size_gc_header = self.gcheaderbuilder.size_gc_header
         try:
             tot_size = size_gc_header + size
@@ -128,10 +127,9 @@
         return llmemory.cast_adr_to_ptr(result, llmemory.GCREF)
     malloc_fixedsize._dont_inline_ = True
 
-    def malloc_fixedsize_clear(self, typeid16, size, can_collect,
+    def malloc_fixedsize_clear(self, typeid16, size,
                                has_finalizer=False, contains_weakptr=False):
-        if can_collect:
-            self.maybe_collect()
+        self.maybe_collect()
         size_gc_header = self.gcheaderbuilder.size_gc_header
         try:
             tot_size = size_gc_header + size
@@ -166,9 +164,8 @@
     malloc_fixedsize_clear._dont_inline_ = True
 
     def malloc_varsize(self, typeid16, length, size, itemsize,
-                       offset_to_length, can_collect):
-        if can_collect:
-            self.maybe_collect()
+                       offset_to_length):
+        self.maybe_collect()
         size_gc_header = self.gcheaderbuilder.size_gc_header
         try:
             fixsize = size_gc_header + size
@@ -200,9 +197,8 @@
     malloc_varsize._dont_inline_ = True
 
     def malloc_varsize_clear(self, typeid16, length, size, itemsize,
-                             offset_to_length, can_collect):
-        if can_collect:
-            self.maybe_collect()
+                             offset_to_length):
+        self.maybe_collect()
         size_gc_header = self.gcheaderbuilder.size_gc_header
         try:
             fixsize = size_gc_header + size
@@ -526,178 +522,10 @@
 
     # experimental support for thread cloning
     def x_swap_pool(self, newpool):
-        # Set newpool as the current pool (create one if newpool == NULL).
-        # All malloc'ed objects are put into the current pool;this is a
-        # way to separate objects depending on when they were allocated.
-        size_gc_header = self.gcheaderbuilder.size_gc_header
-        # invariant: each POOL GcStruct is at the _front_ of a linked list
-        # of malloced objects.
-        oldpool = self.curpool
-        #llop.debug_print(lltype.Void, 'x_swap_pool',
-        #                 lltype.cast_ptr_to_int(oldpool),
-        #                 lltype.cast_ptr_to_int(newpool))
-        if not oldpool:
-            # make a fresh pool object, which is automatically inserted at the
-            # front of the current list
-            oldpool = lltype.malloc(self.POOL)
-            addr = llmemory.cast_ptr_to_adr(oldpool)
-            addr -= size_gc_header
-            hdr = llmemory.cast_adr_to_ptr(addr, self.HDRPTR)
-            # put this new POOL object in the poolnodes list
-            node = lltype.malloc(self.POOLNODE, flavor="raw")
-            node.linkedlist = hdr
-            node.nextnode = self.poolnodes
-            self.poolnodes = node
-        else:
-            # manually insert oldpool at the front of the current list
-            addr = llmemory.cast_ptr_to_adr(oldpool)
-            addr -= size_gc_header
-            hdr = llmemory.cast_adr_to_ptr(addr, self.HDRPTR)
-            hdr.next = self.malloced_objects
-
-        newpool = lltype.cast_opaque_ptr(self.POOLPTR, newpool)
-        if newpool:
-            # newpool is at the front of the new linked list to install
-            addr = llmemory.cast_ptr_to_adr(newpool)
-            addr -= size_gc_header
-            hdr = llmemory.cast_adr_to_ptr(addr, self.HDRPTR)
-            self.malloced_objects = hdr.next
-            # invariant: now that objects in the hdr.next list are accessible
-            # through self.malloced_objects, make sure they are not accessible
-            # via poolnodes (which has a node pointing to newpool):
-            hdr.next = lltype.nullptr(self.HDR)
-        else:
-            # start a fresh new linked list
-            self.malloced_objects = lltype.nullptr(self.HDR)
-        self.curpool = newpool
-        return lltype.cast_opaque_ptr(X_POOL_PTR, oldpool)
+        raise NotImplementedError("old operation deprecated")
 
     def x_clone(self, clonedata):
-        # Recursively clone the gcobject and everything it points to,
-        # directly or indirectly -- but stops at objects that are not
-        # in the specified pool.  A new pool is built to contain the
-        # copies, and the 'gcobjectptr' and 'pool' fields of clonedata
-        # are adjusted to refer to the result.
-
-        # install a new pool into which all the mallocs go
-        curpool = self.x_swap_pool(lltype.nullptr(X_POOL))
-
-        size_gc_header = self.gcheaderbuilder.size_gc_header
-        oldobjects = self.AddressStack()
-        # if no pool specified, use the current pool as the 'source' pool
-        oldpool = clonedata.pool or curpool
-        oldpool = lltype.cast_opaque_ptr(self.POOLPTR, oldpool)
-        addr = llmemory.cast_ptr_to_adr(oldpool)
-        addr -= size_gc_header
-
-        hdr = llmemory.cast_adr_to_ptr(addr, self.HDRPTR)
-        hdr = hdr.next   # skip the POOL object itself
-        while hdr:
-            next = hdr.next
-            # mark all objects from malloced_list
-            hdr.flags = chr(ord(hdr.flags) | FL_CURPOOL)
-            hdr.next = lltype.nullptr(self.HDR)  # abused to point to the copy
-            oldobjects.append(llmemory.cast_ptr_to_adr(hdr))
-            hdr = next
-
-        # a stack of addresses of places that still points to old objects
-        # and that must possibly be fixed to point to a new copy
-        stack = self.AddressStack()
-        stack.append(llmemory.cast_ptr_to_adr(clonedata)
-                     + llmemory.offsetof(X_CLONE, 'gcobjectptr'))
-        while stack.non_empty():
-            gcptr_addr = stack.pop()
-            oldobj_addr = gcptr_addr.address[0]
-            if not oldobj_addr:
-                continue   # pointer is NULL
-            oldhdr = llmemory.cast_adr_to_ptr(oldobj_addr - size_gc_header,
-                                              self.HDRPTR)
-            if not (ord(oldhdr.flags) & FL_CURPOOL):
-                continue   # ignore objects that were not in the malloced_list
-            newhdr = oldhdr.next      # abused to point to the copy
-            if not newhdr:
-                typeid = oldhdr.typeid16
-                size = self.fixed_size(typeid)
-                # XXX! collect() at the beginning if the free heap is low
-                if self.is_varsize(typeid):
-                    itemsize = self.varsize_item_sizes(typeid)
-                    offset_to_length = self.varsize_offset_to_length(typeid)
-                    length = (oldobj_addr + offset_to_length).signed[0]
-                    newobj = self.malloc_varsize(typeid, length, size,
-                                                 itemsize, offset_to_length,
-                                                 False)
-                    size += length*itemsize
-                else:
-                    newobj = self.malloc_fixedsize(typeid, size, False)
-                    length = -1
-
-                newobj_addr = llmemory.cast_ptr_to_adr(newobj)
-
-                #llop.debug_print(lltype.Void, 'clone',
-                #                 llmemory.cast_adr_to_int(oldobj_addr),
-                #                 '->', llmemory.cast_adr_to_int(newobj_addr),
-                #                 'typeid', typeid,
-                #                 'length', length)
-
-                newhdr_addr = newobj_addr - size_gc_header
-                newhdr = llmemory.cast_adr_to_ptr(newhdr_addr, self.HDRPTR)
-
-                saved_id   = newhdr.typeid16  # XXX hack needed for genc
-                saved_flg1 = newhdr.mark
-                saved_flg2 = newhdr.flags
-                saved_next = newhdr.next      # where size_gc_header == 0
-                raw_memcopy(oldobj_addr, newobj_addr, size)
-                newhdr.typeid16 = saved_id
-                newhdr.mark     = saved_flg1
-                newhdr.flags    = saved_flg2
-                newhdr.next     = saved_next
-
-                offsets = self.offsets_to_gc_pointers(typeid)
-                i = 0
-                while i < len(offsets):
-                    pointer_addr = newobj_addr + offsets[i]
-                    stack.append(pointer_addr)
-                    i += 1
-
-                if length > 0:
-                    offsets = self.varsize_offsets_to_gcpointers_in_var_part(
-                        typeid)
-                    itemlength = self.varsize_item_sizes(typeid)
-                    offset = self.varsize_offset_to_variable_part(typeid)
-                    itembaseaddr = newobj_addr + offset
-                    i = 0
-                    while i < length:
-                        item = itembaseaddr + itemlength * i
-                        j = 0
-                        while j < len(offsets):
-                            pointer_addr = item + offsets[j]
-                            stack.append(pointer_addr)
-                            j += 1
-                        i += 1
-
-                oldhdr.next = newhdr
-            newobj_addr = llmemory.cast_ptr_to_adr(newhdr) + size_gc_header
-            gcptr_addr.address[0] = newobj_addr
-        stack.delete()
-
-        # re-create the original linked list
-        next = lltype.nullptr(self.HDR)
-        while oldobjects.non_empty():
-            hdr = llmemory.cast_adr_to_ptr(oldobjects.pop(), self.HDRPTR)
-            hdr.flags = chr(ord(hdr.flags) &~ FL_CURPOOL)  # reset the flag
-            hdr.next = next
-            next = hdr
-        oldobjects.delete()
-
-        # consistency check
-        addr = llmemory.cast_ptr_to_adr(oldpool)
-        addr -= size_gc_header
-        hdr = llmemory.cast_adr_to_ptr(addr, self.HDRPTR)
-        assert hdr.next == next
-
-        # build the new pool object collecting the new objects, and
-        # reinstall the pool that was current at the beginning of x_clone()
-        clonedata.pool = self.x_swap_pool(curpool)
+        raise NotImplementedError("old operation deprecated")
 
     def identityhash(self, obj):
         obj = llmemory.cast_ptr_to_adr(obj)
diff --git a/pypy/rpython/memory/gc/minimark.py b/pypy/rpython/memory/gc/minimark.py
--- a/pypy/rpython/memory/gc/minimark.py
+++ b/pypy/rpython/memory/gc/minimark.py
@@ -450,9 +450,8 @@
             debug_stop("gc-debug")
 
 
-    def malloc_fixedsize_clear(self, typeid, size, can_collect=True,
+    def malloc_fixedsize_clear(self, typeid, size,
                                needs_finalizer=False, contains_weakptr=False):
-        ll_assert(can_collect, "!can_collect")
         size_gc_header = self.gcheaderbuilder.size_gc_header
         totalsize = size_gc_header + size
         rawtotalsize = raw_malloc_usage(totalsize)
@@ -501,8 +500,7 @@
 
 
     def malloc_varsize_clear(self, typeid, length, size, itemsize,
-                             offset_to_length, can_collect):
-        ll_assert(can_collect, "!can_collect")
+                             offset_to_length):
         size_gc_header = self.gcheaderbuilder.size_gc_header
         nonvarsize = size_gc_header + size
         #
diff --git a/pypy/rpython/memory/gc/semispace.py b/pypy/rpython/memory/gc/semispace.py
--- a/pypy/rpython/memory/gc/semispace.py
+++ b/pypy/rpython/memory/gc/semispace.py
@@ -92,14 +92,12 @@
     # This class only defines the malloc_{fixed,var}size_clear() methods
     # because the spaces are filled with zeroes in advance.
 
-    def malloc_fixedsize_clear(self, typeid16, size, can_collect,
+    def malloc_fixedsize_clear(self, typeid16, size,
                                has_finalizer=False, contains_weakptr=False):
         size_gc_header = self.gcheaderbuilder.size_gc_header
         totalsize = size_gc_header + size
         result = self.free
         if raw_malloc_usage(totalsize) > self.top_of_space - result:
-            if not can_collect:
-                raise memoryError
             result = self.obtain_free_space(totalsize)
         llarena.arena_reserve(result, totalsize)
         self.init_gc_object(result, typeid16)
@@ -111,7 +109,7 @@
         return llmemory.cast_adr_to_ptr(result+size_gc_header, llmemory.GCREF)
 
     def malloc_varsize_clear(self, typeid16, length, size, itemsize,
-                             offset_to_length, can_collect):
+                             offset_to_length):
         size_gc_header = self.gcheaderbuilder.size_gc_header
         nonvarsize = size_gc_header + size
         try:
@@ -121,8 +119,6 @@
             raise memoryError
         result = self.free
         if raw_malloc_usage(totalsize) > self.top_of_space - result:
-            if not can_collect:
-                raise memoryError
             result = self.obtain_free_space(totalsize)
         llarena.arena_reserve(result, totalsize)
         self.init_gc_object(result, typeid16)
diff --git a/pypy/rpython/memory/gctransform/framework.py b/pypy/rpython/memory/gctransform/framework.py
--- a/pypy/rpython/memory/gctransform/framework.py
+++ b/pypy/rpython/memory/gctransform/framework.py
@@ -50,7 +50,7 @@
     def analyze_simple_operation(self, op, graphinfo):
         if op.opname in ('malloc', 'malloc_varsize'):
             flags = op.args[1].value
-            return flags['flavor'] == 'gc' and not flags.get('nocollect', False)
+            return flags['flavor'] == 'gc'
         else:
             return (op.opname in LL_OPERATIONS and
                     LL_OPERATIONS[op.opname].canmallocgc)
@@ -265,7 +265,7 @@
             malloc_fixedsize_clear_meth,
             [s_gc, s_typeid16,
              annmodel.SomeInteger(nonneg=True),
-             annmodel.SomeBool(), annmodel.SomeBool(),
+             annmodel.SomeBool(),
              annmodel.SomeBool()], s_gcref,
             inline = False)
         if hasattr(GCClass, 'malloc_fixedsize'):
@@ -274,7 +274,7 @@
                 malloc_fixedsize_meth,
                 [s_gc, s_typeid16,
                  annmodel.SomeInteger(nonneg=True),
-                 annmodel.SomeBool(), annmodel.SomeBool(),
+                 annmodel.SomeBool(),
                  annmodel.SomeBool()], s_gcref,
                 inline = False)
         else:
@@ -283,12 +283,11 @@
 ##         self.malloc_varsize_ptr = getfn(
 ##             GCClass.malloc_varsize.im_func,
 ##             [s_gc] + [annmodel.SomeInteger(nonneg=True) for i in range(5)]
-##             + [annmodel.SomeBool(), annmodel.SomeBool()], s_gcref)
+##             + [annmodel.SomeBool()], s_gcref)
         self.malloc_varsize_clear_ptr = getfn(
             GCClass.malloc_varsize_clear.im_func,
             [s_gc, s_typeid16]
-            + [annmodel.SomeInteger(nonneg=True) for i in range(4)]
-            + [annmodel.SomeBool()], s_gcref)
+            + [annmodel.SomeInteger(nonneg=True) for i in range(4)], s_gcref)
         self.collect_ptr = getfn(GCClass.collect.im_func,
             [s_gc, annmodel.SomeInteger()], annmodel.s_None)
         self.can_move_ptr = getfn(GCClass.can_move.im_func,
@@ -342,13 +341,11 @@
                 malloc_fast_meth,
                 "malloc_fast")
             s_False = annmodel.SomeBool(); s_False.const = False
-            s_True  = annmodel.SomeBool(); s_True .const = True
             self.malloc_fast_ptr = getfn(
                 malloc_fast,
                 [s_gc, s_typeid16,
                  annmodel.SomeInteger(nonneg=True),
-                 s_True, s_False,
-                 s_False], s_gcref,
+                 s_False, s_False], s_gcref,
                 inline = True)
         else:
             self.malloc_fast_ptr = None
@@ -362,15 +359,13 @@
                 GCClass.malloc_varsize_clear.im_func,
                 "malloc_varsize_clear_fast")
             s_False = annmodel.SomeBool(); s_False.const = False
-            s_True  = annmodel.SomeBool(); s_True .const = True
             self.malloc_varsize_clear_fast_ptr = getfn(
                 malloc_varsize_clear_fast,
                 [s_gc, s_typeid16,
                  annmodel.SomeInteger(nonneg=True),
                  annmodel.SomeInteger(nonneg=True),
                  annmodel.SomeInteger(nonneg=True),
-                 annmodel.SomeInteger(nonneg=True),
-                 s_True], s_gcref,
+                 annmodel.SomeInteger(nonneg=True)], s_gcref,
                 inline = True)
         else:
             self.malloc_varsize_clear_fast_ptr = None
@@ -479,20 +474,6 @@
                                     [s_gc, annmodel.SomeInteger()],
                                     annmodel.SomeInteger())
 
-        # experimental gc_x_* operations
-        s_x_pool  = annmodel.SomePtr(marksweep.X_POOL_PTR)
-        s_x_clone = annmodel.SomePtr(marksweep.X_CLONE_PTR)
-        # the x_*() methods use some regular mallocs that must be
-        # transformed in the normal way
-        self.x_swap_pool_ptr = getfn(GCClass.x_swap_pool.im_func,
-                                     [s_gc, s_x_pool],
-                                     s_x_pool,
-                                     minimal_transform = False)
-        self.x_clone_ptr = getfn(GCClass.x_clone.im_func,
-                                 [s_gc, s_x_clone],
-                                 annmodel.s_None,
-                                 minimal_transform = False)
-
         # thread support
         if translator.config.translation.thread:
             root_walker.need_thread_support(self, getfn)
@@ -670,7 +651,6 @@
     def gct_fv_gc_malloc(self, hop, flags, TYPE, *args):
         op = hop.spaceop
         flavor = flags['flavor']
-        c_can_collect = rmodel.inputconst(lltype.Bool, not flags.get('nocollect', False))
 
         PTRTYPE = op.result.concretetype
         assert PTRTYPE.TO == TYPE
@@ -686,14 +666,14 @@
             #malloc_ptr = self.malloc_fixedsize_ptr
             zero = flags.get('zero', False)
             if (self.malloc_fast_ptr is not None and
-                c_can_collect.value and not c_has_finalizer.value and
+                not c_has_finalizer.value and
                 (self.malloc_fast_is_clearing or not zero)):
                 malloc_ptr = self.malloc_fast_ptr
             elif zero:
                 malloc_ptr = self.malloc_fixedsize_clear_ptr
             else:
                 malloc_ptr = self.malloc_fixedsize_ptr
-            args = [self.c_const_gc, c_type_id, c_size, c_can_collect,
+            args = [self.c_const_gc, c_type_id, c_size,
                     c_has_finalizer, rmodel.inputconst(lltype.Bool, False)]
         else:
             assert not c_has_finalizer.value
@@ -706,17 +686,15 @@
             if flags.get('nonmovable') and self.malloc_varsize_nonmovable_ptr:
                 # we don't have tests for such cases, let's fail
                 # explicitely
-                assert c_can_collect.value
                 malloc_ptr = self.malloc_varsize_nonmovable_ptr
                 args = [self.c_const_gc, c_type_id, v_length]
             else:
-                if (self.malloc_varsize_clear_fast_ptr is not None and
-                    c_can_collect.value):
+                if self.malloc_varsize_clear_fast_ptr is not None:
                     malloc_ptr = self.malloc_varsize_clear_fast_ptr
                 else:
                     malloc_ptr = self.malloc_varsize_clear_ptr
                 args = [self.c_const_gc, c_type_id, v_length, c_size,
-                        c_varitemsize, c_ofstolength, c_can_collect]
+                        c_varitemsize, c_ofstolength]
         livevars = self.push_roots(hop)
         v_result = hop.genop("direct_call", [malloc_ptr] + args,
                              resulttype=llmemory.GCREF)
@@ -808,36 +786,21 @@
         hop.genop('adr_add', [v_gcdata_adr, c_ofs], resultvar=op.result)
 
     def gct_gc_x_swap_pool(self, hop):
-        op = hop.spaceop
-        [v_malloced] = op.args
-        hop.genop("direct_call",
-                  [self.x_swap_pool_ptr, self.c_const_gc, v_malloced],
-                  resultvar=op.result)
-
+        raise NotImplementedError("old operation deprecated")
     def gct_gc_x_clone(self, hop):
-        op = hop.spaceop
-        [v_clonedata] = op.args
-        hop.genop("direct_call",
-                  [self.x_clone_ptr, self.c_const_gc, v_clonedata],
-                  resultvar=op.result)
-
+        raise NotImplementedError("old operation deprecated")
     def gct_gc_x_size_header(self, hop):
-        op = hop.spaceop
-        c_result = rmodel.inputconst(lltype.Signed,
-                                     self.gcdata.gc.size_gc_header())
-        hop.genop("same_as",
-                  [c_result],
-                  resultvar=op.result)
+        raise NotImplementedError("old operation deprecated")
 
     def gct_do_malloc_fixedsize_clear(self, hop):
         # used by the JIT (see pypy.jit.backend.llsupport.gc)
         op = hop.spaceop
-        [v_typeid, v_size, v_can_collect,
+        [v_typeid, v_size,
          v_has_finalizer, v_contains_weakptr] = op.args
         livevars = self.push_roots(hop)
         hop.genop("direct_call",
                   [self.malloc_fixedsize_clear_ptr, self.c_const_gc,
-                   v_typeid, v_size, v_can_collect,
+                   v_typeid, v_size,
                    v_has_finalizer, v_contains_weakptr],
                   resultvar=op.result)
         self.pop_roots(hop, livevars)
@@ -846,12 +809,12 @@
         # used by the JIT (see pypy.jit.backend.llsupport.gc)
         op = hop.spaceop
         [v_typeid, v_length, v_size, v_itemsize,
-         v_offset_to_length, v_can_collect] = op.args
+         v_offset_to_length] = op.args
         livevars = self.push_roots(hop)
         hop.genop("direct_call",
                   [self.malloc_varsize_clear_ptr, self.c_const_gc,
                    v_typeid, v_length, v_size, v_itemsize,
-                   v_offset_to_length, v_can_collect],
+                   v_offset_to_length],
                   resultvar=op.result)
         self.pop_roots(hop, livevars)
 
@@ -899,8 +862,8 @@
         c_size = rmodel.inputconst(lltype.Signed, info.fixedsize)
         malloc_ptr = self.malloc_fixedsize_ptr
         c_has_finalizer = rmodel.inputconst(lltype.Bool, False)
-        c_has_weakptr = c_can_collect = rmodel.inputconst(lltype.Bool, True)
-        args = [self.c_const_gc, c_type_id, c_size, c_can_collect,
+        c_has_weakptr = rmodel.inputconst(lltype.Bool, True)
+        args = [self.c_const_gc, c_type_id, c_size,
                 c_has_finalizer, c_has_weakptr]
 
         # push and pop the current live variables *including* the argument
diff --git a/pypy/rpython/memory/test/test_transformed_gc.py b/pypy/rpython/memory/test/test_transformed_gc.py
--- a/pypy/rpython/memory/test/test_transformed_gc.py
+++ b/pypy/rpython/memory/test/test_transformed_gc.py
@@ -7,7 +7,6 @@
 from pypy.rpython.lltypesystem import lltype, llmemory, llarena, rffi, llgroup
 from pypy.rpython.memory.gctransform import framework
 from pypy.rpython.lltypesystem.lloperation import llop, void
-from pypy.rpython.memory.gc.marksweep import X_CLONE, X_POOL, X_POOL_PTR
 from pypy.rlib.objectmodel import compute_unique_id, we_are_translated
 from pypy.rlib.debug import ll_assert
 from pypy.rlib import rgc
@@ -18,15 +17,13 @@
 WORD = LONG_BIT // 8
 
 
-def rtype(func, inputtypes, specialize=True, gcname='ref', stacklessgc=False,
+def rtype(func, inputtypes, specialize=True, gcname='ref',
           backendopt=False, **extraconfigopts):
     from pypy.translator.translator import TranslationContext
     t = TranslationContext()
     # XXX XXX XXX mess
     t.config.translation.gc = gcname
     t.config.translation.gcremovetypeptr = True
-    if stacklessgc:
-        t.config.translation.gcrootfinder = "stackless"
     t.config.set(**extraconfigopts)
     ann = t.buildannotator(policy=annpolicy.StrictAnnotatorPolicy())
     ann.build_types(func, inputtypes)
@@ -44,7 +41,6 @@
 
 class GCTest(object):
     gcpolicy = None
-    stacklessgc = False
     GC_CAN_MOVE = False
     GC_CAN_MALLOC_NONMOVABLE = True
     taggedpointers = False
@@ -103,7 +99,6 @@
 
         s_args = annmodel.SomePtr(lltype.Ptr(ARGS))
         t = rtype(entrypoint, [s_args], gcname=cls.gcname,
-                  stacklessgc=cls.stacklessgc,
                   taggedpointers=cls.taggedpointers)
 
         for fixup in mixlevelstuff:
@@ -777,7 +772,6 @@
                 if op.opname == 'do_malloc_fixedsize_clear':
                     op.args = [Constant(type_id, llgroup.HALFWORD),
                                Constant(llmemory.sizeof(P), lltype.Signed),
-                               Constant(True, lltype.Bool),  # can_collect
                                Constant(False, lltype.Bool), # has_finalizer
                                Constant(False, lltype.Bool)] # contains_weakptr
                     break
@@ -814,7 +808,6 @@
                 if op.opname == 'do_malloc_fixedsize_clear':
                     op.args = [Constant(type_id, llgroup.HALFWORD),
                                Constant(llmemory.sizeof(P), lltype.Signed),
-                               Constant(True, lltype.Bool),  # can_collect
                                Constant(False, lltype.Bool), # has_finalizer
                                Constant(False, lltype.Bool)] # contains_weakptr
                     break
@@ -910,234 +903,6 @@
             root_stack_depth = 200
 
 
-    def define_cloning(cls):
-        B = lltype.GcStruct('B', ('x', lltype.Signed))
-        A = lltype.GcStruct('A', ('b', lltype.Ptr(B)),
-                                 ('unused', lltype.Ptr(B)))
-        def make(n):
-            b = lltype.malloc(B)
-            b.x = n
-            a = lltype.malloc(A)
-            a.b = b
-            return a
-        def func():
-            a1 = make(111)
-            # start recording mallocs in a new pool
-            oldpool = llop.gc_x_swap_pool(X_POOL_PTR, lltype.nullptr(X_POOL))
-            # the following a2 goes into the new list
-            a2 = make(222)
-            # now put the old pool back and get the new pool
-            newpool = llop.gc_x_swap_pool(X_POOL_PTR, oldpool)
-            a3 = make(333)
-            # clone a2
-            a2ref = lltype.cast_opaque_ptr(llmemory.GCREF, a2)
-            clonedata = lltype.malloc(X_CLONE)
-            clonedata.gcobjectptr = a2ref
-            clonedata.pool = newpool
-            llop.gc_x_clone(lltype.Void, clonedata)
-            a2copyref = clonedata.gcobjectptr
-            a2copy = lltype.cast_opaque_ptr(lltype.Ptr(A), a2copyref)
-            a2copy.b.x = 444
-            return a1.b.x * 1000000 + a2.b.x * 1000 + a3.b.x
-
-        return func
-
-    def test_cloning(self):
-        run = self.runner("cloning")
-        res = run([])
-        assert res == 111222333
-
-    def define_cloning_varsize(cls):
-        B = lltype.GcStruct('B', ('x', lltype.Signed))
-        A = lltype.GcStruct('A', ('b', lltype.Ptr(B)),
-                                 ('more', lltype.Array(lltype.Ptr(B))))
-        def make(n):
-            b = lltype.malloc(B)
-            b.x = n
-            a = lltype.malloc(A, 2)
-            a.b = b
-            a.more[0] = lltype.malloc(B)
-            a.more[0].x = n*10
-            a.more[1] = lltype.malloc(B)
-            a.more[1].x = n*10+1
-            return a
-        def func():
-            oldpool = llop.gc_x_swap_pool(X_POOL_PTR, lltype.nullptr(X_POOL))
-            a2 = make(22)
-            newpool = llop.gc_x_swap_pool(X_POOL_PTR, oldpool)
-            # clone a2
-            a2ref = lltype.cast_opaque_ptr(llmemory.GCREF, a2)
-            clonedata = lltype.malloc(X_CLONE)
-            clonedata.gcobjectptr = a2ref
-            clonedata.pool = newpool
-            llop.gc_x_clone(lltype.Void, clonedata)
-            a2copyref = clonedata.gcobjectptr
-            a2copy = lltype.cast_opaque_ptr(lltype.Ptr(A), a2copyref)
-            a2copy.b.x = 44
-            a2copy.more[0].x = 440
-            a2copy.more[1].x = 441
-            return a2.b.x * 1000000 + a2.more[0].x * 1000 + a2.more[1].x
-
-        return func
-
-    def test_cloning_varsize(self):
-        run = self.runner("cloning_varsize")
-        res = run([])
-        assert res == 22220221
-
-    def define_cloning_highlevel(cls):
-        class A:
-            pass
-        class B(A):
-            pass
-        def func(n, dummy):
-            if n > 5:
-                x = A()
-            else:
-                x = B()
-                x.bvalue = 123
-            x.next = A()
-            x.next.next = x
-            y, newpool = rgc.gc_clone(x, None)
-            assert y is not x
-            assert y.next is not x
-            assert y is not x.next
-            assert y.next is not x.next
-            assert y is not y.next
-            assert y is y.next.next
-            if isinstance(y, B):
-                assert n <= 5
-                assert y.bvalue == 123
-            else:
-                assert n > 5
-            return 1
-
-        return func
-
-    def test_cloning_highlevel(self):
-        run = self.runner("cloning_highlevel")
-        res = run([3, 0])
-        assert res == 1
-        res = run([7, 0])
-        assert res == 1
-
-    def define_cloning_highlevel_varsize(cls):
-        class A:
-            pass
-        def func(n, dummy):
-            lst = [A() for i in range(n)]
-            for a in lst:
-                a.value = 1
-            lst2, newpool = rgc.gc_clone(lst, None)
-            for i in range(n):
-                a = A()
-                a.value = i
-                lst.append(a)
-                lst[i].value = 4 + i
-                lst2[i].value = 7 + i
-
-            n = 0
-            for a in lst:
-                n = n*10 + a.value
-            for a in lst2:
-                n = n*10 + a.value
-            return n
-
-        return func
-
-    def test_cloning_highlevel_varsize(self):
-        run = self.runner("cloning_highlevel_varsize")
-        res = run([3, 0])
-        assert res == 456012789
-
-    def define_tree_cloning(cls):
-        import os
-        # this makes a tree of calls.  Each leaf stores its path (a linked
-        # list) in 'result'.  Paths are mutated in-place but the leaves don't
-        # see each other's mutations because of x_clone.
-        STUFF = lltype.FixedSizeArray(lltype.Signed, 21)
-        NODE = lltype.GcForwardReference()
-        NODE.become(lltype.GcStruct('node', ('index', lltype.Signed),
-                                            ('counter', lltype.Signed),
-                                            ('next', lltype.Ptr(NODE)),
-                                            ('use_some_space', STUFF)))
-        PATHARRAY = lltype.GcArray(lltype.Ptr(NODE))
-        clonedata = lltype.malloc(X_CLONE)
-
-        def clone(node):
-            # that's for testing if the test is correct...
-            if not node:
-                return node
-            newnode = lltype.malloc(NODE)
-            newnode.index = node.index
-            newnode.counter = node.counter
-            newnode.next = clone(node.next)
-            return newnode
-
-        def do_call(result, path, index, remaining_depth):
-            # clone the while path
-            clonedata.gcobjectptr = lltype.cast_opaque_ptr(llmemory.GCREF,
-                                                           path)
-            clonedata.pool = lltype.nullptr(X_POOL)
-            llop.gc_x_clone(lltype.Void, clonedata)
-            # install the new pool as the current one
-            parentpool = llop.gc_x_swap_pool(X_POOL_PTR, clonedata.pool)
-            path = lltype.cast_opaque_ptr(lltype.Ptr(NODE),
-                                          clonedata.gcobjectptr)
-
-            # The above should have the same effect as:
-            #    path = clone(path)
-
-            # bump all the path node counters by one
-            p = path
-            while p:
-                p.counter += 1
-                p = p.next
-
-            if remaining_depth == 0:
-                llop.debug_print(lltype.Void, "setting", index, "with", path)
-                result[index] = path   # leaf
-            else:
-                node = lltype.malloc(NODE)
-                node.index = index * 2
-                node.counter = 0
-                node.next = path
-                do_call(result, node, index * 2, remaining_depth - 1)
-                node.index += 1    # mutation!
-                do_call(result, node, index * 2 + 1, remaining_depth - 1)
-
-            # restore the parent pool
-            llop.gc_x_swap_pool(X_POOL_PTR, parentpool)
-
-        def check(path, index, level, depth):
-            if level == depth:
-                assert index == 0
-                assert not path
-            else:
-                assert path.index == index
-                assert path.counter == level + 1
-                check(path.next, index >> 1, level + 1, depth)
-
-        def func(depth, dummy):
-            result = lltype.malloc(PATHARRAY, 1 << depth)
-            os.write(2, 'building tree... ')
-            do_call(result, lltype.nullptr(NODE), 0, depth)
-            os.write(2, 'checking tree... ')
-            #from pypy.rpython.lltypesystem.lloperation import llop
-            #llop.debug_view(lltype.Void, result,
-            #                llop.gc_x_size_header(lltype.Signed))
-            for i in range(1 << depth):
-                check(result[i], i, 0, depth)
-            os.write(2, 'ok\n')
-            return 1
-        return func
-
-    def test_tree_cloning(self):
-        run = self.runner("tree_cloning")
-        res = run([3, 0])
-        assert res == 1
-
-
 class TestPrintingGC(GenericGCTests):
     gcname = "statistics"
 
diff --git a/pypy/translator/c/test/test_boehm.py b/pypy/translator/c/test/test_boehm.py
--- a/pypy/translator/c/test/test_boehm.py
+++ b/pypy/translator/c/test/test_boehm.py
@@ -17,7 +17,6 @@
 
 class AbstractGCTestClass(object):
     gcpolicy = "boehm"
-    stacklessgc = False
     use_threads = False
    
     # deal with cleanups
@@ -34,8 +33,6 @@
         config = get_pypy_config(translating=True)
         config.translation.gc = self.gcpolicy
         config.translation.thread = self.use_threads
-        if self.stacklessgc:
-            config.translation.gcrootfinder = "stackless"
         config.translation.simplifying = True
         t = TranslationContext(config=config)
         self.t = t


More information about the pypy-commit mailing list