Mercurial > hg > truffle
comparison src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @ 2169:f966c66b5463
7014247: CTW fails when compile sun/misc/AtomicLongCSImpl (REMOVED from JDK7)
Summary: Use lea to compute field address in AtomicLongCSImpl::attemptUpdate() intrinsic on x86.
Reviewed-by: never, kvn
author | iveresov |
---|---|
date | Tue, 25 Jan 2011 14:38:15 -0800 |
parents | 037c727f35fb |
children | e1162778c1c8 |
comparison
equal
deleted
inserted
replaced
2168:e4fee0bdaa85 | 2169:f966c66b5463 |
---|---|
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 |