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