New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8277417: C1 LIR instruction for load-klass #6464
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thank you!
@rkennke This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 76 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
|
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a nice change. I only found one problem on Power.
CodeEmitInfo* info = op->info(); | ||
if (info != NULL) { | ||
add_debug_info_for_null_check_here(info); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is incorrect for AIX. Note that the first page is not read protected on that OS. To make it consistent with other places, I suggest:
diff --git a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
index a772e48f3be..23e03cb36e3 100644
--- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
+++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
@@ -2733,7 +2733,11 @@ void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) {
CodeEmitInfo* info = op->info();
if (info != NULL) {
- add_debug_info_for_null_check_here(info);
+ if (!os::zero_page_read_protected() || !ImplicitNullChecks) {
+ explicit_null_check(obj, info);
+ } else {
+ add_debug_info_for_null_check_here(info);
+ }
}
if (UseCompressedClassPointers) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I pushed a fix for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we have the info != NULL
check twice, now. Otherwise, good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested tier1 on 32-bit Arm and AArch64. 32-bit Arm had some failures but they don't seem to be related to this patch.
add_debug_info_for_null_check_here(info); | ||
} | ||
|
||
if (UseCompressedClassPointers) { // On 32 bit arm?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably leftover from when the "arm" port supported both 32- and 64-bit.
@@ -986,14 +986,7 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch | |||
__ ldr(dest->as_register(), as_Address(from_addr)); | |||
break; | |||
case T_ADDRESS: | |||
// FIXME: OMG this is a horrible kludge. Any offset from an | |||
// address that matches klass_offset_in_bytes() will be loaded | |||
// as a word, not a long. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha! I am so glad to see this horrible kludge removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, a very welcome fix. I wish I had done something like this at the time of the AArch64 port, but I was neither brave enough nor knew enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice change! Please remove the duplicated info != NULL
check before integrating.
CodeEmitInfo* info = op->info(); | ||
if (info != NULL) { | ||
add_debug_info_for_null_check_here(info); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we have the info != NULL
check twice, now. Otherwise, good.
/integrate |
Going to push as commit 99e4bda.
Your commit was automatically rebased without conflicts. |
In C1, the load of a Klass* out of an object is currently identified by a load of type T_ADDRESS with offset oopDest::klass_offset_in_bytes(). When encountering such load, this may be decoded when +CompressedClassPointers. This is problematic and ugly: if we ever emit a T_ADDRESS load with offset 8 or 4 (== klass_offset_in_bytes) that is not a Klass*, we would attempt to decode the result. We have been lucky so far.
Also, in Lilliput, we want to do something entirely different there, and need to be able to emit more complex code, possibly including runtime call.
The change introduces a new C1 LIR opcode OpLoadKlass, and refactors the implementations in c1_LIRAssembler_xyz.cpp to emit the code there, instead of mem2reg(). Notice that I could not test anything but x86, all other platforms only received very basic testing via GHA. It would be nice if respective maintainers could give it a try.
Testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/6464/head:pull/6464
$ git checkout pull/6464
Update a local copy of the PR:
$ git checkout pull/6464
$ git pull https://git.openjdk.java.net/jdk pull/6464/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 6464
View PR using the GUI difftool:
$ git pr show -t 6464
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/6464.diff