This commit is contained in:
Phil Race 2017-09-28 09:13:27 -07:00
commit 1c89e3aa56
390 changed files with 7435 additions and 10519 deletions

View file

@ -88,7 +88,6 @@ src/jdk.naming.dns : jdk/src/jdk.naming.dns
src/jdk.naming.rmi : jdk/src/jdk.naming.rmi
src/jdk.net : jdk/src/jdk.net
src/jdk.pack : jdk/src/jdk.pack
src/jdk.policytool : jdk/src/jdk.policytool
src/jdk.rmic : corba/src/jdk.rmic jdk/src/jdk.rmic
src/jdk.scripting.nashorn : nashorn/src/jdk.scripting.nashorn
src/jdk.scripting.nashorn.shell : nashorn/src/jdk.scripting.nashorn.shell

View file

@ -1,90 +0,0 @@
/*
* Copyright (c) 2010, 2013, 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.
*/
/**
* Generate HTML documentation for shell tool. Re-run this tool to regenerate
* html doc when you change options.
*
* Usage:
*
* jjs -scripting genshelldoc.js > shell.html
*/
var Options = Packages.jdk.nashorn.internal.runtime.options.Options;
var title = "Nashorn command line shell tool";
print(<<PREFIX
<html>
<head>
<title>
${title}
</title>
</head>
<body>
<h1>Usage</h1>
<p>
<code>
<b>jjs &lt;options&gt; &lt;script-files&gt; [ -- &lt;script-arguments&gt; ]</b>
</code>
</p>
<h1>${title} options</h1>
<table border="0">
<tr>
<th>name</th>
<th>type</th>
<th>default</th>
<th>description</th>
</tr>
PREFIX);
for each (opt in Options.validOptions) {
var isTimezone = (opt.type == "timezone");
var defValue = opt.defaultValue;
if (defValue == null) {
defValue = "&lt;none&gt;";
}
if (isTimezone) {
// don't output current user's timezone
defValue = "&lt;default-timezone&gt;"
}
print(<<ROW
<tr>
<td><b>${opt.name} ${opt.shortName == null? "" : opt.shortName}</b></td>
<td>${opt.type}</td>
<td>${defValue}</td>
<td>${opt.description}</td>
</tr>
ROW);
}
print(<<SUFFIX
</table>
</body>
</html>
SUFFIX);

View file

@ -41,7 +41,7 @@ JDK_CLASSES := $(call PathList, $(strip $(addprefix $(JDK_OUTPUTDIR)/modules/, \
$(eval $(call SetupJavaCompiler, GENERATE_NEWBYTECODE_DEBUG, \
JVM := $(JAVA_JAVAC), \
JAVAC := $(NEW_JAVAC), \
FLAGS := -g -source 9 -target 9 --upgrade-module-path "$(JDK_OUTPUTDIR)/modules/" \
FLAGS := -g -source 10 -target 10 --upgrade-module-path "$(JDK_OUTPUTDIR)/modules/" \
--system none --module-source-path $(call GetModuleSrcPath), \
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))

View file

@ -56,7 +56,7 @@ define SetupBundleFileBody
$$(eval $1_$$d_RELATIVE_FILES := $$$$(patsubst $$d/%, %, \
$$$$(filter $$d/%, $$$$($1_FILES)))) \
$$(eval $1_$$d_LIST_FILE := \
$(SUPPORT_OUTPUTDIR)/bundles/_$1_$$$$(subst /,_,$$$$(patsubst $(OUTPUT_ROOT)/%,%,$$d)_files)) \
$(SUPPORT_OUTPUTDIR)/bundles/_$1_$$$$(subst /,_,$$$$(patsubst $(OUTPUTDIR)/%,%,$$d)_files)) \
)
ifneq ($$(filter %.tar.gz, $$($1_BUNDLE_NAME)), )

View file

@ -62,10 +62,10 @@ ifneq ($(LIBS_DIR), )
FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \
))
# Use relative links if the import dir is inside the OUTPUT_ROOT, otherwise
# Use relative links if the import dir is inside the OUTPUTDIR, otherwise
# copy to avoid having automated systems following symlinks when deleting files,
# or risk invalidating the build output from external changes.
ifeq ($(filter $(OUTPUT_ROOT)/%, $(LIBS_DIR)), )
ifeq ($(filter $(OUTPUTDIR)/%, $(LIBS_DIR)), )
LINK_MACRO := install-file
LOG_ACTION := Copying
else

View file

