Skip to content
Permalink
Browse files

Merge

  • Loading branch information
slowhog committed Jan 9, 2020
2 parents 02cc064 + 89f2d14 commit 231d9afe6ff3dd63c075f2538175ff5f23217052
Showing with 1,585 additions and 597 deletions.
  1. +2 −0 .hgtags
  2. +18 −11 make/src/classes/build/tools/jfr/GenerateJfrFiles.java
  3. +1 −1 src/hotspot/cpu/aarch64/aarch64.ad
  4. +1 −1 src/hotspot/cpu/arm/arm.ad
  5. +1 −1 src/hotspot/cpu/ppc/ppc.ad
  6. +1 −1 src/hotspot/cpu/s390/s390.ad
  7. +1 −1 src/hotspot/cpu/sparc/sparc.ad
  8. +6 −1 src/hotspot/cpu/x86/x86.ad
  9. +1 −1 src/hotspot/share/compiler/compilationPolicy.cpp
  10. +2 −2 src/hotspot/share/compiler/compilationPolicy.hpp
  11. +0 −14 src/hotspot/share/compiler/compilerDefinitions.cpp
  12. +0 −1 src/hotspot/share/compiler/compilerDefinitions.hpp
  13. +77 −8 src/hotspot/share/compiler/tieredThresholdPolicy.cpp
  14. +9 −2 src/hotspot/share/compiler/tieredThresholdPolicy.hpp
  15. +9 −2 src/hotspot/share/gc/g1/g1CollectedHeap.cpp
  16. +13 −2 src/hotspot/share/gc/g1/g1VMOperations.cpp
  17. +3 −1 src/hotspot/share/gc/g1/g1VMOperations.hpp
  18. +2 −2 src/hotspot/share/jfr/metadata/metadata.xml
  19. +1 −0 src/hotspot/share/jfr/metadata/metadata.xsd
  20. +27 −12 src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp
  21. +5 −2 src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.hpp
  22. +72 −11 src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp
  23. +4 −2 src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSetUtils.hpp
  24. +27 −7 src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp
  25. +12 −4 src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.cpp
  26. +30 −6 src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdEpoch.hpp
  27. +12 −4 src/hotspot/share/jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp
  28. +35 −19 src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp
  29. +42 −0 src/hotspot/share/jfr/support/jfrEpochSynchronization.cpp
  30. +37 −0 src/hotspot/share/jfr/support/jfrEpochSynchronization.hpp
  31. +7 −8 src/hotspot/share/opto/arraycopynode.cpp
  32. +1 −1 src/hotspot/share/opto/arraycopynode.hpp
  33. +23 −1 src/hotspot/share/opto/compile.cpp
  34. +3 −0 src/hotspot/share/opto/compile.hpp
  35. +2 −1 src/hotspot/share/opto/loopPredicate.cpp
  36. +14 −120 src/hotspot/share/opto/loopUnswitch.cpp
  37. +2 −2 src/hotspot/share/opto/matcher.cpp
  38. +1 −1 src/hotspot/share/opto/matcher.hpp
  39. +1 −1 src/hotspot/share/opto/memnode.cpp
  40. +1 −1 src/hotspot/share/prims/jvmtiThreadState.hpp
  41. +10 −1 src/hotspot/share/prims/whitebox.cpp
  42. +5 −1 src/hotspot/share/utilities/growableArray.hpp
  43. +3 −3 src/java.base/share/classes/java/lang/AbstractStringBuilder.java
  44. +36 −10 src/java.base/share/classes/java/lang/Record.java
  45. +12 −3 src/java.base/share/classes/sun/security/x509/AlgorithmId.java
  46. +1 −0 src/java.base/windows/native/libnet/NetworkInterface_winXP.c
  47. +15 −14 src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c
  48. +10 −9 src/java.sql.rowset/share/classes/com/sun/rowset/CachedRowSetImpl.java
  49. +12 −6 src/java.sql.rowset/share/classes/com/sun/rowset/internal/SyncResolverImpl.java
  50. +24 −14 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java
  51. +4 −4 src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
  52. +7 −4 src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c
  53. +9 −5 src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/ConstantMap.java
  54. +86 −0 test/hotspot/jtreg/compiler/arraycopy/TestArrayCopyMemoryChain.java
  55. +174 −7 test/hotspot/jtreg/compiler/loopopts/PartialPeelingUnswitch.java
  56. +53 −0 test/hotspot/jtreg/compiler/tiered/TieredModesTest.java
  57. +2 −2 test/hotspot/jtreg/gc/g1/TestGCLogMessages.java
  58. +1 −1 test/jdk/java/awt/FileDialog/MacOSGoToFolderCrash.java
  59. +174 −0 test/jdk/java/net/MulticastSocket/IPMulticastIF.java
  60. +6 −2 test/jdk/java/util/Locale/LocaleProviders.java
  61. +2 −2 test/jdk/java/util/Locale/LocaleProvidersRun.java
  62. +70 −1 test/jdk/javax/sql/testng/test/rowset/spi/SyncProviderExceptionTests.java
  63. +4 −4 test/jdk/sun/security/pkcs11/PKCS11Test.java
  64. +246 −180 test/jdk/sun/security/ssl/X509TrustManagerImpl/BasicConstraints.java
  65. +71 −66 test/jdk/sun/security/ssl/X509TrustManagerImpl/SelfIssuedCert.java
  66. +29 −1 test/langtools/tools/javac/records/RecordCompilationTests.java
  67. +3 −1 test/lib/sun/hotspot/WhiteBox.java
  68. +10 −1 test/lib/sun/hotspot/code/Compiler.java
