[pypy-svn] r32707 - in pypy/dist/pypy: annotation rpython rpython/l3interp rpython/lltypesystem rpython/memory/test translator/c translator/llvm

mwh at codespeak.net mwh at codespeak.net
Thu Sep 28 19:06:29 CEST 2006


Author: mwh
Date: Thu Sep 28 19:06:25 2006
New Revision: 32707

Removed:
   pypy/dist/pypy/rpython/l3interp/
Modified:
   pypy/dist/pypy/annotation/builtin.py
   pypy/dist/pypy/rpython/llinterp.py
   pypy/dist/pypy/rpython/lltypesystem/lloperation.py
   pypy/dist/pypy/rpython/lltypesystem/lltype.py
   pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py
   pypy/dist/pypy/rpython/rbuiltin.py
   pypy/dist/pypy/translator/c/database.py
   pypy/dist/pypy/translator/c/funcgen.py
   pypy/dist/pypy/translator/c/genc.py
   pypy/dist/pypy/translator/llvm/database.py
Log:
remove the l3interp.
paris was a long time ago....


Modified: pypy/dist/pypy/annotation/builtin.py
==============================================================================
--- pypy/dist/pypy/annotation/builtin.py	(original)
+++ pypy/dist/pypy/annotation/builtin.py	Thu Sep 28 19:06:25 2006
@@ -597,12 +597,6 @@
 
 BUILTIN_ANALYZERS[llmemory.offsetof] = offsetof
 
-from pypy.rpython.l3interp import l3interp
-def l3malloc(size):
-    return SomeAddress()
-
-BUILTIN_ANALYZERS[l3interp.malloc] = l3malloc
-
 #_________________________________
 # external functions
 

Modified: pypy/dist/pypy/rpython/llinterp.py
==============================================================================
--- pypy/dist/pypy/rpython/llinterp.py	(original)
+++ pypy/dist/pypy/rpython/llinterp.py	Thu Sep 28 19:06:25 2006
@@ -669,9 +669,6 @@
     def op_yield_current_frame_to_caller(self):
         raise NotImplementedError("yield_current_frame_to_caller")
 
-    def op_call_boehm_gc_alloc(self):
-        raise NotImplementedError("call_boehm_gc_alloc")
-
 
     # operations on pyobjects!
     for opname in lloperation.opimpls.keys():

Modified: pypy/dist/pypy/rpython/lltypesystem/lloperation.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/lloperation.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/lloperation.py	Thu Sep 28 19:06:25 2006
@@ -319,10 +319,6 @@
     'direct_ptradd':        LLOp(canfold=True),
     'cast_opaque_ptr':      LLOp(canfold=True),
 
-    # _________ XXX l3interp hacks ___________
-
-    'call_boehm_gc_alloc':  LLOp(canraise=(MemoryError,)),
-
     # __________ address operations __________
 
     'raw_malloc':           LLOp(canraise=(MemoryError,)),

Modified: pypy/dist/pypy/rpython/lltypesystem/lltype.py
==============================================================================
--- pypy/dist/pypy/rpython/lltypesystem/lltype.py	(original)
+++ pypy/dist/pypy/rpython/lltypesystem/lltype.py	Thu Sep 28 19:06:25 2006
@@ -516,9 +516,13 @@
 class PyForwardReference(ForwardReference):
     _gckind = 'cpy'
 
+class FuncForwardReference(ForwardReference):
+    _gckind = 'prebuilt'
+
 FORWARDREF_BY_FLAVOR = {'raw': ForwardReference,
                         'gc':  GcForwardReference,
-                        'cpy': PyForwardReference}
+                        'cpy': PyForwardReference,
+                        'prebuilt': FuncForwardReference}
 
 
 class Primitive(LowLevelType):
@@ -594,7 +598,7 @@
 
     def _needsgc(self):
         # XXX deprecated interface
-        return self.TO._gckind != 'raw'
+        return self.TO._gckind not in ('raw', 'prebuilt')
 
     def __str__(self):
         return '* %s' % (self.TO, )

