This commit is contained in:
Jesper Wilhelmsson 2017-03-16 16:40:40 -07:00
commit 3615172074
9 changed files with 35 additions and 27 deletions
jdk
make/test
src
java.base
macosx/native/libjli
unix
windows/classes
jdk.jdwp.agent/share/native/libjdwp
test
sun/tools/jcmd
tools/launcher

@ -1,5 +1,5 @@
# #
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -35,12 +35,14 @@ include $(SPEC)
include MakeBase.gmk include MakeBase.gmk
include TestFilesCompilation.gmk include TestFilesCompilation.gmk
$(eval $(call IncludeCustomExtension, jdk, test/JtregNative.gmk))
################################################################################ ################################################################################
# Targets for building the native tests themselves. # Targets for building the native tests themselves.
################################################################################ ################################################################################
# Add more directories here when needed. # Add more directories here when needed.
BUILD_JDK_JTREG_NATIVE_SRC := \ BUILD_JDK_JTREG_NATIVE_SRC += \
$(JDK_TOPDIR)/test/native_sanity \ $(JDK_TOPDIR)/test/native_sanity \
# #

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -886,6 +886,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void
if (stack_size > 0) { if (stack_size > 0) {
pthread_attr_setstacksize(&attr, stack_size); pthread_attr_setstacksize(&attr, stack_size);
} }
pthread_attr_setguardsize(&attr, 0); // no pthread guard page on java threads
if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
void * tmp; void * tmp;

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,5 +32,3 @@ opens com.sun.crypto.provider to jdk.internal.vm.compiler;
exports jdk.internal.module to jdk.internal.vm.compiler; exports jdk.internal.module to jdk.internal.vm.compiler;
// AOT uses jdk.internal.misc.Unsafe
exports jdk.internal.misc to jdk.aot;

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -899,6 +899,7 @@ ContinueInNewThread0(int (JNICALL *continuation)(void *), jlong stack_size, void
if (stack_size > 0) { if (stack_size > 0) {
pthread_attr_setstacksize(&attr, stack_size); pthread_attr_setstacksize(&attr, stack_size);
} }
pthread_attr_setguardsize(&attr, 0); // no pthread guard page on java threads
if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
void * tmp; void * tmp;

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,3 +26,13 @@
exports sun.security.rsa to jdk.crypto.mscapi; exports sun.security.rsa to jdk.crypto.mscapi;
exports sun.security.internal.spec to jdk.crypto.mscapi; exports sun.security.internal.spec to jdk.crypto.mscapi;
exports sun.security.util to jdk.crypto.mscapi; exports sun.security.util to jdk.crypto.mscapi;
// jdk.internal.vm.compiler uses Unsafe and VM classes from jdk.internal.misc
exports jdk.internal.misc to jdk.internal.vm.compiler;
opens jdk.internal.misc to jdk.internal.vm.compiler;
// jdk.internal.vm.compiler uses com.sun.crypto.provider to generate crypto intrinsics
opens com.sun.crypto.provider to jdk.internal.vm.compiler;
exports jdk.internal.module to jdk.internal.vm.compiler;

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -125,15 +125,13 @@ debugLoop_run(void)
jboolean replyToSender = JNI_TRUE; jboolean replyToSender = JNI_TRUE;
/* /*
* For VirtualMachine commands we hold the vmDeathLock * For all commands we hold the vmDeathLock
* while executing and replying to the command. This ensures * while executing and replying to the command. This ensures
* that a VM command after VM_DEATH will be allowed to complete * that a command after VM_DEATH will be allowed to complete
* before the thread posting the VM_DEATH continues VM * before the thread posting the VM_DEATH continues VM
* termination. * termination.
*/ */
if (cmd->cmdSet == JDWP_COMMAND_SET(VirtualMachine)){ debugMonitorEnter(vmDeathLock);
debugMonitorEnter(vmDeathLock);
}
/* Initialize the input and output streams */ /* Initialize the input and output streams */
inStream_init(&in, p); inStream_init(&in, p);
@ -172,9 +170,7 @@ debugLoop_run(void)
/* /*
* Release the vmDeathLock as the reply has been posted. * Release the vmDeathLock as the reply has been posted.
*/ */
if (cmd->cmdSet == JDWP_COMMAND_SET(VirtualMachine)){ debugMonitorExit(vmDeathLock);
debugMonitorExit(vmDeathLock);
}
inStream_destroy(&in); inStream_destroy(&in);
outStream_destroy(&out); outStream_destroy(&out);

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -240,10 +240,10 @@ dequeueCommand(void)
size = commandSize(command); size = commandSize(command);
/* /*
* Immediately close out any commands enqueued from a * Immediately close out any commands enqueued from
* previously attached debugger. * a dead VM or a previously attached debugger.
*/ */
if (command->sessionID != currentSessionID) { if (gdata->vmDead || command->sessionID != currentSessionID) {
log_debugee_location("dequeueCommand(): command session removal", NULL, NULL, 0); log_debugee_location("dequeueCommand(): command session removal", NULL, NULL, 0);
completeCommand(command); completeCommand(command);
command = NULL; command = NULL;

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -50,7 +50,7 @@ public class TestJcmdDefaults {
private static final String TEST_SRC = System.getProperty("test.src").trim(); private static final String TEST_SRC = System.getProperty("test.src").trim();
private static final String[] VM_ARGS = new String[] { "-XX:+UsePerfData" }; private static final String[] VM_ARGS = new String[] { "-XX:+UsePerfData" };
private static final String JCMD_LIST_REGEX = "^\\d+\\s*.*"; private static final String JCMD_LIST_REGEX = "(?s)^\\d+\\s*.*";
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
testJcmdUsage("-h"); testJcmdUsage("-h");

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -73,9 +73,9 @@ public class Settings extends TestHelper {
} }
static void runTestOptionDefault() throws IOException { static void runTestOptionDefault() throws IOException {
String stackSize = "256"; // in kb int stackSize = 256; // in kb
if (getArch().equals("ppc64") || getArch().equals("ppc64le")) { if (getArch().equals("ppc64") || getArch().equals("ppc64le")) {
stackSize = "800"; stackSize = 800;
} }
TestResult tr; TestResult tr;
tr = doExec(javaCmd, "-Xms64m", "-Xmx512m", tr = doExec(javaCmd, "-Xms64m", "-Xmx512m",
@ -86,7 +86,7 @@ public class Settings extends TestHelper {
throw new RuntimeException("test fails"); throw new RuntimeException("test fails");
} }
tr = doExec(javaCmd, "-Xms65536k", "-Xmx712m", tr = doExec(javaCmd, "-Xms65536k", "-Xmx712m",
"-Xss" + stackSize + "000", "-XshowSettings", "-jar", testJar.getAbsolutePath()); "-Xss" + (stackSize * 1024), "-XshowSettings", "-jar", testJar.getAbsolutePath());
containsAllOptions(tr); containsAllOptions(tr);
if (!tr.isOK()) { if (!tr.isOK()) {
System.out.println(tr); System.out.println(tr);