mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8230434: [C1, C2] Release barrier for volatile field stores in constructors implemented inconsistently
Reviewed-by: shade, lucy
This commit is contained in:
parent
f7d0ece0a1
commit
b0e727124f
2 changed files with 18 additions and 14 deletions
|
@ -1467,11 +1467,12 @@ void GraphBuilder::method_return(Value x, bool ignore_return) {
|
|||
call_register_finalizer();
|
||||
}
|
||||
|
||||
// The conditions for a memory barrier are described in Parse::do_exits().
|
||||
bool need_mem_bar = false;
|
||||
if (method()->name() == ciSymbol::object_initializer_name() &&
|
||||
(scope()->wrote_final() || (AlwaysSafeConstructors && scope()->wrote_fields())
|
||||
|| (support_IRIW_for_not_multiple_copy_atomic_cpu && scope()->wrote_volatile())
|
||||
)){
|
||||
(scope()->wrote_final() ||
|
||||
(AlwaysSafeConstructors && scope()->wrote_fields()) ||
|
||||
(support_IRIW_for_not_multiple_copy_atomic_cpu && scope()->wrote_volatile()))) {
|
||||
need_mem_bar = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue