# HG changeset patch # User Doug Simon # Date 1427889359 -7200 # Node ID 67507ee4e8d6ef68127f69f6113ee8e16a0b8cfe # Parent 3f159221fe367cf5644537c8b7a1e86b331fc629 don't allow non-recursive, non-intrinsified invokes in intrinsics or snippets diff -r 3f159221fe36 -r 67507ee4e8d6 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 Wed Apr 01 13:48:54 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java Wed Apr 01 13:55:59 2015 +0200 @@ -58,6 +58,12 @@ * intrinsic will restart the interpreter at the intrinsified call. */ boolean isIntrinsic(); + + /** + * Determines if a call within the compilation scope of this replacement represents a call + * to the {@linkplain #getOriginalMethod() original} method. + */ + boolean isCallToOriginal(ResolvedJavaMethod method); } /** diff -r 3f159221fe36 -r 67507ee4e8d6 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Wed Apr 01 13:48:54 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Wed Apr 01 13:55:59 2015 +0200 @@ -124,10 +124,9 @@ public void notifyOfNoninlinedInvoke(GraphBuilderContext b, ResolvedJavaMethod method, Invoke invoke) { if (b.parsingReplacement()) { - boolean compilingSnippet = b.getRootMethod().getAnnotation(Snippet.class) != null; Replacement replacement = b.getReplacement(); - assert compilingSnippet : format("All calls in the replacement %s must be inlined or intrinsified: found call to %s", replacement.getReplacementMethod().format("%H.%n(%p)"), - method.format("%h.%n(%p)")); + assert replacement.isCallToOriginal(method) : format("All non-recursive calls in the replacement %s must be inlined or intrinsified: found call to %s", + replacement.getReplacementMethod().format("%H.%n(%p)"), method.format("%h.%n(%p)")); } }