hotspot/src/share/vm/oops/instanceKlass.hpp
changeset 46341 4c676683bdb9
parent 46329 53ccc37bda19
child 46408 70aab0c2ea8b
equal deleted inserted replaced
46340:9c2be834d6e3 46341:4c676683bdb9
   462                                     const Symbol* class_name1,
   462                                     const Symbol* class_name1,
   463                                     oop class_loader2,
   463                                     oop class_loader2,
   464                                     const Symbol* class_name2);
   464                                     const Symbol* class_name2);
   465 
   465 
   466   // find an enclosing class
   466   // find an enclosing class
   467   InstanceKlass* compute_enclosing_class(bool* inner_is_member, TRAPS) const {
   467   InstanceKlass* compute_enclosing_class(bool* inner_is_member, TRAPS) const;
   468     return compute_enclosing_class_impl(this, inner_is_member, THREAD);
   468 
   469   }
   469   // Find InnerClasses attribute and return outer_class_info_index & inner_name_index.
   470   static InstanceKlass* compute_enclosing_class_impl(const InstanceKlass* self,
   470   bool find_inner_classes_attr(int* ooff, int* noff, TRAPS) const;
   471                                                      bool* inner_is_member,
       
   472                                                      TRAPS);
       
   473 
       
   474   // Find InnerClasses attribute for k and return outer_class_info_index & inner_name_index.
       
   475   static bool find_inner_classes_attr(const InstanceKlass* k,
       
   476                                       int* ooff, int* noff, TRAPS);
       
   477 
   471 
   478  private:
   472  private:
   479   // Check prohibited package ("java/" only loadable by boot or platform loaders)
   473   // Check prohibited package ("java/" only loadable by boot or platform loaders)
   480   static void check_prohibited_package(Symbol* class_name,
   474   static void check_prohibited_package(Symbol* class_name,
   481                                        Handle class_loader,
   475                                        Handle class_loader,
   482                                        TRAPS);
   476                                        TRAPS);
   483  public:
   477  public:
   484   // tell if two classes have the same enclosing class (at package level)
   478   // tell if two classes have the same enclosing class (at package level)
   485   bool is_same_package_member(const Klass* class2, TRAPS) const {
   479   bool is_same_package_member(const Klass* class2, TRAPS) const;
   486     return is_same_package_member_impl(this, class2, THREAD);
       
   487   }
       
   488   static bool is_same_package_member_impl(const InstanceKlass* self,
       
   489                                           const Klass* class2,
       
   490                                           TRAPS);
       
   491 
   480 
   492   // initialization state
   481   // initialization state
   493   bool is_loaded() const                   { return _init_state >= loaded; }
   482   bool is_loaded() const                   { return _init_state >= loaded; }
   494   bool is_linked() const                   { return _init_state >= linked; }
   483   bool is_linked() const                   { return _init_state >= linked; }
   495   bool is_initialized() const              { return _init_state == fully_initialized; }
   484   bool is_initialized() const              { return _init_state == fully_initialized; }
   881   }
   870   }
   882   void set_enclosing_method_indices(u2 class_index,
   871   void set_enclosing_method_indices(u2 class_index,
   883                                     u2 method_index);
   872                                     u2 method_index);
   884 
   873 
   885   // jmethodID support
   874   // jmethodID support
   886   static jmethodID get_jmethod_id(InstanceKlass* ik,
   875   jmethodID get_jmethod_id(const methodHandle& method_h);
   887                      const methodHandle& method_h);
   876   jmethodID get_jmethod_id_fetch_or_update(size_t idnum,
   888   static jmethodID get_jmethod_id_fetch_or_update(InstanceKlass* ik,
   877                      jmethodID new_id, jmethodID* new_jmeths,
   889                      size_t idnum, jmethodID new_id, jmethodID* new_jmeths,
       
   890                      jmethodID* to_dealloc_id_p,
   878                      jmethodID* to_dealloc_id_p,
   891                      jmethodID** to_dealloc_jmeths_p);
   879                      jmethodID** to_dealloc_jmeths_p);
   892   static void get_jmethod_id_length_value(jmethodID* cache, size_t idnum,
   880   static void get_jmethod_id_length_value(jmethodID* cache, size_t idnum,
   893                 size_t *length_p, jmethodID* id_p);
   881                 size_t *length_p, jmethodID* id_p);
   894   void ensure_space_for_methodids(int start_offset = 0);
   882   void ensure_space_for_methodids(int start_offset = 0);
  1304   // It has to be an object not a Mutex because it's held through java calls.
  1292   // It has to be an object not a Mutex because it's held through java calls.
  1305   oop init_lock() const;
  1293   oop init_lock() const;
  1306 private:
  1294 private:
  1307   void fence_and_clear_init_lock();
  1295   void fence_and_clear_init_lock();
  1308 
  1296 
  1309   // Static methods that are used to implement member methods where an exposed this pointer
  1297   bool link_class_impl                           (bool throw_verifyerror, TRAPS);
  1310   // is needed due to possible GCs
  1298   bool verify_code                               (bool throw_verifyerror, TRAPS);
  1311   static bool link_class_impl                           (InstanceKlass* this_k, bool throw_verifyerror, TRAPS);
  1299   void initialize_impl                           (TRAPS);
  1312   static bool verify_code                               (InstanceKlass* this_k, bool throw_verifyerror, TRAPS);
  1300   void initialize_super_interfaces               (TRAPS);
  1313   static void initialize_impl                           (InstanceKlass* this_k, TRAPS);
  1301   void eager_initialize_impl                     ();
  1314   static void initialize_super_interfaces               (InstanceKlass* this_k, TRAPS);
       
  1315   static void eager_initialize_impl                     (InstanceKlass* this_k);
       
  1316   static void set_initialization_state_and_notify_impl  (InstanceKlass* this_k, ClassState state, TRAPS);
       
  1317   static void call_class_initializer_impl               (InstanceKlass* this_k, TRAPS);
       
  1318   static Klass* array_klass_impl                        (InstanceKlass* this_k, bool or_null, int n, TRAPS);
       
  1319   static void do_local_static_fields_impl               (InstanceKlass* this_k, void f(fieldDescriptor* fd, Handle, TRAPS), Handle, TRAPS);
       
  1320   /* jni_id_for_impl for jfieldID only */
  1302   /* jni_id_for_impl for jfieldID only */
  1321   static JNIid* jni_id_for_impl                         (InstanceKlass* this_k, int offset);
  1303   JNIid* jni_id_for_impl                         (int offset);
  1322 
  1304 
  1323   // Returns the array class for the n'th dimension
  1305   // Returns the array class for the n'th dimension
  1324   Klass* array_klass_impl(bool or_null, int n, TRAPS);
  1306   Klass* array_klass_impl(bool or_null, int n, TRAPS);
  1325 
  1307 
  1326   // Returns the array class with this class as element type
  1308   // Returns the array class with this class as element type