RFR: 8297036: Generalize C2 stub mechanism
Roman Kennke
rkennke at openjdk.org
Tue Nov 22 17:09:03 UTC 2022
On Wed, 16 Nov 2022 15:03:07 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
> Currently, we have two implementations of out-of-line stubs in C2, one for safepoint poll stubs (C2SafepointPollStubTable in output.hpp) and another for nmmethod entry barriers (C2EntryBarrierStubTable in output.hpp). I will need a few more for Lilliput: One for checking lock-stack size in method prologue, one for handling lock failures (both for fast-locking), and another one for load-klass slow-path. It would be good to generalize the mechanism and consolidate the existing uses on the new general mechanism.
>
> Testing:
> - [x] tier1 (x86_64, x86_32, aarch64)
> - [x] tier2 (x86_64, x86_32, aarch64)
> - [x] tier3 (x86_64, x86_32, aarch64)
@RealFYang, @tstuefe could you check what might be wrong with this PR? RISCV and PPC builds complain with:
> > > undefined reference to `vtable for C2SafepointPollStub'
> >
> >
> > I don't think the newly added [c2_CodeStubs.cpp](https://github.com/openjdk/jdk/pull/11188/files#diff-290de220f9ef00679e975edd8e14fca00873e5d4acc734c81f4893ebaaa1484c) even compiles, because this should fail:
> > ```
> > __ assert_alignment(pc());
> > ```
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > You probably need to call it `c2_CodeStubs_riscv.cpp`? This might be some weird build system quirk?
>
> Ah. "Of course." You have `share/opto/c2_CodeStubs.cpp` and `cpu/riscv/c2_CodeStubs.cpp`. Only one gets compiled. Don't clash the compilation unit names :)
Indeed. Duh. Thanks for finding it, I've been scratching my head why the linker complains on PPC and RISCV.
-------------
PR: https://git.openjdk.org/jdk/pull/11188
More information about the hotspot-compiler-dev
mailing list