# HG changeset patch # User Thomas Wuerthinger # Date 1325601286 -3600 # Node ID 7703a9f4769f5c2e36f37f3b96ecec64195ae9df # Parent d815dbbf3cad886ba0ac9db1473cdfc9d414b68b Removed inlining decisions from CRI. diff -r d815dbbf3cad -r 7703a9f4769f graal/com.oracle.max.cri/src/com/sun/cri/ri/RiRuntime.java --- a/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiRuntime.java Tue Jan 03 15:30:57 2012 +0100 +++ b/graal/com.oracle.max.cri/src/com/sun/cri/ri/RiRuntime.java Tue Jan 03 15:34:46 2012 +0100 @@ -33,32 +33,6 @@ public interface RiRuntime { /** - * Checks whether the specified method is required to be inlined (for semantic reasons). - * If this method returns true, then the null-check of the receiver emitted during - * inlining is omitted. - * - * @param method the method being called - * @return {@code true} if the method must be inlined; {@code false} to let the compiler - * use its own heuristics - */ - boolean mustInline(RiResolvedMethod method); - - /** - * Checks whether the specified method must not be inlined (for semantic reasons). - * @param method the method being called - * @return {@code true} if the method must not be inlined; {@code false} to let the compiler - * use its own heuristics - */ - boolean mustNotInline(RiResolvedMethod method); - - /** - * Checks whether the specified method cannot be compiled. - * @param method the method being called - * @return {@code true} if the method cannot be compiled - */ - boolean mustNotCompile(RiResolvedMethod method); - - /** * Offset of the lock within the lock object on the stack. * Note: superseded by sizeOfLockData() in Graal. diff -r d815dbbf3cad -r 7703a9f4769f graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java Tue Jan 03 15:30:57 2012 +0100 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java Tue Jan 03 15:34:46 2012 +0100 @@ -226,7 +226,7 @@ MethodCallTargetNode callTarget = invoke.callTarget(); if (callTarget.invokeKind() == InvokeKind.Special || callTarget.targetMethod().canBeStaticallyBound()) { - if (checkTargetConditions(callTarget.targetMethod(), runtime)) { + if (checkTargetConditions(callTarget.targetMethod())) { double weight = callback == null ? 0 : callback.inliningWeight(parent, callTarget.targetMethod(), invoke); return new ExactInlineInfo(invoke, weight, level, callTarget.targetMethod()); } @@ -236,7 +236,7 @@ RiResolvedType exact = callTarget.receiver().exactType(); assert exact.isSubtypeOf(callTarget.targetMethod().holder()) : exact + " subtype of " + callTarget.targetMethod().holder(); RiResolvedMethod resolved = exact.resolveMethodImpl(callTarget.targetMethod()); - if (checkTargetConditions(resolved, runtime)) { + if (checkTargetConditions(resolved)) { double weight = callback == null ? 0 : callback.inliningWeight(parent, resolved, invoke); return new ExactInlineInfo(invoke, weight, level, resolved); } @@ -258,7 +258,7 @@ } RiResolvedMethod concrete = holder.uniqueConcreteMethod(callTarget.targetMethod()); if (concrete != null) { - if (checkTargetConditions(concrete, runtime)) { + if (checkTargetConditions(concrete)) { double weight = callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke); return new AssumptionInlineInfo(invoke, weight, level, holder, concrete); } @@ -269,7 +269,7 @@ if (GraalOptions.InlineWithTypeCheck) { // type check and inlining... concrete = profile.types[0].resolveMethodImpl(callTarget.targetMethod()); - if (concrete != null && checkTargetConditions(concrete, runtime)) { + if (concrete != null && checkTargetConditions(concrete)) { double weight = callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke); return new TypeGuardInlineInfo(invoke, weight, level, concrete, profile.types[0], profile.probabilities[0]); } @@ -315,7 +315,7 @@ return true; } - private static boolean checkTargetConditions(RiMethod method, GraalRuntime runtime) { + private static boolean checkTargetConditions(RiMethod method) { if (!(method instanceof RiResolvedMethod)) { if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because it is unresolved", method.toString()); @@ -323,12 +323,6 @@ return false; } RiResolvedMethod resolvedMethod = (RiResolvedMethod) method; - if (runtime.mustNotInline(resolvedMethod)) { - if (GraalOptions.TraceInlining) { - TTY.println("not inlining %s because the CRI set it to be non-inlinable", methodName(resolvedMethod)); - } - return false; - } if (Modifier.isNative(resolvedMethod.accessFlags())) { if (GraalOptions.TraceInlining) { TTY.println("not inlining %s because it is a native method", methodName(resolvedMethod)); diff -r d815dbbf3cad -r 7703a9f4769f graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotRuntime.java --- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotRuntime.java Tue Jan 03 15:30:57 2012 +0100 +++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/HotSpotRuntime.java Tue Jan 03 15:34:46 2012 +0100 @@ -52,8 +52,6 @@ final HotSpotRegisterConfig regConfig; final HotSpotRegisterConfig globalStubRegConfig; private final Compiler compiler; - // TODO(ls) this is not a permanent solution - there should be a more sophisticated compiler oracle - private HashSet notInlineableMethods = new HashSet<>(); public HotSpotRuntime(GraalContext context, HotSpotVMConfig config, Compiler compiler) { this.context = context; @@ -140,28 +138,6 @@ } @Override - public boolean mustInline(RiResolvedMethod method) { - return false; - } - - @Override - public boolean mustNotCompile(RiResolvedMethod method) { - return false; - } - - @Override - public boolean mustNotInline(RiResolvedMethod method) { - if (notInlineableMethods.contains(method)) { - return true; - } - return Modifier.isNative(method.accessFlags()); - } - - public void makeNotInlineable(RiResolvedMethod method) { - notInlineableMethods.add(method); - } - - @Override public Object registerCompilerStub(CiTargetMethod targetMethod, String name) { return HotSpotTargetMethod.installStub(compiler, targetMethod, name); }