[pypy-svn] r49723 - in pypy/branch/pypy-gc-traceopt: rpython rpython/lltypesystem rpython/ootypesystem translator/cli translator/jvm

arigo at codespeak.net arigo at codespeak.net
Thu Dec 13 16:41:14 CET 2007


Author: arigo
Date: Thu Dec 13 16:41:14 2007
New Revision: 49723

Modified:
   pypy/branch/pypy-gc-traceopt/rpython/llinterp.py
   pypy/branch/pypy-gc-traceopt/rpython/lltypesystem/rpbc.py
   pypy/branch/pypy-gc-traceopt/rpython/ootypesystem/rdict.py
   pypy/branch/pypy-gc-traceopt/rpython/rexternalobj.py
   pypy/branch/pypy-gc-traceopt/rpython/rmodel.py
   pypy/branch/pypy-gc-traceopt/rpython/rpbc.py
   pypy/branch/pypy-gc-traceopt/rpython/rtyper.py
   pypy/branch/pypy-gc-traceopt/translator/cli/comparer.py
   pypy/branch/pypy-gc-traceopt/translator/jvm/metavm.py
Log:
Merge r49721 from the trunk.


Modified: pypy/branch/pypy-gc-traceopt/rpython/llinterp.py
==============================================================================
--- pypy/branch/pypy-gc-traceopt/rpython/llinterp.py	(original)
+++ pypy/branch/pypy-gc-traceopt/rpython/llinterp.py	Thu Dec 13 16:41:14 2007
@@ -1215,12 +1215,12 @@
 
 def wrap_callable(llinterpreter, fn, obj, method_name):
     if method_name is None:
-        # fn is a HalfConcreteWrapper wrapping a StaticMethod
+        # fn is a StaticMethod
         if obj is not None:
             self_arg = [obj]
         else:
             self_arg = []
-        func_graph = fn.concretize().value.graph
+        func_graph = fn.graph
     else:
         # obj is an instance, we want to call 'method_name' on it
         assert fn is None        

Modified: pypy/branch/pypy-gc-traceopt/rpython/lltypesystem/rpbc.py
==============================================================================
--- pypy/branch/pypy-gc-traceopt/rpython/lltypesystem/rpbc.py	(original)
+++ pypy/branch/pypy-gc-traceopt/rpython/lltypesystem/rpbc.py	Thu Dec 13 16:41:14 2007
@@ -7,7 +7,7 @@
 from pypy.rpython.lltypesystem.lltype import \
      typeOf, Void, ForwardReference, Struct, Bool, Char, \
      Ptr, malloc, nullptr, Array, Signed, FuncType
-from pypy.rpython.rmodel import Repr, TyperError, inputconst, inputdesc, HalfConcreteWrapper
+from pypy.rpython.rmodel import Repr, TyperError, inputconst, inputdesc
 from pypy.rpython.rpbc import samesig,\
      commonbase, allattributenames, adjust_shape, \
      AbstractClassesPBCRepr, AbstractMethodsPBCRepr, OverriddenFunctionPBCRepr, \
@@ -261,8 +261,7 @@
 class __extend__(pairtype(SmallFunctionSetPBCRepr, FunctionsPBCRepr)):
     def convert_from_to((r_set, r_ptr), v, llops):
         if r_ptr.lowleveltype is Void:
