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 extends DocTree> 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 extends DocTree> dtrees) {
- SimpleDocTreeVisitor