< prev index next >

src/hotspot/share/cds/filemap.hpp

Print this page
@@ -27,10 +27,11 @@
  
  #include "cds/metaspaceShared.hpp"
  #include "include/cds.h"
  #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

@@ -177,10 +178,38 @@
    }
  
    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:

@@ -236,10 +265,11 @@
    bool   _use_optimized_module_handling;// No module-relation VM options were specified, so we can skip
                                          // some expensive operations.
    bool   _use_full_module_graph;        // Can we use the full archived module graph?
    size_t _ptrmap_size_in_bits;          // Size of pointer relocation bitmap
    narrowOop _heap_obj_roots;            // An objArray that stores all the roots of archived heap objects
+   CDSMustMatchFlags _must_match;        // These flags must be the same between dumptime and runtime
    char* from_mapped_offset(size_t offset) const {
      return mapped_base_address() + offset;
    }
    void set_as_offset(char* p, size_t *offset);
  public:

@@ -321,10 +351,14 @@
  
    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 >