On Tue, Mar 22, 2011 at 5:54 PM, Armin Rigo <arigo@tunes.org> wrote:
can_enter_jit() is not correct.  For it to work, it must be called
just before jit_merge_point().  It's wrong that there are two
intermediate instructions here: "pc+=1" and the "pc < len(program)"
condition.

Okay, I think I understand. I'm still learning how all this stuff works. Regardless... 

As a first attempt, you should just not call can_enter_jit() at all.
Nowadays, if can_enter_jit is never called, it's done automatically
for you;

I did not know this. Good to know!
 
I've removed the can_enter_jit() call from the two versions of my interpreter. However, the version that didn't work before still does not run correctly. It seems like I'm still left with the same problem as before.

This works (version without Tape class and with can_enter_jit call removed)
https://bitbucket.org/brownan/bf-interpreter/src/6c6c80397554/targetbf.py
Incidentally, I think it may run slightly slower now, but I'm not sure.

This version still does not (version with Tape class, and with can_enter_jit removed)
https://bitbucket.org/brownan/bf-interpreter/src/1d16c3eed7e2/targetbf.py

Any other ideas? I'm still at a loss. Thanks for taking a look!
-Andrew