This commit is contained in:
Alejandro Murillo 2016-05-26 14:17:03 -07:00
commit e3dfc2043d
16 changed files with 78 additions and 34 deletions

View file

@ -36,9 +36,6 @@ endif
################################################################################ ################################################################################
GTEST_TEST_SRC_FILES := $(shell $(FIND) $(HOTSPOT_TOPDIR)/test/native -name \
"test*.cpp" -type f)
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(OPENJDK_TARGET_OS), windows)
GTEST_JVM_MAPFILE := $(JVM_MAPFILE) GTEST_JVM_MAPFILE := $(JVM_MAPFILE)
else else
@ -58,10 +55,12 @@ $(eval $(call SetupNativeCompilation, BUILD_GTEST_LIBJVM, \
TOOLCHAIN := $(JVM_TOOLCHAIN), \ TOOLCHAIN := $(JVM_TOOLCHAIN), \
LIBRARY := jvm, \ LIBRARY := jvm, \
OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \ OUTPUT_DIR := $(JVM_OUTPUTDIR)/gtest, \
EXTRA_FILES := $(GTEST_TEST_SRC_FILES) \
$(GTEST_FRAMEWORK_SRC)/src/gtest-all.cc \
$(GTEST_TEST_SRC)/gtestMain.cpp, \
OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/objs, \ OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/objs, \
SRC := $(GTEST_TEST_SRC), \
EXCLUDES := $(JVM_EXCLUDES), \
EXCLUDE_FILES := gtestLauncher.cpp, \
EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
EXTRA_FILES := $(GTEST_FRAMEWORK_SRC)/src/gtest-all.cc, \
EXTRA_OBJECT_FILES := $(filter-out %/operator_new$(OBJ_SUFFIX), \ EXTRA_OBJECT_FILES := $(filter-out %/operator_new$(OBJ_SUFFIX), \
$(BUILD_LIBJVM_ALL_OBJS)), \ $(BUILD_LIBJVM_ALL_OBJS)), \
CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \ CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \

View file

@ -756,15 +756,9 @@ extern "C" void* thread_native_entry(void* thread_addr) {
} }
} }
// If the creator called set priority before we started, // Our priority was set when we were created, and stored in the
// we need to call set_native_priority now that we have an lwp. // osthread, but couldn't be passed through to our LWP until now.
// We used to get the priority from thr_getprio (we called // So read back the priority and set it again.
// thr_setprio way back in create_thread) and pass it to
// set_native_priority, but Solaris scales the priority
// in java_to_os_priority, so when we read it back here,
// we pass trash to set_native_priority instead of what's
// in java_to_os_priority. So we save the native priority
// in the osThread and recall it here.
if (osthr->thread_id() != -1) { if (osthr->thread_id() != -1) {
if (UseThreadPriorities) { if (UseThreadPriorities) {
@ -1044,6 +1038,10 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
// Remember that we created this thread so we can set priority on it // Remember that we created this thread so we can set priority on it
osthread->set_vm_created(); osthread->set_vm_created();
// Most thread types will set an explicit priority before starting the thread,
// but for those that don't we need a valid value to read back in thread_native_entry.
osthread->set_native_priority(NormPriority);
// Initial thread state is INITIALIZED, not SUSPENDED // Initial thread state is INITIALIZED, not SUSPENDED
osthread->set_state(INITIALIZED); osthread->set_state(INITIALIZED);

View file

@ -5277,7 +5277,8 @@ bool os::check_heap(bool force) {
} }
} }
DWORD err = GetLastError(); DWORD err = GetLastError();
if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) { if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED &&
(err == ERROR_INVALID_FUNCTION && phe.lpData != NULL)) {
HeapUnlock(heap); HeapUnlock(heap);
fatal("heap walk aborted with error %d", err); fatal("heap walk aborted with error %d", err);
} }

View file

