123 void set_flags(int f) { _flags = f; } |
123 void set_flags(int f) { _flags = f; } |
124 |
124 |
125 private: |
125 private: |
126 intptr_t* base() const { return (intptr_t*) (((char*) this) + sizeof(ConstantPool)); } |
126 intptr_t* base() const { return (intptr_t*) (((char*) this) + sizeof(ConstantPool)); } |
127 |
127 |
128 CPSlot slot_at(int which) { |
128 CPSlot slot_at(int which) const { |
129 assert(is_within_bounds(which), "index out of bounds"); |
129 assert(is_within_bounds(which), "index out of bounds"); |
130 // Uses volatile because the klass slot changes without a lock. |
130 // Uses volatile because the klass slot changes without a lock. |
131 volatile intptr_t adr = (intptr_t)OrderAccess::load_ptr_acquire(obj_at_addr_raw(which)); |
131 volatile intptr_t adr = (intptr_t)OrderAccess::load_ptr_acquire(obj_at_addr_raw(which)); |
132 assert(adr != 0 || which == 0, "cp entry for klass should not be zero"); |
132 assert(adr != 0 || which == 0, "cp entry for klass should not be zero"); |
133 return CPSlot(adr); |
133 return CPSlot(adr); |
351 Klass* klass_at(int which, TRAPS) { |
351 Klass* klass_at(int which, TRAPS) { |
352 constantPoolHandle h_this(THREAD, this); |
352 constantPoolHandle h_this(THREAD, this); |
353 return klass_at_impl(h_this, which, CHECK_NULL); |
353 return klass_at_impl(h_this, which, CHECK_NULL); |
354 } |
354 } |
355 |
355 |
356 Symbol* klass_name_at(int which); // Returns the name, w/o resolving. |
356 Symbol* klass_name_at(int which) const; // Returns the name, w/o resolving. |
357 |
357 |
358 Klass* resolved_klass_at(int which) const { // Used by Compiler |
358 Klass* resolved_klass_at(int which) const { // Used by Compiler |
359 guarantee(tag_at(which).is_klass(), "Corrupted constant pool"); |
359 guarantee(tag_at(which).is_klass(), "Corrupted constant pool"); |
360 // Must do an acquire here in case another thread resolved the klass |
360 // Must do an acquire here in case another thread resolved the klass |
361 // behind our back, lest we later load stale values thru the oop. |
361 // behind our back, lest we later load stale values thru the oop. |