Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java @ 18257:4a41f32ed552
MethodCallTargetNode: better variable names.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Wed, 05 Nov 2014 13:09:49 +0100 |
parents | 34cb95edfc97 |
children | 6b8bceeecb30 |
comparison
equal
deleted
inserted
replaced
18256:1daaa2c62142 | 18257:4a41f32ed552 |
---|---|
147 setTargetMethod(uniqueConcreteMethod); | 147 setTargetMethod(uniqueConcreteMethod); |
148 return; | 148 return; |
149 } | 149 } |
150 } | 150 } |
151 } | 151 } |
152 ResolvedJavaType receiverType = targetMethod().getDeclaringClass(); | 152 ResolvedJavaType declaredReceiverType = targetMethod().getDeclaringClass(); |
153 if (receiverType.isInterface()) { | 153 if (declaredReceiverType.isInterface()) { |
154 ResolvedJavaType single = receiverType.getSingleImplementor(); | 154 ResolvedJavaType singleImplementor = declaredReceiverType.getSingleImplementor(); |
155 if (single != null && !single.equals(receiverType)) { | 155 if (singleImplementor != null && !singleImplementor.equals(declaredReceiverType)) { |
156 ResolvedJavaMethod newResolvedMethod = single.resolveMethod(targetMethod(), invoke().getContextType(), true); | 156 ResolvedJavaMethod singleImplementorMethod = singleImplementor.resolveMethod(targetMethod(), invoke().getContextType(), true); |
157 // TODO (je): we can not yet deal with default methods | 157 // TODO (je): we can not yet deal with default methods |
158 if (newResolvedMethod != null && !newResolvedMethod.isDefault()) { | 158 if (singleImplementorMethod != null && !singleImplementorMethod.isDefault()) { |
159 LogicNode condition = graph().unique(InstanceOfNode.create(single, receiver, getProfile())); | 159 LogicNode condition = graph().unique(InstanceOfNode.create(singleImplementor, receiver, getProfile())); |
160 assert graph().getGuardsStage().ordinal() < StructuredGraph.GuardsStage.FIXED_DEOPTS.ordinal() : "Graph already fixed!"; | 160 assert graph().getGuardsStage().ordinal() < StructuredGraph.GuardsStage.FIXED_DEOPTS.ordinal() : "Graph already fixed!"; |
161 GuardNode guard = graph().unique( | 161 GuardNode guard = graph().unique( |
162 GuardNode.create(condition, BeginNode.prevBegin(invoke().asNode()), DeoptimizationReason.OptimizedTypeCheckViolated, DeoptimizationAction.InvalidateRecompile, | 162 GuardNode.create(condition, BeginNode.prevBegin(invoke().asNode()), DeoptimizationReason.OptimizedTypeCheckViolated, DeoptimizationAction.InvalidateRecompile, |
163 false, JavaConstant.NULL_OBJECT)); | 163 false, JavaConstant.NULL_OBJECT)); |
164 PiNode piNode = graph().unique(PiNode.create(receiver, StampFactory.declared(single), guard)); | 164 PiNode piNode = graph().unique(PiNode.create(receiver, StampFactory.declared(singleImplementor), guard)); |
165 arguments().set(0, piNode); | 165 arguments().set(0, piNode); |
166 setInvokeKind(InvokeKind.Virtual); | 166 setInvokeKind(InvokeKind.Virtual); |
167 setTargetMethod(newResolvedMethod); | 167 setTargetMethod(singleImplementorMethod); |
168 } | 168 } |
169 } | 169 } |
170 } | 170 } |
171 } | 171 } |
172 } | 172 } |