@@ -601,3 +601,5 @@ c16ac7a2eba4e73cb4f7ee9294dd647860eebff0 jdk-14+21
288777cf0702914e5266bc1e5d380eed9032ca41 jdk-14+26
91a3f092682fc715d991a87eb6ec6f28886d2035 jdk-14+27
2069b4bfd23b56b6fc659fba8b75aaaa23debbe0 jdk-14+28
563fa900fa17c290ae516c7a3a69e8c069dde304 jdk-14+29
d54ce919da90dab361995bb4d87be9851f00537a jdk-14+30
@@ -154,6 +154,7 @@ void wireUpTypes() {
boolean startTime;
boolean periodic;
boolean cutoff;
String commitState;
}

static class FieldElement {
@@ -219,14 +220,15 @@ public void startElement(String uri, String localName, String qName, Attributes
currentType.name = attributes.getValue("name");
break;
case "Event":
EventElement eventtType = new EventElement();
eventtType.name = attributes.getValue("name");
eventtType.thread = getBoolean(attributes, "thread", false);
eventtType.stackTrace = getBoolean(attributes, "stackTrace", false);
eventtType.startTime = getBoolean(attributes, "startTime", true);
eventtType.periodic = attributes.getValue("period") != null;
eventtType.cutoff = getBoolean(attributes, "cutoff", false);
currentType = eventtType;
EventElement eventType = new EventElement();
eventType.name = attributes.getValue("name");
eventType.thread = getBoolean(attributes, "thread", false);
eventType.stackTrace = getBoolean(attributes, "stackTrace", false);
eventType.startTime = getBoolean(attributes, "startTime", true);
eventType.periodic = attributes.getValue("period") != null;
eventType.cutoff = getBoolean(attributes, "cutoff", false);
eventType.commitState = attributes.getValue("commitState");
currentType = eventType;
break;
case "Field":
currentField = new FieldElement(metadata);
@@ -459,6 +461,7 @@ private static void printJfrEventClassesHpp(Metadata metadata, File outputDirect
out.write("#include \"utilities/ticks.hpp\"");
out.write("#if INCLUDE_JFR");
out.write("#include \"jfr/recorder/service/jfrEvent.hpp\"");
out.write("#include \"jfr/support/jfrEpochSynchronization.hpp\"");
out.write("/*");
out.write(" * Each event class has an assert member function verify() which is invoked");
out.write(" * just before the engine writes the event and its fields to the data stream.");
@@ -523,7 +526,7 @@ private static void printType(Printer out, TypeElement t, boolean empty) {
}
out.write("");
if (!empty) {
printWriteData(out, t.fields);
printWriteData(out, t.fields, null);
}
out.write("};");
out.write("");
@@ -566,7 +569,7 @@ private static void printEvent(Printer out, EventElement event, boolean empty) {
}
out.write("");
if (!empty) {
printWriteData(out, event.fields);
printWriteData(out, event.fields, event.commitState);
out.write("");
}
out.write(" using JfrEvent<Event" + event.name + ">::commit; // else commit() is hidden by overloaded versions in this class");
@@ -578,9 +581,13 @@ private static void printEvent(Printer out, EventElement event, boolean empty) {
out.write("};");
}

private static void printWriteData(Printer out, List<FieldElement> fields) {
private static void printWriteData(Printer out, List<FieldElement> fields, String commitState) {
out.write(" template <typename Writer>");
out.write(" void writeData(Writer& w) {");
if (("_thread_in_native").equals(commitState)) {
out.write(" // explicit epoch synchronization check");
out.write(" JfrEpochSynchronization sync;");
}
for (FieldElement field : fields) {
if (field.struct) {
out.write(" _" + field.name + ".writeData(w);");
@@ -2297,7 +2297,7 @@ const bool Matcher::need_masked_shift_count = false;
// No support for generic vector operands.
const bool Matcher::supports_generic_vector_operands = false;

MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg) {
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg, bool is_temp) {
ShouldNotReachHere(); // generic vector operands not supported
return NULL;
}
@@ -1080,7 +1080,7 @@ const bool Matcher::convi2l_type_required = true;
// No support for generic vector operands.
const bool Matcher::supports_generic_vector_operands = false;

MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg) {
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg, bool is_temp) {
ShouldNotReachHere(); // generic vector operands not supported
return NULL;
}
@@ -2429,7 +2429,7 @@ const bool Matcher::need_masked_shift_count = true;
// No support for generic vector operands.
const bool Matcher::supports_generic_vector_operands = false;

MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg) {
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg, bool is_temp) {
ShouldNotReachHere(); // generic vector operands not supported
return NULL;
}
@@ -1661,7 +1661,7 @@ const bool Matcher::need_masked_shift_count = false;
// No support for generic vector operands.
const bool Matcher::supports_generic_vector_operands = false;

MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg) {
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg, bool is_temp) {
ShouldNotReachHere(); // generic vector operands not supported
return NULL;
}
@@ -1818,7 +1818,7 @@ const bool Matcher::need_masked_shift_count = false;
// No support for generic vector operands.
const bool Matcher::supports_generic_vector_operands = false;

MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg) {
MachOper* Matcher::specialize_generic_vector_operand(MachOper* original_opnd, uint ideal_reg, bool is_temp) {
ShouldNotReachHere(); // generic vector operands not supported
return NULL;
}
@@ -1438,9 +1438,14 @@ const bool Matcher::match_rule_supported_vector(int opcode, int vlen, BasicType
// x86 supports generic vector operands: vec and legVec.
const bool Matcher::supports_generic_vector_operands = true;

MachOper* Matcher::specialize_generic_vector_operand(MachOper* generic_opnd, uint ideal_reg) {
MachOper* Matcher::specialize_generic_vector_operand(MachOper* generic_opnd, uint ideal_reg, bool is_temp) {
assert(Matcher::is_generic_vector(generic_opnd), "not generic");
bool legacy = (generic_opnd->opcode() == LEGVEC);
if (!VM_Version::supports_avx512vlbwdq() && // KNL
is_temp && !legacy && (ideal_reg == Op_VecZ)) {
// Conservatively specialize 512bit vec TEMP operands to legVecZ (zmm0-15) on KNL.
return new legVecZOper();
}
if (legacy) {
switch (ideal_reg) {
case Op_VecS: return new legVecSOper();
@@ -104,7 +104,7 @@ void CompilationPolicy::compile_if_required(const methodHandle& selected_method,
return;
}
CompileBroker::compile_method(selected_method, InvocationEntryBci,
CompilationPolicy::policy()->initial_compile_level(),
CompilationPolicy::policy()->initial_compile_level(selected_method),
methodHandle(), 0, CompileTask::Reason_MustBeCompiled, CHECK);
}
}
@@ -59,7 +59,7 @@ class CompilationPolicy : public CHeapObj<mtCompiler> {
static CompileTask* select_task_helper(CompileQueue* compile_queue);

// Return initial compile level that is used with Xcomp
virtual CompLevel initial_compile_level() = 0;
virtual CompLevel initial_compile_level(const methodHandle& method) = 0;
virtual int compiler_count(CompLevel comp_level) = 0;
// main notification entry, return a pointer to an nmethod if the OSR is required,
// returns NULL otherwise.
@@ -97,7 +97,7 @@ class SimpleCompPolicy : public CompilationPolicy {
void method_back_branch_event(const methodHandle& m, int bci, JavaThread* thread);
public:
SimpleCompPolicy() : _compiler_count(0) { }
virtual CompLevel initial_compile_level() { return CompLevel_highest_tier; }
virtual CompLevel initial_compile_level(const methodHandle& m) { return CompLevel_highest_tier; }
virtual int compiler_count(CompLevel comp_level);
virtual void do_safepoint_work();
virtual void reprofile(ScopeDesc* trap_scope, bool is_osr);
@@ -57,9 +57,6 @@ bool CompilationModeFlag::initialize() {
jio_fprintf(defaultStream::error_stream(), "Unsupported compilation mode '%s', supported modes are: quick-only, high-only, high-only-quick-internal\n", CompilationMode);
return false;
}
if (disable_intermediate()) {
CompLevel_initial_compile = CompLevel_full_optimization;
}
}
return true;
}
@@ -74,16 +71,6 @@ CompLevel CompLevel_highest_tier = CompLevel_simple; // pure C
CompLevel CompLevel_highest_tier = CompLevel_none;
#endif

#if defined(TIERED)
CompLevel CompLevel_initial_compile = CompLevel_full_profile; // tiered
#elif defined(COMPILER1) || INCLUDE_JVMCI
CompLevel CompLevel_initial_compile = CompLevel_simple; // pure C1 or JVMCI
#elif defined(COMPILER2)
CompLevel CompLevel_initial_compile = CompLevel_full_optimization; // pure C2
#else
CompLevel CompLevel_initial_compile = CompLevel_none;
#endif

#if defined(COMPILER2)
CompMode Compilation_mode = CompMode_server;
#elif defined(COMPILER1)
@@ -145,7 +132,6 @@ intx CompilerConfig::scaled_freq_log(intx freq_log, double scale) {
void set_client_compilation_mode() {
Compilation_mode = CompMode_client;
CompLevel_highest_tier = CompLevel_simple;
CompLevel_initial_compile = CompLevel_simple;
FLAG_SET_ERGO(TieredCompilation, false);
FLAG_SET_ERGO(ProfileInterpreter, false);
#if INCLUDE_JVMCI
@@ -83,7 +83,6 @@ class CompilationModeFlag : AllStatic {
#endif

extern CompLevel CompLevel_highest_tier;
extern CompLevel CompLevel_initial_compile;

enum CompMode {
CompMode_none = 0,
@@ -307,6 +307,78 @@ void TieredThresholdPolicy::initialize() {
set_start_time(os::javaTimeMillis());
}


#ifdef ASSERT
bool TieredThresholdPolicy::verify_level(CompLevel level) {
// AOT and interpreter levels are always valid.
if (level == CompLevel_aot || level == CompLevel_none) {
return true;
}
if (CompilationModeFlag::normal()) {
return true;
} else if (CompilationModeFlag::quick_only()) {
return level == CompLevel_simple;
} else if (CompilationModeFlag::high_only()) {
return level == CompLevel_full_optimization;
} else if (CompilationModeFlag::high_only_quick_internal()) {
return level == CompLevel_full_optimization || level == CompLevel_simple;
}
return false;
}
#endif


CompLevel TieredThresholdPolicy::limit_level(CompLevel level) {
if (CompilationModeFlag::quick_only()) {
level = MIN2(level, CompLevel_simple);
}
assert(verify_level(level), "Invalid compilation level %d", level);
if (level <= TieredStopAtLevel) {
return level;
}
// Some compilation levels are not valid depending on a compilation mode:
// a) quick_only - levels 2,3,4 are invalid; levels -1,0,1 are valid;
// b) high_only - levels 1,2,3 are invalid; levels -1,0,4 are valid;
// c) high_only_quick_internal - levels 2,3 are invalid; levels -1,0,1,4 are valid.
// The invalid levels are actually sequential so a single comparison is sufficient.
// Down here we already have (level > TieredStopAtLevel), which also implies that
// (TieredStopAtLevel < Highest Possible Level), so we need to return a level that is:
// a) a max level that is strictly less than the highest for a given compilation mode
// b) less or equal to TieredStopAtLevel
if (CompilationModeFlag::normal() || CompilationModeFlag::quick_only()) {
return (CompLevel)TieredStopAtLevel;
}

if (CompilationModeFlag::high_only() || CompilationModeFlag::high_only_quick_internal()) {
return MIN2(CompLevel_none, (CompLevel)TieredStopAtLevel);
}

ShouldNotReachHere();
return CompLevel_any;
}

CompLevel TieredThresholdPolicy::initial_compile_level_helper(const methodHandle& method) {
if (CompilationModeFlag::normal()) {
return CompLevel_full_profile;
} else if (CompilationModeFlag::quick_only()) {
return CompLevel_simple;
} else if (CompilationModeFlag::high_only()) {
return CompLevel_full_optimization;
} else if (CompilationModeFlag::high_only_quick_internal()) {
if (force_comp_at_level_simple(method)) {
return CompLevel_simple;
} else {
return CompLevel_full_optimization;
}
}
ShouldNotReachHere();
return CompLevel_any;
}

CompLevel TieredThresholdPolicy::initial_compile_level(const methodHandle& method) {
return limit_level(initial_compile_level_helper(method));
}

void TieredThresholdPolicy::set_carry_if_necessary(InvocationCounter *counter) {
if (!counter->carry() && counter->count() > InvocationCounter::count_limit / 2) {
counter->set_carry_flag();
@@ -457,12 +529,7 @@ nmethod* TieredThresholdPolicy::event(const methodHandle& method, const methodHa

// Check if the method can be compiled, change level if necessary
void TieredThresholdPolicy::compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread) {
assert(level <= TieredStopAtLevel, "Invalid compilation level");
if (CompilationModeFlag::quick_only()) {
assert(level <= CompLevel_simple, "Invalid compilation level");
} else if (CompilationModeFlag::disable_intermediate()) {
assert(level != CompLevel_full_profile && level != CompLevel_limited_profile, "C1 profiling levels shouldn't be used with intermediate levels disabled");
}
assert(verify_level(level) && level <= TieredStopAtLevel, "Invalid compilation level %d", level);

if (level == CompLevel_none) {
if (mh->has_compiled_code()) {
@@ -924,9 +991,11 @@ CompLevel TieredThresholdPolicy::common(Predicate p, const methodHandle& method,
}
}
}
return MIN2(next_level, CompilationModeFlag::quick_only() ? CompLevel_simple : (CompLevel)TieredStopAtLevel);
return limit_level(next_level);
}



// Determine if a method should be compiled with a normal entry point at a different level.
CompLevel TieredThresholdPolicy::call_event(const methodHandle& method, CompLevel cur_level, JavaThread* thread) {
CompLevel osr_level = MIN2((CompLevel) method->highest_osr_comp_level(),
@@ -1027,7 +1096,7 @@ void TieredThresholdPolicy::method_back_branch_event(const methodHandle& mh, con
if (level == CompLevel_aot) {
// Recompile the enclosing method to prevent infinite OSRs. Stay at AOT level while it's compiling.
if (max_osr_level != CompLevel_none && !CompileBroker::compilation_is_in_queue(mh)) {
CompLevel enclosing_level = MIN2(CompilationModeFlag::quick_only() ? CompLevel_simple : (CompLevel)TieredStopAtLevel, CompLevel_full_profile);
CompLevel enclosing_level = limit_level(CompLevel_full_profile);
compile(mh, InvocationEntryBci, enclosing_level, thread);
}
} else {
@@ -170,8 +170,14 @@ class TieredThresholdPolicy : public CompilationPolicy {
inline void set_carry_if_necessary(InvocationCounter *counter);
// Set carry flags in the counters (in Method* and MDO).
inline void handle_counter_overflow(Method* method);
// Verify that a level is consistent with the compilation mode
bool verify_level(CompLevel level);
// Clamp the request level according to various constraints.
inline CompLevel limit_level(CompLevel level);
// Return desired initial compilation level for Xcomp
CompLevel initial_compile_level_helper(const methodHandle& method);
// Call and loop predicates determine whether a transition to a higher compilation
// level should be performed (pointers to predicate functions are passed to common_TF().
// level should be performed (pointers to predicate functions are passed to common().
// Predicates also take compiler load into account.
typedef bool (TieredThresholdPolicy::*Predicate)(int i, int b, CompLevel cur_level, const methodHandle& method);
bool call_predicate(int i, int b, CompLevel cur_level, const methodHandle& method);
@@ -253,7 +259,8 @@ class TieredThresholdPolicy : public CompilationPolicy {
if (is_c2_compile(comp_level)) return c2_count();
return 0;
}
virtual CompLevel initial_compile_level() { return MIN2((CompLevel)TieredStopAtLevel, CompLevel_initial_compile); }
// Return initial compile level to use with Xcomp (depends on compilation mode).
virtual CompLevel initial_compile_level(const methodHandle& method);
virtual void do_safepoint_work() { }
virtual void delay_compilation(Method* method) { }
virtual void disable_compilation(Method* method) { }
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
/*
* Copyright (c) 2001, 2020, 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
@@ -2151,6 +2151,13 @@ bool G1CollectedHeap::try_collect_concurrently(GCCause::Cause cause,
return op.gc_succeeded();
}

// If VMOp skipped initiating concurrent marking cycle because
// we're terminating, then we're done.
if (op.terminating()) {
LOG_COLLECT_CONCURRENTLY(cause, "skipped: terminating");
return false;
}

// Lock to get consistent set of values.
uint old_marking_started_after;
uint old_marking_completed_after;

0 comments on commit 231d9af

Please sign in to comment.