< prev index next >

src/share/vm/memory/filemap.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 30,39 **** --- 30,41 ---- #include "classfile/systemDictionaryShared.hpp" #include "classfile/altHashing.hpp" #if INCLUDE_ALL_GCS #include "gc/g1/g1CollectedHeap.hpp" #endif + #include "logging/log.hpp" + #include "logging/logMessage.hpp" #include "memory/filemap.hpp" #include "memory/metadataFactory.hpp" #include "memory/oopFactory.hpp" #include "oops/objArrayOop.hpp" #include "prims/jvmtiExport.hpp"
*** 96,108 **** tty->print_cr("]"); } else { if (RequireSharedSpaces) { fail(msg, ap); } else { ! if (PrintSharedSpaces) { ! tty->print("UseSharedSpaces: "); ! tty->vprint_cr(msg, ap); } } UseSharedSpaces = false; assert(current_info() != NULL, "singleton must be registered"); current_info()->close(); --- 98,112 ---- tty->print_cr("]"); } else { if (RequireSharedSpaces) { fail(msg, ap); } else { ! if (log_is_enabled(Info, cds)) { ! ResourceMark rm; ! outputStream* logstream = Log(cds)::info_stream(); ! logstream->print("UseSharedSpaces: "); ! logstream->vprint_cr(msg, ap); } } UseSharedSpaces = false; assert(current_info() != NULL, "singleton must be registered"); current_info()->close();
*** 416,428 **** // Write the FileMapInfo information to the file. void FileMapInfo::open_for_write() { _full_path = Arguments::GetSharedArchivePath(); ! if (PrintSharedSpaces) { ! tty->print_cr("Dumping shared data to file: "); ! tty->print_cr(" %s", _full_path); } #ifdef _WINDOWS // On Windows, need WRITE permission to remove the file. chmod(_full_path, _S_IREAD | _S_IWRITE); #endif --- 420,436 ---- // Write the FileMapInfo information to the file. void FileMapInfo::open_for_write() { _full_path = Arguments::GetSharedArchivePath(); ! if (log_is_enabled(Info, cds)) { ! ResourceMark rm; ! LogMessage(cds) msg; ! stringStream info_stream; ! info_stream.print_cr("Dumping shared data to file: "); ! info_stream.print_cr(" %s", _full_path); ! msg.info("%s", info_stream.as_string()); } #ifdef _WINDOWS // On Windows, need WRITE permission to remove the file. chmod(_full_path, _S_IREAD | _S_IWRITE); #endif
*** 475,488 **** bool allow_exec) { struct FileMapInfo::FileMapHeader::space_info* si = &_header->_space[region]; if (_file_open) { guarantee(si->_file_offset == _file_offset, "file offset mismatch."); ! if (PrintSharedSpaces) { ! tty->print_cr("Shared file region %d: " SIZE_FORMAT_HEX_W(6) " bytes, addr " INTPTR_FORMAT ! " file offset " SIZE_FORMAT_HEX_W(6), region, size, p2i(base), _file_offset); ! } } else { si->_file_offset = _file_offset; } if (MetaspaceShared::is_string_region(region)) { assert((base - (char*)Universe::narrow_oop_base()) % HeapWordSize == 0, "Sanity"); --- 483,495 ---- bool allow_exec) { struct FileMapInfo::FileMapHeader::space_info* si = &_header->_space[region]; if (_file_open) { guarantee(si->_file_offset == _file_offset, "file offset mismatch."); ! log_info(cds)("Shared file region %d: " SIZE_FORMAT_HEX_W(6) ! " bytes, addr " INTPTR_FORMAT " file offset " SIZE_FORMAT_HEX_W(6), ! region, size, p2i(base), _file_offset); } else { si->_file_offset = _file_offset; } if (MetaspaceShared::is_string_region(region)) { assert((base - (char*)Universe::narrow_oop_base()) % HeapWordSize == 0, "Sanity");
*** 689,700 **** // Check that all the narrow oop and klass encodings match the archive if (narrow_oop_mode() != Universe::narrow_oop_mode() || narrow_oop_shift() != Universe::narrow_oop_shift() || narrow_klass_base() != Universe::narrow_klass_base() || narrow_klass_shift() != Universe::narrow_klass_shift()) { ! if (PrintSharedSpaces && _header->_space[MetaspaceShared::first_string]._used > 0) { ! tty->print_cr("Shared string data from the CDS archive is being ignored. " "The current CompressedOops/CompressedClassPointers encoding differs from " "that archived due to heap size change. The archive was dumped using max heap " "size " UINTX_FORMAT "M.", max_heap_size()/M); } } else { --- 696,707 ---- // Check that all the narrow oop and klass encodings match the archive if (narrow_oop_mode() != Universe::narrow_oop_mode() || narrow_oop_shift() != Universe::narrow_oop_shift() || narrow_klass_base() != Universe::narrow_klass_base() || narrow_klass_shift() != Universe::narrow_klass_shift()) { ! if (log_is_enabled(Info, cds) && _header->_space[MetaspaceShared::first_string]._used > 0) { ! log_info(cds)("Shared string data from the CDS archive is being ignored. " "The current CompressedOops/CompressedClassPointers encoding differs from " "that archived due to heap size change. The archive was dumped using max heap " "size " UINTX_FORMAT "M.", max_heap_size()/M); } } else {
*** 759,770 **** // the shared string data is mapped successfully return true; } } else { ! if (PrintSharedSpaces && _header->_space[MetaspaceShared::first_string]._used > 0) { ! tty->print_cr("Shared string data from the CDS archive is being ignored. UseG1GC, " "UseCompressedOops and UseCompressedClassPointers are required."); } } // if we get here, the shared string data is not mapped --- 766,777 ---- // the shared string data is mapped successfully return true; } } else { ! if (log_is_enabled(Info, cds) && _header->_space[MetaspaceShared::first_string]._used > 0) { ! log_info(cds)("Shared string data from the CDS archive is being ignored. UseG1GC, " "UseCompressedOops and UseCompressedClassPointers are required."); } } // if we get here, the shared string data is not mapped
< prev index next >