United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7012965 Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API
JDK-7012965 : Fix failed on sparc for 7009756: volatile variables could be broken throw reflection API

Details
Type:
Bug
Submit Date:
2011-01-18
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs20 (b07)

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

Description
During bug fix verification it was found that fix for  7009756: volatile variables could be broken throw reflection API
Test is:
echeneis/vm/code/gen/default_preopt_xdebug/VolatileReflectionTest#testVolatileReflection

                                    

Comments
EVALUATION

I should have know that volatile in C++ is different from Java volatile. It does not guaranty atomicity:

   80   inline jlong    OrderAccess::load_acquire(volatile jlong*   p) { return *p; }
0xfe7e2458: load_acquire       :        save     %sp, -104, %sp
0xfe7e245c: load_acquire+0x0004:        st       %i0, [%fp + 68]
0xfe7e2460: load_acquire+0x0008:        ld       [%fp + 68], %l0
0xfe7e2464: load_acquire+0x000c:        ld       [%l0 + 4], %l1
0xfe7e2468: load_acquire+0x0010:        ld       [%l0], %l0
0xfe7e246c: load_acquire+0x0014:        st       %l0, [%fp - 8]
0xfe7e2470: load_acquire+0x0018:        st       %l1, [%fp - 4]
0xfe7e2474: load_acquire+0x001c:        ldx      [%fp - 8], %g1
0xfe7e2478: load_acquire+0x0020:        srlx     %g1, 32, %l0
0xfe7e247c: load_acquire+0x0024:        mov      %g1, %l1
0xfe7e2480: load_acquire+0x0028:        mov      %l1, %i1
0xfe7e2484: load_acquire+0x002c:        mov      %l0, %i0
0xfe7e2488: load_acquire+0x0030:        ret      
0xfe7e248c: load_acquire+0x0034:        restore
                                     
2011-01-18
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/85c73c0edb06
                                     
2011-01-19
PUBLIC COMMENTS

In 32 bit VM C++ generated code does not guaranty atomicity for volatile long moves.

Use LDX/STX on v9 and LDD/STD on v8 sparc for volatile long moves.
                                     
2011-01-19
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/85c73c0edb06
                                     
2011-01-21



Hardware and Software, Engineered to Work Together