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 16, 2021
2 parents a238739 + 8c1112a commit ee110fc05fe29590e035e6c4c899ef23afec6643
Showing with 460 additions and 476 deletions.
  1. +2 −2 src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp
  2. +5 −1 src/hotspot/os/posix/os_posix.cpp
  3. +3 −1 src/hotspot/share/adlc/output_h.cpp
  4. +3 −3 src/hotspot/share/ci/ciMethod.cpp
  5. +1 −1 src/hotspot/share/classfile/classFileParser.cpp
  6. +1 −1 src/hotspot/share/classfile/javaClasses.cpp
  7. +36 −23 src/hotspot/share/gc/g1/g1CollectedHeap.cpp
  8. +9 −3 src/hotspot/share/gc/g1/g1CollectedHeap.hpp
  9. +6 −19 src/hotspot/share/gc/g1/g1CollectorState.cpp
  10. +1 −3 src/hotspot/share/gc/g1/g1CollectorState.hpp
  11. +30 −35 src/hotspot/share/gc/g1/{g1GCTypes.hpp → g1GCPauseType.hpp}
  12. +25 −25 src/hotspot/share/gc/g1/g1Policy.cpp
  13. +20 −15 src/hotspot/share/gc/g1/g1Trace.cpp
  14. +9 −15 src/hotspot/share/gc/g1/g1Trace.hpp
  15. +32 −17 src/hotspot/share/gc/parallel/psParallelCompact.cpp
  16. +3 −1 src/hotspot/share/gc/parallel/psParallelCompact.hpp
  17. +1 −2 src/hotspot/share/interpreter/interpreterRuntime.cpp
  18. +2 −2 src/hotspot/share/jfr/metadata/metadata.xml
  19. +3 −5 src/hotspot/share/memory/metaspace.cpp
  20. +1 −4 src/hotspot/share/memory/metaspace/metaspaceReporter.cpp
  21. +0 −1 src/hotspot/share/memory/universe.cpp
  22. +2 −1 src/hotspot/share/oops/constantPool.cpp
  23. +1 −2 src/hotspot/share/oops/cpCache.cpp
  24. +1 −2 src/hotspot/share/oops/cpCache.hpp
  25. +26 −72 src/hotspot/share/runtime/interfaceSupport.inline.hpp
  26. +7 −7 src/hotspot/share/runtime/mutex.cpp
  27. +1 −1 src/hotspot/share/runtime/safepoint.cpp
  28. +4 −4 src/hotspot/share/runtime/sharedRuntime.cpp
  29. +1 −1 src/hotspot/share/runtime/sharedRuntime.hpp
  30. +1 −1 src/hotspot/share/runtime/synchronizer.cpp
  31. +12 −3 src/hotspot/share/utilities/exceptions.cpp
  32. +8 −4 src/hotspot/share/utilities/exceptions.hpp
  33. +23 −10 src/hotspot/share/utilities/vmError.cpp
  34. +1 −1 src/java.base/share/classes/java/io/ObjectStreamClass.java
  35. +0 −103 src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
  36. +9 −0 src/java.base/share/classes/java/nio/MappedByteBuffer.java
  37. +8 −2 src/java.base/share/classes/java/nio/MappedMemoryUtils.java
  38. +1 −1 src/java.base/share/classes/javax/crypto/CryptoPolicyParser.java
  39. +3 −3 src/java.base/share/classes/jdk/internal/loader/URLClassPath.java
  40. +1 −1 src/java.base/share/classes/jdk/internal/reflect/SignatureIterator.java
  41. +1 −1 src/java.base/share/classes/sun/invoke/util/Wrapper.java
  42. +1 −1 src/java.base/share/classes/sun/security/provider/PolicyParser.java
  43. +2 −2 src/java.base/windows/native/libnio/MappedMemoryUtils.c
  44. +5 −1 src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
  45. +1 −1 src/java.desktop/share/classes/javax/swing/text/NumberFormatter.java
  46. +2 −2 src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java
  47. +1 −2 src/java.security.jgss/share/classes/sun/security/krb5/PrincipalName.java
  48. +1 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/file/JavacFileManager.java
  49. +0 −45 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/G1YCType.java
  50. +3 −1 src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MappedMemorySegments.java
  51. +0 −1 test/hotspot/jtreg/gc/TestConcurrentGCBreakpoints.java
  52. +0 −1 test/hotspot/jtreg/gc/TestJNIWeak/TestJNIWeak.java
  53. +0 −1 test/hotspot/jtreg/gc/TestReferenceClearDuringMarking.java
  54. +0 −1 test/hotspot/jtreg/gc/TestReferenceClearDuringReferenceProcessing.java
  55. +0 −1 test/hotspot/jtreg/gc/TestReferenceRefersTo.java
  56. +0 −1 test/hotspot/jtreg/gc/TestReferenceRefersToDuringConcMark.java
  57. +2 −2 test/hotspot/jtreg/gc/arguments/TestAggressiveHeap.java
  58. +1 −2 test/hotspot/jtreg/gc/g1/TestPeriodicCollectionJNI.java
  59. +0 −2 test/hotspot/jtreg/gc/shenandoah/TestReferenceRefersToShenandoah.java
  60. +1 −2 test/hotspot/jtreg/runtime/jni/CallWithJNIWeak/CallWithJNIWeak.java
  61. +1 −2 test/hotspot/jtreg/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java
  62. +57 −0 test/jdk/java/net/URLClassLoader/FindResourceDoesNotThrowException.java
  63. +75 −0 test/jdk/java/nio/MappedByteBuffer/ForceException.java
  64. +1 −2 test/jdk/java/util/Formatter/Basic.java
  65. +2 −3 test/jdk/java/util/zip/ZipFile/Zip64SizeTest.java
