# HG changeset patch # User Doug Simon # Date 1432451935 -7200 # Node ID 43c2b3eb3d6d399b86de47ef241933d5ac4220b8 # Parent 923c37b10fb4f3b2f93d417c89fa8a01342d9fba removed unused support for forced inlining of method substitutions diff -r 923c37b10fb4 -r 43c2b3eb3d6d graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/MethodSubstitution.java --- a/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/MethodSubstitution.java Sun May 24 00:21:20 2015 +0200 +++ b/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/MethodSubstitution.java Sun May 24 09:18:55 2015 +0200 @@ -56,15 +56,6 @@ String signature() default ""; /** - * Determines if this method should be substituted in all cases, even if inlining thinks it is - * not important. - * - * Note that this is still depending on whether inlining sees the correct call target, so it's - * only a hard guarantee for static and special invocations. - */ - boolean forced() default false; - - /** * Determines if the substitution is for a method that may not be part of the runtime. For * example, a method introduced in a later JDK version. Substitutions for such methods are * omitted if the original method cannot be found. diff -r 923c37b10fb4 -r 43c2b3eb3d6d graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Replacements.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Replacements.java Sun May 24 00:21:20 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Replacements.java Sun May 24 09:18:55 2015 +0200 @@ -123,11 +123,6 @@ Collection getAllReplacements(); /** - * Determines whether the replacement of this method is flagged as being inlined always. - */ - boolean isForcedSubstitution(ResolvedJavaMethod methodAt); - - /** * Register snippet templates. */ void registerSnippetTemplateCache(SnippetTemplateCache snippetTemplates); diff -r 923c37b10fb4 -r 43c2b3eb3d6d graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/AbstractInliningPolicy.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/AbstractInliningPolicy.java Sun May 24 00:21:20 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/AbstractInliningPolicy.java Sun May 24 09:18:55 2015 +0200 @@ -78,9 +78,6 @@ if (!InliningUtil.canIntrinsify(replacements, info.methodAt(i), info.invoke().bci())) { return false; } - if (!replacements.isForcedSubstitution(info.methodAt(i))) { - return false; - } } return true; } diff -r 923c37b10fb4 -r 43c2b3eb3d6d graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Sun May 24 00:21:20 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Sun May 24 09:18:55 2015 +0200 @@ -117,7 +117,7 @@ return "it is an abstract method"; } else if (!method.getDeclaringClass().isInitialized()) { return "the method's class is not initialized"; - } else if (!method.canBeInlined() && !context.getReplacements().isForcedSubstitution(method)) { + } else if (!method.canBeInlined()) { return "it is marked non-inlinable"; } else if (countRecursiveInlining(method) > MaximumRecursiveInlining.getValue()) { return "it exceeds the maximum recursive inlining depth"; diff -r 923c37b10fb4 -r 43c2b3eb3d6d 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 Sun May 24 00:21:20 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Sun May 24 09:18:55 2015 +0200 @@ -135,7 +135,6 @@ */ protected class ClassReplacements { public final Map methodSubstitutions = CollectionsFactory.newMap(); - public final Set forcedSubstitutions = new HashSet<>(); public ClassReplacements(Class[] substitutionClasses, AtomicReference ref) { for (Class substitutionClass : substitutionClasses) { @@ -172,10 +171,7 @@ if (originalMethods != null) { for (Executable originalMethod : originalMethods) { if (originalMethod != null && (guard == null || guard.execute())) { - ResolvedJavaMethod original = registerMethodSubstitution(this, originalMethod, substituteMethod); - if (original != null && methodSubstitution.forced()) { - forcedSubstitutions.add(original); - } + registerMethodSubstitution(this, originalMethod, substituteMethod); } } } @@ -663,12 +659,6 @@ return result; } - @Override - public boolean isForcedSubstitution(ResolvedJavaMethod method) { - ClassReplacements cr = getClassReplacements(method.getDeclaringClass().getName()); - return cr != null && cr.forcedSubstitutions.contains(method); - } - public boolean hasSubstitution(ResolvedJavaMethod method, boolean fromBytecodeOnly, int callerBci) { if (!fromBytecodeOnly) { InvocationPlugin plugin = graphBuilderPlugins.getInvocationPlugins().lookupInvocation(method);