hotspot/src/share/vm/prims/whitebox.cpp
changeset 27672 d24adedd3655
parent 27642 8c9eff693145
child 27675 a165e756e90d
equal deleted inserted replaced
27671:d1e2e443e43a 27672:d24adedd3655
    62 #include "services/memTracker.hpp"
    62 #include "services/memTracker.hpp"
    63 #include "utilities/nativeCallStack.hpp"
    63 #include "utilities/nativeCallStack.hpp"
    64 #endif // INCLUDE_NMT
    64 #endif // INCLUDE_NMT
    65 
    65 
    66 #include "compiler/compileBroker.hpp"
    66 #include "compiler/compileBroker.hpp"
       
    67 #include "jvmtifiles/jvmtiEnv.hpp"
    67 #include "runtime/compilationPolicy.hpp"
    68 #include "runtime/compilationPolicy.hpp"
    68 
    69 
    69 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
    70 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
    70 
    71 
    71 #define SIZE_T_MAX_VALUE ((size_t) -1)
    72 #define SIZE_T_MAX_VALUE ((size_t) -1)
   110   WBIsKlassAliveClosure closure(sym);
   111   WBIsKlassAliveClosure closure(sym);
   111   ClassLoaderDataGraph::classes_do(&closure);
   112   ClassLoaderDataGraph::classes_do(&closure);
   112 
   113 
   113   return closure.found();
   114   return closure.found();
   114 WB_END
   115 WB_END
       
   116 
       
   117 WB_ENTRY(void, WB_AddToBootstrapClassLoaderSearch(JNIEnv* env, jobject o, jstring segment)) {
       
   118 #if INCLUDE_JVMTI
       
   119   ThreadToNativeFromVM ttnfv(thread);   // can't be in VM when we call JNI
       
   120   const char* seg = env->GetStringUTFChars(segment, NULL);
       
   121   JvmtiEnv* jvmti_env = JvmtiEnv::create_a_jvmti(JVMTI_VERSION);
       
   122   jvmtiError err = jvmti_env->AddToBootstrapClassLoaderSearch(seg);
       
   123   assert(err == JVMTI_ERROR_NONE, "must not fail");
       
   124   env->ReleaseStringUTFChars(segment, seg);
       
   125 #endif
       
   126 }
       
   127 WB_END
       
   128 
       
   129 WB_ENTRY(void, WB_AddToSystemClassLoaderSearch(JNIEnv* env, jobject o, jstring segment)) {
       
   130 #if INCLUDE_JVMTI
       
   131   ThreadToNativeFromVM ttnfv(thread);   // can't be in VM when we call JNI
       
   132   const char* seg = env->GetStringUTFChars(segment, NULL);
       
   133   JvmtiEnv* jvmti_env = JvmtiEnv::create_a_jvmti(JVMTI_VERSION);
       
   134   jvmtiError err = jvmti_env->AddToSystemClassLoaderSearch(seg);
       
   135   assert(err == JVMTI_ERROR_NONE, "must not fail");
       
   136   env->ReleaseStringUTFChars(segment, seg);
       
   137 #endif
       
   138 }
       
   139 WB_END
       
   140 
   115 
   141 
   116 WB_ENTRY(jlong, WB_GetCompressedOopsMaxHeapSize(JNIEnv* env, jobject o)) {
   142 WB_ENTRY(jlong, WB_GetCompressedOopsMaxHeapSize(JNIEnv* env, jobject o)) {
   117   return (jlong)Arguments::max_heap_for_compressed_oops();
   143   return (jlong)Arguments::max_heap_for_compressed_oops();
   118 }
   144 }
   119 WB_END
   145 WB_END
  1100   {CC"isClassAlive0",      CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive      },
  1126   {CC"isClassAlive0",      CC"(Ljava/lang/String;)Z", (void*)&WB_IsClassAlive      },
  1101   {CC"parseCommandLine",
  1127   {CC"parseCommandLine",
  1102       CC"(Ljava/lang/String;[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;",
  1128       CC"(Ljava/lang/String;[Lsun/hotspot/parser/DiagnosticCommand;)[Ljava/lang/Object;",
  1103       (void*) &WB_ParseCommandLine
  1129       (void*) &WB_ParseCommandLine
  1104   },
  1130   },
       
  1131   {CC"addToBootstrapClassLoaderSearch", CC"(Ljava/lang/String;)V",
       
  1132                                                       (void*)&WB_AddToBootstrapClassLoaderSearch},
       
  1133   {CC"addToSystemClassLoaderSearch",    CC"(Ljava/lang/String;)V",
       
  1134                                                       (void*)&WB_AddToSystemClassLoaderSearch},
  1105   {CC"getCompressedOopsMaxHeapSize", CC"()J",
  1135   {CC"getCompressedOopsMaxHeapSize", CC"()J",
  1106       (void*)&WB_GetCompressedOopsMaxHeapSize},
  1136       (void*)&WB_GetCompressedOopsMaxHeapSize},
  1107   {CC"printHeapSizes",     CC"()V",                   (void*)&WB_PrintHeapSizes    },
  1137   {CC"printHeapSizes",     CC"()V",                   (void*)&WB_PrintHeapSizes    },
  1108   {CC"runMemoryUnitTests", CC"()V",                   (void*)&WB_RunMemoryUnitTests},
  1138   {CC"runMemoryUnitTests", CC"()V",                   (void*)&WB_RunMemoryUnitTests},
  1109   {CC"readFromNoaccessArea",CC"()V",                  (void*)&WB_ReadFromNoaccessArea},
  1139   {CC"readFromNoaccessArea",CC"()V",                  (void*)&WB_ReadFromNoaccessArea},