[aarch64-port-dev ] RFR: 8195685: AArch64: AArch64 cannot build with JDK-8174962

Andrew Dinn adinn at redhat.com
Mon Jan 22 12:41:39 UTC 2018


Hi Ningsheng,

I believe this is an unrelated bug and that this test could never have
worked before the patch.

The failing gtest executes this code:

TEST_VM(code, vtableStubs) {
  // Should be in VM to use locks
  ThreadInVMfromNative ThreadInVMfromNative(JavaThread::current());

  VtableStubs::find_vtable_stub(0); // min vtable index
  for (int i = 0; i < 15; i++) {
    VtableStubs::find_vtable_stub((1 << i) - 1);
    VtableStubs::find_vtable_stub((1 << i));
  }
  VtableStubs::find_vtable_stub((1 << 15) - 1); // max vtable index
}

So, it is calling VtableStubs::find_vtable_stub with values up to 1<< 15.

Method find_vtable_stub calls passes the index along to
create_vtable_stub which again passes it on to method
MacroAssembler::lookup_virtual_method. This index is a constant so it is
scaled by wordSize and passed directly to ldr. I guess a size check is
needed to detect offsets that cannto be inserted as an immediate.

    vtable_offset_in_bytes += vtable_index.as_constant() * wordSize;
    ldr(method_result, Address(recv_klass, vtable_offset_in_bytes));

So, I'm going to push the current (8195685) patch as is and leave this
problem to be handled as a separate issue. Thanks for testing the patch.
I'll add you to the list of reviewers before pushing.

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander


More information about the aarch64-port-dev mailing list