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@oracle.com � � � � � � � � 4220 Network Circle
408-276-7048� � � � � � � � � � � � � �Santa Clara, CA 95054-1778
� � � � �*** Support GreenPeace and we'll all breathe easier. ***

">

(original) (raw)

Hi John,

On Wed, Jan 22, 2014 at 6:50 PM, John Coomes <John.Coomes@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@0:


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@oracle.com � � � � � � � � 4220 Network Circle
408-276-7048� � � � � � � � � � � � � �Santa Clara, CA 95054-1778
� � � � �\*\*\* Support GreenPeace and we'll all breathe easier. \*\*\*