@ -54,7 +54,7 @@ TARGETS += $(COPY_CLASSES_TARGET)
################################################################################
$(eval $(call SetupCopyFiles, COPY_SUPPORT_HEADERS, \
SRC := $(BUILD_OUTPUT), \
SRC := $(OUTPUTDIR), \
DEST := $(BUILDJDK_OUTPUTDIR), \
FILES := $(call CacheFind, $(wildcard \
$(addprefix $(SUPPORT_OUTPUTDIR)/headers/, $(MODULES_TO_COPY)))), \
@ -65,7 +65,7 @@ TARGETS += $(COPY_SUPPORT_HEADERS)
################################################################################
$(eval $(call SetupCopyFiles, COPY_JDK_LIB_FILES, \
SRC := $(BUILD_OUTPUT), \
SRC := $(OUTPUTDIR), \
DEST := $(BUILDJDK_OUTPUTDIR), \
FILES := $(JDK_OUTPUTDIR)/lib/tzdb.dat, \
))

View file

@ -130,7 +130,7 @@ endif
# Create jmods in a temp dir and then move them into place to keep the
# module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
$(JMODS_DIR)/$(MODULE).jmod: $(DEPS)
$(call LogWarn, Creating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
$(call LogWarn, Creating $(patsubst $(OUTPUTDIR)/%, %, $@))
$(call MakeDir, $(JMODS_DIR) $(JMODS_TEMPDIR))
$(RM) $@ $(JMODS_TEMPDIR)/$(notdir $@)
$(JMOD) create \

View file

@ -532,7 +532,7 @@ JDK_SPECS_TARGETS += $(COPY_JVMTI_HTML)
# Optional target which bundles all generated javadocs into a zip archive.
JAVADOC_ZIP_NAME := jdk-$(VERSION_STRING)-docs.zip
JAVADOC_ZIP_FILE := $(OUTPUT_ROOT)/bundles/$(JAVADOC_ZIP_NAME)
JAVADOC_ZIP_FILE := $(OUTPUTDIR)/bundles/$(JAVADOC_ZIP_NAME)
$(eval $(call SetupZipArchive, BUILD_JAVADOC_ZIP, \
SRC := $(DOCS_OUTPUTDIR), \

View file

@ -59,8 +59,8 @@ endif
$(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXE_SUFFIX) $(CLASSLIST_JAR)
$(call MakeDir, $(LINK_OPT_DIR))
$(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
$(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $(JLI_TRACE_FILE)))
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@))
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $(JLI_TRACE_FILE)))
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@ \
-Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \

View file

@ -223,7 +223,6 @@ ifneq ($(OPENJDK_TARGET_OS), windows)
jstack.1 \
jstat.1 \
jstatd.1 \
policytool.1 \
rmic.1 \
schemagen.1 \
serialver.1 \
@ -248,38 +247,38 @@ ifneq ($(OPENJDK_TARGET_OS), windows)
endif
$(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
$(JDK_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
$(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
$(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
ifeq ($(OPENJDK_TARGET_OS), solaris)
$(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(call LogInfo, Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Converting $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
$(JDK_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
$(call LogInfo, Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Converting $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
endif
ifneq ($(findstring $(OPENJDK_TARGET_OS), linux macosx), )
$(JRE_IMAGE_DIR)/man/ja:
$(call LogInfo, Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Creating $(patsubst $(OUTPUTDIR)/%,%,$@))
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
$(JDK_IMAGE_DIR)/man/ja:
$(call LogInfo, Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Creating $(patsubst $(OUTPUTDIR)/%,%,$@))
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
endif
@ -313,7 +312,7 @@ endif # Windows
# src.zip
$(JDK_IMAGE_DIR)/lib/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip
$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
$(install-file)
JDK_TARGETS += $(JDK_IMAGE_DIR)/lib/src.zip
@ -355,14 +354,14 @@ ifeq ($(GCOV_ENABLED), true)
GCOV_FIND_EXPR := -type f -name "*.gcno"
$(eval $(call SetupCopyFiles,COPY_HOTSPOT_GCOV_GCNO, \
SRC := $(OUTPUT_ROOT), \
SRC := $(OUTPUTDIR), \
DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR) $(GCOV_FIND_EXPR))))
SYMBOLS_TARGETS += $(COPY_HOTSPOT_GCOV_GCNO)
$(eval $(call SetupCopyFiles,COPY_JDK_GCOV_GCNO, \
SRC := $(OUTPUT_ROOT), \
SRC := $(OUTPUTDIR), \
DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
FILES := $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/native $(GCOV_FIND_EXPR))))

View file

@ -265,7 +265,7 @@ else # HAS_SPEC=true
else
$(ECHO) "Re-running configure using default settings"
endif
( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \
( cd $(OUTPUTDIR) && PATH="$(ORIGINAL_PATH)" \
$(BASH) $(CONFIGURE_CMD) $(CONFIGURE_COMMAND_LINE) )
##############################################################################

View file

@ -349,8 +349,8 @@ else # $(HAS_SPEC)=true
include $(TOPDIR)/make/common/MakeBase.gmk
# Define basic logging setup
BUILD_LOG := $(OUTPUT_ROOT)/build.log
BUILD_PROFILE_LOG := $(OUTPUT_ROOT)/build-profile.log
BUILD_LOG := $(OUTPUTDIR)/build.log
BUILD_PROFILE_LOG := $(OUTPUTDIR)/build-profile.log
BUILD_LOG_PIPE := > >($(TEE) -a $(BUILD_LOG)) 2> >($(TEE) -a $(BUILD_LOG) >&2) && wait
@ -383,7 +383,7 @@ else # $(HAS_SPEC)=true
# FAIL can be set to false to have the return value of compare be ignored.
define ParseCompareBuild
ifneq ($$(COMPARE_BUILD), )
COMPARE_BUILD_OUTPUT_ROOT := $(TOPDIR)/build/compare-build/$(CONF_NAME)
COMPARE_BUILD_OUTPUTDIR := $(TOPDIR)/build/compare-build/$(CONF_NAME)
COMPARE_BUILD_FAIL := true
ifneq ($$(findstring :, $$(COMPARE_BUILD)), )
@ -443,16 +443,16 @@ else # $(HAS_SPEC)=true
# Move the first build away temporarily
$(RM) -r $(TOPDIR)/build/.compare-build-temp
$(MKDIR) -p $(TOPDIR)/build/.compare-build-temp
$(MV) $(OUTPUT_ROOT) $(TOPDIR)/build/.compare-build-temp
$(MV) $(OUTPUTDIR) $(TOPDIR)/build/.compare-build-temp
# Restore an old compare-build, or create a new compare-build directory.
if test -d $(COMPARE_BUILD_OUTPUT_ROOT); then \
$(MV) $(COMPARE_BUILD_OUTPUT_ROOT) $(OUTPUT_ROOT); \
if test -d $(COMPARE_BUILD_OUTPUTDIR); then \
$(MV) $(COMPARE_BUILD_OUTPUTDIR) $(OUTPUTDIR); \
else \
$(MKDIR) -p $(OUTPUT_ROOT); \
$(MKDIR) -p $(OUTPUTDIR); \
fi
# Re-run configure with the same arguments (and possibly some additional),
# must be done after patching.
( cd $(OUTPUT_ROOT) && PATH="$(ORIGINAL_PATH)" \
( cd $(OUTPUTDIR) && PATH="$(ORIGINAL_PATH)" \
$(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) $(COMPARE_BUILD_CONF))
endef
@ -462,8 +462,8 @@ else # $(HAS_SPEC)=true
$(if $(COMPARE_BUILD_PATCH), $(PATCH) -R -p1 < $(COMPARE_BUILD_PATCH))
# Move this build away and restore the original build
$(MKDIR) -p $(TOPDIR)/build/compare-build
$(MV) $(OUTPUT_ROOT) $(COMPARE_BUILD_OUTPUT_ROOT)
$(MV) $(TOPDIR)/build/.compare-build-temp/$(CONF_NAME) $(OUTPUT_ROOT)
$(MV) $(OUTPUTDIR) $(COMPARE_BUILD_OUTPUTDIR)
$(MV) $(TOPDIR)/build/.compare-build-temp/$(CONF_NAME) $(OUTPUTDIR)
$(RM) -r $(TOPDIR)/build/.compare-build-temp
endef
@ -472,11 +472,11 @@ else # $(HAS_SPEC)=true
# Compare first and second build. Ignore any error code from compare.sh.
$(ECHO) "Comparing between comparison rebuild (this/new) and baseline (other/old)"
$(if $(COMPARE_BUILD_COMP_DIR), \
+(cd $(COMPARE_BUILD_OUTPUT_ROOT) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
-2dirs $(COMPARE_BUILD_OUTPUT_ROOT)/$(COMPARE_BUILD_COMP_DIR) \
$(OUTPUT_ROOT)/$(COMPARE_BUILD_COMP_DIR) $(COMPARE_BUILD_IGNORE_RESULT)), \
+(cd $(COMPARE_BUILD_OUTPUT_ROOT) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
-o $(OUTPUT_ROOT) $(COMPARE_BUILD_IGNORE_RESULT)) \
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
-2dirs $(COMPARE_BUILD_OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) \
$(OUTPUTDIR)/$(COMPARE_BUILD_COMP_DIR) $(COMPARE_BUILD_IGNORE_RESULT)), \
+(cd $(COMPARE_BUILD_OUTPUTDIR) && ./compare.sh $(COMPARE_BUILD_COMP_OPTS) \
-o $(OUTPUTDIR) $(COMPARE_BUILD_IGNORE_RESULT)) \
)
endef

View file

@ -94,7 +94,7 @@ else
# Just fake the main bundle to satisfy JPRT
jprt_bundle: $(JPRT_TARGET)
@$(call TargetEnter)
$(MKDIR) -p $(BUILD_OUTPUT)/bundles
$(MKDIR) -p $(OUTPUTDIR)/bundles
$(CD) $(TOPDIR) && $(TAR) cf - README | $(GZIP) > \
$(JPRT_ARCHIVE_BUNDLE)
@$(call TargetExit)

View file

@ -57,23 +57,23 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
# Copy empty directories (jre/lib/applet).
$(JDK_MACOSX_CONTENTS_DIR)/Home/%: $(JDK_IMAGE_DIR)/%
$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
$(MKDIR) -p $(@D)
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
$(JRE_MACOSX_CONTENTS_DIR)/Home/%: $(JRE_IMAGE_DIR)/%
$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
$(MKDIR) -p $(@D)
if [ -d "$<" ]; then $(MKDIR) -p $@; else $(CP) -f -R -P '$<' '$@'; fi
$(JDK_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib:
$(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Creating link $(patsubst $(OUTPUTDIR)/%,%,$@))
$(MKDIR) -p $(@D)
$(RM) $@
$(LN) -s ../Home/lib/jli/libjli.dylib $@
$(JRE_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib:
$(call LogInfo, Creating link $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Creating link $(patsubst $(OUTPUTDIR)/%,%,$@))
$(MKDIR) -p $(@D)
$(RM) $@
$(LN) -s ../Home/lib/jli/libjli.dylib $@

View file

@ -928,7 +928,7 @@ java.base: hotspot
demos: demos-jdk
# The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
# The "exploded image" is a locally runnable JDK in $(OUTPUTDIR)/jdk.
exploded-image-base: $(ALL_MODULES)
exploded-image: exploded-image-base release-file
# When cross compiling, no need to optimize the exploded image since it won't
@ -957,7 +957,7 @@ docs-javadoc: docs-jdk-api
mac-bundles: mac-bundles-jdk
# The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
# The $(OUTPUTDIR)/images directory contain the resulting deliverables,
# and in line with this, our targets for creating these are named *-image[s].
# This target builds the product images, e.g. the JRE and JDK image
@ -1048,7 +1048,7 @@ CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
# Remove everything, except the output from configure.
clean: $(CLEAN_DIR_TARGETS)
($(CD) $(OUTPUT_ROOT) && $(RM) -r build*.log*)
($(CD) $(OUTPUTDIR) && $(RM) -r build*.log*)
$(ECHO) Cleaned all build artifacts.
clean-docs:
@ -1081,14 +1081,14 @@ clean-support: clean-jdk
# Remove everything, including configure configuration. If the output
# directory was created by configure and now becomes empty, remove it as well.
dist-clean: clean
($(CD) $(OUTPUT_ROOT) && \
($(CD) $(OUTPUTDIR) && \
$(RM) -r *spec.gmk $(CONFIGURESUPPORT_OUTPUTDIR) Makefile compare.sh ide)
$(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
$(if $(filter $(CONF_NAME),$(notdir $(OUTPUTDIR))), \
if test "x`$(LS) $(OUTPUTDIR)`" != x; then \
$(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
else \
($(CD) $(TOPDIR) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
&& $(RM) -r $(OUTPUT_ROOT)) \
&& $(RM) -r $(OUTPUTDIR)) \
fi \
)
$(ECHO) Cleaned everything, you will have to re-run configure.

View file

@ -36,7 +36,7 @@ define RunTests
($(CD) $(TOPDIR)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
JT_HOME=$(JT_HOME) PRODUCT_HOME=$(strip $2) \
TEST_IMAGE_DIR=$(TEST_IMAGE_DIR) \
ALT_OUTPUTDIR=$(OUTPUT_ROOT) TEST_JOBS=$(TEST_JOBS) \
ALT_OUTPUTDIR=$(OUTPUTDIR) TEST_JOBS=$(TEST_JOBS) \
JT_JAVA=$(BOOT_JDK) JIB_JAR=$(JIB_JAR) \
JOBS=$(JOBS) $1) || true
endef
@ -54,7 +54,7 @@ endef
define CleanDir
@$(PRINTF) "Cleaning $(strip $1) build artifacts ..."
@$(PRINTF) "\n" $(LOG_DEBUG)
($(CD) $(OUTPUT_ROOT) && $(RM) -r $1)
($(CD) $(OUTPUTDIR) && $(RM) -r $1)
@$(PRINTF) " done\n"
endef

View file

@ -54,7 +54,7 @@ endef
# Param 1 - The file containing the MODULES list
define prepare-info-file
$(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%,%,$@))
$(call MakeDir, $(@D))
$(RM) $@
endef

View file

@ -38,8 +38,8 @@ JTREG_TEST_TOPDIRS := $(TOPDIR) $(JTREG_TESTROOTS)
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, , RunTests.gmk))
TEST_RESULTS_DIR := $(BUILD_OUTPUT)/test-results
TEST_SUPPORT_DIR := $(BUILD_OUTPUT)/test-support
TEST_RESULTS_DIR := $(OUTPUTDIR)/test-results
TEST_SUPPORT_DIR := $(OUTPUTDIR)/test-support
################################################################################
@ -392,20 +392,27 @@ define SetupRunJtregTestBody
$$(call LogWarn, Finished running test '$$($1_TEST)')
$$(call LogWarn, Test report is stored in $$(strip \
$$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR))))
$$(eval $1_PASSED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \
for (i=1; i<=NF; i++) { if ($$$$i == "passed:") \
print $$$$(i+1) } }' $$($1_RESULT_FILE)))
$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0))
$$(eval $1_FAILED := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
for (i=1; i<=NF; i++) { if ($$$$i == "failed:") \
print $$$$(i+1) } }' $$($1_RESULT_FILE)))
$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0))
$$(eval $1_ERROR := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
for (i=1; i<=NF; i++) { if ($$$$i == "error:") \
print $$$$(i+1) } }' $$($1_RESULT_FILE)))
$$(if $$($1_ERROR), , $$(eval $1_ERROR := 0))
$$(eval $1_TOTAL := $$(shell \
$$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR)))
$$(if $$(wildcard $$($1_RESULT_FILE)), \
$$(eval $1_PASSED := $$(shell $$(AWK) '{ gsub(/[,;]/, ""); \
for (i=1; i<=NF; i++) { if ($$$$i == "passed:") \
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
$$(if $$($1_PASSED), , $$(eval $1_PASSED := 0)) \
$$(eval $1_FAILED := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
for (i=1; i<=NF; i++) { if ($$$$i == "failed:") \
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
$$(if $$($1_FAILED), , $$(eval $1_FAILED := 0)) \
$$(eval $1_ERROR := $$(shell $$(AWK) '{gsub(/[,;]/, ""); \
for (i=1; i<=NF; i++) { if ($$$$i == "error:") \
print $$$$(i+1) } }' $$($1_RESULT_FILE))) \
$$(if $$($1_ERROR), , $$(eval $1_ERROR := 0)) \
$$(eval $1_TOTAL := $$(shell \
$$(EXPR) $$($1_PASSED) + $$($1_FAILED) + $$($1_ERROR))) \
, \
$$(eval $1_PASSED := 0) \
$$(eval $1_FAILED := 0) \
$$(eval $1_ERROR := 1) \
$$(eval $1_TOTAL := 1) \
)
$1: run-test-$1 parse-test-$1

View file

@ -23,5 +23,5 @@
# This Makefile was generated by configure @DATE_WHEN_CONFIGURED@
# GENERATED FILE, DO NOT EDIT
SPEC:=@OUTPUT_ROOT@/spec.gmk
SPEC:=@OUTPUTDIR@/spec.gmk
include @TOPDIR@/Makefile

View file

@ -568,8 +568,6 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
# We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
BASIC_FIXUP_PATH(CURDIR)
BASIC_FIXUP_PATH(TOPDIR)
# SRC_ROOT is a traditional alias for TOPDIR.
SRC_ROOT=$TOPDIR
# Calculate a canonical version of TOPDIR for string comparisons
CANONICAL_TOPDIR=$TOPDIR
@ -770,13 +768,13 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
[ CONF_NAME=${with_conf_name} ])
AC_ARG_WITH(output-base-dir, [AS_HELP_STRING([--with-output-base-dir],
[override the default output base directory @<:@./build@:>@])],
[ OUTPUT_BASE=${with_output_base_dir} ], [ OUTPUT_BASE="$SRC_ROOT/build" ] )
[ OUTPUT_BASE=${with_output_base_dir} ], [ OUTPUT_BASE="$TOPDIR/build" ] )
# Test from where we are running configure, in or outside of src root.
AC_MSG_CHECKING([where to store configuration])
if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \
|| test "x$CURDIR" = "x$SRC_ROOT/make/autoconf" \
|| test "x$CURDIR" = "x$SRC_ROOT/make" ; then
if test "x$CURDIR" = "x$TOPDIR" || test "x$CURDIR" = "x$TOPDIR/common" \
|| test "x$CURDIR" = "x$TOPDIR/make/autoconf" \
|| test "x$CURDIR" = "x$TOPDIR/make" ; then
# We are running configure from the src root.
# Create a default ./build/target-variant-debuglevel output root.
if test "x${CONF_NAME}" = x; then
@ -785,10 +783,10 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
else
AC_MSG_RESULT([in build directory with custom name])
fi
OUTPUT_ROOT="${OUTPUT_BASE}/${CONF_NAME}"
$MKDIR -p "$OUTPUT_ROOT"
if test ! -d "$OUTPUT_ROOT"; then
AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT])
OUTPUTDIR="${OUTPUT_BASE}/${CONF_NAME}"
$MKDIR -p "$OUTPUTDIR"
if test ! -d "$OUTPUTDIR"; then
AC_MSG_ERROR([Could not create build directory $OUTPUTDIR])
fi
else
# We are running configure from outside of the src dir.
@ -796,18 +794,18 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
# If configuration is situated in normal build directory, just use the build
# directory name as configuration name, otherwise use the complete path.
if test "x${CONF_NAME}" = x; then
CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"`
CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${TOPDIR}/build/!!"`
fi
OUTPUT_ROOT="$CURDIR"
OUTPUTDIR="$CURDIR"
AC_MSG_RESULT([in current directory])
# WARNING: This might be a bad thing to do. You need to be sure you want to
# have a configuration in this directory. Do some sanity checks!
if test ! -e "$OUTPUT_ROOT/spec.gmk"; then
if test ! -e "$OUTPUTDIR/spec.gmk"; then
# If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
# other files
files_present=`$LS $OUTPUT_ROOT`
files_present=`$LS $OUTPUTDIR`
# Configure has already touched config.log and confdefs.h in the current dir when this check
# is performed.
filtered_files=`$ECHO "$files_present" \
@ -822,7 +820,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
AC_MSG_NOTICE([(as opposed to creating a configuration in <src_root>/build/<conf-name>).])
AC_MSG_NOTICE([However, this directory is not empty. This is not allowed, since it could])
AC_MSG_NOTICE([seriously mess up just about everything.])
AC_MSG_NOTICE([Try 'cd $SRC_ROOT' and restart configure])
AC_MSG_NOTICE([Try 'cd $TOPDIR' and restart configure])
AC_MSG_NOTICE([(or create a new empty directory and cd to it).])
AC_MSG_ERROR([Will not continue creating configuration in $CURDIR])
fi
@ -831,29 +829,29 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
AC_MSG_CHECKING([what configuration name to use])
AC_MSG_RESULT([$CONF_NAME])
BASIC_FIXUP_PATH(OUTPUT_ROOT)
BASIC_FIXUP_PATH(OUTPUTDIR)
CONFIGURESUPPORT_OUTPUTDIR="$OUTPUT_ROOT/configure-support"
CONFIGURESUPPORT_OUTPUTDIR="$OUTPUTDIR/configure-support"
$MKDIR -p "$CONFIGURESUPPORT_OUTPUTDIR"
SPEC="$OUTPUT_ROOT/spec.gmk"
SPEC="$OUTPUTDIR/spec.gmk"
AC_SUBST(SPEC)
AC_SUBST(CONF_NAME)
AC_SUBST(OUTPUT_ROOT)
AC_SUBST(OUTPUTDIR)
AC_SUBST(CONFIGURESUPPORT_OUTPUTDIR)
# The spec.gmk file contains all variables for the make system.
AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
AC_CONFIG_FILES([$OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
# The bootcycle-spec.gmk file contains support for boot cycle builds.
AC_CONFIG_FILES([$OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
AC_CONFIG_FILES([$OUTPUTDIR/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
# The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling.
AC_CONFIG_FILES([$OUTPUT_ROOT/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in])
AC_CONFIG_FILES([$OUTPUTDIR/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in])
# The compare.sh is used to compare the build output to other builds.
AC_CONFIG_FILES([$OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in])
AC_CONFIG_FILES([$OUTPUTDIR/compare.sh:$AUTOCONF_DIR/compare.sh.in])
# The generated Makefile knows where the spec.gmk is and where the source is.
# You can run make from the OUTPUT_ROOT, or from the top-level Makefile
# You can run make from the OUTPUTDIR, or from the top-level Makefile
# which will look for generated configurations
AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in])
AC_CONFIG_FILES([$OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.in])
])
#%%% Simple tools %%%
@ -1173,7 +1171,7 @@ AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK],
AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS],
[
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
file_to_test="$SRC_ROOT/LICENSE"
file_to_test="$TOPDIR/LICENSE"
if test `$STAT -c '%a' "$file_to_test"` -lt 400; then
AC_MSG_ERROR([Bad file permissions on src files. This is usually caused by cloning the repositories with a non cygwin hg in a directory not created in cygwin.])
fi
@ -1186,7 +1184,7 @@ AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
BASIC_CHECK_LEFTOVER_OVERRIDDEN
AC_MSG_CHECKING([if build directory is on local disk])
BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUT_ROOT,
BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUTDIR,
[OUTPUT_DIR_IS_LOCAL="yes"],
[OUTPUT_DIR_IS_LOCAL="no"])
AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL)
@ -1198,7 +1196,7 @@ AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
# Before generating output files, test if they exist. If they do, this is a reconfigure.
# Since we can't properly handle the dependencies for this, warn the user about the situation
if test -e $OUTPUT_ROOT/spec.gmk; then
if test -e $OUTPUTDIR/spec.gmk; then
IS_RECONFIGURE=yes
else
IS_RECONFIGURE=no
@ -1269,18 +1267,18 @@ AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
fi
# Rotate our log file (configure.log)
if test -e "$OUTPUT_ROOT/configure.log.old"; then
$RM -f "$OUTPUT_ROOT/configure.log.old"
if test -e "$OUTPUTDIR/configure.log.old"; then
$RM -f "$OUTPUTDIR/configure.log.old"
fi
if test -e "$OUTPUT_ROOT/configure.log"; then
$MV -f "$OUTPUT_ROOT/configure.log" "$OUTPUT_ROOT/configure.log.old" 2> /dev/null
if test -e "$OUTPUTDIR/configure.log"; then
$MV -f "$OUTPUTDIR/configure.log" "$OUTPUTDIR/configure.log.old" 2> /dev/null
fi
# Move configure.log from current directory to the build output root
if test -e ./configure.log; then
$MV -f ./configure.log "$OUTPUT_ROOT/configure.log" 2> /dev/null
$MV -f ./configure.log "$OUTPUTDIR/configure.log" 2> /dev/null
fi
# Make the compare script executable
$CHMOD +x $OUTPUT_ROOT/compare.sh
$CHMOD +x $OUTPUTDIR/compare.sh
])

View file

@ -382,7 +382,7 @@ AC_DEFUN_ONCE([BASIC_COMPILE_FIXPATH],
FIXPATH=
if test "x$OPENJDK_BUILD_OS" = xwindows; then
AC_MSG_CHECKING([if fixpath can be created])
FIXPATH_SRC="$SRC_ROOT/make/src/native/fixpath.c"
FIXPATH_SRC="$TOPDIR/make/src/native/fixpath.c"
FIXPATH_BIN="$CONFIGURESUPPORT_OUTPUTDIR/bin/fixpath.exe"
FIXPATH_DIR="$CONFIGURESUPPORT_OUTPUTDIR/fixpath"
if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then

View file

@ -77,10 +77,10 @@ AC_DEFUN([BOOTJDK_DO_CHECK],
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
[FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"9([\.+-].*)?\"|(1\.[89]\.)'`]
[FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`]
if test "x$FOUND_CORRECT_VERSION" = x; then
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
AC_MSG_NOTICE([(Your Boot JDK must be version 8 or 9)])
AC_MSG_NOTICE([(Your Boot JDK must be version 8, 9 or 10)])
BOOT_JDK_FOUND=no
else
# We're done! :-)
@ -469,10 +469,10 @@ AC_DEFUN([BOOTJDK_CHECK_BUILD_JDK],
BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
# Extra M4 quote needed to protect [] in grep expression.
[FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP '\"9([\.+-].*)?\"'`]
[FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"'`]
if test "x$FOUND_CORRECT_VERSION" = x; then
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring])
AC_MSG_NOTICE([(Your Build JDK must be version 9)])
AC_MSG_NOTICE([(Your Build JDK must be version 10)])
BUILD_JDK_FOUND=no
else
# We're done!

View file

@ -48,9 +48,9 @@ endif
BOOT_JDK := $(JDK_IMAGE_DIR)
# The bootcycle build has a different output directory
OLD_BUILD_OUTPUT:=@BUILD_OUTPUT@
BUILD_OUTPUT:=$(OLD_BUILD_OUTPUT)/bootcycle-build
SJAVAC_SERVER_DIR:=$(patsubst $(OLD_BUILD_OUTPUT)%, $(BUILD_OUTPUT)%, $(SJAVAC_SERVER_DIR))
OLD_OUTPUTDIR:=@OUTPUTDIR@
OUTPUTDIR:=$(OLD_OUTPUTDIR)/bootcycle-build
SJAVAC_SERVER_DIR:=$(patsubst $(OLD_OUTPUTDIR)%, $(OUTPUTDIR)%, $(SJAVAC_SERVER_DIR))
JAVA_CMD:=$(BOOT_JDK)/bin/java
JAVAC_CMD:=$(BOOT_JDK)/bin/javac

View file

