[pypy-svn] r62182 - in pypy/branch/pyjitpl5/pypy: jit/metainterp jit/tl rpython

arigo at codespeak.net arigo at codespeak.net
Thu Feb 26 14:01:43 CET 2009


Author: arigo
Date: Thu Feb 26 14:01:41 2009
New Revision: 62182

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/support.py
   pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit.py
   pypy/branch/pyjitpl5/pypy/rpython/rlist.py
Log:
Some more simplifications in the oopspecs.
Also disable inlining in pypyjit.py, to prevent
inlining from removing the oopspec functions.


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/codewriter.py	Thu Feb 26 14:01:41 2009
@@ -460,6 +460,7 @@
     serialize_op_cast_int_to_char = serialize_op_same_as
     serialize_op_cast_char_to_int = serialize_op_same_as
     serialize_op_cast_bool_to_int = serialize_op_same_as
+    serialize_op_resume_point = serialize_op_same_as
 
     def serialize_op_char_eq(self, op):
         self.default_serialize_op(op, 'int_eq')

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	Thu Feb 26 14:01:41 2009
@@ -235,7 +235,7 @@
                 self.execute(%r, [b1, b2], "int", True)
         ''' % (_opimpl, _opimpl)).compile()
 
-    for _opimpl in ['int_is_true', 'int_neg',
+    for _opimpl in ['int_is_true', 'int_neg', 'bool_not',
                     ]:
         exec py.code.Source('''
             @arguments("box")

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/support.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/support.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/support.py	Thu Feb 26 14:01:41 2009
@@ -95,11 +95,16 @@
 # coming from modules like pypy.rpython.rlist.  The following
 # functions are fished from the globals() by setup_extra_builtin().
 
-def _ll_1_newlist(LIST):
+def _ll_0_newlist(LIST):
     return LIST.ll_newlist(0)
-def _ll_2_newlist(LIST, count):
+def _ll_1_newlist(LIST, count):
     return LIST.ll_newlist(count)
-_ll_3_newlist = rlist.ll_alloc_and_set
+def _ll_2_newlist(LIST, count, item):
+    return rlist.ll_alloc_and_set(LIST, count, item)
+_ll_0_newlist.need_result_type = True
+_ll_1_newlist.need_result_type = True
+_ll_2_newlist.need_result_type = True
+
 def _ll_1_list_len(l):
     return l.ll_length()
 def _ll_2_list_getitem(l, index):
@@ -110,16 +115,12 @@
     return rlist.ll_pop_default(rlist.dum_checkidx, l)
 def _ll_2_list_pop(l, index):
     return rlist.ll_pop(rlist.dum_checkidx, l, index)
-def _ll_1_list_copy(l):
-    return rlist.ll_copy(lltype.typeOf(l).TO, l)
 _ll_2_list_append = rlist.ll_append
 _ll_2_list_extend = rlist.ll_extend
 _ll_3_list_insert = rlist.ll_insert_nonneg
-_ll_1_list_nonzero = rlist.ll_list_is_true
 
 _ll_2_list_getitem_foldable = _ll_2_list_getitem
 _ll_1_list_len_foldable     = _ll_1_list_len
-_ll_1_list_nonzero_foldable = _ll_1_list_nonzero
 
 _ll_2_dict_getitem = rdict.ll_dict_getitem
 _ll_3_dict_setitem = rdict.ll_dict_setitem
@@ -193,12 +194,13 @@
     args_s = [annmodel.lltype_to_annotation(v) for v in ll_args]
     if '.' not in oopspec_name:    # 'newxxx' operations
         LIST_OR_DICT = ll_res
-        bk = rtyper.annotator.bookkeeper
-        args_s.insert(0, annmodel.SomePBC([bk.getdesc(LIST_OR_DICT.TO)]))
     else:
         LIST_OR_DICT = ll_args[0]
     s_result = annmodel.lltype_to_annotation(ll_res)
     impl = setup_extra_builtin(oopspec_name, len(args_s))
+    if getattr(impl, 'need_result_type', False):
+        bk = rtyper.annotator.bookkeeper
+        args_s.insert(0, annmodel.SomePBC([bk.getdesc(ll_res.TO)]))
     #
     mixlevelann = MixLevelHelperAnnotator(rtyper)
     c_func = mixlevelann.constfunc(impl, args_s, s_result)

Modified: pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/tl/pypyjit.py	Thu Feb 26 14:01:41 2009
@@ -9,6 +9,7 @@
 from pypy.config.pypyoption import get_pypy_config, set_pypy_opt_level
 
 config = get_pypy_config(translating=True)
+config.translation.backendopt.inline_threshold = 0
 set_opt_level(config, level='1')
 config.objspace.compiler = 'ast'
 config.objspace.nofaking = True

Modified: pypy/branch/pyjitpl5/pypy/rpython/rlist.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/rpython/rlist.py	(original)
+++ pypy/branch/pyjitpl5/pypy/rpython/rlist.py	Thu Feb 26 14:01:41 2009
@@ -987,7 +987,6 @@
 def ll_listremove(lst, obj, eqfn):
     index = ll_listindex(lst, obj, eqfn) # raises ValueError if obj not in lst
     ll_delitem_nonneg(dum_nocheck, lst, index)
-ll_listremove.oopspec = 'list.remove(obj)'
 
 def ll_inplace_mul(l, factor):
     length = l.ll_length()



More information about the Pypy-commit mailing list