RFR: 8025856 - Fix typos in the GC code (original) (raw)
Vladimir Kozlov vladimir.kozlov at oracle.com
Wed Jan 22 20:06:23 PST 2014
- Previous message: RFR: 8025856 - Fix typos in the GC code
- Next message: RFR(M): 8027754: Enable loop optimizations for loops with MathExact inside
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
New comment is correct, uncommon traps are generated as call with one input parameter - trap_reason.
Thanks, Vladimir
On 1/22/14 7:43 PM, Krystal Mok wrote:
Hi John,
On Wed, Jan 22, 2014 at 6:50 PM, John Coomes <John.Coomes at oracle.com_ _<mailto:John.Coomes at oracle.com>> wrote: opto/runtime.cpp: fields[TypeFunc::Parms+0] = TypeInt::INT; // trapreason (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::uncommontrapblob to: Deoptimization::UnrollBlock* Deoptimization::uncommontrap(JavaThread* thread, jint traprequest) The "thread" argument came from uncommontrapblob; the "traprequest" argument came from constant embedded in compiled code. And this "traprequest" is the thing described by OptoRuntime::uncommontrapType(). Back in JDK1.4.2-ish or maybe even earlier, the signature of this function was: Deoptimization::UnrollBlock*, Deoptimization::uncommontrap(JavaThread* thread, jint unloadedclassindex) where "unloadedclassindex" 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::generateuncommontrapblob() is also out of date: e.g. hotspot/src/cpu/x86/vm/sharedRuntimex8664.cpp // compiler left unloadedclassindex in jrarg0 move to where the // runtime expects it. __ movl(crarg1, jrarg0);_ "unloadedclassindex" should be "trapreason" now.
-John -- John Coomes Oracle, MS USCA22-3?? john.coomes at oracle.com <mailto:john.coomes at oracle.com> 4220 Network Circle 408-276-7048 tel:408-276-7048 Santa Clara, CA 95054-1778 *** Support GreenPeace and we'll all breathe easier. ***
- Previous message: RFR: 8025856 - Fix typos in the GC code
- Next message: RFR(M): 8027754: Enable loop optimizations for loops with MathExact inside
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the hotspot-compiler-dev mailing list