From fdd0352884cdbba8a9cd11c6f92f0c2fbd800e11 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Wed, 19 May 2021 13:59:46 +0000 Subject: [PATCH] 8267338: [JVMCI] revive JVMCI API removed by JDK-8243287 Reviewed-by: mchung, hseigel --- .../src/jdk/vm/ci/meta/ResolvedJavaType.java | 9 +++++++++ .../src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java | 1 + 2 files changed, 10 insertions(+) diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java index 211cae51f56..b1f5b4e6b69 100644 --- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java +++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java @@ -136,6 +136,15 @@ public interface ResolvedJavaType extends JavaType, ModifiersProvider, Annotated */ boolean isAssignableFrom(ResolvedJavaType other); + /** + * Returns {@code null} since support for VM anonymous class was removed by JDK-8243287. + * This method is preserved for JVMCI backwards compatibility. + */ + @Deprecated + default ResolvedJavaType getHostClass() { + return null; + } + /** * Returns true if this type is exactly the type {@link java.lang.Object}. */ diff --git a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java index c367fcda304..a8e293a623b 100644 --- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java +++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java @@ -1116,6 +1116,7 @@ public class TestResolvedJavaType extends TypeUniverse { "isLinked", "getJavaClass", "getObjectHub", + "getHostClass", "hasFinalizableSubclass", "hasFinalizer", "isLocal",