Path: blob/master/src/hotspot/share/cds/archiveUtils.inline.hpp
41144 views
/*1* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_CDS_ARCHIVEUTILS_INLINE_HPP25#define SHARE_CDS_ARCHIVEUTILS_INLINE_HPP2627#include "cds/archiveUtils.hpp"2829#include "utilities/bitMap.inline.hpp"3031inline bool SharedDataRelocator::do_bit(size_t offset) {32address* p = _patch_base + offset;33assert(_patch_base <= p && p < _patch_end, "must be");3435address old_ptr = *p;36assert(_valid_old_base <= old_ptr && old_ptr < _valid_old_end, "must be");37assert(old_ptr != NULL, "bits for NULL pointers should have been cleaned at dump time");3839address new_ptr = old_ptr + _delta;40assert(new_ptr != NULL, "don't point to the bottom of the archive"); // See ArchivePtrMarker::mark_pointer().41assert(_valid_new_base <= new_ptr && new_ptr < _valid_new_end, "must be");4243DEBUG_ONLY(log_trace(cds, reloc)("Patch2: @%8d [" PTR_FORMAT "] " PTR_FORMAT " -> " PTR_FORMAT,44(int)offset, p2i(p), p2i(old_ptr), p2i(new_ptr)));45*p = new_ptr;46return true; // keep iterating47}4849#endif // SHARE_CDS_ARCHIVEUTILS_INLINE_HPP505152