mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
Merge
This commit is contained in:
commit
5ff01c4163
2
.hgtags
2
.hgtags
@ -485,3 +485,5 @@ f7363de371c9a1f668bd0a01b7df3d1ddb9cc58b jdk-11+7
|
||||
e1e60f75cd39312a7f59d2a4f91d624e5aecc95e jdk-11+11
|
||||
3ab6ba9f94a9045a526d645af26c933235371d6f jdk-11+12
|
||||
758deedaae8406ae60147486107a54e9864aa7b0 jdk-11+13
|
||||
3595bd343b65f8c37818ebe6a4c343ddeb1a5f88 jdk-11+14
|
||||
a11c1cb542bbd1671d25b85efe7d09b983c48525 jdk-11+15
|
||||
|
||||
@ -555,6 +555,7 @@ CC: Sun C++ 5.13 SunOS_i386 151846-10 2015/10/30</code></pre>
|
||||
</ul>
|
||||
<h2 id="running-tests">Running Tests</h2>
|
||||
<p>Most of the OpenJDK tests are using the <a href="http://openjdk.java.net/jtreg">JTReg</a> test framework. Make sure that your configuration knows where to find your installation of JTReg. If this is not picked up automatically, use the <code>--with-jtreg=<path to jtreg home></code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc.</p>
|
||||
<p>The <a href="https://wiki.openjdk.java.net/display/Adoption">Adoption Group</a> provides recent builds of jtreg <a href="https://adopt-openjdk.ci.cloudbees.com/job/jtreg/lastSuccessfulBuild/artifact">here</a>. Download the latest <code>.tar.gz</code> file, unpack it, and point <code>--with-jtreg</code> to the <code>jtreg</code> directory that you just unpacked.</p>
|
||||
<p>To execute the most basic tests (tier 1), use:</p>
|
||||
<pre><code>make run-test-tier1</code></pre>
|
||||
<p>For more details on how to run tests, please see the <a href="testing.html">Testing OpenJDK</a> document.</p>
|
||||
|
||||
@ -833,6 +833,12 @@ installation of JTReg. If this is not picked up automatically, use the
|
||||
Note that this option should point to the JTReg home, i.e. the top directory,
|
||||
containing `lib/jtreg.jar` etc.
|
||||
|
||||
The [Adoption Group](https://wiki.openjdk.java.net/display/Adoption) provides
|
||||
recent builds of jtreg [here](
|
||||
https://adopt-openjdk.ci.cloudbees.com/job/jtreg/lastSuccessfulBuild/artifact).
|
||||
Download the latest `.tar.gz` file, unpack it, and point `--with-jtreg` to the
|
||||
`jtreg` directory that you just unpacked.
|
||||
|
||||
To execute the most basic tests (tier 1), use:
|
||||
```
|
||||
make run-test-tier1
|
||||
|
||||
@ -40,20 +40,21 @@
|
||||
$ make run-test-jdk_lang JTREG="JOBS=8"
|
||||
$ make run-test TEST=jdk_lang
|
||||
$ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
|
||||
$ make run-test TEST="hotspot/test:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"
|
||||
$ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java"
|
||||
$ make exploded-run-test TEST=hotspot_tier1</code></pre>
|
||||
$ make run-test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"
|
||||
$ make run-test TEST="jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java"
|
||||
$ make exploded-run-test TEST=tier2</code></pre>
|
||||
<h3 id="configuration">Configuration</h3>
|
||||
<p>To be able to run JTReg tests, <code>configure</code> needs to know where to find the JTReg test framework. If it is not picked up automatically by configure, use the <code>--with-jtreg=<path to jtreg home></code> option to point to the JTReg framework. Note that this option should point to the JTReg home, i.e. the top directory, containing <code>lib/jtreg.jar</code> etc. (An alternative is to set the <code>JT_HOME</code> environment variable to point to the JTReg home before running <code>configure</code>.)</p>
|
||||
<h2 id="test-selection">Test selection</h2>
|
||||
<p>All functionality is available using the run-test make target. In this use case, the test or tests to be executed is controlled using the <code>TEST</code> variable. To speed up subsequent test runs with no source code changes, run-test-only can be used instead, which do not depend on the source and test image build.</p>
|
||||
<p>For some common top-level tests, direct make targets have been generated. This includes all JTReg test groups, the hotspot gtest, and custom tests (if present). This means that <code>make run-test-tier1</code> is equivalent to <code>make run-test TEST="tier1"</code>, but the latter is more tab-completion friendly. For more complex test runs, the <code>run-test TEST="x"</code> solution needs to be used.</p>
|
||||
<p>The test specifications given in <code>TEST</code> is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, <code>:tier1</code> will expand to <code>jtreg:jdk/test:tier1 jtreg:langtools/test:tier1 jtreg:nashorn/test:tier1 jtreg:jaxp/test:tier1</code>. You can always submit a list of fully qualified test descriptors in the <code>TEST</code> variable if you want to shortcut the parser.</p>
|
||||
<p>The test specifications given in <code>TEST</code> is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, <code>:tier1</code> will expand to <code>jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1 jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1 jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1</code>. You can always submit a list of fully qualified test descriptors in the <code>TEST</code> variable if you want to shortcut the parser.</p>
|
||||
<h3 id="jtreg">JTReg</h3>
|
||||
<p>JTReg test groups can be specified either without a test root, e.g. <code>:tier1</code> (or <code>tier1</code>, the initial colon is optional), or with, e.g. <code>hotspot/test:tier1</code>, <code>jdk/test:jdk_util</code>.</p>
|
||||
<p>When specified without a test root, all matching groups from all tests roots will be added. Otherwise, only the group from the specified test root will be added.</p>
|
||||
<p>Individual JTReg tests or directories containing JTReg tests can also be specified, like <code>hotspot/test/native_sanity/JniVersion.java</code> or <code>hotspot/test/native_sanity</code>. You can also specify an absolute path, to point to a JTReg test outside the source tree.</p>
|
||||
<p>As long as the test groups or test paths can be uniquely resolved, you do not need to enter the <code>jtreg:</code> prefix. If this is not possible, or if you want to use a fully qualified test descriptor, add <code>jtreg:</code>, e.g. <code>jtreg:hotspot/test/native_sanity</code>.</p>
|
||||
<p>JTReg tests can be selected either by picking a JTReg test group, or a selection of files or directories containing JTReg tests.</p>
|
||||
<p>JTReg test groups can be specified either without a test root, e.g. <code>:tier1</code> (or <code>tier1</code>, the initial colon is optional), or with, e.g. <code>hotspot:tier1</code>, <code>test/jdk:jdk_util</code> or <code>$(TOPDIR)/test/hotspot/jtreg:hotspot_all</code>. The test root can be specified either as an absolute path, or a path relative to the OpenJDK top directory, or the <code>test</code> directory. For simplicity, the hotspot JTReg test root, which really is <code>hotspot/jtreg</code> can be abbreviated as just <code>hotspot</code>.</p>
|
||||
<p>When specified without a test root, all matching groups from all test roots will be added. Otherwise, only the group from the specified test root will be added.</p>
|
||||
<p>Individual JTReg tests or directories containing JTReg tests can also be specified, like <code>test/hotspot/jtreg/native_sanity/JniVersion.java</code> or <code>hotspot/jtreg/native_sanity</code>. Just like for test root selection, you can either specify an absolute path (which can even point to JTReg tests outside the source tree), or a path relative to either the OpenJDK top directory or the <code>test</code> directory. <code>hotspot</code> can be used as an alias for <code>hotspot/jtreg</code> here as well.</p>
|
||||
<p>As long as the test groups or test paths can be uniquely resolved, you do not need to enter the <code>jtreg:</code> prefix. If this is not possible, or if you want to use a fully qualified test descriptor, add <code>jtreg:</code>, e.g. <code>jtreg:test/hotspot/jtreg/native_sanity</code>.</p>
|
||||
<h3 id="gtest">Gtest</h3>
|
||||
<p>Since the Hotspot Gtest suite is so quick, the default is to run all tests. This is specified by just <code>gtest</code>, or as a fully qualified test descriptor <code>gtest:all</code>.</p>
|
||||
<p>If you want, you can single out an individual test or a group of tests, for instance <code>gtest:LogDecorations</code> or <code>gtest:LogDecorations.level_test_vm</code>. This can be particularly useful if you want to run a shaky test repeatedly.</p>
|
||||
|
||||
@ -18,9 +18,9 @@ Some example command-lines:
|
||||
$ make run-test-jdk_lang JTREG="JOBS=8"
|
||||
$ make run-test TEST=jdk_lang
|
||||
$ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
|
||||
$ make run-test TEST="hotspot/test:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"
|
||||
$ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java"
|
||||
$ make exploded-run-test TEST=hotspot_tier1
|
||||
$ make run-test TEST="hotspot:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OPTIONS=-XshowSettings -Xlog:gc+ref=debug"
|
||||
$ make run-test TEST="jtreg:test/hotspot:hotspot_gc test/hotspot/jtreg/native_sanity/JniVersion.java"
|
||||
$ make exploded-run-test TEST=tier2
|
||||
|
||||
### Configuration
|
||||
|
||||
@ -46,30 +46,41 @@ test runs, the `run-test TEST="x"` solution needs to be used.
|
||||
|
||||
The test specifications given in `TEST` is parsed into fully qualified test
|
||||
descriptors, which clearly and unambigously show which tests will be run. As an
|
||||
example, `:tier1` will expand to `jtreg:jdk/test:tier1
|
||||
jtreg:langtools/test:tier1 jtreg:nashorn/test:tier1 jtreg:jaxp/test:tier1`. You
|
||||
can always submit a list of fully qualified test descriptors in the `TEST`
|
||||
variable if you want to shortcut the parser.
|
||||
example, `:tier1` will expand to `jtreg:$(TOPDIR)/test/hotspot/jtreg:tier1
|
||||
jtreg:$(TOPDIR)/test/jdk:tier1 jtreg:$(TOPDIR)/test/langtools:tier1
|
||||
jtreg:$(TOPDIR)/test/nashorn:tier1 jtreg:$(TOPDIR)/test/jaxp:tier1`. You can
|
||||
always submit a list of fully qualified test descriptors in the `TEST` variable
|
||||
if you want to shortcut the parser.
|
||||
|
||||
### JTReg
|
||||
|
||||
JTReg test groups can be specified either without a test root, e.g. `:tier1`
|
||||
(or `tier1`, the initial colon is optional), or with, e.g.
|
||||
`hotspot/test:tier1`, `jdk/test:jdk_util`.
|
||||
JTReg tests can be selected either by picking a JTReg test group, or a selection
|
||||
of files or directories containing JTReg tests.
|
||||
|
||||
When specified without a test root, all matching groups from all tests roots
|
||||
JTReg test groups can be specified either without a test root, e.g. `:tier1`
|
||||
(or `tier1`, the initial colon is optional), or with, e.g. `hotspot:tier1`,
|
||||
`test/jdk:jdk_util` or `$(TOPDIR)/test/hotspot/jtreg:hotspot_all`. The test
|
||||
root can be specified either as an absolute path, or a path relative to the
|
||||
OpenJDK top directory, or the `test` directory. For simplicity, the hotspot
|
||||
JTReg test root, which really is `hotspot/jtreg` can be abbreviated as
|
||||
just `hotspot`.
|
||||
|
||||
When specified without a test root, all matching groups from all test roots
|
||||
will be added. Otherwise, only the group from the specified test root will be
|
||||
added.
|
||||
|
||||
Individual JTReg tests or directories containing JTReg tests can also be
|
||||
specified, like `hotspot/test/native_sanity/JniVersion.java` or
|
||||
`hotspot/test/native_sanity`. You can also specify an absolute path, to point
|
||||
to a JTReg test outside the source tree.
|
||||
specified, like `test/hotspot/jtreg/native_sanity/JniVersion.java` or
|
||||
`hotspot/jtreg/native_sanity`. Just like for test root selection, you can
|
||||
either specify an absolute path (which can even point to JTReg tests outside
|
||||
the source tree), or a path relative to either the OpenJDK top directory or the
|
||||
`test` directory. `hotspot` can be used as an alias for `hotspot/jtreg` here as
|
||||
well.
|
||||
|
||||
As long as the test groups or test paths can be uniquely resolved, you do not
|
||||
need to enter the `jtreg:` prefix. If this is not possible, or if you want to
|
||||
use a fully qualified test descriptor, add `jtreg:`, e.g.
|
||||
`jtreg:hotspot/test/native_sanity`.
|
||||
`jtreg:test/hotspot/jtreg/native_sanity`.
|
||||
|
||||
### Gtest
|
||||
|
||||
|
||||
@ -85,7 +85,6 @@ JAVADOC_TAGS := \
|
||||
-tag throws \
|
||||
-taglet build.tools.taglet.ModuleGraph \
|
||||
-tag since \
|
||||
-tag version \
|
||||
-tag serialData \
|
||||
-tag factory \
|
||||
-tag see \
|
||||
|
||||
@ -119,6 +119,33 @@ AC_DEFUN([BASIC_GET_NON_MATCHING_VALUES],
|
||||
fi
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Check if a list of space-separated words contains any word(s) from a list of
|
||||
# space-separated illegal words. Typical use is to see if a user-specified
|
||||
# set of words contains any from a set of illegal words.
|
||||
#
|
||||
# Sets the specified variable to list of matching illegal words, or to
|
||||
# the empty string if no words are matching the illegal set.
|
||||
#
|
||||
# $1: result variable name
|
||||
# $2: list of values to check
|
||||
# $3: list of illegal values
|
||||
AC_DEFUN([BASIC_GET_MATCHING_VALUES],
|
||||
[
|
||||
# grep filter function inspired by a comment to http://stackoverflow.com/a/1617326
|
||||
# Notice that the original variant fails on SLES 10 and 11
|
||||
# Some grep versions (at least bsd) behaves strangely on the base case with
|
||||
# no legal_values, so make it explicit.
|
||||
values_to_check=`$ECHO $2 | $TR ' ' '\n'`
|
||||
illegal_values=`$ECHO $3 | $TR ' ' '\n'`
|
||||
if test -z "$illegal_values"; then
|
||||
$1=""
|
||||
else
|
||||
result=`$GREP -Fx "$illegal_values" <<< "$values_to_check" | $GREP -v '^$'`
|
||||
$1=${result//$'\n'/ }
|
||||
fi
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Sort a space-separated list, and remove duplicates.
|
||||
#
|
||||
|
||||
@ -28,6 +28,9 @@ VALID_JVM_FEATURES="compiler1 compiler2 zero minimal dtrace jvmti jvmci \
|
||||
graal vm-structs jni-check services management cmsgc g1gc parallelgc serialgc nmt cds \
|
||||
static-build link-time-opt aot jfr"
|
||||
|
||||
# Deprecated JVM features (these are ignored, but with a warning)
|
||||
DEPRECATED_JVM_FEATURES="trace"
|
||||
|
||||
# All valid JVM variants
|
||||
VALID_JVM_VARIANTS="server client minimal core zero custom"
|
||||
|
||||
@ -269,18 +272,27 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
|
||||
USER_JVM_FEATURE_LIST=`$ECHO $with_jvm_features | $SED -e 's/,/ /g'`
|
||||
AC_MSG_RESULT([$user_jvm_feature_list])
|
||||
# These features will be added to all variant defaults
|
||||
JVM_FEATURES=`$ECHO $USER_JVM_FEATURE_LIST | $AWK '{ for (i=1; i<=NF; i++) if (!match($i, /^-.*/)) print $i }'`
|
||||
JVM_FEATURES=`$ECHO $USER_JVM_FEATURE_LIST | $AWK '{ for (i=1; i<=NF; i++) if (!match($i, /^-.*/)) printf("%s ", $i) }'`
|
||||
# These features will be removed from all variant defaults
|
||||
DISABLED_JVM_FEATURES=`$ECHO $USER_JVM_FEATURE_LIST | $AWK '{ for (i=1; i<=NF; i++) if (match($i, /^-.*/)) print substr($i, 2) }'`
|
||||
DISABLED_JVM_FEATURES=`$ECHO $USER_JVM_FEATURE_LIST | $AWK '{ for (i=1; i<=NF; i++) if (match($i, /^-.*/)) printf("%s ", substr($i, 2))}'`
|
||||
|
||||
# Verify that the user has provided valid features
|
||||
BASIC_GET_NON_MATCHING_VALUES(INVALID_FEATURES, $JVM_FEATURES $DISABLED_JVM_FEATURES, $VALID_JVM_FEATURES)
|
||||
BASIC_GET_NON_MATCHING_VALUES(INVALID_FEATURES, $JVM_FEATURES $DISABLED_JVM_FEATURES, $VALID_JVM_FEATURES $DEPRECATED_JVM_FEATURES)
|
||||
if test "x$INVALID_FEATURES" != x; then
|
||||
AC_MSG_NOTICE([Unknown JVM features specified: "$INVALID_FEATURES"])
|
||||
AC_MSG_NOTICE([The available JVM features are: "$VALID_JVM_FEATURES"])
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
fi
|
||||
|
||||
# Check if the user has provided deprecated features
|
||||
BASIC_GET_MATCHING_VALUES(DEPRECATED_FEATURES, $JVM_FEATURES $DISABLED_JVM_FEATURES, $DEPRECATED_JVM_FEATURES)
|
||||
if test "x$DEPRECATED_FEATURES" != x; then
|
||||
AC_MSG_WARN([Deprecated JVM features specified (will be ignored): "$DEPRECATED_FEATURES"])
|
||||
# Filter out deprecated features
|
||||
BASIC_GET_NON_MATCHING_VALUES(JVM_FEATURES, $JVM_FEATURES, $DEPRECATED_FEATURES)
|
||||
BASIC_GET_NON_MATCHING_VALUES(DISABLED_JVM_FEATURES, $DISABLED_JVM_FEATURES, $DEPRECATED_FEATURES)
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# Override hotspot cpu definitions for ARM platforms
|
||||
@ -309,9 +321,11 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
|
||||
AC_MSG_ERROR([Specified JVM feature 'cmsgc' requires feature 'serialgc'])
|
||||
fi
|
||||
|
||||
# Enable JFR by default, except on linux-sparcv9 and on minimal.
|
||||
if test "x$OPENJDK_TARGET_OS" != xlinux || test "x$OPENJDK_TARGET_CPU" != xsparcv9; then
|
||||
NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jfr"
|
||||
# Enable JFR by default, except for Zero, linux-sparcv9 and on minimal.
|
||||
if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
|
||||
if test "x$OPENJDK_TARGET_OS" != xlinux || test "x$OPENJDK_TARGET_CPU" != xsparcv9; then
|
||||
NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jfr"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Turn on additional features based on other parts of configure
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
################################################################################
|
||||
# The order of these defines the priority by which we try to find them.
|
||||
VALID_VS_VERSIONS="2013 2012 2010 2015 2017"
|
||||
VALID_VS_VERSIONS="2017 2013 2015 2012 2010"
|
||||
|
||||
VS_DESCRIPTION_2010="Microsoft Visual Studio 2010"
|
||||
VS_VERSION_INTERNAL_2010=100
|
||||
@ -58,7 +58,7 @@ VS_SDK_INSTALLDIR_2013=
|
||||
VS_VS_PLATFORM_NAME_2013="v120"
|
||||
VS_SDK_PLATFORM_NAME_2013=
|
||||
|
||||
VS_DESCRIPTION_2015="Microsoft Visual Studio 2015 - CURRENTLY NOT WORKING"
|
||||
VS_DESCRIPTION_2015="Microsoft Visual Studio 2015"
|
||||
VS_VERSION_INTERNAL_2015=140
|
||||
VS_MSVCR_2015=vcruntime140.dll
|
||||
VS_MSVCP_2015=msvcp140.dll
|
||||
@ -71,7 +71,7 @@ VS_SDK_PLATFORM_NAME_2015=
|
||||
# explicitly specifying Windows Kit 8.1 to be used.
|
||||
VS_ENV_ARGS_2015="8.1"
|
||||
|
||||
VS_DESCRIPTION_2017="Microsoft Visual Studio 2017 - CURRENTLY NOT WORKING"
|
||||
VS_DESCRIPTION_2017="Microsoft Visual Studio 2017"
|
||||
VS_VERSION_INTERNAL_2017=141
|
||||
VS_MSVCR_2017=vcruntime140.dll
|
||||
VS_MSVCP_2017=msvcp140.dll
|
||||
|
||||
@ -184,7 +184,8 @@ var getJibProfiles = function (input) {
|
||||
|
||||
// Identifies the version of this format to the tool reading it.
|
||||
// 1.1 signifies that the publish, publish-src and get-src features are usable.
|
||||
data.format_version = "1.1";
|
||||
// 1.2 signifies that artifact uploads should fail on missing artifacts by default.
|
||||
data.format_version = "1.2";
|
||||
|
||||
// Organization, product and version are used when uploading/publishing build results
|
||||
data.organization = "";
|
||||
@ -822,7 +823,7 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
|
||||
solaris_x64: "SS12u4-Solaris11u1+1.0",
|
||||
solaris_sparcv9: "SS12u4-Solaris11u1+1.1",
|
||||
windows_x64: "VS2013SP4+1.0",
|
||||
windows_x64: "VS2017-15.5.5+1.0",
|
||||
linux_aarch64: (input.profile != null && input.profile.indexOf("arm64") >= 0
|
||||
? "gcc-linaro-aarch64-linux-gnu-4.8-2013.11_linux+1.0"
|
||||
: "gcc7.3.0-Fedora27+1.0"),
|
||||
|
||||
@ -23,13 +23,11 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
$(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcJfr.gmk))
|
||||
|
||||
################################################################################
|
||||
# Build tools needed for the Jfr source code generation
|
||||
# Build tools needed for the JFR source code generation
|
||||
|
||||
JFR_TOOLS_SRCDIR := $(TOPDIR)/src/hotspot/share/jfr/metadata
|
||||
JFR_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/tools/jfr
|
||||
JFR_TOOLS_SRCDIR := $(TOPDIR)/make/src/classes
|
||||
JFR_TOOLS_OUTPUTDIR := $(OUTPUTDIR)/buildtools/tools_classes
|
||||
|
||||
$(eval $(call SetupJavaCompiler, GENERATE_JFRBYTECODE, \
|
||||
JAVAC := $(JAVAC), \
|
||||
@ -42,53 +40,28 @@ $(eval $(call SetupJavaCompiler, GENERATE_JFRBYTECODE, \
|
||||
$(eval $(call SetupJavaCompilation, BUILD_JFR_TOOLS, \
|
||||
SETUP := GENERATE_JFRBYTECODE, \
|
||||
SRC := $(JFR_TOOLS_SRCDIR), \
|
||||
INCLUDE_FILES := GenerateJfrFiles.java, \
|
||||
BIN := $(JFR_TOOLS_OUTPUTDIR), \
|
||||
))
|
||||
|
||||
TOOL_JFR_GEN := $(JAVA_SMALL) -cp $(JFR_TOOLS_OUTPUTDIR) GenerateJfrFiles
|
||||
TARGETS += $(BUILD_JFR_TOOLS)
|
||||
|
||||
################################################################################
|
||||
# Setup make rules for Jfr file file generation.
|
||||
# Setup make rules for JFR gensrc file generation.
|
||||
#
|
||||
# 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. This name is
|
||||
# also used as the name of the output file.
|
||||
#
|
||||
# Remaining parameters are named arguments. These include:
|
||||
# XML_FILE -- The input source file to use
|
||||
# XSD_FILE -- The input schema for validation
|
||||
# OUTPUT_DIR -- The directory to put the generated file in
|
||||
SetupJfrGeneration = $(NamedParamsMacroTemplate)
|
||||
define SetupJfrGenerationBody
|
||||
$$($1_OUTPUT_DIR)/$1: $$($1_XML_FILE) $$($1_XSD_FILE) $$(BUILD_JFR_TOOLS)
|
||||
$$(call LogInfo, Generating $$(@F))
|
||||
$$(call MakeDir, $$(@D))
|
||||
$$(call ExecuteWithLog, $$@, $$(TOOL_JFR_GEN) $$($1_XML_FILE) $$($1_XSD_FILE) $$($1_OUTPUT_DIR))
|
||||
test -f $$@
|
||||
|
||||
TARGETS += $$($1_OUTPUT_DIR)/$1
|
||||
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# Create files in gensrc/jfrfiles
|
||||
TOOL_JFR_GEN := $(JAVA_SMALL) -cp $(JFR_TOOLS_OUTPUTDIR) build.tools.jfr.GenerateJfrFiles
|
||||
|
||||
JFR_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/gensrc/jfrfiles
|
||||
JFR_SRCDIR := $(TOPDIR)/src/hotspot/share/jfr/metadata
|
||||
|
||||
METADATA_XML ?= $(JFR_SRCDIR)/metadata.xml
|
||||
METADATA_XSD ?= $(JFR_SRCDIR)/metadata.xsd
|
||||
|
||||
# Changing these will trigger a rebuild of generated jfr files.
|
||||
JFR_DEPS += \
|
||||
$(METADATA_XML) \
|
||||
$(METADATA_XSD) \
|
||||
#
|
||||
METADATA_XML := $(JFR_SRCDIR)/metadata.xml
|
||||
METADATA_XSD := $(JFR_SRCDIR)/metadata.xsd
|
||||
|
||||
# our generator will generate all files in one go, so only need to setup one target rule
|
||||
$(eval $(call SetupJfrGeneration, jfrEventClasses.hpp, \
|
||||
XML_FILE := $(METADATA_XML), \
|
||||
XSD_FILE := $(METADATA_XSD), \
|
||||
OUTPUT_DIR := $(JFR_OUTPUTDIR), \
|
||||
))
|
||||
$(JFR_OUTPUTDIR)/jfrEventClasses.hpp: $(METADATA_XML) $(METADATA_XSD) \
|
||||
$(BUILD_JFR_TOOLS)
|
||||
$(call LogInfo, Generating $(@F))
|
||||
$(call MakeDir, $(@D))
|
||||
$(call ExecuteWithLog, $@, $(TOOL_JFR_GEN) $(METADATA_XML) $(METADATA_XSD) $(JFR_OUTPUTDIR))
|
||||
test -f $@
|
||||
|
||||
TARGETS += $(JFR_OUTPUTDIR)/jfrEventClasses.hpp
|
||||
|
||||
@ -41,7 +41,7 @@ ifeq ($(call check-jvm-feature, compiler2), true)
|
||||
else
|
||||
JVM_EXCLUDES += opto libadt
|
||||
JVM_EXCLUDE_FILES += bcEscapeAnalyzer.cpp ciTypeFlow.cpp
|
||||
JVM_EXCLUDE_PATTERNS += c2_ runtime_
|
||||
JVM_EXCLUDE_PATTERNS += c2_ runtime_ /c2/
|
||||
endif
|
||||
|
||||
ifeq ($(call check-jvm-feature, zero), true)
|
||||
|
||||
@ -188,7 +188,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBZIP, \
|
||||
-I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libjava \
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
|
||||
CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
|
||||
DISABLED_WARNINGS_gcc := implicit-fallthrough, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
package build.tools.jfr;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
File diff suppressed because it is too large
Load Diff
@ -3665,7 +3665,7 @@ const bool Matcher::strict_fp_requires_explicit_rounding = false;
|
||||
|
||||
// Are floats converted to double when stored to stack during
|
||||
// deoptimization?
|
||||
bool Matcher::float_in_double() { return true; }
|
||||
bool Matcher::float_in_double() { return false; }
|
||||
|
||||
// Do ints take an entire long register or just half?
|
||||
// The relevant question is how the int is callee-saved:
|
||||
|
||||
@ -1284,17 +1284,19 @@ void LIRGenerator::do_If(If* x) {
|
||||
yin->load_item();
|
||||
}
|
||||
|
||||
// add safepoint before generating condition code so it can be recomputed
|
||||
if (x->is_safepoint()) {
|
||||
// increment backedge counter if needed
|
||||
increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci());
|
||||
__ safepoint(LIR_OprFact::illegalOpr, state_for(x, x->state_before()));
|
||||
}
|
||||
set_no_result(x);
|
||||
|
||||
LIR_Opr left = xin->result();
|
||||
LIR_Opr right = yin->result();
|
||||
|
||||
// add safepoint before generating condition code so it can be recomputed
|
||||
if (x->is_safepoint()) {
|
||||
// increment backedge counter if needed
|
||||
increment_backedge_counter_conditionally(lir_cond(cond), left, right, state_for(x, x->state_before()),
|
||||
x->tsux()->bci(), x->fsux()->bci(), x->profiled_bci());
|
||||
__ safepoint(LIR_OprFact::illegalOpr, state_for(x, x->state_before()));
|
||||
}
|
||||
|
||||
__ cmp(lir_cond(cond), left, right);
|
||||
// Generate branch profiling. Profiling code doesn't kill flags.
|
||||
profile_branch(x, cond);
|
||||
|
||||
@ -1224,7 +1224,6 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
|
||||
assert(sub_klass != r0, "killed reg"); // killed by mov(r0, super)
|
||||
assert(sub_klass != r2, "killed reg"); // killed by lea(r2, &pst_counter)
|
||||
|
||||
// Get super_klass value into r0 (even if it was in r5 or r2).
|
||||
RegSet pushed_registers;
|
||||
if (!IS_A_TEMP(r2)) pushed_registers += r2;
|
||||
if (!IS_A_TEMP(r5)) pushed_registers += r5;
|
||||
@ -1235,6 +1234,11 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass,
|
||||
|
||||
push(pushed_registers, sp);
|
||||
|
||||
// Get super_klass value into r0 (even if it was in r5 or r2).
|
||||
if (super_klass != r0) {
|
||||
mov(r0, super_klass);
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
mov(rscratch2, (address)&SharedRuntime::_partial_subtype_ctr);
|
||||
Address pst_counter_addr(rscratch2);
|
||||
|
||||
@ -2937,7 +2937,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_t
|
||||
|
||||
// Exception pending
|
||||
|
||||
RegisterSaver::restore_live_registers(masm);
|
||||
RegisterSaver::restore_live_registers(masm, save_vectors);
|
||||
|
||||
__ far_jump(RuntimeAddress(StubRoutines::forward_exception_entry()));
|
||||
|
||||
|
||||
@ -1351,7 +1351,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
BLOCK_COMMENT("Entry:");
|
||||
}
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_DISJOINT;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -1425,7 +1425,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ cmp(rscratch1, count, Assembler::LSL, exact_log2(size));
|
||||
__ br(Assembler::HS, nooverlap_target);
|
||||
|
||||
DecoratorSet decorators = 0;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -1789,7 +1789,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
}
|
||||
#endif //ASSERT
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_CHECKCAST;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST;
|
||||
bool is_oop = true;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
@ -3851,7 +3851,9 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ sub(cnt1, cnt1, 8 * wordSize);
|
||||
__ eor(tmp7, tmp7, tmp8);
|
||||
__ ldp(tmp2, tmp4, Address(__ post(a2, 2 * wordSize)));
|
||||
__ cmp(cnt1, loopThreshold);
|
||||
// tmp6 is not used. MacroAssembler::subs is used here (rather than
|
||||
// cmp) because subs allows an unlimited range of immediate operand.
|
||||
__ subs(tmp6, cnt1, loopThreshold);
|
||||
__ orr(tmp5, tmp5, tmp7);
|
||||
__ cbnz(tmp5, NOT_EQUAL);
|
||||
__ br(__ GE, LOOP);
|
||||
@ -3877,7 +3879,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ ld1(v0, v1, v2, v3, __ T2D, Address(__ post(a1, 4 * 2 * wordSize)));
|
||||
__ sub(cnt1, cnt1, 8 * wordSize);
|
||||
__ ld1(v4, v5, v6, v7, __ T2D, Address(__ post(a2, 4 * 2 * wordSize)));
|
||||
__ cmp(cnt1, loopThreshold);
|
||||
__ subs(tmp1, cnt1, loopThreshold);
|
||||
__ eor(v0, __ T16B, v0, v4);
|
||||
__ eor(v1, __ T16B, v1, v5);
|
||||
__ eor(v2, __ T16B, v2, v6);
|
||||
@ -3936,7 +3938,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
}
|
||||
if (UseSIMDForArrayEquals) {
|
||||
if (SoftwarePrefetchHintDistance >= 0) {
|
||||
__ cmp(cnt1, prefetchLoopThreshold);
|
||||
__ subs(tmp1, cnt1, prefetchLoopThreshold);
|
||||
__ br(__ LE, NO_PREFETCH_LARGE_LOOP);
|
||||
generate_large_array_equals_loop_simd(prefetchLoopThreshold,
|
||||
/* prfm = */ true, NOT_EQUAL);
|
||||
@ -3949,7 +3951,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
} else {
|
||||
__ push(spilled_regs, sp);
|
||||
if (SoftwarePrefetchHintDistance >= 0) {
|
||||
__ cmp(cnt1, prefetchLoopThreshold);
|
||||
__ subs(tmp1, cnt1, prefetchLoopThreshold);
|
||||
__ br(__ LE, NO_PREFETCH_LARGE_LOOP);
|
||||
generate_large_array_equals_loop_nonsimd(prefetchLoopThreshold,
|
||||
/* prfm = */ true, NOT_EQUAL);
|
||||
|
||||
@ -1522,7 +1522,8 @@ void LIRGenerator::do_If(If* x) {
|
||||
|
||||
// add safepoint before generating condition code so it can be recomputed
|
||||
if (x->is_safepoint()) {
|
||||
increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci());
|
||||
increment_backedge_counter_conditionally(lir_cond(cond), left, right, state_for(x, x->state_before()),
|
||||
x->tsux()->bci(), x->fsux()->bci(), x->profiled_bci());
|
||||
__ safepoint(LIR_OprFact::illegalOpr, state_for(x, x->state_before()));
|
||||
}
|
||||
|
||||
|
||||
@ -2945,7 +2945,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ push(LR);
|
||||
#endif // AARCH64
|
||||
|
||||
DecoratorSet decorators = 0;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY;
|
||||
if (disjoint) {
|
||||
decorators |= ARRAYCOPY_DISJOINT;
|
||||
}
|
||||
@ -3217,7 +3217,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
pushed+=1;
|
||||
#endif // AARCH64
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_CHECKCAST;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST;
|
||||
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->arraycopy_prologue(_masm, decorators, true, to, count, callee_saved_regs);
|
||||
|
||||
@ -1157,7 +1157,8 @@ void LIRGenerator::do_If(If* x) {
|
||||
// Add safepoint before generating condition code so it can be recomputed.
|
||||
if (x->is_safepoint()) {
|
||||
// Increment backedge counter if needed.
|
||||
increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci());
|
||||
increment_backedge_counter_conditionally(lir_cond(cond), left, right, state_for(x, x->state_before()),
|
||||
x->tsux()->bci(), x->fsux()->bci(), x->profiled_bci());
|
||||
__ safepoint(safepoint_poll_register(), state_for(x, x->state_before()));
|
||||
}
|
||||
|
||||
|
||||
@ -304,15 +304,15 @@ void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet deco
|
||||
|
||||
void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Register base, RegisterOrConstant ind_or_offs, Register dst,
|
||||
Register tmp1, Register tmp2, bool needs_frame, Label *is_null) {
|
||||
Register tmp1, Register tmp2, bool needs_frame, Label *L_handle_null) {
|
||||
bool on_oop = type == T_OBJECT || type == T_ARRAY;
|
||||
bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
|
||||
bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
|
||||
bool on_reference = on_weak || on_phantom;
|
||||
Label done;
|
||||
if (on_oop && on_reference && is_null == NULL) { is_null = &done; }
|
||||
if (on_oop && on_reference && L_handle_null == NULL) { L_handle_null = &done; }
|
||||
// Load the value of the referent field.
|
||||
ModRefBarrierSetAssembler::load_at(masm, decorators, type, base, ind_or_offs, dst, tmp1, tmp2, needs_frame, is_null);
|
||||
ModRefBarrierSetAssembler::load_at(masm, decorators, type, base, ind_or_offs, dst, tmp1, tmp2, needs_frame, L_handle_null);
|
||||
if (on_oop && on_reference) {
|
||||
// Generate the G1 pre-barrier code to log the value of
|
||||
// the referent field in an SATB buffer. Note with
|
||||
|
||||
@ -61,7 +61,7 @@ public:
|
||||
|
||||
virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Register base, RegisterOrConstant ind_or_offs, Register dst,
|
||||
Register tmp1, Register tmp2, bool needs_frame, Label *is_null = NULL);
|
||||
Register tmp1, Register tmp2, bool needs_frame, Label *L_handle_null = NULL);
|
||||
|
||||
virtual void resolve_jobject(MacroAssembler* masm, Register value, Register tmp1, Register tmp2, bool needs_frame);
|
||||
};
|
||||
|
||||
@ -65,9 +65,10 @@ void BarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators
|
||||
|
||||
void BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Register base, RegisterOrConstant ind_or_offs, Register dst,
|
||||
Register tmp1, Register tmp2, bool needs_frame, Label *is_null) {
|
||||
bool on_heap = (decorators & IN_HEAP) != 0;
|
||||
bool on_root = (decorators & IN_ROOT) != 0;
|
||||
Register tmp1, Register tmp2, bool needs_frame, Label *L_handle_null) {
|
||||
bool on_heap = (decorators & IN_HEAP) != 0;
|
||||
bool on_root = (decorators & IN_ROOT) != 0;
|
||||
bool not_null = (decorators & OOP_NOT_NULL) != 0;
|
||||
assert(on_heap || on_root, "where?");
|
||||
assert_different_registers(ind_or_offs.register_or_noreg(), dst, R0);
|
||||
|
||||
@ -75,19 +76,24 @@ void BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators,
|
||||
case T_ARRAY:
|
||||
case T_OBJECT: {
|
||||
if (UseCompressedOops && on_heap) {
|
||||
__ lwz(dst, ind_or_offs, base);
|
||||
if (is_null) {
|
||||
if (L_handle_null != NULL) { // Label provided.
|
||||
__ lwz(dst, ind_or_offs, base);
|
||||
__ cmpwi(CCR0, dst, 0);
|
||||
__ beq(CCR0, *is_null);
|
||||
__ beq(CCR0, *L_handle_null);
|
||||
__ decode_heap_oop_not_null(dst);
|
||||
} else {
|
||||
} else if (not_null) { // Guaranteed to be not null.
|
||||
Register narrowOop = (tmp1 != noreg && Universe::narrow_oop_base_disjoint()) ? tmp1 : dst;
|
||||
__ lwz(narrowOop, ind_or_offs, base);
|
||||
__ decode_heap_oop_not_null(dst, narrowOop);
|
||||
} else { // Any oop.
|
||||
__ lwz(dst, ind_or_offs, base);
|
||||
__ decode_heap_oop(dst);
|
||||
}
|
||||
} else {
|
||||
__ ld(dst, ind_or_offs, base);
|
||||
if (is_null) {
|
||||
if (L_handle_null != NULL) {
|
||||
__ cmpdi(CCR0, dst, 0);
|
||||
__ beq(CCR0, *is_null);
|
||||
__ beq(CCR0, *L_handle_null);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -45,7 +45,7 @@ public:
|
||||
|
||||
virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Register base, RegisterOrConstant ind_or_offs, Register dst,
|
||||
Register tmp1, Register tmp2, bool needs_frame, Label *is_null = NULL);
|
||||
Register tmp1, Register tmp2, bool needs_frame, Label *L_handle_null = NULL);
|
||||
|
||||
virtual void resolve_jobject(MacroAssembler* masm, Register value, Register tmp1, Register tmp2, bool needs_frame);
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
Register tmp1, Register tmp2, Register tmp3, Label &ok_is_subtype);
|
||||
|
||||
// Load object from cpool->resolved_references(index).
|
||||
void load_resolved_reference_at_index(Register result, Register index, Label *is_null = NULL);
|
||||
void load_resolved_reference_at_index(Register result, Register index, Label *L_handle_null = NULL);
|
||||
|
||||
// load cpool->resolved_klass_at(index)
|
||||
void load_resolved_klass_at_offset(Register Rcpool, Register Roffset, Register Rklass);
|
||||
|
||||
@ -471,7 +471,7 @@ void InterpreterMacroAssembler::get_u4(Register Rdst, Register Rsrc, int offset,
|
||||
}
|
||||
|
||||
// Load object from cpool->resolved_references(index).
|
||||
void InterpreterMacroAssembler::load_resolved_reference_at_index(Register result, Register index, Label *is_null) {
|
||||
void InterpreterMacroAssembler::load_resolved_reference_at_index(Register result, Register index, Label *L_handle_null) {
|
||||
assert_different_registers(result, index);
|
||||
get_constant_pool(result);
|
||||
|
||||
@ -494,8 +494,7 @@ void InterpreterMacroAssembler::load_resolved_reference_at_index(Register result
|
||||
#endif
|
||||
// Add in the index.
|
||||
add(result, tmp, result);
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->load_at(this, IN_HEAP, T_OBJECT, result, arrayOopDesc::base_offset_in_bytes(T_OBJECT), result, tmp, R0, false, is_null);
|
||||
load_heap_oop(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT), result, tmp, R0, false, 0, L_handle_null);
|
||||
}
|
||||
|
||||
// load cpool->resolved_klass_at(index)
|
||||
|
||||
@ -2045,7 +2045,8 @@ void MacroAssembler::check_method_handle_type(Register mtype_reg, Register mh_re
|
||||
Label& wrong_method_type) {
|
||||
assert_different_registers(mtype_reg, mh_reg, temp_reg);
|
||||
// Compare method type against that of the receiver.
|
||||
load_heap_oop_not_null(temp_reg, delayed_value(java_lang_invoke_MethodHandle::type_offset_in_bytes, temp_reg), mh_reg);
|
||||
load_heap_oop(temp_reg, delayed_value(java_lang_invoke_MethodHandle::type_offset_in_bytes, temp_reg), mh_reg,
|
||||
noreg, noreg, false, OOP_NOT_NULL);
|
||||
cmpd(CCR0, temp_reg, mtype_reg);
|
||||
bne(CCR0, wrong_method_type);
|
||||
}
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
#define CPU_PPC_VM_MACROASSEMBLER_PPC_HPP
|
||||
|
||||
#include "asm/assembler.hpp"
|
||||
#include "oops/accessDecorators.hpp"
|
||||
#include "runtime/rtmLocking.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
@ -691,17 +692,26 @@ class MacroAssembler: public Assembler {
|
||||
inline void null_check_throw(Register a, int offset, Register temp_reg, address exception_entry);
|
||||
inline void null_check(Register a, int offset, Label *Lis_null); // implicit only if Lis_null not provided
|
||||
|
||||
// Load heap oop and decompress. Loaded oop may not be null.
|
||||
// Specify tmp to save one cycle.
|
||||
inline void load_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1 = noreg,
|
||||
Register tmp = noreg);
|
||||
// Store heap oop and decompress. Decompressed oop may not be null.
|
||||
// Specify tmp register if d should not be changed.
|
||||
inline void store_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1,
|
||||
Register tmp = noreg);
|
||||
// Access heap oop, handle encoding and GC barriers.
|
||||
// Some GC barriers call C so use needs_frame = true if an extra frame is needed at the current call site.
|
||||
private:
|
||||
inline void access_store_at(BasicType type, DecoratorSet decorators,
|
||||
Register base, RegisterOrConstant ind_or_offs, Register val,
|
||||
Register tmp1, Register tmp2, Register tmp3, bool needs_frame);
|
||||
inline void access_load_at(BasicType type, DecoratorSet decorators,
|
||||
Register base, RegisterOrConstant ind_or_offs, Register dst,
|
||||
Register tmp1, Register tmp2, bool needs_frame, Label *L_handle_null = NULL);
|
||||
|
||||
// Null allowed.
|
||||
inline void load_heap_oop(Register d, RegisterOrConstant offs, Register s1 = noreg, Label *is_null = NULL);
|
||||
public:
|
||||
// Specify tmp1 for better code in certain compressed oops cases. Specify Label to bail out on null oop.
|
||||
// tmp1, tmp2 and needs_frame are used with decorators ON_PHANTOM_OOP_REF or ON_WEAK_OOP_REF.
|
||||
inline void load_heap_oop(Register d, RegisterOrConstant offs, Register s1,
|
||||
Register tmp1, Register tmp2, bool needs_frame,
|
||||
DecoratorSet decorators = 0, Label *L_handle_null = NULL);
|
||||
|
||||
inline void store_heap_oop(Register d, RegisterOrConstant offs, Register s1,
|
||||
Register tmp1, Register tmp2, Register tmp3, bool needs_frame,
|
||||
DecoratorSet decorators = 0);
|
||||
|
||||
// Encode/decode heap oop. Oop may not be null, else en/decoding goes wrong.
|
||||
// src == d allowed.
|
||||
|
||||
@ -30,6 +30,8 @@
|
||||
#include "asm/macroAssembler.hpp"
|
||||
#include "asm/codeBuffer.hpp"
|
||||
#include "code/codeCache.hpp"
|
||||
#include "gc/shared/barrierSet.hpp"
|
||||
#include "gc/shared/barrierSetAssembler.hpp"
|
||||
#include "runtime/safepointMechanism.hpp"
|
||||
|
||||
inline bool MacroAssembler::is_ld_largeoffset(address a) {
|
||||
@ -323,45 +325,52 @@ inline void MacroAssembler::null_check(Register a, int offset, Label *Lis_null)
|
||||
}
|
||||
}
|
||||
|
||||
inline void MacroAssembler::load_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1, Register tmp) {
|
||||
if (UseCompressedOops) {
|
||||
// In disjoint mode decoding can save a cycle if src != dst.
|
||||
Register narrowOop = (tmp != noreg && Universe::narrow_oop_base_disjoint()) ? tmp : d;
|
||||
lwz(narrowOop, offs, s1);
|
||||
// Attention: no null check here!
|
||||
Register res = decode_heap_oop_not_null(d, narrowOop);
|
||||
assert(res == d, "caller will not consume loaded value");
|
||||
inline void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
|
||||
Register base, RegisterOrConstant ind_or_offs, Register val,
|
||||
Register tmp1, Register tmp2, Register tmp3, bool needs_frame) {
|
||||
assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
|
||||
ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator");
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::store_at(this, decorators, type,
|
||||
base, ind_or_offs, val,
|
||||
tmp1, tmp2, tmp3, needs_frame);
|
||||
} else {
|
||||
ld(d, offs, s1);
|
||||
bs->store_at(this, decorators, type,
|
||||
base, ind_or_offs, val,
|
||||
tmp1, tmp2, tmp3, needs_frame);
|
||||
}
|
||||
}
|
||||
|
||||
inline void MacroAssembler::store_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1, Register tmp) {
|
||||
if (UseCompressedOops) {
|
||||
Register compressedOop = encode_heap_oop_not_null((tmp != noreg) ? tmp : d, d);
|
||||
stw(compressedOop, offs, s1);
|
||||
inline void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
|
||||
Register base, RegisterOrConstant ind_or_offs, Register dst,
|
||||
Register tmp1, Register tmp2, bool needs_frame, Label *L_handle_null) {
|
||||
assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
|
||||
ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator");
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::load_at(this, decorators, type,
|
||||
base, ind_or_offs, dst,
|
||||
tmp1, tmp2, needs_frame, L_handle_null);
|
||||
} else {
|
||||
std(d, offs, s1);
|
||||
bs->load_at(this, decorators, type,
|
||||
base, ind_or_offs, dst,
|
||||
tmp1, tmp2, needs_frame, L_handle_null);
|
||||
}
|
||||
}
|
||||
|
||||
inline void MacroAssembler::load_heap_oop(Register d, RegisterOrConstant offs, Register s1, Label *is_null) {
|
||||
if (UseCompressedOops) {
|
||||
lwz(d, offs, s1);
|
||||
if (is_null != NULL) {
|
||||
cmpwi(CCR0, d, 0);
|
||||
beq(CCR0, *is_null);
|
||||
decode_heap_oop_not_null(d);
|
||||
} else {
|
||||
decode_heap_oop(d);
|
||||
}
|
||||
} else {
|
||||
ld(d, offs, s1);
|
||||
if (is_null != NULL) {
|
||||
cmpdi(CCR0, d, 0);
|
||||
beq(CCR0, *is_null);
|
||||
}
|
||||
}
|
||||
inline void MacroAssembler::load_heap_oop(Register d, RegisterOrConstant offs, Register s1,
|
||||
Register tmp1, Register tmp2,
|
||||
bool needs_frame, DecoratorSet decorators, Label *L_handle_null) {
|
||||
access_load_at(T_OBJECT, IN_HEAP | decorators, s1, offs, d, tmp1, tmp2, needs_frame, L_handle_null);
|
||||
}
|
||||
|
||||
inline void MacroAssembler::store_heap_oop(Register d, RegisterOrConstant offs, Register s1,
|
||||
Register tmp1, Register tmp2, Register tmp3,
|
||||
bool needs_frame, DecoratorSet decorators) {
|
||||
access_store_at(T_OBJECT, IN_HEAP | decorators, s1, offs, d, tmp1, tmp2, tmp3, needs_frame);
|
||||
}
|
||||
|
||||
inline Register MacroAssembler::encode_heap_oop_not_null(Register d, Register src) {
|
||||
|
||||
@ -173,11 +173,14 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
|
||||
|
||||
// Load the invoker, as MH -> MH.form -> LF.vmentry
|
||||
__ verify_oop(recv);
|
||||
__ load_heap_oop_not_null(method_temp, NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes()), recv, temp2);
|
||||
__ load_heap_oop(method_temp, NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes()), recv,
|
||||
temp2, noreg, false, OOP_NOT_NULL);
|
||||
__ verify_oop(method_temp);
|
||||
__ load_heap_oop_not_null(method_temp, NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes()), method_temp, temp2);
|
||||
__ load_heap_oop(method_temp, NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes()), method_temp,
|
||||
temp2, noreg, false, OOP_NOT_NULL);
|
||||
__ verify_oop(method_temp);
|
||||
__ load_heap_oop_not_null(method_temp, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), method_temp);
|
||||
__ load_heap_oop(method_temp, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), method_temp,
|
||||
temp2, noreg, false, OOP_NOT_NULL);
|
||||
__ verify_oop(method_temp);
|
||||
__ ld(method_temp, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes()), method_temp);
|
||||
|
||||
@ -338,7 +341,8 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
if (VerifyMethodHandles && iid != vmIntrinsics::_linkToInterface) {
|
||||
Label L_ok;
|
||||
Register temp2_defc = temp2;
|
||||
__ load_heap_oop_not_null(temp2_defc, NONZERO(java_lang_invoke_MemberName::clazz_offset_in_bytes()), member_reg, temp3);
|
||||
__ load_heap_oop(temp2_defc, NONZERO(java_lang_invoke_MemberName::clazz_offset_in_bytes()), member_reg,
|
||||
temp3, noreg, false, OOP_NOT_NULL);
|
||||
load_klass_from_Class(_masm, temp2_defc, temp3, temp4);
|
||||
__ verify_klass_ptr(temp2_defc);
|
||||
__ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, temp4, L_ok);
|
||||
@ -365,7 +369,8 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
if (VerifyMethodHandles) {
|
||||
verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp2);
|
||||
}
|
||||
__ load_heap_oop(R19_method, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), member_reg);
|
||||
__ load_heap_oop(R19_method, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), member_reg,
|
||||
temp3, noreg, false, OOP_NOT_NULL);
|
||||
__ ld(R19_method, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes()), R19_method);
|
||||
break;
|
||||
|
||||
@ -373,7 +378,8 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
if (VerifyMethodHandles) {
|
||||
verify_ref_kind(_masm, JVM_REF_invokeStatic, member_reg, temp2);
|
||||
}
|
||||
__ load_heap_oop(R19_method, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), member_reg);
|
||||
__ load_heap_oop(R19_method, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), member_reg,
|
||||
temp3, noreg, false, OOP_NOT_NULL);
|
||||
__ ld(R19_method, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes()), R19_method);
|
||||
break;
|
||||
|
||||
@ -415,7 +421,8 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
}
|
||||
|
||||
Register temp2_intf = temp2;
|
||||
__ load_heap_oop_not_null(temp2_intf, NONZERO(java_lang_invoke_MemberName::clazz_offset_in_bytes()), member_reg, temp3);
|
||||
__ load_heap_oop(temp2_intf, NONZERO(java_lang_invoke_MemberName::clazz_offset_in_bytes()), member_reg,
|
||||
temp3, noreg, false, OOP_NOT_NULL);
|
||||
load_klass_from_Class(_masm, temp2_intf, temp3, temp4);
|
||||
__ verify_klass_ptr(temp2_intf);
|
||||
|
||||
|
||||
@ -2024,7 +2024,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
STUB_ENTRY(arrayof_oop_disjoint_arraycopy) :
|
||||
STUB_ENTRY(oop_disjoint_arraycopy);
|
||||
|
||||
DecoratorSet decorators = 0;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -2063,7 +2063,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
address start = __ function_entry();
|
||||
assert_positive_int(R5_ARG3);
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_DISJOINT;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -2159,7 +2159,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
}
|
||||
#endif
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_CHECKCAST;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -2198,7 +2198,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
// ======== loop entry is here ========
|
||||
__ bind(load_element);
|
||||
__ load_heap_oop(R10_oop, R8_offset, R3_from, &store_null); // Load the oop.
|
||||
__ load_heap_oop(R10_oop, R8_offset, R3_from, R12_tmp, noreg, false, AS_RAW, &store_null);
|
||||
|
||||
__ load_klass(R11_klass, R10_oop); // Query the object klass.
|
||||
|
||||
|
||||
@ -524,11 +524,8 @@ address TemplateInterpreterGenerator::generate_Reference_get_entry(void) {
|
||||
__ cmpdi(CCR0, R3_RET, 0);
|
||||
__ beq(CCR0, slow_path);
|
||||
|
||||
// Load the value of the referent field.
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->load_at(_masm, IN_HEAP | ON_WEAK_OOP_REF, T_OBJECT,
|
||||
R3_RET, referent_offset, R3_RET,
|
||||
/* non-volatile temp */ R31, R11_scratch1, true);
|
||||
__ load_heap_oop(R3_RET, referent_offset, R3_RET,
|
||||
/* non-volatile temp */ R31, R11_scratch1, true, ON_WEAK_OOP_REF);
|
||||
|
||||
// Generate the G1 pre-barrier code to log the value of
|
||||
// the referent field in an SATB buffer. Note with
|
||||
|
||||
@ -62,8 +62,7 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
|
||||
Register tmp3,
|
||||
DecoratorSet decorators) {
|
||||
assert_different_registers(tmp1, tmp2, tmp3, val, base);
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->store_at(_masm, decorators, T_OBJECT, base, offset, val, tmp1, tmp2, tmp3, false);
|
||||
__ store_heap_oop(val, offset, base, tmp1, tmp2, tmp3, false, decorators);
|
||||
}
|
||||
|
||||
static void do_oop_load(InterpreterMacroAssembler* _masm,
|
||||
@ -75,8 +74,7 @@ static void do_oop_load(InterpreterMacroAssembler* _masm,
|
||||
DecoratorSet decorators) {
|
||||
assert_different_registers(base, tmp1, tmp2);
|
||||
assert_different_registers(dst, tmp1, tmp2);
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->load_at(_masm, decorators, T_OBJECT, base, offset, dst, tmp1, tmp2, false);
|
||||
__ load_heap_oop(dst, offset, base, tmp1, tmp2, false, decorators);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
80
src/hotspot/cpu/ppc/vm_version_ext_ppc.cpp
Normal file
80
src/hotspot/cpu/ppc/vm_version_ext_ppc.cpp
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "jvm.h"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "vm_version_ext_ppc.hpp"
|
||||
|
||||
// VM_Version_Ext statics
|
||||
int VM_Version_Ext::_no_of_threads = 0;
|
||||
int VM_Version_Ext::_no_of_cores = 0;
|
||||
int VM_Version_Ext::_no_of_sockets = 0;
|
||||
char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0};
|
||||
char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0};
|
||||
|
||||
// get cpu information.
|
||||
bool VM_Version_Ext::initialize_cpu_information(void) {
|
||||
// Not yet implemented.
|
||||
return false;
|
||||
}
|
||||
|
||||
int VM_Version_Ext::number_of_threads(void) {
|
||||
initialize_cpu_information();
|
||||
return _no_of_threads;
|
||||
}
|
||||
|
||||
int VM_Version_Ext::number_of_cores(void) {
|
||||
initialize_cpu_information();
|
||||
return _no_of_cores;
|
||||
}
|
||||
|
||||
int VM_Version_Ext::number_of_sockets(void) {
|
||||
initialize_cpu_information();
|
||||
return _no_of_sockets;
|
||||
}
|
||||
|
||||
const char* VM_Version_Ext::cpu_name(void) {
|
||||
if (!initialize_cpu_information()) {
|
||||
return NULL;
|
||||
}
|
||||
char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing);
|
||||
if (NULL == tmp) {
|
||||
return NULL;
|
||||
}
|
||||
strncpy(tmp, _cpu_name, CPU_TYPE_DESC_BUF_SIZE);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
const char* VM_Version_Ext::cpu_description(void) {
|
||||
if (!initialize_cpu_information()) {
|
||||
return NULL;
|
||||
}
|
||||
char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_DETAILED_DESC_BUF_SIZE, mtTracing);
|
||||
if (NULL == tmp) {
|
||||
return NULL;
|
||||
}
|
||||
strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE);
|
||||
return tmp;
|
||||
}
|
||||
61
src/hotspot/cpu/ppc/vm_version_ext_ppc.hpp
Normal file
61
src/hotspot/cpu/ppc/vm_version_ext_ppc.hpp
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_PPC_VM_VM_VERSION_EXT_PPC_HPP
|
||||
#define CPU_PPC_VM_VM_VERSION_EXT_PPC_HPP
|
||||
|
||||
#include "utilities/macros.hpp"
|
||||
#include "vm_version_ppc.hpp"
|
||||
|
||||
#define CPU_INFO "cpu_info"
|
||||
#define CPU_TYPE "fpu_type"
|
||||
#define CPU_DESCRIPTION "implementation"
|
||||
#define CHIP_ID "chip_id"
|
||||
#define CORE_ID "core_id"
|
||||
|
||||
class VM_Version_Ext : public VM_Version {
|
||||
private:
|
||||
|
||||
static const size_t CPU_TYPE_DESC_BUF_SIZE = 256;
|
||||
static const size_t CPU_DETAILED_DESC_BUF_SIZE = 4096;
|
||||
|
||||
static int _no_of_threads;
|
||||
static int _no_of_cores;
|
||||
static int _no_of_sockets;
|
||||
static char _cpu_name[CPU_TYPE_DESC_BUF_SIZE];
|
||||
static char _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE];
|
||||
|
||||
static bool initialize_cpu_information(void);
|
||||
|
||||
public:
|
||||
|
||||
static int number_of_threads(void);
|
||||
static int number_of_cores(void);
|
||||
static int number_of_sockets(void);
|
||||
|
||||
static const char* cpu_name(void);
|
||||
static const char* cpu_description(void);
|
||||
};
|
||||
|
||||
#endif // CPU_PPC_VM_VM_VERSION_EXT_PPC_HPP
|
||||
@ -37,7 +37,15 @@
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "vm_version_ppc.hpp"
|
||||
|
||||
# include <sys/sysinfo.h>
|
||||
#include <sys/sysinfo.h>
|
||||
|
||||
#if defined(LINUX) && defined(VM_LITTLE_ENDIAN)
|
||||
#include <sys/auxv.h>
|
||||
|
||||
#ifndef PPC_FEATURE2_HTM_NOSC
|
||||
#define PPC_FEATURE2_HTM_NOSC (1 << 24)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
bool VM_Version::_is_determine_features_test_running = false;
|
||||
uint64_t VM_Version::_dscr_val = 0;
|
||||
@ -123,7 +131,7 @@ void VM_Version::initialize() {
|
||||
// Create and print feature-string.
|
||||
char buf[(num_features+1) * 16]; // Max 16 chars per feature.
|
||||
jio_snprintf(buf, sizeof(buf),
|
||||
"ppc64%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
|
||||
"ppc64%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
|
||||
(has_fsqrt() ? " fsqrt" : ""),
|
||||
(has_isel() ? " isel" : ""),
|
||||
(has_lxarxeh() ? " lxarxeh" : ""),
|
||||
@ -136,7 +144,6 @@ void VM_Version::initialize() {
|
||||
(has_lqarx() ? " lqarx" : ""),
|
||||
(has_vcipher() ? " aes" : ""),
|
||||
(has_vpmsumb() ? " vpmsumb" : ""),
|
||||
(has_tcheck() ? " tcheck" : ""),
|
||||
(has_mfdscr() ? " mfdscr" : ""),
|
||||
(has_vsx() ? " vsx" : ""),
|
||||
(has_ldbrx() ? " ldbrx" : ""),
|
||||
@ -304,15 +311,15 @@ void VM_Version::initialize() {
|
||||
|
||||
// Adjust RTM (Restricted Transactional Memory) flags.
|
||||
if (UseRTMLocking) {
|
||||
// If CPU or OS are too old:
|
||||
// If CPU or OS do not support TM:
|
||||
// Can't continue because UseRTMLocking affects UseBiasedLocking flag
|
||||
// setting during arguments processing. See use_biased_locking().
|
||||
// VM_Version_init() is executed after UseBiasedLocking is used
|
||||
// in Thread::allocate().
|
||||
if (!has_tcheck()) {
|
||||
vm_exit_during_initialization("RTM instructions are not available on this CPU");
|
||||
if (PowerArchitecturePPC64 < 8) {
|
||||
vm_exit_during_initialization("RTM instructions are not available on this CPU.");
|
||||
}
|
||||
bool os_too_old = true;
|
||||
bool os_support_tm = false;
|
||||
#ifdef AIX
|
||||
// Actually, this is supported since AIX 7.1.. Unfortunately, this first
|
||||
// contained bugs, so that it can only be enabled after AIX 7.1.3.30.
|
||||
@ -322,22 +329,25 @@ void VM_Version::initialize() {
|
||||
// So the tests can not check on subversion 3.30, and we only enable RTM
|
||||
// with AIX 7.2.
|
||||
if (os::Aix::os_version() >= 0x07020000) { // At least AIX 7.2.
|
||||
os_too_old = false;
|
||||
os_support_tm = true;
|
||||
}
|
||||
#endif
|
||||
#ifdef LINUX
|
||||
// At least Linux kernel 4.2, as the problematic behavior of syscalls
|
||||
// being called in the middle of a transaction has been addressed.
|
||||
// Please, refer to commit b4b56f9ecab40f3b4ef53e130c9f6663be491894
|
||||
// in Linux kernel source tree: https://goo.gl/Kc5i7A
|
||||
if (os::Linux::os_version_is_known()) {
|
||||
if (os::Linux::os_version() >= 0x040200)
|
||||
os_too_old = false;
|
||||
} else {
|
||||
vm_exit_during_initialization("RTM can not be enabled: kernel version is unknown.");
|
||||
#if defined(LINUX) && defined(VM_LITTLE_ENDIAN)
|
||||
unsigned long auxv = getauxval(AT_HWCAP2);
|
||||
|
||||
if (auxv & PPC_FEATURE2_HTM_NOSC) {
|
||||
if (auxv & PPC_FEATURE2_HAS_HTM) {
|
||||
// TM on POWER8 and POWER9 in compat mode (VM) is supported by the JVM.
|
||||
// TM on POWER9 DD2.1 NV (baremetal) is not supported by the JVM (TM on
|
||||
// POWER9 DD2.1 NV has a few issues that need a couple of firmware
|
||||
// and kernel workarounds, so there is a new mode only supported
|
||||
// on non-virtualized P9 machines called HTM with no Suspend Mode).
|
||||
// TM on POWER9 D2.2+ NV is not supported at all by Linux.
|
||||
os_support_tm = true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (os_too_old) {
|
||||
if (!os_support_tm) {
|
||||
vm_exit_during_initialization("RTM is not supported on this OS version.");
|
||||
}
|
||||
}
|
||||
@ -680,12 +690,11 @@ void VM_Version::determine_features() {
|
||||
a->lqarx_unchecked(R6, R3_ARG1, R4_ARG2, 1); // code[9] -> lqarx_m
|
||||
a->vcipher(VR0, VR1, VR2); // code[10] -> vcipher
|
||||
a->vpmsumb(VR0, VR1, VR2); // code[11] -> vpmsumb
|
||||
a->tcheck(0); // code[12] -> tcheck
|
||||
a->mfdscr(R0); // code[13] -> mfdscr
|
||||
a->lxvd2x(VSR0, R3_ARG1); // code[14] -> vsx
|
||||
a->ldbrx(R7, R3_ARG1, R4_ARG2); // code[15] -> ldbrx
|
||||
a->stdbrx(R7, R3_ARG1, R4_ARG2); // code[16] -> stdbrx
|
||||
a->vshasigmaw(VR0, VR1, 1, 0xF); // code[17] -> vshasig
|
||||
a->mfdscr(R0); // code[12] -> mfdscr
|
||||
a->lxvd2x(VSR0, R3_ARG1); // code[13] -> vsx
|
||||
a->ldbrx(R7, R3_ARG1, R4_ARG2); // code[14] -> ldbrx
|
||||
a->stdbrx(R7, R3_ARG1, R4_ARG2); // code[15] -> stdbrx
|
||||
a->vshasigmaw(VR0, VR1, 1, 0xF); // code[16] -> vshasig
|
||||
a->blr();
|
||||
|
||||
// Emit function to set one cache line to zero. Emit function descriptor and get pointer to it.
|
||||
@ -732,7 +741,6 @@ void VM_Version::determine_features() {
|
||||
if (code[feature_cntr++]) features |= lqarx_m;
|
||||
if (code[feature_cntr++]) features |= vcipher_m;
|
||||
if (code[feature_cntr++]) features |= vpmsumb_m;
|
||||
if (code[feature_cntr++]) features |= tcheck_m;
|
||||
if (code[feature_cntr++]) features |= mfdscr_m;
|
||||
if (code[feature_cntr++]) features |= vsx_m;
|
||||
if (code[feature_cntr++]) features |= ldbrx_m;
|
||||
|
||||
@ -44,7 +44,6 @@ protected:
|
||||
lqarx,
|
||||
vcipher,
|
||||
vpmsumb,
|
||||
tcheck,
|
||||
mfdscr,
|
||||
vsx,
|
||||
ldbrx,
|
||||
@ -67,7 +66,6 @@ protected:
|
||||
vcipher_m = (1 << vcipher),
|
||||
vshasig_m = (1 << vshasig),
|
||||
vpmsumb_m = (1 << vpmsumb),
|
||||
tcheck_m = (1 << tcheck ),
|
||||
mfdscr_m = (1 << mfdscr ),
|
||||
vsx_m = (1 << vsx ),
|
||||
ldbrx_m = (1 << ldbrx ),
|
||||
@ -103,7 +101,6 @@ public:
|
||||
static bool has_lqarx() { return (_features & lqarx_m) != 0; }
|
||||
static bool has_vcipher() { return (_features & vcipher_m) != 0; }
|
||||
static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; }
|
||||
static bool has_tcheck() { return (_features & tcheck_m) != 0; }
|
||||
static bool has_mfdscr() { return (_features & mfdscr_m) != 0; }
|
||||
static bool has_vsx() { return (_features & vsx_m) != 0; }
|
||||
static bool has_ldbrx() { return (_features & ldbrx_m) != 0; }
|
||||
|
||||
@ -963,17 +963,20 @@ void LIRGenerator::do_If (If* x) {
|
||||
yin->dont_load_item();
|
||||
}
|
||||
|
||||
LIR_Opr left = xin->result();
|
||||
LIR_Opr right = yin->result();
|
||||
|
||||
set_no_result(x);
|
||||
|
||||
// Add safepoint before generating condition code so it can be recomputed.
|
||||
if (x->is_safepoint()) {
|
||||
// Increment backedge counter if needed.
|
||||
increment_backedge_counter(state_for (x, x->state_before()), x->profiled_bci());
|
||||
increment_backedge_counter_conditionally(lir_cond(cond), left, right, state_for(x, x->state_before()),
|
||||
x->tsux()->bci(), x->fsux()->bci(), x->profiled_bci());
|
||||
// Use safepoint_poll_register() instead of LIR_OprFact::illegalOpr.
|
||||
__ safepoint(safepoint_poll_register(), state_for (x, x->state_before()));
|
||||
}
|
||||
set_no_result(x);
|
||||
|
||||
LIR_Opr left = xin->result();
|
||||
LIR_Opr right = yin->result();
|
||||
__ cmp(lir_cond(cond), left, right);
|
||||
// Generate branch profiling. Profiling code doesn't kill flags.
|
||||
profile_branch(x, cond);
|
||||
|
||||
@ -96,14 +96,14 @@ void G1BarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembler* mas
|
||||
}
|
||||
|
||||
void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
const Address& src, Register dst, Register tmp1, Register tmp2, Label *is_null) {
|
||||
const Address& src, Register dst, Register tmp1, Register tmp2, Label *L_handle_null) {
|
||||
bool on_oop = type == T_OBJECT || type == T_ARRAY;
|
||||
bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
|
||||
bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
|
||||
bool on_reference = on_weak || on_phantom;
|
||||
Label done;
|
||||
if (on_oop && on_reference && is_null == NULL) { is_null = &done; }
|
||||
ModRefBarrierSetAssembler::load_at(masm, decorators, type, src, dst, tmp1, tmp2, is_null);
|
||||
if (on_oop && on_reference && L_handle_null == NULL) { L_handle_null = &done; }
|
||||
ModRefBarrierSetAssembler::load_at(masm, decorators, type, src, dst, tmp1, tmp2, L_handle_null);
|
||||
if (on_oop && on_reference) {
|
||||
// Generate the G1 pre-barrier code to log the value of
|
||||
// the referent field in an SATB buffer.
|
||||
|
||||
@ -65,7 +65,7 @@ class G1BarrierSetAssembler: public ModRefBarrierSetAssembler {
|
||||
#endif
|
||||
|
||||
virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
const Address& src, Register dst, Register tmp1, Register tmp2, Label *is_null = NULL);
|
||||
const Address& src, Register dst, Register tmp1, Register tmp2, Label *L_handle_null = NULL);
|
||||
|
||||
virtual void resolve_jobject(MacroAssembler* masm, Register value, Register tmp1, Register tmp2);
|
||||
};
|
||||
|
||||
@ -36,9 +36,10 @@ void BarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, DecoratorSet
|
||||
}
|
||||
|
||||
void BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
const Address& addr, Register dst, Register tmp1, Register tmp2, Label *is_null) {
|
||||
bool on_heap = (decorators & IN_HEAP) != 0;
|
||||
bool on_root = (decorators & IN_ROOT) != 0;
|
||||
const Address& addr, Register dst, Register tmp1, Register tmp2, Label *L_handle_null) {
|
||||
bool on_heap = (decorators & IN_HEAP) != 0;
|
||||
bool on_root = (decorators & IN_ROOT) != 0;
|
||||
bool not_null = (decorators & OOP_NOT_NULL) != 0;
|
||||
assert(on_heap || on_root, "where?");
|
||||
|
||||
switch (type) {
|
||||
@ -46,16 +47,16 @@ void BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators,
|
||||
case T_OBJECT: {
|
||||
if (UseCompressedOops && on_heap) {
|
||||
__ z_llgf(dst, addr);
|
||||
if (is_null) {
|
||||
__ compareU32_and_branch(dst, (intptr_t)0, Assembler::bcondEqual, *is_null);
|
||||
if (L_handle_null != NULL) { // Label provided.
|
||||
__ compareU32_and_branch(dst, (intptr_t)0, Assembler::bcondEqual, *L_handle_null);
|
||||
__ oop_decoder(dst, dst, false);
|
||||
} else {
|
||||
__ oop_decoder(dst, dst, true);
|
||||
__ oop_decoder(dst, dst, !not_null);
|
||||
}
|
||||
} else {
|
||||
__ z_lg(dst, addr);
|
||||
if (is_null) {
|
||||
__ compareU64_and_branch(dst, (intptr_t)0, Assembler::bcondEqual, *is_null);
|
||||
if (L_handle_null != NULL) {
|
||||
__ compareU64_and_branch(dst, (intptr_t)0, Assembler::bcondEqual, *L_handle_null);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -40,7 +40,7 @@ public:
|
||||
Register dst, Register count, bool do_return = false);
|
||||
|
||||
virtual void load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
const Address& addr, Register dst, Register tmp1, Register tmp2, Label *is_null = NULL);
|
||||
const Address& addr, Register dst, Register tmp1, Register tmp2, Label *L_handle_null = NULL);
|
||||
virtual void store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
const Address& addr, Register val, Register tmp1, Register tmp2, Register tmp3);
|
||||
|
||||
|
||||
@ -391,8 +391,7 @@ void InterpreterMacroAssembler::load_resolved_reference_at_index(Register result
|
||||
bind(index_ok);
|
||||
#endif
|
||||
z_agr(result, index); // Address of indexed array element.
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->load_at(this, IN_HEAP, T_OBJECT, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)), result, tmp, noreg);
|
||||
load_heap_oop(result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)), tmp, noreg);
|
||||
}
|
||||
|
||||
// load cpool->resolved_klass_at(index)
|
||||
|
||||
@ -4047,68 +4047,52 @@ void MacroAssembler::compare_heap_oop(Register Rop1, Address mem, bool maybeNULL
|
||||
BLOCK_COMMENT("} compare heap oop");
|
||||
}
|
||||
|
||||
// Load heap oop and decompress, if necessary.
|
||||
void MacroAssembler::load_heap_oop(Register dest, const Address &a) {
|
||||
if (UseCompressedOops) {
|
||||
z_llgf(dest, a.disp(), a.indexOrR0(), a.baseOrR0());
|
||||
oop_decoder(dest, dest, true);
|
||||
void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators,
|
||||
const Address& addr, Register val,
|
||||
Register tmp1, Register tmp2, Register tmp3) {
|
||||
assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
|
||||
ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator");
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::store_at(this, decorators, type,
|
||||
addr, val,
|
||||
tmp1, tmp2, tmp3);
|
||||
} else {
|
||||
z_lg(dest, a.disp(), a.indexOrR0(), a.baseOrR0());
|
||||
bs->store_at(this, decorators, type,
|
||||
addr, val,
|
||||
tmp1, tmp2, tmp3);
|
||||
}
|
||||
}
|
||||
|
||||
// Load heap oop and decompress, if necessary.
|
||||
void MacroAssembler::load_heap_oop(Register dest, int64_t disp, Register base) {
|
||||
if (UseCompressedOops) {
|
||||
z_llgf(dest, disp, base);
|
||||
oop_decoder(dest, dest, true);
|
||||
void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators,
|
||||
const Address& addr, Register dst,
|
||||
Register tmp1, Register tmp2, Label *is_null) {
|
||||
assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_ROOT | OOP_NOT_NULL |
|
||||
ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator");
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bool as_raw = (decorators & AS_RAW) != 0;
|
||||
if (as_raw) {
|
||||
bs->BarrierSetAssembler::load_at(this, decorators, type,
|
||||
addr, dst,
|
||||
tmp1, tmp2, is_null);
|
||||
} else {
|
||||
z_lg(dest, disp, base);
|
||||
bs->load_at(this, decorators, type,
|
||||
addr, dst,
|
||||
tmp1, tmp2, is_null);
|
||||
}
|
||||
}
|
||||
|
||||
// Load heap oop and decompress, if necessary.
|
||||
void MacroAssembler::load_heap_oop_not_null(Register dest, int64_t disp, Register base) {
|
||||
if (UseCompressedOops) {
|
||||
z_llgf(dest, disp, base);
|
||||
oop_decoder(dest, dest, false);
|
||||
} else {
|
||||
z_lg(dest, disp, base);
|
||||
}
|
||||
void MacroAssembler::load_heap_oop(Register dest, const Address &a,
|
||||
Register tmp1, Register tmp2,
|
||||
DecoratorSet decorators, Label *is_null) {
|
||||
access_load_at(T_OBJECT, IN_HEAP | decorators, a, dest, tmp1, tmp2, is_null);
|
||||
}
|
||||
|
||||
// Compress, if necessary, and store oop to heap.
|
||||
void MacroAssembler::store_heap_oop(Register Roop, RegisterOrConstant offset, Register base) {
|
||||
Register Ridx = offset.is_register() ? offset.register_or_noreg() : Z_R0;
|
||||
if (UseCompressedOops) {
|
||||
assert_different_registers(Roop, offset.register_or_noreg(), base);
|
||||
encode_heap_oop(Roop);
|
||||
z_st(Roop, offset.constant_or_zero(), Ridx, base);
|
||||
} else {
|
||||
z_stg(Roop, offset.constant_or_zero(), Ridx, base);
|
||||
}
|
||||
}
|
||||
|
||||
// Compress, if necessary, and store oop to heap. Oop is guaranteed to be not NULL.
|
||||
void MacroAssembler::store_heap_oop_not_null(Register Roop, RegisterOrConstant offset, Register base) {
|
||||
Register Ridx = offset.is_register() ? offset.register_or_noreg() : Z_R0;
|
||||
if (UseCompressedOops) {
|
||||
assert_different_registers(Roop, offset.register_or_noreg(), base);
|
||||
encode_heap_oop_not_null(Roop);
|
||||
z_st(Roop, offset.constant_or_zero(), Ridx, base);
|
||||
} else {
|
||||
z_stg(Roop, offset.constant_or_zero(), Ridx, base);
|
||||
}
|
||||
}
|
||||
|
||||
// Store NULL oop to heap.
|
||||
void MacroAssembler::store_heap_oop_null(Register zero, RegisterOrConstant offset, Register base) {
|
||||
Register Ridx = offset.is_register() ? offset.register_or_noreg() : Z_R0;
|
||||
if (UseCompressedOops) {
|
||||
z_st(zero, offset.constant_or_zero(), Ridx, base);
|
||||
} else {
|
||||
z_stg(zero, offset.constant_or_zero(), Ridx, base);
|
||||
}
|
||||
void MacroAssembler::store_heap_oop(Register Roop, const Address &a,
|
||||
Register tmp1, Register tmp2, Register tmp3,
|
||||
DecoratorSet decorators) {
|
||||
access_store_at(T_OBJECT, IN_HEAP | decorators, a, Roop, tmp1, tmp2, tmp3);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
#define CPU_S390_VM_MACROASSEMBLER_S390_HPP
|
||||
|
||||
#include "asm/assembler.hpp"
|
||||
#include "oops/accessDecorators.hpp"
|
||||
|
||||
#define MODERN_IFUN(name) ((void (MacroAssembler::*)(Register, int64_t, Register, Register))&MacroAssembler::name)
|
||||
#define CLASSIC_IFUN(name) ((void (MacroAssembler::*)(Register, int64_t, Register, Register))&MacroAssembler::name)
|
||||
@ -804,12 +805,25 @@ class MacroAssembler: public Assembler {
|
||||
int get_oop_base_complement(Register Rbase, uint64_t oop_base);
|
||||
void compare_heap_oop(Register Rop1, Address mem, bool maybeNULL);
|
||||
void compare_klass_ptr(Register Rop1, int64_t disp, Register Rbase, bool maybeNULL);
|
||||
void load_heap_oop(Register dest, const Address &a);
|
||||
void load_heap_oop(Register d, int64_t si16, Register s1);
|
||||
void load_heap_oop_not_null(Register d, int64_t si16, Register s1);
|
||||
void store_heap_oop(Register Roop, RegisterOrConstant offset, Register base);
|
||||
void store_heap_oop_not_null(Register Roop, RegisterOrConstant offset, Register base);
|
||||
void store_heap_oop_null(Register zero, RegisterOrConstant offset, Register base);
|
||||
|
||||
// Access heap oop, handle encoding and GC barriers.
|
||||
private:
|
||||
void access_store_at(BasicType type, DecoratorSet decorators,
|
||||
const Address& addr, Register val,
|
||||
Register tmp1, Register tmp2, Register tmp3);
|
||||
void access_load_at(BasicType type, DecoratorSet decorators,
|
||||
const Address& addr, Register dst,
|
||||
Register tmp1, Register tmp2, Label *is_null = NULL);
|
||||
|
||||
public:
|
||||
// tmp1 and tmp2 are used with decorators ON_PHANTOM_OOP_REF or ON_WEAK_OOP_REF.
|
||||
void load_heap_oop(Register dest, const Address &a,
|
||||
Register tmp1, Register tmp2,
|
||||
DecoratorSet decorators = 0, Label *is_null = NULL);
|
||||
void store_heap_oop(Register Roop, const Address &a,
|
||||
Register tmp1, Register tmp2, Register tmp3,
|
||||
DecoratorSet decorators = 0);
|
||||
|
||||
void oop_encoder(Register Rdst, Register Rsrc, bool maybeNULL,
|
||||
Register Rbase = Z_R1, int pow2_offset = -1, bool only32bitValid = false);
|
||||
void oop_decoder(Register Rdst, Register Rsrc, bool maybeNULL,
|
||||
|
||||
@ -196,16 +196,19 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
|
||||
// Load the invoker, as MH -> MH.form -> LF.vmentry
|
||||
__ verify_oop(recv);
|
||||
__ load_heap_oop(method_temp,
|
||||
Address(recv,
|
||||
NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes())));
|
||||
Address(recv,
|
||||
NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes())),
|
||||
noreg, noreg, OOP_NOT_NULL);
|
||||
__ verify_oop(method_temp);
|
||||
__ load_heap_oop(method_temp,
|
||||
Address(method_temp,
|
||||
NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes())));
|
||||
Address(method_temp,
|
||||
NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes())),
|
||||
noreg, noreg, OOP_NOT_NULL);
|
||||
__ verify_oop(method_temp);
|
||||
__ load_heap_oop(method_temp,
|
||||
Address(method_temp,
|
||||
NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes())));
|
||||
Address(method_temp,
|
||||
NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes())),
|
||||
noreg, noreg, OOP_NOT_NULL);
|
||||
__ verify_oop(method_temp);
|
||||
__ z_lg(method_temp,
|
||||
Address(method_temp,
|
||||
@ -405,7 +408,8 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
NearLabel L_ok;
|
||||
Register temp2_defc = temp2;
|
||||
|
||||
__ load_heap_oop(temp2_defc, member_clazz);
|
||||
__ load_heap_oop(temp2_defc, member_clazz,
|
||||
noreg, noreg, OOP_NOT_NULL);
|
||||
load_klass_from_Class(_masm, temp2_defc, temp3, temp4);
|
||||
__ verify_klass_ptr(temp2_defc);
|
||||
__ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, temp4, L_ok);
|
||||
@ -431,7 +435,8 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
if (VerifyMethodHandles) {
|
||||
verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp3);
|
||||
}
|
||||
__ load_heap_oop(Z_method, member_vmtarget);
|
||||
__ load_heap_oop(Z_method, member_vmtarget,
|
||||
noreg, noreg, OOP_NOT_NULL);
|
||||
__ z_lg(Z_method, vmtarget_method);
|
||||
method_is_live = true;
|
||||
break;
|
||||
@ -440,7 +445,8 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
if (VerifyMethodHandles) {
|
||||
verify_ref_kind(_masm, JVM_REF_invokeStatic, member_reg, temp3);
|
||||
}
|
||||
__ load_heap_oop(Z_method, member_vmtarget);
|
||||
__ load_heap_oop(Z_method, member_vmtarget,
|
||||
noreg, noreg, OOP_NOT_NULL);
|
||||
__ z_lg(Z_method, vmtarget_method);
|
||||
method_is_live = true;
|
||||
break;
|
||||
@ -481,7 +487,8 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
|
||||
|
||||
Register temp3_intf = temp3;
|
||||
|
||||
__ load_heap_oop(temp3_intf, member_clazz);
|
||||
__ load_heap_oop(temp3_intf, member_clazz,
|
||||
noreg, noreg, OOP_NOT_NULL);
|
||||
load_klass_from_Class(_masm, temp3_intf, temp2, temp4);
|
||||
|
||||
Register Z_index = Z_method;
|
||||
|
||||
@ -2239,8 +2239,8 @@ encode %{
|
||||
// Go through the vtable. Get receiver klass. Receiver already
|
||||
// checked for non-null. If we'll go thru a C2I adapter, the
|
||||
// interpreter expects method in Z_method.
|
||||
// Use Z_method to temporarily hold the klass oop. Z_R1_scratch is destroyed
|
||||
// by load_heap_oop_not_null.
|
||||
// Use Z_method to temporarily hold the klass oop.
|
||||
// Z_R1_scratch is destroyed.
|
||||
__ load_klass(Z_method, Z_R2);
|
||||
|
||||
int entry_offset = in_bytes(Klass::vtable_start_offset()) + vtable_index * vtableEntry::size_in_bytes();
|
||||
|
||||
@ -1300,7 +1300,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
unsigned int start_off = __ offset(); // Remember stub start address (is rtn value).
|
||||
unsigned int size = UseCompressedOops ? 4 : 8;
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_DISJOINT;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -1392,7 +1392,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// Branch to disjoint_copy (if applicable) before pre_barrier to avoid double pre_barrier.
|
||||
array_overlap_test(nooverlap_target, shift); // Branch away to nooverlap_target if disjoint.
|
||||
|
||||
DecoratorSet decorators = 0;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
@ -512,9 +512,7 @@ address TemplateInterpreterGenerator::generate_Reference_get_entry(void) {
|
||||
__ z_bre(slow_path);
|
||||
|
||||
// Load the value of the referent field.
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->load_at(_masm, IN_HEAP | ON_WEAK_OOP_REF, T_OBJECT,
|
||||
Address(pre_val, referent_offset), pre_val, scratch1, scratch2);
|
||||
__ load_heap_oop(pre_val, Address(pre_val, referent_offset), scratch1, scratch2, ON_WEAK_OOP_REF);
|
||||
|
||||
// Restore caller sp for c2i case.
|
||||
__ resize_frame_absolute(Z_R10, Z_R0, true); // Cut the stack back to where the caller started.
|
||||
|
||||
@ -200,8 +200,7 @@ static void do_oop_store(InterpreterMacroAssembler* _masm,
|
||||
Register tmp3,
|
||||
DecoratorSet decorators) {
|
||||
assert_different_registers(tmp1, tmp2, tmp3, val, addr.base());
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->store_at(_masm, decorators, T_OBJECT, addr, val, tmp1, tmp2, tmp3);
|
||||
__ store_heap_oop(val, addr, tmp1, tmp2, tmp3, decorators);
|
||||
}
|
||||
|
||||
static void do_oop_load(InterpreterMacroAssembler* _masm,
|
||||
@ -212,8 +211,7 @@ static void do_oop_load(InterpreterMacroAssembler* _masm,
|
||||
DecoratorSet decorators) {
|
||||
assert_different_registers(addr.base(), tmp1, tmp2);
|
||||
assert_different_registers(dst, tmp1, tmp2);
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->load_at(_masm, decorators, T_OBJECT, addr, dst, tmp1, tmp2);
|
||||
__ load_heap_oop(dst, addr, tmp1, tmp2, decorators);
|
||||
}
|
||||
|
||||
Address TemplateTable::at_bcp(int offset) {
|
||||
|
||||
80
src/hotspot/cpu/s390/vm_version_ext_s390.cpp
Normal file
80
src/hotspot/cpu/s390/vm_version_ext_s390.cpp
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "jvm.h"
|
||||
#include "memory/allocation.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "vm_version_ext_s390.hpp"
|
||||
|
||||
// VM_Version_Ext statics
|
||||
int VM_Version_Ext::_no_of_threads = 0;
|
||||
int VM_Version_Ext::_no_of_cores = 0;
|
||||
int VM_Version_Ext::_no_of_sockets = 0;
|
||||
char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0};
|
||||
char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0};
|
||||
|
||||
// get cpu information.
|
||||
bool VM_Version_Ext::initialize_cpu_information(void) {
|
||||
// Not yet implemented.
|
||||
return false;
|
||||
}
|
||||
|
||||
int VM_Version_Ext::number_of_threads(void) {
|
||||
initialize_cpu_information();
|
||||
return _no_of_threads;
|
||||
}
|
||||
|
||||
int VM_Version_Ext::number_of_cores(void) {
|
||||
initialize_cpu_information();
|
||||
return _no_of_cores;
|
||||
}
|
||||
|
||||
int VM_Version_Ext::number_of_sockets(void) {
|
||||
initialize_cpu_information();
|
||||
return _no_of_sockets;
|
||||
}
|
||||
|
||||
const char* VM_Version_Ext::cpu_name(void) {
|
||||
if (!initialize_cpu_information()) {
|
||||
return NULL;
|
||||
}
|
||||
char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing);
|
||||
if (NULL == tmp) {
|
||||
return NULL;
|
||||
}
|
||||
strncpy(tmp, _cpu_name, CPU_TYPE_DESC_BUF_SIZE);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
const char* VM_Version_Ext::cpu_description(void) {
|
||||
if (!initialize_cpu_information()) {
|
||||
return NULL;
|
||||
}
|
||||
char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_DETAILED_DESC_BUF_SIZE, mtTracing);
|
||||
if (NULL == tmp) {
|
||||
return NULL;
|
||||
}
|
||||
strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE);
|
||||
return tmp;
|
||||
}
|
||||
61
src/hotspot/cpu/s390/vm_version_ext_s390.hpp
Normal file
61
src/hotspot/cpu/s390/vm_version_ext_s390.hpp
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_S390_VM_VM_VERSION_EXT_S390_HPP
|
||||
#define CPU_S390_VM_VM_VERSION_EXT_S390_HPP
|
||||
|
||||
#include "utilities/macros.hpp"
|
||||
#include "vm_version_s390.hpp"
|
||||
|
||||
#define CPU_INFO "cpu_info"
|
||||
#define CPU_TYPE "fpu_type"
|
||||
#define CPU_DESCRIPTION "implementation"
|
||||
#define CHIP_ID "chip_id"
|
||||
#define CORE_ID "core_id"
|
||||
|
||||
class VM_Version_Ext : public VM_Version {
|
||||
private:
|
||||
|
||||
static const size_t CPU_TYPE_DESC_BUF_SIZE = 256;
|
||||
static const size_t CPU_DETAILED_DESC_BUF_SIZE = 4096;
|
||||
|
||||
static int _no_of_threads;
|
||||
static int _no_of_cores;
|
||||
static int _no_of_sockets;
|
||||
static char _cpu_name[CPU_TYPE_DESC_BUF_SIZE];
|
||||
static char _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE];
|
||||
|
||||
static bool initialize_cpu_information(void);
|
||||
|
||||
public:
|
||||
|
||||
static int number_of_threads(void);
|
||||
static int number_of_cores(void);
|
||||
static int number_of_sockets(void);
|
||||
|
||||
static const char* cpu_name(void);
|
||||
static const char* cpu_description(void);
|
||||
};
|
||||
|
||||
#endif // CPU_S390_VM_VM_VERSION_EXT_S390_HPP
|
||||
@ -1219,7 +1219,8 @@ void LIRGenerator::do_If(If* x) {
|
||||
// add safepoint before generating condition code so it can be recomputed
|
||||
if (x->is_safepoint()) {
|
||||
// increment backedge counter if needed
|
||||
increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci());
|
||||
increment_backedge_counter_conditionally(lir_cond(cond), left, right, state_for(x, x->state_before()),
|
||||
x->tsux()->bci(), x->fsux()->bci(), x->profiled_bci());
|
||||
__ safepoint(safepoint_poll_register(), state_for(x, x->state_before()));
|
||||
}
|
||||
|
||||
|
||||
@ -153,8 +153,13 @@ address JNI_FastGetField::generate_fast_get_long_field() {
|
||||
__ andcc (G4, 1, G0);
|
||||
__ br (Assembler::notZero, false, Assembler::pn, label1);
|
||||
__ delayed()->srl (O2, 2, O4);
|
||||
__ andn (O1, JNIHandles::weak_tag_mask, O1);
|
||||
__ ld_ptr (O1, 0, O5);
|
||||
__ mov(O1, O5);
|
||||
|
||||
// Both O5 and G1 are clobbered by try_resolve_jobject_in_native.
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->try_resolve_jobject_in_native(masm, /* jni_env */ O0, /* obj */ O5, /* tmp */ G1, label1);
|
||||
DEBUG_ONLY(__ set(0xDEADC0DE, G1);)
|
||||
|
||||
__ add (O5, O4, O5);
|
||||
|
||||
assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
|
||||
@ -206,8 +211,12 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
|
||||
__ andcc (G4, 1, G0);
|
||||
__ br (Assembler::notZero, false, Assembler::pn, label1);
|
||||
__ delayed()->srl (O2, 2, O4);
|
||||
__ andn (O1, JNIHandles::weak_tag_mask, O1);
|
||||
__ ld_ptr (O1, 0, O5);
|
||||
__ mov(O1, O5);
|
||||
|
||||
// Both O5 and G3 are clobbered by try_resolve_jobject_in_native.
|
||||
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->try_resolve_jobject_in_native(masm, /* jni_env */ O0, /* obj */ O5, /* tmp */ G3, label1);
|
||||
DEBUG_ONLY(__ set(0xDEADC0DE, G3);)
|
||||
|
||||
assert(count < LIST_CAPACITY, "LIST_CAPACITY too small");
|
||||
speculative_load_pclist[count] = __ pc();
|
||||
|
||||
@ -2269,7 +2269,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
BLOCK_COMMENT("Entry:");
|
||||
}
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_DISJOINT;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -2326,7 +2326,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
|
||||
array_overlap_test(nooverlap_target, LogBytesPerHeapOop);
|
||||
|
||||
DecoratorSet decorators = 0;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -2446,7 +2446,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
BLOCK_COMMENT("Entry:");
|
||||
}
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_CHECKCAST;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
@ -1402,16 +1402,19 @@ void LIRGenerator::do_If(If* x) {
|
||||
yin->dont_load_item();
|
||||
}
|
||||
|
||||
LIR_Opr left = xin->result();
|
||||
LIR_Opr right = yin->result();
|
||||
|
||||
set_no_result(x);
|
||||
|
||||
// add safepoint before generating condition code so it can be recomputed
|
||||
if (x->is_safepoint()) {
|
||||
// increment backedge counter if needed
|
||||
increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci());
|
||||
increment_backedge_counter_conditionally(lir_cond(cond), left, right, state_for(x, x->state_before()),
|
||||
x->tsux()->bci(), x->fsux()->bci(), x->profiled_bci());
|
||||
__ safepoint(safepoint_poll_register(), state_for(x, x->state_before()));
|
||||
}
|
||||
set_no_result(x);
|
||||
|
||||
LIR_Opr left = xin->result();
|
||||
LIR_Opr right = yin->result();
|
||||
__ cmp(lir_cond(cond), left, right);
|
||||
// Generate branch profiling. Profiling code doesn't kill flags.
|
||||
profile_branch(x, cond);
|
||||
|
||||
@ -188,9 +188,11 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
|
||||
// robj is data dependent on rcounter.
|
||||
}
|
||||
|
||||
__ clear_jweak_tag(robj);
|
||||
// Both robj and rtmp are clobbered by try_resolve_jobject_in_native.
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->try_resolve_jobject_in_native(masm, /* jni_env */ c_rarg0, robj, rtmp, slow);
|
||||
DEBUG_ONLY(__ movl(rtmp, 0xDEADC0DE);)
|
||||
|
||||
__ movptr(robj, Address(robj, 0)); // *obj
|
||||
__ mov (roffset, c_rarg2);
|
||||
__ shrptr(roffset, 2); // offset
|
||||
|
||||
|
||||
@ -6276,6 +6276,8 @@ void MacroAssembler::restore_cpu_control_state_after_jni() {
|
||||
|
||||
// ((OopHandle)result).resolve();
|
||||
void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
|
||||
assert_different_registers(result, tmp);
|
||||
|
||||
// Only 64 bit platforms support GCs that require a tmp register
|
||||
// Only IN_HEAP loads require a thread_tmp register
|
||||
// OopHandle::resolve is an indirection like jobject.
|
||||
|
||||
@ -837,7 +837,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ jcc(Assembler::zero, L_0_count);
|
||||
}
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_DISJOINT;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -1026,7 +1026,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ jcc(Assembler::zero, L_0_count);
|
||||
}
|
||||
|
||||
DecoratorSet decorators = 0;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -1383,7 +1383,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
Address to_element_addr(end_to, count, Address::times_ptr, 0);
|
||||
Address elem_klass_addr(elem, oopDesc::klass_offset_in_bytes());
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_CHECKCAST;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
@ -1820,7 +1820,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
setup_arg_regs(); // from => rdi, to => rsi, count => rdx
|
||||
// r9 and r10 may be used to save non-volatile registers
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_DISJOINT;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -1914,7 +1914,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
setup_arg_regs(); // from => rdi, to => rsi, count => rdx
|
||||
// r9 and r10 may be used to save non-volatile registers
|
||||
|
||||
DecoratorSet decorators = 0;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -2018,7 +2018,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// r9 and r10 may be used to save non-volatile registers
|
||||
// 'from', 'to' and 'qword_count' are now valid
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_DISJOINT;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -2111,7 +2111,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// r9 and r10 may be used to save non-volatile registers
|
||||
// 'from', 'to' and 'qword_count' are now valid
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_DISJOINT;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
@ -2294,7 +2294,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
Address from_element_addr(end_from, count, TIMES_OOP, 0);
|
||||
Address to_element_addr(end_to, count, TIMES_OOP, 0);
|
||||
|
||||
DecoratorSet decorators = ARRAYCOPY_CHECKCAST;
|
||||
DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST;
|
||||
if (dest_uninitialized) {
|
||||
decorators |= AS_DEST_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
@ -973,7 +973,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
|
||||
__ testl(t, JVM_ACC_STATIC);
|
||||
__ jcc(Assembler::zero, L);
|
||||
// get mirror
|
||||
__ load_mirror(t, method);
|
||||
__ load_mirror(t, method, rax);
|
||||
// copy mirror into activation frame
|
||||
__ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset * wordSize),
|
||||
t);
|
||||
|
||||
@ -923,7 +923,7 @@ void VM_Version::get_processor_features() {
|
||||
// Only C2 does RTM locking optimization.
|
||||
// Can't continue because UseRTMLocking affects UseBiasedLocking flag
|
||||
// setting during arguments processing. See use_biased_locking().
|
||||
vm_exit_during_initialization("RTM locking optimization is not supported in emulated client VM");
|
||||
vm_exit_during_initialization("RTM locking optimization is not supported in this VM");
|
||||
}
|
||||
if (is_intel_family_core()) {
|
||||
if ((_model == CPU_MODEL_HASWELL_E3) ||
|
||||
|
||||
90
src/hotspot/cpu/zero/vm_version_ext_zero.cpp
Normal file
90
src/hotspot/cpu/zero/vm_version_ext_zero.cpp
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "memory/allocation.hpp"
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "runtime/os.inline.hpp"
|
||||
#include "vm_version_ext_zero.hpp"
|
||||
|
||||
// VM_Version_Ext statics
|
||||
int VM_Version_Ext::_no_of_threads = 0;
|
||||
int VM_Version_Ext::_no_of_cores = 0;
|
||||
int VM_Version_Ext::_no_of_sockets = 0;
|
||||
bool VM_Version_Ext::_initialized = false;
|
||||
char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0};
|
||||
char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0};
|
||||
|
||||
void VM_Version_Ext::initialize_cpu_information(void) {
|
||||
// do nothing if cpu info has been initialized
|
||||
if (_initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
int core_id = -1;
|
||||
int chip_id = -1;
|
||||
int len = 0;
|
||||
char* src_string = NULL;
|
||||
|
||||
_no_of_cores = os::processor_count();
|
||||
_no_of_threads = _no_of_cores;
|
||||
_no_of_sockets = _no_of_cores;
|
||||
snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "Zero VM");
|
||||
snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "%s", _features_string);
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
int VM_Version_Ext::number_of_threads(void) {
|
||||
initialize_cpu_information();
|
||||
return _no_of_threads;
|
||||
}
|
||||
|
||||
int VM_Version_Ext::number_of_cores(void) {
|
||||
initialize_cpu_information();
|
||||
return _no_of_cores;
|
||||
}
|
||||
|
||||
int VM_Version_Ext::number_of_sockets(void) {
|
||||
initialize_cpu_information();
|
||||
return _no_of_sockets;
|
||||
}
|
||||
|
||||
const char* VM_Version_Ext::cpu_name(void) {
|
||||
initialize_cpu_information();
|
||||
char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing);
|
||||
if (NULL == tmp) {
|
||||
return NULL;
|
||||
}
|
||||
strncpy(tmp, _cpu_name, CPU_TYPE_DESC_BUF_SIZE);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
const char* VM_Version_Ext::cpu_description(void) {
|
||||
initialize_cpu_information();
|
||||
char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_DETAILED_DESC_BUF_SIZE, mtTracing);
|
||||
if (NULL == tmp) {
|
||||
return NULL;
|
||||
}
|
||||
strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE);
|
||||
return tmp;
|
||||
}
|
||||
54
src/hotspot/cpu/zero/vm_version_ext_zero.hpp
Normal file
54
src/hotspot/cpu/zero/vm_version_ext_zero.hpp
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CPU_ZERO_VM_VM_VERSION_EXT_ZERO_HPP
|
||||
#define CPU_ZERO_VM_VM_VERSION_EXT_ZERO_HPP
|
||||
|
||||
#include "utilities/macros.hpp"
|
||||
#include "vm_version_zero.hpp"
|
||||
|
||||
class VM_Version_Ext : public VM_Version {
|
||||
private:
|
||||
static const size_t CPU_TYPE_DESC_BUF_SIZE = 256;
|
||||
static const size_t CPU_DETAILED_DESC_BUF_SIZE = 4096;
|
||||
|
||||
static int _no_of_threads;
|
||||
static int _no_of_cores;
|
||||
static int _no_of_sockets;
|
||||
static bool _initialized;
|
||||
static char _cpu_name[CPU_TYPE_DESC_BUF_SIZE];
|
||||
static char _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE];
|
||||
|
||||
public:
|
||||
static int number_of_threads(void);
|
||||
static int number_of_cores(void);
|
||||
static int number_of_sockets(void);
|
||||
|
||||
static const char* cpu_name(void);
|
||||
static const char* cpu_description(void);
|
||||
static void initialize_cpu_information(void);
|
||||
|
||||
};
|
||||
|
||||
#endif // CPU_ZERO_VM_VM_VERSION_EXT_ZERO_HPP
|
||||
@ -1,111 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2013 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "jvm.h"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/osThread.hpp"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
// sun.misc.Signal ///////////////////////////////////////////////////////////
|
||||
// Signal code is mostly copied from classic vm, signals_md.c 1.4 98/08/23
|
||||
/*
|
||||
* This function is included primarily as a debugging aid. If Java is
|
||||
* running in a console window, then pressing <CTRL-\\> will cause
|
||||
* the current state of all active threads and monitors to be written
|
||||
* to the console window.
|
||||
*/
|
||||
|
||||
JVM_ENTRY_NO_ENV(void*, JVM_RegisterSignal(jint sig, void* handler))
|
||||
// Copied from classic vm
|
||||
// signals_md.c 1.4 98/08/23
|
||||
void* newHandler = handler == (void *)2
|
||||
? os::user_handler()
|
||||
: handler;
|
||||
switch (sig) {
|
||||
/* The following are already used by the VM. */
|
||||
case SIGFPE:
|
||||
case SIGILL:
|
||||
case SIGSEGV:
|
||||
|
||||
/* The following signal is used by the VM to dump thread stacks unless
|
||||
ReduceSignalUsage is set, in which case the user is allowed to set
|
||||
his own _native_ handler for this signal; thus, in either case,
|
||||
we do not allow JVM_RegisterSignal to change the handler. */
|
||||
case BREAK_SIGNAL:
|
||||
return (void *)-1;
|
||||
|
||||
/* The following signals are used for Shutdown Hooks support. However, if
|
||||
ReduceSignalUsage (-Xrs) is set, Shutdown Hooks must be invoked via
|
||||
System.exit(), Java is not allowed to use these signals, and the the
|
||||
user is allowed to set his own _native_ handler for these signals and
|
||||
invoke System.exit() as needed. Terminator.setup() is avoiding
|
||||
registration of these signals when -Xrs is present.
|
||||
- If the HUP signal is ignored (from the nohup) command, then Java
|
||||
is not allowed to use this signal.
|
||||
*/
|
||||
|
||||
case SHUTDOWN1_SIGNAL:
|
||||
case SHUTDOWN2_SIGNAL:
|
||||
case SHUTDOWN3_SIGNAL:
|
||||
if (ReduceSignalUsage) return (void*)-1;
|
||||
if (os::Aix::is_sig_ignored(sig)) return (void*)1;
|
||||
}
|
||||
|
||||
void* oldHandler = os::signal(sig, newHandler);
|
||||
if (oldHandler == os::user_handler()) {
|
||||
return (void *)2;
|
||||
} else {
|
||||
return oldHandler;
|
||||
}
|
||||
JVM_END
|
||||
|
||||
|
||||
JVM_ENTRY_NO_ENV(jboolean, JVM_RaiseSignal(jint sig))
|
||||
if (ReduceSignalUsage) {
|
||||
// do not allow SHUTDOWN1_SIGNAL,SHUTDOWN2_SIGNAL,SHUTDOWN3_SIGNAL,
|
||||
// BREAK_SIGNAL to be raised when ReduceSignalUsage is set, since
|
||||
// no handler for them is actually registered in JVM or via
|
||||
// JVM_RegisterSignal.
|
||||
if (sig == SHUTDOWN1_SIGNAL || sig == SHUTDOWN2_SIGNAL ||
|
||||
sig == SHUTDOWN3_SIGNAL || sig == BREAK_SIGNAL) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
}
|
||||
else if ((sig == SHUTDOWN1_SIGNAL || sig == SHUTDOWN2_SIGNAL ||
|
||||
sig == SHUTDOWN3_SIGNAL) && os::Aix::is_sig_ignored(sig)) {
|
||||
// do not allow SHUTDOWN1_SIGNAL to be raised when SHUTDOWN1_SIGNAL
|
||||
// is ignored, since no handler for them is actually registered in JVM
|
||||
// or via JVM_RegisterSignal.
|
||||
// This also applies for SHUTDOWN2_SIGNAL and SHUTDOWN3_SIGNAL
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
os::signal_raise(sig);
|
||||
return JNI_TRUE;
|
||||
JVM_END
|
||||
|
||||
@ -622,18 +622,6 @@ extern "C" void breakpoint() {
|
||||
debug_only(static bool signal_sets_initialized = false);
|
||||
static sigset_t unblocked_sigs, vm_sigs;
|
||||
|
||||
bool os::Aix::is_sig_ignored(int sig) {
|
||||
struct sigaction oact;
|
||||
sigaction(sig, (struct sigaction*)NULL, &oact);
|
||||
void* ohlr = oact.sa_sigaction ? CAST_FROM_FN_PTR(void*, oact.sa_sigaction)
|
||||
: CAST_FROM_FN_PTR(void*, oact.sa_handler);
|
||||
if (ohlr == CAST_FROM_FN_PTR(void*, SIG_IGN)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void os::Aix::signal_sets_init() {
|
||||
// Should also have an assertion stating we are still single-threaded.
|
||||
assert(!signal_sets_initialized, "Already initialized");
|
||||
@ -659,13 +647,13 @@ void os::Aix::signal_sets_init() {
|
||||
sigaddset(&unblocked_sigs, SR_signum);
|
||||
|
||||
if (!ReduceSignalUsage) {
|
||||
if (!os::Aix::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN1_SIGNAL);
|
||||
}
|
||||
if (!os::Aix::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN2_SIGNAL);
|
||||
}
|
||||
if (!os::Aix::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN3_SIGNAL);
|
||||
}
|
||||
}
|
||||
@ -1377,6 +1365,21 @@ void os::get_summary_os_info(char* buf, size_t buflen) {
|
||||
snprintf(buf, buflen, "%s %s", name.release, name.version);
|
||||
}
|
||||
|
||||
int os::get_loaded_modules_info(os::LoadedModulesCallbackFunc callback, void *param) {
|
||||
// Not yet implemented.
|
||||
return 0;
|
||||
}
|
||||
|
||||
void os::print_os_info_brief(outputStream* st) {
|
||||
uint32_t ver = os::Aix::os_version();
|
||||
st->print_cr("AIX kernel version %u.%u.%u.%u",
|
||||
(ver >> 24) & 0xFF, (ver >> 16) & 0xFF, (ver >> 8) & 0xFF, ver & 0xFF);
|
||||
|
||||
os::Posix::print_uname_info(st);
|
||||
|
||||
// Linux uses print_libversion_info(st); here.
|
||||
}
|
||||
|
||||
void os::print_os_info(outputStream* st) {
|
||||
st->print("OS:");
|
||||
|
||||
@ -1795,7 +1798,7 @@ static void local_sem_wait() {
|
||||
}
|
||||
}
|
||||
|
||||
void os::signal_init_pd() {
|
||||
static void jdk_misc_signal_init() {
|
||||
// Initialize signal structures
|
||||
::memset((void*)pending_signals, 0, sizeof(pending_signals));
|
||||
|
||||
@ -3020,7 +3023,7 @@ bool unblock_program_error_signals() {
|
||||
}
|
||||
|
||||
// Renamed from 'signalHandler' to avoid collision with other shared libs.
|
||||
void javaSignalHandler(int sig, siginfo_t* info, void* uc) {
|
||||
static void javaSignalHandler(int sig, siginfo_t* info, void* uc) {
|
||||
assert(info != NULL && uc != NULL, "it must be old kernel");
|
||||
|
||||
// Never leave program error signals blocked;
|
||||
@ -3579,6 +3582,10 @@ jint os::init_2(void) {
|
||||
|
||||
Aix::signal_sets_init();
|
||||
Aix::install_signal_handlers();
|
||||
// Initialize data for jdk.internal.misc.Signal
|
||||
if (!ReduceSignalUsage) {
|
||||
jdk_misc_signal_init();
|
||||
}
|
||||
|
||||
// Check and sets minimum stack sizes against command line options
|
||||
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2016 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -121,7 +121,6 @@ class Aix {
|
||||
static void signal_sets_init();
|
||||
static void install_signal_handlers();
|
||||
static void set_signal_handler(int, bool);
|
||||
static bool is_sig_ignored(int sig);
|
||||
|
||||
static sigset_t* unblocked_signals();
|
||||
static sigset_t* vm_signals();
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2016 SAP SE. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2018 SAP SE. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -36,9 +36,9 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <netdb.h>
|
||||
|
||||
// File names are case-sensitive on windows only.
|
||||
inline int os::file_name_strcmp(const char* s1, const char* s2) {
|
||||
return strcmp(s1, s2);
|
||||
// File names are case-insensitive on windows only.
|
||||
inline int os::file_name_strncmp(const char* s1, const char* s2, size_t num) {
|
||||
return strncmp(s1, s2, num);
|
||||
}
|
||||
|
||||
inline bool os::obsolete_option(const JavaVMOption *option) {
|
||||
|
||||
1043
src/hotspot/os/aix/os_perf_aix.cpp
Normal file
1043
src/hotspot/os/aix/os_perf_aix.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,7 +26,6 @@
|
||||
#define OS_AIX_VM_OS_SHARE_AIX_HPP
|
||||
|
||||
// misc
|
||||
void signalHandler(int, siginfo_t*, ucontext_t*);
|
||||
void handle_unexpected_exception(Thread* thread, int sig, siginfo_t* info, address pc, address adjusted_pc);
|
||||
#ifndef PRODUCT
|
||||
void continue_with_dump(void);
|
||||
|
||||
@ -533,18 +533,6 @@ extern "C" void breakpoint() {
|
||||
debug_only(static bool signal_sets_initialized = false);
|
||||
static sigset_t unblocked_sigs, vm_sigs;
|
||||
|
||||
bool os::Bsd::is_sig_ignored(int sig) {
|
||||
struct sigaction oact;
|
||||
sigaction(sig, (struct sigaction*)NULL, &oact);
|
||||
void* ohlr = oact.sa_sigaction ? CAST_FROM_FN_PTR(void*, oact.sa_sigaction)
|
||||
: CAST_FROM_FN_PTR(void*, oact.sa_handler);
|
||||
if (ohlr == CAST_FROM_FN_PTR(void*, SIG_IGN)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void os::Bsd::signal_sets_init() {
|
||||
// Should also have an assertion stating we are still single-threaded.
|
||||
assert(!signal_sets_initialized, "Already initialized");
|
||||
@ -569,14 +557,14 @@ void os::Bsd::signal_sets_init() {
|
||||
sigaddset(&unblocked_sigs, SR_signum);
|
||||
|
||||
if (!ReduceSignalUsage) {
|
||||
if (!os::Bsd::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN1_SIGNAL);
|
||||
|
||||
}
|
||||
if (!os::Bsd::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN2_SIGNAL);
|
||||
}
|
||||
if (!os::Bsd::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN3_SIGNAL);
|
||||
}
|
||||
}
|
||||
@ -1830,7 +1818,7 @@ int os::sigexitnum_pd() {
|
||||
static volatile jint pending_signals[NSIG+1] = { 0 };
|
||||
static Semaphore* sig_sem = NULL;
|
||||
|
||||
void os::signal_init_pd() {
|
||||
static void jdk_misc_signal_init() {
|
||||
// Initialize signal structures
|
||||
::memset((void*)pending_signals, 0, sizeof(pending_signals));
|
||||
|
||||
@ -1843,7 +1831,7 @@ void os::signal_notify(int sig) {
|
||||
Atomic::inc(&pending_signals[sig]);
|
||||
sig_sem->signal();
|
||||
} else {
|
||||
// Signal thread is not created with ReduceSignalUsage and signal_init_pd
|
||||
// Signal thread is not created with ReduceSignalUsage and jdk_misc_signal_init
|
||||
// initialization isn't called.
|
||||
assert(ReduceSignalUsage, "signal semaphore should be created");
|
||||
}
|
||||
@ -2773,7 +2761,7 @@ extern "C" JNIEXPORT int JVM_handle_bsd_signal(int signo, siginfo_t* siginfo,
|
||||
void* ucontext,
|
||||
int abort_if_unrecognized);
|
||||
|
||||
void signalHandler(int sig, siginfo_t* info, void* uc) {
|
||||
static void signalHandler(int sig, siginfo_t* info, void* uc) {
|
||||
assert(info != NULL && uc != NULL, "it must be old kernel");
|
||||
int orig_errno = errno; // Preserve errno value over signal handler.
|
||||
JVM_handle_bsd_signal(sig, info, uc, true);
|
||||
@ -3301,6 +3289,10 @@ jint os::init_2(void) {
|
||||
|
||||
Bsd::signal_sets_init();
|
||||
Bsd::install_signal_handlers();
|
||||
// Initialize data for jdk.internal.misc.Signal
|
||||
if (!ReduceSignalUsage) {
|
||||
jdk_misc_signal_init();
|
||||
}
|
||||
|
||||
// Check and sets minimum stack sizes against command line options
|
||||
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -103,7 +103,6 @@ class Bsd {
|
||||
static void signal_sets_init();
|
||||
static void install_signal_handlers();
|
||||
static void set_signal_handler(int, bool);
|
||||
static bool is_sig_ignored(int sig);
|
||||
|
||||
static sigset_t* unblocked_signals();
|
||||
static sigset_t* vm_signals();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,9 +34,9 @@
|
||||
#include <poll.h>
|
||||
#include <netdb.h>
|
||||
|
||||
// File names are case-sensitive on windows only
|
||||
inline int os::file_name_strcmp(const char* s1, const char* s2) {
|
||||
return strcmp(s1, s2);
|
||||
// File names are case-insensitive on windows only
|
||||
inline int os::file_name_strncmp(const char* s1, const char* s2, size_t num) {
|
||||
return strncmp(s1, s2, num);
|
||||
}
|
||||
|
||||
inline bool os::obsolete_option(const JavaVMOption *option) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,7 +26,6 @@
|
||||
#define OS_BSD_VM_OS_SHARE_BSD_HPP
|
||||
|
||||
// misc
|
||||
void signalHandler(int, siginfo_t*, ucontext_t*);
|
||||
void handle_unexpected_exception(Thread* thread, int sig, siginfo_t* info, address pc, address adjusted_pc);
|
||||
#ifndef PRODUCT
|
||||
void continue_with_dump(void);
|
||||
|
||||
@ -1,110 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "jvm.h"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/osThread.hpp"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
// sun.misc.Signal ///////////////////////////////////////////////////////////
|
||||
// Signal code is mostly copied from classic vm, signals_md.c 1.4 98/08/23
|
||||
/*
|
||||
* This function is included primarily as a debugging aid. If Java is
|
||||
* running in a console window, then pressing <CTRL-\\> will cause
|
||||
* the current state of all active threads and monitors to be written
|
||||
* to the console window.
|
||||
*/
|
||||
|
||||
JVM_ENTRY_NO_ENV(void*, JVM_RegisterSignal(jint sig, void* handler))
|
||||
// Copied from classic vm
|
||||
// signals_md.c 1.4 98/08/23
|
||||
void* newHandler = handler == (void *)2
|
||||
? os::user_handler()
|
||||
: handler;
|
||||
switch (sig) {
|
||||
/* The following are already used by the VM. */
|
||||
case SIGFPE:
|
||||
case SIGILL:
|
||||
case SIGSEGV:
|
||||
|
||||
/* The following signal is used by the VM to dump thread stacks unless
|
||||
ReduceSignalUsage is set, in which case the user is allowed to set
|
||||
his own _native_ handler for this signal; thus, in either case,
|
||||
we do not allow JVM_RegisterSignal to change the handler. */
|
||||
case BREAK_SIGNAL:
|
||||
return (void *)-1;
|
||||
|
||||
/* The following signals are used for Shutdown Hooks support. However, if
|
||||
ReduceSignalUsage (-Xrs) is set, Shutdown Hooks must be invoked via
|
||||
System.exit(), Java is not allowed to use these signals, and the the
|
||||
user is allowed to set his own _native_ handler for these signals and
|
||||
invoke System.exit() as needed. Terminator.setup() is avoiding
|
||||
registration of these signals when -Xrs is present.
|
||||
- If the HUP signal is ignored (from the nohup) command, then Java
|
||||
is not allowed to use this signal.
|
||||
*/
|
||||
|
||||
case SHUTDOWN1_SIGNAL:
|
||||
case SHUTDOWN2_SIGNAL:
|
||||
case SHUTDOWN3_SIGNAL:
|
||||
if (ReduceSignalUsage) return (void*)-1;
|
||||
if (os::Linux::is_sig_ignored(sig)) return (void*)1;
|
||||
}
|
||||
|
||||
void* oldHandler = os::signal(sig, newHandler);
|
||||
if (oldHandler == os::user_handler()) {
|
||||
return (void *)2;
|
||||
} else {
|
||||
return oldHandler;
|
||||
}
|
||||
JVM_END
|
||||
|
||||
|
||||
JVM_ENTRY_NO_ENV(jboolean, JVM_RaiseSignal(jint sig))
|
||||
if (ReduceSignalUsage) {
|
||||
// do not allow SHUTDOWN1_SIGNAL,SHUTDOWN2_SIGNAL,SHUTDOWN3_SIGNAL,
|
||||
// BREAK_SIGNAL to be raised when ReduceSignalUsage is set, since
|
||||
// no handler for them is actually registered in JVM or via
|
||||
// JVM_RegisterSignal.
|
||||
if (sig == SHUTDOWN1_SIGNAL || sig == SHUTDOWN2_SIGNAL ||
|
||||
sig == SHUTDOWN3_SIGNAL || sig == BREAK_SIGNAL) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
}
|
||||
else if ((sig == SHUTDOWN1_SIGNAL || sig == SHUTDOWN2_SIGNAL ||
|
||||
sig == SHUTDOWN3_SIGNAL) && os::Linux::is_sig_ignored(sig)) {
|
||||
// do not allow SHUTDOWN1_SIGNAL to be raised when SHUTDOWN1_SIGNAL
|
||||
// is ignored, since no handler for them is actually registered in JVM
|
||||
// or via JVM_RegisterSignal.
|
||||
// This also applies for SHUTDOWN2_SIGNAL and SHUTDOWN3_SIGNAL
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
os::signal_raise(sig);
|
||||
return JNI_TRUE;
|
||||
JVM_END
|
||||
|
||||
@ -425,18 +425,6 @@ extern "C" void breakpoint() {
|
||||
debug_only(static bool signal_sets_initialized = false);
|
||||
static sigset_t unblocked_sigs, vm_sigs;
|
||||
|
||||
bool os::Linux::is_sig_ignored(int sig) {
|
||||
struct sigaction oact;
|
||||
sigaction(sig, (struct sigaction*)NULL, &oact);
|
||||
void* ohlr = oact.sa_sigaction ? CAST_FROM_FN_PTR(void*, oact.sa_sigaction)
|
||||
: CAST_FROM_FN_PTR(void*, oact.sa_handler);
|
||||
if (ohlr == CAST_FROM_FN_PTR(void*, SIG_IGN)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void os::Linux::signal_sets_init() {
|
||||
// Should also have an assertion stating we are still single-threaded.
|
||||
assert(!signal_sets_initialized, "Already initialized");
|
||||
@ -464,13 +452,13 @@ void os::Linux::signal_sets_init() {
|
||||
sigaddset(&unblocked_sigs, SR_signum);
|
||||
|
||||
if (!ReduceSignalUsage) {
|
||||
if (!os::Linux::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN1_SIGNAL);
|
||||
}
|
||||
if (!os::Linux::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN2_SIGNAL);
|
||||
}
|
||||
if (!os::Linux::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN3_SIGNAL);
|
||||
}
|
||||
}
|
||||
@ -2532,7 +2520,7 @@ static volatile jint pending_signals[NSIG+1] = { 0 };
|
||||
static Semaphore* sig_sem = NULL;
|
||||
static PosixSemaphore sr_semaphore;
|
||||
|
||||
void os::signal_init_pd() {
|
||||
static void jdk_misc_signal_init() {
|
||||
// Initialize signal structures
|
||||
::memset((void*)pending_signals, 0, sizeof(pending_signals));
|
||||
|
||||
@ -2545,7 +2533,7 @@ void os::signal_notify(int sig) {
|
||||
Atomic::inc(&pending_signals[sig]);
|
||||
sig_sem->signal();
|
||||
} else {
|
||||
// Signal thread is not created with ReduceSignalUsage and signal_init_pd
|
||||
// Signal thread is not created with ReduceSignalUsage and jdk_misc_signal_init
|
||||
// initialization isn't called.
|
||||
assert(ReduceSignalUsage, "signal semaphore should be created");
|
||||
}
|
||||
@ -2884,6 +2872,10 @@ void os::Linux::sched_getcpu_init() {
|
||||
set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t,
|
||||
(void*)&sched_getcpu_syscall));
|
||||
}
|
||||
|
||||
if (sched_getcpu() == -1) {
|
||||
vm_exit_during_initialization("getcpu(2) system call not supported by kernel");
|
||||
}
|
||||
}
|
||||
|
||||
// Something to do with the numa-aware allocator needs these symbols
|
||||
@ -4452,7 +4444,7 @@ extern "C" JNIEXPORT int JVM_handle_linux_signal(int signo,
|
||||
void* ucontext,
|
||||
int abort_if_unrecognized);
|
||||
|
||||
void signalHandler(int sig, siginfo_t* info, void* uc) {
|
||||
static void signalHandler(int sig, siginfo_t* info, void* uc) {
|
||||
assert(info != NULL && uc != NULL, "it must be old kernel");
|
||||
int orig_errno = errno; // Preserve errno value over signal handler.
|
||||
JVM_handle_linux_signal(sig, info, uc, true);
|
||||
@ -5000,6 +4992,10 @@ jint os::init_2(void) {
|
||||
|
||||
Linux::signal_sets_init();
|
||||
Linux::install_signal_handlers();
|
||||
// Initialize data for jdk.internal.misc.Signal
|
||||
if (!ReduceSignalUsage) {
|
||||
jdk_misc_signal_init();
|
||||
}
|
||||
|
||||
// Check and sets minimum stack sizes against command line options
|
||||
if (Posix::set_minimum_stack_sizes() == JNI_ERR) {
|
||||
@ -5241,6 +5237,12 @@ int os::active_processor_count() {
|
||||
return active_cpus;
|
||||
}
|
||||
|
||||
uint os::processor_id() {
|
||||
const int id = Linux::sched_getcpu();
|
||||
assert(id >= 0 && id < _processor_count, "Invalid processor id");
|
||||
return (uint)id;
|
||||
}
|
||||
|
||||
void os::set_native_thread_name(const char *name) {
|
||||
if (Linux::_pthread_setname_np) {
|
||||
char buf [16]; // according to glibc manpage, 16 chars incl. '/0'
|
||||
|
||||
@ -160,7 +160,6 @@ class Linux {
|
||||
static void signal_sets_init();
|
||||
static void install_signal_handlers();
|
||||
static void set_signal_handler(int, bool);
|
||||
static bool is_sig_ignored(int sig);
|
||||
|
||||
static sigset_t* unblocked_signals();
|
||||
static sigset_t* vm_signals();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -34,9 +34,9 @@
|
||||
#include <poll.h>
|
||||
#include <netdb.h>
|
||||
|
||||
// File names are case-sensitive on windows only
|
||||
inline int os::file_name_strcmp(const char* s1, const char* s2) {
|
||||
return strcmp(s1, s2);
|
||||
// File names are case-insensitive on windows only
|
||||
inline int os::file_name_strncmp(const char* s1, const char* s2, size_t num) {
|
||||
return strncmp(s1, s2, num);
|
||||
}
|
||||
|
||||
inline bool os::obsolete_option(const JavaVMOption *option) {
|
||||
|
||||
@ -29,17 +29,7 @@
|
||||
#include "runtime/os.hpp"
|
||||
#include "runtime/os_perf.hpp"
|
||||
|
||||
#ifdef X86
|
||||
#include "vm_version_ext_x86.hpp"
|
||||
#endif
|
||||
#ifdef ARM
|
||||
#include "vm_version_ext_arm.hpp"
|
||||
#endif
|
||||
#ifndef ARM
|
||||
#ifdef AARCH64
|
||||
#include "vm_version_ext_aarch64.hpp"
|
||||
#endif
|
||||
#endif
|
||||
#include CPU_HEADER(vm_version_ext)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,7 +26,6 @@
|
||||
#define OS_LINUX_VM_OS_SHARE_LINUX_HPP
|
||||
|
||||
// misc
|
||||
void signalHandler(int, siginfo_t*, ucontext_t*);
|
||||
void handle_unexpected_exception(Thread* thread, int sig, siginfo_t* info, address pc, address adjusted_pc);
|
||||
#ifndef PRODUCT
|
||||
void continue_with_dump(void);
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
#include <signal.h>
|
||||
|
||||
|
||||
// sun.misc.Signal ///////////////////////////////////////////////////////////
|
||||
// jdk.internal.misc.Signal ///////////////////////////////////////////////////////////
|
||||
// Signal code is mostly copied from classic vm, signals_md.c 1.4 98/08/23
|
||||
/*
|
||||
* This function is included primarily as a debugging aid. If Java is
|
||||
@ -78,7 +78,7 @@ JVM_ENTRY_NO_ENV(void*, JVM_RegisterSignal(jint sig, void* handler))
|
||||
case SHUTDOWN2_SIGNAL:
|
||||
case SHUTDOWN3_SIGNAL:
|
||||
if (ReduceSignalUsage) return (void*)-1;
|
||||
if (os::Bsd::is_sig_ignored(sig)) return (void*)1;
|
||||
if (os::Posix::is_sig_ignored(sig)) return (void*)1;
|
||||
}
|
||||
|
||||
void* oldHandler = os::signal(sig, newHandler);
|
||||
@ -102,7 +102,7 @@ JVM_ENTRY_NO_ENV(jboolean, JVM_RaiseSignal(jint sig))
|
||||
}
|
||||
}
|
||||
else if ((sig == SHUTDOWN1_SIGNAL || sig == SHUTDOWN2_SIGNAL ||
|
||||
sig == SHUTDOWN3_SIGNAL) && os::Bsd::is_sig_ignored(sig)) {
|
||||
sig == SHUTDOWN3_SIGNAL) && os::Posix::is_sig_ignored(sig)) {
|
||||
// do not allow SHUTDOWN1_SIGNAL to be raised when SHUTDOWN1_SIGNAL
|
||||
// is ignored, since no handler for them is actually registered in JVM
|
||||
// or via JVM_RegisterSignal.
|
||||
@ -926,6 +926,18 @@ bool os::Posix::is_valid_signal(int sig) {
|
||||
#endif
|
||||
}
|
||||
|
||||
bool os::Posix::is_sig_ignored(int sig) {
|
||||
struct sigaction oact;
|
||||
sigaction(sig, (struct sigaction*)NULL, &oact);
|
||||
void* ohlr = oact.sa_sigaction ? CAST_FROM_FN_PTR(void*, oact.sa_sigaction)
|
||||
: CAST_FROM_FN_PTR(void*, oact.sa_handler);
|
||||
if (ohlr == CAST_FROM_FN_PTR(void*, SIG_IGN)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns:
|
||||
// NULL for an invalid signal number
|
||||
// "SIG<num>" for a valid but unknown signal number
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -64,6 +64,7 @@ public:
|
||||
|
||||
// Returns true if signal is valid.
|
||||
static bool is_valid_signal(int sig);
|
||||
static bool is_sig_ignored(int sig);
|
||||
|
||||
// Helper function, returns a string (e.g. "SIGILL") for a signal.
|
||||
// Returned string is a constant. For unknown signals "UNKNOWN" is returned.
|
||||
|
||||
@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "jvm.h"
|
||||
#include "runtime/interfaceSupport.inline.hpp"
|
||||
#include "runtime/osThread.hpp"
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
// sun.misc.Signal ///////////////////////////////////////////////////////////
|
||||
// Signal code is mostly copied from classic vm, signals_md.c 1.4 98/08/23
|
||||
/*
|
||||
* This function is included primarily as a debugging aid. If Java is
|
||||
* running in a console window, then pressing <CTRL-\\> will cause
|
||||
* the current state of all active threads and monitors to be written
|
||||
* to the console window.
|
||||
*/
|
||||
|
||||
JVM_ENTRY_NO_ENV(void*, JVM_RegisterSignal(jint sig, void* handler))
|
||||
// Copied from classic vm
|
||||
// signals_md.c 1.4 98/08/23
|
||||
void* newHandler = handler == (void *)2
|
||||
? os::user_handler()
|
||||
: handler;
|
||||
switch (sig) {
|
||||
/* The following are already used by the VM. */
|
||||
case SIGFPE:
|
||||
case SIGILL:
|
||||
case SIGSEGV:
|
||||
|
||||
/* The following signal is used by the VM to dump thread stacks unless
|
||||
ReduceSignalUsage is set, in which case the user is allowed to set
|
||||
his own _native_ handler for this signal; thus, in either case,
|
||||
we do not allow JVM_RegisterSignal to change the handler. */
|
||||
case BREAK_SIGNAL:
|
||||
return (void *)-1;
|
||||
|
||||
/* The following signals are used for Shutdown Hooks support. However, if
|
||||
ReduceSignalUsage (-Xrs) is set, Shutdown Hooks must be invoked via
|
||||
System.exit(), Java is not allowed to use these signals, and the the
|
||||
user is allowed to set his own _native_ handler for these signals and
|
||||
invoke System.exit() as needed. Terminator.setup() is avoiding
|
||||
registration of these signals when -Xrs is present.
|
||||
- If the HUP signal is ignored (from the nohup) command, then Java
|
||||
is not allowed to use this signal.
|
||||
*/
|
||||
case SHUTDOWN1_SIGNAL:
|
||||
case SHUTDOWN2_SIGNAL:
|
||||
case SHUTDOWN3_SIGNAL:
|
||||
if (ReduceSignalUsage) return (void*)-1;
|
||||
if (os::Solaris::is_sig_ignored(sig)) return (void*)1;
|
||||
}
|
||||
|
||||
void* oldHandler = os::signal(sig, newHandler);
|
||||
if (oldHandler == os::user_handler()) {
|
||||
return (void *)2;
|
||||
} else {
|
||||
return oldHandler;
|
||||
}
|
||||
JVM_END
|
||||
|
||||
|
||||
JVM_ENTRY_NO_ENV(jboolean, JVM_RaiseSignal(jint sig))
|
||||
if (ReduceSignalUsage) {
|
||||
// do not allow SHUTDOWN1_SIGNAL,SHUTDOWN2_SIGNAL,SHUTDOWN3_SIGNAL,
|
||||
// BREAK_SIGNAL to be raised when ReduceSignalUsage is set, since
|
||||
// no handler for them is actually registered in JVM or via
|
||||
// JVM_RegisterSignal.
|
||||
if (sig == SHUTDOWN1_SIGNAL || sig == SHUTDOWN2_SIGNAL ||
|
||||
sig == SHUTDOWN3_SIGNAL || sig == BREAK_SIGNAL) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
}
|
||||
else if ((sig == SHUTDOWN1_SIGNAL || sig == SHUTDOWN2_SIGNAL ||
|
||||
sig == SHUTDOWN3_SIGNAL) && os::Solaris::is_sig_ignored(sig)) {
|
||||
// do not allow SHUTDOWN1_SIGNAL to be raised when SHUTDOWN1_SIGNAL
|
||||
// is ignored, since no handler for them is actually registered in JVM
|
||||
// or via JVM_RegisterSignal.
|
||||
// This also applies for SHUTDOWN2_SIGNAL and SHUTDOWN3_SIGNAL
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
os::signal_raise(sig);
|
||||
return JNI_TRUE;
|
||||
JVM_END
|
||||
|
||||
@ -291,6 +291,12 @@ void os::Solaris::initialize_system_info() {
|
||||
(julong)sysconf(_SC_PAGESIZE);
|
||||
}
|
||||
|
||||
uint os::processor_id() {
|
||||
const processorid_t id = ::getcpuid();
|
||||
assert(id >= 0 && id < _processor_count, "Invalid processor id");
|
||||
return (uint)id;
|
||||
}
|
||||
|
||||
int os::active_processor_count() {
|
||||
// User has overridden the number of active processors
|
||||
if (ActiveProcessorCount > 0) {
|
||||
@ -1026,18 +1032,6 @@ bool os::create_thread(Thread* thread, ThreadType thr_type,
|
||||
debug_only(static bool signal_sets_initialized = false);
|
||||
static sigset_t unblocked_sigs, vm_sigs;
|
||||
|
||||
bool os::Solaris::is_sig_ignored(int sig) {
|
||||
struct sigaction oact;
|
||||
sigaction(sig, (struct sigaction*)NULL, &oact);
|
||||
void* ohlr = oact.sa_sigaction ? CAST_FROM_FN_PTR(void*, oact.sa_sigaction)
|
||||
: CAST_FROM_FN_PTR(void*, oact.sa_handler);
|
||||
if (ohlr == CAST_FROM_FN_PTR(void*, SIG_IGN)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void os::Solaris::signal_sets_init() {
|
||||
// Should also have an assertion stating we are still single-threaded.
|
||||
assert(!signal_sets_initialized, "Already initialized");
|
||||
@ -1062,13 +1056,13 @@ void os::Solaris::signal_sets_init() {
|
||||
sigaddset(&unblocked_sigs, ASYNC_SIGNAL);
|
||||
|
||||
if (!ReduceSignalUsage) {
|
||||
if (!os::Solaris::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN1_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN1_SIGNAL);
|
||||
}
|
||||
if (!os::Solaris::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN2_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN2_SIGNAL);
|
||||
}
|
||||
if (!os::Solaris::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
|
||||
if (!os::Posix::is_sig_ignored(SHUTDOWN3_SIGNAL)) {
|
||||
sigaddset(&unblocked_sigs, SHUTDOWN3_SIGNAL);
|
||||
}
|
||||
}
|
||||
@ -2130,7 +2124,7 @@ void os::Solaris::init_signal_mem() {
|
||||
memset(ourSigFlags, 0, sizeof(int) * (Maxsignum + 1));
|
||||
}
|
||||
|
||||
void os::signal_init_pd() {
|
||||
static void jdk_misc_signal_init() {
|
||||
// Initialize signal semaphore
|
||||
sig_sem = new Semaphore();
|
||||
}
|
||||
@ -2140,7 +2134,7 @@ void os::signal_notify(int sig) {
|
||||
Atomic::inc(&pending_signals[sig]);
|
||||
sig_sem->signal();
|
||||
} else {
|
||||
// Signal thread is not created with ReduceSignalUsage and signal_init_pd
|
||||
// Signal thread is not created with ReduceSignalUsage and jdk_misc_signal_init
|
||||
// initialization isn't called.
|
||||
assert(ReduceSignalUsage, "signal semaphore should be created");
|
||||
}
|
||||
@ -4249,6 +4243,10 @@ jint os::init_2(void) {
|
||||
Solaris::signal_sets_init();
|
||||
Solaris::init_signal_mem();
|
||||
Solaris::install_signal_handlers();
|
||||
// Initialize data for jdk.internal.misc.Signal
|
||||
if (!ReduceSignalUsage) {
|
||||
jdk_misc_signal_init();
|
||||
}
|
||||
|
||||
// initialize synchronization primitives to use either thread or
|
||||
// lwp synchronization (controlled by UseLWPSynchronization)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -188,7 +188,6 @@ class Solaris {
|
||||
static void install_signal_handlers();
|
||||
static void set_signal_handler(int sig, bool set_installed, bool oktochain);
|
||||
static void init_signal_mem();
|
||||
static bool is_sig_ignored(int sig);
|
||||
static void set_our_sigflags(int, int);
|
||||
static int get_our_sigflags(int);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -37,9 +37,9 @@
|
||||
#include <netdb.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
// File names are case-sensitive on windows only
|
||||
inline int os::file_name_strcmp(const char* s1, const char* s2) {
|
||||
return strcmp(s1, s2);
|
||||
// File names are case-insensitive on windows only
|
||||
inline int os::file_name_strncmp(const char* s1, const char* s2, size_t num) {
|
||||
return strncmp(s1, s2, num);
|
||||
}
|
||||
|
||||
inline bool os::uses_stack_guard_pages() {
|
||||
|
||||
@ -1745,13 +1745,46 @@ void os::print_memory_info(outputStream* st) {
|
||||
// value if total memory is larger than 4GB
|
||||
MEMORYSTATUSEX ms;
|
||||
ms.dwLength = sizeof(ms);
|
||||
GlobalMemoryStatusEx(&ms);
|
||||
int r1 = GlobalMemoryStatusEx(&ms);
|
||||
|
||||
st->print(", physical %uk", os::physical_memory() >> 10);
|
||||
st->print("(%uk free)", os::available_memory() >> 10);
|
||||
if (r1 != 0) {
|
||||
st->print(", system-wide physical " INT64_FORMAT "M ",
|
||||
(int64_t) ms.ullTotalPhys >> 20);
|
||||
st->print("(" INT64_FORMAT "M free)\n", (int64_t) ms.ullAvailPhys >> 20);
|
||||
|
||||
st->print("TotalPageFile size " INT64_FORMAT "M ",
|
||||
(int64_t) ms.ullTotalPageFile >> 20);
|
||||
st->print("(AvailPageFile size " INT64_FORMAT "M)",
|
||||
(int64_t) ms.ullAvailPageFile >> 20);
|
||||
|
||||
// on 32bit Total/AvailVirtual are interesting (show us how close we get to 2-4 GB per process borders)
|
||||
#if defined(_M_IX86)
|
||||
st->print(", user-mode portion of virtual address-space " INT64_FORMAT "M ",
|
||||
(int64_t) ms.ullTotalVirtual >> 20);
|
||||
st->print("(" INT64_FORMAT "M free)", (int64_t) ms.ullAvailVirtual >> 20);
|
||||
#endif
|
||||
} else {
|
||||
st->print(", GlobalMemoryStatusEx did not succeed so we miss some memory values.");
|
||||
}
|
||||
|
||||
// extended memory statistics for a process
|
||||
PROCESS_MEMORY_COUNTERS_EX pmex;
|
||||
ZeroMemory(&pmex, sizeof(PROCESS_MEMORY_COUNTERS_EX));
|
||||
pmex.cb = sizeof(pmex);
|
||||
int r2 = GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*) &pmex, sizeof(pmex));
|
||||
|
||||
if (r2 != 0) {
|
||||
st->print("\ncurrent process WorkingSet (physical memory assigned to process): " INT64_FORMAT "M, ",
|
||||
(int64_t) pmex.WorkingSetSize >> 20);
|
||||
st->print("peak: " INT64_FORMAT "M\n", (int64_t) pmex.PeakWorkingSetSize >> 20);
|
||||
|
||||
st->print("current process commit charge (\"private bytes\"): " INT64_FORMAT "M, ",
|
||||
(int64_t) pmex.PrivateUsage >> 20);
|
||||
st->print("peak: " INT64_FORMAT "M", (int64_t) pmex.PeakPagefileUsage >> 20);
|
||||
} else {
|
||||
st->print("\nGetProcessMemoryInfo did not succeed so we miss some memory values.");
|
||||
}
|
||||
|
||||
st->print(", swap %uk", ms.ullTotalPageFile >> 10);
|
||||
st->print("(%uk free)", ms.ullAvailPageFile >> 10);
|
||||
st->cr();
|
||||
}
|
||||
|
||||
@ -1993,7 +2026,7 @@ int os::sigexitnum_pd() {
|
||||
static volatile jint pending_signals[NSIG+1] = { 0 };
|
||||
static Semaphore* sig_sem = NULL;
|
||||
|
||||
void os::signal_init_pd() {
|
||||
static void jdk_misc_signal_init() {
|
||||
// Initialize signal structures
|
||||
memset((void*)pending_signals, 0, sizeof(pending_signals));
|
||||
|
||||
@ -2014,10 +2047,8 @@ void os::signal_init_pd() {
|
||||
// the CTRL-BREAK thread dump mechanism is also disabled in this
|
||||
// case. See bugs 4323062, 4345157, and related bugs.
|
||||
|
||||
if (!ReduceSignalUsage) {
|
||||
// Add a CTRL-C handler
|
||||
SetConsoleCtrlHandler(consoleHandler, TRUE);
|
||||
}
|
||||
// Add a CTRL-C handler
|
||||
SetConsoleCtrlHandler(consoleHandler, TRUE);
|
||||
}
|
||||
|
||||
void os::signal_notify(int sig) {
|
||||
@ -2025,7 +2056,7 @@ void os::signal_notify(int sig) {
|
||||
Atomic::inc(&pending_signals[sig]);
|
||||
sig_sem->signal();
|
||||
} else {
|
||||
// Signal thread is not created with ReduceSignalUsage and signal_init_pd
|
||||
// Signal thread is not created with ReduceSignalUsage and jdk_misc_signal_init
|
||||
// initialization isn't called.
|
||||
assert(ReduceSignalUsage, "signal semaphore should be created");
|
||||
}
|
||||
@ -4132,6 +4163,11 @@ jint os::init_2(void) {
|
||||
|
||||
SymbolEngine::recalc_search_path();
|
||||
|
||||
// Initialize data for jdk.internal.misc.Signal
|
||||
if (!ReduceSignalUsage) {
|
||||
jdk_misc_signal_init();
|
||||
}
|
||||
|
||||
return JNI_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,8 +33,8 @@ inline const char* os::dll_file_extension() { return ".dll"; }
|
||||
inline const int os::default_file_open_flags() { return O_BINARY | O_NOINHERIT;}
|
||||
|
||||
// File names are case-insensitive on windows only
|
||||
inline int os::file_name_strcmp(const char* s, const char* t) {
|
||||
return _stricmp(s, t);
|
||||
inline int os::file_name_strncmp(const char* s, const char* t, size_t num) {
|
||||
return _strnicmp(s, t, num);
|
||||
}
|
||||
|
||||
inline void os::dll_unload(void *lib) {
|
||||
|
||||
@ -40,6 +40,13 @@ frame JavaThread::pd_last_frame() {
|
||||
return frame(sp, pc);
|
||||
}
|
||||
|
||||
bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
|
||||
ucontext_t* uc = (ucontext_t*) ucontext;
|
||||
*fr_addr = frame((intptr_t*)uc->uc_mcontext.jmp_context.gpr[1/*REG_SP*/],
|
||||
(address)uc->uc_mcontext.jmp_context.iar);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Forte Analyzer AsyncGetCallTrace profiling support is not implemented on Aix/PPC.
|
||||
bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava) {
|
||||
Unimplemented();
|
||||
|
||||
@ -48,4 +48,7 @@
|
||||
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext,
|
||||
bool isInJava);
|
||||
|
||||
bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext,
|
||||
bool isInJava);
|
||||
|
||||
#endif // OS_CPU_AIX_PPC_VM_THREAD_AIX_PPC_HPP
|
||||
|
||||
@ -41,6 +41,13 @@ frame JavaThread::pd_last_frame() {
|
||||
return frame(sp, pc);
|
||||
}
|
||||
|
||||
bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
|
||||
ucontext_t* uc = (ucontext_t*) ucontext;
|
||||
*fr_addr = frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/],
|
||||
(address)uc->uc_mcontext.regs->nip);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Forte Analyzer AsyncGetCallTrace profiling support is not implemented on Linux/PPC.
|
||||
bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava) {
|
||||
Unimplemented();
|
||||
|
||||
@ -49,4 +49,6 @@
|
||||
|
||||
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava);
|
||||
|
||||
bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava);
|
||||
|
||||
#endif // OS_CPU_LINUX_PPC_VM_THREAD_LINUX_PPC_HPP
|
||||
|
||||
@ -41,6 +41,13 @@ frame JavaThread::pd_last_frame() {
|
||||
return frame(sp, pc);
|
||||
}
|
||||
|
||||
bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) {
|
||||
ucontext_t* uc = (ucontext_t*) ucontext;
|
||||
*fr_addr = frame((intptr_t*)uc->uc_mcontext.gregs[15/*REG_SP*/],
|
||||
(address)uc->uc_mcontext.psw.addr);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Forte Analyzer AsyncGetCallTrace profiling support is not implemented on Linux/S390x.
|
||||
bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava) {
|
||||
Unimplemented();
|
||||
|
||||
@ -48,4 +48,6 @@
|
||||
|
||||
bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava);
|
||||
|
||||
bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava);
|
||||
|
||||
#endif // OS_CPU_LINUX_S390_VM_THREAD_LINUX_S390_HPP
|
||||
|
||||
@ -110,6 +110,14 @@
|
||||
return false; // silence compile warning
|
||||
}
|
||||
|
||||
bool pd_get_top_frame_for_profiling(frame* fr_addr,
|
||||
void* ucontext,
|
||||
bool isInJava) {
|
||||
ShouldNotCallThis();
|
||||
return false; // silence compile warning
|
||||
}
|
||||
|
||||
|
||||
// These routines are only used on cpu architectures that
|
||||
// have separate register stacks (Itanium).
|
||||
static bool register_stack_overflow() { return false; }
|
||||
|
||||
@ -779,7 +779,7 @@ void Canonicalizer::do_If(If* x) {
|
||||
if (cmp->x() == cmp->y()) {
|
||||
do_If(canon);
|
||||
} else {
|
||||
if (compilation()->profile_branches()) {
|
||||
if (compilation()->profile_branches() || compilation()->count_backedges()) {
|
||||
// TODO: If profiling, leave floating point comparisons unoptimized.
|
||||
// We currently do not support profiling of the unordered case.
|
||||
switch(cmp->op()) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user