diff --git a/common.json b/common.json index 2d1601d47b59..da3ff37bf36c 100644 --- a/common.json +++ b/common.json @@ -8,7 +8,7 @@ "COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet", "jdks": { - "galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+24-2970", "platformspecific": true, "extrabundles": ["static-libs"]}, + "galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+26-3156", "platformspecific": true, "extrabundles": ["static-libs"]}, "oraclejdk17": {"name": "jpg-jdk", "version": "17.0.7", "build_id": "jdk-17.0.7+8", "platformspecific": true, "extrabundles": ["static-libs"]}, "labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.1-b02", "platformspecific": true }, diff --git a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/HotSpotGraalServices.java b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/HotSpotGraalServices.java index 337d6c3e0b56..719eed994871 100644 --- a/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/HotSpotGraalServices.java +++ b/compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/HotSpotGraalServices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import jdk.graal.compiler.core.common.LibGraalSupport; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotObjectConstantScope; +import jdk.vm.ci.hotspot.HotSpotProfilingInfo; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotSpeculationLog; import jdk.vm.ci.hotspot.VMIntrinsicMethod; @@ -48,9 +49,6 @@ public class HotSpotGraalServices { private static final Method methodGetOopMapAt; - private static final Class hotspotProfilingInfoClass; - private static final Method getDecompileCountMethod; - private static final Field methodDataField; static { Method getOopMapAt = null; @@ -61,18 +59,6 @@ public class HotSpotGraalServices { } methodGetOopMapAt = getOopMapAt; - - try { - @SuppressWarnings("unchecked") - Class hotspotMethodData = Class.forName("jdk.vm.ci.hotspot.HotSpotMethodData"); - hotspotProfilingInfoClass = Class.forName("jdk.vm.ci.hotspot.HotSpotProfilingInfo"); - methodDataField = hotspotProfilingInfoClass.getDeclaredField("methodData"); - methodDataField.setAccessible(true); - getDecompileCountMethod = hotspotMethodData.getDeclaredMethod("getDecompileCount"); - getDecompileCountMethod.setAccessible(true); - } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException e) { - throw new InternalError("decompile count isn't available", e); - } } /** @@ -108,13 +94,8 @@ public static BitSet getOopMapAt(ResolvedJavaMethod method, int bci) { */ public static int getDecompileCount(ResolvedJavaMethod method) { ProfilingInfo info = method.getProfilingInfo(); - if (hotspotProfilingInfoClass.isAssignableFrom(info.getClass())) { - try { - Object methodData = methodDataField.get(info); - return (int) getDecompileCountMethod.invoke(methodData); - } catch (IllegalAccessException | InvocationTargetException e) { - throw new RuntimeException(info.toString(), e); - } + if (info instanceof HotSpotProfilingInfo hotSpotProfilingInfo) { + return hotSpotProfilingInfo.getDecompileCount(); } return -1; }