Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8236647: Correct Fix for 8236647: java/lang/invoke/CallSiteTest.java …
…failed with InvocationTargetException in Graal mode

Reviewed-by: kvn, never
  • Loading branch information
Bob Vandette committed Jun 29, 2020
1 parent 97cdfb9 commit d16ea55b627ffbce82044024f791b1a8f1db7f80
Showing 1 changed file with 4 additions and 8 deletions.
@@ -65,25 +65,21 @@ public HotSpotResolvedObjectType getType() {
@Override
public abstract int getIdentityHashCode();

static class Fields {
// Initializing these too early causes a hang, so do it here in a subclass
static final HotSpotResolvedJavaField callSiteTargetField = HotSpotMethodHandleAccessProvider.Internals.instance().callSiteTargetField;
static final HotSpotResolvedJavaField constantCallSiteFrozenField = HotSpotMethodHandleAccessProvider.Internals.instance().constantCallSiteFrozenField;
}

private boolean isFullyInitializedConstantCallSite() {
if (!runtime().getConstantCallSite().isInstance(this)) {
return false;
}
// read ConstantCallSite.isFrozen as a volatile field
boolean isFrozen = readFieldValue(Fields.constantCallSiteFrozenField, true /* volatile */).asBoolean();
HotSpotResolvedJavaField field = HotSpotMethodHandleAccessProvider.Internals.instance().constantCallSiteFrozenField;
boolean isFrozen = readFieldValue(field, true /* volatile */).asBoolean();
// isFrozen true implies fully-initialized
return isFrozen;
}

private HotSpotObjectConstantImpl readTarget() {
// read CallSite.target as a volatile field
return (HotSpotObjectConstantImpl) readFieldValue(Fields.callSiteTargetField, true /* volatile */);
HotSpotResolvedJavaField field = HotSpotMethodHandleAccessProvider.Internals.instance().callSiteTargetField;
return (HotSpotObjectConstantImpl) readFieldValue(field, true /* volatile */);
}

@Override

0 comments on commit d16ea55

Please sign in to comment.