Skip to content

Commit 45300dd

Browse files
hgqxjjTobiHartmann
authored andcommitted
8358568: Purge obsolete/broken GenerateSynchronizationCode flag
Reviewed-by: thartmann, shade
1 parent 44cff9d commit 45300dd

File tree

6 files changed

+6
-23
lines changed

6 files changed

+6
-23
lines changed

src/hotspot/share/c1/c1_LIRGenerator.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,6 @@ void LIRGenerator::logic_op (Bytecodes::Code code, LIR_Opr result_op, LIR_Opr le
623623

624624

625625
void LIRGenerator::monitor_enter(LIR_Opr object, LIR_Opr lock, LIR_Opr hdr, LIR_Opr scratch, int monitor_no, CodeEmitInfo* info_for_exception, CodeEmitInfo* info) {
626-
if (!GenerateSynchronizationCode) return;
627626
// for slow path, use debug info for state after successful locking
628627
CodeStub* slow_path = new MonitorEnterStub(object, lock, info);
629628
__ load_stack_address_monitor(monitor_no, lock);
@@ -633,7 +632,6 @@ void LIRGenerator::monitor_enter(LIR_Opr object, LIR_Opr lock, LIR_Opr hdr, LIR_
633632

634633

635634
void LIRGenerator::monitor_exit(LIR_Opr object, LIR_Opr lock, LIR_Opr new_hdr, LIR_Opr scratch, int monitor_no) {
636-
if (!GenerateSynchronizationCode) return;
637635
// setup registers
638636
LIR_Opr hdr = lock;
639637
lock = new_hdr;
@@ -2585,7 +2583,7 @@ void LIRGenerator::do_Base(Base* x) {
25852583
}
25862584
assert(obj->is_valid(), "must be valid");
25872585

2588-
if (method()->is_synchronized() && GenerateSynchronizationCode) {
2586+
if (method()->is_synchronized()) {
25892587
LIR_Opr lock = syncLockOpr();
25902588
__ load_stack_address_monitor(0, lock);
25912589

src/hotspot/share/opto/callnode.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1451,14 +1451,8 @@ void SafePointNode::push_monitor(const FastLockNode *lock) {
14511451
assert(JVMState::logMonitorEdges == exact_log2(MonitorEdges), "correct MonitorEdges");
14521452
assert(req() == jvms()->endoff(), "correct sizing");
14531453
int nextmon = jvms()->scloff();
1454-
if (GenerateSynchronizationCode) {
1455-
ins_req(nextmon, lock->box_node());
1456-
ins_req(nextmon+1, lock->obj_node());
1457-
} else {
1458-
Node* top = Compile::current()->top();
1459-
ins_req(nextmon, top);
1460-
ins_req(nextmon, top);
1461-
}
1454+
ins_req(nextmon, lock->box_node());
1455+
ins_req(nextmon+1, lock->obj_node());
14621456
jvms()->set_scloff(nextmon + MonitorEdges);
14631457
jvms()->set_endoff(req());
14641458
}

src/hotspot/share/opto/graphKit.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3447,8 +3447,6 @@ FastLockNode* GraphKit::shared_lock(Node* obj) {
34473447
// %%% SynchronizationEntryBCI is redundant; use InvocationEntryBci in interfaces
34483448
assert(SynchronizationEntryBCI == InvocationEntryBci, "");
34493449

3450-
if( !GenerateSynchronizationCode )
3451-
return nullptr; // Not locking things?
34523450
if (stopped()) // Dead monitor?
34533451
return nullptr;
34543452

@@ -3511,8 +3509,6 @@ void GraphKit::shared_unlock(Node* box, Node* obj) {
35113509
// %%% SynchronizationEntryBCI is redundant; use InvocationEntryBci in interfaces
35123510
assert(SynchronizationEntryBCI == InvocationEntryBci, "");
35133511

3514-
if( !GenerateSynchronizationCode )
3515-
return;
35163512
if (stopped()) { // Dead monitor?
35173513
map()->pop_monitor(); // Kill monitor from debug info
35183514
return;

src/hotspot/share/opto/output.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,8 +1074,7 @@ void PhaseOutput::Process_OopMap_Node(MachNode *mach, int current_offset) {
10741074
assert( !method ||
10751075
!method->is_synchronized() ||
10761076
method->is_native() ||
1077-
num_mon > 0 ||
1078-
!GenerateSynchronizationCode,
1077+
num_mon > 0,
10791078
"monitors must always exist for synchronized methods");
10801079

10811080
// Build the growable array of ScopeValues for exp stack

src/hotspot/share/opto/parse1.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ void Parse::do_exits() {
10651065
// This is done late so that we can common up equivalent exceptions
10661066
// (e.g., null checks) arising from multiple points within this method.
10671067
// See GraphKit::add_exception_state, which performs the commoning.
1068-
bool do_synch = method()->is_synchronized() && GenerateSynchronizationCode;
1068+
bool do_synch = method()->is_synchronized();
10691069

10701070
// record exit from a method if compiled while Dtrace is turned on.
10711071
if (do_synch || C->env()->dtrace_method_probes() || _replaced_nodes_for_exceptions) {
@@ -2189,7 +2189,7 @@ void Parse::return_current(Node* value) {
21892189

21902190
// Do not set_parse_bci, so that return goo is credited to the return insn.
21912191
set_bci(InvocationEntryBci);
2192-
if (method()->is_synchronized() && GenerateSynchronizationCode) {
2192+
if (method()->is_synchronized()) {
21932193
shared_unlock(_synch_lock->box_node(), _synch_lock->obj_node());
21942194
}
21952195
if (C->env()->dtrace_method_probes()) {

src/hotspot/share/runtime/globals.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -951,10 +951,6 @@ const int ObjectAlignmentInBytes = 8;
951951
"Inject thread creation failures for " \
952952
"UseDynamicNumberOfCompilerThreads") \
953953
\
954-
develop(bool, GenerateSynchronizationCode, true, \
955-
"generate locking/unlocking code for synchronized methods and " \
956-
"monitors") \
957-
\
958954
product_pd(bool, ImplicitNullChecks, DIAGNOSTIC, \
959955
"Generate code for implicit null checks") \
960956
\

0 commit comments

Comments
 (0)