[aarch64-port-dev ] RFR: 8195685: AArch64: AArch64 cannot build with JDK-8174962 (original) (raw)
David Holmes david.holmes at oracle.com
Tue Jan 23 10:36:42 UTC 2018
- Previous message: [aarch64-port-dev ] RFR: 8195685: AArch64: AArch64 cannot build with JDK-8174962
- Next message: [aarch64-port-dev ] RFR: 8195685: AArch64: AArch64 cannot build with JDK-8174962
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Adding in hotspot-dev and Jesper
Hi Andrew,
On 23/01/2018 8:16 PM, Andrew Dinn wrote:
On 23/01/18 08:46, Andrew Dinn wrote:
I am afraid I messed up by pushing the patch for 8195685 to both jdkdev/jdk and jdkdev/hs. While the former was correct and approved by Vladimir the latter was a stupid neglect of the appropriate protocol on my part. Apologies for making such a mess. The patch included below reverts the erroneous push of 8195685 to jdk/hs. I'm not sure of the procedure to get this into the repo but until that is resolved this can be used by anyone working on AArch64 to get their hg tree back to a clean state.
I don't think you want to push this to jdk/hs, else you'll have a worse problem. If this undoes the fix, and the changeset with the fix is already seen to be in jdk/hs then when we sync with jdk/jdk we will end up without the fix!
You may be lucky in that Jesper has been holding off pulling jdk/jdk into jdk/hs due to some test failures in jdk/jdk. If those are fixed (and I know one has been) then Jesper may merge jdk/jdk to jdk/hs "real soon now" and all the necessary pieces will be in place in jdk/hs.
David
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 ----- 8< -------- 8< -------- 8< -------- 8< -------- 8< -------- 8< ---_ _# HG changeset patch_ _# User adinn_ _# Date 1516702051 0_ _# Tue Jan 23 10:07:31 2018 +0000_ _# Node ID a7e77acacaad73682a6dd70801502dad55450d41_ _# Parent 8f451978683ce3193c302f6140ecf05afee1754a_ _revert wrong commit of 8195685_ _diff -r 8f451978683c -r a7e77acacaad_ _src/hotspot/cpu/aarch64/macroAssembleraarch64.cpp_ _--- a/src/hotspot/cpu/aarch64/macroAssembleraarch64.cpp Tue Jan 23_ _08:55:47 2018 +0100_ _+++ b/src/hotspot/cpu/aarch64/macroAssembleraarch64.cpp Tue Jan 23_ _10:07:31 2018 +0000_ _@@ -963,12 +963,8 @@_ _RegisterOrConstant_ _itableindex,_ _Register methodresult,_ _Register scantemp,_ _- Label& Lnosuchinterface,_ _- bool returnmethod) {_ _- assertdifferentregisters(recvklass, intfklass, scantemp);_ _- assertdifferentregisters(methodresult, intfklass, scantemp);_ _- assert(recvklass != methodresult || !returnmethod,_ _- "recvklass can be destroyed when method isn't needed");_ _+ Label& Lnosuchinterface) {_ _+ assertdifferentregisters(recvklass, intfklass, methodresult,_ _scantemp);_ _assert(itableindex.isconstant() || itableindex.asregister() ==_ _methodresult,_ _"caller must use same register for non-constant itable index_ _as for method");_ _@@ -986,14 +982,12 @@_ _lea(scantemp, Address(recvklass, scantemp, Address::lsl(3)));_ _add(scantemp, scantemp, vtablebase);_ _- if (returnmethod) {_ _- // Adjust recvklass by scaled itableindex, so we can free_ _itableindex._ _- assert(itableMethodEntry::size() * wordSize == wordSize, "adjust_ _the scaling in the code below");_ _- // lea(recvklass, Address(recvklass, itableindex,_ _Address::timesptr, itentryoff));_ _- lea(recvklass, Address(recvklass, itableindex, Address::lsl(3)));_ _- if (itentryoff)_ _- add(recvklass, recvklass, itentryoff);_ _- }_ _+ // Adjust recvklass by scaled itableindex, so we can free itableindex._ _+ assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the_ _scaling in the code below");_ _+ // lea(recvklass, Address(recvklass, itableindex,_ _Address::timesptr, itentryoff));_ _+ lea(recvklass, Address(recvklass, itableindex, Address::lsl(3)));_ _+ if (itentryoff)_ _+ add(recvklass, recvklass, itentryoff);_ _// for (scan = klass->itable(); scan->interface() != NULL; scan += scanstep) { // if (scan->interface() == intf) { @@ -1027,10 +1021,8 @@ bind(foundmethod); // Got a hit. - if (returnmethod) { - ldrw(scantemp, Address(scantemp, itableOffsetEntry::offsetoffsetinbytes())); - ldr(methodresult, Address(recvklass, scantemp, Address::uxtw(0))); - } + ldr(scantemp, Address(scantemp, itableOffsetEntry::offsetoffsetinbytes())); + ldr(methodresult, Address(recvklass, scantemp)); } // virtual method calling diff -r 8f451978683c -r a7e77acacaad src/hotspot/cpu/aarch64/macroAssembleraarch64.hpp --- a/src/hotspot/cpu/aarch64/macroAssembleraarch64.hpp Tue Jan 23 08:55:47 2018 +0100 +++ b/src/hotspot/cpu/aarch64/macroAssembleraarch64.hpp Tue Jan 23 10:07:31 2018 +0000 @@ -875,8 +875,7 @@ RegisterOrConstant itableindex, Register methodresult, Register scantemp, - Label& nosuchinterface, - bool returnmethod = true); + Label& nosuchinterface); // virtual method calling // n.b. x86 allows RegisterOrConstant for vtableindex diff -r 8f451978683c -r a7e77acacaad src/hotspot/cpu/aarch64/templateTableaarch64.cpp --- a/src/hotspot/cpu/aarch64/templateTableaarch64.cpp Tue Jan 23 08:55:47 2018 +0100 +++ b/src/hotspot/cpu/aarch64/templateTableaarch64.cpp Tue Jan 23 10:07:31 2018 +0000 @@ -3279,11 +3279,11 @@ transition(vtos, vtos); assert(byteno == f1byte, "use this argument"); - prepareinvoke(byteno, r0, rmethod, // get f1 Klass*, f2 Method* + prepareinvoke(byteno, r0, rmethod, // get f1 Klass*, f2 itable index r2, r3); // recv, flags // r0: interface klass (from f1) - // rmethod: method (from f2) + // rmethod: itable index (from f2) // r2: receiver // r3: flags @@ -3302,27 +3302,10 @@ __ nullcheck(r2, oopDesc::klassoffsetinbytes());_ __ loadklass(r3, r2);_ - Label nosuchinterface, nosuchmethod; - - // Receiver subtype check against REFC. - // Superklass in r0. Subklass in r3. Blows rscratch2, r13 - _ lookupinterfacemethod(// inputs: rec. class, interface, itable index - r3, r0, noreg, - // outputs: scan temp. reg, scan temp. reg - rscratch2, r13, - nosuchinterface, - /returnmethod=/false); - // profile this call __ profilevirtualcall(r3, r13, r19);_ - // Get declaring interface class from method, and itable index - _ ldr(r0, Address(rmethod, Method::constoffset())); - _ ldr(r0, Address(r0, ConstMethod::constantsoffset())); - _ ldr(r0, Address(r0, ConstantPool::poolholderoffsetinbytes())); - _ ldrw(rmethod, Address(rmethod, Method::itableindexoffset())); - _ subw(rmethod, rmethod, Method::itableindexmax); - _ negw(rmethod, rmethod); + Label nosuchinterface, nosuchmethod; __ lookupinterfacemethod(// inputs: rec. class, interface, itable index_ r3, r0, rmethod, diff -r 8f451978683c -r a7e77acacaad src/hotspot/cpu/aarch64/vtableStubsaarch64.cpp --- a/src/hotspot/cpu/aarch64/vtableStubsaarch64.cpp Tue Jan 23 08:55:47 2018 +0100 +++ b/src/hotspot/cpu/aarch64/vtableStubsaarch64.cpp Tue Jan 23 10:07:31 2018 +0000 @@ -29,7 +29,6 @@ #include "code/vtableStubs.hpp" #include "interpmasmaarch64.hpp" #include "memory/resourceArea.hpp" -#include "oops/compiledICHolder.hpp" #include "oops/instanceKlass.hpp" #include "oops/klassVtable.hpp" #include "runtime/sharedRuntime.hpp" @@ -141,44 +140,28 @@ #endif // Entry arguments: - // rscratch2: CompiledICHolder + // rscratch2: Interface // jrarg0: Receiver - - // Most registers are in use; we'll use r0, rmethod, r10, r11 - const Register recvklassreg = r10; - const Register holderklassreg = r0; // declaring interface klass (DECC) - const Register resolvedklassreg = rmethod; // resolved interface klass (REFC) - const Register tempreg = r11; - const Register icholderreg = rscratch2; - - Label Lnosuchinterface; - - _ ldr(resolvedklassreg, Address(icholderreg, CompiledICHolder::holderklassoffset())); - _ ldr(holderklassreg, Address(icholderreg, CompiledICHolder::holdermetadataoffset())); + // Free registers (non-args) are r0 (interface), rmethod // get receiver (need to skip return address on top of stack) + assert(VtableStub::receiverlocation() == jrarg0->asVMReg(), "receiver expected in jrarg0"); // get receiver klass (also an implicit null-check) address npeaddr = _ pc(); - _ loadklass(recvklassreg, jrarg0); - // Receiver subtype check against REFC. - // Destroys recvklassreg value. - _ lookupinterfacemethod(// inputs: rec. class, interface - recvklassreg, resolvedklassreg, noreg, - // outputs: scan temp. reg1, scan temp. reg2 - recvklassreg, tempreg, - Lnosuchinterface, - /returnmethod=/false); + // Most registers are in use; we'll use r0, rmethod, r10, r11 + _ loadklass(r10, jrarg0); - // Get selected method from declaring class and itable index - _ loadklass(recvklassreg, jrarg0); // restore recvklassreg + Label throwicce; + + // Get Method* and entrypoint for compiler __ lookupinterfacemethod(// inputs: rec. class, interface, itable index_ - recvklassreg, holderklassreg, itableindex, - // outputs: method, scan temp. reg - rmethod, tempreg, - Lnosuchinterface); + r10, rscratch2, itableindex, + // outputs: method, scan temp. reg + rmethod, r11, + throwicce); // method (rmethod): Method* // jrarg0: receiver @@ -200,7 +183,7 @@ __ ldr(rscratch1, Address(rmethod, Method::fromcompiledoffset()));_ __ br(rscratch1);_ - _ bind(Lnosuchinterface); + _ bind(throwicce);
farjump(RuntimeAddress(StubRoutines::throwIncompatibleClassChangeErrorentry()));
__ flush();_ @@ -222,11 +205,11 @@ int size = DebugVtables ? 216 : 0; if (CountCompiledCalls) size += 6 * 4; - // FIXME: vtable stubs only need 36 bytes + // FIXME if (isvtablestub) size += 52; else - size += 176; + size += 104; return size; // In order to tune these parameters, run the JVM with VM options @@ -234,58 +217,33 @@ // actual itable stubs. Run it with -Xmx31G -XX:+UseCompressedOops. // // If Universe::narrowklassbase is nonzero, decoding a compressed - // class can take zeveral instructions. + // class can take zeveral instructions. Run it with -Xmx31G + // -XX:+UseCompressedOops. // // The JVM98 app. 202jess has a megamorphic interface call. // The itable code looks like this: - - // ldr xmethod, [xscratch2,#CompiledICHolder::holderklassoffset] - // ldr x0, [xscratch2] - // ldr w10, [x1,#oopDesc::klassoffsetinbytes] - // mov xheapbase, #0x3c000000 // #narrowklassbase - // movk xheapbase, #0x3f7, lsl #32 - // add x10, xheapbase, x10 - // mov xheapbase, #0xe7ff0000 // #heapbase - // movk xheapbase, #0x3f7, lsl #32 - // ldr w11, [x10,#vtablelengthoffset] - // add x11, x10, x11, uxtx #3 - // add x11, x11, #itableMethodEntry::methodoffsetinbytes - // ldr x10, [x11] - // cmp xmethod, x10 - // b.eq foundmethod - // search: - // cbz x10, nosuchinterface - // add x11, x11, #0x10 - // ldr x10, [x11] - // cmp xmethod, x10 - // b.ne search - // foundmethod: - // ldr w10, [x1,#oopDesc::klassoffsetinbytes] - // mov xheapbase, #0x3c000000 // #narrowklassbase - // movk xheapbase, #0x3f7, lsl #32 - // add x10, xheapbase, x10 - // mov xheapbase, #0xe7ff0000 // #heapbase - // movk xheapbase, #0x3f7, lsl #32 - // ldr w11, [x10,#vtablelengthoffset] - // add x11, x10, x11, uxtx #3 - // add x11, x11, #itableMethodEntry::methodoffsetinbytes - // add x10, x10, #itentryoff - // ldr xmethod, [x11] - // cmp x0, xmethod - // b.eq foundmethod2 - // search2: - // cbz xmethod, 0x000003ffa872e6cc - // add x11, x11, #0x10 - // ldr xmethod, [x11] - // cmp x0, xmethod - // b.ne search2 - // foundmethod2: - // ldr w11, [x11,#itableOffsetEntry::offsetoffsetinbytes] - // ldr xmethod, [x10,w11,uxtw] - // ldr xscratch1, [xmethod,#Method::fromcompiledoffset] - // br xscratch1 - // nosuchinterface: - // b throwICCEentry + // Decoding VtableStub itbl[1]@12 + // ldr w10, [x1,#8] + // lsl x10, x10, #3 + // ldr w11, [x10,#280] + // add x11, x10, x11, uxtx #3 + // add x11, x11, #0x1b8 + // ldr x12, [x11] + // cmp x9, x12 + // b.eq success + // loop: + // cbz x12, throwicce + // add x11, x11, #0x10 + // ldr x12, [x11] + // cmp x9, x12 + // b.ne loop + // success: + // ldr x11, [x11,#8] + // ldr x12, [x10,x11] + // ldr x8, [x12,#72] + // br x8 + // throwicce: + // b throwICCEentry } ----- 8< -------- 8< -------- 8< -------- 8< -------- 8< -------- 8< ---
- Previous message: [aarch64-port-dev ] RFR: 8195685: AArch64: AArch64 cannot build with JDK-8174962
- Next message: [aarch64-port-dev ] RFR: 8195685: AArch64: AArch64 cannot build with JDK-8174962
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]