Mercurial > hg > truffle
changeset 18250:34cb95edfc97
MethodCallTargetNode: get profile from TypeProfileProxy if available.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Tue, 04 Nov 2014 13:22:58 +0100 |
parents | e41787b05c98 |
children | 01e268964aa4 |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java |
diffstat | 1 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Wed Nov 05 11:20:39 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Tue Nov 04 13:22:58 2014 +0100 @@ -156,9 +156,7 @@ ResolvedJavaMethod newResolvedMethod = single.resolveMethod(targetMethod(), invoke().getContextType(), true); // TODO (je): we can not yet deal with default methods if (newResolvedMethod != null && !newResolvedMethod.isDefault()) { - ProfilingInfo profilingInfo = invoke().getContextMethod().getProfilingInfo(); - JavaTypeProfile profile = profilingInfo.getTypeProfile(invoke().bci()); - LogicNode condition = graph().unique(InstanceOfNode.create(single, receiver, profile)); + LogicNode condition = graph().unique(InstanceOfNode.create(single, receiver, getProfile())); assert graph().getGuardsStage().ordinal() < StructuredGraph.GuardsStage.FIXED_DEOPTS.ordinal() : "Graph already fixed!"; GuardNode guard = graph().unique( GuardNode.create(condition, BeginNode.prevBegin(invoke().asNode()), DeoptimizationReason.OptimizedTypeCheckViolated, DeoptimizationAction.InvalidateRecompile, @@ -173,6 +171,17 @@ } } + private JavaTypeProfile getProfile() { + assert !isStatic(); + if (receiver() instanceof TypeProfileProxyNode) { + // get profile from TypeProfileProxy + return ((TypeProfileProxyNode) receiver()).getProfile(); + } + // get profile from invoke() + ProfilingInfo profilingInfo = invoke().getContextMethod().getProfilingInfo(); + return profilingInfo.getTypeProfile(invoke().bci()); + } + @Override public Stamp returnStamp() { Kind returnKind = targetMethod().getSignature().getReturnKind();