CompareAndSwapNode support

Deneau, Tom tom.deneau at amd.com
Fri Oct 25 06:14:10 PDT 2013


Should also add that the java 8 build of the newly merged graal is able to successfully run all of our other junit tests, just not the ones dealing with CompareAndSwapNode subsitutions.

-- Tom
________________________________________
From: graal-dev-bounces at openjdk.java.net [graal-dev-bounces at openjdk.java.net] on behalf of Deneau, Tom
Sent: Friday, October 25, 2013 8:07 AM
To: Christian Thalinger
Cc: graal-dev at openjdk.java.net
Subject: RE: CompareAndSwapNode support

Just to further clarify...

We had a HSAIL  junit test that called AtomicInteger.getAndAddInt from a lambda.  This made it java 8 specific.  This test worked fine (building and running graal with java 8) up until we started doing this merge with the new infrastructure changes.

We now have a version of this test that does the same thing but does not use lambdas.  So this new version can be invoked from java 7.   This new java7-style junit test still fails when we build our newly merged graal (newly merged with the new infrastructure) with java 8-b109 and try to run the test.  The top of the stack trace is shown below.

But if I build our merged graal with java7 b21 this new junit test succeeds.

-- Toim

________________________________________
From: Christian Thalinger [christian.thalinger at oracle.com]
Sent: Thursday, October 24, 2013 8:00 PM
To: Deneau, Tom
Cc: graal-dev at openjdk.java.net
Subject: Re: CompareAndSwapNode support

On Oct 24, 2013, at 3:24 PM, Deneau, Tom <tom.deneau at amd.com> wrote:

> Some additional information on this...
>
> The original junit test was written using lambdas and so could not be run under java 7.  Since our junit framework also supports java7 style tests, I rewrote the test to be java 7, and rebuilt graal with java 7.  And with no other changes to graal, the test now passes.
>
> Does this make any sense?
>
> -- Tom
>
> From: Deneau, Tom
> Sent: Thursday, October 24, 2013 3:21 PM
> To: graal-dev at openjdk.java.net
> Subject: CompareAndSwapNode support
>
> In the HSAIL backend, we had support for CompareAndSwapNode.  (we had not pushed this out to the trunk yet).
>
> As part of the merge with the new runtime infrastructure changes, I see that our CompareAndSwapNode  support is broken.
> I'm trying to understand how to get it working again.
>
> In the particular test I'm looking at the java code calls atomicInt.getAndAdd(constant)

Do you mean getAndAddInt?  If you are talking about the Unsafe guys these exist since 1.8.  So compiling (and running) with 7 or 8 definitely makes a difference.

>
> First I noticed that we were getting Invoke nodes for things like getIntVolatile and compareAndSwapInt.
> So I assumed the UnsafeSubstitutions needed to be enabled for our backend.
>
> When I enabled these, I got the following error which doesn't mean anything to me...
>
> java.lang.AssertionError: <unknown> has unexpected usage 20|LoadField#value of checkcast 19|GuardingPi at <unknown>
>                at com.oracle.graal.replacements.NodeIntrinsificationPhase.checkCheckCastUsage(NodeIntrinsificationPhase.java:387)
>                at com.oracle.graal.replacements.NodeIntrinsificationPhase.checkCheckCastUsage(NodeIntrinsificationPhase.java:382)
>                at com.oracle.graal.replacements.NodeIntrinsificationPhase.cleanUpReturnCheckCast(NodeIntrinsificationPhase.java:328)
>                at com.oracle.graal.replacements.NodeIntrinsificationPhase.run(NodeIntrinsificationPhase.java:67)
>
> Any suggestions?
>
> -- Tom
>







More information about the graal-dev mailing list