NPE when showing truffle expansions
Laurent Daynes
laurent.daynes at oracle.com
Tue Jun 10 15:28:52 UTC 2014
+1
I've hit the very same problem today and had fixed it on my copy with a
null test on the receiver.
Laurent
On 6/10/2014 5:07 PM, Stefan Marr wrote:
> Hi:
>
> There seems to be an issue with static methods, apparently, the current check in place is not sufficient to guard for non-existing receivers.
> The following patch seems to help:
>
> diff --git a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java
> index e90fb56..5dec542 100644
> --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java
> +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java
> @@ -50,7 +50,9 @@ public class TruffleExpansionLogger {
> int sourceMethodBci = callTarget.invoke().bci();
> ResolvedJavaMethod targetMethod = callTarget.targetMethod();
> ResolvedJavaType targetReceiverType = null;
> - if (!sourceMethod.isStatic() && callTarget.receiver().isConstant()) {
> +
> + boolean isStatic = sourceMethod.isStatic() || callTarget.isStatic();
> + if (!isStatic && callTarget.receiver().isConstant()) {
> targetReceiverType = providers.getMetaAccess().lookupJavaType(callTarget.arguments().first().asConstant());
> }
>
>
> Best regards
> Stefan
>
--
Laurent Daynes
Oracle Labs
More information about the graal-dev
mailing list