@ -43,10 +43,10 @@ SYSROOT_CFLAGS := @BUILD_SYSROOT_CFLAGS@
SYSROOT_LDFLAGS := @BUILD_SYSROOT_LDFLAGS@
# These directories should not be moved to BUILDJDK_OUTPUTDIR
HOTSPOT_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(HOTSPOT_OUTPUTDIR))
SUPPORT_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(SUPPORT_OUTPUTDIR))
JDK_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(JDK_OUTPUTDIR))
IMAGES_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(IMAGES_OUTPUTDIR))
HOTSPOT_OUTPUTDIR := $(patsubst $(OUTPUTDIR)%,$(BUILDJDK_OUTPUTDIR)%,$(HOTSPOT_OUTPUTDIR))
SUPPORT_OUTPUTDIR := $(patsubst $(OUTPUTDIR)%,$(BUILDJDK_OUTPUTDIR)%,$(SUPPORT_OUTPUTDIR))
JDK_OUTPUTDIR := $(patsubst $(OUTPUTDIR)%,$(BUILDJDK_OUTPUTDIR)%,$(JDK_OUTPUTDIR))
IMAGES_OUTPUTDIR := $(patsubst $(OUTPUTDIR)%,$(BUILDJDK_OUTPUTDIR)%,$(IMAGES_OUTPUTDIR))
OPENJDK_BUILD_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@
OPENJDK_BUILD_CPU_LEGACY_LIB := @OPENJDK_BUILD_CPU_LEGACY_LIB@

View file

@ -69,15 +69,15 @@ export UNIQ="@UNIQ@"
export UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200"
export UNARCHIVE="@UNZIP@ -q -o"
export SRC_ROOT="@TOPDIR@"
export OUTPUT_ROOT="@OUTPUT_ROOT@"
export TOPDIR="@TOPDIR@"
export OUTPUTDIR="@OUTPUTDIR@"
if [ "@COMPILE_TYPE@" != "cross" ]; then
export JAVAP="@FIXPATH@ $OUTPUT_ROOT/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
export JIMAGE="@FIXPATH@ $OUTPUT_ROOT/jdk/bin/jimage"
export JAVAP="@FIXPATH@ $OUTPUTDIR/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
export JIMAGE="@FIXPATH@ $OUTPUTDIR/jdk/bin/jimage"
elif [ "@CREATE_BUILDJDK@" = "true" ]; then
export JAVAP="@FIXPATH@ $OUTPUT_ROOT/buildjdk/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
export JIMAGE="@FIXPATH@ $OUTPUT_ROOT/buildjdk/jdk/bin/jimage"
export JAVAP="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
export JIMAGE="@FIXPATH@ $OUTPUTDIR/buildjdk/jdk/bin/jimage"
else
export JAVAP="@FIXPATH@ @BUILD_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
export JIMAGE="@FIXPATH@ @BUILD_JDK@/bin/jimage"
@ -88,16 +88,16 @@ if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
fi
# Now locate the main script and run it.
REAL_COMPARE_SCRIPT="$SRC_ROOT/make/scripts/compare.sh"
REAL_COMPARE_SCRIPT="$TOPDIR/make/scripts/compare.sh"
if [ ! -e "$REAL_COMPARE_SCRIPT" ]; then
echo "Error: Cannot locate compare script, it should have been in $REAL_COMPARE_SCRIPT"
exit 1
fi
# Rotate logs
$RM $OUTPUT_ROOT/compare.log.old 2> /dev/null
$MV $OUTPUT_ROOT/compare.log $OUTPUT_ROOT/compare.log.old 2> /dev/null
$RM $OUTPUTDIR/compare.log.old 2> /dev/null
$MV $OUTPUTDIR/compare.log $OUTPUTDIR/compare.log.old 2> /dev/null
export SCRIPT_DIR="$( cd "$( dirname "$0" )" > /dev/null && pwd )"
$BASH $SRC_ROOT/make/scripts/logger.sh $OUTPUT_ROOT/compare.log $BASH "$REAL_COMPARE_SCRIPT" "$@"
$BASH $TOPDIR/make/scripts/logger.sh $OUTPUTDIR/compare.log $BASH "$REAL_COMPARE_SCRIPT" "$@"

View file

@ -1311,9 +1311,10 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDK}"
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
$2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${LDFLAGS_NO_EXEC_STACK}"
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
$2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
-libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
-libpath:${OUTPUTDIR}/support/modules_libs/java.base"
$2JDKLIB_LIBS=""
else
$2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
@ -1388,6 +1389,7 @@ $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${$2JAVA_BASE_LDFLAGS}"
AC_SUBST($2JDKEXE_LIBS)
AC_SUBST($2LDFLAGS_CXX_JDK)
AC_SUBST($2LDFLAGS_HASH_STYLE)
AC_SUBST($2LDFLAGS_NO_EXEC_STACK)
AC_SUBST($2JVM_CFLAGS)
AC_SUBST($2JVM_LDFLAGS)

File diff suppressed because it is too large Load diff

View file

@ -206,15 +206,15 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
printf "====================================================\n"
if test "x$no_create" != "xyes"; then
if test "x$IS_RECONFIGURE" != "xyes"; then
printf "A new configuration has been successfully created in\n%s\n" "$OUTPUT_ROOT"
printf "A new configuration has been successfully created in\n%s\n" "$OUTPUTDIR"
else
printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUT_ROOT"
printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUTDIR"
fi
else
if test "x$IS_RECONFIGURE" != "xyes"; then
printf "A configuration has been successfully checked but not created\n"
else
printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUT_ROOT"
printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUTDIR"
fi
fi
if test "x$CONFIGURE_COMMAND_LINE" != x; then

View file

@ -206,8 +206,16 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
# Choose cacerts source file
AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
[specify alternative cacerts file])])
if test "x$with_cacerts_file" != x; then
AC_MSG_CHECKING([for cacerts file])
if test "x$with_cacerts_file" == x; then
AC_MSG_RESULT([default])
else
CACERTS_FILE=$with_cacerts_file
if test ! -f "$CACERTS_FILE"; then
AC_MSG_RESULT([fail])
AC_MSG_ERROR([Specified cacerts file "$CACERTS_FILE" does not exist])
fi
AC_MSG_RESULT([$CACERTS_FILE])
fi
AC_SUBST(CACERTS_FILE)

View file

@ -25,9 +25,9 @@
AC_DEFUN_ONCE([SRCDIRS_SETUP_DIRS],
[
BUILD_OUTPUT="$OUTPUT_ROOT"
AC_SUBST(BUILD_OUTPUT)
JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
OUTPUTDIR="$OUTPUTDIR"
AC_SUBST(OUTPUTDIR)
JDK_OUTPUTDIR="$OUTPUTDIR/jdk"
# Where are the sources.
AC_SUBST(TOPDIR)

View file

@ -125,14 +125,12 @@ endif
SYSROOT_CFLAGS := @SYSROOT_CFLAGS@
SYSROOT_LDFLAGS := @SYSROOT_LDFLAGS@
# The top-level directory of the forest (SRC_ROOT is a traditional alias)
# The top-level directory of the source repository
TOPDIR:=@TOPDIR@
# These two versions of TOPDIR are used in string comparisons
ORIGINAL_TOPDIR:=@ORIGINAL_TOPDIR@
CANONICAL_TOPDIR:=@CANONICAL_TOPDIR@
SRC_ROOT:=@TOPDIR@
OUTPUT_ROOT:=@OUTPUT_ROOT@
IMPORT_MODULES_CLASSES:=@IMPORT_MODULES_CLASSES@
IMPORT_MODULES_CMDS:=@IMPORT_MODULES_CMDS@
@ -244,29 +242,22 @@ ENABLE_FULL_DOCS := @ENABLE_FULL_DOCS@
# JDK_OUTPUTDIR specifies where a working jvm is built.
# You can run $(JDK_OUTPUTDIR)/bin/java
# Though the layout of the contents of $(JDK_OUTPUTDIR) is not
# yet the same as a default installation.
#
# When you run "make install" it will create the standardized
# layout for the jdk and the jre inside the IMAGES_OUTPUTDIR subdir.
# Then it will copy the contents of the jdk into the installation
# directory.
BUILD_OUTPUT:=@BUILD_OUTPUT@
OUTPUTDIR := @OUTPUTDIR@
# Colon left out to be able to override IMAGES_OUTPUTDIR for bootcycle-images
SUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/support
BUILDTOOLS_OUTPUTDIR=$(BUILD_OUTPUT)/buildtools
SUPPORT_OUTPUTDIR=$(OUTPUTDIR)/support
BUILDTOOLS_OUTPUTDIR=$(OUTPUTDIR)/buildtools
HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
BUNDLES_OUTPUTDIR=$(BUILD_OUTPUT)/bundles
TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/test-make
MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/make-support
HOTSPOT_OUTPUTDIR=$(OUTPUTDIR)/hotspot
JDK_OUTPUTDIR=$(OUTPUTDIR)/jdk
IMAGES_OUTPUTDIR=$(OUTPUTDIR)/images
BUNDLES_OUTPUTDIR=$(OUTPUTDIR)/bundles
TESTMAKE_OUTPUTDIR=$(OUTPUTDIR)/test-make
MAKESUPPORT_OUTPUTDIR=$(OUTPUTDIR)/make-support
# This does not get overridden in a bootcycle build
CONFIGURESUPPORT_OUTPUTDIR:=@CONFIGURESUPPORT_OUTPUTDIR@
BUILDJDK_OUTPUTDIR=$(BUILD_OUTPUT)/buildjdk
BUILDJDK_OUTPUTDIR=$(OUTPUTDIR)/buildjdk
BUILD_FAILURE_HANDLER := @BUILD_FAILURE_HANDLER@
@ -396,6 +387,7 @@ CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@
CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
LDFLAGS_HASH_STYLE := @LDFLAGS_HASH_STYLE@
LDFLAGS_NO_EXEC_STACK := @LDFLAGS_NO_EXEC_STACK@
JVM_CFLAGS := @JVM_CFLAGS@
JVM_CFLAGS_SYMBOLS := @JVM_CFLAGS_SYMBOLS@

View file

@ -935,6 +935,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
elif test "x$with_jtreg" != xyes && test "x$with_jtreg" != x; then
# An explicit path is specified, use it.
JT_HOME="$with_jtreg"
BASIC_FIXUP_PATH([JT_HOME])
if test ! -d "$JT_HOME"; then
AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not exist])
fi

View file

@ -211,7 +211,7 @@ define SetupJarArchiveBody
$1_SUPDATE_CONTENTS=$(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)
# Use a slightly shorter name for logging, but with enough path to identify this jar.
$1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR))
$1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_JAR))
ifneq (,$$($1_CHECK_COMPRESS_JAR))
$1_JAR_CREATE_OPTIONS := c0fm

View file

@ -82,7 +82,7 @@ PrintVar = \
### Functions for timers
# Store the build times in this directory.
BUILDTIMESDIR=$(OUTPUT_ROOT)/make-support/build-times
BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times
# Record starting time for build of a sub repository.
define RecordStartTime
@ -155,7 +155,7 @@ else # HAS_FILE_FUNCTION = false
$(strip $(shell $(CAT) $(TOPDIR)/make/common/support/ListPathsSafely-pre-compress.incl)))
compress_paths += \
$(subst $(TOPDIR),X97, \
$(subst $(OUTPUT_ROOT),X98, \
$(subst $(OUTPUTDIR),X98, \
$(subst X,X00, \
$(subst $(SPACE),\n,$(strip $1)))))
$(eval compress_paths += \
@ -163,7 +163,7 @@ else # HAS_FILE_FUNCTION = false
decompress_paths=$(SED) -f $(TOPDIR)/make/common/support/ListPathsSafely-uncompress.sed \
-e 's|X99|\\n|g' \
-e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(TOPDIR)|g' \
-e 's|X98|$(OUTPUTDIR)|g' -e 's|X97|$(TOPDIR)|g' \
-e 's|X00|X|g'
ListPathsSafely_IfPrintf = \
@ -359,11 +359,11 @@ define SetupLogging
ifeq ($$(IS_GNU_TIME), yes)
SHELL := $$(BASH) $$(TOPDIR)/make/scripts/shell-profiler.sh \
gnutime $$(TIME) \
$$(OUTPUT_ROOT)/build-profile.log $$(SHELL)
$$(OUTPUTDIR)/build-profile.log $$(SHELL)
else ifneq ($$(FLOCK), )
SHELL := $$(BASH) $$(TOPDIR)/make/scripts/shell-profiler.sh \
flock $$(FLOCK) \
$$(OUTPUT_ROOT)/build-profile.log $$(SHELL)
$$(OUTPUTDIR)/build-profile.log $$(SHELL)
endif
endif
@ -707,7 +707,7 @@ define AddFileToCopy
# 4 : Macro to call for copy operation
# 5 : Action text to log
$2: $1
$$(call LogInfo, $(strip $5) $$(patsubst $(OUTPUT_ROOT)/%,%,$$@))
$$(call LogInfo, $(strip $5) $$(patsubst $(OUTPUTDIR)/%,%,$$@))
$$($$(strip $4))
$3 += $2
@ -937,8 +937,8 @@ ExecuteWithLog = \
$(call WriteFile, $2, $(strip $1).cmdline) \
( $(strip $2) > >($(TEE) $(strip $1).log) 2> >($(TEE) $(strip $1).log >&2) || \
( exitcode=$(DOLLAR)? && \
$(CP) $(strip $1).log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(BUILD_OUTPUT)/%,%,$(strip $1))).log && \
$(CP) $(strip $1).cmdline $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(BUILD_OUTPUT)/%,%,$(strip $1))).cmdline && \
$(CP) $(strip $1).log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).log && \
$(CP) $(strip $1).cmdline $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(subst /,_,$(patsubst $(OUTPUTDIR)/%,%,$(strip $1))).cmdline && \
exit $(DOLLAR)exitcode ) )
################################################################################

View file

@ -58,7 +58,6 @@ BOOT_MODULES += \
java.rmi \
java.security.sasl \
java.xml \
jdk.httpserver \
jdk.internal.vm.ci \
jdk.management \
jdk.management.agent \
@ -112,6 +111,7 @@ PLATFORM_MODULES += \
jdk.crypto.cryptoki \
jdk.crypto.ec \
jdk.dynalink \
jdk.httpserver \
jdk.incubator.httpclient \
jdk.jsobject \
jdk.localedata \
@ -173,7 +173,6 @@ DOCS_MODULES += \
jdk.naming.rmi \
jdk.net \
jdk.pack \
jdk.policytool \
jdk.rmic \
jdk.scripting.nashorn \
jdk.sctp \

View file

@ -751,10 +751,10 @@ define SetupNativeCompilationBody
# This is a rough heuristic and may not always print accurate information.
$$($1_BUILD_INFO): $$($1_SRCS) $$($1_COMPILE_VARDEPS_FILE)
ifeq ($$(wildcard $$($1_TARGET)),)
$(ECHO) 'Creating $$(subst $$(BUILD_OUTPUT)/,,$$($1_TARGET)) from $$(words \
$(ECHO) 'Creating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET)) from $$(words \
$$(filter-out %.vardeps, $$?)) file(s)'
else
$(ECHO) $$(strip 'Updating $$(subst $$(BUILD_OUTPUT)/,,$$($1_TARGET))' \
$(ECHO) $$(strip 'Updating $$(subst $$(OUTPUTDIR)/,,$$($1_TARGET))' \
$$(if $$(filter-out %.vardeps, $$?), \
'due to $$(words $$(filter-out %.vardeps, $$?)) file(s)', \
$$(if $$(filter %.vardeps, $$?), 'due to makefile changes')))
@ -946,9 +946,9 @@ define SetupNativeCompilationBody
ifeq ($$(TOOLCHAIN_TYPE), clang)
# There is no strlen function in make, but checking path depth is a
# reasonable approximation.
ifneq ($$(word 10, $$(subst /, ,$$(OUTPUT_ROOT))), )
ifneq ($$(word 10, $$(subst /, ,$$(OUTPUTDIR))), )
$1_LINK_OBJS_RELATIVE := true
$1_ALL_OBJS_RELATIVE := $$(patsubst $$(OUTPUT_ROOT)/%, %, $$($1_ALL_OBJS))
$1_ALL_OBJS_RELATIVE := $$(patsubst $$(OUTPUTDIR)/%, %, $$($1_ALL_OBJS))
endif
endif
endif
@ -976,7 +976,7 @@ define SetupNativeCompilationBody
$$($1_STRIP_CMD)
else
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, \
$$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUT_ROOT) ; ) \
$$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
$(LD_OUT_OPTION)$$@ $$($1_LD_OBJ_ARG) $$($1_RES) $$($1_LIBS) \
$$($1_EXTRA_LIBS)) ; \

View file

@ -95,7 +95,7 @@ define SetupZipArchiveBody
endif
# Use a slightly shorter name for logging, but with enough path to identify this zip.
$1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_ZIP))
$1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_ZIP))
# Now $1_ALL_SRCS should contain all sources that are going to be put into the zip.
# I.e. the zip -i and -x options should match the filtering done in the makefile.

