# HG changeset patch # User Christian Wimmer # Date 1431645281 25200 # Node ID 77a775ebd6d4dbaea982a61bc4cf827052522700 # Parent e4eae0fb72d02c398ba83d4aa3e51e0bfe3b9735 Add convenience method diff -r e4eae0fb72d0 -r 77a775ebd6d4 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java Thu May 14 16:14:17 2015 -0700 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java Thu May 14 16:14:41 2015 -0700 @@ -207,6 +207,15 @@ */ JavaType getInvokeReturnType(); + default Stamp getInvokeReturnStamp() { + JavaType returnType = getInvokeReturnType(); + if (returnType.getKind() == Kind.Object && returnType instanceof ResolvedJavaType) { + return StampFactory.declared((ResolvedJavaType) returnType); + } else { + return StampFactory.forKind(returnType.getKind()); + } + } + /** * Gets the inline depth of this context. A return value of 0 implies that this is the context * for the parse root.