[pypy-svn] r48056 - pypy/dist/pypy/lang/smalltalk

arigo at codespeak.net arigo at codespeak.net
Fri Oct 26 14:49:15 CEST 2007


Author: arigo
Date: Fri Oct 26 14:49:15 2007
New Revision: 48056

Modified:
   pypy/dist/pypy/lang/smalltalk/interpreter.py
Log:
Print which bytecode is missing.  Useful in translated versions.


Modified: pypy/dist/pypy/lang/smalltalk/interpreter.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/interpreter.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/interpreter.py	Fri Oct 26 14:49:15 2007
@@ -6,8 +6,11 @@
 from pypy.rlib import objectmodel, unroll
 
 
-class MissingBytecode(NotImplementedError):
+class MissingBytecode(Exception):
     """Bytecode not implemented yet."""
+    def __init__(self, bytecodename):
+        self.bytecodename = bytecodename
+        print "MissingBytecode:", bytecodename     # hack for debugging
 
 class IllegalStoreError(Exception):
     """Illegal Store."""
@@ -184,7 +187,7 @@
         self._return(self.top(), interp, self.w_sender)
 
     def unknownBytecode(self, interp):
-        raise MissingBytecode
+        raise MissingBytecode("unknownBytecode")
 
     def extendedVariableTypeAndIndex(self):
         descriptor = self.getByte()
@@ -275,7 +278,7 @@
         self.pop()
 
     def experimentalBytecode(self, interp):
-        raise MissingBytecode
+        raise MissingBytecode("experimentalBytecode")
 
     def jump(self,offset):
         self.pc = self.pc + offset
@@ -348,7 +351,7 @@
         self.callPrimitiveAndPush(primitives.MOD, "\\", 1, interp)
 
     def bytecodePrimMakePoint(self, interp):
-        raise MissingBytecode
+        raise MissingBytecode("bytecodePrimMakePoint")
 
     def bytecodePrimBitShift(self, interp):
         self.callPrimitiveAndPush(primitives.BIT_SHIFT, "bitShift:", 1, interp)
@@ -372,16 +375,16 @@
         self.callPrimitiveAndPush(primitives.SIZE, "size", 0, interp)
 
     def bytecodePrimNext(self, interp):
-        raise MissingBytecode
+        raise MissingBytecode("bytecodePrimNext")
 
     def bytecodePrimNextPut(self, interp):
-        raise MissingBytecode
+        raise MissingBytecode("bytecodePrimNextPut")
 
     def bytecodePrimAtEnd(self, interp):
-        raise MissingBytecode
+        raise MissingBytecode("bytecodePrimAtEnd")
 
     def bytecodePrimEquivalent(self, interp):
-        raise MissingBytecode
+        raise MissingBytecode("bytecodePrimEquivalent")
 
     def bytecodePrimClass(self, interp):
         self.callPrimitiveAndPush(



More information about the Pypy-commit mailing list