412 #if INCLUDE_G1GC
413 if (UseG1GC) {
414 G1CollectedHeap* g1h = G1CollectedHeap::heap();
415 const G1HeapRegion* hr = g1h->heap_region_containing(p);
416 return hr->is_old_or_humongous();
417 }
418 #endif
419 #if INCLUDE_PARALLELGC
420 if (UseParallelGC) {
421 ParallelScavengeHeap* psh = ParallelScavengeHeap::heap();
422 return !psh->is_in_young(p);
423 }
424 #endif
425 #if INCLUDE_ZGC
426 if (UseZGC) {
427 return ZHeap::heap()->is_old(to_zaddress(p));
428 }
429 #endif
430 #if INCLUDE_SHENANDOAHGC
431 if (UseShenandoahGC) {
432 return Universe::heap()->is_in(p);
433 }
434 #endif
435 #if INCLUDE_SERIALGC
436 if (UseSerialGC) {
437 return !SerialHeap::heap()->is_in_young(p);
438 }
439 #endif
440 ShouldNotReachHere();
441 return false;
442 WB_END
443
444 WB_ENTRY(jlong, WB_GetObjectSize(JNIEnv* env, jobject o, jobject obj))
445 oop p = JNIHandles::resolve(obj);
446 return p->size() * HeapWordSize;
447 WB_END
448
449 WB_ENTRY(jlong, WB_GetHeapSpaceAlignment(JNIEnv* env, jobject o))
450 return (jlong)SpaceAlignment;
451 WB_END
452
|
412 #if INCLUDE_G1GC
413 if (UseG1GC) {
414 G1CollectedHeap* g1h = G1CollectedHeap::heap();
415 const G1HeapRegion* hr = g1h->heap_region_containing(p);
416 return hr->is_old_or_humongous();
417 }
418 #endif
419 #if INCLUDE_PARALLELGC
420 if (UseParallelGC) {
421 ParallelScavengeHeap* psh = ParallelScavengeHeap::heap();
422 return !psh->is_in_young(p);
423 }
424 #endif
425 #if INCLUDE_ZGC
426 if (UseZGC) {
427 return ZHeap::heap()->is_old(to_zaddress(p));
428 }
429 #endif
430 #if INCLUDE_SHENANDOAHGC
431 if (UseShenandoahGC) {
432 ShenandoahHeap* sh = ShenandoahHeap::heap();
433 return sh->mode()->is_generational() ? sh->is_in_old(p) : sh->is_in(p);
434 }
435 #endif
436 #if INCLUDE_SERIALGC
437 if (UseSerialGC) {
438 return !SerialHeap::heap()->is_in_young(p);
439 }
440 #endif
441 ShouldNotReachHere();
442 return false;
443 WB_END
444
445 WB_ENTRY(jlong, WB_GetObjectSize(JNIEnv* env, jobject o, jobject obj))
446 oop p = JNIHandles::resolve(obj);
447 return p->size() * HeapWordSize;
448 WB_END
449
450 WB_ENTRY(jlong, WB_GetHeapSpaceAlignment(JNIEnv* env, jobject o))
451 return (jlong)SpaceAlignment;
452 WB_END
453
|