[pypy-svn] r7275 - pypy/trunk/src/goal
hpk at codespeak.net
hpk at codespeak.net
Tue Nov 16 12:03:06 CET 2004
Author: hpk
Date: Tue Nov 16 12:03:05 2004
New Revision: 7275
Added:
pypy/trunk/src/goal/buildcache.py
- copied, changed from r7269, pypy/trunk/src/goal/testcachebuild.py
Removed:
pypy/trunk/src/goal/testcachebuild.py
Modified:
pypy/trunk/src/goal/translate_pypy.py
Log:
almost integrate building of caches into translate_pypy.py
(you just need to un-comment the buildcache(space) line)
Copied: pypy/trunk/src/goal/buildcache.py (from r7269, pypy/trunk/src/goal/testcachebuild.py)
==============================================================================
--- pypy/trunk/src/goal/testcachebuild.py (original)
+++ pypy/trunk/src/goal/buildcache.py Tue Nov 16 12:03:05 2004
@@ -42,16 +42,18 @@
#######################################################
-def triggercachebuild(space):
+def buildcache(space):
+ print "triggering cache build for %r" % space
triggerall(space)
triggerexec(space)
+ space._typecache = frozendict(space._typecache)
+ space._faketypecache = frozendict(space._faketypecache)
+ space._gatewaycache = frozendict(space._gatewaycache)
+ print "cache build finished, caches are 'frozen' now"
if __name__ == '__main__':
space = option.objspace('std')
- triggercachebuild(space)
+ buildcache(space)
#testit.main(autopath.pypydir)
- space._typecache = frozendict(space._typecache)
- space._faketypecache = frozendict(space._faketypecache)
- space._gatewaycache = frozendict(space._gatewaycache)
testit.main(os.path.join(autopath.pypydir)) # , 'objspace', 'std'))
Deleted: /pypy/trunk/src/goal/testcachebuild.py
==============================================================================
--- /pypy/trunk/src/goal/testcachebuild.py Tue Nov 16 12:03:05 2004
+++ (empty file)
@@ -1,57 +0,0 @@
-from pypy.tool import option, autopath, testit
-from pypy.interpreter import gateway
-from pypy.tool.frozendict import frozendict
-import os
-
-#######################################################
-def app_triggerall():
- import sys, types # , exceptions
- k = 42
- def gen():
- yield k
- #yield (k, 1.0, 4L, [''], {}, unicode, Ellipsis)
- try:
- raise ValueError
- except ValueError:
- x = sys.exc_info()
- try:
- raise x[0], x[1], x[2]
- except ValueError:
- pass
-
- gen.func_code.co_name
- str({'co_name': ('f',)}), str(object.__init__.im_func.func_code)
- "for %r" % ({'x': gen})
- ("%02d"%1)
- ("%05d"%1)
- ("%-05d"%1)
- ("%04f"%2.25)
- ("%05g"%2.25)
- ("%-05g"%2.25)
- ("%05s"%2.25)
- ('<%s>' % [1,2])
- ('<%s-%s>' % ([1,2], [3,4]))
-
- for x in gen():
- pass
-
-def app_triggerexec():
- exec "i=3"
-
-gateway.importall(globals()) # app_xxx() -> xxx()
-
-#######################################################
-
-def triggercachebuild(space):
- triggerall(space)
- triggerexec(space)
-
-if __name__ == '__main__':
- space = option.objspace('std')
- triggercachebuild(space)
- #testit.main(autopath.pypydir)
- space._typecache = frozendict(space._typecache)
- space._faketypecache = frozendict(space._faketypecache)
- space._gatewaycache = frozendict(space._gatewaycache)
-
- testit.main(os.path.join(autopath.pypydir)) # , 'objspace', 'std'))
Modified: pypy/trunk/src/goal/translate_pypy.py
==============================================================================
--- pypy/trunk/src/goal/translate_pypy.py (original)
+++ pypy/trunk/src/goal/translate_pypy.py Tue Nov 16 12:03:05 2004
@@ -2,12 +2,12 @@
#
#
import autopath, sys
-
from pypy.objspace.std.objspace import StdObjSpace, W_Object
from pypy.objspace.std.intobject import W_IntObject
from pypy.translator.translator import Translator
from pypy.annotation import model as annmodel
+import buildcache
# __________ Entry point __________
@@ -23,6 +23,7 @@
global t
t = Translator(entry_point, verbose=True, simplifying=True)
space = StdObjSpace()
+ #buildcache.buildcache(space)
a = t.annotate([annmodel.immutablevalue(space)])
a.simplify()
More information about the Pypy-commit
mailing list