< prev index next >

src/hotspot/share/cds/aotReferenceObjSupport.cpp

Print this page
*** 30,10 ***
--- 30,11 ---
  #include "classfile/vmSymbols.hpp"
  #include "logging/log.hpp"
  #include "memory/resourceArea.hpp"
  #include "memory/universe.hpp"
  #include "oops/oop.inline.hpp"
+ #include "oops/oopCast.inline.hpp"
  #include "oops/oopHandle.inline.hpp"
  #include "runtime/fieldDescriptor.inline.hpp"
  #include "runtime/javaCalls.hpp"
  #include "utilities/hashTable.hpp"
  

*** 161,13 ***
  
  void AOTReferenceObjSupport::init_keep_alive_objs_table() {
    assert_at_safepoint(); // _keep_alive_objs_table uses raw oops
    oop a = _keep_alive_objs_array.resolve();
    if (a != nullptr) {
!     precond(a->is_objArray());
      precond(AOTReferenceObjSupport::is_enabled());
!     objArrayOop array = objArrayOop(a);
  
      _keep_alive_objs_table = new (mtClass)KeepAliveObjectsTable();
      for (int i = 0; i < array->length(); i++) {
        oop obj = array->obj_at(i);
        _keep_alive_objs_table->put(obj, true); // The array may have duplicated entries but that's OK.
--- 162,13 ---
  
  void AOTReferenceObjSupport::init_keep_alive_objs_table() {
    assert_at_safepoint(); // _keep_alive_objs_table uses raw oops
    oop a = _keep_alive_objs_array.resolve();
    if (a != nullptr) {
!     precond(a->is_refArray());
      precond(AOTReferenceObjSupport::is_enabled());
!     refArrayOop array = oop_cast<refArrayOop>(a);
  
      _keep_alive_objs_table = new (mtClass)KeepAliveObjectsTable();
      for (int i = 0; i < array->length(); i++) {
        oop obj = array->obj_at(i);
        _keep_alive_objs_table->put(obj, true); // The array may have duplicated entries but that's OK.
< prev index next >