< prev index next >

src/hotspot/share/cds/regeneratedClasses.cpp

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

*** 62,20 ***
--- 62,33 ---
                         p2i(orig_m), orig_m->external_name());
      } else {
        _renegerated_objs->put((address)orig_m, (address)regen_m);
      }
    }
+ 
+   if (log_is_enabled(Info, cds)) {
+     ResourceMark rm;
+     log_info(cds)("Regenerated class %s: methods %d -> %d)", orig_klass->external_name(),
+                   orig_klass->methods()->length(), regen_klass->methods()->length());
+   }
  }
  
  bool RegeneratedClasses::has_been_regenerated(address orig_obj) {
    if (_renegerated_objs == nullptr) {
      return false;
    } else {
      return _renegerated_objs->get(orig_obj) != nullptr;
    }
  }
  
+ address RegeneratedClasses::get_regenerated_object(address orig_obj) {
+   assert(_renegerated_objs != nullptr, "must be");
+   address* p =_renegerated_objs->get(orig_obj);
+   assert(p != nullptr, "must be");
+   return *p;
+ }
+ 
  void RegeneratedClasses::record_regenerated_objects() {
    assert_locked_or_safepoint(DumpTimeTable_lock);
    if (_renegerated_objs != nullptr) {
      auto doit = [&] (address orig_obj, address regen_obj) {
        ArchiveBuilder::current()->record_regenerated_object(orig_obj, regen_obj);
< prev index next >