8138894: C1: Support IRIW on weak memory platforms

Reviewed-by: twisti, goetz
This commit is contained in:
Martin Doerr 2015-10-21 10:37:50 +02:00
parent 26f02e4686
commit 9a5f4d56ff
4 changed files with 22 additions and 6 deletions

View file

@ -1438,7 +1438,9 @@ void GraphBuilder::method_return(Value x) {
bool need_mem_bar = false;
if (method()->name() == ciSymbol::object_initializer_name() &&
(scope()->wrote_final() || (AlwaysSafeConstructors && scope()->wrote_fields()))) {
(scope()->wrote_final() || (AlwaysSafeConstructors && scope()->wrote_fields())
|| (support_IRIW_for_not_multiple_copy_atomic_cpu && scope()->wrote_volatile())
)){
need_mem_bar = true;
}
@ -1554,6 +1556,9 @@ void GraphBuilder::access_field(Bytecodes::Code code) {
if (code == Bytecodes::_putfield) {
scope()->set_wrote_fields();
if (field->is_volatile()) {
scope()->set_wrote_volatile();
}
}
const int offset = !needs_patching ? field->offset() : -1;