< prev index next >

src/hotspot/share/cds/aotStreamedHeapLoader.cpp

Print this page
@@ -39,10 +39,11 @@
  #include "memory/iterator.inline.hpp"
  #include "memory/oopFactory.hpp"
  #include "oops/access.inline.hpp"
  #include "oops/objArrayOop.inline.hpp"
  #include "oops/oop.inline.hpp"
+ #include "oops/oopCast.inline.hpp"
  #include "runtime/globals.hpp"
  #include "runtime/globals_extension.hpp"
  #include "runtime/handles.inline.hpp"
  #include "runtime/java.hpp"
  #include "runtime/mutex.hpp"

@@ -993,11 +994,11 @@
    _heap_region_used = _heap_region->used();
  
    // We can't retire a TLAB until the filler klass is set; set it to the archived object klass.
    CollectedHeap::set_filler_object_klass(vmClasses::Object_klass());
  
-   objArrayOop roots = oopFactory::new_objectArray(_num_roots, CHECK);
+   refArrayOop roots = oopFactory::new_objectArray(_num_roots, CHECK);
    _roots = OopHandle(Universe::vm_global(), roots);
  
    _object_index_to_buffer_offset_table = (size_t*)(((address)_heap_region->mapped_base()) + forwarding_offset);
    // We allocate the first entry for "null"
    _object_index_to_heap_object_table = NEW_C_HEAP_ARRAY(void*, _num_archived_objects + 1, mtClassShared);

@@ -1049,11 +1050,11 @@
  
    oop result;
    {
      MutexLocker ml(AOTHeapLoading_lock, Mutex::_safepoint_check_flag);
  
-     oop root = objArrayOop(_roots.resolve())->obj_at(root_index);
+     oop root = oop_cast<refArrayOop>(_roots.resolve())->obj_at(root_index);
  
      if (root != nullptr) {
        // The root has already been materialized
        result = root;
      } else {

@@ -1068,11 +1069,11 @@
  
    return result;
  }
  
  oop AOTStreamedHeapLoader::get_root(int index) {
-   oop result = objArrayOop(_roots.resolve())->obj_at(index);
+   oop result = oop_cast<refArrayOop>(_roots.resolve())->obj_at(index);
    if (result == nullptr) {
      // Materialize root
      result = materialize_root(index);
    }
    if (result == _roots.resolve()) {
< prev index next >