Skip to content
Permalink
Browse files

Merge

  • Loading branch information
JesperIRL committed Jan 9, 2020
2 parents ff91490 + d8e3d8a commit 943b87ddde7f85f5f822662fe0a03538673eb2a8
Showing with 308 additions and 222 deletions.
  1. +1 −0 .hgtags
  2. +8 −1 src/hotspot/share/gc/g1/g1CollectedHeap.cpp
  3. +13 −2 src/hotspot/share/gc/g1/g1VMOperations.cpp
  4. +3 −1 src/hotspot/share/gc/g1/g1VMOperations.hpp
  5. +3 −1 src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp
  6. +4 −2 src/hotspot/share/jfr/recorder/service/jfrRecorderService.cpp
  7. +2 −2 src/hotspot/share/opto/memnode.cpp
  8. +1 −1 src/hotspot/share/opto/memnode.hpp
  9. +10 −1 src/hotspot/share/prims/whitebox.cpp
  10. +7 −3 src/java.base/share/classes/sun/security/ssl/ServerHello.java
  11. +11 −2 src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
  12. +13 −1 src/java.base/share/classes/sun/security/util/LegacyAlgorithmConstraints.java
  13. +24 −16 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java
  14. +1 −1 src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/AbstractLayout.java
  15. +7 −1 src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryAddress.java
  16. +18 −3 src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/MemoryLayout.java
  17. +3 −3 src/jdk.jfr/share/classes/jdk/jfr/Recording.java
  18. +1 −16 src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java
  19. +4 −2 src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java
  20. +2 −1 src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties
  21. +79 −0 test/hotspot/jtreg/compiler/macronodes/TestCompleteVolatileStore.java
  22. +2 −2 test/hotspot/jtreg/gc/g1/TestGCLogMessages.java
  23. +54 −0 test/jdk/java/foreign/TestTypeAccess.java
  24. +1 −2 test/jdk/jdk/jfr/api/consumer/recordingstream/TestSetEndTime.java
  25. +0 −62 test/jdk/jdk/jfr/api/consumer/recordingstream/TestSetFlushInterval.java
  26. +1 −2 test/jdk/jdk/jfr/api/consumer/security/TestStreamingRemote.java
  27. +1 −2 test/jdk/jdk/jfr/api/consumer/streaming/TestInProcessMigration.java
  28. +0 −86 test/jdk/jdk/jfr/api/recording/time/TestSetFlushInterval.java
  29. +9 −4 test/jdk/jdk/jfr/startupargs/TestFlushInterval.java
  30. +12 −0 test/langtools/tools/javac/records/RecordCompilationTests.java
  31. +3 −1 test/lib/sun/hotspot/WhiteBox.java
  32. +10 −1 test/lib/sun/hotspot/code/Compiler.java
