# HG changeset patch # User Christian Wimmer # Date 1326947276 28800 # Node ID a3229b37b04cbf48ba000efcdeab7c5e0909bc93 # Parent 50caadefd9f00c8a9defa114ee8df5c5cf2a8de8# Parent d089b71a5237bed649a8ed4e3e62332d58e02ffe Merge diff -r 50caadefd9f0 -r a3229b37b04c 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 20:19:30 2012 -0800 +++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ri/RiResolvedMethod.java Wed Jan 18 20:27:56 2012 -0800 @@ -225,4 +225,9 @@ * @see Method#getGenericReturnType() */ Type getGenericReturnType(); + + /** + * @return {@code true} if this method can be inlined + */ + boolean canBeInlined(); } diff -r 50caadefd9f0 -r a3229b37b04c 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 20:19:30 2012 -0800 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/InliningUtil.java Wed Jan 18 20:27:56 2012 -0800 @@ -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 50caadefd9f0 -r a3229b37b04c 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 20:19:30 2012 -0800 +++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodResolvedImpl.java Wed Jan 18 20:27:56 2012 -0800 @@ -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 50caadefd9f0 -r a3229b37b04c src/share/vm/graal/graalCompiler.cpp --- a/src/share/vm/graal/graalCompiler.cpp Wed Jan 18 20:19:30 2012 -0800 +++ b/src/share/vm/graal/graalCompiler.cpp Wed Jan 18 20:27:56 2012 -0800 @@ -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 50caadefd9f0 -r a3229b37b04c src/share/vm/graal/graalJavaAccess.hpp --- a/src/share/vm/graal/graalJavaAccess.hpp Wed Jan 18 20:19:30 2012 -0800 +++ b/src/share/vm/graal/graalJavaAccess.hpp Wed Jan 18 20:27:56 2012 -0800 @@ -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;") \