src/share/vm/oops/klass.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/oops/klass.hpp Tue Dec 13 20:05:41 2011
--- new/src/share/vm/oops/klass.hpp Tue Dec 13 20:05:41 2011
*** 311,331 ****
--- 311,331 ----
}
// Can this klass be a primary super? False for interfaces and arrays of
// interfaces. False also for arrays or classes with long super chains.
bool can_be_primary_super() const {
! const juint secondary_offset = secondary_super_cache_offset_in_bytes() + sizeof(oopDesc);
! const juint secondary_offset = in_bytes(secondary_super_cache_offset());
return super_check_offset() != secondary_offset;
}
virtual bool can_be_primary_super_slow() const;
// Returns number of primary supers; may be a number in the inclusive range [0, primary_super_limit].
juint super_depth() const {
if (!can_be_primary_super()) {
return primary_super_limit();
} else {
! juint d = (super_check_offset() - (primary_supers_offset_in_bytes() + sizeof(oopDesc))) / sizeof(klassOop);
! juint d = (super_check_offset() - in_bytes(primary_supers_offset())) / sizeof(klassOop);
assert(d < primary_super_limit(), "oob");
assert(_primary_supers[d] == as_klassOop(), "proper init");
return d;
}
}
*** 371,389 ****
--- 371,389 ----
void set_alloc_count(juint n) { _alloc_count = n; }
virtual juint alloc_size() const = 0;
virtual void set_alloc_size(juint n) = 0;
// Compiler support
! static int super_offset_in_bytes() { return offset_of(Klass, _super); }
! static int super_check_offset_offset_in_bytes() { return offset_of(Klass, _super_check_offset); }
! static int primary_supers_offset_in_bytes(){ return offset_of(Klass, _primary_supers); }
! static int secondary_super_cache_offset_in_bytes() { return offset_of(Klass, _secondary_super_cache); }
! static int secondary_supers_offset_in_bytes() { return offset_of(Klass, _secondary_supers); }
! static int java_mirror_offset_in_bytes() { return offset_of(Klass, _java_mirror); }
! static int modifier_flags_offset_in_bytes(){ return offset_of(Klass, _modifier_flags); }
! static int layout_helper_offset_in_bytes() { return offset_of(Klass, _layout_helper); }
! static int access_flags_offset_in_bytes() { return offset_of(Klass, _access_flags); }
! static ByteSize super_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(Klass, _super)); }
! static ByteSize super_check_offset_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(Klass, _super_check_offset)); }
! static ByteSize primary_supers_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(Klass, _primary_supers)); }
! static ByteSize secondary_super_cache_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(Klass, _secondary_super_cache)); }
! static ByteSize secondary_supers_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(Klass, _secondary_supers)); }
! static ByteSize java_mirror_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(Klass, _java_mirror)); }
! static ByteSize modifier_flags_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(Klass, _modifier_flags)); }
! static ByteSize layout_helper_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(Klass, _layout_helper)); }
! static ByteSize access_flags_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(Klass, _access_flags)); }
// Unpacking layout_helper:
enum {
_lh_neutral_value = 0, // neutral non-array non-instance value
_lh_instance_slow_path_bit = 0x01,
*** 476,486 ****
--- 476,486 ----
bool is_subclass_of(klassOop k) const;
// subtype check: true if is_subclass_of, or if k is interface and receiver implements it
bool is_subtype_of(klassOop k) const {
juint off = k->klass_part()->super_check_offset();
klassOop sup = *(klassOop*)( (address)as_klassOop() + off );
! const juint secondary_offset = secondary_super_cache_offset_in_bytes() + sizeof(oopDesc);
! const juint secondary_offset = in_bytes(secondary_super_cache_offset());
if (sup == k) {
return true;
} else if (off != secondary_offset) {
return false;
} else {
*** 672,682 ****
--- 672,682 ----
// reason why it could not be done for arrayKlasses aside from
// wanting to reduce the initial scope of this optimization. There
// are potential problems in setting the bias pattern for
// JVM-internal oops.
inline void set_prototype_header(markOop header);
! static int prototype_header_offset_in_bytes() { return offset_of(Klass, _prototype_header); }
! static ByteSize prototype_header_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(Klass, _prototype_header)); }
int biased_lock_revocation_count() const { return (int) _biased_lock_revocation_count; }
// Atomically increments biased_lock_revocation_count and returns updated value
int atomic_incr_biased_lock_revocation_count();
void set_biased_lock_revocation_count(int val) { _biased_lock_revocation_count = (jint) val; }
src/share/vm/oops/klass.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File