[pypy-svn] r64177 - pypy/trunk/pypy/translator/jvm/src/pypy

niko at codespeak.net niko at codespeak.net
Thu Apr 16 18:18:54 CEST 2009


Author: niko
Date: Thu Apr 16 18:18:54 2009
New Revision: 64177

Modified:
   pypy/trunk/pypy/translator/jvm/src/pypy/PyPyThrowable.java
Log:
(antocuni, niko)
Override fillInStackTrace() by default on PyPy-generated exceptions
to do nothing.  This improves performance somewhat.



Modified: pypy/trunk/pypy/translator/jvm/src/pypy/PyPyThrowable.java
==============================================================================
--- pypy/trunk/pypy/translator/jvm/src/pypy/PyPyThrowable.java	(original)
+++ pypy/trunk/pypy/translator/jvm/src/pypy/PyPyThrowable.java	Thu Apr 16 18:18:54 2009
@@ -5,4 +5,15 @@
 // because it makes it easy to catch RPython exceptions in our
 // automated tests (just catch any PyPyThrowable instance)
 public class PyPyThrowable extends Throwable
-{}
\ No newline at end of file
+{
+    // set the property pypy.keep.stack.trace if you want it:
+    public static final boolean pypyStackTrace =
+        Boolean.valueOf(System.getProperty("pypy.keep.stack.trace", "false"));
+        
+    // we don't use this in PyPy, so just do nothing:
+    public Throwable fillInStackTrace() {
+        if (pypyStackTrace)
+            return super.fillInStackTrace();
+        return this;
+    }
+}
\ No newline at end of file



More information about the Pypy-commit mailing list