-            wrapper = HalfConcreteWrapper(r_ptr.get_unique_llfn)
-            return inputconst(Void, wrapper)
+            return inputconst(Void, None)
         else:
             assert v.concretetype is Char
             v_int = llops.genop('cast_char_to_int', [v],

Modified: pypy/branch/pypy-gc-traceopt/rpython/ootypesystem/rdict.py
==============================================================================
--- pypy/branch/pypy-gc-traceopt/rpython/ootypesystem/rdict.py	(original)
+++ pypy/branch/pypy-gc-traceopt/rpython/ootypesystem/rdict.py	Thu Dec 13 16:41:14 2007
@@ -160,7 +160,7 @@
             r_func, nimplicitarg = r_func.get_r_implfunc()
         else:
             obj = None
-        callable = r_func.convert_const(fn)
+        callable = r_func.get_unique_llfn().value
         func_name, interp_fn = llinterp.wrap_callable(interp, callable, obj, None)
         return ootype.static_meth(TYPE, func_name, _callable=interp_fn)
         
@@ -232,7 +232,7 @@
 
 def _get_call_vars(hop, r_func, arg, params_annotation):
     if isinstance(r_func, AbstractFunctionsPBCRepr):
-        v_fn = hop.inputarg(r_func, arg=arg)
+        v_fn = r_func.get_unique_llfn()
         v_obj = hop.inputconst(ootype.Void, None)
         c_method_name = hop.inputconst(ootype.Void, None)
     elif isinstance(r_func, AbstractMethodsPBCRepr):
@@ -243,7 +243,7 @@
         c_method_name = hop.inputconst(ootype.Void, methodname)
     elif isinstance(r_func, MethodOfFrozenPBCRepr):
         r_impl, nimplicitarg = r_func.get_r_implfunc()
-        v_fn = hop.inputconst(r_impl, r_func.funcdesc.pyobj)
+        v_fn = r_impl.get_unique_llfn()
         v_obj = hop.inputarg(r_func, arg=arg)
         c_method_name = hop.inputconst(ootype.Void, None)
 

Modified: pypy/branch/pypy-gc-traceopt/rpython/rexternalobj.py
==============================================================================
--- pypy/branch/pypy-gc-traceopt/rpython/rexternalobj.py	(original)
+++ pypy/branch/pypy-gc-traceopt/rpython/rexternalobj.py	Thu Dec 13 16:41:14 2007
@@ -1,7 +1,7 @@
 from pypy.annotation import model as annmodel
 from pypy.rpython.lltypesystem import lltype
 from pypy.rpython.ootypesystem import ootype
-from pypy.rpython.rmodel import Repr, HalfConcreteWrapper
+from pypy.rpython.rmodel import Repr
 from pypy.rpython import rbuiltin
 from pypy.objspace.flow.model import Constant, Variable
 from pypy.rpython import extregistry

Modified: pypy/branch/pypy-gc-traceopt/rpython/rmodel.py
==============================================================================
--- pypy/branch/pypy-gc-traceopt/rpython/rmodel.py	(original)
+++ pypy/branch/pypy-gc-traceopt/rpython/rmodel.py	Thu Dec 13 16:41:14 2007
@@ -421,13 +421,6 @@
     else:
         return '%s_%s' % (prefix, name)
 
-class HalfConcreteWrapper:
-    # see rtyper.gendirectcall()
-    def __init__(self, callback):
-        self.concretize = callback   # should produce a concrete const
-    def _freeze_(self):
-        return True
-
 # __________ utilities __________
 PyObjPtr = Ptr(PyObject)
 

Modified: pypy/branch/pypy-gc-traceopt/rpython/rpbc.py
==============================================================================
--- pypy/branch/pypy-gc-traceopt/rpython/rpbc.py	(original)
+++ pypy/branch/pypy-gc-traceopt/rpython/rpbc.py	Thu Dec 13 16:41:14 2007
@@ -7,7 +7,7 @@
 from pypy.rpython.lltypesystem.lltype import \
      typeOf, Void, Bool, nullptr, frozendict, Ptr, Struct, malloc
 from pypy.rpython.error import TyperError
-from pypy.rpython.rmodel import Repr, inputconst, HalfConcreteWrapper, CanBeNull, \
+from pypy.rpython.rmodel import Repr, inputconst, CanBeNull, \
         mangle, inputdesc, warning, impossible_repr
 from pypy.rpython import rclass
 from pypy.rpython import robject
@@ -225,7 +225,7 @@
         except KeyError:
             pass
         if self.lowleveltype is Void:
-            result = HalfConcreteWrapper(self.get_unique_llfn)
+            result = None
         else:
             llfns = {}
             found_anything = False
@@ -255,7 +255,7 @@
         if isinstance(value, types.MethodType) and value.im_self is None:
             value = value.im_func   # unbound method -> bare function
         if self.lowleveltype is Void:
-            return HalfConcreteWrapper(self.get_unique_llfn)
+            return None
         if value is None:
             null = self.rtyper.type_system.null_callable(self.lowleveltype)
             return null
@@ -346,8 +346,7 @@
             if r_fpbc1.lowleveltype is Void:
                 return inputconst(r_fpbc2, r_fpbc1.s_pbc.const)
             if r_fpbc2.lowleveltype is Void:
-                wrapper = HalfConcreteWrapper(r_fpbc2.get_unique_llfn)
-                return inputconst(Void, wrapper)
+                return inputconst(Void, None)
             return NotImplemented
 
 class OverriddenFunctionPBCRepr(Repr):

Modified: pypy/branch/pypy-gc-traceopt/rpython/rtyper.py
==============================================================================
--- pypy/branch/pypy-gc-traceopt/rpython/rtyper.py	(original)
+++ pypy/branch/pypy-gc-traceopt/rpython/rtyper.py	Thu Dec 13 16:41:14 2007
@@ -27,7 +27,7 @@
 from pypy.translator.unsimplify import insert_empty_block
 from pypy.rpython.error import TyperError
 from pypy.rpython.rmodel import Repr, inputconst, BrokenReprTyperError
-from pypy.rpython.rmodel import warning, HalfConcreteWrapper
+from pypy.rpython.rmodel import warning
 from pypy.rpython.annlowlevel import annotate_lowlevel_helper, LowLevelAnnotatorPolicy
 from pypy.rpython.typesystem import LowLevelTypeSystem,\
                                     ObjectOrientedTypeSystem
@@ -884,12 +884,6 @@
                     raise TyperError("non-constant variable of type Void")
                 if not isinstance(s_value, annmodel.SomePBC):
                     raise TyperError("non-PBC Void argument: %r", (s_value,))
-                if isinstance(s_value.const, HalfConcreteWrapper):
-                    # Modify args_v so that 'v' gets the concrete value
-                    # returned by the wrapper
-                    wrapper = s_value.const
-                    v = wrapper.concretize()
-                    s_value = annmodel.lltype_to_annotation(v.concretetype)
                 args_s.append(s_value)
             else:
                 args_s.append(annmodel.lltype_to_annotation(v.concretetype))

Modified: pypy/branch/pypy-gc-traceopt/translator/cli/comparer.py
==============================================================================
--- pypy/branch/pypy-gc-traceopt/translator/cli/comparer.py	(original)
+++ pypy/branch/pypy-gc-traceopt/translator/cli/comparer.py	Thu Dec 13 16:41:14 2007
@@ -50,10 +50,9 @@
             self._call_function(fn_args.graph, len(arglist))
         else:
             fn, obj, method_name = fn_args
-            # fn is a HalfConcreteWrapper
-            sm = fn.value.concretize().value
+            # fn is a Constant(StaticMethod)
             if method_name.value is None:
-                self._call_function(sm.graph, len(arglist))
+                self._call_function(fn.value.graph, len(arglist))
             else:
                 assert False, 'XXX'
 

Modified: pypy/branch/pypy-gc-traceopt/translator/jvm/metavm.py
==============================================================================
--- pypy/branch/pypy-gc-traceopt/translator/jvm/metavm.py	(original)
+++ pypy/branch/pypy-gc-traceopt/translator/jvm/metavm.py	Thu Dec 13 16:41:14 2007
@@ -110,7 +110,7 @@
             # Standalone function: find the delegate class and
             # instantiate it.
             assert method_name.value is None
-            smimpl = fn.value.concretize().value   # ootype._static_meth
+            smimpl = fn.value                      # ootype._static_meth
             db.record_delegate(smimpl._TYPE)       # _TYPE is a StaticMethod
             ty = db.record_delegate_standalone_func_impl(smimpl.graph)
             gen.new_with_jtype(ty)



More information about the Pypy-commit mailing list