[pypy-svn] r20408 - pypy/branch/somepbc-refactoring/pypy/translator

mwh at codespeak.net mwh at codespeak.net
Tue Nov 29 18:26:58 CET 2005


Author: mwh
Date: Tue Nov 29 18:26:57 2005
New Revision: 20408

Modified:
   pypy/branch/somepbc-refactoring/pypy/translator/transform.py
Log:
kill transform_specialization -- woohoo!


Modified: pypy/branch/somepbc-refactoring/pypy/translator/transform.py
==============================================================================
--- pypy/branch/somepbc-refactoring/pypy/translator/transform.py	(original)
+++ pypy/branch/somepbc-refactoring/pypy/translator/transform.py	Tue Nov 29 18:26:57 2005
@@ -143,49 +143,6 @@
     # make sure the bookkeeper knows about AssertionError
     self.bookkeeper.getuniqueclassdef(AssertionError)
 
-def transform_specialization(self, block_subset):
-    THIS_SHOULD_DISAPPEAR
-    for block in block_subset:
-        for op in block.operations:
-            if op.opname in ('simple_call', 'call_args'):
-                callb = self.binding(op.args[0], extquery=True)
-                if isinstance(callb, annmodel.SomePBC):
-                    if len(callb.prebuiltinstances) == 1:
-                        specialized_callb, specialcase = self.bookkeeper.query_spaceop_callable(op)
-                        if specialcase or callb != specialized_callb:
-                            if not specialcase:
-                                specialized_func = Constant(specialized_callb.prebuiltinstances.keys()[0])
-                                if not isinstance(op.args[0], Constant) and not callb.is_constant():
-                                    # this is a method call on some variable instance:
-                                    # we still need the logic for methods up to calling the fixed specialized function,
-                                    # We use special call operations 'hardwired_simple_call' and 'hardwired_call_args'
-                                    # including the specialized function as 2nd argument to distinguish this case
-                                    op.opname = intern('hardwired_'+op.opname)
-                                    op.args.insert(1, specialized_func)
-                                else:
-                                    op.args[0] = specialized_func
-                            else:
-                                if op.opname != 'simple_call':
-                                    assert 0, "not supported: call_args to a specialized function"
-                                callable = callb.prebuiltinstances.keys()[0]
-                                tag = getattr(callable, '_annspecialcase_', None)
-                                if tag == 'specialize:memo':
-                                    arglist_s = [self.binding(v) for v in op.args[1:]]
-                                    memo_table = MemoTable(self.bookkeeper, 
-                                                           callable, 
-                                                           self.binding(op.result), 
-                                                           arglist_s)
-                                    op.opname = intern('call_memo')
-                                    op.args[0] = Constant(memo_table)
-                                else:
-                                    op.opname = intern('call_specialcase')
-                elif isinstance(callb, annmodel.SomeLLADTMeth):
-                    specialized_callb, specialcase = self.bookkeeper.query_spaceop_callable(op)
-                    assert not specialcase
-                    assert not isinstance(op.args[0], Constant) and not callb.is_constant()
-                    op.opname = intern('hardwired_'+op.opname)
-                    op.args.insert(1, Constant(specialized_callb.func))
-
 def insert_stackcheck(ann):
     from pypy.tool.algo.graphlib import Edge, make_edge_dict, break_cycles
     edges = []
@@ -211,7 +168,6 @@
         caller_block.operations.insert(0, unwind_op)
 
 default_extra_passes = [
-    #transform_specialization,
     transform_allocate,
     ]
 



More information about the Pypy-commit mailing list