# HG changeset patch # User iveresov # Date 1295995095 28800 # Node ID b4acee09acbc75da3b5ecff07eb2f48bff3b265d # Parent f5f4eac4c48f9ae61813f0d0d05bfb24dd10c19a 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 diff -r f5f4eac4c48f -r b4acee09acbc hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp Mon Jan 24 13:34:18 2011 -0800 +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp Tue Jan 25 14:38:15 2011 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -733,8 +733,8 @@ // generate compare-and-swap; produces zero condition if swap occurs int value_offset = sun_misc_AtomicLongCSImpl::value_offset(); - LIR_Opr addr = obj.result(); - __ add(addr, LIR_OprFact::intConst(value_offset), addr); + LIR_Opr addr = new_pointer_register(); + __ leal(LIR_OprFact::address(new LIR_Address(obj.result(), value_offset, T_LONG)), addr); LIR_Opr t1 = LIR_OprFact::illegalOpr; // no temp needed LIR_Opr t2 = LIR_OprFact::illegalOpr; // no temp needed __ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2);