equal
deleted
inserted
replaced
31 |
31 |
32 inline CPSlot ConstantPool::slot_at(int which) const { |
32 inline CPSlot ConstantPool::slot_at(int which) const { |
33 assert(is_within_bounds(which), "index out of bounds"); |
33 assert(is_within_bounds(which), "index out of bounds"); |
34 assert(!tag_at(which).is_unresolved_klass() && !tag_at(which).is_unresolved_klass_in_error(), "Corrupted constant pool"); |
34 assert(!tag_at(which).is_unresolved_klass() && !tag_at(which).is_unresolved_klass_in_error(), "Corrupted constant pool"); |
35 // Uses volatile because the klass slot changes without a lock. |
35 // Uses volatile because the klass slot changes without a lock. |
36 intptr_t adr = OrderAccess::load_acquire(obj_at_addr(which)); |
36 intptr_t adr = Atomic::load_acquire(obj_at_addr(which)); |
37 assert(adr != 0 || which == 0, "cp entry for klass should not be zero"); |
37 assert(adr != 0 || which == 0, "cp entry for klass should not be zero"); |
38 return CPSlot(adr); |
38 return CPSlot(adr); |
39 } |
39 } |
40 |
40 |
41 inline Klass* ConstantPool::resolved_klass_at(int which) const { // Used by Compiler |
41 inline Klass* ConstantPool::resolved_klass_at(int which) const { // Used by Compiler |
44 // behind our back, lest we later load stale values thru the oop. |
44 // behind our back, lest we later load stale values thru the oop. |
45 CPKlassSlot kslot = klass_slot_at(which); |
45 CPKlassSlot kslot = klass_slot_at(which); |
46 assert(tag_at(kslot.name_index()).is_symbol(), "sanity"); |
46 assert(tag_at(kslot.name_index()).is_symbol(), "sanity"); |
47 |
47 |
48 Klass** adr = resolved_klasses()->adr_at(kslot.resolved_klass_index()); |
48 Klass** adr = resolved_klasses()->adr_at(kslot.resolved_klass_index()); |
49 return OrderAccess::load_acquire(adr); |
49 return Atomic::load_acquire(adr); |
50 } |
50 } |
51 |
51 |
52 inline bool ConstantPool::is_pseudo_string_at(int which) { |
52 inline bool ConstantPool::is_pseudo_string_at(int which) { |
53 assert(tag_at(which).is_string(), "Corrupted constant pool"); |
53 assert(tag_at(which).is_string(), "Corrupted constant pool"); |
54 return slot_at(which).is_pseudo_string(); |
54 return slot_at(which).is_pseudo_string(); |