< prev index next >

src/hotspot/share/memory/metaspaceShared.cpp

Print this page
@@ -49,10 +49,12 @@
  #include "memory/metaspaceClosure.hpp"
  #include "memory/metaspaceShared.hpp"
  #include "memory/resourceArea.hpp"
  #include "memory/universe.hpp"
  #include "oops/compressedOops.inline.hpp"
+ #include "oops/flatArrayKlass.hpp"
+ #include "oops/inlineKlass.hpp"
  #include "oops/instanceClassLoaderKlass.hpp"
  #include "oops/instanceMirrorKlass.hpp"
  #include "oops/instanceRefKlass.hpp"
  #include "oops/methodData.hpp"
  #include "oops/objArrayKlass.hpp"

@@ -785,17 +787,19 @@
  //                  into our own tables.
  
  // Currently, the archive contain ONLY the following types of objects that have C++ vtables.
  #define CPP_VTABLE_PATCH_TYPES_DO(f) \
    f(ConstantPool) \
-   f(InstanceKlass) \
+   f(InstanceClassLoaderKlass) \
    f(InstanceKlass) \
    f(InstanceMirrorKlass) \
    f(InstanceRefKlass) \
    f(Method) \
    f(ObjArrayKlass) \
-   f(TypeArrayKlass)
+   f(TypeArrayKlass) \
+   f(FlatArrayKlass) \
+   f(InlineKlass)
  
  class CppVtableInfo {
    intptr_t _vtable_size;
    intptr_t _cloned_vtable[1];
  public:

@@ -1369,16 +1373,30 @@
        RefRelocator refer;
        ref->metaspace_pointers_do_at(&refer, new_loc);
        return true; // recurse into ref.obj()
      }
      virtual void push_special(SpecialRef type, Ref* ref, intptr_t* p) {
-       assert(type == _method_entry_ref, "only special type allowed for now");
+       assert_valid(type);
+ 
        address obj = ref->obj();
        address new_obj = get_new_loc(ref);
        size_t offset = pointer_delta(p, obj,  sizeof(u1));
        intptr_t* new_p = (intptr_t*)(new_obj + offset);
-       assert(*p == *new_p, "must be a copy");
+       switch (type) {
+       case _method_entry_ref:
+         assert(*p == *new_p, "must be a copy");
+         break;
+       case _internal_pointer_ref:
+         {
+           size_t off = pointer_delta(*((address*)p), obj, sizeof(u1));
+           assert(0 <= intx(off) && intx(off) < ref->size() * BytesPerWord, "must point to internal address");
+           *((address*)new_p) = new_obj + off;
+         }
+         break;
+       default:
+         ShouldNotReachHere();
+       }
        ArchivePtrMarker::mark_pointer((address*)new_p);
      }
    };
  
    // Relocate a reference to point to its shallow copy
< prev index next >