Skip to content

Commit 10a5d1a

Browse files
committed
Post rebase fixes.
1 parent 64e0344 commit 10a5d1a

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/PartialEvaluator.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
import jdk.vm.ci.meta.ResolvedJavaType;
8484
import jdk.vm.ci.meta.SpeculationLog.SpeculationReason;
8585

86+
import static jdk.graal.compiler.annotation.AnnotationValueSupport.getDeclaredAnnotationValues;
87+
8688
/**
8789
* Class performing the partial evaluation starting from the root node of an AST.
8890
*/
@@ -202,22 +204,21 @@ public static ConstantFieldInfo computeConstantFieldInfo(ResolvedJavaField field
202204
}
203205

204206
public static PartialEvaluationMethodInfo computePartialEvaluationMethodInfo(ResolvedJavaMethod method,
205-
Collection<AnnotationValue> annotationValues,
207+
Map<ResolvedJavaType, AnnotationValue> declaredAnnotationValues,
206208
KnownTruffleTypes types) {
207-
AnnotationValue truffleBoundary = getAnnotationValue(types.CompilerDirectives_TruffleBoundary, annotationValues);
208-
AnnotationValue truffleCallBoundary = getAnnotationValue(types.TruffleCallBoundary, annotationValues);
209-
boolean specialization = hasAnnotationValue(types.Specialization, annotationValues);
209+
AnnotationValue truffleBoundary = declaredAnnotationValues.get(types.CompilerDirectives_TruffleBoundary);
210+
AnnotationValue truffleCallBoundary = declaredAnnotationValues.get(types.TruffleCallBoundary);
211+
boolean specialization = declaredAnnotationValues.get(types.Specialization) != null;
212+
AnnotationValue explodeLoop = declaredAnnotationValues.get(types.ExplodeLoop);
210213

211-
return new PartialEvaluationMethodInfo(getLoopExplosionKind(annotationValues, types),
214+
return new PartialEvaluationMethodInfo(getLoopExplosionKind(explodeLoop),
212215
getInlineKind(truffleBoundary, truffleCallBoundary, method, true, types),
213216
getInlineKind(truffleBoundary, truffleCallBoundary, method, false, types),
214217
method.canBeInlined(),
215218
specialization);
216219
}
217220

218-
private static LoopExplosionKind getLoopExplosionKind(Collection<AnnotationValue> annotationValues,
219-
KnownTruffleTypes types) {
220-
AnnotationValue value = getAnnotationValue(types.ExplodeLoop, annotationValues);
221+
private static LoopExplosionKind getLoopExplosionKind(AnnotationValue value) {
221222
if (value == null) {
222223
return LoopExplosionKind.NONE;
223224
}

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/truffle/hotspot/HotSpotPartialEvaluator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ protected Object createKey(ResolvedJavaMethod method) {
179179

180180
@Override
181181
protected PartialEvaluationMethodInfo computeValue(ResolvedJavaMethod method) {
182-
Collection<AnnotationValue> declaredAnnotationValues = AnnotationValueSupport.getDeclaredAnnotationValues(method).values();
182+
Map<ResolvedJavaType, AnnotationValue> declaredAnnotationValues = AnnotationValueSupport.getDeclaredAnnotationValues(method);
183183
PartialEvaluationMethodInfo methodInfo = computePartialEvaluationMethodInfo(method, declaredAnnotationValues, getTypes());
184184
/*
185185
* We can canonicalize the instances to reduce space required in the cache. There are

substratevm/src/com.oracle.svm.truffle/src/com/oracle/svm/truffle/api/SubstrateTruffleUniverseFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public SubstrateField createField(AnalysisField aField, HostedStringDeduplicatio
9191
static PartialEvaluationMethodInfo createPartialEvaluationMethodInfo(TruffleCompilerRuntime runtime, ResolvedJavaMethod method,
9292
KnownTruffleTypes types) {
9393
SubstrateAnnotationExtractor extractor = (SubstrateAnnotationExtractor) ImageSingletons.lookup(AnnotationExtractor.class);
94-
List<AnnotationValue> annotations = extractor.getDeclaredAnnotationValues((Annotated) method);
94+
Map<ResolvedJavaType, AnnotationValue> annotations = extractor.getDeclaredAnnotationValues((Annotated) method);
9595
var info = PartialEvaluator.computePartialEvaluationMethodInfo(method, annotations, types);
9696
if (Uninterruptible.Utils.isUninterruptible(method)) {
9797
Uninterruptible uninterruptibleAnnotation = Uninterruptible.Utils.getAnnotation(method);

truffle/src/com.oracle.truffle.runtime/src/com/oracle/truffle/runtime/OptimizedTruffleRuntime.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,13 @@ private static UnmodifiableEconomicMap<String, Class<?>> initLookupTypes(Iterabl
539539
throw new NoClassDefFoundError(className);
540540
}
541541
}
542+
String className = "jdk.internal.event.Event";
543+
try {
544+
Class<?> c = Class.forName(className);
545+
m.put(className, c);
546+
} catch (ClassNotFoundException e) {
547+
throw new NoClassDefFoundError(className);
548+
}
542549
return m;
543550
}
544551

0 commit comments

Comments
 (0)