[master] RFR: Load Klass from header, C1/x86 implementation [v2]

Andrew Haley aph at openjdk.java.net
Wed Oct 27 09:07:33 UTC 2021


On Mon, 18 Oct 2021 10:23:36 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp line 1260:
>> 
>>> 1258: 
>>> 1259:     case T_ADDRESS:
>>> 1260:       __ movptr(dest->as_register(), from_addr);
>> 
>> Can we / should we `assert(addr->disp() != oopDesc::klass_offset_in_bytes(), "sanity")` here and later? So that the non-`LoadKlass` loads would break early?
>
> Not sure, tbh. The current implementation is quite brittle, and we are lucky that we have apparently never hit (emit) a load with offset 8 (or 4 on x86_32) which happens to be klass_offset_in_bytes().

Well, yeah. I was appalled when I saw that when translating into AArch64 code. I thought "Are you serious?"

-------------

PR: https://git.openjdk.java.net/lilliput/pull/20


More information about the lilliput-dev mailing list