--- a/src/hotspot/share/prims/whitebox.cpp Wed Nov 13 13:43:06 2019 -0500
+++ b/src/hotspot/share/prims/whitebox.cpp Wed Nov 13 10:49:12 2019 -0800
@@ -619,6 +619,29 @@
THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_G1AuxiliaryMemoryUsage: G1 GC is not enabled");
WB_END
+WB_ENTRY(jint, WB_G1ActiveMemoryNodeCount(JNIEnv* env, jobject o))
+ if (UseG1GC) {
+ G1NUMA* numa = G1NUMA::numa();
+ return (jint)numa->num_active_nodes();
+ }
+ THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_G1ActiveMemoryNodeCount: G1 GC is not enabled");
+WB_END
+
+WB_ENTRY(jintArray, WB_G1MemoryNodeIds(JNIEnv* env, jobject o))
+ if (UseG1GC) {
+ G1NUMA* numa = G1NUMA::numa();
+ int num_node_ids = (int)numa->num_active_nodes();
+ const int* node_ids = numa->node_ids();
+
+ typeArrayOop result = oopFactory::new_intArray(num_node_ids, CHECK_NULL);
+ for (int i = 0; i < num_node_ids; i++) {
+ result->int_at_put(i, (jint)node_ids[i]);
+ }
+ return (jintArray) JNIHandles::make_local(env, result);
+ }
+ THROW_MSG_NULL(vmSymbols::java_lang_UnsupportedOperationException(), "WB_G1MemoryNodeIds: G1 GC is not enabled");
+WB_END
+
class OldRegionsLivenessClosure: public HeapRegionClosure {
private:
@@ -2195,6 +2218,8 @@
{CC"g1StartConcMarkCycle", CC"()Z", (void*)&WB_G1StartMarkCycle },
{CC"g1AuxiliaryMemoryUsage", CC"()Ljava/lang/management/MemoryUsage;",
(void*)&WB_G1AuxiliaryMemoryUsage },
+ {CC"g1ActiveMemoryNodeCount", CC"()I", (void*)&WB_G1ActiveMemoryNodeCount },
+ {CC"g1MemoryNodeIds", CC"()[I", (void*)&WB_G1MemoryNodeIds },
{CC"g1GetMixedGCInfo", CC"(I)[J", (void*)&WB_G1GetMixedGCInfo },
#endif // INCLUDE_G1GC
#if INCLUDE_G1GC || INCLUDE_PARALLELGC