src/hotspot/share/include/cds.h
changeset 59070 22ee476cc664
parent 58096 0d97bf7cf8a4
equal deleted inserted replaced
59069:e0d59f0c2b7d 59070:22ee476cc664
    31 // We should use only standard C types. Do not use custom types such as bool, intx,
    31 // We should use only standard C types. Do not use custom types such as bool, intx,
    32 // etc, to avoid introducing unnecessary dependencies to other HotSpot type declarations.
    32 // etc, to avoid introducing unnecessary dependencies to other HotSpot type declarations.
    33 //
    33 //
    34 // Also, this is a C header file. Do not use C++ here.
    34 // Also, this is a C header file. Do not use C++ here.
    35 
    35 
    36 #define NUM_CDS_REGIONS 8 // this must be the same as MetaspaceShared::n_regions
    36 #define NUM_CDS_REGIONS 9 // this must be the same as MetaspaceShared::n_regions
    37 #define CDS_ARCHIVE_MAGIC 0xf00baba2
    37 #define CDS_ARCHIVE_MAGIC 0xf00baba2
    38 #define CDS_DYNAMIC_ARCHIVE_MAGIC 0xf00baba8
    38 #define CDS_DYNAMIC_ARCHIVE_MAGIC 0xf00baba8
    39 #define CURRENT_CDS_ARCHIVE_VERSION 8
    39 #define CURRENT_CDS_ARCHIVE_VERSION 9
    40 #define INVALID_CDS_ARCHIVE_VERSION -1
    40 #define INVALID_CDS_ARCHIVE_VERSION -1
    41 
    41 
    42 struct CDSFileMapRegion {
    42 struct CDSFileMapRegion {
    43   int        _crc;            // crc checksum of the current space
    43   int     _crc;               // CRC checksum of this region.
    44   size_t     _file_offset;    // sizeof(this) rounded to vm page size
    44   int     _read_only;         // read only region?
    45   union {
    45   int     _allow_exec;        // executable code in this region?
    46     char*    _base;           // copy-on-write base address
    46   int     _is_heap_region;    // Used by SA and debug build.
    47     size_t   _offset;         // offset from the compressed oop encoding base, only used
    47   int     _is_bitmap_region;  // Relocation bitmap for RO/RW/MC/MD regions (used by SA and debug build).
    48                               // by archive heap space
    48   int     _mapped_from_file;  // Is this region mapped from a file?
    49   } _addr;
    49                               // If false, this region was initialized using os::read().
    50   size_t     _used;           // for setting space top on read
    50   size_t  _file_offset;       // Data for this region starts at this offset in the archive file.
    51   int        _read_only;      // read only space?
    51   size_t  _mapping_offset;    // This region should be mapped at this offset from the base address
    52   int        _allow_exec;     // executable code in space?
    52                               // - for non-heap regions, the base address is SharedBaseAddress
    53   void*      _oopmap;         // bitmap for relocating embedded oops
    53                               // - for heap regions, the base address is the compressed oop encoding base
    54   size_t     _oopmap_size_in_bits;
    54   size_t  _used;              // Number of bytes actually used by this region (excluding padding bytes added
    55   int        _is_heap_region; // used in debug build only.
    55                               // for alignment purposed.
       
    56   size_t  _oopmap_offset;     // Bitmap for relocating embedded oops (offset from SharedBaseAddress).
       
    57   size_t  _oopmap_size_in_bits;
       
    58   char*   _mapped_base;       // Actually mapped address (NULL if this region is not mapped).
    56 };
    59 };
    57 
    60 
    58 struct CDSFileMapHeaderBase {
    61 struct CDSFileMapHeaderBase {
    59   unsigned int _magic;           // identify file type
    62   unsigned int _magic;           // identify file type
    60   int          _crc;             // header crc checksum
    63   int          _crc;             // header crc checksum