72 // This is used in iterators below.
73 class FieldClosure: public StackObj {
74 public:
75 virtual void do_field(fieldDescriptor* fd) = 0;
76 };
77
78 #ifndef PRODUCT
79 // Print fields.
80 // If "obj" argument to constructor is NULL, prints static fields, otherwise prints non-static fields.
81 class FieldPrinter: public FieldClosure {
82 oop _obj;
83 outputStream* _st;
84 public:
85 FieldPrinter(outputStream* st, oop obj = NULL) : _obj(obj), _st(st) {}
86 void do_field(fieldDescriptor* fd);
87 };
88 #endif // !PRODUCT
89
90 // ValueObjs embedded in klass. Describes where oops are located in instances of
91 // this klass.
92 class OopMapBlock VALUE_OBJ_CLASS_SPEC {
93 public:
94 // Byte offset of the first oop mapped by this block.
95 int offset() const { return _offset; }
96 void set_offset(int offset) { _offset = offset; }
97
98 // Number of oops in this block.
99 uint count() const { return _count; }
100 void set_count(uint count) { _count = count; }
101
102 // sizeof(OopMapBlock) in words.
103 static const int size_in_words() {
104 return align_up((int)sizeof(OopMapBlock), wordSize) >>
105 LogBytesPerWord;
106 }
107
108 private:
109 int _offset;
110 uint _count;
111 };
112
|
72 // This is used in iterators below.
73 class FieldClosure: public StackObj {
74 public:
75 virtual void do_field(fieldDescriptor* fd) = 0;
76 };
77
78 #ifndef PRODUCT
79 // Print fields.
80 // If "obj" argument to constructor is NULL, prints static fields, otherwise prints non-static fields.
81 class FieldPrinter: public FieldClosure {
82 oop _obj;
83 outputStream* _st;
84 public:
85 FieldPrinter(outputStream* st, oop obj = NULL) : _obj(obj), _st(st) {}
86 void do_field(fieldDescriptor* fd);
87 };
88 #endif // !PRODUCT
89
90 // ValueObjs embedded in klass. Describes where oops are located in instances of
91 // this klass.
92 class OopMapBlock {
93 public:
94 // Byte offset of the first oop mapped by this block.
95 int offset() const { return _offset; }
96 void set_offset(int offset) { _offset = offset; }
97
98 // Number of oops in this block.
99 uint count() const { return _count; }
100 void set_count(uint count) { _count = count; }
101
102 // sizeof(OopMapBlock) in words.
103 static const int size_in_words() {
104 return align_up((int)sizeof(OopMapBlock), wordSize) >>
105 LogBytesPerWord;
106 }
107
108 private:
109 int _offset;
110 uint _count;
111 };
112
|