< prev index next >

src/share/vm/classfile/javaClasses.cpp

Print this page




3798 oop java_util_concurrent_locks_AbstractOwnableSynchronizer::get_owner_threadObj(oop obj) {
3799   assert(_owner_offset != 0, "Must be initialized");
3800   return obj->obj_field(_owner_offset);
3801 }
3802 
3803 // Compute hard-coded offsets
3804 // Invoked before SystemDictionary::initialize, so pre-loaded classes
3805 // are not available to determine the offset_of_static_fields.
3806 void JavaClasses::compute_hard_coded_offsets() {
3807   const int x = heapOopSize;
3808   const int header = instanceOopDesc::base_offset_in_bytes();
3809 
3810   // Throwable Class
3811   java_lang_Throwable::backtrace_offset  = java_lang_Throwable::hc_backtrace_offset  * x + header;
3812   java_lang_Throwable::detailMessage_offset = java_lang_Throwable::hc_detailMessage_offset * x + header;
3813   java_lang_Throwable::stackTrace_offset = java_lang_Throwable::hc_stackTrace_offset * x + header;
3814   java_lang_Throwable::static_unassigned_stacktrace_offset = java_lang_Throwable::hc_static_unassigned_stacktrace_offset *  x;
3815 
3816   // java_lang_boxing_object
3817   java_lang_boxing_object::value_offset = java_lang_boxing_object::hc_value_offset + header;
3818   java_lang_boxing_object::long_value_offset = align_size_up((java_lang_boxing_object::hc_value_offset + header), BytesPerLong);
3819 
3820   // java_lang_ref_Reference:
3821   java_lang_ref_Reference::referent_offset = java_lang_ref_Reference::hc_referent_offset * x + header;
3822   java_lang_ref_Reference::queue_offset = java_lang_ref_Reference::hc_queue_offset * x + header;
3823   java_lang_ref_Reference::next_offset  = java_lang_ref_Reference::hc_next_offset * x + header;
3824   java_lang_ref_Reference::discovered_offset  = java_lang_ref_Reference::hc_discovered_offset * x + header;
3825   // Artificial fields for java_lang_ref_Reference
3826   // The first field is for the discovered field added in 1.4
3827   java_lang_ref_Reference::number_of_fake_oop_fields = 1;
3828 
3829   // java_lang_ref_SoftReference Class
3830   java_lang_ref_SoftReference::timestamp_offset = align_size_up((java_lang_ref_SoftReference::hc_timestamp_offset * x + header), BytesPerLong);
3831   // Don't multiply static fields because they are always in wordSize units
3832   java_lang_ref_SoftReference::static_clock_offset = java_lang_ref_SoftReference::hc_static_clock_offset * x;
3833 
3834   // java_lang_ClassLoader
3835   java_lang_ClassLoader::parent_offset = java_lang_ClassLoader::hc_parent_offset * x + header;
3836 
3837   // java_lang_System
3838   java_lang_System::static_in_offset  = java_lang_System::hc_static_in_offset  * x;
3839   java_lang_System::static_out_offset = java_lang_System::hc_static_out_offset * x;
3840   java_lang_System::static_err_offset = java_lang_System::hc_static_err_offset * x;
3841   java_lang_System::static_security_offset = java_lang_System::hc_static_security_offset * x;
3842 
3843   // java_lang_StackTraceElement
3844   java_lang_StackTraceElement::declaringClassObject_offset = java_lang_StackTraceElement::hc_declaringClassObject_offset * x + header;
3845   java_lang_StackTraceElement::classLoaderName_offset = java_lang_StackTraceElement::hc_classLoaderName_offset * x + header;
3846   java_lang_StackTraceElement::moduleName_offset = java_lang_StackTraceElement::hc_moduleName_offset * x + header;
3847   java_lang_StackTraceElement::moduleVersion_offset = java_lang_StackTraceElement::hc_moduleVersion_offset * x + header;
3848   java_lang_StackTraceElement::declaringClass_offset = java_lang_StackTraceElement::hc_declaringClass_offset  * x + header;
3849   java_lang_StackTraceElement::methodName_offset = java_lang_StackTraceElement::hc_methodName_offset * x + header;
3850   java_lang_StackTraceElement::fileName_offset   = java_lang_StackTraceElement::hc_fileName_offset   * x + header;




3798 oop java_util_concurrent_locks_AbstractOwnableSynchronizer::get_owner_threadObj(oop obj) {
3799   assert(_owner_offset != 0, "Must be initialized");
3800   return obj->obj_field(_owner_offset);
3801 }
3802 
3803 // Compute hard-coded offsets
3804 // Invoked before SystemDictionary::initialize, so pre-loaded classes
3805 // are not available to determine the offset_of_static_fields.
3806 void JavaClasses::compute_hard_coded_offsets() {
3807   const int x = heapOopSize;
3808   const int header = instanceOopDesc::base_offset_in_bytes();
3809 
3810   // Throwable Class
3811   java_lang_Throwable::backtrace_offset  = java_lang_Throwable::hc_backtrace_offset  * x + header;
3812   java_lang_Throwable::detailMessage_offset = java_lang_Throwable::hc_detailMessage_offset * x + header;
3813   java_lang_Throwable::stackTrace_offset = java_lang_Throwable::hc_stackTrace_offset * x + header;
3814   java_lang_Throwable::static_unassigned_stacktrace_offset = java_lang_Throwable::hc_static_unassigned_stacktrace_offset *  x;
3815 
3816   // java_lang_boxing_object
3817   java_lang_boxing_object::value_offset = java_lang_boxing_object::hc_value_offset + header;
3818   java_lang_boxing_object::long_value_offset = align_up((java_lang_boxing_object::hc_value_offset + header), BytesPerLong);
3819 
3820   // java_lang_ref_Reference:
3821   java_lang_ref_Reference::referent_offset = java_lang_ref_Reference::hc_referent_offset * x + header;
3822   java_lang_ref_Reference::queue_offset = java_lang_ref_Reference::hc_queue_offset * x + header;
3823   java_lang_ref_Reference::next_offset  = java_lang_ref_Reference::hc_next_offset * x + header;
3824   java_lang_ref_Reference::discovered_offset  = java_lang_ref_Reference::hc_discovered_offset * x + header;
3825   // Artificial fields for java_lang_ref_Reference
3826   // The first field is for the discovered field added in 1.4
3827   java_lang_ref_Reference::number_of_fake_oop_fields = 1;
3828 
3829   // java_lang_ref_SoftReference Class
3830   java_lang_ref_SoftReference::timestamp_offset = align_up((java_lang_ref_SoftReference::hc_timestamp_offset * x + header), BytesPerLong);
3831   // Don't multiply static fields because they are always in wordSize units
3832   java_lang_ref_SoftReference::static_clock_offset = java_lang_ref_SoftReference::hc_static_clock_offset * x;
3833 
3834   // java_lang_ClassLoader
3835   java_lang_ClassLoader::parent_offset = java_lang_ClassLoader::hc_parent_offset * x + header;
3836 
3837   // java_lang_System
3838   java_lang_System::static_in_offset  = java_lang_System::hc_static_in_offset  * x;
3839   java_lang_System::static_out_offset = java_lang_System::hc_static_out_offset * x;
3840   java_lang_System::static_err_offset = java_lang_System::hc_static_err_offset * x;
3841   java_lang_System::static_security_offset = java_lang_System::hc_static_security_offset * x;
3842 
3843   // java_lang_StackTraceElement
3844   java_lang_StackTraceElement::declaringClassObject_offset = java_lang_StackTraceElement::hc_declaringClassObject_offset * x + header;
3845   java_lang_StackTraceElement::classLoaderName_offset = java_lang_StackTraceElement::hc_classLoaderName_offset * x + header;
3846   java_lang_StackTraceElement::moduleName_offset = java_lang_StackTraceElement::hc_moduleName_offset * x + header;
3847   java_lang_StackTraceElement::moduleVersion_offset = java_lang_StackTraceElement::hc_moduleVersion_offset * x + header;
3848   java_lang_StackTraceElement::declaringClass_offset = java_lang_StackTraceElement::hc_declaringClass_offset  * x + header;
3849   java_lang_StackTraceElement::methodName_offset = java_lang_StackTraceElement::hc_methodName_offset * x + header;
3850   java_lang_StackTraceElement::fileName_offset   = java_lang_StackTraceElement::hc_fileName_offset   * x + header;


< prev index next >