< prev index next >

src/hotspot/share/prims/whitebox.cpp

Print this page




2075 #endif
2076   return ret;
2077 WB_END
2078 
2079 WB_ENTRY(jboolean, WB_IsContainerized(JNIEnv* env, jobject o))
2080   LINUX_ONLY(return OSContainer::is_containerized();)
2081   return false;
2082 WB_END
2083 
2084 WB_ENTRY(void, WB_PrintOsInfo(JNIEnv* env, jobject o))
2085   os::print_os_info(tty);
2086 WB_END
2087 
2088 // Elf decoder
2089 WB_ENTRY(void, WB_DisableElfSectionCache(JNIEnv* env))
2090 #if !defined(_WINDOWS) && !defined(__APPLE__) && !defined(_AIX)
2091   ElfFile::_do_not_cache_elf_section = true;
2092 #endif
2093 WB_END
2094 
2095 WB_ENTRY(jlong, WB_ResolvedMethodItemsCount(JNIEnv* env, jobject o))
2096   return (jlong) ResolvedMethodTable::items_count();
2097 WB_END
2098 
2099 WB_ENTRY(jint, WB_ProtectionDomainRemovedCount(JNIEnv* env, jobject o))
2100   return (jint) SystemDictionary::pd_cache_table()->removed_entries_count();
2101 WB_END
2102 
2103 WB_ENTRY(jint, WB_AotLibrariesCount(JNIEnv* env, jobject o))
2104   jint result = 0;
2105 #if INCLUDE_AOT
2106   result = (jint) AOTLoader::heaps_count();
2107 #endif
2108   return result;
2109 WB_END
2110 
2111 #define CC (char*)
2112 
2113 static JNINativeMethod methods[] = {
2114   {CC"getObjectAddress0",                CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress  },
2115   {CC"getObjectSize0",                   CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize     },
2116   {CC"isObjectInOldGen0",                CC"(Ljava/lang/Object;)Z", (void*)&WB_isObjectInOldGen  },


2320   {CC"isCDSIncludedInVmBuild",            CC"()Z",    (void*)&WB_IsCDSIncludedInVmBuild },
2321   {CC"isJFRIncludedInVmBuild",            CC"()Z",    (void*)&WB_IsJFRIncludedInVmBuild },
2322   {CC"isJavaHeapArchiveSupported",      CC"()Z",      (void*)&WB_IsJavaHeapArchiveSupported },
2323 
2324   {CC"clearInlineCaches0",  CC"(Z)V",                 (void*)&WB_ClearInlineCaches },
2325   {CC"handshakeWalkStack", CC"(Ljava/lang/Thread;Z)I", (void*)&WB_HandshakeWalkStack },
2326   {CC"addCompilerDirective",    CC"(Ljava/lang/String;)I",
2327                                                       (void*)&WB_AddCompilerDirective },
2328   {CC"removeCompilerDirective",   CC"(I)V",           (void*)&WB_RemoveCompilerDirective },
2329   {CC"isGCSupported",             CC"(I)Z",           (void*)&WB_IsGCSupported},
2330   {CC"isGCSelected",              CC"(I)Z",           (void*)&WB_IsGCSelected},
2331   {CC"isGCSelectedErgonomically", CC"()Z",            (void*)&WB_IsGCSelectedErgonomically},
2332   {CC"supportsConcurrentGCPhaseControl", CC"()Z",     (void*)&WB_SupportsConcurrentGCPhaseControl},
2333   {CC"requestConcurrentGCPhase0", CC"(Ljava/lang/String;)Z",
2334                                                       (void*)&WB_RequestConcurrentGCPhase},
2335   {CC"checkLibSpecifiesNoexecstack", CC"(Ljava/lang/String;)Z",
2336                                                       (void*)&WB_CheckLibSpecifiesNoexecstack},
2337   {CC"isContainerized",           CC"()Z",            (void*)&WB_IsContainerized },
2338   {CC"printOsInfo",               CC"()V",            (void*)&WB_PrintOsInfo },
2339   {CC"disableElfSectionCache",    CC"()V",            (void*)&WB_DisableElfSectionCache },
2340   {CC"resolvedMethodItemsCount",  CC"()J",            (void*)&WB_ResolvedMethodItemsCount },
2341   {CC"protectionDomainRemovedCount",   CC"()I",       (void*)&WB_ProtectionDomainRemovedCount },
2342   {CC"aotLibrariesCount", CC"()I",                    (void*)&WB_AotLibrariesCount },
2343 };
2344 
2345 
2346 #undef CC
2347 
2348 JVM_ENTRY(void, JVM_RegisterWhiteBoxMethods(JNIEnv* env, jclass wbclass))
2349   {
2350     if (WhiteBoxAPI) {
2351       // Make sure that wbclass is loaded by the null classloader
2352       InstanceKlass* ik = InstanceKlass::cast(JNIHandles::resolve(wbclass)->klass());
2353       Handle loader(THREAD, ik->class_loader());
2354       if (loader.is_null()) {
2355         WhiteBox::register_methods(env, wbclass, thread, methods, sizeof(methods) / sizeof(methods[0]));
2356         WhiteBox::set_used();
2357       }
2358     }
2359   }
2360 JVM_END


