[RFA] REWRITE_INSN

Tom Tromey tromey@redhat.com
Mon Apr 23 22:50:00 GMT 2007


>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> The attached patch adds the macro REWRITE_INSN into the
Keith> interpreter. This macro simply replaces all the code in
Keith> interpret-run.cc that look like "pc[-2].insn = FOO; pc[-1].BAR = BAZ;"
Keith> with "REWRITE_INSN (FOO, BAR, BAZ);"

This code is so awful.  I regret writing it actually ... it is racy
for one thing.  Perhaps we should disable it.  Or make it non-racy,
which is possible though a bit tricky.

Anyway ... you didn't attach a patch, but I'm sure it is ok.

Keith> For the non-debugging case, REWRITE_INSN is simply the previous
Keith> (current) code. For the debugging case, REWRITE_INSN checks to see if
Keith> there is a breakpoint at pc[-2], and, if so, calls
Keith> _Jv_RewriteBreakpointInsn so that the new insn is saved into the
Keith> breakpoint. Without it, we would continue to try to run the "old"
Keith> insn, which really cripples the effectiveness of breakpoints. :-)

We could also simply disable rewriting for the debug case.

Tom



More information about the Java-patches mailing list