< prev index next >

src/hotspot/share/cds/heapShared.cpp

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 2018, 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.

@@ -281,11 +281,13 @@
  
      // The archived objects are discovered in a predictable order. Compute
      // their identity_hash() as soon as we see them. This ensures that the
      // the identity_hash in the object header will have a predictable value,
      // making the archive reproducible.
-     obj->identity_hash();
+     if (!obj->klass()->is_inline_klass()) {
+       obj->identity_hash();
+     }
      CachedOopInfo info = make_cached_oop_info();
      archived_object_cache()->put(obj, info);
      mark_native_pointers(obj);
  
      if (log_is_enabled(Debug, cds, heap)) {

@@ -1603,10 +1605,17 @@
    //     are restored by HeapShared::initialize_from_archived_subgraph().
    int i;
    for (int i = 0; fields[i].valid(); ) {
      ArchivableStaticFieldInfo* info = &fields[i];
      const char* klass_name = info->klass_name;
+ 
+     if (CDSConfig::is_valhalla_preview() && strcmp(klass_name, "jdk/internal/module/ArchivedModuleGraph") == 0) {
+       // FIXME -- ArchivedModuleGraph doesn't work when java.base is patched with valhalla classes.
+       i++;
+       continue;
+     }
+ 
      start_recording_subgraph(info->klass, klass_name, is_full_module_graph);
  
      // If you have specified consecutive fields of the same klass in
      // fields[], these will be archived in the same
      // {start_recording_subgraph ... done_recording_subgraph} pass to
< prev index next >