Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import java.lang.reflect.Executable;

import com.oracle.graal.pointsto.meta.BaseLayerMethod;
import com.oracle.graal.pointsto.util.GraalAccess;

import jdk.vm.ci.meta.ResolvedJavaMethod;
Expand Down Expand Up @@ -56,6 +57,10 @@ static ResolvedJavaMethod getOriginalMethod(ResolvedJavaMethod method) {
*/
static Executable getJavaMethod(ResolvedJavaMethod method) {
ResolvedJavaMethod originalMethod = getOriginalMethod(method);
if (originalMethod instanceof BaseLayerMethod) {
/* We don't know corresponding java.lang.reflect.Method. */
return null;
}
if (originalMethod != null) {
try {
return GraalAccess.getOriginalSnippetReflection().originalMethod(originalMethod);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class BaseLayerMethod extends BaseLayerElement implements ResolvedJavaMet
private final ResolvedJavaType declaringClass;
private final String name;
private final boolean isVarArgs;
private final boolean isBridge;
private final ResolvedSignature<AnalysisType> signature;
private final boolean canBeStaticallyBound;
private final boolean isConstructor;
Expand All @@ -64,13 +65,14 @@ public class BaseLayerMethod extends BaseLayerElement implements ResolvedJavaMet
private final int codeSize;
private final IntrinsicMethod methodHandleIntrinsic;

public BaseLayerMethod(int id, AnalysisType declaringClass, String name, boolean isVarArgs, ResolvedSignature<AnalysisType> signature, boolean canBeStaticallyBound, boolean isConstructor,
int modifiers, boolean isSynthetic, byte[] code, int codeSize, IntrinsicMethod methodHandleIntrinsic, Annotation[] annotations) {
public BaseLayerMethod(int id, AnalysisType declaringClass, String name, boolean isVarArgs, boolean isBridge, ResolvedSignature<AnalysisType> signature, boolean canBeStaticallyBound,
boolean isConstructor, int modifiers, boolean isSynthetic, byte[] code, int codeSize, IntrinsicMethod methodHandleIntrinsic, Annotation[] annotations) {
super(annotations);
this.id = id;
this.declaringClass = declaringClass.getWrapped();
this.name = name;
this.isVarArgs = isVarArgs;
this.isBridge = isBridge;
this.signature = signature;
this.canBeStaticallyBound = canBeStaticallyBound;
this.isConstructor = isConstructor;
Expand Down Expand Up @@ -116,12 +118,12 @@ public Signature getSignature() {

@Override
public int getMaxLocals() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public int getMaxStackSize() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
Expand All @@ -136,17 +138,17 @@ public boolean isVarArgs() {

@Override
public boolean isBridge() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
return isBridge;
}

@Override
public boolean isDefault() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public boolean isClassInitializer() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
Expand All @@ -171,42 +173,42 @@ public StackTraceElement asStackTraceElement(int bci) {

@Override
public ProfilingInfo getProfilingInfo(boolean includeNormal, boolean includeOSR) {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public void reprofile() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public ConstantPool getConstantPool() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public Annotation[][] getParameterAnnotations() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public Type[] getGenericParameterTypes() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public boolean canBeInlined() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public boolean hasNeverInlineDirective() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public boolean shouldBeInlined() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
Expand All @@ -221,32 +223,36 @@ public LocalVariableTable getLocalVariableTable() {

@Override
public Constant getEncoding() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public boolean isInVirtualMethodTable(ResolvedJavaType resolved) {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public SpeculationLog getSpeculationLog() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public Annotation[] getAnnotations() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

@Override
public Annotation[] getDeclaredAnnotations() {
throw GraalError.unimplemented("This method is incomplete and should not be used.");
throw unimplemented();
}

private RuntimeException unimplemented() {
return GraalError.unimplemented("This method is incomplete and should not be used. Base layer method: " + format("%H.%n(%p)"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,32 +86,33 @@ struct PersistedAnalysisMethod {
methodHandleIntrinsicName @19 :Text;
annotationList @20 :List(Annotation);
isVarArgs @21 :Bool;
analysisGraphLocation @22 :Text;
analysisGraphIsIntrinsic @23 :Bool;
strengthenedGraphLocation @24 :Text;
isBridge @22 :Bool;
analysisGraphLocation @23 :Text;
analysisGraphIsIntrinsic @24 :Bool;
strengthenedGraphLocation @25 :Text;
wrappedMethod :union {
none @25 :Void; # default
none @26 :Void; # default
factoryMethod :group {
targetConstructorId @26 :MethodId;
throwAllocatedObject @27 :Bool;
instantiatedTypeId @28 :TypeId;
targetConstructorId @27 :MethodId;
throwAllocatedObject @28 :Bool;
instantiatedTypeId @29 :TypeId;
}
outlinedSB :group {
methodTypeReturn @29 :Text;
methodTypeParameters @30 :List(Text);
methodTypeReturn @30 :Text;
methodTypeParameters @31 :List(Text);
}
cEntryPointCallStub :group {
originalMethodId @31 :MethodId;
notPublished @32 :Bool;
originalMethodId @32 :MethodId;
notPublished @33 :Bool;
}
wrappedMember :group {
union {
reflectionExpandSignature @33 :Void;
javaCallVariantWrapper @34 :Void;
reflectionExpandSignature @34 :Void;
javaCallVariantWrapper @35 :Void;
}
name @35 :Text;
declaringClassName @36 :Text;
argumentTypeNames @37 :List(Text);
name @36 :Text;
declaringClassName @37 :Text;
argumentTypeNames @38 :List(Text);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ private void createBaseLayerMethod(PersistedAnalysisMethod.Reader md, int mid, S
Annotation[] annotations = getAnnotations(md.getAnnotationList());

baseLayerMethods.computeIfAbsent(mid,
methodId -> new BaseLayerMethod(mid, type, name, md.getIsVarArgs(), signature, md.getCanBeStaticallyBound(), md.getIsConstructor(),
methodId -> new BaseLayerMethod(mid, type, name, md.getIsVarArgs(), md.getIsBridge(), signature, md.getCanBeStaticallyBound(), md.getIsConstructor(),
md.getModifiers(), md.getIsSynthetic(), code, md.getCodeSize(), methodHandleIntrinsic, annotations));
BaseLayerMethod baseLayerMethod = baseLayerMethods.get(mid);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ private void persistMethod(AnalysisMethod method, Supplier<PersistedAnalysisMeth
builder.setName(method.getName());
builder.setReturnTypeId(method.getSignature().getReturnType().getId());
builder.setIsVarArgs(method.isVarArgs());
builder.setIsBridge(method.isBridge());
builder.setCanBeStaticallyBound(method.canBeStaticallyBound());
builder.setModifiers(method.getModifiers());
builder.setIsConstructor(method.isConstructor());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,13 @@ public final void setIsVarArgs(boolean value) {
_setBooleanField(168, value);
}

public final boolean getIsBridge() {
return _getBooleanField(169);
}
public final void setIsBridge(boolean value) {
_setBooleanField(169, value);
}

public final boolean hasAnalysisGraphLocation() {
return !_pointerFieldIsNull(8);
}
Expand All @@ -1165,10 +1172,10 @@ public final org.capnproto.Text.Builder initAnalysisGraphLocation(int size) {
return _initPointerField(org.capnproto.Text.factory, 8, size);
}
public final boolean getAnalysisGraphIsIntrinsic() {
return _getBooleanField(169);
return _getBooleanField(170);
}
public final void setAnalysisGraphIsIntrinsic(boolean value) {
_setBooleanField(169, value);
_setBooleanField(170, value);
}

public final boolean hasStrengthenedGraphLocation() {
Expand Down Expand Up @@ -1319,6 +1326,10 @@ public final boolean getIsVarArgs() {
return _getBooleanField(168);
}

public final boolean getIsBridge() {
return _getBooleanField(169);
}

public boolean hasAnalysisGraphLocation() {
return !_pointerFieldIsNull(8);
}
Expand All @@ -1327,7 +1338,7 @@ public org.capnproto.Text.Reader getAnalysisGraphLocation() {
}

public final boolean getAnalysisGraphIsIntrinsic() {
return _getBooleanField(169);
return _getBooleanField(170);
}

public boolean hasStrengthenedGraphLocation() {
Expand Down
Loading