diff --git a/.hgtags b/.hgtags index d8806de8e41..08dccf5b560 100644 --- a/.hgtags +++ b/.hgtags @@ -531,3 +531,4 @@ cc4098b3bc10d1c390384289025fea7b0d4b9e93 jdk-13+0 11033c4ada542f9c9a873314b6ecf60af19e8256 jdk-13+1 7496df94b3b79f3da53925d2d137317715f11d97 jdk-12+25 50677f43ac3df9a8684222b8893543c60f3aa0bd jdk-13+2 +de9fd809bb475401aad188eab2264226788aad81 jdk-12+26 diff --git a/make/RunTestsPrebuilt.gmk b/make/RunTestsPrebuilt.gmk index 9d7cba23e63..3ab849ad64e 100644 --- a/make/RunTestsPrebuilt.gmk +++ b/make/RunTestsPrebuilt.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, 2019, 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 @@ -237,7 +237,8 @@ else ifeq ($(OPENJDK_TARGET_OS), solaris) else ifeq ($(OPENJDK_TARGET_OS), windows) NUM_CORES := $(NUMBER_OF_PROCESSORS) MEMORY_SIZE := $(shell \ - $(EXPR) `wmic computersystem get totalphysicalmemory -value | $(GREP) = \ + $(EXPR) `wmic computersystem get totalphysicalmemory -value \ + | $(GREP) = | $(SED) 's/\\r//g' \ | $(CUT) -d "=" -f 2-` / 1024 / 1024 \ ) endif diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4 index f960e16a19e..48dccad5adb 100644 --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -183,7 +183,8 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS], # Additional warnings that are not activated by -Wall and -Wextra WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare \ - -Wunused-function -Wundef -Wunused-value -Wreturn-type" + -Wunused-function -Wundef -Wunused-value -Wreturn-type \ + -Wtrampolines" WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder" WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL" WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX" diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in index 1f2cf97847c..b6d5a126d02 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2019, 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 @@ -729,6 +729,7 @@ MT:=@FIXPATH@ @MT@ RC:=@FIXPATH@ @RC@ DUMPBIN:=@FIXPATH@ @DUMPBIN@ CYGPATH:=@CYGPATH@ +WSLPATH:=@WSLPATH@ LDD:=@LDD@ OTOOL:=@OTOOL@ READELF:=@READELF@ diff --git a/make/hotspot/ide/CreateVSProject.gmk b/make/hotspot/ide/CreateVSProject.gmk index 2040e3a1d37..55188b95c1f 100644 --- a/make/hotspot/ide/CreateVSProject.gmk +++ b/make/hotspot/ide/CreateVSProject.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2019, 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 @@ -46,8 +46,17 @@ ifeq ($(OPENJDK_TARGET_OS), windows) # Helper macro to convert a unix path to a Windows path, suitable for # inclusion in a command line. - FixPath = \ - $(strip $(subst \,\\,$(shell $(CYGPATH) -w $1))) + ifeq ($(OPENJDK_BUILD_OS_ENV), windows.cygwin) + FixPath = \ + $(strip $(subst \,\\,$(shell $(CYGPATH) -w $1))) + FixLinuxExecutable = \ + $(call FixPath, $1) + else ifeq ($(OPENJDK_BUILD_OS_ENV), windows.wsl) + FixPath = \ + $(strip $(subst \,\\,$(shell $(WSLPATH) -w $1))) + FixLinuxExecutable = \ + "%windir%\Sysnative\wsl.exe $1" + endif JVM_DEFINES_client := $(patsubst -D%,%, $(filter -D%, $(JVM_CFLAGS))) EXTRACTED_DEFINES_client := $(addprefix -define , $(JVM_DEFINES_client)) @@ -121,7 +130,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) -platformName x64 \ -buildBase $(call FixPath, $(IDE_OUTPUTDIR)/vs-output) \ -buildSpace $(call FixPath, $(IDE_OUTPUTDIR)) \ - -makeBinary $(call FixPath, $(MAKE)) \ + -makeBinary $(call FixLinuxExecutable, $(MAKE)) \ -makeOutput $(call FixPath, $(JDK_OUTPUTDIR)/bin/server) \ -absoluteInclude $(call FixPath, $(HOTSPOT_OUTPUTDIR)/variant-server/gensrc) \ -absoluteSrcInclude $(call FixPath, $(HOTSPOT_OUTPUTDIR)/variant-server/gensrc) \ diff --git a/make/test/BuildMicrobenchmark.gmk b/make/test/BuildMicrobenchmark.gmk index aeec1b0f9e4..cebf444cafe 100644 --- a/make/test/BuildMicrobenchmark.gmk +++ b/make/test/BuildMicrobenchmark.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2019, 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 @@ -78,7 +78,7 @@ $(eval $(call SetupJavaCompiler, MICROBENCHMARK_JAVA_COMPILER, \ # Build microbenchmark suite for the current JDK $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \ SETUP := MICROBENCHMARK_JAVA_COMPILER, \ - ADD_JAVAC_FLAGS := -cp $(MICROBENCHMARK_CLASSPATH) -Xlint -Werror, \ + ADD_JAVAC_FLAGS := -cp $(MICROBENCHMARK_CLASSPATH) -Xlint -Xlint:-processing -Werror, \ SRC := $(MICROBENCHMARK_SRC), \ BIN := $(MICROBENCHMARK_CLASSES), \ )) diff --git a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp index a95bf5daf44..7894552f67f 100644 --- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp @@ -649,7 +649,7 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod case T_FLOAT: { if (dest->is_single_xmm()) { - if (LP64_ONLY(UseAVX < 2 &&) c->is_zero_float()) { + if (LP64_ONLY(UseAVX <= 2 &&) c->is_zero_float()) { __ xorps(dest->as_xmm_float_reg(), dest->as_xmm_float_reg()); } else { __ movflt(dest->as_xmm_float_reg(), @@ -671,7 +671,7 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod case T_DOUBLE: { if (dest->is_double_xmm()) { - if (LP64_ONLY(UseAVX < 2 &&) c->is_zero_double()) { + if (LP64_ONLY(UseAVX <= 2 &&) c->is_zero_double()) { __ xorpd(dest->as_xmm_double_reg(), dest->as_xmm_double_reg()); } else { __ movdbl(dest->as_xmm_double_reg(), diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index 6e52124df10..0850bec9a45 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -2924,11 +2924,11 @@ instruct MoveVecX2Leg(legVecX dst, vecX src) %{ match(Set dst src); format %{ "movdqu $dst,$src\t! load vector (16 bytes)" %} ins_encode %{ - if (UseAVX < 2 || VM_Version::supports_avx512vl()) { - __ movdqu($dst$$XMMRegister, $src$$XMMRegister); - } else { + if (UseAVX > 2 && !VM_Version::supports_avx512vl()) { int vector_len = 2; __ evmovdquq($dst$$XMMRegister, $src$$XMMRegister, vector_len); + } else { + __ movdqu($dst$$XMMRegister, $src$$XMMRegister); } %} ins_pipe( fpu_reg_reg ); @@ -2939,11 +2939,11 @@ instruct MoveLeg2VecX(vecX dst, legVecX src) %{ match(Set dst src); format %{ "movdqu $dst,$src\t! load vector (16 bytes)" %} ins_encode %{ - if (UseAVX < 2 || VM_Version::supports_avx512vl()) { - __ movdqu($dst$$XMMRegister, $src$$XMMRegister); - } else { + if (UseAVX > 2 && !VM_Version::supports_avx512vl()) { int vector_len = 2; __ evmovdquq($dst$$XMMRegister, $src$$XMMRegister, vector_len); + } else { + __ movdqu($dst$$XMMRegister, $src$$XMMRegister); } %} ins_pipe( fpu_reg_reg ); @@ -2966,11 +2966,11 @@ instruct MoveVecY2Leg(legVecY dst, vecY src) %{ match(Set dst src); format %{ "vmovdqu $dst,$src\t! load vector (32 bytes)" %} ins_encode %{ - if (UseAVX < 2 || VM_Version::supports_avx512vl()) { - __ vmovdqu($dst$$XMMRegister, $src$$XMMRegister); - } else { + if (UseAVX > 2 && !VM_Version::supports_avx512vl()) { int vector_len = 2; __ evmovdquq($dst$$XMMRegister, $src$$XMMRegister, vector_len); + } else { + __ vmovdqu($dst$$XMMRegister, $src$$XMMRegister); } %} ins_pipe( fpu_reg_reg ); @@ -2981,11 +2981,11 @@ instruct MoveLeg2VecY(vecY dst, legVecY src) %{ match(Set dst src); format %{ "vmovdqu $dst,$src\t! load vector (32 bytes)" %} ins_encode %{ - if (UseAVX < 2 || VM_Version::supports_avx512vl()) { - __ vmovdqu($dst$$XMMRegister, $src$$XMMRegister); - } else { + if (UseAVX > 2 && !VM_Version::supports_avx512vl()) { int vector_len = 2; __ evmovdquq($dst$$XMMRegister, $src$$XMMRegister, vector_len); + } else { + __ vmovdqu($dst$$XMMRegister, $src$$XMMRegister); } %} ins_pipe( fpu_reg_reg ); diff --git a/src/hotspot/os/bsd/os_bsd.cpp b/src/hotspot/os/bsd/os_bsd.cpp index 5c59dcdd02f..fd007ae527e 100644 --- a/src/hotspot/os/bsd/os_bsd.cpp +++ b/src/hotspot/os/bsd/os_bsd.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2019, 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 @@ -2256,7 +2256,8 @@ void os::naked_yield() { // not the entire user process, and user level threads are 1:1 mapped to kernel // threads. It has always been the case, but could change in the future. For // this reason, the code should not be used as default (ThreadPriorityPolicy=0). -// It is only used when ThreadPriorityPolicy=1 and requires root privilege. +// It is only used when ThreadPriorityPolicy=1 and may require system level permission +// (e.g., root privilege or CAP_SYS_NICE capability). #if !defined(__APPLE__) int os::java_to_os_priority[CriticalPriority + 1] = { @@ -2303,14 +2304,12 @@ int os::java_to_os_priority[CriticalPriority + 1] = { static int prio_init() { if (ThreadPriorityPolicy == 1) { - // Only root can raise thread priority. Don't allow ThreadPriorityPolicy=1 - // if effective uid is not root. Perhaps, a more elegant way of doing - // this is to test CAP_SYS_NICE capability, but that will require libcap.so if (geteuid() != 0) { if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy)) { - warning("-XX:ThreadPriorityPolicy requires root privilege on Bsd"); + warning("-XX:ThreadPriorityPolicy=1 may require system level permission, " \ + "e.g., being the root user. If the necessary permission is not " \ + "possessed, changes to priority will be silently ignored."); } - ThreadPriorityPolicy = 0; } } if (UseCriticalJavaThreadPriority) { @@ -2327,6 +2326,7 @@ OSReturn os::set_native_priority(Thread* thread, int newpri) { return OS_OK; #elif defined(__FreeBSD__) int ret = pthread_setprio(thread->osthread()->pthread_id(), newpri); + return (ret == 0) ? OS_OK : OS_ERR; #elif defined(__APPLE__) || defined(__NetBSD__) struct sched_param sp; int policy; diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp index 079ed8943af..17a75bd458e 100644 --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2019, 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 @@ -4076,7 +4076,8 @@ void os::naked_yield() { // not the entire user process, and user level threads are 1:1 mapped to kernel // threads. It has always been the case, but could change in the future. For // this reason, the code should not be used as default (ThreadPriorityPolicy=0). -// It is only used when ThreadPriorityPolicy=1 and requires root privilege. +// It is only used when ThreadPriorityPolicy=1 and may require system level permission +// (e.g., root privilege or CAP_SYS_NICE capability). int os::java_to_os_priority[CriticalPriority + 1] = { 19, // 0 Entry should never be used @@ -4100,14 +4101,12 @@ int os::java_to_os_priority[CriticalPriority + 1] = { static int prio_init() { if (ThreadPriorityPolicy == 1) { - // Only root can raise thread priority. Don't allow ThreadPriorityPolicy=1 - // if effective uid is not root. Perhaps, a more elegant way of doing - // this is to test CAP_SYS_NICE capability, but that will require libcap.so if (geteuid() != 0) { if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy)) { - warning("-XX:ThreadPriorityPolicy requires root privilege on Linux"); + warning("-XX:ThreadPriorityPolicy=1 may require system level permission, " \ + "e.g., being the root user. If the necessary permission is not " \ + "possessed, changes to priority will be silently ignored."); } - ThreadPriorityPolicy = 0; } } if (UseCriticalJavaThreadPriority) { diff --git a/src/hotspot/share/code/codeHeapState.cpp b/src/hotspot/share/code/codeHeapState.cpp index 8d03c8afa0c..c21235ea10f 100644 --- a/src/hotspot/share/code/codeHeapState.cpp +++ b/src/hotspot/share/code/codeHeapState.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -1976,7 +1976,7 @@ void CodeHeapState::print_age(outputStream* out, CodeHeap* heap) { ast->print_cr(" The age of a compiled method in the CodeHeap is not available as a\n" " time stamp. Instead, a relative age is deducted from the method's compilation ID.\n" " Age information is available for tier1 and tier2 methods only. There is no\n" - " age information for stubs and blobs, because they have no compilation ID assigned.\n" + " age information for stubs and blobs, because they have no compilation ID assigned.\n" " Information for the youngest method (highest ID) in the granule is printed.\n" " Refer to the legend to learn how method age is mapped to the displayed digit."); print_age_legend(ast); diff --git a/src/hotspot/share/compiler/methodMatcher.cpp b/src/hotspot/share/compiler/methodMatcher.cpp index ac78ce77da9..8cd2b922081 100644 --- a/src/hotspot/share/compiler/methodMatcher.cpp +++ b/src/hotspot/share/compiler/methodMatcher.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, 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 @@ -237,6 +237,12 @@ void skip_leading_spaces(char*& line, int* total_bytes_read ) { } } +#ifdef _MSC_VER +#pragma warning(push) +// warning C4189: The file contains a character that cannot be represented +// in the current code page +#pragma warning(disable : 4819) +#endif void MethodMatcher::parse_method_pattern(char*& line, const char*& error_msg, MethodMatcher* matcher) { MethodMatcher::Mode c_match; MethodMatcher::Mode m_match; @@ -306,6 +312,9 @@ void MethodMatcher::parse_method_pattern(char*& line, const char*& error_msg, Me error_msg = "Could not parse method pattern"; } } +#ifdef _MSC_VER +#pragma warning(pop) +#endif bool MethodMatcher::matches(const methodHandle& method) const { Symbol* class_name = method->method_holder()->name(); diff --git a/src/hotspot/share/gc/z/zReferenceProcessor.cpp b/src/hotspot/share/gc/z/zReferenceProcessor.cpp index 29ef2ea765b..d0c430de972 100644 --- a/src/hotspot/share/gc/z/zReferenceProcessor.cpp +++ b/src/hotspot/share/gc/z/zReferenceProcessor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, 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 @@ -68,9 +68,9 @@ void ZReferenceProcessor::update_soft_reference_clock() const { java_lang_ref_SoftReference::set_clock(now); } -bool ZReferenceProcessor::is_reference_inactive(oop obj) const { - // A non-null next field means the reference is inactive - return java_lang_ref_Reference::next(obj) != NULL; +bool ZReferenceProcessor::is_inactive_final_reference(oop obj, ReferenceType type) const { + // A non-null next field for a FinalReference means the reference is inactive. + return (type == REF_FINAL) && (java_lang_ref_Reference::next(obj) != NULL); } ReferenceType ZReferenceProcessor::reference_type(oop obj) const { @@ -167,11 +167,6 @@ bool ZReferenceProcessor::should_mark_referent(ReferenceType type) const { return type == REF_FINAL; } -bool ZReferenceProcessor::should_clear_referent(ReferenceType type) const { - // Referents that were not marked must be cleared - return !should_mark_referent(type); -} - void ZReferenceProcessor::keep_referent_alive(oop obj, ReferenceType type) const { volatile oop* const p = reference_referent_addr(obj); if (type == REF_PHANTOM) { @@ -192,8 +187,8 @@ bool ZReferenceProcessor::discover_reference(oop obj, ReferenceType type) { // Update statistics _encountered_count.get()[type]++; - if (is_reference_inactive(obj) || - is_referent_strongly_alive_or_null(obj, type) || + if (is_referent_strongly_alive_or_null(obj, type) || + is_inactive_final_reference(obj, type) || is_referent_softly_alive(obj, type)) { // Not discovered return false; @@ -242,23 +237,19 @@ oop* ZReferenceProcessor::keep(oop obj, ReferenceType type) { // Update statistics _enqueued_count.get()[type]++; - // Clear referent - if (should_clear_referent(type)) { + if (type != REF_FINAL) { + // Clear referent java_lang_ref_Reference::set_referent(obj, NULL); + } else { + // For a FinalReference, don't clear the referent, because it is + // needed for the finalize call. Instead, make the reference + // inactive by self-looping the 'next' field. FinalReference + // doesn't allow Reference.enqueue, so there's no race to worry + // about when setting 'next'. + assert(java_lang_ref_Reference::next(obj) == NULL, "enqueued FinalReference"); + java_lang_ref_Reference::set_next_raw(obj, obj); } - // Make reference inactive by self-looping the next field. We could be racing with a - // call to Reference.enqueue() from the application, which is why we are using a CAS - // to make sure we change the next field only if it is NULL. A failing CAS means the - // reference has already been enqueued. However, we don't check the result of the CAS, - // since we still have no option other than keeping the reference on the pending list. - // It's ok to have the reference both on the pending list and enqueued at the same - // time (the pending list is linked through the discovered field, while the reference - // queue is linked through the next field). When the ReferenceHandler thread later - // calls Reference.enqueue() we detect that it has already been enqueued and drop it. - oop* const next_addr = (oop*)java_lang_ref_Reference::next_addr_raw(obj); - Atomic::cmpxchg(obj, next_addr, oop(NULL)); - // Return next in list return (oop*)java_lang_ref_Reference::discovered_addr_raw(obj); } diff --git a/src/hotspot/share/gc/z/zReferenceProcessor.hpp b/src/hotspot/share/gc/z/zReferenceProcessor.hpp index de2e9f351d5..14041cc4061 100644 --- a/src/hotspot/share/gc/z/zReferenceProcessor.hpp +++ b/src/hotspot/share/gc/z/zReferenceProcessor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, 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 @@ -52,12 +52,11 @@ private: const char* reference_type_name(ReferenceType type) const; volatile oop* reference_referent_addr(oop obj) const; oop reference_referent(oop obj) const; - bool is_reference_inactive(oop obj) const; + bool is_inactive_final_reference(oop obj, ReferenceType type) const; bool is_referent_strongly_alive_or_null(oop obj, ReferenceType type) const; bool is_referent_softly_alive(oop obj, ReferenceType type) const; bool should_drop_reference(oop obj, ReferenceType type) const; bool should_mark_referent(ReferenceType type) const; - bool should_clear_referent(ReferenceType type) const; void keep_referent_alive(oop obj, ReferenceType type) const; void discover(oop obj, ReferenceType type); diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp index 5e259992f78..ca2c04b29fc 100644 --- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.cpp @@ -164,7 +164,7 @@ bool JfrSymbolId::is_unsafe_anonymous_klass(const Klass* k) { uintptr_t JfrSymbolId::unsafe_anonymous_klass_name_hash_code(const InstanceKlass* ik) { assert(ik != NULL, "invariant"); assert(ik->is_unsafe_anonymous(), "invariant"); - const oop mirror = ik->java_mirror(); + const oop mirror = ik->java_mirror_no_keepalive(); assert(mirror != NULL, "invariant"); return (uintptr_t)mirror->identity_hash(); } @@ -174,7 +174,7 @@ const char* JfrSymbolId::create_unsafe_anonymous_klass_symbol(const InstanceKlas assert(ik->is_unsafe_anonymous(), "invariant"); assert(0 == hashcode, "invariant"); char* anonymous_symbol = NULL; - const oop mirror = ik->java_mirror(); + const oop mirror = ik->java_mirror_no_keepalive(); assert(mirror != NULL, "invariant"); char hash_buf[40]; hashcode = unsafe_anonymous_klass_name_hash_code(ik); diff --git a/src/hotspot/share/oops/metadata.hpp b/src/hotspot/share/oops/metadata.hpp index c511b4a035a..8acdd88c9ae 100644 --- a/src/hotspot/share/oops/metadata.hpp +++ b/src/hotspot/share/oops/metadata.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2019, 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 @@ -39,9 +39,6 @@ class Metadata : public MetaspaceObj { int identity_hash() { return (int)(uintptr_t)this; } - // Rehashing support for tables containing pointers to this - unsigned int new_hash(juint seed) { ShouldNotReachHere(); return 0; } - virtual bool is_metadata() const volatile { return true; } virtual bool is_klass() const volatile { return false; } virtual bool is_method() const volatile { return false; } diff --git a/src/hotspot/share/oops/oop.cpp b/src/hotspot/share/oops/oop.cpp index eda422cb305..ab0a89dce2a 100644 --- a/src/hotspot/share/oops/oop.cpp +++ b/src/hotspot/share/oops/oop.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ -97,21 +97,6 @@ intptr_t oopDesc::slow_identity_hash() { return ObjectSynchronizer::identity_hash_value_for(object); } -// When String table needs to rehash -unsigned int oopDesc::new_hash(juint seed) { - EXCEPTION_MARK; - ResourceMark rm; - int length; - jchar* chars = java_lang_String::as_unicode_string(this, length, THREAD); - if (chars != NULL) { - // Use alternate hashing algorithm on the string - return AltHashing::murmur3_32(seed, chars, length); - } else { - vm_exit_out_of_memory(length, OOM_MALLOC_ERROR, "unable to create Unicode strings for String table rehash"); - return 0; - } -} - // used only for asserts and guarantees bool oopDesc::is_oop(oop obj, bool ignore_mark_word) { if (!Universe::heap()->is_oop(obj)) { diff --git a/src/hotspot/share/oops/oop.hpp b/src/hotspot/share/oops/oop.hpp index f673c98b452..f8c996d9030 100644 --- a/src/hotspot/share/oops/oop.hpp +++ b/src/hotspot/share/oops/oop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ -308,9 +308,6 @@ class oopDesc { inline intptr_t identity_hash(); intptr_t slow_identity_hash(); - // Alternate hashing code if string table is rehashed - unsigned int new_hash(juint seed); - // marks are forwarded to stack when object is locked inline bool has_displaced_mark_raw() const; inline markOop displaced_mark_raw() const; diff --git a/src/hotspot/share/oops/symbol.cpp b/src/hotspot/share/oops/symbol.cpp index 800a652712c..94218c05475 100644 --- a/src/hotspot/share/oops/symbol.cpp +++ b/src/hotspot/share/oops/symbol.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ -212,13 +212,6 @@ const char* Symbol::as_klass_external_name() const { return str; } -// Alternate hashing for unbalanced symbol tables. -unsigned int Symbol::new_hash(juint seed) { - ResourceMark rm; - // Use alternate hashing algorithm on this symbol. - return AltHashing::murmur3_32(seed, (const jbyte*)as_C_string(), utf8_length()); -} - // Increment refcount while checking for zero. If the Symbol's refcount becomes zero // a thread could be concurrently removing the Symbol. This is used during SymbolTable // lookup to avoid reviving a dead Symbol. diff --git a/src/hotspot/share/oops/symbol.hpp b/src/hotspot/share/oops/symbol.hpp index ac74c674af8..20b58bfc6a7 100644 --- a/src/hotspot/share/oops/symbol.hpp +++ b/src/hotspot/share/oops/symbol.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2019, 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 @@ -164,9 +164,6 @@ class Symbol : public MetaspaceObj { ((addr_bits ^ (length() << 8) ^ (( _body[0] << 8) | _body[1])) << 16); } - // For symbol table alternate hashing - unsigned int new_hash(juint seed); - // Reference counting. See comments above this class for when to use. int refcount() const { return extract_refcount(_length_and_refcount); } bool try_increment_refcount(); diff --git a/src/hotspot/share/opto/loopTransform.cpp b/src/hotspot/share/opto/loopTransform.cpp index 209acbdffe0..6bd26b740c7 100644 --- a/src/hotspot/share/opto/loopTransform.cpp +++ b/src/hotspot/share/opto/loopTransform.cpp @@ -354,6 +354,10 @@ bool IdealLoopTree::policy_peeling( PhaseIdealLoop *phase ) const { // check for vectorized loops, any peeling done was already applied if (_head->is_CountedLoop() && _head->as_CountedLoop()->do_unroll_only()) return false; + if (_head->is_CountedLoop() && _head->as_CountedLoop()->trip_count() == 1) { + return false; + } + while( test != _head ) { // Scan till run off top of loop if( test->is_If() ) { // Test? Node *ctrl = phase->get_ctrl(test->in(1)); @@ -2035,13 +2039,20 @@ void PhaseIdealLoop::mark_reductions(IdealLoopTree *loop) { //------------------------------adjust_limit----------------------------------- // Helper function for add_constraint(). -Node* PhaseIdealLoop::adjust_limit(int stride_con, Node * scale, Node *offset, Node *rc_limit, Node *loop_limit, Node *pre_ctrl) { +Node* PhaseIdealLoop::adjust_limit(int stride_con, Node * scale, Node *offset, Node *rc_limit, Node *loop_limit, Node *pre_ctrl, bool round_up) { // Compute "I :: (limit-offset)/scale" Node *con = new SubINode(rc_limit, offset); register_new_node(con, pre_ctrl); Node *X = new DivINode(0, con, scale); register_new_node(X, pre_ctrl); + // When the absolute value of scale is greater than one, the integer + // division may round limit down so add one to the limit. + if (round_up) { + X = new AddINode(X, _igvn.intcon(1)); + register_new_node(X, pre_ctrl); + } + // Adjust loop limit loop_limit = (stride_con > 0) ? (Node*)(new MinINode(loop_limit, X)) @@ -2082,7 +2093,7 @@ void PhaseIdealLoop::add_constraint( int stride_con, int scale_con, Node *offset // (upper_limit-offset) may overflow or underflow. // But it is fine since main loop will either have // less iterations or will be skipped in such case. - *main_limit = adjust_limit(stride_con, scale, offset, upper_limit, *main_limit, pre_ctrl); + *main_limit = adjust_limit(stride_con, scale, offset, upper_limit, *main_limit, pre_ctrl, false); // The underflow limit: low_limit <= scale*I+offset. // For pre-loop compute @@ -2117,7 +2128,8 @@ void PhaseIdealLoop::add_constraint( int stride_con, int scale_con, Node *offset // max(pre_limit, original_limit) is used in do_range_check(). } // Pass (-stride) to indicate pre_loop_cond = NOT(main_loop_cond); - *pre_limit = adjust_limit((-stride_con), scale, offset, low_limit, *pre_limit, pre_ctrl); + *pre_limit = adjust_limit((-stride_con), scale, offset, low_limit, *pre_limit, pre_ctrl, + scale_con > 1 && stride_con > 0); } else { // stride_con*scale_con < 0 // For negative stride*scale pre-loop checks for overflow and @@ -2143,7 +2155,8 @@ void PhaseIdealLoop::add_constraint( int stride_con, int scale_con, Node *offset Node *plus_one = new AddINode(offset, one); register_new_node( plus_one, pre_ctrl ); // Pass (-stride) to indicate pre_loop_cond = NOT(main_loop_cond); - *pre_limit = adjust_limit((-stride_con), scale, plus_one, upper_limit, *pre_limit, pre_ctrl); + *pre_limit = adjust_limit((-stride_con), scale, plus_one, upper_limit, *pre_limit, pre_ctrl, + scale_con < -1 && stride_con > 0); if (low_limit->get_int() == -max_jint) { // We need this guard when scale*main_limit+offset >= limit @@ -2177,7 +2190,8 @@ void PhaseIdealLoop::add_constraint( int stride_con, int scale_con, Node *offset // I > (low_limit-(offset+1))/scale // ) - *main_limit = adjust_limit(stride_con, scale, plus_one, low_limit, *main_limit, pre_ctrl); + *main_limit = adjust_limit(stride_con, scale, plus_one, low_limit, *main_limit, pre_ctrl, + false); } } diff --git a/src/hotspot/share/opto/loopnode.hpp b/src/hotspot/share/opto/loopnode.hpp index 064ced8f9e2..930a991f25d 100644 --- a/src/hotspot/share/opto/loopnode.hpp +++ b/src/hotspot/share/opto/loopnode.hpp @@ -1190,7 +1190,7 @@ public: // loop. Scale_con, offset and limit are all loop invariant. void add_constraint( int stride_con, int scale_con, Node *offset, Node *low_limit, Node *upper_limit, Node *pre_ctrl, Node **pre_limit, Node **main_limit ); // Helper function for add_constraint(). - Node* adjust_limit( int stride_con, Node * scale, Node *offset, Node *rc_limit, Node *loop_limit, Node *pre_ctrl ); + Node* adjust_limit(int stride_con, Node * scale, Node *offset, Node *rc_limit, Node *loop_limit, Node *pre_ctrl, bool round_up); // Partially peel loop up through last_peel node. bool partial_peel( IdealLoopTree *loop, Node_List &old_new ); diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 5c10769a162..dc38268aaac 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -3088,6 +3088,10 @@ jint Arguments::finalize_vm_init_args(bool patch_mod_javabase) { BytecodeVerificationRemote = true; log_info(cds)("All non-system classes will be verified (-Xverify:remote) during CDS dump time."); } + + // Compilation is already disabled if the user specifies -Xshare:dump. + // Disable compilation in case user specifies -XX:+DumpSharedSpaces instead of -Xshare:dump. + set_mode_flags(_int); } if (UseSharedSpaces && patch_mod_javabase) { no_shared_spaces("CDS is disabled when " JAVA_BASE_NAME " module is patched."); diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp index ede99612e3e..fe97ddac760 100644 --- a/src/hotspot/share/runtime/globals.hpp +++ b/src/hotspot/share/runtime/globals.hpp @@ -2049,7 +2049,8 @@ define_pd_global(uint64_t,MaxRAM, 1ULL*G); " to higher native thread priorities. This policy should be "\ " used with care, as sometimes it can cause performance "\ " degradation in the application and/or the entire system. On "\ - " Linux this policy requires root privilege.") \ + " Linux/BSD/macOS this policy requires root privilege or an "\ + " extended capability.") \ range(0, 1) \ \ product(bool, ThreadPriorityVerbose, false, \ diff --git a/src/java.base/share/classes/java/lang/System.java b/src/java.base/share/classes/java/lang/System.java index 42b97d670fe..9c51536bed1 100644 --- a/src/java.base/share/classes/java/lang/System.java +++ b/src/java.base/share/classes/java/lang/System.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2019, 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 @@ -984,7 +984,7 @@ public final class System { *

If a security manager exists, its * {@link SecurityManager#checkPermission checkPermission} * method is called with a - * {@code {@link RuntimePermission}("getenv."+name)} + * {@link RuntimePermission RuntimePermission("getenv."+name)} * permission. This may result in a {@link SecurityException} * being thrown. If no exception is thrown the value of the * variable {@code name} is returned. @@ -1055,7 +1055,7 @@ public final class System { *

If a security manager exists, its * {@link SecurityManager#checkPermission checkPermission} * method is called with a - * {@code {@link RuntimePermission}("getenv.*")} permission. + * {@link RuntimePermission RuntimePermission("getenv.*")} permission. * This may result in a {@link SecurityException} being thrown. * *

When passing information to a Java subprocess, diff --git a/src/java.base/windows/classes/java/lang/ProcessImpl.java b/src/java.base/windows/classes/java/lang/ProcessImpl.java index b2208faf849..5bbaa853b19 100644 --- a/src/java.base/windows/classes/java/lang/ProcessImpl.java +++ b/src/java.base/windows/classes/java/lang/ProcessImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2019, 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 @@ -106,6 +106,7 @@ final class ProcessImpl extends Process { FileOutputStream f2 = null; try { + boolean forceNullOutputStream = false; long[] stdHandles; if (redirects == null) { stdHandles = new long[] { -1L, -1L, -1L }; @@ -129,6 +130,9 @@ final class ProcessImpl extends Process { stdHandles[1] = fdAccess.getHandle(FileDescriptor.out); } else if (redirects[1] instanceof ProcessBuilder.RedirectPipeImpl) { stdHandles[1] = fdAccess.getHandle(((ProcessBuilder.RedirectPipeImpl) redirects[1]).getFd()); + // Force getInputStream to return a null stream, + // the handle is directly assigned to the next process. + forceNullOutputStream = true; } else { f1 = newFileOutputStream(redirects[1].file(), redirects[1].append()); @@ -149,7 +153,7 @@ final class ProcessImpl extends Process { } Process p = new ProcessImpl(cmdarray, envblock, dir, - stdHandles, redirectErrorStream); + stdHandles, forceNullOutputStream, redirectErrorStream); if (redirects != null) { // Copy the handles's if they are to be redirected to another process if (stdHandles[0] >= 0 @@ -349,6 +353,7 @@ final class ProcessImpl extends Process { final String envblock, final String path, final long[] stdHandles, + boolean forceNullOutputStream, final boolean redirectErrorStream) throws IOException { @@ -437,7 +442,7 @@ final class ProcessImpl extends Process { new FileOutputStream(stdin_fd)); } - if (stdHandles[1] == -1L) + if (stdHandles[1] == -1L || forceNullOutputStream) stdout_stream = ProcessBuilder.NullInputStream.INSTANCE; else { FileDescriptor stdout_fd = new FileDescriptor(); diff --git a/src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java b/src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java index 0dfe2a194ae..32bc9a3a1ea 100644 --- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java +++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java @@ -305,6 +305,8 @@ public enum HtmlTag { STRONG(BlockType.INLINE, EndKind.REQUIRED, EnumSet.of(Flag.EXPECT_CONTENT)), + STYLE(BlockType.OTHER, EndKind.REQUIRED), + SUB(BlockType.INLINE, EndKind.REQUIRED, EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)), diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java index 16f07e67229..b4280ad4252 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java @@ -31,6 +31,7 @@ import com.sun.source.doctree.DocTree; import com.sun.source.doctree.EndElementTree; import com.sun.source.doctree.StartElementTree; import com.sun.source.doctree.TextTree; +import com.sun.source.util.DocTreeFactory; import com.sun.source.util.SimpleDocTreeVisitor; import com.sun.tools.doclint.HtmlTag; import com.sun.tools.doclint.HtmlTag.Attr; @@ -43,6 +44,7 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocFile; import jdk.javadoc.internal.doclets.toolkit.util.DocFileIOException; import jdk.javadoc.internal.doclets.toolkit.util.DocPath; import jdk.javadoc.internal.doclets.toolkit.util.DocPaths; +import jdk.javadoc.internal.doclets.toolkit.util.DocletConstants; import jdk.javadoc.internal.doclets.toolkit.util.Utils; import javax.lang.model.element.Element; @@ -51,6 +53,7 @@ import javax.lang.model.element.PackageElement; import javax.tools.FileObject; import javax.tools.JavaFileManager.Location; +import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -140,13 +143,12 @@ public class DocFilesHandlerImpl implements DocFilesHandler { srcfile.getPath(), dstdir.getPath()); } else { if (Utils.toLowerCase(srcfile.getPath()).endsWith(".html")) { - if (handleHtmlFile(srcfile, dstDocPath)) { - continue; - } + handleHtmlFile(srcfile, dstDocPath); + } else { + configuration.messages.notice("doclet.Copying_File_0_To_Dir_1", + srcfile.getPath(), dstdir.getPath()); + destfile.copyFile(srcfile); } - configuration.messages.notice("doclet.Copying_File_0_To_Dir_1", - srcfile.getPath(), dstdir.getPath()); - destfile.copyFile(srcfile); } } else if (srcfile.isDirectory()) { if (configuration.copydocfilesubdirs @@ -158,19 +160,18 @@ public class DocFilesHandlerImpl implements DocFilesHandler { } } - private boolean handleHtmlFile(DocFile srcfile, DocPath dstPath) throws DocFileIOException { + private void handleHtmlFile(DocFile srcfile, DocPath dstPath) throws DocFileIOException { Utils utils = configuration.utils; FileObject fileObject = srcfile.getFileObject(); DocFileElement dfElement = new DocFileElement(element, fileObject); - if (shouldPassThrough(utils.getPreamble(dfElement))) { - return false; - } - DocPath dfilePath = dstPath.resolve(srcfile.getName()); HtmlDocletWriter docletWriter = new DocFileWriter(configuration, dfilePath, element); configuration.messages.notice("doclet.Generating_0", docletWriter.filename.getPath()); + List localTags = getLocalHeaderTags(utils.getPreamble(dfElement)); + Content localTagsContent = docletWriter.commentTagsToContent(null, dfElement, localTags, false); + String title = getWindowTitle(docletWriter, dfElement).trim(); HtmlTree htmlContent = docletWriter.getBody(true, title); docletWriter.addTop(htmlContent); @@ -193,70 +194,61 @@ public class DocFilesHandlerImpl implements DocFilesHandler { navBar.setUserFooter(docletWriter.getUserHeaderFooter(false)); htmlContent.addContent(navBar.getContent(false)); docletWriter.addBottom(htmlContent); - docletWriter.printHtmlDocument(Collections.emptyList(), false, htmlContent); - return true; + docletWriter.printHtmlDocument(Collections.emptyList(), false, localTagsContent, htmlContent); } - private boolean shouldPassThrough(List dtrees) { - SimpleDocTreeVisitor check = new SimpleDocTreeVisitor() { - @Override - public Boolean visitStartElement(StartElementTree node, Boolean p) { - if (Utils.toLowerCase(node.getName().toString()).equals((Attr.STYLE.getText()))) { - return true; - } - if (Utils.toLowerCase(node.getName().toString()).equals(HtmlTag.LINK.getText())) { - for (DocTree dt : node.getAttributes()) { - if (this.visit(dt, true)) - return true; - } - } - return false; - } - - @Override - public Boolean visitAttribute(AttributeTree node, Boolean p) { - if (p == null || p == false) { - return false; - } - if (Utils.toLowerCase(node.getName().toString()).equals("rel")) { - for (DocTree dt : node.getValue()) { - Boolean found = new SimpleDocTreeVisitor() { - - @Override - public Boolean visitText(TextTree node, ValueKind valueKind) { - switch (valueKind) { - case EMPTY: - return false; - default: - return Utils.toLowerCase(node.getBody()).equals("stylesheet"); - } - } - - @Override - protected Boolean defaultAction(DocTree node, ValueKind valueKind) { - return false; - } - - }.visit(dt, node.getValueKind()); - - if (found) - return true; - } - } - return false; - } - - @Override - protected Boolean defaultAction(DocTree node, Boolean p) { - return false; - } - }; + private List getLocalHeaderTags(List dtrees) { + List localTags = new ArrayList<>(); + DocTreeFactory docTreeFactory = configuration.docEnv.getDocTrees().getDocTreeFactory(); + boolean inHead = false; + boolean inTitle = false; + loop: for (DocTree dt : dtrees) { - if (check.visit(dt, false)) - return true; + switch (dt.getKind()) { + case START_ELEMENT: + StartElementTree startElem = (StartElementTree)dt; + switch (HtmlTag.get(startElem.getName())) { + case HEAD: + inHead = true; + break; + case META: + break; + case TITLE: + inTitle = true; + break; + default: + if (inHead) { + localTags.add(startElem); + localTags.add(docTreeFactory.newTextTree(DocletConstants.NL)); + } + } + break; + case END_ELEMENT: + EndElementTree endElem = (EndElementTree)dt; + switch (HtmlTag.get(endElem.getName())) { + case HEAD: + inHead = false; + break loop; + case TITLE: + inTitle = false; + break; + default: + if (inHead) { + localTags.add(endElem); + localTags.add(docTreeFactory.newTextTree(DocletConstants.NL)); + } + } + break; + case ENTITY: + case TEXT: + if (inHead && !inTitle) { + localTags.add(dt); + } + break; + } } - return false; + return localTags; } private String getWindowTitle(HtmlDocletWriter docletWriter, Element element) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java index 967f276b45c..e8f36e75837 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java @@ -427,7 +427,24 @@ public class HtmlDocletWriter { * @throws DocFileIOException if there is a problem writing the file */ public void printHtmlDocument(List metakeywords, boolean includeScript, - Content body) throws DocFileIOException { + Content body) throws DocFileIOException { + printHtmlDocument(metakeywords, includeScript, new ContentBuilder(), body); + } + + /** + * Generates the HTML document tree and prints it out. + * + * @param metakeywords Array of String keywords for META tag. Each element + * of the array is assigned to a separate META tag. + * Pass in null for no array + * @param includeScript true if printing windowtitle script + * false for files that appear in the left-hand frames + * @param extraContent any additional content to be included in the HEAD element + * @param body the body htmltree to be included in the document + * @throws DocFileIOException if there is a problem writing the file + */ + public void printHtmlDocument(List metakeywords, boolean includeScript, Content extraContent, + Content body) throws DocFileIOException { DocType htmlDocType = DocType.forVersion(configuration.htmlVersion); Content htmlComment = contents.newPage; Head head = new Head(path, configuration.htmlVersion, configuration.docletVersion) @@ -437,7 +454,8 @@ public class HtmlDocletWriter { .addKeywords(metakeywords) .setStylesheets(configuration.getMainStylesheet(), configuration.getAdditionalStylesheets()) .setUseModuleDirectories(configuration.useModuleDirectories) - .setIndex(configuration.createindex, mainBodyScript); + .setIndex(configuration.createindex, mainBodyScript) + .addContent(extraContent); Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body); HtmlDocument htmlDocument = new HtmlDocument(htmlDocType, htmlComment, htmlTree); diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java index 525464a963e..3bd4ad4189b 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java @@ -254,10 +254,6 @@ public class Head { tree.addContent(HtmlTree.META("keywords", k)); } - for (Content c : extraContent) { - tree.addContent(c); - } - if (canonicalLink != null) { HtmlTree link = new HtmlTree(HtmlTag.LINK); link.addAttr(HtmlAttr.REL, "canonical"); @@ -267,6 +263,7 @@ public class Head { addStylesheets(tree); addScripts(tree); + extraContent.forEach(tree::addContent); return tree; } diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index bdab3dea045..f49bf1c7a4e 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -61,6 +61,8 @@ compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all compiler/runtime/Test8168712.java 8211769,8211771 generic-ppc64,generic-ppc64le,linux-s390x +compiler/loopopts/PeelingZeroTripCount.java 8216135 generic-all + ############################################################################# # :hotspot_gc @@ -85,6 +87,7 @@ runtime/appcds/javaldr/GCSharedStringsDuringDump.java 8208778 macosx-x64 runtime/appcds/javaldr/GCDuringDump.java 8208778 macosx-x64 runtime/appcds/jigsaw/classpathtests/EmptyClassInBootClassPath.java 8213299 generic-all runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all +runtime/handshake/HandshakeWalkSuspendExitTest.java 8214174 generic-all runtime/RedefineTests/RedefineRunningMethods.java 8208778 macosx-x64 runtime/SharedArchiveFile/SASymbolTableTest.java 8193639 solaris-all diff --git a/test/hotspot/jtreg/compiler/loopopts/PeelingZeroTripCount.java b/test/hotspot/jtreg/compiler/loopopts/PeelingZeroTripCount.java new file mode 100644 index 00000000000..c6350c06751 --- /dev/null +++ b/test/hotspot/jtreg/compiler/loopopts/PeelingZeroTripCount.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. 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 + * @bug 8215044 + * @summary C2 crash in loopTransform.cpp with assert(cl->trip_count() > 0) failed: peeling a fully unrolled loop + * + * @run main/othervm -XX:CompileOnly=PeelingZeroTripCount.test PeelingZeroTripCount + * + */ + +public class PeelingZeroTripCount { + + public static void main(String[] args) { + PeelingZeroTripCount issue = new PeelingZeroTripCount(); + for (int i = 0; i < 10000; i++) { + issue.test(new int[999]); + } + } + + public void test(int[] iaarg) { + int[] iarr = new int[777]; + for (int i = 4; i > 0; i--) { + for (int j = 0; j <= i - 1; j++) { + int istep = 2 * j - i + 1; + int iadj = 0; + if (istep < 0) { + iadj = iarr[0-istep] + iaarg[i-1]; + } else { + iadj = iarr[istep] + iaarg[i-1]; + } + } + } + } +} diff --git a/test/hotspot/jtreg/compiler/rangechecks/RangeCheckEliminationScaleNotOne.java b/test/hotspot/jtreg/compiler/rangechecks/RangeCheckEliminationScaleNotOne.java new file mode 100644 index 00000000000..50b268a252e --- /dev/null +++ b/test/hotspot/jtreg/compiler/rangechecks/RangeCheckEliminationScaleNotOne.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. 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 + * @bug 8215265 + * @summary C2: range check elimination may allow illegal out of bound access + * + * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:-UseLoopPredicate RangeCheckEliminationScaleNotOne + * + */ + +import java.util.Arrays; + +public class RangeCheckEliminationScaleNotOne { + public static void main(String[] args) { + { + int[] array = new int[199]; + boolean[] flags = new boolean[100]; + Arrays.fill(flags, true); + flags[0] = false; + flags[1] = false; + for (int i = 0; i < 20_000; i++) { + test1(100, array, 0, flags); + } + boolean ex = false; + try { + test1(100, array, -5, flags); + } catch (ArrayIndexOutOfBoundsException aie) { + ex = true; + } + if (!ex) { + throw new RuntimeException("no AIOOB exception"); + } + } + + { + int[] array = new int[199]; + boolean[] flags = new boolean[100]; + Arrays.fill(flags, true); + flags[0] = false; + flags[1] = false; + for (int i = 0; i < 20_000; i++) { + test2(100, array, 198, flags); + } + boolean ex = false; + try { + test2(100, array, 203, flags); + } catch (ArrayIndexOutOfBoundsException aie) { + ex = true; + } + if (!ex) { + throw new RuntimeException("no AIOOB exception"); + } + } + } + + private static int test1(int stop, int[] array, int offset, boolean[] flags) { + if (array == null) {} + int res = 0; + for (int i = 0; i < stop; i++) { + if (flags[i]) { + res += array[2 * i + offset]; + } + } + return res; + } + + + private static int test2(int stop, int[] array, int offset, boolean[] flags) { + if (array == null) {} + int res = 0; + for (int i = 0; i < stop; i++) { + if (flags[i]) { + res += array[-2 * i + offset]; + } + } + return res; + } +} diff --git a/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedArchiveFile.java b/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedArchiveFile.java index 0e4ed4aceb0..0ad543bfab7 100644 --- a/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedArchiveFile.java +++ b/test/hotspot/jtreg/runtime/SharedArchiveFile/SharedArchiveFile.java @@ -47,6 +47,13 @@ public class SharedArchiveFile { OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile"); CDSTestUtils.checkDump(out); + // -XX:+DumpSharedSpaces should behave the same as -Xshare:dump + pb = ProcessTools.createJavaProcessBuilder(true, + "-XX:SharedArchiveFile=./SharedArchiveFile.jsa", + "-XX:+DumpSharedSpaces"); + out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile"); + CDSTestUtils.checkDump(out); + pb = ProcessTools.createJavaProcessBuilder(true, "-XX:SharedArchiveFile=./SharedArchiveFile.jsa", "-Xshare:on", "-version"); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jdi/AttachingConnector/attach/attach002.java b/test/hotspot/jtreg/vmTestbase/nsk/jdi/AttachingConnector/attach/attach002.java index d4092f95bea..22720edadc1 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jdi/AttachingConnector/attach/attach002.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jdi/AttachingConnector/attach/attach002.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2019, 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 @@ -203,6 +203,6 @@ public class attach002 extends Log { return connector; } } - throw new Error("No appropriate connector"); + throw new Error("No appropriate connector: " + connectorName); } } diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/TestDescription.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/TestDescription.java index 68e8bd881f5..c7bf3df62fb 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/TestDescription.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/TestDescription.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, 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 @@ -21,6 +21,7 @@ * questions. */ +// Not run on AIX as it does not support ulimit -v. /* * @test @@ -40,6 +41,7 @@ * * @library /vmTestbase * /test/lib + * @requires os.family != "aix" * @run driver jdk.test.lib.FileInstaller . . * @build nsk.jvmti.Allocate.alloc001 * @run shell alloc001.sh diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.bash b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.bash index 6f59032bd56..83b2b09dd4c 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.bash +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.bash @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2008, 2019, 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 @@ -41,7 +41,8 @@ aix | bsd | linux | solaris) max_ulimit=1048576 max_heap=256m else - max_ulimit=4194304 + # AIX requires a 32-bit value here. + max_ulimit=4194303 max_heap=512m fi @@ -74,6 +75,7 @@ esac export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$TESTNATIVEPATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TESTNATIVEPATH +export LIBPATH=$LIBPATH:$TESTNATIVEPATH export PATH=$PATH:$TESTNATIVEPATH echo $JAVA ${JAVA_OPTS} nsk.jvmti.Allocate.alloc001 diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java index 38ff90a8423..f8dd655f0c3 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, 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 @@ -76,8 +76,18 @@ public class TestDriver { "-agentlib:retransform003-03=id=3 can_retransform_classes=1", nsk.jvmti.RetransformClasses.retransform003.class.getName() ); - String envName = Platform.isWindows() ? "PATH" : - (Platform.isOSX() ? "DYLD_LIBRARY_PATH" : "LD_LIBRARY_PATH"); + + String envName; + if (Platform.isWindows()) { + envName = "PATH"; + } else if (Platform.isOSX()) { + envName = "DYLD_LIBRARY_PATH"; + } else if (Platform.isAix()) { + envName = "LIBPATH"; + } else { + envName = "LD_LIBRARY_PATH"; + } + pb.environment() .merge(envName, ".", (x, y) -> y + File.pathSeparator + x); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java index a3839375b92..ebc4b1d8baa 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2019, 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 @@ -66,8 +66,18 @@ public class TestDriver { "-agentlib:SetNativeMethodPrefix002-03=trace=all prefix=wc_", nsk.jvmti.SetNativeMethodPrefix.SetNativeMethodPrefix002.class.getName() ); - String envName = Platform.isWindows() ? "PATH" : - (Platform.isOSX() ? "DYLD_LIBRARY_PATH" : "LD_LIBRARY_PATH"); + + String envName; + if (Platform.isWindows()) { + envName = "PATH"; + } else if (Platform.isOSX()) { + envName = "DYLD_LIBRARY_PATH"; + } else if (Platform.isAix()) { + envName = "LIBPATH"; + } else { + envName = "LD_LIBRARY_PATH"; + } + pb.environment() .merge(envName, ".", (x, y) -> y + File.pathSeparator + x); diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/ArgumentHandler.java b/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/ArgumentHandler.java index fee4baf773e..ed43c1bf47f 100644 --- a/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/ArgumentHandler.java +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/ArgumentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2019, 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 @@ -533,8 +533,12 @@ class CheckedFeatures { {"linux-sparcv9", "com.sun.jdi.SharedMemoryAttach"}, {"linux-aarch64", "com.sun.jdi.SharedMemoryAttach"}, {"linux-arm", "com.sun.jdi.SharedMemoryAttach"}, + {"linux-ppc64", "com.sun.jdi.SharedMemoryAttach"}, + {"linux-ppc64le", "com.sun.jdi.SharedMemoryAttach"}, + {"linux-s390x", "com.sun.jdi.SharedMemoryAttach"}, {"macosx-amd64", "com.sun.jdi.SharedMemoryAttach"}, {"mac-x64", "com.sun.jdi.SharedMemoryAttach"}, + {"aix-ppc64", "com.sun.jdi.SharedMemoryAttach"}, // listening connectors /* @@ -559,8 +563,12 @@ class CheckedFeatures { {"linux-sparcv9", "com.sun.jdi.SharedMemoryListen"}, {"linux-aarch64", "com.sun.jdi.SharedMemoryListen"}, {"linux-arm", "com.sun.jdi.SharedMemoryListen"}, + {"linux-ppc64", "com.sun.jdi.SharedMemoryListen"}, + {"linux-ppc64le", "com.sun.jdi.SharedMemoryListen"}, + {"linux-s390x", "com.sun.jdi.SharedMemoryListen"}, {"macosx-amd64", "com.sun.jdi.SharedMemoryListen"}, {"mac-x64", "com.sun.jdi.SharedMemoryListen"}, + {"aix-ppc64", "com.sun.jdi.SharedMemoryListen"}, // launching connectors /* @@ -615,6 +623,15 @@ class CheckedFeatures { {"linux-arm", "com.sun.jdi.CommandLineLaunch", "dt_shmem"}, {"linux-arm", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"}, + {"linux-ppc64", "com.sun.jdi.CommandLineLaunch", "dt_shmem"}, + {"linux-ppc64", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"}, + + {"linux-ppc64le", "com.sun.jdi.CommandLineLaunch", "dt_shmem"}, + {"linux-ppc64le", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"}, + + {"linux-s390x", "com.sun.jdi.CommandLineLaunch", "dt_shmem"}, + {"linux-s390x", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"}, + {"windows-i586", "com.sun.jdi.CommandLineLaunch", "dt_socket"}, {"windows-i586", "com.sun.jdi.RawCommandLineLaunch", "dt_socket"}, @@ -633,6 +650,9 @@ class CheckedFeatures { {"mac-x64", "com.sun.jdi.CommandLineLaunch", "dt_shmem"}, {"mac-x64", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"}, + {"aix-ppc64", "com.sun.jdi.CommandLineLaunch", "dt_shmem"}, + {"aix-ppc64", "com.sun.jdi.RawCommandLineLaunch", "dt_shmem"}, + // shared memory transport is implemented only on windows platform {"solaris-sparc", "dt_shmem"}, {"solaris-sparcv9", "dt_shmem"}, @@ -647,7 +667,11 @@ class CheckedFeatures { {"linux-sparcv9", "dt_shmem"}, {"linux-aarch64", "dt_shmem"}, {"linux-arm", "dt_shmem"}, + {"linux-ppc64", "dt_shmem"}, + {"linux-ppc64le", "dt_shmem"}, + {"linux-s390x", "dt_shmem"}, {"macosx-amd64", "dt_shmem"}, {"mac-x64", "dt_shmem"}, + {"aix-ppc64", "dt_shmem"}, }; } diff --git a/test/jdk/java/lang/ProcessBuilder/PipelineTest.java b/test/jdk/java/lang/ProcessBuilder/PipelineTest.java index b2c1bd72ead..47878dc50ba 100644 --- a/test/jdk/java/lang/ProcessBuilder/PipelineTest.java +++ b/test/jdk/java/lang/ProcessBuilder/PipelineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, 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 @@ -34,6 +34,8 @@ import java.util.List; /* * @test PipelineTest + * @bug 8211844 + * @summary Tests for ProcessBuilder.startPipeline */ public class PipelineTest { @@ -170,7 +172,7 @@ public class PipelineTest { static void verify(String input, String expected, List builders) throws IOException { File infile = new File("test.in"); File outfile = new File("test.out"); - setFileContents(infile, expected); + setFileContents(infile, input); for (int i = 0; i < builders.size(); i++) { ProcessBuilder b = builders.get(i); if (i == 0) { @@ -184,8 +186,8 @@ public class PipelineTest { verifyProcesses(processes); waitForAll(processes); String result = fileContents(outfile); - System.out.printf(" in: %s%nout: %s%n", input, expected); - check(result.equals(expected), "result not as expected"); + check(result.equals(expected), + "result not as expected: " + result + ", expected: " + expected); } /** @@ -219,11 +221,14 @@ public class PipelineTest { static void verifyProcesses(List processes) { for (int i = 0; i < processes.size(); i++) { Process p = processes.get(i); + if (i != 0) { verifyNullStream(p.getOutputStream(), "getOutputStream"); } - if (i == processes.size() - 1) { + if (i <= processes.size() - 1) { verifyNullStream(p.getInputStream(), "getInputStream"); + } + if (i == processes.size() - 1) { verifyNullStream(p.getErrorStream(), "getErrorStream"); } } @@ -232,7 +237,7 @@ public class PipelineTest { static void verifyNullStream(OutputStream s, String msg) { try { s.write(0xff); - fail("Stream should have been a NullStream" + msg); + fail("Stream should have been a NullStream: " + msg); } catch (IOException ie) { // expected } @@ -241,7 +246,7 @@ public class PipelineTest { static void verifyNullStream(InputStream s, String msg) { try { int len = s.read(); - check(len == -1, "Stream should have been a NullStream" + msg); + check(len == -1, "Stream should have been a NullStream: " + msg); } catch (IOException ie) { // expected } @@ -271,9 +276,12 @@ public class PipelineTest { //--------------------- Infrastructure --------------------------- static volatile int passed = 0, failed = 0; static void pass() {passed++;} - static void fail() {failed++; Thread.dumpStack();} - static void fail(String msg) {System.err.println(msg); fail();} - static void unexpected(Throwable t) {failed++; t.printStackTrace();} + static void fail() {failed++; new Exception("Stack trace").printStackTrace(System.out);} + static void fail(String msg) { + System.out.println(msg); failed++; + new Exception("Stack trace: " + msg).printStackTrace(System.out); + } + static void unexpected(Throwable t) {failed++; t.printStackTrace(System.out);} static void check(boolean cond) {if (cond) pass(); else fail();} static void check(boolean cond, String m) {if (cond) pass(); else fail(m);} static void equal(Object x, Object y) { diff --git a/test/jdk/java/util/Locale/LocaleProviders.java b/test/jdk/java/util/Locale/LocaleProviders.java index 230d11c320c..f256677b504 100644 --- a/test/jdk/java/util/Locale/LocaleProviders.java +++ b/test/jdk/java/util/Locale/LocaleProviders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, 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 @@ -237,12 +237,16 @@ public class LocaleProviders { } static void bug8027289Test(String expectedCodePoint) { - char[] expectedSymbol = Character.toChars(Integer.valueOf(expectedCodePoint, 16)); - NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.CHINA); - char formatted = nf.format(7000).charAt(0); - System.out.println("returned: " + formatted + ", expected: " + expectedSymbol[0]); - if (formatted != expectedSymbol[0]) { - throw new RuntimeException("Unexpected Chinese currency symbol. returned: " + formatted + ", expected: " + expectedSymbol[0]); + if (System.getProperty("os.name").startsWith("Windows")) { + char[] expectedSymbol = Character.toChars(Integer.valueOf(expectedCodePoint, 16)); + NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.CHINA); + char formatted = nf.format(7000).charAt(0); + System.out.println("returned: " + formatted + ", expected: " + expectedSymbol[0]); + if (formatted != expectedSymbol[0]) { + throw new RuntimeException( + "Unexpected Chinese currency symbol. returned: " + + formatted + ", expected: " + expectedSymbol[0]); + } } } } diff --git a/test/jdk/java/util/Locale/LocaleProvidersRun.java b/test/jdk/java/util/Locale/LocaleProvidersRun.java index 6cb041847eb..958642c6dfe 100644 --- a/test/jdk/java/util/Locale/LocaleProvidersRun.java +++ b/test/jdk/java/util/Locale/LocaleProvidersRun.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2019, 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 @@ -25,7 +25,7 @@ * @test * @bug 6336885 7196799 7197573 7198834 8000245 8000615 8001440 8008577 * 8010666 8013086 8013233 8013903 8015960 8028771 8054482 8062006 - * 8150432 + * 8150432 8215913 * @summary tests for "java.locale.providers" system property * @library /test/lib * @build LocaleProviders @@ -143,7 +143,7 @@ public class LocaleProvidersRun { //testing 8027289 fix, if the platform format default is zh_CN // this assumes Windows' currency symbol for zh_CN is \u00A5, the yen // (yuan) sign. - if (!defLang.equals("en") && !defCtry.equals("CN")){ + if (defFmtLang.equals("zh") && defFmtCtry.equals("CN")) { testRun("JRE,HOST", "bug8027289Test", "FFE5", "", ""); testRun("COMPAT,HOST", "bug8027289Test", "FFE5", "", ""); testRun("HOST", "bug8027289Test", "00A5", "", ""); diff --git a/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java b/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java index 80909a50829..603021a532b 100644 --- a/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java +++ b/test/langtools/jdk/javadoc/doclet/testCopyFiles/TestCopyFiles.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2019, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8157349 8185985 8194953 + * @bug 8157349 8185985 8194953 8214738 * @summary test copy of doc-files, and its contents for HTML meta content. * @library ../../lib * @modules jdk.javadoc/jdk.javadoc.internal.tool @@ -268,9 +268,22 @@ public class TestCopyFiles extends JavadocTester { "-sourcepath", testSrc("packages"), "p2"); checkExit(Exit.OK); - checkOutput("p2/doc-files/case1.html", true, "