< prev index next >

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

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 2015, 2025, 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.
--- 1,7 ---
  /*
!  * Copyright (c) 2015, 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.

*** 61,10 ***
--- 61,30 ---
    } else {
      return nullptr;
    }
  }
  
+ inline address InstanceKlass::end_of_instance_klass() const {
+   return (address)end_of_nonstatic_oop_maps() +
+       (is_interface() ? sizeof(InstanceKlass*) : 0);
+ }
+ 
+ inline InlineKlass* InstanceKlass::get_inline_type_field_klass(int idx) const {
+   assert(has_inlined_fields(), "Sanity checking");
+   assert(idx < java_fields_count(), "IOOB");
+   InlineKlass* k = inline_layout_info(idx).klass();
+   assert(k != nullptr, "Should always be set before being read");
+   return k;
+ }
+ 
+ inline InlineKlass* InstanceKlass::get_inline_type_field_klass_or_null(int idx) const {
+   assert(has_inlined_fields(), "Sanity checking");
+   assert(idx < java_fields_count(), "IOOB");
+   InlineKlass* k = inline_layout_info(idx).klass();
+   return k;
+ }
+ 
  inline ObjArrayKlass* InstanceKlass::array_klasses_acquire() const {
    return AtomicAccess::load_acquire(&_array_klasses);
  }
  
  inline void InstanceKlass::release_set_array_klasses(ObjArrayKlass* k) {

*** 176,6 ***
--- 196,19 ---
    }
  
    oop_oop_iterate_oop_maps_bounded<T>(obj, closure, mr);
  }
  
+ template<typename T, typename TConsumerType>
+ inline void InstanceKlass::print_array_on(outputStream* st, Array<T>* array, TConsumerType elem_printer) {
+    if (array == nullptr) { st->print_cr("nullptr"); return; }
+    array->print_value_on(st); st->cr();
+    if (Verbose || WizardMode) {
+      for (int i = 0; i < array->length(); i++) {
+        st->print("%d : ", i);
+        elem_printer(st, array->at(i));
+        st->cr();
+      }
+    }
+ }
+ 
  #endif // SHARE_OOPS_INSTANCEKLASS_INLINE_HPP
< prev index next >