[pypy-dev] custom interpreter split_block error

Timothy Baldridge tbaldridge at gmail.com
Fri Aug 10 23:06:45 CEST 2012

I have a interpreter that translates fine, but when I turn on the JIT I get
the following error

[translation:ERROR]    File
"/home/tim/pypy/pypy/jit/metainterp/warmspot.py", line 266, in
[translation:ERROR]     graph.startblock =
[translation:ERROR]    File
"/home/tim/pypy/pypy/jit/codewriter/support.py", line 79, in
[translation:ERROR]     link = split_block(None, portalblock, 0, greens_v +
[translation:ERROR]    File "/home/tim/pypy/pypy/translator/unsimplify.py",
line 105, in split_block
[translation:ERROR]     assert v.concretetype is lltype.Void
[translation:ERROR]  AssertionError

My merge point looks like this:

                jitdriver.jit_merge_point(ip = self._ip,
                                          func = self._call_stack[-1],
                                          args = self._arg_stack[-1],
                                          stack = self._sp)

>From what I can tell of the source, this is something to do with one of my
variables infact being a constant and not a variable. What am I doing
wrong? I'm generating my bytecode at runtime via an AST:

def run_benchmark(times):
    max = Argument("max")
    cur = Argument("cur")
    ast = If(Equal(max, cur), cur, Call(CurFunc(), Add(cur,
Const(W_Int(1))), max))
    f = Func([cur, max], ast)

    #value = Interpreter(f.toFunction()).main_loop(W_Int(0),
    value = Interpreter(f.toFunction()).main_loop(W_Int(0),

    return value

Could it be that the translator is propagating my function through as a
constant? I.e. I'm basically hard-coding my byte code via the AST.

Thank for any help,

Timothy Baldridge
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120810/7dadb4d2/attachment.html>

More information about the pypy-dev mailing list