Mercurial > hg > truffle
changeset 4300:a3229b37b04c
Merge
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Wed, 18 Jan 2012 20:27:56 -0800 |
parents | 50caadefd9f0 (current diff) d089b71a5237 (diff) |
children | 8dd27e218e19 |
files | |
diffstat | 5 files changed, 23 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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(); }
--- 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; }
--- 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<Object, Object> 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; + } }
--- 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();
--- 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;") \