< prev index next >

src/hotspot/share/services/management.cpp

Print this page

        

@@ -511,11 +511,11 @@
       instanceOop p = pool->get_memory_pool_instance(CHECK_NULL);
       instanceHandle ph(THREAD, p);
       poolArray->obj_at_put(i, ph());
     }
   }
-  return (jobjectArray) JNIHandles::make_local(env, poolArray());
+  return (jobjectArray) JNIHandles::make_local(THREAD, poolArray());
 JVM_END
 
 // Returns an array of java/lang/management/MemoryManagerMXBean object
 // one for each memory manager if obj == null; otherwise returns
 // an array of memory managers for a given memory pool if

@@ -555,11 +555,11 @@
       instanceOop p = mgr->get_memory_manager_instance(CHECK_NULL);
       instanceHandle ph(THREAD, p);
       mgrArray->obj_at_put(i, ph());
     }
   }
-  return (jobjectArray) JNIHandles::make_local(env, mgrArray());
+  return (jobjectArray) JNIHandles::make_local(THREAD, mgrArray());
 JVM_END
 
 
 // Returns a java/lang/management/MemoryUsage object containing the memory usage
 // of a given memory pool.

@@ -568,11 +568,11 @@
 
   MemoryPool* pool = get_memory_pool_from_jobject(obj, CHECK_NULL);
   if (pool != NULL) {
     MemoryUsage usage = pool->get_memory_usage();
     Handle h = MemoryService::create_MemoryUsage_obj(usage, CHECK_NULL);
-    return JNIHandles::make_local(env, h());
+    return JNIHandles::make_local(THREAD, h());
   } else {
     return NULL;
   }
 JVM_END
 

@@ -583,11 +583,11 @@
 
   MemoryPool* pool = get_memory_pool_from_jobject(obj, CHECK_NULL);
   if (pool != NULL) {
     MemoryUsage usage = pool->get_peak_memory_usage();
     Handle h = MemoryService::create_MemoryUsage_obj(usage, CHECK_NULL);
-    return JNIHandles::make_local(env, h());
+    return JNIHandles::make_local(THREAD, h());
   } else {
     return NULL;
   }
 JVM_END
 

@@ -598,11 +598,11 @@
 
   MemoryPool* pool = get_memory_pool_from_jobject(obj, CHECK_NULL);
   if (pool != NULL && pool->is_collected_pool()) {
     MemoryUsage usage = pool->get_last_collection_usage();
     Handle h = MemoryService::create_MemoryUsage_obj(usage, CHECK_NULL);
-    return JNIHandles::make_local(env, h());
+    return JNIHandles::make_local(THREAD, h());
   } else {
     return NULL;
   }
 JVM_END
 

@@ -762,11 +762,11 @@
 
     usage = MemoryUsage(total_init, total_used, total_committed, total_max);
   }
 
   Handle obj = MemoryService::create_MemoryUsage_obj(usage, CHECK_NULL);
-  return JNIHandles::make_local(env, obj());
+  return JNIHandles::make_local(THREAD, obj());
 JVM_END
 
 // Returns the boolean value of a given attribute.
 JVM_LEAF(jboolean, jmm_GetBoolAttribute(JNIEnv *env, jmmBoolAttribute att))
   switch (att) {

@@ -1277,11 +1277,11 @@
                                                                    synchronizers_array,
                                                                    CHECK_NULL);
     result_h->obj_at_put(index, info_obj);
   }
 
-  return (jobjectArray) JNIHandles::make_local(env, result_h());
+  return (jobjectArray) JNIHandles::make_local(THREAD, result_h());
 JVM_END
 
 // Reset statistic.  Return true if the requested statistic is reset.
 // Otherwise, return false.
 //

@@ -1423,27 +1423,27 @@
     // Return array of right length
     objArrayOop res = oopFactory::new_objArray(SystemDictionary::String_klass(), num_entries, CHECK_NULL);
     for(int i = 0; i < num_entries; i++) {
       res->obj_at_put(i, flags_ah->obj_at(i));
     }
-    return (jobjectArray)JNIHandles::make_local(env, res);
+    return (jobjectArray)JNIHandles::make_local(THREAD, res);
   }
 
-  return (jobjectArray)JNIHandles::make_local(env, flags_ah());
+  return (jobjectArray)JNIHandles::make_local(THREAD, flags_ah());
 JVM_END
 
 // Utility function used by jmm_GetVMGlobals.  Returns false if flag type
 // can't be determined, true otherwise.  If false is returned, then *global
 // will be incomplete and invalid.
