comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java @ 21155:754f2b20d8bc graal-0.7

Skip invokes with a placeholder framestate in MethodCallTargetNode.simplify
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Wed, 29 Apr 2015 17:28:50 +0200
parents deab43a789ad
children d339bcb65015
comparison
equal deleted inserted replaced
21154:271eee87201c 21155:754f2b20d8bc
20 * or visit www.oracle.com if you need additional information or have any 20 * or visit www.oracle.com if you need additional information or have any
21 * questions. 21 * questions.
22 */ 22 */
23 package com.oracle.graal.nodes.java; 23 package com.oracle.graal.nodes.java;
24 24
25 import com.oracle.graal.api.code.*;
25 import com.oracle.graal.api.meta.*; 26 import com.oracle.graal.api.meta.*;
26 import com.oracle.graal.api.meta.Assumptions.AssumptionResult; 27 import com.oracle.graal.api.meta.Assumptions.AssumptionResult;
27 import com.oracle.graal.compiler.common.type.*; 28 import com.oracle.graal.compiler.common.type.*;
28 import com.oracle.graal.graph.*; 29 import com.oracle.graal.graph.*;
29 import com.oracle.graal.graph.spi.*; 30 import com.oracle.graal.graph.spi.*;
147 } 148 }
148 149
149 @Override 150 @Override
150 public void simplify(SimplifierTool tool) { 151 public void simplify(SimplifierTool tool) {
151 // attempt to devirtualize the call 152 // attempt to devirtualize the call
153 if (invoke().getContextMethod() == null) {
154 // avoid invokes that have placeholder bcis: they do not have a valid contextType
155 assert (invoke().stateAfter() != null && BytecodeFrame.isPlaceholderBci(invoke().stateAfter().bci)) || BytecodeFrame.isPlaceholderBci(invoke().stateDuring().bci);
156 return;
157 }
152 ResolvedJavaType contextType = (invoke().stateAfter() == null && invoke().stateDuring() == null) ? null : invoke().getContextType(); 158 ResolvedJavaType contextType = (invoke().stateAfter() == null && invoke().stateDuring() == null) ? null : invoke().getContextType();
153 ResolvedJavaMethod specialCallTarget = findSpecialCallTarget(invokeKind, receiver(), targetMethod, contextType); 159 ResolvedJavaMethod specialCallTarget = findSpecialCallTarget(invokeKind, receiver(), targetMethod, contextType);
154 if (specialCallTarget != null) { 160 if (specialCallTarget != null) {
155 this.setTargetMethod(specialCallTarget); 161 this.setTargetMethod(specialCallTarget);
156 setInvokeKind(InvokeKind.Special); 162 setInvokeKind(InvokeKind.Special);