Skip to content
Permalink
Browse files
8241010: Unnecessarily resolving some well-known classes
Reviewed-by: coleenp
  • Loading branch information
cl4es committed Mar 13, 2020
1 parent 3762967 commit 2b465b1ebfec870de67bb81b904c76f658fee98b
@@ -226,7 +226,6 @@ class GCTimer;
class SystemDictionary : AllStatic {
friend class BootstrapInfo;
friend class VMStructs;
friend class SystemDictionaryHandles;

public:
enum WKID {
@@ -863,7 +863,7 @@ bool universe_post_init() {
Universe::_the_empty_class_klass_array = oopFactory::new_objArray(SystemDictionary::Class_klass(), 0, CHECK_false);

// Setup preallocated OutOfMemoryError errors
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_OutOfMemoryError(), true, CHECK_false);
Klass* k = SystemDictionary::OutOfMemoryError_klass();
InstanceKlass* ik = InstanceKlass::cast(k);
Universe::_out_of_memory_error_java_heap = ik->allocate_instance(CHECK_false);
Universe::_out_of_memory_error_metaspace = ik->allocate_instance(CHECK_false);
@@ -889,8 +889,7 @@ bool universe_post_init() {
k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_ArithmeticException(), true, CHECK_false);
Universe::_arithmetic_exception_instance = InstanceKlass::cast(k)->allocate_instance(CHECK_false);
// Virtual Machine Error for when we get into a situation we can't resolve
k = SystemDictionary::resolve_or_fail(
vmSymbols::java_lang_VirtualMachineError(), true, CHECK_false);
k = SystemDictionary::VirtualMachineError_klass();
bool linked = InstanceKlass::cast(k)->link_class_or_fail(CHECK_false);
if (!linked) {
tty->print_cr("Unable to link/verify VirtualMachineError class");
@@ -187,7 +187,7 @@ void JavaFrameStream::fill_frame(int index, objArrayHandle frames_array,
// T_OBJECT, or T_CONFLICT.
oop LiveFrameStream::create_primitive_slot_instance(StackValueCollection* values,
int i, BasicType type, TRAPS) {
Klass* k = SystemDictionary::resolve_or_null(vmSymbols::java_lang_LiveStackFrameInfo(), CHECK_NULL);
Klass* k = SystemDictionary::LiveStackFrameInfo_klass();
InstanceKlass* ik = InstanceKlass::cast(k);

JavaValue result(T_OBJECT);
@@ -1241,7 +1241,7 @@ void JavaThread::allocate_threadObj(Handle thread_group, const char* thread_name
return;
}

Klass* group = SystemDictionary::ThreadGroup_klass();
Klass* group = SystemDictionary::ThreadGroup_klass();
Handle threadObj(THREAD, this->threadObj());

JavaCalls::call_special(&result,
@@ -3613,7 +3613,7 @@ void Threads::possibly_parallel_threads_do(bool is_par, ThreadClosure* tc) {
// fields in, out, and err. Set up java signal handlers, OS-specific
// system settings, and thread group of the main thread.
static void call_initPhase1(TRAPS) {
Klass* klass = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
Klass* klass = SystemDictionary::System_klass();
JavaValue result(T_VOID);
JavaCalls::call_static(&result, klass, vmSymbols::initPhase1_name(),
vmSymbols::void_method_signature(), CHECK);
@@ -3633,7 +3633,7 @@ static void call_initPhase1(TRAPS) {
static void call_initPhase2(TRAPS) {
TraceTime timer("Initialize module system", TRACETIME_LOG(Info, startuptime));

Klass* klass = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
Klass* klass = SystemDictionary::System_klass();

JavaValue result(T_INT);
JavaCallArguments args;
@@ -3655,7 +3655,7 @@ static void call_initPhase2(TRAPS) {
// and system class loader may be a custom class loaded from -Xbootclasspath/a,
// other modules or the application's classpath.
static void call_initPhase3(TRAPS) {
Klass* klass = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK);
Klass* klass = SystemDictionary::System_klass();
JavaValue result(T_VOID);
JavaCalls::call_static(&result, klass, vmSymbols::initPhase3_name(),
vmSymbols::void_method_signature(), CHECK);
@@ -440,8 +440,7 @@ void SystemGCDCmd::execute(DCmdSource source, TRAPS) {
}

void RunFinalizationDCmd::execute(DCmdSource source, TRAPS) {
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(),
true, CHECK);
Klass* k = SystemDictionary::System_klass();
JavaValue result(T_VOID);
JavaCalls::call_static(&result, k,
vmSymbols::run_finalization_name(),

0 comments on commit 2b465b1

Please sign in to comment.