< prev index next >

src/hotspot/share/cds/archiveBuilder.cpp

Print this page
*** 37,10 ***
--- 37,11 ---
  #include "logging/logStream.hpp"
  #include "memory/allStatic.hpp"
  #include "memory/memRegion.hpp"
  #include "memory/resourceArea.hpp"
  #include "oops/instanceKlass.hpp"
+ #include "oops/klass.inline.hpp"
  #include "oops/objArrayKlass.hpp"
  #include "oops/oopHandle.inline.hpp"
  #include "runtime/arguments.hpp"
  #include "runtime/globals_extension.hpp"
  #include "runtime/sharedRuntime.hpp"

*** 724,10 ***
--- 725,13 ---
      const char* type;
      const char* unlinked = "";
      const char* hidden = "";
      Klass* k = klasses()->at(i);
      k->remove_java_mirror();
+     Klass* requested_k = to_requested(k);
+     narrowKlass nk = CompressedKlassPointers::encode_not_null(requested_k, _requested_static_archive_bottom);
+     k->set_prototype_header(markWord::prototype() LP64_ONLY(.set_narrow_klass(nk)));
      if (k->is_objArray_klass()) {
        // InstanceKlass and TypeArrayKlass will in turn call remove_unshareable_info
        // on their array classes.
        num_obj_array_klasses ++;
        type = "array";

*** 810,10 ***
--- 814,13 ---
  void ArchiveBuilder::relocate_klass_ptr(oop o) {
    assert(DumpSharedSpaces, "sanity");
    Klass* k = get_relocated_klass(o->klass());
    Klass* requested_k = to_requested(k);
    narrowKlass nk = CompressedKlassPointers::encode_not_null(requested_k, _requested_static_archive_bottom);
+ #ifdef _LP64
+   o->set_mark(o->mark().set_narrow_klass(nk));
+ #endif
    o->set_narrow_klass(nk);
  }
  
  // RelocateBufferToRequested --- Relocate all the pointers in rw/ro,
  // so that the archive can be mapped to the "requested" location without runtime relocation.
< prev index next >