469 470 JVM_ENTRY_NO_ENV(void, JVM_BeforeHalt()) 471 JVMWrapper("JVM_BeforeHalt"); 472 EventShutdown event; 473 if (event.should_commit()) { 474 event.set_reason("Shutdown requested from Java"); 475 event.commit(); 476 } 477 JVM_END 478 479 480 JVM_ENTRY_NO_ENV(void, JVM_Halt(jint code)) 481 before_exit(thread); 482 vm_exit(code); 483 JVM_END 484 485 486 JVM_ENTRY_NO_ENV(void, JVM_GC(void)) 487 JVMWrapper("JVM_GC"); 488 if (!DisableExplicitGC) { 489 Universe::heap()->collect(GCCause::_java_lang_system_gc); 490 } 491 JVM_END 492 493 494 JVM_LEAF(jlong, JVM_MaxObjectInspectionAge(void)) 495 JVMWrapper("JVM_MaxObjectInspectionAge"); 496 return Universe::heap()->millis_since_last_gc(); 497 JVM_END 498 499 500 static inline jlong convert_size_t_to_jlong(size_t val) { 501 // In the 64-bit vm, a size_t can overflow a jlong (which is signed). 502 NOT_LP64 (return (jlong)val;) 503 LP64_ONLY(return (jlong)MIN2(val, (size_t)max_jlong);) 504 } 505 506 JVM_ENTRY_NO_ENV(jlong, JVM_TotalMemory(void)) 507 JVMWrapper("JVM_TotalMemory"); 508 size_t n = Universe::heap()->capacity(); | 469 470 JVM_ENTRY_NO_ENV(void, JVM_BeforeHalt()) 471 JVMWrapper("JVM_BeforeHalt"); 472 EventShutdown event; 473 if (event.should_commit()) { 474 event.set_reason("Shutdown requested from Java"); 475 event.commit(); 476 } 477 JVM_END 478 479 480 JVM_ENTRY_NO_ENV(void, JVM_Halt(jint code)) 481 before_exit(thread); 482 vm_exit(code); 483 JVM_END 484 485 486 JVM_ENTRY_NO_ENV(void, JVM_GC(void)) 487 JVMWrapper("JVM_GC"); 488 if (!DisableExplicitGC) { 489 EventSystemGC event; 490 event.commit(); 491 Universe::heap()->collect(GCCause::_java_lang_system_gc); 492 } 493 JVM_END 494 495 496 JVM_LEAF(jlong, JVM_MaxObjectInspectionAge(void)) 497 JVMWrapper("JVM_MaxObjectInspectionAge"); 498 return Universe::heap()->millis_since_last_gc(); 499 JVM_END 500 501 502 static inline jlong convert_size_t_to_jlong(size_t val) { 503 // In the 64-bit vm, a size_t can overflow a jlong (which is signed). 504 NOT_LP64 (return (jlong)val;) 505 LP64_ONLY(return (jlong)MIN2(val, (size_t)max_jlong);) 506 } 507 508 JVM_ENTRY_NO_ENV(jlong, JVM_TotalMemory(void)) 509 JVMWrapper("JVM_TotalMemory"); 510 size_t n = Universe::heap()->capacity(); |