RFR(xs): java.lang.Class.isPrimitive() (C1) returns wrong result if Klass* is aligned to 32bit

Andrew Haley aph at redhat.com
Tue Oct 29 09:32:47 UTC 2019


On 10/26/19 8:10 AM, Thomas Stüfe wrote:
> Yes, that might be clearer. I probably still would have to fix up
> LIR_Assembler::comp_op() for more than just x86, since most would not work
> for comparisons with T_ADDRESS constants.

I think this is just a problem for x86. We don't do anything like that
on AArch64, and we always generate a full-width comparison:

void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Op2* op) {
...
    if (opr2->is_constant()) {
...
      switch(opr2->type()) {
...
      case T_OBJECT:
      case T_ARRAY:
        jobject2reg(opr2->as_constant_ptr()->as_jobject(), rscratch1);
        __ cmpoop(reg1, rscratch1);

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the hotspot-compiler-dev mailing list