[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-graal-dev
Subject: Re: RFR: 8315771: [JVMCI] Resolution of bootstrap methods with int[] static arguments [v13]
From: David Holmes <dholmes () openjdk ! org>
Date: 2023-09-22 1:05:36
Message-ID: smezELf8z-CJ_Rbfy7bPfw6yPyAlRVs1WGj_nsHNJhE=.bab4f132-0e34-4703-834b-32bc1f4afdb8 () github ! com
[Download RAW message or body]
On Thu, 21 Sep 2023 11:36:14 GMT, Sacha Coppey <duke@openjdk.org> wrote:
> > Currently, `jdk.vm.ci.meta.ConstantPool.lookupBootstrapMethodInvocation` does not \
> > support static arguments of type `int[]`.
> > Supporting those static arguments allows to correctly lookup the \
> > `BootstrapMethodInvocation` of some `InvokeDynamic` and `DynamicConstant`.
> > To lookup the constant at the index in the static arguments index list, a new \
> > class is introduced, allowing to lazily resolve the constant or obtain the \
> > constant pool index of the arguments:
> >
> > static class CachedBSMArgs extends AbstractList<JavaConstant> {
> > private final JavaConstant[] cache;
> > private final HotSpotConstantPool cp;
> > private final int bssIndex;
> >
> > CachedBSMArgs(HotSpotConstantPool cp, int bssIndex, int size) {
> > this.cp = cp;
> > this.bssIndex = bssIndex;
> > this.cache = new JavaConstant[size];
> > }
> >
> > @Override
> > public JavaConstant get(int index) {
> > JavaConstant res = cache[index];
> > if (res == null) {
> > int argCpi = compilerToVM().bootstrapArgumentIndexAt(cp, bssIndex, index);
> > res = compilerToVM().lookupConstantInPool(cp, argCpi, false);
> > if (res == null) {
> > res = JavaConstant.forInt(argCpi);
> > }
> > cache[index] = res;
> > }
> > return res;
> > }
> >
> > @Override
> > public int size() {
> > return cache.length;
> > }
> > }
>
> Sacha Coppey has updated the pull request incrementally with one additional commit \
> since the last revision:
> Iterate over all static arguments in TestDynamicConstant
test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/TestDynamicConstant.java \
line 36:
> 34: * jdk.vm.ci.hotspot.test.TestDynamicConstant
> 35: * @run testng/othervm
> 36: * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler \
> -XX:UseBootstrapCallInfo=3
Error: VM option 'UseBootstrapCallInfo' is diagnostic and must be enabled via \
-XX:+UnlockDiagnosticVMOptions.
New bug being filed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15588#discussion_r1333758461
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic