RFR: 8025856 - Fix typos in the GC code

Krystal Mok rednaxelafx at gmail.com
Wed Jan 22 19:43:41 PST 2014


Hi John,

On Wed, Jan 22, 2014 at 6:50 PM, John Coomes <John.Coomes at oracle.com> wrote:
>
> opto/runtime.cpp:
>
>    fields[TypeFunc::Parms+0] = TypeInt::INT; // trap_reason (deopt reason
> and action)
>
>    The comment you added is not obviously correct; did someone from
>    the compiler team check this?  If the comment is correct, the code
>    is crazily obscure!
>
> Yes, I proposed this change. The old comment had been out of date even
before JDK6.

duke at 0:
line 392 of
http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/file/a61af66fc99e/src/share/vm/opto/runtime.cpp

The corresponding runtime call goes through
SharedRuntime::uncommon_trap_blob to:

Deoptimization::UnrollBlock* Deoptimization::uncommon_trap(JavaThread*
thread, jint trap_request)

The "thread" argument came from uncommon_trap_blob; the "trap_request"
argument came from constant embedded in compiled code.
And this "trap_request" is the thing described by
OptoRuntime::uncommon_trap_Type().

Back in JDK1.4.2-ish or maybe even earlier, the signature of this function
was:

Deoptimization::UnrollBlock*, Deoptimization::uncommon_trap(JavaThread*
thread, jint unloaded_class_index)

where "unloaded_class_index" was a constant pool index of a class if >= 0,
or other deopt cases if < 0.

I'm not sure when it changed to its current form... waiting for someone
else to share the history :-)
Maybe the comment had been out of date longer then I thought.

Speaking of this, the comment
in SharedRuntime::generate_uncommon_trap_blob() is also out of date:

e.g. hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp

  // compiler left unloaded_class_index in j_rarg0 move to where the
  // runtime expects it.
  __ movl(c_rarg1, j_rarg0);

"unloaded_class_index" should be "trap_reason" now.


>
> -John
>
> --
> John Coomes                            Oracle, MS USCA22-3??
> john.coomes at oracle.com                 4220 Network Circle
> 408-276-7048                           Santa Clara, CA 95054-1778
>          *** Support GreenPeace and we'll all breathe easier. ***
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20140122/a227236e/attachment.html 


More information about the hotspot-compiler-dev mailing list