Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java @ 16174:5605c5e37a1e
use InvokeKind.Special for array methods
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Mon, 23 Jun 2014 18:02:29 -0700 |
parents | f62cc9f09c7b |
children | 10c12d09a8d2 4bfe1359d98a |
comparison
equal
deleted
inserted
replaced
16173:b92cad49bcc0 | 16174:5605c5e37a1e |
---|---|
139 | 139 |
140 // check if the type of the receiver can narrow the result | 140 // check if the type of the receiver can narrow the result |
141 ValueNode receiver = receiver(); | 141 ValueNode receiver = receiver(); |
142 ResolvedJavaType type = StampTool.typeOrNull(receiver); | 142 ResolvedJavaType type = StampTool.typeOrNull(receiver); |
143 if (type != null && (invoke().stateAfter() != null || invoke().stateDuring() != null)) { | 143 if (type != null && (invoke().stateAfter() != null || invoke().stateDuring() != null)) { |
144 // either the holder class is exact, or the receiver object has an exact type | 144 /* |
145 * either the holder class is exact, or the receiver object has an exact type, or | |
146 * it's an array type | |
147 */ | |
145 ResolvedJavaMethod resolvedMethod = type.resolveMethod(targetMethod, invoke().getContextType()); | 148 ResolvedJavaMethod resolvedMethod = type.resolveMethod(targetMethod, invoke().getContextType()); |
146 if (resolvedMethod != null && (resolvedMethod.canBeStaticallyBound() || StampTool.isExactType(receiver))) { | 149 if (resolvedMethod != null && (resolvedMethod.canBeStaticallyBound() || StampTool.isExactType(receiver) || type.isArray())) { |
147 invokeKind = InvokeKind.Special; | 150 invokeKind = InvokeKind.Special; |
148 targetMethod = resolvedMethod; | 151 targetMethod = resolvedMethod; |
149 return this; | 152 return this; |
150 } | 153 } |
151 if (tool.assumptions() != null && tool.assumptions().useOptimisticAssumptions()) { | 154 if (tool.assumptions() != null && tool.assumptions().useOptimisticAssumptions()) { |