@ -382,6 +382,10 @@ void ClassLoaderData::unload() {
} }
log->cr(); log->cr();
} }
// In some rare cases items added to this list will not be freed elsewhere.
// To keep it simple, just free everything in it here.
free_deallocate_list();
} }
PackageEntryTable* ClassLoaderData::packages() { PackageEntryTable* ClassLoaderData::packages() {

View file

@ -38,6 +38,7 @@
CompactHashtableWriter::CompactHashtableWriter(int num_buckets, CompactHashtableWriter::CompactHashtableWriter(int num_buckets,
CompactHashtableStats* stats) { CompactHashtableStats* stats) {
assert(DumpSharedSpaces, "dump-time only"); assert(DumpSharedSpaces, "dump-time only");
assert(num_buckets > 0, "no buckets");
_num_buckets = num_buckets; _num_buckets = num_buckets;
_num_entries = 0; _num_entries = 0;
_buckets = NEW_C_HEAP_ARRAY(GrowableArray<Entry>*, _num_buckets, mtSymbol); _buckets = NEW_C_HEAP_ARRAY(GrowableArray<Entry>*, _num_buckets, mtSymbol);

View file

@ -740,7 +740,8 @@ void StringTable::serialize(SerializeClosure* soc, GrowableArray<MemRegion> *str
} else { } else {
int num_buckets = the_table()->number_of_entries() / int num_buckets = the_table()->number_of_entries() /
SharedSymbolTableBucketSize; SharedSymbolTableBucketSize;
CompactStringTableWriter writer(num_buckets, // calculation of num_buckets can result in zero buckets, we need at least one
CompactStringTableWriter writer(num_buckets > 1 ? num_buckets : 1,
&MetaspaceShared::stats()->string); &MetaspaceShared::stats()->string);
// Copy the interned strings into the "string space" within the java heap // Copy the interned strings into the "string space" within the java heap

View file

@ -545,6 +545,8 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
} }
assert((_conc_workers != NULL) == (ConcGCThreads > 1), assert((_conc_workers != NULL) == (ConcGCThreads > 1),
"Inconsistency"); "Inconsistency");
log_debug(gc)("ConcGCThreads: %u", ConcGCThreads);
log_debug(gc)("ParallelGCThreads: %u", ParallelGCThreads);
// Parallel task queues; these are shared for the // Parallel task queues; these are shared for the
// concurrent and stop-world phases of CMS, but // concurrent and stop-world phases of CMS, but

View file

@ -438,6 +438,8 @@ G1ConcurrentMark::G1ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper*
} }
assert(ConcGCThreads > 0, "Should have been set"); assert(ConcGCThreads > 0, "Should have been set");
log_debug(gc)("ConcGCThreads: %u", ConcGCThreads);
log_debug(gc)("ParallelGCThreads: %u", ParallelGCThreads);
_parallel_marking_threads = ConcGCThreads; _parallel_marking_threads = ConcGCThreads;
_max_parallel_marking_threads = _parallel_marking_threads; _max_parallel_marking_threads = _parallel_marking_threads;

View file

@ -578,11 +578,6 @@ void Test_logconfiguration_subscribe() {
LogConfiguration::disable_logging(); LogConfiguration::disable_logging();
assert(Test_logconfiguration_subscribe_triggered == 3, "subscription not triggered (3)"); assert(Test_logconfiguration_subscribe_triggered == 3, "subscription not triggered (3)");
// We need to renable stderr error logging since "disable_logging" disable it all.
// TestLogSavedConfig log_cfg will only renable stdout for us.
LogConfiguration::parse_log_arguments("stderr", "all=warning", NULL, NULL, log.error_stream());
assert(Test_logconfiguration_subscribe_triggered == 4, "subscription not triggered (3)");
} }
#define LOG_PREFIX_STR "THE_PREFIX " #define LOG_PREFIX_STR "THE_PREFIX "

View file

