use of jdk.vm.ci.meta.JavaType in project graal by oracle.
the class AArch64HotSpotNodeLIRBuilder method visitBreakpointNode.
@Override
public void visitBreakpointNode(BreakpointNode node) {
JavaType[] sig = new JavaType[node.arguments().size()];
for (int i = 0; i < sig.length; i++) {
sig[i] = node.arguments().get(i).stamp(NodeView.DEFAULT).javaType(gen.getMetaAccess());
}
Value[] parameters = visitInvokeArguments(gen.getRegisterConfig().getCallingConvention(HotSpotCallingConventionType.JavaCall, null, sig, gen), node.arguments());
append(new AArch64BreakpointOp(parameters));
}
use of jdk.vm.ci.meta.JavaType in project graal by oracle.
the class AMD64HotSpotNodeLIRBuilder method visitBreakpointNode.
@Override
public void visitBreakpointNode(BreakpointNode node) {
JavaType[] sig = new JavaType[node.arguments().size()];
for (int i = 0; i < sig.length; i++) {
sig[i] = node.arguments().get(i).stamp(NodeView.DEFAULT).javaType(gen.getMetaAccess());
}
Value[] parameters = visitInvokeArguments(gen.getRegisterConfig().getCallingConvention(HotSpotCallingConventionType.JavaCall, null, sig, gen), node.arguments());
append(new AMD64BreakpointOp(parameters));
}
use of jdk.vm.ci.meta.JavaType in project graal by oracle.
the class SubstrateGraphKit method returnStamp.
private Stamp returnStamp(Signature signature) {
JavaType returnType = signature.getReturnType(null);
JavaKind returnKind = signature.getReturnKind();
if (returnKind == JavaKind.Object && returnType instanceof ResolvedJavaType) {
return StampFactory.object(TypeReference.createTrustedWithoutAssumptions((ResolvedJavaType) returnType));
} else {
return getLoweringProvider().loadStamp(StampFactory.forKind(returnKind), signature.getReturnKind());
}
}
use of jdk.vm.ci.meta.JavaType in project graal by oracle.
the class MethodHandleNode method createTargetInvokeNode.
/**
* Creates an {@link InvokeNode} for the given target method. The {@link CallTargetNode} passed
* to the InvokeNode is in fact a {@link ResolvedMethodHandleCallTargetNode}.
*
* @return invoke node for the member name target
*/
private static InvokeNode createTargetInvokeNode(Assumptions assumptions, IntrinsicMethod intrinsicMethod, ResolvedJavaMethod target, ResolvedJavaMethod original, int bci, StampPair returnStamp, ValueNode[] arguments) {
InvokeKind targetInvokeKind = target.isStatic() ? InvokeKind.Static : InvokeKind.Special;
JavaType targetReturnType = target.getSignature().getReturnType(null);
// MethodHandleLinkTo* nodes have a trailing MemberName argument which
// needs to be popped.
ValueNode[] targetArguments;
switch(intrinsicMethod) {
case INVOKE_BASIC:
targetArguments = arguments;
break;
case LINK_TO_STATIC:
case LINK_TO_SPECIAL:
case LINK_TO_VIRTUAL:
case LINK_TO_INTERFACE:
targetArguments = Arrays.copyOfRange(arguments, 0, arguments.length - 1);
break;
default:
throw GraalError.shouldNotReachHere();
}
StampPair targetReturnStamp = StampFactory.forDeclaredType(assumptions, targetReturnType, false);
MethodCallTargetNode callTarget = ResolvedMethodHandleCallTargetNode.create(targetInvokeKind, target, targetArguments, targetReturnStamp, original, arguments, returnStamp);
// (usually java.lang.Object).
if (returnStamp.getTrustedStamp().getStackKind() == JavaKind.Void) {
return new InvokeNode(callTarget, bci, StampFactory.forVoid());
} else {
return new InvokeNode(callTarget, bci);
}
}
use of jdk.vm.ci.meta.JavaType in project graal by oracle.
the class JavaConstantFieldProvider method getArrayDimension.
private static int getArrayDimension(JavaType type) {
int dimensions = 0;
JavaType componentType = type;
while ((componentType = componentType.getComponentType()) != null) {
dimensions++;
}
return dimensions;
}
Aggregations