Skip to content

Commit

Permalink
8330253: Remove verify_consistent_lock_order
Browse files Browse the repository at this point in the history
Co-authored-by: Patricio Chilano Mateo <pchilanomate@openjdk.org>
Reviewed-by: dcubed, pchilanomate, dnsimon
  • Loading branch information
xmas92 and pchilano committed Apr 29, 2024
1 parent 4e42294 commit 9b423a8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 70 deletions.
13 changes: 0 additions & 13 deletions src/hotspot/share/runtime/deoptimization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ static void restore_eliminated_locks(JavaThread* thread, GrowableArray<compiledV
#ifndef PRODUCT
bool first = true;
#endif // !PRODUCT
DEBUG_ONLY(GrowableArray<oop> lock_order{0};)
// Start locking from outermost/oldest frame
for (int i = (chunk->length() - 1); i >= 0; i--) {
compiledVFrame* cvf = chunk->at(i);
Expand All @@ -401,13 +400,6 @@ static void restore_eliminated_locks(JavaThread* thread, GrowableArray<compiledV
bool relocked = Deoptimization::relock_objects(thread, monitors, deoptee_thread, deoptee,
exec_mode, realloc_failures);
deoptimized_objects = deoptimized_objects || relocked;
#ifdef ASSERT
if (LockingMode == LM_LIGHTWEIGHT && !realloc_failures) {
for (MonitorInfo* mi : *monitors) {
lock_order.push(mi->owner());
}
}
#endif // ASSERT
#ifndef PRODUCT
if (PrintDeoptimizationDetails) {
ResourceMark rm;
Expand Down Expand Up @@ -439,11 +431,6 @@ static void restore_eliminated_locks(JavaThread* thread, GrowableArray<compiledV
#endif // !PRODUCT
}
}
#ifdef ASSERT
if (LockingMode == LM_LIGHTWEIGHT && !realloc_failures) {
deoptee_thread->lock_stack().verify_consistent_lock_order(lock_order, exec_mode != Deoptimization::Unpack_none);
}
#endif // ASSERT
}

// Deoptimize objects, that is reallocate and relock them, just before they escape through JVMTI.
Expand Down
54 changes: 0 additions & 54 deletions src/hotspot/share/runtime/lockStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,60 +103,6 @@ void LockStack::verify(const char* msg) const {
}
#endif

#ifdef ASSERT
void LockStack::verify_consistent_lock_order(GrowableArray<oop>& lock_order, bool leaf_frame) const {
int top_index = to_index(_top);
int lock_index = lock_order.length();

if (!leaf_frame) {
// If the lock_order is not from the leaf frame we must search
// for the top_index which fits with the most recent fast_locked
// objects in the lock stack.
while (lock_index-- > 0) {
const oop obj = lock_order.at(lock_index);
if (contains(obj)) {
for (int index = 0; index < top_index; index++) {
if (_base[index] == obj) {
// Found top index
top_index = index + 1;
break;
}
}

if (VM_Version::supports_recursive_lightweight_locking()) {
// With recursive looks there may be more of the same object
while (lock_index-- > 0 && lock_order.at(lock_index) == obj) {
top_index++;
}
assert(top_index <= to_index(_top), "too many obj in lock_order");
}

break;
}
}

lock_index = lock_order.length();
}

while (lock_index-- > 0) {
const oop obj = lock_order.at(lock_index);
const markWord mark = obj->mark_acquire();
assert(obj->is_locked(), "must be locked");
if (top_index > 0 && obj == _base[top_index - 1]) {
assert(mark.is_fast_locked() || mark.monitor()->is_owner_anonymous(),
"must be fast_locked or inflated by other thread");
top_index--;
} else {
assert(!mark.is_fast_locked(), "must be inflated");
assert(mark.monitor()->owner_raw() == get_thread() ||
(!leaf_frame && get_thread()->current_waiting_monitor() == mark.monitor()),
"must be owned by (or waited on by) thread");
assert(!contains(obj), "must not be on lock_stack");
}
}
}
#endif

void LockStack::print_on(outputStream* st) {
for (int i = to_index(_top); (--i) >= 0;) {
st->print("LockStack[%d]: ", i);
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/runtime/lockStack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ class LockStack {

// Printing
void print_on(outputStream* st);

// Verify Lock Stack consistent with lock order
void verify_consistent_lock_order(GrowableArray<oop>& lock_order, bool leaf_frame) const NOT_DEBUG_RETURN;
};

#endif // SHARE_RUNTIME_LOCKSTACK_HPP

1 comment on commit 9b423a8

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.