# HG changeset patch # User Andreas Woess # Date 1326900114 -3600 # Node ID d089b71a5237bed649a8ed4e3e62332d58e02ffe # Parent 1e3ecb08767d07a540666339269744efebdcff70 Add possibility to disable inlining for specific methods. Clear the HotSpotMethodResolvedImpl constructor, for it's never called. diff -r 1e3ecb08767d -r d089b71a5237 graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedMethod.java --- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedMethod.java Wed Jan 18 15:04:03 2012 -0800 +++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedMethod.java Wed Jan 18 16:21:54 2012 +0100 @@ -225,4 +225,9 @@ * @see Method#getGenericReturnType() */ Type getGenericReturnType(); + + /** + * @return {@code true} if this method can be inlined + */ + boolean canBeInlined(); } diff -r 1e3ecb08767d -r d089b71a5237 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 Wed Jan 18 15:04:03 2012 -0800 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java Wed Jan 18 16:21:54 2012 +0100 @@ -329,6 +329,12 @@ } return false; } + if (!resolvedMethod.canBeInlined()) { + if (GraalOptions.TraceInlining) { + TTY.println("not inlining %s because it is marked non-inlinable", methodName(resolvedMethod)); + } + return false; + } return true; } diff -r 1e3ecb08767d -r d089b71a5237 graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java --- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java Wed Jan 18 15:04:03 2012 -0800 +++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java Wed Jan 18 16:21:54 2012 +0100 @@ -56,13 +56,10 @@ private Map compilerStorage; private RiResolvedType holder; private byte[] code; + private boolean canBeInlined; private HotSpotMethodResolvedImpl() { super(null); - codeSize = -1; - accessFlags = -1; - maxLocals = -1; - maxStackSize = -1; throw new IllegalStateException("this constructor is never actually called, because the objects are allocated from within the VM"); } @@ -306,4 +303,13 @@ return null; } } + + @Override + public boolean canBeInlined() { + return canBeInlined; + } + + public void setCanBeInlined(boolean canBeInlined) { + this.canBeInlined = canBeInlined; + } } diff -r 1e3ecb08767d -r d089b71a5237 src/share/vm/graal/graalCompiler.cpp --- a/src/share/vm/graal/graalCompiler.cpp Wed Jan 18 15:04:03 2012 -0800 +++ b/src/share/vm/graal/graalCompiler.cpp Wed Jan 18 16:21:54 2012 +0100 @@ -270,6 +270,7 @@ HotSpotMethodResolved::set_accessFlags(obj, method->access_flags().as_int()); HotSpotMethodResolved::set_maxLocals(obj, method->max_locals()); HotSpotMethodResolved::set_maxStackSize(obj, method->max_stack()); + HotSpotMethodResolved::set_canBeInlined(obj, true); method->set_graal_mirror(obj()); return obj(); diff -r 1e3ecb08767d -r d089b71a5237 src/share/vm/graal/graalJavaAccess.hpp --- a/src/share/vm/graal/graalJavaAccess.hpp Wed Jan 18 15:04:03 2012 -0800 +++ b/src/share/vm/graal/graalJavaAccess.hpp Wed Jan 18 16:21:54 2012 +0100 @@ -67,6 +67,7 @@ int_field(HotSpotMethodResolved, accessFlags) \ int_field(HotSpotMethodResolved, maxLocals) \ int_field(HotSpotMethodResolved, maxStackSize) \ + boolean_field(HotSpotMethodResolved, canBeInlined) \ end_class \ start_class(HotSpotType) \ oop_field(HotSpotType, name, "Ljava/lang/String;") \