8024919: G1: SPECjbb2013 crashes due to a broken object reference

Thu, 31 Oct 2013 04:16:40 -0700

author
iveresov
date
Thu, 31 Oct 2013 04:16:40 -0700
changeset 6051
946a8294ab15
parent 6050
4d3575d37a07
child 6052
2dcd0bd2920d

8024919: G1: SPECjbb2013 crashes due to a broken object reference
Summary: Pass correct new value to post_barrer() in Unsafe.getAndSetObject() C1 intrinsic
Reviewed-by: kvn, roland

src/cpu/x86/vm/c1_LIRGenerator_x86.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Wed Oct 30 22:55:11 2013 -0700
     1.2 +++ b/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Thu Oct 31 04:16:40 2013 -0700
     1.3 @@ -1468,19 +1468,18 @@
     1.4      addr = new LIR_Address(src.result(), offset, type);
     1.5    }
     1.6  
     1.7 -  if (data != dst) {
     1.8 -    __ move(data, dst);
     1.9 -    data = dst;
    1.10 -  }
    1.11 +  // Because we want a 2-arg form of xchg and xadd
    1.12 +  __ move(data, dst);
    1.13 +
    1.14    if (x->is_add()) {
    1.15 -    __ xadd(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr);
    1.16 +    __ xadd(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr);
    1.17    } else {
    1.18      if (is_obj) {
    1.19        // Do the pre-write barrier, if any.
    1.20        pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */,
    1.21                    true /* do_load */, false /* patch */, NULL);
    1.22      }
    1.23 -    __ xchg(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr);
    1.24 +    __ xchg(LIR_OprFact::address(addr), dst, dst, LIR_OprFact::illegalOpr);
    1.25      if (is_obj) {
    1.26        // Seems to be a precise address
    1.27        post_barrier(LIR_OprFact::address(addr), data);

mercurial