This commit is contained in:
Mikael Vidstedt 2020-07-19 21:34:28 -07:00
commit ec074011a4
22 changed files with 81 additions and 69 deletions

@ -525,13 +525,15 @@ void ShenandoahControlThread::handle_requested_gc(GCCause::Cause cause) {
// comes very late in the already running cycle, it would miss lots of new
// opportunities for cleanup that were made available before the caller
// requested the GC.
size_t required_gc_id = get_gc_id() + 1;
MonitorLocker ml(&_gc_waiters_lock);
while (get_gc_id() < required_gc_id) {
size_t current_gc_id = get_gc_id();
size_t required_gc_id = current_gc_id + 1;
while (current_gc_id < required_gc_id) {
_gc_requested.set();
_requested_gc_cause = cause;
ml.wait();
current_gc_id = get_gc_id();
}
}

@ -74,21 +74,6 @@
#include "opto/runtime.hpp"
#endif
class UnlockFlagSaver {
private:
JavaThread* _thread;
bool _do_not_unlock;
public:
UnlockFlagSaver(JavaThread* t) {
_thread = t;
_do_not_unlock = t->do_not_unlock_if_synchronized();
t->set_do_not_unlock_if_synchronized(false);
}
~UnlockFlagSaver() {
_thread->set_do_not_unlock_if_synchronized(_do_not_unlock);
}
};
// Helper class to access current interpreter state
class LastFrameAccessor : public StackObj {
frame _last_frame;
@ -1031,6 +1016,9 @@ nmethod* InterpreterRuntime::frequency_counter_overflow(JavaThread* thread, addr
JRT_ENTRY(nmethod*,
InterpreterRuntime::frequency_counter_overflow_inner(JavaThread* thread, address branch_bcp))
if (HAS_PENDING_EXCEPTION) {
return NULL;
}
// use UnlockFlagSaver to clear and restore the _do_not_unlock_if_synchronized
// flag, in case this method triggers classloading which will call into Java.
UnlockFlagSaver fs(thread);
@ -1041,7 +1029,6 @@ JRT_ENTRY(nmethod*,
const int branch_bci = branch_bcp != NULL ? method->bci_from(branch_bcp) : InvocationEntryBci;
const int bci = branch_bcp != NULL ? method->bci_from(last_frame.bcp()) : InvocationEntryBci;
assert(!HAS_PENDING_EXCEPTION, "Should not have any exceptions pending");
nmethod* osr_nm = CompilationPolicy::policy()->event(method, method, branch_bci, bci, CompLevel_none, NULL, thread);
assert(!HAS_PENDING_EXCEPTION, "Event handler should not throw any exceptions");
@ -1084,6 +1071,9 @@ JRT_LEAF(jint, InterpreterRuntime::bcp_to_di(Method* method, address cur_bcp))
JRT_END
JRT_ENTRY(void, InterpreterRuntime::profile_method(JavaThread* thread))
if (HAS_PENDING_EXCEPTION) {
return;
}
// use UnlockFlagSaver to clear and restore the _do_not_unlock_if_synchronized
// flag, in case this method triggers classloading which will call into Java.
UnlockFlagSaver fs(thread);

@ -2281,7 +2281,8 @@ void JavaThread::remove_monitor_chunk(MonitorChunk* chunk) {
// _thread_in_native_trans state (such as from
// check_special_condition_for_native_trans()).
void JavaThread::check_and_handle_async_exceptions(bool check_unsafe_error) {
// May be we are at method entry and requires to save do not unlock flag.
UnlockFlagSaver fs(this);
if (has_last_Java_frame() && has_async_condition()) {
// If we are at a polling page safepoint (not a poll return)
// then we must defer async exception because live registers

@ -2339,5 +2339,19 @@ class SignalHandlerMark: public StackObj {
}
};
class UnlockFlagSaver {
private:
JavaThread* _thread;
bool _do_not_unlock;
public:
UnlockFlagSaver(JavaThread* t) {
_thread = t;
_do_not_unlock = t->do_not_unlock_if_synchronized();
t->set_do_not_unlock_if_synchronized(false);
}
~UnlockFlagSaver() {
_thread->set_do_not_unlock_if_synchronized(_do_not_unlock);
}
};
#endif // SHARE_RUNTIME_THREAD_HPP

@ -28,6 +28,7 @@ package jdk.internal.jshell.tool;
import java.io.IOException;
import java.io.InputStream;
import java.util.function.Consumer;
import jdk.internal.org.jline.utils.NonBlockingInputStream;
public final class StopDetectingInputStream extends InputStream {
public static final int INITIAL_SIZE = 128;
@ -63,7 +64,19 @@ public final class StopDetectingInputStream extends InputStream {
if (currentState == State.CLOSED) {
break;
}
if ((read = input.read()) == (-1)) {
if (input instanceof NonBlockingInputStream) {
//workaround: NonBlockingPumpReader.read(), which should
//block until input is available, returns immediatelly,
//which causes busy-waiting for input, consuming
//unnecessary CPU resources. Using a timeout to avoid
//blocking read:
do {
read = ((NonBlockingInputStream) input).read(1000L);
} while (read == NonBlockingInputStream.READ_EXPIRED);
} else {
read = input.read();
}
if (read == (-1)) {
break;
}
if (read == 3 && getState() == State.BUFFER) {

@ -41,8 +41,8 @@ compiler/compilercontrol/mixed/RandomCommandsTest.java 8181753 generi
compiler/graalunit/JttThreadsTest.java 8207757 generic-all
compiler/unsafe/UnsafeGetConstantField.java 8181833 generic-all
compiler/unsafe/UnsafeGetStableArrayElement.java 8181833 generic-all
compiler/unsafe/UnsafeGetConstantField.java 8207267 generic-all
compiler/unsafe/UnsafeGetStableArrayElement.java 8207267 generic-all
compiler/whitebox/ClearMethodStateTest.java 8181831 generic-all
compiler/whitebox/EnqueueMethodForCompilationTest.java 8181831 generic-all
@ -86,8 +86,8 @@ serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorMultiArrayTest.java 819661
serviceability/tmtools/jstat/GcTest02.java 8196611 generic-all
serviceability/tmtools/jstat/GcCapacityTest.java 8196611 generic-all
serviceability/sa/ClhsdbInspect.java 8230419 generic-all
serviceability/sa/ClhsdbJstackXcompStress.java 8244656 generic-all
serviceability/sa/ClhsdbInspect.java 8207267 generic-all
serviceability/sa/ClhsdbJstackXcompStress.java 8207267 generic-all
gc/g1/ihop/TestIHOPErgo.java 8191048 generic-all
gc/g1/plab/TestPLABEvacuationFailure.java 8191048 generic-all
@ -203,18 +203,18 @@ vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_none2indy_b/TestDescription.java
vmTestbase/vm/mlvm/indy/func/jvmti/redefineClassInTarget/TestDescription.java 8195635 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/stepBreakPopReturn/INDIFY_Test.java 8195635 generic-all
compiler/stable/TestStableBoolean.java 8204347 generic-all
compiler/stable/TestStableByte.java 8204347 generic-all
compiler/stable/TestStableChar.java 8204347 generic-all
compiler/stable/TestStableDouble.java 8204347 generic-all
compiler/stable/TestStableFloat.java 8204347 generic-all
compiler/stable/TestStableInt.java 8204347 generic-all
compiler/stable/TestStableLong.java 8204347 generic-all
compiler/stable/TestStableMismatched.java 8204347 generic-all
compiler/stable/TestStableObject.java 8204347 generic-all
compiler/stable/TestStableShort.java 8204347 generic-all
compiler/stable/TestStableUByte.java 8204347 generic-all
compiler/stable/TestStableUShort.java 8204347 generic-all
compiler/stable/TestStableBoolean.java 8207267 generic-all
compiler/stable/TestStableByte.java 8207267 generic-all
compiler/stable/TestStableChar.java 8207267 generic-all
compiler/stable/TestStableDouble.java 8207267 generic-all
compiler/stable/TestStableFloat.java 8207267 generic-all
compiler/stable/TestStableInt.java 8207267 generic-all
compiler/stable/TestStableLong.java 8207267 generic-all
compiler/stable/TestStableMismatched.java 8207267 generic-all
compiler/stable/TestStableObject.java 8207267 generic-all
compiler/stable/TestStableShort.java 8207267 generic-all
compiler/stable/TestStableUByte.java 8207267 generic-all
compiler/stable/TestStableUShort.java 8207267 generic-all
vmTestbase/nsk/jdb/unmonitor/unmonitor001/unmonitor001.java 8218701 generic-all

@ -43,15 +43,10 @@
compiler/ciReplay/TestSAServer.java 8029528 generic-all
compiler/codecache/jmx/PoolsIndependenceTest.java 8167015 generic-all
compiler/codecache/stress/OverloadCompileQueueTest.java 8166554 generic-all
compiler/codegen/Test6896617.java 8193479 generic-all
compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8225370 generic-all
compiler/jvmci/compilerToVM/GetFlagValueTest.java 8204459 generic-all
compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 8158860 generic-all
compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java 8163894 generic-all
compiler/tiered/LevelTransitionTest.java 8067651 generic-all
compiler/c2/Test6852078.java 8194310 generic-all
compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all
compiler/runtime/Test8168712.java 8211769,8211771 generic-ppc64,generic-ppc64le,linux-s390x

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 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,6 +28,7 @@
* @modules java.corba/com.sun.corba.se.impl.encoding
* java.corba/com.sun.jndi.toolkit.corba
*
* @ignore 8194310
* @run main compiler.c2.Test6852078
*/

@ -31,6 +31,7 @@
* java.base/sun.nio.cs
* java.management
*
* @ignore 8193479
* @run main/othervm/timeout=1200 -Xbatch -Xmx256m compiler.codegen.Test6896617
*/

@ -27,7 +27,7 @@
* @requires vm.jvmci
* @library /test/lib /
* @library ../common/patches
* @ignore Not supported JVMCI API
* @ignore 8249621
* @modules java.base/jdk.internal.misc
* @modules java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.org.objectweb.asm.tree

@ -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
@ -27,7 +27,7 @@
* @requires vm.jvmci
* @library /test/lib /
* @library ../common/patches
* @ignore Not supported JVMCI API
* @ignore 8249621
* @modules java.base/jdk.internal.misc
* @modules java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.org.objectweb.asm.tree

@ -27,7 +27,7 @@
* @requires vm.jvmci
* @library / /test/lib
* @library ../common/patches
* @ignore Not supported JVMCI API
* @ignore 8249621
* @modules java.base/jdk.internal.misc:+open
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:+open
*

@ -27,7 +27,8 @@
* @requires vm.jvmci
* @library / /test/lib
* @library ../common/patches
* @ignore Not supported JVMCI API
* @ignore 8249621
* @ignore 8158860
* @modules java.base/jdk.internal.misc
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
* jdk.internal.vm.ci/jdk.vm.ci.meta

@ -27,7 +27,8 @@
* @requires vm.jvmci
* @library /test/lib /
* @library ../common/patches
* @ignore Not supported JVMCI API
* @ignore 8249621
* @ignore 8163894
* @modules java.base/jdk.internal.misc
* @modules java.base/jdk.internal.org.objectweb.asm
* java.base/jdk.internal.org.objectweb.asm.tree

@ -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
@ -26,7 +26,7 @@
* @bug 8136421
* @requires vm.jvmci
* @library /test/lib /
* @ignore Not supported JVMCI API
* @ignore 8249621
* @modules java.base/jdk.internal.misc:open
* @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:open
* jdk.internal.vm.ci/jdk.vm.ci.runtime

@ -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
@ -25,7 +25,7 @@
* @test
* @requires vm.jvmci
* @library ../../../../../
* @ignore Not supported JVMCI API
* @ignore 8249621
* @modules jdk.internal.vm.ci/jdk.vm.ci.meta
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* java.base/jdk.internal.misc

@ -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
@ -25,7 +25,7 @@
* @test
* @requires vm.jvmci
* @library ../../../../../
* @ignore Not supported JVMCI API
* @ignore 8249621
* @modules jdk.internal.vm.ci/jdk.vm.ci.meta
* jdk.internal.vm.ci/jdk.vm.ci.runtime
* java.base/jdk.internal.misc

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, SAP SE and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -25,7 +25,7 @@
#include "jni.h"
JNIEXPORT jint JNICALL
Java_TestJNIBlockFullGC_TestCriticalArray0(JNIEnv *env, jclass jCls, jintArray jIn) {
Java_gc_stress_TestJNIBlockFullGC_TestJNIBlockFullGC_TestCriticalArray0(JNIEnv *env, jclass jCls, jintArray jIn) {
jint *bufIn = NULL;
jint jInLen = (*env)->GetArrayLength(env, jIn);
jint result = 0;

@ -48,11 +48,6 @@ com/sun/jdi/RedefineCrossStart.java 8195635
com/sun/jdi/RedefineG.java 8195635 generic-all
com/sun/jdi/RedefineTTYLineNumber.java 8195635 generic-all
# Next JFR tests fail with Graal. Assuming 8193210.
jdk/jfr/event/compiler/TestCodeSweeper.java 8193210 generic-all
jdk/jfr/event/compiler/TestCompilerInlining.java 8193210 generic-all
jdk/jfr/event/compiler/TestCompilerPhase.java 8193210 generic-all
# Next tests should be re-enabled once libgraal is introduced
java/lang/ref/ReachabilityFenceTest.java 8207267 generic-all

@ -879,8 +879,6 @@ com/sun/jdi/InvokeHangTest.java 8218463 linux-al
# jdk_util
java/util/ServiceLoader/ReloadTest.java 8242935 generic-all
############################################################################
# jdk_instrument

@ -26,7 +26,7 @@
* @bug 6857566
* @summary DirectByteBuffer garbage creation can outpace reclamation
*
* @run main/othervm -XX:MaxDirectMemorySize=128m DirectBufferAllocTest
* @run main/othervm -XX:MaxDirectMemorySize=128m -XX:-ExplicitGCInvokesConcurrent DirectBufferAllocTest
*/
import java.nio.ByteBuffer;

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 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
@ -21,10 +21,11 @@
* questions.
*/
/**
/*
* @test
* @library modules
* @modules jdk.scripting.nashorn
* @modules java.scripting
* @library modules classpath/pearscript
* @build ReloadTest org.pear.PearScript org.pear.PearScriptEngineFactory bananascript/*
* @run testng/othervm ReloadTest
* @summary Basic test of ServiceLoader.reload
*/
@ -39,7 +40,6 @@ import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.util.ServiceLoader.*;
import javax.script.ScriptEngineFactory;
import org.testng.annotations.Test;
import static org.testng.Assert.*;