Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Automatic merge of jdk:master into master
  • Loading branch information
duke committed Mar 3, 2021
2 parents 478286d + 044e2a2 commit 4188413f0da2ba8d5fa56d64839663a0c2c71af3
Showing with 1,571 additions and 1,344 deletions.
  1. +1 −1 make/Docs.gmk
  2. +1 −1 src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp
  3. +66 −17 src/hotspot/cpu/s390/macroAssembler_s390.cpp
  4. +2 −2 src/hotspot/os/windows/os_windows.cpp
  5. +22 −21 src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp
  6. +4 −3 src/hotspot/share/gc/shenandoah/shenandoahVMOperations.hpp
  7. +11 −13 src/hotspot/share/logging/log.hpp
  8. +6 −0 src/hotspot/share/runtime/arguments.cpp
  9. +22 −1 src/hotspot/share/runtime/flags/jvmFlag.hpp
  10. +2 −2 src/hotspot/share/runtime/flags/jvmFlagLimit.cpp
  11. +28 −12 src/hotspot/share/runtime/flags/jvmFlagLimit.hpp
  12. +31 −96 src/hotspot/share/runtime/thread.cpp
  13. +2 −0 src/hotspot/share/utilities/utf8.cpp
  14. +0 −21 src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java
  15. +1 −1 src/java.base/linux/classes/sun/nio/fs/LinuxFileSystem.java
  16. +0 −55 src/java.base/linux/classes/sun/nio/fs/LinuxNativeDispatcher.java
  17. +4 −338 src/java.base/linux/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java
  18. +0 −87 src/java.base/linux/native/libnio/fs/LinuxNativeDispatcher.c
  19. +0 −21 src/java.base/macosx/classes/sun/nio/fs/BsdFileStore.java
  20. +1 −0 src/java.base/macosx/classes/sun/nio/fs/BsdFileSystem.java
  21. +0 −61 src/java.base/macosx/classes/sun/nio/fs/BsdNativeDispatcher.java
  22. +5 −339 src/java.base/macosx/classes/sun/nio/fs/BsdUserDefinedFileAttributeView.java
  23. +0 −50 src/java.base/macosx/native/libnio/fs/BsdNativeDispatcher.c
  24. +1 −1 src/java.base/share/classes/java/lang/Integer.java
  25. +1 −1 src/java.base/share/classes/java/lang/Long.java
  26. +1 −1 src/java.base/share/classes/java/lang/invoke/MethodHandles.java
  27. +7 −0 src/java.base/share/classes/java/net/HttpRetryException.java
  28. +22 −11 src/java.base/share/classes/java/net/Inet6Address.java
  29. +20 −3 src/java.base/share/classes/java/net/InetAddress.java
  30. +20 −3 src/java.base/share/classes/java/net/InetSocketAddress.java
  31. +23 −7 src/java.base/share/classes/java/net/SocketPermission.java
  32. +9 −0 src/java.base/share/classes/java/net/URI.java
  33. +8 −0 src/java.base/share/classes/java/net/URISyntaxException.java
  34. +15 −7 src/java.base/share/classes/java/net/URL.java
  35. +8 −1 src/java.base/share/classes/java/net/URLPermission.java
  36. +3 −2 src/java.base/share/classes/java/net/UnixDomainSocketAddress.java
  37. +2 −2 src/java.base/share/classes/java/util/Comparator.java
  38. +1 −1 src/java.base/share/classes/java/util/jar/package-info.java
  39. +1 −1 src/java.base/share/classes/java/util/zip/Deflater.java
  40. +1 −1 src/java.base/share/classes/java/util/zip/Inflater.java
  41. +3 −2 src/java.base/share/classes/javax/net/ssl/SNIHostName.java
  42. +0 −1 src/java.base/share/classes/javax/net/ssl/SSLSessionContext.java
  43. +63 −32 src/java.base/share/classes/jdk/internal/util/ArraysSupport.java
  44. +6 −1 src/java.base/share/classes/sun/nio/fs/NativeBuffer.java
  45. +8 −3 src/java.base/unix/classes/sun/nio/fs/UnixConstants.java.template
  46. +25 −0 src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java
  47. +46 −0 src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java
  48. +375 −0 src/java.base/unix/classes/sun/nio/fs/UnixUserDefinedFileAttributeView.java
  49. +84 −0 src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c
  50. +5 −1 src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c
  51. +92 −9 src/java.xml/share/classes/module-info.java
  52. +3 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java
  53. +1 −0 src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java
  54. +2 −0 src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java
  55. +3 −0 src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java
  56. +4 −4 src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp
  57. +4 −1 src/jdk.hotspot.agent/linux/native/libsaproc/libproc.h
  58. +44 −19 src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c
  59. +1 −0 src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h
  60. +3 −3 src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m
  61. +4 −1 src/jdk.hotspot.agent/macosx/native/libsaproc/libproc.h
  62. +16 −1 src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c
  63. +3 −5 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java
  64. +3 −5 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java
  65. +1 −1 src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/Addressable.java
  66. +21 −15 src/jdk.incubator.vector/share/classes/jdk/incubator/vector/VectorShape.java
  67. +56 −1 test/hotspot/gtest/utilities/test_utf8.cpp
  68. +17 −5 test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java
  69. +2 −1 test/hotspot/jtreg/gc/shenandoah/compiler/TestLinkToNativeRBP.java
  70. +0 −2 test/jdk/ProblemList.txt
  71. +3 −1 test/jdk/java/foreign/TestHandshake.java
  72. +2 −2 test/jdk/java/util/StringJoiner/MergeTest.java
  73. +2 −2 test/jdk/java/util/StringJoiner/StringJoinerTest.java
  74. +31 −13 test/jdk/javax/net/ssl/ServerName/IllegalSNIName.java
  75. +41 −9 test/jdk/jdk/dynalink/TypeConverterFactoryMemoryLeakTest.java
  76. +43 −12 test/jdk/jdk/dynalink/TypeConverterFactoryRetentionTests.java
  77. +29 −7 test/jdk/jdk/incubator/vector/PreferredSpeciesTest.java
  78. +102 −0 test/jdk/jdk/internal/util/ArraysSupport/NewLength.java
  79. +71 −0 test/langtools/tools/javac/classfiles/attributes/LineNumberTable/StringSwitchBreaks.java
