Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-51637] Directly use JVMCI for constant pool accesses #8275

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
*/
package jdk.graal.compiler.core.test;

import jdk.graal.compiler.serviceprovider.GraalServices;
import java.lang.reflect.Method;
import java.time.Clock;
import java.time.Instant;

import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.ConstantDynamic;
Expand All @@ -37,17 +39,12 @@

import jdk.vm.ci.meta.ResolvedJavaMethod;

import java.lang.reflect.Method;
import java.time.Clock;
import java.time.Instant;

public class ResolveDynamicConstantTest extends CustomizedBytecodePatternTest {

private static final int PUBLIC_STATIC = ACC_PUBLIC | ACC_STATIC;

@Test
public void test00601m001() throws Throwable {
Assume.assumeTrue(GraalServices.supportsNonresolvingLookupConstant());
runTest("test.resolveDynamicConstant00601m001");
}

Expand All @@ -64,7 +61,6 @@ public static void main(String[] args) {

@Test
public void test00602m008() throws Throwable {
Assume.assumeTrue(GraalServices.supportsNonresolvingLookupConstant());
runTest("test.resolveDynamicConstant00602m008");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.lang.reflect.InvocationTargetException;

import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.ClassWriter;
Expand All @@ -38,7 +37,6 @@

import jdk.graal.compiler.core.common.PermanentBailoutException;
import jdk.graal.compiler.core.test.SubprocessTest;
import jdk.graal.compiler.serviceprovider.GraalServices;
import jdk.graal.compiler.test.AddExports;
import jdk.graal.compiler.test.SubprocessUtil;
import jdk.jfr.Event;
Expand All @@ -60,7 +58,6 @@
public class TestGetEventWriter extends SubprocessTest {

private static void initializeJFR() {
Assume.assumeTrue("Requires JDK-8290075", GraalServices.hasLookupMethodWithCaller());
try (Recording r = new Recording()) {
r.start();
// Unlocks access to jdk.jfr.internal.event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
import static jdk.graal.compiler.bytecode.Bytecodes.TABLESWITCH;

import org.graalvm.collections.EconomicMap;
import jdk.graal.compiler.serviceprovider.GraalServices;

import jdk.vm.ci.meta.ConstantPool;
import jdk.vm.ci.meta.JavaConstant;
Expand Down Expand Up @@ -354,7 +353,7 @@ private void decodeOperand(StringBuilder buf, BytecodeStream stream, ConstantPoo
case LDC_W :
case LDC2_W : {
int cpi = stream.readCPI();
Object constant = GraalServices.lookupConstant(cp, cpi, false);
Object constant = cp.lookupConstant(cpi, false);
String desc = null;
if (constant == null) {
desc = "<unresolved>";
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@
import jdk.graal.compiler.phases.OptimisticOptimizations;
import jdk.graal.compiler.phases.util.ValueMergeUtil;
import jdk.graal.compiler.replacements.nodes.MacroInvokable;
import jdk.graal.compiler.serviceprovider.GraalServices;
import jdk.graal.compiler.serviceprovider.SpeculationReasonGroup;
import jdk.vm.ci.code.BailoutException;
import jdk.vm.ci.code.BytecodeFrame;
Expand Down Expand Up @@ -4393,14 +4392,11 @@ private JavaMethod lookupMethod(int cpi, int opcode) {
}

protected JavaMethod lookupMethodInPool(int cpi, int opcode) {
if (GraalServices.hasLookupMethodWithCaller()) {
try {
return GraalServices.lookupMethodWithCaller(constantPool, cpi, opcode, method);
} catch (IllegalAccessError e) {
throw new PermanentBailoutException(e, "cannot link call from %s", method.format("%H.%n(%p)"));
}
try {
return constantPool.lookupMethod(cpi, opcode, method);
} catch (IllegalAccessError e) {
throw new PermanentBailoutException(e, "cannot link call from %s", method.format("%H.%n(%p)"));
}
return constantPool.lookupMethod(cpi, opcode);
}

protected JavaField lookupField(int cpi, int opcode) {
Expand Down Expand Up @@ -4436,7 +4432,7 @@ protected JavaField lookupField(JavaField result) {
*/
protected Object lookupConstant(int cpi, int opcode, boolean allowBootstrapMethodInvocation) {
maybeEagerlyResolve(cpi, opcode);
Object result = GraalServices.lookupConstant(constantPool, cpi, allowBootstrapMethodInvocation);
Object result = constantPool.lookupConstant(cpi, allowBootstrapMethodInvocation);
if (result != null) {
assert !graphBuilderConfig.unresolvedIsError() || !(result instanceof JavaType) || (result instanceof ResolvedJavaType) : result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
import java.util.function.Supplier;

import org.graalvm.collections.Pair;
import jdk.graal.compiler.core.common.BootstrapMethodIntrospection;

import jdk.graal.compiler.graph.Node.ValueNumberable;
import jdk.graal.compiler.nodes.FixedWithNextNode;
import jdk.graal.compiler.nodes.FrameState;
import jdk.graal.compiler.nodes.StructuredGraph;
import jdk.graal.compiler.nodes.ValueNode;
import jdk.graal.compiler.nodes.extended.GuardingNode;

import jdk.vm.ci.meta.ConstantPool.BootstrapMethodInvocation;
import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.JavaTypeProfile;
import jdk.vm.ci.meta.ResolvedJavaField;
Expand Down Expand Up @@ -225,7 +225,7 @@ default boolean handleNewMultiArray(GraphBuilderContext b, ResolvedJavaType type
* @return pair with the call target & arguments for the static call, null if the indy cannot be
* converted to a static call
*/
default Pair<ResolvedJavaMethod, ValueNode[]> convertInvokeDynamic(GraphBuilderContext b, BootstrapMethodIntrospection m) {
default Pair<ResolvedJavaMethod, ValueNode[]> convertInvokeDynamic(GraphBuilderContext b, BootstrapMethodInvocation m) {
return null;
}

Expand Down

This file was deleted.

Loading
Loading