505 TRAPS);
506
507 JavaThread* init_thread() { return AtomicAccess::load(&_init_thread); }
508 const char* init_thread_name() {
509 return init_thread()->name_raw();
510 }
511
512 public:
513 // initialization state
514 bool is_loaded() const { return init_state() >= loaded; }
515 bool is_linked() const { return init_state() >= linked; }
516 bool is_initialized() const { return init_state() == fully_initialized; }
517 bool is_not_initialized() const { return init_state() < being_initialized; }
518 bool is_being_initialized() const { return init_state() == being_initialized; }
519 bool is_in_error_state() const { return init_state() == initialization_error; }
520 bool is_reentrant_initialization(Thread *thread) { return thread == _init_thread; }
521 ClassState init_state() const { return AtomicAccess::load_acquire(&_init_state); }
522 const char* init_state_name() const;
523 bool is_rewritten() const { return _misc_flags.rewritten(); }
524
525 // is this a sealed class
526 bool is_sealed() const;
527
528 // defineClass specified verification
529 bool should_verify_class() const { return _misc_flags.should_verify_class(); }
530 void set_should_verify_class(bool value) { _misc_flags.set_should_verify_class(value); }
531
532 // marking
533 bool is_marked_dependent() const { return _misc_flags.is_marked_dependent(); }
534 void set_is_marked_dependent(bool value) { _misc_flags.set_is_marked_dependent(value); }
535
536 // initialization (virtuals from Klass)
537 bool should_be_initialized() const; // means that initialize should be called
538 void initialize_with_aot_initialized_mirror(TRAPS);
539 void assert_no_clinit_will_run_for_aot_initialized_class() const NOT_DEBUG_RETURN;
540 void initialize(TRAPS);
541 void initialize_preemptable(TRAPS);
542 void link_class(TRAPS);
543 bool link_class_or_fail(TRAPS); // returns false on failure
544 void rewrite_class(TRAPS);
789 void update_methods_jmethod_cache();
790
791 // annotations support
792 Annotations* annotations() const { return _annotations; }
793 void set_annotations(Annotations* anno) { _annotations = anno; }
794
795 AnnotationArray* class_annotations() const {
796 return (_annotations != nullptr) ? _annotations->class_annotations() : nullptr;
797 }
798 Array<AnnotationArray*>* fields_annotations() const {
799 return (_annotations != nullptr) ? _annotations->fields_annotations() : nullptr;
800 }
801 AnnotationArray* class_type_annotations() const {
802 return (_annotations != nullptr) ? _annotations->class_type_annotations() : nullptr;
803 }
804 Array<AnnotationArray*>* fields_type_annotations() const {
805 return (_annotations != nullptr) ? _annotations->fields_type_annotations() : nullptr;
806 }
807 // allocation
808 instanceOop allocate_instance(TRAPS);
809 static instanceOop allocate_instance(oop cls, TRAPS);
810
811 // additional member function to return a handle
812 instanceHandle allocate_instance_handle(TRAPS);
813
814 // Helper function
815 static instanceOop register_finalizer(instanceOop i, TRAPS);
816
817 // Check whether reflection/jni/jvm code is allowed to instantiate this class;
818 // if not, throw either an Error or an Exception.
819 virtual void check_valid_for_instantiation(bool throwError, TRAPS);
820
821 // initialization
822 void call_class_initializer(TRAPS);
823 void set_initialization_state_and_notify(ClassState state, TRAPS);
824
825 // OopMapCache support
826 OopMapCache* oop_map_cache() { return _oop_map_cache; }
827 void set_oop_map_cache(OopMapCache *cache) { _oop_map_cache = cache; }
828 void mask_for(const methodHandle& method, int bci, InterpreterOopMap* entry);
829
|
505 TRAPS);
506
507 JavaThread* init_thread() { return AtomicAccess::load(&_init_thread); }
508 const char* init_thread_name() {
509 return init_thread()->name_raw();
510 }
511
512 public:
513 // initialization state
514 bool is_loaded() const { return init_state() >= loaded; }
515 bool is_linked() const { return init_state() >= linked; }
516 bool is_initialized() const { return init_state() == fully_initialized; }
517 bool is_not_initialized() const { return init_state() < being_initialized; }
518 bool is_being_initialized() const { return init_state() == being_initialized; }
519 bool is_in_error_state() const { return init_state() == initialization_error; }
520 bool is_reentrant_initialization(Thread *thread) { return thread == _init_thread; }
521 ClassState init_state() const { return AtomicAccess::load_acquire(&_init_state); }
522 const char* init_state_name() const;
523 bool is_rewritten() const { return _misc_flags.rewritten(); }
524
525 static const char* state2name(ClassState state);
526
527 // is this a sealed class
528 bool is_sealed() const;
529
530 // defineClass specified verification
531 bool should_verify_class() const { return _misc_flags.should_verify_class(); }
532 void set_should_verify_class(bool value) { _misc_flags.set_should_verify_class(value); }
533
534 // marking
535 bool is_marked_dependent() const { return _misc_flags.is_marked_dependent(); }
536 void set_is_marked_dependent(bool value) { _misc_flags.set_is_marked_dependent(value); }
537
538 // initialization (virtuals from Klass)
539 bool should_be_initialized() const; // means that initialize should be called
540 void initialize_with_aot_initialized_mirror(TRAPS);
541 void assert_no_clinit_will_run_for_aot_initialized_class() const NOT_DEBUG_RETURN;
542 void initialize(TRAPS);
543 void initialize_preemptable(TRAPS);
544 void link_class(TRAPS);
545 bool link_class_or_fail(TRAPS); // returns false on failure
546 void rewrite_class(TRAPS);
791 void update_methods_jmethod_cache();
792
793 // annotations support
794 Annotations* annotations() const { return _annotations; }
795 void set_annotations(Annotations* anno) { _annotations = anno; }
796
797 AnnotationArray* class_annotations() const {
798 return (_annotations != nullptr) ? _annotations->class_annotations() : nullptr;
799 }
800 Array<AnnotationArray*>* fields_annotations() const {
801 return (_annotations != nullptr) ? _annotations->fields_annotations() : nullptr;
802 }
803 AnnotationArray* class_type_annotations() const {
804 return (_annotations != nullptr) ? _annotations->class_type_annotations() : nullptr;
805 }
806 Array<AnnotationArray*>* fields_type_annotations() const {
807 return (_annotations != nullptr) ? _annotations->fields_type_annotations() : nullptr;
808 }
809 // allocation
810 instanceOop allocate_instance(TRAPS);
811 static instanceOop allocate_instance(oop cls, const char* who, TRAPS);
812
813 // additional member function to return a handle
814 instanceHandle allocate_instance_handle(TRAPS);
815
816 // Helper function
817 static instanceOop register_finalizer(instanceOop i, TRAPS);
818
819 // Check whether reflection/jni/jvm code is allowed to instantiate this class;
820 // if not, throw either an Error or an Exception.
821 virtual void check_valid_for_instantiation(bool throwError, TRAPS);
822
823 // initialization
824 void call_class_initializer(TRAPS);
825 void set_initialization_state_and_notify(ClassState state, TRAPS);
826
827 // OopMapCache support
828 OopMapCache* oop_map_cache() { return _oop_map_cache; }
829 void set_oop_map_cache(OopMapCache *cache) { _oop_map_cache = cache; }
830 void mask_for(const methodHandle& method, int bci, InterpreterOopMap* entry);
831
|