Mercurial > hg > truffle
comparison src/share/vm/oops/instanceKlass.hpp @ 974:26b774d693aa
Merge
author | acorn |
---|---|
date | Wed, 16 Sep 2009 09:10:57 -0400 |
parents | ad6585fd4087 9eebd3ac74cf |
children | 83c29a26f67c |
comparison
equal
deleted
inserted
replaced
973:ad6585fd4087 | 974:26b774d693aa |
---|---|
69 // where oops are located in instances of this klass. | 69 // where oops are located in instances of this klass. |
70 | 70 |
71 | 71 |
72 // forward declaration for class -- see below for definition | 72 // forward declaration for class -- see below for definition |
73 class SuperTypeClosure; | 73 class SuperTypeClosure; |
74 class OopMapBlock; | |
75 class JNIid; | 74 class JNIid; |
76 class jniIdMapBase; | 75 class jniIdMapBase; |
77 class BreakpointInfo; | 76 class BreakpointInfo; |
78 class fieldDescriptor; | 77 class fieldDescriptor; |
79 class DepChange; | 78 class DepChange; |
96 public: | 95 public: |
97 FieldPrinter(outputStream* st, oop obj = NULL) : _obj(obj), _st(st) {} | 96 FieldPrinter(outputStream* st, oop obj = NULL) : _obj(obj), _st(st) {} |
98 void do_field(fieldDescriptor* fd); | 97 void do_field(fieldDescriptor* fd); |
99 }; | 98 }; |
100 #endif // !PRODUCT | 99 #endif // !PRODUCT |
100 | |
101 // ValueObjs embedded in klass. Describes where oops are located in instances of | |
102 // this klass. | |
103 class OopMapBlock VALUE_OBJ_CLASS_SPEC { | |
104 public: | |
105 // Byte offset of the first oop mapped by this block. | |
106 int offset() const { return _offset; } | |
107 void set_offset(int offset) { _offset = offset; } | |
108 | |
109 // Number of oops in this block. | |
110 uint count() const { return _count; } | |
111 void set_count(uint count) { _count = count; } | |
112 | |
113 // sizeof(OopMapBlock) in HeapWords. | |
114 static const int size_in_words() { | |
115 return align_size_up(int(sizeof(OopMapBlock)), HeapWordSize) >> | |
116 LogHeapWordSize; | |
117 } | |
118 | |
119 private: | |
120 int _offset; | |
121 uint _count; | |
122 }; | |
101 | 123 |
102 class instanceKlass: public Klass { | 124 class instanceKlass: public Klass { |
103 friend class VMStructs; | 125 friend class VMStructs; |
104 public: | 126 public: |
105 // See "The Java Virtual Machine Specification" section 2.16.2-5 for a detailed description | 127 // See "The Java Virtual Machine Specification" section 2.16.2-5 for a detailed description |
198 // Number of heapOopSize words used by non-static fields in this klass | 220 // Number of heapOopSize words used by non-static fields in this klass |
199 // (including inherited fields but after header_size()). | 221 // (including inherited fields but after header_size()). |
200 int _nonstatic_field_size; | 222 int _nonstatic_field_size; |
201 int _static_field_size; // number words used by static fields (oop and non-oop) in this klass | 223 int _static_field_size; // number words used by static fields (oop and non-oop) in this klass |
202 int _static_oop_field_size;// number of static oop fields in this klass | 224 int _static_oop_field_size;// number of static oop fields in this klass |
203 int _nonstatic_oop_map_size;// number of nonstatic oop-map blocks allocated at end of this klass | 225 int _nonstatic_oop_map_size;// size in words of nonstatic oop map blocks |
204 int _class_flags; // internal class state flags | 226 int _class_flags; // internal class state flags |
205 u2 _minor_version; // minor version number of class file | 227 u2 _minor_version; // minor version number of class file |
206 u2 _major_version; // major version number of class file | 228 u2 _major_version; // major version number of class file |
207 ClassState _init_state; // state of class | 229 ClassState _init_state; // state of class |
208 Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization) | 230 Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization) |
434 // source debug extension | 456 // source debug extension |
435 symbolOop source_debug_extension() const { return _source_debug_extension; } | 457 symbolOop source_debug_extension() const { return _source_debug_extension; } |
436 void set_source_debug_extension(symbolOop n){ oop_store_without_check((oop*) &_source_debug_extension, (oop) n); } | 458 void set_source_debug_extension(symbolOop n){ oop_store_without_check((oop*) &_source_debug_extension, (oop) n); } |
437 | 459 |
438 // nonstatic oop-map blocks | 460 // nonstatic oop-map blocks |
439 int nonstatic_oop_map_size() const { return _nonstatic_oop_map_size; } | 461 static int nonstatic_oop_map_size(unsigned int oop_map_count) { |
440 void set_nonstatic_oop_map_size(int size) { _nonstatic_oop_map_size = size; } | 462 return oop_map_count * OopMapBlock::size_in_words(); |
463 } | |
464 unsigned int nonstatic_oop_map_count() const { | |
465 return _nonstatic_oop_map_size / OopMapBlock::size_in_words(); | |
466 } | |
467 int nonstatic_oop_map_size() const { return _nonstatic_oop_map_size; } | |
468 void set_nonstatic_oop_map_size(int words) { | |
469 _nonstatic_oop_map_size = words; | |
470 } | |
441 | 471 |
442 // RedefineClasses() support for previous versions: | 472 // RedefineClasses() support for previous versions: |
443 void add_previous_version(instanceKlassHandle ikh, BitMap *emcp_methods, | 473 void add_previous_version(instanceKlassHandle ikh, BitMap *emcp_methods, |
444 int emcp_method_count); | 474 int emcp_method_count); |
445 bool has_previous_version() const; | 475 bool has_previous_version() const; |
850 return _idnum_allocated_count++; | 880 return _idnum_allocated_count++; |
851 } | 881 } |
852 } | 882 } |
853 | 883 |
854 | 884 |
855 // ValueObjs embedded in klass. Describes where oops are located in instances of this klass. | |
856 | |
857 class OopMapBlock VALUE_OBJ_CLASS_SPEC { | |
858 private: | |
859 jushort _offset; // Offset of first oop in oop-map block | |
860 jushort _length; // Length of oop-map block | |
861 public: | |
862 // Accessors | |
863 jushort offset() const { return _offset; } | |
864 void set_offset(jushort offset) { _offset = offset; } | |
865 | |
866 jushort length() const { return _length; } | |
867 void set_length(jushort length) { _length = length; } | |
868 }; | |
869 | |
870 /* JNIid class for jfieldIDs only */ | 885 /* JNIid class for jfieldIDs only */ |
871 class JNIid: public CHeapObj { | 886 class JNIid: public CHeapObj { |
872 friend class VMStructs; | 887 friend class VMStructs; |
873 private: | 888 private: |
874 klassOop _holder; | 889 klassOop _holder; |