Merge
This commit is contained in:
commit
fd21613d59
2
.hgtags
2
.hgtags
@ -536,5 +536,5 @@ de9fd809bb475401aad188eab2264226788aad81 jdk-12+26
|
||||
f15d443f97318e9b40e6f451e327ff69ed4ec361 jdk-12+27
|
||||
a47b8125b7cc9ef59619745c163975fe935b57ed jdk-13+4
|
||||
659b004b6a1bd8c31e766cbdf328d8f8473fd4d7 jdk-12+28
|
||||
|
||||
e3ed960609927b5fdfd0a797159835cd83a81a31 jdk-13+5
|
||||
44f41693631f9b5ac78ff4d2bfabd6734fe46df2 jdk-12+29
|
||||
|
@ -1100,7 +1100,11 @@ void nmethod::make_unloaded() {
|
||||
"must be at safepoint");
|
||||
|
||||
// Unregister must be done before the state change
|
||||
Universe::heap()->unregister_nmethod(this);
|
||||
{
|
||||
MutexLockerEx ml(SafepointSynchronize::is_at_safepoint() ? NULL : CodeCache_lock,
|
||||
Mutex::_no_safepoint_check_flag);
|
||||
Universe::heap()->unregister_nmethod(this);
|
||||
}
|
||||
|
||||
// Log the unloading.
|
||||
log_state_change();
|
||||
|
@ -264,21 +264,17 @@ bool ZNMethodTable::register_entry(ZNMethodTableEntry* table, size_t size, ZNMet
|
||||
}
|
||||
}
|
||||
|
||||
bool ZNMethodTable::unregister_entry(ZNMethodTableEntry* table, size_t size, nmethod* nm) {
|
||||
void ZNMethodTable::unregister_entry(ZNMethodTableEntry* table, size_t size, nmethod* nm) {
|
||||
if (size == 0) {
|
||||
// Table is empty
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
size_t index = first_index(nm, size);
|
||||
|
||||
for (;;) {
|
||||
const ZNMethodTableEntry table_entry = table[index];
|
||||
|
||||
if (!table_entry.registered() && !table_entry.unregistered()) {
|
||||
// Entry not found
|
||||
return false;
|
||||
}
|
||||
assert(table_entry.registered() || table_entry.unregistered(), "Entry not found");
|
||||
|
||||
if (table_entry.registered() && table_entry.method() == nm) {
|
||||
// Remove entry
|
||||
@ -287,7 +283,7 @@ bool ZNMethodTable::unregister_entry(ZNMethodTableEntry* table, size_t size, nme
|
||||
// Destroy GC data
|
||||
ZNMethodData::destroy(gc_data(nm));
|
||||
set_gc_data(nm, NULL);
|
||||
return true;
|
||||
return;
|
||||
}
|
||||
|
||||
index = next_index(index, size);
|
||||
@ -451,8 +447,6 @@ void ZNMethodTable::sweeper_wait_for_iteration() {
|
||||
return;
|
||||
}
|
||||
|
||||
assert(CodeCache_lock->owned_by_self(), "Lock must be held");
|
||||
|
||||
while (_iter_table != NULL) {
|
||||
MutexUnlockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
os::naked_short_sleep(1);
|
||||
@ -460,6 +454,7 @@ void ZNMethodTable::sweeper_wait_for_iteration() {
|
||||
}
|
||||
|
||||
void ZNMethodTable::unregister_nmethod(nmethod* nm) {
|
||||
assert(CodeCache_lock->owned_by_self(), "Lock must be held");
|
||||
ResourceMark rm;
|
||||
|
||||
sweeper_wait_for_iteration();
|
||||
@ -467,14 +462,9 @@ void ZNMethodTable::unregister_nmethod(nmethod* nm) {
|
||||
log_unregister(nm);
|
||||
|
||||
// Remove entry
|
||||
if (unregister_entry(_table, _size, nm)) {
|
||||
// Entry was unregistered. When unregister_entry() instead returns
|
||||
// false the nmethod was not in the table (because it didn't have
|
||||
// any oops) so we do not want to decrease the number of registered
|
||||
// entries in that case.
|
||||
_nregistered--;
|
||||
_nunregistered++;
|
||||
}
|
||||
unregister_entry(_table, _size, nm);
|
||||
_nunregistered++;
|
||||
_nregistered--;
|
||||
}
|
||||
|
||||
void ZNMethodTable::disarm_nmethod(nmethod* nm) {
|
||||
|
@ -57,7 +57,7 @@ private:
|
||||
static void sweeper_wait_for_iteration();
|
||||
|
||||
static bool register_entry(ZNMethodTableEntry* table, size_t size, ZNMethodTableEntry entry);
|
||||
static bool unregister_entry(ZNMethodTableEntry* table, size_t size, nmethod* nm);
|
||||
static void unregister_entry(ZNMethodTableEntry* table, size_t size, nmethod* nm);
|
||||
|
||||
static void rebuild(size_t new_size);
|
||||
static void rebuild_if_needed();
|
||||
|
@ -1532,10 +1532,14 @@ Node *LoadNode::Ideal(PhaseGVN *phase, bool can_reshape) {
|
||||
Node* address = in(MemNode::Address);
|
||||
bool progress = false;
|
||||
|
||||
bool addr_mark = ((phase->type(address)->isa_oopptr() || phase->type(address)->isa_narrowoop()) &&
|
||||
phase->type(address)->is_ptr()->offset() == oopDesc::mark_offset_in_bytes());
|
||||
|
||||
// Skip up past a SafePoint control. Cannot do this for Stores because
|
||||
// pointer stores & cardmarks must stay on the same side of a SafePoint.
|
||||
if( ctrl != NULL && ctrl->Opcode() == Op_SafePoint &&
|
||||
phase->C->get_alias_index(phase->type(address)->is_ptr()) != Compile::AliasIdxRaw ) {
|
||||
phase->C->get_alias_index(phase->type(address)->is_ptr()) != Compile::AliasIdxRaw &&
|
||||
!addr_mark ) {
|
||||
ctrl = ctrl->in(0);
|
||||
set_req(MemNode::Control,ctrl);
|
||||
progress = true;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2019, 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
|
||||
@ -93,6 +93,9 @@
|
||||
#include "services/memTracker.hpp"
|
||||
#include "utilities/nativeCallStack.hpp"
|
||||
#endif // INCLUDE_NMT
|
||||
#if INCLUDE_AOT
|
||||
#include "aot/aotLoader.hpp"
|
||||
#endif // INCLUDE_AOT
|
||||
|
||||
#ifdef LINUX
|
||||
#include "osContainer_linux.hpp"
|
||||
@ -2118,6 +2121,14 @@ WB_ENTRY(jint, WB_ProtectionDomainRemovedCount(JNIEnv* env, jobject o))
|
||||
return (jint) SystemDictionary::pd_cache_table()->removed_entries_count();
|
||||
WB_END
|
||||
|
||||
WB_ENTRY(jint, WB_AotLibrariesCount(JNIEnv* env, jobject o))
|
||||
jint result = 0;
|
||||
#if INCLUDE_AOT
|
||||
result = (jint) AOTLoader::heaps_count();
|
||||
#endif
|
||||
return result;
|
||||
WB_END
|
||||
|
||||
#define CC (char*)
|
||||
|
||||
static JNINativeMethod methods[] = {
|
||||
@ -2350,6 +2361,7 @@ static JNINativeMethod methods[] = {
|
||||
{CC"disableElfSectionCache", CC"()V", (void*)&WB_DisableElfSectionCache },
|
||||
{CC"resolvedMethodRemovedCount", CC"()I", (void*)&WB_ResolvedMethodRemovedCount },
|
||||
{CC"protectionDomainRemovedCount", CC"()I", (void*)&WB_ProtectionDomainRemovedCount },
|
||||
{CC"aotLibrariesCount", CC"()I", (void*)&WB_AotLibrariesCount },
|
||||
};
|
||||
|
||||
|
||||
|
@ -98,6 +98,10 @@ public class IntegerExactExceptionTest extends GraalCompilerTest {
|
||||
}
|
||||
}
|
||||
|
||||
public void testIntegerExactOverflowWithoutUse3() {
|
||||
Math.addExact(Integer.MAX_VALUE, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIntegerExactWithoutUse1() throws InvalidInstalledCodeException {
|
||||
ResolvedJavaMethod method = getResolvedJavaMethod("testIntegerExactOverflowWithoutUse1");
|
||||
@ -126,6 +130,20 @@ public class IntegerExactExceptionTest extends GraalCompilerTest {
|
||||
assertTrue(gotException);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIntegerExactWithoutUse3() throws InvalidInstalledCodeException {
|
||||
ResolvedJavaMethod method = getResolvedJavaMethod("testIntegerExactOverflowWithoutUse3");
|
||||
InstalledCode code = getCode(method);
|
||||
|
||||
boolean gotException = false;
|
||||
try {
|
||||
code.executeVarargs(this);
|
||||
} catch (ArithmeticException e) {
|
||||
gotException = true;
|
||||
}
|
||||
assertTrue(gotException);
|
||||
}
|
||||
|
||||
static long longCounter = 10;
|
||||
|
||||
public void testLongExactOverflowSnippet(long input) {
|
||||
|
@ -560,19 +560,14 @@ public class StandardGraphBuilderPlugins {
|
||||
}
|
||||
|
||||
private static boolean createIntegerExactOperation(GraphBuilderContext b, JavaKind kind, ValueNode x, ValueNode y, IntegerExactOp op) {
|
||||
if (x.isConstant() && y.isConstant()) {
|
||||
b.addPush(kind, createIntegerExactArithmeticNode(x, y, null, op));
|
||||
BytecodeExceptionKind exceptionKind = kind == JavaKind.Int ? BytecodeExceptionKind.INTEGER_EXACT_OVERFLOW : BytecodeExceptionKind.LONG_EXACT_OVERFLOW;
|
||||
AbstractBeginNode exceptionEdge = b.genExplicitExceptionEdge(exceptionKind);
|
||||
if (exceptionEdge != null) {
|
||||
IntegerExactArithmeticSplitNode split = b.addPush(kind, createIntegerExactSplit(x, y, exceptionEdge, op));
|
||||
split.setNext(b.add(new BeginNode()));
|
||||
return true;
|
||||
} else {
|
||||
BytecodeExceptionKind exceptionKind = kind == JavaKind.Int ? BytecodeExceptionKind.INTEGER_EXACT_OVERFLOW : BytecodeExceptionKind.LONG_EXACT_OVERFLOW;
|
||||
AbstractBeginNode exceptionEdge = b.genExplicitExceptionEdge(exceptionKind);
|
||||
if (exceptionEdge != null) {
|
||||
IntegerExactArithmeticSplitNode split = b.addPush(kind, createIntegerExactSplit(x, y, exceptionEdge, op));
|
||||
split.setNext(b.add(new BeginNode()));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void registerMathPlugins(InvocationPlugins plugins, boolean allowDeoptimization) {
|
||||
|
@ -147,6 +147,7 @@ org.graalvm.compiler.core.test.CheckGraalInvariants
|
||||
org.graalvm.compiler.core.test.OptionsVerifierTest 8205081
|
||||
org.graalvm.compiler.hotspot.test.CompilationWrapperTest 8205081
|
||||
org.graalvm.compiler.replacements.test.classfile.ClassfileBytecodeProviderTest 8205081
|
||||
org.graalvm.compiler.debug.test.DebugContextTest 8205081
|
||||
|
||||
org.graalvm.compiler.core.test.deopt.CompiledMethodTest 8202955
|
||||
|
||||
|
@ -186,7 +186,6 @@ vmTestbase/vm/mlvm/meth/stress/gc/callSequencesDuringGC/Test.java 8208255 generi
|
||||
vmTestbase/vm/mlvm/meth/stress/java/sequences/Test.java 8208255 generic-all
|
||||
vmTestbase/vm/mlvm/meth/stress/jdi/breakpointInCompiledCode/Test.java 8208255 generic-all
|
||||
vmTestbase/vm/mlvm/mixed/stress/java/findDeadlock/TestDescription.java 8208278 generic-all
|
||||
vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java 8067250 generic-all
|
||||
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2none_a/TestDescription.java 8013267 generic-all
|
||||
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manyDiff_b/TestDescription.java 8013267 generic-all
|
||||
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manySame_b/TestDescription.java 8013267 generic-all
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2005, 2019, 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
|
||||
@ -59,6 +59,7 @@ requires.properties= \
|
||||
vm.rtm.cpu \
|
||||
vm.rtm.compiler \
|
||||
vm.aot \
|
||||
vm.aot.enabled \
|
||||
vm.cds \
|
||||
vm.cds.custom.loaders \
|
||||
vm.cds.archived.java.heap \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2019, 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
|
||||
@ -71,6 +71,11 @@ public abstract class CiReplayBase {
|
||||
"-XX:+ReplayCompiles", REPLAY_FILE_OPTION};
|
||||
protected final Optional<Boolean> runServer;
|
||||
|
||||
public static class EmptyMain {
|
||||
public static void main(String[] args) {
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
try {
|
||||
CLIENT_VM_AVAILABLE = ProcessTools.executeTestJvm(CLIENT_VM_OPTION, VERSION_OPTION)
|
||||
@ -135,7 +140,7 @@ public abstract class CiReplayBase {
|
||||
options.addAll(Arrays.asList(REPLAY_GENERATION_OPTIONS));
|
||||
options.addAll(Arrays.asList(vmopts));
|
||||
options.add(needCoreDump ? ENABLE_COREDUMP_ON_CRASH : DISABLE_COREDUMP_ON_CRASH);
|
||||
options.add(VERSION_OPTION);
|
||||
options.add(EmptyMain.class.getName());
|
||||
if (needCoreDump) {
|
||||
crashOut = ProcessTools.executeProcess(getTestJavaCommandlineWithPrefix(
|
||||
RUN_SHELL_NO_LIMIT, options.toArray(new String[0])));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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,6 +25,8 @@
|
||||
* @test
|
||||
* @bug 8081778
|
||||
* @summary Add C2 x86 intrinsic for BigInteger::mulAdd() method
|
||||
* @comment the test disables intrinsics, so it can't be run w/ AOT'ed java.base
|
||||
* @requires !vm.aot.enabled
|
||||
*
|
||||
* @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch
|
||||
* -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-UseSquareToLenIntrinsic -XX:-UseMultiplyToLenIntrinsic
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, 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
|
||||
@ -24,9 +24,13 @@
|
||||
/*
|
||||
* @test
|
||||
* @bug 8136421
|
||||
*
|
||||
* @requires vm.jvmci
|
||||
* & (vm.compMode != "Xcomp" | vm.opt.TieredCompilation == null | vm.opt.TieredCompilation == true)
|
||||
* @summary no "-Xcomp -XX:-TieredCompilation" combination allowed until JDK-8140018 is resolved
|
||||
* @requires vm.opt.final.EliminateAllocations == true
|
||||
*
|
||||
* @comment no "-Xcomp -XX:-TieredCompilation" combination allowed until JDK-8140018 is resolved
|
||||
* @requires vm.compMode != "Xcomp" | vm.opt.TieredCompilation == null | vm.opt.TieredCompilation == true
|
||||
*
|
||||
* @library / /test/lib
|
||||
* @library ../common/patches
|
||||
* @modules java.base/jdk.internal.misc
|
||||
|
@ -83,9 +83,9 @@ TESTLIBRARY_SRC_FILES = $(TESTLIBRARY_SRC_DIR)/Asserts.java \
|
||||
|
||||
.PHONY: cleantmp
|
||||
|
||||
all: JAR
|
||||
all: $(DIST_JAR)
|
||||
|
||||
JAR: INIT COMPILE manifest
|
||||
$(DIST_JAR): INIT COMPILE manifest
|
||||
$(JAR) cfm $(DIST_JAR) $(MANIFEST) -C $(CLASSES_DIR) .
|
||||
|
||||
manifest:
|
||||
@ -107,7 +107,7 @@ filelist: $(SRC_FILES)
|
||||
INIT: $(DIST_DIR)
|
||||
$(shell if [ ! -d $(CLASSES_DIR) ]; then mkdir -p $(CLASSES_DIR); fi)
|
||||
|
||||
install: clean_testbase testgroup testroot copytestlibrary copyaot JAR cleantmp
|
||||
install: clean_testbase testgroup testroot copytestlibrary copyaot $(DIST_JAR) cleantmp
|
||||
$(JAVA) --add-exports=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -ea -jar $(DIST_JAR) $(APPLICATION_ARGS)
|
||||
|
||||
clean_testbase:
|
||||
|
@ -1,6 +1,6 @@
|
||||
seed=SEED2
|
||||
number-of-tests=1000
|
||||
testbase-dir=ws/hotspot/test
|
||||
testbase-dir=testbase
|
||||
fp-precision=7
|
||||
min-cfg-depth=5
|
||||
max-cfg-depth=5
|
||||
|
@ -32,7 +32,7 @@ public class AotTestGeneratorsFactory implements Function<String[], List<TestsGe
|
||||
private static final String AOT_COMPILER_BUILD_ACTION
|
||||
= "@build compiler.aot.AotCompiler";
|
||||
private static final String AOT_COMPILER_RUN_ACTION_PREFIX
|
||||
= "@run driver compiler.aot.AotCompiler -libname aottest.so -class ";
|
||||
= "@run driver compiler.aot.AotCompiler -extraopt -Xmixed -libname aottest.so -class ";
|
||||
|
||||
@Override
|
||||
public List<TestsGenerator> apply(String[] input) {
|
||||
|
@ -110,6 +110,7 @@ public class Automatic {
|
||||
public static void main(String[] args) {
|
||||
initializeTestGenerator(args);
|
||||
int counter = 0;
|
||||
System.out.printf("Generating %d tests...%n", ProductionParams.numberOfTests.value());
|
||||
System.out.printf(" %13s | %8s | %8s | %8s |%n", "start time", "count", "generat",
|
||||
"running");
|
||||
System.out.printf(" %13s | %8s | %8s | %8s |%n", "---", "---", "---", "---");
|
||||
|
@ -39,7 +39,7 @@ class ByteCodeGenerator extends TestsGenerator {
|
||||
private static final String DEFAULT_SUFFIX = "bytecode_tests";
|
||||
|
||||
ByteCodeGenerator() {
|
||||
super(DEFAULT_SUFFIX);
|
||||
super(DEFAULT_SUFFIX, s -> new String[0], "-Xcomp");
|
||||
}
|
||||
|
||||
ByteCodeGenerator(String suffix, Function<String, String[]> preRunActions, String jtDriverOptions) {
|
||||
|
@ -34,7 +34,7 @@ public class JavaCodeGenerator extends TestsGenerator {
|
||||
private static final String DEFAULT_SUFFIX = "java_tests";
|
||||
|
||||
JavaCodeGenerator() {
|
||||
this(DEFAULT_SUFFIX, JavaCodeGenerator::generatePrerunAction, "");
|
||||
this(DEFAULT_SUFFIX, JavaCodeGenerator::generatePrerunAction, "-Xcomp");
|
||||
}
|
||||
|
||||
JavaCodeGenerator(String prefix, Function<String, String[]> preRunActions, String jtDriverOptions) {
|
||||
@ -64,13 +64,16 @@ public class JavaCodeGenerator extends TestsGenerator {
|
||||
}
|
||||
|
||||
private void compileJavaFile(String mainClassName) {
|
||||
String classPath = getRoot().resolve(generatorDir)
|
||||
.toAbsolutePath()
|
||||
.toString();
|
||||
ProcessBuilder pb = new ProcessBuilder(JAVAC, "-cp", classPath,
|
||||
String classPath = tmpDir.toString();
|
||||
ProcessBuilder pb = new ProcessBuilder(JAVAC,
|
||||
"-d", classPath,
|
||||
"-cp", classPath,
|
||||
generatorDir.resolve(mainClassName + ".java").toString());
|
||||
try {
|
||||
runProcess(pb, generatorDir.resolve(mainClassName).toString());
|
||||
int r = runProcess(pb, tmpDir.resolve(mainClassName + ".javac").toString());
|
||||
if (r != 0) {
|
||||
throw new Error("Can't compile sources, exit code = " + r);
|
||||
}
|
||||
} catch (IOException | InterruptedException e) {
|
||||
throw new Error("Can't compile sources ", e);
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ public abstract class TestsGenerator implements BiConsumer<IRNode, IRNode> {
|
||||
protected static final String JAVAC = Paths.get(JAVA_BIN, "javac").toString();
|
||||
protected static final String JAVA = Paths.get(JAVA_BIN, "java").toString();
|
||||
protected final Path generatorDir;
|
||||
protected final Path tmpDir;
|
||||
protected final Function<String, String[]> preRunActions;
|
||||
protected final String jtDriverOptions;
|
||||
private static final String DISABLE_WARNINGS = "-XX:-PrintWarnings";
|
||||
@ -52,15 +53,19 @@ public abstract class TestsGenerator implements BiConsumer<IRNode, IRNode> {
|
||||
|
||||
protected TestsGenerator(String suffix, Function<String, String[]> preRunActions,
|
||||
String jtDriverOptions) {
|
||||
generatorDir = getRoot().resolve(suffix);
|
||||
generatorDir = getRoot().resolve(suffix).toAbsolutePath();
|
||||
try {
|
||||
tmpDir = Files.createTempDirectory(suffix).toAbsolutePath();
|
||||
} catch (IOException e) {
|
||||
throw new Error("Can't get a tmp dir for " + suffix, e);
|
||||
}
|
||||
this.preRunActions = preRunActions;
|
||||
this.jtDriverOptions = jtDriverOptions;
|
||||
}
|
||||
|
||||
protected void generateGoldenOut(String mainClassName) {
|
||||
String classPath = getRoot().resolve(generatorDir)
|
||||
.toAbsolutePath()
|
||||
.toString();
|
||||
String classPath = tmpDir.toString() + File.pathSeparator
|
||||
+ generatorDir.toString();
|
||||
ProcessBuilder pb = new ProcessBuilder(JAVA, "-Xint", DISABLE_WARNINGS, "-Xverify",
|
||||
"-cp", classPath, mainClassName);
|
||||
String goldFile = mainClassName + ".gold";
|
||||
@ -89,9 +94,10 @@ public abstract class TestsGenerator implements BiConsumer<IRNode, IRNode> {
|
||||
return -1;
|
||||
}
|
||||
|
||||
protected static void compilePrinter() {
|
||||
protected void compilePrinter() {
|
||||
Path root = getRoot();
|
||||
ProcessBuilder pbPrinter = new ProcessBuilder(JAVAC,
|
||||
"-d", tmpDir.toString(),
|
||||
root.resolve("jdk")
|
||||
.resolve("test")
|
||||
.resolve("lib")
|
||||
|
@ -23,11 +23,6 @@
|
||||
|
||||
package jdk.test.lib.jittester;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import jdk.test.lib.jittester.types.TypeBoolean;
|
||||
import jdk.test.lib.jittester.types.TypeByte;
|
||||
import jdk.test.lib.jittester.types.TypeChar;
|
||||
@ -39,6 +34,11 @@ import jdk.test.lib.jittester.types.TypeLong;
|
||||
import jdk.test.lib.jittester.types.TypeShort;
|
||||
import jdk.test.lib.jittester.types.TypeVoid;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public class TypeList {
|
||||
public static final TypeVoid VOID = new TypeVoid();
|
||||
public static final TypeBoolean BOOLEAN = new TypeBoolean();
|
||||
@ -56,7 +56,7 @@ public class TypeList {
|
||||
private static final List<Type> BUILTIN_TYPES = new ArrayList<>();
|
||||
private static final List<Type> BUILTIN_INT_TYPES = new ArrayList<>();
|
||||
private static final List<Type> BUILTIN_FP_TYPES = new ArrayList<>();
|
||||
private static final List<Type> REFERENCE_TYPES = new ArrayList<>();
|
||||
private static final List<TypeKlass> REFERENCE_TYPES = new ArrayList<>();
|
||||
|
||||
static {
|
||||
BUILTIN_INT_TYPES.add(BOOLEAN);
|
||||
@ -99,7 +99,7 @@ public class TypeList {
|
||||
return BUILTIN_FP_TYPES;
|
||||
}
|
||||
|
||||
protected static Collection<Type> getReferenceTypes() {
|
||||
protected static Collection<TypeKlass> getReferenceTypes() {
|
||||
return REFERENCE_TYPES;
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ public class TypeList {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void add(Type t) {
|
||||
public static void add(TypeKlass t) {
|
||||
REFERENCE_TYPES.add(t);
|
||||
TYPES.add(t);
|
||||
}
|
||||
@ -159,8 +159,12 @@ public class TypeList {
|
||||
}
|
||||
|
||||
public static void removeAll() {
|
||||
Predicate<? super Type> isNotBasic = t -> t.getName().startsWith("Test_");
|
||||
TYPES.removeIf(isNotBasic);
|
||||
REFERENCE_TYPES.removeIf(isNotBasic);
|
||||
Predicate<? super String> isNotBasic = s -> s.startsWith("Test_");
|
||||
Predicate<? super Type> isNotBasicType = t -> isNotBasic.test(t.getName());
|
||||
REFERENCE_TYPES.stream()
|
||||
.map(TypeKlass::getChildrenNames)
|
||||
.forEach(l -> l.removeIf(isNotBasic));
|
||||
TYPES.removeIf(isNotBasicType);
|
||||
REFERENCE_TYPES.removeIf(isNotBasicType);
|
||||
}
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ class CastOperatorFactory extends OperatorFactory<CastOperator> {
|
||||
SymbolTable.merge();
|
||||
return castOperator;
|
||||
}
|
||||
throw new ProductionFailedException();
|
||||
SymbolTable.pop();
|
||||
} catch (ProductionFailedException e) {
|
||||
SymbolTable.pop();
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ package jdk.test.lib.jittester.types;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.TreeSet;
|
||||
import jdk.test.lib.jittester.ProductionParams;
|
||||
import jdk.test.lib.jittester.Symbol;
|
||||
@ -124,26 +125,28 @@ public class TypeKlass extends Type {
|
||||
TreeSet<TypeKlass> result = new TreeSet<>();
|
||||
parentsList.stream()
|
||||
.map(TypeList::find)
|
||||
.filter(parentKlass -> parentKlass != null)
|
||||
.map(parentKlass -> (TypeKlass) parentKlass)
|
||||
.forEach(parentKlass -> {
|
||||
result.add(parentKlass);
|
||||
result.addAll(parentKlass.getAllParents());
|
||||
.filter(Objects::nonNull)
|
||||
.map(k -> (TypeKlass) k)
|
||||
.forEach(k -> {
|
||||
if (result.add(k)) {
|
||||
result.addAll(k.getAllParents());
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
public TreeSet<TypeKlass> getAllChildren() {
|
||||
TreeSet<TypeKlass> r = new TreeSet<>();
|
||||
TreeSet<TypeKlass> result = new TreeSet<>();
|
||||
childrenList.stream()
|
||||
.map(TypeList::find)
|
||||
.filter(childKlass -> childKlass != null)
|
||||
.map(childKlass -> (TypeKlass) childKlass)
|
||||
.forEach(childKlass -> {
|
||||
r.add(childKlass);
|
||||
r.addAll(childKlass.getAllChildren());
|
||||
.filter(Objects::nonNull)
|
||||
.map(k -> (TypeKlass) k)
|
||||
.forEach(k -> {
|
||||
if (result.add(k)) {
|
||||
result.addAll(k.getAllChildren());
|
||||
}
|
||||
});
|
||||
return r;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2019, 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,8 +27,7 @@
|
||||
* @bug 6969574
|
||||
*
|
||||
* @summary converted from VM Testbase vm/mlvm/mixed/stress/regression/b6969574.
|
||||
* VM Testbase keywords: [feature_mlvm, nonconcurrent, quarantine]
|
||||
* VM Testbase comments: 8079650
|
||||
* VM Testbase keywords: [feature_mlvm, nonconcurrent]
|
||||
*
|
||||
* @library /vmTestbase
|
||||
* /test/lib
|
||||
@ -313,10 +312,8 @@ public class INDIFY_Test extends MlvmTest {
|
||||
private final static int REFLECTION_CALL = 1;
|
||||
private final static int INVOKE_EXACT = 2;
|
||||
private final static int INVOKE = 3;
|
||||
private final static int INVOKE_WITHARG = 4;
|
||||
private final static int INVOKE_WITHARG_TYPECONV = 5;
|
||||
private final static int INDY = 6;
|
||||
private final static int BENCHMARK_COUNT = 7;
|
||||
private final static int INDY = 4;
|
||||
private final static int BENCHMARK_COUNT = 5;
|
||||
|
||||
//
|
||||
// Test body
|
||||
@ -356,18 +353,6 @@ public class INDIFY_Test extends MlvmTest {
|
||||
}
|
||||
});
|
||||
|
||||
benchmarks[INVOKE_WITHARG] = new Benchmark("MH.invokeWithArguments(), exact types", new T() {
|
||||
public void run() throws Throwable {
|
||||
mhTestee.invokeWithArguments(testData, TESTEE_ARG2, TESTEE_ARG3);
|
||||
}
|
||||
});
|
||||
|
||||
benchmarks[INVOKE_WITHARG_TYPECONV] = new Benchmark("MH.invokeWithArguments() + type conv.", new T() {
|
||||
public void run() throws Throwable {
|
||||
mhTestee.invokeWithArguments((Object) testData, null, (Short) Short.MAX_VALUE);
|
||||
}
|
||||
});
|
||||
|
||||
benchmarks[INDY] = new Benchmark("invokedynamic instruction", new T() {
|
||||
public void run() throws Throwable {
|
||||
indyWrapper(testData);
|
||||
@ -415,8 +400,6 @@ public class INDIFY_Test extends MlvmTest {
|
||||
verifyTimeOrder(results[REFLECTION_CALL], results[INVOKE_EXACT]);
|
||||
verifyTimeOrder(results[INVOKE_EXACT], results[DIRECT_CALL]);
|
||||
verifyTimeOrder(results[INVOKE], results[DIRECT_CALL]);
|
||||
verifyTimeOrder(results[INVOKE_WITHARG], results[INVOKE_EXACT]);
|
||||
verifyTimeOrder(results[INVOKE_WITHARG_TYPECONV], results[INVOKE_EXACT]);
|
||||
verifyTimeOrder(results[INVOKE_EXACT], results[INDY]);
|
||||
|
||||
return true;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, 2019, 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,3 +28,4 @@
|
||||
#############################################################################
|
||||
|
||||
java/lang/invoke/MethodHandles/CatchExceptionTest.java 8146623 generic-all
|
||||
java/util/concurrent/CountDownLatch/Basic.java 8195057 generic-all
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2019, 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,12 +25,10 @@
|
||||
* @test
|
||||
* @library /test/lib
|
||||
* @build jdk.test.lib.Utils
|
||||
* @bug 8204233 8207846 8208691
|
||||
* @bug 8204233
|
||||
* @summary Add configurable option for enhanced socket IOException messages
|
||||
* @run main/othervm
|
||||
* ExceptionText
|
||||
* @run main/othervm
|
||||
* ExceptionText
|
||||
* WITHOUT_Enhanced_Text
|
||||
* @run main/othervm
|
||||
* -Djdk.includeInExceptions=
|
||||
@ -64,7 +62,6 @@ import java.net.Socket;
|
||||
import java.nio.channels.AsynchronousSocketChannel;
|
||||
import java.nio.channels.ClosedChannelException;
|
||||
import java.nio.channels.SocketChannel;
|
||||
import java.security.Security;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import jdk.test.lib.Utils;
|
||||
|
||||
@ -73,33 +70,20 @@ public class ExceptionText {
|
||||
enum TestTarget {SOCKET, CHANNEL, ASYNC_CHANNEL};
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
if (args.length == 0) {
|
||||
testSecProp();
|
||||
String passOrFail = args[0];
|
||||
boolean expectEnhancedText;
|
||||
if (passOrFail.equals("expectEnhancedText")) {
|
||||
expectEnhancedText = true;
|
||||
} else {
|
||||
String passOrFail = args[0];
|
||||
boolean expectEnhancedText;
|
||||
if (passOrFail.equals("expectEnhancedText")) {
|
||||
expectEnhancedText = true;
|
||||
} else {
|
||||
expectEnhancedText = false;
|
||||
}
|
||||
test(expectEnhancedText);
|
||||
expectEnhancedText = false;
|
||||
}
|
||||
test(expectEnhancedText);
|
||||
}
|
||||
|
||||
static final InetSocketAddress dest = Utils.refusingEndpoint();
|
||||
static final String PORT = ":" + Integer.toString(dest.getPort());
|
||||
static final String HOST = dest.getHostString();
|
||||
|
||||
static void testSecProp() {
|
||||
String incInExc = Security.getProperty("jdk.includeInExceptions");
|
||||
if (incInExc != null) {
|
||||
throw new RuntimeException("Test failed: default value of " +
|
||||
"jdk.includeInExceptions security property is not null: " +
|
||||
incInExc);
|
||||
}
|
||||
}
|
||||
|
||||
static void test(boolean withProperty) {
|
||||
// Socket
|
||||
IOException e = getException(TestTarget.SOCKET);
|
||||
@ -132,10 +116,11 @@ public class ExceptionText {
|
||||
static IOException getException(TestTarget target) {
|
||||
try {
|
||||
if (target == TestTarget.SOCKET) {
|
||||
Socket s = new Socket();
|
||||
s.connect(dest);
|
||||
try (Socket s = new Socket()) {
|
||||
s.connect(dest);
|
||||
}
|
||||
} else if (target == TestTarget.CHANNEL) {
|
||||
SocketChannel c = SocketChannel.open(dest);
|
||||
SocketChannel.open(dest);
|
||||
} else if (target == TestTarget.ASYNC_CHANNEL) {
|
||||
AsynchronousSocketChannel c = AsynchronousSocketChannel.open();
|
||||
try {
|
||||
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2019, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
import java.security.Security;
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 8207846 8208691
|
||||
* @summary Test the default setting of the jdk.net.includeInExceptions
|
||||
* security property
|
||||
* @comment In OpenJDK, this property is empty by default and on purpose.
|
||||
* This test assures the default is not changed.
|
||||
* @run main TestJDKIncludeInExceptions
|
||||
*/
|
||||
public class TestJDKIncludeInExceptions {
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
String incInExc = Security.getProperty("jdk.includeInExceptions");
|
||||
if (incInExc != null) {
|
||||
throw new RuntimeException("Test failed: default value of " +
|
||||
"jdk.includeInExceptions security property is not null: " +
|
||||
incInExc);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2019, 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
|
||||
@ -86,6 +86,7 @@ public class VMProps implements Callable<Map<String, String>> {
|
||||
map.put("vm.rtm.cpu", vmRTMCPU());
|
||||
map.put("vm.rtm.compiler", vmRTMCompiler());
|
||||
map.put("vm.aot", vmAOT());
|
||||
map.put("vm.aot.enabled", vmAotEnabled());
|
||||
// vm.cds is true if the VM is compiled with cds support.
|
||||
map.put("vm.cds", vmCDS());
|
||||
map.put("vm.cds.custom.loaders", vmCDSForCustomLoaders());
|
||||
@ -266,6 +267,7 @@ public class VMProps implements Callable<Map<String, String>> {
|
||||
vmOptFinalFlag(map, "ClassUnloading");
|
||||
vmOptFinalFlag(map, "UseCompressedOops");
|
||||
vmOptFinalFlag(map, "EnableJVMCI");
|
||||
vmOptFinalFlag(map, "EliminateAllocations");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -334,6 +336,13 @@ public class VMProps implements Callable<Map<String, String>> {
|
||||
return "" + Files.exists(jaotc);
|
||||
}
|
||||
|
||||
/*
|
||||
* @return true if there is at least one loaded AOT'ed library.
|
||||
*/
|
||||
protected String vmAotEnabled() {
|
||||
return "" + (WB.aotLibrariesCount() > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for CDS support.
|
||||
*
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2019, 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
|
||||
@ -549,4 +549,7 @@ public class WhiteBox {
|
||||
|
||||
// Protection Domain Table
|
||||
public native int protectionDomainRemovedCount();
|
||||
|
||||
// Number of loaded AOT libraries
|
||||
public native int aotLibrariesCount();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user