590 _mirrors[T_INT] = _int_mirror; 591 _mirrors[T_FLOAT] = _float_mirror; 592 _mirrors[T_DOUBLE] = _double_mirror; 593 _mirrors[T_BYTE] = _byte_mirror; 594 _mirrors[T_BOOLEAN] = _bool_mirror; 595 _mirrors[T_CHAR] = _char_mirror; 596 _mirrors[T_LONG] = _long_mirror; 597 _mirrors[T_SHORT] = _short_mirror; 598 _mirrors[T_VOID] = _void_mirror; 599 //_mirrors[T_OBJECT] = instanceKlass::cast(_object_klass)->java_mirror(); 600 //_mirrors[T_ARRAY] = instanceKlass::cast(_object_klass)->java_mirror(); 601 } 602 } 603 604 void Universe::fixup_mirrors(TRAPS) { 605 // Bootstrap problem: all classes gets a mirror (java.lang.Class instance) assigned eagerly, 606 // but we cannot do that for classes created before java.lang.Class is loaded. Here we simply 607 // walk over permanent objects created so far (mostly classes) and fixup their mirrors. Note 608 // that the number of objects allocated at this point is very small. 609 assert(SystemDictionary::Class_klass_loaded(), "java.lang.Class should be loaded"); 610 FixupMirrorClosure blk; 611 Universe::heap()->permanent_object_iterate(&blk); 612 } 613 614 615 static bool has_run_finalizers_on_exit = false; 616 617 void Universe::run_finalizers_on_exit() { 618 if (has_run_finalizers_on_exit) return; 619 has_run_finalizers_on_exit = true; 620 621 // Called on VM exit. This ought to be run in a separate thread. 622 if (TraceReferenceGC) tty->print_cr("Callback to run finalizers on exit"); 623 { 624 PRESERVE_EXCEPTION_MARK; 625 KlassHandle finalizer_klass(THREAD, SystemDictionary::Finalizer_klass()); 626 JavaValue result(T_VOID); 627 JavaCalls::call_static( 628 &result, 629 finalizer_klass, | 590 _mirrors[T_INT] = _int_mirror; 591 _mirrors[T_FLOAT] = _float_mirror; 592 _mirrors[T_DOUBLE] = _double_mirror; 593 _mirrors[T_BYTE] = _byte_mirror; 594 _mirrors[T_BOOLEAN] = _bool_mirror; 595 _mirrors[T_CHAR] = _char_mirror; 596 _mirrors[T_LONG] = _long_mirror; 597 _mirrors[T_SHORT] = _short_mirror; 598 _mirrors[T_VOID] = _void_mirror; 599 //_mirrors[T_OBJECT] = instanceKlass::cast(_object_klass)->java_mirror(); 600 //_mirrors[T_ARRAY] = instanceKlass::cast(_object_klass)->java_mirror(); 601 } 602 } 603 604 void Universe::fixup_mirrors(TRAPS) { 605 // Bootstrap problem: all classes gets a mirror (java.lang.Class instance) assigned eagerly, 606 // but we cannot do that for classes created before java.lang.Class is loaded. Here we simply 607 // walk over permanent objects created so far (mostly classes) and fixup their mirrors. Note 608 // that the number of objects allocated at this point is very small. 609 assert(SystemDictionary::Class_klass_loaded(), "java.lang.Class should be loaded"); 610 611 // Cache the start of the static fields 612 instanceMirrorKlass::set_offset_of_static_fields(instanceMirrorKlass::cast(SystemDictionary::Class_klass())->size_helper() << LogHeapWordSize); 613 614 FixupMirrorClosure blk; 615 Universe::heap()->permanent_object_iterate(&blk); 616 } 617 618 619 static bool has_run_finalizers_on_exit = false; 620 621 void Universe::run_finalizers_on_exit() { 622 if (has_run_finalizers_on_exit) return; 623 has_run_finalizers_on_exit = true; 624 625 // Called on VM exit. This ought to be run in a separate thread. 626 if (TraceReferenceGC) tty->print_cr("Callback to run finalizers on exit"); 627 { 628 PRESERVE_EXCEPTION_MARK; 629 KlassHandle finalizer_klass(THREAD, SystemDictionary::Finalizer_klass()); 630 JavaValue result(T_VOID); 631 JavaCalls::call_static( 632 &result, 633 finalizer_klass, |