< prev index next >

src/hotspot/share/prims/whitebox.cpp

Print this page
rev 53924 : imported patch 8219747-remove-g1-prefix
rev 53925 : imported patch 8219747-shade-review
rev 53927 : [mq]: 8219856-spell-out-hetero


 466     }
 467     return false;
 468   }
 469   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_G1StartMarkCycle: G1 GC is not enabled");
 470 WB_END
 471 
 472 WB_ENTRY(jint, WB_G1RegionSize(JNIEnv* env, jobject o))
 473   if (UseG1GC) {
 474     return (jint)HeapRegion::GrainBytes;
 475   }
 476   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_G1RegionSize: G1 GC is not enabled");
 477 WB_END
 478 
 479 #endif // INCLUDE_G1GC
 480 
 481 #if INCLUDE_G1GC || INCLUDE_PARALLELGC
 482 WB_ENTRY(jlong, WB_DramReservedStart(JNIEnv* env, jobject o))
 483 #if INCLUDE_G1GC
 484   if (UseG1GC) {
 485     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 486     if (g1h->is_hetero_heap()) {
 487       uint start_region = HeterogeneousHeapRegionManager::manager()->start_index_of_dram();
 488       return (jlong)(g1h->base() + start_region * HeapRegion::GrainBytes);
 489     } else {
 490       return (jlong)g1h->base();
 491     }
 492   }
 493 #endif // INCLUDE_G1GC
 494 #if INCLUDE_PARALLELGC
 495   if (UseParallelGC) {
 496     ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
 497     if (AllocateOldGenAt != NULL) {
 498       MemRegion reserved = ps_heap->young_gen()->reserved();
 499       return (jlong)reserved.start();
 500     } else {
 501       return (jlong)ps_heap->base();
 502     }
 503   }
 504 #endif // INCLUDE_PARALLELGC
 505   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_DramReservedStart: enabled only for G1 and Parallel GC");
 506 WB_END
 507 
 508 WB_ENTRY(jlong, WB_DramReservedEnd(JNIEnv* env, jobject o))
 509 #if INCLUDE_G1GC
 510   if (UseG1GC) {
 511     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 512     if (g1h->is_hetero_heap()) {
 513       uint end_region = HeterogeneousHeapRegionManager::manager()->end_index_of_dram();
 514       return (jlong)(g1h->base() + (end_region + 1) * HeapRegion::GrainBytes - 1);
 515     } else {
 516       return (jlong)g1h->base() + g1h->collector_policy()->max_heap_byte_size();
 517     }
 518   }
 519 #endif // INCLUDE_G1GC
 520 #if INCLUDE_PARALLELGC
 521   if (UseParallelGC) {
 522     ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
 523     if (AllocateOldGenAt != NULL) {
 524       MemRegion reserved = ps_heap->young_gen()->reserved();
 525       return (jlong)reserved.end();
 526     } else {
 527       return (jlong)ps_heap->reserved_region().end();
 528     }
 529   }
 530 #endif // INCLUDE_PARALLELGC
 531   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_DramReservedEnd: enabled only for G1 and Parallel GC");
 532 WB_END
 533 
 534 WB_ENTRY(jlong, WB_NvdimmReservedStart(JNIEnv* env, jobject o))
 535 #if INCLUDE_G1GC
 536   if (UseG1GC) {
 537     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 538     if (g1h->is_hetero_heap()) {
 539       uint start_region = HeterogeneousHeapRegionManager::manager()->start_index_of_nvdimm();
 540       return (jlong)(g1h->base() + start_region * HeapRegion::GrainBytes);
 541     } else {
 542       THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedStart: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
 543     }
 544   }
 545 #endif // INCLUDE_G1GC
 546 #if INCLUDE_PARALLELGC
 547   if (UseParallelGC) {
 548     ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
 549     if (AllocateOldGenAt != NULL) {
 550       MemRegion reserved = ps_heap->old_gen()->reserved();
 551       return (jlong)reserved.start();
 552     } else {
 553       THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedStart: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
 554     }
 555   }
 556 #endif // INCLUDE_PARALLELGC
 557   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedStart: enabled only for G1 and Parallel GC");
 558 WB_END
 559 
 560 WB_ENTRY(jlong, WB_NvdimmReservedEnd(JNIEnv* env, jobject o))
 561 #if INCLUDE_G1GC
 562   if (UseG1GC) {
 563     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 564     if (g1h->is_hetero_heap()) {
 565       uint end_region = HeterogeneousHeapRegionManager::manager()->start_index_of_nvdimm();
 566       return (jlong)(g1h->base() + (end_region + 1) * HeapRegion::GrainBytes - 1);
 567     } else {
 568       THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedEnd: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
 569     }
 570   }
 571 #endif // INCLUDE_G1GC
 572 #if INCLUDE_PARALLELGC
 573   if (UseParallelGC) {
 574     ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
 575     if (AllocateOldGenAt != NULL) {
 576       MemRegion reserved = ps_heap->old_gen()->reserved();
 577       return (jlong)reserved.end();
 578       } else {
 579       THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedEnd: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
 580     }
 581   }
 582 #endif // INCLUDE_PARALLELGC
 583   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedEnd: enabled only for G1 and Parallel GC");
 584 WB_END




 466     }
 467     return false;
 468   }
 469   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_G1StartMarkCycle: G1 GC is not enabled");
 470 WB_END
 471 
 472 WB_ENTRY(jint, WB_G1RegionSize(JNIEnv* env, jobject o))
 473   if (UseG1GC) {
 474     return (jint)HeapRegion::GrainBytes;
 475   }
 476   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_G1RegionSize: G1 GC is not enabled");
 477 WB_END
 478 
 479 #endif // INCLUDE_G1GC
 480 
 481 #if INCLUDE_G1GC || INCLUDE_PARALLELGC
 482 WB_ENTRY(jlong, WB_DramReservedStart(JNIEnv* env, jobject o))
 483 #if INCLUDE_G1GC
 484   if (UseG1GC) {
 485     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 486     if (g1h->is_heterogeneous_heap()) {
 487       uint start_region = HeterogeneousHeapRegionManager::manager()->start_index_of_dram();
 488       return (jlong)(g1h->base() + start_region * HeapRegion::GrainBytes);
 489     } else {
 490       return (jlong)g1h->base();
 491     }
 492   }
 493 #endif // INCLUDE_G1GC
 494 #if INCLUDE_PARALLELGC
 495   if (UseParallelGC) {
 496     ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
 497     if (AllocateOldGenAt != NULL) {
 498       MemRegion reserved = ps_heap->young_gen()->reserved();
 499       return (jlong)reserved.start();
 500     } else {
 501       return (jlong)ps_heap->base();
 502     }
 503   }
 504 #endif // INCLUDE_PARALLELGC
 505   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_DramReservedStart: enabled only for G1 and Parallel GC");
 506 WB_END
 507 
 508 WB_ENTRY(jlong, WB_DramReservedEnd(JNIEnv* env, jobject o))
 509 #if INCLUDE_G1GC
 510   if (UseG1GC) {
 511     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 512     if (g1h->is_heterogeneous_heap()) {
 513       uint end_region = HeterogeneousHeapRegionManager::manager()->end_index_of_dram();
 514       return (jlong)(g1h->base() + (end_region + 1) * HeapRegion::GrainBytes - 1);
 515     } else {
 516       return (jlong)g1h->base() + g1h->collector_policy()->max_heap_byte_size();
 517     }
 518   }
 519 #endif // INCLUDE_G1GC
 520 #if INCLUDE_PARALLELGC
 521   if (UseParallelGC) {
 522     ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
 523     if (AllocateOldGenAt != NULL) {
 524       MemRegion reserved = ps_heap->young_gen()->reserved();
 525       return (jlong)reserved.end();
 526     } else {
 527       return (jlong)ps_heap->reserved_region().end();
 528     }
 529   }
 530 #endif // INCLUDE_PARALLELGC
 531   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_DramReservedEnd: enabled only for G1 and Parallel GC");
 532 WB_END
 533 
 534 WB_ENTRY(jlong, WB_NvdimmReservedStart(JNIEnv* env, jobject o))
 535 #if INCLUDE_G1GC
 536   if (UseG1GC) {
 537     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 538     if (g1h->is_heterogeneous_heap()) {
 539       uint start_region = HeterogeneousHeapRegionManager::manager()->start_index_of_nvdimm();
 540       return (jlong)(g1h->base() + start_region * HeapRegion::GrainBytes);
 541     } else {
 542       THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedStart: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
 543     }
 544   }
 545 #endif // INCLUDE_G1GC
 546 #if INCLUDE_PARALLELGC
 547   if (UseParallelGC) {
 548     ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
 549     if (AllocateOldGenAt != NULL) {
 550       MemRegion reserved = ps_heap->old_gen()->reserved();
 551       return (jlong)reserved.start();
 552     } else {
 553       THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedStart: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
 554     }
 555   }
 556 #endif // INCLUDE_PARALLELGC
 557   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedStart: enabled only for G1 and Parallel GC");
 558 WB_END
 559 
 560 WB_ENTRY(jlong, WB_NvdimmReservedEnd(JNIEnv* env, jobject o))
 561 #if INCLUDE_G1GC
 562   if (UseG1GC) {
 563     G1CollectedHeap* g1h = G1CollectedHeap::heap();
 564     if (g1h->is_heterogeneous_heap()) {
 565       uint end_region = HeterogeneousHeapRegionManager::manager()->start_index_of_nvdimm();
 566       return (jlong)(g1h->base() + (end_region + 1) * HeapRegion::GrainBytes - 1);
 567     } else {
 568       THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedEnd: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
 569     }
 570   }
 571 #endif // INCLUDE_G1GC
 572 #if INCLUDE_PARALLELGC
 573   if (UseParallelGC) {
 574     ParallelScavengeHeap* ps_heap = ParallelScavengeHeap::heap();
 575     if (AllocateOldGenAt != NULL) {
 576       MemRegion reserved = ps_heap->old_gen()->reserved();
 577       return (jlong)reserved.end();
 578       } else {
 579       THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedEnd: Old gen is not allocated on NV-DIMM using AllocateOldGenAt flag");
 580     }
 581   }
 582 #endif // INCLUDE_PARALLELGC
 583   THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), "WB_NvdimmReservedEnd: enabled only for G1 and Parallel GC");
 584 WB_END


< prev index next >