8235678: Remove unnecessary calls to Thread::current() in MutexLocker calls

Add THREAD argument when available and make Thread* the first argument to relevant MutexLocker and MonitorLocker constructors

Reviewed-by: lfoltan, coleenp, dholmes
This commit is contained in:
Harold Seigel 2020-01-16 13:48:23 +00:00
parent e2240b714e
commit 7fc58a1020
36 changed files with 122 additions and 121 deletions

View file

@ -522,7 +522,7 @@ void Method::build_interpreter_method_data(const methodHandle& method, TRAPS) {
// Grab a lock here to prevent multiple
// MethodData*s from being created.
MutexLocker ml(MethodData_lock, THREAD);
MutexLocker ml(THREAD, MethodData_lock);
if (method->method_data() == NULL) {
ClassLoaderData* loader_data = method->method_holder()->class_loader_data();
MethodData* method_data = MethodData::allocate(loader_data, method, THREAD);
@ -2455,7 +2455,7 @@ void Method::log_touched(TRAPS) {
my_sig->identity_hash();
juint index = juint(hash) % table_size;
MutexLocker ml(TouchedMethodLog_lock, THREAD);
MutexLocker ml(THREAD, TouchedMethodLog_lock);
if (_touched_method_table == NULL) {
_touched_method_table = NEW_C_HEAP_ARRAY2(TouchedMethodRecord*, table_size,
mtTracing, CURRENT_PC);