Merge
This commit is contained in:
commit
ef335c75e3
4
.hgtags
4
.hgtags
@ -622,3 +622,7 @@ bc54620a3848c26cff9766e5e2a6e5ddab98ed18 jdk-14+36
|
||||
1bee69801aeea1a34261c93f35bc9de072a98704 jdk-15+10
|
||||
b2dd4028a6de4e40dda8b76109e4b5c6b294f980 jdk-15+11
|
||||
2ec0ff3042630ddbd3587e340fe0dd40391cb6c4 jdk-15+12
|
||||
1c06a8ee8acad4d93c782626a233693a73de0add jdk-15+13
|
||||
1d6ceb13e142665ea833fca01c8c8598e0ddd211 jdk-15+14
|
||||
bc54620a3848c26cff9766e5e2a6e5ddab98ed18 jdk-14-ga
|
||||
82b7c62cf4cc56828a8fb724f57087967232a2a7 jdk-15+15
|
||||
|
@ -127,6 +127,9 @@ TEST FAILURE</code></pre>
|
||||
<p>The simplest way to run tests with JCov coverage report is to use the special target <code>jcov-test</code> instead of <code>test</code>, e.g. <code>make jcov-test TEST=jdk_lang</code>. This will make sure the JCov image is built, and that JCov reporting is enabled.</p>
|
||||
<p>The JCov report is stored in <code>build/$BUILD/test-results/jcov-output</code>.</p>
|
||||
<p>Please note that running with JCov reporting can be very memory intensive.</p>
|
||||
<h4 id="jcov_diff_changeset">JCOV_DIFF_CHANGESET</h4>
|
||||
<p>While collecting code coverage with JCov, it is also possible to find coverage for only recently changed code. JCOV_DIFF_CHANGESET specifies a source revision. A textual report will be generated showing coverage of the diff between the specified revision and the repository tip.</p>
|
||||
<p>The report is stored in <code>build/$BUILD/test-results/jcov-output/diff_coverage_report</code> file.</p>
|
||||
<h3 id="jtreg-keywords">JTReg keywords</h3>
|
||||
<h4 id="jobs-1">JOBS</h4>
|
||||
<p>The test concurrency (<code>-concurrency</code>).</p>
|
||||
|
@ -241,10 +241,20 @@ The simplest way to run tests with JCov coverage report is to use the special
|
||||
target `jcov-test` instead of `test`, e.g. `make jcov-test TEST=jdk_lang`. This
|
||||
will make sure the JCov image is built, and that JCov reporting is enabled.
|
||||
|
||||
The JCov report is stored in `build/$BUILD/test-results/jcov-output`.
|
||||
The JCov report is stored in `build/$BUILD/test-results/jcov-output/report`.
|
||||
|
||||
Please note that running with JCov reporting can be very memory intensive.
|
||||
|
||||
#### JCOV_DIFF_CHANGESET
|
||||
|
||||
While collecting code coverage with JCov, it is also possible to find coverage
|
||||
for only recently changed code. JCOV_DIFF_CHANGESET specifies a source
|
||||
revision. A textual report will be generated showing coverage of the diff
|
||||
between the specified revision and the repository tip.
|
||||
|
||||
The report is stored in `build/$BUILD/test-results/jcov-output/diff_coverage_report`
|
||||
file.
|
||||
|
||||
### JTReg keywords
|
||||
|
||||
#### JOBS
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -94,6 +94,7 @@ COPY_TO_IMAGE := *.html *.txt *.png *.xml README*
|
||||
# EXTRA_MANIFEST_ATTR Extra manifest attribute
|
||||
# SKIP_COMPILATION Skip Java compilation iff true
|
||||
# DISABLE_SJAVAC Passed to SetupJavaCompilation
|
||||
# DISABLED_WARNINGS Additional disabled warnings
|
||||
SetupBuildDemo = $(NamedParamsMacroTemplate)
|
||||
define SetupBuildDemoBody
|
||||
ifeq ($$($1_SRC_DIR), )
|
||||
@ -135,6 +136,7 @@ define SetupBuildDemoBody
|
||||
EXTRA_MANIFEST_ATTR := $$($1_EXTRA_MANIFEST_ATTR), \
|
||||
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
|
||||
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
|
||||
DISABLED_WARNINGS := $$($1_DISABLED_WARNINGS), \
|
||||
DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \
|
||||
))
|
||||
|
||||
@ -173,35 +175,42 @@ $(BUILD_DEMO_CodePointIM_JAR): $(CODEPOINT_METAINF_SERVICE_FILE)
|
||||
|
||||
$(eval $(call SetupBuildDemo, FileChooserDemo, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, SwingSet2, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
EXTRA_COPY_TO_JAR := .java, \
|
||||
EXTRA_MANIFEST_ATTR := SplashScreen-Image: resources/images/splash.png, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked static serial cast, \
|
||||
DISABLE_SJAVAC := true, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, Font2DTest, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked serial cast, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, J2Ddemo, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
MAIN_CLASS := java2d.J2Ddemo, \
|
||||
DISABLED_WARNINGS := rawtypes deprecation unchecked cast, \
|
||||
JAR_NAME := J2Ddemo, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, Metalworks, \
|
||||
DISABLED_WARNINGS := rawtypes unchecked, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, Notepad, \
|
||||
DISABLED_WARNINGS := rawtypes, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, Stylepad, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
DISABLED_WARNINGS := rawtypes unchecked, \
|
||||
EXTRA_SRC_DIR := $(DEMO_SHARE_SRC)/jfc/Notepad, \
|
||||
EXCLUDE_FILES := $(DEMO_SHARE_SRC)/jfc/Notepad/README.txt, \
|
||||
))
|
||||
@ -211,6 +220,7 @@ $(eval $(call SetupBuildDemo, SampleTree, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupBuildDemo, TableExample, \
|
||||
DISABLED_WARNINGS := rawtypes unchecked deprecation, \
|
||||
DEMO_SUBDIR := jfc, \
|
||||
))
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -77,12 +77,12 @@ define SetupInterimModule
|
||||
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \
|
||||
COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
|
||||
DISABLED_WARNINGS := module, \
|
||||
ADD_JAVAC_FLAGS := --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \
|
||||
$$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
|
||||
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \
|
||||
--add-exports java.base/jdk.internal=java.compiler.interim \
|
||||
--add-exports java.base/jdk.internal=jdk.compiler.interim \
|
||||
-Xlint:-module, \
|
||||
--add-exports java.base/jdk.internal=jdk.compiler.interim, \
|
||||
))
|
||||
|
||||
$1_DEPS_INTERIM := $$(addsuffix .interim, $$(filter \
|
||||
|
@ -1,79 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# 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.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include SetupJavaCompilers.gmk
|
||||
|
||||
################################################################################
|
||||
# Generate interim versions of the module-info.java files for the interim
|
||||
# langtools modules. Each interim module has ".interim" added as suffix to the
|
||||
# original module name.
|
||||
|
||||
INTERIM_MODULEINFO_PATTERN := \
|
||||
$(foreach m, $(INTERIM_RMIC_BASE_MODULES), -e 's/$m\([,; ]\)/$m.interim\1/g') \
|
||||
-e '/ToolProvider[,; ]/d'
|
||||
|
||||
$(BUILDTOOLS_OUTPUTDIR)/gensrc/%.interim/module-info.java: \
|
||||
$(TOPDIR)/src/%/share/classes/module-info.java
|
||||
$(call LogInfo, Generating module-info.java for $*.interim)
|
||||
$(call MakeDir, $(@D))
|
||||
$(SED) $(INTERIM_MODULEINFO_PATTERN) $< > $@
|
||||
|
||||
TARGETS += $(patsubst %, $(BUILDTOOLS_OUTPUTDIR)/gensrc/%/module-info.java, \
|
||||
$(INTERIM_RMIC_MODULES))
|
||||
|
||||
################################################################################
|
||||
|
||||
RMIC_PKGS := \
|
||||
sun/rmi/rmic \
|
||||
sun/tools/asm \
|
||||
sun/tools/java \
|
||||
sun/tools/javac \
|
||||
sun/tools/tree \
|
||||
sun/tools/util \
|
||||
#
|
||||
|
||||
$(eval $(call SetupJavaCompilation, BUILD_jdk.rmic.interim, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
SRC := $(TOPDIR)/src/jdk.rmic/share/classes, \
|
||||
EXCLUDE_FILES := $(TOPDIR)/src/jdk.rmic/share/classes/module-info.java, \
|
||||
EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/jdk.rmic.interim/module-info.java, \
|
||||
INCLUDES := $(RMIC_PKGS), \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_modules/jdk.rmic.interim, \
|
||||
COPY := .properties, \
|
||||
ADD_JAVAC_FLAGS := \
|
||||
--module-path $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_modules \
|
||||
$(INTERIM_RMIC_ADD_EXPORTS), \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_jdk.rmic.interim)
|
||||
|
||||
##########################################################################################
|
||||
|
||||
all: $(TARGETS)
|
@ -80,7 +80,7 @@ java.datatransfer_COPY += flavormap.properties
|
||||
################################################################################
|
||||
|
||||
java.desktop_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-reference \
|
||||
'-Xdoclint/package:java.*,javax.*' -Xlint:exports \
|
||||
'-Xdoclint/package:java.*,javax.*' \
|
||||
--doclint-format html4
|
||||
java.desktop_COPY += .gif .png .wav .txt .xml .css .pf
|
||||
java.desktop_CLEAN += iio-plugin.properties cursors.properties
|
||||
@ -245,7 +245,6 @@ java.transaction.xa_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/packag
|
||||
################################################################################
|
||||
|
||||
java.sql_ADD_JAVAC_FLAGS += -Xdoclint:all/protected '-Xdoclint/package:java.*,javax.*'
|
||||
java.sql_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
|
||||
|
||||
################################################################################
|
||||
|
||||
@ -270,7 +269,7 @@ java.xml_CLEAN += .properties
|
||||
|
||||
################################################################################
|
||||
|
||||
java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*' -Xlint:-exports
|
||||
java.naming_ADD_JAVAC_FLAGS += -Xdoclint:all/protected,-accessibility '-Xdoclint/package:java.*,javax.*'
|
||||
java.naming_CLEAN += jndiprovider.properties
|
||||
|
||||
################################################################################
|
||||
@ -304,7 +303,8 @@ jdk.compiler_CLEAN_FILES += $(wildcard \
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.hotspot.agent_ADD_JAVAC_FLAGS += $(DISABLE_WARNINGS),-overrides
|
||||
jdk.hotspot.agent_DISABLED_WARNINGS += deprecation rawtypes serial unchecked \
|
||||
cast static overrides fallthrough
|
||||
jdk.hotspot.agent_COPY += .gif .png sa.js .properties
|
||||
|
||||
################################################################################
|
||||
@ -341,17 +341,17 @@ jdk.jartool_ADD_JAVAC_FLAGS += -XDstringConcat=inline
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.scripting.nashorn_ADD_JAVAC_FLAGS += $(DISABLE_WARNINGS),-overrides
|
||||
jdk.scripting.nashorn_DISABLED_WARNINGS += removal
|
||||
jdk.scripting.nashorn_COPY := .properties .js
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.scripting.nashorn.shell_ADD_JAVAC_FLAGS += $(DISABLE_WARNINGS),-overrides
|
||||
jdk.scripting.nashorn.shell_DISABLED_WARNINGS += removal
|
||||
jdk.scripting.nashorn.shell_COPY += .js .properties
|
||||
|
||||
################################################################################
|
||||
|
||||
jdk.rmic_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
|
||||
jdk.rmic_DISABLED_WARNINGS += deprecation
|
||||
jdk.rmic_CLEAN += .properties
|
||||
|
||||
################################################################################
|
||||
@ -431,7 +431,7 @@ jdk.internal.jvmstat_COPY += aliasmap
|
||||
# The exports are needed since JVMCI is dynamically exported (see
|
||||
# jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo).
|
||||
|
||||
jdk.internal.vm.ci_ADD_JAVAC_FLAGS += -parameters -Xlint:-exports -XDstringConcat=inline
|
||||
jdk.internal.vm.ci_ADD_JAVAC_FLAGS += -parameters -XDstringConcat=inline
|
||||
|
||||
################################################################################
|
||||
|
||||
@ -536,13 +536,9 @@ jdk.localedata_EXCLUDE_FILES += sun/text/resources/ext/BreakIteratorRules_th.jav
|
||||
jdk.localedata_KEEP_ALL_TRANSLATIONS := true
|
||||
################################################################################
|
||||
|
||||
# There is an issue in sjavac that triggers a warning in jdk.jfr that isn't
|
||||
# triggered without sjavac.
|
||||
ifeq ($(ENABLE_SJAVAC), yes)
|
||||
jdk.jfr_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
|
||||
endif
|
||||
jdk.jfr_DISABLED_WARNINGS += exports
|
||||
jdk.jfr_COPY := .xsd .xml .dtd
|
||||
jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline -Xlint:-exports
|
||||
jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline
|
||||
|
||||
################################################################################
|
||||
# If this is an imported module that has prebuilt classes, only compile
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -42,6 +42,7 @@ $(eval $(call SetupJavaCompilation,BUILD_JIGSAW_TOOLS, \
|
||||
build/tools/jigsaw, \
|
||||
COPY := .properties .html, \
|
||||
BIN := $(TOOLS_CLASSES_DIR), \
|
||||
DISABLED_WARNINGS := fallthrough, \
|
||||
ADD_JAVAC_FLAGS := \
|
||||
--add-modules jdk.jdeps \
|
||||
--add-exports java.base/jdk.internal.module=ALL-UNNAMED \
|
||||
|
@ -53,6 +53,7 @@ $(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
|
||||
build/tools/jigsaw \
|
||||
build/tools/depend \
|
||||
, \
|
||||
DISABLED_WARNINGS := unchecked rawtypes deprecation cast, \
|
||||
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
|
||||
ADD_JAVAC_FLAGS := \
|
||||
--add-exports java.desktop/sun.awt=ALL-UNNAMED \
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -57,10 +57,7 @@ $(eval $(call IncludeCustomExtension, Docs.gmk))
|
||||
################################################################################
|
||||
# Javadoc settings
|
||||
|
||||
# On top of the sources that was used to compile the JDK, we need some
|
||||
# extra java.rmi sources that are used just for javadoc.
|
||||
MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) \
|
||||
$(SUPPORT_OUTPUTDIR)/rmic/* $(TOPDIR)/src/*/share/doc/stub)
|
||||
MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) )
|
||||
|
||||
# URLs
|
||||
JAVADOC_BASE_URL := https://docs.oracle.com/pls/topic/lookup?ctx=javase$(VERSION_NUMBER)&id=homepage
|
||||
|
@ -45,7 +45,7 @@ help:
|
||||
$(info $(_) make <name>-image # Build just the image for any of: )
|
||||
$(info $(_) # jdk, test, docs, symbols, legacy-jre, static-libs)
|
||||
$(info $(_) make <phase> # Build the specified phase and everything it depends on)
|
||||
$(info $(_) # (gensrc, java, copy, libs, launchers, gendata, rmic))
|
||||
$(info $(_) # (gensrc, java, copy, libs, launchers, gendata))
|
||||
$(info $(_) make *-only # Applies to most targets and disables building the)
|
||||
$(info $(_) # dependencies for that target. This is faster but may)
|
||||
$(info $(_) # result in incorrect build results!)
|
||||
@ -82,7 +82,7 @@ help:
|
||||
$(info $(_) make <module> # Build <module> and everything it depends on)
|
||||
$(info $(_) make <module>-<phase> # Compile the specified phase for the specified module)
|
||||
$(info $(_) # and everything it depends on)
|
||||
$(info $(_) # (gensrc, java, copy, libs, launchers, gendata, rmic))
|
||||
$(info $(_) # (gensrc, java, copy, libs, launchers, gendata))
|
||||
$(info )
|
||||
$(info Make control variables)
|
||||
$(info $(_) CONF= # Build all configurations (note, assignment is empty))
|
||||
|
@ -72,9 +72,6 @@ buildtools-langtools:
|
||||
interim-langtools:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimLangtools.gmk)
|
||||
|
||||
interim-rmic:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileInterimRmic.gmk)
|
||||
|
||||
interim-tzdb:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CopyInterimTZDB.gmk)
|
||||
|
||||
@ -89,7 +86,7 @@ buildtools-hotspot:
|
||||
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f CompileToolsHotspot.gmk)
|
||||
|
||||
ALL_TARGETS += buildtools-langtools interim-langtools \
|
||||
interim-rmic interim-tzdb buildtools-jdk buildtools-modules \
|
||||
interim-tzdb buildtools-jdk buildtools-modules \
|
||||
buildtools-hotspot
|
||||
|
||||
################################################################################
|
||||
@ -193,16 +190,6 @@ $(foreach m, $(JAVA_MODULES), $(eval $(call DeclareCompileJavaRecipe,$m)))
|
||||
|
||||
ALL_TARGETS += $(JAVA_TARGETS)
|
||||
|
||||
################################################################################
|
||||
# Targets for running rmic.
|
||||
$(eval $(call DeclareRecipesForPhase, RMIC, \
|
||||
TARGET_SUFFIX := rmic, \
|
||||
FILE_PREFIX := Rmic, \
|
||||
MAKE_SUBDIR := rmic, \
|
||||
CHECK_MODULES := $(ALL_MODULES)))
|
||||
|
||||
ALL_TARGETS += $(RMIC_TARGETS)
|
||||
|
||||
################################################################################
|
||||
# Targets for compiling native libraries
|
||||
$(eval $(call DeclareRecipesForPhase, LIBS, \
|
||||
@ -688,10 +675,6 @@ else
|
||||
|
||||
$(GENDATA_TARGETS): interim-langtools buildtools-jdk
|
||||
|
||||
interim-rmic: interim-langtools
|
||||
|
||||
$(RMIC_TARGETS): interim-langtools interim-rmic
|
||||
|
||||
$(JAVA_TARGETS): interim-langtools
|
||||
|
||||
# Declare dependencies between hotspot-<variant>* targets
|
||||
@ -732,9 +715,6 @@ else
|
||||
# Declare dependencies between the module meta targets
|
||||
$(foreach m, $(ALL_MODULES), $(eval $m: $(call FindDepsForModule,$m)))
|
||||
|
||||
# Declare dependencies between <module>-rmic to <module>-java
|
||||
$(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
|
||||
|
||||
# Declare dependencies from <module>-lib to <module>-java
|
||||
# Skip modules that do not have java source.
|
||||
$(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java))
|
||||
@ -768,7 +748,7 @@ else
|
||||
jdk.internal.vm.compiler-gensrc-moduleinfo: jdk.internal.vm.compiler-gensrc-src
|
||||
jdk.internal.vm.compiler.management-gensrc-moduleinfo: jdk.internal.vm.compiler.management-gensrc-src
|
||||
|
||||
jdk.jdeps-gendata: java rmic
|
||||
jdk.jdeps-gendata: java
|
||||
|
||||
# The ct.sym generation uses all the moduleinfos as input
|
||||
jdk.compiler-gendata: $(GENSRC_MODULEINFO_TARGETS)
|
||||
@ -790,7 +770,6 @@ else
|
||||
# Declare dependencies from <module>-jmod to all other module targets
|
||||
$(foreach m, $(JAVA_MODULES), $(eval $m_JMOD_DEPS += $m-java))
|
||||
$(foreach m, $(GENDATA_MODULES), $(eval $m_JMOD_DEPS += $m-gendata))
|
||||
$(foreach m, $(RMIC_MODULES), $(eval $m_JMOD_DEPS += $m-rmic))
|
||||
$(foreach m, $(LIBS_MODULES), $(eval $m_JMOD_DEPS += $m-libs))
|
||||
$(foreach m, $(LAUNCHER_MODULES), $(eval $m_JMOD_DEPS += $m-launchers))
|
||||
$(foreach m, $(COPY_MODULES), $(eval $m_JMOD_DEPS += $m-copy))
|
||||
@ -856,7 +835,7 @@ else
|
||||
zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \
|
||||
$(filter jdk.crypto%, $(JAVA_TARGETS))
|
||||
|
||||
zip-source: gensrc rmic
|
||||
zip-source: gensrc
|
||||
|
||||
jrtfs-jar: interim-langtools
|
||||
|
||||
@ -903,11 +882,11 @@ else
|
||||
|
||||
bootcycle-images: jdk-image
|
||||
|
||||
docs-jdk-api-javadoc: $(GENSRC_TARGETS) rmic
|
||||
docs-jdk-api-javadoc: $(GENSRC_TARGETS)
|
||||
|
||||
docs-javase-api-javadoc: $(GENSRC_TARGETS) rmic
|
||||
docs-javase-api-javadoc: $(GENSRC_TARGETS)
|
||||
|
||||
docs-reference-api-javadoc: $(GENSRC_TARGETS) rmic
|
||||
docs-reference-api-javadoc: $(GENSRC_TARGETS)
|
||||
|
||||
docs-jdk-api-modulegraph: exploded-image buildtools-modules
|
||||
|
||||
@ -989,7 +968,7 @@ endif
|
||||
|
||||
# If not already set, set the JVM specific tools targets
|
||||
JVM_TOOLS_TARGETS ?= buildtools-hotspot
|
||||
buildtools: buildtools-langtools interim-langtools interim-rmic \
|
||||
buildtools: buildtools-langtools interim-langtools \
|
||||
buildtools-jdk $(JVM_TOOLS_TARGETS)
|
||||
|
||||
# Declare dependencies from hotspot-<variant> targets
|
||||
@ -1012,8 +991,6 @@ copy: $(ALL_COPY_TARGETS)
|
||||
|
||||
java: $(JAVA_TARGETS)
|
||||
|
||||
rmic: $(RMIC_TARGETS)
|
||||
|
||||
libs: $(LIBS_TARGETS)
|
||||
|
||||
static-libs: $(STATIC_LIBS_TARGETS)
|
||||
@ -1031,7 +1008,6 @@ jdk.jdwp.agent-gensrc: jdk.jdi-gensrc
|
||||
$(foreach m, $(GENSRC_MODULES), $(eval $m: $m-gensrc))
|
||||
$(foreach m, $(JAVA_MODULES), $(eval $m: $m-java))
|
||||
$(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
|
||||
$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
|
||||
$(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs))
|
||||
$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
|
||||
$(foreach m, $(ALL_COPY_MODULES), $(eval $m: $m-copy))
|
||||
@ -1131,7 +1107,7 @@ all-images: product-images test-image docs-image
|
||||
all-bundles: product-bundles test-bundles docs-bundles static-libs-bundles
|
||||
|
||||
ALL_TARGETS += buildtools hotspot hotspot-libs hotspot-gensrc gensrc gendata \
|
||||
copy java rmic libs static-libs launchers jmods \
|
||||
copy java libs static-libs launchers jmods \
|
||||
jdk.jdwp.agent-gensrc $(ALL_MODULES) demos \
|
||||
exploded-image-base exploded-image \
|
||||
create-buildjdk docs-jdk-api docs-javase-api docs-reference-api docs-jdk \
|
||||
|
@ -45,7 +45,7 @@ ifneq ($(TEST_VM_OPTS), )
|
||||
endif
|
||||
|
||||
$(eval $(call ParseKeywordVariable, TEST_OPTS, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV, \
|
||||
SINGLE_KEYWORDS := JOBS TIMEOUT_FACTOR JCOV JCOV_DIFF_CHANGESET, \
|
||||
STRING_KEYWORDS := VM_OPTIONS JAVA_OPTIONS AOT_MODULES, \
|
||||
))
|
||||
|
||||
@ -1266,12 +1266,44 @@ ifeq ($(TEST_OPTS_JCOV), true)
|
||||
TARGETS += jcov-do-start-grabber jcov-start-grabber jcov-stop-grabber \
|
||||
jcov-gen-report
|
||||
|
||||
ifneq ($(TEST_OPTS_JCOV_DIFF_CHANGESET), )
|
||||
|
||||
JCOV_SOURCE_DIFF := $(JCOV_OUTPUT_DIR)/source_diff
|
||||
JCOV_DIFF_COVERAGE_REPORT := $(JCOV_OUTPUT_DIR)/diff_coverage_report
|
||||
|
||||
ifneq ($(and $(HG), $(wildcard $(TOPDIR)/.hg)), )
|
||||
DIFF_COMMAND := $(HG) -R $(TOPDIR) diff -r $(TEST_OPTS_JCOV_DIFF_CHANGESET) > $(JCOV_SOURCE_DIFF)
|
||||
else ifneq ($(and $(GIT), $(wildcard $(TOPDIR)/.git)), )
|
||||
DIFF_COMMAND := $(GIT) -C $(TOPDIR) diff $(TEST_OPTS_JCOV_DIFF_CHANGESET) > $(JCOV_SOURCE_DIFF)
|
||||
else
|
||||
$(info Error: Must be either hg or git source tree for diff coverage.)
|
||||
$(error Neither hg nor git source tree.)
|
||||
endif
|
||||
|
||||
jcov-gen-diffcoverage: jcov-stop-grabber
|
||||
$(call LogWarn, Generating diff coverage with changeset $(TEST_OPTS_JCOV_DIFF_CHANGESET) ... )
|
||||
$(DIFF_COMMAND)
|
||||
$(JAVA) -Xmx4g -jar $(JCOV_HOME)/lib/jcov.jar \
|
||||
DiffCoverage -replaceDiff "src/.*/classes/:" -all \
|
||||
$(JCOV_RESULT_FILE) $(JCOV_SOURCE_DIFF) > \
|
||||
$(JCOV_DIFF_COVERAGE_REPORT)
|
||||
|
||||
TARGETS += jcov-gen-diffcoverage
|
||||
|
||||
endif
|
||||
|
||||
# Hook this into the framework at appropriate places
|
||||
pre-run-test: jcov-start-grabber
|
||||
|
||||
post-run-test: jcov-gen-report
|
||||
|
||||
jcov-gen-report: run-all-tests
|
||||
ifneq ($(TEST_OPTS_JCOV_DIFF_CHANGESET), )
|
||||
|
||||
post-run-test: jcov-gen-diffcoverage
|
||||
|
||||
endif
|
||||
|
||||
jcov-stop-grabber: run-all-tests
|
||||
|
||||
endif
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,18 +39,12 @@ $(eval $(call IncludeCustomExtension, ZipSource.gmk))
|
||||
# Create the directory structure for src.zip using symlinks.
|
||||
# <module>/<package>/<file>.java
|
||||
|
||||
# Find extra source dirs for a module that are not part of normal compilation
|
||||
# but should be included in src.zip.
|
||||
# $1: Module to find dirs for
|
||||
ExtraSrcDirs = \
|
||||
$(wildcard $(SUPPORT_OUTPUTDIR)/rmic/$(strip $1))
|
||||
|
||||
ALL_MODULES := $(FindAllModules)
|
||||
|
||||
# Generate the src dirs in the first make invocation and then call this makefile
|
||||
# again to create src.zip.
|
||||
$(foreach m, $(ALL_MODULES), \
|
||||
$(foreach d, $(call FindModuleSrcDirs, $m) $(call ExtraSrcDirs, $m), \
|
||||
$(foreach d, $(call FindModuleSrcDirs, $m), \
|
||||
$(eval $d_TARGET := $(SRC_ZIP_WORK_DIR)/$(patsubst $(TOPDIR)/%,%,$d)/$m) \
|
||||
$(if $(SRC_GENERATED), , \
|
||||
$(eval $$($d_TARGET): $d ; \
|
||||
|
@ -393,12 +393,25 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
|
||||
AC_MSG_CHECKING([if codesign certificate is present])
|
||||
$RM codesign-testfile
|
||||
$TOUCH codesign-testfile
|
||||
$CODESIGN -s "$MACOSX_CODESIGN_IDENTITY" codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN=
|
||||
$CODESIGN -s "$MACOSX_CODESIGN_IDENTITY" codesign-testfile 2>&AS_MESSAGE_LOG_FD \
|
||||
>&AS_MESSAGE_LOG_FD || CODESIGN=
|
||||
$RM codesign-testfile
|
||||
if test "x$CODESIGN" = x; then
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
# Verify that the codesign has --option runtime
|
||||
AC_MSG_CHECKING([if codesign has --option runtime])
|
||||
$RM codesign-testfile
|
||||
$TOUCH codesign-testfile
|
||||
$CODESIGN --option runtime -s "$MACOSX_CODESIGN_IDENTITY" codesign-testfile \
|
||||
2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN=
|
||||
$RM codesign-testfile
|
||||
if test "x$CODESIGN" = x; then
|
||||
AC_MSG_ERROR([codesign does not have --option runtime. macOS 10.13.6 and above is required.])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
UTIL_REQUIRE_PROGS(SETFILE, SetFile)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -167,36 +167,38 @@ AC_DEFUN_ONCE([BPERF_SETUP_TEST_JOBS],
|
||||
|
||||
AC_DEFUN([BPERF_SETUP_CCACHE],
|
||||
[
|
||||
AC_ARG_ENABLE([ccache],
|
||||
[AS_HELP_STRING([--enable-ccache],
|
||||
[enable using ccache to speed up recompilations @<:@disabled@:>@])])
|
||||
# Check if ccache is available
|
||||
CCACHE_AVAILABLE=true
|
||||
|
||||
CCACHE_STATUS=
|
||||
AC_MSG_CHECKING([is ccache enabled])
|
||||
if test "x$enable_ccache" = xyes; then
|
||||
if test "x$TOOLCHAIN_TYPE" = "xgcc" -o "x$TOOLCHAIN_TYPE" = "xclang"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
OLD_PATH="$PATH"
|
||||
if test "x$TOOLCHAIN_PATH" != x; then
|
||||
PATH=$TOOLCHAIN_PATH:$PATH
|
||||
fi
|
||||
UTIL_REQUIRE_PROGS(CCACHE, ccache)
|
||||
PATH="$OLD_PATH"
|
||||
CCACHE_VERSION=[`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'`]
|
||||
CCACHE_STATUS="Active ($CCACHE_VERSION)"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([ccache is not supported with toolchain type $TOOLCHAIN_TYPE])
|
||||
fi
|
||||
elif test "x$enable_ccache" = xno; then
|
||||
AC_MSG_RESULT([no, explicitly disabled])
|
||||
CCACHE_STATUS="Disabled"
|
||||
elif test "x$enable_ccache" = x; then
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([unknown])
|
||||
AC_MSG_ERROR([--enable-ccache does not accept any parameters])
|
||||
OLD_PATH="$PATH"
|
||||
if test "x$TOOLCHAIN_PATH" != x; then
|
||||
PATH=$TOOLCHAIN_PATH:$PATH
|
||||
fi
|
||||
UTIL_PATH_PROGS(CCACHE, ccache)
|
||||
PATH="$OLD_PATH"
|
||||
|
||||
AC_MSG_CHECKING([if ccache is available])
|
||||
if test "x$TOOLCHAIN_TYPE" != "xgcc" && test "x$TOOLCHAIN_TYPE" != "xclang"; then
|
||||
AC_MSG_RESULT([no, not supported for toolchain type $TOOLCHAIN_TYPE])
|
||||
CCACHE_AVAILABLE=false
|
||||
elif test "x$CCACHE" = "x"; then
|
||||
AC_MSG_RESULT([no, ccache binary missing or not executable])
|
||||
CCACHE_AVAILABLE=false
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
CCACHE_STATUS=""
|
||||
UTIL_ARG_ENABLE(NAME: ccache, DEFAULT: false, AVAILABLE: $CCACHE_AVAILABLE,
|
||||
DESC: [enable using ccache to speed up recompilations],
|
||||
CHECKING_MSG: [if ccache is enabled],
|
||||
IF_ENABLED: [
|
||||
CCACHE_VERSION=[`$CCACHE --version | head -n1 | $SED 's/[A-Za-z ]*//'`]
|
||||
CCACHE_STATUS="Active ($CCACHE_VERSION)"
|
||||
],
|
||||
IF_DISABLED: [
|
||||
CCACHE=""
|
||||
])
|
||||
AC_SUBST(CCACHE)
|
||||
|
||||
AC_ARG_WITH([ccache-dir],
|
||||
@ -284,10 +286,10 @@ AC_DEFUN([BPERF_RUN_ICECC_CREATE_ENV],
|
||||
#
|
||||
AC_DEFUN([BPERF_SETUP_ICECC],
|
||||
[
|
||||
AC_ARG_ENABLE([icecc], [AS_HELP_STRING([--enable-icecc],
|
||||
[enable distribted compilation of native code using icecc/icecream @<:@disabled@:>@])])
|
||||
UTIL_ARG_ENABLE(NAME: icecc, DEFAULT: false, RESULT: ENABLE_ICECC,
|
||||
DESC: [enable distributed compilation of native code using icecc/icecream])
|
||||
|
||||
if test "x${enable_icecc}" = "xyes"; then
|
||||
if test "x$ENABLE_ICECC" = "xtrue"; then
|
||||
UTIL_REQUIRE_PROGS(ICECC_CMD, icecc)
|
||||
old_path="$PATH"
|
||||
|
||||
@ -349,56 +351,44 @@ AC_DEFUN([BPERF_SETUP_ICECC],
|
||||
else
|
||||
BUILD_ICECC="${ICECC}"
|
||||
fi
|
||||
AC_SUBST(ICECC)
|
||||
AC_SUBST(BUILD_ICECC)
|
||||
fi
|
||||
|
||||
AC_SUBST(ICECC)
|
||||
AC_SUBST(BUILD_ICECC)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Can the C/C++ compiler use precompiled headers?
|
||||
#
|
||||
AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers],
|
||||
[disable using precompiled headers when compiling C++ @<:@enabled@:>@])],
|
||||
[ENABLE_PRECOMPH=${enable_precompiled_headers}], [ENABLE_PRECOMPH=yes])
|
||||
|
||||
USE_PRECOMPILED_HEADER=true
|
||||
AC_MSG_CHECKING([If precompiled header is enabled])
|
||||
if test "x$ENABLE_PRECOMPH" = xno; then
|
||||
AC_MSG_RESULT([no, forced])
|
||||
USE_PRECOMPILED_HEADER=false
|
||||
elif test "x$ICECC" != "x"; then
|
||||
# Are precompiled headers available?
|
||||
PRECOMPILED_HEADERS_AVAILABLE=true
|
||||
AC_MSG_CHECKING([if precompiled headers are available])
|
||||
if test "x$ICECC" != "x"; then
|
||||
AC_MSG_RESULT([no, does not work effectively with icecc])
|
||||
USE_PRECOMPILED_HEADER=false
|
||||
PRECOMPILED_HEADERS_AVAILABLE=false
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
AC_MSG_RESULT([no, does not work with Solaris Studio])
|
||||
USE_PRECOMPILED_HEADER=false
|
||||
PRECOMPILED_HEADERS_AVAILABLE=false
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
AC_MSG_RESULT([no, does not work with xlc])
|
||||
USE_PRECOMPILED_HEADER=false
|
||||
PRECOMPILED_HEADERS_AVAILABLE=false
|
||||
elif test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
# Check that the compiler actually supports precomp headers.
|
||||
echo "int alfa();" > conftest.h
|
||||
$CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD
|
||||
if test ! -f conftest.hpp.gch; then
|
||||
PRECOMPILED_HEADERS_AVAILABLE=false
|
||||
AC_MSG_RESULT([no, gcc fails to compile properly with -x c++-header])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
$RM conftest.h conftest.hpp.gch
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
|
||||
if test "x$ENABLE_PRECOMPH" = xyes; then
|
||||
# Check that the compiler actually supports precomp headers.
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
AC_MSG_CHECKING([that precompiled headers work])
|
||||
echo "int alfa();" > conftest.h
|
||||
$CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD
|
||||
if test ! -f conftest.hpp.gch; then
|
||||
USE_PRECOMPILED_HEADER=false
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
$RM conftest.h conftest.hpp.gch
|
||||
fi
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: precompiled-headers, DEFAULT: auto,
|
||||
RESULT: USE_PRECOMPILED_HEADER, AVAILABLE: $PRECOMPILED_HEADERS_AVAILABLE,
|
||||
DESC: [enable using precompiled headers when compiling C++])
|
||||
AC_SUBST(USE_PRECOMPILED_HEADER)
|
||||
])
|
||||
|
||||
@ -442,29 +432,28 @@ AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
|
||||
if test "$MX_VALUE" -lt "512"; then
|
||||
MX_VALUE=512
|
||||
fi
|
||||
UTIL_ADD_JVM_ARG_IF_OK([-Xms${MS_VALUE}M -Xmx${MX_VALUE}M],SJAVAC_SERVER_JAVA_FLAGS,[$SJAVAC_SERVER_JAVA])
|
||||
|
||||
JAVAC_SERVER_AVAILABLE=true
|
||||
SJAVAC_MEMORY_OPT="-Xms${MS_VALUE}M -Xmx${MX_VALUE}M"
|
||||
UTIL_ADD_JVM_ARG_IF_OK([$SJAVAC_MEMORY_OPT],SJAVAC_SERVER_JAVA_FLAGS,[$SJAVAC_SERVER_JAVA])
|
||||
if test "x$JVM_ARG_OK" = "xfalse"; then
|
||||
AC_MSG_WARN([Could not set '$SJAVAC_MEMORY_OPT' on bootjdk, disabling sjavac and javac server])
|
||||
JAVAC_SERVER_AVAILABLE=false
|
||||
fi
|
||||
AC_SUBST(SJAVAC_SERVER_JAVA_FLAGS)
|
||||
|
||||
AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac],
|
||||
[use sjavac to do fast incremental compiles @<:@disabled@:>@])],
|
||||
[ENABLE_SJAVAC="${enableval}"], [ENABLE_SJAVAC="no"])
|
||||
if test "x$JVM_ARG_OK" = "xfalse"; then
|
||||
AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling sjavac])
|
||||
ENABLE_SJAVAC="no"
|
||||
fi
|
||||
AC_MSG_CHECKING([whether to use sjavac])
|
||||
AC_MSG_RESULT([$ENABLE_SJAVAC])
|
||||
UTIL_ARG_ENABLE(NAME: sjavac, DEFAULT: false, AVAILABLE: $JAVAC_SERVER_AVAILABLE,
|
||||
DESC: [use sjavac to do fast incremental compiles],
|
||||
CHECKING_MSG: [whether to use sjavac],
|
||||
IF_ENABLED: [ ENABLE_SJAVAC="yes" ],
|
||||
IF_DISABLED: [ ENABLE_SJAVAC="no" ])
|
||||
AC_SUBST(ENABLE_SJAVAC)
|
||||
|
||||
AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--disable-javac-server],
|
||||
[disable javac server @<:@enabled@:>@])],
|
||||
[ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER="yes"])
|
||||
if test "x$JVM_ARG_OK" = "xfalse"; then
|
||||
AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server])
|
||||
ENABLE_JAVAC_SERVER="no"
|
||||
fi
|
||||
AC_MSG_CHECKING([whether to use javac server])
|
||||
AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
|
||||
UTIL_ARG_ENABLE(NAME: javac-server, DEFAULT: true, AVAILABLE: $JAVAC_SERVER_AVAILABLE,
|
||||
DESC: [enable javac server],
|
||||
CHECKING_MSG: [whether to use javac server],
|
||||
IF_ENABLED: [ ENABLE_JAVAC_SERVER="yes" ],
|
||||
IF_DISABLED: [ ENABLE_JAVAC_SERVER="no" ])
|
||||
AC_SUBST(ENABLE_JAVAC_SERVER)
|
||||
|
||||
if test "x$ENABLE_JAVAC_SERVER" = "xyes" || test "x$ENABLE_SJAVAC" = "xyes"; then
|
||||
|
@ -132,29 +132,17 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
|
||||
AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
[
|
||||
AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors],
|
||||
[do not consider native warnings to be an error @<:@enabled@:>@])])
|
||||
|
||||
# Set default value.
|
||||
if test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
WARNINGS_AS_ERRORS=false
|
||||
if test "x$TOOLCHAIN_TYPE" != xxlc; then
|
||||
WARNINGS_AS_ERRORS_DEFAULT=true
|
||||
else
|
||||
WARNINGS_AS_ERRORS=true
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if native warnings are errors])
|
||||
if test "x$enable_warnings_as_errors" = "xyes"; then
|
||||
AC_MSG_RESULT([yes (explicitly set)])
|
||||
WARNINGS_AS_ERRORS=true
|
||||
elif test "x$enable_warnings_as_errors" = "xno"; then
|
||||
AC_MSG_RESULT([no (explicitly set)])
|
||||
WARNINGS_AS_ERRORS=false
|
||||
elif test "x$enable_warnings_as_errors" = "x"; then
|
||||
AC_MSG_RESULT([${WARNINGS_AS_ERRORS} (default)])
|
||||
else
|
||||
AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument])
|
||||
WARNINGS_AS_ERRORS_DEFAULT=false
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: warnings-as-errors, DEFAULT: $WARNINGS_AS_ERRORS_DEFAULT,
|
||||
RESULT: WARNINGS_AS_ERRORS,
|
||||
DEFAULT_DESC: [auto],
|
||||
DESC: [consider native warnings to be an error])
|
||||
AC_SUBST(WARNINGS_AS_ERRORS)
|
||||
|
||||
case "${TOOLCHAIN_TYPE}" in
|
||||
|
@ -116,50 +116,32 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
|
||||
#
|
||||
AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_GTEST],
|
||||
[
|
||||
AC_ARG_ENABLE([hotspot-gtest], [AS_HELP_STRING([--disable-hotspot-gtest],
|
||||
[Disables building of the Hotspot unit tests @<:@enabled@:>@])])
|
||||
|
||||
GTEST_AVAILABLE=true
|
||||
|
||||
AC_MSG_CHECKING([if Hotspot gtest test source is present])
|
||||
if test -e "${TOPDIR}/test/hotspot/gtest"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, cannot run gtest])
|
||||
AC_MSG_RESULT([no, cannot build gtest])
|
||||
GTEST_AVAILABLE=false
|
||||
fi
|
||||
|
||||
# On solaris, we also must have the libstlport.so.1 library, setup in
|
||||
# LIB_SETUP_LIBRARIES.
|
||||
if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
if test "x$STLPORT_LIB" = "x"; then
|
||||
AC_MSG_CHECKING([if the libstlport.so.1 library is present])
|
||||
if test "x$STLPORT_LIB" != "x"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, cannot build gtest])
|
||||
GTEST_AVAILABLE=false
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if Hotspot gtest unit tests should be built])
|
||||
if test "x$enable_hotspot_gtest" = "xyes"; then
|
||||
if test "x$GTEST_AVAILABLE" = "xtrue"; then
|
||||
AC_MSG_RESULT([yes, forced])
|
||||
BUILD_GTEST="true"
|
||||
else
|
||||
AC_MSG_ERROR([Cannot build gtest with missing dependencies])
|
||||
fi
|
||||
elif test "x$enable_hotspot_gtest" = "xno"; then
|
||||
AC_MSG_RESULT([no, forced])
|
||||
BUILD_GTEST="false"
|
||||
elif test "x$enable_hotspot_gtest" = "x"; then
|
||||
if test "x$GTEST_AVAILABLE" = "xtrue"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
BUILD_GTEST="true"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
BUILD_GTEST="false"
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([--enable-gtest must be either yes or no])
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: hotspot-gtest, DEFAULT: auto,
|
||||
RESULT: BUILD_GTEST, AVAILABLE: $GTEST_AVAILABLE,
|
||||
DEFAULT_DESC: [enabled if possible to build],
|
||||
DESC: [enable building of the Hotspot unit tests])
|
||||
AC_SUBST(BUILD_GTEST)
|
||||
])
|
||||
|
||||
|
@ -46,19 +46,17 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
||||
[
|
||||
DEBUG_LEVEL="release"
|
||||
AC_MSG_CHECKING([which debug level to use])
|
||||
AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
|
||||
[set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
|
||||
[
|
||||
ENABLE_DEBUG="${enableval}"
|
||||
DEBUG_LEVEL="fastdebug"
|
||||
], [ENABLE_DEBUG="no"])
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: debug, DEFAULT: false, RESULT: ENABLE_DEBUG,
|
||||
DESC: [enable debugging (shorthand for --with-debug-level=fastdebug)],
|
||||
IF_ENABLED: [ DEBUG_LEVEL="fastdebug" ])
|
||||
|
||||
AC_MSG_CHECKING([which debug level to use])
|
||||
AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
|
||||
[set the debug level (release, fastdebug, slowdebug, optimized) @<:@release@:>@])],
|
||||
[
|
||||
DEBUG_LEVEL="${withval}"
|
||||
if test "x$ENABLE_DEBUG" = xyes; then
|
||||
if test "x$ENABLE_DEBUG" = xtrue; then
|
||||
AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
|
||||
fi
|
||||
])
|
||||
@ -103,77 +101,42 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
|
||||
[
|
||||
AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
|
||||
[suppress building custom source even if present @<:@disabled@:>@])],,[enable_openjdk_only="no"])
|
||||
|
||||
AC_MSG_CHECKING([if custom source is suppressed (openjdk-only)])
|
||||
AC_MSG_RESULT([$enable_openjdk_only])
|
||||
if test "x$enable_openjdk_only" = "xyes"; then
|
||||
SUPPRESS_CUSTOM_EXTENSIONS="true"
|
||||
elif test "x$enable_openjdk_only" = "xno"; then
|
||||
SUPPRESS_CUSTOM_EXTENSIONS="false"
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value for --enable-openjdk-only: $enable_openjdk_only])
|
||||
fi
|
||||
UTIL_ARG_ENABLE(NAME: openjdk-only, DEFAULT: false,
|
||||
RESULT: SUPPRESS_CUSTOM_EXTENSIONS,
|
||||
DESC: [suppress building custom source even if present],
|
||||
CHECKING_MSG: [if custom source is suppressed (openjdk-only)])
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
[
|
||||
# Should we build a JDK without a graphical UI?
|
||||
AC_MSG_CHECKING([headless only])
|
||||
AC_ARG_ENABLE([headless-only], [AS_HELP_STRING([--enable-headless-only],
|
||||
[only build headless (no GUI) support @<:@disabled@:>@])])
|
||||
|
||||
if test "x$enable_headless_only" = "xyes"; then
|
||||
ENABLE_HEADLESS_ONLY="true"
|
||||
AC_MSG_RESULT([yes])
|
||||
elif test "x$enable_headless_only" = "xno"; then
|
||||
ENABLE_HEADLESS_ONLY="false"
|
||||
AC_MSG_RESULT([no])
|
||||
elif test "x$enable_headless_only" = "x"; then
|
||||
ENABLE_HEADLESS_ONLY="false"
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_ERROR([--enable-headless-only can only take yes or no])
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: headless-only, DEFAULT: false,
|
||||
RESULT: ENABLE_HEADLESS_ONLY,
|
||||
DESC: [only build headless (no GUI) support],
|
||||
CHECKING_MSG: [if we should build headless-only (no GUI)])
|
||||
AC_SUBST(ENABLE_HEADLESS_ONLY)
|
||||
|
||||
# should we linktime gc unused code sections in the JDK build ?
|
||||
AC_MSG_CHECKING([linktime gc])
|
||||
AC_ARG_ENABLE([linktime-gc], [AS_HELP_STRING([--enable-linktime-gc],
|
||||
[linktime gc unused code sections in the JDK build @<:@disabled@:>@])])
|
||||
|
||||
if test "x$enable_linktime_gc" = "xyes"; then
|
||||
ENABLE_LINKTIME_GC="true"
|
||||
AC_MSG_RESULT([yes])
|
||||
elif test "x$enable_linktime_gc" = "xno"; then
|
||||
ENABLE_LINKTIME_GC="false"
|
||||
AC_MSG_RESULT([no])
|
||||
elif test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = xs390x; then
|
||||
ENABLE_LINKTIME_GC="true"
|
||||
AC_MSG_RESULT([yes])
|
||||
elif test "x$enable_linktime_gc" = "x"; then
|
||||
ENABLE_LINKTIME_GC="false"
|
||||
AC_MSG_RESULT([no])
|
||||
if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = xs390x; then
|
||||
LINKTIME_GC_DEFAULT=true
|
||||
else
|
||||
AC_MSG_ERROR([--enable-linktime-gc can only take yes or no])
|
||||
LINKTIME_GC_DEFAULT=false
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: linktime-gc, DEFAULT: $LINKTIME_GC_DEFAULT,
|
||||
DEFAULT_DESC: [auto], RESULT: ENABLE_LINKTIME_GC,
|
||||
DESC: [use link time gc on unused code sections in the JDK build],
|
||||
CHECKING_MSG: [if linker should clean out unused code (linktime-gc)])
|
||||
AC_SUBST(ENABLE_LINKTIME_GC)
|
||||
|
||||
|
||||
# Should we build the complete docs, or just a lightweight version?
|
||||
AC_ARG_ENABLE([full-docs], [AS_HELP_STRING([--enable-full-docs],
|
||||
[build complete documentation @<:@enabled if all tools found@:>@])])
|
||||
|
||||
# Verify dependencies
|
||||
# Check for full doc dependencies
|
||||
FULL_DOCS_AVAILABLE=true
|
||||
AC_MSG_CHECKING([for graphviz dot])
|
||||
if test "x$DOT" != "x"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, cannot generate full docs])
|
||||
FULL_DOCS_DEP_MISSING=true
|
||||
FULL_DOCS_AVAILABLE=false
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([for pandoc])
|
||||
@ -181,35 +144,13 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, cannot generate full docs])
|
||||
FULL_DOCS_DEP_MISSING=true
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([full docs])
|
||||
if test "x$enable_full_docs" = xyes; then
|
||||
if test "x$FULL_DOCS_DEP_MISSING" = "xtrue"; then
|
||||
AC_MSG_RESULT([no, missing dependencies])
|
||||
HELP_MSG_MISSING_DEPENDENCY([dot])
|
||||
AC_MSG_ERROR([Cannot enable full docs with missing dependencies. See above. $HELP_MSG])
|
||||
else
|
||||
ENABLE_FULL_DOCS=true
|
||||
AC_MSG_RESULT([yes, forced])
|
||||
fi
|
||||
elif test "x$enable_full_docs" = xno; then
|
||||
ENABLE_FULL_DOCS=false
|
||||
AC_MSG_RESULT([no, forced])
|
||||
elif test "x$enable_full_docs" = x; then
|
||||
# Check for prerequisites
|
||||
if test "x$FULL_DOCS_DEP_MISSING" = xtrue; then
|
||||
ENABLE_FULL_DOCS=false
|
||||
AC_MSG_RESULT([no, missing dependencies])
|
||||
else
|
||||
ENABLE_FULL_DOCS=true
|
||||
AC_MSG_RESULT([yes, dependencies present])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([--enable-full-docs can only take yes or no])
|
||||
FULL_DOCS_AVAILABLE=false
|
||||
fi
|
||||
|
||||
# Should we build the complete docs, or just a lightweight version?
|
||||
UTIL_ARG_ENABLE(NAME: full-docs, DEFAULT: auto, RESULT: ENABLE_FULL_DOCS,
|
||||
AVAILABLE: $FULL_DOCS_AVAILABLE, DESC: [build complete documentation],
|
||||
DEFAULT_DESC: [enabled if all tools found])
|
||||
AC_SUBST(ENABLE_FULL_DOCS)
|
||||
|
||||
# Choose cacerts source file
|
||||
@ -229,14 +170,8 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
AC_SUBST(CACERTS_FILE)
|
||||
|
||||
# Enable or disable unlimited crypto
|
||||
AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--disable-unlimited-crypto],
|
||||
[Disable unlimited crypto policy @<:@enabled@:>@])],,
|
||||
[enable_unlimited_crypto=yes])
|
||||
if test "x$enable_unlimited_crypto" = "xyes"; then
|
||||
UNLIMITED_CRYPTO=true
|
||||
else
|
||||
UNLIMITED_CRYPTO=false
|
||||
fi
|
||||
UTIL_ARG_ENABLE(NAME: unlimited-crypto, DEFAULT: true, RESULT: UNLIMITED_CRYPTO,
|
||||
DESC: [enable unlimited crypto policy])
|
||||
AC_SUBST(UNLIMITED_CRYPTO)
|
||||
|
||||
# Should we build the serviceability agent (SA)?
|
||||
@ -422,14 +357,19 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
|
||||
[
|
||||
AC_ARG_ENABLE(native-coverage, [AS_HELP_STRING([--enable-native-coverage],
|
||||
[enable native compilation with code coverage data@<:@disabled@:>@])])
|
||||
GCOV_ENABLED="false"
|
||||
if test "x$enable_native_coverage" = "xyes"; then
|
||||
case $TOOLCHAIN_TYPE in
|
||||
gcc | clang)
|
||||
AC_MSG_CHECKING([if native coverage is enabled])
|
||||
AC_MSG_RESULT([yes])
|
||||
UTIL_ARG_ENABLE(NAME: native-coverage, DEFAULT: false, RESULT: GCOV_ENABLED,
|
||||
DESC: [enable native compilation with code coverage data],
|
||||
CHECK_AVAILABLE: [
|
||||
AC_MSG_CHECKING([if native coverage is available])
|
||||
if test "x$TOOLCHAIN_TYPE" = "xgcc" ||
|
||||
test "x$TOOLCHAIN_TYPE" = "xclang"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AVAILABLE=false
|
||||
fi
|
||||
],
|
||||
IF_ENABLED: [
|
||||
GCOV_CFLAGS="-fprofile-arcs -ftest-coverage -fno-inline"
|
||||
GCOV_LDFLAGS="-fprofile-arcs"
|
||||
JVM_CFLAGS="$JVM_CFLAGS $GCOV_CFLAGS"
|
||||
@ -440,18 +380,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
|
||||
CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE $GCOV_CFLAGS"
|
||||
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $GCOV_LDFLAGS"
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $GCOV_LDFLAGS"
|
||||
GCOV_ENABLED="true"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-native-coverage only works with toolchain type gcc or clang])
|
||||
;;
|
||||
esac
|
||||
elif test "x$enable_native_coverage" = "xno"; then
|
||||
AC_MSG_CHECKING([if native coverage is enabled])
|
||||
AC_MSG_RESULT([no])
|
||||
elif test "x$enable_native_coverage" != "x"; then
|
||||
AC_MSG_ERROR([--enable-native-coverage can only be assigned "yes" or "no"])
|
||||
fi
|
||||
])
|
||||
AC_SUBST(GCOV_ENABLED)
|
||||
|
||||
AC_ARG_WITH(jcov, [AS_HELP_STRING([--with-jcov],
|
||||
@ -498,14 +427,19 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
|
||||
[
|
||||
AC_ARG_ENABLE(asan, [AS_HELP_STRING([--enable-asan],
|
||||
[enable AddressSanitizer if possible @<:@disabled@:>@])])
|
||||
ASAN_ENABLED="no"
|
||||
if test "x$enable_asan" = "xyes"; then
|
||||
case $TOOLCHAIN_TYPE in
|
||||
gcc | clang)
|
||||
AC_MSG_CHECKING([if asan is enabled])
|
||||
AC_MSG_RESULT([yes])
|
||||
UTIL_ARG_ENABLE(NAME: asan, DEFAULT: false,
|
||||
DESC: [enable AddressSanitizer],
|
||||
CHECK_AVAILABLE: [
|
||||
AC_MSG_CHECKING([if AddressSanitizer (asan) is available])
|
||||
if test "x$TOOLCHAIN_TYPE" = "xgcc" ||
|
||||
test "x$TOOLCHAIN_TYPE" = "xclang"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AVAILABLE=false
|
||||
fi
|
||||
],
|
||||
IF_ENABLED: [
|
||||
ASAN_CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
|
||||
ASAN_LDFLAGS="-fsanitize=address"
|
||||
JVM_CFLAGS="$JVM_CFLAGS $ASAN_CFLAGS"
|
||||
@ -517,17 +451,10 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
|
||||
LDFLAGS_JDKLIB="$LDFLAGS_JDKLIB $ASAN_LDFLAGS"
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE $ASAN_LDFLAGS"
|
||||
ASAN_ENABLED="yes"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([--enable-asan only works with toolchain type gcc or clang])
|
||||
;;
|
||||
esac
|
||||
elif test "x$enable_asan" = "xno"; then
|
||||
AC_MSG_CHECKING([if asan is enabled])
|
||||
AC_MSG_RESULT([no])
|
||||
elif test "x$enable_asan" != "x"; then
|
||||
AC_MSG_ERROR([--enable-asan can only be assigned "yes" or "no"])
|
||||
fi
|
||||
],
|
||||
IF_DISABLED: [
|
||||
ASAN_ENABLED="no"
|
||||
])
|
||||
|
||||
AC_SUBST(ASAN_ENABLED)
|
||||
])
|
||||
@ -539,26 +466,23 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
|
||||
[
|
||||
AC_ARG_ENABLE([static-build], [AS_HELP_STRING([--enable-static-build],
|
||||
[enable static library build @<:@disabled@:>@])])
|
||||
STATIC_BUILD=false
|
||||
if test "x$enable_static_build" = "xyes"; then
|
||||
AC_MSG_CHECKING([if static build is enabled])
|
||||
AC_MSG_RESULT([yes])
|
||||
if test "x$OPENJDK_TARGET_OS" != "xmacosx"; then
|
||||
AC_MSG_ERROR([--enable-static-build is only supported for macosx builds])
|
||||
fi
|
||||
STATIC_BUILD_CFLAGS="-DSTATIC_BUILD=1"
|
||||
CFLAGS_JDKLIB_EXTRA="$CFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
|
||||
CXXFLAGS_JDKLIB_EXTRA="$CXXFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
|
||||
STATIC_BUILD=true
|
||||
elif test "x$enable_static_build" = "xno"; then
|
||||
AC_MSG_CHECKING([if static build is enabled])
|
||||
AC_MSG_RESULT([no])
|
||||
elif test "x$enable_static_build" != "x"; then
|
||||
AC_MSG_ERROR([--enable-static-build can only be assigned "yes" or "no"])
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: static-build, DEFAULT: false, RESULT: STATIC_BUILD,
|
||||
DESC: [enable static library build],
|
||||
CHECKING_MSG: [if static build is enabled],
|
||||
CHECK_AVAILABLE: [
|
||||
AC_MSG_CHECKING([if static build is available])
|
||||
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AVAILABLE=false
|
||||
fi
|
||||
],
|
||||
IF_ENABLED: [
|
||||
STATIC_BUILD_CFLAGS="-DSTATIC_BUILD=1"
|
||||
CFLAGS_JDKLIB_EXTRA="$CFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
|
||||
CXXFLAGS_JDKLIB_EXTRA="$CXXFLAGS_JDKLIB_EXTRA $STATIC_BUILD_CFLAGS"
|
||||
])
|
||||
AC_SUBST(STATIC_BUILD)
|
||||
])
|
||||
|
||||
@ -569,24 +493,10 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
|
||||
[
|
||||
AC_ARG_ENABLE([keep-packaged-modules], [AS_HELP_STRING([--disable-keep-packaged-modules],
|
||||
[Do not keep packaged modules in jdk image @<:@enable@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([if packaged modules are kept])
|
||||
if test "x$enable_keep_packaged_modules" = "xyes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
JLINK_KEEP_PACKAGED_MODULES=true
|
||||
elif test "x$enable_keep_packaged_modules" = "xno"; then
|
||||
AC_MSG_RESULT([no])
|
||||
JLINK_KEEP_PACKAGED_MODULES=false
|
||||
elif test "x$enable_keep_packaged_modules" = "x"; then
|
||||
AC_MSG_RESULT([yes (default)])
|
||||
JLINK_KEEP_PACKAGED_MODULES=true
|
||||
else
|
||||
AC_MSG_RESULT([error])
|
||||
AC_MSG_ERROR([--enable-keep-packaged-modules accepts no argument])
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: keep-packaged-modules, DEFAULT: true,
|
||||
RESULT: JLINK_KEEP_PACKAGED_MODULES,
|
||||
DESC: [enable keeping of packaged modules in jdk image],
|
||||
CHECKING_MSG: [if packaged modules are kept])
|
||||
AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
|
||||
])
|
||||
|
||||
@ -596,36 +506,20 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
|
||||
[
|
||||
AC_ARG_ENABLE([jtreg-failure-handler], [AS_HELP_STRING([--enable-jtreg-failure-handler],
|
||||
[forces build of the jtreg failure handler to be enabled, missing dependencies
|
||||
become fatal errors. Default is auto, where the failure handler is built if all
|
||||
dependencies are present and otherwise just disabled.])])
|
||||
|
||||
AC_MSG_CHECKING([if jtreg failure handler should be built])
|
||||
|
||||
if test "x$enable_jtreg_failure_handler" = "xyes"; then
|
||||
if test "x$JT_HOME" = "x"; then
|
||||
AC_MSG_ERROR([Cannot enable jtreg failure handler without jtreg.])
|
||||
else
|
||||
BUILD_FAILURE_HANDLER=true
|
||||
AC_MSG_RESULT([yes, forced])
|
||||
fi
|
||||
elif test "x$enable_jtreg_failure_handler" = "xno"; then
|
||||
BUILD_FAILURE_HANDLER=false
|
||||
AC_MSG_RESULT([no, forced])
|
||||
elif test "x$enable_jtreg_failure_handler" = "xauto" \
|
||||
|| test "x$enable_jtreg_failure_handler" = "x"; then
|
||||
if test "x$JT_HOME" = "x"; then
|
||||
BUILD_FAILURE_HANDLER=false
|
||||
AC_MSG_RESULT([no, missing jtreg])
|
||||
else
|
||||
BUILD_FAILURE_HANDLER=true
|
||||
AC_MSG_RESULT([yes, jtreg present])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value for --enable-jtreg-failure-handler: $enable_jtreg_failure_handler])
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: jtreg-failure-handler, DEFAULT: auto,
|
||||
RESULT: BUILD_FAILURE_HANDLER,
|
||||
DESC: [enable keeping of packaged modules in jdk image],
|
||||
DEFAULT_DESC: [enabled if jtreg is present],
|
||||
CHECKING_MSG: [if the jtreg failure handler should be built],
|
||||
CHECK_AVAILABLE: [
|
||||
AC_MSG_CHECKING([if the jtreg failure handler is available])
|
||||
if test "x$JT_HOME" != "x"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AVAILABLE=false
|
||||
AC_MSG_RESULT([no (jtreg not present)])
|
||||
fi
|
||||
])
|
||||
AC_SUBST(BUILD_FAILURE_HANDLER)
|
||||
])
|
||||
|
||||
@ -635,39 +529,14 @@ AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
|
||||
#
|
||||
AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST],
|
||||
[
|
||||
AC_ARG_ENABLE([generate-classlist], [AS_HELP_STRING([--disable-generate-classlist],
|
||||
[forces enabling or disabling of the generation of a CDS classlist at build time.
|
||||
Default is to generate it when either the server or client JVMs are built and
|
||||
enable-cds is true.])])
|
||||
|
||||
# In jvm-features.m4 ENABLE_CDS is set to true iff all JVM variants has cds
|
||||
# enabled.
|
||||
|
||||
AC_MSG_CHECKING([if the CDS classlist generation should be enabled])
|
||||
if test "x$enable_generate_classlist" = "xyes"; then
|
||||
AC_MSG_RESULT([yes, forced])
|
||||
ENABLE_GENERATE_CLASSLIST="true"
|
||||
if test "x$ENABLE_CDS" = "xfalse"; then
|
||||
# In GenerateLinkOptData.gmk, DumpLoadedClassList is used to generate the
|
||||
# classlist file. It never will work in this case since the VM will report
|
||||
# an error for DumpLoadedClassList when CDS is disabled.
|
||||
AC_MSG_ERROR([Generation of classlist is not possible without JVM feature 'cds'])
|
||||
fi
|
||||
elif test "x$enable_generate_classlist" = "xno"; then
|
||||
AC_MSG_RESULT([no, forced])
|
||||
ENABLE_GENERATE_CLASSLIST="false"
|
||||
elif test "x$enable_generate_classlist" = "x"; then
|
||||
if test "x$ENABLE_CDS" = "xtrue"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
ENABLE_GENERATE_CLASSLIST="true"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
ENABLE_GENERATE_CLASSLIST="false"
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value for --enable-generate-classlist: $enable_generate_classlist])
|
||||
fi
|
||||
|
||||
# In GenerateLinkOptData.gmk, DumpLoadedClassList is used to generate the
|
||||
# classlist file. It never will work if CDS is disabled, since the VM will report
|
||||
# an error for DumpLoadedClassList.
|
||||
UTIL_ARG_ENABLE(NAME: generate-classlist, DEFAULT: auto,
|
||||
RESULT: ENABLE_GENERATE_CLASSLIST, AVAILABLE: $ENABLE_CDS,
|
||||
DESC: [enable generation of a CDS classlist at build time],
|
||||
DEFAULT_DESC: [enabled if the JVM feature 'cds' is enabled for all JVM variants],
|
||||
CHECKING_MSG: [if the CDS classlist generation should be enabled])
|
||||
AC_SUBST(ENABLE_GENERATE_CLASSLIST)
|
||||
])
|
||||
|
||||
@ -699,56 +568,33 @@ AC_DEFUN([JDKOPT_EXCLUDE_TRANSLATIONS],
|
||||
#
|
||||
AC_DEFUN([JDKOPT_ENABLE_DISABLE_MANPAGES],
|
||||
[
|
||||
AC_ARG_ENABLE([manpages], [AS_HELP_STRING([--disable-manpages],
|
||||
[Set to disable copy of static man pages @<:@enabled@:>@])])
|
||||
|
||||
BUILD_MANPAGES="true"
|
||||
AC_MSG_CHECKING([if static man pages should be copied])
|
||||
if test "x$enable_manpages" = "x"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
elif test "x$enable_manpages" = "xyes"; then
|
||||
AC_MSG_RESULT([yes, forced])
|
||||
elif test "x$enable_manpages" = "xno"; then
|
||||
AC_MSG_RESULT([no, forced])
|
||||
BUILD_MANPAGES="false"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([--enable-manpages can only yes/no or empty])
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: manpages, DEFAULT: true, RESULT: BUILD_MANPAGES,
|
||||
DESC: [enable copying of static man pages],
|
||||
CHECKING_MSG: [if static man pages should be copied])
|
||||
AC_SUBST(BUILD_MANPAGES)
|
||||
])
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Disable the default CDS archive generation
|
||||
# cross compilation - disabled
|
||||
#
|
||||
AC_DEFUN([JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE],
|
||||
[
|
||||
AC_ARG_ENABLE([cds-archive], [AS_HELP_STRING([--disable-cds-archive],
|
||||
[Set to disable generation of a default CDS archive in the product image @<:@enabled@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([if a default CDS archive should be generated])
|
||||
if test "x$ENABLE_CDS" = "xfalse"; then
|
||||
AC_MSG_RESULT([no, because CDS is disabled])
|
||||
BUILD_CDS_ARCHIVE="false"
|
||||
elif test "x$COMPILE_TYPE" = "xcross"; then
|
||||
AC_MSG_RESULT([no, not possible with cross compilation])
|
||||
BUILD_CDS_ARCHIVE="false"
|
||||
elif test "x$enable_cds_archive" = "xyes"; then
|
||||
AC_MSG_RESULT([yes, forced])
|
||||
BUILD_CDS_ARCHIVE="true"
|
||||
elif test "x$enable_cds_archive" = "x"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
BUILD_CDS_ARCHIVE="true"
|
||||
elif test "x$enable_cds_archive" = "xno"; then
|
||||
AC_MSG_RESULT([no, forced])
|
||||
BUILD_CDS_ARCHIVE="false"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([--enable-cds_archive can only be yes/no or empty])
|
||||
fi
|
||||
|
||||
UTIL_ARG_ENABLE(NAME: cds-archive, DEFAULT: auto, RESULT: BUILD_CDS_ARCHIVE,
|
||||
DESC: [enable generation of a default CDS archive in the product image],
|
||||
DEFAULT_DESC: [enabled if possible],
|
||||
CHECKING_MSG: [if a default CDS archive should be generated],
|
||||
CHECK_AVAILABLE: [
|
||||
AC_MSG_CHECKING([if CDS archive is available])
|
||||
if test "x$ENABLE_CDS" = "xfalse"; then
|
||||
AC_MSG_RESULT([no (CDS is disabled)])
|
||||
AVAILABLE=false
|
||||
elif test "x$COMPILE_TYPE" = "xcross"; then
|
||||
AC_MSG_RESULT([no (not possible with cross compilation)])
|
||||
AVAILABLE=false
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
])
|
||||
AC_SUBST(BUILD_CDS_ARCHIVE)
|
||||
])
|
||||
|
@ -171,12 +171,14 @@ AC_DEFUN_ONCE([JVM_FEATURES_PARSE_OPTIONS],
|
||||
m4_undefine([FEATURE_SHELL])
|
||||
])
|
||||
|
||||
# Warn if the user has both enabled and disabled a feature
|
||||
# If this happens, disable will override enable.
|
||||
# Check if the user has both enabled and disabled a feature
|
||||
UTIL_GET_MATCHING_VALUES(enabled_and_disabled, $JVM_FEATURES_ENABLED, \
|
||||
$JVM_FEATURES_DISABLED)
|
||||
if test "x$enabled_and_disabled" != x; then
|
||||
AC_MSG_WARN([Disabling of these features will override enabling: '$enabled_and_disabled'])
|
||||
AC_MSG_NOTICE([These feature are both enabled and disabled: '$enabled_and_disabled'])
|
||||
AC_MSG_NOTICE([This can happen if you mix --with-jvm-features and --enable-jvm-feature-*])
|
||||
AC_MSG_NOTICE([The recommendation is to only use --enable-jvm-feature-*])
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
fi
|
||||
|
||||
# Clean up lists and announce results to user
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,6 +28,10 @@
|
||||
################################################################################
|
||||
AC_DEFUN_ONCE([LIB_SETUP_LIBFFI],
|
||||
[
|
||||
UTIL_ARG_ENABLE(NAME: libffi-bundling, DEFAULT: false,
|
||||
RESULT: ENABLE_LIBFFI_BUNDLING,
|
||||
DESC: [enable bundling of libffi.so to make the built JDK runnable on more systems])
|
||||
|
||||
AC_ARG_WITH(libffi, [AS_HELP_STRING([--with-libffi],
|
||||
[specify prefix directory for the libffi package
|
||||
(expecting the libraries under PATH/lib and the headers under PATH/include)])])
|
||||
@ -35,8 +39,6 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBFFI],
|
||||
[specify directory for the libffi include files])])
|
||||
AC_ARG_WITH(libffi-lib, [AS_HELP_STRING([--with-libffi-lib],
|
||||
[specify directory for the libffi library])])
|
||||
AC_ARG_ENABLE(libffi-bundling, [AS_HELP_STRING([--enable-libffi-bundling],
|
||||
[enable bundling of libffi.so to make the built JDK runnable on more systems])])
|
||||
|
||||
if test "x$NEEDS_LIB_FFI" = xfalse; then
|
||||
if (test "x${with_libffi}" != x && test "x${with_libffi}" != xno) || \
|
||||
@ -114,20 +116,6 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBFFI],
|
||||
AC_MSG_ERROR([Found libffi but could not link and compile with it. $HELP_MSG])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([if libffi should be bundled])
|
||||
if test "x$enable_libffi_bundling" = "x"; then
|
||||
AC_MSG_RESULT([no])
|
||||
ENABLE_LIBFFI_BUNDLING=false
|
||||
elif test "x$enable_libffi_bundling" = "xno"; then
|
||||
AC_MSG_RESULT([no, forced])
|
||||
ENABLE_LIBFFI_BUNDLING=false
|
||||
elif test "x$enable_libffi_bundling" = "xyes"; then
|
||||
AC_MSG_RESULT([yes, forced])
|
||||
ENABLE_LIBFFI_BUNDLING=true
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value for --enable-libffi-bundling])
|
||||
fi
|
||||
|
||||
# Find the libffi.so.X to bundle
|
||||
if test "x${ENABLE_LIBFFI_BUNDLING}" = "xtrue"; then
|
||||
AC_MSG_CHECKING([for libffi lib file location])
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -563,11 +563,14 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
|
||||
|
||||
AC_DEFUN([PLATFORM_CHECK_DEPRECATION],
|
||||
[
|
||||
AC_ARG_ENABLE(deprecated-ports, [AS_HELP_STRING([--enable-deprecated-ports@<:@=yes/no@:>@],
|
||||
[Suppress the error when configuring for a deprecated port @<:@no@:>@])])
|
||||
UTIL_ARG_ENABLE(NAME: deprecated-ports, DEFAULT: false,
|
||||
RESULT: ENABLE_DEPRECATED_PORTS,
|
||||
DESC: [suppress the error when configuring for a deprecated port])
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris || (test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc && test "x$with_jvm_variants" != xzero); then
|
||||
if test "x$enable_deprecated_ports" = "xyes"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris || \
|
||||
(test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc && \
|
||||
test "x$with_jvm_variants" != xzero); then
|
||||
if test "x$ENABLE_DEPRECATED_PORTS" = "xtrue"; then
|
||||
AC_MSG_WARN([The Solaris and SPARC ports are deprecated and may be removed in a future release.])
|
||||
else
|
||||
AC_MSG_ERROR(m4_normalize([The Solaris and SPARC ports are deprecated and may be removed in a
|
||||
|
@ -656,7 +656,7 @@ BUILD_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@
|
||||
BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS)
|
||||
BUILD_JAR=@FIXPATH@ $(BUILD_JDK)/bin/jar
|
||||
|
||||
# Interim langtools and rmic modules and arguments
|
||||
# Interim langtools modules and arguments
|
||||
INTERIM_LANGTOOLS_BASE_MODULES := java.compiler jdk.compiler jdk.javadoc
|
||||
INTERIM_LANGTOOLS_MODULES := $(addsuffix .interim, $(INTERIM_LANGTOOLS_BASE_MODULES))
|
||||
INTERIM_LANGTOOLS_ADD_EXPORTS := \
|
||||
@ -675,15 +675,6 @@ INTERIM_LANGTOOLS_ARGS := \
|
||||
JAVAC_MAIN_CLASS = -m jdk.compiler.interim/com.sun.tools.javac.Main
|
||||
JAVADOC_MAIN_CLASS = -m jdk.javadoc.interim/jdk.javadoc.internal.tool.Main
|
||||
|
||||
INTERIM_RMIC_BASE_MODULES := jdk.rmic
|
||||
INTERIM_RMIC_MODULES := $(addsuffix .interim, $(INTERIM_RMIC_BASE_MODULES))
|
||||
#
|
||||
# Use = to delay expansion of PathList since it's not available in this file.
|
||||
INTERIM_RMIC_ARGS = --limit-modules java.base,jdk.compiler,jdk.javadoc \
|
||||
--module-path $(call PathList, $(BUILDTOOLS_OUTPUTDIR)/interim_rmic_modules \
|
||||
$(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules) \
|
||||
#
|
||||
|
||||
# You run the new javac using the boot jdk with $(BOOT_JDK)/bin/java $(NEW_JAVAC) ...
|
||||
# Use = assignment to be able to override in bootcycle-spec.gmk
|
||||
NEW_JAVAC = $(INTERIM_LANGTOOLS_ARGS) $(JAVAC_MAIN_CLASS)
|
||||
|
@ -53,7 +53,7 @@ m4_include([util_windows.m4])
|
||||
AC_DEFUN([UTIL_DEFUN_NAMED],
|
||||
[
|
||||
AC_DEFUN($1, [
|
||||
m4_foreach(arg, m4_split($2), [
|
||||
m4_foreach(arg, m4_split(m4_normalize($2)), [
|
||||
m4_if(m4_bregexp(arg, [^\*]), -1,
|
||||
[
|
||||
m4_set_add(legal_named_args, arg)
|
||||
@ -66,11 +66,12 @@ AC_DEFUN([UTIL_DEFUN_NAMED],
|
||||
])
|
||||
|
||||
m4_foreach([arg], [$3], [
|
||||
m4_if(m4_bregexp(arg, [: ]), -1, m4_define([arg], m4_bpatsubst(arg, [:], [: ])))
|
||||
m4_define(arg_name, m4_substr(arg, 0, m4_bregexp(arg, [: ])))
|
||||
m4_set_contains(legal_named_args, arg_name, [],[AC_MSG_ERROR([Internal error: arg_name is not a valid named argument to [$1]. Valid arguments are 'm4_set_contents(legal_named_args, [ ])'.])])
|
||||
m4_set_contains(legal_named_args, arg_name, [],[AC_MSG_ERROR([Internal error: m4_if(arg_name, , arg, arg_name) is not a valid named argument to [$1]. Valid arguments are 'm4_set_contents(defined_args, [ ]) m4_set_contents(legal_named_args, [ ])'.])])
|
||||
m4_set_remove(required_named_args, arg_name)
|
||||
m4_set_remove(legal_named_args, arg_name)
|
||||
m4_pushdef([ARG_][]arg_name, m4_substr(arg, m4_incr(m4_incr(m4_bregexp(arg, [: ])))))
|
||||
m4_pushdef([ARG_][]arg_name, m4_bpatsubst(m4_substr(arg, m4_incr(m4_incr(m4_bregexp(arg, [: ])))), [^\s*], []))
|
||||
m4_set_add(defined_args, arg_name)
|
||||
m4_undefine([arg_name])
|
||||
])
|
||||
@ -95,6 +96,27 @@ AC_DEFUN([UTIL_DEFUN_NAMED],
|
||||
])
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Assert that a programmatic condition holds. If not, exit with an error message.
|
||||
# Check that a shell expression gives return code 0
|
||||
#
|
||||
# $1: The shell expression to evaluate
|
||||
# $2: A message to describe the expression in case of failure
|
||||
# $2: An message to print in case of failure [optional]
|
||||
#
|
||||
AC_DEFUN([UTIL_ASSERT_SHELL_TEST],
|
||||
[
|
||||
ASSERTION_MSG="m4_normalize([$3])"
|
||||
if $1; then
|
||||
$ECHO Assertion failed: $2
|
||||
if test "x$3" != x; then
|
||||
$ECHO Assertion message: "$3"
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Assert that a programmatic condition holds. If not, exit with an error message.
|
||||
# Check that two strings are equal.
|
||||
@ -105,15 +127,50 @@ AC_DEFUN([UTIL_DEFUN_NAMED],
|
||||
#
|
||||
AC_DEFUN([UTIL_ASSERT_STRING_EQUALS],
|
||||
[
|
||||
ASSERTION_MSG="m4_normalize([$3])"
|
||||
if test "x[$1]" != "x[$2]"; then
|
||||
$ECHO Assertion failed: Actual value '[$1]' \("[$1]"\) did not match \
|
||||
expected value '[$2]' \("[$2]"\)
|
||||
if test "x$ASSERTION_MSG" != x; then
|
||||
$ECHO Assertion message: "$ASSERTION_MSG"
|
||||
fi
|
||||
exit 1
|
||||
fi
|
||||
UTIL_ASSERT_SHELL_TEST(
|
||||
[test "x[$1]" != "x[$2]"],
|
||||
[Actual value '[$1]' \("[$1]"\) did not match expected value '[$2]' \("[$2]"\)],
|
||||
$3)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Assert that a programmatic condition holds. If not, exit with an error message.
|
||||
# Check that two strings not are equal.
|
||||
#
|
||||
# $1: The actual string found
|
||||
# $2: The expected string
|
||||
# $3: An message to print in case of failure [optional]
|
||||
#
|
||||
AC_DEFUN([UTIL_ASSERT_STRING_NOT_EQUALS],
|
||||
[
|
||||
UTIL_ASSERT_SHELL_TEST(
|
||||
[test "x[$1]" = "x[$2]"],
|
||||
[Actual value '[$1]' \("[$1]"\) unexpectedly matched '[$2]' \("[$2]"\)],
|
||||
$3)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Assert that a programmatic condition holds. If not, exit with an error message.
|
||||
# Check that the given expression evaluates to the string 'true'
|
||||
#
|
||||
# $1: The expression to evaluate
|
||||
# $2: An message to print in case of failure [optional]
|
||||
#
|
||||
AC_DEFUN([UTIL_ASSERT_TRUE],
|
||||
[
|
||||
UTIL_ASSERT_STRING_EQUALS($1, true, $3)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Assert that a programmatic condition holds. If not, exit with an error message.
|
||||
# Check that the given expression does not evaluate to the string 'true'
|
||||
#
|
||||
# $1: The expression to evaluate
|
||||
# $2: An message to print in case of failure [optional]
|
||||
#
|
||||
AC_DEFUN([UTIL_ASSERT_NOT_TRUE],
|
||||
[
|
||||
UTIL_ASSERT_STRING_NOT_EQUALS($1, true, $3)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
@ -218,20 +275,11 @@ AC_DEFUN([UTIL_DEPRECATED_ARG_WITH],
|
||||
###############################################################################
|
||||
# Register a --enable argument but mark it as deprecated
|
||||
# $1: The name of the with argument to deprecate, not including --enable-
|
||||
# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -)
|
||||
# $3: Messages to user.
|
||||
AC_DEFUN([UTIL_DEPRECATED_ARG_ENABLE],
|
||||
[
|
||||
AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1],
|
||||
[Deprecated. Option is kept for backwards compatibility and is ignored])])
|
||||
if test "x$enable_$2" != x; then
|
||||
AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.])
|
||||
|
||||
if test "x$3" != x; then
|
||||
AC_MSG_WARN([$3])
|
||||
fi
|
||||
|
||||
fi
|
||||
[Deprecated. Option is kept for backwards compatibility and is ignored])],
|
||||
[AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.])])
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
@ -249,6 +297,143 @@ AC_DEFUN([UTIL_ALIASED_ARG_ENABLE],
|
||||
])
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Creates a command-line option using the --enable-* pattern. Will return a
|
||||
# value of 'true' or 'false' in the RESULT variable, depending on whether the
|
||||
# option was enabled or not by the user. The option can not be turned on if it
|
||||
# is not available, as specified by AVAILABLE and/or AVAILABLE_CHECK.
|
||||
#
|
||||
# Arguments:
|
||||
# NAME: The base name of this option (i.e. what follows --enable-). Required.
|
||||
# RESULT: The name of the variable to set to the result. Defaults to
|
||||
# <NAME in uppercase>_RESULT.
|
||||
# DEFAULT: The default value for this option. Can be true, false or auto.
|
||||
# Defaults to true.
|
||||
# AVAILABLE: If true, this option is allowed to be selected. Defaults to true.
|
||||
# DESC: A description of this option. Defaults to a generic and unhelpful
|
||||
# string.
|
||||
# DEFAULT_DESC: A message describing the default value, for the help. Defaults
|
||||
# to the literal value of DEFAULT.
|
||||
# CHECKING_MSG: The message to present to user when checking this option.
|
||||
# Defaults to a generic message.
|
||||
# CHECK_AVAILABLE: An optional code block to execute to determine if the
|
||||
# option should be available. Must set AVAILABLE to 'false' if not.
|
||||
# IF_GIVEN: An optional code block to execute if the option was given on the
|
||||
# command line (regardless of the value).
|
||||
# IF_ENABLED: An optional code block to execute if the option is turned on.
|
||||
# IF_DISABLED: An optional code block to execute if the option is turned off.
|
||||
#
|
||||
UTIL_DEFUN_NAMED([UTIL_ARG_ENABLE],
|
||||
[*NAME RESULT DEFAULT AVAILABLE DESC DEFAULT_DESC CHECKING_MSG
|
||||
CHECK_AVAILABLE IF_GIVEN IF_ENABLED IF_DISABLED], [$@],
|
||||
[
|
||||
##########################
|
||||
# Part 1: Set up m4 macros
|
||||
##########################
|
||||
|
||||
# If DEFAULT is not specified, set it to 'true'.
|
||||
m4_define([ARG_DEFAULT], m4_if(ARG_DEFAULT, , true, ARG_DEFAULT))
|
||||
|
||||
# If AVAILABLE is not specified, set it to 'true'.
|
||||
m4_define([ARG_AVAILABLE], m4_if(ARG_AVAILABLE, , true, ARG_AVAILABLE))
|
||||
|
||||
# If DEFAULT_DESC is not specified, calculate it from DEFAULT.
|
||||
m4_define([ARG_DEFAULT_DESC], m4_if(ARG_DEFAULT_DESC, , m4_if(ARG_DEFAULT, true, enabled, m4_if(ARG_DEFAULT, false, disabled, ARG_DEFAULT)), ARG_DEFAULT_DESC))
|
||||
|
||||
# If RESULT is not specified, set it to 'ARG_NAME[_ENABLED]'.
|
||||
m4_define([ARG_RESULT], m4_if(ARG_RESULT, , m4_translit(ARG_NAME, [a-z-], [A-Z_])[_ENABLED], ARG_RESULT))
|
||||
# Construct shell variable names for the option
|
||||
m4_define(ARG_OPTION, [enable_]m4_translit(ARG_NAME, [-], [_]))
|
||||
m4_define(ARG_GIVEN, m4_translit(ARG_NAME, [a-z-], [A-Z_])[_GIVEN])
|
||||
|
||||
# If DESC is not specified, set it to a generic description.
|
||||
m4_define([ARG_DESC], m4_if(ARG_DESC, , [Enable the ARG_NAME feature], m4_normalize(ARG_DESC)))
|
||||
|
||||
# If CHECKING_MSG is not specified, set it to a generic description.
|
||||
m4_define([ARG_CHECKING_MSG], m4_if(ARG_CHECKING_MSG, , [for --enable-ARG_NAME], ARG_CHECKING_MSG))
|
||||
|
||||
# If the code blocks are not given, set them to the empty statements to avoid
|
||||
# tripping up bash.
|
||||
m4_define([ARG_CHECK_AVAILABLE], m4_if(ARG_CHECK_AVAILABLE, , :, ARG_CHECK_AVAILABLE))
|
||||
m4_define([ARG_IF_GIVEN], m4_if(ARG_IF_GIVEN, , :, ARG_IF_GIVEN))
|
||||
m4_define([ARG_IF_ENABLED], m4_if(ARG_IF_ENABLED, , :, ARG_IF_ENABLED))
|
||||
m4_define([ARG_IF_DISABLED], m4_if(ARG_IF_DISABLED, , :, ARG_IF_DISABLED))
|
||||
|
||||
##########################
|
||||
# Part 2: Set up autoconf shell code
|
||||
##########################
|
||||
|
||||
# Check that DEFAULT has a valid value
|
||||
if test "[x]ARG_DEFAULT" != xtrue && test "[x]ARG_DEFAULT" != xfalse && \
|
||||
test "[x]ARG_DEFAULT" != xauto ; then
|
||||
AC_MSG_ERROR([Internal error: Argument DEFAULT to [UTIL_ARG_ENABLE] can only be true, false or auto, was: 'ARG_DEFAULT'])
|
||||
fi
|
||||
|
||||
# Check that AVAILABLE has a valid value
|
||||
if test "[x]ARG_AVAILABLE" != xtrue && test "[x]ARG_AVAILABLE" != xfalse; then
|
||||
AC_MSG_ERROR([Internal error: Argument AVAILABLE to [UTIL_ARG_ENABLE] can only be true or false, was: 'ARG_AVAILABLE'])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(ARG_NAME, AS_HELP_STRING([--enable-]ARG_NAME,
|
||||
[ARG_DESC [ARG_DEFAULT_DESC]]), [ARG_GIVEN=true], [ARG_GIVEN=false])
|
||||
|
||||
# Check if the option is available
|
||||
AVAILABLE=ARG_AVAILABLE
|
||||
# Run the available check block (if any), which can overwrite AVAILABLE.
|
||||
ARG_CHECK_AVAILABLE
|
||||
|
||||
# Check if the option should be turned on
|
||||
AC_MSG_CHECKING(ARG_CHECKING_MSG)
|
||||
if test x$ARG_GIVEN = xfalse; then
|
||||
if test ARG_DEFAULT = auto; then
|
||||
# If not given, and default is auto, set it to true iff it's available.
|
||||
ARG_RESULT=$AVAILABLE
|
||||
REASON="from default 'auto'"
|
||||
else
|
||||
ARG_RESULT=ARG_DEFAULT
|
||||
REASON="default"
|
||||
fi
|
||||
else
|
||||
if test x$ARG_OPTION = xyes; then
|
||||
ARG_RESULT=true
|
||||
REASON="from command line"
|
||||
elif test x$ARG_OPTION = xno; then
|
||||
ARG_RESULT=false
|
||||
REASON="from command line"
|
||||
elif test x$ARG_OPTION = xauto; then
|
||||
if test ARG_DEFAULT = auto; then
|
||||
# If both given and default is auto, set it to true iff it's available.
|
||||
ARG_RESULT=$AVAILABLE
|
||||
else
|
||||
ARG_RESULT=ARG_DEFAULT
|
||||
fi
|
||||
REASON="from command line 'auto'"
|
||||
else
|
||||
AC_MSG_ERROR([Option [--enable-]ARG_NAME can only be 'yes', 'no' or 'auto'])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$ARG_RESULT = xtrue; then
|
||||
AC_MSG_RESULT([enabled, $REASON])
|
||||
if test x$AVAILABLE = xfalse; then
|
||||
AC_MSG_ERROR([Option [--enable-]ARG_NAME is not available])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([disabled, $REASON])
|
||||
fi
|
||||
|
||||
# Execute result payloads, if present
|
||||
if test x$ARG_GIVEN = xtrue; then
|
||||
ARG_IF_GIVEN
|
||||
fi
|
||||
|
||||
if test x$ARG_RESULT = xtrue; then
|
||||
ARG_IF_ENABLED
|
||||
else
|
||||
ARG_IF_DISABLED
|
||||
fi
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Test that variable $1 denoting a program is not empty. If empty, exit with an error.
|
||||
# $1: variable to check
|
||||
|
@ -52,9 +52,11 @@ JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools nash
|
||||
JTREG_ROOT_FILES := $(addsuffix /TEST.ROOT, $(JTREG_TESTROOTS))
|
||||
JTREG_GROUP_FILES :=
|
||||
$(foreach root, $(JTREG_TESTROOTS), \
|
||||
$(eval include $(root)/TEST.ROOT) \
|
||||
$(eval $(root)_JTREG_GROUP_FILES := $$(addprefix $(root)/, $$(groups))) \
|
||||
$(eval JTREG_GROUP_FILES += $$($(root)_JTREG_GROUP_FILES)) \
|
||||
$(if $(wildcard $(root)/TEST.ROOT), \
|
||||
$(eval include $(root)/TEST.ROOT) \
|
||||
$(eval $(root)_JTREG_GROUP_FILES := $$(addprefix $(root)/, $$(groups))) \
|
||||
$(eval JTREG_GROUP_FILES += $$($(root)_JTREG_GROUP_FILES)) \
|
||||
) \
|
||||
)
|
||||
|
||||
# Cache the expensive to calculate test names in a generated makefile.
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -154,6 +154,7 @@ endef
|
||||
# SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC
|
||||
# JVM:=path to ..bin/java
|
||||
# ADD_JAVAC_FLAGS:=javac flags to append to the default ones.
|
||||
# DISABLED_WARNINGS:=list of Xlint warnings that should be disabled
|
||||
# SRC:=one or more directories to search for sources. The order of the source roots
|
||||
# is significant. The first found file of a certain name has priority.
|
||||
# BIN:=store classes here
|
||||
@ -198,9 +199,15 @@ define SetupJavaCompilationBody
|
||||
$1_FLAGS := -g
|
||||
endif
|
||||
$1_FLAGS += $$($$($1_SETUP)_FLAGS) $$($1_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS)
|
||||
|
||||
ifneq ($$($1_DISABLED_WARNINGS), )
|
||||
$1_FLAGS += -Xlint:$$(call CommaList, $$(addprefix -, $$($1_DISABLED_WARNINGS)))
|
||||
endif
|
||||
|
||||
ifneq ($$($1_CLASSPATH), )
|
||||
$1_FLAGS += -cp $$(call PathList, $$($1_CLASSPATH))
|
||||
endif
|
||||
|
||||
ifeq ($$($1_JAVAC),)
|
||||
$$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP))
|
||||
endif
|
||||
|
@ -1,94 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# 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.
|
||||
#
|
||||
|
||||
# Setup make rules for creating an RMI compilation.
|
||||
#
|
||||
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
||||
# and the targets generated are listed in a variable by that name.
|
||||
#
|
||||
# Remaining parameters are named arguments. These include:
|
||||
# CLASSES:=List of classes to generate stubs for
|
||||
# CLASSES_DIR:=Directory where to look for classes
|
||||
# STUB_CLASSES_DIR:=Directory in where to put stub classes
|
||||
# RUN_V11:=Set to run rmic with -v1.1
|
||||
# RUN_V12:=Set to run rmic with -v1.2
|
||||
# KEEP_GENERATED:=Set to keep generated sources around
|
||||
# STUB_SOURCES_DIR:=Directory to put generated sources in
|
||||
SetupRMICompilation = $(NamedParamsMacroTemplate)
|
||||
define SetupRMICompilationBody
|
||||
|
||||
$1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/_the.$1_rmic.generated
|
||||
|
||||
$1_CLASSES_SLASH := $$(subst .,/,$$($1_CLASSES))
|
||||
$1_CLASS_FILES := $$(addprefix $$($1_CLASSES_DIR)/,$$(addsuffix .class,$$($1_CLASSES_SLASH)))
|
||||
$1_STUB_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Stub.class,$$($1_CLASSES_SLASH)))
|
||||
$1_TARGETS := $$($1_STUB_FILES)
|
||||
$1_ARGS :=
|
||||
ifneq (,$$($1_RUN_V11))
|
||||
$1_SKEL_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Skel.class,$$($1_CLASSES_SLASH)))
|
||||
$1_TARGETS += $$($1_SKEL_FILES)
|
||||
$1_ARGS += -v1.1
|
||||
endif
|
||||
ifneq (,$$($1_RUN_V12))
|
||||
$1_ARGS += -v1.2
|
||||
endif
|
||||
|
||||
$1_TIE_BASE_FILES := $$(foreach f,$$($1_CLASSES_SLASH),$$(dir $$f)_$$(notdir $$f))
|
||||
$1_TIE_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/org/omg/stub/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES)))
|
||||
$1_TIE_STDPKG_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES)))
|
||||
|
||||
ifneq ($$($1_KEEP_GENERATED), )
|
||||
$1_ARGS += -keepgenerated
|
||||
$1_JAVA_TARGETS := $$(subst .class,.java,$$($1_TARGETS))
|
||||
ifneq ($$($1_STUB_SOURCES_DIR), )
|
||||
# This is where the java files are created by rmic
|
||||
$1_JAVA_TARGETS_REL := $$(subst $$($1_STUB_CLASSES_DIR),, $$($1_JAVA_TARGETS))
|
||||
# This is where the caller wants the java files
|
||||
$1_JAVA_TARGETS := $$(addprefix $$($1_STUB_SOURCES_DIR), $$($1_JAVA_TARGETS_REL))
|
||||
endif
|
||||
$1_TARGETS += $$($1_JAVA_TARGETS)
|
||||
endif
|
||||
|
||||
$1_DOLLAR_SAFE_CLASSES := $$(subst $$$$,\$$$$,$$($1_CLASSES))
|
||||
|
||||
$$($1_TARGETS): $$($1_DEP_FILE) $$($1_CLASS_FILES)
|
||||
|
||||
$$($1_DEP_FILE): $$($1_CLASS_FILES)
|
||||
$$(call LogInfo, Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES))
|
||||
$$(call MakeDir, $$($1_STUB_CLASSES_DIR))
|
||||
$(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \
|
||||
-d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \
|
||||
$$(if $$($1_STUB_SOURCES_DIR), \
|
||||
$$(foreach f, $$($1_JAVA_TARGETS_REL), \
|
||||
$(MKDIR) -p $$(dir $$($1_STUB_SOURCES_DIR)/$$f) ; \
|
||||
$(MV) $$($1_STUB_CLASSES_DIR)/$$f $$($1_STUB_SOURCES_DIR)/$$f ; \
|
||||
) \
|
||||
) \
|
||||
$(TOUCH) $$@
|
||||
|
||||
|
||||
$1 := $$($1_TARGETS) $$($1_DEP_FILE)
|
||||
|
||||
endef
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,8 +31,6 @@ $(eval $(call IncludeCustomExtension, common/SetupJavaCompilers.gmk))
|
||||
|
||||
include JavaCompilation.gmk
|
||||
|
||||
DISABLE_WARNINGS ?= -Xlint:all,-deprecation,-removal,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
|
||||
|
||||
JDK_SOURCE_TARGET_FLAGS := -source $(JDK_SOURCE_TARGET_VERSION) \
|
||||
-target $(JDK_SOURCE_TARGET_VERSION)
|
||||
|
||||
@ -48,7 +46,7 @@ $(eval $(call SetupJavaCompiler,BOOT_JAVAC, \
|
||||
$(JAVA_TOOL_FLAGS_SMALL) \
|
||||
$(BOOT_JDK_SOURCETARGET) \
|
||||
-XDignore.symbol.file=true -g \
|
||||
-Xlint:all$(COMMA)-deprecation$(COMMA)-options -Werror, \
|
||||
$(JAVAC_WARNINGS) -Xlint:-options, \
|
||||
DISABLE_SJAVAC := true, \
|
||||
))
|
||||
|
||||
@ -66,7 +64,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \
|
||||
JVM := $(JAVA_SMALL), \
|
||||
JAVAC := $(NEW_JAVAC), \
|
||||
FLAGS := $(BOOT_JDK_SOURCETARGET) -XDignore.symbol.file=true -XDstringConcat=inline \
|
||||
$(DISABLE_WARNINGS) -Xlint:-options, \
|
||||
$(JAVAC_WARNINGS) -Xlint:-options, \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
|
||||
|
||||
@ -80,16 +78,6 @@ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE, \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
|
||||
|
||||
# The generate new bytecode javac setup uses the new compiler to compile for the
|
||||
# new jdk. This new bytecode might only be possible to run using the new jvm.
|
||||
$(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \
|
||||
JVM := $(JAVA_JAVAC), \
|
||||
JAVAC := $(NEW_JAVAC), \
|
||||
FLAGS := $(JDK_SOURCE_TARGET_FLAGS) \
|
||||
-encoding ascii -XDignore.symbol.file=true $(DISABLE_WARNINGS), \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
|
||||
|
||||
# After the jdk is built, we want to build demos using only the recently
|
||||
# generated jdk classes and nothing else, no jdk source, etc etc.
|
||||
# I.e. the rt.jar, but since rt.jar has not yet been generated
|
||||
@ -97,7 +85,8 @@ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \
|
||||
$(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE, \
|
||||
JVM := $(JAVA_SMALL), \
|
||||
JAVAC := $(NEW_JAVAC), \
|
||||
FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none $(DISABLE_WARNINGS), \
|
||||
FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none \
|
||||
$(JAVAC_WARNINGS), \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
|
||||
|
||||
@ -108,7 +97,7 @@ $(eval $(call SetupJavaCompiler,GENERATE_8_BYTECODE, \
|
||||
$(JAVA_TOOL_FLAGS_SMALL) \
|
||||
--release 8 \
|
||||
-XDignore.symbol.file=true -g \
|
||||
-Xlint:all -Werror, \
|
||||
$(JAVAC_WARNINGS), \
|
||||
DISABLE_SJAVAC := true, \
|
||||
))
|
||||
|
||||
|
@ -466,8 +466,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
build_cpu: "x64",
|
||||
dependencies: ["devkit", "build_devkit", "cups"],
|
||||
configure_args: [
|
||||
"--openjdk-target=aarch64-linux-gnu", "--with-freetype=bundled",
|
||||
"--disable-warnings-as-errors"
|
||||
"--openjdk-target=aarch64-linux-gnu",
|
||||
],
|
||||
},
|
||||
|
||||
@ -539,7 +538,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
});
|
||||
|
||||
// Generate -gcov profiles
|
||||
[ "linux-x64", "macosx-x64" ].forEach(function (name) {
|
||||
[ "linux-aarch64", "linux-x64", "macosx-x64" ].forEach(function (name) {
|
||||
var gcovName = name + "-gcov";
|
||||
profiles[gcovName] = clone(profiles[name]);
|
||||
profiles[gcovName].default_make_targets = ["product-bundles", "test-bundles"];
|
||||
@ -626,7 +625,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
});
|
||||
|
||||
// JCov profiles build JCov-instrumented JDK image based on images provided through dependencies.
|
||||
[ "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"]
|
||||
[ "linux-aarch64", "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"]
|
||||
.forEach(function (name) {
|
||||
var jcovName = name + "-jcov";
|
||||
profiles[jcovName] = clone(common.main_profile_base);
|
||||
@ -783,7 +782,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
});
|
||||
|
||||
// Artifacts of JCov profiles
|
||||
[ "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"]
|
||||
[ "linux-aarch64", "linux-x64", "macosx-x64", "solaris-sparcv9", "windows-x64"]
|
||||
.forEach(function (name) {
|
||||
var o = artifactData[name]
|
||||
var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
|
||||
@ -803,7 +802,7 @@ var getJibProfilesProfiles = function (input, common, data) {
|
||||
});
|
||||
|
||||
// Artifacts of gcov (native-code-coverage) profiles
|
||||
[ "linux-x64", "macosx-x64" ].forEach(function (name) {
|
||||
[ "linux-aarch64", "linux-x64", "macosx-x64" ].forEach(function (name) {
|
||||
var o = artifactData[name]
|
||||
var pf = o.platform
|
||||
var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
|
||||
|
@ -23,10 +23,10 @@
|
||||
# 0xF9FD -> u256F -> 0xA2A3
|
||||
# 0xA2CC -> u5341 -> 0xA451
|
||||
# 0xA2CE -> u5345 -> 0xA4CA
|
||||
# 0xF9F9 -> u2550 -> 0xA2A4
|
||||
# 0xF9E9 -> u255E -> 0xA2A5
|
||||
# 0xF9EA -> u256A -> 0xA2A6
|
||||
# 0xF9EB -> u2561 -> 0xA2A7
|
||||
# 0xA2A4 -> u2550 -> 0xF9F9
|
||||
# 0xA2A5 -> u255E -> 0xF9E9
|
||||
# 0xA2A6 -> u256A -> 0xF9EA
|
||||
# 0xA2A7 -> u2561 -> 0xF9EB
|
||||
#
|
||||
# Column #1 is the cp950 code (in hex)
|
||||
# Column #2 is the Unicode (in hex as 0xXXXX)
|
||||
|
@ -6,13 +6,13 @@
|
||||
# (we don't need a MS950.c2b, the entries of MS950.c2b-irreversible
|
||||
# are added in MS950.b2c already)
|
||||
#
|
||||
0xF9FA 0x256D
|
||||
0xA2A4 0x2550
|
||||
0xA2A5 0x255E
|
||||
0xA2A6 0x256A
|
||||
0xA2A7 0x2561
|
||||
0xA2CC 0x5341
|
||||
0xA2CE 0x5345
|
||||
0xF9FA 0x256D
|
||||
0xF9FB 0x256E
|
||||
0xF9FC 0x2570
|
||||
0xF9FD 0x256F
|
||||
0xA2CC 0x5341
|
||||
0xA2CE 0x5345
|
||||
0xF9F9 0x2550
|
||||
0xF9E9 0x255E
|
||||
0xF9EA 0x256A
|
||||
0xF9EB 0x2561
|
||||
|
@ -1,4 +1,4 @@
|
||||
File-Date: 2019-09-16
|
||||
File-Date: 2020-03-16
|
||||
%%
|
||||
Type: language
|
||||
Subtag: aa
|
||||
@ -47129,6 +47129,16 @@ Comments: Pamaka dialect of the "Busi Nenge Tongo" English-based
|
||||
Creole continuum in Eastern Suriname and Western French Guiana
|
||||
%%
|
||||
Type: variant
|
||||
Subtag: peano
|
||||
Description: Latino Sine Flexione
|
||||
Description: Interlingua de API
|
||||
Description: Interlingua de Peano
|
||||
Prefix: la
|
||||
Comments: Peano’s Interlingua, created in 1903 by Giuseppe Peano as an
|
||||
international auxiliary language
|
||||
Added: 2020-03-12
|
||||
%%
|
||||
Type: variant
|
||||
Subtag: petr1708
|
||||
Description: Petrine orthography
|
||||
Added: 2010-10-10
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -31,7 +31,7 @@ JFR_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/buildtools/tools_classes
|
||||
|
||||
$(eval $(call SetupJavaCompiler, GENERATE_JFRBYTECODE, \
|
||||
JAVAC := $(JAVAC), \
|
||||
FLAGS := $(DISABLE_WARNINGS), \
|
||||
FLAGS := -Xlint:all -Werror, \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA), \
|
||||
DISABLE_SJAVAC := true, \
|
||||
@ -41,6 +41,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JFR_TOOLS, \
|
||||
SETUP := GENERATE_JFRBYTECODE, \
|
||||
SRC := $(JFR_TOOLS_SRCDIR), \
|
||||
BIN := $(JFR_TOOLS_OUTPUTDIR), \
|
||||
DISABLED_WARNINGS := try, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_JFR_TOOLS)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,7 +34,7 @@ JVMTI_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/tools/jvmti
|
||||
|
||||
$(eval $(call SetupJavaCompiler, GENERATE_OLDBYTECODE, \
|
||||
JAVAC := $(JAVAC), \
|
||||
FLAGS := $(DISABLE_WARNINGS), \
|
||||
FLAGS := -Xlint:all -Werror, \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA), \
|
||||
DISABLE_SJAVAC := true, \
|
||||
@ -43,6 +43,7 @@ $(eval $(call SetupJavaCompiler, GENERATE_OLDBYTECODE, \
|
||||
$(eval $(call SetupJavaCompilation, BUILD_JVMTI_TOOLS, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
SRC := $(JVMTI_TOOLS_SRCDIR), \
|
||||
DISABLED_WARNINGS := rawtypes cast, \
|
||||
INCLUDE_FILES := jvmtiGen.java jvmtiEnvFill.java, \
|
||||
BIN := $(JVMTI_TOOLS_OUTPUTDIR), \
|
||||
))
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -98,7 +98,7 @@ ifeq ($(call isTargetOs, windows), true)
|
||||
|
||||
$(eval $(call SetupJavaCompilation, BUILD_PROJECT_CREATOR, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
ADD_JAVAC_FLAGS := -Xlint:-auxiliaryclass, \
|
||||
DISABLED_WARNINGS := auxiliaryclass deprecation rawtypes unchecked cast, \
|
||||
SRC := $(TOPDIR)/make/hotspot/src/classes, \
|
||||
BIN := $(TOOLS_OUTPUTDIR), \
|
||||
))
|
||||
|
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
@ -60,37 +60,7 @@
|
||||
</target>
|
||||
|
||||
|
||||
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
|
||||
<!-- Call rmic-jmx subtargets -->
|
||||
|
||||
<target name="-rmic-jmx" depends="-init,-rmic-jmx-jrmp"
|
||||
description="Calls -init,-rmic-jmx-jrmp"
|
||||
/>
|
||||
|
||||
|
||||
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
|
||||
<!-- Generate RMI JRMP stub class files for remote objects -->
|
||||
<!-- Generated java files are kept in a separate directory -->
|
||||
|
||||
<target name="-rmic-jmx-jrmp" depends="-init"
|
||||
description="Generate RMI JRMP stub class files for remote objects. Keep generated java files in separate dir." >
|
||||
|
||||
<!-- Dir to keep generated stub source -->
|
||||
<mkdir dir="${gensrc.dir}" />
|
||||
|
||||
<rmic base="${classes.dir}/javax/management"
|
||||
sourcebase="${gensrc.dir}"
|
||||
includeAntRuntime="no"
|
||||
includeJavaRuntime="no"
|
||||
stubversion="1.2"
|
||||
>
|
||||
<include name="javax/management/remote/rmi/RMIConnectionImpl.class" />
|
||||
<include name="javax/management/remote/rmi/RMIServerImpl.class" />
|
||||
</rmic>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="-post-compile" depends="-init,-rmic-jmx"
|
||||
<target name="-post-compile" depends="-init"
|
||||
description="Jar JMX class files (including RMI stubs)" >
|
||||
<mkdir dir="${dist.dir}/lib"/>
|
||||
<jar jarfile="${dist.dir}/lib/${jar.jmx.name}"
|
||||
|
@ -286,7 +286,7 @@ class Bundle {
|
||||
handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterAbbreviations");
|
||||
handleMultipleInheritance(myMap, parentsMap, calendarPrefix + "QuarterNarrows");
|
||||
|
||||
adjustEraNames(myMap, calendarType);
|
||||
adjustEraNames(myMap, parentsMap, calendarType);
|
||||
|
||||
handleDateTimeFormatPatterns(TIME_PATTERN_KEYS, myMap, parentsMap, calendarType, "TimePatterns");
|
||||
handleDateTimeFormatPatterns(DATE_PATTERN_KEYS, myMap, parentsMap, calendarType, "DatePatterns");
|
||||
@ -410,8 +410,9 @@ class Bundle {
|
||||
}
|
||||
|
||||
/**
|
||||
* Fills in any empty elements with its parent element. Returns true if the resulting array is
|
||||
* identical to its parent array.
|
||||
* Fills in any empty elements with its parent element, falling back to
|
||||
* aliased one if parent element is not found. Returns true if the resulting
|
||||
* array is identical to its parent array.
|
||||
*
|
||||
* @param parents
|
||||
* @param key
|
||||
@ -423,7 +424,7 @@ class Bundle {
|
||||
return false;
|
||||
}
|
||||
if (value instanceof String[]) {
|
||||
Object pvalue = parents.get(key);
|
||||
Object pvalue = parents.getOrDefault(key, parents.get(CLDRConverter.aliases.get(key)));
|
||||
if (pvalue != null && pvalue instanceof String[]) {
|
||||
String[] strings = (String[]) value;
|
||||
String[] pstrings = (String[]) pvalue;
|
||||
@ -442,7 +443,7 @@ class Bundle {
|
||||
* Adjusts String[] for era names because JRE's Calendars use different
|
||||
* ERA value indexes in the Buddhist, Japanese Imperial, and Islamic calendars.
|
||||
*/
|
||||
private void adjustEraNames(Map<String, Object> map, CalendarType type) {
|
||||
private void adjustEraNames(Map<String, Object> map, Map<String, Object> pMap, CalendarType type) {
|
||||
String[][] eraNames = new String[ERA_KEYS.length][];
|
||||
String[] realKeys = new String[ERA_KEYS.length];
|
||||
int index = 0;
|
||||
@ -450,6 +451,9 @@ class Bundle {
|
||||
String realKey = type.keyElementName() + key;
|
||||
String[] value = (String[]) map.get(realKey);
|
||||
if (value != null) {
|
||||
// first fill in missing elements from parents map.
|
||||
fillInElements(pMap, realKey, value);
|
||||
|
||||
switch (type) {
|
||||
case GREGORIAN:
|
||||
break;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -215,10 +215,7 @@ public class EquivMapsGenerator {
|
||||
+ " static final Map<String, String[]> multiEquivsMap;\n"
|
||||
+ " static final Map<String, String> regionVariantEquivMap;\n\n"
|
||||
+ " static {\n"
|
||||
+ " singleEquivMap = new HashMap<>();\n"
|
||||
+ " multiEquivsMap = new HashMap<>();\n"
|
||||
+ " regionVariantEquivMap = new HashMap<>();\n\n"
|
||||
+ " // This is an auto-generated file and should not be manually edited.\n";
|
||||
+ " singleEquivMap = new HashMap<>(";
|
||||
|
||||
private static final String footerText =
|
||||
" }\n\n"
|
||||
@ -242,6 +239,12 @@ public class EquivMapsGenerator {
|
||||
Paths.get(fileName))) {
|
||||
writer.write(getOpenJDKCopyright());
|
||||
writer.write(headerText
|
||||
+ (int)(sortedLanguageMap1.size() / 0.75f + 1) + ");\n"
|
||||
+ " multiEquivsMap = new HashMap<>("
|
||||
+ (int)(sortedLanguageMap2.size() / 0.75f + 1) + ");\n"
|
||||
+ " regionVariantEquivMap = new HashMap<>("
|
||||
+ (int)(sortedRegionVariantMap.size() / 0.75f + 1) + ");\n\n"
|
||||
+ " // This is an auto-generated file and should not be manually edited.\n"
|
||||
+ " // LSR Revision: " + LSRrevisionDate);
|
||||
writer.newLine();
|
||||
|
||||
|
@ -75,7 +75,7 @@ public class ModuleGraph implements Taglet {
|
||||
}
|
||||
return "<dt>Module Graph:</dt>"
|
||||
+ "<dd>"
|
||||
+ "<a class=moduleGraph href=\"" + imageFile + "\">"
|
||||
+ "<a class=\"module-graph\" href=\"" + imageFile + "\">"
|
||||
+ getImage(moduleName, imageFile, thumbnailHeight, false)
|
||||
+ hoverImage
|
||||
+ "</a>"
|
||||
|
@ -1,53 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# 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.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include RmicCommon.gmk
|
||||
|
||||
##########################################################################################
|
||||
#
|
||||
# Generate RMI stubs
|
||||
#
|
||||
|
||||
JMX_RMI_CLASSES := javax.management.remote.rmi.RMIConnectionImpl \
|
||||
javax.management.remote.rmi.RMIServerImpl
|
||||
|
||||
# Generate into gensrc dir where sources get picked up for javadoc, then move the classes
|
||||
# into the stub classes dir.
|
||||
$(eval $(call SetupRMICompilation,RMI_GEN, \
|
||||
CLASSES := $(JMX_RMI_CLASSES), \
|
||||
CLASSES_DIR := $(CLASSES_DIR)/java.management.rmi, \
|
||||
STUB_CLASSES_DIR := $(STUB_CLASSES_DIR)/java.management.rmi, \
|
||||
RUN_V12 := true, \
|
||||
KEEP_GENERATED := true, \
|
||||
STUB_SOURCES_DIR := $(RMIC_GENSRC_DIR)/java.management.rmi, \
|
||||
))
|
||||
|
||||
##########################################################################################
|
||||
|
||||
all: $(RMI_GEN)
|
||||
|
||||
.PHONY: all
|
@ -1,48 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 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. 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.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include RmicCommon.gmk
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# Generate RMI stubs
|
||||
#
|
||||
|
||||
$(eval $(call SetupRMICompilation,RMI_12, \
|
||||
CLASSES := sun.rmi.server.Activation$$ActivationSystemImpl \
|
||||
java.rmi.activation.ActivationGroup, \
|
||||
CLASSES_DIR := $(CLASSES_DIR)/java.rmi, \
|
||||
STUB_CLASSES_DIR := $(STUB_CLASSES_DIR)/java.rmi, \
|
||||
RUN_V12 := true))
|
||||
GENCLASSES += $(RMI_12)
|
||||
|
||||
|
||||
################################################################################
|
||||
|
||||
all: $(RMI_12)
|
||||
|
||||
.PHONY: all
|
@ -1,45 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. 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.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include RMICompilation.gmk
|
||||
|
||||
################################################################################
|
||||
|
||||
RMIC_MAIN_CLASS := -m jdk.rmic.interim/sun.rmi.rmic.Main
|
||||
|
||||
RMIC := $(JAVA_SMALL) $(INTERIM_RMIC_ARGS) $(RMIC_MAIN_CLASS)
|
||||
|
||||
CLASSES_DIR := $(JDK_OUTPUTDIR)/modules
|
||||
# NOTE: If the smart javac dependency management is reintroduced, these classes
|
||||
# risk interfering with the dependency checking. In that case they will need to
|
||||
# be kept separate.
|
||||
STUB_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules
|
||||
RMIC_GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/rmic
|
||||
|
||||
################################################################################
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -52,6 +52,7 @@ $(eval $(call SetupJavaCompilation, BUILD_FAILURE_HANDLER, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
SRC := $(FH_BASEDIR)/src/share/classes $(FH_BASEDIR)/src/share/conf, \
|
||||
BIN := $(FH_SUPPORT)/classes, \
|
||||
DISABLED_WARNINGS := deprecation serial try, \
|
||||
COPY := .properties, \
|
||||
CLASSPATH := $(JTREG_JAR) $(TOOLS_JAR), \
|
||||
JAR := $(FH_JAR), \
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -77,6 +77,7 @@ $(eval $(call SetupJavaCompilation, BUILD_INDIFY, \
|
||||
SETUP := GENERATE_OLDBYTECODE, \
|
||||
SRC := $(TOPDIR)/test/jdk/java/lang/invoke, \
|
||||
INCLUDE_FILES := indify/Indify.java, \
|
||||
DISABLED_WARNINGS := rawtypes unchecked serial deprecation, \
|
||||
BIN := $(MICROBENCHMARK_TOOLS_CLASSES), \
|
||||
))
|
||||
|
||||
@ -88,7 +89,8 @@ $(eval $(call SetupJavaCompiler, MICROBENCHMARK_JAVA_COMPILER, \
|
||||
JVM := $(JAVA) --add-modules jdk.unsupported --limit-modules java.management, \
|
||||
JAVAC := $(NEW_JAVAC), \
|
||||
DISABLE_SJAVAC := true, \
|
||||
FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none $(DISABLE_WARNINGS), \
|
||||
FLAGS := --upgrade-module-path $(JDK_OUTPUTDIR)/modules --system none \
|
||||
-Xlint:all -Werror, \
|
||||
SERVER_DIR := $(SJAVAC_SERVER_DIR), \
|
||||
SERVER_JVM := $(SJAVAC_SERVER_JAVA), \
|
||||
))
|
||||
@ -96,7 +98,8 @@ $(eval $(call SetupJavaCompiler, MICROBENCHMARK_JAVA_COMPILER, \
|
||||
# Build microbenchmark suite for the current JDK
|
||||
$(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
|
||||
SETUP := MICROBENCHMARK_JAVA_COMPILER, \
|
||||
ADD_JAVAC_FLAGS := -cp $(MICROBENCHMARK_CLASSPATH) -Xlint -Xlint:-processing -Werror, \
|
||||
ADD_JAVAC_FLAGS := -cp $(MICROBENCHMARK_CLASSPATH), \
|
||||
DISABLED_WARNINGS := processing rawtypes cast serial deprecation, \
|
||||
SRC := $(MICROBENCHMARK_SRC), \
|
||||
BIN := $(MICROBENCHMARK_CLASSES), \
|
||||
))
|
||||
|
@ -61,7 +61,6 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
$(LIB_OUTPUTDIR)/hamcrest-core-1.3.jar
|
||||
|
||||
TEST_JAVAC_FLAGS := \
|
||||
-Xlint:none \
|
||||
-processorpath $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.compiler.replacements.verifier.jar \
|
||||
--add-exports jdk.unsupported/sun.misc=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
|
||||
@ -114,6 +113,7 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
EXCLUDE_FILES := org/graalvm/compiler/core/test/VerifyDebugUsageTest.java, \
|
||||
BIN := $(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests, \
|
||||
CLASSPATH := $(TEST_COMPILE_CP), \
|
||||
DISABLED_WARNINGS := processing, \
|
||||
ADD_JAVAC_FLAGS := $(TEST_JAVAC_FLAGS), \
|
||||
COPY := .input, \
|
||||
))
|
||||
@ -131,6 +131,7 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
$(TEST_COMPILE_CP) \
|
||||
$(COMPILE_OUTPUTDIR)/jdk.vm.compiler.tests \
|
||||
, \
|
||||
DISABLED_WARNINGS := processing, \
|
||||
ADD_JAVAC_FLAGS := \
|
||||
$(TEST_JAVAC_FLAGS) \
|
||||
-XDstringConcat=inline \
|
||||
@ -155,6 +156,7 @@ ifeq ($(INCLUDE_GRAAL), true)
|
||||
SRC := $(TEST_DIR)/com.oracle.mxtool.junit, \
|
||||
BIN := $(COMPILE_OUTPUTDIR)/com.oracle.mxtool.junit, \
|
||||
JAR := $(COMPILE_OUTPUTDIR)/com.oracle.mxtool.junit.jar, \
|
||||
DISABLED_WARNINGS := processing, \
|
||||
CLASSPATH := $(LIB_OUTPUTDIR)/junit-4.12.jar, \
|
||||
))
|
||||
|
||||
|
@ -55,7 +55,7 @@ BUILD_JDK_JTREG_EXECUTABLES_CFLAGS_exeJliLaunchTest := \
|
||||
|
||||
# Platform specific setup
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c
|
||||
BUILD_JDK_JTREG_EXCLUDE += libDirectIO.c libInheritedChannel.c exelauncher.c
|
||||
|
||||
WIN_LIB_JAVA := $(SUPPORT_OUTPUTDIR)/native/java.base/libjava/java.lib
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := $(WIN_LIB_JAVA)
|
||||
@ -69,14 +69,17 @@ else
|
||||
BUILD_JDK_JTREG_EXCLUDE += exerevokeall.c
|
||||
ifeq ($(call isTargetOs, linux), true)
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava
|
||||
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exelauncher := -ldl
|
||||
else ifeq ($(call isTargetOs, solaris), true)
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava -lsocket -lnsl
|
||||
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exelauncher := -lthread -ldl
|
||||
endif
|
||||
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeJliLaunchTest := -ljli
|
||||
BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeCallerAccessTest := -ljvm
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, macosx), true)
|
||||
BUILD_JDK_JTREG_EXCLUDE += exelauncher.c
|
||||
BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libTestMainKeyWindow := -ObjC
|
||||
BUILD_JDK_JTREG_LIBRARIES_LIBS_libTestMainKeyWindow := -framework JavaVM \
|
||||
-framework Cocoa -framework JavaNativeFoundation
|
||||
|
@ -1575,7 +1575,7 @@ uint MachBreakpointNode::size(PhaseRegAlloc *ra_) const {
|
||||
//=============================================================================
|
||||
const RegMask& MachConstantBaseNode::_out_RegMask = RegMask::Empty;
|
||||
|
||||
int Compile::ConstantTable::calculate_table_base_offset() const {
|
||||
int ConstantTable::calculate_table_base_offset() const {
|
||||
return 0; // absolute addressing, no offset
|
||||
}
|
||||
|
||||
@ -1602,9 +1602,9 @@ void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
|
||||
void MachPrologNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
|
||||
Compile* C = ra_->C;
|
||||
|
||||
int framesize = C->frame_slots() << LogBytesPerInt;
|
||||
int framesize = C->output()->frame_slots() << LogBytesPerInt;
|
||||
|
||||
if (C->need_stack_bang(framesize))
|
||||
if (C->output()->need_stack_bang(framesize))
|
||||
st->print("# stack bang size=%d\n\t", framesize);
|
||||
|
||||
if (framesize < ((1 << 9) + 2 * wordSize)) {
|
||||
@ -1625,7 +1625,7 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
// n.b. frame size includes space for return pc and rfp
|
||||
const long framesize = C->frame_size_in_bytes();
|
||||
const long framesize = C->output()->frame_size_in_bytes();
|
||||
assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment");
|
||||
|
||||
// insert a nop at the start of the prolog so we can patch in a
|
||||
@ -1643,8 +1643,8 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
__ bind(L_skip_barrier);
|
||||
}
|
||||
|
||||
int bangsize = C->bang_size_in_bytes();
|
||||
if (C->need_stack_bang(bangsize) && UseStackBanging)
|
||||
int bangsize = C->output()->bang_size_in_bytes();
|
||||
if (C->output()->need_stack_bang(bangsize) && UseStackBanging)
|
||||
__ generate_stack_overflow_check(bangsize);
|
||||
|
||||
__ build_frame(framesize);
|
||||
@ -1653,12 +1653,12 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
Unimplemented();
|
||||
}
|
||||
|
||||
C->set_frame_complete(cbuf.insts_size());
|
||||
C->output()->set_frame_complete(cbuf.insts_size());
|
||||
|
||||
if (C->has_mach_constant_base_node()) {
|
||||
// NOTE: We set the table base offset here because users might be
|
||||
// emitted before MachConstantBaseNode.
|
||||
Compile::ConstantTable& constant_table = C->constant_table();
|
||||
ConstantTable& constant_table = C->output()->constant_table();
|
||||
constant_table.set_table_base_offset(constant_table.calculate_table_base_offset());
|
||||
}
|
||||
}
|
||||
@ -1679,7 +1679,7 @@ int MachPrologNode::reloc() const
|
||||
#ifndef PRODUCT
|
||||
void MachEpilogNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
|
||||
Compile* C = ra_->C;
|
||||
int framesize = C->frame_slots() << LogBytesPerInt;
|
||||
int framesize = C->output()->frame_slots() << LogBytesPerInt;
|
||||
|
||||
st->print("# pop frame %d\n\t",framesize);
|
||||
|
||||
@ -1705,7 +1705,7 @@ void MachEpilogNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
|
||||
void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
Compile* C = ra_->C;
|
||||
MacroAssembler _masm(&cbuf);
|
||||
int framesize = C->frame_slots() << LogBytesPerInt;
|
||||
int framesize = C->output()->frame_slots() << LogBytesPerInt;
|
||||
|
||||
__ remove_frame(framesize);
|
||||
|
||||
@ -14936,7 +14936,7 @@ instruct cmpI_branch_sign(cmpOpLtGe cmp, iRegIorL2I op1, immI0 op2, label labl)
|
||||
|
||||
instruct cmpL_branch_bit(cmpOpEqNe cmp, iRegL op1, immL op2, immL0 op3, label labl) %{
|
||||
match(If cmp (CmpL (AndL op1 op2) op3));
|
||||
predicate(is_power_of_2(n->in(2)->in(1)->in(2)->get_long()));
|
||||
predicate(is_power_of_2((julong)n->in(2)->in(1)->in(2)->get_long()));
|
||||
effect(USE labl);
|
||||
|
||||
ins_cost(BRANCH_COST);
|
||||
@ -14944,7 +14944,7 @@ instruct cmpL_branch_bit(cmpOpEqNe cmp, iRegL op1, immL op2, immL0 op3, label la
|
||||
ins_encode %{
|
||||
Label* L = $labl$$label;
|
||||
Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode;
|
||||
int bit = exact_log2($op2$$constant);
|
||||
int bit = exact_log2_long($op2$$constant);
|
||||
__ tbr(cond, $op1$$Register, bit, *L);
|
||||
%}
|
||||
ins_pipe(pipe_cmp_branch);
|
||||
@ -14953,7 +14953,7 @@ instruct cmpL_branch_bit(cmpOpEqNe cmp, iRegL op1, immL op2, immL0 op3, label la
|
||||
|
||||
instruct cmpI_branch_bit(cmpOpEqNe cmp, iRegIorL2I op1, immI op2, immI0 op3, label labl) %{
|
||||
match(If cmp (CmpI (AndI op1 op2) op3));
|
||||
predicate(is_power_of_2(n->in(2)->in(1)->in(2)->get_int()));
|
||||
predicate(is_power_of_2((juint)n->in(2)->in(1)->in(2)->get_int()));
|
||||
effect(USE labl);
|
||||
|
||||
ins_cost(BRANCH_COST);
|
||||
@ -14961,7 +14961,7 @@ instruct cmpI_branch_bit(cmpOpEqNe cmp, iRegIorL2I op1, immI op2, immI0 op3, lab
|
||||
ins_encode %{
|
||||
Label* L = $labl$$label;
|
||||
Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode;
|
||||
int bit = exact_log2($op2$$constant);
|
||||
int bit = exact_log2((juint)$op2$$constant);
|
||||
__ tbr(cond, $op1$$Register, bit, *L);
|
||||
%}
|
||||
ins_pipe(pipe_cmp_branch);
|
||||
@ -15001,7 +15001,7 @@ instruct far_cmpI_branch_sign(cmpOpLtGe cmp, iRegIorL2I op1, immI0 op2, label la
|
||||
|
||||
instruct far_cmpL_branch_bit(cmpOpEqNe cmp, iRegL op1, immL op2, immL0 op3, label labl) %{
|
||||
match(If cmp (CmpL (AndL op1 op2) op3));
|
||||
predicate(is_power_of_2(n->in(2)->in(1)->in(2)->get_long()));
|
||||
predicate(is_power_of_2((julong)n->in(2)->in(1)->in(2)->get_long()));
|
||||
effect(USE labl);
|
||||
|
||||
ins_cost(BRANCH_COST);
|
||||
@ -15009,7 +15009,7 @@ instruct far_cmpL_branch_bit(cmpOpEqNe cmp, iRegL op1, immL op2, immL0 op3, labe
|
||||
ins_encode %{
|
||||
Label* L = $labl$$label;
|
||||
Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode;
|
||||
int bit = exact_log2($op2$$constant);
|
||||
int bit = exact_log2_long($op2$$constant);
|
||||
__ tbr(cond, $op1$$Register, bit, *L, /*far*/true);
|
||||
%}
|
||||
ins_pipe(pipe_cmp_branch);
|
||||
@ -15017,7 +15017,7 @@ instruct far_cmpL_branch_bit(cmpOpEqNe cmp, iRegL op1, immL op2, immL0 op3, labe
|
||||
|
||||
instruct far_cmpI_branch_bit(cmpOpEqNe cmp, iRegIorL2I op1, immI op2, immI0 op3, label labl) %{
|
||||
match(If cmp (CmpI (AndI op1 op2) op3));
|
||||
predicate(is_power_of_2(n->in(2)->in(1)->in(2)->get_int()));
|
||||
predicate(is_power_of_2((juint)n->in(2)->in(1)->in(2)->get_int()));
|
||||
effect(USE labl);
|
||||
|
||||
ins_cost(BRANCH_COST);
|
||||
@ -15025,7 +15025,7 @@ instruct far_cmpI_branch_bit(cmpOpEqNe cmp, iRegIorL2I op1, immI op2, immI0 op3,
|
||||
ins_encode %{
|
||||
Label* L = $labl$$label;
|
||||
Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode;
|
||||
int bit = exact_log2($op2$$constant);
|
||||
int bit = exact_log2((juint)$op2$$constant);
|
||||
__ tbr(cond, $op1$$Register, bit, *L, /*far*/true);
|
||||
%}
|
||||
ins_pipe(pipe_cmp_branch);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -432,12 +432,9 @@ int LIR_Assembler::emit_unwind_handler() {
|
||||
}
|
||||
|
||||
if (compilation()->env()->dtrace_method_probes()) {
|
||||
__ call_Unimplemented();
|
||||
#if 0
|
||||
__ movptr(Address(rsp, 0), rax);
|
||||
__ mov_metadata(Address(rsp, sizeof(void*)), method()->constant_encoding());
|
||||
__ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit)));
|
||||
#endif
|
||||
__ mov(c_rarg0, rthread);
|
||||
__ mov_metadata(c_rarg1, method()->constant_encoding());
|
||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), c_rarg0, c_rarg1);
|
||||
}
|
||||
|
||||
if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -1125,6 +1125,16 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
|
||||
}
|
||||
break;
|
||||
|
||||
case dtrace_object_alloc_id:
|
||||
{ // c_rarg0: object
|
||||
StubFrame f(sasm, "dtrace_object_alloc", dont_gc_arguments);
|
||||
save_live_registers(sasm);
|
||||
|
||||
__ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), c_rarg0);
|
||||
|
||||
restore_live_registers(sasm);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{ StubFrame f(sasm, "unimplemented entry", dont_gc_arguments);
|
||||
|
@ -1153,38 +1153,10 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
|
||||
bind(skip_receiver_profile);
|
||||
|
||||
// The method data pointer needs to be updated to reflect the new target.
|
||||
#if INCLUDE_JVMCI
|
||||
if (MethodProfileWidth == 0) {
|
||||
update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size()));
|
||||
}
|
||||
#else // INCLUDE_JVMCI
|
||||
update_mdp_by_constant(mdp,
|
||||
in_bytes(VirtualCallData::
|
||||
virtual_call_data_size()));
|
||||
#endif // INCLUDE_JVMCI
|
||||
bind(profile_continue);
|
||||
}
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
void InterpreterMacroAssembler::profile_called_method(Register method, Register mdp, Register reg2) {
|
||||
assert_different_registers(method, mdp, reg2);
|
||||
if (ProfileInterpreter && MethodProfileWidth > 0) {
|
||||
Label profile_continue;
|
||||
|
||||
// If no method data exists, go to profile_continue.
|
||||
test_method_data_pointer(mdp, profile_continue);
|
||||
|
||||
Label done;
|
||||
record_item_in_profile_helper(method, mdp, reg2, 0, done, MethodProfileWidth,
|
||||
&VirtualCallData::method_offset, &VirtualCallData::method_count_offset, in_bytes(VirtualCallData::nonprofiled_receiver_count_offset()));
|
||||
bind(done);
|
||||
|
||||
update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size()));
|
||||
bind(profile_continue);
|
||||
}
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
// This routine creates a state machine for updating the multi-row
|
||||
// type profile at a virtual call site (or other type-sensitive bytecode).
|
||||
|
@ -262,7 +262,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
void profile_virtual_call(Register receiver, Register mdp,
|
||||
Register scratch2,
|
||||
bool receiver_can_be_null = false);
|
||||
void profile_called_method(Register method, Register mdp, Register reg2) NOT_JVMCI_RETURN;
|
||||
void profile_ret(Register return_bci, Register mdp);
|
||||
void profile_null_seen(Register mdp);
|
||||
void profile_typecheck(Register mdp, Register klass, Register scratch);
|
||||
|
@ -56,6 +56,7 @@
|
||||
#include "opto/compile.hpp"
|
||||
#include "opto/intrinsicnode.hpp"
|
||||
#include "opto/node.hpp"
|
||||
#include "opto/output.hpp"
|
||||
#endif
|
||||
|
||||
#ifdef PRODUCT
|
||||
@ -745,7 +746,7 @@ address MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) {
|
||||
CompileTask* task = ciEnv::current()->task();
|
||||
in_scratch_emit_size =
|
||||
(task != NULL && is_c2_compile(task->comp_level()) &&
|
||||
Compile::current()->in_scratch_emit_size());
|
||||
Compile::current()->output()->in_scratch_emit_size());
|
||||
#endif
|
||||
if (!in_scratch_emit_size) {
|
||||
address stub = emit_trampoline_stub(offset(), entry.target());
|
||||
@ -4860,6 +4861,8 @@ void MacroAssembler::string_indexof_char(Register str1, Register cnt1,
|
||||
Register ch1 = rscratch1;
|
||||
Register result_tmp = rscratch2;
|
||||
|
||||
cbz(cnt1, NOMATCH);
|
||||
|
||||
cmp(cnt1, (u1)4);
|
||||
br(LT, DO1_SHORT);
|
||||
|
||||
|
@ -194,7 +194,7 @@ void emit_hi(CodeBuffer &cbuf, int val) { }
|
||||
//=============================================================================
|
||||
const RegMask& MachConstantBaseNode::_out_RegMask = PTR_REG_mask();
|
||||
|
||||
int Compile::ConstantTable::calculate_table_base_offset() const {
|
||||
int ConstantTable::calculate_table_base_offset() const {
|
||||
int offset = -(size() / 2);
|
||||
// flds, fldd: 8-bit offset multiplied by 4: +/- 1024
|
||||
// ldr, ldrb : 12-bit offset: +/- 4096
|
||||
@ -211,7 +211,7 @@ void MachConstantBaseNode::postalloc_expand(GrowableArray <Node *> *nodes, Phase
|
||||
|
||||
void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
|
||||
Compile* C = ra_->C;
|
||||
Compile::ConstantTable& constant_table = C->constant_table();
|
||||
ConstantTable& constant_table = C->output()->constant_table();
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
Register r = as_Register(ra_->get_encode(this));
|
||||
@ -245,9 +245,9 @@ void MachPrologNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
|
||||
st->print_cr("NOP"); st->print("\t");
|
||||
}
|
||||
|
||||
size_t framesize = C->frame_size_in_bytes();
|
||||
size_t framesize = C->output()->frame_size_in_bytes();
|
||||
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
|
||||
int bangsize = C->bang_size_in_bytes();
|
||||
int bangsize = C->output()->bang_size_in_bytes();
|
||||
// Remove two words for return addr and rbp,
|
||||
framesize -= 2*wordSize;
|
||||
bangsize -= 2*wordSize;
|
||||
@ -257,7 +257,7 @@ void MachPrologNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
|
||||
// some VM calls (such as call site linkage) can use several kilobytes of
|
||||
// stack. But the stack safety zone should account for that.
|
||||
// See bugs 4446381, 4468289, 4497237.
|
||||
if (C->need_stack_bang(bangsize)) {
|
||||
if (C->output()->need_stack_bang(bangsize)) {
|
||||
st->print_cr("! stack bang (%d bytes)", bangsize); st->print("\t");
|
||||
}
|
||||
st->print_cr("PUSH R_FP|R_LR_LR"); st->print("\t");
|
||||
@ -275,9 +275,9 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
__ nop();
|
||||
}
|
||||
|
||||
size_t framesize = C->frame_size_in_bytes();
|
||||
size_t framesize = C->output()->frame_size_in_bytes();
|
||||
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
|
||||
int bangsize = C->bang_size_in_bytes();
|
||||
int bangsize = C->output()->bang_size_in_bytes();
|
||||
// Remove two words for return addr and fp,
|
||||
framesize -= 2*wordSize;
|
||||
bangsize -= 2*wordSize;
|
||||
@ -287,7 +287,7 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
// some VM calls (such as call site linkage) can use several kilobytes of
|
||||
// stack. But the stack safety zone should account for that.
|
||||
// See bugs 4446381, 4468289, 4497237.
|
||||
if (C->need_stack_bang(bangsize)) {
|
||||
if (C->output()->need_stack_bang(bangsize)) {
|
||||
__ arm_stack_overflow_check(bangsize, Rtemp);
|
||||
}
|
||||
|
||||
@ -298,13 +298,13 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
|
||||
// offset from scratch buffer is not valid
|
||||
if (strcmp(cbuf.name(), "Compile::Fill_buffer") == 0) {
|
||||
C->set_frame_complete( __ offset() );
|
||||
C->output()->set_frame_complete( __ offset() );
|
||||
}
|
||||
|
||||
if (C->has_mach_constant_base_node()) {
|
||||
// NOTE: We set the table base offset here because users might be
|
||||
// emitted before MachConstantBaseNode.
|
||||
Compile::ConstantTable& constant_table = C->constant_table();
|
||||
ConstantTable& constant_table = C->output()->constant_table();
|
||||
constant_table.set_table_base_offset(constant_table.calculate_table_base_offset());
|
||||
}
|
||||
}
|
||||
@ -322,7 +322,7 @@ int MachPrologNode::reloc() const {
|
||||
void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
|
||||
Compile* C = ra_->C;
|
||||
|
||||
size_t framesize = C->frame_size_in_bytes();
|
||||
size_t framesize = C->output()->frame_size_in_bytes();
|
||||
framesize -= 2*wordSize;
|
||||
|
||||
if (framesize != 0) {
|
||||
@ -342,7 +342,7 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
MacroAssembler _masm(&cbuf);
|
||||
Compile* C = ra_->C;
|
||||
|
||||
size_t framesize = C->frame_size_in_bytes();
|
||||
size_t framesize = C->output()->frame_size_in_bytes();
|
||||
framesize -= 2*wordSize;
|
||||
if (framesize != 0) {
|
||||
__ add_slow(SP, SP, framesize);
|
||||
@ -827,7 +827,7 @@ void BoxLockNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
uint BoxLockNode::size(PhaseRegAlloc *ra_) const {
|
||||
// BoxLockNode is not a MachNode, so we can't just call MachNode::size(ra_)
|
||||
assert(ra_ == ra_->C->regalloc(), "sanity");
|
||||
return ra_->C->scratch_emit_size(this);
|
||||
return ra_->C->output()->scratch_emit_size(this);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
@ -291,11 +291,13 @@ void LIR_Assembler::return_op(LIR_Opr result) {
|
||||
}
|
||||
|
||||
int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
|
||||
if (info != NULL) {
|
||||
add_debug_info_for_branch(info);
|
||||
}
|
||||
|
||||
int offset = __ offset();
|
||||
__ read_polling_page(Rtemp, relocInfo::poll_type);
|
||||
__ get_polling_page(Rtemp);
|
||||
__ relocate(relocInfo::poll_type);
|
||||
add_debug_info_for_branch(info); // help pc_desc_at to find correct scope for current PC
|
||||
__ ldr(Rtemp, Address(Rtemp));
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
@ -2054,6 +2054,7 @@ void MacroAssembler::fast_unlock(Register Roop, Register Rbox, Register Rscratch
|
||||
bind(done);
|
||||
|
||||
}
|
||||
#endif // COMPILER2
|
||||
|
||||
void MacroAssembler::safepoint_poll(Register tmp1, Label& slow_path) {
|
||||
if (SafepointMechanism::uses_thread_local_poll()) {
|
||||
@ -2081,5 +2082,3 @@ void MacroAssembler::read_polling_page(Register dest, relocInfo::relocType rtype
|
||||
ldr(dest, Address(dest));
|
||||
}
|
||||
|
||||
|
||||
#endif // COMPILER2
|
||||
|
@ -1297,7 +1297,7 @@ static inline jlong replicate_immF(float con) {
|
||||
//=============================================================================
|
||||
|
||||
const RegMask& MachConstantBaseNode::_out_RegMask = BITS64_CONSTANT_TABLE_BASE_mask();
|
||||
int Compile::ConstantTable::calculate_table_base_offset() const {
|
||||
int ConstantTable::calculate_table_base_offset() const {
|
||||
return 0; // absolute addressing, no offset
|
||||
}
|
||||
|
||||
@ -1338,10 +1338,10 @@ void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
|
||||
#ifndef PRODUCT
|
||||
void MachPrologNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
|
||||
Compile* C = ra_->C;
|
||||
const long framesize = C->frame_slots() << LogBytesPerInt;
|
||||
const long framesize = C->output()->frame_slots() << LogBytesPerInt;
|
||||
|
||||
st->print("PROLOG\n\t");
|
||||
if (C->need_stack_bang(framesize)) {
|
||||
if (C->output()->need_stack_bang(framesize)) {
|
||||
st->print("stack_overflow_check\n\t");
|
||||
}
|
||||
|
||||
@ -1381,7 +1381,7 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
Compile* C = ra_->C;
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
const long framesize = C->frame_size_in_bytes();
|
||||
const long framesize = C->output()->frame_size_in_bytes();
|
||||
assert(framesize % (2 * wordSize) == 0, "must preserve 2*wordSize alignment");
|
||||
|
||||
const bool method_is_frameless = false /* TODO: PPC port C->is_frameless_method()*/;
|
||||
@ -1426,9 +1426,9 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
// use several kilobytes of stack. But the stack safety zone should
|
||||
// account for that. See bugs 4446381, 4468289, 4497237.
|
||||
|
||||
int bangsize = C->bang_size_in_bytes();
|
||||
int bangsize = C->output()->bang_size_in_bytes();
|
||||
assert(bangsize >= framesize || bangsize <= 0, "stack bang size incorrect");
|
||||
if (C->need_stack_bang(bangsize) && UseStackBanging) {
|
||||
if (C->output()->need_stack_bang(bangsize) && UseStackBanging) {
|
||||
// Unfortunately we cannot use the function provided in
|
||||
// assembler.cpp as we have to emulate the pipes. So I had to
|
||||
// insert the code of generate_stack_overflow_check(), see
|
||||
@ -1482,7 +1482,7 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
bang_offset += page_size;
|
||||
}
|
||||
// R11 trashed
|
||||
} // C->need_stack_bang(framesize) && UseStackBanging
|
||||
} // C->output()->need_stack_bang(framesize) && UseStackBanging
|
||||
|
||||
unsigned int bytes = (unsigned int)framesize;
|
||||
long offset = Assembler::align_addr(bytes, frame::alignment_in_bytes);
|
||||
@ -1537,7 +1537,7 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
___(std) std(return_pc, _abi(lr), callers_sp);
|
||||
}
|
||||
|
||||
C->set_frame_complete(cbuf.insts_size());
|
||||
C->output()->set_frame_complete(cbuf.insts_size());
|
||||
}
|
||||
#undef ___
|
||||
#undef ___stop
|
||||
@ -1573,7 +1573,7 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
Compile* C = ra_->C;
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
const long framesize = ((long)C->frame_slots()) << LogBytesPerInt;
|
||||
const long framesize = ((long)C->output()->frame_slots()) << LogBytesPerInt;
|
||||
assert(framesize >= 0, "negative frame-size?");
|
||||
|
||||
const bool method_needs_polling = do_polling() && C->is_method_compilation();
|
||||
@ -2786,7 +2786,7 @@ encode %{
|
||||
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
if (!ra_->C->in_scratch_emit_size()) {
|
||||
if (!ra_->C->output()->in_scratch_emit_size()) {
|
||||
address const_toc_addr;
|
||||
// Create a non-oop constant, no relocation needed.
|
||||
// If it is an IC, it has a virtual_call_Relocation.
|
||||
@ -3053,7 +3053,7 @@ encode %{
|
||||
// TODO: PPC port $archOpcode(ppc64Opcode_addis);
|
||||
|
||||
MacroAssembler _masm(&cbuf);
|
||||
if (!ra_->C->in_scratch_emit_size()) {
|
||||
if (!ra_->C->output()->in_scratch_emit_size()) {
|
||||
intptr_t val = $src$$constant;
|
||||
relocInfo::relocType constant_reloc = $src->constant_reloc(); // src
|
||||
address const_toc_addr;
|
||||
@ -3791,7 +3791,7 @@ encode %{
|
||||
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
if (!ra_->C->in_scratch_emit_size()) {
|
||||
if (!ra_->C->output()->in_scratch_emit_size()) {
|
||||
// Create a call trampoline stub for the given method.
|
||||
const address entry_point = !($meth$$method) ? 0 : (address)$meth$$method;
|
||||
const address entry_point_const = __ address_constant(entry_point, RelocationHolder::none);
|
||||
@ -6285,7 +6285,7 @@ instruct loadConL_lo(iRegLdst dst, immL src, iRegLdst base) %{
|
||||
size(4);
|
||||
ins_encode %{
|
||||
// TODO: PPC port $archOpcode(ppc64Opcode_ld);
|
||||
int offset = ra_->C->in_scratch_emit_size() ? 0 : _const_toc_offset_hi_node->_const_toc_offset;
|
||||
int offset = ra_->C->output()->in_scratch_emit_size() ? 0 : _const_toc_offset_hi_node->_const_toc_offset;
|
||||
__ ld($dst$$Register, MacroAssembler::largeoffset_si16_si16_lo(offset), $base$$Register);
|
||||
%}
|
||||
ins_pipe(pipe_class_memory);
|
||||
@ -6570,7 +6570,7 @@ instruct loadConP_lo(iRegPdst dst, immP_NM src, iRegLdst base) %{
|
||||
size(4);
|
||||
ins_encode %{
|
||||
// TODO: PPC port $archOpcode(ppc64Opcode_ld);
|
||||
int offset = ra_->C->in_scratch_emit_size() ? 0 : _const_toc_offset_hi_node->_const_toc_offset;
|
||||
int offset = ra_->C->output()->in_scratch_emit_size() ? 0 : _const_toc_offset_hi_node->_const_toc_offset;
|
||||
__ ld($dst$$Register, MacroAssembler::largeoffset_si16_si16_lo(offset), $base$$Register);
|
||||
%}
|
||||
ins_pipe(pipe_class_memory);
|
||||
|
@ -3664,7 +3664,6 @@ void TemplateTable::invokeinterface(int byte_no) {
|
||||
// Found entry. Jump off!
|
||||
// Argument and return type profiling.
|
||||
__ profile_arguments_type(Rmethod2, Rscratch1, Rscratch2, true);
|
||||
//__ profile_called_method(Rindex, Rscratch1);
|
||||
__ call_from_interpreter(Rmethod2, Rret_addr, Rscratch1, Rscratch2);
|
||||
|
||||
// Vtable entry was NULL => Throw abstract method error.
|
||||
|
@ -192,8 +192,6 @@ void VM_Version::initialize() {
|
||||
_supports_atomic_getset8 = true;
|
||||
_supports_atomic_getadd8 = true;
|
||||
|
||||
UseSSE = 0; // Only on x86 and x64
|
||||
|
||||
intx cache_line_size = L1_data_cache_line_size();
|
||||
|
||||
if (PowerArchitecturePPC64 >= 9) {
|
||||
|
@ -54,7 +54,7 @@ address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark/*
|
||||
// That's why we must use the macroassembler to generate a stub.
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
address stub = __ start_a_stub(Compile::MAX_stubs_size);
|
||||
address stub = __ start_a_stub(CompiledStaticCall::to_interp_stub_size());
|
||||
if (stub == NULL) {
|
||||
return NULL; // CodeBuffer::expand failed.
|
||||
}
|
||||
|
@ -795,7 +795,7 @@ static int emit_call_reloc(MacroAssembler &_masm, intptr_t entry_point, Relocati
|
||||
//=============================================================================
|
||||
|
||||
const RegMask& MachConstantBaseNode::_out_RegMask = _Z_PTR_REG_mask;
|
||||
int Compile::ConstantTable::calculate_table_base_offset() const {
|
||||
int ConstantTable::calculate_table_base_offset() const {
|
||||
return 0; // absolute addressing, no offset
|
||||
}
|
||||
|
||||
@ -840,15 +840,15 @@ void MachPrologNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
|
||||
st->print("\t");
|
||||
}
|
||||
|
||||
long framesize = C->frame_size_in_bytes();
|
||||
int bangsize = C->bang_size_in_bytes();
|
||||
long framesize = C->output()->frame_size_in_bytes();
|
||||
int bangsize = C->output()->bang_size_in_bytes();
|
||||
|
||||
// Calls to C2R adapters often do not accept exceptional returns.
|
||||
// We require that their callers must bang for them. But be
|
||||
// careful, because some VM calls (such as call site linkage) can
|
||||
// use several kilobytes of stack. But the stack safety zone should
|
||||
// account for that. See bugs 4446381, 4468289, 4497237.
|
||||
if (C->need_stack_bang(bangsize) && UseStackBanging) {
|
||||
if (C->output()->need_stack_bang(bangsize) && UseStackBanging) {
|
||||
st->print_cr("# stack bang"); st->print("\t");
|
||||
}
|
||||
st->print_cr("push_frame %d", (int)-framesize);
|
||||
@ -862,8 +862,8 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
|
||||
__ verify_thread();
|
||||
|
||||
size_t framesize = C->frame_size_in_bytes();
|
||||
size_t bangsize = C->bang_size_in_bytes();
|
||||
size_t framesize = C->output()->frame_size_in_bytes();
|
||||
size_t bangsize = C->output()->bang_size_in_bytes();
|
||||
|
||||
assert(framesize % wordSize == 0, "must preserve wordSize alignment");
|
||||
|
||||
@ -889,7 +889,7 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
// careful, because some VM calls (such as call site linkage) can
|
||||
// use several kilobytes of stack. But the stack safety zone should
|
||||
// account for that. See bugs 4446381, 4468289, 4497237.
|
||||
if (C->need_stack_bang(bangsize) && UseStackBanging) {
|
||||
if (C->output()->need_stack_bang(bangsize) && UseStackBanging) {
|
||||
__ generate_stack_overflow_check(bangsize);
|
||||
}
|
||||
|
||||
@ -903,7 +903,7 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
if (C->has_mach_constant_base_node()) {
|
||||
// NOTE: We set the table base offset here because users might be
|
||||
// emitted before MachConstantBaseNode.
|
||||
Compile::ConstantTable& constant_table = C->constant_table();
|
||||
ConstantTable& constant_table = C->output()->constant_table();
|
||||
constant_table.set_table_base_offset(constant_table.calculate_table_base_offset());
|
||||
}
|
||||
}
|
||||
@ -940,7 +940,7 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
bool need_polling = do_polling() && C->is_method_compilation();
|
||||
|
||||
// Pop frame, restore return_pc, and all stuff needed by interpreter.
|
||||
int frame_size_in_bytes = Assembler::align((C->frame_slots() << LogBytesPerInt), frame::alignment_in_bytes);
|
||||
int frame_size_in_bytes = Assembler::align((C->output()->frame_slots() << LogBytesPerInt), frame::alignment_in_bytes);
|
||||
__ pop_frame_restore_retPC(frame_size_in_bytes);
|
||||
|
||||
if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
|
||||
@ -1257,7 +1257,7 @@ void MachNopNode::emit(CodeBuffer &cbuf, PhaseRegAlloc * ra_) const {
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
int rem_space = 0;
|
||||
if (!(ra_->C->in_scratch_emit_size())) {
|
||||
if (!(ra_->C->output()->in_scratch_emit_size())) {
|
||||
rem_space = cbuf.insts()->remaining();
|
||||
if (rem_space <= _count*2 + 8) {
|
||||
tty->print("NopNode: _count = %3.3d, remaining space before = %d", _count, rem_space);
|
||||
@ -1268,7 +1268,7 @@ void MachNopNode::emit(CodeBuffer &cbuf, PhaseRegAlloc * ra_) const {
|
||||
__ z_nop();
|
||||
}
|
||||
|
||||
if (!(ra_->C->in_scratch_emit_size())) {
|
||||
if (!(ra_->C->output()->in_scratch_emit_size())) {
|
||||
if (rem_space <= _count*2 + 8) {
|
||||
int rem_space2 = cbuf.insts()->remaining();
|
||||
tty->print_cr(", after = %d", rem_space2);
|
||||
|
@ -1646,36 +1646,10 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
|
||||
bind(skip_receiver_profile);
|
||||
|
||||
// The method data pointer needs to be updated to reflect the new target.
|
||||
#if INCLUDE_JVMCI
|
||||
if (MethodProfileWidth == 0) {
|
||||
update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
|
||||
}
|
||||
#else
|
||||
update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
|
||||
#endif
|
||||
bind(profile_continue);
|
||||
}
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
void InterpreterMacroAssembler::profile_called_method(Register method, Register scratch) {
|
||||
assert_different_registers(method, scratch);
|
||||
if (ProfileInterpreter && MethodProfileWidth > 0) {
|
||||
Label profile_continue;
|
||||
|
||||
// If no method data exists, go to profile_continue.
|
||||
test_method_data_pointer(profile_continue);
|
||||
|
||||
Label done;
|
||||
record_item_in_profile_helper(method, scratch, 0, done, MethodProfileWidth,
|
||||
&VirtualCallData::method_offset, &VirtualCallData::method_count_offset, in_bytes(VirtualCallData::nonprofiled_receiver_count_offset()));
|
||||
bind(done);
|
||||
|
||||
update_mdp_by_constant(in_bytes(VirtualCallData::virtual_call_data_size()));
|
||||
bind(profile_continue);
|
||||
}
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
void InterpreterMacroAssembler::record_klass_in_profile_helper(Register receiver, Register scratch,
|
||||
Label& done, bool is_virtual_call) {
|
||||
|
@ -302,7 +302,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
void profile_call(Register scratch);
|
||||
void profile_final_call(Register scratch);
|
||||
void profile_virtual_call(Register receiver, Register scratch, bool receiver_can_be_null = false);
|
||||
void profile_called_method(Register method, Register scratch) NOT_JVMCI_RETURN;
|
||||
void profile_ret(TosState state, Register return_bci, Register scratch);
|
||||
void profile_null_seen(Register scratch);
|
||||
void profile_typecheck(Register klass, Register scratch);
|
||||
|
@ -1002,7 +1002,7 @@ void emit_hi(CodeBuffer &cbuf, int val) { }
|
||||
//=============================================================================
|
||||
const RegMask& MachConstantBaseNode::_out_RegMask = PTR_REG_mask();
|
||||
|
||||
int Compile::ConstantTable::calculate_table_base_offset() const {
|
||||
int ConstantTable::calculate_table_base_offset() const {
|
||||
if (UseRDPCForConstantTableBase) {
|
||||
// The table base offset might be less but then it fits into
|
||||
// simm13 anyway and we are good (cf. MachConstantBaseNode::emit).
|
||||
@ -1023,7 +1023,7 @@ void MachConstantBaseNode::postalloc_expand(GrowableArray <Node *> *nodes, Phase
|
||||
|
||||
void MachConstantBaseNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
|
||||
Compile* C = ra_->C;
|
||||
Compile::ConstantTable& constant_table = C->constant_table();
|
||||
ConstantTable& constant_table = C->output()->constant_table();
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
Register r = as_Register(ra_->get_encode(this));
|
||||
@ -1128,15 +1128,15 @@ void MachPrologNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
|
||||
st->print_cr("Verify_Thread"); st->print("\t");
|
||||
}
|
||||
|
||||
size_t framesize = C->frame_size_in_bytes();
|
||||
int bangsize = C->bang_size_in_bytes();
|
||||
size_t framesize = C->output()->frame_size_in_bytes();
|
||||
int bangsize = C->output()->bang_size_in_bytes();
|
||||
|
||||
// Calls to C2R adapters often do not accept exceptional returns.
|
||||
// We require that their callers must bang for them. But be careful, because
|
||||
// some VM calls (such as call site linkage) can use several kilobytes of
|
||||
// stack. But the stack safety zone should account for that.
|
||||
// See bugs 4446381, 4468289, 4497237.
|
||||
if (C->need_stack_bang(bangsize)) {
|
||||
if (C->output()->need_stack_bang(bangsize)) {
|
||||
st->print_cr("! stack bang (%d bytes)", bangsize); st->print("\t");
|
||||
}
|
||||
|
||||
@ -1161,17 +1161,17 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
|
||||
__ verify_thread();
|
||||
|
||||
size_t framesize = C->frame_size_in_bytes();
|
||||
size_t framesize = C->output()->frame_size_in_bytes();
|
||||
assert(framesize >= 16*wordSize, "must have room for reg. save area");
|
||||
assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment");
|
||||
int bangsize = C->bang_size_in_bytes();
|
||||
int bangsize = C->output()->bang_size_in_bytes();
|
||||
|
||||
// Calls to C2R adapters often do not accept exceptional returns.
|
||||
// We require that their callers must bang for them. But be careful, because
|
||||
// some VM calls (such as call site linkage) can use several kilobytes of
|
||||
// stack. But the stack safety zone should account for that.
|
||||
// See bugs 4446381, 4468289, 4497237.
|
||||
if (C->need_stack_bang(bangsize)) {
|
||||
if (C->output()->need_stack_bang(bangsize)) {
|
||||
__ generate_stack_overflow_check(bangsize);
|
||||
}
|
||||
|
||||
@ -1182,12 +1182,12 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
__ add(G3, -framesize & 0x3ff, G3);
|
||||
__ save(SP, G3, SP);
|
||||
}
|
||||
C->set_frame_complete( __ offset() );
|
||||
C->output()->set_frame_complete( __ offset() );
|
||||
|
||||
if (!UseRDPCForConstantTableBase && C->has_mach_constant_base_node()) {
|
||||
// NOTE: We set the table base offset here because users might be
|
||||
// emitted before MachConstantBaseNode.
|
||||
Compile::ConstantTable& constant_table = C->constant_table();
|
||||
ConstantTable& constant_table = C->output()->constant_table();
|
||||
constant_table.set_table_base_offset(constant_table.calculate_table_base_offset());
|
||||
}
|
||||
}
|
||||
@ -1570,7 +1570,7 @@ void BoxLockNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
uint BoxLockNode::size(PhaseRegAlloc *ra_) const {
|
||||
// BoxLockNode is not a MachNode, so we can't just call MachNode::size(ra_)
|
||||
assert(ra_ == ra_->C->regalloc(), "sanity");
|
||||
return ra_->C->scratch_emit_size(this);
|
||||
return ra_->C->output()->scratch_emit_size(this);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
@ -2426,7 +2426,7 @@ encode %{
|
||||
enc_class call_epilog %{
|
||||
if( VerifyStackAtCalls ) {
|
||||
MacroAssembler _masm(&cbuf);
|
||||
int framesize = ra_->C->frame_size_in_bytes();
|
||||
int framesize = ra_->C->output()->frame_size_in_bytes();
|
||||
Register temp_reg = G3;
|
||||
__ add(SP, framesize, temp_reg);
|
||||
__ cmp(temp_reg, FP);
|
||||
@ -8854,7 +8854,7 @@ instruct jumpXtnd(iRegX switch_val, o7RegI table) %{
|
||||
// zero offsets because they might change when
|
||||
// MachConstantBaseNode decides to optimize the constant table
|
||||
// base.
|
||||
if ((constant_offset() == 0) && !Compile::current()->in_scratch_emit_size()) {
|
||||
if ((constant_offset() == 0) && !Compile::current()->output()->in_scratch_emit_size()) {
|
||||
table_reg = $constanttablebase;
|
||||
} else {
|
||||
table_reg = O7;
|
||||
|
@ -3028,7 +3028,6 @@ void TemplateTable::generate_vtable_call(Register Rrecv, Register Rindex, Regist
|
||||
// get target Method* & entry point
|
||||
__ lookup_virtual_method(Rrecv, Rindex, G5_method);
|
||||
__ profile_arguments_type(G5_method, Rcall, Gargs, true);
|
||||
__ profile_called_method(G5_method, Rtemp);
|
||||
__ call_from_interpreter(Rcall, Gargs, Rret);
|
||||
}
|
||||
|
||||
@ -3299,7 +3298,6 @@ void TemplateTable::invokeinterface(int byte_no) {
|
||||
assert_different_registers(Rcall, G5_method, Gargs, Rret);
|
||||
|
||||
__ profile_arguments_type(G5_method, Rcall, Gargs, true);
|
||||
__ profile_called_method(G5_method, Rscratch);
|
||||
__ call_from_interpreter(Rcall, Gargs, Rret);
|
||||
|
||||
__ bind(L_no_such_interface);
|
||||
|
@ -68,8 +68,6 @@ void VM_Version::initialize() {
|
||||
}
|
||||
}
|
||||
|
||||
UseSSE = false; // Only used on x86 and x64.
|
||||
|
||||
_supports_cx8 = true; // All SPARC V9 implementations.
|
||||
_supports_atomic_getset4 = true; // Using the 'swap' instruction.
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -339,15 +339,15 @@ class Address {
|
||||
|
||||
private:
|
||||
bool base_needs_rex() const {
|
||||
return _base != noreg && _base->encoding() >= 8;
|
||||
return _base->is_valid() && _base->encoding() >= 8;
|
||||
}
|
||||
|
||||
bool index_needs_rex() const {
|
||||
return _index != noreg &&_index->encoding() >= 8;
|
||||
return _index->is_valid() &&_index->encoding() >= 8;
|
||||
}
|
||||
|
||||
bool xmmindex_needs_rex() const {
|
||||
return _xmmindex != xnoreg && _xmmindex->encoding() >= 8;
|
||||
return _xmmindex->is_valid() && _xmmindex->encoding() >= 8;
|
||||
}
|
||||
|
||||
relocInfo::relocType reloc() const { return _rspec.type(); }
|
||||
@ -659,33 +659,37 @@ private:
|
||||
bool _legacy_mode_dq;
|
||||
bool _legacy_mode_vl;
|
||||
bool _legacy_mode_vlbw;
|
||||
bool _is_managed;
|
||||
bool _vector_masking; // For stub code use only
|
||||
NOT_LP64(bool _is_managed;)
|
||||
|
||||
class InstructionAttr *_attributes;
|
||||
|
||||
// 64bit prefixes
|
||||
int prefix_and_encode(int reg_enc, bool byteinst = false);
|
||||
int prefixq_and_encode(int reg_enc);
|
||||
void prefix(Register reg);
|
||||
void prefix(Register dst, Register src, Prefix p);
|
||||
void prefix(Register dst, Address adr, Prefix p);
|
||||
|
||||
void prefix(Address adr);
|
||||
void prefix(Address adr, Register reg, bool byteinst = false);
|
||||
void prefix(Address adr, XMMRegister reg);
|
||||
|
||||
int prefix_and_encode(int reg_enc, bool byteinst = false);
|
||||
int prefix_and_encode(int dst_enc, int src_enc) {
|
||||
return prefix_and_encode(dst_enc, false, src_enc, false);
|
||||
}
|
||||
int prefix_and_encode(int dst_enc, bool dst_is_byte, int src_enc, bool src_is_byte);
|
||||
int prefixq_and_encode(int dst_enc, int src_enc);
|
||||
|
||||
void prefix(Register reg);
|
||||
void prefix(Register dst, Register src, Prefix p);
|
||||
void prefix(Register dst, Address adr, Prefix p);
|
||||
void prefix(Address adr);
|
||||
// Some prefixq variants always emit exactly one prefix byte, so besides a
|
||||
// prefix-emitting method we provide a method to get the prefix byte to emit,
|
||||
// which can then be folded into a byte stream.
|
||||
int8_t get_prefixq(Address adr);
|
||||
int8_t get_prefixq(Address adr, Register reg);
|
||||
|
||||
void prefixq(Address adr);
|
||||
|
||||
void prefix(Address adr, Register reg, bool byteinst = false);
|
||||
void prefix(Address adr, XMMRegister reg);
|
||||
void prefixq(Address adr, Register reg);
|
||||
void prefixq(Address adr, XMMRegister reg);
|
||||
|
||||
void prefetch_prefix(Address src);
|
||||
int prefixq_and_encode(int reg_enc);
|
||||
int prefixq_and_encode(int dst_enc, int src_enc);
|
||||
|
||||
void rex_prefix(Address adr, XMMRegister xreg,
|
||||
VexSimdPrefix pre, VexOpcode opc, bool rex_w);
|
||||
@ -871,22 +875,34 @@ private:
|
||||
_legacy_mode_dq = (VM_Version::supports_avx512dq() == false);
|
||||
_legacy_mode_vl = (VM_Version::supports_avx512vl() == false);
|
||||
_legacy_mode_vlbw = (VM_Version::supports_avx512vlbw() == false);
|
||||
_is_managed = false;
|
||||
_vector_masking = false;
|
||||
NOT_LP64(_is_managed = false;)
|
||||
_attributes = NULL;
|
||||
}
|
||||
|
||||
void set_attributes(InstructionAttr *attributes) { _attributes = attributes; }
|
||||
void clear_attributes(void) { _attributes = NULL; }
|
||||
|
||||
void set_managed(void) { _is_managed = true; }
|
||||
void clear_managed(void) { _is_managed = false; }
|
||||
bool is_managed(void) { return _is_managed; }
|
||||
void set_managed(void) { NOT_LP64(_is_managed = true;) }
|
||||
void clear_managed(void) { NOT_LP64(_is_managed = false;) }
|
||||
bool is_managed(void) {
|
||||
NOT_LP64(return _is_managed;)
|
||||
LP64_ONLY(return false;) }
|
||||
|
||||
void lea(Register dst, Address src);
|
||||
|
||||
void mov(Register dst, Register src);
|
||||
|
||||
#ifdef _LP64
|
||||
// support caching the result of some routines
|
||||
|
||||
// must be called before pusha(), popa(), vzeroupper() - checked with asserts
|
||||
static void precompute_instructions();
|
||||
|
||||
void pusha_uncached();
|
||||
void popa_uncached();
|
||||
#endif
|
||||
void vzeroupper_uncached();
|
||||
|
||||
void pusha();
|
||||
void popa();
|
||||
|
||||
@ -2271,22 +2287,20 @@ public:
|
||||
bool no_reg_mask, // when true, k0 is used when EVEX encoding is chosen, else embedded_opmask_register_specifier is used
|
||||
bool uses_vl) // This instruction may have legacy constraints based on vector length for EVEX
|
||||
:
|
||||
_avx_vector_len(vector_len),
|
||||
_rex_vex_w(rex_vex_w),
|
||||
_rex_vex_w_reverted(false),
|
||||
_legacy_mode(legacy_mode),
|
||||
_legacy_mode(legacy_mode || UseAVX < 3),
|
||||
_no_reg_mask(no_reg_mask),
|
||||
_uses_vl(uses_vl),
|
||||
_tuple_type(Assembler::EVEX_ETUP),
|
||||
_input_size_in_bits(Assembler::EVEX_NObit),
|
||||
_rex_vex_w_reverted(false),
|
||||
_is_evex_instruction(false),
|
||||
_evex_encoding(0),
|
||||
_is_clear_context(true),
|
||||
_is_extended_context(false),
|
||||
_avx_vector_len(vector_len),
|
||||
_tuple_type(Assembler::EVEX_ETUP),
|
||||
_input_size_in_bits(Assembler::EVEX_NObit),
|
||||
_evex_encoding(0),
|
||||
_embedded_opmask_register_specifier(0), // hard code k0
|
||||
_current_assembler(NULL) {
|
||||
if (UseAVX < 3) _legacy_mode = true;
|
||||
}
|
||||
_current_assembler(NULL) { }
|
||||
|
||||
~InstructionAttr() {
|
||||
if (_current_assembler != NULL) {
|
||||
@ -2296,37 +2310,37 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
int _avx_vector_len;
|
||||
bool _rex_vex_w;
|
||||
bool _rex_vex_w_reverted;
|
||||
bool _legacy_mode;
|
||||
bool _no_reg_mask;
|
||||
bool _uses_vl;
|
||||
int _tuple_type;
|
||||
int _input_size_in_bits;
|
||||
bool _rex_vex_w_reverted;
|
||||
bool _is_evex_instruction;
|
||||
int _evex_encoding;
|
||||
bool _is_clear_context;
|
||||
bool _is_extended_context;
|
||||
int _avx_vector_len;
|
||||
int _tuple_type;
|
||||
int _input_size_in_bits;
|
||||
int _evex_encoding;
|
||||
int _embedded_opmask_register_specifier;
|
||||
|
||||
Assembler *_current_assembler;
|
||||
|
||||
public:
|
||||
// query functions for field accessors
|
||||
int get_vector_len(void) const { return _avx_vector_len; }
|
||||
bool is_rex_vex_w(void) const { return _rex_vex_w; }
|
||||
bool is_rex_vex_w_reverted(void) { return _rex_vex_w_reverted; }
|
||||
bool is_legacy_mode(void) const { return _legacy_mode; }
|
||||
bool is_no_reg_mask(void) const { return _no_reg_mask; }
|
||||
bool uses_vl(void) const { return _uses_vl; }
|
||||
int get_tuple_type(void) const { return _tuple_type; }
|
||||
int get_input_size(void) const { return _input_size_in_bits; }
|
||||
int is_evex_instruction(void) const { return _is_evex_instruction; }
|
||||
int get_evex_encoding(void) const { return _evex_encoding; }
|
||||
bool is_rex_vex_w_reverted(void) { return _rex_vex_w_reverted; }
|
||||
bool is_evex_instruction(void) const { return _is_evex_instruction; }
|
||||
bool is_clear_context(void) const { return _is_clear_context; }
|
||||
bool is_extended_context(void) const { return _is_extended_context; }
|
||||
int get_embedded_opmask_register_specifier(void) const { return _embedded_opmask_register_specifier; }
|
||||
int get_vector_len(void) const { return _avx_vector_len; }
|
||||
int get_tuple_type(void) const { return _tuple_type; }
|
||||
int get_input_size(void) const { return _input_size_in_bits; }
|
||||
int get_evex_encoding(void) const { return _evex_encoding; }
|
||||
int get_embedded_opmask_register_specifier(void) const { return _embedded_opmask_register_specifier; }
|
||||
|
||||
// Set the vector len manually
|
||||
void set_vector_len(int vector_len) { _avx_vector_len = vector_len; }
|
||||
|
@ -93,9 +93,13 @@ LIR_Opr LIRGenerator::result_register_for(ValueType* type, bool callee) {
|
||||
case intTag: opr = FrameMap::rax_opr; break;
|
||||
case objectTag: opr = FrameMap::rax_oop_opr; break;
|
||||
case longTag: opr = FrameMap::long0_opr; break;
|
||||
#ifdef _LP64
|
||||
case floatTag: opr = FrameMap::xmm0_float_opr; break;
|
||||
case doubleTag: opr = FrameMap::xmm0_double_opr; break;
|
||||
#else
|
||||
case floatTag: opr = UseSSE >= 1 ? FrameMap::xmm0_float_opr : FrameMap::fpu0_float_opr; break;
|
||||
case doubleTag: opr = UseSSE >= 2 ? FrameMap::xmm0_double_opr : FrameMap::fpu0_double_opr; break;
|
||||
|
||||
#endif // _LP64
|
||||
case addressTag:
|
||||
default: ShouldNotReachHere(); return LIR_OprFact::illegalOpr;
|
||||
}
|
||||
@ -356,6 +360,7 @@ void LIRGenerator::do_ArithmeticOp_FPU(ArithmeticOp* x) {
|
||||
left.dont_load_item();
|
||||
}
|
||||
|
||||
#ifndef _LP64
|
||||
// do not load right operand if it is a constant. only 0 and 1 are
|
||||
// loaded because there are special instructions for loading them
|
||||
// without memory access (not needed for SSE2 instructions)
|
||||
@ -371,13 +376,18 @@ void LIRGenerator::do_ArithmeticOp_FPU(ArithmeticOp* x) {
|
||||
must_load_right = UseSSE < 2 && (c->is_one_double() || c->is_zero_double());
|
||||
}
|
||||
}
|
||||
#endif // !LP64
|
||||
|
||||
if (must_load_both) {
|
||||
// frem and drem destroy also right operand, so move it to a new register
|
||||
right.set_destroys_register();
|
||||
right.load_item();
|
||||
} else if (right.is_register() || must_load_right) {
|
||||
} else if (right.is_register()) {
|
||||
right.load_item();
|
||||
#ifndef _LP64
|
||||
} else if (must_load_right) {
|
||||
right.load_item();
|
||||
#endif // !LP64
|
||||
} else {
|
||||
right.dont_load_item();
|
||||
}
|
||||
@ -788,9 +798,11 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) {
|
||||
LIRItem value(x->argument_at(0), this);
|
||||
|
||||
bool use_fpu = false;
|
||||
#ifndef _LP64
|
||||
if (UseSSE < 2) {
|
||||
value.set_destroys_register();
|
||||
}
|
||||
#endif // !LP64
|
||||
value.load_item();
|
||||
|
||||
LIR_Opr calc_input = value.result();
|
||||
@ -1552,10 +1564,12 @@ void LIRGenerator::volatile_field_load(LIR_Address* address, LIR_Opr result,
|
||||
LIR_Opr temp_double = new_register(T_DOUBLE);
|
||||
__ volatile_move(LIR_OprFact::address(address), temp_double, T_LONG, info);
|
||||
__ volatile_move(temp_double, result, T_LONG);
|
||||
#ifndef _LP64
|
||||
if (UseSSE < 2) {
|
||||
// no spill slot needed in SSE2 mode because xmm->cpu register move is possible
|
||||
set_vreg_flag(result, must_start_in_memory);
|
||||
}
|
||||
#endif // !LP64
|
||||
} else {
|
||||
__ load(address, result, info);
|
||||
}
|
||||
|
@ -367,6 +367,7 @@ static OopMap* generate_oop_map(StubAssembler* sasm, int num_rt_args,
|
||||
#endif
|
||||
|
||||
if (save_fpu_registers) {
|
||||
#ifndef _LP64
|
||||
if (UseSSE < 2) {
|
||||
int fpu_off = float_regs_as_doubles_off;
|
||||
for (int n = 0; n < FrameMap::nof_fpu_regs; n++) {
|
||||
@ -379,7 +380,18 @@ static OopMap* generate_oop_map(StubAssembler* sasm, int num_rt_args,
|
||||
fpu_off += 2;
|
||||
}
|
||||
assert(fpu_off == fpu_state_off, "incorrect number of fpu stack slots");
|
||||
|
||||
if (UseSSE == 1) {
|
||||
int xmm_off = xmm_regs_as_doubles_off;
|
||||
for (int n = 0; n < FrameMap::nof_fpu_regs; n++) {
|
||||
VMReg xmm_name_0 = as_XMMRegister(n)->as_VMReg();
|
||||
map->set_callee_saved(VMRegImpl::stack2reg(xmm_off + num_rt_args), xmm_name_0);
|
||||
xmm_off += 2;
|
||||
}
|
||||
assert(xmm_off == float_regs_as_doubles_off, "incorrect number of xmm registers");
|
||||
}
|
||||
}
|
||||
#endif // !LP64
|
||||
|
||||
if (UseSSE >= 2) {
|
||||
int xmm_off = xmm_regs_as_doubles_off;
|
||||
@ -395,15 +407,6 @@ static OopMap* generate_oop_map(StubAssembler* sasm, int num_rt_args,
|
||||
xmm_off += 2;
|
||||
}
|
||||
assert(xmm_off == float_regs_as_doubles_off, "incorrect number of xmm registers");
|
||||
|
||||
} else if (UseSSE == 1) {
|
||||
int xmm_off = xmm_regs_as_doubles_off;
|
||||
for (int n = 0; n < FrameMap::nof_fpu_regs; n++) {
|
||||
VMReg xmm_name_0 = as_XMMRegister(n)->as_VMReg();
|
||||
map->set_callee_saved(VMRegImpl::stack2reg(xmm_off + num_rt_args), xmm_name_0);
|
||||
xmm_off += 2;
|
||||
}
|
||||
assert(xmm_off == float_regs_as_doubles_off, "incorrect number of xmm registers");
|
||||
}
|
||||
}
|
||||
|
||||
@ -454,6 +457,16 @@ void C1_MacroAssembler::save_live_registers_no_oop_map(bool save_fpu_registers)
|
||||
__ fstp_d(Address(rsp, float_regs_as_doubles_off * VMRegImpl::stack_slot_size + offset));
|
||||
offset += 8;
|
||||
}
|
||||
|
||||
if (UseSSE == 1) {
|
||||
// save XMM registers as float because double not supported without SSE2(num MMX == num fpu)
|
||||
int offset = 0;
|
||||
for (int n = 0; n < FrameMap::nof_fpu_regs; n++) {
|
||||
XMMRegister xmm_name = as_XMMRegister(n);
|
||||
__ movflt(Address(rsp, xmm_regs_as_doubles_off * VMRegImpl::stack_slot_size + offset), xmm_name);
|
||||
offset += 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !_LP64
|
||||
|
||||
@ -475,16 +488,6 @@ void C1_MacroAssembler::save_live_registers_no_oop_map(bool save_fpu_registers)
|
||||
__ movdbl(Address(rsp, xmm_regs_as_doubles_off * VMRegImpl::stack_slot_size + offset), xmm_name);
|
||||
offset += 8;
|
||||
}
|
||||
#ifndef _LP64
|
||||
} else if (UseSSE == 1) {
|
||||
// save XMM registers as float because double not supported without SSE2(num MMX == num fpu)
|
||||
int offset = 0;
|
||||
for (int n = 0; n < FrameMap::nof_fpu_regs; n++) {
|
||||
XMMRegister xmm_name = as_XMMRegister(n);
|
||||
__ movflt(Address(rsp, xmm_regs_as_doubles_off * VMRegImpl::stack_slot_size + offset), xmm_name);
|
||||
offset += 8;
|
||||
}
|
||||
#endif // !_LP64
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "opto/compile.hpp"
|
||||
#include "opto/machnode.hpp"
|
||||
#include "opto/node.hpp"
|
||||
#include "opto/output.hpp"
|
||||
#include "opto/regalloc.hpp"
|
||||
#include "utilities/align.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
@ -126,7 +127,7 @@ IntelJccErratumAlignment::IntelJccErratumAlignment(MacroAssembler& masm, int jcc
|
||||
return;
|
||||
}
|
||||
|
||||
if (Compile::current()->in_scratch_emit_size()) {
|
||||
if (Compile::current()->output()->in_scratch_emit_size()) {
|
||||
// When we measure the size of this 32 byte alignment, we apply a conservative guess.
|
||||
__ nop(jcc_size);
|
||||
} else if (IntelJccErratum::is_crossing_or_ending_at_32_byte_boundary(_start_pc, _start_pc + jcc_size)) {
|
||||
@ -141,7 +142,7 @@ IntelJccErratumAlignment::IntelJccErratumAlignment(MacroAssembler& masm, int jcc
|
||||
|
||||
IntelJccErratumAlignment::~IntelJccErratumAlignment() {
|
||||
if (!VM_Version::has_intel_jcc_erratum() ||
|
||||
Compile::current()->in_scratch_emit_size()) {
|
||||
Compile::current()->output()->in_scratch_emit_size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -103,6 +103,10 @@ define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
|
||||
product(bool, UseStoreImmI16, true, \
|
||||
"Use store immediate 16-bits value instruction on x86") \
|
||||
\
|
||||
product(intx, UseSSE, 99, \
|
||||
"Highest supported SSE instructions set on x86/x64") \
|
||||
range(0, 99) \
|
||||
\
|
||||
product(intx, UseAVX, 3, \
|
||||
"Highest supported AVX instructions set on x86/x64") \
|
||||
range(0, 99) \
|
||||
@ -210,5 +214,10 @@ define_pd_global(intx, InitArrayShortSize, 8*BytesPerLong);
|
||||
"Minimum array size in bytes to use AVX512 intrinsics" \
|
||||
"for copy, inflate and fill. When this value is set as zero" \
|
||||
"compare operations can also use AVX512 intrinsics.") \
|
||||
range(0, max_jint)
|
||||
range(0, max_jint) \
|
||||
\
|
||||
diagnostic(bool, IntelJccErratumMitigation, true, \
|
||||
"Turn off JVM mitigations related to Intel micro code " \
|
||||
"mitigations for the Intel JCC erratum")
|
||||
|
||||
#endif // CPU_X86_GLOBALS_X86_HPP
|
||||
|
@ -1621,38 +1621,10 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
|
||||
bind(skip_receiver_profile);
|
||||
|
||||
// The method data pointer needs to be updated to reflect the new target.
|
||||
#if INCLUDE_JVMCI
|
||||
if (MethodProfileWidth == 0) {
|
||||
update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size()));
|
||||
}
|
||||
#else // INCLUDE_JVMCI
|
||||
update_mdp_by_constant(mdp,
|
||||
in_bytes(VirtualCallData::
|
||||
virtual_call_data_size()));
|
||||
#endif // INCLUDE_JVMCI
|
||||
bind(profile_continue);
|
||||
}
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMCI
|
||||
void InterpreterMacroAssembler::profile_called_method(Register method, Register mdp, Register reg2) {
|
||||
assert_different_registers(method, mdp, reg2);
|
||||
if (ProfileInterpreter && MethodProfileWidth > 0) {
|
||||
Label profile_continue;
|
||||
|
||||
// If no method data exists, go to profile_continue.
|
||||
test_method_data_pointer(mdp, profile_continue);
|
||||
|
||||
Label done;
|
||||
record_item_in_profile_helper(method, mdp, reg2, 0, done, MethodProfileWidth,
|
||||
&VirtualCallData::method_offset, &VirtualCallData::method_count_offset, in_bytes(VirtualCallData::nonprofiled_receiver_count_offset()));
|
||||
bind(done);
|
||||
|
||||
update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size()));
|
||||
bind(profile_continue);
|
||||
}
|
||||
}
|
||||
#endif // INCLUDE_JVMCI
|
||||
|
||||
// This routine creates a state machine for updating the multi-row
|
||||
// type profile at a virtual call site (or other type-sensitive bytecode).
|
||||
|
@ -269,7 +269,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
void profile_virtual_call(Register receiver, Register mdp,
|
||||
Register scratch2,
|
||||
bool receiver_can_be_null = false);
|
||||
void profile_called_method(Register method, Register mdp, Register reg2) NOT_JVMCI_RETURN;
|
||||
void profile_ret(Register return_bci, Register mdp);
|
||||
void profile_null_seen(Register mdp);
|
||||
void profile_typecheck(Register mdp, Register klass, Register scratch);
|
||||
|
@ -2724,17 +2724,6 @@ void MacroAssembler::divss(XMMRegister dst, AddressLiteral src) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef _LP64
|
||||
void MacroAssembler::empty_FPU_stack() {
|
||||
if (VM_Version::supports_mmx()) {
|
||||
emms();
|
||||
} else {
|
||||
for (int i = 8; i-- > 0; ) ffree(i);
|
||||
}
|
||||
}
|
||||
#endif // !LP64
|
||||
|
||||
|
||||
void MacroAssembler::enter() {
|
||||
push(rbp);
|
||||
mov(rbp, rsp);
|
||||
@ -2753,7 +2742,7 @@ void MacroAssembler::fat_nop() {
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(_LP64)
|
||||
#ifndef _LP64
|
||||
void MacroAssembler::fcmp(Register tmp) {
|
||||
fcmp(tmp, 1, true, true);
|
||||
}
|
||||
@ -2856,6 +2845,14 @@ void MacroAssembler::fremr(Register tmp) {
|
||||
fxch(1);
|
||||
fpop();
|
||||
}
|
||||
|
||||
void MacroAssembler::empty_FPU_stack() {
|
||||
if (VM_Version::supports_mmx()) {
|
||||
emms();
|
||||
} else {
|
||||
for (int i = 8; i-- > 0; ) ffree(i);
|
||||
}
|
||||
}
|
||||
#endif // !LP64
|
||||
|
||||
void MacroAssembler::mulpd(XMMRegister dst, AddressLiteral src) {
|
||||
@ -2868,39 +2865,51 @@ void MacroAssembler::mulpd(XMMRegister dst, AddressLiteral src) {
|
||||
}
|
||||
|
||||
void MacroAssembler::load_float(Address src) {
|
||||
#ifdef _LP64
|
||||
movflt(xmm0, src);
|
||||
#else
|
||||
if (UseSSE >= 1) {
|
||||
movflt(xmm0, src);
|
||||
} else {
|
||||
LP64_ONLY(ShouldNotReachHere());
|
||||
NOT_LP64(fld_s(src));
|
||||
fld_s(src);
|
||||
}
|
||||
#endif // LP64
|
||||
}
|
||||
|
||||
void MacroAssembler::store_float(Address dst) {
|
||||
#ifdef _LP64
|
||||
movflt(dst, xmm0);
|
||||
#else
|
||||
if (UseSSE >= 1) {
|
||||
movflt(dst, xmm0);
|
||||
} else {
|
||||
LP64_ONLY(ShouldNotReachHere());
|
||||
NOT_LP64(fstp_s(dst));
|
||||
fstp_s(dst);
|
||||
}
|
||||
#endif // LP64
|
||||
}
|
||||
|
||||
void MacroAssembler::load_double(Address src) {
|
||||
#ifdef _LP64
|
||||
movdbl(xmm0, src);
|
||||
#else
|
||||
if (UseSSE >= 2) {
|
||||
movdbl(xmm0, src);
|
||||
} else {
|
||||
LP64_ONLY(ShouldNotReachHere());
|
||||
NOT_LP64(fld_d(src));
|
||||
fld_d(src);
|
||||
}
|
||||
#endif // LP64
|
||||
}
|
||||
|
||||
void MacroAssembler::store_double(Address dst) {
|
||||
#ifdef _LP64
|
||||
movdbl(dst, xmm0);
|
||||
#else
|
||||
if (UseSSE >= 2) {
|
||||
movdbl(dst, xmm0);
|
||||
} else {
|
||||
LP64_ONLY(ShouldNotReachHere());
|
||||
NOT_LP64(fstp_d(dst));
|
||||
fstp_d(dst);
|
||||
}
|
||||
#endif // LP64
|
||||
}
|
||||
|
||||
// dst = c = a * b + c
|
||||
|
@ -4445,7 +4445,7 @@ void roundDeclast(XMMRegister xmm_reg) {
|
||||
}
|
||||
|
||||
address generate_cipherBlockChaining_decryptVectorAESCrypt() {
|
||||
assert(VM_Version::supports_vaes(), "need AES instructions and misaligned SSE support");
|
||||
assert(VM_Version::supports_avx512_vaes(), "need AES instructions and misaligned SSE support");
|
||||
__ align(CodeEntryAlignment);
|
||||
StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_decryptAESCrypt");
|
||||
address start = __ pc();
|
||||
@ -5750,7 +5750,7 @@ address generate_avx_ghash_processBlocks() {
|
||||
|
||||
// If vectorization is enabled, check if the number of iterations is at least 64
|
||||
// If not, then go to ShifTwo processing 2 iterations
|
||||
if (VM_Version::supports_vbmi2()) {
|
||||
if (VM_Version::supports_avx512_vbmi2()) {
|
||||
__ cmpptr(totalNumIter, (AVX3Threshold/64));
|
||||
__ jcc(Assembler::less, ShiftTwo);
|
||||
|
||||
@ -5874,7 +5874,7 @@ address generate_avx_ghash_processBlocks() {
|
||||
|
||||
// If vectorization is enabled, check if the number of iterations is at least 64
|
||||
// If not, then go to ShiftTwo shifting two numbers at a time
|
||||
if (VM_Version::supports_vbmi2()) {
|
||||
if (VM_Version::supports_avx512_vbmi2()) {
|
||||
__ cmpl(totalNumIter, (AVX3Threshold/64));
|
||||
__ jcc(Assembler::less, ShiftTwo);
|
||||
|
||||
@ -6466,7 +6466,7 @@ address generate_avx_ghash_processBlocks() {
|
||||
StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock();
|
||||
StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock();
|
||||
StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt();
|
||||
if (VM_Version::supports_vaes() && VM_Version::supports_avx512vl() && VM_Version::supports_avx512dq() ) {
|
||||
if (VM_Version::supports_avx512_vaes() && VM_Version::supports_avx512vl() && VM_Version::supports_avx512dq() ) {
|
||||
StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptVectorAESCrypt();
|
||||
StubRoutines::_electronicCodeBook_encryptAESCrypt = generate_electronicCodeBook_encryptAESCrypt();
|
||||
StubRoutines::_electronicCodeBook_decryptAESCrypt = generate_electronicCodeBook_decryptAESCrypt();
|
||||
@ -6475,7 +6475,7 @@ address generate_avx_ghash_processBlocks() {
|
||||
}
|
||||
}
|
||||
if (UseAESCTRIntrinsics) {
|
||||
if (VM_Version::supports_vaes() && VM_Version::supports_avx512bw() && VM_Version::supports_avx512vl()) {
|
||||
if (VM_Version::supports_avx512_vaes() && VM_Version::supports_avx512bw() && VM_Version::supports_avx512vl()) {
|
||||
StubRoutines::x86::_counter_mask_addr = counter_mask_addr();
|
||||
StubRoutines::_counterMode_AESCrypt = generate_counterMode_VectorAESCrypt();
|
||||
} else {
|
||||
@ -6556,7 +6556,7 @@ address generate_avx_ghash_processBlocks() {
|
||||
if (UseMulAddIntrinsic) {
|
||||
StubRoutines::_mulAdd = generate_mulAdd();
|
||||
}
|
||||
if (VM_Version::supports_vbmi2()) {
|
||||
if (VM_Version::supports_avx512_vbmi2()) {
|
||||
StubRoutines::_bigIntegerRightShiftWorker = generate_bigIntegerRightShift();
|
||||
StubRoutines::_bigIntegerLeftShiftWorker = generate_bigIntegerLeftShift();
|
||||
}
|
||||
|
@ -3743,7 +3743,6 @@ void TemplateTable::invokevirtual_helper(Register index,
|
||||
__ profile_virtual_call(rax, rlocals, rdx);
|
||||
// get target Method* & entry point
|
||||
__ lookup_virtual_method(rax, index, method);
|
||||
__ profile_called_method(method, rdx, rbcp);
|
||||
|
||||
__ profile_arguments_type(rdx, method, rbcp, true);
|
||||
__ jump_from_interpreted(method, rdx);
|
||||
@ -3895,7 +3894,6 @@ void TemplateTable::invokeinterface(int byte_no) {
|
||||
__ testptr(rbx, rbx);
|
||||
__ jcc(Assembler::zero, no_such_method);
|
||||
|
||||
__ profile_called_method(rbx, rbcp, rdx);
|
||||
__ profile_arguments_type(rdx, rbx, rbcp, true);
|
||||
|
||||
// do the call
|
||||
|
@ -562,7 +562,10 @@ class VM_Version_StubGenerator: public StubCodeGenerator {
|
||||
__ jcc(Assembler::equal, L_wrapup);
|
||||
__ cmpl(rcx, 0x00080650); // If it is Future Xeon Phi
|
||||
__ jcc(Assembler::equal, L_wrapup);
|
||||
__ vzeroupper();
|
||||
// vzeroupper() will use a pre-computed instruction sequence that we
|
||||
// can't compute until after we've determined CPU capabilities. Use
|
||||
// uncached variant here directly to be able to bootstrap correctly
|
||||
__ vzeroupper_uncached();
|
||||
# undef __
|
||||
}
|
||||
};
|
||||
@ -697,9 +700,9 @@ void VM_Version::get_processor_features() {
|
||||
_features &= ~CPU_AVX512VL;
|
||||
_features &= ~CPU_AVX512_VPOPCNTDQ;
|
||||
_features &= ~CPU_AVX512_VPCLMULQDQ;
|
||||
_features &= ~CPU_VAES;
|
||||
_features &= ~CPU_VNNI;
|
||||
_features &= ~CPU_VBMI2;
|
||||
_features &= ~CPU_AVX512_VAES;
|
||||
_features &= ~CPU_AVX512_VNNI;
|
||||
_features &= ~CPU_AVX512_VBMI2;
|
||||
}
|
||||
|
||||
if (UseAVX < 2)
|
||||
@ -721,12 +724,20 @@ void VM_Version::get_processor_features() {
|
||||
}
|
||||
}
|
||||
|
||||
_has_intel_jcc_erratum = compute_has_intel_jcc_erratum();
|
||||
if (FLAG_IS_DEFAULT(IntelJccErratumMitigation)) {
|
||||
_has_intel_jcc_erratum = compute_has_intel_jcc_erratum();
|
||||
} else {
|
||||
_has_intel_jcc_erratum = IntelJccErratumMitigation;
|
||||
}
|
||||
|
||||
char buf[512];
|
||||
int res = jio_snprintf(buf, sizeof(buf),
|
||||
"(%u cores per cpu, %u threads per core) family %d model %d stepping %d"
|
||||
"%s%s%s%s%s%s%s%s%s%s" "%s%s%s%s%s%s%s%s%s%s" "%s%s%s%s%s%s%s%s%s%s" "%s%s%s%s%s%s%s%s%s%s" "%s%s%s%s%s%s",
|
||||
|
||||
char buf[256];
|
||||
jio_snprintf(buf, sizeof(buf), "(%u cores per cpu, %u threads per core) family %d model %d stepping %d%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
|
||||
cores_per_cpu(), threads_per_core(),
|
||||
cpu_family(), _model, _stepping,
|
||||
|
||||
(supports_cmov() ? ", cmov" : ""),
|
||||
(supports_cmpxchg8() ? ", cx8" : ""),
|
||||
(supports_fxsr() ? ", fxsr" : ""),
|
||||
@ -737,7 +748,9 @@ void VM_Version::get_processor_features() {
|
||||
(supports_ssse3()? ", ssse3": ""),
|
||||
(supports_sse4_1() ? ", sse4.1" : ""),
|
||||
(supports_sse4_2() ? ", sse4.2" : ""),
|
||||
|
||||
(supports_popcnt() ? ", popcnt" : ""),
|
||||
(supports_vzeroupper() ? ", vzeroupper" : ""),
|
||||
(supports_avx() ? ", avx" : ""),
|
||||
(supports_avx2() ? ", avx2" : ""),
|
||||
(supports_aes() ? ", aes" : ""),
|
||||
@ -746,6 +759,7 @@ void VM_Version::get_processor_features() {
|
||||
(supports_rtm() ? ", rtm" : ""),
|
||||
(supports_mmx_ext() ? ", mmxext" : ""),
|
||||
(supports_3dnow_prefetch() ? ", 3dnowpref" : ""),
|
||||
|
||||
(supports_lzcnt() ? ", lzcnt": ""),
|
||||
(supports_sse4a() ? ", sse4a": ""),
|
||||
(supports_ht() ? ", ht": ""),
|
||||
@ -755,12 +769,28 @@ void VM_Version::get_processor_features() {
|
||||
(supports_bmi1() ? ", bmi1" : ""),
|
||||
(supports_bmi2() ? ", bmi2" : ""),
|
||||
(supports_adx() ? ", adx" : ""),
|
||||
(supports_evex() ? ", evex" : ""),
|
||||
(supports_evex() ? ", avx512f" : ""),
|
||||
|
||||
(supports_avx512dq() ? ", avx512dq" : ""),
|
||||
(supports_avx512pf() ? ", avx512pf" : ""),
|
||||
(supports_avx512er() ? ", avx512er" : ""),
|
||||
(supports_avx512cd() ? ", avx512cd" : ""),
|
||||
(supports_avx512bw() ? ", avx512bw" : ""),
|
||||
(supports_avx512vl() ? ", avx512vl" : ""),
|
||||
(supports_avx512_vpopcntdq() ? ", avx512_vpopcntdq" : ""),
|
||||
(supports_avx512_vpclmulqdq() ? ", avx512_vpclmulqdq" : ""),
|
||||
(supports_avx512_vbmi2() ? ", avx512_vbmi2" : ""),
|
||||
(supports_avx512_vaes() ? ", avx512_vaes" : ""),
|
||||
|
||||
(supports_avx512_vnni() ? ", avx512_vnni" : ""),
|
||||
(supports_sha() ? ", sha" : ""),
|
||||
(supports_fma() ? ", fma" : ""),
|
||||
(supports_vbmi2() ? ", vbmi2" : ""),
|
||||
(supports_vaes() ? ", vaes" : ""),
|
||||
(supports_vnni() ? ", vnni" : ""));
|
||||
(supports_clflush() ? ", clflush" : ""),
|
||||
(supports_clflushopt() ? ", clflushopt" : ""),
|
||||
(supports_clwb() ? ", clwb" : ""));
|
||||
|
||||
assert(res > 0, "not enough temporary space allocated"); // increase 'buf' size
|
||||
|
||||
_features_string = os::strdup(buf);
|
||||
|
||||
// UseSSE is set to the smaller of what hardware supports and what
|
||||
@ -1829,6 +1859,9 @@ void VM_Version::initialize() {
|
||||
g.generate_get_cpu_info());
|
||||
|
||||
get_processor_features();
|
||||
|
||||
LP64_ONLY(Assembler::precompute_instructions();)
|
||||
|
||||
if (cpu_family() > 4) { // it supports CPUID
|
||||
check_virtualizations();
|
||||
}
|
||||
|
@ -338,17 +338,18 @@ protected:
|
||||
#define CPU_AVX512VL ((uint64_t)UCONST64(0x200000000)) // EVEX instructions with smaller vector length
|
||||
#define CPU_SHA ((uint64_t)UCONST64(0x400000000)) // SHA instructions
|
||||
#define CPU_FMA ((uint64_t)UCONST64(0x800000000)) // FMA instructions
|
||||
#define CPU_VZEROUPPER ((uint64_t)UCONST64(0x1000000000)) // Vzeroupper instruction
|
||||
#define CPU_AVX512_VPOPCNTDQ ((uint64_t)UCONST64(0x2000000000)) // Vector popcount
|
||||
#define CPU_AVX512_VPCLMULQDQ ((uint64_t)UCONST64(0x4000000000)) //Vector carryless multiplication
|
||||
#define CPU_VAES ((uint64_t)UCONST64(0x8000000000)) // Vector AES instructions
|
||||
#define CPU_VNNI ((uint64_t)UCONST64(0x10000000000)) // Vector Neural Network Instructions
|
||||
#define CPU_VZEROUPPER ((uint64_t)UCONST64(0x1000000000)) // Vzeroupper instruction
|
||||
#define CPU_AVX512_VPOPCNTDQ ((uint64_t)UCONST64(0x2000000000)) // Vector popcount
|
||||
#define CPU_AVX512_VPCLMULQDQ ((uint64_t)UCONST64(0x4000000000)) // Vector carryless multiplication
|
||||
#define CPU_AVX512_VAES ((uint64_t)UCONST64(0x8000000000)) // Vector AES instructions
|
||||
#define CPU_AVX512_VNNI ((uint64_t)UCONST64(0x10000000000)) // Vector Neural Network Instructions
|
||||
#define CPU_AVX512_VBMI2 ((uint64_t)UCONST64(0x100000000000)) // VBMI2 shift left double instructions
|
||||
|
||||
#define CPU_FLUSH ((uint64_t)UCONST64(0x20000000000)) // flush instruction
|
||||
#define CPU_FLUSHOPT ((uint64_t)UCONST64(0x40000000000)) // flushopt instruction
|
||||
#define CPU_CLWB ((uint64_t)UCONST64(0x80000000000)) // clwb instruction
|
||||
#define CPU_VBMI2 ((uint64_t)UCONST64(0x100000000000)) // VBMI2 shift left double instructions
|
||||
|
||||
// NB! When adding new CPU feature detection consider updating feature string in VM_Version::get_processor_features().
|
||||
|
||||
enum Extended_Family {
|
||||
// AMD
|
||||
@ -570,11 +571,11 @@ enum Extended_Family {
|
||||
if (_cpuid_info.sef_cpuid7_ecx.bits.avx512_vpclmulqdq != 0)
|
||||
result |= CPU_AVX512_VPCLMULQDQ;
|
||||
if (_cpuid_info.sef_cpuid7_ecx.bits.vaes != 0)
|
||||
result |= CPU_VAES;
|
||||
result |= CPU_AVX512_VAES;
|
||||
if (_cpuid_info.sef_cpuid7_ecx.bits.avx512_vnni != 0)
|
||||
result |= CPU_VNNI;
|
||||
result |= CPU_AVX512_VNNI;
|
||||
if (_cpuid_info.sef_cpuid7_ecx.bits.avx512_vbmi2 != 0)
|
||||
result |= CPU_VBMI2;
|
||||
result |= CPU_AVX512_VBMI2;
|
||||
}
|
||||
}
|
||||
if (_cpuid_info.sef_cpuid7_ebx.bits.bmi1 != 0)
|
||||
@ -862,11 +863,11 @@ public:
|
||||
static bool supports_sha() { return (_features & CPU_SHA) != 0; }
|
||||
static bool supports_fma() { return (_features & CPU_FMA) != 0 && supports_avx(); }
|
||||
static bool supports_vzeroupper() { return (_features & CPU_VZEROUPPER) != 0; }
|
||||
static bool supports_vpopcntdq() { return (_features & CPU_AVX512_VPOPCNTDQ) != 0; }
|
||||
static bool supports_avx512_vpopcntdq() { return (_features & CPU_AVX512_VPOPCNTDQ) != 0; }
|
||||
static bool supports_avx512_vpclmulqdq() { return (_features & CPU_AVX512_VPCLMULQDQ) != 0; }
|
||||
static bool supports_vaes() { return (_features & CPU_VAES) != 0; }
|
||||
static bool supports_vnni() { return (_features & CPU_VNNI) != 0; }
|
||||
static bool supports_vbmi2() { return (_features & CPU_VBMI2) != 0; }
|
||||
static bool supports_avx512_vaes() { return (_features & CPU_AVX512_VAES) != 0; }
|
||||
static bool supports_avx512_vnni() { return (_features & CPU_AVX512_VNNI) != 0; }
|
||||
static bool supports_avx512_vbmi2() { return (_features & CPU_AVX512_VBMI2) != 0; }
|
||||
|
||||
// Intel features
|
||||
static bool is_intel_family_core() { return is_intel() &&
|
||||
|
@ -1262,7 +1262,7 @@ const bool Matcher::match_rule_supported(int opcode) {
|
||||
}
|
||||
break;
|
||||
case Op_PopCountVI:
|
||||
if (!UsePopCountInstruction || !VM_Version::supports_vpopcntdq()) {
|
||||
if (!UsePopCountInstruction || !VM_Version::supports_avx512_vpopcntdq()) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@ -1295,14 +1295,6 @@ const bool Matcher::match_rule_supported(int opcode) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case Op_AddReductionVF:
|
||||
case Op_AddReductionVD:
|
||||
case Op_MulReductionVF:
|
||||
case Op_MulReductionVD:
|
||||
if (UseSSE < 1) { // requires at least SSE
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case Op_SqrtVD:
|
||||
case Op_SqrtVF:
|
||||
if (UseAVX < 1) { // enabled for AVX only
|
||||
@ -1338,14 +1330,6 @@ const bool Matcher::match_rule_supported(int opcode) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case Op_MulAddVS2VI:
|
||||
case Op_RShiftVL:
|
||||
case Op_AbsVD:
|
||||
case Op_NegVD:
|
||||
if (UseSSE < 2) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case Op_MulVB:
|
||||
case Op_LShiftVB:
|
||||
case Op_RShiftVB:
|
||||
@ -1381,6 +1365,24 @@ const bool Matcher::match_rule_supported(int opcode) {
|
||||
return false; // 128bit vroundpd is not available
|
||||
}
|
||||
break;
|
||||
#ifndef _LP64
|
||||
case Op_AddReductionVF:
|
||||
case Op_AddReductionVD:
|
||||
case Op_MulReductionVF:
|
||||
case Op_MulReductionVD:
|
||||
if (UseSSE < 1) { // requires at least SSE
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case Op_MulAddVS2VI:
|
||||
case Op_RShiftVL:
|
||||
case Op_AbsVD:
|
||||
case Op_NegVD:
|
||||
if (UseSSE < 2) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
#endif // !LP64
|
||||
}
|
||||
return true; // Match rules are supported by default.
|
||||
}
|
||||
@ -3122,14 +3124,12 @@ instruct storeV(memory mem, vec src) %{
|
||||
|
||||
// Replicate byte scalar to be vector
|
||||
instruct ReplB_reg(vec dst, rRegI src) %{
|
||||
predicate((n->as_Vector()->length() <= 32) ||
|
||||
(n->as_Vector()->length() == 64 && VM_Version::supports_avx512bw())); // AVX512BW for 512bit byte instructions
|
||||
match(Set dst (ReplicateB src));
|
||||
format %{ "replicateB $dst,$src" %}
|
||||
ins_encode %{
|
||||
uint vlen = vector_length(this);
|
||||
if (vlen == 64 || VM_Version::supports_avx512vlbw()) { // AVX512VL for <512bit operands
|
||||
assert(VM_Version::supports_avx512bw(), "required");
|
||||
assert(VM_Version::supports_avx512bw(), "required"); // 512-bit byte vectors assume AVX512BW
|
||||
int vlen_enc = vector_length_encoding(this);
|
||||
__ evpbroadcastb($dst$$XMMRegister, $src$$Register, vlen_enc);
|
||||
} else {
|
||||
@ -3139,7 +3139,7 @@ instruct ReplB_reg(vec dst, rRegI src) %{
|
||||
if (vlen >= 16) {
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
if (vlen >= 32) {
|
||||
assert(vlen == 32, "sanity"); // vlen == 64 && !AVX512BW is covered by ReplB_reg_leg
|
||||
assert(vlen == 32, "sanity");
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
}
|
||||
}
|
||||
@ -3148,29 +3148,11 @@ instruct ReplB_reg(vec dst, rRegI src) %{
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct ReplB_reg_leg(legVec dst, rRegI src) %{
|
||||
predicate(n->as_Vector()->length() == 64 && !VM_Version::supports_avx512bw()); // AVX512BW for 512bit byte instructions
|
||||
match(Set dst (ReplicateB src));
|
||||
format %{ "replicateB $dst,$src" %}
|
||||
ins_encode %{
|
||||
assert(UseAVX > 2, "required");
|
||||
__ movdl($dst$$XMMRegister, $src$$Register);
|
||||
__ punpcklbw($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ pshuflw($dst$$XMMRegister, $dst$$XMMRegister, 0x00);
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti64x4($dst$$XMMRegister, $dst$$XMMRegister, $dst$$XMMRegister, 0x1);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct ReplB_mem(vec dst, memory mem) %{
|
||||
predicate((n->as_Vector()->length() <= 32 && VM_Version::supports_avx512vlbw()) || // AVX512VL for <512bit operands
|
||||
(n->as_Vector()->length() == 64 && VM_Version::supports_avx512bw())); // AVX512BW for 512bit byte instructions
|
||||
predicate(VM_Version::supports_avx2());
|
||||
match(Set dst (ReplicateB (LoadB mem)));
|
||||
format %{ "replicateB $dst,$mem" %}
|
||||
ins_encode %{
|
||||
assert(UseAVX > 2, "required");
|
||||
int vector_len = vector_length_encoding(this);
|
||||
__ vpbroadcastb($dst$$XMMRegister, $mem$$Address, vector_len);
|
||||
%}
|
||||
@ -3178,8 +3160,6 @@ instruct ReplB_mem(vec dst, memory mem) %{
|
||||
%}
|
||||
|
||||
instruct ReplB_imm(vec dst, immI con) %{
|
||||
predicate((n->as_Vector()->length() <= 32) ||
|
||||
(n->as_Vector()->length() == 64 && VM_Version::supports_avx512bw())); // AVX512BW for 512bit byte instructions
|
||||
match(Set dst (ReplicateB con));
|
||||
format %{ "replicateB $dst,$con" %}
|
||||
ins_encode %{
|
||||
@ -3190,15 +3170,12 @@ instruct ReplB_imm(vec dst, immI con) %{
|
||||
} else {
|
||||
__ movq($dst$$XMMRegister, const_addr);
|
||||
if (vlen >= 16) {
|
||||
if (vlen == 64 || VM_Version::supports_avx512vlbw()) { // AVX512VL for <512bit operands
|
||||
if (VM_Version::supports_avx2()) {
|
||||
int vlen_enc = vector_length_encoding(this);
|
||||
__ vpbroadcastb($dst$$XMMRegister, $dst$$XMMRegister, vlen_enc);
|
||||
__ vpbroadcastq($dst$$XMMRegister, $dst$$XMMRegister, vlen_enc);
|
||||
} else {
|
||||
assert(vlen == 16, "sanity");
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
if (vlen >= 32) {
|
||||
assert(vlen == 32, "sanity");// vlen == 64 && !AVX512BW is covered by ReplB_imm_leg
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3206,19 +3183,6 @@ instruct ReplB_imm(vec dst, immI con) %{
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct ReplB_imm_leg(legVec dst, immI con) %{
|
||||
predicate(n->as_Vector()->length() == 64 && !VM_Version::supports_avx512bw());
|
||||
match(Set dst (ReplicateB con));
|
||||
format %{ "replicateB $dst,$con" %}
|
||||
ins_encode %{
|
||||
__ movq($dst$$XMMRegister, $constantaddress(replicate8_imm($con$$constant, 1)));
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti64x4($dst$$XMMRegister, $dst$$XMMRegister, $dst$$XMMRegister, 0x1);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
// Replicate byte scalar zero to be vector
|
||||
instruct ReplB_zero(vec dst, immI0 zero) %{
|
||||
match(Set dst (ReplicateB zero));
|
||||
@ -3239,14 +3203,12 @@ instruct ReplB_zero(vec dst, immI0 zero) %{
|
||||
// ====================ReplicateS=======================================
|
||||
|
||||
instruct ReplS_reg(vec dst, rRegI src) %{
|
||||
predicate((n->as_Vector()->length() <= 16) ||
|
||||
(n->as_Vector()->length() == 32 && VM_Version::supports_avx512bw())); // AVX512BW for 512bit instructions on shorts
|
||||
match(Set dst (ReplicateS src));
|
||||
format %{ "replicateS $dst,$src" %}
|
||||
ins_encode %{
|
||||
uint vlen = vector_length(this);
|
||||
if (vlen == 32 || VM_Version::supports_avx512vlbw()) { // AVX512VL for <512bit operands
|
||||
assert(VM_Version::supports_avx512bw(), "required");
|
||||
assert(VM_Version::supports_avx512bw(), "required"); // 512-bit short vectors assume AVX512BW
|
||||
int vlen_enc = vector_length_encoding(this);
|
||||
__ evpbroadcastw($dst$$XMMRegister, $src$$Register, vlen_enc);
|
||||
} else {
|
||||
@ -3255,7 +3217,7 @@ instruct ReplS_reg(vec dst, rRegI src) %{
|
||||
if (vlen >= 8) {
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
if (vlen >= 16) {
|
||||
assert(vlen == 16, "sanity"); // vlen == 32 && !AVX512BW is covered by ReplS_reg_leg
|
||||
assert(vlen == 16, "sanity");
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
}
|
||||
}
|
||||
@ -3264,81 +3226,34 @@ instruct ReplS_reg(vec dst, rRegI src) %{
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct ReplS_reg_leg(legVec dst, rRegI src) %{
|
||||
predicate(n->as_Vector()->length() == 32 && !VM_Version::supports_avx512bw());
|
||||
match(Set dst (ReplicateS src));
|
||||
format %{ "replicateS $dst,$src" %}
|
||||
ins_encode %{
|
||||
__ movdl($dst$$XMMRegister, $src$$Register);
|
||||
__ pshuflw($dst$$XMMRegister, $dst$$XMMRegister, 0x00);
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti64x4($dst$$XMMRegister, $dst$$XMMRegister, $dst$$XMMRegister, 0x1);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct ReplS_mem(vec dst, memory mem) %{
|
||||
predicate((n->as_Vector()->length() >= 4 &&
|
||||
n->as_Vector()->length() <= 16 && VM_Version::supports_avx()) ||
|
||||
(n->as_Vector()->length() == 32 && VM_Version::supports_avx512bw())); // AVX512BW for 512bit instructions on shorts
|
||||
predicate(VM_Version::supports_avx2());
|
||||
match(Set dst (ReplicateS (LoadS mem)));
|
||||
format %{ "replicateS $dst,$mem" %}
|
||||
ins_encode %{
|
||||
uint vlen = vector_length(this);
|
||||
if (vlen == 32 || VM_Version::supports_avx512vlbw()) { // AVX512VL for <512bit operands
|
||||
assert(VM_Version::supports_avx512bw(), "required");
|
||||
int vlen_enc = vector_length_encoding(this);
|
||||
__ vpbroadcastw($dst$$XMMRegister, $mem$$Address, vlen_enc);
|
||||
} else {
|
||||
__ pshuflw($dst$$XMMRegister, $mem$$Address, 0x00);
|
||||
if (vlen >= 8) {
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
if (vlen >= 16) {
|
||||
assert(vlen == 16, "sanity"); // vlen == 32 && !AVX512BW is covered by ReplS_mem_leg
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
}
|
||||
}
|
||||
}
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct ReplS_mem_leg(legVec dst, memory mem) %{
|
||||
predicate(n->as_Vector()->length() == 32 && !VM_Version::supports_avx512bw());
|
||||
match(Set dst (ReplicateS (LoadS mem)));
|
||||
format %{ "replicateS $dst,$mem" %}
|
||||
ins_encode %{
|
||||
__ pshuflw($dst$$XMMRegister, $mem$$Address, 0x00);
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti64x4($dst$$XMMRegister, $dst$$XMMRegister, $dst$$XMMRegister, 0x1);
|
||||
int vlen_enc = vector_length_encoding(this);
|
||||
__ vpbroadcastw($dst$$XMMRegister, $mem$$Address, vlen_enc);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct ReplS_imm(vec dst, immI con) %{
|
||||
predicate((n->as_Vector()->length() <= 16) ||
|
||||
(n->as_Vector()->length() == 32 && VM_Version::supports_avx512bw())); // AVX512BW for 512bit instructions on shorts
|
||||
match(Set dst (ReplicateS con));
|
||||
format %{ "replicateS $dst,$con" %}
|
||||
ins_encode %{
|
||||
uint vlen = vector_length(this);
|
||||
InternalAddress constaddr = $constantaddress(replicate8_imm($con$$constant, 2));
|
||||
InternalAddress const_addr = $constantaddress(replicate8_imm($con$$constant, 2));
|
||||
if (vlen == 2) {
|
||||
__ movdl($dst$$XMMRegister, constaddr);
|
||||
__ movdl($dst$$XMMRegister, const_addr);
|
||||
} else {
|
||||
__ movq($dst$$XMMRegister, constaddr);
|
||||
if (vlen == 32 || VM_Version::supports_avx512vlbw() ) { // AVX512VL for <512bit operands
|
||||
assert(VM_Version::supports_avx512bw(), "required");
|
||||
int vlen_enc = vector_length_encoding(this);
|
||||
__ vpbroadcastw($dst$$XMMRegister, $dst$$XMMRegister, vlen_enc);
|
||||
} else {
|
||||
__ movq($dst$$XMMRegister, constaddr);
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
if (vlen >= 16) {
|
||||
assert(vlen == 16, "sanity"); // vlen == 32 && !AVX512BW is covered by ReplS_imm_leg
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ movq($dst$$XMMRegister, const_addr);
|
||||
if (vlen >= 8) {
|
||||
if (VM_Version::supports_avx2()) {
|
||||
int vlen_enc = vector_length_encoding(this);
|
||||
__ vpbroadcastw($dst$$XMMRegister, $dst$$XMMRegister, vlen_enc);
|
||||
} else {
|
||||
assert(vlen == 8, "sanity");
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3346,19 +3261,6 @@ instruct ReplS_imm(vec dst, immI con) %{
|
||||
ins_pipe( fpu_reg_reg );
|
||||
%}
|
||||
|
||||
instruct ReplS_imm_leg(legVec dst, immI con) %{
|
||||
predicate(n->as_Vector()->length() == 32 && !VM_Version::supports_avx512bw());
|
||||
match(Set dst (ReplicateS con));
|
||||
format %{ "replicateS $dst,$con" %}
|
||||
ins_encode %{
|
||||
__ movq($dst$$XMMRegister, $constantaddress(replicate8_imm($con$$constant, 2)));
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti64x4($dst$$XMMRegister, $dst$$XMMRegister, $dst$$XMMRegister, 0x1);
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
%}
|
||||
|
||||
instruct ReplS_zero(vec dst, immI0 zero) %{
|
||||
match(Set dst (ReplicateS zero));
|
||||
format %{ "replicateS $dst,$zero" %}
|
||||
@ -3397,20 +3299,17 @@ instruct ReplI_reg(vec dst, rRegI src) %{
|
||||
%}
|
||||
|
||||
instruct ReplI_mem(vec dst, memory mem) %{
|
||||
predicate(VM_Version::supports_avx()); // use VEX-encoded pshufd to relax 16-byte alignment restriction on the source
|
||||
match(Set dst (ReplicateI (LoadI mem)));
|
||||
format %{ "replicateI $dst,$mem" %}
|
||||
ins_encode %{
|
||||
uint vlen = vector_length(this);
|
||||
if (vlen <= 4) {
|
||||
__ pshufd($dst$$XMMRegister, $mem$$Address, 0x00);
|
||||
} else if (vlen == 16 || VM_Version::supports_avx512vl()) { // AVX512VL for <512bit operands
|
||||
__ movdl($dst$$XMMRegister, $mem$$Address);
|
||||
__ pshufd($dst$$XMMRegister, $dst$$XMMRegister, 0x00);
|
||||
} else {
|
||||
assert(VM_Version::supports_avx2(), "sanity");
|
||||
int vector_len = vector_length_encoding(this);
|
||||
__ vpbroadcastd($dst$$XMMRegister, $mem$$Address, vector_len);
|
||||
} else {
|
||||
assert(vlen == 8, "sanity");
|
||||
__ pshufd($dst$$XMMRegister, $mem$$Address, 0x00);
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
}
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
@ -3421,20 +3320,17 @@ instruct ReplI_imm(vec dst, immI con) %{
|
||||
format %{ "replicateI $dst,$con" %}
|
||||
ins_encode %{
|
||||
uint vlen = vector_length(this);
|
||||
InternalAddress constaddr = $constantaddress(replicate8_imm($con$$constant, 4));
|
||||
if (vlen == 2) {
|
||||
__ movq($dst$$XMMRegister, constaddr);
|
||||
} else if (vlen == 16 || VM_Version::supports_avx512vl()) { // AVX512VL for <512bit operands
|
||||
int vector_len = vector_length_encoding(this);
|
||||
__ movq($dst$$XMMRegister, constaddr);
|
||||
__ vpbroadcastd($dst$$XMMRegister, $dst$$XMMRegister, vector_len);
|
||||
} else {
|
||||
__ movq($dst$$XMMRegister, constaddr);
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
if (vlen >= 8) {
|
||||
assert(vlen == 8, "sanity");
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
InternalAddress const_addr = $constantaddress(replicate8_imm($con$$constant, 4));
|
||||
if (vlen <= 4) {
|
||||
__ movq($dst$$XMMRegister, const_addr);
|
||||
if (vlen == 4) {
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
}
|
||||
} else {
|
||||
assert(VM_Version::supports_avx2(), "sanity");
|
||||
int vector_len = vector_length_encoding(this);
|
||||
__ movq($dst$$XMMRegister, const_addr);
|
||||
__ vpbroadcastd($dst$$XMMRegister, $dst$$XMMRegister, vector_len);
|
||||
}
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
@ -3544,14 +3440,10 @@ instruct ReplL_mem(vec dst, memory mem) %{
|
||||
if (vlen == 2) {
|
||||
__ movq($dst$$XMMRegister, $mem$$Address);
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
} else if (vlen == 8 || VM_Version::supports_avx512vl()) { // AVX512VL for <512bit operands
|
||||
} else {
|
||||
assert(VM_Version::supports_avx2(), "sanity");
|
||||
int vlen_enc = vector_length_encoding(this);
|
||||
__ vpbroadcastq($dst$$XMMRegister, $mem$$Address, vlen_enc);
|
||||
} else {
|
||||
assert(vlen == 4, "sanity");
|
||||
__ movq($dst$$XMMRegister, $mem$$Address);
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
}
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
@ -3567,15 +3459,11 @@ instruct ReplL_imm(vec dst, immL con) %{
|
||||
if (vlen == 2) {
|
||||
__ movq($dst$$XMMRegister, const_addr);
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
} else if (vlen == 8 || VM_Version::supports_avx512vl()) { // AVX512VL for <512bit operands
|
||||
} else {
|
||||
assert(VM_Version::supports_avx2(), "sanity");
|
||||
int vlen_enc = vector_length_encoding(this);
|
||||
__ movq($dst$$XMMRegister, const_addr);
|
||||
__ vpbroadcastq($dst$$XMMRegister, $dst$$XMMRegister, vlen_enc);
|
||||
} else {
|
||||
assert(vlen == 4, "sanity");
|
||||
__ movq($dst$$XMMRegister, const_addr);
|
||||
__ punpcklqdq($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
__ vinserti128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
}
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
@ -3605,9 +3493,9 @@ instruct ReplF_reg(vec dst, vlRegF src) %{
|
||||
uint vlen = vector_length(this);
|
||||
if (vlen <= 4) {
|
||||
__ pshufd($dst$$XMMRegister, $src$$XMMRegister, 0x00);
|
||||
} else if (vlen == 16 || VM_Version::supports_avx512vl()) { // AVX512VL for <512bit operands
|
||||
} else if (VM_Version::supports_avx2()) {
|
||||
int vector_len = vector_length_encoding(this);
|
||||
__ vbroadcastss($dst$$XMMRegister, $src$$XMMRegister, vector_len);
|
||||
__ vbroadcastss($dst$$XMMRegister, $src$$XMMRegister, vector_len); // reg-to-reg variant requires AVX2
|
||||
} else {
|
||||
assert(vlen == 8, "sanity");
|
||||
__ pshufd($dst$$XMMRegister, $src$$XMMRegister, 0x00);
|
||||
@ -3618,20 +3506,17 @@ instruct ReplF_reg(vec dst, vlRegF src) %{
|
||||
%}
|
||||
|
||||
instruct ReplF_mem(vec dst, memory mem) %{
|
||||
predicate(VM_Version::supports_avx()); // use VEX-encoded pshufd to relax 16-byte alignment restriction on the source
|
||||
match(Set dst (ReplicateF (LoadF mem)));
|
||||
format %{ "replicateF $dst,$mem" %}
|
||||
ins_encode %{
|
||||
uint vlen = vector_length(this);
|
||||
if (vlen <= 4) {
|
||||
__ pshufd($dst$$XMMRegister, $mem$$Address, 0x00);
|
||||
} else if (vlen == 16 || VM_Version::supports_avx512vl()) { // AVX512VL for <512bit operands
|
||||
__ movdl($dst$$XMMRegister, $mem$$Address);
|
||||
__ pshufd($dst$$XMMRegister, $dst$$XMMRegister, 0x00);
|
||||
} else {
|
||||
assert(VM_Version::supports_avx(), "sanity");
|
||||
int vector_len = vector_length_encoding(this);
|
||||
__ vbroadcastss($dst$$XMMRegister, $mem$$Address, vector_len);
|
||||
} else {
|
||||
assert(vlen == 8, "sanity");
|
||||
__ pshufd($dst$$XMMRegister, $mem$$Address, 0x00);
|
||||
__ vinsertf128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
}
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
@ -3662,9 +3547,9 @@ instruct ReplD_reg(vec dst, vlRegD src) %{
|
||||
uint vlen = vector_length(this);
|
||||
if (vlen == 2) {
|
||||
__ pshufd($dst$$XMMRegister, $src$$XMMRegister, 0x44);
|
||||
} else if (vlen == 8 || VM_Version::supports_avx512vl()) { // AVX512VL for <512bit operands
|
||||
} else if (VM_Version::supports_avx2()) {
|
||||
int vector_len = vector_length_encoding(this);
|
||||
__ vbroadcastsd($dst$$XMMRegister, $src$$XMMRegister, vector_len);
|
||||
__ vbroadcastsd($dst$$XMMRegister, $src$$XMMRegister, vector_len); // reg-to-reg variant requires AVX2
|
||||
} else {
|
||||
assert(vlen == 4, "sanity");
|
||||
__ pshufd($dst$$XMMRegister, $src$$XMMRegister, 0x44);
|
||||
@ -3675,20 +3560,17 @@ instruct ReplD_reg(vec dst, vlRegD src) %{
|
||||
%}
|
||||
|
||||
instruct ReplD_mem(vec dst, memory mem) %{
|
||||
predicate(VM_Version::supports_avx()); // use VEX-encoded pshufd to relax 16-byte alignment restriction on the source
|
||||
match(Set dst (ReplicateD (LoadD mem)));
|
||||
format %{ "replicateD $dst,$mem" %}
|
||||
ins_encode %{
|
||||
uint vlen = vector_length(this);
|
||||
if (vlen == 2) {
|
||||
__ pshufd($dst$$XMMRegister, $mem$$Address, 0x44);
|
||||
} else if (vlen == 8 || VM_Version::supports_avx512vl()) { // AVX512VL for <512bit operands
|
||||
__ movq($dst$$XMMRegister, $mem$$Address);
|
||||
__ pshufd($dst$$XMMRegister, $dst$$XMMRegister, 0x44);
|
||||
} else {
|
||||
assert(VM_Version::supports_avx(), "sanity");
|
||||
int vector_len = vector_length_encoding(this);
|
||||
__ vbroadcastsd($dst$$XMMRegister, $mem$$Address, vector_len);
|
||||
} else {
|
||||
assert(vlen == 4, "sanity");
|
||||
__ pshufd($dst$$XMMRegister, $mem$$Address, 0x44);
|
||||
__ vinsertf128_high($dst$$XMMRegister, $dst$$XMMRegister);
|
||||
}
|
||||
%}
|
||||
ins_pipe( pipe_slow );
|
||||
@ -5784,7 +5666,7 @@ instruct vmuladdS2I_reg_avx(vec dst, vec src1, vec src2) %{
|
||||
// --------------------------------- Vector Multiply Add Add ----------------------------------
|
||||
|
||||
instruct vmuladdaddS2I_reg(vec dst, vec src1, vec src2) %{
|
||||
predicate(VM_Version::supports_vnni());
|
||||
predicate(VM_Version::supports_avx512_vnni());
|
||||
match(Set dst (AddVI (MulAddVS2VI src1 src2) dst));
|
||||
format %{ "evpdpwssd $dst,$src1,$src2\t! muladdadd packedStoI" %}
|
||||
ins_encode %{
|
||||
|
@ -523,7 +523,7 @@ void emit_cmpfp3(MacroAssembler& _masm, Register dst) {
|
||||
//=============================================================================
|
||||
const RegMask& MachConstantBaseNode::_out_RegMask = RegMask::Empty;
|
||||
|
||||
int Compile::ConstantTable::calculate_table_base_offset() const {
|
||||
int ConstantTable::calculate_table_base_offset() const {
|
||||
return 0; // absolute addressing, no offset
|
||||
}
|
||||
|
||||
@ -552,13 +552,13 @@ void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
|
||||
void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
|
||||
Compile* C = ra_->C;
|
||||
|
||||
int framesize = C->frame_size_in_bytes();
|
||||
int bangsize = C->bang_size_in_bytes();
|
||||
int framesize = C->output()->frame_size_in_bytes();
|
||||
int bangsize = C->output()->bang_size_in_bytes();
|
||||
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
|
||||
// Remove wordSize for return addr which is already pushed.
|
||||
framesize -= wordSize;
|
||||
|
||||
if (C->need_stack_bang(bangsize)) {
|
||||
if (C->output()->need_stack_bang(bangsize)) {
|
||||
framesize -= wordSize;
|
||||
st->print("# stack bang (%d bytes)", bangsize);
|
||||
st->print("\n\t");
|
||||
@ -616,17 +616,17 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
Compile* C = ra_->C;
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
int framesize = C->frame_size_in_bytes();
|
||||
int bangsize = C->bang_size_in_bytes();
|
||||
int framesize = C->output()->frame_size_in_bytes();
|
||||
int bangsize = C->output()->bang_size_in_bytes();
|
||||
|
||||
__ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, C->in_24_bit_fp_mode(), C->stub_function() != NULL);
|
||||
__ verified_entry(framesize, C->output()->need_stack_bang(bangsize)?bangsize:0, C->in_24_bit_fp_mode(), C->stub_function() != NULL);
|
||||
|
||||
C->set_frame_complete(cbuf.insts_size());
|
||||
C->output()->set_frame_complete(cbuf.insts_size());
|
||||
|
||||
if (C->has_mach_constant_base_node()) {
|
||||
// NOTE: We set the table base offset here because users might be
|
||||
// emitted before MachConstantBaseNode.
|
||||
Compile::ConstantTable& constant_table = C->constant_table();
|
||||
ConstantTable& constant_table = C->output()->constant_table();
|
||||
constant_table.set_table_base_offset(constant_table.calculate_table_base_offset());
|
||||
}
|
||||
}
|
||||
@ -643,7 +643,7 @@ int MachPrologNode::reloc() const {
|
||||
#ifndef PRODUCT
|
||||
void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream* st ) const {
|
||||
Compile *C = ra_->C;
|
||||
int framesize = C->frame_size_in_bytes();
|
||||
int framesize = C->output()->frame_size_in_bytes();
|
||||
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
|
||||
// Remove two words for return addr and rbp,
|
||||
framesize -= 2*wordSize;
|
||||
@ -682,7 +682,7 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
_masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std()));
|
||||
}
|
||||
|
||||
int framesize = C->frame_size_in_bytes();
|
||||
int framesize = C->output()->frame_size_in_bytes();
|
||||
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
|
||||
// Remove two words for return addr and rbp,
|
||||
framesize -= 2*wordSize;
|
||||
|
@ -785,7 +785,7 @@ void emit_fp_min_max(MacroAssembler& _masm, XMMRegister dst,
|
||||
//=============================================================================
|
||||
const RegMask& MachConstantBaseNode::_out_RegMask = RegMask::Empty;
|
||||
|
||||
int Compile::ConstantTable::calculate_table_base_offset() const {
|
||||
int ConstantTable::calculate_table_base_offset() const {
|
||||
return 0; // absolute addressing, no offset
|
||||
}
|
||||
|
||||
@ -814,13 +814,13 @@ void MachConstantBaseNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
|
||||
void MachPrologNode::format(PhaseRegAlloc* ra_, outputStream* st) const {
|
||||
Compile* C = ra_->C;
|
||||
|
||||
int framesize = C->frame_size_in_bytes();
|
||||
int bangsize = C->bang_size_in_bytes();
|
||||
int framesize = C->output()->frame_size_in_bytes();
|
||||
int bangsize = C->output()->bang_size_in_bytes();
|
||||
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
|
||||
// Remove wordSize for return addr which is already pushed.
|
||||
framesize -= wordSize;
|
||||
|
||||
if (C->need_stack_bang(bangsize)) {
|
||||
if (C->output()->need_stack_bang(bangsize)) {
|
||||
framesize -= wordSize;
|
||||
st->print("# stack bang (%d bytes)", bangsize);
|
||||
st->print("\n\t");
|
||||
@ -874,8 +874,8 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
Compile* C = ra_->C;
|
||||
MacroAssembler _masm(&cbuf);
|
||||
|
||||
int framesize = C->frame_size_in_bytes();
|
||||
int bangsize = C->bang_size_in_bytes();
|
||||
int framesize = C->output()->frame_size_in_bytes();
|
||||
int bangsize = C->output()->bang_size_in_bytes();
|
||||
|
||||
if (C->clinit_barrier_on_entry()) {
|
||||
assert(VM_Version::supports_fast_class_init_checks(), "sanity");
|
||||
@ -892,14 +892,14 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
|
||||
__ bind(L_skip_barrier);
|
||||
}
|
||||
|
||||
__ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, false, C->stub_function() != NULL);
|
||||
__ verified_entry(framesize, C->output()->need_stack_bang(bangsize)?bangsize:0, false, C->stub_function() != NULL);
|
||||
|
||||
C->set_frame_complete(cbuf.insts_size());
|
||||
C->output()->set_frame_complete(cbuf.insts_size());
|
||||
|
||||
if (C->has_mach_constant_base_node()) {
|
||||
// NOTE: We set the table base offset here because users might be
|
||||
// emitted before MachConstantBaseNode.
|
||||
Compile::ConstantTable& constant_table = C->constant_table();
|
||||
ConstantTable& constant_table = C->output()->constant_table();
|
||||
constant_table.set_table_base_offset(constant_table.calculate_table_base_offset());
|
||||
}
|
||||
}
|
||||
@ -925,7 +925,7 @@ void MachEpilogNode::format(PhaseRegAlloc* ra_, outputStream* st) const
|
||||
st->cr(); st->print("\t");
|
||||
}
|
||||
|
||||
int framesize = C->frame_size_in_bytes();
|
||||
int framesize = C->output()->frame_size_in_bytes();
|
||||
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
|
||||
// Remove word for return adr already pushed
|
||||
// and RBP
|
||||
@ -966,7 +966,7 @@ void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
|
||||
__ vzeroupper();
|
||||
}
|
||||
|
||||
int framesize = C->frame_size_in_bytes();
|
||||
int framesize = C->output()->frame_size_in_bytes();
|
||||
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
|
||||
// Remove word for return adr already pushed
|
||||
// and RBP
|
||||
@ -3120,7 +3120,7 @@ operand immL32()
|
||||
|
||||
operand immL_Pow2()
|
||||
%{
|
||||
predicate(is_power_of_2(n->get_long()));
|
||||
predicate(is_power_of_2((julong)n->get_long()));
|
||||
match(ConL);
|
||||
|
||||
op_cost(15);
|
||||
@ -3130,7 +3130,7 @@ operand immL_Pow2()
|
||||
|
||||
operand immL_NotPow2()
|
||||
%{
|
||||
predicate(is_power_of_2(~n->get_long()));
|
||||
predicate(is_power_of_2((julong)~n->get_long()));
|
||||
match(ConL);
|
||||
|
||||
op_cost(15);
|
||||
@ -10029,7 +10029,7 @@ instruct btsL_mem_imm(memory dst, immL_Pow2 con, rFlagsReg cr)
|
||||
ins_cost(125);
|
||||
format %{ "btsq $dst, log2($con)\t# long" %}
|
||||
ins_encode %{
|
||||
__ btsq($dst$$Address, log2_long($con$$constant));
|
||||
__ btsq($dst$$Address, log2_long((julong)$con$$constant));
|
||||
%}
|
||||
ins_pipe(ialu_mem_imm);
|
||||
%}
|
||||
|
@ -2649,7 +2649,7 @@ int os::java_to_os_priority[CriticalPriority + 1] = {
|
||||
static int prio_init() {
|
||||
if (ThreadPriorityPolicy == 1) {
|
||||
if (geteuid() != 0) {
|
||||
if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy)) {
|
||||
if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy) && !FLAG_IS_JIMAGE_RESOURCE(ThreadPriorityPolicy)) {
|
||||
warning("-XX:ThreadPriorityPolicy=1 may require system level permission, " \
|
||||
"e.g., being the root user. If the necessary permission is not " \
|
||||
"possessed, changes to priority will be silently ignored.");
|
||||
|
@ -2277,7 +2277,7 @@ int os::java_to_os_priority[CriticalPriority + 1] = {
|
||||
static int prio_init() {
|
||||
if (ThreadPriorityPolicy == 1) {
|
||||
if (geteuid() != 0) {
|
||||
if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy)) {
|
||||
if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy) && !FLAG_IS_JIMAGE_RESOURCE(ThreadPriorityPolicy)) {
|
||||
warning("-XX:ThreadPriorityPolicy=1 may require system level permission, " \
|
||||
"e.g., being the root user. If the necessary permission is not " \
|
||||
"possessed, changes to priority will be silently ignored.");
|
||||
|
@ -39,237 +39,34 @@ CgroupSubsystem* CgroupSubsystemFactory::create() {
|
||||
CgroupV1Controller* cpuset = NULL;
|
||||
CgroupV1Controller* cpu = NULL;
|
||||
CgroupV1Controller* cpuacct = NULL;
|
||||
FILE *mntinfo = NULL;
|
||||
FILE *cgroups = NULL;
|
||||
FILE *cgroup = NULL;
|
||||
char buf[MAXPATHLEN+1];
|
||||
char tmproot[MAXPATHLEN+1];
|
||||
char tmpmount[MAXPATHLEN+1];
|
||||
char *p;
|
||||
bool is_cgroupsV2;
|
||||
// true iff all controllers, memory, cpu, cpuset, cpuacct are enabled
|
||||
// at the kernel level.
|
||||
bool all_controllers_enabled;
|
||||
|
||||
CgroupInfo cg_infos[CG_INFO_LENGTH];
|
||||
int cpuset_idx = 0;
|
||||
int cpu_idx = 1;
|
||||
int cpuacct_idx = 2;
|
||||
int memory_idx = 3;
|
||||
u1 cg_type_flags = INVALID_CGROUPS_GENERIC;
|
||||
const char* proc_cgroups = "/proc/cgroups";
|
||||
const char* proc_self_cgroup = "/proc/self/cgroup";
|
||||
const char* proc_self_mountinfo = "/proc/self/mountinfo";
|
||||
|
||||
/*
|
||||
* Read /proc/cgroups so as to be able to distinguish cgroups v2 vs cgroups v1.
|
||||
*
|
||||
* For cgroups v1 unified hierarchy, cpu, cpuacct, cpuset, memory controllers
|
||||
* must have non-zero for the hierarchy ID field.
|
||||
*/
|
||||
cgroups = fopen("/proc/cgroups", "r");
|
||||
if (cgroups == NULL) {
|
||||
log_debug(os, container)("Can't open /proc/cgroups, %s",
|
||||
os::strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
bool valid_cgroup = determine_type(cg_infos, proc_cgroups, proc_self_cgroup, proc_self_mountinfo, &cg_type_flags);
|
||||
|
||||
while ((p = fgets(buf, MAXPATHLEN, cgroups)) != NULL) {
|
||||
char name[MAXPATHLEN+1];
|
||||
int hierarchy_id;
|
||||
int enabled;
|
||||
|
||||
// Format of /proc/cgroups documented via man 7 cgroups
|
||||
if (sscanf(p, "%s %d %*d %d", name, &hierarchy_id, &enabled) != 3) {
|
||||
continue;
|
||||
}
|
||||
if (strcmp(name, "memory") == 0) {
|
||||
cg_infos[memory_idx]._name = os::strdup(name);
|
||||
cg_infos[memory_idx]._hierarchy_id = hierarchy_id;
|
||||
cg_infos[memory_idx]._enabled = (enabled == 1);
|
||||
} else if (strcmp(name, "cpuset") == 0) {
|
||||
cg_infos[cpuset_idx]._name = os::strdup(name);
|
||||
cg_infos[cpuset_idx]._hierarchy_id = hierarchy_id;
|
||||
cg_infos[cpuset_idx]._enabled = (enabled == 1);
|
||||
} else if (strcmp(name, "cpu") == 0) {
|
||||
cg_infos[cpu_idx]._name = os::strdup(name);
|
||||
cg_infos[cpu_idx]._hierarchy_id = hierarchy_id;
|
||||
cg_infos[cpu_idx]._enabled = (enabled == 1);
|
||||
} else if (strcmp(name, "cpuacct") == 0) {
|
||||
cg_infos[cpuacct_idx]._name = os::strdup(name);
|
||||
cg_infos[cpuacct_idx]._hierarchy_id = hierarchy_id;
|
||||
cg_infos[cpuacct_idx]._enabled = (enabled == 1);
|
||||
}
|
||||
}
|
||||
fclose(cgroups);
|
||||
|
||||
is_cgroupsV2 = true;
|
||||
all_controllers_enabled = true;
|
||||
for (int i = 0; i < CG_INFO_LENGTH; i++) {
|
||||
is_cgroupsV2 = is_cgroupsV2 && cg_infos[i]._hierarchy_id == 0;
|
||||
all_controllers_enabled = all_controllers_enabled && cg_infos[i]._enabled;
|
||||
}
|
||||
|
||||
if (!all_controllers_enabled) {
|
||||
// one or more controllers disabled, disable container support
|
||||
log_debug(os, container)("One or more required controllers disabled at kernel level.");
|
||||
if (!valid_cgroup) {
|
||||
// Could not detect cgroup type
|
||||
return NULL;
|
||||
}
|
||||
assert(is_valid_cgroup(&cg_type_flags), "Expected valid cgroup type");
|
||||
|
||||
/*
|
||||
* Read /proc/self/cgroup and determine:
|
||||
* - the cgroup path for cgroups v2 or
|
||||
* - on a cgroups v1 system, collect info for mapping
|
||||
* the host mount point to the local one via /proc/self/mountinfo below.
|
||||
*/
|
||||
cgroup = fopen("/proc/self/cgroup", "r");
|
||||
if (cgroup == NULL) {
|
||||
log_debug(os, container)("Can't open /proc/self/cgroup, %s",
|
||||
os::strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while ((p = fgets(buf, MAXPATHLEN, cgroup)) != NULL) {
|
||||
char *controllers;
|
||||
char *token;
|
||||
char *hierarchy_id_str;
|
||||
int hierarchy_id;
|
||||
char *cgroup_path;
|
||||
|
||||
hierarchy_id_str = strsep(&p, ":");
|
||||
hierarchy_id = atoi(hierarchy_id_str);
|
||||
/* Get controllers and base */
|
||||
controllers = strsep(&p, ":");
|
||||
cgroup_path = strsep(&p, "\n");
|
||||
|
||||
if (controllers == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
while (!is_cgroupsV2 && (token = strsep(&controllers, ",")) != NULL) {
|
||||
if (strcmp(token, "memory") == 0) {
|
||||
assert(hierarchy_id == cg_infos[memory_idx]._hierarchy_id, "/proc/cgroups and /proc/self/cgroup hierarchy mismatch");
|
||||
cg_infos[memory_idx]._cgroup_path = os::strdup(cgroup_path);
|
||||
} else if (strcmp(token, "cpuset") == 0) {
|
||||
assert(hierarchy_id == cg_infos[cpuset_idx]._hierarchy_id, "/proc/cgroups and /proc/self/cgroup hierarchy mismatch");
|
||||
cg_infos[cpuset_idx]._cgroup_path = os::strdup(cgroup_path);
|
||||
} else if (strcmp(token, "cpu") == 0) {
|
||||
assert(hierarchy_id == cg_infos[cpu_idx]._hierarchy_id, "/proc/cgroups and /proc/self/cgroup hierarchy mismatch");
|
||||
cg_infos[cpu_idx]._cgroup_path = os::strdup(cgroup_path);
|
||||
} else if (strcmp(token, "cpuacct") == 0) {
|
||||
assert(hierarchy_id == cg_infos[cpuacct_idx]._hierarchy_id, "/proc/cgroups and /proc/self/cgroup hierarchy mismatch");
|
||||
cg_infos[cpuacct_idx]._cgroup_path = os::strdup(cgroup_path);
|
||||
}
|
||||
}
|
||||
if (is_cgroupsV2) {
|
||||
for (int i = 0; i < CG_INFO_LENGTH; i++) {
|
||||
cg_infos[i]._cgroup_path = os::strdup(cgroup_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(cgroup);
|
||||
|
||||
if (is_cgroupsV2) {
|
||||
// Find the cgroup2 mount point by reading /proc/self/mountinfo
|
||||
mntinfo = fopen("/proc/self/mountinfo", "r");
|
||||
if (mntinfo == NULL) {
|
||||
log_debug(os, container)("Can't open /proc/self/mountinfo, %s",
|
||||
os::strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char cgroupv2_mount[MAXPATHLEN+1];
|
||||
char fstype[MAXPATHLEN+1];
|
||||
bool mount_point_found = false;
|
||||
while ((p = fgets(buf, MAXPATHLEN, mntinfo)) != NULL) {
|
||||
char *tmp_mount_point = cgroupv2_mount;
|
||||
char *tmp_fs_type = fstype;
|
||||
|
||||
// mountinfo format is documented at https://www.kernel.org/doc/Documentation/filesystems/proc.txt
|
||||
if (sscanf(p, "%*d %*d %*d:%*d %*s %s %*[^-]- %s cgroup2 %*s", tmp_mount_point, tmp_fs_type) == 2) {
|
||||
// we likely have an early match return, be sure we have cgroup2 as fstype
|
||||
if (strcmp("cgroup2", tmp_fs_type) == 0) {
|
||||
mount_point_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(mntinfo);
|
||||
if (!mount_point_found) {
|
||||
log_trace(os, container)("Mount point for cgroupv2 not found in /proc/self/mountinfo");
|
||||
return NULL;
|
||||
}
|
||||
if (is_cgroup_v2(&cg_type_flags)) {
|
||||
// Cgroups v2 case, we have all the info we need.
|
||||
// Construct the subsystem, free resources and return
|
||||
// Note: any index in cg_infos will do as the path is the same for
|
||||
// all controllers.
|
||||
CgroupController* unified = new CgroupV2Controller(cgroupv2_mount, cg_infos[memory_idx]._cgroup_path);
|
||||
for (int i = 0; i < CG_INFO_LENGTH; i++) {
|
||||
os::free(cg_infos[i]._name);
|
||||
os::free(cg_infos[i]._cgroup_path);
|
||||
}
|
||||
CgroupController* unified = new CgroupV2Controller(cg_infos[MEMORY_IDX]._mount_path, cg_infos[MEMORY_IDX]._cgroup_path);
|
||||
log_debug(os, container)("Detected cgroups v2 unified hierarchy");
|
||||
cleanup(cg_infos);
|
||||
return new CgroupV2Subsystem(unified);
|
||||
}
|
||||
|
||||
// What follows is cgroups v1
|
||||
log_debug(os, container)("Detected cgroups hybrid or legacy hierarchy, using cgroups v1 controllers");
|
||||
|
||||
/*
|
||||
* Find the cgroup mount point for memory and cpuset
|
||||
* by reading /proc/self/mountinfo
|
||||
* Cgroup v1 case:
|
||||
*
|
||||
* Example for docker:
|
||||
* 219 214 0:29 /docker/7208cebd00fa5f2e342b1094f7bed87fa25661471a4637118e65f1c995be8a34 /sys/fs/cgroup/memory ro,nosuid,nodev,noexec,relatime - cgroup cgroup rw,memory
|
||||
*
|
||||
* Example for host:
|
||||
* 34 28 0:29 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:16 - cgroup cgroup rw,memory
|
||||
*/
|
||||
mntinfo = fopen("/proc/self/mountinfo", "r");
|
||||
if (mntinfo == NULL) {
|
||||
log_debug(os, container)("Can't open /proc/self/mountinfo, %s",
|
||||
os::strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while ((p = fgets(buf, MAXPATHLEN, mntinfo)) != NULL) {
|
||||
char tmpcgroups[MAXPATHLEN+1];
|
||||
char *cptr = tmpcgroups;
|
||||
char *token;
|
||||
|
||||
// mountinfo format is documented at https://www.kernel.org/doc/Documentation/filesystems/proc.txt
|
||||
if (sscanf(p, "%*d %*d %*d:%*d %s %s %*[^-]- cgroup %*s %s", tmproot, tmpmount, tmpcgroups) != 3) {
|
||||
continue;
|
||||
}
|
||||
while ((token = strsep(&cptr, ",")) != NULL) {
|
||||
if (strcmp(token, "memory") == 0) {
|
||||
memory = new CgroupV1MemoryController(tmproot, tmpmount);
|
||||
} else if (strcmp(token, "cpuset") == 0) {
|
||||
cpuset = new CgroupV1Controller(tmproot, tmpmount);
|
||||
} else if (strcmp(token, "cpu") == 0) {
|
||||
cpu = new CgroupV1Controller(tmproot, tmpmount);
|
||||
} else if (strcmp(token, "cpuacct") == 0) {
|
||||
cpuacct= new CgroupV1Controller(tmproot, tmpmount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fclose(mntinfo);
|
||||
|
||||
if (memory == NULL) {
|
||||
log_debug(os, container)("Required cgroup v1 memory subsystem not found");
|
||||
return NULL;
|
||||
}
|
||||
if (cpuset == NULL) {
|
||||
log_debug(os, container)("Required cgroup v1 cpuset subsystem not found");
|
||||
return NULL;
|
||||
}
|
||||
if (cpu == NULL) {
|
||||
log_debug(os, container)("Required cgroup v1 cpu subsystem not found");
|
||||
return NULL;
|
||||
}
|
||||
if (cpuacct == NULL) {
|
||||
log_debug(os, container)("Required cgroup v1 cpuacct subsystem not found");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Use info gathered previously from /proc/self/cgroup
|
||||
* and map host mount point to
|
||||
* local one via /proc/self/mountinfo content above
|
||||
@ -293,21 +90,302 @@ CgroupSubsystem* CgroupSubsystemFactory::create() {
|
||||
* /sys/fs/cgroup/memory/user.slice
|
||||
*
|
||||
*/
|
||||
assert(is_cgroup_v1(&cg_type_flags), "Cgroup v1 expected");
|
||||
for (int i = 0; i < CG_INFO_LENGTH; i++) {
|
||||
CgroupInfo info = cg_infos[i];
|
||||
if (strcmp(info._name, "memory") == 0) {
|
||||
memory = new CgroupV1MemoryController(info._root_mount_path, info._mount_path);
|
||||
memory->set_subsystem_path(info._cgroup_path);
|
||||
} else if (strcmp(info._name, "cpuset") == 0) {
|
||||
cpuset = new CgroupV1Controller(info._root_mount_path, info._mount_path);
|
||||
cpuset->set_subsystem_path(info._cgroup_path);
|
||||
} else if (strcmp(info._name, "cpu") == 0) {
|
||||
cpu = new CgroupV1Controller(info._root_mount_path, info._mount_path);
|
||||
cpu->set_subsystem_path(info._cgroup_path);
|
||||
} else if (strcmp(info._name, "cpuacct") == 0) {
|
||||
cpuacct = new CgroupV1Controller(info._root_mount_path, info._mount_path);
|
||||
cpuacct->set_subsystem_path(info._cgroup_path);
|
||||
}
|
||||
}
|
||||
cleanup(cg_infos);
|
||||
return new CgroupV1Subsystem(cpuset, cpu, cpuacct, memory);
|
||||
}
|
||||
|
||||
bool CgroupSubsystemFactory::determine_type(CgroupInfo* cg_infos,
|
||||
const char* proc_cgroups,
|
||||
const char* proc_self_cgroup,
|
||||
const char* proc_self_mountinfo,
|
||||
u1* flags) {
|
||||
FILE *mntinfo = NULL;
|
||||
FILE *cgroups = NULL;
|
||||
FILE *cgroup = NULL;
|
||||
char buf[MAXPATHLEN+1];
|
||||
char *p;
|
||||
bool is_cgroupsV2;
|
||||
// true iff all controllers, memory, cpu, cpuset, cpuacct are enabled
|
||||
// at the kernel level.
|
||||
bool all_controllers_enabled;
|
||||
|
||||
/*
|
||||
* Read /proc/cgroups so as to be able to distinguish cgroups v2 vs cgroups v1.
|
||||
*
|
||||
* For cgroups v1 hierarchy (hybrid or legacy), cpu, cpuacct, cpuset, memory controllers
|
||||
* must have non-zero for the hierarchy ID field and relevant controllers mounted.
|
||||
* Conversely, for cgroups v2 (unified hierarchy), cpu, cpuacct, cpuset, memory
|
||||
* controllers must have hierarchy ID 0 and the unified controller mounted.
|
||||
*/
|
||||
cgroups = fopen(proc_cgroups, "r");
|
||||
if (cgroups == NULL) {
|
||||
log_debug(os, container)("Can't open %s, %s",
|
||||
proc_cgroups, os::strerror(errno));
|
||||
*flags = INVALID_CGROUPS_GENERIC;
|
||||
return false;
|
||||
}
|
||||
|
||||
while ((p = fgets(buf, MAXPATHLEN, cgroups)) != NULL) {
|
||||
char name[MAXPATHLEN+1];
|
||||
int hierarchy_id;
|
||||
int enabled;
|
||||
|
||||
// Format of /proc/cgroups documented via man 7 cgroups
|
||||
if (sscanf(p, "%s %d %*d %d", name, &hierarchy_id, &enabled) != 3) {
|
||||
continue;
|
||||
}
|
||||
if (strcmp(name, "memory") == 0) {
|
||||
cg_infos[MEMORY_IDX]._name = os::strdup(name);
|
||||
cg_infos[MEMORY_IDX]._hierarchy_id = hierarchy_id;
|
||||
cg_infos[MEMORY_IDX]._enabled = (enabled == 1);
|
||||
} else if (strcmp(name, "cpuset") == 0) {
|
||||
cg_infos[CPUSET_IDX]._name = os::strdup(name);
|
||||
cg_infos[CPUSET_IDX]._hierarchy_id = hierarchy_id;
|
||||
cg_infos[CPUSET_IDX]._enabled = (enabled == 1);
|
||||
} else if (strcmp(name, "cpu") == 0) {
|
||||
cg_infos[CPU_IDX]._name = os::strdup(name);
|
||||
cg_infos[CPU_IDX]._hierarchy_id = hierarchy_id;
|
||||
cg_infos[CPU_IDX]._enabled = (enabled == 1);
|
||||
} else if (strcmp(name, "cpuacct") == 0) {
|
||||
cg_infos[CPUACCT_IDX]._name = os::strdup(name);
|
||||
cg_infos[CPUACCT_IDX]._hierarchy_id = hierarchy_id;
|
||||
cg_infos[CPUACCT_IDX]._enabled = (enabled == 1);
|
||||
}
|
||||
}
|
||||
fclose(cgroups);
|
||||
|
||||
is_cgroupsV2 = true;
|
||||
all_controllers_enabled = true;
|
||||
for (int i = 0; i < CG_INFO_LENGTH; i++) {
|
||||
is_cgroupsV2 = is_cgroupsV2 && cg_infos[i]._hierarchy_id == 0;
|
||||
all_controllers_enabled = all_controllers_enabled && cg_infos[i]._enabled;
|
||||
}
|
||||
|
||||
if (!all_controllers_enabled) {
|
||||
// one or more controllers disabled, disable container support
|
||||
log_debug(os, container)("One or more required controllers disabled at kernel level.");
|
||||
cleanup(cg_infos);
|
||||
*flags = INVALID_CGROUPS_GENERIC;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read /proc/self/cgroup and determine:
|
||||
* - the cgroup path for cgroups v2 or
|
||||
* - on a cgroups v1 system, collect info for mapping
|
||||
* the host mount point to the local one via /proc/self/mountinfo below.
|
||||
*/
|
||||
cgroup = fopen(proc_self_cgroup, "r");
|
||||
if (cgroup == NULL) {
|
||||
log_debug(os, container)("Can't open %s, %s",
|
||||
proc_self_cgroup, os::strerror(errno));
|
||||
cleanup(cg_infos);
|
||||
*flags = INVALID_CGROUPS_GENERIC;
|
||||
return false;
|
||||
}
|
||||
|
||||
while ((p = fgets(buf, MAXPATHLEN, cgroup)) != NULL) {
|
||||
char *controllers;
|
||||
char *token;
|
||||
char *hierarchy_id_str;
|
||||
int hierarchy_id;
|
||||
char *cgroup_path;
|
||||
|
||||
hierarchy_id_str = strsep(&p, ":");
|
||||
hierarchy_id = atoi(hierarchy_id_str);
|
||||
/* Get controllers and base */
|
||||
controllers = strsep(&p, ":");
|
||||
cgroup_path = strsep(&p, "\n");
|
||||
|
||||
if (controllers == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
while (!is_cgroupsV2 && (token = strsep(&controllers, ",")) != NULL) {
|
||||
if (strcmp(token, "memory") == 0) {
|
||||
assert(hierarchy_id == cg_infos[MEMORY_IDX]._hierarchy_id, "/proc/cgroups and /proc/self/cgroup hierarchy mismatch");
|
||||
cg_infos[MEMORY_IDX]._cgroup_path = os::strdup(cgroup_path);
|
||||
} else if (strcmp(token, "cpuset") == 0) {
|
||||
assert(hierarchy_id == cg_infos[CPUSET_IDX]._hierarchy_id, "/proc/cgroups and /proc/self/cgroup hierarchy mismatch");
|
||||
cg_infos[CPUSET_IDX]._cgroup_path = os::strdup(cgroup_path);
|
||||
} else if (strcmp(token, "cpu") == 0) {
|
||||
assert(hierarchy_id == cg_infos[CPU_IDX]._hierarchy_id, "/proc/cgroups and /proc/self/cgroup hierarchy mismatch");
|
||||
cg_infos[CPU_IDX]._cgroup_path = os::strdup(cgroup_path);
|
||||
} else if (strcmp(token, "cpuacct") == 0) {
|
||||
assert(hierarchy_id == cg_infos[CPUACCT_IDX]._hierarchy_id, "/proc/cgroups and /proc/self/cgroup hierarchy mismatch");
|
||||
cg_infos[CPUACCT_IDX]._cgroup_path = os::strdup(cgroup_path);
|
||||
}
|
||||
}
|
||||
if (is_cgroupsV2) {
|
||||
for (int i = 0; i < CG_INFO_LENGTH; i++) {
|
||||
cg_infos[i]._cgroup_path = os::strdup(cgroup_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(cgroup);
|
||||
|
||||
// Find various mount points by reading /proc/self/mountinfo
|
||||
// mountinfo format is documented at https://www.kernel.org/doc/Documentation/filesystems/proc.txt
|
||||
mntinfo = fopen(proc_self_mountinfo, "r");
|
||||
if (mntinfo == NULL) {
|
||||
log_debug(os, container)("Can't open %s, %s",
|
||||
proc_self_mountinfo, os::strerror(errno));
|
||||
cleanup(cg_infos);
|
||||
*flags = INVALID_CGROUPS_GENERIC;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cgroupv2_mount_point_found = false;
|
||||
bool any_cgroup_mounts_found = false;
|
||||
while ((p = fgets(buf, MAXPATHLEN, mntinfo)) != NULL) {
|
||||
char tmp_mount_point[MAXPATHLEN+1];
|
||||
char tmp_fs_type[MAXPATHLEN+1];
|
||||
char tmproot[MAXPATHLEN+1];
|
||||
char tmpmount[MAXPATHLEN+1];
|
||||
char tmpcgroups[MAXPATHLEN+1];
|
||||
char *cptr = tmpcgroups;
|
||||
char *token;
|
||||
|
||||
// Cgroup v2 relevant info. We only look for the _mount_path iff is_cgroupsV2 so
|
||||
// as to avoid memory stomping of the _mount_path pointer later on in the cgroup v1
|
||||
// block in the hybrid case.
|
||||
//
|
||||
if (is_cgroupsV2 && sscanf(p, "%*d %*d %*d:%*d %*s %s %*[^-]- %s cgroup2 %*s", tmp_mount_point, tmp_fs_type) == 2) {
|
||||
// we likely have an early match return (e.g. cgroup fs match), be sure we have cgroup2 as fstype
|
||||
if (!cgroupv2_mount_point_found && strcmp("cgroup2", tmp_fs_type) == 0) {
|
||||
cgroupv2_mount_point_found = true;
|
||||
any_cgroup_mounts_found = true;
|
||||
for (int i = 0; i < CG_INFO_LENGTH; i++) {
|
||||
assert(cg_infos[i]._mount_path == NULL, "_mount_path memory stomping");
|
||||
cg_infos[i]._mount_path = os::strdup(tmp_mount_point);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Cgroup v1 relevant info
|
||||
*
|
||||
* Find the cgroup mount point for memory, cpuset, cpu, cpuacct
|
||||
*
|
||||
* Example for docker:
|
||||
* 219 214 0:29 /docker/7208cebd00fa5f2e342b1094f7bed87fa25661471a4637118e65f1c995be8a34 /sys/fs/cgroup/memory ro,nosuid,nodev,noexec,relatime - cgroup cgroup rw,memory
|
||||
*
|
||||
* Example for host:
|
||||
* 34 28 0:29 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:16 - cgroup cgroup rw,memory
|
||||
*/
|
||||
if (sscanf(p, "%*d %*d %*d:%*d %s %s %*[^-]- %s cgroup %s", tmproot, tmpmount, tmp_fs_type, tmpcgroups) == 4) {
|
||||
if (strcmp("cgroup", tmp_fs_type) != 0) {
|
||||
// Skip cgroup2 fs lines on hybrid or unified hierarchy.
|
||||
continue;
|
||||
}
|
||||
any_cgroup_mounts_found = true;
|
||||
while ((token = strsep(&cptr, ",")) != NULL) {
|
||||
if (strcmp(token, "memory") == 0) {
|
||||
assert(cg_infos[MEMORY_IDX]._mount_path == NULL, "stomping of _mount_path");
|
||||
cg_infos[MEMORY_IDX]._mount_path = os::strdup(tmpmount);
|
||||
cg_infos[MEMORY_IDX]._root_mount_path = os::strdup(tmproot);
|
||||
cg_infos[MEMORY_IDX]._data_complete = true;
|
||||
} else if (strcmp(token, "cpuset") == 0) {
|
||||
assert(cg_infos[CPUSET_IDX]._mount_path == NULL, "stomping of _mount_path");
|
||||
cg_infos[CPUSET_IDX]._mount_path = os::strdup(tmpmount);
|
||||
cg_infos[CPUSET_IDX]._root_mount_path = os::strdup(tmproot);
|
||||
cg_infos[CPUSET_IDX]._data_complete = true;
|
||||
} else if (strcmp(token, "cpu") == 0) {
|
||||
assert(cg_infos[CPU_IDX]._mount_path == NULL, "stomping of _mount_path");
|
||||
cg_infos[CPU_IDX]._mount_path = os::strdup(tmpmount);
|
||||
cg_infos[CPU_IDX]._root_mount_path = os::strdup(tmproot);
|
||||
cg_infos[CPU_IDX]._data_complete = true;
|
||||
} else if (strcmp(token, "cpuacct") == 0) {
|
||||
assert(cg_infos[CPUACCT_IDX]._mount_path == NULL, "stomping of _mount_path");
|
||||
cg_infos[CPUACCT_IDX]._mount_path = os::strdup(tmpmount);
|
||||
cg_infos[CPUACCT_IDX]._root_mount_path = os::strdup(tmproot);
|
||||
cg_infos[CPUACCT_IDX]._data_complete = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fclose(mntinfo);
|
||||
|
||||
// Neither cgroup2 nor cgroup filesystems mounted via /proc/self/mountinfo
|
||||
// No point in continuing.
|
||||
if (!any_cgroup_mounts_found) {
|
||||
log_trace(os, container)("No cgroup controllers mounted.");
|
||||
cleanup(cg_infos);
|
||||
*flags = INVALID_CGROUPS_NO_MOUNT;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_cgroupsV2) {
|
||||
if (!cgroupv2_mount_point_found) {
|
||||
log_trace(os, container)("Mount point for cgroupv2 not found in /proc/self/mountinfo");
|
||||
cleanup(cg_infos);
|
||||
*flags = INVALID_CGROUPS_V2;
|
||||
return false;
|
||||
}
|
||||
// Cgroups v2 case, we have all the info we need.
|
||||
*flags = CGROUPS_V2;
|
||||
return true;
|
||||
}
|
||||
|
||||
// What follows is cgroups v1
|
||||
log_debug(os, container)("Detected cgroups hybrid or legacy hierarchy, using cgroups v1 controllers");
|
||||
|
||||
if (!cg_infos[MEMORY_IDX]._data_complete) {
|
||||
log_debug(os, container)("Required cgroup v1 memory subsystem not found");
|
||||
cleanup(cg_infos);
|
||||
*flags = INVALID_CGROUPS_V1;
|
||||
return false;
|
||||
}
|
||||
if (!cg_infos[CPUSET_IDX]._data_complete) {
|
||||
log_debug(os, container)("Required cgroup v1 cpuset subsystem not found");
|
||||
cleanup(cg_infos);
|
||||
*flags = INVALID_CGROUPS_V1;
|
||||
return false;
|
||||
}
|
||||
if (!cg_infos[CPU_IDX]._data_complete) {
|
||||
log_debug(os, container)("Required cgroup v1 cpu subsystem not found");
|
||||
cleanup(cg_infos);
|
||||
*flags = INVALID_CGROUPS_V1;
|
||||
return false;
|
||||
}
|
||||
if (!cg_infos[CPUACCT_IDX]._data_complete) {
|
||||
log_debug(os, container)("Required cgroup v1 cpuacct subsystem not found");
|
||||
cleanup(cg_infos);
|
||||
*flags = INVALID_CGROUPS_V1;
|
||||
return false;
|
||||
}
|
||||
// Cgroups v1 case, we have all the info we need.
|
||||
*flags = CGROUPS_V1;
|
||||
return true;
|
||||
|
||||
};
|
||||
|
||||
void CgroupSubsystemFactory::cleanup(CgroupInfo* cg_infos) {
|
||||
assert(cg_infos != NULL, "Invariant");
|
||||
for (int i = 0; i < CG_INFO_LENGTH; i++) {
|
||||
os::free(cg_infos[i]._name);
|
||||
os::free(cg_infos[i]._cgroup_path);
|
||||
os::free(cg_infos[i]._root_mount_path);
|
||||
os::free(cg_infos[i]._mount_path);
|
||||
}
|
||||
}
|
||||
|
||||
/* active_processor_count
|
||||
*
|
||||
* Calculate an appropriate number of active processors for the
|
||||
|
@ -54,6 +54,20 @@
|
||||
*/
|
||||
#define PER_CPU_SHARES 1024
|
||||
|
||||
#define CGROUPS_V1 1
|
||||
#define CGROUPS_V2 2
|
||||
#define INVALID_CGROUPS_V2 3
|
||||
#define INVALID_CGROUPS_V1 4
|
||||
#define INVALID_CGROUPS_NO_MOUNT 5
|
||||
#define INVALID_CGROUPS_GENERIC 6
|
||||
|
||||
// Four controllers: cpu, cpuset, cpuacct, memory
|
||||
#define CG_INFO_LENGTH 4
|
||||
#define CPUSET_IDX 0
|
||||
#define CPU_IDX 1
|
||||
#define CPUACCT_IDX 2
|
||||
#define MEMORY_IDX 3
|
||||
|
||||
typedef char * cptr;
|
||||
|
||||
class CgroupController: public CHeapObj<mtInternal> {
|
||||
@ -180,8 +194,6 @@ PRAGMA_DIAG_POP
|
||||
log_trace(os, container)(logstring, variable); \
|
||||
}
|
||||
|
||||
// Four controllers: cpu, cpuset, cpuacct, memory
|
||||
#define CG_INFO_LENGTH 4
|
||||
|
||||
class CachedMetric : public CHeapObj<mtInternal>{
|
||||
private:
|
||||
@ -242,23 +254,62 @@ class CgroupSubsystem: public CHeapObj<mtInternal> {
|
||||
virtual CachingCgroupController* cpu_controller() = 0;
|
||||
};
|
||||
|
||||
class CgroupSubsystemFactory: AllStatic {
|
||||
public:
|
||||
static CgroupSubsystem* create();
|
||||
};
|
||||
|
||||
// Class representing info in /proc/self/cgroup.
|
||||
// See man 7 cgroups
|
||||
// Utility class for storing info retrieved from /proc/cgroups,
|
||||
// /proc/self/cgroup and /proc/self/mountinfo
|
||||
// For reference see man 7 cgroups and CgroupSubsystemFactory
|
||||
class CgroupInfo : public StackObj {
|
||||
friend class CgroupSubsystemFactory;
|
||||
friend class WhiteBox;
|
||||
|
||||
private:
|
||||
char* _name;
|
||||
int _hierarchy_id;
|
||||
bool _enabled;
|
||||
char* _cgroup_path;
|
||||
char* _name;
|
||||
int _hierarchy_id;
|
||||
bool _enabled;
|
||||
bool _data_complete; // indicating cgroup v1 data is complete for this controller
|
||||
char* _cgroup_path; // cgroup controller path from /proc/self/cgroup
|
||||
char* _root_mount_path; // root mount path from /proc/self/mountinfo. Unused for cgroup v2
|
||||
char* _mount_path; // mount path from /proc/self/mountinfo.
|
||||
|
||||
public:
|
||||
CgroupInfo() {
|
||||
_name = NULL;
|
||||
_hierarchy_id = -1;
|
||||
_enabled = false;
|
||||
_data_complete = false;
|
||||
_cgroup_path = NULL;
|
||||
_root_mount_path = NULL;
|
||||
_mount_path = NULL;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class CgroupSubsystemFactory: AllStatic {
|
||||
friend class WhiteBox;
|
||||
|
||||
public:
|
||||
static CgroupSubsystem* create();
|
||||
private:
|
||||
static inline bool is_cgroup_v2(u1* flags) {
|
||||
return *flags == CGROUPS_V2;
|
||||
}
|
||||
|
||||
#ifdef ASSERT
|
||||
static inline bool is_valid_cgroup(u1* flags) {
|
||||
return *flags == CGROUPS_V1 || *flags == CGROUPS_V2;
|
||||
}
|
||||
static inline bool is_cgroup_v1(u1* flags) {
|
||||
return *flags == CGROUPS_V1;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Determine the cgroup type (version 1 or version 2), given
|
||||
// relevant paths to files. Sets 'flags' accordingly.
|
||||
static bool determine_type(CgroupInfo* cg_infos,
|
||||
const char* proc_cgroups,
|
||||
const char* proc_self_cgroup,
|
||||
const char* proc_self_mountinfo,
|
||||
u1* flags);
|
||||
static void cleanup(CgroupInfo* cg_infos);
|
||||
};
|
||||
|
||||
#endif // CGROUP_SUBSYSTEM_LINUX_HPP
|
||||
|
@ -2302,6 +2302,19 @@ void os::Linux::print_full_memory_info(outputStream* st) {
|
||||
st->print("\n/proc/meminfo:\n");
|
||||
_print_ascii_file("/proc/meminfo", st);
|
||||
st->cr();
|
||||
|
||||
// some information regarding THPs; for details see
|
||||
// https://www.kernel.org/doc/Documentation/vm/transhuge.txt
|
||||
st->print_cr("/sys/kernel/mm/transparent_hugepage/enabled:");
|
||||
if (!_print_ascii_file("/sys/kernel/mm/transparent_hugepage/enabled", st)) {
|
||||
st->print_cr(" <Not Available>");
|
||||
}
|
||||
st->cr();
|
||||
st->print_cr("/sys/kernel/mm/transparent_hugepage/defrag (defrag/compaction efforts parameter):");
|
||||
if (!_print_ascii_file("/sys/kernel/mm/transparent_hugepage/defrag", st)) {
|
||||
st->print_cr(" <Not Available>");
|
||||
}
|
||||
st->cr();
|
||||
}
|
||||
|
||||
void os::Linux::print_ld_preload_file(outputStream* st) {
|
||||
@ -4319,7 +4332,7 @@ int os::java_to_os_priority[CriticalPriority + 1] = {
|
||||
static int prio_init() {
|
||||
if (ThreadPriorityPolicy == 1) {
|
||||
if (geteuid() != 0) {
|
||||
if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy)) {
|
||||
if (!FLAG_IS_DEFAULT(ThreadPriorityPolicy) && !FLAG_IS_JIMAGE_RESOURCE(ThreadPriorityPolicy)) {
|
||||
warning("-XX:ThreadPriorityPolicy=1 may require system level permission, " \
|
||||
"e.g., being the root user. If the necessary permission is not " \
|
||||
"possessed, changes to priority will be silently ignored.");
|
||||
|
@ -4161,98 +4161,121 @@ static void file_attribute_data_to_stat(struct stat* sbuf, WIN32_FILE_ATTRIBUTE_
|
||||
}
|
||||
}
|
||||
|
||||
static errno_t convert_to_unicode(char const* char_path, LPWSTR* unicode_path) {
|
||||
// Get required buffer size to convert to Unicode
|
||||
int unicode_path_len = MultiByteToWideChar(CP_THREAD_ACP,
|
||||
MB_ERR_INVALID_CHARS,
|
||||
char_path, -1,
|
||||
NULL, 0);
|
||||
if (unicode_path_len == 0) {
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
*unicode_path = NEW_C_HEAP_ARRAY(WCHAR, unicode_path_len, mtInternal);
|
||||
|
||||
int result = MultiByteToWideChar(CP_THREAD_ACP,
|
||||
MB_ERR_INVALID_CHARS,
|
||||
char_path, -1,
|
||||
*unicode_path, unicode_path_len);
|
||||
assert(result == unicode_path_len, "length already checked above");
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static errno_t get_full_path(LPCWSTR unicode_path, LPWSTR* full_path) {
|
||||
// Get required buffer size to convert to full path. The return
|
||||
// value INCLUDES the terminating null character.
|
||||
DWORD full_path_len = GetFullPathNameW(unicode_path, 0, NULL, NULL);
|
||||
if (full_path_len == 0) {
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
*full_path = NEW_C_HEAP_ARRAY(WCHAR, full_path_len, mtInternal);
|
||||
|
||||
// When the buffer has sufficient size, the return value EXCLUDES the
|
||||
// terminating null character
|
||||
DWORD result = GetFullPathNameW(unicode_path, full_path_len, *full_path, NULL);
|
||||
assert(result <= full_path_len, "length already checked above");
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static void set_path_prefix(char* buf, LPWSTR* prefix, int* prefix_off, bool* needs_fullpath) {
|
||||
*prefix_off = 0;
|
||||
*needs_fullpath = true;
|
||||
|
||||
if (::isalpha(buf[0]) && !::IsDBCSLeadByte(buf[0]) && buf[1] == ':' && buf[2] == '\\') {
|
||||
*prefix = L"\\\\?\\";
|
||||
} else if (buf[0] == '\\' && buf[1] == '\\') {
|
||||
if (buf[2] == '?' && buf[3] == '\\') {
|
||||
*prefix = L"";
|
||||
*needs_fullpath = false;
|
||||
} else {
|
||||
*prefix = L"\\\\?\\UNC";
|
||||
*prefix_off = 1; // Overwrite the first char with the prefix, so \\share\path becomes \\?\UNC\share\path
|
||||
}
|
||||
} else {
|
||||
*prefix = L"\\\\?\\";
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the given path as an absolute wide path in unc format. The returned path is NULL
|
||||
// on error (with err being set accordingly) and should be freed via os::free() otherwise.
|
||||
// additional_space is the number of additionally allocated wchars after the terminating L'\0'.
|
||||
// This is based on pathToNTPath() in io_util_md.cpp, but omits the optimizations for
|
||||
// short paths.
|
||||
// additional_space is the size of space, in wchar_t, the function will additionally add to
|
||||
// the allocation of return buffer (such that the size of the returned buffer is at least
|
||||
// wcslen(buf) + 1 + additional_space).
|
||||
static wchar_t* wide_abs_unc_path(char const* path, errno_t & err, int additional_space = 0) {
|
||||
if ((path == NULL) || (path[0] == '\0')) {
|
||||
err = ENOENT;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t path_len = strlen(path);
|
||||
// Need to allocate at least room for 3 characters, since os::native_path transforms C: to C:.
|
||||
char* buf = (char*) os::malloc(1 + MAX2((size_t) 3, path_len), mtInternal);
|
||||
wchar_t* result = NULL;
|
||||
size_t buf_len = 1 + MAX2((size_t)3, strlen(path));
|
||||
char* buf = NEW_C_HEAP_ARRAY(char, buf_len, mtInternal);
|
||||
strncpy(buf, path, buf_len);
|
||||
os::native_path(buf);
|
||||
|
||||
if (buf == NULL) {
|
||||
err = ENOMEM;
|
||||
} else {
|
||||
memcpy(buf, path, path_len + 1);
|
||||
os::native_path(buf);
|
||||
|
||||
wchar_t* prefix;
|
||||
int prefix_off = 0;
|
||||
bool is_abs = true;
|
||||
bool needs_fullpath = true;
|
||||
|
||||
if (::isalpha(buf[0]) && !::IsDBCSLeadByte(buf[0]) && buf[1] == ':' && buf[2] == '\\') {
|
||||
prefix = L"\\\\?\\";
|
||||
} else if (buf[0] == '\\' && buf[1] == '\\') {
|
||||
if (buf[2] == '?' && buf[3] == '\\') {
|
||||
prefix = L"";
|
||||
needs_fullpath = false;
|
||||
} else {
|
||||
prefix = L"\\\\?\\UNC";
|
||||
prefix_off = 1; // Overwrite the first char with the prefix, so \\share\path becomes \\?\UNC\share\path
|
||||
}
|
||||
} else {
|
||||
is_abs = false;
|
||||
prefix = L"\\\\?\\";
|
||||
}
|
||||
|
||||
size_t buf_len = strlen(buf);
|
||||
size_t prefix_len = wcslen(prefix);
|
||||
size_t full_path_size = is_abs ? 1 + buf_len : JVM_MAXPATHLEN;
|
||||
size_t result_size = prefix_len + full_path_size - prefix_off;
|
||||
result = (wchar_t*) os::malloc(sizeof(wchar_t) * (additional_space + result_size), mtInternal);
|
||||
|
||||
if (result == NULL) {
|
||||
err = ENOMEM;
|
||||
} else {
|
||||
size_t converted_chars;
|
||||
wchar_t* path_start = result + prefix_len - prefix_off;
|
||||
err = ::mbstowcs_s(&converted_chars, path_start, buf_len + 1, buf, buf_len);
|
||||
|
||||
if ((err == ERROR_SUCCESS) && needs_fullpath) {
|
||||
wchar_t* tmp = (wchar_t*) os::malloc(sizeof(wchar_t) * full_path_size, mtInternal);
|
||||
|
||||
if (tmp == NULL) {
|
||||
err = ENOMEM;
|
||||
} else {
|
||||
if (!_wfullpath(tmp, path_start, full_path_size)) {
|
||||
err = ENOENT;
|
||||
} else {
|
||||
::memcpy(path_start, tmp, (1 + wcslen(tmp)) * sizeof(wchar_t));
|
||||
}
|
||||
|
||||
os::free(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(result, prefix, sizeof(wchar_t) * prefix_len);
|
||||
|
||||
// Remove trailing pathsep (not for \\?\<DRIVE>:\, since it would make it relative)
|
||||
size_t result_len = wcslen(result);
|
||||
|
||||
if (result[result_len - 1] == L'\\') {
|
||||
if (!(::iswalpha(result[4]) && result[5] == L':' && result_len == 7)) {
|
||||
result[result_len - 1] = L'\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
os::free(buf);
|
||||
LPWSTR prefix = NULL;
|
||||
int prefix_off = 0;
|
||||
bool needs_fullpath = true;
|
||||
set_path_prefix(buf, &prefix, &prefix_off, &needs_fullpath);
|
||||
|
||||
LPWSTR unicode_path = NULL;
|
||||
err = convert_to_unicode(buf, &unicode_path);
|
||||
FREE_C_HEAP_ARRAY(char, buf);
|
||||
if (err != ERROR_SUCCESS) {
|
||||
os::free(result);
|
||||
result = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return result;
|
||||
LPWSTR converted_path = NULL;
|
||||
if (needs_fullpath) {
|
||||
err = get_full_path(unicode_path, &converted_path);
|
||||
} else {
|
||||
converted_path = unicode_path;
|
||||
}
|
||||
|
||||
LPWSTR result = NULL;
|
||||
if (converted_path != NULL) {
|
||||
size_t prefix_len = wcslen(prefix);
|
||||
size_t result_len = prefix_len - prefix_off + wcslen(converted_path) + additional_space + 1;
|
||||
result = NEW_C_HEAP_ARRAY(WCHAR, result_len, mtInternal);
|
||||
_snwprintf(result, result_len, L"%s%s", prefix, &converted_path[prefix_off]);
|
||||
|
||||
// Remove trailing pathsep (not for \\?\<DRIVE>:\, since it would make it relative)
|
||||
result_len = wcslen(result);
|
||||
if ((result[result_len - 1] == L'\\') &&
|
||||
!(::iswalpha(result[4]) && result[5] == L':' && result_len == 7)) {
|
||||
result[result_len - 1] = L'\0';
|
||||
}
|
||||
}
|
||||
|
||||
if (converted_path != unicode_path) {
|
||||
FREE_C_HEAP_ARRAY(WCHAR, converted_path);
|
||||
}
|
||||
FREE_C_HEAP_ARRAY(WCHAR, unicode_path);
|
||||
|
||||
return static_cast<wchar_t*>(result); // LPWSTR and wchat_t* are the same type on Windows.
|
||||
}
|
||||
|
||||
int os::stat(const char *path, struct stat *sbuf) {
|
||||
|
@ -3374,7 +3374,7 @@ void ADLParser::constant_parse_expression(EncClass* encoding, char* ec_name) {
|
||||
}
|
||||
|
||||
// Start code line.
|
||||
encoding->add_code(" _constant = C->constant_table().add");
|
||||
encoding->add_code(" _constant = C->output()->constant_table().add");
|
||||
|
||||
// Parse everything in ( ) expression.
|
||||
encoding->add_code("(this, ");
|
||||
|
@ -237,6 +237,7 @@ int main(int argc, char *argv[])
|
||||
AD.addInclude(AD._HPP_file, "memory/allocation.hpp");
|
||||
AD.addInclude(AD._HPP_file, "oops/compressedOops.hpp");
|
||||
AD.addInclude(AD._HPP_file, "code/nativeInst.hpp");
|
||||
AD.addInclude(AD._HPP_file, "opto/output.hpp");
|
||||
AD.addInclude(AD._HPP_file, "opto/machnode.hpp");
|
||||
AD.addInclude(AD._HPP_file, "opto/node.hpp");
|
||||
AD.addInclude(AD._HPP_file, "opto/regalloc.hpp");
|
||||
|
@ -2605,7 +2605,7 @@ void ArchDesc::defineEmit(FILE* fp, InstructForm& inst) {
|
||||
|
||||
// For MachConstantNodes which are ideal jump nodes, fill the jump table.
|
||||
if (inst.is_mach_constant() && inst.is_ideal_jump()) {
|
||||
fprintf(fp, " ra_->C->constant_table().fill_jump_table(cbuf, (MachConstantNode*) this, _index2label);\n");
|
||||
fprintf(fp, " ra_->C->output()->constant_table().fill_jump_table(cbuf, (MachConstantNode*) this, _index2label);\n");
|
||||
}
|
||||
|
||||
// Output each operand's offset into the array of registers.
|
||||
@ -2679,7 +2679,7 @@ void ArchDesc::defineEvalConstant(FILE* fp, InstructForm& inst) {
|
||||
|
||||
// For ideal jump nodes, add a jump-table entry.
|
||||
if (inst.is_ideal_jump()) {
|
||||
fprintf(fp, " _constant = C->constant_table().add_jump_table(this);\n");
|
||||
fprintf(fp, " _constant = C->output()->constant_table().add_jump_table(this);\n");
|
||||
}
|
||||
|
||||
// If user did not define an encode section,
|
||||
|
@ -283,14 +283,21 @@ class AbstractAssembler : public ResourceObj {
|
||||
// ensure buf contains all code (call this before using/copying the code)
|
||||
void flush();
|
||||
|
||||
void emit_int8( int8_t x) { code_section()->emit_int8( x); }
|
||||
void emit_int16( int16_t x) { code_section()->emit_int16( x); }
|
||||
void emit_int32( int32_t x) { code_section()->emit_int32( x); }
|
||||
void emit_int64( int64_t x) { code_section()->emit_int64( x); }
|
||||
void emit_int8( int8_t x1) { code_section()->emit_int8(x1); }
|
||||
|
||||
void emit_float( jfloat x) { code_section()->emit_float( x); }
|
||||
void emit_double( jdouble x) { code_section()->emit_double( x); }
|
||||
void emit_address(address x) { code_section()->emit_address(x); }
|
||||
void emit_int16( int16_t x) { code_section()->emit_int16(x); }
|
||||
void emit_int16( int8_t x1, int8_t x2) { code_section()->emit_int16(x1, x2); }
|
||||
|
||||
void emit_int24( int8_t x1, int8_t x2, int8_t x3) { code_section()->emit_int24(x1, x2, x3); }
|
||||
|
||||
void emit_int32( int32_t x) { code_section()->emit_int32(x); }
|
||||
void emit_int32( int8_t x1, int8_t x2, int8_t x3, int8_t x4) { code_section()->emit_int32(x1, x2, x3, x4); }
|
||||
|
||||
void emit_int64( int64_t x) { code_section()->emit_int64(x); }
|
||||
|
||||
void emit_float( jfloat x) { code_section()->emit_float(x); }
|
||||
void emit_double( jdouble x) { code_section()->emit_double(x); }
|
||||
void emit_address(address x) { code_section()->emit_address(x); }
|
||||
|
||||
// min and max values for signed immediate ranges
|
||||
static int min_simm(int nbits) { return -(intptr_t(1) << (nbits - 1)) ; }
|
||||
|
@ -200,9 +200,38 @@ class CodeSection {
|
||||
}
|
||||
|
||||
// Code emission
|
||||
void emit_int8 ( int8_t x) { *((int8_t*) end()) = x; set_end(end() + sizeof(int8_t)); }
|
||||
void emit_int16( int16_t x) { *((int16_t*) end()) = x; set_end(end() + sizeof(int16_t)); }
|
||||
void emit_int32( int32_t x) { *((int32_t*) end()) = x; set_end(end() + sizeof(int32_t)); }
|
||||
void emit_int8(int8_t x1) {
|
||||
address curr = end();
|
||||
*((int8_t*) curr++) = x1;
|
||||
set_end(curr);
|
||||
}
|
||||
|
||||
void emit_int16(int16_t x) { *((int16_t*) end()) = x; set_end(end() + sizeof(int16_t)); }
|
||||
void emit_int16(int8_t x1, int8_t x2) {
|
||||
address curr = end();
|
||||
*((int8_t*) curr++) = x1;
|
||||
*((int8_t*) curr++) = x2;
|
||||
set_end(curr);
|
||||
}
|
||||
|
||||
void emit_int24(int8_t x1, int8_t x2, int8_t x3) {
|
||||
address curr = end();
|
||||
*((int8_t*) curr++) = x1;
|
||||
*((int8_t*) curr++) = x2;
|
||||
*((int8_t*) curr++) = x3;
|
||||
set_end(curr);
|
||||
}
|
||||
|
||||
void emit_int32(int32_t x) { *((int32_t*) end()) = x; set_end(end() + sizeof(int32_t)); }
|
||||
void emit_int32(int8_t x1, int8_t x2, int8_t x3, int8_t x4) {
|
||||
address curr = end();
|
||||
*((int8_t*) curr++) = x1;
|
||||
*((int8_t*) curr++) = x2;
|
||||
*((int8_t*) curr++) = x3;
|
||||
*((int8_t*) curr++) = x4;
|
||||
set_end(curr);
|
||||
}
|
||||
|
||||
void emit_int64( int64_t x) { *((int64_t*) end()) = x; set_end(end() + sizeof(int64_t)); }
|
||||
|
||||
void emit_float( jfloat x) { *((jfloat*) end()) = x; set_end(end() + sizeof(jfloat)); }
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -3796,6 +3796,23 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, bool ign
|
||||
INLINE_BAILOUT("mdo allocation failed");
|
||||
}
|
||||
|
||||
const bool is_invokedynamic = (bc == Bytecodes::_invokedynamic);
|
||||
const bool has_receiver = (bc != Bytecodes::_invokestatic && !is_invokedynamic);
|
||||
|
||||
const int args_base = state()->stack_size() - callee->arg_size();
|
||||
assert(args_base >= 0, "stack underflow during inlining");
|
||||
|
||||
Value recv = NULL;
|
||||
if (has_receiver) {
|
||||
assert(!callee->is_static(), "callee must not be static");
|
||||
assert(callee->arg_size() > 0, "must have at least a receiver");
|
||||
|
||||
recv = state()->stack_at(args_base);
|
||||
if (recv->is_null_obj()) {
|
||||
INLINE_BAILOUT("receiver is always null");
|
||||
}
|
||||
}
|
||||
|
||||
// now perform tests that are based on flag settings
|
||||
bool inlinee_by_directive = compilation()->directive()->should_inline(callee);
|
||||
if (callee->force_inline() || inlinee_by_directive) {
|
||||
@ -3838,21 +3855,11 @@ bool GraphBuilder::try_inline_full(ciMethod* callee, bool holder_known, bool ign
|
||||
|
||||
BlockBegin* orig_block = block();
|
||||
|
||||
const bool is_invokedynamic = bc == Bytecodes::_invokedynamic;
|
||||
const bool has_receiver = (bc != Bytecodes::_invokestatic && !is_invokedynamic);
|
||||
|
||||
const int args_base = state()->stack_size() - callee->arg_size();
|
||||
assert(args_base >= 0, "stack underflow during inlining");
|
||||
|
||||
// Insert null check if necessary
|
||||
Value recv = NULL;
|
||||
if (has_receiver) {
|
||||
// note: null check must happen even if first instruction of callee does
|
||||
// an implicit null check since the callee is in a different scope
|
||||
// and we must make sure exception handling does the right thing
|
||||
assert(!callee->is_static(), "callee must not be static");
|
||||
assert(callee->arg_size() > 0, "must have at least a receiver");
|
||||
recv = state()->stack_at(args_base);
|
||||
null_check(recv);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -268,7 +268,7 @@ class InstructionVisitor: public StackObj {
|
||||
|
||||
|
||||
#define HASHING3(class_name, enabled, f1, f2, f3) \
|
||||
virtual intx hash() const { \
|
||||
virtual intx hash() const { \
|
||||
return (enabled) ? HASH4(name(), f1, f2, f3) : 0; \
|
||||
} \
|
||||
virtual bool is_equal(Value v) const { \
|
||||
@ -454,6 +454,8 @@ class Instruction: public CompilationResourceObj {
|
||||
bool is_linked() const { return check_flag(IsLinkedInBlockFlag); }
|
||||
bool can_be_linked() { return as_Local() == NULL && as_Phi() == NULL; }
|
||||
|
||||
bool is_null_obj() { return as_Constant() != NULL && type()->as_ObjectType()->constant_value()->is_null_object(); }
|
||||
|
||||
bool has_uses() const { return use_count() > 0; }
|
||||
ValueStack* state_before() const { return _state_before; }
|
||||
ValueStack* exception_state() const { return _exception_state; }
|
||||
@ -834,8 +836,8 @@ LEAF(LoadField, AccessField)
|
||||
|
||||
ciType* declared_type() const;
|
||||
|
||||
// generic
|
||||
HASHING2(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset()) // cannot be eliminated if needs patching or if volatile
|
||||
// generic; cannot be eliminated if needs patching or if volatile.
|
||||
HASHING3(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset(), declared_type())
|
||||
};
|
||||
|
||||
|
||||
@ -964,8 +966,8 @@ LEAF(LoadIndexed, AccessIndexed)
|
||||
ciType* exact_type() const;
|
||||
ciType* declared_type() const;
|
||||
|
||||
// generic
|
||||
HASHING2(LoadIndexed, true, array()->subst(), index()->subst())
|
||||
// generic;
|
||||
HASHING3(LoadIndexed, true, type()->tag(), array()->subst(), index()->subst())
|
||||
};
|
||||
|
||||
|
||||
|
@ -1092,7 +1092,7 @@ IntervalUseKind LinearScan::use_kind_of_input_operand(LIR_Op* op, LIR_Opr opr) {
|
||||
// this operand is allowed to be on the stack in some cases
|
||||
BasicType opr_type = opr->type_register();
|
||||
if (opr_type == T_FLOAT || opr_type == T_DOUBLE) {
|
||||
if ((UseSSE == 1 && opr_type == T_FLOAT) || UseSSE >= 2 S390_ONLY(|| true)) {
|
||||
if (IA32_ONLY( (UseSSE == 1 && opr_type == T_FLOAT) || UseSSE >= 2 ) NOT_IA32( true )) {
|
||||
// SSE float instruction (T_DOUBLE only supported with SSE2)
|
||||
switch (op->code()) {
|
||||
case lir_cmp:
|
||||
@ -1154,7 +1154,7 @@ IntervalUseKind LinearScan::use_kind_of_input_operand(LIR_Op* op, LIR_Opr opr) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // X86 S390
|
||||
#endif // X86 || S390
|
||||
|
||||
// all other operands require a register
|
||||
return mustHaveRegister;
|
||||
@ -1291,7 +1291,7 @@ void LinearScan::build_intervals() {
|
||||
if (has_fpu_registers()) {
|
||||
#ifdef X86
|
||||
if (UseSSE < 2) {
|
||||
#endif
|
||||
#endif // X86
|
||||
for (i = 0; i < FrameMap::nof_caller_save_fpu_regs; i++) {
|
||||
LIR_Opr opr = FrameMap::caller_save_fpu_reg_at(i);
|
||||
assert(opr->is_valid() && opr->is_register(), "FrameMap should not return invalid operands");
|
||||
@ -1300,6 +1300,9 @@ void LinearScan::build_intervals() {
|
||||
}
|
||||
#ifdef X86
|
||||
}
|
||||
#endif // X86
|
||||
|
||||
#ifdef X86
|
||||
if (UseSSE > 0) {
|
||||
int num_caller_save_xmm_regs = FrameMap::get_num_caller_save_xmms();
|
||||
for (i = 0; i < num_caller_save_xmm_regs; i ++) {
|
||||
@ -1309,7 +1312,7 @@ void LinearScan::build_intervals() {
|
||||
caller_save_registers[num_caller_save_registers++] = reg_num(opr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // X86
|
||||
}
|
||||
assert(num_caller_save_registers <= LinearScan::nof_regs, "out of bounds");
|
||||
|
||||
@ -2147,12 +2150,12 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) {
|
||||
if (UseAVX < 3) {
|
||||
last_xmm_reg = pd_first_xmm_reg + (pd_nof_xmm_regs_frame_map / 2) - 1;
|
||||
}
|
||||
#endif
|
||||
#endif // LP64
|
||||
assert(assigned_reg >= pd_first_xmm_reg && assigned_reg <= last_xmm_reg, "no xmm register");
|
||||
assert(interval->assigned_regHi() == any_reg, "must not have hi register");
|
||||
return LIR_OprFact::single_xmm(assigned_reg - pd_first_xmm_reg);
|
||||
}
|
||||
#endif
|
||||
#endif // X86
|
||||
|
||||
assert(assigned_reg >= pd_first_fpu_reg && assigned_reg <= pd_last_fpu_reg, "no fpu register");
|
||||
assert(interval->assigned_regHi() == any_reg, "must not have hi register");
|
||||
@ -2167,12 +2170,12 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) {
|
||||
if (UseAVX < 3) {
|
||||
last_xmm_reg = pd_first_xmm_reg + (pd_nof_xmm_regs_frame_map / 2) - 1;
|
||||
}
|
||||
#endif
|
||||
#endif // LP64
|
||||
assert(assigned_reg >= pd_first_xmm_reg && assigned_reg <= last_xmm_reg, "no xmm register");
|
||||
assert(interval->assigned_regHi() == any_reg, "must not have hi register (double xmm values are stored in one register)");
|
||||
return LIR_OprFact::double_xmm(assigned_reg - pd_first_xmm_reg);
|
||||
}
|
||||
#endif
|
||||
#endif // X86
|
||||
|
||||
#ifdef SPARC
|
||||
assert(assigned_reg >= pd_first_fpu_reg && assigned_reg <= pd_last_fpu_reg, "no fpu register");
|
||||
|
@ -318,7 +318,7 @@ InstanceKlass* ClassListParser::load_class_from_source(Symbol* class_name, TRAPS
|
||||
|
||||
// This tells JVM_FindLoadedClass to not find this class.
|
||||
k->set_shared_classpath_index(UNREGISTERED_INDEX);
|
||||
k->clear_class_loader_type();
|
||||
k->clear_shared_class_loader_type();
|
||||
}
|
||||
|
||||
return k;
|
||||
|
@ -1361,7 +1361,7 @@ void ClassLoader::record_result(InstanceKlass* ik, const ClassFileStream* stream
|
||||
if (loader == NULL) {
|
||||
// JFR classes
|
||||
ik->set_shared_classpath_index(0);
|
||||
ik->set_class_loader_type(ClassLoader::BOOT_LOADER);
|
||||
ik->set_shared_class_loader_type(ClassLoader::BOOT_LOADER);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -39,8 +39,8 @@ inline oop ClassLoaderData::class_loader() const {
|
||||
}
|
||||
|
||||
inline bool ClassLoaderData::is_boot_class_loader_data() const {
|
||||
return class_loader() == NULL;
|
||||
}
|
||||
return this == _the_null_class_loader_data || class_loader() == NULL;
|
||||
}
|
||||
|
||||
inline ClassLoaderData* ClassLoaderData::class_loader_data_or_null(oop loader) {
|
||||
if (loader == NULL) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -245,7 +245,7 @@ void ClassLoaderExt::record_result(const s2 classpath_index,
|
||||
ClassLoaderExt::set_max_used_path_index(classpath_index);
|
||||
}
|
||||
result->set_shared_classpath_index(classpath_index);
|
||||
result->set_class_loader_type(classloader_type);
|
||||
result->set_shared_class_loader_type(classloader_type);
|
||||
}
|
||||
|
||||
// Load the class of the given name from the location given by path. The path is specified by
|
||||
|
@ -2014,10 +2014,8 @@ class BacktraceBuilder: public StackObj {
|
||||
typeArrayOop _bcis;
|
||||
objArrayOop _mirrors;
|
||||
typeArrayOop _names; // Needed to insulate method name against redefinition.
|
||||
// This is set to a java.lang.Boolean(true) if the top frame
|
||||
// of the backtrace is omitted because it shall be hidden.
|
||||
// Else it is null.
|
||||
oop _has_hidden_top_frame;
|
||||
// True if the top frame of the backtrace is omitted because it shall be hidden.
|
||||
bool _has_hidden_top_frame;
|
||||
int _index;
|
||||
NoSafepointVerifier _nsv;
|
||||
|
||||
@ -2053,15 +2051,15 @@ class BacktraceBuilder: public StackObj {
|
||||
assert(names != NULL, "names array should be initialized in backtrace");
|
||||
return names;
|
||||
}
|
||||
static oop get_has_hidden_top_frame(objArrayHandle chunk) {
|
||||
static bool has_hidden_top_frame(objArrayHandle chunk) {
|
||||
oop hidden = chunk->obj_at(trace_hidden_offset);
|
||||
return hidden;
|
||||
return hidden != NULL;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
// constructor for new backtrace
|
||||
BacktraceBuilder(TRAPS): _head(NULL), _methods(NULL), _bcis(NULL), _mirrors(NULL), _names(NULL), _has_hidden_top_frame(NULL) {
|
||||
BacktraceBuilder(TRAPS): _head(NULL), _methods(NULL), _bcis(NULL), _mirrors(NULL), _names(NULL), _has_hidden_top_frame(false) {
|
||||
expand(CHECK);
|
||||
_backtrace = Handle(THREAD, _head);
|
||||
_index = 0;
|
||||
@ -2072,7 +2070,7 @@ class BacktraceBuilder: public StackObj {
|
||||
_bcis = get_bcis(backtrace);
|
||||
_mirrors = get_mirrors(backtrace);
|
||||
_names = get_names(backtrace);
|
||||
_has_hidden_top_frame = get_has_hidden_top_frame(backtrace);
|
||||
_has_hidden_top_frame = has_hidden_top_frame(backtrace);
|
||||
assert(_methods->length() == _bcis->length() &&
|
||||
_methods->length() == _mirrors->length() &&
|
||||
_mirrors->length() == _names->length(),
|
||||
@ -2152,19 +2150,17 @@ class BacktraceBuilder: public StackObj {
|
||||
}
|
||||
|
||||
void set_has_hidden_top_frame(TRAPS) {
|
||||
if (_has_hidden_top_frame == NULL) {
|
||||
if (!_has_hidden_top_frame) {
|
||||
// It would be nice to add java/lang/Boolean::TRUE here
|
||||
// to indicate that this backtrace has a hidden top frame.
|
||||
// But this code is used before TRUE is allocated.
|
||||
// Therefor let's just use an arbitrary legal oop
|
||||
// available right here. We only test for != null
|
||||
// anyways. _methods is a short[].
|
||||
// Therefore let's just use an arbitrary legal oop
|
||||
// available right here. _methods is a short[].
|
||||
assert(_methods != NULL, "we need a legal oop");
|
||||
_has_hidden_top_frame = _methods;
|
||||
_head->obj_at_put(trace_hidden_offset, _has_hidden_top_frame);
|
||||
_has_hidden_top_frame = true;
|
||||
_head->obj_at_put(trace_hidden_offset, _methods);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct BacktraceElement : public StackObj {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user