-bool add_global_entry(JNIEnv* env, Handle name, jmmVMGlobal *global, JVMFlag *flag, TRAPS) {
+bool add_global_entry(Handle name, jmmVMGlobal *global, JVMFlag *flag, TRAPS) {
   Handle flag_name;
   if (name() == NULL) {
     flag_name = java_lang_String::create_from_str(flag->_name, CHECK_false);
   } else {
     flag_name = name;
   }
-  global->name = (jstring)JNIHandles::make_local(env, flag_name());
+  global->name = (jstring)JNIHandles::make_local(THREAD, flag_name());
 
   if (flag->is_bool()) {
     global->value.z = flag->get_bool() ? JNI_TRUE : JNI_FALSE;
     global->type = JMM_VMGLOBAL_TYPE_JBOOLEAN;
   } else if (flag->is_int()) {

@@ -1467,11 +1467,11 @@
   } else if (flag->is_size_t()) {
     global->value.j = (jlong)flag->get_size_t();
     global->type = JMM_VMGLOBAL_TYPE_JLONG;
   } else if (flag->is_ccstr()) {
     Handle str = java_lang_String::create_from_str(flag->get_ccstr(), CHECK_false);
-    global->value.l = (jobject)JNIHandles::make_local(env, str());
+    global->value.l = (jobject)JNIHandles::make_local(THREAD, str());
     global->type = JMM_VMGLOBAL_TYPE_JSTRING;
   } else {
     global->type = JMM_VMGLOBAL_TYPE_UNKNOWN;
     return false;
   }

@@ -1546,11 +1546,11 @@
 
       Handle sh(THREAD, s);
       char* str = java_lang_String::as_utf8_string(s);
       JVMFlag* flag = JVMFlag::find_flag(str);
       if (flag != NULL &&
-          add_global_entry(env, sh, &globals[i], flag, THREAD)) {
+          add_global_entry(sh, &globals[i], flag, THREAD)) {
         num_entries++;
       } else {
         globals[i].name = NULL;
       }
     }

@@ -1568,11 +1568,11 @@
       if (flag->is_constant_in_binary()) {
         continue;
       }
       // Exclude the locked (diagnostic, experimental) flags
       if ((flag->is_unlocked() || flag->is_unlocker()) &&
-          add_global_entry(env, null_h, &globals[num_entries], flag, THREAD)) {
+          add_global_entry(null_h, &globals[num_entries], flag, THREAD)) {
         num_entries++;
       }
     }
     return num_entries;
   }

@@ -1753,19 +1753,19 @@
 // Input parameter:
 //    object_monitors_only - if true, only check object monitors
 //
 JVM_ENTRY(jobjectArray, jmm_FindDeadlockedThreads(JNIEnv *env, jboolean object_monitors_only))
   Handle result = find_deadlocks(object_monitors_only != 0, CHECK_NULL);
-  return (jobjectArray) JNIHandles::make_local(env, result());
+  return (jobjectArray) JNIHandles::make_local(THREAD, result());
 JVM_END
 
 // Finds cycles of threads that are deadlocked on monitor locks
 // Returns an array of Thread objects which are in deadlock, if any.
 // Otherwise, returns NULL.
 JVM_ENTRY(jobjectArray, jmm_FindMonitorDeadlockedThreads(JNIEnv *env))
   Handle result = find_deadlocks(true, CHECK_NULL);
-  return (jobjectArray) JNIHandles::make_local(env, result());
+  return (jobjectArray) JNIHandles::make_local(THREAD, result());
 JVM_END
 
 // Gets the information about GC extension attributes including
 // the name of the attribute, its type, and a short description.
 //

@@ -1943,11 +1943,11 @@
   objArrayHandle cmd_array(THREAD, cmd_array_oop);
   for (int i = 0; i < dcmd_list->length(); i++) {
     oop cmd_name = java_lang_String::create_oop_from_str(dcmd_list->at(i), CHECK_NULL);
     cmd_array->obj_at_put(i, cmd_name);
   }
-  return (jobjectArray) JNIHandles::make_local(env, cmd_array());
+  return (jobjectArray) JNIHandles::make_local(THREAD, cmd_array());
 JVM_END
 
 JVM_ENTRY(void, jmm_GetDiagnosticCommandInfo(JNIEnv *env, jobjectArray cmds,
           dcmdInfo* infoArray))
   if (cmds == NULL || infoArray == NULL) {

@@ -2052,11 +2052,11 @@
                    "Command line content cannot be null.");
   }
   bufferedStream output;
   DCmd::parse_and_execute(DCmd_Source_MBean, &output, cmdline, ' ', CHECK_NULL);
   oop result = java_lang_String::create_oop_from_str(output.as_string(), CHECK_NULL);
-  return (jstring) JNIHandles::make_local(env, result);
+  return (jstring) JNIHandles::make_local(THREAD, result);
 JVM_END
 
 JVM_ENTRY(void, jmm_SetDiagnosticFrameworkNotificationEnabled(JNIEnv *env, jboolean enabled))
   DCmdFactory::set_jmx_notification_enabled(enabled?true:false);
 JVM_END
< prev index next >