Mercurial > hg > truffle
comparison src/share/vm/oops/instanceKlass.hpp @ 12067:e22ee8e7ae62
8021948: Change InstanceKlass::_source_file_name and _generic_signature from Symbol* to constant pool indexes.
Summary: Change InstanceKlass::_source_file_name and _generic_signature to u2 fields.
Reviewed-by: coleenp, iklam
author | jiangli |
---|---|
date | Mon, 19 Aug 2013 14:59:54 -0400 |
parents | 825e6cb66923 |
children | b2e698d2276c 4f9a42c33738 |
comparison
equal
deleted
inserted
replaced
12061:e5003079dfa5 | 12067:e22ee8e7ae62 |
---|---|
199 // number_of_inner_classes * 4. If the class has both InnerClasses | 199 // number_of_inner_classes * 4. If the class has both InnerClasses |
200 // and EnclosingMethod attributes the _inner_classes array length is | 200 // and EnclosingMethod attributes the _inner_classes array length is |
201 // number_of_inner_classes * 4 + enclosing_method_attribute_size. | 201 // number_of_inner_classes * 4 + enclosing_method_attribute_size. |
202 Array<jushort>* _inner_classes; | 202 Array<jushort>* _inner_classes; |
203 | 203 |
204 // Name of source file containing this klass, NULL if not specified. | |
205 Symbol* _source_file_name; | |
206 // the source debug extension for this klass, NULL if not specified. | 204 // the source debug extension for this klass, NULL if not specified. |
207 // Specified as UTF-8 string without terminating zero byte in the classfile, | 205 // Specified as UTF-8 string without terminating zero byte in the classfile, |
208 // it is stored in the instanceklass as a NULL-terminated UTF-8 string | 206 // it is stored in the instanceklass as a NULL-terminated UTF-8 string |
209 char* _source_debug_extension; | 207 char* _source_debug_extension; |
210 // Generic signature, or null if none. | |
211 Symbol* _generic_signature; | |
212 // Array name derived from this class which needs unreferencing | 208 // Array name derived from this class which needs unreferencing |
213 // if this class is unloaded. | 209 // if this class is unloaded. |
214 Symbol* _array_name; | 210 Symbol* _array_name; |
215 | 211 |
216 // Number of heapOopSize words used by non-static fields in this klass | 212 // Number of heapOopSize words used by non-static fields in this klass |
217 // (including inherited fields but after header_size()). | 213 // (including inherited fields but after header_size()). |
218 int _nonstatic_field_size; | 214 int _nonstatic_field_size; |
219 int _static_field_size; // number words used by static fields (oop and non-oop) in this klass | 215 int _static_field_size; // number words used by static fields (oop and non-oop) in this klass |
216 // Constant pool index to the utf8 entry of the Generic signature, | |
217 // or 0 if none. | |
218 u2 _generic_signature_index; | |
219 // Constant pool index to the utf8 entry for the name of source file | |
220 // containing this klass, 0 if not specified. | |
221 u2 _source_file_name_index; | |
220 u2 _static_oop_field_count;// number of static oop fields in this klass | 222 u2 _static_oop_field_count;// number of static oop fields in this klass |
221 u2 _java_fields_count; // The number of declared Java fields | 223 u2 _java_fields_count; // The number of declared Java fields |
222 int _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks | 224 int _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks |
223 | 225 |
224 // _is_marked_dependent can be set concurrently, thus cannot be part of the | 226 // _is_marked_dependent can be set concurrently, thus cannot be part of the |
568 _misc_flags &= ~_misc_is_contended; | 570 _misc_flags &= ~_misc_is_contended; |
569 } | 571 } |
570 } | 572 } |
571 | 573 |
572 // source file name | 574 // source file name |
573 Symbol* source_file_name() const { return _source_file_name; } | 575 Symbol* source_file_name() const { |
574 void set_source_file_name(Symbol* n); | 576 return (_source_file_name_index == 0) ? |
577 (Symbol*)NULL : _constants->symbol_at(_source_file_name_index); | |
578 } | |
579 u2 source_file_name_index() const { | |
580 return _source_file_name_index; | |
581 } | |
582 void set_source_file_name_index(u2 sourcefile_index) { | |
583 _source_file_name_index = sourcefile_index; | |
584 } | |
575 | 585 |
576 // minor and major version numbers of class file | 586 // minor and major version numbers of class file |
577 u2 minor_version() const { return _minor_version; } | 587 u2 minor_version() const { return _minor_version; } |
578 void set_minor_version(u2 minor_version) { _minor_version = minor_version; } | 588 void set_minor_version(u2 minor_version) { _minor_version = minor_version; } |
579 u2 major_version() const { return _major_version; } | 589 u2 major_version() const { return _major_version; } |
646 // for adding methods, ConstMethod::UNSET_IDNUM means no more ids available | 656 // for adding methods, ConstMethod::UNSET_IDNUM means no more ids available |
647 inline u2 next_method_idnum(); | 657 inline u2 next_method_idnum(); |
648 void set_initial_method_idnum(u2 value) { _idnum_allocated_count = value; } | 658 void set_initial_method_idnum(u2 value) { _idnum_allocated_count = value; } |
649 | 659 |
650 // generics support | 660 // generics support |
651 Symbol* generic_signature() const { return _generic_signature; } | 661 Symbol* generic_signature() const { |
652 void set_generic_signature(Symbol* sig) { _generic_signature = sig; } | 662 return (_generic_signature_index == 0) ? |
663 (Symbol*)NULL : _constants->symbol_at(_generic_signature_index); | |
664 } | |
665 u2 generic_signature_index() const { | |
666 return _generic_signature_index; | |
667 } | |
668 void set_generic_signature_index(u2 sig_index) { | |
669 _generic_signature_index = sig_index; | |
670 } | |
653 | 671 |
654 u2 enclosing_method_data(int offset); | 672 u2 enclosing_method_data(int offset); |
655 u2 enclosing_method_class_index() { | 673 u2 enclosing_method_class_index() { |
656 return enclosing_method_data(enclosing_method_class_index_offset); | 674 return enclosing_method_data(enclosing_method_class_index_offset); |
657 } | 675 } |