< prev index next >

src/share/vm/prims/whitebox.cpp

Print this page




1526   char* package_name = NULL;
1527   if (package != NULL) {
1528       package_name = java_lang_String::as_utf8_string(JNIHandles::resolve_non_null(package));
1529   }
1530   Modules::add_module_package(module, package_name, CHECK);
1531 WB_END
1532 
1533 WB_ENTRY(jlong, WB_IncMetaspaceCapacityUntilGC(JNIEnv* env, jobject wb, jlong inc))
1534   if (inc < 0) {
1535     THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
1536         err_msg("WB_IncMetaspaceCapacityUntilGC: inc is negative: " JLONG_FORMAT, inc));
1537   }
1538 
1539   jlong max_size_t = (jlong) ((size_t) -1);
1540   if (inc > max_size_t) {
1541     THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
1542         err_msg("WB_IncMetaspaceCapacityUntilGC: inc does not fit in size_t: " JLONG_FORMAT, inc));
1543   }
1544 
1545   size_t new_cap_until_GC = 0;
1546   size_t aligned_inc = align_size_down((size_t) inc, Metaspace::commit_alignment());
1547   bool success = MetaspaceGC::inc_capacity_until_GC(aligned_inc, &new_cap_until_GC);
1548   if (!success) {
1549     THROW_MSG_0(vmSymbols::java_lang_IllegalStateException(),
1550                 "WB_IncMetaspaceCapacityUntilGC: could not increase capacity until GC "
1551                 "due to contention with another thread");
1552   }
1553   return (jlong) new_cap_until_GC;
1554 WB_END
1555 
1556 WB_ENTRY(jlong, WB_MetaspaceCapacityUntilGC(JNIEnv* env, jobject wb))
1557   return (jlong) MetaspaceGC::capacity_until_GC();
1558 WB_END
1559 
1560 WB_ENTRY(jboolean, WB_MetaspaceShouldConcurrentCollect(JNIEnv* env, jobject wb))
1561   return MetaspaceGC::should_concurrent_collect();
1562 WB_END
1563 
1564 
1565 WB_ENTRY(void, WB_AssertMatchingSafepointCalls(JNIEnv* env, jobject o, jboolean mutexSafepointValue, jboolean attemptedNoSafepointValue))
1566   Monitor::SafepointCheckRequired sfpt_check_required = mutexSafepointValue ?




1526   char* package_name = NULL;
1527   if (package != NULL) {
1528       package_name = java_lang_String::as_utf8_string(JNIHandles::resolve_non_null(package));
1529   }
1530   Modules::add_module_package(module, package_name, CHECK);
1531 WB_END
1532 
1533 WB_ENTRY(jlong, WB_IncMetaspaceCapacityUntilGC(JNIEnv* env, jobject wb, jlong inc))
1534   if (inc < 0) {
1535     THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
1536         err_msg("WB_IncMetaspaceCapacityUntilGC: inc is negative: " JLONG_FORMAT, inc));
1537   }
1538 
1539   jlong max_size_t = (jlong) ((size_t) -1);
1540   if (inc > max_size_t) {
1541     THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(),
1542         err_msg("WB_IncMetaspaceCapacityUntilGC: inc does not fit in size_t: " JLONG_FORMAT, inc));
1543   }
1544 
1545   size_t new_cap_until_GC = 0;
1546   size_t aligned_inc = align_down((size_t) inc, Metaspace::commit_alignment());
1547   bool success = MetaspaceGC::inc_capacity_until_GC(aligned_inc, &new_cap_until_GC);
1548   if (!success) {
1549     THROW_MSG_0(vmSymbols::java_lang_IllegalStateException(),
1550                 "WB_IncMetaspaceCapacityUntilGC: could not increase capacity until GC "
1551                 "due to contention with another thread");
1552   }
1553   return (jlong) new_cap_until_GC;
1554 WB_END
1555 
1556 WB_ENTRY(jlong, WB_MetaspaceCapacityUntilGC(JNIEnv* env, jobject wb))
1557   return (jlong) MetaspaceGC::capacity_until_GC();
1558 WB_END
1559 
1560 WB_ENTRY(jboolean, WB_MetaspaceShouldConcurrentCollect(JNIEnv* env, jobject wb))
1561   return MetaspaceGC::should_concurrent_collect();
1562 WB_END
1563 
1564 
1565 WB_ENTRY(void, WB_AssertMatchingSafepointCalls(JNIEnv* env, jobject o, jboolean mutexSafepointValue, jboolean attemptedNoSafepointValue))
1566   Monitor::SafepointCheckRequired sfpt_check_required = mutexSafepointValue ?


< prev index next >