# HG changeset patch # User Andreas Woess # Date 1380206694 -7200 # Node ID 9af8b109ec0fca3478403a4d908eeb880174e53e # Parent 4937347fa343de3d93408862f1b16c690007e643 Truffle: force slow path on StringBuilder methods. diff -r 4937347fa343 -r 9af8b109ec0f graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java Thu Sep 26 16:38:35 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java Thu Sep 26 16:44:54 2013 +0200 @@ -60,12 +60,14 @@ private final HashMap, StructuredGraph> cache = new HashMap<>(); private final StructuredGraph markerGraph = new StructuredGraph(); + private final ResolvedJavaType stringBuilderClass; public TruffleCache(MetaAccessProvider metaAccessProvider, GraphBuilderConfiguration config, OptimisticOptimizations optimisticOptimizations, Replacements replacements) { this.metaAccessProvider = metaAccessProvider; this.config = config; this.optimisticOptimizations = optimisticOptimizations; this.replacements = replacements; + this.stringBuilderClass = metaAccessProvider.lookupJavaType(StringBuilder.class); } @SuppressWarnings("unused") @@ -215,9 +217,9 @@ return false; } - private static boolean shouldInline(final MethodCallTargetNode methodCallTargetNode) { + private boolean shouldInline(final MethodCallTargetNode methodCallTargetNode) { return (methodCallTargetNode.invokeKind() == InvokeKind.Special || methodCallTargetNode.invokeKind() == InvokeKind.Static) && !Modifier.isNative(methodCallTargetNode.targetMethod().getModifiers()) && methodCallTargetNode.targetMethod().getAnnotation(ExplodeLoop.class) == null && - methodCallTargetNode.targetMethod().getAnnotation(CompilerDirectives.SlowPath.class) == null; + methodCallTargetNode.targetMethod().getAnnotation(CompilerDirectives.SlowPath.class) == null && methodCallTargetNode.targetMethod().getDeclaringClass() != stringBuilderClass; } }