# HG changeset patch # User Andreas Woess # Date 1366803314 -7200 # Node ID 1fcaf6edc69db7dcfed78abc8aba1679a7483da4 # Parent a9cfbe03d9c4d880c6c532194378af45833472a1 CallSiteTargetNode: address review comment diff -r a9cfbe03d9c4 -r 1fcaf6edc69d graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java --- 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; }