View file

@ -208,7 +208,7 @@ endif
CACERTS_DST := $(LIB_DST_DIR)/security/cacerts
$(CACERTS_DST): $(CACERTS_FILE)
$(call LogInfo, Copying $(patsubst $(OUTPUT_ROOT)/%, %, $@))
$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%, %, $@))
$(call install-file)
TARGETS += $(CACERTS_DST)

View file

@ -75,12 +75,12 @@ ifeq (,$(SKIP_ME))
$(foreach p,$(filter-out $(me),$(platforms)),$(eval $(p) : $$(me)))
endif
OUTPUT_ROOT = $(abspath ../../build/devkit)
RESULT = $(OUTPUT_ROOT)/result
OUTPUTDIR = $(abspath ../../build/devkit)
RESULT = $(OUTPUTDIR)/result
submakevars = HOST=$@ BUILD=$(me) \
RESULT=$(RESULT) PREFIX=$(RESULT)/$@ \
OUTPUT_ROOT=$(OUTPUT_ROOT)
OUTPUTDIR=$(OUTPUTDIR)
$(platforms) :
@echo 'Building compilers for $@'
@echo 'Targets: $(platforms)'

View file

@ -121,13 +121,13 @@ else
endif
# Define directories
RESULT := $(OUTPUT_ROOT)/result
BUILDDIR := $(OUTPUT_ROOT)/$(HOST)/$(TARGET)
RESULT := $(OUTPUTDIR)/result
BUILDDIR := $(OUTPUTDIR)/$(HOST)/$(TARGET)
PREFIX := $(RESULT)/$(HOST)
TARGETDIR := $(PREFIX)/$(TARGET)
SYSROOT := $(TARGETDIR)/sysroot
DOWNLOAD := $(OUTPUT_ROOT)/download
SRCDIR := $(OUTPUT_ROOT)/src
DOWNLOAD := $(OUTPUTDIR)/download
SRCDIR := $(OUTPUTDIR)/src
# Marker file for unpacking rpms
rpms := $(SYSROOT)/rpms_unpacked

View file

@ -72,7 +72,7 @@ $(CHARSET_DONE_CS)-euctw: $(CHARSET_COPYRIGHT_HEADER)/EUC_TW.java \
$(CHARSET_GENSRC_JAVA_DIR_CS)/sjis0213.dat: $(CHARSET_DATA_DIR)/sjis0213.map \
$(BUILD_TOOLS_JDK)
$(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@))
$(call MakeDir, $(@D))
$(TOOL_CHARSETMAPPING) '$<' '$@' sjis0213

View file

