# HG changeset patch # User Christian Wimmer # Date 1367424765 25200 # Node ID deb3189e834dae5c5e09a50d5be208201a88dad2 # Parent 6f84aacfdf3c5c6dff13e6e0f4e77f842c7ca163 Inline method in snippet when replacement is available. Replacements are frequently used for native methods, which are per default excluded from inlining. But if there is a non-native replacement, we want it inlined. diff -r 6f84aacfdf3c -r deb3189e834d 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 May 01 09:11:13 2013 -0700 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Wed May 01 09:12:45 2013 -0700 @@ -366,9 +366,10 @@ afterInline(graph, originalGraph); substituteCallsOriginal = true; } else { - if ((callTarget.invokeKind() == InvokeKind.Static || callTarget.invokeKind() == InvokeKind.Special) && policy.shouldInline(callee, methodToParse)) { + StructuredGraph intrinsicGraph = InliningUtil.getIntrinsicGraph(ReplacementsImpl.this, callee); + if ((callTarget.invokeKind() == InvokeKind.Static || callTarget.invokeKind() == InvokeKind.Special) && + (policy.shouldInline(callee, methodToParse) || (intrinsicGraph != null && policy.shouldUseReplacement(callee, methodToParse)))) { StructuredGraph targetGraph; - StructuredGraph intrinsicGraph = InliningUtil.getIntrinsicGraph(ReplacementsImpl.this, callee); if (intrinsicGraph != null && policy.shouldUseReplacement(callee, methodToParse)) { targetGraph = intrinsicGraph; } else {