< prev index next >
src/share/vm/prims/jvm.cpp
Print this page
rev 12310 : [mq]: gcinterface.patch
*** 441,458 ****
JVM_ENTRY_NO_ENV(void, JVM_GC(void))
JVMWrapper("JVM_GC");
if (!DisableExplicitGC) {
! Universe::heap()->collect(GCCause::_java_lang_system_gc);
}
JVM_END
JVM_LEAF(jlong, JVM_MaxObjectInspectionAge(void))
JVMWrapper("JVM_MaxObjectInspectionAge");
! return Universe::heap()->millis_since_last_gc();
JVM_END
static inline jlong convert_size_t_to_jlong(size_t val) {
// In the 64-bit vm, a size_t can overflow a jlong (which is signed).
--- 441,458 ----
JVM_ENTRY_NO_ENV(void, JVM_GC(void))
JVMWrapper("JVM_GC");
if (!DisableExplicitGC) {
! GC::gc()->heap()->collect(GCCause::_java_lang_system_gc);
}
JVM_END
JVM_LEAF(jlong, JVM_MaxObjectInspectionAge(void))
JVMWrapper("JVM_MaxObjectInspectionAge");
! return GC::gc()->heap()->millis_since_last_gc();
JVM_END
static inline jlong convert_size_t_to_jlong(size_t val) {
// In the 64-bit vm, a size_t can overflow a jlong (which is signed).
*** 460,477 ****
LP64_ONLY(return (jlong)MIN2(val, (size_t)max_jlong);)
}
JVM_ENTRY_NO_ENV(jlong, JVM_TotalMemory(void))
JVMWrapper("JVM_TotalMemory");
! size_t n = Universe::heap()->capacity();
return convert_size_t_to_jlong(n);
JVM_END
JVM_ENTRY_NO_ENV(jlong, JVM_FreeMemory(void))
JVMWrapper("JVM_FreeMemory");
! CollectedHeap* ch = Universe::heap();
size_t n;
{
MutexLocker x(Heap_lock);
n = ch->capacity() - ch->used();
}
--- 460,477 ----
LP64_ONLY(return (jlong)MIN2(val, (size_t)max_jlong);)
}
JVM_ENTRY_NO_ENV(jlong, JVM_TotalMemory(void))
JVMWrapper("JVM_TotalMemory");
! size_t n = GC::gc()->heap()->capacity();
return convert_size_t_to_jlong(n);
JVM_END
JVM_ENTRY_NO_ENV(jlong, JVM_FreeMemory(void))
JVMWrapper("JVM_FreeMemory");
! CollectedHeap* ch = GC::gc()->heap();
size_t n;
{
MutexLocker x(Heap_lock);
n = ch->capacity() - ch->used();
}
*** 479,489 ****
JVM_END
JVM_ENTRY_NO_ENV(jlong, JVM_MaxMemory(void))
JVMWrapper("JVM_MaxMemory");
! size_t n = Universe::heap()->max_capacity();
return convert_size_t_to_jlong(n);
JVM_END
JVM_ENTRY_NO_ENV(jint, JVM_ActiveProcessorCount(void))
--- 479,489 ----
JVM_END
JVM_ENTRY_NO_ENV(jlong, JVM_MaxMemory(void))
JVMWrapper("JVM_MaxMemory");
! size_t n = GC::gc()->heap()->max_capacity();
return convert_size_t_to_jlong(n);
JVM_END
JVM_ENTRY_NO_ENV(jint, JVM_ActiveProcessorCount(void))
*** 666,676 ****
(size_t)align_object_size(size) / HeapWordsPerLong);
// Clear the header
new_obj_oop->init_mark();
// Store check (mark entire object and let gc sort it out)
! BarrierSet* bs = Universe::heap()->barrier_set();
assert(bs->has_write_region_opt(), "Barrier set does not have write_region");
bs->write_region(MemRegion((HeapWord*)new_obj_oop, size));
Handle new_obj(THREAD, new_obj_oop);
// Special handling for MemberNames. Since they contain Method* metadata, they
--- 666,676 ----
(size_t)align_object_size(size) / HeapWordsPerLong);
// Clear the header
new_obj_oop->init_mark();
// Store check (mark entire object and let gc sort it out)
! BarrierSet* bs = GC::gc()->heap()->barrier_set();
assert(bs->has_write_region_opt(), "Barrier set does not have write_region");
bs->write_region(MemRegion((HeapWord*)new_obj_oop, size));
Handle new_obj(THREAD, new_obj_oop);
// Special handling for MemberNames. Since they contain Method* metadata, they
< prev index next >