Mercurial > hg > truffle
changeset 20115:67507ee4e8d6
don't allow non-recursive, non-intrinsified invokes in intrinsics or snippets
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 01 Apr 2015 13:55:59 +0200 |
parents | 3f159221fe36 |
children | 674a81af7992 |
files | graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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); } /**
--- 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)")); } }