< prev index next >

src/hotspot/share/oops/cpCache.inline.hpp

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 2018, 2026, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

@@ -25,10 +25,11 @@
  #ifndef SHARE_OOPS_CPCACHE_INLINE_HPP
  #define SHARE_OOPS_CPCACHE_INLINE_HPP
  
  #include "oops/cpCache.hpp"
  
+ #include "oops/oopCast.inline.hpp"
  #include "oops/oopHandle.inline.hpp"
  #include "oops/resolvedFieldEntry.hpp"
  #include "oops/resolvedIndyEntry.hpp"
  #include "oops/resolvedMethodEntry.hpp"
  #include "runtime/atomicAccess.hpp"

@@ -44,14 +45,14 @@
                                                    _resolved_field_entries(field_entries),
                                                    _resolved_method_entries(method_entries) {
    CDS_JAVA_HEAP_ONLY(_archived_references_index = -1;)
  }
  
- inline objArrayOop ConstantPoolCache::resolved_references() {
+ inline refArrayOop ConstantPoolCache::resolved_references() {
    oop obj = _resolved_references.resolve();
-   assert(obj == nullptr || obj->is_objArray(), "should be objArray");
-   return (objArrayOop)obj;
+   assert(obj == nullptr || obj->is_refArray(), "should be refArray");
+   return obj == nullptr ? nullptr : oop_cast<refArrayOop>(obj);
  }
  
  inline ResolvedFieldEntry* ConstantPoolCache::resolved_field_entry_at(int field_index) const {
    return _resolved_field_entries->adr_at(field_index);
  }
< prev index next >