128 } _saved;
129
130 void set_tags(Array<u1>* tags) { _tags = tags; }
131 void tag_at_put(int which, jbyte t) { tags()->at_put(which, t); }
132 void release_tag_at_put(int which, jbyte t) { tags()->release_at_put(which, t); }
133
134 u1* tag_addr_at(int which) const { return tags()->adr_at(which); }
135
136 void set_operands(Array<u2>* operands) { _operands = operands; }
137
138 int flags() const { return _flags; }
139 void set_flags(int f) { _flags = f; }
140
141 private:
142 intptr_t* base() const { return (intptr_t*) (((char*) this) + sizeof(ConstantPool)); }
143
144 CPSlot slot_at(int which) const {
145 assert(is_within_bounds(which), "index out of bounds");
146 assert(!tag_at(which).is_unresolved_klass() && !tag_at(which).is_unresolved_klass_in_error(), "Corrupted constant pool");
147 // Uses volatile because the klass slot changes without a lock.
148 volatile intptr_t adr = OrderAccess::load_acquire(obj_at_addr_raw(which));
149 assert(adr != 0 || which == 0, "cp entry for klass should not be zero");
150 return CPSlot(adr);
151 }
152
153 void slot_at_put(int which, CPSlot s) const {
154 assert(is_within_bounds(which), "index out of bounds");
155 assert(s.value() != 0, "Caught something");
156 *(intptr_t*)&base()[which] = s.value();
157 }
158 intptr_t* obj_at_addr_raw(int which) const {
159 assert(is_within_bounds(which), "index out of bounds");
160 return (intptr_t*) &base()[which];
161 }
162
163 jint* int_at_addr(int which) const {
164 assert(is_within_bounds(which), "index out of bounds");
165 return (jint*) &base()[which];
166 }
167
168 jlong* long_at_addr(int which) const {
|
128 } _saved;
129
130 void set_tags(Array<u1>* tags) { _tags = tags; }
131 void tag_at_put(int which, jbyte t) { tags()->at_put(which, t); }
132 void release_tag_at_put(int which, jbyte t) { tags()->release_at_put(which, t); }
133
134 u1* tag_addr_at(int which) const { return tags()->adr_at(which); }
135
136 void set_operands(Array<u2>* operands) { _operands = operands; }
137
138 int flags() const { return _flags; }
139 void set_flags(int f) { _flags = f; }
140
141 private:
142 intptr_t* base() const { return (intptr_t*) (((char*) this) + sizeof(ConstantPool)); }
143
144 CPSlot slot_at(int which) const {
145 assert(is_within_bounds(which), "index out of bounds");
146 assert(!tag_at(which).is_unresolved_klass() && !tag_at(which).is_unresolved_klass_in_error(), "Corrupted constant pool");
147 // Uses volatile because the klass slot changes without a lock.
148 intptr_t adr = OrderAccess::load_acquire(obj_at_addr_raw(which));
149 assert(adr != 0 || which == 0, "cp entry for klass should not be zero");
150 return CPSlot(adr);
151 }
152
153 void slot_at_put(int which, CPSlot s) const {
154 assert(is_within_bounds(which), "index out of bounds");
155 assert(s.value() != 0, "Caught something");
156 *(intptr_t*)&base()[which] = s.value();
157 }
158 intptr_t* obj_at_addr_raw(int which) const {
159 assert(is_within_bounds(which), "index out of bounds");
160 return (intptr_t*) &base()[which];
161 }
162
163 jint* int_at_addr(int which) const {
164 assert(is_within_bounds(which), "index out of bounds");
165 return (jint*) &base()[which];
166 }
167
168 jlong* long_at_addr(int which) const {
|