2075 #endif
2076   return ret;
2077 WB_END
2078 
2079 WB_ENTRY(jboolean, WB_IsContainerized(JNIEnv* env, jobject o))
2080   LINUX_ONLY(return OSContainer::is_containerized();)
2081   return false;
2082 WB_END
2083 
2084 WB_ENTRY(void, WB_PrintOsInfo(JNIEnv* env, jobject o))
2085   os::print_os_info(tty);
2086 WB_END
2087 
2088 // Elf decoder
2089 WB_ENTRY(void, WB_DisableElfSectionCache(JNIEnv* env))
2090 #if !defined(_WINDOWS) && !defined(__APPLE__) && !defined(_AIX)
2091   ElfFile::_do_not_cache_elf_section = true;
2092 #endif
2093 WB_END
2094 
2095 WB_ENTRY(jint, WB_ResolvedMethodRemovedCount(JNIEnv* env, jobject o))
2096   return (jint) ResolvedMethodTable::removed_entries_count();
2097 WB_END
2098 
2099 WB_ENTRY(jint, WB_ProtectionDomainRemovedCount(JNIEnv* env, jobject o))
2100   return (jint) SystemDictionary::pd_cache_table()->removed_entries_count();
2101 WB_END
2102 
2103 WB_ENTRY(jint, WB_AotLibrariesCount(JNIEnv* env, jobject o))
2104   jint result = 0;
2105 #if INCLUDE_AOT
2106   result = (jint) AOTLoader::heaps_count();
2107 #endif
2108   return result;
2109 WB_END
2110 
2111 #define CC (char*)
2112 
2113 static JNINativeMethod methods[] = {
2114   {CC"getObjectAddress0",                CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress  },
2115   {CC"getObjectSize0",                   CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize     },
2116   {CC"isObjectInOldGen0",                CC"(Ljava/lang/Object;)Z", (void*)&WB_isObjectInOldGen  },


2320   {CC"isCDSIncludedInVmBuild",            CC"()Z",    (void*)&WB_IsCDSIncludedInVmBuild },
2321   {CC"isJFRIncludedInVmBuild",            CC"()Z",    (void*)&WB_IsJFRIncludedInVmBuild },
2322   {CC"isJavaHeapArchiveSupported",      CC"()Z",      (void*)&WB_IsJavaHeapArchiveSupported },
2323 
2324   {CC"clearInlineCaches0",  CC"(Z)V",                 (void*)&WB_ClearInlineCaches },
2325   {CC"handshakeWalkStack", CC"(Ljava/lang/Thread;Z)I", (void*)&WB_HandshakeWalkStack },
2326   {CC"addCompilerDirective",    CC"(Ljava/lang/String;)I",
2327                                                       (void*)&WB_AddCompilerDirective },
2328   {CC"removeCompilerDirective",   CC"(I)V",           (void*)&WB_RemoveCompilerDirective },
2329   {CC"isGCSupported",             CC"(I)Z",           (void*)&WB_IsGCSupported},
2330   {CC"isGCSelected",              CC"(I)Z",           (void*)&WB_IsGCSelected},
2331   {CC"isGCSelectedErgonomically", CC"()Z",            (void*)&WB_IsGCSelectedErgonomically},
2332   {CC"supportsConcurrentGCPhaseControl", CC"()Z",     (void*)&WB_SupportsConcurrentGCPhaseControl},
2333   {CC"requestConcurrentGCPhase0", CC"(Ljava/lang/String;)Z",
2334                                                       (void*)&WB_RequestConcurrentGCPhase},
2335   {CC"checkLibSpecifiesNoexecstack", CC"(Ljava/lang/String;)Z",
2336                                                       (void*)&WB_CheckLibSpecifiesNoexecstack},
2337   {CC"isContainerized",           CC"()Z",            (void*)&WB_IsContainerized },
2338   {CC"printOsInfo",               CC"()V",            (void*)&WB_PrintOsInfo },
2339   {CC"disableElfSectionCache",    CC"()V",            (void*)&WB_DisableElfSectionCache },
2340   {CC"resolvedMethodRemovedCount",     CC"()I",       (void*)&WB_ResolvedMethodRemovedCount },
2341   {CC"protectionDomainRemovedCount",   CC"()I",       (void*)&WB_ProtectionDomainRemovedCount },
2342   {CC"aotLibrariesCount", CC"()I",                    (void*)&WB_AotLibrariesCount },
2343 };
2344 
2345 
2346 #undef CC
2347 
2348 JVM_ENTRY(void, JVM_RegisterWhiteBoxMethods(JNIEnv* env, jclass wbclass))
2349   {
2350     if (WhiteBoxAPI) {
2351       // Make sure that wbclass is loaded by the null classloader
2352       InstanceKlass* ik = InstanceKlass::cast(JNIHandles::resolve(wbclass)->klass());
2353       Handle loader(THREAD, ik->class_loader());
2354       if (loader.is_null()) {
2355         WhiteBox::register_methods(env, wbclass, thread, methods, sizeof(methods) / sizeof(methods[0]));
2356         WhiteBox::set_used();
2357       }
2358     }
2359   }
2360 JVM_END
< prev index next >