Mercurial > hg > release > icedtea7-forest-2.5 > hotspot
changeset 5802:d81faf9016ce jdk7u75-b05
Merge
author | asaha |
---|---|
date | Wed, 15 Oct 2014 10:24:59 -0700 |
parents | 6b27e1adb4bd (diff) 61dacdb82145 (current diff) |
children | e0ad595b3a35 |
files | .hgtags |
diffstat | 12 files changed, 187 insertions(+), 92 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Wed Oct 08 13:02:06 2014 -0700 +++ b/.hgtags Wed Oct 15 10:24:59 2014 -0700 @@ -742,3 +742,8 @@ d9b56c6bdddb6f9d8242230f5fdd58f9c7d30ea5 jdk7u72-b14 a6ae698522bfab3c595a4f8c2c3ee7e8939eb1bb jdk7u72-b30 492a2abed4ca015459e24f7348233531b7e929d2 jdk7u72-b31 +e6b6d91b3934c281086f8efacb0926e7451cc18b jdk7u75-b00 +9096ac248b379a0f3012f18c7289ec47cdef8459 jdk7u75-b01 +a6964b2822d906eab9c923cdd723cf3dd4facfcd jdk7u75-b02 +6c1a8b7ed616311a932715428620e262076bb68a jdk7u75-b03 +2480d9d778301a3f88b0ab8ee35a585df82528e5 jdk7u75-b04
--- a/make/hotspot_version Wed Oct 08 13:02:06 2014 -0700 +++ b/make/hotspot_version Wed Oct 15 10:24:59 2014 -0700 @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2015, 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 @@ -31,11 +31,11 @@ # # Don't put quotes (fail windows build). -HOTSPOT_VM_COPYRIGHT=Copyright 2014 +HOTSPOT_VM_COPYRIGHT=Copyright 2015 HS_MAJOR_VER=24 -HS_MINOR_VER=72 -HS_BUILD_NUMBER=04 +HS_MINOR_VER=75 +HS_BUILD_NUMBER=01 JDK_MAJOR_VER=1 JDK_MINOR_VER=7
--- a/src/share/vm/ci/bcEscapeAnalyzer.cpp Wed Oct 08 13:02:06 2014 -0700 +++ b/src/share/vm/ci/bcEscapeAnalyzer.cpp Wed Oct 15 10:24:59 2014 -0700 @@ -89,8 +89,8 @@ public: ArgumentMap *_vars; ArgumentMap *_stack; - short _stack_height; - short _max_stack; + int _stack_height; + int _max_stack; bool _initialized; ArgumentMap empty_map;
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Wed Oct 08 13:02:06 2014 -0700 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Wed Oct 15 10:24:59 2014 -0700 @@ -757,7 +757,7 @@ // Support for parallelizing survivor space rescan if ((CMSParallelRemarkEnabled && CMSParallelSurvivorRemarkEnabled) || CMSParallelInitialMarkEnabled) { const size_t max_plab_samples = - ((DefNewGeneration*)_young_gen)->max_survivor_size()/MinTLABSize; + ((DefNewGeneration*)_young_gen)->max_survivor_size() / plab_sample_minimum_size(); _survivor_plab_array = NEW_C_HEAP_ARRAY(ChunkArray, ParallelGCThreads, mtGC); _survivor_chunk_array = NEW_C_HEAP_ARRAY(HeapWord*, 2*max_plab_samples, mtGC); @@ -824,6 +824,12 @@ _inter_sweep_timer.start(); // start of time } +size_t CMSCollector::plab_sample_minimum_size() { + // The default value of MinTLABSize is 2k, but there is + // no way to get the default value if the flag has been overridden. + return MAX2(ThreadLocalAllocBuffer::min_size() * HeapWordSize, 2 * K); +} + const char* ConcurrentMarkSweepGeneration::name() const { return "concurrent mark-sweep generation"; }
--- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp Wed Oct 08 13:02:06 2014 -0700 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp Wed Oct 15 10:24:59 2014 -0700 @@ -766,6 +766,10 @@ size_t* _cursor; ChunkArray* _survivor_plab_array; + // A bounded minimum size of PLABs, should not return too small values since + // this will affect the size of the data structures used for parallel young gen rescan + size_t plab_sample_minimum_size(); + // Support for marking stack overflow handling bool take_from_overflow_list(size_t num, CMSMarkStack* to_stack); bool par_take_from_overflow_list(size_t num,
--- a/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp Wed Oct 08 13:02:06 2014 -0700 +++ b/src/share/vm/gc_implementation/shared/parGCAllocBuffer.hpp Wed Oct 15 10:24:59 2014 -0700 @@ -62,7 +62,8 @@ ParGCAllocBuffer(size_t word_sz); static const size_t min_size() { - return ThreadLocalAllocBuffer::min_size(); + // Make sure that we return something that is larger than AlignmentReserve + return align_object_size(MAX2(MinTLABSize / HeapWordSize, (uintx)oopDesc::header_size())) + AlignmentReserve; } static const size_t max_size() {
--- a/src/share/vm/memory/threadLocalAllocBuffer.cpp Wed Oct 08 13:02:06 2014 -0700 +++ b/src/share/vm/memory/threadLocalAllocBuffer.cpp Wed Oct 15 10:24:59 2014 -0700 @@ -240,22 +240,19 @@ } size_t ThreadLocalAllocBuffer::initial_desired_size() { - size_t init_sz; + size_t init_sz = 0; if (TLABSize > 0) { - init_sz = MIN2(TLABSize / HeapWordSize, max_size()); - } else if (global_stats() == NULL) { - // Startup issue - main thread initialized before heap initialized. - init_sz = min_size(); - } else { + init_sz = TLABSize / HeapWordSize; + } else if (global_stats() != NULL) { // Initial size is a function of the average number of allocating threads. unsigned nof_threads = global_stats()->allocating_threads_avg(); init_sz = (Universe::heap()->tlab_capacity(myThread()) / HeapWordSize) / (nof_threads * target_refills()); init_sz = align_object_size(init_sz); - init_sz = MIN2(MAX2(init_sz, min_size()), max_size()); } + init_sz = MIN2(MAX2(init_sz, min_size()), max_size()); return init_sz; }
--- a/src/share/vm/memory/threadLocalAllocBuffer.hpp Wed Oct 08 13:02:06 2014 -0700 +++ b/src/share/vm/memory/threadLocalAllocBuffer.hpp Wed Oct 15 10:24:59 2014 -0700 @@ -103,7 +103,7 @@ // do nothing. tlabs must be inited by initialize() calls } - static const size_t min_size() { return align_object_size(MinTLABSize / HeapWordSize); } + static const size_t min_size() { return align_object_size(MinTLABSize / HeapWordSize) + alignment_reserve(); } static const size_t max_size(); HeapWord* start() const { return _start; }
--- a/src/share/vm/prims/jni.cpp Wed Oct 08 13:02:06 2014 -0700 +++ b/src/share/vm/prims/jni.cpp Wed Oct 15 10:24:59 2014 -0700 @@ -5037,6 +5037,7 @@ #include "gc_implementation/shared/gcTimer.hpp" #include "gc_interface/collectedHeap.hpp" #include "utilities/quickSort.hpp" +#include "utilities/ostream.hpp" #define run_unit_test(unit_test_function_call) \ tty->print_cr("Running test: " #unit_test_function_call); \ @@ -5058,6 +5059,7 @@ run_unit_test(QuickSort::test_quick_sort()); run_unit_test(AltHashing::test_alt_hash()); run_unit_test(TestOldFreeSpaceCalculation_test()); + run_unit_test(test_loggc_filename()); tty->print_cr("All internal VM tests passed"); } }
--- a/src/share/vm/utilities/defaultStream.hpp Wed Oct 08 13:02:06 2014 -0700 +++ b/src/share/vm/utilities/defaultStream.hpp Wed Oct 15 10:24:59 2014 -0700 @@ -41,6 +41,8 @@ void init(); void init_log(); + fileStream* open_file(const char* log_name); + void start_log(); void finish_log(); void finish_log_on_error(char *buf, int buflen); public:
--- a/src/share/vm/utilities/ostream.cpp Wed Oct 08 13:02:06 2014 -0700 +++ b/src/share/vm/utilities/ostream.cpp Wed Oct 15 10:24:59 2014 -0700 @@ -567,6 +567,11 @@ buffer_length += strlen(pid); } + // File name is too long. + if (buffer_length > JVM_MAXPATHLEN) { + return NULL; + } + // Create big enough buffer. char *buf = NEW_C_HEAP_ARRAY(char, buffer_length, mtInternal); @@ -589,87 +594,54 @@ return buf; } +fileStream* defaultStream::open_file(const char* log_name){ + const char* try_name = make_log_name(log_name, NULL); + if (try_name == NULL) { + warning("Cannot open file %s: file name is too long.\n", log_name); + return NULL; + } + + fileStream* file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name); + FREE_C_HEAP_ARRAY(char, try_name, mtInternal); + if (file->is_open()) { + return file; + } + + // Try again to open the file. + delete file; + char warnbuf[O_BUFLEN*2]; + jio_snprintf(warnbuf, sizeof(warnbuf), "Warning: Cannot open log file: %s\n", try_name); + // Note: This feature is for maintainer use only. No need for L10N. + jio_print(warnbuf); + try_name = make_log_name("hs_pid%p.log", os::get_temp_directory()); + if (try_name == NULL) { + warning("Cannot open file %s: file name is too long for directory %s.\n", "hs_pid", os::get_temp_directory()); + return NULL; + } + + jio_snprintf(warnbuf, sizeof(warnbuf), "Warning: Forcing option -XX:LogFile=%s\n", try_name); + jio_print(warnbuf); + + file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name); + FREE_C_HEAP_ARRAY(char, try_name, mtInternal); + if (file->is_open()) { + return file; + } + + delete file; + return NULL; +} + void defaultStream::init_log() { // %%% Need a MutexLocker? const char* log_name = LogFile != NULL ? LogFile : "hotspot.log"; - const char* try_name = make_log_name(log_name, NULL); - fileStream* file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name); - if (!file->is_open()) { - // Try again to open the file. - char warnbuf[O_BUFLEN*2]; - jio_snprintf(warnbuf, sizeof(warnbuf), - "Warning: Cannot open log file: %s\n", try_name); - // Note: This feature is for maintainer use only. No need for L10N. - jio_print(warnbuf); - FREE_C_HEAP_ARRAY(char, try_name, mtInternal); - try_name = make_log_name("hs_pid%p.log", os::get_temp_directory()); - jio_snprintf(warnbuf, sizeof(warnbuf), - "Warning: Forcing option -XX:LogFile=%s\n", try_name); - jio_print(warnbuf); - delete file; - file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name); - FREE_C_HEAP_ARRAY(char, try_name, mtInternal); - } - if (file->is_open()) { + fileStream* file = open_file(log_name); + + if (file != NULL) { _log_file = file; - xmlStream* xs = new(ResourceObj::C_HEAP, mtInternal) xmlStream(file); - _outer_xmlStream = xs; - if (this == tty) xtty = xs; - // Write XML header. - xs->print_cr("<?xml version='1.0' encoding='UTF-8'?>"); - // (For now, don't bother to issue a DTD for this private format.) - jlong time_ms = os::javaTimeMillis() - tty->time_stamp().milliseconds(); - // %%% Should be: jlong time_ms = os::start_time_milliseconds(), if - // we ever get round to introduce that method on the os class - xs->head("hotspot_log version='%d %d'" - " process='%d' time_ms='"INT64_FORMAT"'", - LOG_MAJOR_VERSION, LOG_MINOR_VERSION, - os::current_process_id(), time_ms); - // Write VM version header immediately. - xs->head("vm_version"); - xs->head("name"); xs->text("%s", VM_Version::vm_name()); xs->cr(); - xs->tail("name"); - xs->head("release"); xs->text("%s", VM_Version::vm_release()); xs->cr(); - xs->tail("release"); - xs->head("info"); xs->text("%s", VM_Version::internal_vm_info_string()); xs->cr(); - xs->tail("info"); - xs->tail("vm_version"); - // Record information about the command-line invocation. - xs->head("vm_arguments"); // Cf. Arguments::print_on() - if (Arguments::num_jvm_flags() > 0) { - xs->head("flags"); - Arguments::print_jvm_flags_on(xs->text()); - xs->tail("flags"); - } - if (Arguments::num_jvm_args() > 0) { - xs->head("args"); - Arguments::print_jvm_args_on(xs->text()); - xs->tail("args"); - } - if (Arguments::java_command() != NULL) { - xs->head("command"); xs->text()->print_cr("%s", Arguments::java_command()); - xs->tail("command"); - } - if (Arguments::sun_java_launcher() != NULL) { - xs->head("launcher"); xs->text()->print_cr("%s", Arguments::sun_java_launcher()); - xs->tail("launcher"); - } - if (Arguments::system_properties() != NULL) { - xs->head("properties"); - // Print it as a java-style property list. - // System properties don't generally contain newlines, so don't bother with unparsing. - for (SystemProperty* p = Arguments::system_properties(); p != NULL; p = p->next()) { - xs->text()->print_cr("%s=%s", p->key(), p->value()); - } - xs->tail("properties"); - } - xs->tail("vm_arguments"); - // tty output per se is grouped under the <tty>...</tty> element. - xs->head("tty"); - // All further non-markup text gets copied to the tty: - xs->_text = this; // requires friend declaration! + _outer_xmlStream = new(ResourceObj::C_HEAP, mtInternal) xmlStream(file); + start_log(); } else { - delete(file); // and leave xtty as NULL LogVMOutput = false; DisplayVMOutput = true; @@ -677,6 +649,64 @@ } } +void defaultStream::start_log() { + xmlStream* xs = _outer_xmlStream; + if (this == tty) xtty = xs; + // Write XML header. + xs->print_cr("<?xml version='1.0' encoding='UTF-8'?>"); + // (For now, don't bother to issue a DTD for this private format.) + jlong time_ms = os::javaTimeMillis() - tty->time_stamp().milliseconds(); + // %%% Should be: jlong time_ms = os::start_time_milliseconds(), if + // we ever get round to introduce that method on the os class + xs->head("hotspot_log version='%d %d'" + " process='%d' time_ms='"INT64_FORMAT"'", + LOG_MAJOR_VERSION, LOG_MINOR_VERSION, + os::current_process_id(), time_ms); + // Write VM version header immediately. + xs->head("vm_version"); + xs->head("name"); xs->text("%s", VM_Version::vm_name()); xs->cr(); + xs->tail("name"); + xs->head("release"); xs->text("%s", VM_Version::vm_release()); xs->cr(); + xs->tail("release"); + xs->head("info"); xs->text("%s", VM_Version::internal_vm_info_string()); xs->cr(); + xs->tail("info"); + xs->tail("vm_version"); + // Record information about the command-line invocation. + xs->head("vm_arguments"); // Cf. Arguments::print_on() + if (Arguments::num_jvm_flags() > 0) { + xs->head("flags"); + Arguments::print_jvm_flags_on(xs->text()); + xs->tail("flags"); + } + if (Arguments::num_jvm_args() > 0) { + xs->head("args"); + Arguments::print_jvm_args_on(xs->text()); + xs->tail("args"); + } + if (Arguments::java_command() != NULL) { + xs->head("command"); xs->text()->print_cr("%s", Arguments::java_command()); + xs->tail("command"); + } + if (Arguments::sun_java_launcher() != NULL) { + xs->head("launcher"); xs->text()->print_cr("%s", Arguments::sun_java_launcher()); + xs->tail("launcher"); + } + if (Arguments::system_properties() != NULL) { + xs->head("properties"); + // Print it as a java-style property list. + // System properties don't generally contain newlines, so don't bother with unparsing. + for (SystemProperty* p = Arguments::system_properties(); p != NULL; p = p->next()) { + xs->text()->print_cr("%s=%s", p->key(), p->value()); + } + xs->tail("properties"); + } + xs->tail("vm_arguments"); + // tty output per se is grouped under the <tty>...</tty> element. + xs->head("tty"); + // All further non-markup text gets copied to the tty: + xs->_text = this; // requires friend declaration! +} + // finish_log() is called during normal VM shutdown. finish_log_on_error() is // called by ostream_abort() after a fatal error. // @@ -1038,6 +1068,50 @@ } #ifndef PRODUCT +void test_loggc_filename() { + const char* o_result; + + { + // longest filename + char longest_name[JVM_MAXPATHLEN]; + memset(longest_name, 'a', sizeof(longest_name)); + longest_name[JVM_MAXPATHLEN - 1] = '\0'; + o_result = make_log_name((const char*)&longest_name, NULL); + assert(strcmp(longest_name, o_result) == 0, err_msg("longest name does not match. expected '%s' but got '%s'", longest_name, o_result)); + FREE_C_HEAP_ARRAY(char, o_result, mtInternal); + } + + { + // too long file name + char too_long_name[JVM_MAXPATHLEN + 100]; + int too_long_length = sizeof(too_long_name); + memset(too_long_name, 'a', too_long_length); + too_long_name[too_long_length - 1] = '\0'; + o_result = make_log_name((const char*)&too_long_name, NULL); + assert(o_result == NULL, err_msg("Too long file name should return NULL, but got '%s'", o_result)); + } + + { + // too long with pid + char longest_name[JVM_MAXPATHLEN]; + memset(longest_name, 'a', JVM_MAXPATHLEN); + longest_name[JVM_MAXPATHLEN - 3] = '%'; + longest_name[JVM_MAXPATHLEN - 2] = 'p'; + longest_name[JVM_MAXPATHLEN - 1] = '\0'; + o_result = make_log_name((const char*)&longest_name, NULL); + assert(o_result == NULL, err_msg("Too long file name after %%p pid expansion should return NULL, but got '%s'", o_result)); + } + + { + // too long with pid (star) + char longest_name[JVM_MAXPATHLEN]; + memset(longest_name, 'a', JVM_MAXPATHLEN); + longest_name[JVM_MAXPATHLEN - 2] = '*'; + longest_name[JVM_MAXPATHLEN - 1] = '\0'; + o_result = make_log_name((const char*)&longest_name, NULL); + assert(o_result == NULL, err_msg("Too long file name after star (pid) expansion should return NULL, but got '%s'", o_result)); + } +} #if defined(SOLARIS) || defined(LINUX) || defined(_ALLBSD_SOURCE) #include <sys/types.h>
--- a/src/share/vm/utilities/ostream.hpp Wed Oct 08 13:02:06 2014 -0700 +++ b/src/share/vm/utilities/ostream.hpp Wed Oct 15 10:24:59 2014 -0700 @@ -242,6 +242,10 @@ virtual void rotate_log(); }; +#ifndef PRODUCT +void test_loggc_filename(); +#endif + void ostream_init(); void ostream_init_log(); void ostream_exit();