@ -117,7 +117,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
$(GENSRC_OSX_ICONS): $(GENSRC_OSX_ICONS_SRC) $(BUILD_TOOLS_JDK)
$(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $@))
$(call MakeDir, $(@D))
$(RM) $@ $@.tmp
$(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp

View file

@ -99,7 +99,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
# Run the ProjectCreator tool
PROJECT_CREATOR_TOOL := $(JAVA_SMALL) -cp $(TOOLS_OUTPUTDIR) build.tools.projectcreator.ProjectCreator
IDE_OUTPUTDIR := $(BUILD_OUTPUT)/ide/hotspot-visualstudio
IDE_OUTPUTDIR := $(OUTPUTDIR)/ide/hotspot-visualstudio
VCPROJ_FILE := $(IDE_OUTPUTDIR)/jvm.vcxproj

View file

@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 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
@ -36,7 +36,7 @@ ifneq ($(OPENJDK_TARGET_OS), windows)
ifeq ($(STATIC_BUILD), false)
ifeq ($(OPENJDK_TARGET_OS), linux)
LIBJSIG_CFLAGS := -fPIC -D_GNU_SOURCE -D_REENTRANT $(EXTRA_CFLAGS)
LIBJSIG_LDFLAGS := $(LDFLAGS_HASH_STYLE) $(EXTRA_CFLAGS)
LIBJSIG_LDFLAGS := $(LDFLAGS_HASH_STYLE) ${LDFLAGS_NO_EXEC_STACK} $(EXTRA_CFLAGS)
LIBJSIG_LIBS := $(LIBDL)
# NOTE: The old build compiled this library without -soname.

View file

@ -22,11 +22,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/jdk.jshell" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/jdk.javadoc" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/make" />
<excludeFolder url="file://$MODULE_DIR$/src" />
<excludeFolder url="file://$MODULE_DIR$/test" />
</content>
<content url="file://$MODULE_DIR$/test/langtools"/>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="inheritedJdk" />
</component>

View file

@ -57,8 +57,8 @@ public class TransitiveDependencies {
}
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
List<String> options = Arrays.asList("-source", "9",
"-target", "9",
List<String> options = Arrays.asList("-source", "10",
"-target", "10",
"-proc:only",
"--system", "none",
"--module-source-path", args[0],

View file

@ -1,33 +0,0 @@
#
# Copyright (c) 2011, 2016, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
include LauncherCommon.gmk
ifeq ($(ENABLE_HEADLESS_ONLY), false)
$(eval $(call SetupBuildLauncher, policytool, \
MAIN_CLASS := sun.security.tools.policytool.PolicyTool, \
LIBS_unix := $(X_LIBS), \
))
endif

View file

@ -1,5 +1,5 @@
#
# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 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
@ -74,17 +74,16 @@ SUNWprivate_1.1 {
JNU_ThrowStringIndexOutOfBoundsException;
JNU_ToString;
Java_java_io_FileDescriptor_close;
Java_java_io_FileDescriptor_initIDs;
Java_java_io_FileDescriptor_sync;
Java_java_io_FileDescriptor_getAppend;
Java_java_io_FileInputStream_available0;
Java_java_io_FileInputStream_close0;
Java_java_io_FileInputStream_initIDs;
Java_java_io_FileInputStream_open0;
Java_java_io_FileInputStream_read0;
Java_java_io_FileInputStream_readBytes;
Java_java_io_FileInputStream_skip0;
Java_java_io_FileOutputStream_close0;
Java_java_io_FileOutputStream_initIDs;
Java_java_io_FileOutputStream_open0;
Java_java_io_FileOutputStream_write;
@ -95,7 +94,6 @@ SUNWprivate_1.1 {
Java_java_io_ObjectOutputStream_floatsToBytes;
Java_java_io_ObjectStreamClass_hasStaticInitializer;
Java_java_io_ObjectStreamClass_initNative;
Java_java_io_RandomAccessFile_close0;
Java_java_io_RandomAccessFile_getFilePointer;
Java_java_io_RandomAccessFile_initIDs;
Java_java_io_RandomAccessFile_length;

View file

@ -219,7 +219,8 @@
<target name="-define-nashorn-task">
<ant dir="${nashorntask.dir}" inheritAll="false"/>
<taskdef name="nashorn" classname="jdk.nashorn.ant.NashornTask" classpath="${nashorntask.dir}/dist/nashorntask.jar"/>
<taskdef name="nashorn" classname="jdk.nashorn.ant.NashornTask"
classpath="${nashorntask.dist.dir}/nashorntask.jar"/>
</target>
<!--

View file

@ -174,8 +174,6 @@
<target name="compile" depends="prepare" description="Compiles nashorn">
<javac srcdir="${dynalink.module.src.dir}"
destdir="${dynalink.module.classes.dir}"
source="${javac.source}"
target="${javac.target}"
debug="${javac.debug}"
encoding="${javac.encoding}"
includeantruntime="false" fork="true">
@ -190,8 +188,6 @@
</delete>
<javac srcdir="${nashorn.module.src.dir}"
destdir="${nashorn.module.classes.dir}"
source="${javac.source}"
target="${javac.target}"
debug="${javac.debug}"
encoding="${javac.encoding}"
includeantruntime="false" fork="true">
@ -207,8 +203,6 @@
</delete>
<javac srcdir="${nashorn.shell.module.src.dir}"
destdir="${nashorn.shell.module.classes.dir}"
source="${javac.source}"
target="${javac.target}"
debug="${javac.debug}"
encoding="${javac.encoding}"
includeantruntime="false" fork="true">
@ -271,17 +265,16 @@
<target name="javadoc" depends="jar">
<javadoc destdir="${dist.javadoc.dir}" use="yes"
windowtitle="${nashorn.product.name} ${nashorn.version}"
additionalparam="-quiet" failonerror="true" useexternalfile="true">
additionalparam="-quiet" failonerror="true" useexternalfile="true">
<arg value="--patch-module"/>
<arg value="jdk.scripting.nashorn=${basedir}/${nashorn.module.src.dir}"/>
<arg value="--patch-module"/>
<arg value="jdk.dynalink=${basedir}/${dynalink.module.src.dir}"/>
<arg value="--module-source-path"/>
<arg value="${nashorn.module.src.dir}"/>
<arg value="--module-source-path"/>
<arg value="${dynalink.module.src.dir}"/>
<arg value="."/>
<arg value="${javadoc.option}"/>
<classpath>
<pathelement location="${build.classes.dir}"/>
</classpath>
<fileset dir="${dynalink.module.src.dir}" includes="**/*.java"/>
<fileset dir="${nashorn.module.src.dir}" includes="**/*.java"/>
<fileset dir="${dynalink.module.src.dir}" includes="**/*.java"/>
<link href="http://docs.oracle.com/javase/8/docs/api/"/>
</javadoc>
</target>
@ -290,14 +283,15 @@
<target name="nashornapi" depends="jar">
<mkdir dir="${dist.nashornapi.javadoc.dir}"/>
<javadoc destdir="${dist.nashornapi.javadoc.dir}" use="yes"
extdirs="${nashorn.ext.path}" windowtitle="${nashorn.product.name} ${nashorn.version}"
windowtitle="${nashorn.product.name} ${nashorn.version}"
additionalparam="-quiet" failonerror="true" useexternalfile="true">
<arg value="--patch-module"/>
<arg value="jdk.scripting.nashorn=${basedir}/${nashorn.module.src.dir}"/>
<arg value="--patch-module"/>
<arg value="jdk.dynalink=${basedir}/${dynalink.module.src.dir}"/>
<arg value="--module-source-path"/>
<arg value="${nashorn.module.src.dir}"/>
<arg value="."/>
<arg value="${javadoc.option}"/>
<classpath>
<pathelement location="${build.classes.dir}"/>
</classpath>
<fileset dir="${nashorn.module.src.dir}" includes="jdk/nashorn/api/**/*.java"/>
<link href="http://docs.oracle.com/javase/8/docs/api/"/>
</javadoc>
@ -309,30 +303,22 @@
<javadoc destdir="${dist.dynalinkapi.javadoc.dir}" use="yes"
windowtitle="Dynalink"
additionalparam="-quiet" failonerror="true" useexternalfile="true">
<arg value="--patch-module"/>
<arg value="jdk.scripting.nashorn=${basedir}/${nashorn.module.src.dir}"/>
<arg value="--patch-module"/>
<arg value="jdk.dynalink=${basedir}/${dynalink.module.src.dir}"/>
<arg value="--module-source-path"/>
<arg value="${dynalink.module.src.dir}"/>
<arg value="."/>
<arg value="${javadoc.option}"/>
<classpath>
<pathelement location="${build.classes.dir}"/>
</classpath>
<fileset dir="${dynalink.module.src.dir}" includes="**/*.java" excludes="jdk/dynalink/internal/*.java"/>
<fileset dir="${dynalink.module.src.dir}" includes="**/*.java"/>
<link href="http://docs.oracle.com/javase/8/docs/api/"/>
</javadoc>
</target>
<target name="javadocapi" depends="nashornapi, dynalinkapi"/>
<!-- generate shell.html for shell tool documentation -->
<target name="shelldoc" depends="jar">
<java classname="${nashorn.shell.tool}" dir="${basedir}" output="${dist.dir}/shell.html" failonerror="true" fork="true">
<jvmarg line="${nashorn.override.option}"/>
<arg value="-scripting"/>
<arg value="docs/genshelldoc.js"/>
</java>
</target>
<!-- generate all docs -->
<target name="docs" depends="javadoc, shelldoc"/>
<target name="docs" depends="javadoc"/>
<!-- create .zip and .tar.gz for nashorn binaries and scripts. -->
<target name="dist" depends="jar">
@ -350,8 +336,6 @@
<javac srcdir="${test.src.dir}"
destdir="${build.test.classes.dir}"
classpath="${javac.test.classpath}"
source="${javac.source}"
target="${javac.target}"
debug="${javac.debug}"
encoding="${javac.encoding}"
includeantruntime="false" fork="true">
@ -359,7 +343,7 @@
<compilerarg value="-Xlint:unchecked"/>
<compilerarg value="-Xlint:deprecation"/>
<compilerarg value="-Xdiags:verbose"/>
<compilerarg line="${test.module.imports}"/>
<compilerarg line="${test.module.imports.compile.time}"/>
</javac>
<copy todir="${build.test.classes.dir}/META-INF/services">
@ -614,7 +598,7 @@ grant codeBase "file:/${basedir}/${test.script.dir}/basic/JDK-8158467.js" {
</testng>
</target>
<target name="test" depends="prepare, test-pessimistic, test-optimistic"/>
<target name="test" depends="prepare, javadoc, test-pessimistic, test-optimistic"/>
<target name="test-optimistic" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-security-config" if="testng.available">
<echo message="Running test suite in OPTIMISTIC mode..."/>
@ -752,7 +736,7 @@ grant codeBase "file:/${basedir}/${test.script.dir}/basic/JDK-8158467.js" {
<target name="run" depends="jar"
description="Run the shell with a sample script">
<java classname="${nashorn.shell.tool}" fork="true" dir="samples">
<java classname="${nashorn.shell.tool}" fork="true" dir="${basedir}/src/sample/nashorn">
<jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
<arg value="-dump-on-error"/>
<arg value="test.js"/>
@ -761,7 +745,7 @@ grant codeBase "file:/${basedir}/${test.script.dir}/basic/JDK-8158467.js" {
<target name="debug" depends="jar"
description="Debug the shell with a sample script">
<java classname="${nashorn.shell.tool}" fork="true" dir="samples">
<java classname="${nashorn.shell.tool}" fork="true" dir="${basedir}/src/sample/nashorn">
<jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx}"/>
<arg value="--print-code"/>
<arg value="--verify-code"/>

View file

@ -24,8 +24,6 @@ application.title=nasgen
# source and target levels
build.compiler=modern
javac.source=1.7
javac.target=1.7
# This directory is removed when the project is cleaned:
nasgen.build.dir=../../../../build/nashorn/nasgen

View file

@ -27,18 +27,18 @@
</target>
<target name="prepare" depends="init">
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${nashorntask.build.classes.dir}"/>
<mkdir dir="${nashorntask.dist.dir}"/>
</target>
<target name="clean" depends="init">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${nashorntask.build.dir}"/>
<delete dir="${nashorntask.dist.dir}"/>
</target>
<target name="compile" depends="prepare" description="Compiles the nashorn ant tag sources">
<javac srcdir="${src.dir}"
destdir="${build.classes.dir}"
destdir="${nashorntask.build.classes.dir}"
debug="${javac.debug}"
includeantruntime="true">
<compilerarg value="-Xlint:unchecked"/>
@ -47,7 +47,7 @@
</target>
<target name="jar" depends="compile" description="Creates nashorntask.jar">
<jar jarfile="${dist.jar}" basedir="${build.classes.dir}"/>
<jar jarfile="${nashorntask.dist.jar}" basedir="${nashorntask.build.classes.dir}"/>
</target>
<target name="dist" depends="jar"/>

View file

@ -24,17 +24,15 @@ application.title=nashorntask
# source and target levels
build.compiler=modern
javac.source=1.8
javac.target=1.8
build.classes.dir=${build.dir}/classes
# This directory is removed when the project is cleaned:
build.dir=build
nashorntask.build.dir=../../../../build/nashorn/nashorntask
nashorntask.build.classes.dir=${nashorntask.build.dir}/classes
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/nashorntask.jar
dist.javadoc.dir=${dist.dir}/javadoc
nashorntask.dist.dir=${nashorntask.build.dir}/dist
nashorntask.dist.jar=${nashorntask.dist.dir}/nashorntask.jar
nashorntask.dist.javadoc.dir=${nashorntask.dist.dir}/javadoc
javac.debug=true
src.dir=src

View file

@ -32,8 +32,6 @@ jdk.jline.src.dir=src/jdk.internal.le/share/classes
# source and target levels
build.compiler=modern
javac.source=1.9
javac.target=1.9
javadoc.option=\
-tag "implSpec:a:Implementation Requirements:" \
@ -60,7 +58,8 @@ nashorn.override.option=\
--patch-module jdk.dynalink=${build.classes.dir}/jdk.dynalink
# project directory of <nashorn> ant task
nashorntask.dir=buildtools/nashorntask
nashorntask.dir=${nashorn.make.dir}/buildtools/nashorntask
nashorntask.dist.dir=${build.dir}/nashorntask/dist
# nashorn Shell tool
nashorn.shell.tool=jdk.nashorn.tools.Shell
@ -145,7 +144,7 @@ javac.test.classpath=\
${file.reference.bsh.jar}${path.separator}\
${file.reference.snakeyaml.jar}
test.module.imports=\
test.module.imports.compile.time=\
--add-exports jdk.scripting.nashorn/jdk.nashorn.internal.ir=ALL-UNNAMED \
--add-exports jdk.scripting.nashorn/jdk.nashorn.internal.codegen=ALL-UNNAMED \
--add-exports jdk.scripting.nashorn/jdk.nashorn.internal.parser=ALL-UNNAMED \
@ -158,7 +157,10 @@ test.module.imports=\
--add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp=ALL-UNNAMED \
--add-exports jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp.joni=ALL-UNNAMED \
--add-exports jdk.scripting.nashorn/jdk.nashorn.tools=ALL-UNNAMED \
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
test.module.imports.runtime=\
${test.module.imports.compile.time} \
--add-opens jdk.scripting.nashorn/jdk.nashorn.internal.runtime=ALL-UNNAMED \
--add-opens jdk.scripting.nashorn/jdk.nashorn.internal.runtime.doubleconv=ALL-UNNAMED
@ -358,7 +360,7 @@ run.test.user.country=TR
run.test.jvmargs.common=\
-server \
${test.module.imports} \
${test.module.imports.runtime} \
${run.test.jvmargs.external} \
--add-modules jdk.scripting.nashorn.shell \
${nashorn.override.option} \

View file

@ -29,7 +29,7 @@
################################################################################
# Check that we are run via the wrapper generated by configure
if [ -z "$SRC_ROOT" ]; then
if [ -z "$TOPDIR" ]; then
echo "Error: You must run this script using build/[conf]/compare.sh"
exit 1
fi
@ -56,7 +56,7 @@ else
STAT_PRINT_SIZE="-c %s"
fi
COMPARE_EXCEPTIONS_INCLUDE="$SRC_ROOT/make/scripts/compare_exceptions.sh.incl"
COMPARE_EXCEPTIONS_INCLUDE="$TOPDIR/make/scripts/compare_exceptions.sh.incl"
if [ ! -e "$COMPARE_EXCEPTIONS_INCLUDE" ]; then
echo "Error: Cannot locate the exceptions file, it should have been here: $COMPARE_EXCEPTIONS_INCLUDE"
exit 1

View file

@ -86,7 +86,6 @@ if [ "$OPENJDK_TARGET_OS" = "linux" ]; then
./bin/keytool
./bin/orbd
./bin/pack200
./bin/policytool
./bin/rmic
./bin/rmid
./bin/rmiregistry
@ -219,7 +218,6 @@ if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ];
./bin/keytool
./bin/orbd
./bin/pack200
./bin/policytool
./bin/rmic
./bin/rmid
./bin/rmiregistry
@ -329,7 +327,6 @@ if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "sparcv9" ]
./bin/keytool
./bin/orbd
./bin/pack200
./bin/policytool
./bin/rmic
./bin/rmid
./bin/rmiregistry
@ -422,7 +419,6 @@ if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
./bin/ktab.exe
./bin/orbd.exe
./bin/pack200.exe
./bin/policytool.exe
./bin/rmic.exe
./bin/rmid.exe
./bin/rmiregistry.exe
@ -512,7 +508,6 @@ if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
./bin/keytool
./bin/orbd
./bin/pack200
./bin/policytool
./bin/rmic
./bin/rmid
./bin/rmiregistry

View file

@ -117,7 +117,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
BUILD_HOTSPOT_JTREG_EXECUTABLES_CFLAGS_exeFPRegs := -MT
endif
BUILD_HOTSPOT_JTREG_OUTPUT_DIR := $(BUILD_OUTPUT)/support/test/hotspot/jtreg/native
BUILD_HOTSPOT_JTREG_OUTPUT_DIR := $(OUTPUTDIR)/support/test/hotspot/jtreg/native
BUILD_HOTSPOT_JTREG_IMAGE_DIR := $(TEST_IMAGE_DIR)/hotspot/jtreg

View file

@ -47,7 +47,7 @@ BUILD_JDK_JTREG_NATIVE_SRC += \
$(TOPDIR)/test/jdk/java/lang/String/nativeEncoding \
#
BUILD_JDK_JTREG_OUTPUT_DIR := $(BUILD_OUTPUT)/support/test/jdk/jtreg/native
BUILD_JDK_JTREG_OUTPUT_DIR := $(OUTPUTDIR)/support/test/jdk/jtreg/native
BUILD_JDK_JTREG_IMAGE_DIR := $(TEST_IMAGE_DIR)/jdk/jtreg

View file

@ -1,24 +0,0 @@
." Copyright (c) 2001, 2012, 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.
."
.TH policytool 1 "07 May 2011"
.LP

View file

@ -149,7 +149,7 @@ Keystore implementations are provider-based, which means the application interfa
.PP
Applications can choose different types of keystore implementations from different providers, with the \f3getInstance\fR factory method in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information and the algorithms used to protect private keys in the keystore and the integrity of the keystore itself\&. Keystore implementations of different types are not compatible\&.
.PP
The \f3jarsigner\fR and \f3policytool\fR commands can read file-based keystores from any location that can be specified using a URL\&. In addition, these commands can read non-file-based keystores such as those provided by MSCAPI on Windows and PKCS11 on all platforms\&.
The \f3jarsigner\fR command can read file-based keystores from any location that can be specified using a URL\&. In addition, the command can read non-file-based keystores such as those provided by MSCAPI on Windows and PKCS11 on all platforms\&.
.PP
For the \f3jarsigner\fR and \f3keytool\fR commands, you can specify a keystore type at the command line with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIEdit\fR command in the \fIKeyStore\fR menu\&.
.PP

View file

@ -1231,7 +1231,7 @@ Keystore implementations are provider-based\&. More specifically, the applicatio
Applications can choose different types of keystore implementations from different providers, using the \f3getInstance\fR factory method supplied in the \f3KeyStore\fR class\&. A keystore type defines the storage and data format of the keystore information, and the algorithms used to protect private/secret keys in the keystore and the integrity of the keystore\&. Keystore implementations of different types are not compatible\&.
The \f3keytool\fR command works on any file-based keystore implementation\&. It treats the keystore location that is passed to it at the command line as a file name and converts it to a \f3FileInputStream\fR, from which it loads the keystore information\&.)The \f3jarsigner\fR and \f3policytool\fR commands can read a keystore from any location that can be specified with a URL\&.
The \f3keytool\fR command works on any file-based keystore implementation\&. It treats the keystore location that is passed to it at the command line as a file name and converts it to a \f3FileInputStream\fR, from which it loads the keystore information\&.)The \f3jarsigner\fR command can read a keystore from any location that can be specified with a URL\&.
For \f3keytool\fR and \f3jarsigner\fR, you can specify a keystore type at the command line, with the \f3-storetype\fR option\&. For Policy Tool, you can specify a keystore type with the \fIKeystore\fR menu\&.

View file

@ -1,114 +0,0 @@
'\" t
.\" Copyright (c) 2001, 2015, 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.
.\"
.\" Arch: generic
.\" Software: JDK 8
.\" Date: 03 March 2015
.\" SectDesc: Security Tools
.\" Title: policytool.1
.\"
.if n .pl 99999
.TH policytool 1 "03 March 2015" "JDK 8" "Security Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH NAME
policytool \- Reads and writes a plain text policy file based on user input through the utility GUI\&.
.SH SYNOPSIS
.sp
.nf
\fBpolicytool\fR [ \fB\-file\fR ] [ \fIfilename\fR ]
.fi
.sp
.TP
-file
.br
Directs the \f3policytool\fR command to load a policy file\&.
.TP
\fIfilename\fR
The name of the file to be loaded\&.
.PP
\fIExamples\fR:
.PP
Run the policy tool administrator utility:
.sp
.nf
\f3policytool\fP
.fi
.nf
\f3\fP
.fi
.sp
Run the \f3policytool\fR command and load the specified file:
.sp
.nf
\f3policytool \-file \fImypolicyfile\fR\fP
.fi
.nf
\f3\fP
.fi
.sp
.SH DESCRIPTION
The \f3policytool\fR command calls an administrator\&'s GUI that enables system administrators to manage the contents of local policy files\&. A policy file is a plain-text file with a \f3\&.policy\fR extension, that maps remote requestors by domain, to permission objects\&. For details, see Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
.SH OPTIONS
.TP
-file
.br
Directs the \f3policytool\fR command to load a policy file\&.
.SH SEE\ ALSO
.TP 0.2i
\(bu
Default Policy Implementation and Policy File Syntax at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyFiles\&.html
.TP 0.2i
\(bu
Policy File Creation and Management at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/PolicyGuide\&.html
.TP 0.2i
\(bu
Permissions in Java SE Development Kit (JDK) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/permissions\&.html
.TP 0.2i
\(bu
Java Security Overview at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/overview/jsoverview\&.html
.TP 0.2i
\(bu
Java Cryptography Architecture (JCA) Reference Guide at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/security/crypto/CryptoSpec\&.html
.RE
.br
'pl 8.5i
'bp

View file

@ -100,9 +100,6 @@ When necessary, a security policy can be specified with the following option:
.SH SEE\ ALSO
.TP 0.2i
\(bu
policytool(1)
.TP 0.2i
\(bu
The \f3java\&.io\&.ObjectStream\fR class description at http://docs\&.oracle\&.com/javase/8/docs/api/java/io/ObjectStreamClass\&.html
.RE
.br

View file

@ -31,7 +31,7 @@ RuntimePermission "queuePrintJob"
The program will run without these properties set,
but some of its features will be limited.
To enable all features, please add these permissions with policytool.
To enable all features, please add these permissions.
-----------------------------------------------------------------------
Introduction

View file

@ -73,6 +73,9 @@
#include "utilities/nativeCallStack.hpp"
#endif // INCLUDE_NMT
#ifdef LINUX
#include "utilities/elfFile.hpp"
#endif
#define SIZE_T_MAX_VALUE ((size_t) -1)
@ -1823,6 +1826,20 @@ WB_ENTRY(void, WB_RemoveCompilerDirective(JNIEnv* env, jobject o, jint count))
DirectivesStack::pop(count);
WB_END
// Checks that the library libfile has the noexecstack bit set.
WB_ENTRY(jboolean, WB_CheckLibSpecifiesNoexecstack(JNIEnv* env, jobject o, jstring libfile))
jboolean ret = false;
#ifdef LINUX
// Can't be in VM when we call JNI.
ThreadToNativeFromVM ttnfv(thread);
const char* lf = env->GetStringUTFChars(libfile, NULL);
CHECK_JNI_EXCEPTION_(env, 0);
ret = (jboolean) ElfFile::specifies_noexecstack(lf);
env->ReleaseStringUTFChars(libfile, lf);
#endif
return ret;
WB_END
#define CC (char*)
static JNINativeMethod methods[] = {
@ -2027,6 +2044,8 @@ static JNINativeMethod methods[] = {
(void*)&WB_GetConcurrentGCPhases},
{CC"requestConcurrentGCPhase0", CC"(Ljava/lang/String;)Z",
(void*)&WB_RequestConcurrentGCPhase},
{CC"checkLibSpecifiesNoexecstack", CC"(Ljava/lang/String;)Z",
(void*)&WB_CheckLibSpecifiesNoexecstack},
};
#undef CC

View file

@ -341,7 +341,7 @@ class FileInputStream extends InputStream
fd.closeAll(new Closeable() {
public void close() throws IOException {
close0();
fd.close();
}
});
}
@ -403,7 +403,6 @@ class FileInputStream extends InputStream
private static native void initIDs();
private native void close0() throws IOException;
static {
initIDs();

View file

@ -365,7 +365,7 @@ class FileOutputStream extends OutputStream
fd.closeAll(new Closeable() {
public void close() throws IOException {
close0();
fd.close();
}
});
}
@ -458,8 +458,6 @@ class FileOutputStream extends OutputStream
}
}
private native void close0() throws IOException;
private static native void initIDs();
static {

View file

@ -648,7 +648,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
fd.closeAll(new Closeable() {
public void close() throws IOException {
close0();
fd.close();
}
});
}
@ -1177,8 +1177,6 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
private static native void initIDs();
private native void close0() throws IOException;
static {
initIDs();
SharedSecrets.setJavaIORandomAccessFileAccess(new JavaIORandomAccessFileAccess()

View file

@ -2160,10 +2160,12 @@ public abstract class ClassLoader {
* if a package of the given {@code name} is already
* defined by this class loader
*
*
* @since 1.2
* @revised 9
* @spec JPMS
*
* @jvms 5.3 Run-time package
* @see <a href="{@docRoot}/../specs/jar/jar.html#sealing">
* The JAR File Specification: Package Sealing</a>
*/
@ -2186,17 +2188,19 @@ public abstract class ClassLoader {
}
/**
* Returns a {@code Package} of the given <a href="#name">name</a> that has been
* defined by this class loader.
* Returns a {@code Package} of the given <a href="#name">name</a> that
* has been defined by this class loader.
*
* @param name The <a href="#name">package name</a>
*
* @return The {@code Package} of the given name defined by this class loader,
* or {@code null} if not found
* @return The {@code Package} of the given name that has been defined
* by this class loader, or {@code null} if not found
*
* @throws NullPointerException
* if {@code name} is {@code null}.
*
* @jvms 5.3 Run-time package
*
* @since 9
* @spec JPMS
*/
@ -2211,14 +2215,18 @@ public abstract class ClassLoader {
}
/**
* Returns all of the {@code Package}s defined by this class loader.
* The returned array has no duplicated {@code Package}s of the same name.
* Returns all of the {@code Package}s that have been defined by
* this class loader. The returned array has no duplicated {@code Package}s
* of the same name.
*
* @apiNote This method returns an array rather than a {@code Set} or {@code Stream}
* for consistency with the existing {@link #getPackages} method.
*
* @return The array of {@code Package} objects defined by this class loader;
* or an zero length array if no package has been defined by this class loader.
* @return The array of {@code Package} objects that have been defined by
* this class loader; or an zero length array if no package has been
* defined by this class loader.
*
* @jvms 5.3 Run-time package
*
* @since 9
* @spec JPMS
@ -2244,7 +2252,7 @@ public abstract class ClassLoader {
* @param name
* The <a href="#name">package name</a>
*
* @return The {@code Package} corresponding to the given name defined by
* @return The {@code Package} of the given name that has been defined by
* this class loader or its ancestors, or {@code null} if not found.
*
* @throws NullPointerException
@ -2263,6 +2271,8 @@ public abstract class ClassLoader {
* {@link ClassLoader#getDefinedPackage} method which returns
* a {@code Package} for the specified class loader.
*
* @see ClassLoader#getDefinedPackage(String)
*
* @since 1.2
* @revised 9
* @spec JPMS
@ -2281,10 +2291,10 @@ public abstract class ClassLoader {
}
/**
* Returns all of the {@code Package}s defined by this class loader
* and its ancestors. The returned array may contain more than one
* {@code Package} object of the same package name, each defined by
* a different class loader in the class loader hierarchy.
* Returns all of the {@code Package}s that have been defined by
* this class loader and its ancestors. The returned array may contain
* more than one {@code Package} object of the same package name, each
* defined by a different class loader in the class loader hierarchy.
*
* @apiNote The {@link #getPlatformClassLoader() platform class loader}
* may delegate to the application class loader. In other words,
@ -2294,8 +2304,10 @@ public abstract class ClassLoader {
* when invoked on the platform class loader, this method will not
* return any packages defined to the application class loader.
*
* @return The array of {@code Package} objects defined by this
* class loader and its ancestors
* @return The array of {@code Package} objects that have been defined by
* this class loader and its ancestors
*
* @see ClassLoader#getDefinedPackages()
*
* @since 1.2
* @revised 9

View file

@ -151,9 +151,9 @@ final class ProcessHandleImpl implements ProcessHandle {
} catch (InterruptedException ie) {
// ignore and retry
}
startTime = isAlive0(pid); // recheck if is alive
if (origStart > 0 && startTime != origStart) {
// start time changed, pid is not the same process
startTime = isAlive0(pid); // recheck if it is alive
if (startTime > 0 && origStart > 0 && startTime != origStart) {
// start time changed (and is not zero), pid is not the same process
break;
}
}

View file

@ -344,13 +344,21 @@ public class CallSite {
break;
default:
final int NON_SPREAD_ARG_COUNT = 3; // (caller, name, type)
if (NON_SPREAD_ARG_COUNT + argv.length > MethodType.MAX_MH_ARITY)
throw new BootstrapMethodError("too many bootstrap method arguments");
MethodType invocationType = MethodType.genericMethodType(NON_SPREAD_ARG_COUNT + argv.length);
MethodHandle typedBSM = bootstrapMethod.asType(invocationType);
MethodHandle spreader = invocationType.invokers().spreadInvoker(NON_SPREAD_ARG_COUNT);
binding = spreader.invokeExact(typedBSM, (Object) caller, (Object) name, (Object) type, argv);
final int MAX_SAFE_SIZE = MethodType.MAX_MH_ARITY / 2 - NON_SPREAD_ARG_COUNT;
if (argv.length >= MAX_SAFE_SIZE) {
// to be on the safe side, use invokeWithArguments which handles jumbo lists
Object[] newargv = new Object[NON_SPREAD_ARG_COUNT + argv.length];
newargv[0] = caller;
newargv[1] = name;
newargv[2] = type;
System.arraycopy(argv, 0, newargv, NON_SPREAD_ARG_COUNT, argv.length);
binding = bootstrapMethod.invokeWithArguments(newargv);
} else {
MethodType invocationType = MethodType.genericMethodType(NON_SPREAD_ARG_COUNT + argv.length);
MethodHandle typedBSM = bootstrapMethod.asType(invocationType);
MethodHandle spreader = invocationType.invokers().spreadInvoker(NON_SPREAD_ARG_COUNT);
binding = spreader.invokeExact(typedBSM, (Object) caller, (Object) name, (Object) type, argv);
}
}
}
if (binding instanceof CallSite) {

View file

@ -28,6 +28,7 @@ package java.lang.invoke;
import java.util.Arrays;
import static java.lang.invoke.LambdaForm.*;
import static java.lang.invoke.LambdaForm.Kind.*;
import static java.lang.invoke.MethodHandleNatives.Constants.REF_invokeVirtual;
import static java.lang.invoke.MethodHandleStatics.*;
/**
@ -158,8 +159,11 @@ abstract class DelegatingMethodHandle extends MethodHandle {
static final NamedFunction NF_getTarget;
static {
try {
NF_getTarget = new NamedFunction(DelegatingMethodHandle.class
.getDeclaredMethod("getTarget"));
MemberName member = new MemberName(DelegatingMethodHandle.class, "getTarget",
MethodType.methodType(MethodHandle.class), REF_invokeVirtual);
NF_getTarget = new NamedFunction(
MemberName.getFactory()
.resolveOrFail(REF_invokeVirtual, member, DelegatingMethodHandle.class, NoSuchMethodException.class));
} catch (ReflectiveOperationException ex) {
throw newInternalError(ex);
}

View file

@ -753,42 +753,38 @@ class DirectMethodHandle extends MethodHandle {
return nf;
}
private static final MethodType OBJ_OBJ_TYPE = MethodType.methodType(Object.class, Object.class);
private static final MethodType LONG_OBJ_TYPE = MethodType.methodType(long.class, Object.class);
private static NamedFunction createFunction(byte func) {
try {
switch (func) {
case NF_internalMemberName:
return new NamedFunction(DirectMethodHandle.class
.getDeclaredMethod("internalMemberName", Object.class));
return getNamedFunction("internalMemberName", OBJ_OBJ_TYPE);
case NF_internalMemberNameEnsureInit:
return new NamedFunction(DirectMethodHandle.class
.getDeclaredMethod("internalMemberNameEnsureInit", Object.class));
return getNamedFunction("internalMemberNameEnsureInit", OBJ_OBJ_TYPE);
case NF_ensureInitialized:
return new NamedFunction(DirectMethodHandle.class
.getDeclaredMethod("ensureInitialized", Object.class));
return getNamedFunction("ensureInitialized", MethodType.methodType(void.class, Object.class));
case NF_fieldOffset:
return new NamedFunction(DirectMethodHandle.class
.getDeclaredMethod("fieldOffset", Object.class));
return getNamedFunction("fieldOffset", LONG_OBJ_TYPE);
case NF_checkBase:
return new NamedFunction(DirectMethodHandle.class
.getDeclaredMethod("checkBase", Object.class));
return getNamedFunction("checkBase", OBJ_OBJ_TYPE);
case NF_staticBase:
return new NamedFunction(DirectMethodHandle.class
.getDeclaredMethod("staticBase", Object.class));
return getNamedFunction("staticBase", OBJ_OBJ_TYPE);
case NF_staticOffset:
return new NamedFunction(DirectMethodHandle.class
.getDeclaredMethod("staticOffset", Object.class));
return getNamedFunction("staticOffset", LONG_OBJ_TYPE);
case NF_checkCast:
return new NamedFunction(DirectMethodHandle.class
.getDeclaredMethod("checkCast", Object.class, Object.class));
return getNamedFunction("checkCast", MethodType.methodType(Object.class, Object.class, Object.class));
case NF_allocateInstance:
return new NamedFunction(DirectMethodHandle.class
.getDeclaredMethod("allocateInstance", Object.class));
return getNamedFunction("allocateInstance", OBJ_OBJ_TYPE);
case NF_constructorMethod:
return new NamedFunction(DirectMethodHandle.class
.getDeclaredMethod("constructorMethod", Object.class));
return getNamedFunction("constructorMethod", OBJ_OBJ_TYPE);
case NF_UNSAFE:
return new NamedFunction(new MemberName(MethodHandleStatics.class
.getDeclaredField("UNSAFE")));
MemberName member = new MemberName(MethodHandleStatics.class, "UNSAFE", Unsafe.class, REF_getField);
return new NamedFunction(
MemberName.getFactory()
.resolveOrFail(REF_getField, member, DirectMethodHandle.class, NoSuchMethodException.class));
default:
throw newInternalError("Unknown function: " + func);
}
@ -797,6 +793,15 @@ class DirectMethodHandle extends MethodHandle {
}
}
private static NamedFunction getNamedFunction(String name, MethodType type)
throws ReflectiveOperationException
{
MemberName member = new MemberName(DirectMethodHandle.class, name, type, REF_invokeStatic);
return new NamedFunction(
MemberName.getFactory()
.resolveOrFail(REF_invokeStatic, member, DirectMethodHandle.class, NoSuchMethodException.class));
}
static {
// The Holder class will contain pre-generated DirectMethodHandles resolved
// speculatively using MemberName.getFactory().resolveOrNull. However, that

View file

@ -611,23 +611,17 @@ class Invokers {
try {
switch (func) {
case NF_checkExactType:
return new NamedFunction(Invokers.class
.getDeclaredMethod("checkExactType", MethodHandle.class, MethodType.class));
return getNamedFunction("checkExactType", MethodType.methodType(void.class, MethodHandle.class, MethodType.class));
case NF_checkGenericType:
return new NamedFunction(Invokers.class
.getDeclaredMethod("checkGenericType", MethodHandle.class, MethodType.class));
return getNamedFunction("checkGenericType", MethodType.methodType(MethodHandle.class, MethodHandle.class, MethodType.class));
case NF_getCallSiteTarget:
return new NamedFunction(Invokers.class
.getDeclaredMethod("getCallSiteTarget", CallSite.class));
return getNamedFunction("getCallSiteTarget", MethodType.methodType(MethodHandle.class, CallSite.class));
case NF_checkCustomized:
return new NamedFunction(Invokers.class
.getDeclaredMethod("checkCustomized", MethodHandle.class));
return getNamedFunction("checkCustomized", MethodType.methodType(void.class, MethodHandle.class));
case NF_checkVarHandleGenericType:
return new NamedFunction(Invokers.class
.getDeclaredMethod("checkVarHandleGenericType", VarHandle.class, VarHandle.AccessDescriptor.class));
return getNamedFunction("checkVarHandleGenericType", MethodType.methodType(MethodHandle.class, VarHandle.class, VarHandle.AccessDescriptor.class));
case NF_checkVarHandleExactType:
return new NamedFunction(Invokers.class
.getDeclaredMethod("checkVarHandleExactType", VarHandle.class, VarHandle.AccessDescriptor.class));
return getNamedFunction("checkVarHandleExactType", MethodType.methodType(MethodHandle.class, VarHandle.class, VarHandle.AccessDescriptor.class));
default:
throw newInternalError("Unknown function: " + func);
}
@ -636,6 +630,15 @@ class Invokers {
}
}
private static NamedFunction getNamedFunction(String name, MethodType type)
throws ReflectiveOperationException
{
MemberName member = new MemberName(Invokers.class, name, type, REF_invokeStatic);
return new NamedFunction(
MemberName.getFactory()
.resolveOrFail(REF_invokeStatic, member, Invokers.class, NoSuchMethodException.class));
}
private static class Lazy {
private static final MethodHandle MH_asSpreader;

View file

@ -584,10 +584,10 @@ public abstract class MethodHandle {
/*non-public*/ static native @PolymorphicSignature Object linkToInterface(Object... args) throws Throwable;
/**
* Performs a variable arity invocation, passing the arguments in the given list
* Performs a variable arity invocation, passing the arguments in the given array
* to the method handle, as if via an inexact {@link #invoke invoke} from a call site
* which mentions only the type {@code Object}, and whose arity is the length
* of the argument list.
* which mentions only the type {@code Object}, and whose actual argument count is the length
* of the argument array.
* <p>
* Specifically, execution proceeds as if by the following steps,
* although the methods are not guaranteed to be called if the JVM
@ -595,36 +595,104 @@ public abstract class MethodHandle {
* <ul>
* <li>Determine the length of the argument array as {@code N}.
* For a null reference, {@code N=0}. </li>
* <li>Determine the general type {@code TN} of {@code N} arguments as
* as {@code TN=MethodType.genericMethodType(N)}.</li>
* <li>Collect the {@code N} elements of the array as a logical
* argument list, each argument statically typed as an {@code Object}. </li>
* <li>Determine, as {@code M}, the parameter count of the type of this
* method handle. </li>
* <li>Determine the general type {@code TN} of {@code N} arguments or
* {@code M} arguments, if smaller than {@code N}, as
* {@code TN=MethodType.genericMethodType(Math.min(N, M))}.</li>
* <li>If {@code N} is greater than {@code M}, perform the following
* checks and actions to shorten the logical argument list: <ul>
* <li>Check that this method handle has variable arity with a
* {@linkplain MethodType#lastParameterType trailing parameter}
* of some array type {@code A[]}. If not, fail with a
* {@code WrongMethodTypeException}. </li>
* <li>Collect the trailing elements (there are {@code N-M+1} of them)
* from the logical argument list into a single array of
* type {@code A[]}, using {@code asType} conversions to
* convert each trailing argument to type {@code A}. </li>
* <li>If any of these conversions proves impossible, fail with either
* a {@code ClassCastException} if any trailing element cannot be
* cast to {@code A} or a {@code NullPointerException} if any
* trailing element is {@code null} and {@code A} is not a reference
* type. </li>
* <li>Replace the logical arguments gathered into the array of
* type {@code A[]} with the array itself, thus shortening
* the argument list to length {@code M}. This final argument
* retains the static type {@code A[]}.</li>
* <li>Adjust the type {@code TN} by changing the {@code N}th
* parameter type from {@code Object} to {@code A[]}.
* </ul>
* <li>Force the original target method handle {@code MH0} to the
* required type, as {@code MH1 = MH0.asType(TN)}. </li>
* <li>Spread the array into {@code N} separate arguments {@code A0, ...}. </li>
* <li>Spread the argument list into {@code N} separate arguments {@code A0, ...}. </li>
* <li>Invoke the type-adjusted method handle on the unpacked arguments:
* MH1.invokeExact(A0, ...). </li>
* <li>Take the return value as an {@code Object} reference. </li>
* </ul>
* <p>
* If the target method handle has variable arity, and the argument list is longer
* than that arity, the excess arguments, starting at the position of the trailing
* array argument, will be gathered (if possible, as if by {@code asType} conversions)
* into an array of the appropriate type, and invocation will proceed on the
* shortened argument list.
* In this way, <em>jumbo argument lists</em> which would spread into more
* than 254 slots can still be processed uniformly.
* <p>
* Unlike the {@link #invoke(Object...) generic} invocation mode, which can
* "recycle" an array argument, passing it directly to the target method,
* this invocation mode <em>always</em> creates a new array parameter, even
* if the original array passed to {@code invokeWithArguments} would have
* been acceptable as a direct argument to the target method.
* Even if the number {@code M} of actual arguments is the arity {@code N},
* and the last argument is dynamically a suitable array of type {@code A[]},
* it will still be boxed into a new one-element array, since the call
* site statically types the argument as {@code Object}, not an array type.
* This is not a special rule for this method, but rather a regular effect
* of the {@linkplain #asVarargsCollector rules for variable-arity invocation}.
* <p>
* Because of the action of the {@code asType} step, the following argument
* conversions are applied as necessary:
* <ul>
* <li>reference casting
* <li>unboxing
* <li>widening primitive conversions
* <li>variable arity conversion
* </ul>
* <p>
* The result returned by the call is boxed if it is a primitive,
* or forced to null if the return type is void.
* <p>
* This call is equivalent to the following code:
* <blockquote><pre>{@code
* MethodHandle invoker = MethodHandles.spreadInvoker(this.type(), 0);
* Object result = invoker.invokeExact(this, arguments);
* }</pre></blockquote>
* <p>
* Unlike the signature polymorphic methods {@code invokeExact} and {@code invoke},
* {@code invokeWithArguments} can be accessed normally via the Core Reflection API and JNI.
* It can therefore be used as a bridge between native or reflective code and method handles.
* @apiNote
* This call is approximately equivalent to the following code:
* <blockquote><pre>{@code
* // for jumbo argument lists, adapt varargs explicitly:
* int N = (arguments == null? 0: arguments.length);
* int M = this.type.parameterCount();
* int MAX_SAFE = 127; // 127 longs require 254 slots, which is OK
* if (N > MAX_SAFE && N > M && this.isVarargsCollector()) {
* Class<?> arrayType = this.type().lastParameterType();
* Class<?> elemType = arrayType.getComponentType();
* if (elemType != null) {
* Object args2 = Array.newInstance(elemType, M);
* MethodHandle arraySetter = MethodHandles.arrayElementSetter(arrayType);
* for (int i = 0; i < M; i++) {
* arraySetter.invoke(args2, i, arguments[M-1 + i]);
* }
* arguments = Arrays.copyOf(arguments, M);
* arguments[M-1] = args2;
* return this.asFixedArity().invokeWithArguments(arguments);
* }
* } // done with explicit varargs processing
*
* // Handle fixed arity and non-jumbo variable arity invocation.
* MethodHandle invoker = MethodHandles.spreadInvoker(this.type(), 0);
* Object result = invoker.invokeExact(this, arguments);
* }</pre></blockquote>
*
* @param arguments the arguments to pass to the target
* @return the result returned by the target
@ -634,20 +702,24 @@ public abstract class MethodHandle {
* @see MethodHandles#spreadInvoker
*/
public Object invokeWithArguments(Object... arguments) throws Throwable {
// Note: Jumbo argument lists are handled in the variable-arity subclass.
MethodType invocationType = MethodType.genericMethodType(arguments == null ? 0 : arguments.length);
return invocationType.invokers().spreadInvoker(0).invokeExact(asType(invocationType), arguments);
}
/**
* Performs a variable arity invocation, passing the arguments in the given array
* Performs a variable arity invocation, passing the arguments in the given list
* to the method handle, as if via an inexact {@link #invoke invoke} from a call site
* which mentions only the type {@code Object}, and whose arity is the length
* of the argument array.
* which mentions only the type {@code Object}, and whose actual argument count is the length
* of the argument list.
* <p>
* This method is also equivalent to the following code:
* <blockquote><pre>{@code
* invokeWithArguments(arguments.toArray())
* }</pre></blockquote>
* <p>
* Jumbo-sized lists are acceptable if this method handle has variable arity.
* See {@link #invokeWithArguments(Object[])} for details.
*
* @param arguments the arguments to pass to the target
* @return the result returned by the target
@ -987,6 +1059,16 @@ assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray
* disturbing its variable arity property:
* {@code mh.asType(mh.type().changeParameterType(0,int.class))
* .withVarargs(mh.isVarargsCollector())}
* <p>
* This call is approximately equivalent to the following code:
* <blockquote><pre>{@code
* if (makeVarargs == isVarargsCollector())
* return this;
* else if (makeVarargs)
* return asVarargsCollector(type().lastParameterType());
* else
* return return asFixedArity();
* }</pre></blockquote>
* @param makeVarargs true if the return method handle should have variable arity behavior
* @return a method handle of the same type, with possibly adjusted variable arity behavior
* @throws IllegalArgumentException if {@code makeVarargs} is true and
@ -995,11 +1077,10 @@ assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray
* @see #asVarargsCollector
* @see #asFixedArity
*/
public MethodHandle withVarargs(boolean makeVarargs) {
if (!makeVarargs) {
return asFixedArity();
} else if (!isVarargsCollector()) {
return asVarargsCollector(type().lastParameterType());
public MethodHandle withVarargs(boolean makeVarargs) {
assert(!isVarargsCollector()); // subclass responsibility
if (makeVarargs) {
return asVarargsCollector(type().lastParameterType());
} else {
return this;
}
@ -1026,8 +1107,9 @@ assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray
* <p>
* (The array may also be a shared constant when {@code arrayLength} is zero.)
* <p>
* (<em>Note:</em> The {@code arrayType} is often identical to the last
* parameter type of the original target.
* (<em>Note:</em> The {@code arrayType} is often identical to the
* {@linkplain MethodType#lastParameterType last parameter type}
* of the original target.
* It is an explicit argument for symmetry with {@code asSpreader}, and also
* to allow the target to use a simple {@code Object} as its last parameter type.)
* <p>
@ -1168,7 +1250,9 @@ assertEquals("[123]", (String) longsToString.invokeExact((long)123));
* {@code invoke} and {@code asType} requests can lead to
* trailing positional arguments being collected into target's
* trailing parameter.
* Also, the last parameter type of the adapter will be
* Also, the
* {@linkplain MethodType#lastParameterType last parameter type}
* of the adapter will be
* {@code arrayType}, even if the target has a different
* last parameter type.
* <p>

View file

@ -523,6 +523,12 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
return asFixedArity();
}
@Override
public MethodHandle withVarargs(boolean makeVarargs) {
if (makeVarargs) return this;
return asFixedArity();
}
@Override
public MethodHandle asTypeUncached(MethodType newType) {
MethodType type = this.type();
@ -561,6 +567,49 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
: Arrays.asList(this, newType);
return true;
}
@Override
public Object invokeWithArguments(Object... arguments) throws Throwable {
MethodType type = this.type();
int argc;
final int MAX_SAFE = 127; // 127 longs require 254 slots, which is safe to spread
if (arguments == null
|| (argc = arguments.length) <= MAX_SAFE
|| argc < type.parameterCount()) {
return super.invokeWithArguments(arguments);
}
// a jumbo invocation requires more explicit reboxing of the trailing arguments
int uncollected = type.parameterCount() - 1;
Class<?> elemType = arrayType.getComponentType();
int collected = argc - uncollected;
Object collArgs = (elemType == Object.class)
? new Object[collected] : Array.newInstance(elemType, collected);
if (!elemType.isPrimitive()) {
// simple cast: just do some casting
try {
System.arraycopy(arguments, uncollected, collArgs, 0, collected);
} catch (ArrayStoreException ex) {
return super.invokeWithArguments(arguments);
}
} else {
// corner case of flat array requires reflection (or specialized copy loop)
MethodHandle arraySetter = MethodHandles.arrayElementSetter(arrayType);
try {
for (int i = 0; i < collected; i++) {
arraySetter.invoke(collArgs, i, arguments[uncollected + i]);
}
} catch (WrongMethodTypeException|ClassCastException ex) {
return super.invokeWithArguments(arguments);
}
}
// chop the jumbo list down to size and call in non-varargs mode
Object[] newArgs = new Object[uncollected + 1];
System.arraycopy(arguments, 0, newArgs, 0, uncollected);
newArgs[uncollected] = collArgs;
return asFixedArity().invokeWithArguments(newArgs);
}
}
/** Factory method: Spread selected argument. */

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 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
@ -759,7 +759,23 @@ class MethodType implements java.io.Serializable {
return Collections.unmodifiableList(Arrays.asList(ptypes.clone()));
}
/*non-public*/ Class<?> lastParameterType() {
/**
* Returns the last parameter type of this method type.
* If this type has no parameters, the sentinel value
* {@code void.class} is returned instead.
* @apiNote
* <p>
* The sentinel value is chosen so that reflective queries can be
* made directly against the result value.
* The sentinel value cannot be confused with a real parameter,
* since {@code void} is never acceptable as a parameter type.
* For variable arity invocation modes, the expression
* {@link Class#getComponentType lastParameterType().getComponentType()}
* is useful to query the type of the "varargs" parameter.
* @return the last parameter type if any, else {@code void.class}
* @since 10
*/
public Class<?> lastParameterType() {
int len = ptypes.length;
return len == 0 ? void.class : ptypes[len-1];
}

View file

@ -81,12 +81,19 @@
* in which dynamic call site occurs </li>
* <li>a {@code String}, the method name mentioned in the call site </li>
* <li>a {@code MethodType}, the resolved type descriptor of the call </li>
* <li>optionally, between 1 and 251 additional static arguments taken from the constant pool </li>
* <li>optionally, any number of additional static arguments taken from the constant pool </li>
* </ul>
* Invocation is as if by
* {@link java.lang.invoke.MethodHandle#invoke MethodHandle.invoke}.
* The returned result must be a {@link java.lang.invoke.CallSite CallSite}
* (or a subclass), otherwise a
* <p>
* In all cases, bootstrap method invocation is as if by
* {@link java.lang.invoke.MethodHandle#invokeWithArguments MethodHandle.invokeWithArguments},
* (This is also equivalent to
* {@linkplain java.lang.invoke.MethodHandle#invoke generic invocation}
* if the number of arguments is small enough.)
* <p>
* For an {@code invokedynamic} instruction, the
* returned result must be convertible to a non-null reference to a
* {@link java.lang.invoke.CallSite CallSite}.
* If the returned result cannot be converted to the expected type,
* {@link java.lang.BootstrapMethodError BootstrapMethodError} is thrown.
* The type of the call site's target must be exactly equal to the type
* derived from the dynamic call site's type descriptor and passed to
@ -150,10 +157,12 @@
* If the {@code invokedynamic} instruction specifies one or more static arguments,
* those values will be passed as additional arguments to the method handle.
* (Note that because there is a limit of 255 arguments to any method,
* at most 251 extra arguments can be supplied, since the bootstrap method
* at most 251 extra arguments can be supplied to a non-varargs bootstrap method,
* since the bootstrap method
* handle itself and its first three arguments must also be stacked.)
* The bootstrap method will be invoked as if by either {@code MethodHandle.invoke}
* or {@code invokeWithArguments}. (There is no way to tell the difference.)
* The bootstrap method will be invoked as if by {@code MethodHandle.invokeWithArguments}.
* A variable-arity bootstrap method can accept thousands of static arguments,
* subject only by limits imposed by the class-file format.
* <p>
* The normal argument conversion rules for {@code MethodHandle.invoke} apply to all stacked arguments.
* For example, if a pushed value is a primitive type, it may be converted to a reference by boxing conversion.
@ -194,9 +203,9 @@
* </tbody>
* </table>
* The last example assumes that the extra arguments are of type
* {@code CONSTANT_String} and {@code CONSTANT_Integer}, respectively.
* {@code String} and {@code Integer} (or {@code int}), respectively.
* The second-to-last example assumes that all extra arguments are of type
* {@code CONSTANT_String}.
* {@code String}.
* The other examples work with all types of extra arguments.
* <p>
* As noted above, the actual method type of the bootstrap method can vary.
@ -220,7 +229,7 @@
* to safely and compactly encode metadata.
* In principle, the name and extra arguments are redundant,
* since each call site could be given its own unique bootstrap method.
* Such a practice is likely to produce large class files and constant pools.
* Such a practice would be likely to produce large class files and constant pools.
*
* @author John Rose, JSR 292 EG
* @since 1.7

View file

@ -1122,30 +1122,36 @@ class ZipFile implements ZipConstants, Closeable {
zerror("zip comment read failed");
}
}
if (end.cenlen == ZIP64_MAGICVAL ||
end.cenoff == ZIP64_MAGICVAL ||
end.centot == ZIP64_MAGICCOUNT)
{
// need to find the zip64 end;
try {
byte[] loc64 = new byte[ZIP64_LOCHDR];
if (readFullyAt(loc64, 0, loc64.length, end.endpos - ZIP64_LOCHDR)
!= loc64.length || GETSIG(loc64) != ZIP64_LOCSIG) {
return end;
}
long end64pos = ZIP64_LOCOFF(loc64);
byte[] end64buf = new byte[ZIP64_ENDHDR];
if (readFullyAt(end64buf, 0, end64buf.length, end64pos)
!= end64buf.length || GETSIG(end64buf) != ZIP64_ENDSIG) {
return end;
}
// end64 found, re-calcualte everything.
end.cenlen = ZIP64_ENDSIZ(end64buf);
end.cenoff = ZIP64_ENDOFF(end64buf);
end.centot = (int)ZIP64_ENDTOT(end64buf); // assume total < 2g
end.endpos = end64pos;
} catch (IOException x) {} // no zip64 loc/end
}
// must check for a zip64 end record; it is always permitted to be present
try {
byte[] loc64 = new byte[ZIP64_LOCHDR];
if (end.endpos < ZIP64_LOCHDR ||
readFullyAt(loc64, 0, loc64.length, end.endpos - ZIP64_LOCHDR)
!= loc64.length || GETSIG(loc64) != ZIP64_LOCSIG) {
return end;
}
long end64pos = ZIP64_LOCOFF(loc64);
byte[] end64buf = new byte[ZIP64_ENDHDR];
if (readFullyAt(end64buf, 0, end64buf.length, end64pos)
!= end64buf.length || GETSIG(end64buf) != ZIP64_ENDSIG) {
return end;
}
// end64 candidate found,
long cenlen64 = ZIP64_ENDSIZ(end64buf);
long cenoff64 = ZIP64_ENDOFF(end64buf);
long centot64 = ZIP64_ENDTOT(end64buf);
// double-check
if (cenlen64 != end.cenlen && end.cenlen != ZIP64_MAGICVAL ||
cenoff64 != end.cenoff && end.cenoff != ZIP64_MAGICVAL ||
centot64 != end.centot && end.centot != ZIP64_MAGICCOUNT) {
return end;
}
// to use the end64 values
end.cenlen = cenlen64;
end.cenoff = cenoff64;
end.centot = (int)centot64; // assume total < 2g
end.endpos = end64pos;
} catch (IOException x) {} // no zip64 loc/end
return end;
}
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 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
@ -31,12 +31,13 @@ import java.io.FileDescriptor;
*/
public interface JavaIOFileDescriptorAccess {
public void set(FileDescriptor obj, int fd);
public int get(FileDescriptor fd);
public void setAppend(FileDescriptor obj, boolean append);
public boolean getAppend(FileDescriptor obj);
public void set(FileDescriptor fdo, int fd);
public int get(FileDescriptor fdo);
public void setAppend(FileDescriptor fdo, boolean append);
public boolean getAppend(FileDescriptor fdo);
public void close(FileDescriptor fdo);
// Only valid on Windows
public void setHandle(FileDescriptor obj, long handle);
public long getHandle(FileDescriptor obj);
public void setHandle(FileDescriptor fdo, long handle);
public long getHandle(FileDescriptor fdo);
}

View file

@ -271,7 +271,6 @@ module java.base {
java.rmi,
java.security.jgss,
jdk.crypto.cryptoki,
jdk.policytool,
jdk.security.auth;
exports sun.security.provider.certpath to
java.naming;
@ -294,7 +293,6 @@ module java.base {
jdk.crypto.ec,
jdk.crypto.cryptoki,
jdk.jartool,
jdk.policytool,
jdk.security.auth,
jdk.security.jgss;
exports sun.security.x509 to

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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
@ -144,7 +144,7 @@ public class FileChannelImpl
//
((java.io.Closeable)parent).close();
} else {
nd.close(fd);
fdAccess.close(fd);
}
}

View file

@ -1802,7 +1802,12 @@ public final class SSLSocketImpl extends BaseSSLSocketImpl {
try {
readRecord(true);
} catch (SocketTimeoutException e) {
// if time out, ignore the exception and continue
if ((debug != null) && Debug.isOn("ssl")) {
System.out.println(
Thread.currentThread().getName() +
", received Exception: " + e);
}
fatal((byte)(-1), "Did not receive close_notify from peer", e);
}
}
} catch (IOException e) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -28,6 +28,7 @@ package sun.security.util;
import java.security.*;
import java.util.HashMap;
import java.io.ByteArrayOutputStream;
import static java.nio.charset.StandardCharsets.UTF_8;
/**
* This class is used to compute digests on sections of the Manifest.
@ -112,8 +113,6 @@ public class ManifestDigester {
rawBytes = bytes;
entries = new HashMap<>();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Position pos = new Position();
if (!findSection(0, pos))
@ -131,50 +130,41 @@ public class ManifestDigester {
if (len > 6) {
if (isNameAttr(bytes, start)) {
StringBuilder nameBuf = new StringBuilder(sectionLen);
ByteArrayOutputStream nameBuf = new ByteArrayOutputStream();
nameBuf.write(bytes, start+6, len-6);
try {
nameBuf.append(
new String(bytes, start+6, len-6, "UTF8"));
int i = start + len;
if ((i-start) < sectionLen) {
if (bytes[i] == '\r') {
i += 2;
} else {
i += 1;
}
int i = start + len;
if ((i-start) < sectionLen) {
if (bytes[i] == '\r') {
i += 2;
} else {
i += 1;
}
while ((i-start) < sectionLen) {
if (bytes[i++] == ' ') {
// name is wrapped
int wrapStart = i;
while (((i-start) < sectionLen)
&& (bytes[i++] != '\n'));
if (bytes[i-1] != '\n')
return; // XXX: exception?
int wrapLen;
if (bytes[i-2] == '\r')
wrapLen = i-wrapStart-2;
else
wrapLen = i-wrapStart-1;
nameBuf.append(new String(bytes, wrapStart,
wrapLen, "UTF8"));
} else {
break;
}
}
entries.put(nameBuf.toString(),
new Entry(start, sectionLen, sectionLenWithBlank,
rawBytes));
} catch (java.io.UnsupportedEncodingException uee) {
throw new IllegalStateException(
"UTF8 not available on platform");
}
while ((i-start) < sectionLen) {
if (bytes[i++] == ' ') {
// name is wrapped
int wrapStart = i;
while (((i-start) < sectionLen)
&& (bytes[i++] != '\n'));
if (bytes[i-1] != '\n')
return; // XXX: exception?
int wrapLen;
if (bytes[i-2] == '\r')
wrapLen = i-wrapStart-2;
else
wrapLen = i-wrapStart-1;
nameBuf.write(bytes, wrapStart, wrapLen);
} else {
break;
}
}
entries.put(new String(nameBuf.toByteArray(), UTF_8),
new Entry(start, sectionLen, sectionLenWithBlank,
rawBytes));
}
}
start = pos.startOfNext;

View file

@ -64,7 +64,7 @@ public class PolicyUtil {
}
/**
* this is intended for use by policytool and the policy parser to
* this is intended for use by the policy parser to
* instantiate a KeyStore from the information in the GUI/policy file
*/
public static KeyStore getKeyStore

View file

@ -142,6 +142,10 @@ grant codeBase "jrt:/jdk.dynalink" {
permission java.security.AllPermission;
};
grant codeBase "jrt:/jdk.httpserver" {
permission java.security.AllPermission;
};
grant codeBase "jrt:/jdk.internal.le" {
permission java.security.AllPermission;
};

View file

@ -1517,6 +1517,7 @@ NewPlatformString(JNIEnv *env, char *s)
}
str = (*env)->CallStaticObjectMethod(env, cls,
makePlatformStringMID, USE_STDERR, ary);
CHECK_EXCEPTION_RETURN_VALUE(0);
(*env)->DeleteLocalRef(env, ary);
return str;
}
@ -1585,13 +1586,16 @@ static jclass
GetApplicationClass(JNIEnv *env)
{
jmethodID mid;
jclass appClass;
jclass cls = GetLauncherHelperClass(env);
NULL_CHECK0(cls);
NULL_CHECK0(mid = (*env)->GetStaticMethodID(env, cls,
"getApplicationClass",
"()Ljava/lang/Class;"));
return (*env)->CallStaticObjectMethod(env, cls, mid);
appClass = (*env)->CallStaticObjectMethod(env, cls, mid);
CHECK_EXCEPTION_RETURN_VALUE(0);
return appClass;
}
static char* expandWildcardOnLongOpt(char* arg) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 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
@ -33,16 +33,13 @@ import jdk.internal.misc.SharedSecrets;
/**
* Instances of the file descriptor class serve as an opaque handle
* to the underlying machine-specific structure representing an open
* file, an open socket, or another source or sink of bytes. The
* main practical use for a file descriptor is to create a
* <code>FileInputStream</code> or <code>FileOutputStream</code> to
* contain it.
* file, an open socket, or another source or sink of bytes.
* The main practical use for a file descriptor is to create a
* {@link FileInputStream} or {@link FileOutputStream} to contain it.
* <p>
* Applications should not create their own file descriptors.
*
* @author Pavani Diwanji
* @see java.io.FileInputStream
* @see java.io.FileOutputStream
* @since 1.0
*/
public final class FileDescriptor {
@ -58,6 +55,45 @@ public final class FileDescriptor {
*/
private boolean append;
static {
initIDs();
}
// Set up JavaIOFileDescriptorAccess in SharedSecrets
static {
SharedSecrets.setJavaIOFileDescriptorAccess(
new JavaIOFileDescriptorAccess() {
public void set(FileDescriptor fdo, int fd) {
fdo.fd = fd;
}
public int get(FileDescriptor fdo) {
return fdo.fd;
}
public void setAppend(FileDescriptor fdo, boolean append) {
fdo.append = append;
}
public boolean getAppend(FileDescriptor fdo) {
return fdo.append;
}
public void close(FileDescriptor fdo) {
fdo.close();
}
public void setHandle(FileDescriptor fdo, long handle) {
throw new UnsupportedOperationException();
}
public long getHandle(FileDescriptor fdo) {
throw new UnsupportedOperationException();
}
}
);
}
/**
* Constructs an (invalid) FileDescriptor
* object.
@ -74,7 +110,7 @@ public final class FileDescriptor {
/**
* A handle to the standard input stream. Usually, this file
* descriptor is not used directly, but rather via the input stream
* known as <code>System.in</code>.
* known as {@code System.in}.
*
* @see java.lang.System#in
*/
@ -83,7 +119,7 @@ public final class FileDescriptor {
/**
* A handle to the standard output stream. Usually, this file
* descriptor is not used directly, but rather via the output stream
* known as <code>System.out</code>.
* known as {@code System.out}.
* @see java.lang.System#out
*/
public static final FileDescriptor out = new FileDescriptor(1);
@ -91,7 +127,7 @@ public final class FileDescriptor {
/**
* A handle to the standard error stream. Usually, this file
* descriptor is not used directly, but rather via the output stream
* known as <code>System.err</code>.
* known as {@code System.err}.
*
* @see java.lang.System#err
*/
@ -100,9 +136,9 @@ public final class FileDescriptor {
/**
* Tests if this file descriptor object is valid.
*
* @return <code>true</code> if the file descriptor object represents a
* @return {@code true} if the file descriptor object represents a
* valid, open file, socket, or other active I/O connection;
* <code>false</code> otherwise.
* {@code false} otherwise.
*/
public boolean valid() {
return fd != -1;
@ -141,46 +177,18 @@ public final class FileDescriptor {
/* This routine initializes JNI field offsets for the class */
private static native void initIDs();
static {
initIDs();
}
// Set up JavaIOFileDescriptorAccess in SharedSecrets
static {
SharedSecrets.setJavaIOFileDescriptorAccess(
new JavaIOFileDescriptorAccess() {
public void set(FileDescriptor obj, int fd) {
obj.fd = fd;
}
public int get(FileDescriptor obj) {
return obj.fd;
}
public void setAppend(FileDescriptor obj, boolean append) {
obj.append = append;
}
public boolean getAppend(FileDescriptor obj) {
return obj.append;
}
public void setHandle(FileDescriptor obj, long handle) {
throw new UnsupportedOperationException();
}
public long getHandle(FileDescriptor obj) {
throw new UnsupportedOperationException();
}
}
);
}
/**
* Returns true, if the file was opened for appending.
*/
private static native boolean getAppend(int fd);
/**
* Close the raw file descriptor or handle, if it has not already been closed
* and set the fd and handle to -1.
* Package private to allow it to be used in java.io.
*/
native void close();
/*
* Package private methods to track referents.
* If multiple streams point to the same FileDescriptor, we cycle

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 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
@ -28,6 +28,9 @@ package sun.nio.ch;
import java.io.FileDescriptor;
import java.io.IOException;
import jdk.internal.misc.JavaIOFileDescriptorAccess;
import jdk.internal.misc.SharedSecrets;
class FileDispatcherImpl extends FileDispatcher {
static {
@ -35,6 +38,9 @@ class FileDispatcherImpl extends FileDispatcher {
init();
}
private static final JavaIOFileDescriptorAccess fdAccess =
SharedSecrets.getJavaIOFileDescriptorAccess();
FileDispatcherImpl() {
}
@ -95,7 +101,7 @@ class FileDispatcherImpl extends FileDispatcher {
}
void close(FileDescriptor fd) throws IOException {
close0(fd);
fdAccess.close(fd);
}
void preClose(FileDescriptor fd) throws IOException {
@ -153,6 +159,8 @@ class FileDispatcherImpl extends FileDispatcher {
static native void release0(FileDescriptor fd, long pos, long size)
throws IOException;
// Shared with SocketDispatcher and DatagramDispatcher but
// NOT used by FileDispatcherImpl
static native void close0(FileDescriptor fd) throws IOException;
static native void preClose0(FileDescriptor fd) throws IOException;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -70,3 +70,9 @@ Java_java_io_FileDescriptor_getAppend(JNIEnv *env, jclass fdClass, jint fd) {
int flags = fcntl(fd, F_GETFL);
return ((flags & O_APPEND) == 0) ? JNI_FALSE : JNI_TRUE;
}
// instance method close0 for FileDescriptor
JNIEXPORT void JNICALL
Java_java_io_FileDescriptor_close(JNIEnv *env, jobject this) {
fileDescriptorClose(env, this);
}

View file

@ -662,7 +662,7 @@ pid_t unix_getParentPidAndTimings(JNIEnv *env, pid_t pid,
return -1;
}
// Validate the pid before returning the info in case /proc/pid is racy
// Validate the pid before returning the info
if (kill(pid, 0) < 0) {
return -1;
}

View file

@ -124,19 +124,31 @@ fileOpen(JNIEnv *env, jobject this, jstring path, jfieldID fid, int flags)
void
fileClose(JNIEnv *env, jobject this, jfieldID fid)
{
FD fd = GET_FD(this, fid);
if (fd == -1) {
jobject fileDescriptor = (*env)->GetObjectField(env, (this), (fid));
if (fileDescriptor == NULL) {
return;
}
fileDescriptorClose(env, fileDescriptor);
}
// Function to close the fd held by this FileDescriptor and set fd to -1.
void
fileDescriptorClose(JNIEnv *env, jobject this)
{
FD fd = (*env)->GetIntField(env, this, IO_fd_fdID);
if ((*env)->ExceptionOccurred(env)) {
return;
}
/* Set the fd to -1 before closing it so that the timing window
* of other threads using the wrong fd (closed but recycled fd,
* that gets re-opened with some other filename) is reduced.
* Practically the chance of its occurance is low, however, we are
* taking extra precaution over here.
*/
SET_FD(this, -1, fid);
(*env)->SetIntField(env, this, IO_fd_fdID, -1);
if ((*env)->ExceptionOccurred(env)) {
return;
}
/*
* Don't close file descriptors 0, 1, or 2. If we close these stream
* then a subsequent file open or socket will use them. Instead we
@ -145,7 +157,7 @@ fileClose(JNIEnv *env, jobject this, jfieldID fid)
if (fd >= STDIN_FILENO && fd <= STDERR_FILENO) {
int devnull = open("/dev/null", O_WRONLY);
if (devnull < 0) {
SET_FD(this, fd, fid); // restore fd
(*env)->SetIntField(env, this, IO_fd_fdID, fd);
JNU_ThrowIOExceptionWithLastError(env, "open /dev/null failed");
} else {
dup2(devnull, fd);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@ -103,6 +103,7 @@ FD handleOpen(const char *path, int oflag, int mode);
* IO helper function(s)
*/
void fileClose(JNIEnv *env, jobject this, jfieldID fid);
void fileDescriptorClose(JNIEnv *env, jobject this);
#ifdef MACOSX
jstring newStringPlatform(JNIEnv *env, const char* str);

View file

@ -679,14 +679,16 @@ Java_java_net_PlainSocketImpl_socketAccept(JNIEnv *env, jobject this,
}
/* ECONNABORTED or EWOULDBLOCK error so adjust timeout if there is one. */
currNanoTime = JVM_NanoTime(env, 0);
nanoTimeout -= (currNanoTime - prevNanoTime);
if (nanoTimeout < NET_NSEC_PER_MSEC) {
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException",
"Accept timed out");
return;
if (nanoTimeout >= NET_NSEC_PER_MSEC) {
currNanoTime = JVM_NanoTime(env, 0);
nanoTimeout -= (currNanoTime - prevNanoTime);
if (nanoTimeout < NET_NSEC_PER_MSEC) {
JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException",
"Accept timed out");
return;
}
prevNanoTime = currNanoTime;
}
prevNanoTime = currNanoTime;
}
if (newfd < 0) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@ -32,12 +32,12 @@ import jdk.internal.misc.SharedSecrets;
/**
* Instances of the file descriptor class serve as an opaque handle
* to the underlying machine-specific structure representing an
* open file, an open socket, or another source or sink of bytes.
* to the underlying machine-specific structure representing an open
* file, an open socket, or another source or sink of bytes.
* The main practical use for a file descriptor is to create a
* {@link FileInputStream} or {@link FileOutputStream} to contain it.
*
* <p>Applications should not create their own file descriptors.
* <p>
* Applications should not create their own file descriptors.
*
* @author Pavani Diwanji
* @since 1.0
@ -57,15 +57,6 @@ public final class FileDescriptor {
*/
private boolean append;
/**
* Constructs an (invalid) FileDescriptor
* object.
*/
public /**/ FileDescriptor() {
fd = -1;
handle = -1;
}
static {
initIDs();
}
@ -73,34 +64,47 @@ public final class FileDescriptor {
// Set up JavaIOFileDescriptorAccess in SharedSecrets
static {
SharedSecrets.setJavaIOFileDescriptorAccess(
new JavaIOFileDescriptorAccess() {
public void set(FileDescriptor obj, int fd) {
obj.fd = fd;
}
new JavaIOFileDescriptorAccess() {
public void set(FileDescriptor fdo, int fd) {
fdo.fd = fd;
}
public int get(FileDescriptor obj) {
return obj.fd;
}
public int get(FileDescriptor fdo) {
return fdo.fd;
}
public void setAppend(FileDescriptor obj, boolean append) {
obj.append = append;
}
public void setAppend(FileDescriptor fdo, boolean append) {
fdo.append = append;
}
public boolean getAppend(FileDescriptor obj) {
return obj.append;
}
public boolean getAppend(FileDescriptor fdo) {
return fdo.append;
}
public void setHandle(FileDescriptor obj, long handle) {
obj.handle = handle;
}
public void close(FileDescriptor fdo) {
fdo.close();
}
public long getHandle(FileDescriptor obj) {
return obj.handle;
public void setHandle(FileDescriptor fdo, long handle) {
fdo.handle = handle;
}
public long getHandle(FileDescriptor fdo) {
return fdo.handle;
}
}
}
);
}
/**
* Constructs an (invalid) FileDescriptor
* object.
*/
public FileDescriptor() {
fd = -1;
handle = -1;
}
/**
* A handle to the standard input stream. Usually, this file
* descriptor is not used directly, but rather via the input stream
@ -135,7 +139,7 @@ public final class FileDescriptor {
* {@code false} otherwise.
*/
public boolean valid() {
return ((handle != -1) || (fd != -1));
return (handle != -1) || (fd != -1);
}
/**
@ -179,6 +183,13 @@ public final class FileDescriptor {
return desc;
}
/**
* Close the raw file descriptor or handle, if it has not already been closed
* and set the fd and handle to -1.
* Package private to allow it to be used in java.io.
*/
native void close();
/*
* Package private methods to track referents.
* If multiple streams point to the same FileDescriptor, we cycle

View file

@ -104,7 +104,7 @@ class FileDispatcherImpl extends FileDispatcher {
}
void close(FileDescriptor fd) throws IOException {
close0(fd);
fdAccess.close(fd);
}
FileDescriptor duplicateForMapping(FileDescriptor fd) throws IOException {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@ -72,3 +72,9 @@ Java_java_io_FileDescriptor_sync(JNIEnv *env, jobject this) {
JNU_ThrowByName(env, "java/io/SyncFailedException", "sync failed");
}
}
// instance method close0 for FileDescriptor
JNIEXPORT void JNICALL
Java_java_io_FileDescriptor_close(JNIEnv *env, jobject this) {
fileDescriptorClose(env, this);
}

View file

@ -1,44 +0,0 @@
/*
* Copyright (c) 2003, 2004, 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
#include "jni.h"
#include "jni_util.h"
#include "jvm.h"
#include "io_util.h"
#include "io_util_md.h"
#include "java_io_RandomAccessFile.h"
extern jfieldID raf_fd; /* id for jobject 'fd' in java.io.RandomAccessFile */
/*********************************************************************
* Platform specific implementation of input stream native methods
*/
JNIEXPORT void JNICALL
Java_java_io_RandomAccessFile_close0(JNIEnv *env, jobject this) {
handleClose(env, this, raf_fd);
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 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
@ -535,14 +535,28 @@ jint handleAppend(FD fd, const void *buf, jint len) {
return writeInternal(fd, buf, len, JNI_TRUE);
}
jint
void
handleClose(JNIEnv *env, jobject this, jfieldID fid)
{
FD fd = GET_FD(this, fid);
jobject fileDescriptor = (*env)->GetObjectField(env, (this), (fid));
if (fileDescriptor == NULL) {
return;
}
fileDescriptorClose(env, fileDescriptor);
}
// Function to close the fd held by this FileDescriptor and set fd to -1.
void
fileDescriptorClose(JNIEnv *env, jobject this)
{
FD fd = (*env)->GetLongField(env, this, IO_handle_fdID);
if ((*env)->ExceptionOccurred(env)) {
return;
}
HANDLE h = (HANDLE)fd;
if (h == INVALID_HANDLE_VALUE) {
return 0;
return;
}
/* Set the fd to -1 before closing it so that the timing window
@ -551,12 +565,14 @@ handleClose(JNIEnv *env, jobject this, jfieldID fid)
* Practically the chance of its occurance is low, however, we are
* taking extra precaution over here.
*/
SET_FD(this, -1, fid);
(*env)->SetLongField(env, this, IO_handle_fdID, -1);
if ((*env)->ExceptionOccurred(env)) {
return;
}
if (CloseHandle(h) == 0) { /* Returns zero on failure */
JNU_ThrowIOExceptionWithLastError(env, "close failed");
}
return 0;
}
jlong

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@ -48,7 +48,8 @@ jlong handleGetLength(FD fd);
JNIEXPORT jint handleRead(FD fd, void *buf, jint len);
jint handleWrite(FD fd, const void *buf, jint len);
jint handleAppend(FD fd, const void *buf, jint len);
jint handleClose(JNIEnv *env, jobject this, jfieldID fid);
void handleClose(JNIEnv *env, jobject this, jfieldID fid);
void fileDescriptorClose(JNIEnv *env, jobject this);
jlong handleLseek(FD fd, jlong offset, jint whence);
/*

Some files were not shown because too many files have changed in this diff Show more