< prev index next >

src/hotspot/share/classfile/systemDictionaryShared.cpp

Print this page
@@ -57,10 +57,11 @@
  #include "memory/metadataFactory.hpp"
  #include "memory/metaspaceClosure.hpp"
  #include "memory/oopFactory.hpp"
  #include "memory/resourceArea.hpp"
  #include "memory/universe.hpp"
+ #include "oops/compressedKlass.inline.hpp"
  #include "oops/instanceKlass.hpp"
  #include "oops/klass.inline.hpp"
  #include "oops/objArrayKlass.hpp"
  #include "oops/objArrayOop.inline.hpp"
  #include "oops/oop.inline.hpp"

@@ -419,10 +420,17 @@
          SharedClassLoadingMark slm(THREAD, k);
          k = find_or_define_instance_class(name, class_loader, k, CHECK_NULL);
        }
      }
    }
+ 
+ #ifdef ASSERT
+     if (UseCompressedClassPointers && k != nullptr) {
+       CompressedKlassPointers::check_valid_klass(k);
+     }
+ #endif
+ 
    return k;
  }
  
  class UnregisteredClassesTable : public ResourceHashtable<
    Symbol*, InstanceKlass*,

@@ -1328,11 +1336,15 @@
    const RunTimeClassInfo* record = find_record(&_static_archive._builtin_dictionary,
                                                 &_dynamic_archive._builtin_dictionary,
                                                 name);
    if (record != nullptr) {
      assert(!record->_klass->is_hidden(), "hidden class cannot be looked up by name");
-     assert(check_alignment(record->_klass), "Address not aligned");
+ #ifdef _LP64
+     if (UseCompressedClassPointers) {
+       DEBUG_ONLY(CompressedKlassPointers::check_valid_klass(record->_klass);)
+     }
+ #endif
      // We did not save the classfile data of the generated LambdaForm invoker classes,
      // so we cannot support CLFH for such classes.
      if (record->_klass->is_generated_shared_class() && JvmtiExport::should_post_class_file_load_hook()) {
         return nullptr;
      }
< prev index next >