@@ -174,7 +174,7 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
if (large_disp != 0) {
LIR_Opr tmp = new_pointer_register();
if (Assembler::operand_valid_for_add_sub_immediate(large_disp)) {
__ add(tmp, tmp, LIR_OprFact::intptrConst(large_disp));
__ add(index, LIR_OprFact::intptrConst(large_disp), tmp);
index = tmp;
} else {
__ move(tmp, LIR_OprFact::intptrConst(large_disp));
@@ -191,7 +191,7 @@ LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index,
}

// at this point we either have base + index or base + displacement
if (large_disp == 0) {
if (large_disp == 0 && index->is_register()) {
return new LIR_Address(base, index, type);
} else {
assert(Address::offset_ok_for_immed(large_disp, 0), "must be");
@@ -1878,13 +1878,17 @@ void os::shutdown() {
// Note: os::abort() might be called very early during initialization, or
// called from signal handler. Before adding something to os::abort(), make
// sure it is async-safe and can handle partially initialized VM.
// Also note we can abort while other threads continue to run, so we can
// easily trigger secondary faults in those threads. To reduce the likelihood
// of that we use _exit rather than exit, so that no atexit hooks get run.
// But note that os::shutdown() could also trigger secondary faults.
void os::abort(bool dump_core, void* siginfo, const void* context) {
os::shutdown();
if (dump_core) {
LINUX_ONLY(if (DumpPrivateMappingsInCore) ClassLoader::close_jrt_image();)
::abort(); // dump core
}
::exit(1);
::_exit(1);
}

// Die immediately, no exit hook, no abort hook, no cleanup.
@@ -2136,7 +2136,9 @@ class OutputMachOpcodes : public OutputMap {
public:
OutputMachOpcodes(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
: OutputMap(hpp, cpp, globals, AD, "MachOpcodes"),
begin_inst_chain_rule(-1), end_inst_chain_rule(-1), end_instructions(-1)
begin_inst_chain_rule(-1), end_inst_chain_rule(-1),
begin_rematerialize(-1), end_rematerialize(-1),
end_instructions(-1)
{};

void declaration() { }
@@ -299,7 +299,7 @@ bool ciMethod::has_balanced_monitors() {
}

{
EXCEPTION_MARK;
ExceptionMark em(THREAD);
ResourceMark rm(THREAD);
GeneratePairingInfo gpi(method);
gpi.compute_map(CATCH);
@@ -1143,7 +1143,7 @@ bool ciMethod::was_executed_more_than(int times) {
bool ciMethod::has_unloaded_classes_in_signature() {
VM_ENTRY_MARK;
{
EXCEPTION_MARK;
ExceptionMark em(THREAD);
methodHandle m(THREAD, get_Method());
bool has_unloaded = Method::has_unloaded_classes_in_signature(m, thread);
if( HAS_PENDING_EXCEPTION ) {
@@ -1170,7 +1170,7 @@ bool ciMethod::check_call(int refinfo_index, bool is_static) const {
// FIXME: Remove this method and resolve_method_statically; refactor to use the other LinkResolver entry points.
VM_ENTRY_MARK;
{
EXCEPTION_MARK;
ExceptionMark em(THREAD);
HandleMark hm(THREAD);
constantPoolHandle pool (THREAD, get_Method()->constants());
Bytecodes::Code code = (is_static ? Bytecodes::_invokestatic : Bytecodes::_invokevirtual);
@@ -3766,7 +3766,7 @@ void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cf
}
parse_classfile_synthetic_attribute(CHECK);
} else if (tag == vmSymbols::tag_deprecated()) {
// Check for Deprecatd tag - 4276120
// Check for Deprecated tag - 4276120
if (attribute_length != 0) {
classfile_parse_error(
"Invalid Deprecated classfile attribute length %u in class file %s",
@@ -2382,7 +2382,7 @@ void java_lang_Throwable::print_stack_trace(Handle throwable, outputStream* st)
}
{
// Call getCause() which doesn't necessarily return the _cause field.
EXCEPTION_MARK;
ExceptionMark em(THREAD);
JavaValue cause(T_OBJECT);
JavaCalls::call_virtual(&cause,
throwable,
@@ -43,7 +43,7 @@
#include "gc/g1/g1FullCollector.hpp"
#include "gc/g1/g1GCParPhaseTimesTracker.hpp"
#include "gc/g1/g1GCPhaseTimes.hpp"
#include "gc/g1/g1GCTypes.hpp"
#include "gc/g1/g1GCPauseType.hpp"
#include "gc/g1/g1HeapSizingPolicy.hpp"
#include "gc/g1/g1HeapTransition.hpp"
#include "gc/g1/g1HeapVerifier.hpp"
@@ -2848,18 +2848,15 @@ void G1CollectedHeap::expand_heap_after_young_collection(){
}
}

const char* G1CollectedHeap::young_gc_name() const {
if (collector_state()->in_concurrent_start_gc()) {
return "Pause Young (Concurrent Start)";
} else if (collector_state()->in_young_only_phase()) {
if (collector_state()->in_young_gc_before_mixed()) {
return "Pause Young (Prepare Mixed)";
} else {
return "Pause Young (Normal)";
}
} else {
return "Pause Young (Mixed)";
}
void G1CollectedHeap::set_young_gc_name(char* young_gc_name) {
G1GCPauseType pause_type =
// The strings for all Concurrent Start pauses are the same, so the parameter
// does not matter here.
collector_state()->young_gc_pause_type(false /* concurrent_operation_is_full_mark */);
snprintf(young_gc_name,
MaxYoungGCNameLength,
"Pause Young (%s)",
G1GCPauseTypeHelper::to_string(pause_type));
}

bool G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
@@ -2882,6 +2879,21 @@ bool G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_
return true;
}

void G1CollectedHeap::gc_tracer_report_gc_start() {
_gc_timer_stw->register_gc_start();
_gc_tracer_stw->report_gc_start(gc_cause(), _gc_timer_stw->gc_start());
}

void G1CollectedHeap::gc_tracer_report_gc_end(bool concurrent_operation_is_full_mark,
G1EvacuationInfo& evacuation_info) {
_gc_tracer_stw->report_evacuation_info(&evacuation_info);
_gc_tracer_stw->report_tenuring_threshold(_policy->tenuring_threshold());

_gc_timer_stw->register_gc_end();
_gc_tracer_stw->report_gc_end(_gc_timer_stw->gc_end(),
_gc_timer_stw->time_partitions());
}

void G1CollectedHeap::do_collection_pause_at_safepoint_helper(double target_pause_time_ms) {
GCIdMark gc_id_mark;

@@ -2890,8 +2902,7 @@ void G1CollectedHeap::do_collection_pause_at_safepoint_helper(double target_paus

policy()->note_gc_start();

_gc_timer_stw->register_gc_start();
_gc_tracer_stw->report_gc_start(gc_cause(), _gc_timer_stw->gc_start());
gc_tracer_report_gc_start();

wait_for_root_region_scanning();

@@ -2926,11 +2937,12 @@ void G1CollectedHeap::do_collection_pause_at_safepoint_helper(double target_paus
{
G1EvacuationInfo evacuation_info;

_gc_tracer_stw->report_yc_phase(collector_state()->young_gc_phase());

GCTraceCPUTime tcpu;

GCTraceTime(Info, gc) tm(young_gc_name(), NULL, gc_cause(), true);
char young_gc_name[MaxYoungGCNameLength];
set_young_gc_name(young_gc_name);

GCTraceTime(Info, gc) tm(young_gc_name, NULL, gc_cause(), true);

uint active_workers = WorkerPolicy::calc_active_workers(workers()->total_workers(),
workers()->active_workers(),
@@ -2940,7 +2952,7 @@ void G1CollectedHeap::do_collection_pause_at_safepoint_helper(double target_paus

G1MonitoringScope ms(g1mm(),
false /* full_gc */,
collector_state()->young_gc_phase() == Mixed /* all_memory_pools_affected */);
collector_state()->in_mixed_phase() /* all_memory_pools_affected */);

G1HeapTransition heap_transition(this);

@@ -3008,6 +3020,10 @@ void G1CollectedHeap::do_collection_pause_at_safepoint_helper(double target_paus
// evacuation, eventually aborting it.
concurrent_operation_is_full_mark = policy()->concurrent_operation_is_full_mark("Revise IHOP");

// Need to report the collection pause now since record_collection_pause_end()
// modifies it to the next state.
_gc_tracer_stw->report_young_gc_pause(collector_state()->young_gc_pause_type(concurrent_operation_is_full_mark));

double sample_end_time_sec = os::elapsedTime();
double pause_time_ms = (sample_end_time_sec - sample_start_time_sec) * MILLIUNITS;
policy()->record_collection_pause_end(pause_time_ms, concurrent_operation_is_full_mark);
@@ -3042,10 +3058,7 @@ void G1CollectedHeap::do_collection_pause_at_safepoint_helper(double target_paus
// before any GC notifications are raised.
g1mm()->update_sizes();

_gc_tracer_stw->report_evacuation_info(&evacuation_info);
_gc_tracer_stw->report_tenuring_threshold(_policy->tenuring_threshold());
_gc_timer_stw->register_gc_end();
_gc_tracer_stw->report_gc_end(_gc_timer_stw->gc_end(), _gc_timer_stw->time_partitions());
gc_tracer_report_gc_end(concurrent_operation_is_full_mark, evacuation_info);
}
// It should now be safe to tell the concurrent mark thread to start
// without its logging output interfering with the logging output
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 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
@@ -36,7 +36,7 @@
#include "gc/g1/g1EvacStats.hpp"
#include "gc/g1/g1EvacuationInfo.hpp"
#include "gc/g1/g1GCPhaseTimes.hpp"
#include "gc/g1/g1GCTypes.hpp"
#include "gc/g1/g1GCPauseType.hpp"
#include "gc/g1/g1HeapTransition.hpp"
#include "gc/g1/g1HeapVerifier.hpp"
#include "gc/g1/g1HRPrinter.hpp"
@@ -378,7 +378,10 @@ class G1CollectedHeap : public CollectedHeap {
#define assert_used_and_recalculate_used_equal(g1h) do {} while(0)
#endif

const char* young_gc_name() const;
static const uint MaxYoungGCNameLength = 128;
// Sets given young_gc_name to the canonical young gc pause string. Young_gc_name
// must be at least of length MaxYoungGCNameLength.
void set_young_gc_name(char* young_gc_name);

// The young region list.
G1EdenRegions _eden;
@@ -388,6 +391,9 @@ class G1CollectedHeap : public CollectedHeap {

G1NewTracer* _gc_tracer_stw;

void gc_tracer_report_gc_start();
void gc_tracer_report_gc_end(bool concurrent_operation_is_full_mark, G1EvacuationInfo& evacuation_info);

// The current policy object for the collector.
G1Policy* _policy;
G1HeapSizingPolicy* _heap_sizing_policy;
@@ -24,37 +24,24 @@

#include "precompiled.hpp"
#include "gc/g1/g1CollectorState.hpp"
#include "gc/g1/g1GCTypes.hpp"
#include "gc/g1/g1GCPauseType.hpp"

G1GCPauseType G1CollectorState::young_gc_pause_type(bool concurrent_operation_is_full_mark) const {
assert(!in_full_gc(), "must be");
if (in_concurrent_start_gc()) {
assert(!in_young_gc_before_mixed(), "must be");
return concurrent_operation_is_full_mark ? ConcurrentStartMarkGC : ConcurrentStartUndoGC;
return concurrent_operation_is_full_mark ? G1GCPauseType::ConcurrentStartMarkGC :
G1GCPauseType::ConcurrentStartUndoGC;
} else if (in_young_gc_before_mixed()) {
assert(!in_concurrent_start_gc(), "must be");
return LastYoungGC;
return G1GCPauseType::LastYoungGC;
} else if (in_mixed_phase()) {
assert(!in_concurrent_start_gc(), "must be");
assert(!in_young_gc_before_mixed(), "must be");
return MixedGC;
return G1GCPauseType::MixedGC;
} else {
assert(!in_concurrent_start_gc(), "must be");
assert(!in_young_gc_before_mixed(), "must be");
return YoungGC;
}
}

G1GCYoungPhase G1CollectorState::young_gc_phase() const {
assert(!in_full_gc(), "must be");

if (in_concurrent_start_gc()) {
return ConcurrentStart;
} else if (mark_or_rebuild_in_progress()) {
return DuringMarkOrRebuild;
} else if (in_young_only_phase()) {
return Normal;
} else {
return Mixed;
return G1GCPauseType::YoungGC;
}
}
@@ -25,7 +25,7 @@
#ifndef SHARE_GC_G1_G1COLLECTORSTATE_HPP
#define SHARE_GC_G1_G1COLLECTORSTATE_HPP

#include "gc/g1/g1GCTypes.hpp"
#include "gc/g1/g1GCPauseType.hpp"
#include "utilities/globalDefinitions.hpp"

// State of the G1 collection.
@@ -112,8 +112,6 @@ class G1CollectorState {

// Calculate GC Pause Type from internal state.
G1GCPauseType young_gc_pause_type(bool concurrent_operation_is_full_mark) const;
G1GCYoungPhase young_gc_phase() const;

};

#endif // SHARE_GC_G1_G1COLLECTORSTATE_HPP

0 comments on commit ee110fc

Please sign in to comment.