default StampPair getInvokeReturnStamp(Assumptions assumptions) { JavaType returnType = getInvokeReturnType(); return StampFactory.forDeclaredType(assumptions, returnType, false); }
private boolean replaceOffsetOf(GraphBuilderContext b, ResolvedJavaMethod method, ValueNode[] args, AccessorInfo accessorInfo, int displacement) { /* * A method annotated with @OffsetOf can be static, but does not need to be. If it is * non-static, we just ignore the receiver. */ assert args.length == accessorInfo.parameterCount(!method.isStatic()); JavaKind kind = wordTypes.asKind(b.getInvokeReturnType()); b.addPush(pushKind(method), ConstantNode.forIntegerKind(kind, displacement, b.getGraph())); return true; }
if (wordTypes.isWord(b.getInvokeReturnType())) { returnStamp = wordTypes.getWordStamp((ResolvedJavaType) b.getInvokeReturnType()); } else { returnStamp = b.getInvokeReturnStamp(null).getTrustedStamp(); b.handleReplacedInvoke(indirectCallTargetNode, b.getInvokeReturnType().getJavaKind()); } else if (callType == SubstrateCallingConventionType.NativeCall) {
private boolean replaceConstant(GraphBuilderContext b, ResolvedJavaMethod method, ConstantInfo constantInfo) { Object value = constantInfo.getValueInfo().getProperty(); JavaKind kind = wordTypes.asKind(b.getInvokeReturnType()); ConstantNode valueNode; switch (constantInfo.getKind()) { case INTEGER: case POINTER: if (method.getSignature().getReturnKind() == JavaKind.Boolean) { valueNode = ConstantNode.forBoolean((long) value != 0, b.getGraph()); } else { valueNode = ConstantNode.forIntegerKind(kind, (long) value, b.getGraph()); } break; case FLOAT: valueNode = ConstantNode.forFloatingKind(kind, (double) value, b.getGraph()); break; case STRING: case BYTEARRAY: valueNode = ConstantNode.forConstant(SubstrateObjectConstant.forObject(value), b.getMetaAccess(), b.getGraph()); break; default: throw shouldNotReachHere("Unexpected constant kind " + constantInfo); } b.push(pushKind(method), valueNode); return true; }
JavaKind resultKind = wordTypes.asKind(b.getInvokeReturnType()); JavaKind readKind = kindFromSize(elementSize, resultKind); if (readKind == JavaKind.Object) {
b.addPush(b.getInvokeReturnType().getJavaKind(), LoadFieldNode.create(null, lookup(b, methodHandleArguments, fieldLoad.object()), resolvedTarget)); assert b.getInvokeReturnType().getJavaKind() == constantResult.getJavaKind(); b.addPush(constantResult.getJavaKind(), ConstantNode.forConstant(lookup(constantResult), universeProviders.getMetaAccess())); } else { assert b.getInvokeReturnType().getJavaKind() == JavaKind.Void;
JavaKind resultKind = wordTypes.asKind(b.getInvokeReturnType()); b.push(pushKind(method), adaptPrimitiveType(graph, cur, computeKind, resultKind == JavaKind.Boolean ? resultKind : resultKind.getStackKind(), isUnsigned)); return true;