RFR(S): 8221083: [ppc64] Wrong oop compare in C1-generated code

Florian Weimer fw at deneb.enyo.de
Tue Mar 19 21:47:34 UTC 2019


* Volker Simonis:

> The regression test reproduces the issue by allocation an object at an
> address with the 32-bit least significant bits being zero and comperes
> it with another null object.

  79         for (int i = 0; i < 10; i++) {
  80             System.gc();
  81             for (int j = 0; j < 1024; j++) {
  82                 s = new String("I'm not null!!!");
  83                 if (WB.getObjectAddress(s) == 0x700000000L) break;
  84             }
  85             if (WB.getObjectAddress(s) == 0x700000000L) {
  86                 System.out.println("Got object at address 0x700000000");
  87                 break;
  88             }
  89         }

I think this could use a labeled loop, like this:

        GC_TESTS: for (int i = 0; i < 10; i++) {
            System.gc();
            for (int j = 0; j < 1024; j++) {
                s = new String("I'm not null!!!");
                if (WB.getObjectAddress(s) == 0x700000000L) {
                    System.out.println("Got object at address 0x700000000");
                    break GC_TESTS;
                }
            }
        }

(Untested.)

On the other hand, neither this version or yours properly detects when
s is *not* actually the object with the desired address, in which case
the test objective fails to materialize, I think.


More information about the hotspot-compiler-dev mailing list