src/hotspot/share/prims/cdsoffsets.cpp
changeset 54927 1512d88b24c6
parent 51477 e77d7687c831
child 55694 7b7df2be6219
child 58678 9cf78a70fa4f
equal deleted inserted replaced
54926:d4e7ccaf1445 54927:1512d88b24c6
     1 /*
     1 /*
     2  * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "utilities/macros.hpp"
    26 #include "utilities/macros.hpp"
    27 #if INCLUDE_CDS
    27 #if INCLUDE_CDS
    28 #include "runtime/os.hpp"
    28 #include "runtime/os.hpp"
       
    29 #include "memory/dynamicArchive.hpp"
    29 #include "memory/filemap.hpp"
    30 #include "memory/filemap.hpp"
    30 #include "memory/allocation.hpp"
    31 #include "memory/allocation.hpp"
    31 #include "memory/allocation.inline.hpp"
    32 #include "memory/allocation.inline.hpp"
    32 #include "prims/cdsoffsets.hpp"
    33 #include "prims/cdsoffsets.hpp"
    33 
    34 
    42 #define ADD_NEXT(list, name, value) \
    43 #define ADD_NEXT(list, name, value) \
    43   list->add_end(new CDSOffsets(name, value, NULL))
    44   list->add_end(new CDSOffsets(name, value, NULL))
    44 
    45 
    45 #define CREATE_OFFSET_MAPS                                                                  \
    46 #define CREATE_OFFSET_MAPS                                                                  \
    46     _all = new CDSOffsets("size_t_size", sizeof(size_t), NULL);                             \
    47     _all = new CDSOffsets("size_t_size", sizeof(size_t), NULL);                             \
       
    48     ADD_NEXT(_all, "int_size", sizeof(int));                                                \
    47     ADD_NEXT(_all, "FileMapHeader::_magic", offset_of(FileMapHeader, _magic));              \
    49     ADD_NEXT(_all, "FileMapHeader::_magic", offset_of(FileMapHeader, _magic));              \
    48     ADD_NEXT(_all, "FileMapHeader::_crc", offset_of(FileMapHeader, _crc));                  \
    50     ADD_NEXT(_all, "FileMapHeader::_crc", offset_of(FileMapHeader, _crc));                  \
    49     ADD_NEXT(_all, "FileMapHeader::_version", offset_of(FileMapHeader, _version));          \
    51     ADD_NEXT(_all, "FileMapHeader::_version", offset_of(FileMapHeader, _version));          \
    50     ADD_NEXT(_all, "FileMapHeader::_space[0]", offset_of(FileMapHeader, _space));           \
    52     ADD_NEXT(_all, "FileMapHeader::_space[0]", offset_of(FileMapHeader, _space));           \
    51     ADD_NEXT(_all, "CDSFileMapRegion::_crc", offset_of(CDSFileMapRegion, _crc));            \
    53     ADD_NEXT(_all, "CDSFileMapRegion::_crc", offset_of(CDSFileMapRegion, _crc));            \
    52     ADD_NEXT(_all, "CDSFileMapRegion::_used", offset_of(CDSFileMapRegion, _used));          \
    54     ADD_NEXT(_all, "CDSFileMapRegion::_used", offset_of(CDSFileMapRegion, _used));          \
    53     ADD_NEXT(_all, "FileMapHeader::_paths_misc_info_size", offset_of(FileMapHeader, _paths_misc_info_size)); \
    55     ADD_NEXT(_all, "FileMapHeader::_paths_misc_info_size", offset_of(FileMapHeader, _paths_misc_info_size)); \
    54     ADD_NEXT(_all, "file_header_size", sizeof(FileMapHeader));                              \
    56     ADD_NEXT(_all, "file_header_size", sizeof(FileMapHeader));                              \
       
    57     ADD_NEXT(_all, "DynamicArchiveHeader::_base_archive_crc", offset_of(DynamicArchiveHeader, _base_archive_crc)); \
    55     ADD_NEXT(_all, "CDSFileMapRegion_size", sizeof(CDSFileMapRegion));
    58     ADD_NEXT(_all, "CDSFileMapRegion_size", sizeof(CDSFileMapRegion));
    56 
    59 
    57 int CDSOffsets::find_offset(const char* name) {
    60 int CDSOffsets::find_offset(const char* name) {
    58   if (_all == NULL) {
    61   if (_all == NULL) {
    59     CREATE_OFFSET_MAPS
    62     CREATE_OFFSET_MAPS