Request Review: 6902182: Starting with jdwp agent should not incur performance penalty

Tom Rodriguez Thomas.Rodriguez at Sun.COM
Wed Dec 9 14:04:15 PST 2009

Why can't you use a flag in the JavaThread instead of performing a runtime call every time?  That just seems too expensive and complicated for every exception.  I don't think we want this under a flag either.  It should be the default behaviour.

By the way, another thing I think you want to fix is this code in runtime.cpp:

    if (JvmtiExport::can_post_exceptions()) {
      // "Full-speed catching" is not necessary here,                                                         
      // since we're notifying the VM on every catch.                                                         
      // Force deoptimization and the rest of the lookup                                                     
      // will be fine.                                                                                       
      deoptimize_caller_frame(thread, true);

It should also be checking that someone actually wants to see the exception.  There's similar code in c1_Runtime1.cpp.  I don't the client compiler needs any other changes to work properly with debug enabled.


On Dec 9, 2009, at 1:31 PM, Deneau, Tom wrote:

> Webrev is at
> This webrev changes two places in the compiler where code for exception
> throws is being JITted.
>   * previously these checked jvmti_can_post_exceptions() at compile
>     time, compiling in a slow path if true
>   * now they call a new jvmtiExport::must_post_exception_events at
>     run time, and take a faster path if must_post_exception_events is
>     false.
> must_post_exception_events uses logic similar to that used
> by jvmtiExport::post_exception_throw and returns false if
> jvmtiExport::post_exception_throw wouldn't have done anything.
> A similar change of calling must_post_exception_events instead of
> jvmti_can_post_exceptions is made in the exception runtime code in
> trace_exception in opto/runtime.cpp
> Throughput Numbers from a JIRA-based web workload (JIRA makes fairly heavy use
> of exception throws and catches).  Bigger is better.
>   unmodified hotspot, no jdwp agent       69.7
>   unmodified hotspot, with jdwp agent     11.8 
>   modified hotspot, with jdwp agent       65.7
> All changes are platform-independent.
> -- Tom Deneau
>   tom.deneau at

More information about the hotspot-compiler-dev mailing list