Author: Maciej Fijalkowski <[email protected]>
Branch: gc_no_cleanup_nursery
Changeset: r73465:3bb2c92cc2d3
Date: 2014-09-11 11:36 -0600
http://bitbucket.org/pypy/pypy/changeset/3bb2c92cc2d3/

Log:    Backed out changeset 6dfd216b0e8d

diff --git a/rpython/jit/backend/llgraph/runner.py 
b/rpython/jit/backend/llgraph/runner.py
--- a/rpython/jit/backend/llgraph/runner.py
+++ b/rpython/jit/backend/llgraph/runner.py
@@ -630,17 +630,17 @@
 
     def bh_new(self, sizedescr):
         return lltype.cast_opaque_ptr(llmemory.GCREF,
-                                      lltype.malloc(sizedescr.S, zero=True))
+                                      lltype.malloc(sizedescr.S))
 
     def bh_new_with_vtable(self, vtable, descr):
-        result = lltype.malloc(descr.S, zero=True)
+        result = lltype.malloc(descr.S)
         result_as_objptr = lltype.cast_pointer(rclass.OBJECTPTR, result)
         result_as_objptr.typeptr = support.cast_from_int(rclass.CLASSTYPE,
                                                          vtable)
         return lltype.cast_opaque_ptr(llmemory.GCREF, result)
 
     def bh_new_array(self, length, arraydescr):
-        array = lltype.malloc(arraydescr.A, length, zero=True)
+        array = lltype.malloc(arraydescr.A, length)
         return lltype.cast_opaque_ptr(llmemory.GCREF, array)
 
     def bh_classof(self, struct):
diff --git a/rpython/jit/backend/llsupport/descr.py 
b/rpython/jit/backend/llsupport/descr.py
--- a/rpython/jit/backend/llsupport/descr.py
+++ b/rpython/jit/backend/llsupport/descr.py
@@ -35,11 +35,9 @@
     size = 0      # help translation
     tid = llop.combine_ushort(lltype.Signed, 0, 0)
 
-    def __init__(self, size, count_fields_if_immut=-1,
-                 offsets_of_gcptrs=None):
+    def __init__(self, size, count_fields_if_immut=-1):
         self.size = size
         self.count_fields_if_immut = count_fields_if_immut
-        self.offsets_of_gcptrs = offsets_of_gcptrs
 
     def count_fields_if_immutable(self):
         return self.count_fields_if_immut
@@ -60,13 +58,10 @@
     except KeyError:
         size = symbolic.get_size(STRUCT, gccache.translate_support_code)
         count_fields_if_immut = heaptracker.count_fields_if_immutable(STRUCT)
-        offsets_of_gcptrs = heaptracker.offsets_of_gcptrs(gccache, STRUCT)
         if heaptracker.has_gcstruct_a_vtable(STRUCT):
-            sizedescr = SizeDescrWithVTable(size, count_fields_if_immut,
-                                            offsets_of_gcptrs)
+            sizedescr = SizeDescrWithVTable(size, count_fields_if_immut)
         else:
-            sizedescr = SizeDescr(size, count_fields_if_immut,
-                                  offsets_of_gcptrs)
+            sizedescr = SizeDescr(size, count_fields_if_immut)
         gccache.init_size_descr(STRUCT, sizedescr)
         cache[STRUCT] = sizedescr
         return sizedescr
diff --git a/rpython/jit/backend/llsupport/test/test_descr.py 
b/rpython/jit/backend/llsupport/test/test_descr.py
--- a/rpython/jit/backend/llsupport/test/test_descr.py
+++ b/rpython/jit/backend/llsupport/test/test_descr.py
@@ -15,9 +15,6 @@
                              ('y', lltype.Ptr(T)))
     descr_s = get_size_descr(c0, S)
     descr_t = get_size_descr(c0, T)
-    assert descr_t.offsets_of_gcptrs == []
-    assert descr_s.offsets_of_gcptrs == [
-        symbolic.get_field_token(S, "y", False)[0]]
     assert descr_s.size == symbolic.get_size(S, False)
     assert descr_t.size == symbolic.get_size(T, False)
     assert descr_s.count_fields_if_immutable() == -1
diff --git a/rpython/jit/codewriter/heaptracker.py 
b/rpython/jit/codewriter/heaptracker.py
--- a/rpython/jit/codewriter/heaptracker.py
+++ b/rpython/jit/codewriter/heaptracker.py
@@ -1,6 +1,5 @@
 from rpython.rtyper.lltypesystem import lltype, llmemory, rclass
 from rpython.rlib.objectmodel import we_are_translated
-from rpython.jit.backend.llsupport import symbolic
 
 
 def adr2int(addr):
@@ -126,16 +125,3 @@
     vtable = descr.as_vtable_size_descr()._corresponding_vtable
     vtable = llmemory.cast_ptr_to_adr(vtable)
     return adr2int(vtable)
-
-def offsets_of_gcptrs(gccache, STRUCT, res=None):
-    if res is None:
-        res = []
-    for name, FIELD in STRUCT._flds.iteritems():
-        if isinstance(FIELD, lltype.Ptr) and FIELD._needsgc():
-            
-            offset, _ = symbolic.get_field_token(STRUCT, name,
-                                        gccache.translate_support_code)
-            res.append(offset)
-        elif isinstance(FIELD, lltype.Struct):
-            offsets_of_gcptrs(gccache, FIELD, res)
-    return res
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to