Skip to content

Commit

Permalink
[Misc] Fix bugs in previous commit.
Browse files Browse the repository at this point in the history
Summary:
- Basic change such as naming convention or typo.
- Fix wrong usage of some functions.
- Add one more dereference when encouter _threadObj since it's oop* rather than oop in Java11.
- Add WispThread convertion in clinit_barrier when UseWispMonitor is enabled, because ini thread is WispThread.
- Pass correct current thread to ExceptionMark constructor in Runtime1::monitorexit_wisp.
- Modify code in test to pass hotspot and jdk jtregs.
- Fix wisp2 create property crash.
- Delete control node in make_runtime_call() since it is wrong that treating control node to memory node.
- Refine coroutine properties append logic(From JVM_GetProperties to Arguments::init_system_properties).
- Hoist code of safepoint state out of MutexLocker to prevent safepoint deadlock problem.
- Fix WispThread BarrierSet and JavaCalls assert.
- Fix Thread interrupted flag in public class Thread.
- Fix threadObj changed in coroutine steal.
- Add more debug functions for switchTo.
- Delete jniDetachThreadHoldingMonitorTest.sh, jniMonitorExitTest.sh and SelectorInitCriticalTest.java because SelectorProvider removed lock in Java17.
- test/hotspot/jtreg/runtime/jni/registerNativesWarning/TestRegisterNativesWarning.java: yield() in Thread.java is not a native method after we port wisp coroutine to JDK. Thus we use currentTimeMillis() instead.
- vmTestbase/nsk/monitoring/stress/thread/strace001/TestDescription.java: Add "java.lang.Thread.sleep0" and "java.lang.Thread.yield0" in expectedTrace, and let expectedLength = depth + 4.
- test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/ThreadController.java: Add sleep0 and yield0 in expectedMethods.
- test/hotspot/jtreg/vmTestbase/nsk/stress/strace/strace00*.java: Add sleep0 and yield0 in EXPECTED_METHODS.
- test/hotspot/jtreg/vmTestbase/nsk/monitoring/share/thread/SleepingThread.java and RunningThread.java: Add sleep0 and yield0 in expectedMethods.
- test/hotspot/jtreg/vmTestbase/nsk/share/locks/LockingThread.java: Add 1 to expectedDepth and add function myWait to add 1 more stack frame.
- test/jdk/java/beans/XMLDecoder/8028054/Task.java: Remove "java.dyn.CoroutineSupport" from fileNames.
- test/jdk/jdk/jfr/event/runtime/TestSystemPropertyEvent.java: Add "com.alibaba.coroutine.enableCoroutine" to SystemProperty.
- test/jdk/com/alibaba/wisp2/Wisp2ShutdownTest.java: Change awaitTermination time to 5 seconds, because all coroutines may not terminated in 1 second.
- Put trace_switch, print_site and coroutine_switch_trace into debug version.

Reviewed-by: yulei

Test Plan:
test/hotspot/jtreg/runtime/coroutine/
test/jdk/com/alibaba/wisp
test/jdk/com/alibaba/wisp2

Issue:
#77
  • Loading branch information
nebula-xm authored and yuleil committed Jul 6, 2023
1 parent c590c27 commit 5adb2a4
Show file tree
Hide file tree
Showing 128 changed files with 563 additions and 432 deletions.
16 changes: 9 additions & 7 deletions make/modules/java.base/Copy.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,15 @@ $(NET_PROPERTIES_DST): $(NET_PROPERTIES_SRCS)

TARGETS += $(NET_PROPERTIES_DST)

################################################################################

$(eval $(call SetupCopyFiles, COPY_WISP_PROPERTIES, \
FILES := $(TOPDIR)/src/java.base/share/conf/wisp.properties, \
DEST := $(CONF_DST_DIR), \
))

TARGETS += $(COPY_WISP_PROPERTIES)

