[pypy-svn] r20255 - in pypy/branch/somepbc-refactoring/pypy/rpython: . lltypesystem

arigo at codespeak.net arigo at codespeak.net
Fri Nov 25 19:45:24 CET 2005


Author: arigo
Date: Fri Nov 25 19:45:23 2005
New Revision: 20255

Modified:
   pypy/branch/somepbc-refactoring/pypy/rpython/lltypesystem/rpbc.py
   pypy/branch/somepbc-refactoring/pypy/rpython/rmodel.py
   pypy/branch/somepbc-refactoring/pypy/rpython/rtyper.py
Log:
(pedronis, arigo)

killed hardwired_call operations.



Modified: pypy/branch/somepbc-refactoring/pypy/rpython/lltypesystem/rpbc.py
==============================================================================
--- pypy/branch/somepbc-refactoring/pypy/rpython/lltypesystem/rpbc.py	(original)
+++ pypy/branch/somepbc-refactoring/pypy/rpython/lltypesystem/rpbc.py	Fri Nov 25 19:45:23 2005
@@ -193,34 +193,21 @@
     It assumes that all the methods come from the same name in a base
     classdef."""
 
-    def rtype_hardwired_simple_call(self, hop):
-        return self.redispatch_call(hop, call_args=False, hardwired=True)
-
-    def rtype_hardwired_call_args(self, hop):
-        return self.redispatch_call(hop, call_args=True, hardwired=True)
-
     def rtype_simple_call(self, hop):
         return self.redispatch_call(hop, call_args=False)
 
     def rtype_call_args(self, hop):
         return self.redispatch_call(hop, call_args=True)
 
-    def redispatch_call(self, hop, call_args, hardwired=False):
+    def redispatch_call(self, hop, call_args):
         hop2 = hop.copy()
-        if hardwired:
-            hop2.swap_fst_snd_args() # bring the hardwired function constant in front
-            func = hop2.args_v[0].value
-            s_func = annmodel.SomePBC({func: True})
-            hop2.r_s_popfirstarg() # info captured, discard it
-            v_func = Constant(func)
-        else:
-            r_class = self.r_im_self.rclass
-            mangled_name, r_func = r_class.clsfields[self.methodname]
-            assert isinstance(r_func, FunctionsPBCRepr)
-            s_func = r_func.s_pbc
-            v_im_self = hop.inputarg(self, arg=0)
-            v_cls = self.r_im_self.getfield(v_im_self, '__class__', hop.llops)
-            v_func = r_class.getclsfield(v_cls, self.methodname, hop.llops)
+        r_class = self.r_im_self.rclass
+        mangled_name, r_func = r_class.clsfields[self.methodname]
+        assert isinstance(r_func, FunctionsPBCRepr)
+        s_func = r_func.s_pbc
+        v_im_self = hop.inputarg(self, arg=0)
+        v_cls = self.r_im_self.getfield(v_im_self, '__class__', hop.llops)
+        v_func = r_class.getclsfield(v_cls, self.methodname, hop.llops)
 
         hop2.args_s[0] = self.s_im_self   # make the 1st arg stand for 'im_self'
         hop2.args_r[0] = self.r_im_self   # (same lowleveltype as 'self')

Modified: pypy/branch/somepbc-refactoring/pypy/rpython/rmodel.py
==============================================================================
--- pypy/branch/somepbc-refactoring/pypy/rpython/rmodel.py	(original)
+++ pypy/branch/somepbc-refactoring/pypy/rpython/rmodel.py	Fri Nov 25 19:45:23 2005
@@ -240,10 +240,6 @@
 for opname in annmodel.UNARY_OPERATIONS:
     setattr_default(Repr, 'rtype_' + opname, missing_rtype_operation)
 
-# hardwired_*call*
-setattr_default(Repr, 'rtype_hardwired_simple_call', missing_rtype_operation)
-setattr_default(Repr, 'rtype_hardwired_call_args'  , missing_rtype_operation)
-
 for opname in annmodel.BINARY_OPERATIONS:
     setattr_default(pairtype(Repr, Repr),
                     'rtype_' + opname, missing_rtype_operation)

Modified: pypy/branch/somepbc-refactoring/pypy/rpython/rtyper.py
==============================================================================
--- pypy/branch/somepbc-refactoring/pypy/rpython/rtyper.py	(original)
+++ pypy/branch/somepbc-refactoring/pypy/rpython/rtyper.py	Fri Nov 25 19:45:23 2005
@@ -499,12 +499,6 @@
         r_arg2 = hop.args_r[1]
         return pair(r_arg1, r_arg2).rtype_contains(hop)
 
-    def translate_op_hardwired_simple_call(self, hop):
-        return hop.args_r[0].rtype_hardwired_simple_call(hop)
-
-    def translate_op_hardwired_call_args(self, hop):
-        return hop.args_r[0].rtype_hardwired_call_args(hop)
-
     # __________ irregular operations __________
 
     def translate_op_newlist(self, hop):



More information about the Pypy-commit mailing list