< prev index next >

src/hotspot/share/classfile/javaClasses.cpp

Print this page

        

@@ -196,11 +196,11 @@
 }
 
 #if INCLUDE_CDS
 void java_lang_String::serialize_offsets(SerializeClosure* f) {
   STRING_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
-  f->do_bool(&initialized);
+  f->do_u4((u4*)&initialized);
 }
 #endif
 
 class CompactStringsFixup : public FieldClosure {
 private:

@@ -1564,11 +1564,11 @@
   CLASS_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
 }
 
 #if INCLUDE_CDS
 void java_lang_Class::serialize_offsets(SerializeClosure* f) {
-  f->do_bool(&offsets_computed);
+  f->do_u4((u4*)&offsets_computed);
   f->do_u4((u4*)&_init_lock_offset);
 
   CLASS_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
 
   CLASS_INJECTED_FIELDS(INJECTED_FIELD_SERIALIZE_OFFSET);

@@ -4153,18 +4153,10 @@
 int java_lang_AssertionStatusDirectives::deflt_offset;
 int java_nio_Buffer::_limit_offset;
 int java_util_concurrent_locks_AbstractOwnableSynchronizer::_owner_offset;
 int reflect_ConstantPool::_oop_offset;
 int reflect_UnsafeStaticFieldAccessorImpl::_base_offset;
-int java_lang_Integer_IntegerCache::_static_cache_offset;
-int java_lang_Long_LongCache::_static_cache_offset;
-int java_lang_Character_CharacterCache::_static_cache_offset;
-int java_lang_Short_ShortCache::_static_cache_offset;
-int java_lang_Byte_ByteCache::_static_cache_offset;
-int java_lang_Boolean::_static_TRUE_offset;
-int java_lang_Boolean::_static_FALSE_offset;
-
 
 
 #define STACKTRACEELEMENT_FIELDS_DO(macro) \
   macro(declaringClassObject_offset,  k, "declaringClassObject", class_signature, false); \
   macro(classLoaderName_offset, k, "classLoaderName", string_signature, false); \

@@ -4320,196 +4312,10 @@
 void java_util_concurrent_locks_AbstractOwnableSynchronizer::serialize_offsets(SerializeClosure* f) {
   AOS_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
 }
 #endif
 
-#define INTEGER_CACHE_FIELDS_DO(macro) \
-  macro(_static_cache_offset, k, "cache", java_lang_Integer_array_signature, true)
-
-void java_lang_Integer_IntegerCache::compute_offsets(InstanceKlass *k) {
-  guarantee(k != NULL && k->is_initialized(), "must be loaded and initialized");
-  INTEGER_CACHE_FIELDS_DO(FIELD_COMPUTE_OFFSET);
-}
-
-objArrayOop java_lang_Integer_IntegerCache::cache(InstanceKlass *ik) {
-  oop base = ik->static_field_base_raw();
-  return objArrayOop(base->obj_field(_static_cache_offset));
-}
-
-Symbol* java_lang_Integer_IntegerCache::symbol() {
-  return vmSymbols::java_lang_Integer_IntegerCache();
-}
-
-#if INCLUDE_CDS
-void java_lang_Integer_IntegerCache::serialize_offsets(SerializeClosure* f) {
-  INTEGER_CACHE_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
-}
-#endif
-#undef INTEGER_CACHE_FIELDS_DO
-
-jint java_lang_Integer::value(oop obj) {
-   jvalue v;
-   java_lang_boxing_object::get_value(obj, &v);
-   return v.i;
-}
-
-#define LONG_CACHE_FIELDS_DO(macro) \
-  macro(_static_cache_offset, k, "cache", java_lang_Long_array_signature, true)
-
-void java_lang_Long_LongCache::compute_offsets(InstanceKlass *k) {
-  guarantee(k != NULL && k->is_initialized(), "must be loaded and initialized");
-  LONG_CACHE_FIELDS_DO(FIELD_COMPUTE_OFFSET);
-}
-
-objArrayOop java_lang_Long_LongCache::cache(InstanceKlass *ik) {
-  oop base = ik->static_field_base_raw();
-  return objArrayOop(base->obj_field(_static_cache_offset));
-}
-
-Symbol* java_lang_Long_LongCache::symbol() {
-  return vmSymbols::java_lang_Long_LongCache();
-}
-
-#if INCLUDE_CDS
-void java_lang_Long_LongCache::serialize_offsets(SerializeClosure* f) {
-  LONG_CACHE_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
-}
-#endif
-#undef LONG_CACHE_FIELDS_DO
-
-jlong java_lang_Long::value(oop obj) {
-   jvalue v;
-   java_lang_boxing_object::get_value(obj, &v);
-   return v.j;
-}
-
-#define CHARACTER_CACHE_FIELDS_DO(macro) \
-  macro(_static_cache_offset, k, "cache", java_lang_Character_array_signature, true)
-
-void java_lang_Character_CharacterCache::compute_offsets(InstanceKlass *k) {
-  guarantee(k != NULL && k->is_initialized(), "must be loaded and initialized");
-  CHARACTER_CACHE_FIELDS_DO(FIELD_COMPUTE_OFFSET);
-}
-
-objArrayOop java_lang_Character_CharacterCache::cache(InstanceKlass *ik) {
-  oop base = ik->static_field_base_raw();
-  return objArrayOop(base->obj_field(_static_cache_offset));
-}
-
-Symbol* java_lang_Character_CharacterCache::symbol() {
-  return vmSymbols::java_lang_Character_CharacterCache();
-}
-
-#if INCLUDE_CDS
-void java_lang_Character_CharacterCache::serialize_offsets(SerializeClosure* f) {
-  CHARACTER_CACHE_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
-}
-#endif
-#undef CHARACTER_CACHE_FIELDS_DO
-
-jchar java_lang_Character::value(oop obj) {
-   jvalue v;
-   java_lang_boxing_object::get_value(obj, &v);
-   return v.c;
-}
-
-#define SHORT_CACHE_FIELDS_DO(macro) \
-  macro(_static_cache_offset, k, "cache", java_lang_Short_array_signature, true)
-
-void java_lang_Short_ShortCache::compute_offsets(InstanceKlass *k) {
-  guarantee(k != NULL && k->is_initialized(), "must be loaded and initialized");
-  SHORT_CACHE_FIELDS_DO(FIELD_COMPUTE_OFFSET);
-}
-
-objArrayOop java_lang_Short_ShortCache::cache(InstanceKlass *ik) {
-  oop base = ik->static_field_base_raw();
-  return objArrayOop(base->obj_field(_static_cache_offset));
-}
-
-Symbol* java_lang_Short_ShortCache::symbol() {
-  return vmSymbols::java_lang_Short_ShortCache();
-}
-
-#if INCLUDE_CDS
-void java_lang_Short_ShortCache::serialize_offsets(SerializeClosure* f) {
-  SHORT_CACHE_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
-}
-#endif
-#undef SHORT_CACHE_FIELDS_DO
-
-jshort java_lang_Short::value(oop obj) {
-   jvalue v;
-   java_lang_boxing_object::get_value(obj, &v);
-   return v.s;
-}
-
-#define BYTE_CACHE_FIELDS_DO(macro) \
-  macro(_static_cache_offset, k, "cache", java_lang_Byte_array_signature, true)
-
-void java_lang_Byte_ByteCache::compute_offsets(InstanceKlass *k) {
-  guarantee(k != NULL && k->is_initialized(), "must be loaded and initialized");
-  BYTE_CACHE_FIELDS_DO(FIELD_COMPUTE_OFFSET);
-}
-
-objArrayOop java_lang_Byte_ByteCache::cache(InstanceKlass *ik) {
-  oop base = ik->static_field_base_raw();
-  return objArrayOop(base->obj_field(_static_cache_offset));
-}
-
-Symbol* java_lang_Byte_ByteCache::symbol() {
-  return vmSymbols::java_lang_Byte_ByteCache();
-}
-
-#if INCLUDE_CDS
-void java_lang_Byte_ByteCache::serialize_offsets(SerializeClosure* f) {
-  BYTE_CACHE_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
-}
-#endif
-#undef BYTE_CACHE_FIELDS_DO
-
-jbyte java_lang_Byte::value(oop obj) {
-   jvalue v;
-   java_lang_boxing_object::get_value(obj, &v);
-   return v.b;
-}
-#define BOOLEAN_FIELDS_DO(macro) \
-  macro(_static_TRUE_offset, k, "TRUE", java_lang_Boolean_signature, true); \
-  macro(_static_FALSE_offset, k, "FALSE", java_lang_Boolean_signature, true)
-
-
-void java_lang_Boolean::compute_offsets(InstanceKlass *k) {
-  guarantee(k != NULL && k->is_initialized(), "must be loaded and initialized");
-  BOOLEAN_FIELDS_DO(FIELD_COMPUTE_OFFSET);
-}
-
-oop java_lang_Boolean::get_TRUE(InstanceKlass *ik) {
-  oop base = ik->static_field_base_raw();
-  return base->obj_field(_static_TRUE_offset);
-}
-
-oop java_lang_Boolean::get_FALSE(InstanceKlass *ik) {
-  oop base = ik->static_field_base_raw();
-  return base->obj_field(_static_FALSE_offset);
-}
-
-Symbol* java_lang_Boolean::symbol() {
-  return vmSymbols::java_lang_Boolean();
-}
-
-#if INCLUDE_CDS
-void java_lang_Boolean::serialize_offsets(SerializeClosure* f) {
-  BOOLEAN_FIELDS_DO(FIELD_SERIALIZE_OFFSET);
-}
-#endif
-#undef BOOLEAN_CACHE_FIELDS_DO
-
-jboolean java_lang_Boolean::value(oop obj) {
-   jvalue v;
-   java_lang_boxing_object::get_value(obj, &v);
-   return v.z;
-}
-
 static int member_offset(int hardcoded_offset) {
   return (hardcoded_offset * heapOopSize) + instanceOopDesc::base_offset_in_bytes();
 }
 
 // Compute hard-coded offsets
< prev index next >