430 // vtables 431 klassVtable vtable() const; 432 int vtable_length() const { return _vtable_len; } 433 434 // subclass check 435 bool is_subclass_of(const Klass* k) const; 436 // subtype check: true if is_subclass_of, or if k is interface and receiver implements it 437 bool is_subtype_of(Klass* k) const { 438 juint off = k->super_check_offset(); 439 Klass* sup = *(Klass**)( (address)this + off ); 440 const juint secondary_offset = in_bytes(secondary_super_cache_offset()); 441 if (sup == k) { 442 return true; 443 } else if (off != secondary_offset) { 444 return false; 445 } else { 446 return search_secondary_supers(k); 447 } 448 } 449 450 // Is an oop/narrowOop null or subtype of this Klass? 451 template <typename T> 452 bool is_instanceof_or_null(T element); 453 454 bool search_secondary_supers(Klass* k) const; 455 456 // Find LCA in class hierarchy 457 Klass *LCA( Klass *k ); 458 459 // Check whether reflection/jni/jvm code is allowed to instantiate this class; 460 // if not, throw either an Error or an Exception. 461 virtual void check_valid_for_instantiation(bool throwError, TRAPS); 462 463 // array copying 464 virtual void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS); 465 466 // tells if the class should be initialized 467 virtual bool should_be_initialized() const { return false; } 468 // initializes the klass 469 virtual void initialize(TRAPS); 470 // lookup operation for MethodLookupCache 471 friend class MethodLookupCache; 472 virtual Klass* find_field(Symbol* name, Symbol* signature, fieldDescriptor* fd) const; 473 virtual Method* uncached_lookup_method(const Symbol* name, const Symbol* signature, OverpassLookupMode overpass_mode) const; | 430 // vtables 431 klassVtable vtable() const; 432 int vtable_length() const { return _vtable_len; } 433 434 // subclass check 435 bool is_subclass_of(const Klass* k) const; 436 // subtype check: true if is_subclass_of, or if k is interface and receiver implements it 437 bool is_subtype_of(Klass* k) const { 438 juint off = k->super_check_offset(); 439 Klass* sup = *(Klass**)( (address)this + off ); 440 const juint secondary_offset = in_bytes(secondary_super_cache_offset()); 441 if (sup == k) { 442 return true; 443 } else if (off != secondary_offset) { 444 return false; 445 } else { 446 return search_secondary_supers(k); 447 } 448 } 449 450 bool search_secondary_supers(Klass* k) const; 451 452 // Find LCA in class hierarchy 453 Klass *LCA( Klass *k ); 454 455 // Check whether reflection/jni/jvm code is allowed to instantiate this class; 456 // if not, throw either an Error or an Exception. 457 virtual void check_valid_for_instantiation(bool throwError, TRAPS); 458 459 // array copying 460 virtual void copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS); 461 462 // tells if the class should be initialized 463 virtual bool should_be_initialized() const { return false; } 464 // initializes the klass 465 virtual void initialize(TRAPS); 466 // lookup operation for MethodLookupCache 467 friend class MethodLookupCache; 468 virtual Klass* find_field(Symbol* name, Symbol* signature, fieldDescriptor* fd) const; 469 virtual Method* uncached_lookup_method(const Symbol* name, const Symbol* signature, OverpassLookupMode overpass_mode) const; |