< prev index next >

src/hotspot/share/cds/heapShared.cpp

Print this page
*** 281,11 ***
  
      // 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();
      CachedOopInfo info = make_cached_oop_info(obj);
      archived_object_cache()->put(obj, info);
      mark_native_pointers(obj);
  
      if (log_is_enabled(Debug, cds, heap)) {
--- 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.
!     if (!obj->klass()->is_inline_klass()) {
+       obj->identity_hash();
+     }
      CachedOopInfo info = make_cached_oop_info(obj);
      archived_object_cache()->put(obj, info);
      mark_native_pointers(obj);
  
      if (log_is_enabled(Debug, cds, heap)) {

*** 1651,10 ***
--- 1653,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 >