Mercurial > hg > truffle
comparison src/share/vm/c1/c1_LIRGenerator.cpp @ 2123:df307487d610
7010665: Misplaced membar in C1 implementation of Unsafe.get/putXXX
Summary: Modify membars to match regular volatile variable handling
Reviewed-by: iveresov, kvn, never
author | dholmes |
---|---|
date | Sun, 09 Jan 2011 17:16:16 -0500 |
parents | 5ddfcf4b079e |
children | e31d8c656c5b |
comparison
equal
deleted
inserted
replaced
2101:55d7d18ccff9 | 2123:df307487d610 |
---|---|
1988 off.load_item(); | 1988 off.load_item(); |
1989 src.load_item(); | 1989 src.load_item(); |
1990 | 1990 |
1991 LIR_Opr reg = reg = rlock_result(x, x->basic_type()); | 1991 LIR_Opr reg = reg = rlock_result(x, x->basic_type()); |
1992 | 1992 |
1993 get_Object_unsafe(reg, src.result(), off.result(), type, x->is_volatile()); | |
1993 if (x->is_volatile() && os::is_MP()) __ membar_acquire(); | 1994 if (x->is_volatile() && os::is_MP()) __ membar_acquire(); |
1994 get_Object_unsafe(reg, src.result(), off.result(), type, x->is_volatile()); | |
1995 if (x->is_volatile() && os::is_MP()) __ membar(); | |
1996 } | 1995 } |
1997 | 1996 |
1998 | 1997 |
1999 void LIRGenerator::do_UnsafePutObject(UnsafePutObject* x) { | 1998 void LIRGenerator::do_UnsafePutObject(UnsafePutObject* x) { |
2000 BasicType type = x->basic_type(); | 1999 BasicType type = x->basic_type(); |
2012 | 2011 |
2013 set_no_result(x); | 2012 set_no_result(x); |
2014 | 2013 |
2015 if (x->is_volatile() && os::is_MP()) __ membar_release(); | 2014 if (x->is_volatile() && os::is_MP()) __ membar_release(); |
2016 put_Object_unsafe(src.result(), off.result(), data.result(), type, x->is_volatile()); | 2015 put_Object_unsafe(src.result(), off.result(), data.result(), type, x->is_volatile()); |
2016 if (x->is_volatile() && os::is_MP()) __ membar(); | |
2017 } | 2017 } |
2018 | 2018 |
2019 | 2019 |
2020 void LIRGenerator::do_UnsafePrefetch(UnsafePrefetch* x, bool is_store) { | 2020 void LIRGenerator::do_UnsafePrefetch(UnsafePrefetch* x, bool is_store) { |
2021 LIRItem src(x->object(), this); | 2021 LIRItem src(x->object(), this); |