[pypy-commit] pypy default: a flag to allow skipping argument checking in the jit driver when untranslated, this can take a lot of time

alex_gaynor noreply at buildbot.pypy.org
Fri Feb 15 17:18:23 CET 2013


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r61267:912ec202eba7
Date: 2013-02-15 08:17 -0800
http://bitbucket.org/pypy/pypy/changeset/912ec202eba7/

Log:	a flag to allow skipping argument checking in the jit driver when
	untranslated, this can take a lot of time

diff --git a/rpython/rlib/jit.py b/rpython/rlib/jit.py
--- a/rpython/rlib/jit.py
+++ b/rpython/rlib/jit.py
@@ -476,7 +476,7 @@
                  get_jitcell_at=None, set_jitcell_at=None,
                  get_printable_location=None, confirm_enter_jit=None,
                  can_never_inline=None, should_unroll_one_iteration=None,
-                 name='jitdriver'):
+                 name='jitdriver', check_untranslated=True):
         if greens is not None:
             self.greens = greens
         self.name = name
@@ -511,6 +511,7 @@
         self.confirm_enter_jit = confirm_enter_jit
         self.can_never_inline = can_never_inline
         self.should_unroll_one_iteration = should_unroll_one_iteration
+        self.check_untranslated = check_untranslated
 
     def _freeze_(self):
         return True
@@ -565,13 +566,15 @@
 
     def jit_merge_point(_self, **livevars):
         # special-cased by ExtRegistryEntry
-        _self._check_arguments(livevars)
+        if _self.check_untranslated:
+            _self._check_arguments(livevars)
 
     def can_enter_jit(_self, **livevars):
         if _self.autoreds:
             raise TypeError, "Cannot call can_enter_jit on a driver with reds='auto'"
         # special-cased by ExtRegistryEntry
-        _self._check_arguments(livevars)
+        if _self.check_untranslated:
+            _self._check_arguments(livevars)
 
     def loop_header(self):
         # special-cased by ExtRegistryEntry
diff --git a/rpython/rtyper/lltypesystem/rlist.py b/rpython/rtyper/lltypesystem/rlist.py
--- a/rpython/rtyper/lltypesystem/rlist.py
+++ b/rpython/rtyper/lltypesystem/rlist.py
@@ -246,6 +246,7 @@
     of the list to be 'newsize'."""
     _ll_list_resize_really(l, newsize, False)
 
+
 @jit.look_inside_iff(lambda l, newsize: jit.isconstant(len(l.items)) and jit.isconstant(newsize))
 @jit.oopspec("list._resize_ge(l, newsize)")
 def _ll_list_resize_ge(l, newsize):


More information about the pypy-commit mailing list