[RFA] REWRITE_INSN

Keith Seitz keiths@redhat.com
Mon Apr 23 21:33:00 GMT 2007


Hi,

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

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

This is my last critical patch before I'm ready to say "merge".

Questions/comments/concerns?
Keith

ChangeLog
2007-04-23  Keith Seitz  <keiths@redhat.com>

         * headers.txt (gnu/gcj/jvmti/Breakpoint.h)[DIRECT_THREADED]:
         Add _Jv_RewriteBreakpointInsn friend declaration.
         * gnu/gcj/jvmti/natBreakpoint.cc (_Jv_RewriteBreakpointInsn)
         [DIRECT_THREADED]: New function.
         * gnu/gcj/jvmti/Breakpoint.h: Regenerate.
         * interpret-run.cc: Define new REWRITE_INSN macro.
         Changed all occurrences of insn rewriting to call REWRITE_INSN.



More information about the Java-patches mailing list