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: Changes to interpreter to avoid non-debugging slowdown


Tom Tromey wrote:
"Kyle" == Kyle Galloway <kgallowa@redhat.com> writes:

Tom> We talked about it offline and the idea is, we need to track the types Tom> of stack and local variable slots while interpreting if the debugging Tom> code is enabled. However, we don't want to do this unconditionally as Tom> it adds overhead to interpretation.

So, I looked at JVMTI a little more.  It seems that we only need to
know the types of locals, is that correct?

I'm wondering now if it is worthwhile to make an entire second
interpreter just for this. Perhaps an extra store in the various
'store' instructions is not too much overhead.
There are other reasons for this as well, in addition to what Keith said. If we want the full suite of event notifications, we need to add code to check for them so it could mean a slew of conditional checks to see if we are debugging. If we instead can just #ifdef this code into the debugging version, it will mean we don't have to do conditional checks in either case since we will know at the invocation of run() or run_debug() whether we should report debug info or not.
That said, your updated patch is looking pretty good to me.
One more addition I didn't think of yesterday: you have to update
stacktrace.cc to account for the new interpreter.
Small oversight on my part, I've fixed it. I had also forgot about the change in ncode() in the changelog. New changelog and new patch attached.

2006-07-28 Kyle Galloway <kgallowa@redhat.com>

* /include/java-interp.h (_Jv_InterpMethod::run_debug): New method.
* /interpret.cc: Added placeholder for debug variable type info to STORE*
macros.
(_Jv_InterpMethod::run_debug): New method.
(_Jv_InterpMethod::run_sync_object_debug): New method.
(_Jv_InterpMethod::run_sync_class_debug): New method.
(_Jv_InterpMethod::run_normal_debug): New method.
(_Jv_InterpMethod::run_class_debug): New method.
(_Jv_InterpMethod::ncode ()): Changed to select either debug or normal
versions of these functions.
* /interpret-run.cc: New file, holds contents of old _Jv_InterpMethod::run
method.
* /stacktrace.cc (_Jv_StackTrace::UnwindTraceFn): Changed to select
appropriate function for debug or normal mode.



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