comparison src/share/vm/oops/instanceKlass.hpp @ 13086:096c224171c4

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Wed, 20 Nov 2013 00:10:38 +0100
parents cefad50507d8 b8860472c377
children 02f27ecb4f3a
comparison
equal deleted inserted replaced
12782:92b7ec34ddfa 13086:096c224171c4
267 267
268 NOT_PRODUCT(int _verify_count;) // to avoid redundant verifies 268 NOT_PRODUCT(int _verify_count;) // to avoid redundant verifies
269 269
270 // Method array. 270 // Method array.
271 Array<Method*>* _methods; 271 Array<Method*>* _methods;
272 // Default Method Array, concrete methods inherited from interfaces
273 Array<Method*>* _default_methods;
272 // Interface (Klass*s) this class declares locally to implement. 274 // Interface (Klass*s) this class declares locally to implement.
273 Array<Klass*>* _local_interfaces; 275 Array<Klass*>* _local_interfaces;
274 // Interface (Klass*s) this class implements transitively. 276 // Interface (Klass*s) this class implements transitively.
275 Array<Klass*>* _transitive_interfaces; 277 Array<Klass*>* _transitive_interfaces;
276 // Int array containing the original order of method in the class file (for JVMTI). 278 // Int array containing the original order of method in the class file (for JVMTI).
277 Array<int>* _method_ordering; 279 Array<int>* _method_ordering;
280 // Int array containing the vtable_indices for default_methods
281 // offset matches _default_methods offset
282 Array<int>* _default_vtable_indices;
283
278 // Instance and static variable information, starts with 6-tuples of shorts 284 // Instance and static variable information, starts with 6-tuples of shorts
279 // [access, name index, sig index, initval index, low_offset, high_offset] 285 // [access, name index, sig index, initval index, low_offset, high_offset]
280 // for all fields, followed by the generic signature data at the end of 286 // for all fields, followed by the generic signature data at the end of
281 // the array. Only fields with generic signature attributes have the generic 287 // the array. Only fields with generic signature attributes have the generic
282 // signature data set in the array. The fields array looks like following: 288 // signature data set in the array. The fields array looks like following:
354 // method ordering 360 // method ordering
355 Array<int>* method_ordering() const { return _method_ordering; } 361 Array<int>* method_ordering() const { return _method_ordering; }
356 void set_method_ordering(Array<int>* m) { _method_ordering = m; } 362 void set_method_ordering(Array<int>* m) { _method_ordering = m; }
357 void copy_method_ordering(intArray* m, TRAPS); 363 void copy_method_ordering(intArray* m, TRAPS);
358 364
365 // default_methods
366 Array<Method*>* default_methods() const { return _default_methods; }
367 void set_default_methods(Array<Method*>* a) { _default_methods = a; }
368
369 // default method vtable_indices
370 Array<int>* default_vtable_indices() const { return _default_vtable_indices; }
371 void set_default_vtable_indices(Array<int>* v) { _default_vtable_indices = v; }
372 Array<int>* create_new_default_vtable_indices(int len, TRAPS);
373
359 // interfaces 374 // interfaces
360 Array<Klass*>* local_interfaces() const { return _local_interfaces; } 375 Array<Klass*>* local_interfaces() const { return _local_interfaces; }
361 void set_local_interfaces(Array<Klass*>* a) { 376 void set_local_interfaces(Array<Klass*>* a) {
362 guarantee(_local_interfaces == NULL || a == NULL, "Just checking"); 377 guarantee(_local_interfaces == NULL || a == NULL, "Just checking");
363 _local_interfaces = a; } 378 _local_interfaces = a; }
499 514
500 // find a local method (returns NULL if not found) 515 // find a local method (returns NULL if not found)
501 Method* find_method(Symbol* name, Symbol* signature) const; 516 Method* find_method(Symbol* name, Symbol* signature) const;
502 static Method* find_method(Array<Method*>* methods, Symbol* name, Symbol* signature); 517 static Method* find_method(Array<Method*>* methods, Symbol* name, Symbol* signature);
503 518
519 // find a local method index in default_methods (returns -1 if not found)
520 static int find_method_index(Array<Method*>* methods, Symbol* name, Symbol* signature);
521
504 // lookup operation (returns NULL if not found) 522 // lookup operation (returns NULL if not found)
505 Method* uncached_lookup_method(Symbol* name, Symbol* signature) const; 523 Method* uncached_lookup_method(Symbol* name, Symbol* signature) const;
506 524
507 // lookup a method in all the interfaces that this class implements 525 // lookup a method in all the interfaces that this class implements
508 // (returns NULL if not found) 526 // (returns NULL if not found)
509 Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature) const; 527 Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature) const;
528 // lookup a method in local defaults then in all interfaces
529 // (returns NULL if not found)
530 Method* lookup_method_in_ordered_interfaces(Symbol* name, Symbol* signature) const;
510 531
511 // Find method indices by name. If a method with the specified name is 532 // Find method indices by name. If a method with the specified name is
512 // found the index to the first method is returned, and 'end' is filled in 533 // found the index to the first method is returned, and 'end' is filled in
513 // with the index of first non-name-matching method. If no method is found 534 // with the index of first non-name-matching method. If no method is found
514 // -1 is returned. 535 // -1 is returned.
908 klassVtable* vtable() const; // return new klassVtable wrapper 929 klassVtable* vtable() const; // return new klassVtable wrapper
909 inline Method* method_at_vtable(int index); 930 inline Method* method_at_vtable(int index);
910 klassItable* itable() const; // return new klassItable wrapper 931 klassItable* itable() const; // return new klassItable wrapper
911 Method* method_at_itable(Klass* holder, int index, TRAPS); 932 Method* method_at_itable(Klass* holder, int index, TRAPS);
912 933
934 #if INCLUDE_JVMTI
935 void adjust_default_methods(Method** old_methods, Method** new_methods,
936 int methods_length, bool* trace_name_printed);
937 #endif // INCLUDE_JVMTI
938
913 // Garbage collection 939 // Garbage collection
914 void oop_follow_contents(oop obj); 940 void oop_follow_contents(oop obj);
915 int oop_adjust_pointers(oop obj); 941 int oop_adjust_pointers(oop obj);
916 942
917 void clean_implementors_list(BoolObjectClosure* is_alive); 943 void clean_implementors_list(BoolObjectClosure* is_alive);
993 public: 1019 public:
994 // Lock for (1) initialization; (2) access to the ConstantPool of this class. 1020 // Lock for (1) initialization; (2) access to the ConstantPool of this class.
995 // Must be one per class and it has to be a VM internal object so java code 1021 // Must be one per class and it has to be a VM internal object so java code
996 // cannot lock it (like the mirror). 1022 // cannot lock it (like the mirror).
997 // It has to be an object not a Mutex because it's held through java calls. 1023 // It has to be an object not a Mutex because it's held through java calls.
998 volatile oop init_lock() const; 1024 oop init_lock() const;
999 private: 1025 private:
1026 void fence_and_clear_init_lock();
1000 1027
1001 // Static methods that are used to implement member methods where an exposed this pointer 1028 // Static methods that are used to implement member methods where an exposed this pointer
1002 // is needed due to possible GCs 1029 // is needed due to possible GCs
1003 static bool link_class_impl (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS); 1030 static bool link_class_impl (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS);
1004 static bool verify_code (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS); 1031 static bool verify_code (instanceKlassHandle this_oop, bool throw_verifyerror, TRAPS);