@@ -99,7 +99,7 @@ JAVADOC_TAGS := \
REFERENCE_TAGS := $(JAVADOC_TAGS)

# Which doclint checks to ignore
JAVADOC_DISABLED_DOCLINT := accessibility html missing syntax reference
JAVADOC_DISABLED_DOCLINT := missing

# The initial set of options for javadoc
JAVADOC_OPTIONS := -use -keywords -notimestamp \
@@ -147,7 +147,7 @@ int StubAssembler::call_RT(Register oop_result1, Register metadata_result, addre
if (arg1 == c_rarg2 || arg1 == c_rarg3 ||
arg2 == c_rarg1 || arg2 == c_rarg3 ||
arg3 == c_rarg1 || arg3 == c_rarg2) {
stp(arg3, arg2, Address(pre(sp, 2 * wordSize)));
stp(arg3, arg2, Address(pre(sp, -2 * wordSize)));
stp(arg1, zr, Address(pre(sp, -2 * wordSize)));
ldp(c_rarg1, zr, Address(post(sp, 2 * wordSize)));
ldp(c_rarg3, c_rarg2, Address(post(sp, 2 * wordSize)));
@@ -3603,6 +3603,7 @@ void MacroAssembler::encode_klass_not_null(Register dst, Register src) {
Register current = (src != noreg) ? src : dst; // Klass is in dst if no src provided. (dst == src) also possible.
address base = CompressedKlassPointers::base();
int shift = CompressedKlassPointers::shift();
bool need_zero_extend = base != 0;
assert(UseCompressedClassPointers, "only for compressed klass ptrs");

BLOCK_COMMENT("cKlass encoder {");
@@ -3619,28 +3620,76 @@ void MacroAssembler::encode_klass_not_null(Register dst, Register src) {
bind(ok);
#endif

if (base != NULL) {
unsigned int base_h = ((unsigned long)base)>>32;
unsigned int base_l = (unsigned int)((unsigned long)base);
if ((base_h != 0) && (base_l == 0) && VM_Version::has_HighWordInstr()) {
lgr_if_needed(dst, current);
z_aih(dst, -((int)base_h)); // Base has no set bits in lower half.
} else if ((base_h == 0) && (base_l != 0)) {
lgr_if_needed(dst, current);
z_agfi(dst, -(int)base_l);
} else {
load_const(Z_R0, base);
lgr_if_needed(dst, current);
z_sgr(dst, Z_R0);
}
current = dst;
}
// Scale down the incoming klass pointer first.
// We then can be sure we calculate an offset that fits into 32 bit.
// More generally speaking: all subsequent calculations are purely 32-bit.
if (shift != 0) {
assert (LogKlassAlignmentInBytes == shift, "decode alg wrong");
z_srlg(dst, current, shift);
current = dst;
}
lgr_if_needed(dst, current); // Move may be required (if neither base nor shift != 0).

if (base != NULL) {
// Use scaled-down base address parts to match scaled-down klass pointer.
unsigned int base_h = ((unsigned long)base)>>(32+shift);
unsigned int base_l = (unsigned int)(((unsigned long)base)>>shift);

// General considerations:
// - when calculating (current_h - base_h), all digits must cancel (become 0).
// Otherwise, we would end up with a compressed klass pointer which doesn't
// fit into 32-bit.
// - Only bit#33 of the difference could potentially be non-zero. For that
// to happen, (current_l < base_l) must hold. In this case, the subtraction
// will create a borrow out of bit#32, nicely killing bit#33.
// - With the above, we only need to consider current_l and base_l to
// calculate the result.
// - Both values are treated as unsigned. The unsigned subtraction is
// replaced by adding (unsigned) the 2's complement of the subtrahend.

if (base_l == 0) {
// - By theory, the calculation to be performed here (current_h - base_h) MUST
// cancel all high-word bits. Otherwise, we would end up with an offset
// (i.e. compressed klass pointer) that does not fit into 32 bit.
// - current_l remains unchanged.
// - Therefore, we can replace all calculation with just a
// zero-extending load 32 to 64 bit.
// - Even that can be replaced with a conditional load if dst != current.
// (this is a local view. The shift step may have requested zero-extension).
} else {
if ((base_h == 0) && is_uimm(base_l, 31)) {
// If we happen to find that (base_h == 0), and that base_l is within the range
// which can be represented by a signed int, then we can use 64bit signed add with
// (-base_l) as 32bit signed immediate operand. The add will take care of the
// upper 32 bits of the result, saving us the need of an extra zero extension.
// For base_l to be in the required range, it must not have the most significant
// bit (aka sign bit) set.
lgr_if_needed(dst, current); // no zero/sign extension in this case!
z_agfi(dst, -(int)base_l); // base_l must be passed as signed.
need_zero_extend = false;
current = dst;
} else {
// To begin with, we may need to copy and/or zero-extend the register operand.
// We have to calculate (current_l - base_l). Because there is no unsigend
// subtract instruction with immediate operand, we add the 2's complement of base_l.
if (need_zero_extend) {
z_llgfr(dst, current);
need_zero_extend = false;
} else {
llgfr_if_needed(dst, current);
}
current = dst;
z_alfi(dst, -base_l);
}
}
}

if (need_zero_extend) {
// We must zero-extend the calculated result. It may have some leftover bits in
// the hi-word because we only did optimized calculations.
z_llgfr(dst, current);
} else {
llgfr_if_needed(dst, current); // zero-extension while copying comes at no extra cost.
}

BLOCK_COMMENT("} cKlass encoder");
}
@@ -1700,9 +1700,9 @@ void os::print_os_info(outputStream* st) {
char buffer[1024];
st->print("HostName: ");
if (get_host_name(buffer, sizeof(buffer))) {
st->print("%s ", buffer);
st->print_cr(buffer);
} else {
st->print("N/A ");
st->print_cr("N/A");
}
#endif
st->print_cr("OS:");
@@ -395,32 +395,33 @@ bool StringDedupTable::is_rehashing() {
StringDedupTable* StringDedupTable::prepare_resize() {
size_t size = _table->_size;

// Check if the hashtable needs to be resized
// Decide whether to resize, and compute desired new size if so.
if (_table->_entries > _table->_grow_threshold) {
// Grow table, double the size
size *= 2;
if (size > _max_size) {
// Too big, don't resize
return NULL;
// Compute new size.
size_t needed = _table->_entries / _grow_load_factor;
if (needed < _max_size) {
size = round_up_power_of_2(needed);
} else {
size = _max_size;
}
} else if (_table->_entries < _table->_shrink_threshold) {
// Shrink table, half the size
size /= 2;
if (size < _min_size) {
// Too small, don't resize
return NULL;
}
} else if (StringDeduplicationResizeALot) {
// Force grow
size *= 2;
if (size > _max_size) {
// Too big, force shrink instead
size /= 4;
// Compute new size. We can't shrink by more than a factor of 2,
// because the partitioning for parallelization doesn't support more.
if (size > _min_size) size /= 2;
}
// If no change in size needed (and not forcing resize) then done.
if (size == _table->_size) {
if (!StringDeduplicationResizeALot) {
return NULL; // Don't resize.
} else if (size < _max_size) {
size *= 2; // Force grow, but not past _max_size.
} else {
size /= 2; // Can't force grow, so force shrink instead.
}
} else {
// Resize not needed
return NULL;
}
assert(size <= _max_size, "invariant: %zu", size);
assert(size >= _min_size, "invariant: %zu", size);
assert(is_power_of_2(size), "invariant: %zu", size);

// Update statistics
_resize_count++;
@@ -35,11 +35,12 @@ class ShenandoahFullGC;
//
// VM_ShenandoahOperation
// - VM_ShenandoahInitMark: initiate concurrent marking
// - VM_ShenandoahFinalMarkStartEvac: finish up concurrent marking, and start evacuation
// - VM_ShenandoahInitUpdateRefs: initiate update references
// - VM_ShenandoahFinalUpdateRefs: finish up update references
// - VM_ShenandoahReferenceOperation:
// - VM_ShenandoahFinalMarkStartEvac: finish up concurrent marking, and start evacuation
// - VM_ShenandoahInitUpdateRefs: initiate update references
// - VM_ShenandoahFinalUpdateRefs: finish up update references
// - VM_ShenandoahFullGC: do full GC
// - VM_ShenandoahDegeneratedGC: do STW degenerated GC

class VM_ShenandoahOperation : public VM_Operation {
protected:
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2021, 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
@@ -72,16 +72,16 @@ class LogMessageBuffer;
// Log class for more advanced logging scenarios.
// Has printf-style member functions for each log level (trace(), debug(), etc).
//
// Also has outputStream compatible API for the different log-levels.
// The streams are resource allocated when requested and are accessed through
// calls to <level>_stream() functions (trace_stream(), debug_stream(), etc).
// The (trace(), debug(), etc) functions can also be used along with the LogStream
// class to obtain an outputStream object, to be passed to various printing
// functions that accept an outputStream:
//
// Example usage:
// Log(logging) log;
// Log(codecache, sweep) log;
// if (log.is_debug()) {
// ...
// log.debug("result = %d", result).trace(" tracing info");
// obj->print_on(log.debug_stream());
// LogStream ls(log.debug());
// CodeCache::print_summary(&ls, false);
// }
//
#define Log(...) LogImpl<LOG_TAGS(__VA_ARGS__)>
@@ -93,13 +93,11 @@ class LogMessageBuffer;
// so that redundant specification of tags or levels can be avoided.
//
// Example usage:
// LogTarget(Debug, gc) out;
// LogTarget(Debug, codecache, sweep) out;
// if (out.is_enabled()) {
// ...
// out.print("Worker: %u", i);
// out.print(" data: %d", x);
// ...
// print_stats(out.stream());
// out.print("result = %d", result);
// LogStream ls(out);
// CodeCache::print_summary(&ls, false);
// }
//
#define LogTarget(level, ...) LogTargetImpl<LogLevel::level, LOG_TAGS(__VA_ARGS__)>
@@ -44,6 +44,7 @@
#include "runtime/arguments.hpp"
#include "runtime/flags/jvmFlag.hpp"
#include "runtime/flags/jvmFlagAccess.hpp"
#include "runtime/flags/jvmFlagLimit.hpp"
#include "runtime/globals_extension.hpp"
#include "runtime/java.hpp"
#include "runtime/os.inline.hpp"
@@ -2270,6 +2271,11 @@ jint Arguments::parse_xss(const JavaVMOption* option, const char* tail, intx* ou
const julong min_ThreadStackSize = 0;
const julong max_ThreadStackSize = 1 * M;

// Make sure the above values match the range set in globals.hpp
const JVMTypedFlagLimit<intx>* limit = JVMFlagLimit::get_range_at(FLAG_MEMBER_ENUM(ThreadStackSize))->cast<intx>();
assert(min_ThreadStackSize == static_cast<julong>(limit->min()), "must be");
assert(max_ThreadStackSize == static_cast<julong>(limit->max()), "must be");

const julong min_size = min_ThreadStackSize * K;
const julong max_size = max_ThreadStackSize * K;

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, 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
@@ -29,6 +29,7 @@
#include "utilities/enumIterator.hpp"
#include "utilities/macros.hpp"
#include "utilities/vmEnums.hpp"
#include <type_traits>

class outputStream;

@@ -290,6 +291,26 @@ class JVMFlag {

static const char* flag_error_str(JVMFlag::Error error);

// type checking
#define CHECK_COMPATIBLE(type) \
case TYPE_##type: \
assert(sizeof(T) == sizeof(type) && \
std::is_integral<T>::value == std::is_integral<type>::value && \
std::is_signed <T>::value == std::is_signed <type>::value, "must be"); \
break;

template <typename T>
static void assert_compatible_type(int type_enum) {
#ifndef PRODUCT
switch (type_enum) {
JVM_FLAG_NON_STRING_TYPES_DO(CHECK_COMPATIBLE);
default: ShouldNotReachHere();
}
#endif
}

#undef CHECK_COMPATIBLE

public:
static void printSetFlags(outputStream* out);

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, 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
@@ -92,7 +92,7 @@ class LimitGetter {
// macro body starts here -------------------+
// |
// v
#define FLAG_LIMIT_DEFINE( type, name, ...) ); constexpr JVMTypedFlagLimit<type> limit_##name(0
#define FLAG_LIMIT_DEFINE( type, name, ...) ); constexpr JVMTypedFlagLimit<type> limit_##name(JVMFlag::TYPE_##type
#define FLAG_LIMIT_DEFINE_DUMMY(type, name, ...) ); constexpr DummyLimit nolimit_##name(0
#define FLAG_LIMIT_PTR( type, name, ...) ), LimitGetter<type>::get_limit(&limit_##name, 0
#define FLAG_LIMIT_PTR_NONE( type, name, ...) ), LimitGetter<type>::no_limit(0

0 comments on commit 4188413

Please sign in to comment.