Modified: pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py	(original)
+++ pypy/dist/pypy/rpython/memory/test/test_transformed_gc.py	Thu Sep 28 19:06:25 2006
@@ -658,8 +658,8 @@
 
 class TestSemiSpaceGC(TestMarkSweepGC):
 
-    def setup_class(cls):
-        py.test.skip("in-progress")
+    #def setup_class(cls):
+    #    py.test.skip("in-progress")
 
     class gcpolicy(gc.StacklessFrameworkGcPolicy):
         class transformerclass(gctransform.FrameworkGCTransformer):

Modified: pypy/dist/pypy/rpython/rbuiltin.py
==============================================================================
--- pypy/dist/pypy/rpython/rbuiltin.py	(original)
+++ pypy/dist/pypy/rpython/rbuiltin.py	Thu Sep 28 19:06:25 2006
@@ -584,18 +584,6 @@
 
 BUILTIN_TYPER[llmemory.offsetof] = rtype_offsetof
 
-# XXX this next little bit is a monstrous hack.  the Real Thing awaits
-# some kind of proper GC integration
-from pypy.rpython.l3interp import l3interp
-#from pypy.rpython.raddress import offset_repr
-
-def rtype_l3malloc(hop):
-    v_list = hop.inputargs(lltype.Signed)
-    return hop.genop("call_boehm_gc_alloc", v_list,
-                     resulttype=llmemory.Address)
-
-BUILTIN_TYPER[l3interp.malloc] = rtype_l3malloc
-
 # _________________________________________________________________
 # non-gc objects
 

Modified: pypy/dist/pypy/translator/c/database.py
==============================================================================
--- pypy/dist/pypy/translator/c/database.py	(original)
+++ pypy/dist/pypy/translator/c/database.py	Thu Sep 28 19:06:25 2006
@@ -36,6 +36,7 @@
         self.containerstats = {}
         self.externalfuncs = {}
         self.helper2ptr = {}
+        self.raisingop2direct = True
 
         # late_initializations is for when the value you want to
         # assign to a constant object is something C doesn't think is

Modified: pypy/dist/pypy/translator/c/funcgen.py
==============================================================================
--- pypy/dist/pypy/translator/c/funcgen.py	(original)
+++ pypy/dist/pypy/translator/c/funcgen.py	Thu Sep 28 19:06:25 2006
@@ -46,6 +46,10 @@
         if db.stacklesstransformer:
             db.stacklesstransformer.transform_graph(graph)
         # apply the exception transformation
+        if self.db.raisingop2direct:
+            from pypy.translator.backendopt.raisingop2direct_call import raisingop2direct_call
+            raisingop2direct_call(db.translator, [graph])
+            
         if self.db.exctransformer:
             self.db.exctransformer.create_exception_handling(self.graph)
         # apply the gc transformation

Modified: pypy/dist/pypy/translator/c/genc.py
==============================================================================
--- pypy/dist/pypy/translator/c/genc.py	(original)
+++ pypy/dist/pypy/translator/c/genc.py	Thu Sep 28 19:06:25 2006
@@ -142,6 +142,8 @@
         # actually generating the source.
         if db is None:
             db = self.build_database()
+        from pypy.translator.backendopt.all import backend_optimizations
+        backend_optimizations(self.translator, raisingop2direct_call_all=True)
         for node in db.containerlist:
             if isinstance(node, FuncNode):
                 for funcgen in node.funcgens:

Modified: pypy/dist/pypy/translator/llvm/database.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/database.py	(original)
+++ pypy/dist/pypy/translator/llvm/database.py	Thu Sep 28 19:06:25 2006
@@ -560,7 +560,12 @@
         elif isinstance(value, llmemory.CompositeOffset):
             from_, indices, to = self.get_offset(value.offsets[0], indices)
             for item in value.offsets[1:]:
-                _, indices, to = self.get_offset(item, indices)
+                if not isinstance(item, llmemory.GCHeaderOffset):
+                    _, indices, to = self.get_offset(item, indices)
+
+        elif isinstance(value, llmemory.GCHeaderOffset):
+            from_ = lltype.Ptr(value.gcheaderbuilder.HDR)
+            to = "BBB" # better not use this!
 
         else:
             raise Exception("unsupported offset")



More information about the Pypy-commit mailing list