< prev index next >

src/hotspot/share/cds/filemap.hpp

Print this page
@@ -29,10 +29,11 @@
  #include "include/cds.h"
  #include "logging/logLevel.hpp"
  #include "memory/allocation.hpp"
  #include "oops/array.hpp"
  #include "oops/compressedOops.hpp"
+ #include "runtime/globals.hpp"
  #include "utilities/align.hpp"
  
  // To understand the layout of the CDS archive file:
  //
  // java -Xlog:cds+map=info:file=cds.map:none:filesize=0

@@ -172,10 +173,38 @@
  
    bool check_region_crc(char* base) const;
    void print(outputStream* st, int region_index);
  };
  
+ #define CDS_MUST_MATCH_FLAGS_DO(f) \
+   f(EnableValhalla) \
+   f(FlatArrayElementMaxOops) \
+   f(FlatArrayElementMaxSize) \
+   f(InlineFieldMaxFlatSize) \
+   f(InlineTypePassFieldsAsArgs) \
+   f(InlineTypeReturnedAsFields)
+ 
+ class CDSMustMatchFlags {
+ private:
+   size_t _max_name_width;
+ #define DECLARE_CDS_MUST_MATCH_FLAG(n) \
+   decltype(n) _v_##n;
+   CDS_MUST_MATCH_FLAGS_DO(DECLARE_CDS_MUST_MATCH_FLAG);
+ #undef DECLARE_CDS_MUST_MATCH_FLAG
+ 
+   inline static void do_print(outputStream* st, bool v);
+   inline static void do_print(outputStream* st, intx v);
+   inline static void do_print(outputStream* st, uintx v);
+   inline static void do_print(outputStream* st, double v);
+   void print_info() const;
+ 
+ public:
+   void init();
+   bool runtime_check() const;
+   void print(outputStream* st) const;
+ };
+ 
  class FileMapHeader: private CDSFileMapHeaderBase {
    friend class CDSConstants;
    friend class VMStructs;
  
  private:

@@ -223,10 +252,12 @@
  
    bool   _allow_archiving_with_java_agent; // setting of the AllowArchivingWithJavaAgent option
    bool   _use_optimized_module_handling;// No module-relation VM options were specified, so we can skip
                                          // some expensive operations.
    bool   _has_full_module_graph;        // Does this CDS archive contain the full archived module graph?
+   bool   _has_valhalla_patched_classes; // Is this archived dumped with --enable-preview -XX:+EnableValhalla?
+   CDSMustMatchFlags _must_match;        // These flags must be the same between dumptime and runtime
    size_t _heap_roots_offset;            // Offset of the HeapShared::roots() object, from the bottom
                                          // of the archived heap objects, in bytes.
    size_t _heap_oopmap_start_pos;        // The first bit in the oopmap corresponds to this position in the heap.
    size_t _heap_ptrmap_start_pos;        // The first bit in the ptrmap corresponds to this position in the heap.
    size_t _rw_ptrmap_start_pos;          // The first bit in the ptrmap corresponds to this position in the rw region

@@ -319,10 +350,14 @@
                  size_t common_app_classpath_size);
    static bool is_valid_region(int region) {
      return (0 <= region && region < NUM_CDS_REGIONS);
    }
  
+   bool check_must_match_flags() const {
+     return _must_match.runtime_check();
+   }
+ 
    void print(outputStream* st);
  };
  
  class FileMapInfo : public CHeapObj<mtInternal> {
  private:
< prev index next >