@@ -608,4 +608,5 @@ f33197adda9ad82fdef46ac0f7dc0126204f35b2 jdk-15+2
d05fcdf25717d85e80a3a39a6b719458b22be5fe jdk-15+3
d54ce919da90dab361995bb4d87be9851f00537a jdk-14+30
bb0a7975b31ded63d594ee8dbfc4d4ead587f79b jdk-15+4
decd3d2953b640f1043ee76953ff89238bff92e8 jdk-14+31
b97c1773ccafae4a8c16cc6aedb10b2a4f9a07ed jdk-15+5
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -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;
@@ -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
@@ -47,6 +47,7 @@ VM_G1TryInitiateConcMark::VM_G1TryInitiateConcMark(uint gc_count_before,
_target_pause_time_ms(target_pause_time_ms),
_transient_failure(false),
_cycle_already_in_progress(false),
_terminating(false),
_gc_succeeded(false)
{}

@@ -66,7 +67,17 @@ void VM_G1TryInitiateConcMark::doit() {
G1CollectedHeap* g1h = G1CollectedHeap::heap();

GCCauseSetter x(g1h, _gc_cause);
if (!g1h->policy()->force_initial_mark_if_outside_cycle(_gc_cause)) {

// Record for handling by caller.
_terminating = g1h->_cm_thread->should_terminate();

if (_terminating && GCCause::is_user_requested_gc(_gc_cause)) {
// When terminating, the request to initiate a concurrent cycle will be
// ignored by do_collection_pause_at_safepoint; instead it will just do
// a young-only or mixed GC (depending on phase). For a user request
// there's no point in even doing that much, so done. For some non-user
// requests the alternative GC might still be needed.
} else if (!g1h->policy()->force_initial_mark_if_outside_cycle(_gc_cause)) {
// Failure to force the next GC pause to be an initial mark indicates
// there is already a concurrent marking cycle in progress. Set flag
// to notify the caller and return immediately.
@@ -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
@@ -52,6 +52,7 @@ class VM_G1TryInitiateConcMark : public VM_GC_Operation {
double _target_pause_time_ms;
bool _transient_failure;
bool _cycle_already_in_progress;
bool _terminating;
bool _gc_succeeded;

public:
@@ -63,6 +64,7 @@ class VM_G1TryInitiateConcMark : public VM_GC_Operation {
virtual void doit();
bool transient_failure() const { return _transient_failure; }
bool cycle_already_in_progress() const { return _cycle_already_in_progress; }
bool terminating() const { return _terminating; }
bool gc_succeeded() const { return _gc_succeeded; }
};

@@ -223,7 +223,9 @@ class ShenandoahNMethodUnlinkClosure : public NMethodClosure {
ShenandoahReentrantLocker locker(nm_data->lock());

// Heal oops and disarm
ShenandoahNMethod::heal_nmethod(nm);
if (_heap->is_evacuation_in_progress()) {
ShenandoahNMethod::heal_nmethod(nm);
}
ShenandoahNMethod::disarm_nmethod(nm);

// Clear compiled ICs and exception caches
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 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
@@ -671,7 +671,9 @@ void JfrRecorderService::invoke_flush() {

void JfrRecorderService::flushpoint() {
MutexLocker lock(JfrStream_lock, Mutex::_no_safepoint_check_flag);
invoke_flush();
if (_chunkwriter.is_valid()) {
invoke_flush();
}
}

void JfrRecorderService::process_full_buffers() {
@@ -4170,7 +4170,7 @@ intptr_t InitializeNode::find_next_fullword_store(uint start, PhaseGVN* phase) {
Node* InitializeNode::complete_stores(Node* rawctl, Node* rawmem, Node* rawptr,
intptr_t header_size,
Node* size_in_bytes,
PhaseGVN* phase) {
PhaseIterGVN* phase) {
assert(!is_complete(), "not already complete");
assert(stores_are_sane(phase), "");
assert(allocation() != NULL, "must be present");
@@ -4262,7 +4262,7 @@ Node* InitializeNode::complete_stores(Node* rawctl, Node* rawmem, Node* rawptr,
}

// Collect the store and move on:
st->set_req(MemNode::Memory, inits);
phase->replace_input_of(st, MemNode::Memory, inits);
inits = st; // put it on the linearized chain
set_req(i, zmem); // unhook from previous position

@@ -1402,7 +1402,7 @@ class InitializeNode: public MemBarNode {
// Called when the associated AllocateNode is expanded into CFG.
Node* complete_stores(Node* rawctl, Node* rawmem, Node* rawptr,
intptr_t header_size, Node* size_in_bytes,
PhaseGVN* phase);
PhaseIterGVN* phase);

private:
void remove_extra_zeroes();
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 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
@@ -1986,6 +1986,14 @@ WB_ENTRY(jboolean, WB_IsCDSIncludedInVmBuild(JNIEnv* env))
#endif // INCLUDE_CDS
WB_END

WB_ENTRY(jboolean, WB_isC2OrJVMCIIncludedInVmBuild(JNIEnv* env))
#if COMPILER2_OR_JVMCI
return true;
#else
return false;
#endif
WB_END

WB_ENTRY(jboolean, WB_IsJavaHeapArchiveSupported(JNIEnv* env))
return HeapShared::is_heap_object_archiving_allowed();
WB_END
@@ -2411,6 +2419,7 @@ static JNINativeMethod methods[] = {
{CC"areOpenArchiveHeapObjectsMapped", CC"()Z", (void*)&WB_AreOpenArchiveHeapObjectsMapped},
{CC"isCDSIncludedInVmBuild", CC"()Z", (void*)&WB_IsCDSIncludedInVmBuild },
{CC"isJFRIncludedInVmBuild", CC"()Z", (void*)&WB_IsJFRIncludedInVmBuild },
{CC"isC2OrJVMCIIncludedInVmBuild", CC"()Z", (void*)&WB_isC2OrJVMCIIncludedInVmBuild },
{CC"isJavaHeapArchiveSupported", CC"()Z", (void*)&WB_IsJavaHeapArchiveSupported },
{CC"cdsMemoryMappingFailed", CC"()Z", (void*)&WB_CDSMemoryMappingFailed },

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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
@@ -28,9 +28,11 @@
import java.io.IOException;
import java.nio.ByteBuffer;
import java.security.AlgorithmConstraints;
import java.security.CryptoPrimitive;
import java.security.GeneralSecurityException;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
@@ -434,7 +436,7 @@ private static KeyExchangeProperties chooseCipherSuite(
continue;
}
if (!ServerHandshakeContext.legacyAlgorithmConstraints.permits(
null, cs.name, null)) {
EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), cs.name, null)) {
legacySuites.add(cs);
continue;
}
@@ -723,7 +725,9 @@ private static CipherSuite chooseCipherSuite(
}

if ((legacySuite == null) &&
!legacyConstraints.permits(null, cs.name, null)) {
!legacyConstraints.permits(
EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
cs.name, null)) {
legacySuite = cs;
continue;
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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
@@ -128,6 +128,11 @@ public DisabledAlgorithmConstraints(String propertyName,
@Override
public final boolean permits(Set<CryptoPrimitive> primitives,
String algorithm, AlgorithmParameters parameters) {
if (primitives == null || primitives.isEmpty()) {
throw new IllegalArgumentException("The primitives cannot be null" +
" or empty.");
}

if (!checkAlgorithm(disabledAlgorithms, algorithm, decomposer)) {
return false;
}
@@ -216,7 +221,11 @@ public boolean checkProperty(String param) {
private boolean checkConstraints(Set<CryptoPrimitive> primitives,
String algorithm, Key key, AlgorithmParameters parameters) {

// check the key parameter, it cannot be null.
if (primitives == null || primitives.isEmpty()) {
throw new IllegalArgumentException("The primitives cannot be null" +
" or empty.");
}

if (key == null) {
throw new IllegalArgumentException("The key cannot be null");
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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
@@ -51,17 +51,29 @@ public LegacyAlgorithmConstraints(String propertyName,
@Override
public final boolean permits(Set<CryptoPrimitive> primitives,
String algorithm, AlgorithmParameters parameters) {
if (primitives == null || primitives.isEmpty()) {
throw new IllegalArgumentException("The primitives cannot be null" +
" or empty.");
}
return checkAlgorithm(legacyAlgorithms, algorithm, decomposer);
}

@Override
public final boolean permits(Set<CryptoPrimitive> primitives, Key key) {
if (primitives == null || primitives.isEmpty()) {
throw new IllegalArgumentException("The primitives cannot be null" +
" or empty.");
}
return true;
}

@Override
public final boolean permits(Set<CryptoPrimitive> primitives,
String algorithm, Key key, AlgorithmParameters parameters) {
if (primitives == null || primitives.isEmpty()) {
throw new IllegalArgumentException("The primitives cannot be null" +
" or empty.");
}
return checkAlgorithm(legacyAlgorithms, algorithm, decomposer);
}

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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
@@ -1855,21 +1855,17 @@ void letInit(JCTree tree) {

/** Check that trackable variable is initialized.
*/
boolean checkInit(DiagnosticPosition pos, VarSymbol sym, boolean compactConstructor) {
return checkInit(pos, sym, Errors.VarMightNotHaveBeenInitialized(sym), compactConstructor);
void checkInit(DiagnosticPosition pos, VarSymbol sym) {
checkInit(pos, sym, Errors.VarMightNotHaveBeenInitialized(sym));
}

boolean checkInit(DiagnosticPosition pos, VarSymbol sym, Error errkey, boolean compactConstructor) {
void checkInit(DiagnosticPosition pos, VarSymbol sym, Error errkey) {
if ((sym.adr >= firstadr || sym.owner.kind != TYP) &&
trackable(sym) &&
!inits.isMember(sym.adr)) {
if (sym.owner.kind != TYP || !compactConstructor || !uninits.isMember(sym.adr)) {
log.error(pos, errkey);
}
inits.incl(sym.adr);
return false;
}
return true;
}

/** Utility method to reset several Bits instances.
@@ -2099,15 +2095,27 @@ public void visitMethodDef(JCMethodDecl tree) {
// the ctor is default(synthesized) or not
if (isSynthesized && !isCompactConstructor) {
checkInit(TreeInfo.diagnosticPositionFor(var, vardecl),
var, Errors.VarNotInitializedInDefaultConstructor(var), isCompactConstructor);
} else {
boolean wasInitialized = checkInit(TreeInfo.diagEndPos(tree.body), var, isCompactConstructor && tree.completesNormally);
if (!wasInitialized && var.owner.kind == TYP && isCompactConstructor && uninits.isMember(var.adr) && tree.completesNormally) {
var, Errors.VarNotInitializedInDefaultConstructor(var));
} else if (isCompactConstructor) {
boolean isInstanceRecordField = var.enclClass().isRecord() &&
(var.flags_field & (Flags.PRIVATE | Flags.FINAL | Flags.GENERATED_MEMBER | Flags.RECORD)) != 0 &&
!var.isStatic() &&
var.owner.kind == TYP;
if (isInstanceRecordField) {
boolean notInitialized = !inits.isMember(var.adr);
if (notInitialized && uninits.isMember(var.adr) && tree.completesNormally) {
/* this way we indicate Lower that it should generate an initialization for this field
* in the compact constructor
*/
var.flags_field |= UNINITIALIZED_FIELD;
var.flags_field |= UNINITIALIZED_FIELD;
} else {
checkInit(TreeInfo.diagEndPos(tree.body), var);
}
} else {
checkInit(TreeInfo.diagnosticPositionFor(var, vardecl), var);
}
} else {
checkInit(TreeInfo.diagEndPos(tree.body), var);
}
}
}
@@ -2124,7 +2132,7 @@ public void visitMethodDef(JCMethodDecl tree) {
Assert.check(exit instanceof AssignPendingExit);
inits.assign(((AssignPendingExit) exit).exit_inits);
for (int i = firstadr; i < nextadr; i++) {
checkInit(exit.tree.pos(), vardecls[i].sym, isCompactConstructor);
checkInit(exit.tree.pos(), vardecls[i].sym);
}
}
}
@@ -2666,7 +2674,7 @@ public void visitSelect(JCFieldAccess tree) {
super.visitSelect(tree);
if (TreeInfo.isThisQualifier(tree.selected) &&
tree.sym.kind == VAR) {
checkInit(tree.pos(), (VarSymbol)tree.sym, false);
checkInit(tree.pos(), (VarSymbol)tree.sym);
}
}

@@ -2727,7 +2735,7 @@ public void visitBinary(JCBinary tree) {

public void visitIdent(JCIdent tree) {
if (tree.sym.kind == VAR) {
checkInit(tree.pos(), (VarSymbol)tree.sym, false);
checkInit(tree.pos(), (VarSymbol)tree.sym);
referenced(tree.sym);
}
}
@@ -140,7 +140,7 @@ public boolean equals(Object other) {

/*** Helper constants for implementing Layout::describeConstable ***/

public static final DirectMethodHandleDesc BSM_GET_STATIC_FINAL
static final DirectMethodHandleDesc BSM_GET_STATIC_FINAL
= ConstantDescs.ofConstantBootstrap(ConstantDescs.CD_ConstantBootstraps, "getStaticFinal",
ConstantDescs.CD_Object, ConstantDescs.CD_Class);

@@ -74,7 +74,13 @@

/**
* Compares the specified object with this address for equality. Returns {@code true} if and only if the specified
* object is also a address, and it is equal to this address.
* object is also an address, and it refers to the same memory location as this address.
*
* @apiNote two addresses might be considered equal despite their associated segments differ. This
* can happen, for instance, if the segment associated with one address is a <em>slice</em>
* (see {@link MemorySegment#asSlice(long, long)}) of the segment associated with the other address. Moreover,
* two addresses might be considered equals despite differences in the temporal bounds associated with their
* corresponding segments (this is possible, for example, as a result of calls to {@link MemorySegment#acquire()}).
*
* @param that the object to be compared for equality with this address.
* @return {@code true} if the specified object is equal to this address.

0 comments on commit 943b87d

Please sign in to comment.