Mercurial > hg > truffle
diff src/share/vm/oops/klass.hpp @ 4970:33df1aeaebbf
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 27 Feb 2012 13:10:13 +0100 |
parents | 7d9469b37f1f 34e2e90e7182 |
children | 5e9f38419819 |
line wrap: on
line diff
--- a/src/share/vm/oops/klass.hpp Fri Feb 24 18:30:42 2012 -0800 +++ b/src/share/vm/oops/klass.hpp Mon Feb 27 13:10:13 2012 +0100 @@ -33,6 +33,7 @@ #include "oops/klassPS.hpp" #include "oops/oop.hpp" #include "runtime/orderAccess.hpp" +#include "trace/traceMacros.hpp" #include "utilities/accessFlags.hpp" #ifndef SERIALGC #include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp" @@ -80,6 +81,7 @@ // [last_biased_lock_bulk_revocation_time] (64 bits) // [prototype_header] // [biased_lock_revocation_count] +// [trace_id] // Forward declarations. @@ -265,6 +267,7 @@ markOop _prototype_header; // Used when biased locking is both enabled and disabled for this type jint _biased_lock_revocation_count; + TRACE_DEFINE_KLASS_TRACE_ID; public: // returns the enclosing klassOop @@ -315,7 +318,7 @@ // 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; @@ -325,7 +328,7 @@ 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; @@ -380,16 +383,16 @@ 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 graal_mirror_offset_in_bytes() { return offset_of(Klass, _graal_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)); } + static ByteSize graal_mirror_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(Klass, _graal_mirror)); } // Unpacking layout_helper: enum { @@ -486,7 +489,7 @@ 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) { @@ -682,7 +685,7 @@ // 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 @@ -691,6 +694,7 @@ jlong last_biased_lock_bulk_revocation_time() { return _last_biased_lock_bulk_revocation_time; } void set_last_biased_lock_bulk_revocation_time(jlong cur_time) { _last_biased_lock_bulk_revocation_time = cur_time; } + TRACE_DEFINE_KLASS_METHODS; // garbage collection support virtual void follow_weak_klass_links(