From 501573119878c4909acaacd162b7d1e363770d51 Mon Sep 17 00:00:00 2001
From: goetz
Date: Wed, 27 Dec 2017 11:31:09 +0100
Subject: [PATCH 01/29] 8194232: Container memory not properly recognized.
Reviewed-by: bobv, mdoerr, acorn
---
src/hotspot/os/linux/osContainer_linux.cpp | 33 ++++++++++------------
1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/src/hotspot/os/linux/osContainer_linux.cpp b/src/hotspot/os/linux/osContainer_linux.cpp
index dacd53b27dc..f32b5417af2 100644
--- a/src/hotspot/os/linux/osContainer_linux.cpp
+++ b/src/hotspot/os/linux/osContainer_linux.cpp
@@ -31,16 +31,11 @@
#include "logging/log.hpp"
#include "osContainer_linux.hpp"
-/*
- * Warning: Some linux distros use 0x7FFFFFFFFFFFF000
- * and others use 0x7FFFFFFFFFFFFFFF for unlimited.
- */
-#define UNLIMITED_MEM CONST64(0x7FFFFFFFFFFFF000)
-
#define PER_CPU_SHARES 1024
bool OSContainer::_is_initialized = false;
bool OSContainer::_is_containerized = false;
+julong _unlimited_memory;
class CgroupSubsystem: CHeapObj {
friend class OSContainer;
@@ -217,6 +212,8 @@ void OSContainer::init() {
_is_initialized = true;
_is_containerized = false;
+ _unlimited_memory = (LONG_MAX / os::vm_page_size()) * os::vm_page_size();
+
log_trace(os, container)("OSContainer::init: Initializing Container Support");
if (!UseContainerSupport) {
log_trace(os, container)("Container Support not enabled");
@@ -419,37 +416,37 @@ char * OSContainer::container_type() {
* OSCONTAINER_ERROR for not supported
*/
jlong OSContainer::memory_limit_in_bytes() {
- GET_CONTAINER_INFO(jlong, memory, "/memory.limit_in_bytes",
- "Memory Limit is: " JLONG_FORMAT, JLONG_FORMAT, memlimit);
+ GET_CONTAINER_INFO(julong, memory, "/memory.limit_in_bytes",
+ "Memory Limit is: " JULONG_FORMAT, JULONG_FORMAT, memlimit);
- if (memlimit >= UNLIMITED_MEM) {
+ if (memlimit >= _unlimited_memory) {
log_trace(os, container)("Memory Limit is: Unlimited");
return (jlong)-1;
}
else {
- return memlimit;
+ return (jlong)memlimit;
}
}
jlong OSContainer::memory_and_swap_limit_in_bytes() {
- GET_CONTAINER_INFO(jlong, memory, "/memory.memsw.limit_in_bytes",
- "Memory and Swap Limit is: " JLONG_FORMAT, JLONG_FORMAT, memswlimit);
- if (memswlimit >= UNLIMITED_MEM) {
+ GET_CONTAINER_INFO(julong, memory, "/memory.memsw.limit_in_bytes",
+ "Memory and Swap Limit is: " JULONG_FORMAT, JULONG_FORMAT, memswlimit);
+ if (memswlimit >= _unlimited_memory) {
log_trace(os, container)("Memory and Swap Limit is: Unlimited");
return (jlong)-1;
} else {
- return memswlimit;
+ return (jlong)memswlimit;
}
}
jlong OSContainer::memory_soft_limit_in_bytes() {
- GET_CONTAINER_INFO(jlong, memory, "/memory.soft_limit_in_bytes",
- "Memory Soft Limit is: " JLONG_FORMAT, JLONG_FORMAT, memsoftlimit);
- if (memsoftlimit >= UNLIMITED_MEM) {
+ GET_CONTAINER_INFO(julong, memory, "/memory.soft_limit_in_bytes",
+ "Memory Soft Limit is: " JULONG_FORMAT, JULONG_FORMAT, memsoftlimit);
+ if (memsoftlimit >= _unlimited_memory) {
log_trace(os, container)("Memory Soft Limit is: Unlimited");
return (jlong)-1;
} else {
- return memsoftlimit;
+ return (jlong)memsoftlimit;
}
}
From c4a8c91467cb6ec27ef12213934e3e61aa136ff6 Mon Sep 17 00:00:00 2001
From: joehw
Date: Wed, 3 Jan 2018 18:21:10 -0800
Subject: [PATCH 02/29] 8189704: broken links in the javax/xml/namespace
package Reviewed-by: darcy
---
src/java.xml/share/classes/javax/xml/XMLConstants.java | 6 +-----
.../classes/javax/xml/namespace/NamespaceContext.java | 6 ++----
src/java.xml/share/classes/javax/xml/namespace/QName.java | 8 ++------
3 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/src/java.xml/share/classes/javax/xml/XMLConstants.java b/src/java.xml/share/classes/javax/xml/XMLConstants.java
index b8a22af61a6..7de589087e7 100644
--- a/src/java.xml/share/classes/javax/xml/XMLConstants.java
+++ b/src/java.xml/share/classes/javax/xml/XMLConstants.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -34,7 +34,6 @@
* @see XML 1.0 Second Edition Specification Errata
* @see Namespaces in XML 1.1
* @see Namespaces in XML
- * @see Namespaces in XML Errata
* @see XML Schema Part 1: Structures
* @since 1.5
**/
@@ -103,9 +102,6 @@ private XMLConstants() {
* @see
* Namespaces in XML, 3. Qualified Names
- * @see
- * Namespaces in XML Errata
*/
public static final String XMLNS_ATTRIBUTE_NS_URI =
"http://www.w3.org/2000/xmlns/";
diff --git a/src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java b/src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java
index 596775392fb..b978973541e 100644
--- a/src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java
+++ b/src/java.xml/share/classes/javax/xml/namespace/NamespaceContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -72,10 +72,8 @@
* javax.xml.XMLConstants for declarations of common XML values
* @see
* XML Schema Part2: Datatypes
- * @see
+ * @see
* Namespaces in XML
- * @see
- * Namespaces in XML Errata
* @since 1.5
*/
diff --git a/src/java.xml/share/classes/javax/xml/namespace/QName.java b/src/java.xml/share/classes/javax/xml/namespace/QName.java
index 88cfe3328c6..94121d0d334 100644
--- a/src/java.xml/share/classes/javax/xml/namespace/QName.java
+++ b/src/java.xml/share/classes/javax/xml/namespace/QName.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -35,9 +35,7 @@
* href="http://www.w3.org/TR/xmlschema-2/#QName">XML Schema Part2:
* Datatypes specification, Namespaces
- * in XML , Namespaces
- * in XML Errata .
+ * in XML.
*
* The value of a QName
contains a Namespace
* URI , local part and
@@ -64,8 +62,6 @@
* XML Schema Part2: Datatypes specification
* @see
* Namespaces in XML
- * @see
- * Namespaces in XML Errata
* @since 1.5
*/
From 4b3eac93be1658ccd767f45eba3657e8c7cbc2f5 Mon Sep 17 00:00:00 2001
From: bpatel
Date: Thu, 4 Jan 2018 09:22:17 -0800
Subject: [PATCH 03/29] 8192007: javadoc @uses and @provides tags in the
modules documentation appears before the first-sentence summary of the
service type. Reviewed-by: jjg, ksrini
---
.../formats/html/ModuleWriterImpl.java | 18 +--
.../testModules/TestModuleServices.java | 112 +++++++++++++++++-
.../doclet/testModules/TestModules.java | 8 +-
3 files changed, 124 insertions(+), 14 deletions(-)
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
index a8579ec8ccd..f5283fb4062 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
@@ -820,11 +820,14 @@ public void addUsesList(Table table) {
Content summary = new ContentBuilder();
if (display(usesTrees)) {
description = usesTrees.get(t);
- if (description != null) {
- summary.addContent(description);
+ if (description != null && !description.isEmpty()) {
+ summary.addContent(HtmlTree.DIV(HtmlStyle.block, description));
+ } else {
+ addSummaryComment(t, summary);
}
+ } else {
+ summary.addContent(Contents.SPACE);
}
- addSummaryComment(t, summary);
table.addRow(typeLinkContent, summary);
}
}
@@ -847,11 +850,12 @@ public void addProvidesList(Table table) {
Content desc = new ContentBuilder();
if (display(providesTrees)) {
description = providesTrees.get(srv);
- if (description != null) {
- desc.addContent(description);
+ desc.addContent((description != null && !description.isEmpty())
+ ? HtmlTree.DIV(HtmlStyle.block, description)
+ : Contents.SPACE);
+ } else {
+ desc.addContent(Contents.SPACE);
}
- }
- addSummaryComment(srv, desc);
// Only display the implementation details in the "all" mode.
if (moduleMode == ModuleMode.ALL && !implSet.isEmpty()) {
desc.addContent(new HtmlTree(HtmlTag.BR));
diff --git a/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java b/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java
index 2d31c056316..552f27edb43 100644
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModuleServices.java
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 8178067
+ * @bug 8178067 8192007
* @summary tests the module's services, such as provides and uses
* @modules jdk.javadoc/jdk.javadoc.internal.api
* jdk.javadoc/jdk.javadoc.internal.tool
@@ -34,6 +34,7 @@
* @run main TestModuleServices
*/
+import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -51,6 +52,106 @@ public TestModuleServices() {
tb = new ToolBox();
}
+ @Test
+ public void checkModuleServicesDescription(Path base) throws Exception {
+ Path src = Files.createDirectories(base.resolve("src"));
+ ModuleBuilder mb = new ModuleBuilder(tb, "moduleService")
+ .comment("This module exports a package containing the declaration of a service type.")
+ .exports("pkgService")
+ .classes("/**A Package that has a service.*/ package pkgService;")
+ .classes("package pkgService; /**A service Interface for service providers.*/ "
+ + "public interface Service {\n"
+ + " /**\n"
+ + " * A test method for the service.\n"
+ + " */\n"
+ + " void testMethod1();\n"
+ + " /**\n"
+ + " * Another test method for the service.\n"
+ + " */\n"
+ + " void testMethod2();\n"
+ + "}");
+ mb.write(src);
+ mb = new ModuleBuilder(tb, "moduleServiceProvider")
+ .comment("This module provides an implementation of a service.\n" +
+ "@provides pkgService.Service Provides a service whose name is ServiceProvider.")
+ .requires("moduleService")
+ .provides("pkgService.Service", "pkgServiceProvider.ServiceProvider")
+ .classes("/**A Package that has a service provider.*/ package pkgServiceProvider;")
+ .classes("package pkgServiceProvider;\n"
+ + "public class ServiceProvider implements pkgService.Service {\n"
+ + " /**\n"
+ + " * {@inheritDoc}\n"
+ + " */\n"
+ + " public void testMethod1() {}\n"
+ + " /**\n"
+ + " * This is an internal implementation so the documentation will not be seen.\n"
+ + " */\n"
+ + " public void testMethod2() {}\n"
+ + "}");
+ mb.write(src);
+ mb = new ModuleBuilder(tb, "moduleServiceUser")
+ .comment("This module uses a service defined in another module.\n"
+ + "@uses pkgService.Service If no other provider is found, a default internal implementation will be used.")
+ .requires("moduleService")
+ .uses("pkgService.Service")
+ .classes("/**A Package that has a service user.*/ package pkgServiceUser;")
+ .classes("package pkgServiceUser;\n"
+ + "/**\n"
+ + " * A service user class.\n"
+ + " */\n"
+ + "public class ServiceUser {\n"
+ + "}");
+ mb.write(src);
+ mb = new ModuleBuilder(tb, "moduleServiceUserNoDescription")
+ .comment("This is another module that uses a service defined in another module.\n"
+ + "@uses pkgService.Service")
+ .requires("moduleService")
+ .uses("pkgService.Service")
+ .classes("/**A Package that has a service user with no description.*/ package pkgServiceUserNoDescription;")
+ .classes("package pkgServiceUserNoDescription;\n"
+ + "/**\n"
+ + " * A service user class.\n"
+ + " */\n"
+ + "public class ServiceUserNoDescription {\n"
+ + "}");
+ mb.write(src);
+
+ javadoc("-d", base.resolve("out").toString(),
+ "-quiet", "-noindex",
+ "--module-source-path", src.toString(),
+ "--module", "moduleService,moduleServiceProvider,moduleServiceUser,moduleServiceUserNoDescription",
+ "pkgService", "moduleServiceProvider/pkgServiceProvider", "moduleServiceUser/pkgServiceUser",
+ "moduleServiceUserNoDescription/pkgServiceUserNoDescription");
+ checkExit(Exit.OK);
+
+ checkOutput("moduleServiceProvider-summary.html", true,
+ "\n"
+ + "Service \n"
+ + "\n"
+ + "Provides a service whose name is ServiceProvider.
\n"
+ + " \n"
+ + " ");
+ checkOutput("moduleServiceUser-summary.html", true,
+ "\n"
+ + "Service \n"
+ + "\n"
+ + "If no other provider is found, a default internal implementation will be used.
\n"
+ + " \n"
+ + " ");
+ checkOutput("moduleServiceUserNoDescription-summary.html", true,
+ "\n"
+ + "Service \n"
+ + "\n"
+ + "A service Interface for service providers.
\n"
+ + " \n"
+ + " ");
+ checkOutput("moduleServiceProvider-summary.html", false,
+ "A service Interface for service providers.");
+ checkOutput("moduleServiceUser-summary.html", false,
+ "A service Interface for service providers.");
+ }
+
@Test
public void checkUsesNoApiTagModuleModeDefault(Path base) throws Exception {
ModuleBuilder mb = new ModuleBuilder(tb, "m")
@@ -251,7 +352,8 @@ public void checkProvidesWithApiTagModuleModeDefault(Path base) throws Exception
"\n" +
"\n" +
"A \n" +
- "abc \n" +
+ "\n" +
+ "abc
\n \n" +
" \n" +
" \n" +
"\n");
@@ -292,7 +394,8 @@ public void checkUsesProvidesWithApiTagsModeDefault(Path base) throws Exception
"\n" +
"\n" +
"A \n" +
- "abc \n" +
+ "\n" +
+ "abc
\n \n" +
" \n" +
" \n" +
"",
@@ -305,7 +408,8 @@ public void checkUsesProvidesWithApiTagsModeDefault(Path base) throws Exception
"\n" +
"\n" +
"B \n" +
- "def \n" +
+ "\n" +
+ "def
\n \n" +
" \n" +
" \n" +
"\n");
diff --git a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
index f3d0c18cc94..f73fac14942 100644
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
@@ -26,7 +26,7 @@
* @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363
* 8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218
* 8175823 8166306 8178043 8181622 8183511 8169819 8074407 8183037 8191464
- 8164407
+ 8164407 8192007
* @summary Test modules support in javadoc.
* @author bpatel
* @library ../lib
@@ -764,7 +764,8 @@ void checkModuleSummary() {
+ "",
"\n"
+ "TestClassInModuleB \n"
- + "With a test description for uses. \n"
+ + "\n"
+ + "With a test description for uses.
\n \n"
+ " ",
"Opens \n"
+ "\n"
@@ -931,7 +932,8 @@ void checkModuleModeCommon() {
+ "testpkgmdlB \n");
checkOutput("moduleB-summary.html", true,
"TestClassInModuleB \n"
- + "With a test description for uses. ");
+ + "\n"
+ + "With a test description for uses.
\n \n");
checkOutput("moduletags-summary.html", true,
"Description | Modules"
+ " | Packages | Services ",
From d70bea896076d7f2353f09b441bc0c9991ceba0f Mon Sep 17 00:00:00 2001
From: rfield
Date: Thu, 4 Jan 2018 12:24:56 -0800
Subject: [PATCH 04/29] 8179858: jshell tool: sync nomenclature from reference
to online /help Reviewed-by: dlsmith, jjg
---
.../jdk/internal/jshell/tool/JShellTool.java | 5 +-
.../jshell/tool/resources/l10n.properties | 365 ++++++++++--------
.../jdk/jshell/CommandCompletionTest.java | 4 +-
test/langtools/jdk/jshell/EditorTestBase.java | 2 +-
test/langtools/jdk/jshell/ToolBasicTest.java | 10 +-
test/langtools/jdk/jshell/ToolSimpleTest.java | 2 +-
6 files changed, 214 insertions(+), 174 deletions(-)
diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
index 79a0a1f71f8..8fc94b1b47b 100644
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
@@ -1817,7 +1817,7 @@ Stream allTypeSnippets() {
// Documentation pseudo-commands
registerCommand(new Command("/",
- "help.id",
+ "help.slashID",
arg -> cmdHelp("rerun"),
EMPTY_COMPLETION_PROVIDER,
CommandKind.HELP_ONLY));
@@ -1829,6 +1829,9 @@ Stream allTypeSnippets() {
registerCommand(new Command("intro",
"help.intro",
CommandKind.HELP_SUBJECT));
+ registerCommand(new Command("id",
+ "help.id",
+ CommandKind.HELP_SUBJECT));
registerCommand(new Command("shortcuts",
"help.shortcuts",
CommandKind.HELP_SUBJECT));
diff --git a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties
index 0d7e517f185..5c405b6e821 100644
--- a/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties
+++ b/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/resources/l10n.properties
@@ -46,7 +46,7 @@ jshell.err.file.not.found = File ''{1}'' for ''{0}'' is not found.
jshell.err.file.exception = File ''{1}'' for ''{0}'' threw exception: {2}
jshell.err.file.filename = ''{0}'' requires a filename argument.
-jshell.err.startup.unexpected.exception = Unexpected exception reading start-up: {0}
+jshell.err.startup.unexpected.exception = Unexpected exception reading startup: {0}
jshell.err.unexpected.exception = Unexpected exception: {0}
jshell.err.invalid.command = Invalid command: {0}
@@ -104,9 +104,9 @@ For example ''/help /list'' or ''/help intro''.\n\
Subjects:\n\
\n
-jshell.err.no.snippet.with.id = No snippet with id: {0}
+jshell.err.no.snippet.with.id = No snippet with ID: {0}
jshell.err.end.snippet.range.less.than.start = End of snippet range less than start: {0} - {1}
-jshell.err.range.requires.id = Snippet ranges require snippet ids: {0}
+jshell.err.range.requires.id = Snippet ranges require snippet IDs: {0}
jshell.err.exit.not.expression = The argument to /exit must be a valid integer expression, it is not an expression: {0}
jshell.err.exit.bad.type = The argument to /exit must be a valid integer expression. The type is {1} : {0}
@@ -114,7 +114,7 @@ jshell.err.exit.bad.value = The argument to /exit has bad value is {1} : {0}
jshell.err.drop.arg =\
In the /drop argument, please specify an import, variable, method, or class to drop.\n\
-Specify by id or name. Use /list to see ids. Use /reset to reset all state.
+Specify by ID or name. Use /list to see IDs. Use /reset to reset all state.
jshell.err.failed = Failed.
jshell.msg.native.method = Native Method
jshell.msg.unknown.source = Unknown Source
@@ -193,15 +193,15 @@ For more information see:\n\
/help shortcuts
help.usage = \
-Usage: jshell ... ...\n\
+Usage: jshell ... ...\n\
where possible options include:\n\
\ --class-path Specify where to find user class files\n\
\ --module-path Specify where to find application modules\n\
\ --add-modules (,)*\n\
\ Specify modules to resolve, or all modules on the\n\
\ module path if is ALL-MODULE-PATHs\n\
-\ --startup One run replacement for the start-up definitions\n\
-\ --no-startup Do not run the start-up definitions\n\
+\ --startup One run replacement for the startup definitions\n\
+\ --no-startup Do not run the startup definitions\n\
\ --feedback Specify the initial feedback mode. The mode may be\n\
\ predefined (silent, concise, normal, or verbose) or\n\
\ previously user-defined\n\
@@ -218,12 +218,22 @@ where possible options include:\n\
\ --show-version Print version information and continue\n\
\ --help Print this synopsis of standard options and exit\n\
\ --help-extra, -X Print help on non-standard options and exit\n\
+\n\
A file argument may be a file name, or one of the predefined file names: DEFAULT,\n\
PRINTING, or JAVASE.\n\
-A load file may also be "-" to indicate standard input, without interactive I/O.\n
+A load-file may also be "-" to indicate standard input, without interactive I/O.\n\
+\n\
+For more information on the evaluation context options (--class-path,\n\
+--module-path, and --add-modules) see:\n\t\
+ /help context\n\
+\n\
+A path lists the directories and archives to search. For Windows, use a\n\
+semicolon (;) to separate items in the path. On other platforms, use a\n\
+colon (:) to separate items.\n\
help.usage.x = \
-\ --add-exports / Export specified module-private package to snippets\n\
+\ --add-exports / Specify a package to be considered as\n\
+\ exported from its defining module \n\
\ --execution Specify an alternate execution engine.\n\
\ Where is an ExecutionControl spec.\n\
\ See the documentation of the package\n\
@@ -234,47 +244,43 @@ help.usage.x = \
help.list.summary = list the source you have typed
help.list.args = [|-all|-start]
help.list =\
-Show the source of snippets, prefaced with the snippet id.\n\
+Show the snippets, prefaced with their snippet IDs.\n\
\n\
/list\n\t\
List the currently active snippets of code that you typed or read with /open\n\n\
/list -start\n\t\
- List the automatically evaluated start-up snippets\n\n\
+ List the evaluated startup snippets\n\n\
/list -all\n\t\
- List all snippets including failed, overwritten, dropped, and start-up\n\n\
+ List all snippets including failed, overwritten, dropped, and startup\n\n\
/list \n\t\
List snippets with the specified name (preference for active snippets)\n\n\
/list \n\t\
- List the snippet with the specified snippet id\n\n\
-/list ...\n\t\
- List the snippets with the specified snippet ids\n\n\
-/list -\n\t\
- List the snippets within the range of snippet ids
+ List the snippet with the specified snippet ID.\n\t\
+ One or more IDs or ID ranges may used, see '/help id'
-help.edit.summary = edit a source entry referenced by name or id
+help.edit.summary = edit a source entry
help.edit.args =
help.edit =\
Edit a snippet or snippets of source in an external editor.\n\
-The editor to use is set with /set editor.\n\
-If no editor has been set, a simple editor will be launched.\n\
+The editor to use is set with /set editor. If no editor is set, then the\n\
+following environment variables are checked in order: JSHELLEDITOR, VISUAL,\n\
+and EDITOR. If no editor has been set and none of the editor environment\n\
+variables is set, a simple editor will be launched.\n\
\n\
/edit \n\t\
Edit the snippet or snippets with the specified name (preference for active snippets)\n\n\
/edit \n\t\
- Edit the snippet with the specified snippet id\n\n\
-/edit ...\n\t\
- Edit the snippets with the specified snippet ids\n\n\
-/edit -\n\t\
- Edit the snippets within the range of snippet ids\n\n\
+ Edit the snippet with the specified snippet ID.\n\t\
+ One or more IDs or ID ranges may used, see '/help id'\n\n\
/edit -start\n\t\
- Edit the automatically evaluated start-up snippets. Any changes are in this\n\t\
- session, and do not affect the start-up setting\n\n\
+ Edit the startup snippets. Any changes are in this session, and do not\n\t\
+ affect the startup setting\n\n\
/edit -all\n\t\
- Edit all snippets including failed, overwritten, dropped, and start-up\n\n\
+ Edit all snippets including failed, overwritten, dropped, and startup\n\n\
/edit\n\t\
Edit the currently active snippets of code that you typed or read with /open
-help.drop.summary = delete a source entry referenced by name or id
+help.drop.summary = delete a source entry
help.drop.args =
help.drop =\
Drop a snippet -- making it inactive.\n\
@@ -282,13 +288,10 @@ Drop a snippet -- making it inactive.\n\
/drop \n\t\
Drop the snippet with the specified name\n\n\
/drop \n\t\
- Drop the snippet with the specified snippet id\n\n\
-/drop ...\n\t\
- Drop the snippets with the specified snippet ids\n\n\
-/drop -\n\t\
- Drop the snippets within the range of snippet ids
+ Drop the snippet with the specified snippet ID.\n\t\
+ One or more IDs or ID ranges may used, see '/help id'
-help.save.summary = Save snippet source to a file.
+help.save.summary = Save snippet source to a file
help.save.args = [-all|-history|-start]
help.save =\
Save the specified snippets and/or commands to the specified file.\n\
@@ -297,17 +300,15 @@ Save the specified snippets and/or commands to the specified file.\n\
Save the source of current active snippets to the file.\n\n\
/save -all \n\t\
Save the source of all snippets to the file.\n\t\
- Includes source including overwritten, failed, and start-up code.\n\n\
+ Includes source of overwritten, failed, and startup code\n\n\
/save -history \n\t\
- Save the sequential history of all commands and snippets entered since jshell was launched.\n\n\
+ Save the sequential history of all commands and snippets entered since the\n\t\
+ jshell tool was launched.\n\n\
/save -start \n\t\
- Save the current start-up definitions to the file.\n\n\
+ Save the current startup definitions to the file\n\n\
/save \n\t\
- Save the snippet with the specified snippet id\n\n\
-/save ... \n\t\
- Save the snippets with the specified snippet ids\n\n\
-/save - \n\t\
- Save the snippets within the range of snippet ids
+ Save the snippet with the specified snippet ID.\n\t\
+ One or more IDs or ID ranges may used, see '/help id'
help.open.summary = open a file as source input
help.open.args =
@@ -315,97 +316,94 @@ help.open =\
Open a file and read its contents as snippets and commands.\n\
\n\
/open \n\t\
- Read the specified file as jshell input.
+ Read the specified file as the jshell tool input.\n\
+\n\
+The may be an operating system file name, or one of the predefined\n\
+file names: DEFAULT, PRINTING, or JAVASE.\n\
+These are respectively: the default import snippets (as used by -default),\n\
+definitions of print(), println(), and printf() method snippets, or\n\
+imports of all Java SE packages.\n
help.vars.summary = list the declared variables and their values
help.vars.args = [|-all|-start]
help.vars =\
-List the type, name, and value of jshell variables.\n\
+List the type, name, and value of variables that were entered.\n\
\n\
/vars\n\t\
- List the type, name, and value of the current active jshell variables\n\n\
+ List the type, name, and value of the current active variables\n\n\
/vars \n\t\
- List jshell variables with the specified name (preference for active variables)\n\n\
+ List variables with the specified name (preference for active variables)\n\n\
/vars \n\t\
- List the jshell variable with the specified snippet id\n\n\
-/vars ... \n\t\
- List the jshell variables with the specified snippet ids\n\n\
-/vars - \n\t\
- List the jshell variables within the range of snippet ids\n\n\
+ List the variable with the specified snippet ID.\n\t\
+ One or more IDs or ID ranges may used, see '/help id'\n\n\
/vars -start\n\t\
- List the automatically added start-up jshell variables\n\n\
+ List the variables in the evaluated startup snippets\n\n\
/vars -all\n\t\
- List all jshell variables including failed, overwritten, dropped, and start-up
+ List all variables including failed, overwritten, dropped, and startup
help.methods.summary = list the declared methods and their signatures
help.methods.args = [|-all|-start]
help.methods =\
-List the name, parameter types, and return type of jshell methods.\n\
+List the name, parameter types, and return type of methods that were entered.\n\
\n\
/methods\n\t\
- List the name, parameter types, and return type of the current active jshell methods\n\n\
+ List the name, parameter types, and return type of the current active methods\n\n\
/methods \n\t\
- List jshell methods with the specified name (preference for active methods)\n\n\
+ List methods with the specified name (preference for active methods)\n\n\
/methods \n\t\
- List the jshell method with the specified snippet id\n\n\
-/methods ... \n\t\
- List jshell methods with the specified snippet ids\n\n\
-/methods - \n\t\
- List jshell methods within the range of snippet ids\n\n\
+ List the method with the specified snippet ID.\n\t\
+ One or more IDs or ID ranges may used, see '/help id'\n\n\
/methods -start\n\t\
- List the automatically added start-up jshell methods\n\n\
+ List the methods in the evaluated startup snippets\n\n\
/methods -all\n\t\
- List all snippets including failed, overwritten, dropped, and start-up
+ List all snippets including failed, overwritten, dropped, and startup
-help.types.summary = list the declared types
+help.types.summary = list the type declarations
help.types.args =[|-all|-start]
help.types =\
-List jshell classes, interfaces, and enums.\n\
+List classes and interfaces that were entered.\n\
\n\
/types\n\t\
- List the current active jshell classes, interfaces, and enums.\n\n\
+ List the current active type declarations\n\n\
/types \n\t\
- List jshell types with the specified name (preference for active types)\n\n\
+ List type declarations with the specified name (preference for active snippets)\n\n\
/types \n\t\
- List the jshell type with the specified snippet id\n\n\
-/types ... \n\t\
- List jshell types with the specified snippet ids\n\n\
-/types - \n\t\
- List jshell types within the range of snippet ids\n\n\
+ List the type declaration with the specified snippet ID.\n\t\
+ One or more IDs or ID ranges may used, see '/help id'\n\n\
/types -start\n\t\
- List the automatically added start-up jshell types\n\n\
+ List the type declarations in the evaluated startup snippets\n\n\
/types -all\n\t\
- List all jshell types including failed, overwritten, dropped, and start-up
+ List all type declarations including failed, overwritten, dropped, and startup
help.imports.summary = list the imported items
help.imports.args =
help.imports =\
-List the current active jshell imports.
+List the current active imports. This will include imports from\n\
+startup snippets.
-help.exit.summary = exit jshell
+help.exit.summary = exit the jshell tool
help.exit.args =[]
help.exit =\
Leave the jshell tool. No work is saved.\n\
Save any work before using this command\n\
\n\
/exit\n\t\
- Leave the jshell tool. The exit status is zero.\n\n\
+ Leave the jshell tool. The exit status is zero\n\n\
/exit \n\t\
Evaluate the snippet. If the snippet fails or is not an integer expression,\n\t\
display the error. Otherwise leave the jshell tool with the\n\t\
value of the expression as the exit status
-help.reset.summary = reset jshell
+help.reset.summary = reset the jshell tool
help.reset.args = \
[-class-path ] [-module-path ] [-add-modules ]...
help.reset =\
Reset the jshell tool code and execution state:\n\t\
- * All entered code is lost.\n\t\
- * Start-up code is re-executed.\n\t\
- * The execution state is restarted.\n\t\
-Tool settings are maintained, as set with: /set ...\n\
+ * All entered code is lost\n\t\
+ * The execution state is restarted\n\t\
+ * Startup code is re-executed\n\
Save any work before using this command.\n\
-The /reset command accepts context options, see:\n\n\t\
+The /reset command accepts evaluation context options, see:\n\n\t\
/help context\n\
@@ -417,18 +415,19 @@ Reset the jshell tool code and execution state then replay each valid snippet\n\
and any /drop commands in the order they were entered.\n\
\n\
/reload\n\t\
- Reset and replay the valid history since jshell was entered, or\n\t\
- a /reset, or /reload command was executed -- whichever is most\n\t\
- recent.\n\n\
+ Reset and replay the valid history since the jshell tool was entered, or\n\t\
+ a /reset or /reload command was executed -- whichever is most\n\t\
+ recent\n\n\
/reload -restore\n\t\
Reset and replay the valid history between the previous and most\n\t\
- recent time that jshell was entered, or a /reset, /reload, or /env\n\t\
+ recent time that the jshell tool was entered, or a /reset, /reload, or /env\n\t\
command was executed. This can thus be used to restore a previous\n\t\
- jshell tool session.\n\n\
+ jshell tool session\n\n\
/reload [-restore] -quiet\n\t\
- With the '-quiet' argument the replay is not shown. Errors will display.\n\
+ With the '-quiet' argument the replay is not shown, however any errors\n\t\
+ will be displayed\n\
\n\
-Each of the above accepts context options, see:\n\n\t\
+Each of the above accepts evaluation context options, see:\n\n\t\
/help context\n\
\n\
For example:\n\n\t\
@@ -439,28 +438,30 @@ help.env.args = \
[-class-path ] [-module-path ] [-add-modules ] ...
help.env =\
View or change the evaluation context. The evaluation context is the class path,\n\
-module path, etc.\n\
+module path, etc.\n\n\
/env\n\t\
- Show the evaluation context displayed as context options.\n\n\
+ Show the evaluation context displayed as context options\n\n\
/env [-class-path ] [-module-path ] [-add-modules ] ...\n\t\
With at least one option set, sets the evaluation context. If snippets\n\t\
have been defined, the execution state is reset with the new\n\t\
evaluation context and the snippets will be replayed -- the replay is not\n\t\
- shown, however, errors will display. This is equivalent to: /reload -quiet\n\t\
- For details of context options, see:\n\n\t\t\
- /help context\n\n\t\
- For example:\n\n\t\t\
- /env -add-modules com.greetings
+ shown, however any errors will be displayed. This is equivalent to:\n\n\t\t\
+ /reload -quiet ...\n\
+\n\
+For details of evaluation context options, see:\n\n\t\
+ /help context\n\n\
+For example:\n\n\t\
+ /env -add-modules com.greetings
help.history.summary = history of what you have typed
help.history.args =
help.history =\
-Display the history of snippet and command input since this jshell was launched.
+Display the history of snippet and command input since this jshell tool was launched.
-help.debug.summary = toggle debugging of the jshell
+help.debug.summary = toggle debugging of the jshell tool
help.debug.args = [0][r][g][f][c][d][e]
help.debug =\
-Display debugging information for the jshell implementation.\n\
+Display debugging information for the jshell tool implementation.\n\
0: Debugging off\n\
r: Tool level debugging on\n\
g: General debugging on\n\
@@ -469,12 +470,12 @@ c: Completion analysis debugging on\n\
d: Dependency debugging on\n\
e: Event debugging on
-help.help.summary = get information about jshell
+help.help.summary = get information about using the jshell tool
help.help.args = [|]
help.help =\
-Display information about jshell.\n\
+Display information about using the jshell tool.\n\
/help\n\t\
- List the jshell commands and help subjects.\n\n\
+ List the jshell tool commands and help subjects\n\n\
/help \n\t\
Display information about the specified command. The slash must be included.\n\t\
Only the first few letters of the command are needed -- if more than one\n\t\
@@ -482,40 +483,40 @@ Display information about jshell.\n\
/help \n\t\
Display information about the specified help subject. Example: /help intro
-help.set.summary = set jshell configuration information
+help.set.summary = set configuration information
help.set.args = editor|start|feedback|mode|prompt|truncation|format ...
help.set =\
-Set jshell configuration information, including:\n\
-the external editor to use, the start-up definitions to use, a new feedback mode,\n\
+Set the jshell tool configuration information, including:\n\
+the external editor to use, the startup definitions to use, a new feedback mode,\n\
the command prompt, the feedback mode to use, or the format of output.\n\
\n\
/set editor [-wait] ...\n\t\
Specify the command to launch for the /edit command.\n\t\
- The is an operating system dependent string.\n\n\
+ The is an operating system dependent string\n\n\
/set start \n\t\
- The contents of the specified become the default start-up snippets and commands.\n\n\
+ The contents of the specified become the default startup snippets and commands\n\n\
/set feedback \n\t\
- Set the feedback mode describing displayed feedback for entered snippets and commands.\n\n\
+ Set the feedback mode describing displayed feedback for entered snippets and commands\n\n\
/set mode [] -command|-quiet|-delete\n\t\
- Create or update a user-defined feedback mode, optionally copying from an existing mode.\n\n\
+ Create or update a user-defined feedback mode, optionally copying from an existing mode\n\n\
/set prompt "" ""\n\t\
- Set the displayed prompts for a given feedback mode.\n\n\
+ Set the displayed prompts for a given feedback mode\n\n\
/set truncation ...\n\t\
- Set the maximum length of a displayed value.\n\n\
+ Set the maximum length of a displayed value\n\n\
/set format "" ...\n\t\
- Configure a feedback mode by setting the format of a field when the selector matches.\n\n\
+ Configure a feedback mode by setting the format of a field when the selector matches\n\n\
/set\n\t\
Show editor, start, and feedback settings as /set commands.\n\t\
- To show the settings of any of the above, omit the set value.\n\n\
+ To show the settings of any of the above, omit the set value\n\n\
To get more information about one of these forms, use /help with the form specified.\n\
For example: /help /set format
-help.quest.summary = get information about jshell
+help.quest.summary = get information about using the jshell tool
help.quest.args = [|]
help.quest =\
-Display information about jshell (abbreviation for /help).\n\
+Display information about using the jshell tool (abbreviation for /help).\n\
/?\n\t\
- Display list of commands and help subjects.\n\
+ Display list of commands and help subjects\n\
/? \n\t\
Display information about the specified command. The slash must be included.\n\t\
Only the first few letters of the command are needed -- if more than one\n\t\
@@ -528,17 +529,18 @@ help.bang.args =
help.bang =\
Reevaluate the most recently entered snippet.
-help.id.summary = rerun snippets by id or id range -- see /help rerun
-help.id.args =
-help.id =\
+help.slashID.summary = rerun snippets by ID or ID range -- see /help rerun
+help.slashID.args =
+help.slashID =\
/ \n\
\n\
/-\n\
\n\
-Reevaluate the snippets specified by the id or id range.\n\
-An id range is represented as a two ids separated by a hyphen, e.g.: 3-17\n\
-Start-up and error snippets maybe used, e.g.: s3-s9 or e1-e4\n\
-Any number of ids or id ranges may be used, e.g.: /3-7 s4 14-16 e2
+Reevaluate the snippets specified by the ID or ID range.\n\
+An ID range is represented as a two IDs separated by a hyphen, e.g.: 3-17\n\
+Startup and error snippets maybe used, e.g.: s3-s9 or e1-e4\n\
+Any number of IDs or ID ranges may be used, e.g.: /3-7 s4 14-16 e2\n\
+See '/help id'.
help.previous.summary = rerun n-th previous snippet -- see /help rerun
help.previous.args =
@@ -553,7 +555,7 @@ or a Java expression, like: x + x\n\
or a Java statement or import.\n\
These little chunks of Java code are called 'snippets'.\n\
\n\
-There are also jshell commands that allow you to understand and\n\
+There are also the jshell tool commands that allow you to understand and\n\
control what you are doing, like: /list\n\
\n\
For a list of commands: /help
@@ -565,7 +567,7 @@ Supported shortcuts include:\n\
\n\
\n\t\t\
After entering the first few letters of a Java identifier,\n\t\t\
- a jshell command, or, in some cases, a jshell command argument,\n\t\t\
+ a jshell tool command, or, in some cases, a jshell tool command argument,\n\t\t\
press the key to complete the input.\n\t\t\
If there is more than one completion, then possible completions will be shown.\n\t\t\
Will show documentation if available and appropriate.\n\n\
@@ -580,26 +582,26 @@ Shift- m\n\t\t\
of the expression.\n\n\
Shift- i\n\t\t\
After an unresolvable identifier, hold down while pressing ,\n\t\t\
- then release and press "i", and jshell will propose possible imports\n\t\t\
+ then release and press "i", and the jshell tool will propose possible imports\n\t\t\
which will resolve the identifier based on the content of the specified classpath.
help.context.summary = a description of the evaluation context options for /env /reload and /reset
help.context =\
-These options configure the evaluation context, they can be specified when\n\
-jshell is started: on the command-line, or restarted with the commands /env,\n\
-/reload, or /reset.\n\
+These options configure the evaluation context. They can be specified on the\n\
+command-line when the jshell tool is started or as command options when the jshell tool is\n\
+restarted with the commands /env, /reload, or /reset.\n\
\n\
They are:\n\t\
- --class-path \n\t\t\
- A list of directories, JAR archives,\n\t\t\
+ --class-path \n\t\t\
+ The is a list of directories, JAR archives,\n\t\t\
and ZIP archives to search for class files.\n\t\t\
- The list is separated with the path separator\n\t\t\
- (a : on unix/linux/mac, and ; on windows).\n\t\
- --module-path ...\n\t\t\
- A list of directories, each directory\n\t\t\
- is a directory of modules.\n\t\t\
- The list is separated with the path separator\n\t\t\
- (a : on unix/linux/mac, and ; on windows).\n\t\
+ For Windows, use a semicolon (;) to separate items in the\n\t\t\
+ path. On other platforms, use a colon (:) to separate items.\n\t\
+ --module-path ...\n\t\t\
+ The is a list of directories, JAR archives,\n\t\t\
+ and ZIP archives to search for modules.\n\t\t\
+ For Windows, use a semicolon (;) to separate items in the\n\t\t\
+ path. On other platforms, use a colon (:) to separate items.\n\t\
--add-modules [,...]\n\t\t\
root modules to resolve in addition to the initial module.\n\t\t\
can also be ALL-DEFAULT, ALL-SYSTEM,\n\t\t\
@@ -611,8 +613,42 @@ They are:\n\t\
unnamed modules. In jshell, if the is not\n\t\t\
specified (no =) then ALL-UNNAMED is used.\n\
\n\
+Evaluation context options entered on the command line or provided with a\n\
+previous /reset, /env, or /reload command are maintained unless an option is\n\
+entered that overwrites the setting.\n\
+\n\
On the command-line these options must have two dashes, e.g.: --module-path\n\
-On jshell commands they can have one or two dashes, e.g.: -module-path\n\
+On the jshell tool commands they can have one or two dashes, e.g.: -module-path
+
+help.id.summary = a description of snippet IDs and how use them
+help.id =\
+Every snippet of code you enter has its own unique snippet ID. Even if you\n\
+enter the same snippet again, it will have a new ID. For normal snippets the ID\n\
+is an increasing number. Snippets which fail with an error have a snippet ID\n\
+which begins with 'e'. Snippets in the startup have an ID which begins with 's'.\n\
+\n\
+A snippet ID is one way to refer to a snippet in a command. For example, this\n\
+command drops the snippet with ID '14':\n\
+\n\t\
+ /drop 14\n\
+\n\
+To see the ID of a snippet or snippets use the '/list' command. To see the ID\n\
+of all snippets. including failed, startup, and overwritten snippets, use the\n\
+'/list -all' command.\n\
+\n\
+You can also refer to a range of IDs by separating the beginning ID and ending\n\
+ID with a hypen. For example, '1-4' is the same as '1 2 3 4'. All commands\n\
+which refer to snippets will take a list of IDs, ID ranges, and snippet names\n\
+as arguments. These commands are: /list, /edit, /drop, /save, /vars, /methods,\n\
+/types, and /. Some examples:\n\
+\n\t\
+ /edit 7-23\n\
+\n\t\
+ /save s1-s4 3-8 foo 12 myfile\n\
+\n\t\
+ /9-12 33\n\
+\n\
+See '/help /edit', '/help /save', and '/help rerun' respectively.
help.rerun.summary = a description of ways to re-evaluate previously entered snippets
help.rerun =\
@@ -639,10 +675,11 @@ For example:\n\
\t2 + 2\n\
\t$5 ==> 4\n\
\n\
-The snippets to re-evaluate may be specified by snippet id or id range.\n\
-An id range is represented as a two ids separated by a hyphen, e.g.: 3-17\n\
-Start-up and error snippets maybe used, e.g.: s3-s9 or e1-e4\n\
-Any number of ids or id ranges may be used, e.g.: /3-7 s4 14-16 e2\n\
+The snippets to re-evaluate may be specified by snippet ID or ID range.\n\
+An ID range is represented as a two IDs separated by a hyphen, e.g.: 3-17\n\
+Startup and error snippets maybe used, e.g.: s3-s9 or e1-e4\n\
+Any number of IDs or ID ranges may be used, e.g.: /3-7 s4 14-16 e2\n\
+See also '/help id'.\n\
\n\
Finally, you can search backwards through history by entering ctrl-R followed by the string to search for.
@@ -656,7 +693,7 @@ The -retain option can be used on the following forms of /set:\n\n\t\
See these commands for more detail -- for example /help /set editor
help.set.format.summary = \
-Set the format for reporting a snippet event.
+Set the format for reporting a snippet event
help.set.format = \
Set the format for reporting a snippet event:\n\
@@ -746,7 +783,7 @@ mode and field are shown. Example:\n\t\
shows the format settings for the mode mymode\n
help.set.truncation.summary = \
-Set the max length of a displayed value.
+Set the max length of a displayed value
help.set.truncation = \
Set the max length of a displayed value:\n\
@@ -789,7 +826,7 @@ Example:\n\t\
shows the truncation settings for the mode mymode\n
help.set.feedback.summary = \
-Set the feedback mode describing displayed feedback for entered snippets and commands.
+Set the feedback mode describing displayed feedback for entered snippets and commands
help.set.feedback = \
Set the feedback mode describing displayed feedback for entered snippets and commands:\n\
@@ -814,7 +851,7 @@ runs of the jshell tool.\n\
The form without or -retain displays the current feedback mode and available modes.\n
help.set.mode.summary = \
-Create a user-defined feedback mode, optionally copying from an existing mode.
+Create a user-defined feedback mode, optionally copying from an existing mode
help.set.mode = \
Create a user-defined feedback mode, optionally copying from an existing mode:\n\
@@ -869,7 +906,7 @@ Example:\n\t\
shows the mode, prompt, format, and truncation settings for the mode mymode
help.set.prompt.summary = \
-Set the prompts.
+Set the prompts
help.set.prompt = \
Set the prompts. Both the normal prompt and the continuation-prompt must be set:\n\
@@ -881,9 +918,9 @@ Show the normal prompt and the continuation-prompts:\n\
/set prompt []\n\
\n\
Where is the name of a previously defined feedback mode.\n\
-Where and are quoted strings printed as input prompts;\n\
-Both may optionally contain '%%s' which will be substituted with the next snippet id --\n\
-note that what is entered may not be assigned that id, for example it may be an error or command.\n\
+Where and are quoted strings to be printed as input prompts.\n\
+Both may optionally contain '%%s' which will be substituted with the next snippet ID --\n\
+note that what is entered may not be assigned that ID, for example it may be an error or command.\n\
The continuation-prompt is used on the second and subsequent lines of a multi-line snippet.\n\
\n\
The form without shows the currently set prompts.\n\
@@ -893,7 +930,7 @@ Example:\n\t\
shows the prompts set for the mode mymode\n
help.set.editor.summary =\
-Specify the command to launch for the /edit command.
+Specify the command to launch for the /edit command
help.set.editor =\
Specify the command to launch for the /edit command:\n\
@@ -937,10 +974,10 @@ runs of the jshell tool.\n\
The form without or options shows the editor setting.\n
help.set.start.summary =\
-Set the start-up configuration.
+Set the startup configuration
help.set.start =\
-Set the start-up configuration -- a sequence of snippets and commands read at start-up:\n\
+Set the startup configuration -- a sequence of snippets and commands read at startup:\n\
\n\t\
/set start [-retain] ...\n\
\n\t\
@@ -948,29 +985,29 @@ Set the start-up configuration -- a sequence of snippets and commands read at st
\n\t\
/set start [-retain] -none\n\
\n\
-Retain the start-up configuration for future sessions:\n\
+Retain the startup configuration for future sessions:\n\
\n\t\
/set start -retain\n\
\n\
-Show the start-up setting:\n\
+Show the startup setting:\n\
\n\t\
/set start\n\
\n\
-The contents of the specified become the start-up snippets and commands used\n\
+The contents of the specified become the startup snippets and commands used\n\
when the /reset, /reload, or /env commands are used in this session.\n\
-If instead the -default option is specified, the predefined start-up import\n\
+If instead the -default option is specified, the predefined startup import\n\
snippets will be used.\n\
-If the -none option is used, the start-up will be empty -- no start-up snippets\n\
+If the -none option is used, the startup will be empty -- no startup snippets\n\
or commands will be used.\n\
-This command is good for testing the start-up settings. To retain them for future\n\
+This command is good for testing the startup settings. To retain them for future\n\
runs of the jshell tool use the command:\n\t\
/set start -retain\n\
\n\
When the -retain option is used, the setting will be used in this and future\n\
runs of the jshell tool.\n\
\n\
-The form without or options shows the start-up setting.\n\
-Note: if the start-up was last set from a file, this is shown with the\n\
+The form without or options shows the startup setting.\n\
+Note: if the startup was last set from a file, this is shown with the\n\
'set start' command followed by the contents of the file.\n\
\n\
The may be an operating system file name, or one of the predefined\n\
diff --git a/test/langtools/jdk/jshell/CommandCompletionTest.java b/test/langtools/jdk/jshell/CommandCompletionTest.java
index 535a9eb1c7e..827cd047287 100644
--- a/test/langtools/jdk/jshell/CommandCompletionTest.java
+++ b/test/langtools/jdk/jshell/CommandCompletionTest.java
@@ -162,13 +162,13 @@ public void testHelp() {
"/edit ", "/env ", "/exit ",
"/help ", "/history ", "/imports ",
"/list ", "/methods ", "/open ", "/reload ", "/reset ",
- "/save ", "/set ", "/types ", "/vars ", "context ", "intro ", "rerun ", "shortcuts "),
+ "/save ", "/set ", "/types ", "/vars ", "context ", "id ", "intro ", "rerun ", "shortcuts "),
a -> assertCompletion(a, "/? |", false,
"/! ", "/- ", "/ ", "/? ", "/drop ",
"/edit ", "/env ", "/exit ",
"/help ", "/history ", "/imports ",
"/list ", "/methods ", "/open ", "/reload ", "/reset ",
- "/save ", "/set ", "/types ", "/vars ", "context ", "intro ", "rerun ", "shortcuts "),
+ "/save ", "/set ", "/types ", "/vars ", "context ", "id ", "intro ", "rerun ", "shortcuts "),
a -> assertCompletion(a, "/help /s|", false,
"/save ", "/set "),
a -> assertCompletion(a, "/help /set |", false,
diff --git a/test/langtools/jdk/jshell/EditorTestBase.java b/test/langtools/jdk/jshell/EditorTestBase.java
index a4fddac9018..14e20d6339f 100644
--- a/test/langtools/jdk/jshell/EditorTestBase.java
+++ b/test/langtools/jdk/jshell/EditorTestBase.java
@@ -73,7 +73,7 @@ public void testEditNegative() {
for (String edit : new String[] {"/ed", "/edit"}) {
test(new String[]{"--no-startup"},
a -> assertCommandOutputStartsWith(a, edit + " 1",
- "| No snippet with id: 1"),
+ "| No snippet with ID: 1"),
a -> assertCommandOutputStartsWith(a, edit + " unknown",
"| No such snippet: unknown")
);
diff --git a/test/langtools/jdk/jshell/ToolBasicTest.java b/test/langtools/jdk/jshell/ToolBasicTest.java
index 04174aec298..7ddc10aa622 100644
--- a/test/langtools/jdk/jshell/ToolBasicTest.java
+++ b/test/langtools/jdk/jshell/ToolBasicTest.java
@@ -189,8 +189,8 @@ public void testStop() {
public void testRerun() {
test(false, new String[] {"--no-startup"},
- (a) -> assertCommand(a, "/0", "| No snippet with id: 0"),
- (a) -> assertCommand(a, "/5", "| No snippet with id: 5")
+ (a) -> assertCommand(a, "/0", "| No snippet with ID: 0"),
+ (a) -> assertCommand(a, "/5", "| No snippet with ID: 5")
);
String[] codes = new String[] {
"int a = 0;", // var
@@ -251,9 +251,9 @@ public void test8142447() {
);
test(false, new String[] {"--no-startup"},
- (a) -> assertCommand(a, "/s1", "| No snippet with id: s1"),
- (a) -> assertCommand(a, "/1", "| No snippet with id: 1"),
- (a) -> assertCommand(a, "/e1", "| No snippet with id: e1")
+ (a) -> assertCommand(a, "/s1", "| No snippet with ID: s1"),
+ (a) -> assertCommand(a, "/1", "| No snippet with ID: 1"),
+ (a) -> assertCommand(a, "/e1", "| No snippet with ID: e1")
);
}
diff --git a/test/langtools/jdk/jshell/ToolSimpleTest.java b/test/langtools/jdk/jshell/ToolSimpleTest.java
index f0906c7f7a2..3a6ae752622 100644
--- a/test/langtools/jdk/jshell/ToolSimpleTest.java
+++ b/test/langtools/jdk/jshell/ToolSimpleTest.java
@@ -296,7 +296,7 @@ public void testDropRange() {
@Test
public void testDropNegative() {
test(false, new String[]{"--no-startup"},
- a -> assertCommandOutputStartsWith(a, "/drop 0", "| No snippet with id: 0"),
+ a -> assertCommandOutputStartsWith(a, "/drop 0", "| No snippet with ID: 0"),
a -> assertCommandOutputStartsWith(a, "/drop a", "| No such snippet: a"),
a -> assertCommandCheckOutput(a, "/drop",
assertStartsWith("| In the /drop argument, please specify an import, variable, method, or class to drop.")),
From 3e8a0024c96015629192b043a8fce3b5b6e17945 Mon Sep 17 00:00:00 2001
From: jjg
Date: Thu, 4 Jan 2018 12:55:06 -0800
Subject: [PATCH 05/29] 8194069: doclint throws missing comment warnings on
lines which can't even have javadoc Reviewed-by: ksrini
---
.../com/sun/tools/doclint/DocLint.java | 16 +++++-
test/langtools/tools/doclint/LambdaTest.java | 54 +++++++++++++++++++
2 files changed, 68 insertions(+), 2 deletions(-)
create mode 100644 test/langtools/tools/doclint/LambdaTest.java
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java b/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java
index b68e02ad0c9..deedef33146 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -37,8 +37,10 @@
import javax.tools.StandardLocation;
import com.sun.source.doctree.DocCommentTree;
+import com.sun.source.tree.BlockTree;
import com.sun.source.tree.ClassTree;
import com.sun.source.tree.CompilationUnitTree;
+import com.sun.source.tree.LambdaExpressionTree;
import com.sun.source.tree.ModuleTree;
import com.sun.source.tree.PackageTree;
import com.sun.source.tree.MethodTree;
@@ -398,6 +400,7 @@ public Void visitPackage(PackageTree tree, Void ignore) {
visitDecl(tree, null);
return super.visitPackage(tree, ignore);
}
+
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitClass(ClassTree tree, Void ignore) {
visitDecl(tree, tree.getSimpleName());
@@ -407,7 +410,6 @@ public Void visitClass(ClassTree tree, Void ignore) {
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitMethod(MethodTree tree, Void ignore) {
visitDecl(tree, tree.getName());
- //return super.visitMethod(tree, ignore);
return null;
}
@@ -431,6 +433,16 @@ public Void visitCompilationUnit(CompilationUnitTree node, Void p) {
return super.visitCompilationUnit(node, p);
}
+ @Override @DefinedBy(Api.COMPILER_TREE)
+ public Void visitBlock(BlockTree tree, Void ignore) {
+ return null;
+ }
+
+ @Override @DefinedBy(Api.COMPILER_TREE)
+ public Void visitLambdaExpression(LambdaExpressionTree tree, Void ignore) {
+ return null;
+ }
+
}
//
diff --git a/test/langtools/tools/doclint/LambdaTest.java b/test/langtools/tools/doclint/LambdaTest.java
new file mode 100644
index 00000000000..84555288ed4
--- /dev/null
+++ b/test/langtools/tools/doclint/LambdaTest.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2012, 2018, 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.
+ */
+
+/*
+ * @test
+ * @bug 8194069
+ * @summary ignore declarations in lambda expressions
+ * @modules jdk.compiler/com.sun.tools.doclint
+ * @build DocLintTester
+ * @run main DocLintTester -Xmsgs:all SyntheticTest.java
+ */
+
+package acme;
+
+import java.util.Arrays;
+import java.util.Set;
+import java.util.function.Function;
+
+/**
+ * The class has docs.
+ */
+public final class LambdaTest
+{
+ /**
+ * The field itself has docs.
+ */
+ // Ensure no warning for lambda parameter, at 'string ->'
+ static final Function someFunction = string -> {
+ // Ensure no warning for 'localVariable'
+ int localVariable = 3;
+ return Integer.toString(localVariable);
+ };
+}
+
From b33cf61a1c2c897199f5a80c7e4cce0fa71c119b Mon Sep 17 00:00:00 2001
From: ksrini
Date: Thu, 4 Jan 2018 13:32:10 -0800
Subject: [PATCH 06/29] 8193671: Default Methods tab under Method Summary
includes static methods Reviewed-by: jjg
---
.../formats/html/MethodWriterImpl.java | 5 ++--
.../testMethodTypes/TestMethodTypes.java | 25 +++++++++-------
.../doclet/testMethodTypes/pkg1/A.java | 3 +-
.../doclet/testMethodTypes/pkg1/B.java | 30 +++++++++++++++++--
.../doclet/testMethodTypes/pkg1/D.java | 3 +-
5 files changed, 48 insertions(+), 18 deletions(-)
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java
index 564045881f6..d157887f01f 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, 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
@@ -264,8 +264,7 @@ protected Table createSummaryTable() {
.addTab(resources.getText("doclet.Abstract_Methods"), utils::isAbstract)
.addTab(resources.getText("doclet.Concrete_Methods"),
e -> !utils.isAbstract(e) && !utils.isInterface(e.getEnclosingElement()))
- .addTab(resources.getText("doclet.Default_Methods"),
- e -> !utils.isAbstract(e) && utils.isInterface(e.getEnclosingElement()))
+ .addTab(resources.getText("doclet.Default_Methods"), utils::isDefault)
.addTab(resources.getText("doclet.Deprecated_Methods"),
e -> utils.isDeprecated(e) || utils.isDeprecated(typeElement))
.setTabScriptVariable("methods")
diff --git a/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java b/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java
index 24e09f2fc5d..5badf773a46 100644
--- a/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java
+++ b/test/langtools/jdk/javadoc/doclet/testMethodTypes/TestMethodTypes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -23,8 +23,8 @@
/*
* @test
- * @bug 8002304 8024096
- * @summary Test for various method types in the method summary table
+ * @bug 8002304 8024096 8193671
+ * @summary Test for various method type tabs in the method summary table
* @author Bhavesh Patel
* @library ../lib
* @modules jdk.javadoc/jdk.javadoc.internal.tool
@@ -62,13 +62,18 @@ void test() {
"");
checkOutput("pkg1/B.html", true,
- "All "
- + "Methods "
- + ""
- + "Instance Methods "
- + ""
- + "Abstract Methods "
- + " ");
+ "var methods = {\"i0\":6,\"i1\":18,\"i2\":18,\"i3\":1,\"i4\":1,"
+ + "\"i5\":6,\"i6\":6,\"i7\":6,\"i8\":6};\n",
+ "All Methods "
+ + " "
+ + "Static Methods "
+ + " "
+ + "Instance Methods "
+ + " "
+ + "Abstract Methods "
+ + " "
+ + "Default Methods "
+ + " \n");
checkOutput("pkg1/D.html", true,
"var methods = {",
diff --git a/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/A.java b/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/A.java
index 6a75d86eebd..0aa2bfb59d7 100644
--- a/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/A.java
+++ b/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/A.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -44,6 +44,7 @@ public final void setStub() {
/**
* This is the third concrete instance method.
+ * @return a string
*/
public String getParameter() {
return "test";
diff --git a/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/B.java b/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/B.java
index 1404e095645..3c38a2c5215 100644
--- a/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/B.java
+++ b/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/B.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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,8 +24,8 @@
package pkg1;
/**
- * This interface has different types of methods such as "Instance Methods" and
- * "Abstract Methods". All the tabs will display same list of methods.
+ * This interface has different types of methods such as "Static Methods",
+ * "Instance Methods", "Abstract Methods", "Default Methods".
*/
public interface B {
@@ -36,21 +36,45 @@ public interface B {
/**
* This is the second abstract instance method.
+ * @return a string
*/
public String getName();
/**
* This is the third abstract instance method.
+ * @return a boolean value
*/
public boolean addEntry();
/**
* This is the fourth abstract instance method.
+ * @return a boolean value
*/
public boolean removeEntry();
/**
* This is the fifth abstract instance method.
+ * @return a string
*/
public String getPermissions();
+
+ /**
+ * A static interface method.
+ */
+ public static void aStaticMethod() {}
+
+ /**
+ * Another static interface method.
+ */
+ public static void anotherStaticMethod() {}
+
+ /**
+ * A default method.
+ */
+ public default void aDefaultMethod() {}
+
+ /**
+ * Another default method.
+ */
+ public default void anotherDefaultMethod() {}
}
diff --git a/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/D.java b/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/D.java
index 2d6b36c697c..e67790347c7 100644
--- a/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/D.java
+++ b/test/langtools/jdk/javadoc/doclet/testMethodTypes/pkg1/D.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -46,6 +46,7 @@ public final void setStub() {
/**
* This is the second concrete instance method.
+ * @return a string
*/
public String getParameter() {
return "test";
From c436a140714340a6ad5b87272aaf669e11057fe9 Mon Sep 17 00:00:00 2001
From: iveresov
Date: Thu, 4 Jan 2018 14:44:38 -0800
Subject: [PATCH 07/29] 8194271: jaotc crashes with --debug flag Reviewed-by:
kvn, thartmann
---
.../share/jvmci/jvmciCodeInstaller.cpp | 3 ++
.../src/jdk/tools/jaotc/AOTBackend.java | 2 +-
.../cli/jaotc/CompileClassWithDebugTest.java | 52 +++++++++++++++++++
3 files changed, 56 insertions(+), 1 deletion(-)
create mode 100644 test/hotspot/jtreg/compiler/aot/cli/jaotc/CompileClassWithDebugTest.java
diff --git a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
index 59ac0256448..768e37f015f 100644
--- a/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
+++ b/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
@@ -600,6 +600,9 @@ JVMCIEnv::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, Hand
if (!compiled_code->is_a(HotSpotCompiledNmethod::klass())) {
oop stubName = HotSpotCompiledCode::name(compiled_code_obj);
+ if (oopDesc::is_null(stubName)) {
+ JVMCI_ERROR_OK("stub should have a name");
+ }
char* name = strdup(java_lang_String::as_utf8_string(stubName));
cb = RuntimeStub::new_runtime_stub(name,
&buffer,
diff --git a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTBackend.java b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTBackend.java
index 3c96f630fd9..d9ae8f72bea 100644
--- a/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTBackend.java
+++ b/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTBackend.java
@@ -166,7 +166,7 @@ private static PhaseSuite initGraphBuilderSuite(HotSpotBackend
void printCompiledMethod(HotSpotResolvedJavaMethod resolvedMethod, CompilationResult compResult) {
// This is really not installing the method.
- InstalledCode installedCode = codeCache.addCode(resolvedMethod, HotSpotCompiledCodeBuilder.createCompiledCode(codeCache, null, null, compResult), null, null);
+ InstalledCode installedCode = codeCache.addCode(resolvedMethod, HotSpotCompiledCodeBuilder.createCompiledCode(codeCache, resolvedMethod, null, compResult), null, null);
String disassembly = codeCache.disassemble(installedCode);
if (disassembly != null) {
main.printer.printlnDebug(disassembly);
diff --git a/test/hotspot/jtreg/compiler/aot/cli/jaotc/CompileClassWithDebugTest.java b/test/hotspot/jtreg/compiler/aot/cli/jaotc/CompileClassWithDebugTest.java
new file mode 100644
index 00000000000..1f24043f0ab
--- /dev/null
+++ b/test/hotspot/jtreg/compiler/aot/cli/jaotc/CompileClassWithDebugTest.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/*
+ * @test
+ * @requires vm.aot
+ * @library / /test/lib /testlibrary
+ * @modules java.base/jdk.internal.misc
+ * @build compiler.aot.cli.jaotc.CompileClassWithDebugTest
+ * @run driver ClassFileInstaller compiler.aot.cli.jaotc.data.HelloWorldOne
+ * @run driver compiler.aot.cli.jaotc.CompileClassWithDebugTest
+ * @summary check that jaotc can compile a class with a --debug flag
+ */
+
+package compiler.aot.cli.jaotc;
+
+import compiler.aot.cli.jaotc.data.HelloWorldOne;
+import java.io.File;
+import jdk.test.lib.Asserts;
+import jdk.test.lib.process.OutputAnalyzer;
+
+public class CompileClassWithDebugTest {
+ public static void main(String[] args) {
+ OutputAnalyzer oa = JaotcTestHelper.compileLibrary("--debug", "--class-name", JaotcTestHelper
+ .getClassAotCompilationName(HelloWorldOne.class));
+ oa.shouldHaveExitValue(0);
+ File compiledLibrary = new File(JaotcTestHelper.DEFAULT_LIB_PATH);
+ Asserts.assertTrue(compiledLibrary.exists(), "Compiled library file missing");
+ Asserts.assertGT(compiledLibrary.length(), 0L, "Unexpected compiled library size");
+ JaotcTestHelper.checkLibraryUsage(HelloWorldOne.class.getName());
+ }
+}
From ca87ad40c614b7ac99d76771d9109de6cdadcb46 Mon Sep 17 00:00:00 2001
From: thartmann
Date: Fri, 5 Jan 2018 10:23:57 +0100
Subject: [PATCH 08/29] 8194494: SHA-512 stub uses AVX 2 instructions on
non-supporting CPUs Summary: Check for supports_avx2() && supports_bmi2()
before generating SHA-512 stub. Reviewed-by: kvn
---
src/hotspot/cpu/x86/vm_version_x86.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp
index 563ff1f111b..137cde0536a 100644
--- a/src/hotspot/cpu/x86/vm_version_x86.cpp
+++ b/src/hotspot/cpu/x86/vm_version_x86.cpp
@@ -882,7 +882,7 @@ void VM_Version::get_processor_features() {
FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
}
- if (UseSHA) {
+ if (UseSHA && supports_avx2() && supports_bmi2()) {
if (FLAG_IS_DEFAULT(UseSHA512Intrinsics)) {
FLAG_SET_DEFAULT(UseSHA512Intrinsics, true);
}
From 736a3f96f64ccd612cc69a1f7d2f99dcbf68c04d Mon Sep 17 00:00:00 2001
From: lana
Date: Fri, 5 Jan 2018 20:09:06 +0000
Subject: [PATCH 09/29] Added tag jdk-10+38 for changeset e569e83139fd
---
.hgtags | 1 +
1 file changed, 1 insertion(+)
diff --git a/.hgtags b/.hgtags
index 73855f4306a..8b5fe3dcf20 100644
--- a/.hgtags
+++ b/.hgtags
@@ -462,3 +462,4 @@ bbd692ad4fa300ecca7939ffbe3b1d5e52a28cc6 jdk-10+33
d8c634b016c628622c9abbdc6bf50509e5dedbec jdk-10+35
cb54a299aa91419cb7caef3992592e7b22488163 jdk-10+36
4f830b447edf04fb4a52151a5ad44d9bb60723cd jdk-10+37
+e569e83139fdfbecfeb3cd9014d560917787f158 jdk-10+38
From df123f847922824d77455002b59be68f7a3dcbc7 Mon Sep 17 00:00:00 2001
From: jjg
Date: Fri, 5 Jan 2018 12:41:28 -0800
Subject: [PATCH 10/29] 8188649: javadoc -encoding doesn't work when using the
old doclet API Reviewed-by: ksrini
---
.../sun/tools/javadoc/main/ToolOption.java | 3 +-
.../jdk/javadoc/tool/EncodingTest.java | 81 +++++++++++++++++++
.../langtools/tools/javadoc/EncodingTest.java | 80 ++++++++++++++++++
3 files changed, 163 insertions(+), 1 deletion(-)
create mode 100644 test/langtools/jdk/javadoc/tool/EncodingTest.java
create mode 100644 test/langtools/tools/javadoc/EncodingTest.java
diff --git a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java
index e84e6595015..1fc197b079b 100644
--- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/ToolOption.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -159,6 +159,7 @@ public void process(Helper helper, String arg) throws InvalidValueException {
public void process(Helper helper, String arg) {
helper.encoding = arg;
helper.setCompilerOpt(opt, arg);
+ helper.setFileManagerOpt(Option.ENCODING, arg);
}
},
diff --git a/test/langtools/jdk/javadoc/tool/EncodingTest.java b/test/langtools/jdk/javadoc/tool/EncodingTest.java
new file mode 100644
index 00000000000..1098916d25b
--- /dev/null
+++ b/test/langtools/jdk/javadoc/tool/EncodingTest.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/*
+ * @test
+ * @bug 8188649
+ * @summary ensure javadoc -encoding is not ignored
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ * @modules jdk.compiler/com.sun.tools.javac.main
+ * @modules jdk.javadoc/jdk.javadoc.internal.api
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @library /tools/lib /tools/javadoc/lib
+ * @build toolbox.JavacTask toolbox.JavadocTask toolbox.TestRunner toolbox.ToolBox
+ * @run main EncodingTest
+ */
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import toolbox.JavadocTask;
+import toolbox.Task;
+import toolbox.TestRunner;
+import toolbox.ToolBox;
+
+public class EncodingTest extends TestRunner {
+ public static void main(String... args) throws Exception {
+ EncodingTest t = new EncodingTest();
+ t.runTests();
+ }
+
+ private final ToolBox tb = new ToolBox();
+ private final Path src = Paths.get("src");
+ private final Path api = Paths.get("api");
+
+ EncodingTest() throws Exception {
+ super(System.err);
+ init();
+ }
+
+ void init() throws IOException {
+ Files.createDirectories(src);
+ Files.write(src.resolve("C.java"),
+ "/** \u03b1\u03b2\u03b3 */ public class C { }".getBytes(StandardCharsets.UTF_8));
+ }
+
+ @Test
+ public void testEncoding() {
+ Task.Result result = new JavadocTask(tb, Task.Mode.EXEC)
+ .outdir(api)
+ .options("-J-Dfile.encoding=ASCII",
+ "-encoding", "UTF-8",
+ "-docencoding", "UTF-8")
+ .files(src.resolve("C.java"))
+ .run(Task.Expect.SUCCESS)
+ .writeAll();
+ }
+}
+
diff --git a/test/langtools/tools/javadoc/EncodingTest.java b/test/langtools/tools/javadoc/EncodingTest.java
new file mode 100644
index 00000000000..72f69f511d6
--- /dev/null
+++ b/test/langtools/tools/javadoc/EncodingTest.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/*
+ * @test
+ * @bug 8188649
+ * @summary javadoc -encoding doesn't work when using the old doclet API
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ * @modules jdk.compiler/com.sun.tools.javac.main
+ * @modules jdk.javadoc/jdk.javadoc.internal.api
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @library /tools/lib /tools/javadoc/lib
+ * @build toolbox.JavacTask toolbox.JavadocTask toolbox.TestRunner toolbox.ToolBox ToyDoclet
+ * @run main EncodingTest
+ */
+
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+import toolbox.JavadocTask;
+import toolbox.Task;
+import toolbox.TestRunner;
+import toolbox.ToolBox;
+
+public class EncodingTest extends TestRunner {
+ public static void main(String... args) throws Exception {
+ EncodingTest t = new EncodingTest();
+ t.runTests();
+ }
+
+ private final ToolBox tb = new ToolBox();
+ private final Path src = Paths.get("src");
+
+ EncodingTest() throws Exception {
+ super(System.err);
+ init();
+ }
+
+ void init() throws IOException {
+ Files.createDirectories(src);
+ Files.write(src.resolve("C.java"),
+ "/** \u03b1\u03b2\u03b3 */ public class C { }".getBytes(StandardCharsets.UTF_8));
+ }
+
+ @Test
+ public void testEncoding() {
+ Task.Result result = new JavadocTask(tb, Task.Mode.EXEC)
+ .options("-docletpath", System.getProperty("test.class.path"),
+ "-doclet", "ToyDoclet",
+ "-J-Dfile.encoding=ASCII",
+ "-encoding", "UTF-8")
+ .files(src.resolve("C.java"))
+ .run(Task.Expect.SUCCESS)
+ .writeAll();
+ }
+}
+
From 17a6d1fbe68ec6857699f511dadc4fea9a6eb347 Mon Sep 17 00:00:00 2001
From: jjg
Date: Fri, 5 Jan 2018 16:49:50 -0800
Subject: [PATCH 11/29] 8191637: Interface with defaults invalid compiler
warning for Serializable Reviewed-by: vromero
---
.../com/sun/tools/javac/comp/Attr.java | 18 +++------------
...ava => SerializableAbstractClassTest.java} | 23 +++++++++++--------
.../SerializableAbstractClassTest.out | 4 ++++
...bstractClassWithNonAbstractMethodsTest.out | 5 ----
4 files changed, 21 insertions(+), 29 deletions(-)
rename test/langtools/tools/javac/T6356530/{SerializableAbstractClassWithNonAbstractMethodsTest.java => SerializableAbstractClassTest.java} (63%)
create mode 100644 test/langtools/tools/javac/T6356530/SerializableAbstractClassTest.out
delete mode 100644 test/langtools/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.out
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
index 62b47d8af19..c17bd554a39 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -4743,9 +4743,8 @@ private void attribClassBody(Env env, ClassSymbol c) {
// Check for proper use of serialVersionUID
if (env.info.lint.isEnabled(LintCategory.SERIAL)
&& isSerializable(c.type)
- && (c.flags() & Flags.ENUM) == 0
- && !c.isAnonymous()
- && checkForSerial(c)) {
+ && (c.flags() & (Flags.ENUM | Flags.INTERFACE)) == 0
+ && !c.isAnonymous()) {
checkSerialVersionUID(tree, c);
}
if (allowTypeAnnos) {
@@ -4757,17 +4756,6 @@ && checkForSerial(c)) {
}
}
// where
- boolean checkForSerial(ClassSymbol c) {
- if ((c.flags() & ABSTRACT) == 0) {
- return true;
- } else {
- return c.members().anyMatch(anyNonAbstractOrDefaultMethod);
- }
- }
-
- public static final Filter anyNonAbstractOrDefaultMethod = s ->
- s.kind == MTH && (s.flags() & (DEFAULT | ABSTRACT)) != ABSTRACT;
-
/** get a diagnostic position for an attribute of Type t, or null if attribute missing */
private DiagnosticPosition getDiagnosticPosition(JCClassDecl tree, Type t) {
for(List al = tree.mods.annotations; !al.isEmpty(); al = al.tail) {
diff --git a/test/langtools/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.java b/test/langtools/tools/javac/T6356530/SerializableAbstractClassTest.java
similarity index 63%
rename from test/langtools/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.java
rename to test/langtools/tools/javac/T6356530/SerializableAbstractClassTest.java
index ffdf34d5c8e..2b224be30ac 100644
--- a/test/langtools/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.java
+++ b/test/langtools/tools/javac/T6356530/SerializableAbstractClassTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -23,26 +23,31 @@
/*
* @test
- * @bug 6356530
- * @summary -Xlint:serial does not flag abstract classes with concrete methods/members
- * @compile/fail/ref=SerializableAbstractClassWithNonAbstractMethodsTest.out -XDrawDiagnostics -Werror -Xlint:serial SerializableAbstractClassWithNonAbstractMethodsTest.java
+ * @bug 6356530 8191637
+ * @summary -Xlint:serial does not flag abstract classes with persisent fields
+ * @compile/fail/ref=SerializableAbstractClassTest.out -XDrawDiagnostics -Werror -Xlint:serial SerializableAbstractClassTest.java
*/
-abstract class SerializableAbstractClassWithNonAbstractMethodsTest implements java.io.Serializable {
- void m1() {}
+abstract class SerializableAbstractClassTest implements java.io.Serializable {
+ // no serialVersionUID; error
abstract void m2();
- abstract class AWithUID implements java.io.Serializable {
+ static abstract class AWithUID implements java.io.Serializable {
private static final long serialVersionUID = 0;
void m(){}
}
+ interface I extends java.io.Serializable {
+ // no need for serialVersionUID
+ }
+
interface IDefault extends java.io.Serializable {
+ // no need for serialVersionUID
default int m() { return 1; }
}
- interface IDefaultAndUID extends java.io.Serializable {
+ interface IUID extends java.io.Serializable {
+ // no need for serialVersionUID, but not wrong
static final long serialVersionUID = 0;
- default int m() { return 1; }
}
}
diff --git a/test/langtools/tools/javac/T6356530/SerializableAbstractClassTest.out b/test/langtools/tools/javac/T6356530/SerializableAbstractClassTest.out
new file mode 100644
index 00000000000..11c67dad864
--- /dev/null
+++ b/test/langtools/tools/javac/T6356530/SerializableAbstractClassTest.out
@@ -0,0 +1,4 @@
+SerializableAbstractClassTest.java:31:10: compiler.warn.missing.SVUID: SerializableAbstractClassTest
+- compiler.err.warnings.and.werror
+1 error
+1 warning
diff --git a/test/langtools/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.out b/test/langtools/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.out
deleted file mode 100644
index b6007717746..00000000000
--- a/test/langtools/tools/javac/T6356530/SerializableAbstractClassWithNonAbstractMethodsTest.out
+++ /dev/null
@@ -1,5 +0,0 @@
-SerializableAbstractClassWithNonAbstractMethodsTest.java:40:5: compiler.warn.missing.SVUID: SerializableAbstractClassWithNonAbstractMethodsTest.IDefault
-SerializableAbstractClassWithNonAbstractMethodsTest.java:31:10: compiler.warn.missing.SVUID: SerializableAbstractClassWithNonAbstractMethodsTest
-- compiler.err.warnings.and.werror
-1 error
-2 warnings
From a634e63fa204ddb2f04eab77545cd7ba5cd74ccd Mon Sep 17 00:00:00 2001
From: amlu
Date: Mon, 8 Jan 2018 10:15:21 +0800
Subject: [PATCH 12/29] 8194666: ProblemList update for bugid associated with
PreferredKey.java, ConcurrentHashMapTest and SSLSocketParametersTest.sh
Reviewed-by: xuelei
---
test/jdk/ProblemList.txt | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt
index c3a3d63d29a..24af70a9552 100644
--- a/test/jdk/ProblemList.txt
+++ b/test/jdk/ProblemList.txt
@@ -264,7 +264,7 @@ javax/net/ssl/DTLS/RespondToRetransmit.java 8169086 macosx-x
sun/security/krb5/auto/UnboundSSL.java 8180265 windows-all
sun/security/provider/KeyStore/DKSTest.sh 8180266 windows-all
-sun/security/ssl/X509KeyManager/PreferredKey.java 8176354 generic-all
+sun/security/ssl/X509KeyManager/PreferredKey.java 8190333 generic-all
############################################################################
@@ -363,12 +363,12 @@ com/sun/tools/attach/StartManagementAgent.java 8179700 generic-
com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java 8169942 linux-i586,macosx-all,windows-x64
-javax/rmi/PortableRemoteObject/8146975/RmiIiopReturnValueTest.java 8169737 generic-all
+javax/rmi/PortableRemoteObject/8146975/RmiIiopReturnValueTest.java 8194663 generic-all
-org/omg/CORBA/OrbPropertiesTest.java 8175177 generic-all
+org/omg/CORBA/OrbPropertiesTest.java 8194663 generic-all
-javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java 8080643 generic-all
+javax/rmi/PortableRemoteObject/ConcurrentHashMapTest.java 8194663 generic-all
-javax/rmi/ssl/SSLSocketParametersTest.sh 8162906 generic-all
+javax/rmi/ssl/SSLSocketParametersTest.sh 8194663 generic-all
############################################################################
From 027262a502b4677f8ed21ceb928be840aa29a4a9 Mon Sep 17 00:00:00 2001
From: amlu
Date: Mon, 8 Jan 2018 11:20:20 +0800
Subject: [PATCH 13/29] 8194662: Problem list
com/sun/jndi/ldap/LdapTimeoutTest.java Reviewed-by: dholmes
---
test/jdk/ProblemList.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/test/jdk/ProblemList.txt b/test/jdk/ProblemList.txt
index 24af70a9552..6911ede6399 100644
--- a/test/jdk/ProblemList.txt
+++ b/test/jdk/ProblemList.txt
@@ -363,6 +363,8 @@ com/sun/tools/attach/StartManagementAgent.java 8179700 generic-
com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java 8169942 linux-i586,macosx-all,windows-x64
+com/sun/jndi/ldap/LdapTimeoutTest.java 8151678 linux-all
+
javax/rmi/PortableRemoteObject/8146975/RmiIiopReturnValueTest.java 8194663 generic-all
org/omg/CORBA/OrbPropertiesTest.java 8194663 generic-all
From 3c0428eaf2fb7a1a872236b971959979a730c7a9 Mon Sep 17 00:00:00 2001
From: hannesw
Date: Mon, 8 Jan 2018 17:16:37 +0100
Subject: [PATCH 14/29] 8193567: Conversion of comparison nodes affects local
slots in optimistic continuation Reviewed-by: jlaskey, attila
---
.../codegen/OptimisticTypesCalculator.java | 7 ++--
test/nashorn/script/basic/JDK-8193567.js | 36 +++++++++++++++++++
2 files changed, 39 insertions(+), 4 deletions(-)
create mode 100644 test/nashorn/script/basic/JDK-8193567.js
diff --git a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java
index 42f017f3bcd..06fa55a4aae 100644
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesCalculator.java
@@ -101,13 +101,12 @@ public boolean enterBinaryNode(final BinaryNode binaryNode) {
tagNeverOptimistic(binaryNode.rhs());
}
}
- } else if(binaryNode.isTokenType(TokenType.INSTANCEOF)
- || binaryNode.isTokenType(TokenType.EQ_STRICT)
- || binaryNode.isTokenType(TokenType.NE_STRICT)) {
+ } else if(binaryNode.isTokenType(TokenType.INSTANCEOF)) {
tagNeverOptimistic(binaryNode.lhs());
tagNeverOptimistic(binaryNode.rhs());
}
- return true;
+ // Don't enter comparison nodes, see JDK-8193567
+ return !binaryNode.isComparison();
}
@Override
diff --git a/test/nashorn/script/basic/JDK-8193567.js b/test/nashorn/script/basic/JDK-8193567.js
new file mode 100644
index 00000000000..88b394296cc
--- /dev/null
+++ b/test/nashorn/script/basic/JDK-8193567.js
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017, 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.
+ */
+
+/**
+ * JDK-8193567: Conversion of comparison nodes affects local slots in optimistic continuation
+ *
+ * @test
+ * @run
+ */
+
+function a() {
+ var x, y;
+ return null == (r = null == (x = this.p) ? void 0 : x.r) ? this : y;
+}
+
+a();
From 0701d4851f9e14a043dca088414c56c5500390bb Mon Sep 17 00:00:00 2001
From: vromero
Date: Mon, 8 Jan 2018 14:06:25 -0500
Subject: [PATCH 15/29] 8187487: crash with classes with same binary name
Reviewed-by: jjg
---
.../com/sun/tools/javac/comp/Enter.java | 8 ++++-
.../tools/javac/resources/compiler.properties | 4 +++
.../tools/javac/NestedInnerClassNames.out | 2 +-
.../CrashWithDuplicateClassNamesTest.java | 20 ++++++++++++
.../CrashWithDuplicateClassNamesTest.out | 3 ++
.../javac/diags/examples/SameBinaryName.java | 32 +++++++++++++++++++
6 files changed, 67 insertions(+), 2 deletions(-)
create mode 100644 test/langtools/tools/javac/T8187487/CrashWithDuplicateClassNamesTest.java
create mode 100644 test/langtools/tools/javac/T8187487/CrashWithDuplicateClassNamesTest.out
create mode 100644 test/langtools/tools/javac/diags/examples/SameBinaryName.java
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java
index fe4cb8529de..ec60235650e 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -421,6 +421,12 @@ public void visitClassDef(JCClassDecl tree) {
// We are seeing a member class.
c = syms.enterClass(env.toplevel.modle, tree.name, (TypeSymbol)owner);
if (c.owner != owner) {
+ if (c.name != tree.name) {
+ log.error(tree.pos(), Errors.SameBinaryName(c.name, tree.name));
+ result = types.createErrorType(tree.name, (TypeSymbol)owner, Type.noType);
+ tree.sym = (ClassSymbol)result.tsym;
+ return;
+ }
//anonymous class loaded from a classfile may be recreated from source (see below)
//if this class is a member of such an anonymous class, fix the owner:
Assert.check(owner.owner.kind != TYP, owner::toString);
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
index a8052159762..f93ce0f900b 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties
@@ -443,6 +443,10 @@ compiler.err.invalid.repeatable.annotation.not.applicable.in.context=\
compiler.err.duplicate.class=\
duplicate class: {0}
+# 0: name, 1: name
+compiler.err.same.binary.name=\
+ classes: {0} and {1} have the same binary name
+
compiler.err.duplicate.case.label=\
duplicate case label
diff --git a/test/langtools/tools/javac/NestedInnerClassNames.out b/test/langtools/tools/javac/NestedInnerClassNames.out
index 2038a29791e..586a618c004 100644
--- a/test/langtools/tools/javac/NestedInnerClassNames.out
+++ b/test/langtools/tools/javac/NestedInnerClassNames.out
@@ -6,7 +6,7 @@ NestedInnerClassNames.java:46:13: compiler.err.already.defined: kindname.class,
NestedInnerClassNames.java:59:9: compiler.err.already.defined: kindname.class, NestedInnerClassNames.foo$bar, kindname.class, NestedInnerClassNames
NestedInnerClassNames.java:76:13: compiler.err.already.defined: kindname.class, NestedInnerClassNames.$bar, kindname.class, NestedInnerClassNames
NestedInnerClassNames.java:90:13: compiler.err.already.defined: kindname.class, NestedInnerClassNames.bar$bar.bar, kindname.class, NestedInnerClassNames.bar$bar
-NestedInnerClassNames.java:109:5: compiler.err.duplicate.class: NestedInnerClassNames.foo.foo
+NestedInnerClassNames.java:109:5: compiler.err.same.binary.name: foo, foo$foo
NestedInnerClassNames.java:19:9: compiler.err.already.defined: kindname.class, NestedInnerClassNames, kindname.package, compiler.misc.unnamed.package
NestedInnerClassNames.java:28:13: compiler.err.already.defined: kindname.class, foo, kindname.method, m2()
NestedInnerClassNames.java:40:13: compiler.err.already.defined: kindname.class, NestedInnerClassNames, kindname.package, compiler.misc.unnamed.package
diff --git a/test/langtools/tools/javac/T8187487/CrashWithDuplicateClassNamesTest.java b/test/langtools/tools/javac/T8187487/CrashWithDuplicateClassNamesTest.java
new file mode 100644
index 00000000000..f26846628b0
--- /dev/null
+++ b/test/langtools/tools/javac/T8187487/CrashWithDuplicateClassNamesTest.java
@@ -0,0 +1,20 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8187487
+ * @summary crash with duplicate class name
+ * @compile/fail/ref=CrashWithDuplicateClassNamesTest.out -XDrawDiagnostics CrashWithDuplicateClassNamesTest.java
+ */
+
+class CrashWithDuplicateClassNamesTest {
+ static class C1$C2 {}
+
+ static class C1 {
+ static class C2 {}
+ }
+
+ static class C3 {
+ static class C4 {}
+ }
+
+ static class C3$C4 {}
+}
diff --git a/test/langtools/tools/javac/T8187487/CrashWithDuplicateClassNamesTest.out b/test/langtools/tools/javac/T8187487/CrashWithDuplicateClassNamesTest.out
new file mode 100644
index 00000000000..79cf163acae
--- /dev/null
+++ b/test/langtools/tools/javac/T8187487/CrashWithDuplicateClassNamesTest.out
@@ -0,0 +1,3 @@
+CrashWithDuplicateClassNamesTest.java:12:16: compiler.err.same.binary.name: C1$C2, C2
+CrashWithDuplicateClassNamesTest.java:19:12: compiler.err.same.binary.name: C4, C3$C4
+2 errors
diff --git a/test/langtools/tools/javac/diags/examples/SameBinaryName.java b/test/langtools/tools/javac/diags/examples/SameBinaryName.java
new file mode 100644
index 00000000000..661d060c5fd
--- /dev/null
+++ b/test/langtools/tools/javac/diags/examples/SameBinaryName.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+// key: compiler.err.same.binary.name
+
+class SameBinaryName {
+ private static final class Foo$Bar {}
+
+ private static final class Foo {
+ private static final class Bar {}
+ }
+}
From d163b93d81c508bc2bfb02724b3828692c3ecf01 Mon Sep 17 00:00:00 2001
From: darcy
Date: Mon, 8 Jan 2018 17:32:54 -0800
Subject: [PATCH 16/29] 8187951: Update javax.lang.model.SourceVersion for
"var" name Reviewed-by: jjg, mcimadamore
---
.../javax/lang/model/SourceVersion.java | 17 ++++++++++-------
.../processing/model/TestSourceVersion.java | 18 ++++++++++++++++--
2 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java
index 5d8124aeda6..6ab21d602da 100644
--- a/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java
+++ b/src/java.compiler/share/classes/javax/lang/model/SourceVersion.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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
@@ -219,8 +219,9 @@ public static SourceVersion latestSupported() {
* followed only by characters for which {@link
* Character#isJavaIdentifierPart(int)} returns {@code true}.
* This pattern matches regular identifiers, keywords, restricted
- * keywords, and the literals {@code "true"}, {@code "false"}, and
- * {@code "null"}.
+ * keywords, and the literals {@code "true"}, {@code "false"},
+ * {@code "null"}, and {@code "var"}.
+ *
* The method returns {@code false} for all other strings.
*
* @param name the string to check
@@ -254,8 +255,9 @@ public static boolean isIdentifier(CharSequence name) {
* qualified name in the latest source version. Unlike {@link
* #isIdentifier isIdentifier}, this method returns {@code false}
* for keywords, boolean literals, and the null literal.
+ *
* This method returns {@code true} for restricted
- * keywords .
+ * keywords and {@code "var"}.
*
* @param name the string to check
* @return {@code true} if this string is a
@@ -272,8 +274,9 @@ public static boolean isName(CharSequence name) {
* qualified name in the given source version. Unlike {@link
* #isIdentifier isIdentifier}, this method returns {@code false}
* for keywords, boolean literals, and the null literal.
+ *
* This method returns {@code true} for restricted
- * keywords .
+ * keywords and {@code "var"}.
*
* @param name the string to check
* @param version the version to use
@@ -297,7 +300,7 @@ public static boolean isName(CharSequence name, SourceVersion version) {
* Returns whether or not {@code s} is a keyword, boolean literal,
* or null literal in the latest source version.
* This method returns {@code false} for restricted
- * keywords .
+ * keywords and {@code "var"}.
*
* @param s the string to check
* @return {@code true} if {@code s} is a keyword, or boolean
@@ -314,7 +317,7 @@ public static boolean isKeyword(CharSequence s) {
* Returns whether or not {@code s} is a keyword, boolean literal,
* or null literal in the given source version.
* This method returns {@code false} for restricted
- * keywords .
+ * keywords and {@code "var"}.
*
* @param s the string to check
* @param version the version to use
diff --git a/test/langtools/tools/javac/processing/model/TestSourceVersion.java b/test/langtools/tools/javac/processing/model/TestSourceVersion.java
index 3ce894e8b25..ceb3dc3f959 100644
--- a/test/langtools/tools/javac/processing/model/TestSourceVersion.java
+++ b/test/langtools/tools/javac/processing/model/TestSourceVersion.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -23,7 +23,7 @@
/*
* @test
- * @bug 7025809 8028543 6415644 8028544 8029942
+ * @bug 7025809 8028543 6415644 8028544 8029942 8187951
* @summary Test latest, latestSupported, underscore as keyword, etc.
* @author Joseph D. Darcy
* @modules java.compiler
@@ -42,6 +42,7 @@ public static void main(String... args) {
testLatestSupported();
testVersionVaryingKeywords();
testRestrictedKeywords();
+ testVar();
}
private static void testLatestSupported() {
@@ -96,6 +97,19 @@ private static void testRestrictedKeywords() {
}
}
+ private static void testVar() {
+
+ for(SourceVersion version : SourceVersion.values()) {
+ check(false, isKeyword("var", version), "keyword", version);
+ check(false, isKeyword("foo.var", version), "keyword", version);
+ check(false, isKeyword("var.foo", version), "keyword", version);
+
+ check(true, isName("var", version), "name", version);
+ check(true, isName("foo.var", version), "name", version);
+ check(true, isName("var.foo", version), "name", version);
+ }
+ }
+
private static void check(boolean result, boolean expected,
String message, SourceVersion version) {
if (result != expected) {
From fe56d419ef204c587532906a25fa44f854e4420e Mon Sep 17 00:00:00 2001
From: sballal
Date: Tue, 9 Jan 2018 15:21:19 +0530
Subject: [PATCH 17/29] 8194067: [Testbug] serviceability/sa/Jhsdb* tests can't
tolerate unrelated warnings Reviewed-by: dholmes, sspitsyn
---
.../sa/JhsdbThreadInfoTest.java | 20 +++++++++++++++++--
.../sa/TestJhsdbJstackLock.java | 20 +++++++++++++++++--
2 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/test/hotspot/jtreg/serviceability/sa/JhsdbThreadInfoTest.java b/test/hotspot/jtreg/serviceability/sa/JhsdbThreadInfoTest.java
index 000e8081993..c0a32e8eda4 100644
--- a/test/hotspot/jtreg/serviceability/sa/JhsdbThreadInfoTest.java
+++ b/test/hotspot/jtreg/serviceability/sa/JhsdbThreadInfoTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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,6 +21,11 @@
* questions.
*/
+import java.util.Arrays;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
import jdk.test.lib.apps.LingeredApp;
import jdk.test.lib.JDKToolLauncher;
import jdk.test.lib.Platform;
@@ -69,7 +74,18 @@ public static void main(String[] args) throws Exception {
out.shouldMatch(" JavaThread state: _thread_.+");
out.shouldNotContain(" java.lang.Thread.State: UNKNOWN");
- out.stderrShouldBeEmpty();
+
+ // stderr should be empty except for VM warnings.
+ if (!out.getStderr().isEmpty()) {
+ List lines = Arrays.asList(out.getStderr().split("(\\r\\n|\\n|\\r)"));
+ Pattern p = Pattern.compile(".*VM warning.*");
+ for (String line : lines) {
+ Matcher m = p.matcher(line);
+ if (!m.matches()) {
+ throw new RuntimeException("Stderr has output other than VM warnings");
+ }
+ }
+ }
System.out.println("Test Completed");
} catch (InterruptedException ie) {
diff --git a/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackLock.java b/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackLock.java
index 739ae29ba0b..17614ab06eb 100644
--- a/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackLock.java
+++ b/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackLock.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, 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,7 +24,11 @@
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
import jdk.test.lib.apps.LingeredApp;
import jdk.test.lib.Asserts;
import jdk.test.lib.JDKToolLauncher;
@@ -76,7 +80,19 @@ public static void main (String... args) throws Exception {
out.shouldMatch("^\\s+- waiting to lock <0x[0-9a-f]+> \\(a java\\.lang\\.Class for LingeredAppWithLock\\)$");
out.shouldMatch("^\\s+- locked <0x[0-9a-f]+> \\(a java\\.lang\\.Thread\\)$");
out.shouldMatch("^\\s+- locked <0x[0-9a-f]+> \\(a java\\.lang\\.Class for int\\)$");
- out.stderrShouldBeEmpty();
+
+ // stderr should be empty except for VM warnings.
+ if (!out.getStderr().isEmpty()) {
+ List lines = Arrays.asList(out.getStderr().split("(\\r\\n|\\n|\\r)"));
+ Pattern p = Pattern.compile(".*VM warning.*");
+ for (String line : lines) {
+ Matcher m = p.matcher(line);
+ if (!m.matches()) {
+ throw new RuntimeException("Stderr has output other than VM warnings");
+ }
+ }
+ }
+
System.out.println("Test Completed");
} finally {
From d5c43d2707c6567f32d385fad4ef52213ab5bb6d Mon Sep 17 00:00:00 2001
From: thartmann
Date: Fri, 15 Dec 2017 16:51:13 +0100
Subject: [PATCH 18/29] 8193608: Quarantine
test/hotspot/jtreg/compiler/codegen/Test6896617.java until JDK-8193479 is
fixed Summary: Added test to ProblemList.txt Reviewed-by: vlivanov
---
test/hotspot/jtreg/ProblemList.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt
index d56bd6c0a14..28dde210a6f 100644
--- a/test/hotspot/jtreg/ProblemList.txt
+++ b/test/hotspot/jtreg/ProblemList.txt
@@ -42,6 +42,7 @@
compiler/ciReplay/TestSAServer.java 8029528 generic-all
compiler/codecache/stress/OverloadCompileQueueTest.java 8166554 generic-all
+compiler/codegen/Test6896617.java 8193479 generic-all
compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8140405 generic-all
compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 8158860 generic-all
compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java 8163894 generic-all
From 7e56405d5bc50f97b89ff0bbe0144f90361418d1 Mon Sep 17 00:00:00 2001
From: goetz
Date: Tue, 9 Jan 2018 16:24:24 +0100
Subject: [PATCH 19/29] 8194742: Writing replay data crashes: task is NULL
Summary: Added missing NULL check. Reviewed-by: thartmann
---
src/hotspot/share/ci/ciEnv.cpp | 34 ++++++++++++++++++----------------
1 file changed, 18 insertions(+), 16 deletions(-)
diff --git a/src/hotspot/share/ci/ciEnv.cpp b/src/hotspot/share/ci/ciEnv.cpp
index 70a7818aed1..531f2ab1e0e 100644
--- a/src/hotspot/share/ci/ciEnv.cpp
+++ b/src/hotspot/share/ci/ciEnv.cpp
@@ -1164,28 +1164,30 @@ ciInstance* ciEnv::unloaded_ciinstance() {
void ciEnv::dump_compile_data(outputStream* out) {
CompileTask* task = this->task();
- Method* method = task->method();
- int entry_bci = task->osr_bci();
- int comp_level = task->comp_level();
- out->print("compile %s %s %s %d %d",
- method->klass_name()->as_quoted_ascii(),
- method->name()->as_quoted_ascii(),
- method->signature()->as_quoted_ascii(),
- entry_bci, comp_level);
- if (compiler_data() != NULL) {
- if (is_c2_compile(comp_level)) {
+ if (task) {
+ Method* method = task->method();
+ int entry_bci = task->osr_bci();
+ int comp_level = task->comp_level();
+ out->print("compile %s %s %s %d %d",
+ method->klass_name()->as_quoted_ascii(),
+ method->name()->as_quoted_ascii(),
+ method->signature()->as_quoted_ascii(),
+ entry_bci, comp_level);
+ if (compiler_data() != NULL) {
+ if (is_c2_compile(comp_level)) {
#ifdef COMPILER2
- // Dump C2 inlining data.
- ((Compile*)compiler_data())->dump_inline_data(out);
+ // Dump C2 inlining data.
+ ((Compile*)compiler_data())->dump_inline_data(out);
#endif
- } else if (is_c1_compile(comp_level)) {
+ } else if (is_c1_compile(comp_level)) {
#ifdef COMPILER1
- // Dump C1 inlining data.
- ((Compilation*)compiler_data())->dump_inline_data(out);
+ // Dump C1 inlining data.
+ ((Compilation*)compiler_data())->dump_inline_data(out);
#endif
+ }
}
+ out->cr();
}
- out->cr();
}
void ciEnv::dump_replay_data_unsafe(outputStream* out) {
From 38cf684b987be1bf89efe11e4915bcf6ad406b9b Mon Sep 17 00:00:00 2001
From: jjg
Date: Tue, 9 Jan 2018 17:03:39 -0800
Subject: [PATCH 20/29] 8185986: redundant/obsolete overview.html pages
Reviewed-by: darcy
---
.../classes/javax/lang/model/overview.html | 38 -------------
.../share/classes/javax/tools/overview.html | 54 -------------------
.../classes/com/sun/tools/javap/overview.html | 10 ----
3 files changed, 102 deletions(-)
delete mode 100644 src/java.compiler/share/classes/javax/lang/model/overview.html
delete mode 100644 src/java.compiler/share/classes/javax/tools/overview.html
delete mode 100644 src/jdk.jdeps/share/classes/com/sun/tools/javap/overview.html
diff --git a/src/java.compiler/share/classes/javax/lang/model/overview.html b/src/java.compiler/share/classes/javax/lang/model/overview.html
deleted file mode 100644
index 9eabdcf7ba0..00000000000
--- a/src/java.compiler/share/classes/javax/lang/model/overview.html
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-javax.lang.model
-
-
-
-
-Packages used to model various aspects of the Java programming language.
-
-@since 1.6
-
-
-
diff --git a/src/java.compiler/share/classes/javax/tools/overview.html b/src/java.compiler/share/classes/javax/tools/overview.html
deleted file mode 100644
index 883b8d4aa16..00000000000
--- a/src/java.compiler/share/classes/javax/tools/overview.html
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-javax.tools
-
-
-
-
-The Java™ programming language compiler API is a set of interfaces that describes the
-functions provided by a compiler. This API has three
-main objectives:
-
-
-
-
-Allow invocation of a compiler from a program using
-standardized interfaces.
-
-Provide interfaces enabling the compiler to report diagnostics in a
-structured way.
-
-Provide interfaces enabling clients of the compiler to override
-how file objects are found. "File objects" is a file
-abstraction.
-
-
-
-
-
diff --git a/src/jdk.jdeps/share/classes/com/sun/tools/javap/overview.html b/src/jdk.jdeps/share/classes/com/sun/tools/javap/overview.html
deleted file mode 100644
index fc0f472d2b7..00000000000
--- a/src/jdk.jdeps/share/classes/com/sun/tools/javap/overview.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
- javap: class file disassembler
-
-
-
- Javap is a class file disassembler.
-
-
From ddf9408c7ce48284433a377493d19b6a99b2cc37 Mon Sep 17 00:00:00 2001
From: vromero
Date: Tue, 9 Jan 2018 22:30:20 -0500
Subject: [PATCH 21/29] 8194836: delta apply changesets for JDK-8192885 and
JDK-8175883 Reviewed-by: mcimadamore
---
.../com/sun/tools/javac/comp/Lower.java | 21 ++--
.../AddGotoAfterForLoopToLNTTest.java | 116 ------------------
.../javac/flow/tests/TestCaseForEach.java | 2 +-
3 files changed, 9 insertions(+), 130 deletions(-)
delete mode 100644 test/langtools/tools/javac/T8192885/AddGotoAfterForLoopToLNTTest.java
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java
index fe9f0945797..bdde191d7b3 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -3226,7 +3226,7 @@ private void visitArrayForeachLoop(JCEnhancedForLoop tree) {
JCVariableDecl indexdef = make.VarDef(index, make.Literal(INT, 0));
indexdef.init.type = indexdef.type = syms.intType.constType(0);
- List loopinit = List.of(lencachedef, indexdef);
+ List loopinit = List.of(arraycachedef, lencachedef, indexdef);
JCBinary cond = makeBinary(LT, make.Ident(index), make.Ident(lencache));
JCExpressionStatement step = make.Exec(makeUnary(PREINC, make.Ident(index)));
@@ -3236,20 +3236,18 @@ private void visitArrayForeachLoop(JCEnhancedForLoop tree) {
make.Ident(index)).setType(elemtype);
JCVariableDecl loopvardef = (JCVariableDecl)make.VarDef(tree.var.mods,
tree.var.name,
- tree.var.vartype, loopvarinit).setType(tree.var.type);
+ tree.var.vartype,
+ loopvarinit).setType(tree.var.type);
loopvardef.sym = tree.var.sym;
+ JCBlock body = make.
+ Block(0, List.of(loopvardef, tree.body));
- JCBlock body = make.Block(0, List.of(loopvardef, tree.body));
-
- arraycachedef = translate(arraycachedef);
result = translate(make.
ForLoop(loopinit,
cond,
List.of(step),
body));
patchTargets(body, tree, result);
- JCStatement nullAssignToArr = make.Assignment(arraycache, make.Literal(BOT, null).setType(syms.botType));
- result = make.Block(0, List.of(arraycachedef, (JCStatement)result, nullAssignToArr));
}
/** Patch up break and continue targets. */
private void patchTargets(JCTree body, final JCTree src, final JCTree dest) {
@@ -3303,7 +3301,7 @@ private void visitIterableForeachLoop(JCEnhancedForLoop tree) {
types.erasure(types.asSuper(iterator.type.getReturnType(), syms.iteratorType.tsym)),
currentMethodSym);
- JCStatement init = make.
+ JCStatement init = make.
VarDef(itvar, make.App(make.Select(tree.expr, iterator)
.setType(types.erasure(iterator.type))));
@@ -3328,15 +3326,12 @@ private void visitIterableForeachLoop(JCEnhancedForLoop tree) {
indexDef.sym = tree.var.sym;
JCBlock body = make.Block(0, List.of(indexDef, tree.body));
body.endpos = TreeInfo.endPos(tree.body);
- init = translate(init);
result = translate(make.
- ForLoop(List.nil(),
+ ForLoop(List.of(init),
cond,
List.nil(),
body));
patchTargets(body, tree, result);
- JCStatement nullAssignToIterator = make.Assignment(itvar, make.Literal(BOT, null).setType(syms.botType));
- result = make.Block(0, List.of(init, (JCStatement)result, nullAssignToIterator));
}
public void visitVarDef(JCVariableDecl tree) {
diff --git a/test/langtools/tools/javac/T8192885/AddGotoAfterForLoopToLNTTest.java b/test/langtools/tools/javac/T8192885/AddGotoAfterForLoopToLNTTest.java
deleted file mode 100644
index 5d5df2c4ff4..00000000000
--- a/test/langtools/tools/javac/T8192885/AddGotoAfterForLoopToLNTTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2017, 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.
- */
-
-/*
- * @test
- * @bug 8192885
- * @summary Compiler in JDK 10-ea+33 misses to include entry in LineNumberTable for goto instruction of foreach loop
- * @library /tools/lib
- * @modules jdk.jdeps/com.sun.tools.classfile
- * jdk.compiler/com.sun.tools.javac.api
- * jdk.compiler/com.sun.tools.javac.main
- * jdk.compiler/com.sun.tools.javac.util
- * jdk.jdeps/com.sun.tools.javap
- * @build toolbox.ToolBox toolbox.JavacTask
- * @run main AddGotoAfterForLoopToLNTTest
- */
-
-import java.io.File;
-import java.nio.file.Paths;
-
-import com.sun.tools.classfile.ClassFile;
-import com.sun.tools.classfile.Code_attribute;
-import com.sun.tools.classfile.LineNumberTable_attribute;
-import com.sun.tools.classfile.Method;
-import com.sun.tools.javac.util.Assert;
-
-import toolbox.JavacTask;
-import toolbox.ToolBox;
-
-public class AddGotoAfterForLoopToLNTTest {
-
- static final String testSource =
- /* 01 */ "class GotoAtEnhancedForTest {\n" +
- /* 02 */ " void lookForThisMethod() {\n" +
- /* 03 */ " for (Object o : java.util.Collections.emptyList()) {\n" +
- /* 04 */ " }\n" +
- /* 05 */ " }\n" +
- /* 06 */ "}";
-
- static final int[][] expectedLNT = {
- // {line-number, start-pc},
- {3, 0},
- {4, 25},
- {3, 28},
- {5, 30},
- };
-
- static final String methodToLookFor = "lookForThisMethod";
-
- public static void main(String[] args) throws Exception {
- new AddGotoAfterForLoopToLNTTest().run();
- }
-
- ToolBox tb = new ToolBox();
-
- void run() throws Exception {
- compileTestClass();
- checkClassFile(new File(Paths.get(System.getProperty("user.dir"),
- "GotoAtEnhancedForTest.class").toUri()), methodToLookFor);
- }
-
- void compileTestClass() throws Exception {
- new JavacTask(tb)
- .sources(testSource)
- .run();
- }
-
- void checkClassFile(final File cfile, String methodToFind) throws Exception {
- ClassFile classFile = ClassFile.read(cfile);
- boolean methodFound = false;
- for (Method method : classFile.methods) {
- if (method.getName(classFile.constant_pool).equals(methodToFind)) {
- methodFound = true;
- Code_attribute code = (Code_attribute) method.attributes.get("Code");
- LineNumberTable_attribute lnt =
- (LineNumberTable_attribute) code.attributes.get("LineNumberTable");
- Assert.check(lnt.line_number_table_length == expectedLNT.length,
- "The LineNumberTable found has a length different to the expected one");
- int i = 0;
- for (LineNumberTable_attribute.Entry entry: lnt.line_number_table) {
- Assert.check(entry.line_number == expectedLNT[i][0] &&
- entry.start_pc == expectedLNT[i][1],
- "LNT entry at pos " + i + " differ from expected." +
- "Found " + entry.line_number + ":" + entry.start_pc +
- ". Expected " + expectedLNT[i][0] + ":" + expectedLNT[i][1]);
- i++;
- }
- }
- }
- Assert.check(methodFound, "The seek method was not found");
- }
-
- void error(String msg) {
- throw new AssertionError(msg);
- }
-}
diff --git a/test/langtools/tools/javac/flow/tests/TestCaseForEach.java b/test/langtools/tools/javac/flow/tests/TestCaseForEach.java
index 978ae3fbb7e..30b0c131122 100644
--- a/test/langtools/tools/javac/flow/tests/TestCaseForEach.java
+++ b/test/langtools/tools/javac/flow/tests/TestCaseForEach.java
@@ -3,7 +3,7 @@
public class TestCaseForEach {
@AliveRange(varName="o", bytecodeStart=25, bytecodeLength=11)
- @AliveRange(varName="o", bytecodeStart=41, bytecodeLength=1)
+ @AliveRange(varName="o", bytecodeStart=39, bytecodeLength=1)
void m(String[] args) {
Object o;
for (String s : args) {
From 1f86051d096e337069c5097cfa2d1eb12b87238d Mon Sep 17 00:00:00 2001
From: thartmann
Date: Wed, 10 Jan 2018 09:04:11 +0100
Subject: [PATCH 22/29] 8191362: [Graal] gc/g1/TestShrinkAuxiliaryData tests
crash with "assert(check_klass_alignment(result)) failed: address not
aligned" Summary: Graal does not respect ObjectAlignmentInBytes VM option.
Reviewed-by: kvn
---
.../ci/hotspot/HotSpotMetaAccessProvider.java | 11 +++++-----
.../jdk/vm/ci/hotspot/HotSpotVMConfig.java | 2 ++
.../replacements/HotSpotReplacementsUtil.java | 22 +++++++++++++++++++
.../replacements/NewObjectSnippets.java | 6 ++---
.../compiler/hotspot/stubs/NewArrayStub.java | 5 ++---
5 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java
index 6a3a38b7ca2..32555f6d40c 100644
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java
@@ -34,7 +34,6 @@
import java.util.Objects;
import jdk.vm.ci.code.CodeUtil;
-import jdk.vm.ci.code.TargetDescription;
import jdk.vm.ci.common.JVMCIError;
import jdk.vm.ci.meta.DeoptimizationAction;
import jdk.vm.ci.meta.DeoptimizationReason;
@@ -284,11 +283,9 @@ public long getMemorySize(JavaConstant constant) {
ResolvedJavaType elementType = lookupJavaType.getComponentType();
JavaKind elementKind = elementType.getJavaKind();
final int headerSize = getArrayBaseOffset(elementKind);
- TargetDescription target = runtime.getHostJVMCIBackend().getTarget();
int sizeOfElement = getArrayIndexScale(elementKind);
- int alignment = target.wordSize;
int log2ElementSize = CodeUtil.log2(sizeOfElement);
- return computeArrayAllocationSize(length, alignment, headerSize, log2ElementSize);
+ return computeArrayAllocationSize(length, headerSize, log2ElementSize);
}
return lookupJavaType.instanceSize();
}
@@ -303,11 +300,13 @@ public long getMemorySize(JavaConstant constant) {
* alignment requirements.
*
* @param length the number of elements in the array
- * @param alignment the object alignment requirement
* @param headerSize the size of the array header
* @param log2ElementSize log2 of the size of an element in the array
+ * @return the size of the memory chunk
*/
- public static int computeArrayAllocationSize(int length, int alignment, int headerSize, int log2ElementSize) {
+ public int computeArrayAllocationSize(int length, int headerSize, int log2ElementSize) {
+ HotSpotVMConfig config = runtime.getConfig();
+ int alignment = config.objectAlignment;
int size = (length << log2ElementSize) + headerSize + (alignment - 1);
int mask = ~(alignment - 1);
return size & mask;
diff --git a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
index 640422e8605..499ee16df36 100644
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java
@@ -68,6 +68,8 @@ String getHostArchitectureName() {
final boolean useCompressedOops = getFlag("UseCompressedOops", Boolean.class);
+ final int objectAlignment = getFlag("ObjectAlignmentInBytes", Integer.class);
+
final int prototypeMarkWordOffset = getFieldOffset("Klass::_prototype_header", Integer.class, "markOop");
final int subklassOffset = getFieldOffset("Klass::_subklass", Integer.class, "Klass*");
final int nextSiblingOffset = getFieldOffset("Klass::_next_sibling", Integer.class, "Klass*");
diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java
index 0966cf6f1de..299abdfafa5 100644
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java
@@ -565,6 +565,28 @@ public static Word arrayStart(int[] a) {
return WordFactory.unsigned(ComputeObjectAddressNode.get(a, getArrayBaseOffset(JavaKind.Int)));
}
+ @Fold
+ public static int objectAlignment(@InjectedParameter GraalHotSpotVMConfig config) {
+ return config.objectAlignment;
+ }
+
+ /**
+ * Computes the size of the memory chunk allocated for an array. This size accounts for the
+ * array header size, body size and any padding after the last element to satisfy object
+ * alignment requirements.
+ *
+ * @param length the number of elements in the array
+ * @param headerSize the size of the array header
+ * @param log2ElementSize log2 of the size of an element in the array
+ * @return the size of the memory chunk
+ */
+ public static int arrayAllocationSize(int length, int headerSize, int log2ElementSize) {
+ int alignment = objectAlignment(INJECTED_VMCONFIG);
+ int size = (length << log2ElementSize) + headerSize + (alignment - 1);
+ int mask = ~(alignment - 1);
+ return size & mask;
+ }
+
@Fold
public static int instanceHeaderSize(@InjectedParameter GraalHotSpotVMConfig config) {
return config.useCompressedClassPointers ? (2 * wordSize()) - 4 : 2 * wordSize();
diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java
index b5d78318876..67f8c0cfb18 100644
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java
@@ -23,7 +23,6 @@
package org.graalvm.compiler.hotspot.replacements;
import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset;
-import static jdk.vm.ci.hotspot.HotSpotMetaAccessProvider.computeArrayAllocationSize;
import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
import static org.graalvm.compiler.core.common.calc.UnsignedMath.belowThan;
import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG;
@@ -33,6 +32,7 @@
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.PROTOTYPE_MARK_WORD_LOCATION;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.TLAB_END_LOCATION;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.TLAB_TOP_LOCATION;
+import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayAllocationSize;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayKlassOffset;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayLengthOffset;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.config;
@@ -52,7 +52,6 @@
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useBiasedLocking;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useTLAB;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.verifyOop;
-import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.wordSize;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.writeTlabTop;
import static org.graalvm.compiler.hotspot.replacements.HotspotSnippetsOptions.ProfileAllocations;
import static org.graalvm.compiler.hotspot.replacements.HotspotSnippetsOptions.ProfileAllocationsContext;
@@ -315,8 +314,7 @@ public static Object allocateArray(KlassPointer hub, int length, Word prototypeM
private static Object allocateArrayImpl(KlassPointer hub, int length, Word prototypeMarkWord, int headerSize, int log2ElementSize, boolean fillContents, Register threadRegister,
boolean maybeUnroll, String typeContext, boolean skipNegativeCheck, OptionValues options, Counters counters) {
Object result;
- int alignment = wordSize();
- int allocationSize = computeArrayAllocationSize(length, alignment, headerSize, log2ElementSize);
+ int allocationSize = arrayAllocationSize(length, headerSize, log2ElementSize);
Word thread = registerAsWord(threadRegister);
Word top = readTlabTop(thread);
Word end = readTlabEnd(thread);
diff --git a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java
index b5cbb0e5585..fc1d26262ba 100644
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java
@@ -23,6 +23,7 @@
package org.graalvm.compiler.hotspot.stubs;
import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG;
+import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayAllocationSize;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayPrototypeMarkWord;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getAndClearObjectResult;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.layoutHelperElementTypeMask;
@@ -34,7 +35,6 @@
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readLayoutHelper;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.registerAsWord;
import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useCMSIncrementalMode;
-import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.wordSize;
import static org.graalvm.compiler.hotspot.replacements.NewObjectSnippets.MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH;
import static org.graalvm.compiler.hotspot.replacements.NewObjectSnippets.formatArray;
import static org.graalvm.compiler.hotspot.stubs.NewInstanceStub.refillAllocate;
@@ -42,7 +42,6 @@
import static org.graalvm.compiler.hotspot.stubs.StubUtil.newDescriptor;
import static org.graalvm.compiler.hotspot.stubs.StubUtil.printf;
import static org.graalvm.compiler.hotspot.stubs.StubUtil.verifyObject;
-import static jdk.vm.ci.hotspot.HotSpotMetaAccessProvider.computeArrayAllocationSize;
import org.graalvm.compiler.api.replacements.Fold;
import org.graalvm.compiler.api.replacements.Snippet;
@@ -112,7 +111,7 @@ private static Object newArray(KlassPointer hub, int length, boolean fillContent
int log2ElementSize = (layoutHelper >> layoutHelperLog2ElementSizeShift(INJECTED_VMCONFIG)) & layoutHelperLog2ElementSizeMask(INJECTED_VMCONFIG);
int headerSize = (layoutHelper >> layoutHelperHeaderSizeShift(INJECTED_VMCONFIG)) & layoutHelperHeaderSizeMask(INJECTED_VMCONFIG);
int elementKind = (layoutHelper >> layoutHelperElementTypeShift(INJECTED_VMCONFIG)) & layoutHelperElementTypeMask(INJECTED_VMCONFIG);
- int sizeInBytes = computeArrayAllocationSize(length, wordSize(), headerSize, log2ElementSize);
+ int sizeInBytes = arrayAllocationSize(length, headerSize, log2ElementSize);
if (logging(options)) {
printf("newArray: element kind %d\n", elementKind);
printf("newArray: array length %d\n", length);
From 40a285f88c0cd1a52300ddca6b8e2479723399db Mon Sep 17 00:00:00 2001
From: tschatzl
Date: Wed, 10 Jan 2018 10:21:25 +0100
Subject: [PATCH 23/29] 8194824: Add
gc/stress/gclocker/TestGCLockerWithParallel.java to the ProblemList file
Reviewed-by: ehelin, kbarrett
---
test/hotspot/jtreg/ProblemList.txt | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt
index 28dde210a6f..8b226061672 100644
--- a/test/hotspot/jtreg/ProblemList.txt
+++ b/test/hotspot/jtreg/ProblemList.txt
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2016, 2018, 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
@@ -67,6 +67,7 @@ gc/survivorAlignment/TestPromotionToSurvivor.java 8129886 generic-all
gc/g1/logging/TestG1LoggingFailure.java 8169634 generic-all
gc/g1/humongousObjects/TestHeapCounters.java 8178918 generic-all
gc/g1/TestVerifyGCType.java 8193067 generic-all
+gc/stress/gclocker/TestGCLockerWithParallel.java 8180622 generic-all
gc/stress/gclocker/TestGCLockerWithG1.java 8179226 generic-all
gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java 8177765 generic-all
From a4590fa977ef492bc786a483b6a67638f73120a5 Mon Sep 17 00:00:00 2001
From: mdoerr
Date: Wed, 10 Jan 2018 11:09:55 +0100
Subject: [PATCH 24/29] 8194258: PPC64 safepoint mechanism: Fix initialization
on AIX and support SIGTRAP Summary: Use mmap on AIX to allocate protected
page. Use trap instructions for polling if UseSIGTRAP is enabled.
Reviewed-by: rehn, goetz
---
src/hotspot/cpu/ppc/globalDefinitions_ppc.hpp | 4 ++
.../cpu/ppc/macroAssembler_ppc.inline.hpp | 8 +++-
src/hotspot/cpu/ppc/nativeInst_ppc.hpp | 6 +++
src/hotspot/os/aix/safepointMechanism_aix.cpp | 33 +++++++++++----
src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp | 8 +++-
src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp | 6 ++-
.../share/runtime/safepointMechanism.cpp | 42 +++++++++++++------
.../runtime/logging/OsCpuLoggingTest.java | 10 ++---
8 files changed, 87 insertions(+), 30 deletions(-)
diff --git a/src/hotspot/cpu/ppc/globalDefinitions_ppc.hpp b/src/hotspot/cpu/ppc/globalDefinitions_ppc.hpp
index 8725ee979fa..404ea99301b 100644
--- a/src/hotspot/cpu/ppc/globalDefinitions_ppc.hpp
+++ b/src/hotspot/cpu/ppc/globalDefinitions_ppc.hpp
@@ -55,5 +55,9 @@ const bool CCallingConventionRequiresIntsAsLongs = true;
#define SUPPORT_RESERVED_STACK_AREA
#define THREAD_LOCAL_POLL
+// If UseSIGTRAP is active, we only use the poll bit and no polling page.
+// Otherwise, we fall back to usage of the polling page in nmethods.
+// Define the condition to use this -XX flag.
+#define USE_POLL_BIT_ONLY UseSIGTRAP
#endif // CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP
diff --git a/src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp b/src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp
index a15f07528b6..0150cedada0 100644
--- a/src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp
+++ b/src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp
@@ -30,6 +30,7 @@
#include "asm/macroAssembler.hpp"
#include "asm/codeBuffer.hpp"
#include "code/codeCache.hpp"
+#include "runtime/safepointMechanism.hpp"
inline bool MacroAssembler::is_ld_largeoffset(address a) {
const int inst1 = *(int *)a;
@@ -261,7 +262,12 @@ inline address MacroAssembler::last_calls_return_pc() {
// Read from the polling page, its address is already in a register.
inline void MacroAssembler::load_from_polling_page(Register polling_page_address, int offset) {
- ld(R0, offset, polling_page_address);
+ if (SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) {
+ int encoding = SafepointMechanism::poll_bit();
+ tdi(traptoGreaterThanUnsigned | traptoEqual, polling_page_address, encoding);
+ } else {
+ ld(R0, offset, polling_page_address);
+ }
}
// Trap-instruction-based checks.
diff --git a/src/hotspot/cpu/ppc/nativeInst_ppc.hpp b/src/hotspot/cpu/ppc/nativeInst_ppc.hpp
index 99aa11c4b20..8fbd5b4198c 100644
--- a/src/hotspot/cpu/ppc/nativeInst_ppc.hpp
+++ b/src/hotspot/cpu/ppc/nativeInst_ppc.hpp
@@ -31,6 +31,7 @@
#include "memory/allocation.hpp"
#include "runtime/icache.hpp"
#include "runtime/os.hpp"
+#include "runtime/safepointMechanism.hpp"
// We have interfaces for the following instructions:
//
@@ -93,6 +94,11 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC {
bool is_safepoint_poll() {
// Is the current instruction a POTENTIAL read access to the polling page?
// The current arguments of the instruction are not checked!
+ if (SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) {
+ int encoding = SafepointMechanism::poll_bit();
+ return MacroAssembler::is_tdi(long_at(0), Assembler::traptoGreaterThanUnsigned | Assembler::traptoEqual,
+ -1, encoding);
+ }
return MacroAssembler::is_load_from_polling_page(long_at(0), NULL);
}
diff --git a/src/hotspot/os/aix/safepointMechanism_aix.cpp b/src/hotspot/os/aix/safepointMechanism_aix.cpp
index 8b6eec89900..3bc79d12cd7 100644
--- a/src/hotspot/os/aix/safepointMechanism_aix.cpp
+++ b/src/hotspot/os/aix/safepointMechanism_aix.cpp
@@ -30,8 +30,18 @@
#include
void SafepointMechanism::pd_initialize() {
+ // No special code needed if we can use SIGTRAP
+ if (ThreadLocalHandshakes && USE_POLL_BIT_ONLY) {
+ default_initialize();
+ return;
+ }
+
+ // Allocate one protected page
char* map_address = (char*)MAP_FAILED;
const size_t page_size = os::vm_page_size();
+ const int prot = PROT_READ;
+ const int flags = MAP_PRIVATE | MAP_ANONYMOUS;
+
// Use optimized addresses for the polling page,
// e.g. map it to a special 32-bit address.
if (OptimizePollingPageLocation) {
@@ -57,14 +67,14 @@ void SafepointMechanism::pd_initialize() {
// Try to map with current address wish.
// AIX: AIX needs MAP_FIXED if we provide an address and mmap will
// fail if the address is already mapped.
- map_address = (char*) ::mmap(address_wishes[i] - (ssize_t)page_size,
- page_size, PROT_READ,
- MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED,
+ map_address = (char*) ::mmap(address_wishes[i],
+ page_size, prot,
+ flags | MAP_FIXED,
-1, 0);
- log_debug(os)("SafePoint Polling Page address: %p (wish) => %p",
- address_wishes[i], map_address + (ssize_t)page_size);
+ log_debug(os)("SafePoint Polling Page address: %p (wish) => %p",
+ address_wishes[i], map_address);
- if (map_address + (ssize_t)page_size == address_wishes[i]) {
+ if (map_address == address_wishes[i]) {
// Map succeeded and map_address is at wished address, exit loop.
break;
}
@@ -78,8 +88,17 @@ void SafepointMechanism::pd_initialize() {
}
}
if (map_address == (char*)MAP_FAILED) {
- map_address = os::reserve_memory(page_size, NULL, page_size);
+ map_address = (char*) ::mmap(NULL, page_size, prot, flags, -1, 0);
}
guarantee(map_address != (char*)MAP_FAILED, "SafepointMechanism::pd_initialize: failed to allocate polling page");
+ log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(map_address));
os::set_polling_page((address)(map_address));
+
+ // Use same page for ThreadLocalHandshakes without SIGTRAP
+ if (ThreadLocalHandshakes) {
+ set_uses_thread_local_poll();
+ intptr_t bad_page_val = reinterpret_cast(map_address);
+ _poll_armed_value = reinterpret_cast(bad_page_val | poll_bit());
+ _poll_disarmed_value = NULL; // Readable on AIX
+ }
}
diff --git a/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp b/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
index 992285069c3..3ab86a8f789 100644
--- a/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
+++ b/src/hotspot/os_cpu/aix_ppc/os_aix_ppc.cpp
@@ -47,6 +47,7 @@
#include "runtime/javaCalls.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/osThread.hpp"
+#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.inline.hpp"
@@ -374,9 +375,12 @@ JVM_handle_aix_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrec
goto run_stub;
}
- else if (sig == SIGSEGV && os::is_poll_address(addr)) {
+ else if ((SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY)
+ ? (sig == SIGTRAP && ((NativeInstruction*)pc)->is_safepoint_poll())
+ : (sig == SIGSEGV && os::is_poll_address(addr))) {
if (TraceTraps) {
- tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", pc);
+ tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (%s)", p2i(pc),
+ (SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) ? "SIGTRAP" : "SIGSEGV");
}
stub = SharedRuntime::get_poll_stub(pc);
goto run_stub;
diff --git a/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp b/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
index 80ed5bd8e1f..f80d477bccc 100644
--- a/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
+++ b/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp
@@ -46,6 +46,7 @@
#include "runtime/javaCalls.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/osThread.hpp"
+#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/thread.inline.hpp"
@@ -382,7 +383,7 @@ JVM_handle_linux_signal(int sig,
stub = SharedRuntime::get_handle_wrong_method_stub();
}
- else if (sig == SIGSEGV &&
+ else if (sig == ((SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) ? SIGTRAP : SIGSEGV) &&
// A linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults
// in 64bit mode (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6),
// especially when we try to read from the safepoint polling page. So the check
@@ -393,7 +394,8 @@ JVM_handle_linux_signal(int sig,
((cb = CodeCache::find_blob(pc)) != NULL) &&
cb->is_compiled()) {
if (TraceTraps) {
- tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (SIGSEGV)", p2i(pc));
+ tty->print_cr("trap: safepoint_poll at " INTPTR_FORMAT " (%s)", p2i(pc),
+ (SafepointMechanism::uses_thread_local_poll() && USE_POLL_BIT_ONLY) ? "SIGTRAP" : "SIGSEGV");
}
stub = SharedRuntime::get_poll_stub(pc);
}
diff --git a/src/hotspot/share/runtime/safepointMechanism.cpp b/src/hotspot/share/runtime/safepointMechanism.cpp
index d5a19744f22..d229b60bffd 100644
--- a/src/hotspot/share/runtime/safepointMechanism.cpp
+++ b/src/hotspot/share/runtime/safepointMechanism.cpp
@@ -36,23 +36,39 @@ void* SafepointMechanism::_poll_disarmed_value;
void SafepointMechanism::default_initialize() {
if (ThreadLocalHandshakes) {
set_uses_thread_local_poll();
- const size_t page_size = os::vm_page_size();
- const size_t allocation_size = 2 * page_size;
- char* polling_page = os::reserve_memory(allocation_size, NULL, page_size);
- os::commit_memory_or_exit(polling_page, allocation_size, false, "Unable to commit Safepoint polling page");
- char* bad_page = polling_page;
- char* good_page = polling_page + page_size;
+ // Poll bit values
+ intptr_t poll_armed_value = poll_bit();
+ intptr_t poll_disarmed_value = 0;
+
+#ifdef USE_POLL_BIT_ONLY
+ if (!USE_POLL_BIT_ONLY)
+#endif
+ {
+ // Polling page
+ const size_t page_size = os::vm_page_size();
+ const size_t allocation_size = 2 * page_size;
+ char* polling_page = os::reserve_memory(allocation_size, NULL, page_size);
+ os::commit_memory_or_exit(polling_page, allocation_size, false, "Unable to commit Safepoint polling page");
+
+ char* bad_page = polling_page;
+ char* good_page = polling_page + page_size;
+
+ os::protect_memory(bad_page, page_size, os::MEM_PROT_NONE);
+ os::protect_memory(good_page, page_size, os::MEM_PROT_READ);
- os::protect_memory(bad_page, page_size, os::MEM_PROT_NONE);
- os::protect_memory(good_page, page_size, os::MEM_PROT_READ);
+ log_info(os)("SafePoint Polling address, bad (protected) page:" INTPTR_FORMAT ", good (unprotected) page:" INTPTR_FORMAT, p2i(bad_page), p2i(good_page));
+ os::set_polling_page((address)(bad_page));
- log_info(os)("SafePoint Polling address, bad (protected) page:" INTPTR_FORMAT ", good (unprotected) page:" INTPTR_FORMAT, p2i(bad_page), p2i(good_page));
- os::set_polling_page((address)(bad_page));
+ // Poll address values
+ intptr_t bad_page_val = reinterpret_cast(bad_page),
+ good_page_val = reinterpret_cast(good_page);
+ poll_armed_value |= bad_page_val;
+ poll_disarmed_value |= good_page_val;
+ }
- intptr_t poll_page_val = reinterpret_cast(bad_page);
- _poll_armed_value = reinterpret_cast(poll_page_val | poll_bit());
- _poll_disarmed_value = good_page;
+ _poll_armed_value = reinterpret_cast(poll_armed_value);
+ _poll_disarmed_value = reinterpret_cast(poll_disarmed_value);
} else {
const size_t page_size = os::vm_page_size();
char* polling_page = os::reserve_memory(page_size, NULL, page_size);
diff --git a/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java b/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java
index 3a29b66e3c0..5190cf26927 100644
--- a/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java
+++ b/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java
@@ -40,10 +40,7 @@
public class OsCpuLoggingTest {
static void analyzeOutputForOsLog(OutputAnalyzer output) throws Exception {
- // Aix has it's own logging
- if (!Platform.isAix()) {
- output.shouldContain("SafePoint Polling address");
- }
+ output.shouldContain("SafePoint Polling address");
output.shouldHaveExitValue(0);
}
@@ -58,7 +55,10 @@ public static void main(String[] args) throws Exception {
OutputAnalyzer output = new OutputAnalyzer(pb.start());
analyzeOutputForOsCpuLog(output);
- pb = ProcessTools.createJavaProcessBuilder("-Xlog:os", "-version");
+ // PPC64 only uses polling pages when UseSIGTRAP is off.
+ pb = (Platform.isPPC() && Platform.is64bit())
+ ? ProcessTools.createJavaProcessBuilder("-Xlog:os", "-XX:-UseSIGTRAP", "-version")
+ : ProcessTools.createJavaProcessBuilder("-Xlog:os", "-version");
output = new OutputAnalyzer(pb.start());
analyzeOutputForOsLog(output);
}
From 79d779922d5cef67212732d0932692aeaea385fb Mon Sep 17 00:00:00 2001
From: rraghavan
Date: Wed, 10 Jan 2018 02:31:25 -0800
Subject: [PATCH 25/29] 8193607: Test failure with
java.lang.ClassNotFoundException: compiler.tiered.LevelTransitionTest
Summary: Added compiler.tiered.LevelTransitionTest to @build Reviewed-by:
thartmann Contributed-by: ramkumar.sunderbabu@oracle.com
---
test/hotspot/jtreg/compiler/tiered/LevelTransitionTest.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/hotspot/jtreg/compiler/tiered/LevelTransitionTest.java b/test/hotspot/jtreg/compiler/tiered/LevelTransitionTest.java
index ea6a7599e93..3dc10938e94 100644
--- a/test/hotspot/jtreg/compiler/tiered/LevelTransitionTest.java
+++ b/test/hotspot/jtreg/compiler/tiered/LevelTransitionTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, 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
@@ -29,6 +29,7 @@
* java.management
*
* @build sun.hotspot.WhiteBox
+ * compiler.tiered.LevelTransitionTest
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm/timeout=240 -Xmixed -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
From 56f3eb1c5e16edfed0c6b115180c88c30b02c5d5 Mon Sep 17 00:00:00 2001
From: lkorinth
Date: Tue, 9 Jan 2018 10:27:12 +0100
Subject: [PATCH 26/29] 8194681: G1 uses young free cset time when reporting
non-young free cset times Reviewed-by: tschatzl, kbarrett
---
src/hotspot/share/gc/g1/g1CollectedHeap.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
index 7245bf55388..3fbaa30250b 100644
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2018, 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
@@ -4786,7 +4786,7 @@ class G1FreeCollectionSetTask : public AbstractGangTask {
timer->record_time_secs(G1GCPhaseTimes::YoungFreeCSet, worker_id, young_time);
}
if (has_non_young_time) {
- timer->record_time_secs(G1GCPhaseTimes::NonYoungFreeCSet, worker_id, young_time);
+ timer->record_time_secs(G1GCPhaseTimes::NonYoungFreeCSet, worker_id, non_young_time);
}
}
};
From 7139f6af22845bc46f228feab31901fa16e4037d Mon Sep 17 00:00:00 2001
From: serb
Date: Wed, 10 Jan 2018 07:21:33 -0800
Subject: [PATCH 27/29] 8193673: Regression manual Test
javax/swing/JFileChooser/6515169/bug6515169.java fails Reviewed-by: erikj,
psadhukhan
---
make/gensrc/Gensrc-java.desktop.gmk | 8 +-
.../UIManager/8193673/TestProperties.java | 103 ++++++++++++++++++
2 files changed, 108 insertions(+), 3 deletions(-)
create mode 100644 test/jdk/javax/swing/UIManager/8193673/TestProperties.java
diff --git a/make/gensrc/Gensrc-java.desktop.gmk b/make/gensrc/Gensrc-java.desktop.gmk
index f58c4379663..ae6cb3e9811 100644
--- a/make/gensrc/Gensrc-java.desktop.gmk
+++ b/make/gensrc/Gensrc-java.desktop.gmk
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2018, 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
@@ -46,7 +46,6 @@ PROP_SRC_DIRS := \
$(TOPDIR)/src/java.desktop/share/classes/sun/awt/resources \
$(TOPDIR)/src/java.desktop/share/classes/com/sun/accessibility/internal/resources \
$(TOPDIR)/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/resources \
- $(TOPDIR)/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/resources \
$(TOPDIR)/src/java.desktop/share/classes/com/sun/swing/internal/plaf/basic/resources \
$(TOPDIR)/src/java.desktop/share/classes/com/sun/swing/internal/plaf/metal/resources \
$(TOPDIR)/src/java.desktop/share/classes/com/sun/swing/internal/plaf/synth/resources \
@@ -61,7 +60,10 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
endif
ifeq ($(OPENJDK_TARGET_OS), windows)
- PROP_SRC_DIRS += $(TOPDIR)/src/java.desktop/windows/classes/sun/awt/windows
+ PROP_SRC_DIRS += \
+ $(TOPDIR)/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/resources \
+ $(TOPDIR)/src/java.desktop/windows/classes/sun/awt/windows \
+ #
endif
ifeq ($(filter $(OPENJDK_TARGET_OS), windows macosx), )
diff --git a/test/jdk/javax/swing/UIManager/8193673/TestProperties.java b/test/jdk/javax/swing/UIManager/8193673/TestProperties.java
new file mode 100644
index 00000000000..d3611671e5a
--- /dev/null
+++ b/test/jdk/javax/swing/UIManager/8193673/TestProperties.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2018, 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 javax.swing.UIManager;
+import javax.swing.plaf.metal.MetalLookAndFeel;
+import javax.swing.plaf.nimbus.NimbusLookAndFeel;
+
+/**
+ * @test
+ * @bug 8193673
+ * @summary The test verifies that l&f specific properties are accessible
+ */
+public final class TestProperties {
+
+ private static final String[] windowsProperties = {
+ "FileChooser.viewMenuButtonToolTipText",
+ "FileChooser.viewMenuButtonAccessibleName",
+ };
+
+ private static final String[] aquaProperties = {
+ "FileChooser.mac.newFolder",
+ };
+
+ private static final String[] gtkProperties = {
+ "FileChooser.renameFileDialogText",
+ };
+
+ private static final String[] motifProperties = {
+ "FileChooser.enterFolderNameLabel.textAndMnemonic",
+ };
+
+ private static final String[] nimbusProperties = {
+ "FileChooser.refreshActionLabelText",
+ };
+
+ private static final String[] metalProperties = {
+ "MetalTitlePane.iconify.titleAndMnemonic",
+ };
+
+ public static void main(final String[] args) throws Exception {
+ UIManager.setLookAndFeel(new MetalLookAndFeel());
+ test(metalProperties);
+
+ UIManager.setLookAndFeel(new NimbusLookAndFeel());
+ test(nimbusProperties);
+
+ UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
+ test(motifProperties);
+
+ try {
+ UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
+ test(windowsProperties);
+ } catch (Exception e) {
+ // ignore
+ }
+
+ try {
+ UIManager.setLookAndFeel("com.apple.laf.AquaLookAndFeel");
+ test(aquaProperties);
+ } catch (Exception e) {
+ // ignore
+ }
+
+ try {
+ UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
+ test(gtkProperties);
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+
+ private static void test(final String[] properties) {
+ for (final String name : properties) {
+ String value = UIManager.getString(name);
+ if (value == null) {
+ System.err.println("Current LookAndFeel = "
+ + UIManager.getLookAndFeel().getDescription());
+ System.err.printf("The value for %s property is null\n", name);
+ throw new Error();
+ }
+ }
+ }
+}
From 9faca2d1e389a1b3485583e37901ae6e8c099432 Mon Sep 17 00:00:00 2001
From: jjg
Date: Wed, 10 Jan 2018 15:05:33 -0800
Subject: [PATCH 28/29] 8194901: remove interim code from
javax.tools.ToolProvider Reviewed-by: mchung
---
.../classes/javax/tools/ToolProvider.java | 43 +++----------------
1 file changed, 7 insertions(+), 36 deletions(-)
diff --git a/src/java.compiler/share/classes/javax/tools/ToolProvider.java b/src/java.compiler/share/classes/javax/tools/ToolProvider.java
index 1c7d0455a1e..5630d829748 100644
--- a/src/java.compiler/share/classes/javax/tools/ToolProvider.java
+++ b/src/java.compiler/share/classes/javax/tools/ToolProvider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2018, 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,8 +25,6 @@
package javax.tools;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Iterator;
@@ -101,17 +99,6 @@ public static ClassLoader getSystemToolClassLoader() {
return null;
}
- private static final boolean useLegacy;
-
- static {
- Class> c = null;
- try {
- c = Class.forName("java.lang.Module");
- } catch (Throwable t) {
- }
- useLegacy = (c == null);
- }
-
/**
* Get an instance of a system tool using the service loader.
* @implNote By default, this returns the implementation in the specified module.
@@ -126,14 +113,6 @@ public static ClassLoader getSystemToolClassLoader() {
* @return the specified implementation of the tool
*/
private static T getSystemTool(Class clazz, String moduleName, String className) {
- if (useLegacy) {
- try {
- return Class.forName(className, true, ClassLoader.getSystemClassLoader()).
- asSubclass(clazz).getConstructor().newInstance();
- } catch (ReflectiveOperationException e) {
- throw new Error(e);
- }
- }
try {
ServiceLoader sl = ServiceLoader.load(clazz, ClassLoader.getSystemClassLoader());
@@ -150,24 +129,16 @@ private static T getSystemTool(Class clazz, String moduleName, String cla
/**
* Determine if this is the desired tool instance.
- * @param the interface of the tool
- * @param tool the instance of the tool
- * @param moduleName the name of the module containing the desired implementation
+ * @param the interface of the tool
+ * @param tool the instance of the tool
+ * @param moduleName the name of the module containing the desired implementation
* @return true if and only if the tool matches the specified criteria
*/
private static boolean matches(T tool, String moduleName) {
PrivilegedAction pa = () -> {
- // for now, use reflection to implement
- // return moduleName.equals(tool.getClass().getModule().getName());
- try {
- Method getModuleMethod = Class.class.getDeclaredMethod("getModule");
- Object toolModule = getModuleMethod.invoke(tool.getClass());
- Method getNameMethod = toolModule.getClass().getDeclaredMethod("getName");
- String toolModuleName = (String) getNameMethod.invoke(toolModule);
- return moduleName.equals(toolModuleName);
- } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
- return false;
- }
+ Module toolModule = tool.getClass().getModule();
+ String toolModuleName = toolModule.getName();
+ return toolModuleName.equals(moduleName);
};
return AccessController.doPrivileged(pa);
}
From a7c02ecb6e5c1f9f9958ec6393cf9d960d6089f7 Mon Sep 17 00:00:00 2001
From: vromero
Date: Wed, 10 Jan 2018 22:52:08 -0500
Subject: [PATCH 29/29] 8187805: bogus RuntimeVisibleTypeAnnotations for unused
local in a block Reviewed-by: sadayapalam
---
.../javac/code/TypeAnnotationPosition.java | 3 +-
.../classes/com/sun/tools/javac/jvm/Code.java | 18 ++--
.../T8187805/BogusRTTAForUnusedVarTest.java | 88 +++++++++++++++++++
3 files changed, 101 insertions(+), 8 deletions(-)
create mode 100644 test/langtools/tools/javac/T8187805/BogusRTTAForUnusedVarTest.java
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
index 6e4cd02e0ae..ff6e264b926 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2018, 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
@@ -312,6 +312,7 @@ public void setExceptionIndex(final int exception_index) {
Assert.check(!hasExceptionIndex(), "exception_index already set");
Assert.check(exception_index >= 0, "Expected a valid index into exception table");
this.exception_index = exception_index;
+ this.isValidOffset = true;
}
public boolean hasCatchType() {
diff --git a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java
index 281fd77b734..fb21dcba9c7 100644
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, 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
@@ -2100,15 +2100,19 @@ private void endScope(int adr) {
}
private void fillLocalVarPosition(LocalVar lv) {
- if (lv == null || lv.sym == null || !lv.sym.hasTypeAnnotations())
+ if (lv == null || lv.sym == null || lv.sym.isExceptionParameter()|| !lv.sym.hasTypeAnnotations())
return;
+ LocalVar.Range widestRange = lv.getWidestRange();
for (Attribute.TypeCompound ta : lv.sym.getRawTypeAttributes()) {
TypeAnnotationPosition p = ta.position;
- LocalVar.Range widestRange = lv.getWidestRange();
- p.lvarOffset = new int[] { (int)widestRange.start_pc };
- p.lvarLength = new int[] { (int)widestRange.length };
- p.lvarIndex = new int[] { (int)lv.reg };
- p.isValidOffset = true;
+ if (widestRange.closed() && widestRange.length > 0) {
+ p.lvarOffset = new int[] { (int)widestRange.start_pc };
+ p.lvarLength = new int[] { (int)widestRange.length };
+ p.lvarIndex = new int[] { (int)lv.reg };
+ p.isValidOffset = true;
+ } else {
+ p.isValidOffset = false;
+ }
}
}
diff --git a/test/langtools/tools/javac/T8187805/BogusRTTAForUnusedVarTest.java b/test/langtools/tools/javac/T8187805/BogusRTTAForUnusedVarTest.java
new file mode 100644
index 00000000000..bc45478ee0a
--- /dev/null
+++ b/test/langtools/tools/javac/T8187805/BogusRTTAForUnusedVarTest.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+
+/*
+ * @test 8187805
+ * @summary bogus RuntimeVisibleTypeAnnotations for unused local in a block
+ * @modules jdk.jdeps/com.sun.tools.classfile
+ * jdk.compiler/com.sun.tools.javac.util
+ * @run main BogusRTTAForUnusedVarTest
+ */
+
+import com.sun.tools.classfile.*;
+
+import java.io.File;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.RuntimeVisibleTypeAnnotations_attribute;
+import com.sun.tools.classfile.TypeAnnotation;
+import com.sun.tools.classfile.TypeAnnotation.Position;
+import com.sun.tools.javac.util.Assert;
+
+public class BogusRTTAForUnusedVarTest {
+
+ class Foo {
+ void something() {
+ {
+ @MyAnno Object o = new Object();
+ }
+ }
+ }
+
+ @Target(ElementType.TYPE_USE)
+ @Retention(RetentionPolicy.RUNTIME)
+ @interface MyAnno {}
+
+ public static void main(String args[]) throws Throwable {
+ new BogusRTTAForUnusedVarTest().run();
+ }
+
+ void run() throws Throwable {
+ checkRTTA();
+ }
+
+ void checkRTTA() throws Throwable {
+ File testClasses = new File(System.getProperty("test.classes"));
+ File file = new File(testClasses,
+ BogusRTTAForUnusedVarTest.class.getName() + "$Foo.class");
+ ClassFile classFile = ClassFile.read(file);
+ for (Method m : classFile.methods) {
+ if (m.getName(classFile.constant_pool).equals("something")) {
+ for (Attribute a : m.attributes) {
+ if (a.getName(classFile.constant_pool).equals("Code")) {
+ Code_attribute code = (Code_attribute)a;
+ for (Attribute codeAttrs : code.attributes) {
+ if (codeAttrs.getName(classFile.constant_pool).equals("RuntimeVisibleTypeAnnotations")) {
+ throw new AssertionError("no RuntimeVisibleTypeAnnotations attribute should have been generated in this case");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}