This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] REWRITE_INSN


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]