Mercurial > hg > graal-jvmci-8
changeset 21474:43c2b3eb3d6d
removed unused support for forced inlining of method substitutions
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Sun, 24 May 2015 09:18:55 +0200 |
parents | 923c37b10fb4 |
children | e538b5923ff0 |
files | graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/MethodSubstitution.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Replacements.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/AbstractInliningPolicy.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java |
diffstat | 5 files changed, 2 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- 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.
--- 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<ResolvedJavaMethod> 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);
--- 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; }
--- 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";
--- 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<ResolvedJavaMethod, ResolvedJavaMethod> methodSubstitutions = CollectionsFactory.newMap(); - public final Set<ResolvedJavaMethod> forcedSubstitutions = new HashSet<>(); public ClassReplacements(Class<?>[] substitutionClasses, AtomicReference<ClassReplacements> 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);