[pypy-svn] r79775 - in pypy/branch/out-of-line-guards/pypy: interpreter module/pypyjit module/sys

fijal at codespeak.net fijal at codespeak.net
Fri Dec 3 13:33:31 CET 2010


Author: fijal
Date: Fri Dec  3 13:33:30 2010
New Revision: 79775

Modified:
   pypy/branch/out-of-line-guards/pypy/interpreter/function.py
   pypy/branch/out-of-line-guards/pypy/module/pypyjit/interp_jit.py
   pypy/branch/out-of-line-guards/pypy/module/sys/__init__.py
   pypy/branch/out-of-line-guards/pypy/module/sys/vm.py
Log:
A bit of improvements on calling by reducing number of getfields. To make
it work completely have to finish out of line guards


Modified: pypy/branch/out-of-line-guards/pypy/interpreter/function.py
==============================================================================
--- pypy/branch/out-of-line-guards/pypy/interpreter/function.py	(original)
+++ pypy/branch/out-of-line-guards/pypy/interpreter/function.py	Fri Dec  3 13:33:30 2010
@@ -29,7 +29,9 @@
     can_change_code = True
 
     _immutable_fields_ = ['w_func_globals', 'closure']
+    _jit_invariant_fields_ = ['defs_w', 'code']
 
+    @jit.dont_look_inside
     def __init__(self, space, code, w_globals=None, defs_w=[], closure=None,
                  forcename=None):
         self.space = space
@@ -334,6 +336,7 @@
             return space.w_None
         return space.newtuple(values_w)
 
+    @jit.dont_look_inside
     def fset_func_defaults(space, self, w_defaults):
         if space.is_w(w_defaults, space.w_None):
             self.defs_w = []
@@ -342,6 +345,7 @@
             raise OperationError( space.w_TypeError, space.wrap("func_defaults must be set to a tuple object or None") )
         self.defs_w = space.fixedview(w_defaults)
 
+    @jit.dont_look_inside
     def fdel_func_defaults(space, self):
         self.defs_w = []
 
@@ -387,6 +391,7 @@
     def fget_func_code(space, self):
         return space.wrap(self.code)
 
+    @jit.dont_look_inside
     def fset_func_code(space, self, w_code):
         from pypy.interpreter.pycode import PyCode
         if not self.can_change_code:

Modified: pypy/branch/out-of-line-guards/pypy/module/pypyjit/interp_jit.py
==============================================================================
--- pypy/branch/out-of-line-guards/pypy/module/pypyjit/interp_jit.py	(original)
+++ pypy/branch/out-of-line-guards/pypy/module/pypyjit/interp_jit.py	Fri Dec  3 13:33:30 2010
@@ -21,6 +21,8 @@
                             'fastlocals_w[*]',
                             'last_exception',
                             'lastblock',
+                            'w_globals',
+                            'is_being_profiled',
                             ]
 
 JUMP_ABSOLUTE = opmap['JUMP_ABSOLUTE']

Modified: pypy/branch/out-of-line-guards/pypy/module/sys/__init__.py
==============================================================================
--- pypy/branch/out-of-line-guards/pypy/module/sys/__init__.py	(original)
+++ pypy/branch/out-of-line-guards/pypy/module/sys/__init__.py	Fri Dec  3 13:33:30 2010
@@ -5,6 +5,9 @@
 
 class Module(MixedModule):
     """Sys Builtin Module. """
+
+    _jit_invariant_fields_ = ['recursionlimit']
+    
     def __init__(self, space, w_name):
         """NOT_RPYTHON""" # because parent __init__ isn't
         if space.config.translating:

Modified: pypy/branch/out-of-line-guards/pypy/module/sys/vm.py
==============================================================================
--- pypy/branch/out-of-line-guards/pypy/module/sys/vm.py	(original)
+++ pypy/branch/out-of-line-guards/pypy/module/sys/vm.py	Fri Dec  3 13:33:30 2010
@@ -4,6 +4,7 @@
 from pypy.interpreter.error import OperationError
 from pypy.interpreter.gateway import ObjSpace
 from pypy.rlib.runicode import MAXUNICODE
+from pypy.rlib import jit
 import sys
 
 # ____________________________________________________________
@@ -43,6 +44,7 @@
 
 # directly from the C code in ceval.c, might be moved somewhere else.
 
+ at jit.dont_look_inside
 def setrecursionlimit(space, w_new_limit):
     """Set the maximum depth of the Python interpreter stack to n.  This
 limit prevents infinite recursion from causing an overflow of the C



More information about the Pypy-commit mailing list