Author: Armin Rigo <ar...@tunes.org>
Branch: stmgc-c7
Changeset: r69754:acd1f927bb36
Date: 2014-03-06 11:28 +0100
http://bitbucket.org/pypy/pypy/changeset/acd1f927bb36/

Log:    Hack hack

diff --git a/rpython/memory/gctransform/framework.py 
b/rpython/memory/gctransform/framework.py
--- a/rpython/memory/gctransform/framework.py
+++ b/rpython/memory/gctransform/framework.py
@@ -191,19 +191,9 @@
             # run-time teardown code for tests!
             gcdata.gc._teardown()
 
-        bk = self.translator.annotator.bookkeeper
         r_typeid16 = rffi.platform.numbertype_to_rclass[TYPE_ID]
         s_typeid16 = annmodel.SomeInteger(knowntype=r_typeid16)
 
-        # the point of this little dance is to not annotate
-        # self.gcdata.static_root_xyz as constants. XXX is it still needed??
-        data_classdef = bk.getuniqueclassdef(gctypelayout.GCData)
-        data_classdef.generalize_attr('static_root_start', SomeAddress())
-        data_classdef.generalize_attr('static_root_nongcend', SomeAddress())
-        data_classdef.generalize_attr('static_root_end', SomeAddress())
-        data_classdef.generalize_attr('max_type_id', annmodel.SomeInteger())
-        data_classdef.generalize_attr('typeids_z', SomeAddress())
-
         annhelper = annlowlevel.MixLevelHelperAnnotator(self.translator.rtyper)
 
         def getfn(ll_function, args_s, s_result, inline=False,
@@ -227,6 +217,7 @@
         self.weakref_deref_ptr = self.inittime_helper(
             ll_weakref_deref, [llmemory.WeakRefPtr], llmemory.Address)
 
+        bk = self.translator.annotator.bookkeeper
         classdef = bk.getuniqueclassdef(GCClass)
         s_gc = annmodel.SomeInstance(classdef)
 
@@ -272,6 +263,16 @@
         from rpython.memory.gc.base import ARRAY_TYPEID_MAP
         from rpython.memory.gc import inspector
 
+        # the point of this little dance is to not annotate
+        # self.gcdata.static_root_xyz as constants. XXX is it still needed??
+        bk = self.translator.annotator.bookkeeper
+        data_classdef = bk.getuniqueclassdef(gctypelayout.GCData)
+        data_classdef.generalize_attr('static_root_start', SomeAddress())
+        data_classdef.generalize_attr('static_root_nongcend', SomeAddress())
+        data_classdef.generalize_attr('static_root_end', SomeAddress())
+        data_classdef.generalize_attr('max_type_id', annmodel.SomeInteger())
+        data_classdef.generalize_attr('typeids_z', SomeAddress())
+
         s_gcref = SomePtr(llmemory.GCREF)
         gcdata = self.gcdata
         translator = self.translator
diff --git a/rpython/memory/gctransform/stmframework.py 
b/rpython/memory/gctransform/stmframework.py
--- a/rpython/memory/gctransform/stmframework.py
+++ b/rpython/memory/gctransform/stmframework.py
@@ -38,6 +38,10 @@
                                      llannotation.SomePtr(GCClass.VISIT_FPTR)],
                   annmodel.s_None))
 
+    def finish_tables(self):
+        self.layoutbuilder.close_table()
+        return []
+
     def build_root_walker(self):
         return StmRootWalker(self)
 
diff --git a/rpython/translator/c/node.py b/rpython/translator/c/node.py
--- a/rpython/translator/c/node.py
+++ b/rpython/translator/c/node.py
@@ -72,7 +72,7 @@
             if isinstance(T, GcStruct):
                 node = self.db.gettypedefnode(T, varlength=varlength)
                 self.dependencies.add(node)
-                return 'struct %s' % node.name
+                return 'struct %s @' % node.name
             if isinstance(T, OpaqueType):
                 if T.hints.get("is_stm_header", False):
                     return 'struct rpyobj_s @'
@@ -538,7 +538,7 @@
             else:
                 assert self.implementationtypename.endswith('_t @')
                 uniontypename = 'union %su @'%self.implementationtypename[:-4]
-            if self.db.with_stm():
+            if self.db.with_stm() and self.getTYPE()._gckind == 'gc':
                 uniontypename = 'TLPREFIX ' + uniontypename
             return uniontypename, self.name[:-2]
         else:
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to