Skip to content

Commit

Permalink
Move reflection config into reflect-config.json
Browse files Browse the repository at this point in the history
  • Loading branch information
fniephaus committed Sep 23, 2023
1 parent 78058e5 commit 22da80b
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,9 @@
],
"methods": [{ "name": "<init>", "parameterTypes": ["int", "int", "int", "int"] }]
},
{ "name": "java.awt.MenuComponent", "fields": [{ "name": "appContext" }] },
{
"name": "java.awt.MenuComponent",
"fields": [{ "name": "appContext" }]
},
{ "name": "java.awt.MenuItem",
"name": "java.awt.MenuItem",
"methods": [
{ "name": "getActionCommand", "parameterTypes": [ ] },
{ "name": "getLabel", "parameterTypes": [ ] }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,74 @@
[
{
"name": "com.oracle.svm.enterprise.truffle.SubstrateEnterpriseOptimizedCallTarget",
"methods": [
{ "name": "getCallCount", "parameterTypes": [ ] },
{ "name": "getCallAndLoopCount", "parameterTypes": [ ] },
{ "name": "getKnownCallSiteCount", "parameterTypes": [ ] },
{ "name": "getNonTrivialNodeCount", "parameterTypes": [ ] },
{ "name": "toString", "parameterTypes": [ ] }
]
},
{
"name": "com.oracle.svm.truffle.api.SubstrateOptimizedCallTarget",
"allDeclaredFields": true,
"methods": [
{ "name": "getCallCount", "parameterTypes": [ ] },
{ "name": "getCallAndLoopCount", "parameterTypes": [ ] },
{ "name": "getKnownCallSiteCount", "parameterTypes": [ ] },
{ "name": "getNonTrivialNodeCount", "parameterTypes": [ ] },
{ "name": "toString", "parameterTypes": [ ] }
]
},
{
"name": "com.oracle.svm.truffle.api.SubstrateTruffleRuntime",
"methods": [
{ "name": "getCompileQueue", "parameterTypes": [ ] },
{ "name": "getCompilationQueueSize", "parameterTypes": [ ] },
{ "name": "getName", "parameterTypes": [ ] },
{ "name": "toString", "parameterTypes": [ ] }
]
},
{
"name": "com.oracle.truffle.runtime.BackgroundCompileQueue",
"allDeclaredFields": true,
"methods": [
{ "name": "getQueueSize", "parameterTypes": [ ] },
{ "name": "toString", "parameterTypes": [ ] }
]
},
{
"name": "com.oracle.truffle.runtime.OptimizedCallTarget",
"allDeclaredFields": true,
"methods": [
{ "name": "getCallCount", "parameterTypes": [ ] },
{ "name": "getCallAndLoopCount", "parameterTypes": [ ] },
{ "name": "getKnownCallSiteCount", "parameterTypes": [ ] },
{ "name": "getNonTrivialNodeCount", "parameterTypes": [ ] },
{ "name": "toString", "parameterTypes": [ ] }
]
},
{
"name": "com.oracle.truffle.runtime.OptimizedCallTarget$ArgumentsProfile",
"allDeclaredFields": true,
"allDeclaredMethods": true
},
{
"name": "com.oracle.truffle.runtime.OptimizedCallTarget$ReturnProfile",
"allDeclaredFields": true,
"allDeclaredMethods": true
},
{
"name": "com.oracle.truffle.runtime.OptimizedDirectCallNode",
"allDeclaredFields": true,
"allDeclaredMethods": true
},
{
"name": "java.awt.Frame",
"methods": [
{ "name": "getFrames", "parameterTypes": [ ] },
{ "name": "getTitle", "parameterTypes": [ ] },
{ "name": "setTitle", "parameterTypes": [ "java.lang.String" ] }
{ "name": "setTitle", "parameterTypes": ["java.lang.String"] }
]
},
{ "name": "java.awt.Image" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ protected HashMap<String, Field> computeValue(final Class<?> type) {
}

private boolean ignoredForAOT(final Class<?> cls) {
final String simpleName = cls.getSimpleName();
return "Class".equals(simpleName) || "SubstrateTruffleRuntime".equals(simpleName) || "GraalTruffleRuntime".equals(simpleName);
return "Class".equals(cls.getSimpleName());
}
};
private static final ClassValue<HashMap<String, Method>> CLASSES_TO_METHODS = new ClassValue<>() {
Expand Down Expand Up @@ -169,14 +168,6 @@ private boolean ignoredForAOT(final Method method) {
return true;
}
return !ArrayUtils.containsEqual(new String[]{"getCanonicalName", "getName", "getSimpleName", "isInstance", "toString"}, methodName);
case "SubstrateTruffleRuntime":
case "GraalTruffleRuntime": // superclass of SubstrateTruffleRuntime
return !ArrayUtils.containsEqual(new String[]{"getCompileQueue", "getCompilationQueueSize", "getName", "toString"}, methodName);
case "SubstrateOptimizedCallTarget":
case "SubstrateEnterpriseOptimizedCallTarget":
return !ArrayUtils.containsEqual(new String[]{"getCallCount", "getCallAndLoopCount", "getCallNodes", "getKnownCallSiteCount", "getNonTrivialNodeCount", "toString"}, methodName);
case "BackgroundCompileQueue":
return !ArrayUtils.containsEqual(new String[]{"getQueueSize", "toString"}, methodName);
default:
return false;
}
Expand Down Expand Up @@ -219,25 +210,6 @@ protected InteropArray computeValue(final Class<?> type) {
CLASSES_TO_MEMBERS.get(cls);
CLASSES_TO_MEMBERS.get(Array.newInstance(cls, 0).getClass()); // Add array classes
}

try {
for (final String className : new String[]{
// Truffle runtime class and BackgroundCompileQueue
// "com.oracle.svm.truffle.api.SubstrateTruffleRuntime",
"com.oracle.truffle.runtime.BackgroundCompileQueue",
// For CallTargetBrowser
"com.oracle.svm.truffle.api.SubstrateOptimizedCallTarget",
"com.oracle.svm.enterprise.truffle.SubstrateEnterpriseOptimizedCallTarget",
"com.oracle.truffle.runtime.OptimizedCallTarget",
"com.oracle.truffle.runtime.OptimizedCallTarget$ArgumentsProfile",
"com.oracle.truffle.runtime.OptimizedCallTarget$ReturnProfile",
"com.oracle.truffle.runtime.OptimizedDirectCallNode"
}) {
CLASSES_TO_MEMBERS.get(Class.forName(className));
}
} catch (final ClassNotFoundException e) {
e.printStackTrace();
}
}
}

Expand Down

1 comment on commit 22da80b

@TruffleSqueak-Bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance Report (22da80b)

Benchmarks ran on graalvm-jdk-21+35.1.

Steady (after 100 iterations)

Benchmark Name Min Geomean Median Mean Max Total (ms) Total (min)
Bounce 537 553 540.12 538 540.11 108024 1.8
CD 441 453 444.77 443 444.75 88953 1.48
DeltaBlue 271 480 409.42 401 407.73 81884 1.36
Havlak 1113 1162 1142.19 1148 1142.12 228438 3.81
Json 367 385 373.75 374 373.73 74750 1.25
List 292 326 303.51 303 303.44 60702 1.01
Mandelbrot 125 143 125.8 126 125.79 25160 0.42
NBody 248 267 251.76 250 251.74 50352 0.84
Permute 149 160 150.66 150 150.65 30132 0.5
Queens 231 246 232.07 232 232.06 46413 0.77
Richards 1221 1283 1226.41 1225 1226.38 245281 4.09
Sieve 185 204 186.24 186 186.23 37248 0.62
Storage 137 146 138.84 138 138.82 27767 0.46
Towers 194 206 197.31 196 197.28 39462 0.66
5511 6014 5722.83 5710 5720.83 1144566 19.08

22da80b-2-steady.svg

Warmup (first 100 iterations)

22da80b-3-warmup.svg

Please sign in to comment.