1 /* |
1 /* |
2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
731 // object pointer register is overwritten with field address |
731 // object pointer register is overwritten with field address |
732 obj.load_item(); |
732 obj.load_item(); |
733 |
733 |
734 // generate compare-and-swap; produces zero condition if swap occurs |
734 // generate compare-and-swap; produces zero condition if swap occurs |
735 int value_offset = sun_misc_AtomicLongCSImpl::value_offset(); |
735 int value_offset = sun_misc_AtomicLongCSImpl::value_offset(); |
736 LIR_Opr addr = obj.result(); |
736 LIR_Opr addr = new_pointer_register(); |
737 __ add(addr, LIR_OprFact::intConst(value_offset), addr); |
737 __ leal(LIR_OprFact::address(new LIR_Address(obj.result(), value_offset, T_LONG)), addr); |
738 LIR_Opr t1 = LIR_OprFact::illegalOpr; // no temp needed |
738 LIR_Opr t1 = LIR_OprFact::illegalOpr; // no temp needed |
739 LIR_Opr t2 = LIR_OprFact::illegalOpr; // no temp needed |
739 LIR_Opr t2 = LIR_OprFact::illegalOpr; // no temp needed |
740 __ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2); |
740 __ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2); |
741 |
741 |
742 // generate conditional move of boolean result |
742 // generate conditional move of boolean result |