353 WB_END |
353 WB_END |
354 |
354 |
355 WB_ENTRY(jlong, WB_GetHeapAlignment(JNIEnv* env, jobject o)) |
355 WB_ENTRY(jlong, WB_GetHeapAlignment(JNIEnv* env, jobject o)) |
356 size_t alignment = Universe::heap()->collector_policy()->heap_alignment(); |
356 size_t alignment = Universe::heap()->collector_policy()->heap_alignment(); |
357 return (jlong)alignment; |
357 return (jlong)alignment; |
|
358 WB_END |
|
359 |
|
360 WB_ENTRY(jboolean, WB_SupportsConcurrentGCPhaseControl(JNIEnv* env, jobject o)) |
|
361 return Universe::heap()->supports_concurrent_phase_control(); |
|
362 WB_END |
|
363 |
|
364 WB_ENTRY(jobjectArray, WB_GetConcurrentGCPhases(JNIEnv* env, jobject o)) |
|
365 const char* const* phases = Universe::heap()->concurrent_phases(); |
|
366 jint nphases = 0; |
|
367 for ( ; phases[nphases] != NULL; ++nphases) ; |
|
368 |
|
369 ResourceMark rm(thread); |
|
370 ThreadToNativeFromVM ttn(thread); |
|
371 jclass clazz = env->FindClass(vmSymbols::java_lang_Object()->as_C_string()); |
|
372 CHECK_JNI_EXCEPTION_(env, NULL); |
|
373 |
|
374 jobjectArray result = env->NewObjectArray(nphases, clazz, NULL); |
|
375 CHECK_JNI_EXCEPTION_(env, NULL); |
|
376 |
|
377 // If push fails, return with pending exception. |
|
378 if (env->PushLocalFrame(nphases) < 0) return NULL; |
|
379 for (jint i = 0; i < nphases; ++i) { |
|
380 jstring phase = env->NewStringUTF(phases[i]); |
|
381 CHECK_JNI_EXCEPTION_(env, NULL); |
|
382 env->SetObjectArrayElement(result, i, phase); |
|
383 CHECK_JNI_EXCEPTION_(env, NULL); |
|
384 } |
|
385 env->PopLocalFrame(NULL); |
|
386 |
|
387 return result; |
|
388 WB_END |
|
389 |
|
390 WB_ENTRY(jboolean, WB_RequestConcurrentGCPhase(JNIEnv* env, jobject o, jstring name)) |
|
391 Handle h_name(THREAD, JNIHandles::resolve(name)); |
|
392 ResourceMark rm; |
|
393 const char* c_name = java_lang_String::as_utf8_string(h_name()); |
|
394 return Universe::heap()->request_concurrent_phase(c_name); |
358 WB_END |
395 WB_END |
359 |
396 |
360 #if INCLUDE_ALL_GCS |
397 #if INCLUDE_ALL_GCS |
361 WB_ENTRY(jboolean, WB_G1IsHumongous(JNIEnv* env, jobject o, jobject obj)) |
398 WB_ENTRY(jboolean, WB_G1IsHumongous(JNIEnv* env, jobject o, jobject obj)) |
362 if (UseG1GC) { |
399 if (UseG1GC) { |
1967 (void*)&WB_AddCompilerDirective }, |
2004 (void*)&WB_AddCompilerDirective }, |
1968 {CC"removeCompilerDirective", CC"(I)V", (void*)&WB_RemoveCompilerDirective }, |
2005 {CC"removeCompilerDirective", CC"(I)V", (void*)&WB_RemoveCompilerDirective }, |
1969 {CC"currentGC", CC"()I", (void*)&WB_CurrentGC}, |
2006 {CC"currentGC", CC"()I", (void*)&WB_CurrentGC}, |
1970 {CC"allSupportedGC", CC"()I", (void*)&WB_AllSupportedGC}, |
2007 {CC"allSupportedGC", CC"()I", (void*)&WB_AllSupportedGC}, |
1971 {CC"gcSelectedByErgo", CC"()Z", (void*)&WB_GCSelectedByErgo}, |
2008 {CC"gcSelectedByErgo", CC"()Z", (void*)&WB_GCSelectedByErgo}, |
|
2009 {CC"supportsConcurrentGCPhaseControl", CC"()Z", (void*)&WB_SupportsConcurrentGCPhaseControl}, |
|
2010 {CC"getConcurrentGCPhases", CC"()[Ljava/lang/String;", |
|
2011 (void*)&WB_GetConcurrentGCPhases}, |
|
2012 {CC"requestConcurrentGCPhase0", CC"(Ljava/lang/String;)Z", |
|
2013 (void*)&WB_RequestConcurrentGCPhase}, |
1972 }; |
2014 }; |
1973 |
2015 |
1974 #undef CC |
2016 #undef CC |
1975 |
2017 |
1976 JVM_ENTRY(void, JVM_RegisterWhiteBoxMethods(JNIEnv* env, jclass wbclass)) |
2018 JVM_ENTRY(void, JVM_RegisterWhiteBoxMethods(JNIEnv* env, jclass wbclass)) |