107 args.push_oop(mgr_name); // Argument 1
108
109 Symbol* method_name = NULL;
110 Symbol* signature = NULL;
111 if (is_gc_memory_manager()) {
112 Klass* extKlass = Management::com_sun_management_internal_GarbageCollectorExtImpl_klass(CHECK_0);
113 // com.sun.management.GarbageCollectorMXBean is in jdk.management module which may not be present.
114 if (extKlass != NULL) {
115 k = extKlass;
116 }
117
118 method_name = vmSymbols::createGarbageCollector_name();
119
120 signature = vmSymbols::createGarbageCollector_signature();
121 args.push_oop(Handle()); // Argument 2 (for future extension)
122 } else {
123 method_name = vmSymbols::createMemoryManager_name();
124 signature = vmSymbols::createMemoryManager_signature();
125 }
126
127 instanceKlassHandle ik(THREAD, k);
128
129 JavaCalls::call_static(&result,
130 ik,
131 method_name,
132 signature,
133 &args,
134 CHECK_0);
135
136 instanceOop m = (instanceOop) result.get_jobject();
137 instanceHandle mgr(THREAD, m);
138
139 {
140 // Get lock before setting _memory_mgr_obj
141 // since another thread may have created the instance
142 MutexLocker ml(Management_lock);
143
144 // Check if another thread has created the management object. We reload
145 // _memory_mgr_obj here because some other thread may have initialized
146 // it while we were executing the code before the lock.
147 //
|
107 args.push_oop(mgr_name); // Argument 1
108
109 Symbol* method_name = NULL;
110 Symbol* signature = NULL;
111 if (is_gc_memory_manager()) {
112 Klass* extKlass = Management::com_sun_management_internal_GarbageCollectorExtImpl_klass(CHECK_0);
113 // com.sun.management.GarbageCollectorMXBean is in jdk.management module which may not be present.
114 if (extKlass != NULL) {
115 k = extKlass;
116 }
117
118 method_name = vmSymbols::createGarbageCollector_name();
119
120 signature = vmSymbols::createGarbageCollector_signature();
121 args.push_oop(Handle()); // Argument 2 (for future extension)
122 } else {
123 method_name = vmSymbols::createMemoryManager_name();
124 signature = vmSymbols::createMemoryManager_signature();
125 }
126
127 InstanceKlass* ik = InstanceKlass::cast(k);
128
129 JavaCalls::call_static(&result,
130 ik,
131 method_name,
132 signature,
133 &args,
134 CHECK_0);
135
136 instanceOop m = (instanceOop) result.get_jobject();
137 instanceHandle mgr(THREAD, m);
138
139 {
140 // Get lock before setting _memory_mgr_obj
141 // since another thread may have created the instance
142 MutexLocker ml(Management_lock);
143
144 // Check if another thread has created the management object. We reload
145 // _memory_mgr_obj here because some other thread may have initialized
146 // it while we were executing the code before the lock.
147 //
|