Author: Lars Wassermann <[email protected]>
Branch:
Changeset: r125:2f7194263d4b
Date: 2013-03-06 21:10 +0100
http://bitbucket.org/pypy/lang-smalltalk/changeset/2f7194263d4b/
Log: (tfel, lwassermann): updated the targettinybenchsmalltalk to reflect
the jit test changes needed because of interpreter restructuring
diff --git a/targettinybenchsmalltalk.py b/targettinybenchsmalltalk.py
--- a/targettinybenchsmalltalk.py
+++ b/targettinybenchsmalltalk.py
@@ -15,45 +15,27 @@
# compile...
sys.setrecursionlimit(100000)
-
-def tinyBenchmarks():
+def setup():
from spyvm import objspace
space = objspace.ObjSpace()
image = create_testimage(space)
- interp = interpreter.Interpreter(space)
+ interp = interpreter.Interpreter(space, image)
+ w_selector = interp.perform(space.wrap_string("loopTest"), "asSymbol")
+ w_object = model.W_SmallInteger(0)
+ s_class = w_object.shadow_of_my_class(space)
+ s_method = s_class.lookup(w_selector)
+ s_frame = s_method.create_frame(space, w_object, [])
+ return interp, s_frame
- w_object = model.W_SmallInteger(0)
-
- s_class = w_object.shadow_of_my_class(space)
- w_method = s_class.lookup("loopTest")
-
- assert w_method
- w_frame = w_method.create_frame(space, w_object, [])
- interp.store_w_active_context(w_frame)
-
- counter = 0
-
- from spyvm.interpreter import BYTECODE_TABLE
- return interp
-
-
-interp = tinyBenchmarks()
-
+interp, s_frame = setup()
def entry_point(argv):
- counter = 0
try:
- while True:
- counter += 1
- interp.interpret()
- if counter == 100000:
- counter = 0
- os.write(2, '#')
+ interp.loop(s_frame.w_self())
except interpreter.ReturnFromTopLevel, e:
w_result = e.object
-
- assert isinstance(w_result, model.W_BytesObject)
- print w_result.as_string()
+ assert isinstance(w_result, model.W_BytesObject)
+ print w_result.as_string()
return 0
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit