[pypy-svn] r53816 - pypy/branch/io-improvements/pypy/interpreter

fijal at codespeak.net fijal at codespeak.net
Wed Apr 16 03:47:01 CEST 2008


Author: fijal
Date: Wed Apr 16 03:46:59 2008
New Revision: 53816

Modified:
   pypy/branch/io-improvements/pypy/interpreter/pyframe.py
   pypy/branch/io-improvements/pypy/interpreter/pyopcode.py
Log:
Don't globally import rstack


Modified: pypy/branch/io-improvements/pypy/interpreter/pyframe.py
==============================================================================
--- pypy/branch/io-improvements/pypy/interpreter/pyframe.py	(original)
+++ pypy/branch/io-improvements/pypy/interpreter/pyframe.py	Wed Apr 16 03:46:59 2008
@@ -9,8 +9,6 @@
 import opcode
 from pypy.rlib.objectmodel import we_are_translated, instantiate
 from pypy.rlib.jit import we_are_jitted, hint
-from pypy.rlib import rstack # for resume points
-
 
 # Define some opcodes used
 g = globals()
@@ -102,6 +100,7 @@
 
     def execute_frame(self):
         """Execute this frame.  Main entry point to the interpreter."""
+        from pypy.rlib import rstack
         executioncontext = self.space.getexecutioncontext()
         executioncontext.enter(self)
         try:

Modified: pypy/branch/io-improvements/pypy/interpreter/pyopcode.py
==============================================================================
--- pypy/branch/io-improvements/pypy/interpreter/pyopcode.py	(original)
+++ pypy/branch/io-improvements/pypy/interpreter/pyopcode.py	Wed Apr 16 03:46:59 2008
@@ -18,7 +18,6 @@
 from pypy.tool.stdlib_opcode import opcodedesc, HAVE_ARGUMENT
 from pypy.tool.stdlib_opcode import unrolling_opcode_descs
 from pypy.tool.stdlib_opcode import opcode_method_names
-from pypy.rlib import rstack # for resume points
 from pypy.rlib.unroll import unrolling_iterable
 
 def unaryoperation(operationname):
@@ -70,6 +69,8 @@
 
     def dispatch(self, pycode, next_instr, ec):
         # For the sequel, force 'next_instr' to be unsigned for performance
+        from pypy.rlib import rstack # for resume points
+
         next_instr = r_uint(next_instr)
         co_code = pycode.co_code
 
@@ -82,6 +83,8 @@
             return self.popvalue()
 
     def handle_bytecode(self, co_code, next_instr, ec):
+        from pypy.rlib import rstack # for resume points
+
         try:
             next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
             rstack.resume_point("handle_bytecode", self, co_code, ec,
@@ -203,6 +206,8 @@
                 return next_instr
 
             if we_are_translated():
+                from pypy.rlib import rstack # for resume points
+
                 for opdesc in unrolling_opcode_descs:
                     # static checks to skip this whole case if necessary
                     if not opdesc.is_enabled(space):
@@ -850,6 +855,8 @@
                                   f.space.w_None)
                       
     def call_function(f, oparg, w_star=None, w_starstar=None):
+        from pypy.rlib import rstack # for resume points
+    
         n_arguments = oparg & 0xff
         n_keywords = (oparg>>8) & 0xff
         keywords = None
@@ -863,6 +870,8 @@
         f.pushvalue(w_result)
         
     def CALL_FUNCTION(f, oparg, *ignored):
+        from pypy.rlib import rstack # for resume points
+
         # XXX start of hack for performance
         if (oparg >> 8) & 0xff == 0:
             # Only positional arguments



More information about the Pypy-commit mailing list