--- old/src/share/vm/c1/c1_GraphBuilder.cpp 2012-02-15 17:38:23.774326388 -0500 +++ new/src/share/vm/c1/c1_GraphBuilder.cpp 2012-02-15 17:38:22.381399298 -0500 @@ -1395,6 +1395,12 @@ call_register_finalizer(); } + bool need_mem_bar = false; + if (method()->name() == ciSymbol::object_initializer_name() && + scope()->wrote_final()) { + need_mem_bar = true; + } + // Check to see whether we are inlining. If so, Return // instructions become Gotos to the continuation point. if (continuation() != NULL) { @@ -1414,6 +1420,10 @@ monitorexit(state()->lock_at(0), SynchronizationEntryBCI); } + if (need_mem_bar) { + append(new MemBar(lir_membar_storestore)); + } + // State at end of inlined method is the state of the caller // without the method parameters on stack, including the // return value, if any, of the inlined method on operand stack. @@ -1433,7 +1443,6 @@ // the continuation point. append_with_bci(goto_callee, scope_data()->continuation()->bci()); incr_num_returns(); - return; } @@ -1449,6 +1458,10 @@ append_split(new MonitorExit(receiver, state()->unlock())); } + if (need_mem_bar) { + append(new MemBar(lir_membar_storestore)); + } + append(new Return(x)); } @@ -1481,6 +1494,9 @@ } } + if (field->is_final() && (code == Bytecodes::_putfield)) { + scope()->set_wrote_final(); + } const int offset = !needs_patching ? field->offset() : -1; switch (code) {