ifeq ($(call isTargetOs, linux), true)
$(eval $(call SetupCopyFiles, COPY_SDP_CONF, \
FILES := $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/sdp/sdp.conf.template, \
Expand All @@ -205,13 +214,6 @@ ifeq ($(call isTargetOs, linux), true)
TARGETS += $(COPY_SDP_CONF)
endif

$(eval $(call SetupCopyFiles, COPY_WISP_PROPERTIES, \
FILES := $(TOPDIR)/src/java.base/share/conf/wisp.properties, \
DEST := $(CONF_DST_DIR), \
))

TARGETS += $(COPY_WISP_PROPERTIES)

################################################################################

# JDK license and assembly exception files to be packaged in JMOD
Expand Down
7 changes: 7 additions & 0 deletions src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,14 @@ void C2_MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmp
// Propagate ICC.ZF from CAS above into DONE_LABEL.
jcc(Assembler::equal, DONE_LABEL); // CAS above succeeded; propagate ZF = 1 (success)

if (UseWispMonitor) {
movptr (r15_thread, Address(r15_thread, JavaThread::current_coroutine_offset()));
movptr (r15_thread, Address(r15_thread, Coroutine::wisp_thread_offset()));
}
cmpptr(r15_thread, rax); // Check if we are already the owner (recursive lock)
if (UseWispMonitor) {
movptr (r15_thread, Address(r15_thread, WispThread::thread_offset()));
}
jcc(Assembler::notEqual, DONE_LABEL); // If not recursive, ZF = 0 at this point (fail)
incq(Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions)));
xorq(rax, rax); // Set ZF = 1 (success) for recursive lock, denoting locking success
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/cpu/x86/interp_masm_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,11 +817,11 @@ void InterpreterMacroAssembler::jump_from_interpreted(Register method, Register
cmpb(Address(temp, JavaThread::interp_only_mode_offset()), 0);
jccb(Assembler::zero, run_compiled_code);
if (EnableCoroutine) {
cmpq(Address(method, Method::intrinsic_id_offset_in_bytes()), (int)vmIntrinsics::_switchTo);
cmpq(Address(method, Method::intrinsic_id_offset_in_bytes()), (int32_t)vmIntrinsics::_switchTo);
jcc(Assembler::zero, coroutine_skip_interpret);
cmpq(Address(method, Method::intrinsic_id_offset_in_bytes()), (int)vmIntrinsics::_switchToAndExit);
cmpq(Address(method, Method::intrinsic_id_offset_in_bytes()), (int32_t)vmIntrinsics::_switchToAndExit);
jcc(Assembler::zero, coroutine_skip_interpret);
cmpq(Address(method, Method::intrinsic_id_offset_in_bytes()), (int)vmIntrinsics::_switchToAndTerminate);
cmpq(Address(method, Method::intrinsic_id_offset_in_bytes()), (int32_t)vmIntrinsics::_switchToAndTerminate);
jcc(Assembler::zero, coroutine_skip_interpret);
}
jmp(Address(method, Method::interpreter_entry_offset()));
Expand Down
7 changes: 7 additions & 0 deletions src/hotspot/cpu/x86/macroAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4161,8 +4161,15 @@ void MacroAssembler::clinit_barrier(Register klass, Register thread, Label* L_fa
cmpb(Address(klass, InstanceKlass::init_state_offset()), InstanceKlass::fully_initialized);
jcc(Assembler::equal, *L_fast_path);

if (UseWispMonitor) {
movptr(thread, Address(thread, JavaThread::current_coroutine_offset()));
movptr(thread, Address(thread, Coroutine::wisp_thread_offset()));
}
// Fast path check: current thread is initializer thread
cmpptr(thread, Address(klass, InstanceKlass::init_thread_offset()));
if (UseWispMonitor) {
movptr(thread, Address(thread, WispThread::thread_offset()));
}
if (L_slow_path == &L_fallthrough) {
jcc(Assembler::equal, *L_fast_path);
bind(*L_slow_path);
Expand Down
47 changes: 38 additions & 9 deletions src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,11 @@ static void gen_special_dispatch(MacroAssembler* masm,
receiver_reg, member_reg, /*for_compiler_entry:*/ true);
}

void create_switchTo_contents(MacroAssembler *masm, int start, OopMapSet* oop_maps, int &stack_slots, int total_in_args, BasicType *in_sig_bt, VMRegPair *in_regs, BasicType ret_type, bool terminate);
void create_switchTo_contents(MacroAssembler *masm, int start,
OopMapSet* oop_maps, int &stack_slots,
int total_in_args, BasicType *in_sig_bt, VMRegPair *in_regs,
BasicType ret_type, bool terminate,
int total_c_args, VMRegPair *out_regs);

void generate_thread_fix(MacroAssembler *masm, Method *method) {
// we can have a check here at the codegen time, so no cost in runtime.
Expand Down Expand Up @@ -1823,10 +1827,14 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
if (EnableCoroutine) {
// the coroutine support methods have a hand-coded fast version that will handle the most common cases
if (method->intrinsic_id() == vmIntrinsics::_switchTo) {
create_switchTo_contents(masm, start, oop_maps, stack_slots, total_in_args, in_sig_bt, in_regs, ret_type, false);
create_switchTo_contents(masm, start, oop_maps, stack_slots,
total_in_args, in_sig_bt, in_regs, ret_type, false,
total_c_args, out_regs);
} else if (method->intrinsic_id() == vmIntrinsics::_switchToAndTerminate ||
method->intrinsic_id() == vmIntrinsics::_switchToAndExit) {
create_switchTo_contents(masm, start, oop_maps, stack_slots, total_in_args, in_sig_bt, in_regs, ret_type, true);
create_switchTo_contents(masm, start, oop_maps, stack_slots,
total_in_args, in_sig_bt, in_regs, ret_type, true,
total_c_args, out_regs);
}
}

Expand Down Expand Up @@ -3991,8 +3999,26 @@ MacroAssembler* debug_line(MacroAssembler* masm, int l) {
return masm;
}

static const int64_t invalid_val = 0x500000005L;
void crash_if_reg_invalid(MacroAssembler *masm, Register reg, int loc) {
Label skip;
__ cmp64(reg, ExternalAddress((address)&invalid_val));
__ jcc(Assembler::notEqual, skip);
__ movptr(Address(reg, (ByteSize)loc), (intptr_t)loc);
__ bind(skip);
}

#ifdef ASSERT
void trace_switch(MacroAssembler *masm, Register reg, int total_c_args, VMRegPair *out_regs) {
save_args(masm, total_c_args, 0, out_regs);
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::coroutine_switch_trace), r15_thread, reg);
restore_args(masm, total_c_args, 0, out_regs);
}
#endif

void create_switchTo_contents(MacroAssembler *masm, int start, OopMapSet* oop_maps, int &stack_slots, int total_in_args,
BasicType *in_sig_bt, VMRegPair *in_regs, BasicType ret_type, bool terminate) {
BasicType *in_sig_bt, VMRegPair *in_regs, BasicType ret_type, bool terminate,
int total_c_args, VMRegPair *out_regs) {
assert(total_in_args == 2, "wrong number of arguments");

if (j_rarg0 != rsi) {
Expand Down Expand Up @@ -4033,7 +4059,6 @@ void create_switchTo_contents(MacroAssembler *masm, int start, OopMapSet* oop_ma
DEBUG_ONLY(stop_if_null(masm, old_coroutine_obj, "null old_coroutine"));
__ movptr(old_coroutine, Address(old_coroutine_obj, java_dyn_CoroutineBase::get_data_offset()));
DEBUG_ONLY(stop_if_null(masm, old_coroutine, "old_coroutine without data"));
__ movptr(old_stack, Address(old_coroutine, Coroutine::stack_offset()));

#if defined(_WINDOWS)
// rescue the SEH pointer
Expand All @@ -4059,14 +4084,18 @@ void create_switchTo_contents(MacroAssembler *masm, int start, OopMapSet* oop_ma
__ movptr(Address(old_coroutine, Coroutine::last_Java_pc_offset()), temp);
__ movptr(temp, Address(thread, JavaThread::last_Java_sp_offset()));
__ movptr(Address(old_coroutine, Coroutine::last_Java_sp_offset()), temp);
// __ movptr(temp, Address(thread, JavaThread::privileged_stack_top_offset()));
// __ movptr(Address(old_coroutine, Coroutine::privileged_stack_top_offset()), temp);
__ movptr(temp, Address(thread, JavaThread::threadObj_offset()));
// Now temp is JavaThread::_threadObj.
// In Java17, JavaThread::_threadObj is oop* while Java11 stores JavaThread::_threadObj as oop.
// So we dereference temp here to get the target JavaThread oop.
__ movptr(temp, Address(temp, 0));
__ movl(temp, Address(temp, java_lang_Thread::thread_status_offset()));
__ movl(Address(old_coroutine, Coroutine::thread_status_offset()), temp);
__ movl(temp, Address(thread, JavaThread::java_call_counter_offset()));
__ movl(Address(old_coroutine, Coroutine::java_call_counter_offset()), temp);

// store rsp into CorotineStack
__ movptr(old_stack, Address(old_coroutine, Coroutine::stack_offset()));
__ movptr(Address(old_stack, CoroutineStack::last_sp_offset()), rsp);
}
Register target_stack = r12;
Expand Down Expand Up @@ -4100,10 +4129,10 @@ void create_switchTo_contents(MacroAssembler *masm, int start, OopMapSet* oop_ma
__ movptr(Address(thread, JavaThread::last_Java_pc_offset()), temp);
__ movptr(temp, Address(target_coroutine, Coroutine::last_Java_sp_offset()));
__ movptr(Address(thread, JavaThread::last_Java_sp_offset()), temp);
// __ movptr(temp, Address(target_coroutine, Coroutine::privileged_stack_top_offset()));
// __ movptr(Address(thread, JavaThread::privileged_stack_top_offset()), temp);
__ movl(temp2, Address(target_coroutine, Coroutine::thread_status_offset()));
__ movptr(temp, Address(thread, JavaThread::threadObj_offset()));
// Dereference temp here to get the target JavaThread oop.
__ movptr(temp, Address(temp, 0));
__ movl(Address(temp, java_lang_Thread::thread_status_offset()), temp2);
__ movl(temp, Address(target_coroutine, Coroutine::java_call_counter_offset()));
__ movl(Address(thread, JavaThread::java_call_counter_offset()), temp);
Expand Down
14 changes: 0 additions & 14 deletions src/hotspot/os/posix/os_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@


#include "jvm.h"
#include "memory/allocation.hpp"
#ifdef LINUX
#include "classfile/classLoader.hpp"
#endif
Expand Down Expand Up @@ -876,19 +875,6 @@ void os::naked_short_sleep(jlong ms) {
return;
}

bool clear_interrupt_for_wisp(Thread* thread) {
assert(EnableCoroutine, "Coroutine is disabled");
// If we only use -XX:+EnableCoroutine and -Dcom.alibaba.transparentAsync=true, we will
// fall here, so we cannot use `assert(UseWispMonitor)` only.
if (UseWispMonitor && thread->is_Wisp_thread()) {
thread = ((WispThread *)thread)->thread();
}
bool interrupted = ((JavaThread*) thread->as_Java_thread())->is_interrupted(false);
thread->osthread()->set_interrupted(false);

return interrupted;
}

char* os::Posix::describe_pthread_attr(char* buf, size_t buflen, const pthread_attr_t* attr) {
size_t stack_size = 0;
size_t guard_size = 0;
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/c1/c1_Runtime1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,8 @@ JRT_END
JRT_ENTRY_NO_ASYNC(void, Runtime1::monitorexit_wisp(JavaThread* current, BasicObjectLock* lock))
NOT_PRODUCT(_monitorexit_slowcase_cnt++;)
assert(UseWispMonitor, "UseWispMonitor is off");
JavaThread* thread_tmp = NULL;
ExceptionMark __em(thread_tmp);
assert(current == Thread::current(), "sanity check");
ExceptionMark em(current);
oop obj = lock->obj();
// Almost a copy from Runtime1::monitorexit,
// excpet that handles are used to access objects.
Expand All @@ -733,15 +733,15 @@ JRT_END
// 3. There is no exception handler in this method, So it needs to unwind to its caller
// 4. GC happened during unpark
// This path will not call Java, so JRT_LEAF is used.
JRT_LEAF(void, Runtime1::monitorexit_wisp_proxy(JavaThread* thread, BasicObjectLock* lock))
JRT_LEAF(void, Runtime1::monitorexit_wisp_proxy(JavaThread* current, BasicObjectLock* lock))
NOT_PRODUCT(_monitorexit_slowcase_cnt++;)
assert(UseWispMonitor, "UseWispMonitor is off");
EXCEPTION_MARK;
oop obj = lock->obj();
assert(oopDesc::is_oop(obj), "must be NULL or an object");
// Setting _is_proxy_unpark of current wisp thread to true.
// Proxy unpark will be used when this flag is true.
WispThread* wisp_thread = WispThread::current(thread);
WispThread* wisp_thread = WispThread::current(current);
wisp_thread->set_proxy_unpark_flag();
// When using fast locking, the compiled code has already tried the fast case
ObjectSynchronizer::exit(obj, lock->lock(), THREAD);
Expand Down
11 changes: 5 additions & 6 deletions src/hotspot/share/classfile/javaClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4755,9 +4755,9 @@ void java_dyn_CoroutineBase::set_data(oop obj, jlong value) {
int com_alibaba_wisp_engine_WispEngine::_isInCritical_offset = 0;

void com_alibaba_wisp_engine_WispEngine::compute_offsets() {
Klass* k = vmClasses::com_alibaba_wisp_engine_WispEngine_klass();
assert(k != NULL, "WispEngine_klass is null");
compute_offset(_isInCritical_offset, InstanceKlass::cast(k), vmSymbols::isInCritical_name(), vmSymbols::bool_signature());
InstanceKlass* ik = vmClasses::com_alibaba_wisp_engine_WispEngine_klass();
assert(ik != NULL, "WispEngine_klass is null");
compute_offset(_isInCritical_offset, ik, vmSymbols::isInCritical_name(), vmSymbols::bool_signature());
}

bool com_alibaba_wisp_engine_WispEngine::in_critical(oop obj) {
Expand All @@ -4773,9 +4773,8 @@ int com_alibaba_wisp_engine_WispTask::_stealCount_offset = 0;
int com_alibaba_wisp_engine_WispTask::_stealFailureCount_offset = 0;

void com_alibaba_wisp_engine_WispTask::compute_offsets() {
Klass* k = vmClasses::com_alibaba_wisp_engine_WispTask_klass();
assert(k != NULL, "WispTask_klass is null");
InstanceKlass *ik = InstanceKlass::cast(k);
InstanceKlass* ik = vmClasses::com_alibaba_wisp_engine_WispTask_klass();
assert(ik != NULL, "WispTask_klass is null");
compute_offset(_jvmParkStatus_offset, ik, vmSymbols::jvmParkStatus_name(), vmSymbols::int_signature());
compute_offset(_id_offset, ik, vmSymbols::id_name(), vmSymbols::int_signature());
compute_offset(_threadWrapper_offset, ik, vmSymbols::threadWrapper_name(), vmSymbols::thread_signature());
Expand Down
32 changes: 14 additions & 18 deletions src/hotspot/share/classfile/systemDictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Symbol* SystemDictionary::class_name_symbol(const char* name, Symbol* exception,
#ifdef ASSERT
// Used to verify that class loading succeeded in adding k to the dictionary.
void verify_dictionary_entry(Symbol* class_name, InstanceKlass* k) {
SystemDictLocker mu(SystemDictionary_lock);
SystemDictLocker mu(JavaThread::current(), SystemDictionary_lock);
ClassLoaderData* loader_data = k->class_loader_data();
Dictionary* dictionary = loader_data->dictionary();
assert(class_name == k->name(), "Must be the same");
Expand Down Expand Up @@ -470,7 +470,7 @@ InstanceKlass* SystemDictionary::resolve_super_or_fail(Symbol* class_name,
//
// The notify allows applications that did an untimed wait() on
// the classloader object lock to not hang.
static void double_lock_wait(SystemDictLocker *mu, JavaThread* thread, Handle lockObject) {
static void double_lock_wait(JavaThread* thread, SystemDictLocker *mu, Handle lockObject) {
assert_lock_strong(SystemDictionary_lock);

assert(lockObject() != NULL, "lockObject must be non-NULL");
Expand Down Expand Up @@ -520,7 +520,8 @@ InstanceKlass* SystemDictionary::handle_parallel_loading(JavaThread* current,
Symbol* name,
ClassLoaderData* loader_data,
Handle lockObject,
bool* throw_circularity_error) {
bool* throw_circularity_error,
SystemDictLocker* mu) {
PlaceholderEntry* oldprobe = placeholders()->get_entry(name_hash, name, loader_data);
if (oldprobe != NULL) {
// only need check_seen_thread once, not on each loop
Expand Down Expand Up @@ -549,11 +550,10 @@ InstanceKlass* SystemDictionary::handle_parallel_loading(JavaThread* current,
// which we will find below in the systemDictionary.
oldprobe = NULL; // Other thread could delete this placeholder entry

SystemDictLocker mu(JavaThread::current(), SystemDictionary_lock);
if (lockObject.is_null()) {
mu.wait();
mu->wait();
} else {
double_lock_wait(&mu, current, lockObject);
double_lock_wait(current, mu, lockObject);
}

// Check if classloading completed while we were waiting
Expand Down Expand Up @@ -689,7 +689,8 @@ InstanceKlass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
name,
loader_data,
lockObject,
&throw_circularity_error);
&throw_circularity_error,
&mu);
}

// Recheck if the class has been loaded for all class loader cases and
Expand Down Expand Up @@ -732,7 +733,7 @@ InstanceKlass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
// and initiating loaders
SystemDictLocker mu(THREAD, SystemDictionary_lock);
placeholders()->find_and_remove(name_hash, name, loader_data, PlaceholderTable::LOAD_INSTANCE, THREAD);
SystemDictionary_lock->notify_all(THREAD);
mu.notify_all();
}
}

Expand Down Expand Up @@ -1514,7 +1515,7 @@ InstanceKlass* SystemDictionary::find_or_define_helper(Symbol* class_name, Handl
if (is_parallelDefine(class_loader) && (probe->instance_klass() != NULL)) {
InstanceKlass* ik = probe->instance_klass();
placeholders()->find_and_remove(name_hash, name_h, loader_data, PlaceholderTable::DEFINE_CLASS, THREAD);
SystemDictionary_lock->notify_all(THREAD);
mu.notify_all();
#ifdef ASSERT
InstanceKlass* check = dictionary->find_class(name_hash, name_h);
assert(check != NULL, "definer missed recording success");
Expand All @@ -1538,7 +1539,7 @@ InstanceKlass* SystemDictionary::find_or_define_helper(Symbol* class_name, Handl
}
probe->set_definer(NULL);
placeholders()->find_and_remove(name_hash, name_h, loader_data, PlaceholderTable::DEFINE_CLASS, THREAD);
SystemDictionary_lock->notify_all(THREAD);
mu.notify_all();
}

return HAS_PENDING_EXCEPTION ? NULL : k;
Expand Down Expand Up @@ -1606,7 +1607,7 @@ bool SystemDictionary::do_unloading(GCTimer* gc_timer) {
MutexLocker ml2(is_concurrent ? Module_lock : NULL);
JFR_ONLY(Jfr::on_unloading_classes();)

SystemDictLocker ml1(JavaThread::current(), is_concurrent ? SystemDictionary_lock : NULL);
GCSystemDictLocker ml1(is_concurrent ? SystemDictionary_lock : NULL);
ClassLoaderDataGraph::clean_module_and_package_info();
constraints()->purge_loader_constraints();
resolution_errors()->purge_resolution_errors();
Expand Down Expand Up @@ -1777,15 +1778,15 @@ Klass* SystemDictionary::find_constrained_instance_or_array_klass(
if (t != T_OBJECT) {
klass = Universe::typeArrayKlassObj(t);
} else {
SystemDictLocker mu(JavaThread::current(), SystemDictionary_lock);
SystemDictLocker mu((JavaThread*)current, SystemDictionary_lock);
klass = constraints()->find_constrained_klass(ss.as_symbol(), class_loader);
}
// If element class already loaded, allocate array klass
if (klass != NULL) {
klass = klass->array_klass_or_null(ndims);
}
} else {
SystemDictLocker mu(JavaThread::current(), SystemDictionary_lock);
SystemDictLocker mu((JavaThread*)current, SystemDictionary_lock);
// Non-array classes are easy: simply check the constraint table.
klass = constraints()->find_constrained_klass(class_name, class_loader);
}
Expand Down Expand Up @@ -2488,8 +2489,3 @@ void SystemDictionaryDCmd::execute(DCmdSource source, TRAPS) {
_verbose.value());
VMThread::execute(&dumper);
}

void SystemDictionary::system_dict_lock_change(JavaThread* THREAD) {
assert(UseWispMonitor, "UseWispMonitor is off");
SystemDictionary_lock->set_obj_lock(oopFactory::new_intArray(0, THREAD), THREAD);
}
Loading

0 comments on commit 5adb2a4

Please sign in to comment.