[lworld] RFR: 8272307: [lworld] [AArch64] TestCallingConventionC1 test63 and test64 get incorrect result

Nick Gasson ngasson at openjdk.java.net
Thu Aug 12 09:11:03 UTC 2021


These two were hidden by the earlier IR test failures.  The errors look like:


  Caused by: java.lang.RuntimeException: assertEquals: expected -1163019586 to equal 777
  at jdk.test.lib.Asserts.fail(Asserts.java:594)
  at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
  at jdk.test.lib.Asserts.assertEquals(Asserts.java:189)
  at jdk.test.lib.Asserts.assertEQ(Asserts.java:166)
  at compiler.valhalla.inlinetypes.TestCallingConventionC1.test64_verifier(TestCallingConventionC1.java:1518)
  ... 9 more


In the C1 scalarised entry point we call a runtime stub to allocate objects for buffering the incoming inline types.  The runtime stub returns its result in r0 which is also j_rarg7 and might be holding a live argument value.  To work around this we temporarily move j_rarg7 into r21 which is known to be free at this point and then move it back after the call.  However if a GC occurs during the runtime call and an object held in j_rarg7 is moved, r21 will still be pointing at the old from-space copy after the call returns because it's not recorded in the oop map.  Fix that by having the stub return the object array in r20 and leave r0-r7 untouched.

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

Commit messages:
 - 8272307: [lworld] [AArch64] TestCallingConventionC1 test63 and test64 get incorrect result

Changes: https://git.openjdk.java.net/valhalla/pull/527/files
 Webrev: https://webrevs.openjdk.java.net/?repo=valhalla&pr=527&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8272307
  Stats: 20 lines in 2 files changed: 7 ins; 8 del; 5 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/527.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/527/head:pull/527

PR: https://git.openjdk.java.net/valhalla/pull/527


More information about the valhalla-dev mailing list