< prev index next >

src/hotspot/share/code/codeBlob.cpp

Print this page
@@ -20,10 +20,11 @@
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   *
   */
  
+ #include "code/SCCache.hpp"
  #include "code/codeBlob.hpp"
  #include "code/codeCache.hpp"
  #include "code/relocInfo.hpp"
  #include "code/vtableStubs.hpp"
  #include "compiler/disassembler.hpp"

@@ -185,11 +186,11 @@
    assert(_mutable_data != nullptr, "should never be null");
    if (_mutable_data != blob_end()) {
      os::free(_mutable_data);
      _mutable_data = blob_end(); // Valid not null address
    }
-   if (_oop_maps != nullptr) {
+   if (_oop_maps != nullptr && !SCCache::is_address_in_aot_cache((address)_oop_maps)) {
      delete _oop_maps;
      _oop_maps = nullptr;
    }
    NOT_PRODUCT(_asm_remarks.clear());
    NOT_PRODUCT(_dbg_strings.clear());

@@ -213,10 +214,20 @@
  void CodeBlob::print_code_on(outputStream* st) {
    ResourceMark m;
    Disassembler::decode(this, st);
  }
  
+ void CodeBlob::prepare_for_archiving() {
+   set_name(nullptr);
+   _oop_maps = nullptr;
+   _mutable_data = nullptr;
+ #ifndef PRODUCT
+   asm_remarks().clear();
+   dbg_strings().clear();
+ #endif /* PRODUCT */
+ }
+ 
  //-----------------------------------------------------------------------------------------
  // Creates a RuntimeBlob from a CodeBuffer and copy code and relocation info.
  
  RuntimeBlob::RuntimeBlob(
    const char* name,
< prev index next >