Skip to content

Commit b7bea54

Browse files
committed
[GR-60743] More documentation in code generated by IntrinsicStubProcessor.
PullRequest: graal/20371
2 parents 0ad90d7 + 1c6d58a commit b7bea54

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

compiler/src/jdk.graal.compiler.processor/src/jdk/graal/compiler/lir/processor/IntrinsicStubProcessor.java

+27
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ private void createStubs(AbstractProcessor processor, TargetVM targetVM, TypeEle
325325
}
326326
}
327327
out.printf("\n");
328+
out.println("// generated by: IntrinsicStubProcessor");
328329
out.printf("public class %s ", genClassName);
329330
if (targetVM == TargetVM.hotspot) {
330331
out.printf("extends SnippetStub ");
@@ -409,6 +410,10 @@ private void createStubs(AbstractProcessor processor, TargetVM targetVM, TypeEle
409410

410411
private void generateStub(TargetVM targetVM, PrintWriter out, Name className, String methodName, List<String> params, ExecutableElement m, String runtimeCheckedFeatures,
411412
int runtimeCheckedFeaturesParameterIndex) {
413+
out.printf(" // method: %s.%s\n", className, removePackageNames(m.toString()));
414+
if (runtimeCheckedFeatures != null) {
415+
out.println(" // runtime-checked CPU features variant, i.e. variant compiled with CPU features not present in the feature set selected by the -march option");
416+
}
412417
switch (targetVM) {
413418
case hotspot:
414419
out.printf(" @Snippet\n");
@@ -455,4 +460,26 @@ private void generateStub(TargetVM targetVM, PrintWriter out, Name className, St
455460
out.printf(" }\n");
456461
out.printf("\n");
457462
}
463+
464+
private static String removePackageNames(String signature) {
465+
StringBuilder sb = new StringBuilder(signature.length());
466+
int i = signature.indexOf('(') + 1;
467+
assert i > 0;
468+
sb.append(signature, 0, i);
469+
while (i < signature.length()) {
470+
int end = signature.indexOf(',', i);
471+
if (end < 0) {
472+
end = signature.length() - 1;
473+
}
474+
int start = signature.lastIndexOf('.', end);
475+
if (start < i) {
476+
start = i;
477+
} else {
478+
start++;
479+
}
480+
i = end + 1;
481+
sb.append(signature, start, i);
482+
}
483+
return sb.toString();
484+
}
458485
}

truffle/src/com.oracle.truffle.api.strings/src/com/oracle/truffle/api/strings/TruffleString.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -7302,11 +7302,11 @@ abstract static class InternalSwitchEncodingNode extends AbstractInternalNode {
73027302
@Specialization
73037303
static TruffleString immutable(Node node, TruffleString a, Encoding targetEncoding, TranscodingErrorHandler errorHandler,
73047304
@Cached TStringInternalNodes.GetPreciseCodeRangeWithMaterializationNode getPreciseCodeRangeNode,
7305-
@Cached InlinedConditionProfile isCompatibleProfile,
7306-
@Cached InlinedConditionProfile noOpProfile,
7307-
@Cached InlinedConditionProfile mustCompactProfile,
7308-
@Cached InlinedConditionProfile compact10Profile,
7309-
@Cached InlinedConditionProfile compact20Profile,
7305+
@Cached @Exclusive InlinedConditionProfile isCompatibleProfile,
7306+
@Cached @Exclusive InlinedConditionProfile noOpProfile,
7307+
@Cached @Exclusive InlinedConditionProfile mustCompactProfile,
7308+
@Cached @Exclusive InlinedConditionProfile compact10Profile,
7309+
@Cached @Exclusive InlinedConditionProfile compact20Profile,
73107310
@Cached @Exclusive InlinedConditionProfile cacheHit,
73117311
@Cached @Exclusive InlinedConditionProfile managedProfileA,
73127312
@Cached @Exclusive InlinedConditionProfile nativeProfileA,

0 commit comments

Comments
 (0)