Commits

Ronan Lamy committed 35bee26

Kill rpython.jit.codewriter.support.OOtypeHelpers

  • Participants
  • Parent commits 80e0b30
  • Branches kill-ootype

Comments (0)

Files changed (2)

File rpython/jit/codewriter/jtransform.py

                               op.result)
 
     def _array_of_voids(self, ARRAY):
-        #if isinstance(ARRAY, ootype.Array):
-        #    return ARRAY.ITEM == ootype.Void
-        #else:
         return ARRAY.OF == lltype.Void
 
     def rewrite_op_getfield(self, op):

File rpython/jit/codewriter/support.py

 from rpython.rtyper.lltypesystem import lltype, rclass, rffi, llmemory, rstr as ll_rstr, rdict as ll_rdict
 from rpython.rtyper.lltypesystem.lloperation import llop
 from rpython.rtyper.lltypesystem.module import ll_math
-from rpython.rtyper.ootypesystem import ootype, rdict as oo_rdict
 from rpython.translator.simplify import get_funcobj
 from rpython.translator.translator import TranslationContext
 from rpython.translator.unsimplify import split_block
             # another block, so the set of alive_v will be different.
             methname = op.args[0].value
             assert methname == 'jit_merge_point', (
-                "reds='auto' is supported only for jit drivers which " 
+                "reds='auto' is supported only for jit drivers which "
                 "calls only jit_merge_point. Found a call to %s" % methname)
             #
             # compute the set of live variables across the jit_marker
     def _ll_1_gc_add_memory_pressure(num):
         llop.gc_add_memory_pressure(lltype.Void, num)
 
-class OOtypeHelpers:
-
-    # ---------- dict ----------
-
-    def _ll_0_newdict(DICT):
-        return oo_rdict.ll_newdict(DICT)
-    _ll_0_newdict.need_result_type = True
-
-    def _ll_3_dict_setitem(d, key, value):
-        d.ll_set(key, value)
-
-    def _ll_2_dict_contains(d, key):
-        return d.ll_contains(key)
-
-    def _ll_1_dict_clear(d):
-        d.ll_clear()
-
-    _ll_2_dict_getitem = oo_rdict.ll_dict_getitem
-    _ll_2_dict_delitem = oo_rdict.ll_dict_delitem
-    _ll_3_dict_setdefault = oo_rdict.ll_dict_setdefault
-    _ll_3_dict_get = oo_rdict.ll_dict_get
-    _ll_1_dict_copy = oo_rdict.ll_dict_copy
-    _ll_2_dict_update = oo_rdict.ll_dict_update
-
-    # ---------- dict keys(), values(), items(), iter ----------
-
-    _ll_1_dict_keys   = oo_rdict.ll_dict_keys
-    _ll_1_dict_values = oo_rdict.ll_dict_values
-    _ll_1_dict_items  = oo_rdict.ll_dict_items
-    _ll_1_dict_keys  .need_result_type = True
-    _ll_1_dict_values.need_result_type = True
-    _ll_1_dict_items .need_result_type = True
-
-    _dictnext_keys   = staticmethod(oo_rdict.ll_dictnext_group['keys'])
-    _dictnext_values = staticmethod(oo_rdict.ll_dictnext_group['values'])
-    _dictnext_items  = staticmethod(oo_rdict.ll_dictnext_group['items'])
-
-    def _ll_1_dictiter_nextkeys(iter):
-        return OOtypeHelpers._dictnext_keys(None, iter)
-    def _ll_1_dictiter_nextvalues(iter):
-        return OOtypeHelpers._dictnext_values(None, iter)
-    def _ll_1_dictiter_nextitems(RES, iter):
-        return OOtypeHelpers._dictnext_items(RES, iter)
-    _ll_1_dictiter_nextitems.need_result_type = True
-
-    # --------------- oostring and oounicode ----------------
-
-    def _ll_2_oostring_signed_foldable(n, base):
-        return ootype.oostring(n, base)
-
-    def _ll_1_oostring_char_foldable(ch):
-        return ootype.oostring(ch, -1)
-
-    def _ll_1_oostring_unsigned_foldable(n):
-        return ootype.oostring(n, -1)
-
-    def _ll_1_oostring_string_foldable(s):
-        return ootype.oostring(s, -1)
-
-    def _ll_1_oostring_root_foldable(s):
-        return ootype.oostring(s, -1)
-
-    def _ll_2_oounicode_signed_foldable(n, base):
-        return ootype.oounicode(n, base)
-
-    def _ll_1_oounicode_unichar_foldable(ch):
-        return ootype.oounicode(ch, -1)
-
-    def _ll_1_oounicode_string_foldable(s):
-        return ootype.oounicode(s, -1)
-
-# -------------------------------------------------------
 
 def setup_extra_builtin(rtyper, oopspec_name, nb_args, extra=None):
     name = '_ll_%d_%s' % (nb_args, oopspec_name.replace('.', '_'))
     try:
         wrapper = globals()[name]
     except KeyError:
-        if rtyper.type_system.name == 'lltypesystem':
-            Helpers = LLtypeHelpers
-        else:
-            Helpers = OOtypeHelpers
-        wrapper = getattr(Helpers, name).im_func
+        wrapper = getattr(LLtypeHelpers, name).im_func
     if extra is not None:
         wrapper = wrapper(*extra)
     return wrapper
     normalized_opargs = normalize_opargs(argtuple, opargs)
     return oopspec, normalized_opargs
 
-def get_oostring_oopspec(op):
-    T = op.args[0].concretetype
-    if T is not ootype.Signed:
-        args = op.args[:-1]
-    else:
-        args = op.args
-    if isinstance(T, ootype.Instance):
-        T = ootype.ROOT
-    return '%s_%s_foldable' % (op.opname, T._name.lower()), args
-
 def get_identityhash_oopspec(op):
     return 'gc_identityhash', op.args
 
 
 
 def decode_builtin_call(op):
-    if op.opname == 'oosend':
-        SELFTYPE, name, opargs = decompose_oosend(op)
-        return get_send_oopspec(SELFTYPE, name), opargs
-    elif op.opname == 'direct_call':
+    if op.opname == 'direct_call':
         fnobj = get_funcobj(op.args[0].value)
         opargs = op.args[1:]
         return get_call_oopspec_opargs(fnobj, opargs)
-    elif op.opname in ('oostring', 'oounicode'):
-        return get_oostring_oopspec(op)
     elif op.opname == 'gc_identityhash':
         return get_identityhash_oopspec(op)
     elif op.opname == 'gc_id':