Mercurial > hg > graal-compiler
changeset 9277:1fcaf6edc69d
CallSiteTargetNode: address review comment
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Wed, 24 Apr 2013 13:35:14 +0200 |
parents | a9cfbe03d9c4 |
children | 8cf939b349dd |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java Tue Apr 23 21:03:47 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java Wed Apr 24 13:35:14 2013 +0200 @@ -43,13 +43,14 @@ private ConstantNode getConstantCallTarget(MetaAccessProvider metaAccessProvider, Assumptions assumptions) { if (getCallSite().isConstant() && !getCallSite().isNullConstant()) { CallSite callSite = (CallSite) getCallSite().asConstant().asObject(); - if (callSite instanceof ConstantCallSite) { - return ConstantNode.forObject(callSite.getTarget(), metaAccessProvider, graph()); - } else if (callSite instanceof MutableCallSite || callSite instanceof VolatileCallSite && assumptions != null && assumptions.useOptimisticAssumptions()) { - MethodHandle target = callSite.getTarget(); + MethodHandle target = callSite.getTarget(); + if (!(callSite instanceof ConstantCallSite)) { + if (assumptions == null || !assumptions.useOptimisticAssumptions()) { + return null; + } assumptions.record(new Assumptions.CallSiteTargetValue(callSite, target)); - return ConstantNode.forObject(target, metaAccessProvider, graph()); } + return ConstantNode.forObject(target, metaAccessProvider, graph()); } return null; }