[pypy-svn] r9750 - in pypy/dist: goal pypy/annotation

pedronis at codespeak.net pedronis at codespeak.net
Fri Mar 11 19:39:33 CET 2005


Author: pedronis
Date: Fri Mar 11 19:39:33 2005
New Revision: 9750

Modified:
   pypy/dist/goal/translate_pypy0.py
   pypy/dist/pypy/annotation/builtin.py
Log:
* dummy annotation for sys.exc_info. This is just a hack. In reality we should hide is usage from the translator

* cheat in translate_pypy0 to deal with the app-level helpers 

* added code so that we can even try to run the result

Right now translate_pypy0 manages to go through annotating the touched interp code with a few remaining problems,
it can even start to run a compiled result but then chokes on a problem with Stack instances. We specialize
Stack so that could be related.



Modified: pypy/dist/goal/translate_pypy0.py
==============================================================================
--- pypy/dist/goal/translate_pypy0.py	(original)
+++ pypy/dist/goal/translate_pypy0.py	Fri Mar 11 19:39:33 2005
@@ -55,6 +55,11 @@
 
     pycode.setup_frame_classes()
 
+    from pypy.interpreter import pyopcode
+
+    # cheat
+    space._gatewaycache.content[pyopcode.app] =  space.newdict([])
+
     t = Translator(entry_point, verbose=True, simplifying=True)
     if listen_port:
         run_async_server()
@@ -268,10 +273,8 @@
             update_usession_dir()
             if not options['-o']:
                 print 'Running!'
-                w_result = c_entry_point()
+                w_result = c_entry_point(compile("a+b","<stuff>","eval"),dummy.W_Obj())
                 print w_result
-                print w_result.intval
-                assert w_result.intval == 42
     except:
         debug(True)
     else:

Modified: pypy/dist/pypy/annotation/builtin.py
==============================================================================
--- pypy/dist/pypy/annotation/builtin.py	(original)
+++ pypy/dist/pypy/annotation/builtin.py	Fri Mar 11 19:39:33 2005
@@ -200,6 +200,9 @@
 def math_floor(x):
     return SomeObject()
 
+def exc_info(): # XXX
+    return SomeTuple((immutablevalue(None),)*3)
+
 # collect all functions
 import __builtin__
 BUILTIN_ANALYZERS = {}
@@ -214,3 +217,4 @@
 BUILTIN_ANALYZERS[sys.getrefcount] = count
 BUILTIN_ANALYZERS[math.fmod] = math_fmod
 BUILTIN_ANALYZERS[math.floor] = math_floor
+BUILTIN_ANALYZERS[sys.exc_info] = exc_info # xxx



More information about the Pypy-commit mailing list