Skip to content
Closed
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
2 changes: 1 addition & 1 deletion common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
}
}

/**
Expand Down Expand Up @@ -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;
}
Expand Down
Loading