[pypy-svn] r75531 - pypy/branch/fast-forward/pypy/interpreter

benjamin at codespeak.net benjamin at codespeak.net
Wed Jun 23 19:02:32 CEST 2010


Author: benjamin
Date: Wed Jun 23 19:02:31 2010
New Revision: 75531

Modified:
   pypy/branch/fast-forward/pypy/interpreter/pyopcode.py
Log:
move cpython opcodes to CPythonFrame

Modified: pypy/branch/fast-forward/pypy/interpreter/pyopcode.py
==============================================================================
--- pypy/branch/fast-forward/pypy/interpreter/pyopcode.py	(original)
+++ pypy/branch/fast-forward/pypy/interpreter/pyopcode.py	Wed Jun 23 19:02:31 2010
@@ -814,18 +814,6 @@
         next_instr += jumpby
         return next_instr
 
-    def JUMP_IF_FALSE(self, stepby, next_instr):
-        w_cond = self.peekvalue()
-        if not self.space.is_true(w_cond):
-            next_instr += stepby
-        return next_instr
-
-    def JUMP_IF_TRUE(self, stepby, next_instr):
-        w_cond = self.peekvalue()
-        if self.space.is_true(w_cond):
-            next_instr += stepby
-        return next_instr
-
     def POP_JUMP_IF_FALSE(self, target, next_instr):
         w_value = self.popvalue()
         if not self.space.is_true(w_value):
@@ -1030,6 +1018,7 @@
         ofs = self.last_instr
         c = self.pycode.co_code[ofs]
         name = self.pycode.co_name
+        self.pycode.dump()
         raise BytecodeCorruption("unknown opcode, ofs=%d, code=%d, name=%s" %
                                  (ofs, ord(c), name) )
 
@@ -1043,7 +1032,19 @@
         raise BytecodeCorruption
 
 
-class __extends__(pyframe.CPythonFrame):
+class __extend__(pyframe.CPythonFrame):
+
+    def JUMP_IF_FALSE(self, stepby, next_instr):
+        w_cond = self.peekvalue()
+        if not self.space.is_true(w_cond):
+            next_instr += stepby
+        return next_instr
+
+    def JUMP_IF_TRUE(self, stepby, next_instr):
+        w_cond = self.peekvalue()
+        if self.space.is_true(w_cond):
+            next_instr += stepby
+        return next_instr
 
     def BUILD_MAP(self, itemcount, next_instr):
         if sys.version_info >= (2, 6):



More information about the Pypy-commit mailing list