@ -54,7 +54,7 @@ class LogStdoutOutput : public LogFileStreamOutput {
private: private:
static LogStdoutOutput _instance; static LogStdoutOutput _instance;
LogStdoutOutput() : LogFileStreamOutput(stdout) { LogStdoutOutput() : LogFileStreamOutput(stdout) {
set_config_string("all=off"); set_config_string("all=warning");
} }
virtual bool initialize(const char* options, outputStream* errstream) { virtual bool initialize(const char* options, outputStream* errstream) {
return false; return false;
@ -70,7 +70,7 @@ class LogStderrOutput : public LogFileStreamOutput {
private: private:
static LogStderrOutput _instance; static LogStderrOutput _instance;
LogStderrOutput() : LogFileStreamOutput(stderr) { LogStderrOutput() : LogFileStreamOutput(stderr) {
set_config_string("all=warning"); set_config_string("all=off");
} }
virtual bool initialize(const char* options, outputStream* errstream) { virtual bool initialize(const char* options, outputStream* errstream) {
return false; return false;

View file

@ -50,7 +50,7 @@ LogTagSet::LogTagSet(PrefixWriter prefix_writer, LogTagType t0, LogTagType t1, L
_ntagsets++; _ntagsets++;
// Set the default output to warning and error level for all new tagsets. // Set the default output to warning and error level for all new tagsets.
_output_list.set_output_level(LogOutput::Stderr, LogLevel::Default); _output_list.set_output_level(LogOutput::Stdout, LogLevel::Default);
} }
void LogTagSet::update_decorators(const LogDecorators& decorator) { void LogTagSet::update_decorators(const LogDecorators& decorator) {

View file

@ -43,11 +43,11 @@
// for the x64 platform // for the x64 platform
#define DEFAULT_VTBL_COMMON_CODE_SIZE (1*K) // conservative size of the "common_code" for the x64 platform #define DEFAULT_VTBL_COMMON_CODE_SIZE (1*K) // conservative size of the "common_code" for the x64 platform
#define DEFAULT_SHARED_READ_WRITE_SIZE (NOT_LP64(9*M) LP64_ONLY(10*M)) #define DEFAULT_SHARED_READ_WRITE_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
#define MIN_SHARED_READ_WRITE_SIZE (NOT_LP64(7*M) LP64_ONLY(10*M)) #define MIN_SHARED_READ_WRITE_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
#define DEFAULT_SHARED_READ_ONLY_SIZE (NOT_LP64(9*M) LP64_ONLY(10*M)) #define DEFAULT_SHARED_READ_ONLY_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
#define MIN_SHARED_READ_ONLY_SIZE (NOT_LP64(9*M) LP64_ONLY(10*M)) #define MIN_SHARED_READ_ONLY_SIZE (NOT_LP64(6*M) LP64_ONLY(10*M))
// the MIN_SHARED_MISC_DATA_SIZE and MIN_SHARED_MISC_CODE_SIZE estimates are based on // the MIN_SHARED_MISC_DATA_SIZE and MIN_SHARED_MISC_CODE_SIZE estimates are based on
// the sizes required for dumping the archive using the default classlist. The sizes // the sizes required for dumping the archive using the default classlist. The sizes

View file

@ -1641,7 +1641,6 @@ void Arguments::set_cms_and_parnew_gc_flags() {
} }
log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
log_trace(gc)("ConcGCThreads: %u", ConcGCThreads);
} }
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
@ -1949,7 +1948,6 @@ void Arguments::set_g1_gc_flags() {
} }
log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
log_trace(gc)("ConcGCThreads: %u", ConcGCThreads);
} }
void Arguments::set_gc_specific_flags() { void Arguments::set_gc_specific_flags() {

View file

@ -25,9 +25,9 @@
* @test Test2GbHeap * @test Test2GbHeap
* @bug 8031686 * @bug 8031686
* @summary Regression test to ensure we can start G1 with 2gb heap. * @summary Regression test to ensure we can start G1 with 2gb heap.
* Skip test on 32 bit Windows: it typically does not support the many and large virtual memory reservations needed. * Skip test on 32 bit system: it typically does not support the many and large virtual memory reservations needed.
* @requires (vm.gc == "G1" | vm.gc == "null") * @requires (vm.gc == "G1" | vm.gc == "null")
* @requires !((sun.arch.data.model == "32") & (os.family == "windows")) * @requires vm.bits != "32"
* @key gc * @key gc
* @key regression * @key regression
* @library /testlibrary * @library /testlibrary

View file

@ -0,0 +1,43 @@
/*
* Copyright (c) 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.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test TestDefaultLogOutput
* @summary Ensure logging is default on stdout.
* @modules java.base/jdk.internal.misc
* @library /testlibrary
*/
import jdk.test.lib.ProcessTools;
import jdk.test.lib.OutputAnalyzer;
public class TestDefaultLogOutput {
public static void main(String[] args) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:badTag");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.stdoutShouldMatch("\\[error *\\]\\[logging *\\]");
output.shouldHaveExitValue(1);
}
}

View file

@ -24,7 +24,7 @@
/* /*
* @test * @test
* @library /testlibrary * @library /testlibrary
* * @requires vm.flavor != "minimal"
* @run main/othervm/native -agentlib:SimpleClassFileLoadHook=Foo,XXX,YYY * @run main/othervm/native -agentlib:SimpleClassFileLoadHook=Foo,XXX,YYY
* SimpleClassFileLoadHookTest * SimpleClassFileLoadHookTest
*/ */