From a59ce6689f8b782d2f13f6b0f2d29effff6f715b Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Tue, 24 Nov 2015 21:32:46 +0300 Subject: [PATCH 001/212] 8132961: JEP 279: Improve Test-Failure Troubleshooting Co-authored-by: Kirill Shirokov Co-authored-by: Dmitry Fazunenko Co-authored-by: Kirill Zhaldybin Reviewed-by: lmesnik, sla --- test/failure_handler/Makefile | 114 ++++++ test/failure_handler/README | 107 ++++++ .../failurehandler/ElapsedTimePrinter.java | 48 +++ .../EnvironmentInfoGatherer.java | 28 ++ .../test/failurehandler/GathererFactory.java | 63 +++ .../jdk/test/failurehandler/HtmlPage.java | 47 +++ .../jdk/test/failurehandler/HtmlSection.java | 237 ++++++++++++ .../failurehandler/ProcessInfoGatherer.java | 28 ++ .../jdk/test/failurehandler/Stopwatch.java | 73 ++++ .../jdk/test/failurehandler/ToolKit.java | 72 ++++ .../jdk/test/failurehandler/Utils.java | 88 +++++ .../test/failurehandler/action/Action.java | 33 ++ .../failurehandler/action/ActionHelper.java | 360 ++++++++++++++++++ .../action/ActionParameters.java | 47 +++ .../test/failurehandler/action/ActionSet.java | 126 ++++++ .../failurehandler/action/PatternAction.java | 79 ++++ .../failurehandler/action/SimpleAction.java | 86 +++++ .../jtreg/GatherDiagnosticInfoObserver.java | 153 ++++++++ .../GatherProcessInfoTimeoutHandler.java | 144 +++++++ .../failurehandler/value/ArrayParser.java | 53 +++ .../failurehandler/value/DefaultParser.java | 120 ++++++ .../failurehandler/value/DefaultValue.java | 35 ++ .../value/InvalidValueException.java | 40 ++ .../failurehandler/value/PathValueParser.java | 36 ++ .../test/failurehandler/value/SubValues.java | 35 ++ .../jdk/test/failurehandler/value/Value.java | 36 ++ .../failurehandler/value/ValueHandler.java | 122 ++++++ .../failurehandler/value/ValueParser.java | 28 ++ .../src/share/conf/common.properties | 74 ++++ .../src/share/conf/linux.properties | 110 ++++++ .../src/share/conf/mac.properties | 98 +++++ .../src/share/conf/solaris.properties | 111 ++++++ .../src/share/conf/windows.properties | 115 ++++++ .../jtreg/GatherProcessInfoTimeoutHandler.c | 37 ++ test/failure_handler/test/TEST.ROOT | 0 test/failure_handler/test/sanity/Crash.java | 39 ++ .../failure_handler/test/sanity/Deadlock.java | 63 +++ .../failure_handler/test/sanity/Livelock.java | 55 +++ test/failure_handler/test/sanity/OOME.java | 49 +++ test/failure_handler/test/sanity/Suicide.java | 55 +++ .../test/sanity/SystemExit.java | 32 ++ .../test/sanity/ThrowError.java | 31 ++ .../test/sanity/WaitForDeadlock.java | 44 +++ .../value/DefaultParserTest.java | 118 ++++++ .../value/ValueHandlerTest.java | 110 ++++++ 45 files changed, 3579 insertions(+) create mode 100644 test/failure_handler/Makefile create mode 100644 test/failure_handler/README create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/ElapsedTimePrinter.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/EnvironmentInfoGatherer.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlPage.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlSection.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/ProcessInfoGatherer.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/Stopwatch.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/Utils.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/Action.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionHelper.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionParameters.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionSet.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/PatternAction.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/action/SimpleAction.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ArrayParser.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultParser.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultValue.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/InvalidValueException.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/PathValueParser.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/SubValues.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/Value.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueHandler.java create mode 100644 test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueParser.java create mode 100644 test/failure_handler/src/share/conf/common.properties create mode 100644 test/failure_handler/src/share/conf/linux.properties create mode 100644 test/failure_handler/src/share/conf/mac.properties create mode 100644 test/failure_handler/src/share/conf/solaris.properties create mode 100644 test/failure_handler/src/share/conf/windows.properties create mode 100644 test/failure_handler/src/windows/native/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.c create mode 100644 test/failure_handler/test/TEST.ROOT create mode 100644 test/failure_handler/test/sanity/Crash.java create mode 100644 test/failure_handler/test/sanity/Deadlock.java create mode 100644 test/failure_handler/test/sanity/Livelock.java create mode 100644 test/failure_handler/test/sanity/OOME.java create mode 100644 test/failure_handler/test/sanity/Suicide.java create mode 100644 test/failure_handler/test/sanity/SystemExit.java create mode 100644 test/failure_handler/test/sanity/ThrowError.java create mode 100644 test/failure_handler/test/sanity/WaitForDeadlock.java create mode 100644 test/failure_handler/test/unit/jdk/test/failurehandler/value/DefaultParserTest.java create mode 100644 test/failure_handler/test/unit/jdk/test/failurehandler/value/ValueHandlerTest.java diff --git a/test/failure_handler/Makefile b/test/failure_handler/Makefile new file mode 100644 index 00000000000..00f34c26511 --- /dev/null +++ b/test/failure_handler/Makefile @@ -0,0 +1,114 @@ +# +# Copyright (c) 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. +# + +# +# This is a temporary standalone makefile +# + +BUILD_DIR := $(shell pwd)/build +CLASSES_DIR := ${BUILD_DIR}/classes +IMAGE_DIR := ${BUILD_DIR}/image +RUN_DIR := $(shell pwd)/run + +SRC_DIR := src/share/classes/ +SOURCES := ${SRC_DIR}/jdk/test/failurehandler/*.java \ + ${SRC_DIR}/jdk/test/failurehandler/action/*.java \ + ${SRC_DIR}/jdk/test/failurehandler/jtreg/*.java \ + ${SRC_DIR}/jdk/test/failurehandler/value/*.java + +CONF_DIR = src/share/conf + +JAVA_RELEASE = 7 + +TARGET_JAR = ${IMAGE_DIR}/lib/jtregFailureHandler.jar + +OS_NAME := $(shell uname -o 2>&1) + +ifeq ("${OS_NAME}", "Cygwin") +BUILD_DIR := $(shell cygpath -m "${BUILD_DIR}") +CLASSES_DIR := $(shell cygpath -m "${CLASSES_DIR}") +IMAGE_DIR := $(shell cygpath -m "${IMAGE_DIR}") RUN_DIR := $(shell cygpath -m "${RUN_DIR}") +SRC_DIR := $(shell cygpath -m "${SRC_DIR}") +JTREG_HOME := $(shell cygpath -m "${JTREG_HOME}") +CC := "cl.exe" +endif + +all: clean test + +native: require_env +ifeq ("${OS_NAME}", "Cygwin") + "${CC}" src/windows/native/jdk/test/failurehandler/jtreg/*.c \ + -I"$(shell cygpath -w ${JAVA_HOME}/include)" \ + -I"$(shell cygpath -w ${JAVA_HOME}/include/win32)" \ + /link /MACHINE:X64 /DLL /OUT:timeoutHandler.dll +endif + +check_defined = $(foreach 1,$1,$(__check_defined)) +__check_defined = $(if $(value $1),, $(error $1 is not set)) + +classes: require_env + mkdir -p ${IMAGE_DIR}/bin ${IMAGE_DIR}/lib ${CLASSES_DIR} + "${JAVA_HOME}"/bin/javac -target ${JAVA_RELEASE} -source ${JAVA_RELEASE} \ + -sourcepath $(shell pwd) \ + -classpath ${JTREG_HOME}/lib/jtreg.jar:${JAVA_HOME}/lib/tools.jar \ + -d ${CLASSES_DIR} \ + ${SOURCES} + "${JAVA_HOME}"/bin/jar cf ${TARGET_JAR} -C ${CLASSES_DIR} . + "${JAVA_HOME}"/bin/jar uf ${TARGET_JAR} -C ${CONF_DIR} . + +# +# Use JTREG_TEST_OPTS for test VM options +# Use JTREG_TESTS for jtreg tests parameter +# +test: require_env build + rm -rf ${RUN_DIR} + mkdir -p ${RUN_DIR} + "${JTREG_HOME}"/bin/jtreg \ + -jdk:"${JAVA_HOME}" \ + ${JTREG_TEST_OPTS} \ + -timeout:0.1 -va -retain:all \ + -noreport \ + -agentvm \ + -thd:"${TARGET_JAR}" \ + -th:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \ + -od:"${TARGET_JAR}" \ + -o:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \ + -w:${RUN_DIR}/JTwork -r:${RUN_DIR}/JTreport \ + $(if ${JTREG_TESTS}, ${JTREG_TESTS}, test) \ + && false || true + +debug: JTREG_TEST_OPTS += "-J-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005'" +debug: test + +require_env: + $(call check_defined, JAVA_HOME) + $(call check_defined, JTREG_HOME) + +clean: + rm -rf "${BUILD_DIR}" "${RUN_DIR}" + +build: classes native + +.PHONY: all build classes native test require_env clean +.DEFAULT: all + diff --git a/test/failure_handler/README b/test/failure_handler/README new file mode 100644 index 00000000000..ca3e72705d2 --- /dev/null +++ b/test/failure_handler/README @@ -0,0 +1,107 @@ +Copyright (c) 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. + + + +DESCRIPTION + +The purpose of this library is gathering diagnostic information on test +failures and timeouts. The library runs platform specific tools, which are +configured in the way described below. The collected data will be available +in HTML format next to JTR files. + +The library uses JTHarness Observer and jtreg TimeoutHandler extensions points. + +DEPENDENCES + +The library requires jtreg 4b13+ and JDK 7+. + +BUILDING + +To build a library, one should simply run make with 'JTREG_HOME' and +'JAVA_HOME' environment variables set. 'JAVA_HOME' should contain path to JDK, +'JTREG_HOME' -- path to jtreg. + +'image/lib/jtregFailureHandler.jar' is created on successful build. + +CONFIGURATION + +Properties files are used to configure the library. They define which actions +to be performed in case of individual test failure or timeout. Each platform +family uses its own property file (named '.properties'). For platform +independent actions, 'common.properties' is used. + +Actions to be performed on each failure are listed in 'environment' property. +Extra actions for timeouts are listed in 'onTimeout'. + +Each action is defined via the following parameters: + - 'javaOnly' -- run the action only for java applications, false by default + - 'app' -- an application to run, mandatory parameter + - 'args' -- application command line arguments, none by default + - 'params' -- a structure which defines how an application should be run, + described below + +Actions listed in 'onTimeout' are "patterned" actions. Besides the parameters +listed above, they also have 'pattern' parameter -- a string which will be +replaced by PID in 'args' parameter before action execution. + +'params' structure has the following parameters: + - repeat -- how many times an action will be run, 1 by default + - pause -- delay in ms between iterations, 500 by default + - timeout -- time limitation for iteration in ms, 20 000 by default + - stopOnError -- if true, an action will be interrupted after the first error, + false by default + +From '.properties', the library reads the following parameters + - 'config.execSuffix' -- a suffix for all binary application file names + - 'config.getChildren' -- a "patterned" action used to get the list of all + children + +For simplicity we use parameter values inheritance. This means that we are +looking for the most specified parameter value. If we do not find it, we are +trying to find less specific value by reducing prefix. +For example, if properties contains 'p1=A', 'a.p1=B', 'a.b.p1=C', then +parameter 'p1' will be: + - 'C' for 'a.b.c' + - 'B' for 'a.c' + - 'A' for 'b.c' + +RUNNING + +To enable the library in jtreg, the following options should be set: + - '-timeoutHandlerDir' points to the built jar ('jtregFailureHandler.jar') + - '-observerDir' points to the built jar + - '-timeoutHandler' equals to jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler + - '-observer' equals to jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver + +In case of environment issues during an action execution, such as missing +application, hung application, lack of disk space, etc, the corresponding +warning appears and the library proceeds to next action. + +EXAMPLES + +$ ${JTREG_HOME}/bin/jtreg -jdk:${JAVA_HOME} \ + -timeoutHandlerDir:./image/lib/jtregFailureHandler.jar \ + -observerDir:./image/lib/jtregFailureHandler.jar \ + -timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler\ + -observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \ + ${WS}/hotspot/test/ + diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/ElapsedTimePrinter.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ElapsedTimePrinter.java new file mode 100644 index 00000000000..f1ab374d22c --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ElapsedTimePrinter.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler; + +import java.io.PrintWriter; +import java.util.concurrent.TimeUnit; + +public class ElapsedTimePrinter implements AutoCloseable { + private final String name; + private final PrintWriter out; + private final Stopwatch stopwatch; + + public ElapsedTimePrinter(Stopwatch stopwatch, String name, + PrintWriter out) { + this.stopwatch = stopwatch; + this.name = name; + this.out = out; + stopwatch.start(); + } + + @Override + public void close() { + stopwatch.stop(); + out.printf("%s took %d s%n", name, + TimeUnit.NANOSECONDS.toSeconds(stopwatch.getElapsedTimeNs())); + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/EnvironmentInfoGatherer.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/EnvironmentInfoGatherer.java new file mode 100644 index 00000000000..e2b9510ed76 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/EnvironmentInfoGatherer.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler; + +public interface EnvironmentInfoGatherer { + void gatherEnvironmentInfo(HtmlSection section); +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java new file mode 100644 index 00000000000..4799bb81da6 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/GathererFactory.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler; + +import jdk.test.failurehandler.action.ActionHelper; +import jdk.test.failurehandler.value.InvalidValueException; + +import java.io.PrintWriter; +import java.nio.file.Path; +import java.util.Properties; + +public final class GathererFactory { + private final Path workdir; + private final Path[] jdks; + private final PrintWriter log; + private final String osName; + + public GathererFactory(String osName, Path workdir, PrintWriter log, Path... jdks) { + this.osName = osName; + this.workdir = workdir; + this.log = log; + this.jdks = jdks; + } + + public EnvironmentInfoGatherer getEnvironmentInfoGatherer() { + return create(); + } + + public ProcessInfoGatherer getProcessInfoGatherer() { + return create(); + } + + private ToolKit create() { + Properties osProperty = Utils.getProperties(osName); + try { + ActionHelper helper = new ActionHelper(workdir, "config", osProperty, jdks); + return new ToolKit(helper, log, osName, "common"); + } catch (InvalidValueException e) { + throw new IllegalStateException("can't create tool kit", e); + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlPage.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlPage.java new file mode 100644 index 00000000000..d8fd13fdd7c --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlPage.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler; + +import java.io.PrintWriter; +import java.util.Objects; + +public class HtmlPage implements AutoCloseable { + private final PrintWriter writer; + private final HtmlSection rootSection; + + public HtmlPage(PrintWriter writer) { + Objects.requireNonNull(writer, "writer cannot be null"); + this.writer = writer; + rootSection = new HtmlSection(writer); + } + + @Override + public void close() { + writer.close(); + } + + public HtmlSection getRootSection() { + return rootSection; + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlSection.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlSection.java new file mode 100644 index 00000000000..0597fe7b206 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/HtmlSection.java @@ -0,0 +1,237 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler; + +import java.io.FilterWriter; +import java.io.IOException; +import java.io.PrintWriter; + +public class HtmlSection { + protected final HtmlSection rootSection; + protected final String id; + protected final String name; + + public PrintWriter getWriter() { + return textWriter; + } + + protected final PrintWriter pw; + protected final PrintWriter textWriter; + protected boolean closed; + + private HtmlSection child; + + + public HtmlSection(PrintWriter pw) { + this(pw, "", null, null); + } + + private HtmlSection(PrintWriter pw, String id, String name, HtmlSection rootSection) { + this.pw = pw; + textWriter = new PrintWriter(new HtmlFilterWriter(pw)); + this.id = id; + this.name = name; + child = null; + // main + if (rootSection == null) { + this.rootSection = this; + this.pw.println(""); + this.pw.println("\n" + + "\n" + + "\n" + + ""); + + this.pw.println(""); + } else { + this.rootSection = rootSection; + this.pw.print("
    "); + } + } + + public HtmlSection createChildren(String section) { + if (child != null) { + if (child.name.equals(section)) { + return child; + } + child.close(); + } + child = new SubSection(this, section, rootSection); + return child; + } + + protected final void removeChild(HtmlSection child) { + if (this.child == child) { + this.child = null; + } + } + + public void close() { + closeChild(); + if (closed) { + return; + } + closed = true; + + if (rootSection == this) { + pw.println(""); + pw.println(""); + pw.close(); + } else { + pw.println("
"); + } + + } + + protected final void closeChild() { + if (child != null) { + child.close(); + child = null; + } + } + + public void link(HtmlSection section, String child, String name) { + String path = section.id; + if (path.isEmpty()) { + path = child; + } else if (child != null) { + path = String.format("%s.%s", path, child); + } + pw.printf("%2$s%n", + path, name); + } + + public HtmlSection createChildren(String[] sections) { + int i = 0; + int n = sections.length; + HtmlSection current = rootSection; + if (current != null) { + for (; i < n && current.child != null; + ++i, current = current.child) { + if (!sections[i].equals(current.child.name)) { + break; + } + } + } + for (; i < n; ++i) { + current = current.createChildren(sections[i]); + } + return current; + } + + private static class SubSection extends HtmlSection { + private final HtmlSection parent; + + public SubSection(HtmlSection parent, String name, + HtmlSection rootSection) { + super(parent.pw, + parent.id.isEmpty() + ? name + : String.format("%s.%s", parent.id, name), + name, rootSection); + this.parent = parent; + pw.printf("
  • %2$s
    ",
    +                    id, name);
    +        }
    +
    +        @Override
    +        public void close() {
    +            closeChild();
    +            if (closed) {
    +                return;
    +            }
    +            pw.print("
  • "); + parent.removeChild(this); + super.close(); + } + } + + private static class HtmlFilterWriter extends FilterWriter { + public HtmlFilterWriter(PrintWriter pw) { + super(pw); + } + + @Override + public void write(int c) throws IOException { + switch (c) { + case '<': + super.write("<", 0, 4); + break; + case '>': + super.write(">", 0, 4); + break; + case '"': + super.write(""", 0, 5); + break; + case '&': + super.write("&", 0, 4); + break; + default: + super.write(c); + } + } + + @Override + public void write(char[] cbuf, int off, int len) throws IOException { + for (int i = off; i < len; ++i){ + write(cbuf[i]); + } + } + + @Override + public void write(String str, int off, int len) throws IOException { + for (int i = off; i < len; ++i){ + write(str.charAt(i)); + } + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/ProcessInfoGatherer.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ProcessInfoGatherer.java new file mode 100644 index 00000000000..3fb407cb578 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ProcessInfoGatherer.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler; + +public interface ProcessInfoGatherer { + void gatherProcessInfo(HtmlSection section, long pid); +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/Stopwatch.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/Stopwatch.java new file mode 100644 index 00000000000..2ac98959821 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/Stopwatch.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler; + +public final class Stopwatch { + protected boolean isResultAvailable; + protected boolean isRunning; + + private long startTimeNs; + private long stopTimeNs; + + public Stopwatch() { + isResultAvailable = false; + } + + /** + * Starts measuring time. + */ + public void start() { + startTimeNs = System.nanoTime(); + isRunning = true; + } + + /** + * Stops measuring time. + */ + public void stop() { + if (!isRunning) { + throw new IllegalStateException(" hasn't been started"); + } + stopTimeNs = System.nanoTime(); + isRunning = false; + isResultAvailable = true; + } + + /** + * @return time in nanoseconds measured between + * calls of {@link #start()} and {@link #stop()} methods. + * + * @throws IllegalStateException if called without preceding + * {@link #start()} {@link #stop()} method + */ + public long getElapsedTimeNs() { + if (isRunning) { + throw new IllegalStateException("hasn't been stopped"); + } + if (!isResultAvailable) { + throw new IllegalStateException("was not run"); + } + return stopTimeNs - startTimeNs; + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java new file mode 100644 index 00000000000..408bc1f450a --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/ToolKit.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler; + +import jdk.test.failurehandler.action.ActionSet; +import jdk.test.failurehandler.action.ActionHelper; + +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +public class ToolKit implements EnvironmentInfoGatherer, ProcessInfoGatherer { + private final List actions = new ArrayList<>(); + private final ActionHelper helper; + + public ToolKit(ActionHelper helper, PrintWriter log, String... names) { + this.helper = helper; + for (String name : names) { + actions.add(new ActionSet(helper, log, name)); + } + } + + @Override + public void gatherEnvironmentInfo(HtmlSection section) { + for (ActionSet set : actions) { + set.gatherEnvironmentInfo(section); + } + } + + @Override + public void gatherProcessInfo(HtmlSection section, long pid) { + Queue pids = new LinkedList<>(); + pids.add(pid); + for (Long p = pids.poll(); p != null; p = pids.poll()) { + HtmlSection pidSection = section.createChildren("" + p); + for (ActionSet set : actions) { + set.gatherProcessInfo(pidSection, p); + } + List children = helper.getChildren(pidSection, p); + if (!children.isEmpty()) { + HtmlSection s = pidSection.createChildren("children"); + for (Long c : children) { + s.link(section, c.toString(), c.toString()); + } + pids.addAll(children); + } + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/Utils.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/Utils.java new file mode 100644 index 00000000000..ea82360293b --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/Utils.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; +import java.util.Properties; + +public final class Utils { + private static final int BUFFER_LENGTH = 1024; + + public static String prependPrefix(String prefix, String name) { + return (prefix == null || prefix.isEmpty()) + ? name + : (name == null || name.isEmpty()) + ? prefix + : String.format("%s.%s", prefix, name); + } + + public static void copyStream(InputStream in, OutputStream out) + throws IOException { + int n; + byte[] buffer = new byte[BUFFER_LENGTH]; + while ((n = in.read(buffer)) != -1) { + out.write(buffer, 0, n); + } + out.flush(); + } + + public static void copyStream(Reader in, Writer out) + throws IOException { + int n; + char[] buffer = new char[BUFFER_LENGTH]; + while ((n = in.read(buffer)) != -1) { + out.write(buffer, 0, n); + } + out.flush(); + } + + public static Properties getProperties(String name) { + Properties properties = new Properties(); + String resourceName = String.format( + "/%s.%s", name.toLowerCase(), "properties"); + InputStream stream = Utils.class.getResourceAsStream(resourceName); + if (stream == null) { + throw new IllegalStateException(String.format( + "resource '%s' doesn't exist%n", resourceName)); + } + try { + try { + properties.load(stream); + } finally { + stream.close(); + } + } catch (IOException e) { + throw new IllegalStateException(String.format( + "can't read resource '%s' : %s%n", + resourceName, e.getMessage()), e); + } + return properties; + } + + private Utils() { } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/Action.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/Action.java new file mode 100644 index 00000000000..65b2a229e45 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/Action.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.action; + +import jdk.test.failurehandler.HtmlSection; + +public interface Action { + boolean isJavaOnly(); + HtmlSection getSection(HtmlSection section); + + ActionParameters getParameters(); +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionHelper.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionHelper.java new file mode 100644 index 00000000000..6a8ae037ea4 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionHelper.java @@ -0,0 +1,360 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.action; + +import com.sun.tools.attach.VirtualMachine; +import com.sun.tools.attach.VirtualMachineDescriptor; +import jdk.test.failurehandler.value.InvalidValueException; +import jdk.test.failurehandler.value.Value; +import jdk.test.failurehandler.value.ValueHandler; +import jdk.test.failurehandler.HtmlSection; +import jdk.test.failurehandler.Stopwatch; +import jdk.test.failurehandler.Utils; + +import java.io.BufferedReader; +import java.io.CharArrayReader; +import java.io.CharArrayWriter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.Reader; +import java.io.Writer; +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Properties; +import java.util.Timer; +import java.util.TimerTask; +import java.util.concurrent.TimeUnit; + +public class ActionHelper { + private final Path workDir; + @Value(name = "execSuffix") + private String executableSuffix = ""; + private Path[] paths; + + private final PatternAction getChildren; + + public ActionHelper(Path workDir, String prefix, Properties properties, + Path... jdks) throws InvalidValueException { + this.workDir = workDir.toAbsolutePath(); + getChildren = new PatternAction("children", + Utils.prependPrefix(prefix, "getChildren"), properties); + ValueHandler.apply(this, properties, prefix); + String[] pathStrings = System.getenv("PATH").split(File.pathSeparator); + paths = new Path[pathStrings.length]; + for (int i = 0; i < paths.length; ++i) { + paths[i] = Paths.get(pathStrings[i]); + } + addJdks(jdks); + } + + public List getChildren(HtmlSection section, long pid) { + String pidStr = "" + pid; + ProcessBuilder pb = getChildren.prepareProcess(section, this, pidStr); + PrintWriter log = getChildren.getSection(section).getWriter(); + CharArrayWriter writer = new CharArrayWriter(); + ExitCode code = run(log, writer, pb, getChildren.getParameters()); + Reader output = new CharArrayReader(writer.toCharArray()); + + if (!ExitCode.OK.equals(code)) { + log.println("WARNING: get children pids action failed"); + try { + Utils.copyStream(output, log); + } catch (IOException e) { + e.printStackTrace(log); + } + return Collections.emptyList(); + } + + List result = new ArrayList<>(); + try { + try (BufferedReader reader = new BufferedReader(output)) { + String line; + while ((line = reader.readLine()) != null) { + String value = line.trim(); + if (value.isEmpty()) { + // ignore empty lines + continue; + } + try { + result.add(Long.valueOf(value)); + } catch (NumberFormatException e) { + log.printf("WARNING: can't parse child pid %s : %s%n", + line, e.getMessage()); + e.printStackTrace(log); + } + } + } + } catch (IOException e) { + e.printStackTrace(log); + } + return result; + } + + public ProcessBuilder prepareProcess(PrintWriter log, String app, + String... args) { + File appBin = findApp(app); + if (appBin == null) { + log.printf("ERROR: can't find %s in %s.%n", + app, Arrays.toString(paths)); + return null; + } + List command = new ArrayList<>(args.length + 1); + command.add(appBin.toString()); + Collections.addAll(command, args); + return new ProcessBuilder() + .command(command) + .directory(workDir.toFile()); + } + + private File findApp(String app) { + String name = app + executableSuffix; + for (Path pathElem : paths) { + File result = pathElem.resolve(name).toFile(); + if (result.exists()) { + return result; + } + } + return null; + } + + private void addJdks(Path[] jdkPaths) { + if (jdkPaths != null && jdkPaths.length != 0) { + Path[] result = new Path[jdkPaths.length + paths.length]; + for (int i = 0; i < jdkPaths.length; ++i) { + result[i] = jdkPaths[i].resolve("bin"); + } + System.arraycopy(paths, 0, result, jdkPaths.length, paths.length); + paths = result; + } + } + + private ExitCode run(PrintWriter log, Writer out, ProcessBuilder pb, + ActionParameters params) { + char[] lineChars = new char[40]; + Arrays.fill(lineChars, '-'); + String line = new String(lineChars); + Stopwatch stopwatch = new Stopwatch(); + stopwatch.start(); + + log.printf("%s%n[%tF % 0) { + WATCHDOG.schedule(this, timeout); + } + } + } + + private void exec(HtmlSection section, ProcessBuilder process, + ActionParameters params) { + if (process == null) { + return; + } + PrintWriter sectionWriter = section.getWriter(); + if (params.repeat > 1) { + for (int i = 0, n = params.repeat; i < n; ++i) { + HtmlSection iteration = section.createChildren( + String.format("iteration_%d", i)); + PrintWriter writer = iteration.getWriter(); + ExitCode exitCode = run(writer, writer, process, params); + if (params.stopOnError && !ExitCode.OK.equals(exitCode)) { + sectionWriter.printf( + "ERROR: non zero exit code[%d] -- break.", + exitCode.value); + break; + } + try { + Thread.sleep(params.pause); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + e.printStackTrace(sectionWriter); + } + } + } else { + run(section.getWriter(), section.getWriter(), process, params); + } + } + + /** + * Special values for prepareProcess exit code. + * + *

    Can we clash with normal codes? + * On Solaris and Linux, only [0..255] are returned. + * On Windows, prepareProcess exit codes are stored in unsigned int. + * On MacOSX no limits (except it should fit C int type) + * are defined in the exit() man pages. + */ + private static class ExitCode { + /** Process exits gracefully */ + public static final ExitCode OK = new ExitCode(0); + /** Error launching prepareProcess */ + public static final ExitCode LAUNCH_ERROR = new ExitCode(-1); + /** Application prepareProcess has been killed by watchdog due to timeout */ + public static final ExitCode TIMED_OUT = new ExitCode(-2); + /** Application prepareProcess has never been started due to program logic */ + public static final ExitCode NEVER_STARTED = new ExitCode(-3); + + public final int value; + + private ExitCode(int value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + ExitCode exitCode = (ExitCode) o; + return value == exitCode.value; + } + + @Override + public int hashCode() { + return value; + } + } + +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionParameters.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionParameters.java new file mode 100644 index 00000000000..4bd919e1549 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionParameters.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.action; + +import jdk.test.failurehandler.value.DefaultValue; +import jdk.test.failurehandler.value.Value; + +public class ActionParameters { + @Value (name = "repeat") + @DefaultValue (value = "1") + public int repeat = 1; + + @Value (name = "pause") + @DefaultValue (value = "500") + public long pause = 500; + + @Value (name = "stopOnError") + @DefaultValue (value = "false") + public boolean stopOnError = false; + + @Value (name = "timeout") + @DefaultValue (value = "" + 20_000L) + public long timeout = -1L; + + public ActionParameters() { } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionSet.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionSet.java new file mode 100644 index 00000000000..3ed5b31403d --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/ActionSet.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.action; + +import jdk.test.failurehandler.ProcessInfoGatherer; +import jdk.test.failurehandler.EnvironmentInfoGatherer; +import jdk.test.failurehandler.HtmlSection; +import jdk.test.failurehandler.Utils; + +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +public class ActionSet implements ProcessInfoGatherer, EnvironmentInfoGatherer { + private static final String ENVIRONMENT_PROPERTY = "environment"; + private static final String ON_PID_PROPERTY = "onTimeout"; + + private final ActionHelper helper; + + public String getName() { + return name; + } + + private final String name; + private final List environmentActions; + private final List processActions; + + + public ActionSet(ActionHelper helper, PrintWriter log, String name) { + this.helper = helper; + this.name = name; + + Properties p = Utils.getProperties(name); + environmentActions = getSimpleActions(log, p, ENVIRONMENT_PROPERTY); + processActions = getPatternActions(log, p, ON_PID_PROPERTY); + } + + private List getSimpleActions(PrintWriter log, Properties p, + String key) { + String[] tools = getTools(log, p, key); + List result = new ArrayList<>(tools.length); + for (String tool : tools) { + try { + SimpleAction action = new SimpleAction( + Utils.prependPrefix(name, tool), tool, p); + result.add(action); + } catch (Exception e) { + log.printf("ERROR: %s cannot be created : %s %n", + tool, e.getMessage()); + e.printStackTrace(log); + } + } + return result; + } + + private List getPatternActions(PrintWriter log, + Properties p, String key) { + String[] tools = getTools(log, p, key); + List result = new ArrayList<>(tools.length); + for (String tool : tools) { + try { + PatternAction action = new PatternAction( + Utils.prependPrefix(name, tool), tool, p); + result.add(action); + } catch (Exception e) { + log.printf("ERROR: %s cannot be created : %s %n", + tool, e.getMessage()); + e.printStackTrace(log); + } + } + return result; + } + + private String[] getTools(PrintWriter writer, Properties p, String key) { + String value = p.getProperty(key); + if (value == null || value.isEmpty()) { + writer.printf("ERROR: '%s' property is empty%n", key); + return new String[]{}; + } + return value.split(" "); + } + + + @Override + public void gatherProcessInfo(HtmlSection section, long pid) { + String pidStr = "" + pid; + for (PatternAction action : processActions) { + if (action.isJavaOnly()) { + if (helper.isJava(pid, section.getWriter())) { + helper.runPatternAction(action, section, pidStr); + } + } else { + helper.runPatternAction(action, section, pidStr); + } + } + } + + @Override + public void gatherEnvironmentInfo(HtmlSection section) { + for (SimpleAction action : environmentActions) { + helper.runPatternAction(action, section); + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/PatternAction.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/PatternAction.java new file mode 100644 index 00000000000..fbcaaa7f47d --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/PatternAction.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.action; + +import jdk.test.failurehandler.value.InvalidValueException; +import jdk.test.failurehandler.HtmlSection; +import jdk.test.failurehandler.value.Value; +import jdk.test.failurehandler.value.ValueHandler; + +import java.util.Properties; + +public class PatternAction implements Action { + @Value(name = "pattern") + private String pattern = null; + + private final SimpleAction action; + private final String[] originalArgs; + + public PatternAction(String id, Properties properties) + throws InvalidValueException { + this(id, id, properties); + } + + public PatternAction(String name, String id, Properties properties) + throws InvalidValueException { + action = new SimpleAction(("pattern." + name), id, properties); + ValueHandler.apply(this, properties, id); + originalArgs = action.args.clone(); + } + + public ProcessBuilder prepareProcess(HtmlSection section, + ActionHelper helper, String value) { + action.sections[0] = value; + section = getSection(section); + String[] args = action.args; + System.arraycopy(originalArgs, 0, args, 0, originalArgs.length); + + for (int i = 0, n = args.length; i < n; ++i) { + args[i] = args[i].replace(pattern, value) ; + } + return action.prepareProcess(section.getWriter(), helper); + } + + @Override + public HtmlSection getSection(HtmlSection section) { + return action.getSection(section); + } + + @Override + public ActionParameters getParameters() { + return action.getParameters(); + } + + @Override + public boolean isJavaOnly() { + return action.isJavaOnly(); + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/SimpleAction.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/SimpleAction.java new file mode 100644 index 00000000000..e6a0e9ad102 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/action/SimpleAction.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.action; + +import jdk.test.failurehandler.HtmlSection; +import jdk.test.failurehandler.value.InvalidValueException; +import jdk.test.failurehandler.value.SubValues; +import jdk.test.failurehandler.value.Value; +import jdk.test.failurehandler.value.ValueHandler; +import jdk.test.failurehandler.value.DefaultValue; + +import java.io.PrintWriter; +import java.util.Properties; + +public class SimpleAction implements Action { + /* package-private */ final String[] sections; + @Value(name = "javaOnly") + @DefaultValue(value = "false") + private boolean javaOnly = false; + + @Value (name = "app") + private String app = null; + + @Value (name = "args") + @DefaultValue (value = "") + /* package-private */ String[] args = new String[]{}; + + @SubValues(prefix = "params") + private final ActionParameters params; + + public SimpleAction(String id, Properties properties) + throws InvalidValueException { + this(id, id, properties); + } + public SimpleAction(String name, String id, Properties properties) + throws InvalidValueException { + sections = name.split("\\."); + this.params = new ActionParameters(); + ValueHandler.apply(this, properties, id); + } + + public ProcessBuilder prepareProcess(PrintWriter log, ActionHelper helper) { + ProcessBuilder process = helper.prepareProcess(log, app, args); + if (process != null) { + process.redirectErrorStream(true); + } + + return process; + } + + @Override + public boolean isJavaOnly() { + return javaOnly; + } + + @Override + public HtmlSection getSection(HtmlSection section) { + return section.createChildren(sections); + } + + @Override + public ActionParameters getParameters() { + return params; + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java new file mode 100644 index 00000000000..bab0b598059 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java @@ -0,0 +1,153 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.jtreg; + +import com.sun.javatest.Harness; +import com.sun.javatest.Parameters; +import com.sun.javatest.TestResult; +import com.sun.javatest.regtest.RegressionParameters; +import com.sun.javatest.regtest.OS; +import jdk.test.failurehandler.*; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; + +/** + * The jtreg test execution observer, which gathers info about + * system and dumps it to a file. + */ +public class GatherDiagnosticInfoObserver implements Harness.Observer { + public static final String LOG_FILENAME = "environment.log"; + public static final String ENVIRONMENT_OUTPUT = "environment.html"; + + private String compileJdk; + private String testJdk; + + /* + * The harness calls this method after each test. + */ + @Override + public void finishedTest(TestResult tr) { + if (!tr.getStatus().isError() && !tr.getStatus().isFailed()) { + return; + } + + String jtrFile = tr.getFile().toString(); + final Path workDir = Paths.get( + jtrFile.substring(0, jtrFile.lastIndexOf('.'))); + workDir.toFile().mkdir(); + + String name = getClass().getName(); + PrintWriter log; + boolean needClose = false; + try { + log = new PrintWriter(new FileWriter( + workDir.resolve(LOG_FILENAME).toFile(), true)); + needClose = true; + } catch (IOException e) { + log = new PrintWriter(System.out); + log.printf("ERROR: %s cannot open log file %s", name, + LOG_FILENAME); + e.printStackTrace(log); + } + try { + log.printf("%s ---%n", name); + GathererFactory gathererFactory = new GathererFactory( + OS.current().family, workDir, log, + Paths.get(testJdk), Paths.get(compileJdk)); + gatherEnvInfo(workDir, name, log, + gathererFactory.getEnvironmentInfoGatherer()); + } catch (Throwable e) { + log.printf("ERROR: exception in observer %s:", name); + e.printStackTrace(log); + } finally { + log.printf("--- %s%n", name); + if (needClose) { + log.close(); + } else { + log.flush(); + } + } + } + + private void gatherEnvInfo(Path workDir, String name, PrintWriter log, + EnvironmentInfoGatherer gatherer) { + File output = workDir.resolve(ENVIRONMENT_OUTPUT).toFile(); + try (HtmlPage html = new HtmlPage(new PrintWriter( + new FileWriter(output, true)))) { + try (ElapsedTimePrinter timePrinter + = new ElapsedTimePrinter(new Stopwatch(), name, log)) { + gatherer.gatherEnvironmentInfo(html.getRootSection()); + } + } catch (Throwable e) { + log.printf("ERROR: exception in observer on getting environment " + + "information %s:", name); + e.printStackTrace(log); + } + } + + /* + * The harness calls this method one time per run, not per test. + */ + @Override + public void startingTestRun(Parameters params) { + // TODO find a better way to get JDKs + RegressionParameters rp = (RegressionParameters) params; + Map map = new HashMap<>(); + rp.save(map); + compileJdk = (String) map.get("regtest.compilejdk"); + testJdk = (String) map.get("regtest.testjdk"); + } + + @Override + public void startingTest(TestResult tr) { + // no-op + } + + @Override + public void stoppingTestRun() { + // no-op + } + + @Override + public void finishedTesting() { + // no-op + } + + @Override + public void finishedTestRun(boolean allOK) { + // no-op + } + + @Override + public void error(String msg) { + // no-op + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java new file mode 100644 index 00000000000..a16b4e734d7 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.java @@ -0,0 +1,144 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.jtreg; + +import com.sun.javatest.regtest.OS; +import com.sun.javatest.regtest.TimeoutHandler; +import jdk.test.failurehandler.*; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.lang.reflect.Field; +import java.nio.file.Path; + +/** + * A timeout handler for jtreg, which gathers information about the timed out + * process and its children. + */ +public class GatherProcessInfoTimeoutHandler extends TimeoutHandler { + static { + try { + System.loadLibrary("timeoutHandler"); + } catch (UnsatisfiedLinkError ignore) { + // not all os need timeoutHandler native-library + } + } + private static final String LOG_FILENAME = "processes.log"; + private static final String OUTPUT_FILENAME = "processes.html"; + + public GatherProcessInfoTimeoutHandler(PrintWriter jtregLog, File outputDir, + File testJdk) { + super(jtregLog, outputDir, testJdk); + } + + /** + * Runs various actions for jtreg timeout handler. + * + *

    Please see method code for the actions. + */ + @Override + protected void runActions(Process process, long pid) + throws InterruptedException { + Path workDir = outputDir.toPath(); + + String name = getClass().getName(); + PrintWriter actionsLog; + try { + // try to open a separate file for aciton log + actionsLog = new PrintWriter(new FileWriter( + workDir.resolve(LOG_FILENAME).toFile(), true)); + } catch (IOException e) { + // use jtreg log as a fallback + actionsLog = log; + actionsLog.printf("ERROR: %s cannot open log file %s : %s", name, + LOG_FILENAME, e.getMessage()); + } + try { + actionsLog.printf("%s ---%n", name); + + File output = workDir.resolve(OUTPUT_FILENAME).toFile(); + try { + PrintWriter pw = new PrintWriter(new FileWriter(output, true)); + runGatherer(name, workDir, actionsLog, pw, pid); + } catch (IOException e) { + actionsLog.printf("IOException: cannot open output file[%s] : %s", + output, e.getMessage()); + e.printStackTrace(actionsLog); + } + } finally { + actionsLog.printf("--- %s%n", name); + // don't close jtreg log + if (actionsLog != log) { + actionsLog.close(); + } else { + log.flush(); + } + } + } + + @Override + protected long getProcessId(Process process) { + long result = super.getProcessId(process); + if (result == 0L) { + /* jtreg didn't find pid, most probably we are on JDK < 9 + there is no Process::getPid */ + if ("windows".equals(OS.current().family)) { + try { + Field field = process.getClass().getDeclaredField("handle"); + boolean old = field.isAccessible(); + try { + field.setAccessible(true); + long handle = field.getLong(process); + result = getWin32Pid(handle); + } finally { + field.setAccessible(old); + } + } catch (ReflectiveOperationException e) { + e.printStackTrace(log); + } + } + } + return result; + } + + private native long getWin32Pid(long handle); + + private void runGatherer(String name, Path workDir, PrintWriter log, + PrintWriter out, long pid) { + try (HtmlPage html = new HtmlPage(out)) { + ProcessInfoGatherer gatherer = new GathererFactory( + OS.current().family, + workDir, log, testJdk.toPath()).getProcessInfoGatherer(); + try (ElapsedTimePrinter timePrinter + = new ElapsedTimePrinter(new Stopwatch(), name, log)) { + gatherer.gatherProcessInfo(html.getRootSection(), pid); + } + } catch (Throwable e) { + log.printf("ERROR: exception in timeout handler %s:", name); + e.printStackTrace(log); + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ArrayParser.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ArrayParser.java new file mode 100644 index 00000000000..fd2e4e6e01a --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ArrayParser.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.value; + +import java.lang.reflect.Array; +import java.util.Objects; + +public class ArrayParser implements ValueParser { + private final ValueParser parser; + + public ArrayParser(ValueParser parser) { + Objects.requireNonNull(parser); + this.parser = parser; + } + + @Override + public Object parse(Class type, String value, String delimiter) { + Class component = type.getComponentType(); + if (component.isArray()) { + throw new IllegalArgumentException( + "multidimensional array fields aren't supported"); + } + String[] values = (value == null || value.isEmpty()) + ? new String[]{} + : value.split(delimiter); + Object result = Array.newInstance(component, values.length); + for (int i = 0, n = values.length; i < n; ++i) { + Array.set(result, i, parser.parse(component, values[i], delimiter)); + } + return result; + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultParser.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultParser.java new file mode 100644 index 00000000000..7de7442efaf --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultParser.java @@ -0,0 +1,120 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.value; + +import java.util.HashMap; +import java.util.Map; + +public class DefaultParser implements ValueParser { + private static final Map, BasicParser> PARSERS = new HashMap<>(); + + static { + BasicParser.init(); + } + + @Override + public Object parse(Class type, String value, String s) { + if (type.isArray()) { + return new ArrayParser(this).parse(type, value, s); + } + ValueParser parser = PARSERS.get(type); + if (parser == null) { + throw new IllegalArgumentException("can't find parser for " + + type.getName()); + } + + return parser.parse(type, value, s); + } + + private static enum BasicParser implements ValueParser { + BOOL(boolean.class, Boolean.class) { + @Override + public Object parse(Class type, String value, String s) { + return Boolean.valueOf(value); + } + }, + BYTE(byte.class, Byte.class) { + @Override + public Object parse(Class type, String value, String s) { + return Byte.decode(value); + } + }, + CHAR(char.class, Character.class) { + @Override + public Object parse(Class type, String value, String s) { + if (value.length() != 1) { + throw new IllegalArgumentException( + String.format("can't cast %s to char", value)); + } + return value.charAt(0); + } + }, + SHORT(short.class, Short.class) { + @Override + public Object parse(Class type, String value, String s) { + return Short.decode(value); + } + }, + INT(int.class, Integer.class) { + @Override + public Object parse(Class type, String value, String s) { + return Integer.decode(value); + } + }, + LONG(long.class, Long.class) { + @Override + public Object parse(Class type, String value, String s) { + return Long.decode(value); + } + }, + FLOAT(float.class, Float.class) { + @Override + public Object parse(Class type, String value, String s) { + return Float.parseFloat(value); + } + }, + DOUBLE(double.class, Double.class) { + @Override + public Object parse(Class type, String value, String s) { + return Double.parseDouble(value); + } + }, + STRING(String.class, Object.class) { + @Override + public Object parse(Class type, String value, String s) { + return value; + } + }; + + private BasicParser(Class... classes) { + for (Class aClass : classes) { + DefaultParser.PARSERS.put(aClass, this); + } + } + + private static void init() { + // no-op used to provoke + } + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultValue.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultValue.java new file mode 100644 index 00000000000..081a9fd92de --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/DefaultValue.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.value; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(value = RetentionPolicy.RUNTIME) +@Target(value = ElementType.FIELD) +public @interface DefaultValue { + String value(); +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/InvalidValueException.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/InvalidValueException.java new file mode 100644 index 00000000000..6d544c27cb3 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/InvalidValueException.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.value; + +public class InvalidValueException extends Exception { + public InvalidValueException() { } + + public InvalidValueException(String message) { + super(message); + } + + public InvalidValueException(String s, Throwable e) { + super(s, e); + } + + public InvalidValueException(Throwable cause) { + super(cause); + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/PathValueParser.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/PathValueParser.java new file mode 100644 index 00000000000..89ed3a713b0 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/PathValueParser.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.value; + +import java.io.File; + +public class PathValueParser implements ValueParser { + @Override + public Object parse(Class type, String value, String delimiter) { + if (type.isArray()) { + return new ArrayParser(this).parse(type, value, delimiter); + } + return new File(value).toPath(); + } +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/SubValues.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/SubValues.java new file mode 100644 index 00000000000..cc09a0d4b50 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/SubValues.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.value; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(value = RetentionPolicy.RUNTIME) +@Target(value = ElementType.FIELD) +public @interface SubValues { + String prefix(); +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/Value.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/Value.java new file mode 100644 index 00000000000..9f4c3cdac22 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/Value.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.value; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(value = RetentionPolicy.RUNTIME) +@Target(value = ElementType.FIELD) +public @interface Value { + String name(); + Class parser() default DefaultParser.class; +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueHandler.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueHandler.java new file mode 100644 index 00000000000..971f11ef243 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueHandler.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.value; + +import jdk.test.failurehandler.Utils; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.Objects; +import java.util.Properties; + +public final class ValueHandler { + public static void apply(T object, Properties properties, + String prefix) throws InvalidValueException { + Objects.requireNonNull(object, "object cannot be null"); + Objects.requireNonNull(properties, "properties cannot be null"); + Class aClass = object.getClass(); + while (aClass != null) { + for (Field field : aClass.getDeclaredFields()) { + Value p = field.getAnnotation(Value.class); + if (p != null) { + applyToField(p, object, field, properties, prefix); + } else { + SubValues sub + = field.getAnnotation(SubValues.class); + if (sub != null) { + getAccess(field); + try { + apply(field.get(object), properties, + Utils.prependPrefix(prefix, sub.prefix())); + } catch (IllegalAccessException e) { + throw new InvalidValueException(String.format( + "can't apply sub properties to %s.", + field.getName())); + } + } + } + } + aClass = aClass.getSuperclass(); + } + } + + private static void applyToField(Value property, Object object, + Field field, Properties properties, String prefix) + throws InvalidValueException { + getAccess(field); + if (Modifier.isFinal(field.getModifiers())) { + throw new InvalidValueException( + String.format("field '%s' is final", field)); + } + String name = Utils.prependPrefix(prefix, property.name()); + String value = getProperty(properties, prefix, property.name()); + if (value == null) { + DefaultValue defaultValue + = field.getAnnotation(DefaultValue.class); + value = defaultValue == null ? null : defaultValue.value(); + } + if (value == null) { + throw new InvalidValueException(String.format( + "can't set '%s', because properties don't have '%s'.", + field.getName(), name)); + } + String delimiter = getProperty(properties, + Utils.prependPrefix(prefix, property.name()), "delimiter"); + delimiter = delimiter == null ? " " : delimiter; + Class parserClass = property.parser(); + try { + field.set(object, parserClass.newInstance().parse( + field.getType(), value, delimiter)); + } catch (ReflectiveOperationException | IllegalArgumentException e) { + throw new InvalidValueException( + String.format("can't set field '%s' : %s", + field.getName(), e.getMessage()), e); + } + } + + private static String getProperty(Properties properties, + String prefix, String name) { + if (prefix == null || prefix.isEmpty()) { + return properties.getProperty(name); + } + int index = prefix.length(); + do { + String value = properties.getProperty( + Utils.prependPrefix(prefix.substring(0, index), name)); + if (value != null) { + return value; + } + index = prefix.lastIndexOf('.', index - 1); + } while (index > 0); + return properties.getProperty(name); + } + + private static void getAccess(Field field) { + int modifiers = field.getModifiers(); + if (!Modifier.isPublic(modifiers)) { + field.setAccessible(true); + } + } + +} diff --git a/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueParser.java b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueParser.java new file mode 100644 index 00000000000..fe7c00a41d2 --- /dev/null +++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/value/ValueParser.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.value; + +public interface ValueParser { + Object parse(Class type, String value, String delimiter); +} diff --git a/test/failure_handler/src/share/conf/common.properties b/test/failure_handler/src/share/conf/common.properties new file mode 100644 index 00000000000..6e8e6ef24c4 --- /dev/null +++ b/test/failure_handler/src/share/conf/common.properties @@ -0,0 +1,74 @@ +# +# Copyright (c) 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. +# + +pattern=%p +javaOnly=true +args=%p +################################################################################ +# process info to gather +################################################################################ +onTimeout=\ + jinfo \ + jcmd.compiler.codecache jcmd.compiler.codelist \ + jcmd.compiler.queue \ + jcmd.vm.classloader_stats jcmd.vm.stringtable \ + jcmd.vm.symboltable jcmd.vm.uptime jcmd.vm.dynlibs \ + jcmd.vm.system_properties \ + jcmd.gc.class_stats jcmd.gc.class_histogram \ + jstack \ + jmap.heap jmap.histo jmap.clstats jmap.finalizerinfo + +jinfo.app=jinfo + +jcmd.app=jcmd + +jcmd.compiler.codecache.args=%p Compiler.codecache +jcmd.compiler.codelist.args=%p Compiler.codelist +jcmd.compiler.queue.args=%p Compiler.queue + +jcmd.vm.classloader_stats.args=%p VM.classloader_stats +jcmd.vm.stringtable.args=%p VM.stringtable +jcmd.vm.symboltable.args=%p VM.symboltable +jcmd.vm.uptime.args=%p VM.uptime +jcmd.vm.dynlibs.args=%p VM.dynlibs +jcmd.vm.system_properties.args=%p VM.system_properties + +jcmd.gc.class_stats.args=%p GC.class_stats +jcmd.gc.class_histogram.args=%p GC.class_histogram + +jstack.app=jstack +jstack.params.repeat=6 + +jmap.app=jmap +jmap.heap.args=-heap %p +jmap.histo.args=-histo %p +jmap.clstats.args=-clstats %p +jmap.finalizerinfo.args=-finalizerinfo %p + +################################################################################ +# environment info to gather +################################################################################ +environment=jps +jps.app=jps +jps.args=-mlv +################################################################################ diff --git a/test/failure_handler/src/share/conf/linux.properties b/test/failure_handler/src/share/conf/linux.properties new file mode 100644 index 00000000000..a9cb01f4b84 --- /dev/null +++ b/test/failure_handler/src/share/conf/linux.properties @@ -0,0 +1,110 @@ +# +# Copyright (c) 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. +# + +config.execSuffix= +config.getChildren.pattern=%p +config.getChildren.app=ps +config.getChildren.args=--no-headers -o pid --ppid %p +################################################################################ +# process info to gather +################################################################################ +onTimeout=\ + native.pmap.normal native.pmap.everything \ + native.files native.locks \ + native.stack native.core +################################################################################ +native.pattern=%p +native.javaOnly=false +native.args=%p + +native.pmap.app=pmap +native.pmap.normal.args=-p %p +native.pmap.everything.args=-XXp %p + +native.files.app=lsof +native.files.args=-p %p + +native.locks.app=lslocks +native.locks.args=-u --pid %p + +native.stack.app=gdb +native.stack.args=--pid=%p\0-batch\0-ex\0thread apply all backtrace +native.stack.args.delimiter=\0 +native.stack.params.repeat=6 + +native.core.app=gcore +native.core.args=-o ./core.%p %p +native.core.params.timeout=3600000 +################################################################################ +# environment info to gather +################################################################################ +environment=\ + users.current users.logged users.last \ + disk \ + env \ + system.dmesg system.sysctl \ + process.top process.ps \ + memory.free memory.vmstat.default memory.vmstat.statistics \ + memory.vmstat.slabinfo memory.vmstat.disk \ + files \ + locks \ + net.sockets net.statistics +################################################################################ +users.current.app=id +users.current.args=-a +users.logged.app=who +users.logged.args=-a +users.last.app=last +users.last.args=-10 + +disk.app=df +disk.args=-h + +env.app=env + +system.dmesg.app=dmesg +system.sysctl.app=sysctl +system.sysctl.args=-a + +process.top.app=top +process.top.args=-b -n 1 +process.ps.app=ps +process.ps.args=-Leo pid,pcpu,cputime,start,pmem,vsz,rssize,stackp,stat,sgi_p,wchan,user,args + +memory.free.app=free +memory.free.args=-h +memory.vmstat.app=vmstat +memory.vmstat.default.args=3 3 +memory.vmstat.statistics.args=-s +memory.vmstat.slabinfo.args=-m +memory.vmstat.disk.args=-d + +files.app=lsof +locks.app=lslocks +locks.args=-u + +net.app=netstat +net.sockets.args=-aeeopv +net.statistics.args=-sv +################################################################################ + diff --git a/test/failure_handler/src/share/conf/mac.properties b/test/failure_handler/src/share/conf/mac.properties new file mode 100644 index 00000000000..e2b1ac21b25 --- /dev/null +++ b/test/failure_handler/src/share/conf/mac.properties @@ -0,0 +1,98 @@ +# +# Copyright (c) 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. +# + +config.execSuffix= +config.getChildren.pattern=%p +config.getChildren.app=pgrep +config.getChildren.args=-P %p +################################################################################ +# process info to gather +################################################################################ +onTimeout=\ + native.vmmap native.heap native.leaks native.spindump \ + native.stack native.core +################################################################################ +native.pattern=%p +native.javaOnly=false +native.args=%p + +# Some of them require root privileges +native.vmmap.app=vmmap +native.heap.app=heap +native.leaks.app=leaks +native.spindump.app=spindump +native.spindump.args=%p -stdout + +native.stack.app=lldb +native.stack.delimiter=\0 +native.stack.params.repeat=6 +native.stack.args=-o\0attach %p\0-o\0thread backtrace all\0-o\0detach\0-o\0quit + +native.core.app=bash +native.core.delimiter=\0 +native.core.args=-c\0gcore -o ./core.%p %p || \ + lldb -o 'attach %p' -o 'process save-core core.%p' -o 'detach' -o 'quit' +native.core.params.timeout=3600000 +################################################################################ +# environment info to gather +################################################################################ +environment=\ + users.current users.logged users.last \ + disk \ + env \ + system.dmesg system.sysctl \ + process.ps process.top \ + memory.vmstat \ + netstat.av netstat.aL netstat.m netstat.s +################################################################################ +users.current.app=id +users.current.args=-a +users.logged.app=who +users.logged.args=-a +users.last.app=last +users.last.args=-10 + +disk.app=df +disk.args=-h + +env.app=env + +system.dmesg.app=dmesg +system.sysctl.app=sysctl +system.sysctl.args=-a + +process.ps.app=ps +process.ps.args=-Meo pid,pcpu,cputime,start,pmem,vsz,rss,state,wchan,user,args +process.top.app=top +process.top.args=-l 1 + +memory.vmstat.app=vm_stat +memory.vmstat.args=-c 3 3 + + +netstat.app=netstat +netstat.av.args=-av +netstat.aL.args=-aL +netstat.m.args=-m +netstat.s.args=-s +################################################################################ diff --git a/test/failure_handler/src/share/conf/solaris.properties b/test/failure_handler/src/share/conf/solaris.properties new file mode 100644 index 00000000000..4c0b673014e --- /dev/null +++ b/test/failure_handler/src/share/conf/solaris.properties @@ -0,0 +1,111 @@ +# +# Copyright (c) 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. +# + +config.execSuffix= +# pattern will be replaced with the PID +config.getChildren.pattern=%p +config.getChildren.app=pgrep +config.getChildren.args=-P %p +################################################################################ +# prepareProcess info to gather +################################################################################ +onTimeout=\ + native.pmap \ + native.pfiles \ + native.stack native.core +################################################################################ +# solaris specific +################################################################################ +native.pattern=%p +native.javaOnly=false + +native.pmap.app=pmap +native.pmap.args=-F %p + +native.pfiles.app=pfiles +native.pfiles.args=-F %p + +# native.locks TODO find 'analog for solaris' for Linux lslocks + +native.stack.app=pstack +native.stack.args=-F %p +native.stack.params.repeat=6 + +native.core.app=gcore +native.core.args=-F -o ./core %p +native.core.params.timeout=3600000 +################################################################################ +# environment info to gather +################################################################################ +environment=\ + users.current users.logged users.last \ + disk \ + env \ + system.dmesg system.prtconf system.sysdef \ + process.ps process.top \ + memory.swap memory.vmstat.default memory.vmstat.statistics memory.pagesize \ + netstat.av netstat.m netstat.s netstat.i +################################################################################ +# common unix +################################################################################ +users.current.app=id +users.current.args=-a +users.logged.app=who +users.logged.args=-a +users.last.app=last +users.last.args=-10 + +disk.app=df +disk.args=-h + +env.app=env + +system.dmesg.app=dmesg +system.prtconf.app=prtconf +system.sysdef.app=sysdef + +memory.swap.app=swap +memory.swap.args=-l + +process.ps.app=ps +process.ps.args=-Leo pid,lwp,ppid,tty,s,wchan,pcpu,time,stime,pmem,vsz,osz,rss,args + +process.top.app=top +process.top.args=-b -n + +memory.vmstat.app=vmstat +memory.vmstat.default.args=3 3 +memory.vmstat.statistics.args=-s + +memory.pagesize.app=pagesize + +# TODO: how to start prstat to show statistics and exit? +# prstat.app=prstat +# prstat.args=-a + +netstat.app=netstat +netstat.av.args=-av +netstat.m.args=-m +netstat.s.args=-s +netstat.i.args=-i 1 5 +################################################################################ diff --git a/test/failure_handler/src/share/conf/windows.properties b/test/failure_handler/src/share/conf/windows.properties new file mode 100644 index 00000000000..ed5385cba83 --- /dev/null +++ b/test/failure_handler/src/share/conf/windows.properties @@ -0,0 +1,115 @@ +# +# Copyright (c) 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. +# + +config.execSuffix=.exe +config.getChildren.app=bash +config.getChildren.pattern=%p +config.getChildren.args=-c\0wmic process where ParentProcessId=%p get ProcessId | tail -n+2 +config.getChildren.args.delimiter=\0 +################################################################################ +# process info to gather +################################################################################ +onTimeout=\ + native.info \ + native.pmap.normal native.pmap.everything \ + native.files native.locks \ + native.stack native.core +################################################################################ +native.pattern=%p +native.javaOnly=false +native.args=%p + +native.info.app=wmic +native.info.args=process where processId=%p list full + +native.pmap.app=pmap +native.pmap.normal.args=%p +native.pmap.everything.args=-x %p + +native.files.app=handle +native.files.args=-p %p +# TODO +native.locks.app=lslocks +native.locks.args=-u --pid %p + +native.stack.app=cdb +native.stack.args=-c "~*kP n;qd" -p %p +native.stack.params.repeat=6 + +native.core.app=cdb +native.core.args=-c ".dump /f core.%p;qd" -p %p +native.core.params.timeout=3600000 +################################################################################ +# environment info to gather +################################################################################ +environment=\ + users.current users.logged \ + disk \ + env \ + system.events.system system.events.application system.os \ + process.top process.ps process.tasklist \ + memory.free memory.vmstat.default memory.vmstat.statistics \ + memory.vmstat.slabinfo memory.vmstat.disk \ + files \ + net.sockets net.statistics +################################################################################ +users.current.app=id +users.current.args=-a +users.logged.app=query +users.logged.args=user + +disk.app=df +disk.args=-h + +env.app=env + +system.events.app=powershell +system.events.delimiter=\0 +system.events.system.args=-NoLogo\0-Command\0Get-EventLog System -After (Get-Date).AddDays(-1) | Format-List +system.events.application.args=-NoLogo\0-Command\0Get-EventLog Application -After (Get-Date).AddDays(-1) | Format-List + +system.os.app=wmic +system.os.args=os get /format:list + +process.top.app=top +process.top.args=-b -n 1 +process.ps.app=ps +process.ps.args=-efW +process.tasklist.app=tasklist +process.tasklist.args=/V + +memory.free.app=free +memory.vmstat.app=vmstat +memory.vmstat.statistics.args=-s +memory.vmstat.slabinfo.args=-m +memory.vmstat.disk.args=-d + +files.app=openfiles +files.args=/query + +net.sockets.app=bash +net.sockets.args=-c\0netstat -b -a -t -o || netstat -a -t -o +net.sockets.args.delimiter=\0 +net.statistics.app=netstat +net.statistics.args=-s -e +################################################################################ diff --git a/test/failure_handler/src/windows/native/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.c b/test/failure_handler/src/windows/native/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.c new file mode 100644 index 00000000000..f2155129316 --- /dev/null +++ b/test/failure_handler/src/windows/native/jdk/test/failurehandler/jtreg/GatherProcessInfoTimeoutHandler.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 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 +#include + +#ifdef __cplusplus +extern "C" { +#endif + +JNIEXPORT jlong JNICALL Java_jdk_test_failurehandler_jtreg_GatherProcessInfoTimeoutHandler_getWin32Pid + (JNIEnv* env, jobject o, jlong handle) { + return GetProcessId(handle); +} +#ifdef __cplusplus +} +#endif diff --git a/test/failure_handler/test/TEST.ROOT b/test/failure_handler/test/TEST.ROOT new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/failure_handler/test/sanity/Crash.java b/test/failure_handler/test/sanity/Crash.java new file mode 100644 index 00000000000..8ada290fd78 --- /dev/null +++ b/test/failure_handler/test/sanity/Crash.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 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. + */ + +import sun.misc.Unsafe; + +import java.lang.reflect.Field; + +/* + * @test + * @run main/othervm Crash + */ +public class Crash { + public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException { + Field f = Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + Unsafe u = (Unsafe) f.get(null); + u.setMemory(0, 42, (byte) 0xFF); + } +} diff --git a/test/failure_handler/test/sanity/Deadlock.java b/test/failure_handler/test/sanity/Deadlock.java new file mode 100644 index 00000000000..d74c7a5de66 --- /dev/null +++ b/test/failure_handler/test/sanity/Deadlock.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 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. + */ + + +/* + * @test + * @summary Deadlocked client + */ +public class Deadlock { + public double e; + private volatile int i; + + public static void main(String[] args) { + new Deadlock().test(); + } + private void test() { + final Object a = new Object(); + final Object b = new Object(); + + new Thread(new Runnable() { + @Override + public void run() { + synchronized (a) { + do { + i |= 1; + } while (i != 3); + + synchronized (b) { + e = 1; + } + } + }}).start(); + + synchronized (b) { + do { + i |= 2; + } while (i != 3); + synchronized (a) { + e = 2; + } + } + } +} diff --git a/test/failure_handler/test/sanity/Livelock.java b/test/failure_handler/test/sanity/Livelock.java new file mode 100644 index 00000000000..6ab96fdbb91 --- /dev/null +++ b/test/failure_handler/test/sanity/Livelock.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @summary Busy infinite loop client, calculating E number + */ +public class Livelock { + + public static double elim; + + public static void main(String[] args) { + System.out.printf( + "%24s %24s %24s %24s %24s %24s%n", + "n", "n!", "e = lim(...)", "e = taylor series", + "err e-lim", "err e-taylor"); + + while (true) { + double esum = 2; + double nfac = 1; + double iter = 1; + for (double n = 1; !Double.isInfinite(n) && !Double.isNaN(n) ; n = n * 2) { + elim = Math.pow(1 + 1 / n, n); + + iter += 1; + nfac *= iter; + esum += 1 / nfac; + + System.out.printf("% 24.16e % 24.16e % 24.16e % 24.16e" + + "%- 24.16e %- 24.16e%n", + n, nfac, elim, esum, (Math.E - elim), (Math.E - esum)); + } + } + } +} diff --git a/test/failure_handler/test/sanity/OOME.java b/test/failure_handler/test/sanity/OOME.java new file mode 100644 index 00000000000..6cec15b3e8d --- /dev/null +++ b/test/failure_handler/test/sanity/OOME.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 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. + */ + + +import java.util.LinkedList; + +/* + * @test + * @summary Slowly eat all memory in an infinite loop + * @run main/othervm Crash + */ +public class OOME { + @SuppressWarnings ("UnusedDeclaration") + private static Object garbage; + public static void main(String args[]) { + + int chunkSize = 0x8000; + LinkedList list = new LinkedList<>(); + garbage = list; + + while (true) { + try { + list.add(new int[chunkSize]); + } catch (OutOfMemoryError e) { + chunkSize >>= 1; + } + } + } +} diff --git a/test/failure_handler/test/sanity/Suicide.java b/test/failure_handler/test/sanity/Suicide.java new file mode 100644 index 00000000000..0cc1c4a3fe0 --- /dev/null +++ b/test/failure_handler/test/sanity/Suicide.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 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. + */ + + + +import java.lang.management.ManagementFactory; + +/* + * @test + * @summary Suicide test + * @run main/othervm Crash + */ +public class Suicide { + public static void main(String[] args) { + String cmd = null; + try { + String pidStr = ManagementFactory.getRuntimeMXBean().getName() + .split("@")[0]; + String osName = System.getProperty("os.name"); + if (osName.contains("Windows")) { + cmd = "taskkill.exe /F /PID " + pidStr; + } else { + cmd = "kill -9 " + pidStr; + } + + System.out.printf("executing `%s'%n", cmd); + Runtime.getRuntime().exec(cmd); + Thread.sleep(2000); + } catch (Exception e) { + e.printStackTrace(); + } + System.err.printf("TEST/ENV BUG: %s didn't kill JVM%n", cmd); + System.exit(1); + } +} diff --git a/test/failure_handler/test/sanity/SystemExit.java b/test/failure_handler/test/sanity/SystemExit.java new file mode 100644 index 00000000000..e0eabb77f57 --- /dev/null +++ b/test/failure_handler/test/sanity/SystemExit.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @run main/othervm SystemExit + */ +public class SystemExit { + public static void main(String[] args) { + System.exit(1); + } +} diff --git a/test/failure_handler/test/sanity/ThrowError.java b/test/failure_handler/test/sanity/ThrowError.java new file mode 100644 index 00000000000..45100d6862b --- /dev/null +++ b/test/failure_handler/test/sanity/ThrowError.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + */ +public class ThrowError { + public static void main(String[] args) { + throw new Error("TEST FAIL"); + } +} diff --git a/test/failure_handler/test/sanity/WaitForDeadlock.java b/test/failure_handler/test/sanity/WaitForDeadlock.java new file mode 100644 index 00000000000..98f14bc31f3 --- /dev/null +++ b/test/failure_handler/test/sanity/WaitForDeadlock.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 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. + */ + +import java.io.IOException; +import java.nio.file.Paths; + +/* + * @test + * @build Deadlock + * @run driver WaitForDeadlock + */ +public class WaitForDeadlock { + public static void main(String[] args) throws Exception { + System.out.println("START"); + ProcessBuilder pb = new ProcessBuilder(Paths.get( + System.getProperty("test.jdk"), "bin", "java").toString(), + "-cp", System.getProperty("java.class.path"), + Deadlock.class.getName()); + pb.redirectError(ProcessBuilder.Redirect.to(Paths.get("out").toFile())); + pb.redirectOutput(ProcessBuilder.Redirect.to(Paths.get("err").toFile())); + int r = pb.start().waitFor(); + System.out.println("END. " + r); + } +} diff --git a/test/failure_handler/test/unit/jdk/test/failurehandler/value/DefaultParserTest.java b/test/failure_handler/test/unit/jdk/test/failurehandler/value/DefaultParserTest.java new file mode 100644 index 00000000000..55297e09168 --- /dev/null +++ b/test/failure_handler/test/unit/jdk/test/failurehandler/value/DefaultParserTest.java @@ -0,0 +1,118 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.value; + +import org.junit.Assert; +import org.junit.Test; + +public class DefaultParserTest { + @Test + public void testParseStringArray() throws Exception { + DefaultParser parser = new DefaultParser(); + String line = "a aa aaa"; + String[] result = {"a", "aa", "", "", "aaa"}; + Assert.assertArrayEquals(result, + (Object[]) parser.parse(result.getClass(), line, " ")); + + line = null; + result = new String[]{}; + Assert.assertArrayEquals(result, + (Object[]) parser.parse(result.getClass(), line, " ")); + } + + @Test + public void testParseObjectArray() throws Exception { + DefaultParser parser = new DefaultParser(); + String line = "a aa aaa"; + String[] result = {"a", "aa", "", "", "aaa"}; + Assert.assertArrayEquals(result, + (String[]) parser.parse(result.getClass(), line, " ")); + Object[] result2 = {"a", "aa", "", "", "aaa"}; + Assert.assertArrayEquals(result2, + (Object[]) parser.parse(result.getClass(), line, " ")); + } + + @Test + public void testParseCharArray() throws Exception { + DefaultParser parser = new DefaultParser(); + String line = "a b c a"; + char[] result = {'a', 'b', 'c', 'a'}; + Assert.assertArrayEquals(result, + (char[]) parser.parse(result.getClass(), line, " ")); + + Character[] result2 = {'a', 'b', 'c', 'a'}; + Assert.assertArrayEquals(result2, + (Character[]) parser.parse(result2.getClass(), line, " ")); + } + + @Test + public void testParseBoolean() throws Exception { + DefaultParser parser = new DefaultParser(); + String line = "a b c a"; + Assert.assertEquals(false, + (boolean) parser.parse(boolean.class, line, " ")); + Assert.assertEquals(Boolean.FALSE, + parser.parse(Boolean.class, line, " ")); + line = "trUe"; + Assert.assertEquals(true, + (boolean) parser.parse(boolean.class, line, " ")); + Assert.assertEquals(Boolean.TRUE, + parser.parse(Boolean.class, line, " ")); + } + + @Test + public void testParseShort() throws Exception { + DefaultParser parser = new DefaultParser(); + Assert.assertSame("10", (short) 10, + parser.parse(short.class, "10", " ")); + Assert.assertSame("010", (short) 8, + parser.parse(short.class, "010", " ")); + Assert.assertSame("0x10", (short) 16, + parser.parse(short.class, "0x10", " ")); + } + + @Test + public void testParseByte() throws Exception { + DefaultParser parser = new DefaultParser(); + Assert.assertSame("11", (byte) 11, + parser.parse(byte.class, "11", " ")); + Assert.assertSame("011", (byte) 9, + parser.parse(byte.class, "011", " ")); + Assert.assertSame("0x11", (byte) 17, + parser.parse(byte.class, "0x11", " ")); + } + + @Test + public void testParseInt() throws Exception { + DefaultParser parser = new DefaultParser(); + Assert.assertEquals("20", (int) 20, + parser.parse(int.class, "20", " ")); + Assert.assertEquals("020", (int) 16, + parser.parse(int.class, "020", " ")); + Assert.assertEquals("0x20", (int) 32, + parser.parse(int.class, "0x20", " ")); + } + + +} diff --git a/test/failure_handler/test/unit/jdk/test/failurehandler/value/ValueHandlerTest.java b/test/failure_handler/test/unit/jdk/test/failurehandler/value/ValueHandlerTest.java new file mode 100644 index 00000000000..51e8205ffcf --- /dev/null +++ b/test/failure_handler/test/unit/jdk/test/failurehandler/value/ValueHandlerTest.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 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. + */ + +package jdk.test.failurehandler.value; + +import org.junit.Assert; +import org.junit.Test; + +import java.lang.reflect.Field; +import java.util.Properties; + +public class ValueHandlerTest { + @Test + public void testApplyAnonymousPrivateFinalInt() throws Exception { + Properties p = new Properties(); + p.put("int", "010"); + Object o = new Object() { + @Value (name = "int") + private final int i1 = -1; + }; + Field f = o.getClass().getDeclaredField("i1"); + f.setAccessible(true); + int value = f.getInt(o); + Assert.assertEquals(value, -1); + f.setAccessible(false); + ValueHandler.apply(o, p, null); + f.setAccessible(true); + value = f.getInt(o); + Assert.assertEquals(value, 8); + f.setAccessible(false); + } + + @Test + public void testApplyPublicStaticWithDefault() throws Exception { + Assert.assertEquals(StaticDefaultCase.s, null); + Properties p = new Properties(); + StaticDefaultCase o = new StaticDefaultCase(); + ValueHandler.apply(o, p, "prefix"); + Assert.assertEquals(StaticDefaultCase.s, "default"); + p.put("s", "new2"); + ValueHandler.apply(o, p, "prefix"); + Assert.assertEquals(StaticDefaultCase.s, "new2"); + p.put("prefix.s", "new"); + ValueHandler.apply(o, p, "prefix"); + Assert.assertEquals(StaticDefaultCase.s, "new"); + ValueHandler.apply(o, p, null); + Assert.assertEquals(StaticDefaultCase.s, "new2"); + } + + protected class InnerClass1 { + @Value (name = "innerClass") + String[] arr = null; + } + + public class InnerClass2 extends InnerClass1 { + @Value (name = "float") + float f = 0.0f; + + @SubValues (prefix = "inner") + InnerClass1 inner1 = new InnerClass1(); + + @SubValues (prefix = "") + InnerClass1 inner2 = new InnerClass1(); + } + + @Test + public void testApplySub() throws Exception { + InnerClass2 o = new InnerClass2(); + Assert.assertArrayEquals(o.arr, null); + Assert.assertArrayEquals(o.inner1.arr, null); + Assert.assertArrayEquals(o.inner2.arr, null); + Assert.assertEquals(o.f, 0.0f, Float.MIN_VALUE); + + Properties p = new Properties(); + p.put("float", "1.f"); + p.put("innerClass", "a b"); + p.put("inner.innerClass", "a b c"); + ValueHandler.apply(o, p, ""); + Assert.assertArrayEquals(o.arr, new String[]{"a", "b"}); + Assert.assertArrayEquals(o.inner1.arr, new String[]{"a", "b", "c"}); + Assert.assertArrayEquals(o.inner2.arr, new String[]{"a", "b"}); + Assert.assertEquals(o.f, 1.0f, Float.MIN_VALUE); + } +} + +class StaticDefaultCase { + @Value (name = "s") + @DefaultValue (value = "default") + public static String s; +} From a82be01120f3014cec548125b9da6caefbb62f67 Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Fri, 18 Dec 2015 20:23:26 +0300 Subject: [PATCH 002/212] 8071374: -XX:+PrintAssembly -XX:+PrintSignatureHandlers crash fastdebug VM with assert(limit == __null || limit <= nm->code_end()) in RelocIterator::initialize Reviewed-by: kvn, iklam, shade --- hotspot/src/share/tools/hsdis/hsdis.c | 19 ++++++++++--------- hotspot/src/share/vm/c1/c1_Runtime1.cpp | 1 + hotspot/src/share/vm/ci/ciEnv.cpp | 3 --- hotspot/src/share/vm/code/codeBlob.cpp | 5 +++++ hotspot/src/share/vm/code/codeBlob.hpp | 1 + hotspot/src/share/vm/code/nmethod.cpp | 8 +------- hotspot/src/share/vm/code/nmethod.hpp | 1 - .../src/share/vm/compiler/disassembler.cpp | 3 +++ .../vm/interpreter/interpreterRuntime.cpp | 1 + .../src/share/vm/jvmci/jvmciCompilerToVM.cpp | 4 +--- .../src/share/vm/runtime/sharedRuntime.cpp | 3 ++- hotspot/src/share/vm/runtime/vframe.hpp | 1 + hotspot/src/share/vm/utilities/debug.cpp | 13 +++++++------ 13 files changed, 33 insertions(+), 30 deletions(-) diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c index 3d038f1ecd9..8706163981c 100644 --- a/hotspot/src/share/tools/hsdis/hsdis.c +++ b/hotspot/src/share/tools/hsdis/hsdis.c @@ -125,15 +125,15 @@ decode_instructions(void* start_pv, void* end_pv, event_callback_t event_callback_arg, void* event_stream_arg, printf_callback_t printf_callback_arg, void* printf_stream_arg, const char* options) { - decode_instructions_virtual((uintptr_t)start_pv, - (uintptr_t)end_pv, - (unsigned char*)start_pv, - (uintptr_t)end_pv - (uintptr_t)start_pv, - event_callback_arg, - event_stream_arg, - printf_callback_arg, - printf_stream_arg, - options, false); + return decode_instructions_virtual((uintptr_t)start_pv, + (uintptr_t)end_pv, + (unsigned char*)start_pv, + (uintptr_t)end_pv - (uintptr_t)start_pv, + event_callback_arg, + event_stream_arg, + printf_callback_arg, + printf_stream_arg, + options, false); } static void* decode(struct hsdis_app_data* app_data, const char* options) { @@ -212,6 +212,7 @@ static const char* format_insn_close(const char* close, case dis_condjsr: type = "condjsr"; break; case dis_dref: type = "dref"; break; case dis_dref2: type = "dref2"; break; + case dis_noninsn: type = "noninsn"; break; } strcpy(buf, close); diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 668ae3e91dd..4d9a205604c 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -1030,6 +1030,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i address copy_buff = stub_location - *byte_skip - *byte_count; address being_initialized_entry = stub_location - *being_initialized_entry_offset; if (TracePatching) { + ttyLocker ttyl; tty->print_cr(" Patching %s at bci %d at address " INTPTR_FORMAT " (%s)", Bytecodes::name(code), bci, p2i(instr_pc), (stub_id == Runtime1::access_field_patching_id) ? "field" : "klass"); nmethod* caller_code = CodeCache::find_nmethod(caller_frame.pc()); diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp index 9c9d7b300c2..cea5712ab4f 100644 --- a/hotspot/src/share/vm/ci/ciEnv.cpp +++ b/hotspot/src/share/vm/ci/ciEnv.cpp @@ -1045,9 +1045,6 @@ void ciEnv::register_method(ciMethod* target, if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) { nm->print_nmethod(printnmethods); } - if (directives->PrintAssemblyOption) { - Disassembler::decode(nm); - } nm->set_has_unsafe_access(has_unsafe_access); nm->set_has_wide_vectors(has_wide_vectors); diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp index a0a50cec45d..d90326e9aa5 100644 --- a/hotspot/src/share/vm/code/codeBlob.cpp +++ b/hotspot/src/share/vm/code/codeBlob.cpp @@ -181,6 +181,11 @@ const ImmutableOopMap* CodeBlob::oop_map_for_return_address(address return_addre return oop_maps()->find_map_at_offset((intptr_t) return_address - (intptr_t) code_begin()); } +void CodeBlob::print_code() { + HandleMark hm; + ResourceMark m; + Disassembler::decode(this, tty); +} //---------------------------------------------------------------------------------------------------- // Implementation of BufferBlob diff --git a/hotspot/src/share/vm/code/codeBlob.hpp b/hotspot/src/share/vm/code/codeBlob.hpp index a4a4cab7c8b..4a45f6b96f4 100644 --- a/hotspot/src/share/vm/code/codeBlob.hpp +++ b/hotspot/src/share/vm/code/codeBlob.hpp @@ -196,6 +196,7 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC { void print() const { print_on(tty); } virtual void print_on(outputStream* st) const; virtual void print_value_on(outputStream* st) const; + void print_code(); // Deal with Disassembler, VTune, Forte, JvmtiExport, MemoryService. static void trace_new_stub(CodeBlob* blob, const char* name1, const char* name2 = ""); diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 4f59ffc30ba..45daee8f06c 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -2639,6 +2639,7 @@ address nmethod::continuation_for_implicit_exception(address pc) { ResourceMark rm(thread); CodeBlob* cb = CodeCache::find_blob(pc); assert(cb != NULL && cb == this, ""); + ttyLocker ttyl; tty->print_cr("implicit exception happened at " INTPTR_FORMAT, p2i(pc)); print(); method()->print_codes(); @@ -2960,13 +2961,6 @@ void nmethod::print() const { nul_chk_table_size()); } -void nmethod::print_code() { - HandleMark hm; - ResourceMark m; - Disassembler::decode(this); -} - - #ifndef PRODUCT void nmethod::print_scopes() { diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index f38ed2edb36..b736fab13ed 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -704,7 +704,6 @@ public: // printing support void print() const; - void print_code(); void print_relocations() PRODUCT_RETURN; void print_pcs() PRODUCT_RETURN; void print_scopes() PRODUCT_RETURN; diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp index 1ac15590cd0..4cc723f30a4 100644 --- a/hotspot/src/share/vm/compiler/disassembler.cpp +++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -497,6 +497,7 @@ address decode_env::decode_instructions(address start, address end) { void Disassembler::decode(CodeBlob* cb, outputStream* st) { + ttyLocker ttyl; if (!load_library()) return; if (cb->is_nmethod()) { decode((nmethod*)cb, st); @@ -510,12 +511,14 @@ void Disassembler::decode(CodeBlob* cb, outputStream* st) { } void Disassembler::decode(address start, address end, outputStream* st, CodeStrings c) { + ttyLocker ttyl; if (!load_library()) return; decode_env env(CodeCache::find_blob_unsafe(start), st, c); env.decode_instructions(start, end); } void Disassembler::decode(nmethod* nm, outputStream* st) { + ttyLocker ttyl; if (!load_library()) return; decode_env env(nm, st); env.output()->print_cr("----------------------------------------------------------------------"); diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 077732802f5..684b3ed31db 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -1252,6 +1252,7 @@ void SignatureHandlerLibrary::add(const methodHandle& method) { } else { // debugging suppport if (PrintSignatureHandlers && (handler != Interpreter::slow_signature_handler())) { + ttyLocker ttyl; tty->cr(); tty->print_cr("argument handler #%d for: %s %s (fingerprint = " UINT64_FORMAT ", %d bytes generated)", _handlers->length(), diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp index 2205ff479fd..2299b174d5f 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp @@ -897,10 +897,8 @@ C2V_VMENTRY(jobject, disassembleCodeBlob, (JNIEnv *jniEnv, jobject, jobject inst if (!nm->is_alive()) { return NULL; } - Disassembler::decode(nm, &st); - } else { - Disassembler::decode(cb, &st); } + Disassembler::decode(cb, &st); if (st.size() <= 0) { return NULL; } diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index f2497b54fbb..03b8b5cf048 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -726,6 +726,7 @@ address SharedRuntime::compute_compiled_exc_handler(nmethod* nm, address ret_pc, #endif if (t == NULL) { + ttyLocker ttyl; tty->print_cr("MISSING EXCEPTION HANDLER for pc " INTPTR_FORMAT " and handler bci %d", p2i(ret_pc), handler_bci); tty->print_cr(" Exception:"); exception->print(); @@ -2759,7 +2760,7 @@ void AdapterHandlerLibrary::create_native_wrapper(const methodHandle& method) { DirectiveSet* directive = DirectivesStack::getDefaultDirective(CompileBroker::compiler(CompLevel_simple)); if (directive->PrintAssemblyOption) { - Disassembler::decode(nm, tty); + nm->print_code(); } DirectivesStack::release(directive); } diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp index 654d6b823b1..dde2f246812 100644 --- a/hotspot/src/share/vm/runtime/vframe.hpp +++ b/hotspot/src/share/vm/runtime/vframe.hpp @@ -406,6 +406,7 @@ inline void vframeStreamCommon::fill_from_compiled_frame(int decode_offset) { // as it were a native compiled frame (no Java-level assumptions). #ifdef ASSERT if (WizardMode) { + ttyLocker ttyl; tty->print_cr("Error in fill_from_frame: pc_desc for " INTPTR_FORMAT " not found or invalid at %d", p2i(_frame.pc()), decode_offset); diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index 29ccf223721..fa9a27dacc4 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -480,12 +480,13 @@ extern "C" void nm(intptr_t p) { extern "C" void disnm(intptr_t p) { Command c("disnm"); CodeBlob* cb = CodeCache::find_blob((address) p); - nmethod* nm = cb->as_nmethod_or_null(); - if (nm) { - nm->print(); - Disassembler::decode(nm); - } else { - cb->print(); + if (cb != NULL) { + nmethod* nm = cb->as_nmethod_or_null(); + if (nm != NULL) { + nm->print(); + } else { + cb->print(); + } Disassembler::decode(cb); } } From 7adcd9a5038bf794322cc6c854eb2ea2e3ef53de Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Fri, 18 Dec 2015 20:23:27 +0300 Subject: [PATCH 003/212] 8140659: C1: invokedynamic call patching violates JVMS-6.5.invokedynamic Reviewed-by: roland --- hotspot/src/share/vm/c1/c1_GraphBuilder.cpp | 7 +------ hotspot/src/share/vm/c1/c1_Runtime1.cpp | 11 ++++++++--- hotspot/src/share/vm/c1/c1_globals.hpp | 3 --- hotspot/src/share/vm/classfile/systemDictionary.cpp | 1 + hotspot/src/share/vm/interpreter/linkResolver.cpp | 9 ++++++--- hotspot/src/share/vm/oops/cpCache.cpp | 2 ++ hotspot/src/share/vm/oops/method.cpp | 4 +++- hotspot/src/share/vm/prims/methodHandles.cpp | 2 ++ 8 files changed, 23 insertions(+), 16 deletions(-) diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 952ce683db7..b2766898d71 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1748,10 +1748,6 @@ void GraphBuilder::invoke(Bytecodes::Code code) { const Bytecodes::Code bc_raw = stream()->cur_bc_raw(); assert(declared_signature != NULL, "cannot be null"); - if (!C1PatchInvokeDynamic && Bytecodes::has_optional_appendix(bc_raw) && !will_link) { - BAILOUT("unlinked call site (C1PatchInvokeDynamic is off)"); - } - // we have to make sure the argument size (incl. the receiver) // is correct for compilation (the call would fail later during // linkage anyway) - was bug (gri 7/28/99) @@ -1803,8 +1799,7 @@ void GraphBuilder::invoke(Bytecodes::Code code) { // Push appendix argument (MethodType, CallSite, etc.), if one. bool patch_for_appendix = false; int patching_appendix_arg = 0; - if (C1PatchInvokeDynamic && - (Bytecodes::has_optional_appendix(bc_raw) && (!will_link || PatchALot))) { + if (Bytecodes::has_optional_appendix(bc_raw) && (!will_link || PatchALot)) { Value arg = append(new Constant(new ObjectConstant(compilation()->env()->unloaded_ciinstance()), copy_state_before())); apush(arg); patch_for_appendix = true; diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 4d9a205604c..f31e63ff57d 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -954,20 +954,25 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i constantPoolHandle pool(thread, caller_method->constants()); int index = bytecode.index(); LinkResolver::resolve_invoke(info, Handle(), pool, index, bc, CHECK); - appendix = info.resolved_appendix(); switch (bc) { case Bytecodes::_invokehandle: { int cache_index = ConstantPool::decode_cpcache_index(index, true); assert(cache_index >= 0 && cache_index < pool->cache()->length(), "unexpected cache index"); - pool->cache()->entry_at(cache_index)->set_method_handle(pool, info); + ConstantPoolCacheEntry* cpce = pool->cache()->entry_at(cache_index); + cpce->set_method_handle(pool, info); + appendix = info.resolved_appendix(); // just in case somebody already resolved the entry break; } case Bytecodes::_invokedynamic: { - pool->invokedynamic_cp_cache_entry_at(index)->set_dynamic_call(pool, info); + ConstantPoolCacheEntry* cpce = pool->invokedynamic_cp_cache_entry_at(index); + cpce->set_dynamic_call(pool, info); + appendix = cpce->appendix_if_resolved(pool); // just in case somebody already resolved the entry break; } default: fatal("unexpected bytecode for load_appendix_patching_id"); } + assert(appendix.not_null(), "%s @ %d (%s)", + caller_method->name_and_sig_as_C_string(), bci, Bytecodes::name(bc)); } else { ShouldNotReachHere(); } diff --git a/hotspot/src/share/vm/c1/c1_globals.hpp b/hotspot/src/share/vm/c1/c1_globals.hpp index 3cdcfc2ed38..ad6548e4928 100644 --- a/hotspot/src/share/vm/c1/c1_globals.hpp +++ b/hotspot/src/share/vm/c1/c1_globals.hpp @@ -341,9 +341,6 @@ develop(bool, PrintCFGToFile, false, \ "print control flow graph to a separate file during compilation") \ \ - diagnostic(bool, C1PatchInvokeDynamic, true, \ - "Patch invokedynamic appendix not known at compile time") \ - \ // Read default values for c1 globals C1_FLAGS(DECLARE_DEVELOPER_FLAG, \ diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index 420bf3f36b0..0fdfc81acbb 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -2386,6 +2386,7 @@ static methodHandle unpack_method_and_appendix(Handle mname, oop appendix = appendix_box->obj_at(0); if (TraceMethodHandles) { #ifndef PRODUCT + ttyLocker ttyl; tty->print("Linked method=" INTPTR_FORMAT ": ", p2i(m)); m->print(); if (appendix != NULL) { tty->print("appendix = "); appendix->print(); } diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index 48018a55e62..e4face34571 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -447,6 +447,7 @@ methodHandle LinkResolver::lookup_polymorphic_method( assert(result->intrinsic_id() != vmIntrinsics::_invokeGeneric, "wrong place to find this"); assert(basic_signature == result->signature(), "predict the result signature"); if (TraceMethodHandles) { + ttyLocker ttyl; tty->print("lookup_polymorphic_method => intrinsic "); result->print_on(tty); } @@ -479,6 +480,7 @@ methodHandle LinkResolver::lookup_polymorphic_method( &method_type, CHECK_NULL); if (TraceMethodHandles) { + ttyLocker ttyl; tty->print("lookup_polymorphic_method => (via Java) "); result->print_on(tty); tty->print(" lookup_polymorphic_method => appendix = "); @@ -1585,10 +1587,11 @@ void LinkResolver::resolve_invokedynamic(CallInfo& result, const constantPoolHan } if (TraceMethodHandles) { - ResourceMark rm(THREAD); - tty->print_cr("resolve_invokedynamic #%d %s %s", + ResourceMark rm(THREAD); + tty->print_cr("resolve_invokedynamic #%d %s %s in %s", ConstantPool::decode_invokedynamic_index(index), - method_name->as_C_string(), method_signature->as_C_string()); + method_name->as_C_string(), method_signature->as_C_string(), + current_klass->name()->as_C_string()); tty->print(" BSM info: "); bootstrap_specifier->print(); } diff --git a/hotspot/src/share/vm/oops/cpCache.cpp b/hotspot/src/share/vm/oops/cpCache.cpp index 6066a319e8f..2adcb1c21e9 100644 --- a/hotspot/src/share/vm/oops/cpCache.cpp +++ b/hotspot/src/share/vm/oops/cpCache.cpp @@ -306,6 +306,7 @@ void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle& adapter->size_of_parameters()); if (TraceInvokeDynamic) { + ttyLocker ttyl; tty->print_cr("set_method_handle bc=%d appendix=" PTR_FORMAT "%s method_type=" PTR_FORMAT "%s method=" PTR_FORMAT " ", invoke_code, p2i(appendix()), (has_appendix ? "" : " (unused)"), @@ -357,6 +358,7 @@ void ConstantPoolCacheEntry::set_method_handle_common(const constantPoolHandle& set_bytecode_1(invoke_code); NOT_PRODUCT(verify(tty)); if (TraceInvokeDynamic) { + ttyLocker ttyl; this->print(tty, 0); } } diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index 015843d9c87..cd279e40c5a 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -1200,8 +1200,10 @@ methodHandle Method::make_method_handle_intrinsic(vmIntrinsics::ID iid, m->set_vtable_index(Method::nonvirtual_vtable_index); m->link_method(m, CHECK_(empty)); - if (TraceMethodHandles && (Verbose || WizardMode)) + if (TraceMethodHandles && (Verbose || WizardMode)) { + ttyLocker ttyl; m->print_on(tty); + } return m; } diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp index 4f21e410c24..74724b6d80b 100644 --- a/hotspot/src/share/vm/prims/methodHandles.cpp +++ b/hotspot/src/share/vm/prims/methodHandles.cpp @@ -202,6 +202,7 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { assert(m_klass->verify_itable_index(vmindex), ""); flags |= IS_METHOD | (JVM_REF_invokeInterface << REFERENCE_KIND_SHIFT); if (TraceInvokeDynamic) { + ttyLocker ttyl; ResourceMark rm; tty->print_cr("memberName: invokeinterface method_holder::method: %s, itableindex: %d, access_flags:", Method::name_and_sig_as_C_string(m->method_holder(), m->name(), m->signature()), @@ -242,6 +243,7 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { m_klass = m_klass_non_interface; } if (TraceInvokeDynamic) { + ttyLocker ttyl; ResourceMark rm; tty->print_cr("memberName: invokevirtual method_holder::method: %s, receiver: %s, vtableindex: %d, access_flags:", Method::name_and_sig_as_C_string(m->method_holder(), m->name(), m->signature()), From 0e0175037007b6b5be5044722397a89782611bee Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Fri, 18 Dec 2015 20:23:28 +0300 Subject: [PATCH 004/212] 8133612: new clone logic added in 8042235 is missing from compiler intrinsics Reviewed-by: roland --- hotspot/src/share/vm/oops/klass.cpp | 14 ++++++++++++++ hotspot/src/share/vm/oops/klass.hpp | 5 +++-- hotspot/src/share/vm/opto/library_call.cpp | 10 +++++----- hotspot/src/share/vm/runtime/vmStructs.cpp | 2 +- hotspot/src/share/vm/utilities/accessFlags.hpp | 6 +++--- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp index a9d660b8e13..313130021d5 100644 --- a/hotspot/src/share/vm/oops/klass.cpp +++ b/hotspot/src/share/vm/oops/klass.cpp @@ -44,6 +44,20 @@ #include "gc/g1/g1SATBCardTableModRefBS.hpp" #endif // INCLUDE_ALL_GCS +bool Klass::is_cloneable() const { + return _access_flags.is_cloneable_fast() || + is_subtype_of(SystemDictionary::Cloneable_klass()); +} + +void Klass::set_is_cloneable() { + if (name() != vmSymbols::java_lang_invoke_MemberName()) { + _access_flags.set_is_cloneable_fast(); + } else { + assert(is_final(), "no subclasses allowed"); + // MemberName cloning should not be intrinsified and always happen in JVM_Clone. + } +} + void Klass::set_name(Symbol* n) { _name = n; if (_name != NULL) _name->increment_refcount(); diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp index 1f05ba24aaa..fbb40c16188 100644 --- a/hotspot/src/share/vm/oops/klass.hpp +++ b/hotspot/src/share/vm/oops/klass.hpp @@ -524,13 +524,14 @@ protected: bool has_final_method() const { return _access_flags.has_final_method(); } void set_has_finalizer() { _access_flags.set_has_finalizer(); } void set_has_final_method() { _access_flags.set_has_final_method(); } - bool is_cloneable() const { return _access_flags.is_cloneable(); } - void set_is_cloneable() { _access_flags.set_is_cloneable(); } bool has_vanilla_constructor() const { return _access_flags.has_vanilla_constructor(); } void set_has_vanilla_constructor() { _access_flags.set_has_vanilla_constructor(); } bool has_miranda_methods () const { return access_flags().has_miranda_methods(); } void set_has_miranda_methods() { _access_flags.set_has_miranda_methods(); } + bool is_cloneable() const; + void set_is_cloneable(); + // Biased locking support // Note: the prototype header is always set up to be at least the // prototype markOop. If biased locking is enabled it may further be diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 408b4d09f3b..d4d2d563a88 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -3151,7 +3151,7 @@ Node* LibraryCallKit::load_klass_from_mirror_common(Node* mirror, } //--------------------(inline_native_Class_query helpers)--------------------- -// Use this for JVM_ACC_INTERFACE, JVM_ACC_IS_CLONEABLE, JVM_ACC_HAS_FINALIZER. +// Use this for JVM_ACC_INTERFACE, JVM_ACC_IS_CLONEABLE_FAST, JVM_ACC_HAS_FINALIZER. // Fall through if (mods & mask) == bits, take the guard otherwise. Node* LibraryCallKit::generate_access_flags_guard(Node* kls, int modifier_mask, int modifier_bits, RegionNode* region) { // Branch around if the given klass has the given modifier bit set. @@ -4489,14 +4489,14 @@ bool LibraryCallKit::inline_native_clone(bool is_virtual) { generate_virtual_guard(obj_klass, slow_region); } - // The object must be cloneable and must not have a finalizer. + // The object must be easily cloneable and must not have a finalizer. // Both of these conditions may be checked in a single test. - // We could optimize the cloneable test further, but we don't care. + // We could optimize the test further, but we don't care. generate_access_flags_guard(obj_klass, // Test both conditions: - JVM_ACC_IS_CLONEABLE | JVM_ACC_HAS_FINALIZER, + JVM_ACC_IS_CLONEABLE_FAST | JVM_ACC_HAS_FINALIZER, // Must be cloneable but not finalizer: - JVM_ACC_IS_CLONEABLE, + JVM_ACC_IS_CLONEABLE_FAST, slow_region); } diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 89beb13b39d..06243bd52b3 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -2397,7 +2397,7 @@ typedef CompactHashtable SymbolCompactHashTable; declare_constant(JVM_ACC_HAS_MIRANDA_METHODS) \ declare_constant(JVM_ACC_HAS_VANILLA_CONSTRUCTOR) \ declare_constant(JVM_ACC_HAS_FINALIZER) \ - declare_constant(JVM_ACC_IS_CLONEABLE) \ + declare_constant(JVM_ACC_IS_CLONEABLE_FAST) \ declare_constant(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE) \ declare_constant(JVM_ACC_PROMOTED_FLAGS) \ declare_constant(JVM_ACC_FIELD_ACCESS_WATCHED) \ diff --git a/hotspot/src/share/vm/utilities/accessFlags.hpp b/hotspot/src/share/vm/utilities/accessFlags.hpp index 2cab120a880..8e9219fe8bc 100644 --- a/hotspot/src/share/vm/utilities/accessFlags.hpp +++ b/hotspot/src/share/vm/utilities/accessFlags.hpp @@ -61,7 +61,7 @@ enum { JVM_ACC_HAS_MIRANDA_METHODS = 0x10000000, // True if this class has miranda methods in it's vtable JVM_ACC_HAS_VANILLA_CONSTRUCTOR = 0x20000000, // True if klass has a vanilla default constructor JVM_ACC_HAS_FINALIZER = 0x40000000, // True if klass has a non-empty finalize() method - JVM_ACC_IS_CLONEABLE = (int)0x80000000,// True if klass supports the Clonable interface + JVM_ACC_IS_CLONEABLE_FAST = (int)0x80000000,// True if klass implements the Cloneable interface and can be optimized in generated code JVM_ACC_HAS_FINAL_METHOD = 0x01000000, // True if klass has final method // Klass* and Method* flags @@ -143,7 +143,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC { bool has_vanilla_constructor () const { return (_flags & JVM_ACC_HAS_VANILLA_CONSTRUCTOR) != 0; } bool has_finalizer () const { return (_flags & JVM_ACC_HAS_FINALIZER ) != 0; } bool has_final_method () const { return (_flags & JVM_ACC_HAS_FINAL_METHOD ) != 0; } - bool is_cloneable () const { return (_flags & JVM_ACC_IS_CLONEABLE ) != 0; } + bool is_cloneable_fast () const { return (_flags & JVM_ACC_IS_CLONEABLE_FAST ) != 0; } // Klass* and Method* flags bool has_localvariable_table () const { return (_flags & JVM_ACC_HAS_LOCAL_VARIABLE_TABLE) != 0; } void set_has_localvariable_table() { atomic_set_bits(JVM_ACC_HAS_LOCAL_VARIABLE_TABLE); } @@ -210,7 +210,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC { void set_has_vanilla_constructor() { atomic_set_bits(JVM_ACC_HAS_VANILLA_CONSTRUCTOR); } void set_has_finalizer() { atomic_set_bits(JVM_ACC_HAS_FINALIZER); } void set_has_final_method() { atomic_set_bits(JVM_ACC_HAS_FINAL_METHOD); } - void set_is_cloneable() { atomic_set_bits(JVM_ACC_IS_CLONEABLE); } + void set_is_cloneable_fast() { atomic_set_bits(JVM_ACC_IS_CLONEABLE_FAST); } void set_has_miranda_methods() { atomic_set_bits(JVM_ACC_HAS_MIRANDA_METHODS); } public: From 6961dea52a6aae94d1fb4573de64525f4934352e Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Fri, 11 Dec 2015 16:57:08 +0100 Subject: [PATCH 005/212] 8139771: Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash Lost dependency when CastPP at Phis are eliminate Reviewed-by: kvn --- hotspot/src/share/vm/opto/block.hpp | 1 + hotspot/src/share/vm/opto/castnode.cpp | 107 +++++++++++++----- hotspot/src/share/vm/opto/castnode.hpp | 46 ++++---- hotspot/src/share/vm/opto/cfgnode.cpp | 73 +++++++----- hotspot/src/share/vm/opto/cfgnode.hpp | 9 +- hotspot/src/share/vm/opto/compile.cpp | 22 ++-- hotspot/src/share/vm/opto/gcm.cpp | 39 +++++-- hotspot/src/share/vm/opto/loopopts.cpp | 9 ++ hotspot/src/share/vm/opto/node.cpp | 4 +- hotspot/src/share/vm/opto/phaseX.cpp | 18 ++- hotspot/src/share/vm/opto/phaseX.hpp | 10 ++ .../TestEliminatedCastPPAtPhi.java | 105 +++++++++++++++++ 12 files changed, 343 insertions(+), 100 deletions(-) create mode 100644 hotspot/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java diff --git a/hotspot/src/share/vm/opto/block.hpp b/hotspot/src/share/vm/opto/block.hpp index d84529deb88..d7aa5bb783c 100644 --- a/hotspot/src/share/vm/opto/block.hpp +++ b/hotspot/src/share/vm/opto/block.hpp @@ -499,6 +499,7 @@ class PhaseCFG : public Phase { void convert_NeverBranch_to_Goto(Block *b); CFGLoop* create_loop_tree(); + bool is_dominator(Node* dom_node, Node* node); #ifndef PRODUCT bool _trace_opto_pipelining; // tracing flag diff --git a/hotspot/src/share/vm/opto/castnode.cpp b/hotspot/src/share/vm/opto/castnode.cpp index 44ea7c39814..fb2c99f70e4 100644 --- a/hotspot/src/share/vm/opto/castnode.cpp +++ b/hotspot/src/share/vm/opto/castnode.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "opto/addnode.hpp" +#include "opto/callnode.hpp" #include "opto/castnode.hpp" #include "opto/connode.hpp" #include "opto/matcher.hpp" @@ -33,14 +34,22 @@ //============================================================================= // If input is already higher or equal to cast type, then this is an identity. -Node *ConstraintCastNode::Identity( PhaseTransform *phase ) { +Node *ConstraintCastNode::Identity(PhaseTransform *phase) { + Node* dom = dominating_cast(phase); + if (dom != NULL) { + assert(_carry_dependency, "only for casts that carry a dependency"); + return dom; + } + if (_carry_dependency) { + return this; + } return phase->type(in(1))->higher_equal_speculative(_type) ? in(1) : this; } //------------------------------Value------------------------------------------ // Take 'join' of input and cast-up type -const Type *ConstraintCastNode::Value( PhaseTransform *phase ) const { - if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP; +const Type *ConstraintCastNode::Value(PhaseTransform *phase) const { + if (in(0) && phase->type(in(0)) == Type::TOP) return Type::TOP; const Type* ft = phase->type(in(1))->filter_speculative(_type); #ifdef ASSERT @@ -69,25 +78,77 @@ const Type *ConstraintCastNode::Value( PhaseTransform *phase ) const { //------------------------------Ideal------------------------------------------ // Return a node which is more "ideal" than the current node. Strip out // control copies -Node *ConstraintCastNode::Ideal(PhaseGVN *phase, bool can_reshape){ +Node *ConstraintCastNode::Ideal(PhaseGVN *phase, bool can_reshape) { return (in(0) && remove_dead_region(phase, can_reshape)) ? this : NULL; } -uint CastIINode::size_of() const { +uint ConstraintCastNode::cmp(const Node &n) const { + return TypeNode::cmp(n) && ((ConstraintCastNode&)n)._carry_dependency == _carry_dependency; +} + +uint ConstraintCastNode::size_of() const { return sizeof(*this); } -uint CastIINode::cmp(const Node &n) const { - return TypeNode::cmp(n) && ((CastIINode&)n)._carry_dependency == _carry_dependency; +Node* ConstraintCastNode::make_cast(int opcode, Node* c, Node *n, const Type *t, bool carry_dependency) { + switch(opcode) { + case Op_CastII: { + Node* cast = new CastIINode(n, t, carry_dependency); + cast->set_req(0, c); + return cast; + } + case Op_CastPP: { + Node* cast = new CastPPNode(n, t, carry_dependency); + cast->set_req(0, c); + return cast; + } + case Op_CheckCastPP: return new CheckCastPPNode(c, n, t, carry_dependency); + default: + fatal("Bad opcode %d", opcode); + } + return NULL; } -Node *CastIINode::Identity(PhaseTransform *phase) { - if (_carry_dependency) { - return this; +TypeNode* ConstraintCastNode::dominating_cast(PhaseTransform *phase) const { + if (!carry_dependency()) { + return NULL; } - return ConstraintCastNode::Identity(phase); + Node* val = in(1); + Node* ctl = in(0); + int opc = Opcode(); + if (ctl == NULL) { + return NULL; + } + for (DUIterator_Fast imax, i = val->fast_outs(imax); i < imax; i++) { + Node* u = val->fast_out(i); + if (u != this && + u->Opcode() == opc && + u->in(0) != NULL && + u->bottom_type()->higher_equal(type())) { + if (phase->is_dominator(u->in(0), ctl)) { + return u->as_Type(); + } + if (is_CheckCastPP() && u->in(1)->is_Proj() && u->in(1)->in(0)->is_Allocate() && + u->in(0)->is_Proj() && u->in(0)->in(0)->is_Initialize() && + u->in(1)->in(0)->as_Allocate()->initialization() == u->in(0)->in(0)) { + // CheckCastPP following an allocation always dominates all + // use of the allocation result + return u->as_Type(); + } + } + } + return NULL; } +#ifndef PRODUCT +void ConstraintCastNode::dump_spec(outputStream *st) const { + TypeNode::dump_spec(st); + if (_carry_dependency) { + st->print(" carry dependency"); + } +} +#endif + const Type *CastIINode::Value(PhaseTransform *phase) const { const Type *res = ConstraintCastNode::Value(phase); @@ -154,19 +215,18 @@ const Type *CastIINode::Value(PhaseTransform *phase) const { return res; } -#ifndef PRODUCT -void CastIINode::dump_spec(outputStream *st) const { - TypeNode::dump_spec(st); - if (_carry_dependency) { - st->print(" carry dependency"); - } -} -#endif - //============================================================================= //------------------------------Identity--------------------------------------- // If input is already higher or equal to cast type, then this is an identity. Node *CheckCastPPNode::Identity( PhaseTransform *phase ) { + Node* dom = dominating_cast(phase); + if (dom != NULL) { + assert(_carry_dependency, "only for casts that carry a dependency"); + return dom; + } + if (_carry_dependency) { + return this; + } // Toned down to rescue meeting at a Phi 3 different oops all implementing // the same interface. CompileTheWorld starting at 502, kd12rc1.zip. return (phase->type(in(1)) == phase->type(this)) ? in(1) : this; @@ -255,13 +315,6 @@ const Type *CheckCastPPNode::Value( PhaseTransform *phase ) const { // return join; } -//------------------------------Ideal------------------------------------------ -// Return a node which is more "ideal" than the current node. Strip out -// control copies -Node *CheckCastPPNode::Ideal(PhaseGVN *phase, bool can_reshape){ - return (in(0) && remove_dead_region(phase, can_reshape)) ? this : NULL; -} - //============================================================================= //------------------------------Value------------------------------------------ const Type *CastX2PNode::Value( PhaseTransform *phase ) const { diff --git a/hotspot/src/share/vm/opto/castnode.hpp b/hotspot/src/share/vm/opto/castnode.hpp index 535b0e6610b..1d317d21047 100644 --- a/hotspot/src/share/vm/opto/castnode.hpp +++ b/hotspot/src/share/vm/opto/castnode.hpp @@ -32,8 +32,15 @@ //------------------------------ConstraintCastNode----------------------------- // cast to a different range class ConstraintCastNode: public TypeNode { + protected: + // Can this node be removed post CCP or does it carry a required dependency? + const bool _carry_dependency; + virtual uint cmp( const Node &n ) const; + virtual uint size_of() const; + public: - ConstraintCastNode (Node *n, const Type *t ): TypeNode(t,2) { + ConstraintCastNode(Node *n, const Type *t, bool carry_dependency) + : TypeNode(t,2), _carry_dependency(carry_dependency) { init_class_id(Class_ConstraintCast); init_req(1, n); } @@ -42,53 +49,50 @@ class ConstraintCastNode: public TypeNode { virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual int Opcode() const; virtual uint ideal_reg() const = 0; + virtual bool depends_only_on_test() const { return !_carry_dependency; } + bool carry_dependency() const { return _carry_dependency; } + TypeNode* dominating_cast(PhaseTransform *phase) const; + static Node* make_cast(int opcode, Node* c, Node *n, const Type *t, bool carry_dependency); + +#ifndef PRODUCT + virtual void dump_spec(outputStream *st) const; +#endif }; //------------------------------CastIINode------------------------------------- // cast integer to integer (different range) class CastIINode: public ConstraintCastNode { - private: - // Can this node be removed post CCP or does it carry a required dependency? - const bool _carry_dependency; - - protected: - virtual uint cmp( const Node &n ) const; - virtual uint size_of() const; - public: CastIINode(Node *n, const Type *t, bool carry_dependency = false) - : ConstraintCastNode(n,t), _carry_dependency(carry_dependency) {} + : ConstraintCastNode(n, t, carry_dependency) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } - virtual Node *Identity( PhaseTransform *phase ); virtual const Type *Value( PhaseTransform *phase ) const; -#ifndef PRODUCT - virtual void dump_spec(outputStream *st) const; -#endif }; //------------------------------CastPPNode------------------------------------- // cast pointer to pointer (different type) class CastPPNode: public ConstraintCastNode { public: - CastPPNode (Node *n, const Type *t ): ConstraintCastNode(n, t) {} + CastPPNode (Node *n, const Type *t, bool carry_dependency = false) + : ConstraintCastNode(n, t, carry_dependency) { + } virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegP; } }; //------------------------------CheckCastPPNode-------------------------------- // for _checkcast, cast pointer to pointer (different type), without JOIN, -class CheckCastPPNode: public TypeNode { +class CheckCastPPNode: public ConstraintCastNode { public: - CheckCastPPNode( Node *c, Node *n, const Type *t ) : TypeNode(t,2) { + CheckCastPPNode(Node *c, Node *n, const Type *t, bool carry_dependency = false) + : ConstraintCastNode(n, t, carry_dependency) { init_class_id(Class_CheckCastPP); init_req(0, c); - init_req(1, n); } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); + virtual Node *Identity(PhaseTransform *phase); + virtual const Type *Value(PhaseTransform *phase) const; virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegP; } }; diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp index 454a29636a6..f1360ad1ad3 100644 --- a/hotspot/src/share/vm/opto/cfgnode.cpp +++ b/hotspot/src/share/vm/opto/cfgnode.cpp @@ -27,6 +27,7 @@ #include "memory/allocation.inline.hpp" #include "oops/objArrayKlass.hpp" #include "opto/addnode.hpp" +#include "opto/castnode.hpp" #include "opto/cfgnode.hpp" #include "opto/connode.hpp" #include "opto/convertnode.hpp" @@ -1148,7 +1149,7 @@ Node *PhiNode::Identity( PhaseTransform *phase ) { // It would check for a tributary phi on the backedge that the main phi // trivially, perhaps with a single cast. The unique_input method // does all this and more, by reducing such tributaries to 'this'.) - Node* uin = unique_input(phase); + Node* uin = unique_input(phase, false); if (uin != NULL) { return uin; } @@ -1165,8 +1166,9 @@ Node *PhiNode::Identity( PhaseTransform *phase ) { //-----------------------------unique_input------------------------------------ // Find the unique value, discounting top, self-loops, and casts. // Return top if there are no inputs, and self if there are multiple. -Node* PhiNode::unique_input(PhaseTransform* phase) { - // 1) One unique direct input, or +Node* PhiNode::unique_input(PhaseTransform* phase, bool uncast) { + // 1) One unique direct input, + // or if uncast is true: // 2) some of the inputs have an intervening ConstraintCast and // the type of input is the same or sharper (more specific) // than the phi's type. @@ -1180,8 +1182,7 @@ Node* PhiNode::unique_input(PhaseTransform* phase) { Node* r = in(0); // RegionNode if (r == NULL) return in(1); // Already degraded to a Copy - Node* uncasted_input = NULL; // The unique uncasted input (ConstraintCasts removed) - Node* direct_input = NULL; // The unique direct input + Node* input = NULL; // The unique direct input (maybe uncasted = ConstraintCasts removed) for (uint i = 1, cnt = req(); i < cnt; ++i) { Node* rc = r->in(i); @@ -1190,34 +1191,23 @@ Node* PhiNode::unique_input(PhaseTransform* phase) { Node* n = in(i); if (n == NULL) continue; - Node* un = n->uncast(); + Node* un = uncast ? n->uncast() : n; if (un == NULL || un == this || phase->type(un) == Type::TOP) { continue; // ignore if top, or in(i) and "this" are in a data cycle } - // Check for a unique uncasted input - if (uncasted_input == NULL) { - uncasted_input = un; - } else if (uncasted_input != un) { - uncasted_input = NodeSentinel; // no unique uncasted input - } - // Check for a unique direct input - if (direct_input == NULL) { - direct_input = n; - } else if (direct_input != n) { - direct_input = NodeSentinel; // no unique direct input + // Check for a unique input (maybe uncasted) + if (input == NULL) { + input = un; + } else if (input != un) { + input = NodeSentinel; // no unique input } } - if (direct_input == NULL) { + if (input == NULL) { return phase->C->top(); // no inputs } - assert(uncasted_input != NULL,""); - if (direct_input != NodeSentinel) { - return direct_input; // one unique direct input - } - if (uncasted_input != NodeSentinel && - phase->type(uncasted_input)->higher_equal(type())) { - return uncasted_input; // one unique uncasted input + if (input != NodeSentinel) { + return input; // one unique direct input } // Nothing. @@ -1650,7 +1640,12 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { return top; } - Node* uin = unique_input(phase); + bool uncasted = false; + Node* uin = unique_input(phase, false); + if (uin == NULL) { + uncasted = true; + uin = unique_input(phase, true); + } if (uin == top) { // Simplest case: no alive inputs. if (can_reshape) // IGVN transformation return top; @@ -1683,6 +1678,31 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { } } + if (uncasted) { + const Type* phi_type = bottom_type(); + assert(phi_type->isa_int() || phi_type->isa_ptr(), "bad phi type"); + int opcode; + if (phi_type->isa_int()) { + opcode = Op_CastII; + } else { + const Type* uin_type = phase->type(uin); + if (phi_type->join(TypePtr::NOTNULL) == uin_type->join(TypePtr::NOTNULL)) { + opcode = Op_CastPP; + } else { + opcode = Op_CheckCastPP; + } + } + // Add a cast to carry the control dependency of the Phi that is + // going away + Node* cast = ConstraintCastNode::make_cast(opcode, r, uin, phi_type, true); + cast = phase->transform(cast); + // set all inputs to the new cast so the Phi is removed by Identity + for (uint i = 1; i < req(); i++) { + set_req(i, cast); + } + uin = cast; + } + // One unique input. debug_only(Node* ident = Identity(phase)); // The unique input must eventually be detected by the Identity call. @@ -1699,7 +1719,6 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) { return NULL; } - Node* opt = NULL; int true_path = is_diamond_phi(); if( true_path != 0 ) { diff --git a/hotspot/src/share/vm/opto/cfgnode.hpp b/hotspot/src/share/vm/opto/cfgnode.hpp index a87a70a41e6..b248c70846b 100644 --- a/hotspot/src/share/vm/opto/cfgnode.hpp +++ b/hotspot/src/share/vm/opto/cfgnode.hpp @@ -175,7 +175,14 @@ public: // Determine a unique non-trivial input, if any. // Ignore casts if it helps. Return NULL on failure. - Node* unique_input(PhaseTransform *phase); + Node* unique_input(PhaseTransform *phase, bool uncast); + Node* unique_input(PhaseTransform *phase) { + Node* uin = unique_input(phase, false); + if (uin == NULL) { + uin = unique_input(phase, true); + } + return uin; + } // Check for a simple dead loop. enum LoopSafety { Safe = 0, Unsafe, UnsafeLoop }; diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index 41483faf907..b55fa571e58 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -2296,17 +2296,17 @@ void Compile::Optimize() { DEBUG_ONLY( _modified_nodes = NULL; ) } // (End scope of igvn; run destructor if necessary for asserts.) - process_print_inlining(); - // A method with only infinite loops has no edges entering loops from root - { - TracePhase tp("graphReshape", &timers[_t_graphReshaping]); - if (final_graph_reshaping()) { - assert(failing(), "must bail out w/ explicit message"); - return; - } - } + process_print_inlining(); + // A method with only infinite loops has no edges entering loops from root + { + TracePhase tp("graphReshape", &timers[_t_graphReshaping]); + if (final_graph_reshaping()) { + assert(failing(), "must bail out w/ explicit message"); + return; + } + } - print_method(PHASE_OPTIMIZE_FINISHED, 2); + print_method(PHASE_OPTIMIZE_FINISHED, 2); } @@ -2874,7 +2874,7 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) { Node* use = m->fast_out(i); if (use->is_Mem() || use->is_EncodeNarrowPtr()) { use->ensure_control_or_add_prec(n->in(0)); - } else if (use->in(0) == NULL) { + } else { switch(use->Opcode()) { case Op_AddP: case Op_DecodeN: diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp index 833be199daa..48376b2f57a 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -101,7 +101,32 @@ void PhaseCFG::replace_block_proj_ctrl( Node *n ) { } } -static bool is_dominator(Block* d, Block* n) { +bool PhaseCFG::is_dominator(Node* dom_node, Node* node) { + if (dom_node == node) { + return true; + } + Block* d = get_block_for_node(dom_node); + Block* n = get_block_for_node(node); + if (d == n) { + if (dom_node->is_block_start()) { + return true; + } + if (node->is_block_start()) { + return false; + } + if (dom_node->is_block_proj()) { + return false; + } + if (node->is_block_proj()) { + return true; + } +#ifdef ASSERT + node->dump(); + dom_node->dump(); +#endif + fatal("unhandled"); + return false; + } return d->dom_lca(n) == d; } @@ -145,19 +170,15 @@ void PhaseCFG::schedule_pinned_nodes(VectorSet &visited) { if (n == NULL) { n = m; } else { - Block* bn = get_block_for_node(n); - Block* bm = get_block_for_node(m); - assert(is_dominator(bn, bm) || is_dominator(bm, bn), "one must dominate the other"); - n = is_dominator(bn, bm) ? m : n; + assert(is_dominator(n, m) || is_dominator(m, n), "one must dominate the other"); + n = is_dominator(n, m) ? m : n; } } } if (n != NULL) { assert(node->in(0), "control should have been set"); - Block* bn = get_block_for_node(n); - Block* bnode = get_block_for_node(node->in(0)); - assert(is_dominator(bn, bnode) || is_dominator(bnode, bn), "one must dominate the other"); - if (!is_dominator(bn, bnode)) { + assert(is_dominator(n, node->in(0)) || is_dominator(node->in(0), n), "one must dominate the other"); + if (!is_dominator(n, node->in(0))) { node->set_req(0, n); } } diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp index 9be560add6a..7a6e94e72e7 100644 --- a/hotspot/src/share/vm/opto/loopopts.cpp +++ b/hotspot/src/share/vm/opto/loopopts.cpp @@ -26,6 +26,7 @@ #include "memory/allocation.inline.hpp" #include "opto/addnode.hpp" #include "opto/connode.hpp" +#include "opto/castnode.hpp" #include "opto/divnode.hpp" #include "opto/loopnode.hpp" #include "opto/matcher.hpp" @@ -900,6 +901,14 @@ Node *PhaseIdealLoop::split_if_with_blocks_pre( Node *n ) { Node *m = remix_address_expressions( n ); if( m ) return m; + if (n->is_ConstraintCast()) { + Node* dom_cast = n->as_ConstraintCast()->dominating_cast(this); + if (dom_cast != NULL) { + _igvn.replace_node(n, dom_cast); + return dom_cast; + } + } + // Determine if the Node has inputs from some local Phi. // Returns the block to clone thru. Node *n_blk = has_local_phi_input( n ); diff --git a/hotspot/src/share/vm/opto/node.cpp b/hotspot/src/share/vm/opto/node.cpp index 433cfaf0946..b9ccd2a142f 100644 --- a/hotspot/src/share/vm/opto/node.cpp +++ b/hotspot/src/share/vm/opto/node.cpp @@ -911,7 +911,7 @@ int Node::disconnect_inputs(Node *n, Compile* C) { Node* Node::uncast() const { // Should be inline: //return is_ConstraintCast() ? uncast_helper(this) : (Node*) this; - if (is_ConstraintCast() || is_CheckCastPP()) + if (is_ConstraintCast()) return uncast_helper(this); else return (Node*) this; @@ -965,8 +965,6 @@ Node* Node::uncast_helper(const Node* p) { break; } else if (p->is_ConstraintCast()) { p = p->in(1); - } else if (p->is_CheckCastPP()) { - p = p->in(1); } else { break; } diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp index 0274f0e7c98..241cb0307c7 100644 --- a/hotspot/src/share/vm/opto/phaseX.cpp +++ b/hotspot/src/share/vm/opto/phaseX.cpp @@ -835,6 +835,22 @@ Node *PhaseGVN::transform_no_reclaim( Node *n ) { return k; } +bool PhaseGVN::is_dominator_helper(Node *d, Node *n, bool linear_only) { + if (d->is_top() || n->is_top()) { + return false; + } + assert(d->is_CFG() && n->is_CFG(), "must have CFG nodes"); + int i = 0; + while (d != n) { + n = IfNode::up_one_dom(n, linear_only); + i++; + if (n == NULL || i >= 10) { + return false; + } + } + return true; +} + #ifdef ASSERT //------------------------------dead_loop_check-------------------------------- // Check for a simple dead loop when a data node references itself directly @@ -1525,7 +1541,7 @@ void PhaseIterGVN::add_users_to_worklist( Node *n ) { } // If changed Cast input, check Phi users for simple cycles - if( use->is_ConstraintCast() || use->is_CheckCastPP() ) { + if (use->is_ConstraintCast()) { for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { Node* u = use->fast_out(i2); if (u->is_Phi()) diff --git a/hotspot/src/share/vm/opto/phaseX.hpp b/hotspot/src/share/vm/opto/phaseX.hpp index 990383e76c6..837118d177a 100644 --- a/hotspot/src/share/vm/opto/phaseX.hpp +++ b/hotspot/src/share/vm/opto/phaseX.hpp @@ -330,6 +330,9 @@ public: // Delayed node rehash if this is an IGVN phase virtual void igvn_rehash_node_delayed(Node* n) {} + // true if CFG node d dominates CFG node n + virtual bool is_dominator(Node *d, Node *n) { fatal("unimplemented for this pass"); return false; }; + #ifndef PRODUCT void dump_old2new_map() const; void dump_new( uint new_lidx ) const; @@ -397,6 +400,9 @@ public: //------------------------------PhaseGVN--------------------------------------- // Phase for performing local, pessimistic GVN-style optimizations. class PhaseGVN : public PhaseValues { +protected: + bool is_dominator_helper(Node *d, Node *n, bool linear_only); + public: PhaseGVN( Arena *arena, uint est_max_size ) : PhaseValues( arena, est_max_size ) {} PhaseGVN( PhaseGVN *gvn ) : PhaseValues( gvn ) {} @@ -415,6 +421,8 @@ public: _types = gvn->_types; } + bool is_dominator(Node *d, Node *n) { return is_dominator_helper(d, n, true); } + // Check for a simple dead loop when a data node references itself. DEBUG_ONLY(void dead_loop_check(Node *n);) }; @@ -545,6 +553,8 @@ public: _table.check_no_speculative_types(); } + bool is_dominator(Node *d, Node *n) { return is_dominator_helper(d, n, false); } + #ifndef PRODUCT protected: // Sub-quadratic implementation of VerifyIterativeGVN. diff --git a/hotspot/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java b/hotspot/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java new file mode 100644 index 00000000000..9c3daafbb9b --- /dev/null +++ b/hotspot/test/compiler/controldependency/TestEliminatedCastPPAtPhi.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 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. + * + */ + +/** + * @test + * @bug 8139771 + * @summary Eliminating CastPP nodes at Phis when they all come from a unique input may cause crash + * @requires vm.gc=="Serial" | vm.gc=="Parallel" + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+IgnoreUnrecognizedVMOptions -XX:+StressGCM TestEliminatedCastPPAtPhi + * + */ + +public class TestEliminatedCastPPAtPhi { + + static TestEliminatedCastPPAtPhi saved; + static TestEliminatedCastPPAtPhi saved_not_null; + + int f; + + static int test(TestEliminatedCastPPAtPhi obj, int[] array, boolean flag) { + int ret = array[0] + array[20]; + saved = obj; + if (obj == null) { + return ret; + } + saved_not_null = obj; + + // empty loop to be optimized out. Delays range check smearing + // for the array access below until the if diamond is + // optimized out + int i = 0; + for (; i < 10; i++); + + ret += array[i]; + + TestEliminatedCastPPAtPhi res; + if (flag) { + // load is optimized out and res is obj here + res = saved; + } else { + // load is optimized out and res is non null CastPP of res here + res = saved_not_null; + } + // null check + CastPP here for res field load below + + // 1) null check is pushed in the branches of the if above by + // split through phi because res is non null in the second + // branch and the null check can be optimized out in that + // branch. The Castpp stays here. + + // 2) null check in the first branch is also optimized out + // because a dominating null check is found (the explicit null + // check at the beggining of the test) + + // 3) the Phi for the if above merges a CastPP'ed value and + // the same value so it's optimized out and replaced by the + // uncasted value: obj + + // 4) the if above has 2 empty branches so it's optimized + // out. The control of the CastPP that is still here is now + // the success branch of the range check for the array access + // above + + // 5) the loop above is optimized out, i = 10, the range check + // for the array access above is optimized out and all its + // uses are replaced by the range check for the array accesses + // at the beginning of the method. The castPP here is one of + // the uses and so its control is now the range check at the + // beginning of the method: the control of the CastPP bypasses + // the explicit null check + + return ret + res.f; + } + + static public void main(String[] args) { + int[] array = new int[100]; + TestEliminatedCastPPAtPhi obj = new TestEliminatedCastPPAtPhi(); + for (int i = 0; i < 20000; i++) { + test(obj, array, (i%2) == 0); + } + test(null, array, true); + } + +} From 67e52adf51c8334abe83acf1e21da5b979abd0ce Mon Sep 17 00:00:00 2001 From: Alexander Smundak Date: Fri, 11 Dec 2015 10:45:46 -0800 Subject: [PATCH 006/212] 8073139: PPC64: User-visible arch directory and os.arch value on ppc64le cause issues with Java tooling Set VAR_CPU value to ppc64le on the little-endian PowerPC64. Co-authored-by: Andrew Hughes Reviewed-by: dholmes, ihse --- common/autoconf/generated-configure.sh | 24 ++++++++++++------------ common/autoconf/platform.m4 | 2 +- common/bin/unshuffle_list.txt | 1 + 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 9318de77b41..139e0e0631d 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4052,6 +4052,15 @@ pkgadd_help() { # +################################################################################ +# +# Static build support. When enabled will generate static +# libraries instead of shared libraries for all JDK libs. +# + + + + # # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4091,15 +4100,6 @@ pkgadd_help() { -################################################################################ -# -# Static build support. When enabled will generate static -# libraries instead of shared libraries for all JDK libs. -# - - - - # # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4709,7 +4709,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1449049746 +DATE_WHEN_GENERATED=1449859210 ############################################################################### # @@ -14688,7 +14688,7 @@ test -n "$target_alias" && VAR_CPU_ENDIAN=big ;; powerpc64le) - VAR_CPU=ppc64 + VAR_CPU=ppc64le VAR_CPU_ARCH=ppc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=little @@ -14827,7 +14827,7 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } VAR_CPU_ENDIAN=big ;; powerpc64le) - VAR_CPU=ppc64 + VAR_CPU=ppc64le VAR_CPU_ARCH=ppc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=little diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 index 203b6285a06..3b7e3e33e5d 100644 --- a/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4 @@ -67,7 +67,7 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], VAR_CPU_ENDIAN=big ;; powerpc64le) - VAR_CPU=ppc64 + VAR_CPU=ppc64le VAR_CPU_ARCH=ppc VAR_CPU_BITS=64 VAR_CPU_ENDIAN=little diff --git a/common/bin/unshuffle_list.txt b/common/bin/unshuffle_list.txt index 68acb88fde4..1c704041649 100644 --- a/common/bin/unshuffle_list.txt +++ b/common/bin/unshuffle_list.txt @@ -378,6 +378,7 @@ jdk/src/java.base/unix/conf/arm/jvm.cfg : jdk/src/solaris/bin/arm/jvm.cfg jdk/src/java.base/unix/conf/i586/jvm.cfg : jdk/src/solaris/bin/i586/jvm.cfg jdk/src/java.base/unix/conf/ia64/jvm.cfg : jdk/src/solaris/bin/ia64/jvm.cfg jdk/src/java.base/unix/conf/ppc64/jvm.cfg : jdk/src/solaris/bin/ppc64/jvm.cfg +jdk/src/java.base/unix/conf/ppc64le/jvm.cfg : jdk/src/solaris/bin/ppc64le/jvm.cfg jdk/src/java.base/unix/conf/ppc/jvm.cfg : jdk/src/solaris/bin/ppc/jvm.cfg jdk/src/java.base/unix/conf/sdp/sdp.conf.template : jdk/src/solaris/lib/sdp/sdp.conf.template jdk/src/java.base/unix/conf/sparc/jvm.cfg : jdk/src/solaris/bin/sparc/jvm.cfg From ed2eaccb972f92f5e2f5bb9d97c5057072310db2 Mon Sep 17 00:00:00 2001 From: Andreas Eriksson Date: Mon, 14 Dec 2015 15:17:52 +0100 Subject: [PATCH 007/212] 8129419: heapDumper.cpp: assert(length_in_bytes > 0) failed: nothing to copy Reviewed-by: dsamersoff --- .../test/lib/hprof/parser/HprofReader.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test/lib/share/classes/jdk/test/lib/hprof/parser/HprofReader.java b/test/lib/share/classes/jdk/test/lib/hprof/parser/HprofReader.java index 53e52a0be02..15bd6af7fda 100644 --- a/test/lib/share/classes/jdk/test/lib/hprof/parser/HprofReader.java +++ b/test/lib/share/classes/jdk/test/lib/hprof/parser/HprofReader.java @@ -354,7 +354,14 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes } private void skipBytes(long length) throws IOException { - in.skipBytes((int)length); + while (length > 0) { + long skipped = in.skip(length); + if (skipped == 0) { + // EOF or other problem, throw exception + throw new EOFException("Couldn't skip enough bytes"); + } + length -= skipped; + } } private int readVersionHeader() throws IOException { @@ -486,12 +493,12 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes break; } case HPROF_GC_OBJ_ARRAY_DUMP: { - int bytesRead = readArray(false); + long bytesRead = readArray(false); bytesLeft -= bytesRead; break; } case HPROF_GC_PRIM_ARRAY_DUMP: { - int bytesRead = readArray(true); + long bytesRead = readArray(true); bytesLeft -= bytesRead; break; } @@ -743,12 +750,12 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes // Handle a HPROF_GC_OBJ_ARRAY_DUMP or HPROF_GC_PRIM_ARRAY_DUMP // Return number of bytes read // - private int readArray(boolean isPrimitive) throws IOException { + private long readArray(boolean isPrimitive) throws IOException { long start = in.position(); long id = readID(); StackTrace stackTrace = getStackTraceFromSerial(in.readInt()); int num = in.readInt(); - int bytesRead = identifierSize + 8; + long bytesRead = identifierSize + 8; long elementClassID; if (isPrimitive) { elementClassID = in.readByte(); @@ -810,14 +817,14 @@ public class HprofReader extends Reader /* imports */ implements ArrayTypeCodes } } if (primitiveSignature != 0x00) { - int size = elSize * num; + long size = elSize * (long)num; bytesRead += size; JavaValueArray va = new JavaValueArray(primitiveSignature, start); skipBytes(size); snapshot.addHeapObject(id, va); snapshot.setSiteTrace(va, stackTrace); } else { - int sz = num * identifierSize; + long sz = (long)num * identifierSize; bytesRead += sz; JavaObjectArray arr = new JavaObjectArray(elementClassID, start); skipBytes(sz); From 85c44d96823cd695d4b238b0d2a01874329ac9dc Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 16 Dec 2015 01:16:49 -0500 Subject: [PATCH 008/212] 8145427: [aix] xlc: wrong flag used to switch off optimization Just a small typo in flags.m4 Reviewed-by: dholmes --- common/autoconf/flags.m4 | 2 +- common/autoconf/generated-configure.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index 88f2e89dd6f..e35d25111cc 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -475,7 +475,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], C_O_FLAG_HI="-O3 -qstrict" C_O_FLAG_NORM="-O2" C_O_FLAG_DEBUG="-qnoopt" - C_O_FLAG_NONE="-qnoop" + C_O_FLAG_NONE="-qnoopt" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then C_O_FLAG_HIGHEST="-O2" C_O_FLAG_HI="-O1" diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 2b7000bd591..3980351d761 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4728,7 +4728,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1449859210 +DATE_WHEN_GENERATED=1450246539 ############################################################################### # @@ -46926,7 +46926,7 @@ $as_echo "$supports" >&6; } C_O_FLAG_HI="-O3 -qstrict" C_O_FLAG_NORM="-O2" C_O_FLAG_DEBUG="-qnoopt" - C_O_FLAG_NONE="-qnoop" + C_O_FLAG_NONE="-qnoopt" elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then C_O_FLAG_HIGHEST="-O2" C_O_FLAG_HI="-O1" From 83e2c4bdf7b3003dc19ee2769c92b04e026cb689 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 17 Dec 2015 10:16:27 +0100 Subject: [PATCH 009/212] 8145564: 8036003: startup regression on linux fastdebug builds Reviewed-by: ihse --- common/autoconf/generated-configure.sh | 14 +++++++++++--- common/autoconf/jdk-options.m4 | 12 ++++++++++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index a322c533c01..b80d7355aac 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4728,7 +4728,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1449850507 +DATE_WHEN_GENERATED=1450343758 ############################################################################### # @@ -47677,7 +47677,10 @@ $as_echo "$NATIVE_DEBUG_SYMBOLS" >&6; } ENABLE_DEBUG_SYMBOLS=true ZIP_DEBUGINFO_FILES=true - DEBUG_BINARIES=true + # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles + # will basically do slowdebug builds when DEBUG_BINARIES is set for + # fastdebug builds + DEBUG_BINARIES=false STRIP_POLICY=min_strip elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then ENABLE_DEBUG_SYMBOLS=false @@ -47687,6 +47690,8 @@ $as_echo "$NATIVE_DEBUG_SYMBOLS" >&6; } elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then ENABLE_DEBUG_SYMBOLS=false # -g option only ZIP_DEBUGINFO_FILES=false + # Fastdebug builds with this setting will essentially be slowdebug + # in hotspot. DEBUG_BINARIES=true STRIP_POLICY=no_strip STRIP="" @@ -47702,7 +47707,10 @@ $as_echo "$NATIVE_DEBUG_SYMBOLS" >&6; } ENABLE_DEBUG_SYMBOLS=true ZIP_DEBUGINFO_FILES=false - DEBUG_BINARIES=true + # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles + # will basically do slowdebug builds when DEBUG_BINARIES is set for + # fastdebug builds + DEBUG_BINARIES=false STRIP_POLICY=min_strip else as_fn_error $? "Allowed native debug symbols are: none, internal, external, zipped" "$LINENO" 5 diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 index 3f7a29e0abb..8236c201308 100644 --- a/common/autoconf/jdk-options.m4 +++ b/common/autoconf/jdk-options.m4 @@ -515,7 +515,10 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], ENABLE_DEBUG_SYMBOLS=true ZIP_DEBUGINFO_FILES=true - DEBUG_BINARIES=true + # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles + # will basically do slowdebug builds when DEBUG_BINARIES is set for + # fastdebug builds + DEBUG_BINARIES=false STRIP_POLICY=min_strip elif test "x$NATIVE_DEBUG_SYMBOLS" = xnone; then ENABLE_DEBUG_SYMBOLS=false @@ -525,6 +528,8 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], elif test "x$NATIVE_DEBUG_SYMBOLS" = xinternal; then ENABLE_DEBUG_SYMBOLS=false # -g option only ZIP_DEBUGINFO_FILES=false + # Fastdebug builds with this setting will essentially be slowdebug + # in hotspot. DEBUG_BINARIES=true STRIP_POLICY=no_strip STRIP="" @@ -540,7 +545,10 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], ENABLE_DEBUG_SYMBOLS=true ZIP_DEBUGINFO_FILES=false - DEBUG_BINARIES=true + # -g is already added by ENABLE_DEBUG_SYMBOLS and the hotspot makefiles + # will basically do slowdebug builds when DEBUG_BINARIES is set for + # fastdebug builds + DEBUG_BINARIES=false STRIP_POLICY=min_strip else AC_MSG_ERROR([Allowed native debug symbols are: none, internal, external, zipped]) From 280ec689c6a24a9b39080fa24ef2b2d3c0a61e22 Mon Sep 17 00:00:00 2001 From: Kirill Zhaldybin Date: Thu, 17 Dec 2015 16:20:09 +0300 Subject: [PATCH 010/212] 8132723: Add tests which check that soft references to humongous objects should work correctly 8132724: Add tests which check that weak references to humongous objects should work correctly Reviewed-by: jmasa, dfazunen --- test/lib/sun/hotspot/WhiteBox.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java index 02a4c562993..6b7863ad938 100644 --- a/test/lib/sun/hotspot/WhiteBox.java +++ b/test/lib/sun/hotspot/WhiteBox.java @@ -140,6 +140,23 @@ public class WhiteBox { return g1IsHumongous0(o); } + private native boolean g1BelongsToHumongousRegion0(long adr); + public boolean g1BelongsToHumongousRegion(long adr) { + if (adr == 0) { + throw new IllegalArgumentException("adr argument should not be null"); + } + return g1BelongsToHumongousRegion0(adr); + } + + + private native boolean g1BelongsToFreeRegion0(long adr); + public boolean g1BelongsToFreeRegion(long adr) { + if (adr == 0) { + throw new IllegalArgumentException("adr argument should not be null"); + } + return g1BelongsToFreeRegion0(adr); + } + public native long g1NumMaxRegions(); public native long g1NumFreeRegions(); public native int g1RegionSize(); From 19cddada2c3960681befcbce2e8d54201676a41f Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Tue, 22 Dec 2015 20:47:40 -0800 Subject: [PATCH 011/212] 8145828: JPRT hotspot push jobs should allow merge on push Reviewed-by: dholmes, iklam --- make/jprt.properties | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/make/jprt.properties b/make/jprt.properties index 30d974af888..1d66e76b1ca 100644 --- a/make/jprt.properties +++ b/make/jprt.properties @@ -34,13 +34,8 @@ jprt.selective.test.bundle.installation=true # The current release name jprt.tools.default.release=jdk9 -# Check if this is the equivalent of a hotspot push job -# Interpret -testset hotspot to mean exactly that -my.is.hotspot.job.hotspot=true -my.is.hotspot.job=${my.is.hotspot.job.${jprt.test.set}} - -# Disable syncing the source after builds and tests are done -jprt.sync.push=${my.is.hotspot.job ? false : true} +# Allow concurrent changes to be merged in prior to pushing +jprt.sync.push=true # Directories to be excluded from the source bundles jprt.bundle.exclude.src.dirs=build dist webrev From c28f46f6373f992ac29284bbade8154e4ffa7367 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Wed, 23 Dec 2015 13:12:12 +0300 Subject: [PATCH 012/212] 8067194: Restructure hotspot/agent/src to conform the modular source layout Move sources under jdk.hotspot.agent Reviewed-by: ihse, erikj, jbachorik --- make/CompileJavaModules.gmk | 8 ++------ make/common/Modules.gmk | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index 83eb00338a9..06241b35ba9 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -367,10 +367,6 @@ jdk.compiler_CLEAN_FILES := $(wildcard \ ################################################################################ -jdk.hotspot.agent_SRC += \ - $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent \ - $(HOTSPOT_TOPDIR)/agent/src/share/classes \ - # jdk.hotspot.agent_ADD_JAVAC_FLAGS := $(DISABLE_WARNINGS),-overrides jdk.hotspot.agent_COPY := .png sa.js .properties @@ -381,9 +377,9 @@ ifeq ($(MODULE), jdk.hotspot.agent) # These can't be handled by COPY to SetupJavaCompilation since they chop off # one directory level. $(eval $(call SetupCopyFiles, COPY_SA_IMAGES, \ - SRC := $(HOTSPOT_TOPDIR)/agent/src/share/classes/images, \ + SRC := $(HOTSPOT_TOPDIR)/src/jdk.hotspot.agent/share/classes/images, \ DEST := $(JDK_OUTPUTDIR)/modules/$(MODULE), \ - FILES := $(wildcard $(HOTSPOT_TOPDIR)/agent/src/share/classes/images/*/*/*.gif), \ + FILES := $(wildcard $(HOTSPOT_TOPDIR)/src/jdk.hotspot.agent/share/classes/images/*/*/*.gif), \ )) jdk.hotspot.agent: $(COPY_SA_IMAGES) endif diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index c90e505b040..500f3a62350 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -49,25 +49,21 @@ ALL_TOP_SRC_DIRS := \ # # Find all modules with java sources by looking in the source dirs -# jdk.hotspot.agent currently doesn't comply with source dir policy. define FindJavaModules $(filter-out $(MODULES_FILTER), $(sort $(notdir \ $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir \ $(wildcard $(patsubst %,%/*/share/classes/*, $(ALL_TOP_SRC_DIRS)) \ $(patsubst %,%/*/$(OPENJDK_TARGET_OS)/classes/*, $(ALL_TOP_SRC_DIRS)) \ - $(patsubst %,%/*/$(OPENJDK_TARGET_OS_TYPE)/classes/*, $(ALL_TOP_SRC_DIRS))))))))))) \ - jdk.hotspot.agent) + $(patsubst %,%/*/$(OPENJDK_TARGET_OS_TYPE)/classes/*, $(ALL_TOP_SRC_DIRS)))))))))))) endef # Find all modules with source for the target platform. -# jdk.hotspot.agent currently doesn't comply with source dir policy. define FindAllModules $(sort $(filter-out $(MODULES_FILTER) closed demo sample, \ $(notdir $(patsubst %/,%, $(dir \ $(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \ $(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \ - $(patsubst %, %/*/$(OPENJDK_TARGET_OS_TYPE), $(ALL_TOP_SRC_DIRS)))))) \ - jdk.hotspot.agent)) + $(patsubst %, %/*/$(OPENJDK_TARGET_OS_TYPE), $(ALL_TOP_SRC_DIRS)))))))) endef ################################################################################ From d9ae786b3b54036a8b2417321e5fffe5bc343094 Mon Sep 17 00:00:00 2001 From: Alejandro Murillo Date: Wed, 13 Jan 2016 12:45:33 -0800 Subject: [PATCH 013/212] 8146660: Resolve merge issue in resulting from sun.misc.VM move to jdk.internal.misc Reviewed-by: twisti, erikj, chegar --- make/Main.gmk | 4 ++++ modules.xml | 1 + 2 files changed, 5 insertions(+) diff --git a/make/Main.gmk b/make/Main.gmk index 3b60038e42d..ce315103b88 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -427,6 +427,10 @@ else # in javadoc. java.desktop-gensrc-jdk: java.base-gensrc + # The annotation processing for jdk.vm.ci needs java.base classes from the + # current JDK. + jdk.vm.ci-gensrc-hotspot: java.base-java + # Explicitly add dependencies for special targets java.base-java: unpack-sec diff --git a/modules.xml b/modules.xml index d7db4ed42d8..c5f8419faf3 100644 --- a/modules.xml +++ b/modules.xml @@ -237,6 +237,7 @@ jdk.charsets jdk.management.resource jdk.scripting.nashorn + jdk.vm.ci jdk.internal.org.objectweb.asm From 64e41d5ac44c996908b546bc4fba4cd249fa6ecf Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Thu, 14 Jan 2016 14:35:22 +0100 Subject: [PATCH 014/212] 8146364: Remove @ServiceProvider mechanism from JVMCI Reviewed-by: twisti --- make/CompileJavaModules.gmk | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index 06241b35ba9..b2c915b1243 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -467,18 +467,6 @@ jdk.jvmstat_COPY := aliasmap ################################################################################ -jdk.vm.ci_EXCLUDE_FILES += \ - jdk/vm/ci/options/processor/OptionProcessor.java \ - jdk/vm/ci/service/processor/ServiceProviderProcessor.java \ - # - -jdk.vm.ci_EXCLUDES += \ - META-INF/jvmci.options \ - META-INF/jvmci.providers \ - # - -################################################################################ - jdk.xml.bind_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS jdk.xml.bind_CLEAN := .properties jdk.xml.bind_COPY := .xsd JAXBContextFactory.java ZeroOneBooleanAdapter.java From 2489b87d30bbec40ff74843aee6e29a035b2ccb4 Mon Sep 17 00:00:00 2001 From: Filipp Zhinkin Date: Tue, 22 Dec 2015 10:18:55 +0300 Subject: [PATCH 015/212] 8066599: Add methods to check VM mode to c.o.j.t.Platform Reviewed-by: iignatyev --- .../share/classes/jdk/test/lib/Platform.java | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/test/lib/share/classes/jdk/test/lib/Platform.java b/test/lib/share/classes/jdk/test/lib/Platform.java index f809d694312..966f70d6333 100644 --- a/test/lib/share/classes/jdk/test/lib/Platform.java +++ b/test/lib/share/classes/jdk/test/lib/Platform.java @@ -34,6 +34,7 @@ public class Platform { private static final String vmName = System.getProperty("java.vm.name"); private static final String userName = System.getProperty("user.name"); private static final String compiler = System.getProperty("sun.management.compiler"); + private static final String vmInfo = System.getProperty("java.vm.info"); public static boolean isClient() { return vmName.endsWith(" Client VM"); @@ -63,6 +64,18 @@ public class Platform { return compiler.contains("Tiered Compilers"); } + public static boolean isInt() { + return vmInfo.contains("interpreted"); + } + + public static boolean isMixed() { + return vmInfo.contains("mixed"); + } + + public static boolean isComp() { + return vmInfo.contains("compiled"); + } + public static boolean is32bit() { return dataModel.equals("32"); } @@ -135,12 +148,6 @@ public class Platform { return isArch("aarch64"); } - private static boolean isArch(String archnameRE) { - return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE) - .matcher(osArch) - .matches(); - } - public static String getOsArch() { return osArch; } @@ -203,4 +210,10 @@ public class Platform { public static boolean canAttachOSX() throws Exception { return userName.equals("root"); } + + private static boolean isArch(String archnameRE) { + return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE) + .matcher(osArch) + .matches(); + } } From c3808b209125b732fef6e1a2f52fddc7588b8c5b Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Mon, 28 Dec 2015 13:59:20 -0500 Subject: [PATCH 016/212] 8143847: Remove REF_CLEANER reference category Remove REF_CLEANER. Reviewed-by: jwilhelm, mchung, tbenson --- .../share/vm/classfile/systemDictionary.cpp | 5 ++-- .../share/vm/classfile/systemDictionary.hpp | 3 +- hotspot/src/share/vm/classfile/vmSymbols.hpp | 3 +- .../share/vm/gc/shared/referenceProcessor.cpp | 30 ++----------------- .../share/vm/gc/shared/referenceProcessor.hpp | 5 ++-- hotspot/src/share/vm/memory/referenceType.hpp | 5 ++-- hotspot/src/share/vm/runtime/vmStructs.cpp | 1 - 7 files changed, 10 insertions(+), 42 deletions(-) diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index 420bf3f36b0..e9d00c82823 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1974,12 +1974,11 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) { InstanceKlass::cast(WK_KLASS(Reference_klass))->set_reference_type(REF_OTHER); InstanceRefKlass::update_nonstatic_oop_maps(WK_KLASS(Reference_klass)); - initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(Cleaner_klass), scan, CHECK); + initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(PhantomReference_klass), scan, CHECK); InstanceKlass::cast(WK_KLASS(SoftReference_klass))->set_reference_type(REF_SOFT); InstanceKlass::cast(WK_KLASS(WeakReference_klass))->set_reference_type(REF_WEAK); InstanceKlass::cast(WK_KLASS(FinalReference_klass))->set_reference_type(REF_FINAL); InstanceKlass::cast(WK_KLASS(PhantomReference_klass))->set_reference_type(REF_PHANTOM); - InstanceKlass::cast(WK_KLASS(Cleaner_klass))->set_reference_type(REF_CLEANER); // JSR 292 classes WKID jsr292_group_start = WK_KLASS_ENUM_NAME(MethodHandle_klass); diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp index b08b4113b75..628895f1e44 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.hpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -128,7 +128,6 @@ class SymbolPropertyTable; do_klass(WeakReference_klass, java_lang_ref_WeakReference, Pre ) \ do_klass(FinalReference_klass, java_lang_ref_FinalReference, Pre ) \ do_klass(PhantomReference_klass, java_lang_ref_PhantomReference, Pre ) \ - do_klass(Cleaner_klass, sun_misc_Cleaner, Pre ) \ do_klass(Finalizer_klass, java_lang_ref_Finalizer, Pre ) \ \ do_klass(Thread_klass, java_lang_Thread, Pre ) \ diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index cef61cc3aa2..777c6221934 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,7 +82,6 @@ template(java_lang_ref_WeakReference, "java/lang/ref/WeakReference") \ template(java_lang_ref_FinalReference, "java/lang/ref/FinalReference") \ template(java_lang_ref_PhantomReference, "java/lang/ref/PhantomReference") \ - template(sun_misc_Cleaner, "sun/misc/Cleaner") \ template(java_lang_ref_Finalizer, "java/lang/ref/Finalizer") \ template(java_lang_reflect_AccessibleObject, "java/lang/reflect/AccessibleObject") \ template(java_lang_reflect_Method, "java/lang/reflect/Method") \ diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp index 58e73f237ed..522f9e27807 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -119,7 +119,6 @@ ReferenceProcessor::ReferenceProcessor(MemRegion span, _discoveredWeakRefs = &_discoveredSoftRefs[_max_num_q]; _discoveredFinalRefs = &_discoveredWeakRefs[_max_num_q]; _discoveredPhantomRefs = &_discoveredFinalRefs[_max_num_q]; - _discoveredCleanerRefs = &_discoveredPhantomRefs[_max_num_q]; // Initialize all entries to NULL for (uint i = 0; i < _max_num_q * number_of_subclasses_of_ref(); i++) { @@ -208,14 +207,11 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( _soft_ref_timestamp_clock = java_lang_ref_SoftReference::clock(); - // Include cleaners in phantom statistics. We expect Cleaner - // references to be temporary, and don't want to deal with - // possible incompatibilities arising from making it more visible. ReferenceProcessorStats stats( total_count(_discoveredSoftRefs), total_count(_discoveredWeakRefs), total_count(_discoveredFinalRefs), - total_count(_discoveredPhantomRefs) + total_count(_discoveredCleanerRefs)); + total_count(_discoveredPhantomRefs)); // Soft references { @@ -245,12 +241,6 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( GCTraceTime(Debug, gc, ref) tt("PhantomReference", gc_timer); process_discovered_reflist(_discoveredPhantomRefs, NULL, true, is_alive, keep_alive, complete_gc, task_executor); - - // Process cleaners, but include them in phantom timing. We expect - // Cleaner references to be temporary, and don't want to deal with - // possible incompatibilities arising from making it more visible. - process_discovered_reflist(_discoveredCleanerRefs, NULL, true, - is_alive, keep_alive, complete_gc, task_executor); } // Weak global JNI references. It would make more sense (semantically) to @@ -807,7 +797,6 @@ void ReferenceProcessor::balance_all_queues() { balance_queues(_discoveredWeakRefs); balance_queues(_discoveredFinalRefs); balance_queues(_discoveredPhantomRefs); - balance_queues(_discoveredCleanerRefs); } void ReferenceProcessor::process_discovered_reflist( @@ -912,9 +901,6 @@ inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt) case REF_PHANTOM: list = &_discoveredPhantomRefs[id]; break; - case REF_CLEANER: - list = &_discoveredCleanerRefs[id]; - break; case REF_NONE: // we should not reach here if we are an InstanceRefKlass default: @@ -1162,17 +1148,6 @@ void ReferenceProcessor::preclean_discovered_references( preclean_discovered_reflist(_discoveredPhantomRefs[i], is_alive, keep_alive, complete_gc, yield); } - - // Cleaner references. Included in timing for phantom references. We - // expect Cleaner references to be temporary, and don't want to deal with - // possible incompatibilities arising from making it more visible. - for (uint i = 0; i < _max_num_q; i++) { - if (yield->should_return()) { - return; - } - preclean_discovered_reflist(_discoveredCleanerRefs[i], is_alive, - keep_alive, complete_gc, yield); - } } } @@ -1238,7 +1213,6 @@ const char* ReferenceProcessor::list_name(uint i) { case 1: return "WeakRef"; case 2: return "FinalRef"; case 3: return "PhantomRef"; - case 4: return "CleanerRef"; } ShouldNotReachHere(); return NULL; diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp index fcfcbccd02d..0d100893465 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -244,10 +244,9 @@ class ReferenceProcessor : public CHeapObj { DiscoveredList* _discoveredWeakRefs; DiscoveredList* _discoveredFinalRefs; DiscoveredList* _discoveredPhantomRefs; - DiscoveredList* _discoveredCleanerRefs; public: - static int number_of_subclasses_of_ref() { return (REF_CLEANER - REF_OTHER); } + static int number_of_subclasses_of_ref() { return (REF_PHANTOM - REF_OTHER); } uint num_q() { return _num_q; } uint max_num_q() { return _max_num_q; } diff --git a/hotspot/src/share/vm/memory/referenceType.hpp b/hotspot/src/share/vm/memory/referenceType.hpp index a54e8238e87..ea50b2c88f6 100644 --- a/hotspot/src/share/vm/memory/referenceType.hpp +++ b/hotspot/src/share/vm/memory/referenceType.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,8 +35,7 @@ enum ReferenceType { REF_SOFT, // Subclass of java/lang/ref/SoftReference REF_WEAK, // Subclass of java/lang/ref/WeakReference REF_FINAL, // Subclass of java/lang/ref/FinalReference - REF_PHANTOM, // Subclass of java/lang/ref/PhantomReference - REF_CLEANER // Subclass of sun/misc/Cleaner + REF_PHANTOM // Subclass of java/lang/ref/PhantomReference }; #endif // SHARE_VM_MEMORY_REFERENCETYPE_HPP diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 8885bbb9a24..7f2fde47b2e 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -706,7 +706,6 @@ typedef CompactHashtable SymbolCompactHashTable; static_field(SystemDictionary, WK_KLASS(WeakReference_klass), InstanceKlass*) \ static_field(SystemDictionary, WK_KLASS(FinalReference_klass), InstanceKlass*) \ static_field(SystemDictionary, WK_KLASS(PhantomReference_klass), InstanceKlass*) \ - static_field(SystemDictionary, WK_KLASS(Cleaner_klass), InstanceKlass*) \ static_field(SystemDictionary, WK_KLASS(Finalizer_klass), InstanceKlass*) \ static_field(SystemDictionary, WK_KLASS(Thread_klass), InstanceKlass*) \ static_field(SystemDictionary, WK_KLASS(ThreadGroup_klass), InstanceKlass*) \ From b26df6b69f579858a371971ae9d2d79f50bfc792 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 4 Jan 2016 15:41:05 +0100 Subject: [PATCH 017/212] 8146401: Clean up oop.hpp: add inline directives and fix header files Reviewed-by: coleenp --- hotspot/src/share/vm/ci/ciInstance.hpp | 4 +- .../src/share/vm/classfile/classLoader.cpp | 3 +- .../share/vm/classfile/classLoaderData.hpp | 6 +- .../vm/classfile/classLoaderData.inline.hpp | 7 +- hotspot/src/share/vm/classfile/dictionary.cpp | 12 +- hotspot/src/share/vm/classfile/dictionary.hpp | 11 +- .../src/share/vm/classfile/javaAssertions.cpp | 3 +- .../src/share/vm/classfile/javaClasses.hpp | 114 +-- .../share/vm/classfile/javaClasses.inline.hpp | 108 ++- .../src/share/vm/classfile/stringTable.cpp | 4 +- hotspot/src/share/vm/code/dependencies.cpp | 9 +- hotspot/src/share/vm/code/dependencies.hpp | 10 +- hotspot/src/share/vm/gc/serial/markSweep.cpp | 1 + .../share/vm/gc/shared/referenceProcessor.cpp | 2 +- .../src/share/vm/jvmci/jvmciCompilerToVM.cpp | 3 +- .../src/share/vm/jvmci/jvmciJavaClasses.hpp | 3 +- hotspot/src/share/vm/jvmci/jvmciRuntime.cpp | 3 +- hotspot/src/share/vm/oops/constantPool.cpp | 6 +- hotspot/src/share/vm/oops/constantPool.hpp | 6 +- .../share/vm/oops/instanceRefKlass.inline.hpp | 4 +- hotspot/src/share/vm/oops/method.cpp | 3 +- hotspot/src/share/vm/oops/objArrayOop.hpp | 10 +- .../src/share/vm/oops/objArrayOop.inline.hpp | 10 +- hotspot/src/share/vm/oops/oop.hpp | 307 ++++---- hotspot/src/share/vm/oops/oop.inline.hpp | 705 +++++++++--------- hotspot/src/share/vm/oops/typeArrayKlass.cpp | 2 +- hotspot/src/share/vm/oops/typeArrayOop.hpp | 7 +- ...peArrayOop.cpp => typeArrayOop.inline.hpp} | 13 +- hotspot/src/share/vm/opto/runtime.cpp | 1 + hotspot/src/share/vm/prims/jni.cpp | 4 +- hotspot/src/share/vm/prims/jvmtiTagMap.cpp | 3 +- .../src/share/vm/runtime/deoptimization.cpp | 3 +- hotspot/src/share/vm/services/gcNotifier.cpp | 3 +- hotspot/src/share/vm/services/serviceUtil.hpp | 3 +- .../src/share/vm/services/threadService.cpp | 3 +- hotspot/src/share/vm/utilities/hashtable.cpp | 4 +- 36 files changed, 714 insertions(+), 686 deletions(-) rename hotspot/src/share/vm/oops/{typeArrayOop.cpp => typeArrayOop.inline.hpp} (75%) diff --git a/hotspot/src/share/vm/ci/ciInstance.hpp b/hotspot/src/share/vm/ci/ciInstance.hpp index acff37f1e71..a33aabbc0ce 100644 --- a/hotspot/src/share/vm/ci/ciInstance.hpp +++ b/hotspot/src/share/vm/ci/ciInstance.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ class ciInstance : public ciObject { protected: ciInstance(instanceHandle h_i) : ciObject(h_i) { - assert(h_i()->is_instance(), "wrong type"); + assert(h_i()->is_instance_noinline(), "wrong type"); } ciInstance(ciKlass* klass) : ciObject(klass) {} diff --git a/hotspot/src/share/vm/classfile/classLoader.cpp b/hotspot/src/share/vm/classfile/classLoader.cpp index 8a2597f515e..3881be599a7 100644 --- a/hotspot/src/share/vm/classfile/classLoader.cpp +++ b/hotspot/src/share/vm/classfile/classLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,6 +43,7 @@ #include "memory/universe.inline.hpp" #include "oops/instanceKlass.hpp" #include "oops/instanceRefKlass.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" #include "prims/jvm_misc.hpp" diff --git a/hotspot/src/share/vm/classfile/classLoaderData.hpp b/hotspot/src/share/vm/classfile/classLoaderData.hpp index 4d4b9d48e41..d208fde85fb 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.hpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -275,9 +275,7 @@ class ClassLoaderData : public CHeapObj { // Used to make sure that this CLD is not unloaded. void set_keep_alive(bool value) { _keep_alive = value; } - unsigned int identity_hash() const { - return _class_loader == NULL ? 0 : _class_loader->identity_hash(); - } + inline unsigned int identity_hash() const; // Used when tracing from klasses. void oops_do(OopClosure* f, KlassClosure* klass_closure, bool must_claim); diff --git a/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp b/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp index 11014f25cbb..2427838890f 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,11 @@ #include "classfile/classLoaderData.hpp" #include "classfile/javaClasses.hpp" +#include "oops/oop.inline.hpp" + +unsigned int ClassLoaderData::identity_hash() const { + return _class_loader == NULL ? 0 : _class_loader->identity_hash(); +} inline ClassLoaderData* ClassLoaderData::class_loader_data_or_null(oop loader) { if (loader == NULL) { diff --git a/hotspot/src/share/vm/classfile/dictionary.cpp b/hotspot/src/share/vm/classfile/dictionary.cpp index fde1bb4c6c7..6f70ef9b47e 100644 --- a/hotspot/src/share/vm/classfile/dictionary.cpp +++ b/hotspot/src/share/vm/classfile/dictionary.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/classLoaderData.inline.hpp" #include "classfile/sharedClassUtil.hpp" #include "classfile/dictionary.hpp" #include "classfile/systemDictionary.hpp" @@ -500,6 +501,15 @@ void Dictionary::reorder_dictionary() { } } + +unsigned int ProtectionDomainCacheTable::compute_hash(oop protection_domain) { + return (unsigned int)(protection_domain->identity_hash()); +} + +int ProtectionDomainCacheTable::index_for(oop protection_domain) { + return hash_to_index(compute_hash(protection_domain)); +} + ProtectionDomainCacheTable::ProtectionDomainCacheTable(int table_size) : Hashtable(table_size, sizeof(ProtectionDomainCacheEntry)) { diff --git a/hotspot/src/share/vm/classfile/dictionary.hpp b/hotspot/src/share/vm/classfile/dictionary.hpp index 1f308578220..a77f33717f3 100644 --- a/hotspot/src/share/vm/classfile/dictionary.hpp +++ b/hotspot/src/share/vm/classfile/dictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -196,14 +196,9 @@ private: return entry; } - static unsigned int compute_hash(oop protection_domain) { - return (unsigned int)(protection_domain->identity_hash()); - } - - int index_for(oop protection_domain) { - return hash_to_index(compute_hash(protection_domain)); - } + static unsigned int compute_hash(oop protection_domain); + int index_for(oop protection_domain); ProtectionDomainCacheEntry* add_entry(int index, unsigned int hash, oop protection_domain); ProtectionDomainCacheEntry* find_entry(int index, oop protection_domain); diff --git a/hotspot/src/share/vm/classfile/javaAssertions.cpp b/hotspot/src/share/vm/classfile/javaAssertions.cpp index 800cdbef2c0..5c3c8c9c0e3 100644 --- a/hotspot/src/share/vm/classfile/javaAssertions.cpp +++ b/hotspot/src/share/vm/classfile/javaAssertions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ #include "classfile/vmSymbols.hpp" #include "memory/allocation.inline.hpp" #include "memory/oopFactory.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/handles.inline.hpp" diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 192d11ccede..0edec1ab0b7 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,12 +60,7 @@ class java_lang_String : AllStatic { static Handle basic_create(int length, bool byte_arr, TRAPS); - static void set_coder(oop string, jbyte coder) { - assert(initialized, "Must be initialized"); - if (coder_offset > 0) { - string->byte_field_put(coder_offset, coder); - } - } + static inline void set_coder(oop string, jbyte coder); public: @@ -110,55 +105,15 @@ class java_lang_String : AllStatic { return coder_offset; } - static void set_value_raw(oop string, typeArrayOop buffer) { - assert(initialized, "Must be initialized"); - string->obj_field_put_raw(value_offset, buffer); - } - static void set_value(oop string, typeArrayOop buffer) { - assert(initialized && (value_offset > 0), "Must be initialized"); - string->obj_field_put(value_offset, (oop)buffer); - } - static void set_hash(oop string, unsigned int hash) { - assert(initialized && (hash_offset > 0), "Must be initialized"); - string->int_field_put(hash_offset, hash); - } + static inline void set_value_raw(oop string, typeArrayOop buffer); + static inline void set_value(oop string, typeArrayOop buffer); + static inline void set_hash(oop string, unsigned int hash); // Accessors - static typeArrayOop value(oop java_string) { - assert(initialized && (value_offset > 0), "Must be initialized"); - assert(is_instance(java_string), "must be java_string"); - return (typeArrayOop) java_string->obj_field(value_offset); - } - static unsigned int hash(oop java_string) { - assert(initialized && (hash_offset > 0), "Must be initialized"); - assert(is_instance(java_string), "must be java_string"); - return java_string->int_field(hash_offset); - } - static bool is_latin1(oop java_string) { - assert(initialized, "Must be initialized"); - assert(is_instance(java_string), "must be java_string"); - if (coder_offset > 0) { - jbyte coder = java_string->byte_field(coder_offset); - assert(CompactStrings || coder == CODER_UTF16, "Must be UTF16 without CompactStrings"); - return coder == CODER_LATIN1; - } else { - return false; - } - } - static int length(oop java_string) { - assert(initialized, "Must be initialized"); - assert(is_instance(java_string), "must be java_string"); - typeArrayOop value_array = ((typeArrayOop)java_string->obj_field(value_offset)); - if (value_array == NULL) { - return 0; - } - int arr_length = value_array->length(); - if (!is_latin1(java_string)) { - assert((arr_length & 1) == 0, "should be even for UTF16 string"); - arr_length >>= 1; // convert number of bytes to number of elements - } - return arr_length; - } + static inline typeArrayOop value(oop java_string); + static inline unsigned int hash(oop java_string); + static inline bool is_latin1(oop java_string); + static inline int length(oop java_string); static int utf8_length(oop java_string); // String converters @@ -219,7 +174,7 @@ class java_lang_String : AllStatic { // Testers static bool is_instance(oop obj); - static bool is_instance_inlined(oop obj); + static inline bool is_instance_inlined(oop obj); // Debugging static void print(oop java_string, outputStream* st); @@ -910,42 +865,19 @@ class java_lang_ref_Reference: AllStatic { static int number_of_fake_oop_fields; // Accessors - static oop referent(oop ref) { - return ref->obj_field(referent_offset); - } - static void set_referent(oop ref, oop value) { - ref->obj_field_put(referent_offset, value); - } - static void set_referent_raw(oop ref, oop value) { - ref->obj_field_put_raw(referent_offset, value); - } - static HeapWord* referent_addr(oop ref) { - return ref->obj_field_addr(referent_offset); - } - static oop next(oop ref) { - return ref->obj_field(next_offset); - } - static void set_next(oop ref, oop value) { - ref->obj_field_put(next_offset, value); - } - static void set_next_raw(oop ref, oop value) { - ref->obj_field_put_raw(next_offset, value); - } - static HeapWord* next_addr(oop ref) { - return ref->obj_field_addr(next_offset); - } - static oop discovered(oop ref) { - return ref->obj_field(discovered_offset); - } - static void set_discovered(oop ref, oop value) { - ref->obj_field_put(discovered_offset, value); - } - static void set_discovered_raw(oop ref, oop value) { - ref->obj_field_put_raw(discovered_offset, value); - } - static HeapWord* discovered_addr(oop ref) { - return ref->obj_field_addr(discovered_offset); - } + static inline oop referent(oop ref); + static inline void set_referent(oop ref, oop value); + static inline void set_referent_raw(oop ref, oop value); + static inline HeapWord* referent_addr(oop ref); + static inline oop next(oop ref); + static inline void set_next(oop ref, oop value); + static inline void set_next_raw(oop ref, oop value); + static inline HeapWord* next_addr(oop ref); + static inline oop discovered(oop ref); + static inline void set_discovered(oop ref, oop value); + static inline void set_discovered_raw(oop ref, oop value); + static inline HeapWord* discovered_addr(oop ref); + // Accessors for statics static oop pending_list_lock(); static oop pending_list(); diff --git a/hotspot/src/share/vm/classfile/javaClasses.inline.hpp b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp index ac35ccb8439..05deb981ba1 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.inline.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,105 @@ #include "oops/oop.inline.hpp" #include "oops/oopsHierarchy.hpp" +void java_lang_String::set_coder(oop string, jbyte coder) { + assert(initialized, "Must be initialized"); + if (coder_offset > 0) { + string->byte_field_put(coder_offset, coder); + } +} + +void java_lang_String::set_value_raw(oop string, typeArrayOop buffer) { + assert(initialized, "Must be initialized"); + string->obj_field_put_raw(value_offset, buffer); +} +void java_lang_String::set_value(oop string, typeArrayOop buffer) { + assert(initialized && (value_offset > 0), "Must be initialized"); + string->obj_field_put(value_offset, (oop)buffer); +} +void java_lang_String::set_hash(oop string, unsigned int hash) { + assert(initialized && (hash_offset > 0), "Must be initialized"); + string->int_field_put(hash_offset, hash); +} + +// Accessors +typeArrayOop java_lang_String::value(oop java_string) { + assert(initialized && (value_offset > 0), "Must be initialized"); + assert(is_instance(java_string), "must be java_string"); + return (typeArrayOop) java_string->obj_field(value_offset); +} +unsigned int java_lang_String::hash(oop java_string) { + assert(initialized && (hash_offset > 0), "Must be initialized"); + assert(is_instance(java_string), "must be java_string"); + return java_string->int_field(hash_offset); +} +bool java_lang_String::is_latin1(oop java_string) { + assert(initialized, "Must be initialized"); + assert(is_instance(java_string), "must be java_string"); + if (coder_offset > 0) { + jbyte coder = java_string->byte_field(coder_offset); + assert(CompactStrings || coder == CODER_UTF16, "Must be UTF16 without CompactStrings"); + return coder == CODER_LATIN1; + } else { + return false; + } +} +int java_lang_String::length(oop java_string) { + assert(initialized, "Must be initialized"); + assert(is_instance(java_string), "must be java_string"); + typeArrayOop value_array = ((typeArrayOop)java_string->obj_field(value_offset)); + if (value_array == NULL) { + return 0; + } + int arr_length = value_array->length(); + if (!is_latin1(java_string)) { + assert((arr_length & 1) == 0, "should be even for UTF16 string"); + arr_length >>= 1; // convert number of bytes to number of elements + } + return arr_length; +} + +bool java_lang_String::is_instance_inlined(oop obj) { + return obj != NULL && obj->klass() == SystemDictionary::String_klass(); +} + +// Accessors +oop java_lang_ref_Reference::referent(oop ref) { + return ref->obj_field(referent_offset); +} +void java_lang_ref_Reference::set_referent(oop ref, oop value) { + ref->obj_field_put(referent_offset, value); +} +void java_lang_ref_Reference::set_referent_raw(oop ref, oop value) { + ref->obj_field_put_raw(referent_offset, value); +} +HeapWord* java_lang_ref_Reference::referent_addr(oop ref) { + return ref->obj_field_addr(referent_offset); +} +oop java_lang_ref_Reference::next(oop ref) { + return ref->obj_field(next_offset); +} +void java_lang_ref_Reference::set_next(oop ref, oop value) { + ref->obj_field_put(next_offset, value); +} +void java_lang_ref_Reference::set_next_raw(oop ref, oop value) { + ref->obj_field_put_raw(next_offset, value); +} +HeapWord* java_lang_ref_Reference::next_addr(oop ref) { + return ref->obj_field_addr(next_offset); +} +oop java_lang_ref_Reference::discovered(oop ref) { + return ref->obj_field(discovered_offset); +} +void java_lang_ref_Reference::set_discovered(oop ref, oop value) { + ref->obj_field_put(discovered_offset, value); +} +void java_lang_ref_Reference::set_discovered_raw(oop ref, oop value) { + ref->obj_field_put_raw(discovered_offset, value); +} +HeapWord* java_lang_ref_Reference::discovered_addr(oop ref) { + return ref->obj_field_addr(discovered_offset); +} + inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) { site->obj_field_put_volatile(_target_offset, target); } @@ -41,10 +140,6 @@ inline void java_lang_invoke_CallSite::set_target(oop site, oop target) { site->obj_field_put(_target_offset, target); } -inline bool java_lang_String::is_instance_inlined(oop obj) { - return obj != NULL && obj->klass() == SystemDictionary::String_klass(); -} - inline bool java_lang_invoke_CallSite::is_instance(oop obj) { return obj != NULL && is_subclass(obj->klass()); } @@ -73,6 +168,9 @@ inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) { return obj != NULL && is_subclass(obj->klass()); } + + + inline int Backtrace::merge_bci_and_version(int bci, int version) { // only store u2 for version, checking for overflow. if (version > USHRT_MAX || version < 0) version = USHRT_MAX; diff --git a/hotspot/src/share/vm/classfile/stringTable.cpp b/hotspot/src/share/vm/classfile/stringTable.cpp index 59a78bbb221..88eba0750c9 100644 --- a/hotspot/src/share/vm/classfile/stringTable.cpp +++ b/hotspot/src/share/vm/classfile/stringTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ #include "precompiled.hpp" #include "classfile/altHashing.hpp" #include "classfile/compactHashtable.inline.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/stringTable.hpp" #include "classfile/systemDictionary.hpp" #include "gc/shared/collectedHeap.inline.hpp" diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index c941f404276..ed9ec7f052c 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1950,3 +1950,10 @@ void Dependencies::print_statistics() { } } #endif + +CallSiteDepChange::CallSiteDepChange(Handle call_site, Handle method_handle) : + _call_site(call_site), + _method_handle(method_handle) { + assert(_call_site()->is_a(SystemDictionary::CallSite_klass()), "must be"); + assert(_method_handle.is_null() || _method_handle()->is_a(SystemDictionary::MethodHandle_klass()), "must be"); +} diff --git a/hotspot/src/share/vm/code/dependencies.hpp b/hotspot/src/share/vm/code/dependencies.hpp index e9c26011695..5872a4f30a4 100644 --- a/hotspot/src/share/vm/code/dependencies.hpp +++ b/hotspot/src/share/vm/code/dependencies.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -767,13 +767,7 @@ class CallSiteDepChange : public DepChange { Handle _method_handle; public: - CallSiteDepChange(Handle call_site, Handle method_handle) - : _call_site(call_site), - _method_handle(method_handle) - { - assert(_call_site() ->is_a(SystemDictionary::CallSite_klass()), "must be"); - assert(_method_handle.is_null() || _method_handle()->is_a(SystemDictionary::MethodHandle_klass()), "must be"); - } + CallSiteDepChange(Handle call_site, Handle method_handle); // What kind of DepChange is this? virtual bool is_call_site_change() const { return true; } diff --git a/hotspot/src/share/vm/gc/serial/markSweep.cpp b/hotspot/src/share/vm/gc/serial/markSweep.cpp index 489fe2a0cd0..93741aeee4a 100644 --- a/hotspot/src/share/vm/gc/serial/markSweep.cpp +++ b/hotspot/src/share/vm/gc/serial/markSweep.cpp @@ -37,6 +37,7 @@ #include "oops/methodData.hpp" #include "oops/objArrayKlass.inline.hpp" #include "oops/oop.inline.hpp" +#include "oops/typeArrayOop.inline.hpp" #include "utilities/macros.hpp" #include "utilities/stack.inline.hpp" #if INCLUDE_ALL_GCS diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp index 522f9e27807..73be2d60d14 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/systemDictionary.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectedHeap.inline.hpp" diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp index 558331e64a7..ea3a8356d18 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,6 +22,7 @@ */ #include "precompiled.hpp" +#include "classfile/javaClasses.inline.hpp" #include "code/codeCache.hpp" #include "code/scopeDesc.hpp" #include "interpreter/linkResolver.hpp" diff --git a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp index a49eda73d4d..0765e0edf24 100644 --- a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #include "classfile/systemDictionary.hpp" #include "oops/instanceMirrorKlass.hpp" +#include "oops/oop.inline.hpp" class JVMCIJavaClasses : AllStatic { public: diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index b9691e4eb66..0debca62565 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ #include "precompiled.hpp" #include "asm/codeBuffer.hpp" +#include "classfile/javaClasses.inline.hpp" #include "code/codeCache.hpp" #include "compiler/compileBroker.hpp" #include "compiler/disassembler.hpp" diff --git a/hotspot/src/share/vm/oops/constantPool.cpp b/hotspot/src/share/vm/oops/constantPool.cpp index 26b5e3abe07..6d7b72c3f07 100644 --- a/hotspot/src/share/vm/oops/constantPool.cpp +++ b/hotspot/src/share/vm/oops/constantPool.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -186,6 +186,10 @@ int ConstantPool::cp_to_object_index(int cp_index) { return (i < 0) ? _no_index_sentinel : i; } +void ConstantPool::string_at_put(int which, int obj_index, oop str) { + resolved_references()->obj_at_put(obj_index, str); +} + void ConstantPool::trace_class_resolution(const constantPoolHandle& this_cp, KlassHandle k) { ResourceMark rm; int line_number = -1; diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp index 4bf8e777157..57d4fd9aa56 100644 --- a/hotspot/src/share/vm/oops/constantPool.hpp +++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -302,9 +302,7 @@ class ConstantPool : public Metadata { *symbol_at_addr(which) = s; } - void string_at_put(int which, int obj_index, oop str) { - resolved_references()->obj_at_put(obj_index, str); - } + void string_at_put(int which, int obj_index, oop str); // For temporary use while constructing constant pool void string_index_at_put(int which, int string_index) { diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp b/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp index 580d99346b3..97e6d48d311 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ #ifndef SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP #define SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "gc/shared/referenceProcessor.hpp" #include "logging/log.hpp" #include "oops/instanceKlass.inline.hpp" diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index d1a7c297dfd..55551c6b1c3 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,7 @@ #include "oops/constMethod.hpp" #include "oops/method.hpp" #include "oops/methodData.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" #include "prims/jvmtiExport.hpp" diff --git a/hotspot/src/share/vm/oops/objArrayOop.hpp b/hotspot/src/share/vm/oops/objArrayOop.hpp index 189be122044..b30b1fd8007 100644 --- a/hotspot/src/share/vm/oops/objArrayOop.hpp +++ b/hotspot/src/share/vm/oops/objArrayOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,13 +81,7 @@ private: // Accessing oop obj_at(int index) const; - void obj_at_put(int index, oop value) { - if (UseCompressedOops) { - oop_store(obj_at_addr(index), value); - } else { - oop_store(obj_at_addr(index), value); - } - } + void /*inline*/ obj_at_put(int index, oop value); oop atomic_compare_exchange_oop(int index, oop exchange_value, oop compare_value); diff --git a/hotspot/src/share/vm/oops/objArrayOop.inline.hpp b/hotspot/src/share/vm/oops/objArrayOop.inline.hpp index 53f402023ff..5c9004de897 100644 --- a/hotspot/src/share/vm/oops/objArrayOop.inline.hpp +++ b/hotspot/src/share/vm/oops/objArrayOop.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,4 +39,12 @@ inline oop objArrayOopDesc::obj_at(int index) const { } } +inline void objArrayOopDesc::obj_at_put(int index, oop value) { + if (UseCompressedOops) { + oop_store(obj_at_addr(index), value); + } else { + oop_store(obj_at_addr(index), value); + } +} + #endif // SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp index b096f3f45c5..e9d3693fb41 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,7 @@ #include "utilities/macros.hpp" #include "utilities/top.hpp" -// oopDesc is the top baseclass for objects classes. The {name}Desc classes describe +// oopDesc is the top baseclass for objects classes. The {name}Desc classes describe // the format of Java objects so the fields can be accessed from C++. // oopDesc is abstract. // (see oopHierarchy for complete oop class hierarchy) @@ -40,8 +40,8 @@ // no virtual functions allowed // store into oop with store check -template void oop_store(T* p, oop v); -template void oop_store(volatile T* p, oop v); +template inline void oop_store(T* p, oop v); +template inline void oop_store(volatile T* p, oop v); extern bool always_do_update_barrier; @@ -59,60 +59,60 @@ class ParCompactionManager; class oopDesc { friend class VMStructs; private: - volatile markOop _mark; + volatile markOop _mark; union _metadata { Klass* _klass; narrowKlass _compressed_klass; } _metadata; - // Fast access to barrier set. Must be initialized. + // Fast access to barrier set. Must be initialized. static BarrierSet* _bs; public: - markOop mark() const { return _mark; } - markOop* mark_addr() const { return (markOop*) &_mark; } + markOop mark() const { return _mark; } + markOop* mark_addr() const { return (markOop*) &_mark; } - void set_mark(volatile markOop m) { _mark = m; } + void set_mark(volatile markOop m) { _mark = m; } - void release_set_mark(markOop m); - markOop cas_set_mark(markOop new_mark, markOop old_mark); + inline void release_set_mark(markOop m); + inline markOop cas_set_mark(markOop new_mark, markOop old_mark); // Used only to re-initialize the mark word (e.g., of promoted // objects during a GC) -- requires a valid klass pointer - void init_mark(); + inline void init_mark(); - Klass* klass() const; - Klass* klass_or_null() const volatile; - Klass** klass_addr(); - narrowKlass* compressed_klass_addr(); + /*inline*/ Klass* klass() const; + inline Klass* klass_or_null() const volatile; + inline Klass** klass_addr(); + inline narrowKlass* compressed_klass_addr(); - void set_klass(Klass* k); + /*inline*/ void set_klass(Klass* k); // For klass field compression - int klass_gap() const; - void set_klass_gap(int z); + inline int klass_gap() const; + /*inline*/ void set_klass_gap(int z); // For when the klass pointer is being used as a linked list "next" field. - void set_klass_to_list_ptr(oop k); - oop list_ptr_from_klass(); + inline void set_klass_to_list_ptr(oop k); + inline oop list_ptr_from_klass(); // size of object header, aligned to platform wordSize - static int header_size() { return sizeof(oopDesc)/HeapWordSize; } + static int header_size() { return sizeof(oopDesc)/HeapWordSize; } // Returns whether this is an instance of k or an instance of a subclass of k - bool is_a(Klass* k) const; + inline bool is_a(Klass* k) const; // Returns the actual oop size of the object - int size(); + /*inline*/ int size(); // Sometimes (for complicated concurrency-related reasons), it is useful // to be able to figure out the size of an object knowing its klass. - int size_given_klass(Klass* klass); + inline int size_given_klass(Klass* klass); // type test operations (inlined in oop.inline.hpp) - bool is_instance() const; - bool is_array() const; - bool is_objArray() const; - bool is_typeArray() const; + inline bool is_instance() const; + /*inline*/ bool is_array() const; + inline bool is_objArray() const; + inline bool is_typeArray() const; // type test operations that don't require inclusion of oop.inline.hpp. bool is_instance_noinline() const; @@ -122,141 +122,142 @@ class oopDesc { private: // field addresses in oop - void* field_base(int offset) const; + inline void* field_base(int offset) const; - jbyte* byte_field_addr(int offset) const; - jchar* char_field_addr(int offset) const; - jboolean* bool_field_addr(int offset) const; - jint* int_field_addr(int offset) const; - jshort* short_field_addr(int offset) const; - jlong* long_field_addr(int offset) const; - jfloat* float_field_addr(int offset) const; - jdouble* double_field_addr(int offset) const; - Metadata** metadata_field_addr(int offset) const; + inline jbyte* byte_field_addr(int offset) const; + inline jchar* char_field_addr(int offset) const; + inline jboolean* bool_field_addr(int offset) const; + inline jint* int_field_addr(int offset) const; + inline jshort* short_field_addr(int offset) const; + inline jlong* long_field_addr(int offset) const; + inline jfloat* float_field_addr(int offset) const; + inline jdouble* double_field_addr(int offset) const; + inline Metadata** metadata_field_addr(int offset) const; public: // Need this as public for garbage collection. - template T* obj_field_addr(int offset) const; + template inline T* obj_field_addr(int offset) const; // Needed for javaClasses - address* address_field_addr(int offset) const; + inline address* address_field_addr(int offset) const; - static bool is_null(oop obj); - static bool is_null(narrowOop obj); + inline static bool is_null(oop obj) { return obj == NULL; } + inline static bool is_null(narrowOop obj) { return obj == 0; } // Decode an oop pointer from a narrowOop if compressed. // These are overloaded for oop and narrowOop as are the other functions // below so that they can be called in template functions. - static oop decode_heap_oop_not_null(oop v); - static oop decode_heap_oop_not_null(narrowOop v); - static oop decode_heap_oop(oop v); - static oop decode_heap_oop(narrowOop v); + static inline oop decode_heap_oop_not_null(oop v) { return v; } + static /*inline*/ oop decode_heap_oop_not_null(narrowOop v); + static inline oop decode_heap_oop(oop v) { return v; } + static /*inline*/ oop decode_heap_oop(narrowOop v); - // Encode an oop pointer to a narrow oop. The or_null versions accept + // Encode an oop pointer to a narrow oop. The or_null versions accept // null oop pointer, others do not in order to eliminate the // null checking branches. - static narrowOop encode_heap_oop_not_null(oop v); - static narrowOop encode_heap_oop(oop v); + static inline narrowOop encode_heap_oop_not_null(oop v); + static /*inline*/ narrowOop encode_heap_oop(oop v); - // Load an oop out of the Java heap - static narrowOop load_heap_oop(narrowOop* p); - static oop load_heap_oop(oop* p); + // Load an oop out of the Java heap as is without decoding. + // Called by GC to check for null before decoding. + static inline narrowOop load_heap_oop(narrowOop* p) { return *p; } + static inline oop load_heap_oop(oop* p) { return *p; } // Load an oop out of Java heap and decode it to an uncompressed oop. - static oop load_decode_heap_oop_not_null(narrowOop* p); - static oop load_decode_heap_oop_not_null(oop* p); - static oop load_decode_heap_oop(narrowOop* p); - static oop load_decode_heap_oop(oop* p); + static inline oop load_decode_heap_oop_not_null(narrowOop* p); + static inline oop load_decode_heap_oop_not_null(oop* p) { return *p; } + static inline oop load_decode_heap_oop(narrowOop* p); + static inline oop load_decode_heap_oop(oop* p) { return *p; } - // Store an oop into the heap. - static void store_heap_oop(narrowOop* p, narrowOop v); - static void store_heap_oop(oop* p, oop v); + // Store already encoded heap oop into the heap. + static inline void store_heap_oop(narrowOop* p, narrowOop v) { *p = v; } + static inline void store_heap_oop(oop* p, oop v) { *p = v; } // Encode oop if UseCompressedOops and store into the heap. - static void encode_store_heap_oop_not_null(narrowOop* p, oop v); - static void encode_store_heap_oop_not_null(oop* p, oop v); - static void encode_store_heap_oop(narrowOop* p, oop v); - static void encode_store_heap_oop(oop* p, oop v); + static inline void encode_store_heap_oop_not_null(narrowOop* p, oop v); + static inline void encode_store_heap_oop_not_null(oop* p, oop v) { *p = v; } + static inline void encode_store_heap_oop(narrowOop* p, oop v); + static inline void encode_store_heap_oop(oop* p, oop v) { *p = v; } - static void release_store_heap_oop(volatile narrowOop* p, narrowOop v); - static void release_store_heap_oop(volatile oop* p, oop v); + static inline void release_store_heap_oop(volatile narrowOop* p, narrowOop v); + static inline void release_store_heap_oop(volatile oop* p, oop v); - static void release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v); - static void release_encode_store_heap_oop_not_null(volatile oop* p, oop v); - static void release_encode_store_heap_oop(volatile narrowOop* p, oop v); - static void release_encode_store_heap_oop(volatile oop* p, oop v); + static inline void release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v); + static inline void release_encode_store_heap_oop_not_null(volatile oop* p, oop v); + static inline void release_encode_store_heap_oop(volatile narrowOop* p, oop v); + static inline void release_encode_store_heap_oop(volatile oop* p, oop v); - static oop atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest); - static oop atomic_compare_exchange_oop(oop exchange_value, - volatile HeapWord *dest, - oop compare_value, - bool prebarrier = false); + static inline oop atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest); + static inline oop atomic_compare_exchange_oop(oop exchange_value, + volatile HeapWord *dest, + oop compare_value, + bool prebarrier = false); // Access to fields in a instanceOop through these methods. - oop obj_field(int offset) const; - void obj_field_put(int offset, oop value); - void obj_field_put_raw(int offset, oop value); - void obj_field_put_volatile(int offset, oop value); + inline oop obj_field(int offset) const; + inline void obj_field_put(int offset, oop value); + inline void obj_field_put_raw(int offset, oop value); + inline void obj_field_put_volatile(int offset, oop value); - Metadata* metadata_field(int offset) const; - void metadata_field_put(int offset, Metadata* value); + inline Metadata* metadata_field(int offset) const; + inline void metadata_field_put(int offset, Metadata* value); - jbyte byte_field(int offset) const; - void byte_field_put(int offset, jbyte contents); + inline jbyte byte_field(int offset) const; + inline void byte_field_put(int offset, jbyte contents); - jchar char_field(int offset) const; - void char_field_put(int offset, jchar contents); + inline jchar char_field(int offset) const; + inline void char_field_put(int offset, jchar contents); - jboolean bool_field(int offset) const; - void bool_field_put(int offset, jboolean contents); + inline jboolean bool_field(int offset) const; + inline void bool_field_put(int offset, jboolean contents); - jint int_field(int offset) const; - void int_field_put(int offset, jint contents); + inline jint int_field(int offset) const; + inline void int_field_put(int offset, jint contents); - jshort short_field(int offset) const; - void short_field_put(int offset, jshort contents); + inline jshort short_field(int offset) const; + inline void short_field_put(int offset, jshort contents); - jlong long_field(int offset) const; - void long_field_put(int offset, jlong contents); + inline jlong long_field(int offset) const; + inline void long_field_put(int offset, jlong contents); - jfloat float_field(int offset) const; - void float_field_put(int offset, jfloat contents); + inline jfloat float_field(int offset) const; + inline void float_field_put(int offset, jfloat contents); - jdouble double_field(int offset) const; - void double_field_put(int offset, jdouble contents); + inline jdouble double_field(int offset) const; + inline void double_field_put(int offset, jdouble contents); - address address_field(int offset) const; - void address_field_put(int offset, address contents); + inline address address_field(int offset) const; + inline void address_field_put(int offset, address contents); - oop obj_field_acquire(int offset) const; - void release_obj_field_put(int offset, oop value); + inline oop obj_field_acquire(int offset) const; + inline void release_obj_field_put(int offset, oop value); - jbyte byte_field_acquire(int offset) const; - void release_byte_field_put(int offset, jbyte contents); + inline jbyte byte_field_acquire(int offset) const; + inline void release_byte_field_put(int offset, jbyte contents); - jchar char_field_acquire(int offset) const; - void release_char_field_put(int offset, jchar contents); + inline jchar char_field_acquire(int offset) const; + inline void release_char_field_put(int offset, jchar contents); - jboolean bool_field_acquire(int offset) const; - void release_bool_field_put(int offset, jboolean contents); + inline jboolean bool_field_acquire(int offset) const; + inline void release_bool_field_put(int offset, jboolean contents); - jint int_field_acquire(int offset) const; - void release_int_field_put(int offset, jint contents); + inline jint int_field_acquire(int offset) const; + inline void release_int_field_put(int offset, jint contents); - jshort short_field_acquire(int offset) const; - void release_short_field_put(int offset, jshort contents); + inline jshort short_field_acquire(int offset) const; + inline void release_short_field_put(int offset, jshort contents); - jlong long_field_acquire(int offset) const; - void release_long_field_put(int offset, jlong contents); + inline jlong long_field_acquire(int offset) const; + inline void release_long_field_put(int offset, jlong contents); - jfloat float_field_acquire(int offset) const; - void release_float_field_put(int offset, jfloat contents); + inline jfloat float_field_acquire(int offset) const; + inline void release_float_field_put(int offset, jfloat contents); - jdouble double_field_acquire(int offset) const; - void release_double_field_put(int offset, jdouble contents); + inline jdouble double_field_acquire(int offset) const; + inline void release_double_field_put(int offset, jdouble contents); - address address_field_acquire(int offset) const; - void release_address_field_put(int offset, address contents); + inline address address_field_acquire(int offset) const; + inline void release_address_field_put(int offset, address contents); // printing functions for VM debugging void print_on(outputStream* st) const; // First level print @@ -277,42 +278,41 @@ class oopDesc { void verify(); // locking operations - bool is_locked() const; - bool is_unlocked() const; - bool has_bias_pattern() const; + inline bool is_locked() const; + inline bool is_unlocked() const; + inline bool has_bias_pattern() const; // asserts - bool is_oop(bool ignore_mark_word = false) const; - bool is_oop_or_null(bool ignore_mark_word = false) const; + /*inline*/ bool is_oop(bool ignore_mark_word = false) const; + /*inline*/ bool is_oop_or_null(bool ignore_mark_word = false) const; #ifndef PRODUCT - bool is_unlocked_oop() const; + inline bool is_unlocked_oop() const; #endif // garbage collection - bool is_gc_marked() const; + inline bool is_gc_marked() const; - bool is_scavengable() const; + inline bool is_scavengable() const; // Forward pointer operations for scavenge - bool is_forwarded() const; + inline bool is_forwarded() const; - void forward_to(oop p); - bool cas_forward_to(oop p, markOop compare); + inline void forward_to(oop p); + inline bool cas_forward_to(oop p, markOop compare); #if INCLUDE_ALL_GCS // Like "forward_to", but inserts the forwarding pointer atomically. // Exactly one thread succeeds in inserting the forwarding pointer, and // this call returns "NULL" for that thread; any other thread has the // value of the forwarding pointer returned and does not modify "this". - oop forward_to_atomic(oop p); + inline oop forward_to_atomic(oop p); #endif // INCLUDE_ALL_GCS - oop forwardee() const; + inline oop forwardee() const; // Age of object during scavenge - uint age() const; - void incr_age(); - + /*inline*/ uint age() const; + inline void incr_age(); // mark-sweep support void follow_body(int begin, int end); @@ -325,28 +325,28 @@ class oopDesc { // Mark Sweep // Adjust all pointers in this object to point at it's forwarded location and - // return the size of this oop. This is used by the MarkSweep collector. - int ms_adjust_pointers(); + // return the size of this oop. This is used by the MarkSweep collector. + inline int ms_adjust_pointers(); #if INCLUDE_ALL_GCS // Parallel Compact - void pc_follow_contents(ParCompactionManager* pc); - void pc_update_contents(); + inline void pc_follow_contents(ParCompactionManager* pc); + inline void pc_update_contents(); // Parallel Scavenge - void ps_push_contents(PSPromotionManager* pm); + inline void ps_push_contents(PSPromotionManager* pm); #endif // iterators, returns size of object #define OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ - void oop_iterate(OopClosureType* blk); \ - void oop_iterate(OopClosureType* blk, MemRegion mr); // Only in mr. + inline void oop_iterate(OopClosureType* blk); \ + inline void oop_iterate(OopClosureType* blk, MemRegion mr); // Only in mr. ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_DECL) -#define OOP_ITERATE_SIZE_DECL(OopClosureType, nv_suffix) \ - int oop_iterate_size(OopClosureType* blk); \ - int oop_iterate_size(OopClosureType* blk, MemRegion mr); // Only in mr. +#define OOP_ITERATE_SIZE_DECL(OopClosureType, nv_suffix) \ + inline int oop_iterate_size(OopClosureType* blk); \ + inline int oop_iterate_size(OopClosureType* blk, MemRegion mr); // Only in mr. ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_SIZE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_SIZE_DECL) @@ -355,28 +355,29 @@ class oopDesc { #if INCLUDE_ALL_GCS #define OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ - void oop_iterate_backwards(OopClosureType* blk); + inline void oop_iterate_backwards(OopClosureType* blk); ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_BACKWARDS_DECL) -#endif - int oop_iterate_no_header(OopClosure* bk); - int oop_iterate_no_header(OopClosure* bk, MemRegion mr); +#endif // INCLUDE_ALL_GCS + + inline int oop_iterate_no_header(OopClosure* bk); + inline int oop_iterate_no_header(OopClosure* bk, MemRegion mr); // identity hash; returns the identity hash key (computes it if necessary) // NOTE with the introduction of UseBiasedLocking that identity_hash() might reach a // safepoint if called on a biased object. Calling code must be aware of that. - intptr_t identity_hash(); + inline intptr_t identity_hash(); intptr_t slow_identity_hash(); // Alternate hashing code if string table is rehashed unsigned int new_hash(juint seed); // marks are forwarded to stack when object is locked - bool has_displaced_mark() const; - markOop displaced_mark() const; - void set_displaced_mark(markOop m); + inline bool has_displaced_mark() const; + inline markOop displaced_mark() const; + inline void set_displaced_mark(markOop m); static bool has_klass_gap(); diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index bc480f49dea..32b87fa1edd 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,17 +41,65 @@ #include "runtime/os.hpp" #include "utilities/macros.hpp" +inline void update_barrier_set(void* p, oop v, bool release = false) { + assert(oopDesc::bs() != NULL, "Uninitialized bs in oop!"); + oopDesc::bs()->write_ref_field(p, v, release); +} + +template inline void update_barrier_set_pre(T* p, oop v) { + oopDesc::bs()->write_ref_field_pre(p, v); +} + +template void oop_store(T* p, oop v) { + if (always_do_update_barrier) { + oop_store((volatile T*)p, v); + } else { + update_barrier_set_pre(p, v); + oopDesc::encode_store_heap_oop(p, v); + // always_do_update_barrier == false => + // Either we are at a safepoint (in GC) or CMS is not used. In both + // cases it's unnecessary to mark the card as dirty with release sematics. + update_barrier_set((void*)p, v, false /* release */); // cast away type + } +} + +template void oop_store(volatile T* p, oop v) { + update_barrier_set_pre((T*)p, v); // cast away volatile + // Used by release_obj_field_put, so use release_store_ptr. + oopDesc::release_encode_store_heap_oop(p, v); + // When using CMS we must mark the card corresponding to p as dirty + // with release sematics to prevent that CMS sees the dirty card but + // not the new value v at p due to reordering of the two + // stores. Note that CMS has a concurrent precleaning phase, where + // it reads the card table while the Java threads are running. + update_barrier_set((void*)p, v, true /* release */); // cast away type +} + +// Should replace *addr = oop assignments where addr type depends on UseCompressedOops +// (without having to remember the function name this calls). +inline void oop_store_raw(HeapWord* addr, oop value) { + if (UseCompressedOops) { + oopDesc::encode_store_heap_oop((narrowOop*)addr, value); + } else { + oopDesc::encode_store_heap_oop((oop*)addr, value); + } +} + // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references -inline void oopDesc::release_set_mark(markOop m) { +void oopDesc::release_set_mark(markOop m) { OrderAccess::release_store_ptr(&_mark, m); } -inline markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) { +markOop oopDesc::cas_set_mark(markOop new_mark, markOop old_mark) { return (markOop) Atomic::cmpxchg_ptr(new_mark, &_mark, old_mark); } +void oopDesc::init_mark() { + set_mark(markOopDesc::prototype_for_object(this)); +} + inline Klass* oopDesc::klass() const { if (UseCompressedClassPointers) { return Klass::decode_klass_not_null(_metadata._compressed_klass); @@ -60,7 +108,7 @@ inline Klass* oopDesc::klass() const { } } -inline Klass* oopDesc::klass_or_null() const volatile { +Klass* oopDesc::klass_or_null() const volatile { // can be NULL in CMS if (UseCompressedClassPointers) { return Klass::decode_klass(_metadata._compressed_klass); @@ -69,14 +117,14 @@ inline Klass* oopDesc::klass_or_null() const volatile { } } -inline Klass** oopDesc::klass_addr() { +Klass** oopDesc::klass_addr() { // Only used internally and with CMS and will not work with // UseCompressedOops assert(!UseCompressedClassPointers, "only supported with uncompressed klass pointers"); return (Klass**) &_metadata._klass; } -inline narrowKlass* oopDesc::compressed_klass_addr() { +narrowKlass* oopDesc::compressed_klass_addr() { assert(UseCompressedClassPointers, "only called by compressed klass pointers"); return &_metadata._compressed_klass; } @@ -92,7 +140,7 @@ inline void oopDesc::set_klass(Klass* k) { } } -inline int oopDesc::klass_gap() const { +int oopDesc::klass_gap() const { return *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()); } @@ -102,7 +150,7 @@ inline void oopDesc::set_klass_gap(int v) { } } -inline void oopDesc::set_klass_to_list_ptr(oop k) { +void oopDesc::set_klass_to_list_ptr(oop k) { // This is only to be used during GC, for from-space objects, so no // barrier is needed. if (UseCompressedClassPointers) { @@ -112,7 +160,7 @@ inline void oopDesc::set_klass_to_list_ptr(oop k) { } } -inline oop oopDesc::list_ptr_from_klass() { +oop oopDesc::list_ptr_from_klass() { // This is only to be used during GC, for from-space objects. if (UseCompressedClassPointers) { return decode_heap_oop((narrowOop)_metadata._compressed_klass); @@ -122,261 +170,15 @@ inline oop oopDesc::list_ptr_from_klass() { } } -inline void oopDesc::init_mark() { set_mark(markOopDesc::prototype_for_object(this)); } - -inline bool oopDesc::is_a(Klass* k) const { return klass()->is_subtype_of(k); } - -inline bool oopDesc::is_instance() const { - return klass()->is_instance_klass(); +bool oopDesc::is_a(Klass* k) const { + return klass()->is_subtype_of(k); } -inline bool oopDesc::is_array() const { return klass()->is_array_klass(); } -inline bool oopDesc::is_objArray() const { return klass()->is_objArray_klass(); } -inline bool oopDesc::is_typeArray() const { return klass()->is_typeArray_klass(); } - -inline void* oopDesc::field_base(int offset) const { return (void*)&((char*)this)[offset]; } - -template inline T* oopDesc::obj_field_addr(int offset) const { return (T*)field_base(offset); } -inline Metadata** oopDesc::metadata_field_addr(int offset) const { return (Metadata**)field_base(offset); } -inline jbyte* oopDesc::byte_field_addr(int offset) const { return (jbyte*) field_base(offset); } -inline jchar* oopDesc::char_field_addr(int offset) const { return (jchar*) field_base(offset); } -inline jboolean* oopDesc::bool_field_addr(int offset) const { return (jboolean*)field_base(offset); } -inline jint* oopDesc::int_field_addr(int offset) const { return (jint*) field_base(offset); } -inline jshort* oopDesc::short_field_addr(int offset) const { return (jshort*) field_base(offset); } -inline jlong* oopDesc::long_field_addr(int offset) const { return (jlong*) field_base(offset); } -inline jfloat* oopDesc::float_field_addr(int offset) const { return (jfloat*) field_base(offset); } -inline jdouble* oopDesc::double_field_addr(int offset) const { return (jdouble*) field_base(offset); } -inline address* oopDesc::address_field_addr(int offset) const { return (address*) field_base(offset); } - - -// Functions for getting and setting oops within instance objects. -// If the oops are compressed, the type passed to these overloaded functions -// is narrowOop. All functions are overloaded so they can be called by -// template functions without conditionals (the compiler instantiates via -// the right type and inlines the appopriate code). - -inline bool oopDesc::is_null(oop obj) { return obj == NULL; } -inline bool oopDesc::is_null(narrowOop obj) { return obj == 0; } - -// Algorithm for encoding and decoding oops from 64 bit pointers to 32 bit -// offset from the heap base. Saving the check for null can save instructions -// in inner GC loops so these are separated. - -inline bool check_obj_alignment(oop obj) { - return cast_from_oop(obj) % MinObjAlignmentInBytes == 0; +inline int oopDesc::size() { + return size_given_klass(klass()); } -inline narrowOop oopDesc::encode_heap_oop_not_null(oop v) { - assert(!is_null(v), "oop value can never be zero"); - assert(check_obj_alignment(v), "Address not aligned"); - assert(Universe::heap()->is_in_reserved(v), "Address not in heap"); - address base = Universe::narrow_oop_base(); - int shift = Universe::narrow_oop_shift(); - uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base, 1)); - assert(OopEncodingHeapMax > pd, "change encoding max if new encoding"); - uint64_t result = pd >> shift; - assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow"); - assert(decode_heap_oop(result) == v, "reversibility"); - return (narrowOop)result; -} - -inline narrowOop oopDesc::encode_heap_oop(oop v) { - return (is_null(v)) ? (narrowOop)0 : encode_heap_oop_not_null(v); -} - -inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) { - assert(!is_null(v), "narrow oop value can never be zero"); - address base = Universe::narrow_oop_base(); - int shift = Universe::narrow_oop_shift(); - oop result = (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift)); - assert(check_obj_alignment(result), "address not aligned: " INTPTR_FORMAT, p2i((void*) result)); - return result; -} - -inline oop oopDesc::decode_heap_oop(narrowOop v) { - return is_null(v) ? (oop)NULL : decode_heap_oop_not_null(v); -} - -inline oop oopDesc::decode_heap_oop_not_null(oop v) { return v; } -inline oop oopDesc::decode_heap_oop(oop v) { return v; } - -// Load an oop out of the Java heap as is without decoding. -// Called by GC to check for null before decoding. -inline oop oopDesc::load_heap_oop(oop* p) { return *p; } -inline narrowOop oopDesc::load_heap_oop(narrowOop* p) { return *p; } - -// Load and decode an oop out of the Java heap into a wide oop. -inline oop oopDesc::load_decode_heap_oop_not_null(oop* p) { return *p; } -inline oop oopDesc::load_decode_heap_oop_not_null(narrowOop* p) { - return decode_heap_oop_not_null(*p); -} - -// Load and decode an oop out of the heap accepting null -inline oop oopDesc::load_decode_heap_oop(oop* p) { return *p; } -inline oop oopDesc::load_decode_heap_oop(narrowOop* p) { - return decode_heap_oop(*p); -} - -// Store already encoded heap oop into the heap. -inline void oopDesc::store_heap_oop(oop* p, oop v) { *p = v; } -inline void oopDesc::store_heap_oop(narrowOop* p, narrowOop v) { *p = v; } - -// Encode and store a heap oop. -inline void oopDesc::encode_store_heap_oop_not_null(narrowOop* p, oop v) { - *p = encode_heap_oop_not_null(v); -} -inline void oopDesc::encode_store_heap_oop_not_null(oop* p, oop v) { *p = v; } - -// Encode and store a heap oop allowing for null. -inline void oopDesc::encode_store_heap_oop(narrowOop* p, oop v) { - *p = encode_heap_oop(v); -} -inline void oopDesc::encode_store_heap_oop(oop* p, oop v) { *p = v; } - -// Store heap oop as is for volatile fields. -inline void oopDesc::release_store_heap_oop(volatile oop* p, oop v) { - OrderAccess::release_store_ptr(p, v); -} -inline void oopDesc::release_store_heap_oop(volatile narrowOop* p, - narrowOop v) { - OrderAccess::release_store(p, v); -} - -inline void oopDesc::release_encode_store_heap_oop_not_null( - volatile narrowOop* p, oop v) { - // heap oop is not pointer sized. - OrderAccess::release_store(p, encode_heap_oop_not_null(v)); -} - -inline void oopDesc::release_encode_store_heap_oop_not_null( - volatile oop* p, oop v) { - OrderAccess::release_store_ptr(p, v); -} - -inline void oopDesc::release_encode_store_heap_oop(volatile oop* p, - oop v) { - OrderAccess::release_store_ptr(p, v); -} -inline void oopDesc::release_encode_store_heap_oop( - volatile narrowOop* p, oop v) { - OrderAccess::release_store(p, encode_heap_oop(v)); -} - - -// These functions are only used to exchange oop fields in instances, -// not headers. -inline oop oopDesc::atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest) { - if (UseCompressedOops) { - // encode exchange value from oop to T - narrowOop val = encode_heap_oop(exchange_value); - narrowOop old = (narrowOop)Atomic::xchg(val, (narrowOop*)dest); - // decode old from T to oop - return decode_heap_oop(old); - } else { - return (oop)Atomic::xchg_ptr(exchange_value, (oop*)dest); - } -} - -// In order to put or get a field out of an instance, must first check -// if the field has been compressed and uncompress it. -inline oop oopDesc::obj_field(int offset) const { - return UseCompressedOops ? - load_decode_heap_oop(obj_field_addr(offset)) : - load_decode_heap_oop(obj_field_addr(offset)); -} - -inline void oopDesc::obj_field_put(int offset, oop value) { - UseCompressedOops ? oop_store(obj_field_addr(offset), value) : - oop_store(obj_field_addr(offset), value); -} - -inline Metadata* oopDesc::metadata_field(int offset) const { - return *metadata_field_addr(offset); -} - -inline void oopDesc::metadata_field_put(int offset, Metadata* value) { - *metadata_field_addr(offset) = value; -} - -inline void oopDesc::obj_field_put_raw(int offset, oop value) { - UseCompressedOops ? - encode_store_heap_oop(obj_field_addr(offset), value) : - encode_store_heap_oop(obj_field_addr(offset), value); -} -inline void oopDesc::obj_field_put_volatile(int offset, oop value) { - OrderAccess::release(); - obj_field_put(offset, value); - OrderAccess::fence(); -} - -inline jbyte oopDesc::byte_field(int offset) const { return (jbyte) *byte_field_addr(offset); } -inline void oopDesc::byte_field_put(int offset, jbyte contents) { *byte_field_addr(offset) = (jint) contents; } - -inline jboolean oopDesc::bool_field(int offset) const { return (jboolean) *bool_field_addr(offset); } -inline void oopDesc::bool_field_put(int offset, jboolean contents) { *bool_field_addr(offset) = (jint) contents; } - -inline jchar oopDesc::char_field(int offset) const { return (jchar) *char_field_addr(offset); } -inline void oopDesc::char_field_put(int offset, jchar contents) { *char_field_addr(offset) = (jint) contents; } - -inline jint oopDesc::int_field(int offset) const { return *int_field_addr(offset); } -inline void oopDesc::int_field_put(int offset, jint contents) { *int_field_addr(offset) = contents; } - -inline jshort oopDesc::short_field(int offset) const { return (jshort) *short_field_addr(offset); } -inline void oopDesc::short_field_put(int offset, jshort contents) { *short_field_addr(offset) = (jint) contents;} - -inline jlong oopDesc::long_field(int offset) const { return *long_field_addr(offset); } -inline void oopDesc::long_field_put(int offset, jlong contents) { *long_field_addr(offset) = contents; } - -inline jfloat oopDesc::float_field(int offset) const { return *float_field_addr(offset); } -inline void oopDesc::float_field_put(int offset, jfloat contents) { *float_field_addr(offset) = contents; } - -inline jdouble oopDesc::double_field(int offset) const { return *double_field_addr(offset); } -inline void oopDesc::double_field_put(int offset, jdouble contents) { *double_field_addr(offset) = contents; } - -inline address oopDesc::address_field(int offset) const { return *address_field_addr(offset); } -inline void oopDesc::address_field_put(int offset, address contents) { *address_field_addr(offset) = contents; } - -inline oop oopDesc::obj_field_acquire(int offset) const { - return UseCompressedOops ? - decode_heap_oop((narrowOop) - OrderAccess::load_acquire(obj_field_addr(offset))) - : decode_heap_oop((oop) - OrderAccess::load_ptr_acquire(obj_field_addr(offset))); -} -inline void oopDesc::release_obj_field_put(int offset, oop value) { - UseCompressedOops ? - oop_store((volatile narrowOop*)obj_field_addr(offset), value) : - oop_store((volatile oop*) obj_field_addr(offset), value); -} - -inline jbyte oopDesc::byte_field_acquire(int offset) const { return OrderAccess::load_acquire(byte_field_addr(offset)); } -inline void oopDesc::release_byte_field_put(int offset, jbyte contents) { OrderAccess::release_store(byte_field_addr(offset), contents); } - -inline jboolean oopDesc::bool_field_acquire(int offset) const { return OrderAccess::load_acquire(bool_field_addr(offset)); } -inline void oopDesc::release_bool_field_put(int offset, jboolean contents) { OrderAccess::release_store(bool_field_addr(offset), contents); } - -inline jchar oopDesc::char_field_acquire(int offset) const { return OrderAccess::load_acquire(char_field_addr(offset)); } -inline void oopDesc::release_char_field_put(int offset, jchar contents) { OrderAccess::release_store(char_field_addr(offset), contents); } - -inline jint oopDesc::int_field_acquire(int offset) const { return OrderAccess::load_acquire(int_field_addr(offset)); } -inline void oopDesc::release_int_field_put(int offset, jint contents) { OrderAccess::release_store(int_field_addr(offset), contents); } - -inline jshort oopDesc::short_field_acquire(int offset) const { return (jshort)OrderAccess::load_acquire(short_field_addr(offset)); } -inline void oopDesc::release_short_field_put(int offset, jshort contents) { OrderAccess::release_store(short_field_addr(offset), contents); } - -inline jlong oopDesc::long_field_acquire(int offset) const { return OrderAccess::load_acquire(long_field_addr(offset)); } -inline void oopDesc::release_long_field_put(int offset, jlong contents) { OrderAccess::release_store(long_field_addr(offset), contents); } - -inline jfloat oopDesc::float_field_acquire(int offset) const { return OrderAccess::load_acquire(float_field_addr(offset)); } -inline void oopDesc::release_float_field_put(int offset, jfloat contents) { OrderAccess::release_store(float_field_addr(offset), contents); } - -inline jdouble oopDesc::double_field_acquire(int offset) const { return OrderAccess::load_acquire(double_field_addr(offset)); } -inline void oopDesc::release_double_field_put(int offset, jdouble contents) { OrderAccess::release_store(double_field_addr(offset), contents); } - -inline address oopDesc::address_field_acquire(int offset) const { return (address) OrderAccess::load_ptr_acquire(address_field_addr(offset)); } -inline void oopDesc::release_address_field_put(int offset, address contents) { OrderAccess::release_store_ptr(address_field_addr(offset), contents); } - -inline int oopDesc::size_given_klass(Klass* klass) { +int oopDesc::size_given_klass(Klass* klass) { int lh = klass->layout_helper(); int s; @@ -461,59 +263,133 @@ inline int oopDesc::size_given_klass(Klass* klass) { return s; } +bool oopDesc::is_instance() const { return klass()->is_instance_klass(); } +inline bool oopDesc::is_array() const { return klass()->is_array_klass(); } +bool oopDesc::is_objArray() const { return klass()->is_objArray_klass(); } +bool oopDesc::is_typeArray() const { return klass()->is_typeArray_klass(); } -inline int oopDesc::size() { - return size_given_klass(klass()); +void* oopDesc::field_base(int offset) const { return (void*)&((char*)this)[offset]; } + +jbyte* oopDesc::byte_field_addr(int offset) const { return (jbyte*) field_base(offset); } +jchar* oopDesc::char_field_addr(int offset) const { return (jchar*) field_base(offset); } +jboolean* oopDesc::bool_field_addr(int offset) const { return (jboolean*) field_base(offset); } +jint* oopDesc::int_field_addr(int offset) const { return (jint*) field_base(offset); } +jshort* oopDesc::short_field_addr(int offset) const { return (jshort*) field_base(offset); } +jlong* oopDesc::long_field_addr(int offset) const { return (jlong*) field_base(offset); } +jfloat* oopDesc::float_field_addr(int offset) const { return (jfloat*) field_base(offset); } +jdouble* oopDesc::double_field_addr(int offset) const { return (jdouble*) field_base(offset); } +Metadata** oopDesc::metadata_field_addr(int offset) const { return (Metadata**)field_base(offset); } + +template T* oopDesc::obj_field_addr(int offset) const { return (T*) field_base(offset); } +address* oopDesc::address_field_addr(int offset) const { return (address*) field_base(offset); } + + +// Functions for getting and setting oops within instance objects. +// If the oops are compressed, the type passed to these overloaded functions +// is narrowOop. All functions are overloaded so they can be called by +// template functions without conditionals (the compiler instantiates via +// the right type and inlines the appopriate code). + +// Algorithm for encoding and decoding oops from 64 bit pointers to 32 bit +// offset from the heap base. Saving the check for null can save instructions +// in inner GC loops so these are separated. + +inline bool check_obj_alignment(oop obj) { + return cast_from_oop(obj) % MinObjAlignmentInBytes == 0; } -inline void update_barrier_set(void* p, oop v, bool release = false) { - assert(oopDesc::bs() != NULL, "Uninitialized bs in oop!"); - oopDesc::bs()->write_ref_field(p, v, release); +inline oop oopDesc::decode_heap_oop_not_null(narrowOop v) { + assert(!is_null(v), "narrow oop value can never be zero"); + address base = Universe::narrow_oop_base(); + int shift = Universe::narrow_oop_shift(); + oop result = (oop)(void*)((uintptr_t)base + ((uintptr_t)v << shift)); + assert(check_obj_alignment(result), "address not aligned: " INTPTR_FORMAT, p2i((void*) result)); + return result; } -template inline void update_barrier_set_pre(T* p, oop v) { - oopDesc::bs()->write_ref_field_pre(p, v); +inline oop oopDesc::decode_heap_oop(narrowOop v) { + return is_null(v) ? (oop)NULL : decode_heap_oop_not_null(v); } -template inline void oop_store(T* p, oop v) { - if (always_do_update_barrier) { - oop_store((volatile T*)p, v); - } else { - update_barrier_set_pre(p, v); - oopDesc::encode_store_heap_oop(p, v); - // always_do_update_barrier == false => - // Either we are at a safepoint (in GC) or CMS is not used. In both - // cases it's unnecessary to mark the card as dirty with release sematics. - update_barrier_set((void*)p, v, false /* release */); // cast away type - } +narrowOop oopDesc::encode_heap_oop_not_null(oop v) { + assert(!is_null(v), "oop value can never be zero"); + assert(check_obj_alignment(v), "Address not aligned"); + assert(Universe::heap()->is_in_reserved(v), "Address not in heap"); + address base = Universe::narrow_oop_base(); + int shift = Universe::narrow_oop_shift(); + uint64_t pd = (uint64_t)(pointer_delta((void*)v, (void*)base, 1)); + assert(OopEncodingHeapMax > pd, "change encoding max if new encoding"); + uint64_t result = pd >> shift; + assert((result & CONST64(0xffffffff00000000)) == 0, "narrow oop overflow"); + assert(decode_heap_oop(result) == v, "reversibility"); + return (narrowOop)result; } -template inline void oop_store(volatile T* p, oop v) { - update_barrier_set_pre((T*)p, v); // cast away volatile - // Used by release_obj_field_put, so use release_store_ptr. - oopDesc::release_encode_store_heap_oop(p, v); - // When using CMS we must mark the card corresponding to p as dirty - // with release sematics to prevent that CMS sees the dirty card but - // not the new value v at p due to reordering of the two - // stores. Note that CMS has a concurrent precleaning phase, where - // it reads the card table while the Java threads are running. - update_barrier_set((void*)p, v, true /* release */); // cast away type +inline narrowOop oopDesc::encode_heap_oop(oop v) { + return (is_null(v)) ? (narrowOop)0 : encode_heap_oop_not_null(v); } -// Should replace *addr = oop assignments where addr type depends on UseCompressedOops -// (without having to remember the function name this calls). -inline void oop_store_raw(HeapWord* addr, oop value) { +// Load and decode an oop out of the Java heap into a wide oop. +oop oopDesc::load_decode_heap_oop_not_null(narrowOop* p) { + return decode_heap_oop_not_null(*p); +} + +// Load and decode an oop out of the heap accepting null +oop oopDesc::load_decode_heap_oop(narrowOop* p) { + return decode_heap_oop(*p); +} + +// Encode and store a heap oop. +void oopDesc::encode_store_heap_oop_not_null(narrowOop* p, oop v) { + *p = encode_heap_oop_not_null(v); +} + +// Encode and store a heap oop allowing for null. +void oopDesc::encode_store_heap_oop(narrowOop* p, oop v) { + *p = encode_heap_oop(v); +} + +// Store heap oop as is for volatile fields. +void oopDesc::release_store_heap_oop(volatile oop* p, oop v) { + OrderAccess::release_store_ptr(p, v); +} +void oopDesc::release_store_heap_oop(volatile narrowOop* p, narrowOop v) { + OrderAccess::release_store(p, v); +} + +void oopDesc::release_encode_store_heap_oop_not_null(volatile narrowOop* p, oop v) { + // heap oop is not pointer sized. + OrderAccess::release_store(p, encode_heap_oop_not_null(v)); +} +void oopDesc::release_encode_store_heap_oop_not_null(volatile oop* p, oop v) { + OrderAccess::release_store_ptr(p, v); +} + +void oopDesc::release_encode_store_heap_oop(volatile oop* p, oop v) { + OrderAccess::release_store_ptr(p, v); +} +void oopDesc::release_encode_store_heap_oop(volatile narrowOop* p, oop v) { + OrderAccess::release_store(p, encode_heap_oop(v)); +} + +// These functions are only used to exchange oop fields in instances, +// not headers. +oop oopDesc::atomic_exchange_oop(oop exchange_value, volatile HeapWord *dest) { if (UseCompressedOops) { - oopDesc::encode_store_heap_oop((narrowOop*)addr, value); + // encode exchange value from oop to T + narrowOop val = encode_heap_oop(exchange_value); + narrowOop old = (narrowOop)Atomic::xchg(val, (narrowOop*)dest); + // decode old from T to oop + return decode_heap_oop(old); } else { - oopDesc::encode_store_heap_oop((oop*)addr, value); + return (oop)Atomic::xchg_ptr(exchange_value, (oop*)dest); } } -inline oop oopDesc::atomic_compare_exchange_oop(oop exchange_value, - volatile HeapWord *dest, - oop compare_value, - bool prebarrier) { +oop oopDesc::atomic_compare_exchange_oop(oop exchange_value, + volatile HeapWord *dest, + oop compare_value, + bool prebarrier) { if (UseCompressedOops) { if (prebarrier) { update_barrier_set_pre((narrowOop*)dest, exchange_value); @@ -533,24 +409,112 @@ inline oop oopDesc::atomic_compare_exchange_oop(oop exchange_value, } } -// Used only for markSweep, scavenging -inline bool oopDesc::is_gc_marked() const { - return mark()->is_marked(); +// In order to put or get a field out of an instance, must first check +// if the field has been compressed and uncompress it. +oop oopDesc::obj_field(int offset) const { + return UseCompressedOops ? + load_decode_heap_oop(obj_field_addr(offset)) : + load_decode_heap_oop(obj_field_addr(offset)); } -inline bool oopDesc::is_locked() const { +void oopDesc::obj_field_put(int offset, oop value) { + UseCompressedOops ? oop_store(obj_field_addr(offset), value) : + oop_store(obj_field_addr(offset), value); +} + +void oopDesc::obj_field_put_raw(int offset, oop value) { + UseCompressedOops ? + encode_store_heap_oop(obj_field_addr(offset), value) : + encode_store_heap_oop(obj_field_addr(offset), value); +} +void oopDesc::obj_field_put_volatile(int offset, oop value) { + OrderAccess::release(); + obj_field_put(offset, value); + OrderAccess::fence(); +} + +Metadata* oopDesc::metadata_field(int offset) const { return *metadata_field_addr(offset); } +void oopDesc::metadata_field_put(int offset, Metadata* value) { *metadata_field_addr(offset) = value; } + +jbyte oopDesc::byte_field(int offset) const { return (jbyte) *byte_field_addr(offset); } +void oopDesc::byte_field_put(int offset, jbyte contents) { *byte_field_addr(offset) = (jint) contents; } + +jchar oopDesc::char_field(int offset) const { return (jchar) *char_field_addr(offset); } +void oopDesc::char_field_put(int offset, jchar contents) { *char_field_addr(offset) = (jint) contents; } + +jboolean oopDesc::bool_field(int offset) const { return (jboolean) *bool_field_addr(offset); } +void oopDesc::bool_field_put(int offset, jboolean contents) { *bool_field_addr(offset) = (jint) contents; } + +jint oopDesc::int_field(int offset) const { return *int_field_addr(offset); } +void oopDesc::int_field_put(int offset, jint contents) { *int_field_addr(offset) = contents; } + +jshort oopDesc::short_field(int offset) const { return (jshort) *short_field_addr(offset); } +void oopDesc::short_field_put(int offset, jshort contents) { *short_field_addr(offset) = (jint) contents;} + +jlong oopDesc::long_field(int offset) const { return *long_field_addr(offset); } +void oopDesc::long_field_put(int offset, jlong contents) { *long_field_addr(offset) = contents; } + +jfloat oopDesc::float_field(int offset) const { return *float_field_addr(offset); } +void oopDesc::float_field_put(int offset, jfloat contents) { *float_field_addr(offset) = contents; } + +jdouble oopDesc::double_field(int offset) const { return *double_field_addr(offset); } +void oopDesc::double_field_put(int offset, jdouble contents) { *double_field_addr(offset) = contents; } + +address oopDesc::address_field(int offset) const { return *address_field_addr(offset); } +void oopDesc::address_field_put(int offset, address contents) { *address_field_addr(offset) = contents; } + +oop oopDesc::obj_field_acquire(int offset) const { + return UseCompressedOops ? + decode_heap_oop((narrowOop) + OrderAccess::load_acquire(obj_field_addr(offset))) + : decode_heap_oop((oop) + OrderAccess::load_ptr_acquire(obj_field_addr(offset))); +} +void oopDesc::release_obj_field_put(int offset, oop value) { + UseCompressedOops ? + oop_store((volatile narrowOop*)obj_field_addr(offset), value) : + oop_store((volatile oop*) obj_field_addr(offset), value); +} + +jbyte oopDesc::byte_field_acquire(int offset) const { return OrderAccess::load_acquire(byte_field_addr(offset)); } +void oopDesc::release_byte_field_put(int offset, jbyte contents) { OrderAccess::release_store(byte_field_addr(offset), contents); } + +jchar oopDesc::char_field_acquire(int offset) const { return OrderAccess::load_acquire(char_field_addr(offset)); } +void oopDesc::release_char_field_put(int offset, jchar contents) { OrderAccess::release_store(char_field_addr(offset), contents); } + +jboolean oopDesc::bool_field_acquire(int offset) const { return OrderAccess::load_acquire(bool_field_addr(offset)); } +void oopDesc::release_bool_field_put(int offset, jboolean contents) { OrderAccess::release_store(bool_field_addr(offset), contents); } + +jint oopDesc::int_field_acquire(int offset) const { return OrderAccess::load_acquire(int_field_addr(offset)); } +void oopDesc::release_int_field_put(int offset, jint contents) { OrderAccess::release_store(int_field_addr(offset), contents); } + +jshort oopDesc::short_field_acquire(int offset) const { return (jshort)OrderAccess::load_acquire(short_field_addr(offset)); } +void oopDesc::release_short_field_put(int offset, jshort contents) { OrderAccess::release_store(short_field_addr(offset), contents); } + +jlong oopDesc::long_field_acquire(int offset) const { return OrderAccess::load_acquire(long_field_addr(offset)); } +void oopDesc::release_long_field_put(int offset, jlong contents) { OrderAccess::release_store(long_field_addr(offset), contents); } + +jfloat oopDesc::float_field_acquire(int offset) const { return OrderAccess::load_acquire(float_field_addr(offset)); } +void oopDesc::release_float_field_put(int offset, jfloat contents) { OrderAccess::release_store(float_field_addr(offset), contents); } + +jdouble oopDesc::double_field_acquire(int offset) const { return OrderAccess::load_acquire(double_field_addr(offset)); } +void oopDesc::release_double_field_put(int offset, jdouble contents) { OrderAccess::release_store(double_field_addr(offset), contents); } + +address oopDesc::address_field_acquire(int offset) const { return (address) OrderAccess::load_ptr_acquire(address_field_addr(offset)); } +void oopDesc::release_address_field_put(int offset, address contents) { OrderAccess::release_store_ptr(address_field_addr(offset), contents); } + +bool oopDesc::is_locked() const { return mark()->is_locked(); } -inline bool oopDesc::is_unlocked() const { +bool oopDesc::is_unlocked() const { return mark()->is_unlocked(); } -inline bool oopDesc::has_bias_pattern() const { +bool oopDesc::has_bias_pattern() const { return mark()->has_bias_pattern(); } - // used only for asserts inline bool oopDesc::is_oop(bool ignore_mark_word) const { oop obj = (oop) this; @@ -580,25 +544,30 @@ inline bool oopDesc::is_oop_or_null(bool ignore_mark_word) const { #ifndef PRODUCT // used only for asserts -inline bool oopDesc::is_unlocked_oop() const { +bool oopDesc::is_unlocked_oop() const { if (!Universe::heap()->is_in_reserved(this)) return false; return mark()->is_unlocked(); } #endif // PRODUCT -inline bool oopDesc::is_scavengable() const { +// Used only for markSweep, scavenging +bool oopDesc::is_gc_marked() const { + return mark()->is_marked(); +} + +bool oopDesc::is_scavengable() const { return Universe::heap()->is_scavengable(this); } // Used by scavengers -inline bool oopDesc::is_forwarded() const { +bool oopDesc::is_forwarded() const { // The extra heap check is needed since the obj might be locked, in which case the // mark would point to a stack location and have the sentinel bit cleared return mark()->is_marked(); } // Used by scavengers -inline void oopDesc::forward_to(oop p) { +void oopDesc::forward_to(oop p) { assert(check_obj_alignment(p), "forwarding to something not aligned"); assert(Universe::heap()->is_in_reserved(p), @@ -609,7 +578,7 @@ inline void oopDesc::forward_to(oop p) { } // Used by parallel scavengers -inline bool oopDesc::cas_forward_to(oop p, markOop compare) { +bool oopDesc::cas_forward_to(oop p, markOop compare) { assert(check_obj_alignment(p), "forwarding to something not aligned"); assert(Universe::heap()->is_in_reserved(p), @@ -620,7 +589,7 @@ inline bool oopDesc::cas_forward_to(oop p, markOop compare) { } #if INCLUDE_ALL_GCS -inline oop oopDesc::forward_to_atomic(oop p) { +oop oopDesc::forward_to_atomic(oop p) { markOop oldMark = mark(); markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p); markOop curMark; @@ -646,22 +615,10 @@ inline oop oopDesc::forward_to_atomic(oop p) { // Note that the forwardee is not the same thing as the displaced_mark. // The forwardee is used when copying during scavenge and mark-sweep. // It does need to clear the low two locking- and GC-related bits. -inline oop oopDesc::forwardee() const { +oop oopDesc::forwardee() const { return (oop) mark()->decode_pointer(); } -inline bool oopDesc::has_displaced_mark() const { - return mark()->has_displaced_mark_helper(); -} - -inline markOop oopDesc::displaced_mark() const { - return mark()->displaced_mark_helper(); -} - -inline void oopDesc::set_displaced_mark(markOop m) { - mark()->set_displaced_mark_helper(m); -} - // The following method needs to be MT safe. inline uint oopDesc::age() const { assert(!is_forwarded(), "Attempt to read age from forwarded mark"); @@ -672,7 +629,7 @@ inline uint oopDesc::age() const { } } -inline void oopDesc::incr_age() { +void oopDesc::incr_age() { assert(!is_forwarded(), "Attempt to increment age of forwarded mark"); if (has_displaced_mark()) { set_displaced_mark(displaced_mark()->incr_age()); @@ -681,21 +638,7 @@ inline void oopDesc::incr_age() { } } - -inline intptr_t oopDesc::identity_hash() { - // Fast case; if the object is unlocked and the hash value is set, no locking is needed - // Note: The mark must be read into local variable to avoid concurrent updates. - markOop mrk = mark(); - if (mrk->is_unlocked() && !mrk->has_no_hash()) { - return mrk->hash(); - } else if (mrk->is_marked()) { - return mrk->hash(); - } else { - return slow_identity_hash(); - } -} - -inline int oopDesc::ms_adjust_pointers() { +int oopDesc::ms_adjust_pointers() { debug_only(int check_size = size()); int s = klass()->oop_ms_adjust_pointers(this); assert(s == check_size, "should be the same"); @@ -703,11 +646,11 @@ inline int oopDesc::ms_adjust_pointers() { } #if INCLUDE_ALL_GCS -inline void oopDesc::pc_follow_contents(ParCompactionManager* cm) { +void oopDesc::pc_follow_contents(ParCompactionManager* cm) { klass()->oop_pc_follow_contents(this, cm); } -inline void oopDesc::pc_update_contents() { +void oopDesc::pc_update_contents() { Klass* k = klass(); if (!k->is_typeArray_klass()) { // It might contain oops beyond the header, so take the virtual call. @@ -716,7 +659,7 @@ inline void oopDesc::pc_update_contents() { // Else skip it. The TypeArrayKlass in the header never needs scavenging. } -inline void oopDesc::ps_push_contents(PSPromotionManager* pm) { +void oopDesc::ps_push_contents(PSPromotionManager* pm) { Klass* k = klass(); if (!k->is_typeArray_klass()) { // It might contain oops beyond the header, so take the virtual call. @@ -724,43 +667,42 @@ inline void oopDesc::ps_push_contents(PSPromotionManager* pm) { } // Else skip it. The TypeArrayKlass in the header never needs scavenging. } -#endif +#endif // INCLUDE_ALL_GCS -#define OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - \ -inline void oopDesc::oop_iterate(OopClosureType* blk) { \ - klass()->oop_oop_iterate##nv_suffix(this, blk); \ -} \ - \ -inline void oopDesc::oop_iterate(OopClosureType* blk, MemRegion mr) { \ - klass()->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \ +#define OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ + \ +void oopDesc::oop_iterate(OopClosureType* blk) { \ + klass()->oop_oop_iterate##nv_suffix(this, blk); \ +} \ + \ +void oopDesc::oop_iterate(OopClosureType* blk, MemRegion mr) { \ + klass()->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \ } -#define OOP_ITERATE_SIZE_DEFN(OopClosureType, nv_suffix) \ - \ -inline int oopDesc::oop_iterate_size(OopClosureType* blk) { \ - Klass* k = klass(); \ - int size = size_given_klass(k); \ - k->oop_oop_iterate##nv_suffix(this, blk); \ - return size; \ -} \ - \ -inline int oopDesc::oop_iterate_size(OopClosureType* blk, \ - MemRegion mr) { \ - Klass* k = klass(); \ - int size = size_given_klass(k); \ - k->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \ - return size; \ +#define OOP_ITERATE_SIZE_DEFN(OopClosureType, nv_suffix) \ + \ +int oopDesc::oop_iterate_size(OopClosureType* blk) { \ + Klass* k = klass(); \ + int size = size_given_klass(k); \ + k->oop_oop_iterate##nv_suffix(this, blk); \ + return size; \ +} \ + \ +int oopDesc::oop_iterate_size(OopClosureType* blk, MemRegion mr) { \ + Klass* k = klass(); \ + int size = size_given_klass(k); \ + k->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \ + return size; \ } -inline int oopDesc::oop_iterate_no_header(OopClosure* blk) { +int oopDesc::oop_iterate_no_header(OopClosure* blk) { // The NoHeaderExtendedOopClosure wraps the OopClosure and proxies all // the do_oop calls, but turns off all other features in ExtendedOopClosure. NoHeaderExtendedOopClosure cl(blk); return oop_iterate_size(&cl); } -inline int oopDesc::oop_iterate_no_header(OopClosure* blk, MemRegion mr) { +int oopDesc::oop_iterate_no_header(OopClosure* blk, MemRegion mr) { NoHeaderExtendedOopClosure cl(blk); return oop_iterate_size(&cl, mr); } @@ -773,7 +715,7 @@ inline void oopDesc::oop_iterate_backwards(OopClosureType* blk) { \ } #else #define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) -#endif +#endif // INCLUDE_ALL_GCS #define ALL_OOPDESC_OOP_ITERATE(OopClosureType, nv_suffix) \ OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ @@ -783,4 +725,29 @@ inline void oopDesc::oop_iterate_backwards(OopClosureType* blk) { \ ALL_OOP_OOP_ITERATE_CLOSURES_1(ALL_OOPDESC_OOP_ITERATE) ALL_OOP_OOP_ITERATE_CLOSURES_2(ALL_OOPDESC_OOP_ITERATE) +intptr_t oopDesc::identity_hash() { + // Fast case; if the object is unlocked and the hash value is set, no locking is needed + // Note: The mark must be read into local variable to avoid concurrent updates. + markOop mrk = mark(); + if (mrk->is_unlocked() && !mrk->has_no_hash()) { + return mrk->hash(); + } else if (mrk->is_marked()) { + return mrk->hash(); + } else { + return slow_identity_hash(); + } +} + +bool oopDesc::has_displaced_mark() const { + return mark()->has_displaced_mark_helper(); +} + +markOop oopDesc::displaced_mark() const { + return mark()->displaced_mark_helper(); +} + +void oopDesc::set_displaced_mark(markOop m) { + mark()->set_displaced_mark_helper(m); +} + #endif // SHARE_VM_OOPS_OOP_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/typeArrayKlass.cpp b/hotspot/src/share/vm/oops/typeArrayKlass.cpp index 2e76bc4d96a..f8ec9ee822e 100644 --- a/hotspot/src/share/vm/oops/typeArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/typeArrayKlass.cpp @@ -37,7 +37,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayKlass.inline.hpp" -#include "oops/typeArrayOop.hpp" +#include "oops/typeArrayOop.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/orderAccess.inline.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/oops/typeArrayOop.hpp b/hotspot/src/share/vm/oops/typeArrayOop.hpp index 57036c2c0c8..e4670a8949b 100644 --- a/hotspot/src/share/vm/oops/typeArrayOop.hpp +++ b/hotspot/src/share/vm/oops/typeArrayOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -160,10 +160,7 @@ class typeArrayOopDesc : public arrayOopDesc { } public: - int object_size() { - TypeArrayKlass* tk = TypeArrayKlass::cast(klass()); - return object_size(tk->layout_helper(), length()); - } + inline int object_size(); }; #endif // SHARE_VM_OOPS_TYPEARRAYOOP_HPP diff --git a/hotspot/src/share/vm/oops/typeArrayOop.cpp b/hotspot/src/share/vm/oops/typeArrayOop.inline.hpp similarity index 75% rename from hotspot/src/share/vm/oops/typeArrayOop.cpp rename to hotspot/src/share/vm/oops/typeArrayOop.inline.hpp index d3551e0cf3f..679993db822 100644 --- a/hotspot/src/share/vm/oops/typeArrayOop.cpp +++ b/hotspot/src/share/vm/oops/typeArrayOop.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,8 +22,15 @@ * */ -#include "precompiled.hpp" +#ifndef SHARE_VM_OOPS_TYPEARRAYOOP_INLINE_HPP +#define SHARE_VM_OOPS_TYPEARRAYOOP_INLINE_HPP + #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.hpp" -// <> +int typeArrayOopDesc::object_size() { + TypeArrayKlass* tk = TypeArrayKlass::cast(klass()); + return object_size(tk->layout_helper(), length()); +} + +#endif // SHARE_VM_OOPS_TYPEARRAYOOP_INLINE_HPP diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index 7e249dd5b30..22e44463330 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -46,6 +46,7 @@ #include "memory/oopFactory.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" +#include "oops/typeArrayOop.inline.hpp" #include "opto/ad.hpp" #include "opto/addnode.hpp" #include "opto/callnode.hpp" diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 54d8248e718..182cfec7d5a 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -28,7 +28,7 @@ #include "classfile/altHashing.hpp" #include "classfile/classFileStream.hpp" #include "classfile/classLoader.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index a468a62e571..9883c5278b6 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index a1711971464..7706d5b1594 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" #include "oops/method.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/fieldStreams.hpp" #include "oops/verifyOopClosure.hpp" diff --git a/hotspot/src/share/vm/services/gcNotifier.cpp b/hotspot/src/share/vm/services/gcNotifier.cpp index 5a90b7be4f9..0336428e2b4 100644 --- a/hotspot/src/share/vm/services/gcNotifier.cpp +++ b/hotspot/src/share/vm/services/gcNotifier.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/java.hpp" diff --git a/hotspot/src/share/vm/services/serviceUtil.hpp b/hotspot/src/share/vm/services/serviceUtil.hpp index fca509770c2..14276bb7da0 100644 --- a/hotspot/src/share/vm/services/serviceUtil.hpp +++ b/hotspot/src/share/vm/services/serviceUtil.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ #include "classfile/systemDictionary.hpp" #include "oops/objArrayOop.hpp" +#include "oops/oop.inline.hpp" // // Serviceability utility functions. diff --git a/hotspot/src/share/vm/services/threadService.cpp b/hotspot/src/share/vm/services/threadService.cpp index d0598e46195..7d49726d1ac 100644 --- a/hotspot/src/share/vm/services/threadService.cpp +++ b/hotspot/src/share/vm/services/threadService.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ #include "memory/heapInspection.hpp" #include "memory/oopFactory.hpp" #include "oops/instanceKlass.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/handles.inline.hpp" diff --git a/hotspot/src/share/vm/utilities/hashtable.cpp b/hotspot/src/share/vm/utilities/hashtable.cpp index b62c52b5e54..10f4456274a 100644 --- a/hotspot/src/share/vm/utilities/hashtable.cpp +++ b/hotspot/src/share/vm/utilities/hashtable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "classfile/altHashing.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/stringTable.hpp" #include "memory/allocation.inline.hpp" #include "memory/filemap.hpp" From 28c6b5ad896da0dfaed13de54f0019f24128818c Mon Sep 17 00:00:00 2001 From: Max Ockner Date: Wed, 6 Jan 2016 09:39:55 -0500 Subject: [PATCH 018/212] 8146485: Add test for Unified Logging classresolve tag Test has been added for Unified Logging classresolve tag. Reviewed-by: coleenp, gtriantafill --- .../runtime/logging/ClassResolutionTest.java | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 hotspot/test/runtime/logging/ClassResolutionTest.java diff --git a/hotspot/test/runtime/logging/ClassResolutionTest.java b/hotspot/test/runtime/logging/ClassResolutionTest.java new file mode 100644 index 00000000000..84d06c4eebb --- /dev/null +++ b/hotspot/test/runtime/logging/ClassResolutionTest.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/* + * @test ClassResolutionTest + * @bug 8144874 + * @library /testlibrary + * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools + * @run driver ClassResolutionTest + */ + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; +import java.lang.ref.WeakReference; +import java.lang.reflect.Method; + +public class ClassResolutionTest { + + public static class ClassResolutionTestMain { + + public static class Thing1 { + public static int getThingNumber() { + return 1; + } + }; + public static class Thing1Handler { + public static int getThingNumber() { + return Thing1.getThingNumber(); + } + }; + + public static void main(String... args) throws Exception { + Thing1Handler.getThingNumber(); + } + } + + public static void main(String... args) throws Exception { + + // (1) classresolve should turn on. + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:classresolve=info", ClassResolutionTestMain.class.getName()); + OutputAnalyzer o = new OutputAnalyzer(pb.start()); + o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1"); + + // (2) classresolve should turn off. + pb = ProcessTools.createJavaProcessBuilder( + "-Xlog", "-Xlog:classresolve=off", ClassResolutionTestMain.class.getName()); + o = new OutputAnalyzer(pb.start()); + o.shouldNotContain("[classresolve]"); + + // (3) TraceClassResolution should turn on. + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+TraceClassResolution", ClassResolutionTestMain.class.getName()); + o = new OutputAnalyzer(pb.start()); + o.shouldContain("[classresolve] ClassResolutionTest$ClassResolutionTestMain$Thing1Handler ClassResolutionTest$ClassResolutionTestMain$Thing1"); + + // (4) TraceClassResolution should turn off. + pb = ProcessTools.createJavaProcessBuilder( + "-Xlog", "-XX:-TraceClassResolution", ClassResolutionTestMain.class.getName()); + o = new OutputAnalyzer(pb.start()); + o.shouldNotContain("[classresolve]"); + + + }; +} From 7479dffbc6991c5bbf9a7cbabbab0ad3e9bf7ed7 Mon Sep 17 00:00:00 2001 From: Sangheon Kim Date: Tue, 5 Jan 2016 17:05:13 -0800 Subject: [PATCH 019/212] 8144527: NewSizeThreadIncrease would make an overflow Revert to previous value if NewSizeThreadIncrease related calculation overflows Reviewed-by: jwilhelm, mgerdin, mchernov --- .../share/vm/gc/serial/defNewGeneration.cpp | 43 +++++- .../share/vm/gc/serial/defNewGeneration.hpp | 8 ++ .../arguments/TestNewSizeThreadIncrease.java | 123 ++++++++++++++++++ 3 files changed, 168 insertions(+), 6 deletions(-) create mode 100644 hotspot/test/gc/arguments/TestNewSizeThreadIncrease.java diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp index eaaf9a213e5..dae4e8a14c8 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp @@ -364,6 +364,36 @@ bool DefNewGeneration::expand(size_t bytes) { return success; } +size_t DefNewGeneration::adjust_for_thread_increase(size_t new_size_candidate, + size_t new_size_before, + size_t alignment) const { + size_t desired_new_size = new_size_before; + + if (NewSizeThreadIncrease > 0) { + int threads_count; + size_t thread_increase_size = 0; + + // 1. Check an overflow at 'threads_count * NewSizeThreadIncrease'. + threads_count = Threads::number_of_non_daemon_threads(); + if (NewSizeThreadIncrease <= max_uintx / threads_count) { + thread_increase_size = threads_count * NewSizeThreadIncrease; + + // 2. Check an overflow at 'new_size_candidate + thread_increase_size'. + if (new_size_candidate <= max_uintx - thread_increase_size) { + new_size_candidate += thread_increase_size; + + // 3. Check an overflow at 'align_size_up'. + size_t aligned_max = ((max_uintx - alignment) & ~(alignment-1)); + if (new_size_candidate <= aligned_max) { + desired_new_size = align_size_up(new_size_candidate, alignment); + } + } + } + } + + return desired_new_size; +} + void DefNewGeneration::compute_new_size() { // This is called after a GC that includes the old generation, so from-space // will normally be empty. @@ -385,12 +415,13 @@ void DefNewGeneration::compute_new_size() { // All space sizes must be multiples of Generation::GenGrain. size_t alignment = Generation::GenGrain; - // Compute desired new generation size based on NewRatio and - // NewSizeThreadIncrease - size_t desired_new_size = old_size/NewRatio; - int threads_count = Threads::number_of_non_daemon_threads(); - size_t thread_increase_size = threads_count * NewSizeThreadIncrease; - desired_new_size = align_size_up(desired_new_size + thread_increase_size, alignment); + int threads_count = 0; + size_t thread_increase_size = 0; + + size_t new_size_candidate = old_size / NewRatio; + // Compute desired new generation size based on NewRatio and NewSizeThreadIncrease + // and reverts to previous value if any overflow happens + size_t desired_new_size = adjust_for_thread_increase(new_size_candidate, new_size_before, alignment); // Adjust new generation size desired_new_size = MAX2(MIN2(desired_new_size, max_new_size), min_new_size); diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp index f537a6d6a4f..70f719e7917 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp @@ -354,6 +354,14 @@ protected: void compute_space_boundaries(uintx minimum_eden_size, bool clear_space, bool mangle_space); + + // Return adjusted new size for NewSizeThreadIncrease. + // If any overflow happens, revert to previous new size. + size_t adjust_for_thread_increase(size_t new_size_candidate, + size_t new_size_before, + size_t alignment) const; + + // Scavenge support void swap_spaces(); }; diff --git a/hotspot/test/gc/arguments/TestNewSizeThreadIncrease.java b/hotspot/test/gc/arguments/TestNewSizeThreadIncrease.java new file mode 100644 index 00000000000..2422baec386 --- /dev/null +++ b/hotspot/test/gc/arguments/TestNewSizeThreadIncrease.java @@ -0,0 +1,123 @@ +/* +* Copyright (c) 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. +*/ + +/* + * @test TestNewSizeThreadIncrease + * @key gc + * @bug 8144527 + * @summary Tests argument processing for NewSizeThreadIncrease + * @library /testlibrary + * @requires vm.gc=="Serial" | vm.gc=="null" + * @modules java.base/sun.misc + * java.management + */ + + +import jdk.test.lib.*; + +// Range of NewSizeThreadIncrease is 0 ~ max_uintx. +// Total of 5 threads will be created (1 GCTest thread and 4 TestThread). +public class TestNewSizeThreadIncrease { + static final String VALID_VALUE = "2097152"; // 2MB + + // This value will make an overflow of 'thread count * NewSizeThreadIncrease' at DefNewGeneration::compute_new_size(). + // = (max_uintx / 5) + 1, = (18446744073709551615 / 5) + 1 + static String INVALID_VALUE_1 = "3689348814741910324"; + + // This string is contained when compute_new_size() expands or shrinks. + static final String LOG_NEWSIZE_CHANGED = "New generation size "; + + public static void main(String[] args) throws Exception { + if (Platform.is32bit()) { + // (max_uintx / 5) + 1, 4294967295/5 + 1 + INVALID_VALUE_1 = "858993460"; + } + + // New size will be applied as NewSizeThreadIncrease is small enough to expand. + runNewSizeThreadIncreaseTest(VALID_VALUE, true); + + // New size will be ignored as 'thread count * NewSizeThreadIncrease' overflows. + runNewSizeThreadIncreaseTest(INVALID_VALUE_1, false); + } + + static void runNewSizeThreadIncreaseTest(String expectedValue, boolean isNewsizeChanged) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseSerialGC", + "-Xms96M", + "-Xmx128M", + "-XX:NewRatio=2", + "-Xlog:gc+heap+ergo=debug", + "-XX:NewSizeThreadIncrease="+expectedValue, + GCTest.class.getName()); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + output.shouldHaveExitValue(0); + + if (isNewsizeChanged) { + output.shouldContain(LOG_NEWSIZE_CHANGED); + } else { + output.shouldNotContain(LOG_NEWSIZE_CHANGED); + } + } + + static class GCTest { + + static final int MAX_THREADS_COUNT = 4; + static TestThread threads[] = new TestThread[MAX_THREADS_COUNT]; + + public static void main(String[] args) { + + System.out.println("Creating garbage"); + + for (int i=0; i Date: Tue, 5 Jan 2016 10:36:34 -0800 Subject: [PATCH 020/212] 8145093: [TESTBUG] Remove test skip code for Solaris SPARC in runtime/SharedArchiveFile/SharedBaseAddress.java The test failed(see bug 8044600) once on sparc platform which never reproduced thereafter, remove the skip. Reviewed-by: hseigel, iklam, gtriantafill --- .../test/runtime/SharedArchiveFile/SharedBaseAddress.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java index 37119150c5a..8386a55ca98 100644 --- a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java +++ b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,10 +43,6 @@ public class SharedBaseAddress { }; public static void main(String[] args) throws Exception { - // Known issue on Solaris-Sparc - // @ignore JDK-8044600 - if (Platform.isSolaris() && Platform.isSparc()) - return; for (String testEntry : testTable) { String filename = "SharedBaseAddress" + testEntry + ".jsa"; From 87f0463ced4d38777d48e3d48f9b0dad1188d48b Mon Sep 17 00:00:00 2001 From: Sangheon Kim Date: Tue, 5 Jan 2016 10:41:56 -0800 Subject: [PATCH 021/212] 8145000: TestOptionsWithRanges.java failure for XX:+UseNUMA -XX:+UseNUMAInterleaving -XX:NUMAInterleaveGranularity=65536 Add protect_pages_individually() to protect memory per chunk on Windows Reviewed-by: jwilhelm, tbenson --- hotspot/src/os/windows/vm/os_windows.cpp | 49 ++++++++++++++++++- .../TestOptionsWithRanges.java | 6 --- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 5229d1478bc..d96fb961d52 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -3318,6 +3318,35 @@ bool os::remove_stack_guard_pages(char* addr, size_t size) { return os::uncommit_memory(addr, size); } +static bool protect_pages_individually(char* addr, size_t bytes, unsigned int p, DWORD *old_status) { + uint count = 0; + bool ret = false; + size_t bytes_remaining = bytes; + char * next_protect_addr = addr; + + // Use VirtualQuery() to get the chunk size. + while (bytes_remaining) { + MEMORY_BASIC_INFORMATION alloc_info; + if (VirtualQuery(next_protect_addr, &alloc_info, sizeof(alloc_info)) == 0) { + return false; + } + + size_t bytes_to_protect = MIN2(bytes_remaining, (size_t)alloc_info.RegionSize); + // We used different API at allocate_pages_individually() based on UseNUMAInterleaving, + // but we don't distinguish here as both cases are protected by same API. + ret = VirtualProtect(next_protect_addr, bytes_to_protect, p, old_status) != 0; + warning("Failed protecting pages individually for chunk #%u", count); + if (!ret) { + return false; + } + + bytes_remaining -= bytes_to_protect; + next_protect_addr += bytes_to_protect; + count++; + } + return ret; +} + // Set protections specified bool os::protect_memory(char* addr, size_t bytes, ProtType prot, bool is_committed) { @@ -3345,7 +3374,25 @@ bool os::protect_memory(char* addr, size_t bytes, ProtType prot, // Pages in the region become guard pages. Any attempt to access a guard page // causes the system to raise a STATUS_GUARD_PAGE exception and turn off // the guard page status. Guard pages thus act as a one-time access alarm. - return VirtualProtect(addr, bytes, p, &old_status) != 0; + bool ret; + if (UseNUMAInterleaving) { + // If UseNUMAInterleaving is enabled, the pages may have been allocated a chunk at a time, + // so we must protect the chunks individually. + ret = protect_pages_individually(addr, bytes, p, &old_status); + } else { + ret = VirtualProtect(addr, bytes, p, &old_status) != 0; + } +#ifdef ASSERT + if (!ret) { + int err = os::get_last_error(); + char buf[256]; + size_t buf_len = os::lasterror(buf, sizeof(buf)); + warning("INFO: os::protect_memory(" PTR_FORMAT ", " SIZE_FORMAT + ") failed; error='%s' (DOS error/errno=%d)", addr, bytes, + buf_len != 0 ? buf : "", err); + } +#endif + return ret; } bool os::guard_memory(char* addr, size_t bytes) { diff --git a/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java b/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java index fe952cdaf2e..f762017bff2 100644 --- a/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java +++ b/hotspot/test/runtime/CommandLine/OptionsValidation/TestOptionsWithRanges.java @@ -135,12 +135,6 @@ public class TestOptionsWithRanges { excludeTestMaxRange("VMThreadStackSize"); - /* - * JDK-8145027 - * Temporarily exclude as current range/constraint is not enough for some option combinations. - */ - excludeTestRange("NUMAInterleaveGranularity"); - /* * Remove parameters controlling the code cache. As these * parameters have implications on the physical memory From a476bf01f49c52ee7cf5021eb3c540b8c72b3000 Mon Sep 17 00:00:00 2001 From: David Lindholm Date: Thu, 7 Jan 2016 14:55:12 +0100 Subject: [PATCH 022/212] 8146409: TestPromotionFailedEventWithParallelScavenge.java failed with assert(_time_stamps != __null) failed: Sanity Reviewed-by: tschatzl, jwilhelm --- .../src/share/vm/gc/parallel/gcTaskThread.cpp | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp index 47d441a1ce4..f00faf5b7d1 100644 --- a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp +++ b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp @@ -78,19 +78,22 @@ GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) { void GCTaskThread::print_task_time_stamps() { assert(log_is_enabled(Debug, gc, task, time), "Sanity"); - assert(_time_stamps != NULL, "Sanity"); - log_debug(gc, task, time)("GC-Thread %u entries: %d", id(), _time_stamp_index); - for(uint i=0; i<_time_stamp_index; i++) { - GCTaskTimeStamp* time_stamp = time_stamp_at(i); - log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]", - time_stamp->name(), - time_stamp->entry_time(), - time_stamp->exit_time()); + // Since _time_stamps is now lazily allocated we need to check that it + // has in fact been allocated when calling this function. + if (_time_stamps != NULL) { + log_debug(gc, task, time)("GC-Thread %u entries: %d", id(), _time_stamp_index); + for(uint i=0; i<_time_stamp_index; i++) { + GCTaskTimeStamp* time_stamp = time_stamp_at(i); + log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]", + time_stamp->name(), + time_stamp->entry_time(), + time_stamp->exit_time()); + } + + // Reset after dumping the data + _time_stamp_index = 0; } - - // Reset after dumping the data - _time_stamp_index = 0; } // GC workers get tasks from the GCTaskManager and execute From 98193d202b797ff9bf9348b47cb4545fce72048f Mon Sep 17 00:00:00 2001 From: David Lindholm Date: Thu, 7 Jan 2016 16:25:53 +0100 Subject: [PATCH 023/212] 8146399: Refactor the BlockOffsetTable classes Reviewed-by: mgerdin, jwilhelm, tschatzl --- hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp | 2 +- .../src/share/vm/gc/g1/g1BlockOffsetTable.cpp | 318 +++++++----------- .../src/share/vm/gc/g1/g1BlockOffsetTable.hpp | 228 +++---------- .../vm/gc/g1/g1BlockOffsetTable.inline.hpp | 74 ++-- .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 8 +- .../src/share/vm/gc/g1/g1CollectedHeap.hpp | 4 +- .../share/vm/gc/g1/g1CollectedHeap_ext.cpp | 2 +- hotspot/src/share/vm/gc/g1/g1RemSet.cpp | 6 +- hotspot/src/share/vm/gc/g1/g1RemSet.hpp | 4 +- hotspot/src/share/vm/gc/g1/heapRegion.cpp | 73 ++-- hotspot/src/share/vm/gc/g1/heapRegion.hpp | 22 +- .../src/share/vm/gc/g1/heapRegion.inline.hpp | 38 +-- .../src/share/vm/gc/g1/heapRegionRemSet.cpp | 15 +- .../src/share/vm/gc/g1/heapRegionRemSet.hpp | 8 +- hotspot/src/share/vm/gc/g1/heapRegionSet.cpp | 18 +- hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp | 6 +- .../share/vm/gc/shared/blockOffsetTable.hpp | 2 +- 17 files changed, 288 insertions(+), 540 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp b/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp index f7a9c8e8414..e48b0f22c11 100644 --- a/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp @@ -277,7 +277,7 @@ HeapRegion* OldGCAllocRegion::release() { // Determine how far we are from the next card boundary. If it is smaller than // the minimum object size we can allocate into, expand into the next card. HeapWord* top = cur->top(); - HeapWord* aligned_top = (HeapWord*)align_ptr_up(top, G1BlockOffsetSharedArray::N_bytes); + HeapWord* aligned_top = (HeapWord*)align_ptr_up(top, G1BlockOffsetTable::N_bytes); size_t to_allocate_words = pointer_delta(aligned_top, top, HeapWordSize); diff --git a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp index a123477e58e..ef377be6c07 100644 --- a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp @@ -35,35 +35,29 @@ ////////////////////////////////////////////////////////////////////// -// G1BlockOffsetSharedArray +// G1BlockOffsetTable ////////////////////////////////////////////////////////////////////// -G1BlockOffsetSharedArray::G1BlockOffsetSharedArray(MemRegion heap, G1RegionToSpaceMapper* storage) : - _reserved(), _end(NULL), _listener(), _offset_array(NULL) { - - _reserved = heap; - _end = NULL; +G1BlockOffsetTable::G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* storage) : + _reserved(heap), _offset_array(NULL) { MemRegion bot_reserved = storage->reserved(); _offset_array = (u_char*)bot_reserved.start(); - _end = _reserved.end(); - storage->set_mapping_changed_listener(&_listener); - - log_trace(gc, bot)("G1BlockOffsetSharedArray::G1BlockOffsetSharedArray: "); + log_trace(gc, bot)("G1BlockOffsetTable::G1BlockOffsetTable: "); log_trace(gc, bot)(" rs.base(): " PTR_FORMAT " rs.size(): " SIZE_FORMAT " rs end(): " PTR_FORMAT, p2i(bot_reserved.start()), bot_reserved.byte_size(), p2i(bot_reserved.end())); } -bool G1BlockOffsetSharedArray::is_card_boundary(HeapWord* p) const { +bool G1BlockOffsetTable::is_card_boundary(HeapWord* p) const { assert(p >= _reserved.start(), "just checking"); size_t delta = pointer_delta(p, _reserved.start()); return (delta & right_n_bits(LogN_words)) == (size_t)NoBits; } #ifdef ASSERT -void G1BlockOffsetSharedArray::check_index(size_t index, const char* msg) const { +void G1BlockOffsetTable::check_index(size_t index, const char* msg) const { assert((index) < (_reserved.word_size() >> LogN_words), "%s - index: " SIZE_FORMAT ", _vs.committed_size: " SIZE_FORMAT, msg, (index), (_reserved.word_size() >> LogN_words)); @@ -77,25 +71,19 @@ void G1BlockOffsetSharedArray::check_index(size_t index, const char* msg) const #endif // ASSERT ////////////////////////////////////////////////////////////////////// -// G1BlockOffsetArray +// G1BlockOffsetTablePart ////////////////////////////////////////////////////////////////////// -G1BlockOffsetArray::G1BlockOffsetArray(G1BlockOffsetSharedArray* array, - MemRegion mr) : - G1BlockOffsetTable(mr.start(), mr.end()), - _unallocated_block(_bottom), - _array(array), _gsp(NULL) { - assert(_bottom <= _end, "arguments out of order"); -} - -void G1BlockOffsetArray::set_space(G1OffsetTableContigSpace* sp) { - _gsp = sp; -} +G1BlockOffsetTablePart::G1BlockOffsetTablePart(G1BlockOffsetTable* array, G1ContiguousSpace* gsp) : + _bot(array), + _space(gsp), + _next_offset_threshold(NULL), + _next_offset_index(0) +{ } // The arguments follow the normal convention of denoting // a right-open interval: [start, end) -void -G1BlockOffsetArray:: set_remainder_to_point_to_start(HeapWord* start, HeapWord* end) { +void G1BlockOffsetTablePart:: set_remainder_to_point_to_start(HeapWord* start, HeapWord* end) { if (start >= end) { // The start address is equal to the end address (or to @@ -137,23 +125,22 @@ G1BlockOffsetArray:: set_remainder_to_point_to_start(HeapWord* start, HeapWord* // Move back N (e.g., 8) entries and repeat with the // value of the new entry // - size_t start_card = _array->index_for(start); - size_t end_card = _array->index_for(end-1); - assert(start ==_array->address_for_index(start_card), "Precondition"); - assert(end ==_array->address_for_index(end_card)+N_words, "Precondition"); + size_t start_card = _bot->index_for(start); + size_t end_card = _bot->index_for(end-1); + assert(start ==_bot->address_for_index(start_card), "Precondition"); + assert(end ==_bot->address_for_index(end_card)+N_words, "Precondition"); set_remainder_to_point_to_start_incl(start_card, end_card); // closed interval } // Unlike the normal convention in this code, the argument here denotes // a closed, inclusive interval: [start_card, end_card], cf set_remainder_to_point_to_start() // above. -void -G1BlockOffsetArray::set_remainder_to_point_to_start_incl(size_t start_card, size_t end_card) { +void G1BlockOffsetTablePart::set_remainder_to_point_to_start_incl(size_t start_card, size_t end_card) { if (start_card > end_card) { return; } - assert(start_card > _array->index_for(_bottom), "Cannot be first card"); - assert(_array->offset_array(start_card-1) <= N_words, + assert(start_card > _bot->index_for(_space->bottom()), "Cannot be first card"); + assert(_bot->offset_array(start_card-1) <= N_words, "Offset card has an unexpected value"); size_t start_card_for_region = start_card; u_char offset = max_jubyte; @@ -164,11 +151,11 @@ G1BlockOffsetArray::set_remainder_to_point_to_start_incl(size_t start_card, size size_t reach = start_card - 1 + (BlockOffsetArray::power_to_cards_back(i+1) - 1); offset = N_words + i; if (reach >= end_card) { - _array->set_offset_array(start_card_for_region, end_card, offset); + _bot->set_offset_array(start_card_for_region, end_card, offset); start_card_for_region = reach + 1; break; } - _array->set_offset_array(start_card_for_region, reach, offset); + _bot->set_offset_array(start_card_for_region, reach, offset); start_card_for_region = reach + 1; } assert(start_card_for_region > end_card, "Sanity check"); @@ -178,79 +165,44 @@ G1BlockOffsetArray::set_remainder_to_point_to_start_incl(size_t start_card, size // The card-interval [start_card, end_card] is a closed interval; this // is an expensive check -- use with care and only under protection of // suitable flag. -void G1BlockOffsetArray::check_all_cards(size_t start_card, size_t end_card) const { +void G1BlockOffsetTablePart::check_all_cards(size_t start_card, size_t end_card) const { if (end_card < start_card) { return; } - guarantee(_array->offset_array(start_card) == N_words, "Wrong value in second card"); + guarantee(_bot->offset_array(start_card) == N_words, "Wrong value in second card"); for (size_t c = start_card + 1; c <= end_card; c++ /* yeah! */) { - u_char entry = _array->offset_array(c); + u_char entry = _bot->offset_array(c); if (c - start_card > BlockOffsetArray::power_to_cards_back(1)) { guarantee(entry > N_words, "Should be in logarithmic region - " "entry: %u, " "_array->offset_array(c): %u, " "N_words: %u", - (uint)entry, (uint)_array->offset_array(c), (uint)N_words); + (uint)entry, (uint)_bot->offset_array(c), (uint)N_words); } size_t backskip = BlockOffsetArray::entry_to_cards_back(entry); size_t landing_card = c - backskip; guarantee(landing_card >= (start_card - 1), "Inv"); if (landing_card >= start_card) { - guarantee(_array->offset_array(landing_card) <= entry, + guarantee(_bot->offset_array(landing_card) <= entry, "Monotonicity - landing_card offset: %u, " "entry: %u", - (uint)_array->offset_array(landing_card), (uint)entry); + (uint)_bot->offset_array(landing_card), (uint)entry); } else { guarantee(landing_card == start_card - 1, "Tautology"); // Note that N_words is the maximum offset value - guarantee(_array->offset_array(landing_card) <= N_words, + guarantee(_bot->offset_array(landing_card) <= N_words, "landing card offset: %u, " "N_words: %u", - (uint)_array->offset_array(landing_card), (uint)N_words); + (uint)_bot->offset_array(landing_card), (uint)N_words); } } } -HeapWord* G1BlockOffsetArray::block_start_unsafe(const void* addr) { - assert(_bottom <= addr && addr < _end, - "addr must be covered by this Array"); - // Must read this exactly once because it can be modified by parallel - // allocation. - HeapWord* ub = _unallocated_block; - if (BlockOffsetArrayUseUnallocatedBlock && addr >= ub) { - assert(ub < _end, "tautology (see above)"); - return ub; - } - // Otherwise, find the block start using the table. - HeapWord* q = block_at_or_preceding(addr, false, 0); - return forward_to_block_containing_addr(q, addr); -} - -// This duplicates a little code from the above: unavoidable. -HeapWord* -G1BlockOffsetArray::block_start_unsafe_const(const void* addr) const { - assert(_bottom <= addr && addr < _end, - "addr must be covered by this Array"); - // Must read this exactly once because it can be modified by parallel - // allocation. - HeapWord* ub = _unallocated_block; - if (BlockOffsetArrayUseUnallocatedBlock && addr >= ub) { - assert(ub < _end, "tautology (see above)"); - return ub; - } - // Otherwise, find the block start using the table. - HeapWord* q = block_at_or_preceding(addr, false, 0); - HeapWord* n = q + block_size(q); - return forward_to_block_containing_addr_const(q, n, addr); -} - - -HeapWord* -G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord* q, - HeapWord* n, - const void* addr) { +HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr_slow(HeapWord* q, + HeapWord* n, + const void* addr) { // We're not in the normal case. We need to handle an important subcase // here: LAB allocation. An allocation previously recorded in the // offset table was actually a lab allocation, and was divided into @@ -260,17 +212,17 @@ G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord* q, // If the fist object's end q is at the card boundary. Start refining // with the corresponding card (the value of the entry will be basically // set to 0). If the object crosses the boundary -- start from the next card. - size_t n_index = _array->index_for(n); - size_t next_index = _array->index_for(n) + !_array->is_card_boundary(n); + size_t n_index = _bot->index_for(n); + size_t next_index = _bot->index_for(n) + !_bot->is_card_boundary(n); // Calculate a consistent next boundary. If "n" is not at the boundary // already, step to the boundary. - HeapWord* next_boundary = _array->address_for_index(n_index) + + HeapWord* next_boundary = _bot->address_for_index(n_index) + (n_index == next_index ? 0 : N_words); - assert(next_boundary <= _array->_end, + assert(next_boundary <= _bot->_reserved.end(), "next_boundary is beyond the end of the covered region " " next_boundary " PTR_FORMAT " _array->_end " PTR_FORMAT, - p2i(next_boundary), p2i(_array->_end)); - if (addr >= gsp()->top()) return gsp()->top(); + p2i(next_boundary), p2i(_bot->_reserved.end())); + if (addr >= _space->top()) return _space->top(); while (next_boundary < addr) { while (n <= next_boundary) { q = n; @@ -280,18 +232,11 @@ G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord* q, } assert(q <= next_boundary && n > next_boundary, "Consequence of loop"); // [q, n) is the block that crosses the boundary. - alloc_block_work2(&next_boundary, &next_index, q, n); + alloc_block_work(&next_boundary, &next_index, q, n); } return forward_to_block_containing_addr_const(q, n, addr); } -// Note that the committed size of the covered space may have changed, -// so the table size might also wish to change. -void G1BlockOffsetArray::resize(size_t new_word_size) { - HeapWord* new_end = _bottom + new_word_size; - _end = new_end; // update _end -} - // // threshold_ // | _index_ @@ -302,8 +247,8 @@ void G1BlockOffsetArray::resize(size_t new_word_size) { // ( ^ ] // block-start // -void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_, - HeapWord* blk_start, HeapWord* blk_end) { +void G1BlockOffsetTablePart::alloc_block_work(HeapWord** threshold_, size_t* index_, + HeapWord* blk_start, HeapWord* blk_end) { // For efficiency, do copy-in/copy-out. HeapWord* threshold = *threshold_; size_t index = *index_; @@ -318,7 +263,7 @@ void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_ "reference must be into the heap"); assert(G1CollectedHeap::heap()->is_in_reserved(blk_end-1), "limit must be within the heap"); - assert(threshold == _array->_reserved.start() + index*N_words, + assert(threshold == _bot->_reserved.start() + index*N_words, "index must agree with threshold"); DEBUG_ONLY(size_t orig_index = index;) @@ -326,26 +271,26 @@ void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_ // Mark the card that holds the offset into the block. Note // that _next_offset_index and _next_offset_threshold are not // updated until the end of this method. - _array->set_offset_array(index, threshold, blk_start); + _bot->set_offset_array(index, threshold, blk_start); // We need to now mark the subsequent cards that this blk spans. // Index of card on which blk ends. - size_t end_index = _array->index_for(blk_end - 1); + size_t end_index = _bot->index_for(blk_end - 1); // Are there more cards left to be updated? if (index + 1 <= end_index) { - HeapWord* rem_st = _array->address_for_index(index + 1); + HeapWord* rem_st = _bot->address_for_index(index + 1); // Calculate rem_end this way because end_index // may be the last valid index in the covered region. - HeapWord* rem_end = _array->address_for_index(end_index) + N_words; + HeapWord* rem_end = _bot->address_for_index(end_index) + N_words; set_remainder_to_point_to_start(rem_st, rem_end); } index = end_index + 1; // Calculate threshold_ this way because end_index // may be the last valid index in the covered region. - threshold = _array->address_for_index(end_index) + N_words; + threshold = _bot->address_for_index(end_index) + N_words; assert(threshold >= blk_end, "Incorrect offset threshold"); // index_ and threshold_ updated here. @@ -355,49 +300,49 @@ void G1BlockOffsetArray::alloc_block_work2(HeapWord** threshold_, size_t* index_ #ifdef ASSERT // The offset can be 0 if the block starts on a boundary. That // is checked by an assertion above. - size_t start_index = _array->index_for(blk_start); - HeapWord* boundary = _array->address_for_index(start_index); - assert((_array->offset_array(orig_index) == 0 && blk_start == boundary) || - (_array->offset_array(orig_index) > 0 && _array->offset_array(orig_index) <= N_words), + size_t start_index = _bot->index_for(blk_start); + HeapWord* boundary = _bot->address_for_index(start_index); + assert((_bot->offset_array(orig_index) == 0 && blk_start == boundary) || + (_bot->offset_array(orig_index) > 0 && _bot->offset_array(orig_index) <= N_words), "offset array should have been set - " "orig_index offset: %u, " "blk_start: " PTR_FORMAT ", " "boundary: " PTR_FORMAT, - (uint)_array->offset_array(orig_index), + (uint)_bot->offset_array(orig_index), p2i(blk_start), p2i(boundary)); for (size_t j = orig_index + 1; j <= end_index; j++) { - assert(_array->offset_array(j) > 0 && - _array->offset_array(j) <= + assert(_bot->offset_array(j) > 0 && + _bot->offset_array(j) <= (u_char) (N_words+BlockOffsetArray::N_powers-1), "offset array should have been set - " "%u not > 0 OR %u not <= %u", - (uint) _array->offset_array(j), - (uint) _array->offset_array(j), + (uint) _bot->offset_array(j), + (uint) _bot->offset_array(j), (uint) (N_words+BlockOffsetArray::N_powers-1)); } #endif } -void G1BlockOffsetArray::verify() const { - assert(gsp()->bottom() < gsp()->top(), "Only non-empty regions should be verified."); - size_t start_card = _array->index_for(gsp()->bottom()); - size_t end_card = _array->index_for(gsp()->top() - 1); +void G1BlockOffsetTablePart::verify() const { + assert(_space->bottom() < _space->top(), "Only non-empty regions should be verified."); + size_t start_card = _bot->index_for(_space->bottom()); + size_t end_card = _bot->index_for(_space->top() - 1); for (size_t current_card = start_card; current_card < end_card; current_card++) { - u_char entry = _array->offset_array(current_card); + u_char entry = _bot->offset_array(current_card); if (entry < N_words) { // The entry should point to an object before the current card. Verify that // it is possible to walk from that object in to the current card by just // iterating over the objects following it. - HeapWord* card_address = _array->address_for_index(current_card); + HeapWord* card_address = _bot->address_for_index(current_card); HeapWord* obj_end = card_address - entry; while (obj_end < card_address) { HeapWord* obj = obj_end; size_t obj_size = block_size(obj); obj_end = obj + obj_size; - guarantee(obj_end > obj && obj_end <= gsp()->top(), + guarantee(obj_end > obj && obj_end <= _space->top(), "Invalid object end. obj: " PTR_FORMAT " obj_size: " SIZE_FORMAT " obj_end: " PTR_FORMAT " top: " PTR_FORMAT, - p2i(obj), obj_size, p2i(obj_end), p2i(gsp()->top())); + p2i(obj), obj_size, p2i(obj_end), p2i(_space->top())); } } else { // Because we refine the BOT based on which cards are dirty there is not much we can verify here. @@ -411,103 +356,66 @@ void G1BlockOffsetArray::verify() const { "Going backwards beyond the start_card. start_card: " SIZE_FORMAT " current_card: " SIZE_FORMAT " backskip: " SIZE_FORMAT, start_card, current_card, backskip); - HeapWord* backskip_address = _array->address_for_index(current_card - backskip); - guarantee(backskip_address >= gsp()->bottom(), + HeapWord* backskip_address = _bot->address_for_index(current_card - backskip); + guarantee(backskip_address >= _space->bottom(), "Going backwards beyond bottom of the region: bottom: " PTR_FORMAT ", backskip_address: " PTR_FORMAT, - p2i(gsp()->bottom()), p2i(backskip_address)); + p2i(_space->bottom()), p2i(backskip_address)); } } } #ifndef PRODUCT void -G1BlockOffsetArray::print_on(outputStream* out) { - size_t from_index = _array->index_for(_bottom); - size_t to_index = _array->index_for(_end); +G1BlockOffsetTablePart::print_on(outputStream* out) { + size_t from_index = _bot->index_for(_space->bottom()); + size_t to_index = _bot->index_for(_space->end()); out->print_cr(">> BOT for area [" PTR_FORMAT "," PTR_FORMAT ") " "cards [" SIZE_FORMAT "," SIZE_FORMAT ")", - p2i(_bottom), p2i(_end), from_index, to_index); + p2i(_space->bottom()), p2i(_space->end()), from_index, to_index); for (size_t i = from_index; i < to_index; ++i) { out->print_cr(" entry " SIZE_FORMAT_W(8) " | " PTR_FORMAT " : %3u", - i, p2i(_array->address_for_index(i)), - (uint) _array->offset_array(i)); + i, p2i(_bot->address_for_index(i)), + (uint) _bot->offset_array(i)); } -} -#endif // !PRODUCT - -////////////////////////////////////////////////////////////////////// -// G1BlockOffsetArrayContigSpace -////////////////////////////////////////////////////////////////////// - -HeapWord* -G1BlockOffsetArrayContigSpace::block_start_unsafe(const void* addr) { - assert(_bottom <= addr && addr < _end, - "addr must be covered by this Array"); - HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1); - return forward_to_block_containing_addr(q, addr); -} - -HeapWord* -G1BlockOffsetArrayContigSpace:: -block_start_unsafe_const(const void* addr) const { - assert(_bottom <= addr && addr < _end, - "addr must be covered by this Array"); - HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1); - HeapWord* n = q + block_size(q); - return forward_to_block_containing_addr_const(q, n, addr); -} - -G1BlockOffsetArrayContigSpace:: -G1BlockOffsetArrayContigSpace(G1BlockOffsetSharedArray* array, - MemRegion mr) : - G1BlockOffsetArray(array, mr) -{ - _next_offset_threshold = NULL; - _next_offset_index = 0; -} - -HeapWord* G1BlockOffsetArrayContigSpace::initialize_threshold_raw() { - assert(!G1CollectedHeap::heap()->is_in_reserved(_array->_offset_array), - "just checking"); - _next_offset_index = _array->index_for_raw(_bottom); - _next_offset_index++; - _next_offset_threshold = - _array->address_for_index_raw(_next_offset_index); - return _next_offset_threshold; -} - -void G1BlockOffsetArrayContigSpace::zero_bottom_entry_raw() { - assert(!G1CollectedHeap::heap()->is_in_reserved(_array->_offset_array), - "just checking"); - size_t bottom_index = _array->index_for_raw(_bottom); - assert(_array->address_for_index_raw(bottom_index) == _bottom, - "Precondition of call"); - _array->set_offset_array_raw(bottom_index, 0); -} - -HeapWord* G1BlockOffsetArrayContigSpace::initialize_threshold() { - assert(!G1CollectedHeap::heap()->is_in_reserved(_array->_offset_array), - "just checking"); - _next_offset_index = _array->index_for(_bottom); - _next_offset_index++; - _next_offset_threshold = - _array->address_for_index(_next_offset_index); - return _next_offset_threshold; -} - -void G1BlockOffsetArrayContigSpace::set_for_starts_humongous(HeapWord* obj_top, size_t fill_size) { - // The first BOT entry should have offset 0. - reset_bot(); - alloc_block(_bottom, obj_top); - if (fill_size > 0) { - alloc_block(obj_top, fill_size); - } -} - -#ifndef PRODUCT -void G1BlockOffsetArrayContigSpace::print_on(outputStream* out) { - G1BlockOffsetArray::print_on(out); out->print_cr(" next offset threshold: " PTR_FORMAT, p2i(_next_offset_threshold)); out->print_cr(" next offset index: " SIZE_FORMAT, _next_offset_index); } #endif // !PRODUCT + +HeapWord* G1BlockOffsetTablePart::initialize_threshold_raw() { + assert(!G1CollectedHeap::heap()->is_in_reserved(_bot->_offset_array), + "just checking"); + _next_offset_index = _bot->index_for_raw(_space->bottom()); + _next_offset_index++; + _next_offset_threshold = + _bot->address_for_index_raw(_next_offset_index); + return _next_offset_threshold; +} + +void G1BlockOffsetTablePart::zero_bottom_entry_raw() { + assert(!G1CollectedHeap::heap()->is_in_reserved(_bot->_offset_array), + "just checking"); + size_t bottom_index = _bot->index_for_raw(_space->bottom()); + assert(_bot->address_for_index_raw(bottom_index) == _space->bottom(), + "Precondition of call"); + _bot->set_offset_array_raw(bottom_index, 0); +} + +HeapWord* G1BlockOffsetTablePart::initialize_threshold() { + assert(!G1CollectedHeap::heap()->is_in_reserved(_bot->_offset_array), + "just checking"); + _next_offset_index = _bot->index_for(_space->bottom()); + _next_offset_index++; + _next_offset_threshold = + _bot->address_for_index(_next_offset_index); + return _next_offset_threshold; +} + +void G1BlockOffsetTablePart::set_for_starts_humongous(HeapWord* obj_top, size_t fill_size) { + // The first BOT entry should have offset 0. + reset_bot(); + alloc_block(_space->bottom(), obj_top); + if (fill_size > 0) { + alloc_block(obj_top, fill_size); + } +} diff --git a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp index 7c900fb960a..3e968e020e4 100644 --- a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp +++ b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp @@ -30,119 +30,25 @@ #include "memory/virtualspace.hpp" #include "utilities/globalDefinitions.hpp" -// The CollectedHeap type requires subtypes to implement a method -// "block_start". For some subtypes, notably generational -// systems using card-table-based write barriers, the efficiency of this -// operation may be important. Implementations of the "BlockOffsetArray" -// class may be useful in providing such efficient implementations. -// -// While generally mirroring the structure of the BOT for GenCollectedHeap, -// the following types are tailored more towards G1's uses; these should, -// however, be merged back into a common BOT to avoid code duplication -// and reduce maintenance overhead. -// -// G1BlockOffsetTable (abstract) -// -- G1BlockOffsetArray (uses G1BlockOffsetSharedArray) -// -- G1BlockOffsetArrayContigSpace -// -// A main impediment to the consolidation of this code might be the -// effect of making some of the block_start*() calls non-const as -// below. Whether that might adversely affect performance optimizations -// that compilers might normally perform in the case of non-G1 -// collectors needs to be carefully investigated prior to any such -// consolidation. - // Forward declarations -class G1BlockOffsetSharedArray; -class G1OffsetTableContigSpace; - -class G1BlockOffsetTable VALUE_OBJ_CLASS_SPEC { - friend class VMStructs; -protected: - // These members describe the region covered by the table. - - // The space this table is covering. - HeapWord* _bottom; // == reserved.start - HeapWord* _end; // End of currently allocated region. - -public: - // Initialize the table to cover the given space. - // The contents of the initial table are undefined. - G1BlockOffsetTable(HeapWord* bottom, HeapWord* end) : - _bottom(bottom), _end(end) - { - assert(_bottom <= _end, "arguments out of order"); - } - - // Note that the committed size of the covered space may have changed, - // so the table size might also wish to change. - virtual void resize(size_t new_word_size) = 0; - - virtual void set_bottom(HeapWord* new_bottom) { - assert(new_bottom <= _end, - "new_bottom (" PTR_FORMAT ") > _end (" PTR_FORMAT ")", - p2i(new_bottom), p2i(_end)); - _bottom = new_bottom; - resize(pointer_delta(_end, _bottom)); - } - - // Requires "addr" to be contained by a block, and returns the address of - // the start of that block. (May have side effects, namely updating of - // shared array entries that "point" too far backwards. This can occur, - // for example, when LAB allocation is used in a space covered by the - // table.) - virtual HeapWord* block_start_unsafe(const void* addr) = 0; - // Same as above, but does not have any of the possible side effects - // discussed above. - virtual HeapWord* block_start_unsafe_const(const void* addr) const = 0; - - // Returns the address of the start of the block containing "addr", or - // else "null" if it is covered by no block. (May have side effects, - // namely updating of shared array entries that "point" too far - // backwards. This can occur, for example, when lab allocation is used - // in a space covered by the table.) - inline HeapWord* block_start(const void* addr); - // Same as above, but does not have any of the possible side effects - // discussed above. - inline HeapWord* block_start_const(const void* addr) const; -}; - -class G1BlockOffsetSharedArrayMappingChangedListener : public G1MappingChangedListener { - public: - virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled) { - // Nothing to do. The BOT is hard-wired to be part of the HeapRegion, and we cannot - // retrieve it here since this would cause firing of several asserts. The code - // executed after commit of a region already needs to do some re-initialization of - // the HeapRegion, so we combine that. - } -}; +class G1BlockOffsetTable; +class G1ContiguousSpace; // This implementation of "G1BlockOffsetTable" divides the covered region // into "N"-word subregions (where "N" = 2^"LogN". An array with an entry // for each such subregion indicates how far back one must go to find the // start of the chunk that includes the first word of the subregion. // -// Each BlockOffsetArray is owned by a Space. However, the actual array -// may be shared by several BlockOffsetArrays; this is useful -// when a single resizable area (such as a generation) is divided up into -// several spaces in which contiguous allocation takes place, -// such as, for example, in G1 or in the train generation.) +// Each G1BlockOffsetTablePart is owned by a G1ContiguousSpace. -// Here is the shared array type. - -class G1BlockOffsetSharedArray: public CHeapObj { - friend class G1BlockOffsetArray; - friend class G1BlockOffsetArrayContigSpace; +class G1BlockOffsetTable: public CHeapObj { + friend class G1BlockOffsetTablePart; friend class VMStructs; private: - G1BlockOffsetSharedArrayMappingChangedListener _listener; - // The reserved region covered by the shared array. + // The reserved region covered by the table. MemRegion _reserved; - // End of the current committed region. - HeapWord* _end; - // Array for keeping offsets for retrieving object start fast given an // address. u_char* _offset_array; // byte array keeping backwards offsets @@ -192,13 +98,9 @@ public: N_words = 1 << LogN_words }; - // Initialize the table to cover from "base" to (at least) - // "base + init_word_size". In the future, the table may be expanded - // (see "resize" below) up to the size of "_reserved" (which must be at - // least "init_word_size".) The contents of the initial table are - // undefined; it is the responsibility of the constituent - // G1BlockOffsetTable(s) to initialize cards. - G1BlockOffsetSharedArray(MemRegion heap, G1RegionToSpaceMapper* storage); + // Initialize the Block Offset Table to cover the memory region passed + // in the heap parameter. + G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* storage); // Return the appropriate index into "_offset_array" for "p". inline size_t index_for(const void* p) const; @@ -213,29 +115,24 @@ public: } }; -// And here is the G1BlockOffsetTable subtype that uses the array. - -class G1BlockOffsetArray: public G1BlockOffsetTable { - friend class G1BlockOffsetSharedArray; - friend class G1BlockOffsetArrayContigSpace; +class G1BlockOffsetTablePart VALUE_OBJ_CLASS_SPEC { + friend class G1BlockOffsetTable; friend class VMStructs; private: enum SomePrivateConstants { - N_words = G1BlockOffsetSharedArray::N_words, - LogN = G1BlockOffsetSharedArray::LogN + N_words = G1BlockOffsetTable::N_words, + LogN = G1BlockOffsetTable::LogN }; - // This is the array, which can be shared by several BlockOffsetArray's - // servicing different - G1BlockOffsetSharedArray* _array; + // allocation boundary at which offset array must be updated + HeapWord* _next_offset_threshold; + size_t _next_offset_index; // index corresponding to that boundary + + // This is the global BlockOffsetTable. + G1BlockOffsetTable* _bot; // The space that owns this subregion. - G1OffsetTableContigSpace* _gsp; - - // The portion [_unallocated_block, _sp.end()) of the space that - // is a single block known not to contain any objects. - // NOTE: See BlockOffsetArrayUseUnallocatedBlock flag. - HeapWord* _unallocated_block; + G1ContiguousSpace* _space; // Sets the entries // corresponding to the cards starting at "start" and ending at "end" @@ -246,9 +143,12 @@ private: // that is closed: [start_index, end_index] void set_remainder_to_point_to_start_incl(size_t start, size_t end); -protected: - - G1OffsetTableContigSpace* gsp() const { return _gsp; } + // Zero out the entry for _bottom (offset will be zero). Does not check for availability of the + // memory first. + void zero_bottom_entry_raw(); + // Variant of initialize_threshold that does not check for availability of the + // memory first. + HeapWord* initialize_threshold_raw(); inline size_t block_size(const HeapWord* p) const; @@ -263,9 +163,8 @@ protected: // next block (or the end of the space.) Return the address of the // beginning of the block that contains "addr". Does so without side // effects (see, e.g., spec of block_start.) - inline HeapWord* - forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, - const void* addr) const; + inline HeapWord* forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, + const void* addr) const; // "q" is a block boundary that is <= "addr"; return the address of the // beginning of the block that contains "addr". May have side effects @@ -288,60 +187,26 @@ protected: // starting at "*threshold_", and for any other indices crossed by the // block. Updates "*threshold_" and "*index_" to correspond to the first // index after the block end. - void alloc_block_work2(HeapWord** threshold_, size_t* index_, - HeapWord* blk_start, HeapWord* blk_end); - -public: - // The space may not have it's bottom and top set yet, which is why the - // region is passed as a parameter. The elements of the array are - // initialized to zero. - G1BlockOffsetArray(G1BlockOffsetSharedArray* array, MemRegion mr); - - // Note: this ought to be part of the constructor, but that would require - // "this" to be passed as a parameter to a member constructor for - // the containing concrete subtype of Space. - // This would be legal C++, but MS VC++ doesn't allow it. - void set_space(G1OffsetTableContigSpace* sp); - - // Resets the covered region to one with the same _bottom as before but - // the "new_word_size". - void resize(size_t new_word_size); - - virtual HeapWord* block_start_unsafe(const void* addr); - virtual HeapWord* block_start_unsafe_const(const void* addr) const; + void alloc_block_work(HeapWord** threshold_, size_t* index_, + HeapWord* blk_start, HeapWord* blk_end); void check_all_cards(size_t left_card, size_t right_card) const; +public: + // The elements of the array are initialized to zero. + G1BlockOffsetTablePart(G1BlockOffsetTable* array, G1ContiguousSpace* gsp); + void verify() const; - virtual void print_on(outputStream* out) PRODUCT_RETURN; -}; - -// A subtype of BlockOffsetArray that takes advantage of the fact -// that its underlying space is a ContiguousSpace, so that its "active" -// region can be more efficiently tracked (than for a non-contiguous space). -class G1BlockOffsetArrayContigSpace: public G1BlockOffsetArray { - friend class VMStructs; - - // allocation boundary at which offset array must be updated - HeapWord* _next_offset_threshold; - size_t _next_offset_index; // index corresponding to that boundary - - // Work function to be called when allocation start crosses the next - // threshold in the contig space. - void alloc_block_work1(HeapWord* blk_start, HeapWord* blk_end) { - alloc_block_work2(&_next_offset_threshold, &_next_offset_index, - blk_start, blk_end); - } - - // Zero out the entry for _bottom (offset will be zero). Does not check for availability of the - // memory first. - void zero_bottom_entry_raw(); - // Variant of initialize_threshold that does not check for availability of the - // memory first. - HeapWord* initialize_threshold_raw(); - public: - G1BlockOffsetArrayContigSpace(G1BlockOffsetSharedArray* array, MemRegion mr); + // Returns the address of the start of the block containing "addr", or + // else "null" if it is covered by no block. (May have side effects, + // namely updating of shared array entries that "point" too far + // backwards. This can occur, for example, when lab allocation is used + // in a space covered by the table.) + inline HeapWord* block_start(const void* addr); + // Same as above, but does not have any of the possible side effects + // discussed above. + inline HeapWord* block_start_const(const void* addr) const; // Initialize the threshold to reflect the first boundary after the // bottom of the covered region. @@ -362,19 +227,16 @@ class G1BlockOffsetArrayContigSpace: public G1BlockOffsetArray { // never exceeds the "_next_offset_threshold". void alloc_block(HeapWord* blk_start, HeapWord* blk_end) { if (blk_end > _next_offset_threshold) { - alloc_block_work1(blk_start, blk_end); + alloc_block_work(&_next_offset_threshold, &_next_offset_index, blk_start, blk_end); } } void alloc_block(HeapWord* blk, size_t size) { alloc_block(blk, blk+size); } - HeapWord* block_start_unsafe(const void* addr); - HeapWord* block_start_unsafe_const(const void* addr) const; - void set_for_starts_humongous(HeapWord* obj_top, size_t fill_size); - virtual void print_on(outputStream* out) PRODUCT_RETURN; + void print_on(outputStream* out) PRODUCT_RETURN; }; #endif // SHARE_VM_GC_G1_G1BLOCKOFFSETTABLE_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp index 202d4e5bb94..8341c27f1ca 100644 --- a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp @@ -30,34 +30,36 @@ #include "gc/shared/memset_with_concurrent_readers.hpp" #include "gc/shared/space.hpp" -inline HeapWord* G1BlockOffsetTable::block_start(const void* addr) { - if (addr >= _bottom && addr < _end) { - return block_start_unsafe(addr); +inline HeapWord* G1BlockOffsetTablePart::block_start(const void* addr) { + if (addr >= _space->bottom() && addr < _space->end()) { + HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1); + return forward_to_block_containing_addr(q, addr); } else { return NULL; } } -inline HeapWord* -G1BlockOffsetTable::block_start_const(const void* addr) const { - if (addr >= _bottom && addr < _end) { - return block_start_unsafe_const(addr); +inline HeapWord* G1BlockOffsetTablePart::block_start_const(const void* addr) const { + if (addr >= _space->bottom() && addr < _space->end()) { + HeapWord* q = block_at_or_preceding(addr, true, _next_offset_index-1); + HeapWord* n = q + block_size(q); + return forward_to_block_containing_addr_const(q, n, addr); } else { return NULL; } } -u_char G1BlockOffsetSharedArray::offset_array(size_t index) const { +u_char G1BlockOffsetTable::offset_array(size_t index) const { check_index(index, "index out of range"); return _offset_array[index]; } -void G1BlockOffsetSharedArray::set_offset_array(size_t index, u_char offset) { +void G1BlockOffsetTable::set_offset_array(size_t index, u_char offset) { check_index(index, "index out of range"); set_offset_array_raw(index, offset); } -void G1BlockOffsetSharedArray::set_offset_array(size_t index, HeapWord* high, HeapWord* low) { +void G1BlockOffsetTable::set_offset_array(size_t index, HeapWord* high, HeapWord* low) { check_index(index, "index out of range"); assert(high >= low, "addresses out of order"); size_t offset = pointer_delta(high, low); @@ -65,7 +67,7 @@ void G1BlockOffsetSharedArray::set_offset_array(size_t index, HeapWord* high, He set_offset_array(index, (u_char)offset); } -void G1BlockOffsetSharedArray::set_offset_array(size_t left, size_t right, u_char offset) { +void G1BlockOffsetTable::set_offset_array(size_t left, size_t right, u_char offset) { check_index(right, "right index out of range"); assert(left <= right, "indexes out of order"); size_t num_cards = right - left + 1; @@ -73,11 +75,11 @@ void G1BlockOffsetSharedArray::set_offset_array(size_t left, size_t right, u_cha } // Variant of index_for that does not check the index for validity. -inline size_t G1BlockOffsetSharedArray::index_for_raw(const void* p) const { +inline size_t G1BlockOffsetTable::index_for_raw(const void* p) const { return pointer_delta((char*)p, _reserved.start(), sizeof(char)) >> LogN; } -inline size_t G1BlockOffsetSharedArray::index_for(const void* p) const { +inline size_t G1BlockOffsetTable::index_for(const void* p) const { char* pc = (char*)p; assert(pc >= (char*)_reserved.start() && pc < (char*)_reserved.end(), @@ -88,8 +90,7 @@ inline size_t G1BlockOffsetSharedArray::index_for(const void* p) const { return result; } -inline HeapWord* -G1BlockOffsetSharedArray::address_for_index(size_t index) const { +inline HeapWord* G1BlockOffsetTable::address_for_index(size_t index) const { check_index(index, "index out of range"); HeapWord* result = address_for_index_raw(index); assert(result >= _reserved.start() && result < _reserved.end(), @@ -99,47 +100,45 @@ G1BlockOffsetSharedArray::address_for_index(size_t index) const { return result; } -inline size_t -G1BlockOffsetArray::block_size(const HeapWord* p) const { - return gsp()->block_size(p); +inline size_t G1BlockOffsetTablePart::block_size(const HeapWord* p) const { + return _space->block_size(p); } -inline HeapWord* -G1BlockOffsetArray::block_at_or_preceding(const void* addr, - bool has_max_index, - size_t max_index) const { - assert(_array->offset_array(0) == 0, "objects can't cross covered areas"); - size_t index = _array->index_for(addr); +inline HeapWord* G1BlockOffsetTablePart::block_at_or_preceding(const void* addr, + bool has_max_index, + size_t max_index) const { + assert(_bot->offset_array(0) == 0, "objects can't cross covered areas"); + size_t index = _bot->index_for(addr); // We must make sure that the offset table entry we use is valid. If // "addr" is past the end, start at the last known one and go forward. if (has_max_index) { index = MIN2(index, max_index); } - HeapWord* q = _array->address_for_index(index); + HeapWord* q = _bot->address_for_index(index); - uint offset = _array->offset_array(index); // Extend u_char to uint. + uint offset = _bot->offset_array(index); // Extend u_char to uint. while (offset >= N_words) { // The excess of the offset from N_words indicates a power of Base // to go back by. size_t n_cards_back = BlockOffsetArray::entry_to_cards_back(offset); q -= (N_words * n_cards_back); index -= n_cards_back; - offset = _array->offset_array(index); + offset = _bot->offset_array(index); } assert(offset < N_words, "offset too large"); q -= offset; return q; } -inline HeapWord* -G1BlockOffsetArray:: -forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, - const void* addr) const { - if (addr >= gsp()->top()) return gsp()->top(); +inline HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, + const void* addr) const { + if (addr >= _space->top()) return _space->top(); while (n <= addr) { q = n; oop obj = oop(q); - if (obj->klass_or_null() == NULL) return q; + if (obj->klass_or_null() == NULL) { + return q; + } n += block_size(q); } assert(q <= n, "wrong order for q and addr"); @@ -147,10 +146,11 @@ forward_to_block_containing_addr_const(HeapWord* q, HeapWord* n, return q; } -inline HeapWord* -G1BlockOffsetArray::forward_to_block_containing_addr(HeapWord* q, - const void* addr) { - if (oop(q)->klass_or_null() == NULL) return q; +inline HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr(HeapWord* q, + const void* addr) { + if (oop(q)->klass_or_null() == NULL) { + return q; + } HeapWord* n = q + block_size(q); // In the normal case, where the query "addr" is a card boundary, and the // offset table chunks are the same size as cards, the block starting at diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index f8705d626bf..b1a9819aab3 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -1745,7 +1745,7 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : _is_alive_closure_stw(this), _ref_processor_cm(NULL), _ref_processor_stw(NULL), - _bot_shared(NULL), + _bot(NULL), _cg1r(NULL), _g1mm(NULL), _refine_cte_cl(NULL), @@ -1906,8 +1906,8 @@ jint G1CollectedHeap::initialize() { // Create storage for the BOT, card table, card counts table (hot card cache) and the bitmaps. G1RegionToSpaceMapper* bot_storage = create_aux_memory_mapper("Block offset table", - G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize), - G1BlockOffsetSharedArray::heap_map_factor()); + G1BlockOffsetTable::compute_size(g1_rs.size() / HeapWordSize), + G1BlockOffsetTable::heap_map_factor()); ReservedSpace cardtable_rs(G1SATBCardTableLoggingModRefBS::compute_size(g1_rs.size() / HeapWordSize)); G1RegionToSpaceMapper* cardtable_storage = @@ -1945,7 +1945,7 @@ jint G1CollectedHeap::initialize() { FreeRegionList::set_unrealistically_long_length(max_regions() + 1); - _bot_shared = new G1BlockOffsetSharedArray(reserved_region(), bot_storage); + _bot = new G1BlockOffsetTable(reserved_region(), bot_storage); { HeapWord* start = _hrm.reserved().start(); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index 2ba6704bf8d..de5088f1f03 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -154,7 +154,7 @@ private: uint _expansion_regions; // The block offset table for the G1 heap. - G1BlockOffsetSharedArray* _bot_shared; + G1BlockOffsetTable* _bot; // Tears down the region sets / lists so that they are empty and the // regions on the heap do not belong to a region set / list. The @@ -1008,7 +1008,7 @@ public: void iterate_dirty_card_closure(CardTableEntryClosure* cl, uint worker_i); // The shared block offset table array. - G1BlockOffsetSharedArray* bot_shared() const { return _bot_shared; } + G1BlockOffsetTable* bot() const { return _bot; } // Reference Processing accessors diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap_ext.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap_ext.cpp index 0c04c106aad..a4a9617edb4 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap_ext.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap_ext.cpp @@ -36,5 +36,5 @@ bool G1CollectedHeap::copy_allocation_context_stats(const jint* contexts, HeapRegion* G1CollectedHeap::new_heap_region(uint hrs_index, MemRegion mr) { - return new HeapRegion(hrs_index, bot_shared(), mr); + return new HeapRegion(hrs_index, bot(), mr); } diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp index 699388513a8..c1b83e7345b 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp @@ -97,7 +97,7 @@ ScanRSClosure::ScanRSClosure(G1ParPushHeapRSClosure* oc, _worker_i(worker_i), _try_claimed(false) { _g1h = G1CollectedHeap::heap(); - _bot_shared = _g1h->bot_shared(); + _bot = _g1h->bot(); _ct_bs = _g1h->g1_barrier_set(); _block_size = MAX2(G1RSetScanBlockSize, 1); } @@ -109,7 +109,7 @@ void ScanRSClosure::scanCard(size_t index, HeapRegion *r) { // Set the "from" region in the closure. _oc->set_region(r); - MemRegion card_region(_bot_shared->address_for_index(index), G1BlockOffsetSharedArray::N_words); + MemRegion card_region(_bot->address_for_index(index), G1BlockOffsetTable::N_words); MemRegion pre_gc_allocated(r->bottom(), r->scan_top()); MemRegion mr = pre_gc_allocated.intersection(card_region); if (!mr.is_empty() && !_ct_bs->is_card_claimed(index)) { @@ -153,7 +153,7 @@ bool ScanRSClosure::doHeapRegion(HeapRegion* r) { jump_to_card = hrrs->iter_claimed_next(_block_size); } if (current_card < jump_to_card) continue; - HeapWord* card_start = _g1h->bot_shared()->address_for_index(card_index); + HeapWord* card_start = _g1h->bot()->address_for_index(card_index); HeapRegion* card_region = _g1h->heap_region_containing(card_start); _cards++; diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp index 6c987945a18..8aab4ca498c 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp @@ -36,7 +36,7 @@ class BitMap; class CardTableModRefBS; -class G1BlockOffsetSharedArray; +class G1BlockOffsetTable; class ConcurrentG1Refine; class CodeBlobClosure; class G1CollectedHeap; @@ -171,7 +171,7 @@ class ScanRSClosure : public HeapRegionClosure { G1ParPushHeapRSClosure* _oc; CodeBlobClosure* _code_root_cl; - G1BlockOffsetSharedArray* _bot_shared; + G1BlockOffsetTable* _bot; G1SATBCardTableModRefBS *_ct_bs; double _strong_code_root_scan_time_sec; diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.cpp b/hotspot/src/share/vm/gc/g1/heapRegion.cpp index 5ba5df6446d..1a63fa377ed 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp @@ -153,7 +153,7 @@ void HeapRegion::setup_heap_region_size(size_t initial_heap_size, size_t max_hea } void HeapRegion::reset_after_compaction() { - G1OffsetTableContigSpace::reset_after_compaction(); + G1ContiguousSpace::reset_after_compaction(); // After a compaction the mark bitmap is invalid, so we must // treat all objects as being inside the unmarked area. zero_marked_bytes(); @@ -183,7 +183,6 @@ void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) { } zero_marked_bytes(); - _offsets.resize(HeapRegion::GrainWords); init_top_at_mark_start(); if (clear_space) clear(SpaceDecorator::Mangle); } @@ -219,7 +218,7 @@ void HeapRegion::set_starts_humongous(HeapWord* obj_top, size_t fill_size) { _type.set_starts_humongous(); _humongous_start_region = this; - _offsets.set_for_starts_humongous(obj_top, fill_size); + _bot_part.set_for_starts_humongous(obj_top, fill_size); } void HeapRegion::set_continues_humongous(HeapRegion* first_hr) { @@ -239,9 +238,9 @@ void HeapRegion::clear_humongous() { } HeapRegion::HeapRegion(uint hrm_index, - G1BlockOffsetSharedArray* sharedOffsetArray, + G1BlockOffsetTable* bot, MemRegion mr) : - G1OffsetTableContigSpace(sharedOffsetArray, mr), + G1ContiguousSpace(bot), _hrm_index(hrm_index), _allocation_context(AllocationContext::system()), _humongous_start_region(NULL), @@ -257,7 +256,7 @@ HeapRegion::HeapRegion(uint hrm_index, _rem_set(NULL), _recorded_rs_length(0), _predicted_elapsed_time_ms(0), _predicted_bytes_to_copy(0) { - _rem_set = new HeapRegionRemSet(sharedOffsetArray, this); + _rem_set = new HeapRegionRemSet(bot, this); initialize(mr); } @@ -265,7 +264,7 @@ HeapRegion::HeapRegion(uint hrm_index, void HeapRegion::initialize(MemRegion mr, bool clear_space, bool mangle_space) { assert(_rem_set->is_empty(), "Remembered set must be empty"); - G1OffsetTableContigSpace::initialize(mr, clear_space, mangle_space); + G1ContiguousSpace::initialize(mr, clear_space, mangle_space); hr_clear(false /*par*/, false /*clear_space*/); set_top(bottom()); @@ -773,7 +772,7 @@ void HeapRegion::verify(VerifyOption vo, } if (!is_young() && !is_empty()) { - _offsets.verify(); + _bot_part.verify(); } if (is_region_humongous) { @@ -797,7 +796,7 @@ void HeapRegion::verify(VerifyOption vo, if (p < the_end) { // Look up top HeapWord* addr_1 = p; - HeapWord* b_start_1 = _offsets.block_start_const(addr_1); + HeapWord* b_start_1 = _bot_part.block_start_const(addr_1); if (b_start_1 != p) { log_info(gc, verify)("BOT look up for top: " PTR_FORMAT " " " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, @@ -809,7 +808,7 @@ void HeapRegion::verify(VerifyOption vo, // Look up top + 1 HeapWord* addr_2 = p + 1; if (addr_2 < the_end) { - HeapWord* b_start_2 = _offsets.block_start_const(addr_2); + HeapWord* b_start_2 = _bot_part.block_start_const(addr_2); if (b_start_2 != p) { log_info(gc, verify)("BOT look up for top + 1: " PTR_FORMAT " " " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, @@ -823,7 +822,7 @@ void HeapRegion::verify(VerifyOption vo, size_t diff = pointer_delta(the_end, p) / 2; HeapWord* addr_3 = p + diff; if (addr_3 < the_end) { - HeapWord* b_start_3 = _offsets.block_start_const(addr_3); + HeapWord* b_start_3 = _bot_part.block_start_const(addr_3); if (b_start_3 != p) { log_info(gc, verify)("BOT look up for top + diff: " PTR_FORMAT " " " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, @@ -835,7 +834,7 @@ void HeapRegion::verify(VerifyOption vo, // Look up end - 1 HeapWord* addr_4 = the_end - 1; - HeapWord* b_start_4 = _offsets.block_start_const(addr_4); + HeapWord* b_start_4 = _bot_part.block_start_const(addr_4); if (b_start_4 != p) { log_info(gc, verify)("BOT look up for end - 1: " PTR_FORMAT " " " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, @@ -860,52 +859,41 @@ void HeapRegion::prepare_for_compaction(CompactPoint* cp) { // G1OffsetTableContigSpace code; copied from space.cpp. Hope this can go // away eventually. -void G1OffsetTableContigSpace::clear(bool mangle_space) { +void G1ContiguousSpace::clear(bool mangle_space) { set_top(bottom()); _scan_top = bottom(); CompactibleSpace::clear(mangle_space); reset_bot(); } -void G1OffsetTableContigSpace::set_bottom(HeapWord* new_bottom) { - Space::set_bottom(new_bottom); - _offsets.set_bottom(new_bottom); -} - -void G1OffsetTableContigSpace::set_end(HeapWord* new_end) { - assert(new_end == _bottom + HeapRegion::GrainWords, "set_end should only ever be set to _bottom + HeapRegion::GrainWords"); - Space::set_end(new_end); - _offsets.resize(new_end - bottom()); -} - #ifndef PRODUCT -void G1OffsetTableContigSpace::mangle_unused_area() { +void G1ContiguousSpace::mangle_unused_area() { mangle_unused_area_complete(); } -void G1OffsetTableContigSpace::mangle_unused_area_complete() { +void G1ContiguousSpace::mangle_unused_area_complete() { SpaceMangler::mangle_region(MemRegion(top(), end())); } #endif -void G1OffsetTableContigSpace::print() const { +void G1ContiguousSpace::print() const { print_short(); tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", - p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end())); + p2i(bottom()), p2i(top()), p2i(_bot_part.threshold()), p2i(end())); } -HeapWord* G1OffsetTableContigSpace::initialize_threshold() { - return _offsets.initialize_threshold(); +HeapWord* G1ContiguousSpace::initialize_threshold() { + return _bot_part.initialize_threshold(); } -HeapWord* G1OffsetTableContigSpace::cross_threshold(HeapWord* start, +HeapWord* G1ContiguousSpace::cross_threshold(HeapWord* start, HeapWord* end) { - _offsets.alloc_block(start, end); - return _offsets.threshold(); + _bot_part.alloc_block(start, end); + return _bot_part.threshold(); } -HeapWord* G1OffsetTableContigSpace::scan_top() const { +HeapWord* G1ContiguousSpace::scan_top() const { G1CollectedHeap* g1h = G1CollectedHeap::heap(); HeapWord* local_top = top(); OrderAccess::loadload(); @@ -918,7 +906,7 @@ HeapWord* G1OffsetTableContigSpace::scan_top() const { } } -void G1OffsetTableContigSpace::record_timestamp() { +void G1ContiguousSpace::record_timestamp() { G1CollectedHeap* g1h = G1CollectedHeap::heap(); unsigned curr_gc_time_stamp = g1h->get_gc_time_stamp(); @@ -935,17 +923,17 @@ void G1OffsetTableContigSpace::record_timestamp() { } } -void G1OffsetTableContigSpace::record_retained_region() { +void G1ContiguousSpace::record_retained_region() { // scan_top is the maximum address where it's safe for the next gc to // scan this region. _scan_top = top(); } -void G1OffsetTableContigSpace::safe_object_iterate(ObjectClosure* blk) { +void G1ContiguousSpace::safe_object_iterate(ObjectClosure* blk) { object_iterate(blk); } -void G1OffsetTableContigSpace::object_iterate(ObjectClosure* blk) { +void G1ContiguousSpace::object_iterate(ObjectClosure* blk) { HeapWord* p = bottom(); while (p < top()) { if (block_is_obj(p)) { @@ -955,17 +943,14 @@ void G1OffsetTableContigSpace::object_iterate(ObjectClosure* blk) { } } -G1OffsetTableContigSpace:: -G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray, - MemRegion mr) : - _offsets(sharedOffsetArray, mr), +G1ContiguousSpace::G1ContiguousSpace(G1BlockOffsetTable* bot) : + _bot_part(bot, this), _par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true), _gc_time_stamp(0) { - _offsets.set_space(this); } -void G1OffsetTableContigSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) { +void G1ContiguousSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) { CompactibleSpace::initialize(mr, clear_space, mangle_space); _top = bottom(); _scan_top = bottom(); diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.hpp b/hotspot/src/share/vm/gc/g1/heapRegion.hpp index 77fa01ce9d2..171db485327 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.hpp @@ -115,12 +115,12 @@ public: // The time stamps are re-initialized to zero at cleanup and at Full GCs. // The current scheme that uses sequential unsigned ints will fail only if we have 4b // evacuation pauses between two cleanups, which is _highly_ unlikely. -class G1OffsetTableContigSpace: public CompactibleSpace { +class G1ContiguousSpace: public CompactibleSpace { friend class VMStructs; HeapWord* volatile _top; HeapWord* volatile _scan_top; protected: - G1BlockOffsetArrayContigSpace _offsets; + G1BlockOffsetTablePart _bot_part; Mutex _par_alloc_lock; volatile unsigned _gc_time_stamp; // When we need to retire an allocation region, while other threads @@ -132,14 +132,13 @@ class G1OffsetTableContigSpace: public CompactibleSpace { HeapWord* _pre_dummy_top; public: - G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray, - MemRegion mr); + G1ContiguousSpace(G1BlockOffsetTable* bot); void set_top(HeapWord* value) { _top = value; } HeapWord* top() const { return _top; } protected: - // Reset the G1OffsetTableContigSpace. + // Reset the G1ContiguousSpace. virtual void initialize(MemRegion mr, bool clear_space, bool mangle_space); HeapWord* volatile* top_addr() { return &_top; } @@ -167,9 +166,6 @@ class G1OffsetTableContigSpace: public CompactibleSpace { void object_iterate(ObjectClosure* blk); void safe_object_iterate(ObjectClosure* blk); - void set_bottom(HeapWord* value); - void set_end(HeapWord* value); - void mangle_unused_area() PRODUCT_RETURN; void mangle_unused_area_complete() PRODUCT_RETURN; @@ -213,15 +209,15 @@ class G1OffsetTableContigSpace: public CompactibleSpace { virtual void print() const; void reset_bot() { - _offsets.reset_bot(); + _bot_part.reset_bot(); } void print_bot_on(outputStream* out) { - _offsets.print_on(out); + _bot_part.print_on(out); } }; -class HeapRegion: public G1OffsetTableContigSpace { +class HeapRegion: public G1ContiguousSpace { friend class VMStructs; // Allow scan_and_forward to call (private) overrides for auxiliary functions on this class template @@ -233,8 +229,6 @@ class HeapRegion: public G1OffsetTableContigSpace { // issues.) HeapRegionRemSet* _rem_set; - G1BlockOffsetArrayContigSpace* offsets() { return &_offsets; } - // Auxiliary functions for scan_and_forward support. // See comments for CompactibleSpace for more information. inline HeapWord* scan_limit() const { @@ -330,7 +324,7 @@ class HeapRegion: public G1OffsetTableContigSpace { public: HeapRegion(uint hrm_index, - G1BlockOffsetSharedArray* sharedOffsetArray, + G1BlockOffsetTable* bot, MemRegion mr); // Initializing the HeapRegion not only resets the data structure, but also diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp b/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp index 245bd8ebfdf..2138155fb9d 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.inline.hpp @@ -32,9 +32,9 @@ #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" -inline HeapWord* G1OffsetTableContigSpace::allocate_impl(size_t min_word_size, - size_t desired_word_size, - size_t* actual_size) { +inline HeapWord* G1ContiguousSpace::allocate_impl(size_t min_word_size, + size_t desired_word_size, + size_t* actual_size) { HeapWord* obj = top(); size_t available = pointer_delta(end(), obj); size_t want_to_allocate = MIN2(available, desired_word_size); @@ -49,9 +49,9 @@ inline HeapWord* G1OffsetTableContigSpace::allocate_impl(size_t min_word_size, } } -inline HeapWord* G1OffsetTableContigSpace::par_allocate_impl(size_t min_word_size, - size_t desired_word_size, - size_t* actual_size) { +inline HeapWord* G1ContiguousSpace::par_allocate_impl(size_t min_word_size, + size_t desired_word_size, + size_t* actual_size) { do { HeapWord* obj = top(); size_t available = pointer_delta(end(), obj); @@ -73,22 +73,22 @@ inline HeapWord* G1OffsetTableContigSpace::par_allocate_impl(size_t min_word_siz } while (true); } -inline HeapWord* G1OffsetTableContigSpace::allocate(size_t min_word_size, - size_t desired_word_size, - size_t* actual_size) { +inline HeapWord* G1ContiguousSpace::allocate(size_t min_word_size, + size_t desired_word_size, + size_t* actual_size) { HeapWord* res = allocate_impl(min_word_size, desired_word_size, actual_size); if (res != NULL) { - _offsets.alloc_block(res, *actual_size); + _bot_part.alloc_block(res, *actual_size); } return res; } -inline HeapWord* G1OffsetTableContigSpace::allocate(size_t word_size) { +inline HeapWord* G1ContiguousSpace::allocate(size_t word_size) { size_t temp; return allocate(word_size, word_size, &temp); } -inline HeapWord* G1OffsetTableContigSpace::par_allocate(size_t word_size) { +inline HeapWord* G1ContiguousSpace::par_allocate(size_t word_size) { size_t temp; return par_allocate(word_size, word_size, &temp); } @@ -96,20 +96,20 @@ inline HeapWord* G1OffsetTableContigSpace::par_allocate(size_t word_size) { // Because of the requirement of keeping "_offsets" up to date with the // allocations, we sequentialize these with a lock. Therefore, best if // this is used for larger LAB allocations only. -inline HeapWord* G1OffsetTableContigSpace::par_allocate(size_t min_word_size, - size_t desired_word_size, - size_t* actual_size) { +inline HeapWord* G1ContiguousSpace::par_allocate(size_t min_word_size, + size_t desired_word_size, + size_t* actual_size) { MutexLocker x(&_par_alloc_lock); return allocate(min_word_size, desired_word_size, actual_size); } -inline HeapWord* G1OffsetTableContigSpace::block_start(const void* p) { - return _offsets.block_start(p); +inline HeapWord* G1ContiguousSpace::block_start(const void* p) { + return _bot_part.block_start(p); } inline HeapWord* -G1OffsetTableContigSpace::block_start_const(const void* p) const { - return _offsets.block_start_const(p); +G1ContiguousSpace::block_start_const(const void* p) const { + return _bot_part.block_start_const(p); } inline bool diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp index 0514663b918..30fed52f93c 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp @@ -687,9 +687,9 @@ OtherRegionsTable::do_cleanup_work(HRRSCleanupTask* hrrs_cleanup_task) { _sparse_table.do_cleanup_work(hrrs_cleanup_task); } -HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, +HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetTable* bot, HeapRegion* hr) - : _bosa(bosa), + : _bot(bot), _m(Mutex::leaf, FormatBuffer<128>("HeapRegionRemSet lock #%u", hr->hrm_index()), true, Monitor::_safepoint_check_never), _code_roots(), _other_regions(hr, &_m), _iter_state(Unclaimed), _iter_claimed(0) { reset_for_par_iteration(); @@ -728,8 +728,7 @@ void HeapRegionRemSet::print() { HeapRegionRemSetIterator iter(this); size_t card_index; while (iter.has_next(card_index)) { - HeapWord* card_start = - G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index); + HeapWord* card_start = _bot->address_for_index(card_index); tty->print_cr(" Card " PTR_FORMAT, p2i(card_start)); } if (iter.n_yielded() != occupied()) { @@ -825,7 +824,7 @@ HeapRegionRemSetIterator:: HeapRegionRemSetIterator(HeapRegionRemSet* hrrs) : _hrrs(hrrs), _g1h(G1CollectedHeap::heap()), _coarse_map(&hrrs->_other_regions._coarse_map), - _bosa(hrrs->_bosa), + _bot(hrrs->_bot), _is(Sparse), // Set these values so that we increment to the first region. _coarse_cur_region_index(-1), @@ -852,7 +851,7 @@ bool HeapRegionRemSetIterator::coarse_has_next(size_t& card_index) { _coarse_cur_region_cur_card = 0; HeapWord* r_bot = _g1h->region_at((uint) _coarse_cur_region_index)->bottom(); - _cur_region_card_offset = _bosa->index_for(r_bot); + _cur_region_card_offset = _bot->index_for(r_bot); } else { return false; } @@ -893,7 +892,7 @@ void HeapRegionRemSetIterator::switch_to_prt(PerRegionTable* prt) { _fine_cur_prt = prt; HeapWord* r_bot = _fine_cur_prt->hr()->bottom(); - _cur_region_card_offset = _bosa->index_for(r_bot); + _cur_region_card_offset = _bot->index_for(r_bot); // The bitmap scan for the PRT always scans from _cur_region_cur_card + 1. // To avoid special-casing this start case, and not miss the first bitmap @@ -1001,7 +1000,7 @@ void HeapRegionRemSet::test() { size_t card_index; while (iter.has_next(card_index)) { HeapWord* card_start = - G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index); + G1CollectedHeap::heap()->bot()->address_for_index(card_index); tty->print_cr(" Card " PTR_FORMAT ".", p2i(card_start)); sum++; } diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp index 369d2aaaeed..5a286bc2836 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp @@ -34,7 +34,7 @@ // abstractly, in terms of what the "BlockOffsetTable" in use can parse. class G1CollectedHeap; -class G1BlockOffsetSharedArray; +class G1BlockOffsetTable; class HeapRegion; class HeapRegionRemSetIterator; class PerRegionTable; @@ -174,7 +174,7 @@ class HeapRegionRemSet : public CHeapObj { friend class HeapRegionRemSetIterator; private: - G1BlockOffsetSharedArray* _bosa; + G1BlockOffsetTable* _bot; // A set of code blobs (nmethods) whose code contains pointers into // the region that owns this RSet. @@ -189,7 +189,7 @@ private: volatile size_t _iter_claimed; public: - HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr); + HeapRegionRemSet(G1BlockOffsetTable* bot, HeapRegion* hr); static void setup_remset_size(); @@ -350,7 +350,7 @@ class HeapRegionRemSetIterator : public StackObj { // Local caching of HRRS fields. const BitMap* _coarse_map; - G1BlockOffsetSharedArray* _bosa; + G1BlockOffsetTable* _bot; G1CollectedHeap* _g1h; // The number of cards yielded since initialization. diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp index 1240a43c028..620d4facee0 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp @@ -381,17 +381,17 @@ void FreeRegionList_test() { MemRegion heap(NULL, num_regions_in_test * HeapRegion::GrainWords); // Allocate a fake BOT because the HeapRegion constructor initializes // the BOT. - size_t bot_size = G1BlockOffsetSharedArray::compute_size(heap.word_size()); + size_t bot_size = G1BlockOffsetTable::compute_size(heap.word_size()); HeapWord* bot_data = NEW_C_HEAP_ARRAY(HeapWord, bot_size, mtGC); - ReservedSpace bot_rs(G1BlockOffsetSharedArray::compute_size(heap.word_size())); + ReservedSpace bot_rs(G1BlockOffsetTable::compute_size(heap.word_size())); G1RegionToSpaceMapper* bot_storage = G1RegionToSpaceMapper::create_mapper(bot_rs, bot_rs.size(), os::vm_page_size(), HeapRegion::GrainBytes, - G1BlockOffsetSharedArray::N_bytes, + G1BlockOffsetTable::N_bytes, mtGC); - G1BlockOffsetSharedArray oa(heap, bot_storage); + G1BlockOffsetTable bot(heap, bot_storage); bot_storage->commit_regions(0, num_regions_in_test); // Set up memory regions for the heap regions. @@ -401,11 +401,11 @@ void FreeRegionList_test() { MemRegion mr3(mr2.end(), HeapRegion::GrainWords); MemRegion mr4(mr3.end(), HeapRegion::GrainWords); - HeapRegion hr0(0, &oa, mr0); - HeapRegion hr1(1, &oa, mr1); - HeapRegion hr2(2, &oa, mr2); - HeapRegion hr3(3, &oa, mr3); - HeapRegion hr4(4, &oa, mr4); + HeapRegion hr0(0, &bot, mr0); + HeapRegion hr1(1, &bot, mr1); + HeapRegion hr2(2, &bot, mr2); + HeapRegion hr3(3, &bot, mr3); + HeapRegion hr4(4, &bot, mr4); l.add_ordered(&hr1); l.add_ordered(&hr0); l.add_ordered(&hr3); diff --git a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp index 672c4f855ac..3c3edfe2e5e 100644 --- a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp +++ b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp @@ -35,7 +35,7 @@ static_field(HeapRegion, GrainBytes, size_t) \ static_field(HeapRegion, LogOfHRGrainBytes, int) \ \ - nonstatic_field(G1OffsetTableContigSpace, _top, HeapWord* volatile) \ + nonstatic_field(G1ContiguousSpace, _top, HeapWord* volatile) \ \ nonstatic_field(G1HeapRegionTable, _base, address) \ nonstatic_field(G1HeapRegionTable, _length, size_t) \ @@ -96,8 +96,8 @@ \ declare_type(G1CollectedHeap, CollectedHeap) \ \ - declare_type(G1OffsetTableContigSpace, CompactibleSpace) \ - declare_type(HeapRegion, G1OffsetTableContigSpace) \ + declare_type(G1ContiguousSpace, CompactibleSpace) \ + declare_type(HeapRegion, G1ContiguousSpace) \ declare_toplevel_type(HeapRegionManager) \ declare_toplevel_type(HeapRegionSetBase) \ declare_toplevel_type(G1MonitoringSupport) \ diff --git a/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp b/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp index 24f5df95429..0921e932609 100644 --- a/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp +++ b/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp @@ -248,7 +248,7 @@ public: ////////////////////////////////////////////////////////////////////////// class BlockOffsetArray: public BlockOffsetTable { friend class VMStructs; - friend class G1BlockOffsetArray; // temp. until we restructure and cleanup + friend class G1BlockOffsetTablePart; // temp. until we restructure and cleanup protected: // The following enums are used by do_block_internal() below enum Action { From 6dac872d4d18d985e10dace8fa0ed6097c2c2f9e Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Thu, 7 Jan 2016 13:53:20 -0500 Subject: [PATCH 024/212] 8141564: Convert TraceItables and PrintVtables to Unified Logging The former -XX:+TraceItables and +PrintVtables flags have been converted to UL options -Xlog:itables=trace and vtables=trace Reviewed-by: acorn, coleenp, dholmes --- .../vm/interpreter/interpreterRuntime.cpp | 6 +- .../src/share/vm/interpreter/linkResolver.cpp | 89 +++---- .../src/share/vm/interpreter/linkResolver.hpp | 4 - hotspot/src/share/vm/logging/logTag.hpp | 4 +- hotspot/src/share/vm/oops/klassVtable.cpp | 220 +++++++----------- hotspot/src/share/vm/oops/method.cpp | 9 + hotspot/src/share/vm/oops/method.hpp | 1 + hotspot/src/share/vm/runtime/globals.hpp | 6 - hotspot/test/runtime/logging/ClassB.java | 67 ++++++ hotspot/test/runtime/logging/ItablesTest.java | 58 +++++ hotspot/test/runtime/logging/VtablesTest.java | 63 +++++ hotspot/test/runtime/logging/p1/A.java | 29 +++ hotspot/test/runtime/logging/p1/C.java | 34 +++ hotspot/test/runtime/logging/p2/B.jcod | 125 ++++++++++ hotspot/test/runtime/logging/p2/D.java | 29 +++ 15 files changed, 556 insertions(+), 188 deletions(-) create mode 100644 hotspot/test/runtime/logging/ClassB.java create mode 100644 hotspot/test/runtime/logging/ItablesTest.java create mode 100644 hotspot/test/runtime/logging/VtablesTest.java create mode 100644 hotspot/test/runtime/logging/p1/A.java create mode 100644 hotspot/test/runtime/logging/p1/C.java create mode 100644 hotspot/test/runtime/logging/p2/B.jcod create mode 100644 hotspot/test/runtime/logging/p2/D.java diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index d348e8d2cac..686402ddad3 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -773,9 +773,11 @@ void InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes::Code byte if (cp_cache_entry->is_resolved(bytecode)) return; if (bytecode == Bytecodes::_invokeinterface) { - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { ResourceMark rm(thread); - tty->print_cr("Resolving: klass: %s to method: %s", info.resolved_klass()->name()->as_C_string(), info.resolved_method()->name()->as_C_string()); + log_develop_trace(itables)("Resolving: klass: %s to method: %s", + info.resolved_klass()->name()->as_C_string(), + info.resolved_method()->name()->as_C_string()); } } #ifdef ASSERT diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index e0d15337001..a118a8a6e48 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -32,9 +32,11 @@ #include "interpreter/bytecode.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/linkResolver.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.inline.hpp" #include "oops/instanceKlass.hpp" +#include "oops/method.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" @@ -728,6 +730,36 @@ methodHandle LinkResolver::resolve_method(const LinkInfo& link_info, return resolved_method; } +static void trace_method_resolution(const char* prefix, + KlassHandle klass, + KlassHandle resolved_klass, + const methodHandle& method, + bool logitables, + int index = -1) { +#ifndef PRODUCT + ResourceMark rm; + outputStream* st; + if (logitables) { + st = LogHandle(itables)::trace_stream(); + } else { + st = LogHandle(vtables)::trace_stream(); + } + st->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ", + prefix, + (klass.is_null() ? "" : klass->internal_name()), + (resolved_klass.is_null() ? "" : resolved_klass->internal_name()), + Method::name_and_sig_as_C_string(resolved_klass(), + method->name(), + method->signature()), + method->method_holder()->internal_name()); + method->print_linkage_flags(st); + if (index != -1) { + st->print("vtable_index:%d", index); + } + st->cr(); +#endif // PRODUCT +} + methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info, bool nostatics, TRAPS) { @@ -784,10 +816,10 @@ methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info, THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { trace_method_resolution("invokeinterface resolved method: caller-class", - link_info.current_klass(), resolved_klass, resolved_method); - tty->cr(); + link_info.current_klass(), resolved_klass, + resolved_method, true); } return resolved_method; @@ -1032,10 +1064,9 @@ methodHandle LinkResolver::linktime_resolve_special_method(const LinkInfo& link_ THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { trace_method_resolution("invokespecial resolved method: caller-class:", - current_klass, resolved_klass, resolved_method); - tty->cr(); + current_klass, resolved_klass, resolved_method, true); } return resolved_method; @@ -1104,10 +1135,9 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result, sel_method->signature())); } - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { trace_method_resolution("invokespecial selected method: resolved-class:", - resolved_klass, resolved_klass, sel_method); - tty->cr(); + resolved_klass, resolved_klass, sel_method, true); } // setup result @@ -1158,10 +1188,9 @@ methodHandle LinkResolver::linktime_resolve_virtual_method(const LinkInfo& link_ THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { trace_method_resolution("invokevirtual resolved method: caller-class:", - current_klass, resolved_klass, resolved_method); - tty->cr(); + current_klass, resolved_klass, resolved_method, false); } return resolved_method; @@ -1239,10 +1268,10 @@ void LinkResolver::runtime_resolve_virtual_method(CallInfo& result, selected_method->signature())); } - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { trace_method_resolution("invokevirtual selected method: receiver-class:", - recv_klass, resolved_klass, selected_method); - tty->print_cr("vtable_index:%d", vtable_index); + recv_klass, resolved_klass, selected_method, + false, vtable_index); } // setup result result.set_virtual(resolved_klass, recv_klass, resolved_method, selected_method, vtable_index, CHECK); @@ -1338,10 +1367,9 @@ void LinkResolver::runtime_resolve_interface_method(CallInfo& result, sel_method->signature())); } - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { trace_method_resolution("invokeinterface selected method: receiver-class", - recv_klass, resolved_klass, sel_method); - tty->cr(); + recv_klass, resolved_klass, sel_method, true); } // setup result if (!resolved_method->has_itable_index()) { @@ -1588,28 +1616,3 @@ void LinkResolver::resolve_dynamic_call(CallInfo& result, result.set_handle(resolved_method, resolved_appendix, resolved_method_type, THREAD); wrap_invokedynamic_exception(CHECK); } - -#ifndef PRODUCT -void LinkResolver::trace_method_resolution(const char* prefix, - KlassHandle klass, - KlassHandle resolved_klass, - const methodHandle& method) { - ResourceMark rm; - tty->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ", - prefix, - (klass.is_null() ? "" : klass->internal_name()), - (resolved_klass.is_null() ? "" : resolved_klass->internal_name()), - Method::name_and_sig_as_C_string(resolved_klass(), - method->name(), - method->signature()), - method->method_holder()->internal_name() - ); - method->access_flags().print_on(tty); - if (method->is_default_method()) { - tty->print("default "); - } - if (method->is_overpass()) { - tty->print("overpass "); - } -} -#endif // PRODUCT diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp index 198eefbe2c0..17d858e86b8 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.hpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp @@ -295,9 +295,5 @@ class LinkResolver: AllStatic { static void resolve_invoke(CallInfo& result, Handle recv, const constantPoolHandle& pool, int index, Bytecodes::Code byte, TRAPS); - private: - static void trace_method_resolution(const char* prefix, KlassHandle klass, - KlassHandle resolved_klass, - const methodHandle& method) PRODUCT_RETURN; }; #endif // SHARE_VM_INTERPRETER_LINKRESOLVER_HPP diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index f723b3548d7..aeedd0b2043 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -52,6 +52,7 @@ LOG_TAG(heap) \ LOG_TAG(humongous) \ LOG_TAG(ihop) \ + LOG_TAG(itables) \ LOG_TAG(jni) \ LOG_TAG(liveness) \ LOG_TAG(logging) \ @@ -80,7 +81,8 @@ LOG_TAG(tlab) \ LOG_TAG(time) \ LOG_TAG(verify) \ - LOG_TAG(vmoperation) + LOG_TAG(vmoperation) \ + LOG_TAG(vtables) #define PREFIX_LOG_TAG(T) (LogTag::_##T) diff --git a/hotspot/src/share/vm/oops/klassVtable.cpp b/hotspot/src/share/vm/oops/klassVtable.cpp index f5955c6bf28..a64fda544e0 100644 --- a/hotspot/src/share/vm/oops/klassVtable.cpp +++ b/hotspot/src/share/vm/oops/klassVtable.cpp @@ -26,6 +26,7 @@ #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "gc/shared/gcLocker.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.inline.hpp" #include "oops/instanceKlass.hpp" @@ -134,12 +135,12 @@ int klassVtable::initialize_from_super(KlassHandle super) { superVtable->verify(tty, true); #endif superVtable->copy_vtable_to(table()); -#ifndef PRODUCT - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { ResourceMark rm; - tty->print_cr("copy vtable from %s to %s size %d", super->internal_name(), klass()->internal_name(), _length); + log_develop_trace(vtables)("copy vtable from %s to %s size %d", + super->internal_name(), klass()->internal_name(), + _length); } -#endif return superVtable->length(); } } @@ -152,9 +153,9 @@ void klassVtable::initialize_vtable(bool checkconstraints, TRAPS) { KlassHandle super (THREAD, klass()->java_super()); int nofNewEntries = 0; - if (PrintVtables && !klass()->is_array_klass()) { + if (!klass()->is_array_klass()) { ResourceMark rm(THREAD); - tty->print_cr("Initializing: %s", _klass->name()->as_C_string()); + log_develop_debug(vtables)("Initializing: %s", _klass->name()->as_C_string()); } #ifdef ASSERT @@ -271,24 +272,19 @@ InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper assert(super_method->name() == name && super_method->signature() == signature, "vtable entry name/sig mismatch"); #endif if (supersuperklass->is_override(super_method, target_loader, target_classname, THREAD)) { -#ifndef PRODUCT - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { ResourceMark rm(THREAD); + outputStream* logst = LogHandle(vtables)::trace_stream(); char* sig = target_method()->name_and_sig_as_C_string(); - tty->print("transitive overriding superclass %s with %s::%s index %d, original flags: ", - supersuperklass->internal_name(), - _klass->internal_name(), sig, vtable_index); - super_method->access_flags().print_on(tty); - if (super_method->is_default_method()) { - tty->print("default "); - } - tty->print("overriders flags: "); - target_method->access_flags().print_on(tty); - if (target_method->is_default_method()) { - tty->print("default "); - } + logst->print("transitive overriding superclass %s with %s::%s index %d, original flags: ", + supersuperklass->internal_name(), + _klass->internal_name(), sig, vtable_index); + super_method->print_linkage_flags(logst); + logst->print("overriders flags: "); + target_method->print_linkage_flags(logst); + logst->cr(); } -#endif /*PRODUCT*/ + break; // return found superk } } else { @@ -303,6 +299,29 @@ InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper return superk; } +static void log_vtables(int i, bool overrides, methodHandle target_method, + KlassHandle target_klass, Method* super_method, + Thread* thread) { +#ifndef PRODUCT + if (develop_log_is_enabled(Trace, vtables)) { + ResourceMark rm(thread); + outputStream* logst = LogHandle(vtables)::trace_stream(); + char* sig = target_method()->name_and_sig_as_C_string(); + if (overrides) { + logst->print("overriding with %s::%s index %d, original flags: ", + target_klass->internal_name(), sig, i); + } else { + logst->print("NOT overriding with %s::%s index %d, original flags: ", + target_klass->internal_name(), sig, i); + } + super_method->print_linkage_flags(logst); + logst->print("overriders flags: "); + target_method->print_linkage_flags(logst); + logst->cr(); + } +#endif +} + // Update child's copy of super vtable for overrides // OR return true if a new vtable entry is required. // Only called for InstanceKlass's, i.e. not for arrays @@ -396,6 +415,9 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar // get super_klass for method_holder for the found method InstanceKlass* super_klass = super_method->method_holder(); + // Whether the method is being overridden + bool overrides = false; + // private methods are also never overridden if (!super_method->is_private() && (is_default @@ -446,95 +468,39 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar THROW_MSG_(vmSymbols::java_lang_LinkageError(), buf, false); } } - } - - put_method_at(target_method(), i); - if (!is_default) { - target_method()->set_vtable_index(i); - } else { - if (def_vtable_indices != NULL) { - def_vtable_indices->at_put(default_index, i); - } - assert(super_method->is_default_method() || super_method->is_overpass() - || super_method->is_abstract(), "default override error"); - } - - -#ifndef PRODUCT - if (PrintVtables && Verbose) { - ResourceMark rm(THREAD); - char* sig = target_method()->name_and_sig_as_C_string(); - tty->print("overriding with %s::%s index %d, original flags: ", - target_klass->internal_name(), sig, i); - super_method->access_flags().print_on(tty); - if (super_method->is_default_method()) { - tty->print("default "); - } - if (super_method->is_overpass()) { - tty->print("overpass"); - } - tty->print("overriders flags: "); - target_method->access_flags().print_on(tty); - if (target_method->is_default_method()) { - tty->print("default "); - } - if (target_method->is_overpass()) { - tty->print("overpass"); - } - tty->cr(); } -#endif /*PRODUCT*/ + + put_method_at(target_method(), i); + overrides = true; + if (!is_default) { + target_method()->set_vtable_index(i); + } else { + if (def_vtable_indices != NULL) { + def_vtable_indices->at_put(default_index, i); + } + assert(super_method->is_default_method() || super_method->is_overpass() + || super_method->is_abstract(), "default override error"); + } } else { - // allocate_new = true; default. We might override one entry, - // but not override another. Once we override one, not need new -#ifndef PRODUCT - if (PrintVtables && Verbose) { - ResourceMark rm(THREAD); - char* sig = target_method()->name_and_sig_as_C_string(); - tty->print("NOT overriding with %s::%s index %d, original flags: ", - target_klass->internal_name(), sig,i); - super_method->access_flags().print_on(tty); - if (super_method->is_default_method()) { - tty->print("default "); - } - if (super_method->is_overpass()) { - tty->print("overpass"); - } - tty->print("overriders flags: "); - target_method->access_flags().print_on(tty); - if (target_method->is_default_method()) { - tty->print("default "); - } - if (target_method->is_overpass()) { - tty->print("overpass"); - } - tty->cr(); - } -#endif /*PRODUCT*/ + overrides = false; } + log_vtables(i, overrides, target_method, target_klass, super_method, THREAD); } } return allocate_new; } void klassVtable::put_method_at(Method* m, int index) { -#ifndef PRODUCT - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { ResourceMark rm; + outputStream* logst = LogHandle(vtables)::trace_stream(); const char* sig = (m != NULL) ? m->name_and_sig_as_C_string() : ""; - tty->print("adding %s at index %d, flags: ", sig, index); + logst->print("adding %s at index %d, flags: ", sig, index); if (m != NULL) { - m->access_flags().print_on(tty); - if (m->is_default_method()) { - tty->print("default "); - } - if (m->is_overpass()) { - tty->print("overpass"); - } + m->print_linkage_flags(logst); } - tty->cr(); + logst->cr(); } -#endif table()[index].set(m); } @@ -852,18 +818,16 @@ int klassVtable::fill_in_mirandas(int initialized) { get_mirandas(&mirandas, NULL, ik()->super(), ik()->methods(), ik()->default_methods(), ik()->local_interfaces()); for (int i = 0; i < mirandas.length(); i++) { - if (PrintVtables && Verbose) { + if (develop_log_is_enabled(Trace, vtables)) { Method* meth = mirandas.at(i); ResourceMark rm(Thread::current()); + outputStream* logst = LogHandle(vtables)::trace_stream(); if (meth != NULL) { char* sig = meth->name_and_sig_as_C_string(); - tty->print("fill in mirandas with %s index %d, flags: ", - sig, initialized); - meth->access_flags().print_on(tty); - if (meth->is_default_method()) { - tty->print("default "); - } - tty->cr(); + logst->print("fill in mirandas with %s index %d, flags: ", + sig, initialized); + meth->print_linkage_flags(logst); + logst->cr(); } } put_method_at(mirandas.at(i), initialized); @@ -1036,8 +1000,8 @@ void klassItable::initialize_itable(bool checkconstraints, TRAPS) { guarantee(size_offset_table() >= 1, "too small"); int num_interfaces = size_offset_table() - 1; if (num_interfaces > 0) { - if (TraceItables) tty->print_cr("%3d: Initializing itables for %s", ++initialize_count, - _klass->name()->as_C_string()); + log_develop_debug(itables)("%3d: Initializing itables for %s", ++initialize_count, + _klass->name()->as_C_string()); // Iterate through all interfaces @@ -1069,8 +1033,8 @@ inline bool interface_method_needs_itable_index(Method* m) { int klassItable::assign_itable_indices_for_interface(Klass* klass) { // an interface does not have an itable, but its methods need to be numbered - if (TraceItables) tty->print_cr("%3d: Initializing itable indices for interface %s", ++initialize_count, - klass->name()->as_C_string()); + log_develop_debug(itables)("%3d: Initializing itable indices for interface %s", + ++initialize_count, klass->name()->as_C_string()); Array* methods = InstanceKlass::cast(klass)->methods(); int nof_methods = methods->length(); int ime_num = 0; @@ -1079,24 +1043,18 @@ int klassItable::assign_itable_indices_for_interface(Klass* klass) { if (interface_method_needs_itable_index(m)) { assert(!m->is_final_method(), "no final interface methods"); // If m is already assigned a vtable index, do not disturb it. - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { ResourceMark rm; - const char* sig = (m != NULL) ? m->name_and_sig_as_C_string() : ""; + outputStream* logst = LogHandle(itables)::trace_stream(); + assert(m != NULL, "methods can never be null"); + const char* sig = m->name_and_sig_as_C_string(); if (m->has_vtable_index()) { - tty->print("vtable index %d for method: %s, flags: ", m->vtable_index(), sig); + logst->print("vtable index %d for method: %s, flags: ", m->vtable_index(), sig); } else { - tty->print("itable index %d for method: %s, flags: ", ime_num, sig); + logst->print("itable index %d for method: %s, flags: ", ime_num, sig); } - if (m != NULL) { - m->access_flags().print_on(tty); - if (m->is_default_method()) { - tty->print("default "); - } - if (m->is_overpass()) { - tty->print("overpass"); - } - } - tty->cr(); + m->print_linkage_flags(logst); + logst->cr(); } if (!m->has_vtable_index()) { assert(m->vtable_index() == Method::pending_itable_index, "set by initialize_vtable"); @@ -1200,19 +1158,17 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass int ime_num = m->itable_index(); assert(ime_num < ime_count, "oob"); itableOffsetEntry::method_entry(_klass(), method_table_offset)[ime_num].initialize(target()); - if (TraceItables && Verbose) { + if (develop_log_is_enabled(Trace, itables)) { ResourceMark rm(THREAD); if (target() != NULL) { + outputStream* logst = LogHandle(itables)::trace_stream(); char* sig = target()->name_and_sig_as_C_string(); - tty->print("interface: %s, ime_num: %d, target: %s, method_holder: %s ", - interf_h()->internal_name(), ime_num, sig, - target()->method_holder()->internal_name()); - tty->print("target_method flags: "); - target()->access_flags().print_on(tty); - if (target()->is_default_method()) { - tty->print("default "); - } - tty->cr(); + logst->print("interface: %s, ime_num: %d, target: %s, method_holder: %s ", + interf_h()->internal_name(), ime_num, sig, + target()->method_holder()->internal_name()); + logst->print("target_method flags: "); + target()->print_linkage_flags(logst); + logst->cr(); } } } diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index 015843d9c87..d1a7c297dfd 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -2207,6 +2207,15 @@ void Method::print_on(outputStream* st) const { } } +void Method::print_linkage_flags(outputStream* st) { + access_flags().print_on(st); + if (is_default_method()) { + st->print("default "); + } + if (is_overpass()) { + st->print("overpass "); + } +} #endif //PRODUCT void Method::print_value_on(outputStream* st) const { diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp index 662d66555a5..457054de50f 100644 --- a/hotspot/src/share/vm/oops/method.hpp +++ b/hotspot/src/share/vm/oops/method.hpp @@ -939,6 +939,7 @@ class Method : public Metadata { void print_on(outputStream* st) const; #endif void print_value_on(outputStream* st) const; + void print_linkage_flags(outputStream* st) PRODUCT_RETURN; const char* internal_name() const { return "{method}"; } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 9a444cb7c1d..c4f4627bdb0 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -741,9 +741,6 @@ public: product(bool, ForceTimeHighResolution, false, \ "Using high time resolution (for Win32 only)") \ \ - develop(bool, TraceItables, false, \ - "Trace initialization and use of itables") \ - \ develop(bool, TracePcPatching, false, \ "Trace usage of frame::patch_pc") \ \ @@ -2699,9 +2696,6 @@ public: develop(bool, DebugVtables, false, \ "add debugging code to vtable dispatch") \ \ - develop(bool, PrintVtables, false, \ - "print vtables when printing klass") \ - \ notproduct(bool, PrintVtableStats, false, \ "print vtables stats at end of run") \ \ diff --git a/hotspot/test/runtime/logging/ClassB.java b/hotspot/test/runtime/logging/ClassB.java new file mode 100644 index 00000000000..0642e13c572 --- /dev/null +++ b/hotspot/test/runtime/logging/ClassB.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 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. + */ + +import p2.D; + +interface InterfaceA { + public void Method1(); + public void Method2(); +} + +class ClassA implements InterfaceA { + public void Method1() { + System.out.println("ClassA's Method1"); + } + public void Method2() { + System.out.println("ClassA's Method2"); + } + public void Method3() { + System.out.println("ClassA's Method3"); + } + public void Method4() { + System.out.println("ClassA's Method4"); + } +} + +public class ClassB extends ClassA { + public void Method1() { + System.out.println("ClassB's Method1"); + } + public void Method3() { + System.out.println("ClassB's Method3"); + } + public static void main(String[] args) throws Exception { + ClassB classBObj = new ClassB(); + classBObj.Method1(); + classBObj.Method2(); + classBObj.Method3(); + classBObj.Method4(); + ClassA classAObj = new ClassA(); + classAObj.Method1(); + classAObj.Method2(); + classAObj.Method3(); + classAObj.Method4(); + D classD = new D(); + D.loadD(); + } +} diff --git a/hotspot/test/runtime/logging/ItablesTest.java b/hotspot/test/runtime/logging/ItablesTest.java new file mode 100644 index 00000000000..4cad4392bad --- /dev/null +++ b/hotspot/test/runtime/logging/ItablesTest.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @bug 8141564 + * @summary itables=trace should have logging from each of the statements + * in the code + * @library /testlibrary + * @ignore 8146435 + * @compile ClassB.java + * @modules java.base/sun.misc + * java.management + * @run driver ItablesTest + */ + +import jdk.test.lib.*; + +public class ItablesTest { + public static void main(String[] args) throws Exception { + if (Platform.isDebugBuild()) { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:itables=trace", "ClassB"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain(": Initializing itables for ClassB"); + output.shouldContain(": Initializing itable indices for interface "); + output.shouldContain("vtable index "); + output.shouldContain("itable index "); + output.shouldContain("target: ClassB.Method1()V, method_holder: ClassB target_method flags: public"); + output.shouldContain("invokeinterface resolved method: caller-class"); + output.shouldContain("invokespecial resolved method: caller-class:ClassB"); + output.shouldContain("invokespecial selected method: resolved-class:ClassB"); + output.shouldContain("invokeinterface selected method: receiver-class"); + output.shouldContain("Resolving: klass: "); + output.shouldHaveExitValue(0); + } + } +} diff --git a/hotspot/test/runtime/logging/VtablesTest.java b/hotspot/test/runtime/logging/VtablesTest.java new file mode 100644 index 00000000000..e31d4cde2fc --- /dev/null +++ b/hotspot/test/runtime/logging/VtablesTest.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @bug 8141564 + * @summary vtables=trace should have logging from each of the statements in the code + * @library /testlibrary + * @compile ClassB.java + * p1/A.java + * p2/B.jcod + * p1/C.java + * p2/D.java + * @modules java.base/sun.misc + * java.management + * @run driver VtablesTest + */ + +import jdk.test.lib.*; + +public class VtablesTest { + public static void main(String[] args) throws Exception { + if (Platform.isDebugBuild()) { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:vtables=trace", "ClassB"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("copy vtable from ClassA to ClassB"); + output.shouldContain("Initializing: ClassB"); + output.shouldContain("adding ClassB.Method1()V"); + output.shouldContain("] overriding with ClassB::ClassB.Method2()V"); + output.shouldContain("invokevirtual resolved method: caller-class:ClassB"); + output.shouldContain("invokevirtual selected method: receiver-class:ClassB"); + output.shouldContain("NOT overriding with p2.D::p2.D.nooverride()V"); + output.shouldHaveExitValue(0); + + pb = ProcessTools.createJavaProcessBuilder("-Xlog:vtables=trace", "p1/C"); + output = new OutputAnalyzer(pb.start()); + output.shouldContain("transitive overriding superclass "); + output.shouldHaveExitValue(0); + } + } +} + diff --git a/hotspot/test/runtime/logging/p1/A.java b/hotspot/test/runtime/logging/p1/A.java new file mode 100644 index 00000000000..57d2ca57cf8 --- /dev/null +++ b/hotspot/test/runtime/logging/p1/A.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 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. + */ + +package p1; + +public class A { + public void test() { System.out.println("In A's test method"); } + void nooverride() {} +} diff --git a/hotspot/test/runtime/logging/p1/C.java b/hotspot/test/runtime/logging/p1/C.java new file mode 100644 index 00000000000..5624726aa7e --- /dev/null +++ b/hotspot/test/runtime/logging/p1/C.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 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. + */ + +package p1; + +import p2.B; + +public class C extends B { + public void test() { System.out.println("In C's test method"); } + public static void main(String args[]) { + C c = new C(); + c.test(); + } +} diff --git a/hotspot/test/runtime/logging/p2/B.jcod b/hotspot/test/runtime/logging/p2/B.jcod new file mode 100644 index 00000000000..724c180aa16 --- /dev/null +++ b/hotspot/test/runtime/logging/p2/B.jcod @@ -0,0 +1,125 @@ +/* + * Copyright (c) 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. + */ + +class p2/B { + 0xCAFEBABE; + 0; // minor version + 52; // version + [28] { // Constant Pool + ; // first element is empty + Method #6 #14; // #1 at 0x0A + Field #15 #16; // #2 at 0x0F + String #17; // #3 at 0x14 + Method #18 #19; // #4 at 0x17 + class #20; // #5 at 0x1C + class #21; // #6 at 0x1F + Utf8 ""; // #7 at 0x22 + Utf8 "()V"; // #8 at 0x2B + Utf8 "Code"; // #9 at 0x31 + Utf8 "LineNumberTable"; // #10 at 0x38 + Utf8 "test"; // #11 at 0x4A + Utf8 "SourceFile"; // #12 at 0x52 + Utf8 "B.java"; // #13 at 0x5F + NameAndType #7 #8; // #14 at 0x68 + class #22; // #15 at 0x6D + NameAndType #23 #24; // #16 at 0x70 + Utf8 "In B's test method"; // #17 at 0x75 + class #25; // #18 at 0x8A + NameAndType #26 #27; // #19 at 0x8D + Utf8 "p2/B"; // #20 at 0x92 + Utf8 "p1/A"; // #21 at 0x99 + Utf8 "java/lang/System"; // #22 at 0xA0 + Utf8 "out"; // #23 at 0xB3 + Utf8 "Ljava/io/PrintStream;"; // #24 at 0xB9 + Utf8 "java/io/PrintStream"; // #25 at 0xD1 + Utf8 "println"; // #26 at 0xE7 + Utf8 "(Ljava/lang/String;)V"; // #27 at 0xF1 + } // Constant Pool + + 0x0021; // access + #5;// this_cpx + #6;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // fields + } // fields + + [2] { // methods + { // Member at 0x0115 + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [1] { // Attributes + Attr(#9, 29) { // Code at 0x011D + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0134 + [1] { // LineNumberTable + 0 5; // at 0x0140 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x0140 + 0x0000; // access + #11; // name_cpx + #8; // sig_cpx + [1] { // Attributes + Attr(#9, 33) { // Code at 0x0148 + 2; // max_stack + 1; // max_locals + Bytes[9]{ + 0xB200021203B60004; + 0xB1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0163 + [1] { // LineNumberTable + 0 6; // at 0x016F + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [1] { // Attributes + Attr(#12, 2) { // SourceFile at 0x0171 + #13; + } // end SourceFile + } // Attributes +} // end class p2/B diff --git a/hotspot/test/runtime/logging/p2/D.java b/hotspot/test/runtime/logging/p2/D.java new file mode 100644 index 00000000000..05f366fabfc --- /dev/null +++ b/hotspot/test/runtime/logging/p2/D.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 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. + */ + +package p2; + +public class D extends p1.A { + void nooverride() {} + public static void loadD() {} +} From a8fcb62829e4d480eafbad7344c32069cc36928a Mon Sep 17 00:00:00 2001 From: Kishor Kharbas Date: Thu, 7 Jan 2016 14:29:05 -0800 Subject: [PATCH 025/212] 8146581: Minor corrections to the patch submitted for earlier bug id - 8143925 Reviewed-by: kvn --- hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp | 16 ++++++---------- hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp | 12 ++++++------ hotspot/src/cpu/x86/vm/vm_version_x86.cpp | 12 +----------- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 5ac5593f1c9..b1895f639dc 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -2802,8 +2802,7 @@ class StubGenerator: public StubCodeGenerator { const Register to = rdx; // destination array address const Register key = rcx; // key array address const Register counter = rdi; // counter byte array initialized from initvector array address - - // and left with the results of the last encryption block + // and updated with the incremented counter in the end const Register len_reg = rbx; const Register pos = rax; @@ -2829,10 +2828,7 @@ class StubGenerator: public StubCodeGenerator { __ movptr(from , from_param); __ movptr(to , to_param); - //__ movptr(key, key_param); - //__ movptr(counter, rvec_param); __ movptr(len_reg , len_param); - //__ movptr(pos, 0); // Use the partially used encrpyted counter from last invocation Label L_exit_preLoop, L_preLoop_start; @@ -3007,8 +3003,8 @@ class StubGenerator: public StubCodeGenerator { __ subptr(len_reg, AESBlockSize); __ jmp(L_singleBlockLoopTop[k]); - __ BIND(L_processTail_insr[k]); - __ addptr(pos, len_reg); + __ BIND(L_processTail_insr[k]); // Process the tail part of the input array + __ addptr(pos, len_reg); // 1. Insert bytes from src array into xmm_from0 register __ testptr(len_reg, 8); __ jcc(Assembler::zero, L_processTail_4_insr[k]); __ subptr(pos,8); @@ -3035,11 +3031,11 @@ class StubGenerator: public StubCodeGenerator { __ BIND(L_processTail_exit_insr[k]); __ movptr(saved_encCounter_start, saved_counter_param); - __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); - __ pxor(xmm_result0, xmm_from0); + __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); // 2. Perform pxor of the encrypted counter and plaintext Bytes. + __ pxor(xmm_result0, xmm_from0); // Also the encrypted counter is saved for next invocation. __ testptr(len_reg, 8); - __ jcc(Assembler::zero, L_processTail_4_extr[k]); + __ jcc(Assembler::zero, L_processTail_4_extr[k]); // 3. Extract bytes from xmm_result0 into the dest. array __ pextrd(Address(to, pos), xmm_result0, 0); __ pextrd(Address(to, pos, Address::times_1, 4), xmm_result0, 1); __ psrldq(xmm_result0, 8); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index b3eb330ac9b..f2fd002295a 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -3752,7 +3752,7 @@ class StubGenerator: public StubCodeGenerator { const Register to = c_rarg1; // destination array address const Register key = c_rarg2; // key array address const Register counter = c_rarg3; // counter byte array initialized from counter array address - // and left with the results of the last encryption block + // and updated with the incremented counter in the end #ifndef _WIN64 const Register len_reg = c_rarg4; const Register saved_encCounter_start = c_rarg5; @@ -3967,8 +3967,8 @@ class StubGenerator: public StubCodeGenerator { __ addptr(pos, AESBlockSize); __ subptr(len_reg, AESBlockSize); __ jmp(L_singleBlockLoopTop[k]); - __ BIND(L_processTail_insr[k]); - __ addptr(pos, len_reg); + __ BIND(L_processTail_insr[k]); // Process the tail part of the input array + __ addptr(pos, len_reg); // 1. Insert bytes from src array into xmm_from0 register __ testptr(len_reg, 8); __ jcc(Assembler::zero, L_processTail_4_insr[k]); __ subptr(pos,8); @@ -3993,11 +3993,11 @@ class StubGenerator: public StubCodeGenerator { __ pinsrb(xmm_from0, Address(from, pos), 0); __ BIND(L_processTail_exit_insr[k]); - __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); - __ pxor(xmm_result0, xmm_from0); + __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); // 2. Perform pxor of the encrypted counter and plaintext Bytes. + __ pxor(xmm_result0, xmm_from0); // Also the encrypted counter is saved for next invocation. __ testptr(len_reg, 8); - __ jcc(Assembler::zero, L_processTail_4_extr[k]); + __ jcc(Assembler::zero, L_processTail_4_extr[k]); // 3. Extract bytes from xmm_result0 into the dest. array __ pextrq(Address(to, pos), xmm_result0, 0); __ psrldq(xmm_result0, 8); __ addptr(pos, 8); diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index d31b0e5acd2..8756b51e899 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -671,7 +671,7 @@ void VM_Version::get_processor_features() { } // --AES-CTR ends-- } - } else if (UseAES || UseAESIntrinsics) { + } else if (UseAES || UseAESIntrinsics || UseAESCTRIntrinsics) { if (UseAES && !FLAG_IS_DEFAULT(UseAES)) { warning("AES instructions are not available on this CPU"); FLAG_SET_DEFAULT(UseAES, false); @@ -707,16 +707,6 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseCRC32Intrinsics, false); } - if (UseAESIntrinsics) { - if (FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { - UseAESCTRIntrinsics = true; - } - } else if (UseAESCTRIntrinsics) { - if (!FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) - warning("AES/CTR intrinsics are not available on this CPU"); - FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); - } - if (supports_sse4_2()) { if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { UseCRC32CIntrinsics = true; From 22ad9cec840cf93b9f9d08f292ccfa478b57f9e4 Mon Sep 17 00:00:00 2001 From: Alexander Harlap Date: Fri, 8 Jan 2016 15:41:44 -0500 Subject: [PATCH 026/212] 8145037: Clean up FreeIdSet usage Avoid wasting space for the unused sets Reviewed-by: tschatzl --- hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp | 75 ++++++++++++++++++- hotspot/src/share/vm/gc/g1/dirtyCardQueue.hpp | 3 +- .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 4 +- hotspot/src/share/vm/gc/shared/workgroup.cpp | 40 ---------- hotspot/src/share/vm/gc/shared/workgroup.hpp | 26 ------- 5 files changed, 77 insertions(+), 71 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp index 3869a648af9..ee9ae50a0d9 100644 --- a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp @@ -32,6 +32,72 @@ #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" +// Represents a set of free small integer ids. +class FreeIdSet : public CHeapObj { + enum { + end_of_list = UINT_MAX, + claimed = UINT_MAX - 1 + }; + + uint _size; + Monitor* _mon; + + uint* _ids; + uint _hd; + uint _waiters; + uint _claimed; + +public: + FreeIdSet(uint size, Monitor* mon); + ~FreeIdSet(); + + // Returns an unclaimed parallel id (waiting for one to be released if + // necessary). + uint claim_par_id(); + + void release_par_id(uint id); +}; + +FreeIdSet::FreeIdSet(uint size, Monitor* mon) : + _size(size), _mon(mon), _hd(0), _waiters(0), _claimed(0) +{ + guarantee(size != 0, "must be"); + _ids = NEW_C_HEAP_ARRAY(uint, size, mtGC); + for (uint i = 0; i < size - 1; i++) { + _ids[i] = i+1; + } + _ids[size-1] = end_of_list; // end of list. +} + +FreeIdSet::~FreeIdSet() { + FREE_C_HEAP_ARRAY(uint, _ids); +} + +uint FreeIdSet::claim_par_id() { + MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag); + while (_hd == end_of_list) { + _waiters++; + _mon->wait(Mutex::_no_safepoint_check_flag); + _waiters--; + } + uint res = _hd; + _hd = _ids[res]; + _ids[res] = claimed; // For debugging. + _claimed++; + return res; +} + +void FreeIdSet::release_par_id(uint id) { + MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag); + assert(_ids[id] == claimed, "Precondition."); + _ids[id] = _hd; + _hd = id; + _claimed--; + if (_waiters > 0) { + _mon->notify_all(); + } +} + DirtyCardQueue::DirtyCardQueue(DirtyCardQueueSet* qset, bool permanent) : // Dirty card queues are always active, so we create them with their // active field set to true. @@ -103,7 +169,8 @@ void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl, int process_completed_threshold, int max_completed_queue, Mutex* lock, - DirtyCardQueueSet* fl_owner) { + DirtyCardQueueSet* fl_owner, + bool init_free_ids) { _mut_process_closure = cl; PtrQueueSet::initialize(cbl_mon, fl_lock, @@ -112,7 +179,9 @@ void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl, fl_owner); set_buffer_size(G1UpdateBufferSize); _shared_dirty_card_queue.set_lock(lock); - _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon); + if (init_free_ids) { + _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon); + } } void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) { @@ -120,7 +189,7 @@ void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) { } bool DirtyCardQueueSet::mut_process_buffer(void** buf) { - + guarantee(_free_ids != NULL, "must be"); // Used to determine if we had already claimed a par_id // before entering this method. bool already_claimed = false; diff --git a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.hpp b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.hpp index f3f9bb18a07..9fa3c3da069 100644 --- a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.hpp +++ b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.hpp @@ -116,7 +116,8 @@ public: int process_completed_threshold, int max_completed_queue, Mutex* lock, - DirtyCardQueueSet* fl_owner = NULL); + DirtyCardQueueSet* fl_owner, + bool init_free_ids = false); // The number of parallel ids that can be claimed to allow collector or // mutator threads to do card-processing work. diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index b1a9819aab3..1bd7a8faedb 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -1984,7 +1984,9 @@ jint G1CollectedHeap::initialize() { DirtyCardQ_FL_lock, concurrent_g1_refine()->yellow_zone(), concurrent_g1_refine()->red_zone(), - Shared_DirtyCardQ_lock); + Shared_DirtyCardQ_lock, + NULL, // fl_owner + true); // init_free_ids dirty_card_queue_set().initialize(NULL, // Should never be called by the Java code DirtyCardQ_CBL_mon, diff --git a/hotspot/src/share/vm/gc/shared/workgroup.cpp b/hotspot/src/share/vm/gc/shared/workgroup.cpp index 0fea9e88eb3..41b3b9a8ef8 100644 --- a/hotspot/src/share/vm/gc/shared/workgroup.cpp +++ b/hotspot/src/share/vm/gc/shared/workgroup.cpp @@ -499,43 +499,3 @@ bool SequentialSubTasksDone::all_tasks_completed() { } return false; } - -FreeIdSet::FreeIdSet(uint size, Monitor* mon) : - _size(size), _mon(mon), _hd(0), _waiters(0), _claimed(0) -{ - guarantee(size != 0, "must be"); - _ids = NEW_C_HEAP_ARRAY(uint, size, mtGC); - for (uint i = 0; i < size - 1; i++) { - _ids[i] = i+1; - } - _ids[size-1] = end_of_list; // end of list. -} - -FreeIdSet::~FreeIdSet() { - FREE_C_HEAP_ARRAY(uint, _ids); -} - -uint FreeIdSet::claim_par_id() { - MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag); - while (_hd == end_of_list) { - _waiters++; - _mon->wait(Mutex::_no_safepoint_check_flag); - _waiters--; - } - uint res = _hd; - _hd = _ids[res]; - _ids[res] = claimed; // For debugging. - _claimed++; - return res; -} - -void FreeIdSet::release_par_id(uint id) { - MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag); - assert(_ids[id] == claimed, "Precondition."); - _ids[id] = _hd; - _hd = id; - _claimed--; - if (_waiters > 0) { - _mon->notify_all(); - } -} diff --git a/hotspot/src/share/vm/gc/shared/workgroup.hpp b/hotspot/src/share/vm/gc/shared/workgroup.hpp index 8c0dde8b396..b2a48647cab 100644 --- a/hotspot/src/share/vm/gc/shared/workgroup.hpp +++ b/hotspot/src/share/vm/gc/shared/workgroup.hpp @@ -378,30 +378,4 @@ public: bool all_tasks_completed(); }; -// Represents a set of free small integer ids. -class FreeIdSet : public CHeapObj { - enum { - end_of_list = UINT_MAX, - claimed = UINT_MAX - 1 - }; - - uint _size; - Monitor* _mon; - - uint* _ids; - uint _hd; - uint _waiters; - uint _claimed; - -public: - FreeIdSet(uint size, Monitor* mon); - ~FreeIdSet(); - - // Returns an unclaimed parallel id (waiting for one to be released if - // necessary). - uint claim_par_id(); - - void release_par_id(uint id); -}; - #endif // SHARE_VM_GC_SHARED_WORKGROUP_HPP From 00f6aa5a7c439c50f1d30474c00522f08dae133c Mon Sep 17 00:00:00 2001 From: Ron Durbin Date: Fri, 8 Jan 2016 15:38:08 -0800 Subject: [PATCH 027/212] 8135198: Add -XX:VMOptionsFile support to JAVA_TOOL_OPTIONS and _JAVA_OPTIONS Reviewed-by: dcubed, ddmitriev, ahgross, gthornbr, coleenp --- hotspot/src/share/vm/runtime/arguments.cpp | 203 +++++++++++------- hotspot/src/share/vm/runtime/arguments.hpp | 7 +- .../VMOptionsFile/TestVMOptionsFile.java | 51 +++-- 3 files changed, 168 insertions(+), 93 deletions(-) diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 7fc37d0865c..f8be77fafc1 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -2622,7 +2622,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, Flag::Flags origin) { - // Remaining part of option string + // For match_option to return remaining or value part of option string const char* tail; // iterate over arguments @@ -3502,15 +3502,19 @@ jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_req class ScopedVMInitArgs : public StackObj { private: JavaVMInitArgs _args; + char* _container_name; bool _is_set; + char* _vm_options_file_arg; public: - ScopedVMInitArgs() { + ScopedVMInitArgs(const char *container_name) { _args.version = JNI_VERSION_1_2; _args.nOptions = 0; _args.options = NULL; _args.ignoreUnrecognized = false; + _container_name = (char *)container_name; _is_set = false; + _vm_options_file_arg = NULL; } // Populates the JavaVMInitArgs object represented by this @@ -3542,10 +3546,23 @@ class ScopedVMInitArgs : public StackObj { return JNI_OK; } - JavaVMInitArgs* get() { return &_args; } - bool is_set() { return _is_set; } + JavaVMInitArgs* get() { return &_args; } + char* container_name() { return _container_name; } + bool is_set() { return _is_set; } + bool found_vm_options_file_arg() { return _vm_options_file_arg != NULL; } + char* vm_options_file_arg() { return _vm_options_file_arg; } + + void set_vm_options_file_arg(const char *vm_options_file_arg) { + if (_vm_options_file_arg != NULL) { + os::free(_vm_options_file_arg); + } + _vm_options_file_arg = os::strdup_check_oom(vm_options_file_arg); + } ~ScopedVMInitArgs() { + if (_vm_options_file_arg != NULL) { + os::free(_vm_options_file_arg); + } if (_args.options == NULL) return; for (int i = 0; i < _args.nOptions; i++) { os::free(_args.options[i].optionString); @@ -3826,12 +3843,23 @@ static bool use_vm_log() { #endif // PRODUCT +bool Arguments::args_contains_vm_options_file_arg(const JavaVMInitArgs* args) { + for (int index = 0; index < args->nOptions; index++) { + const JavaVMOption* option = args->options + index; + const char* tail; + if (match_option(option, "-XX:VMOptionsFile=", &tail)) { + return true; + } + } + return false; +} + jint Arguments::insert_vm_options_file(const JavaVMInitArgs* args, - char** vm_options_file, + const char* vm_options_file, const int vm_options_file_pos, - ScopedVMInitArgs *vm_options_file_args, + ScopedVMInitArgs* vm_options_file_args, ScopedVMInitArgs* args_out) { - jint code = parse_vm_options_file(*vm_options_file, vm_options_file_args); + jint code = parse_vm_options_file(vm_options_file, vm_options_file_args); if (code != JNI_OK) { return code; } @@ -3840,17 +3868,46 @@ jint Arguments::insert_vm_options_file(const JavaVMInitArgs* args, return JNI_OK; } + if (args_contains_vm_options_file_arg(vm_options_file_args->get())) { + jio_fprintf(defaultStream::error_stream(), + "A VM options file may not refer to a VM options file. " + "Specification of '-XX:VMOptionsFile=' in the " + "options file '%s' in options container '%s' is an error.\n", + vm_options_file_args->vm_options_file_arg(), + vm_options_file_args->container_name()); + return JNI_EINVAL; + } + return args_out->insert(args, vm_options_file_args->get(), vm_options_file_pos); } +// Expand -XX:VMOptionsFile found in args_in as needed. +// mod_args and args_out parameters may return values as needed. +jint Arguments::expand_vm_options_as_needed(const JavaVMInitArgs* args_in, + ScopedVMInitArgs* mod_args, + JavaVMInitArgs** args_out) { + jint code = match_special_option_and_act(args_in, mod_args); + if (code != JNI_OK) { + return code; + } + + if (mod_args->is_set()) { + // args_in contains -XX:VMOptionsFile and mod_args contains the + // original options from args_in along with the options expanded + // from the VMOptionsFile. Return a short-hand to the caller. + *args_out = mod_args->get(); + } else { + *args_out = (JavaVMInitArgs *)args_in; // no changes so use args_in + } + return JNI_OK; +} + jint Arguments::match_special_option_and_act(const JavaVMInitArgs* args, - char ** vm_options_file, ScopedVMInitArgs* args_out) { // Remaining part of option string const char* tail; - int vm_options_file_pos = -1; - ScopedVMInitArgs vm_options_file_args; + ScopedVMInitArgs vm_options_file_args(args_out->container_name()); for (int index = 0; index < args->nOptions; index++) { const JavaVMOption* option = args->options + index; @@ -3862,39 +3919,34 @@ jint Arguments::match_special_option_and_act(const JavaVMInitArgs* args, continue; } if (match_option(option, "-XX:VMOptionsFile=", &tail)) { - if (vm_options_file != NULL) { - // The caller accepts -XX:VMOptionsFile - if (*vm_options_file != NULL) { - jio_fprintf(defaultStream::error_stream(), - "The VM Options file can only be specified once and " - "only on the command line.\n"); - return JNI_EINVAL; - } - - *vm_options_file = (char *) tail; - vm_options_file_pos = index; // save position of -XX:VMOptionsFile - // If there's a VMOptionsFile, parse that (also can set flags_file) - jint code = insert_vm_options_file(args, vm_options_file, - vm_options_file_pos, - &vm_options_file_args, args_out); - if (code != JNI_OK) { - return code; - } - if (args_out->is_set()) { - // The VMOptions file inserted some options so switch 'args' - // to the new set of options, and continue processing which - // preserves "last option wins" semantics. - args = args_out->get(); - // The first option from the VMOptionsFile replaces the - // current option. So we back track to process the - // replacement option. - index--; - } - } else { + if (vm_options_file_args.found_vm_options_file_arg()) { jio_fprintf(defaultStream::error_stream(), - "VM options file is only supported on the command line\n"); + "The option '%s' is already specified in the options " + "container '%s' so the specification of '%s' in the " + "same options container is an error.\n", + vm_options_file_args.vm_options_file_arg(), + vm_options_file_args.container_name(), + option->optionString); return JNI_EINVAL; } + vm_options_file_args.set_vm_options_file_arg(option->optionString); + // If there's a VMOptionsFile, parse that + jint code = insert_vm_options_file(args, tail, index, + &vm_options_file_args, args_out); + if (code != JNI_OK) { + return code; + } + args_out->set_vm_options_file_arg(vm_options_file_args.vm_options_file_arg()); + if (args_out->is_set()) { + // The VMOptions file inserted some options so switch 'args' + // to the new set of options, and continue processing which + // preserves "last option wins" semantics. + args = args_out->get(); + // The first option from the VMOptionsFile replaces the + // current option. So we back track to process the + // replacement option. + index--; + } continue; } if (match_option(option, "-XX:+PrintVMOptions")) { @@ -3963,7 +4015,7 @@ static void print_options(const JavaVMInitArgs *args) { // Parse entry point called from JNI_CreateJavaVM -jint Arguments::parse(const JavaVMInitArgs* args) { +jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) { assert(verify_special_jvm_flags(), "deprecated and obsolete flag table inconsistent"); // Initialize ranges and constraints @@ -3972,67 +4024,74 @@ jint Arguments::parse(const JavaVMInitArgs* args) { // If flag "-XX:Flags=flags-file" is used it will be the first option to be processed. const char* hotspotrc = ".hotspotrc"; - char* vm_options_file = NULL; bool settings_file_specified = false; bool needs_hotspotrc_warning = false; - ScopedVMInitArgs java_tool_options_args; - ScopedVMInitArgs java_options_args; - ScopedVMInitArgs modified_cmd_line_args; + ScopedVMInitArgs initial_java_tool_options_args("env_var='JAVA_TOOL_OPTIONS'"); + ScopedVMInitArgs initial_java_options_args("env_var='_JAVA_OPTIONS'"); + + // Pointers to current working set of containers + JavaVMInitArgs* cur_cmd_args; + JavaVMInitArgs* cur_java_options_args; + JavaVMInitArgs* cur_java_tool_options_args; + + // Containers for modified/expanded options + ScopedVMInitArgs mod_cmd_args("cmd_line_args"); + ScopedVMInitArgs mod_java_tool_options_args("env_var='JAVA_TOOL_OPTIONS'"); + ScopedVMInitArgs mod_java_options_args("env_var='_JAVA_OPTIONS'"); + jint code = - parse_java_tool_options_environment_variable(&java_tool_options_args); + parse_java_tool_options_environment_variable(&initial_java_tool_options_args); if (code != JNI_OK) { return code; } - code = parse_java_options_environment_variable(&java_options_args); + code = parse_java_options_environment_variable(&initial_java_options_args); if (code != JNI_OK) { return code; } - code = match_special_option_and_act(java_tool_options_args.get(), - NULL, NULL); + code = expand_vm_options_as_needed(initial_java_tool_options_args.get(), + &mod_java_tool_options_args, + &cur_java_tool_options_args); if (code != JNI_OK) { return code; } - code = match_special_option_and_act(args, &vm_options_file, - &modified_cmd_line_args); + code = expand_vm_options_as_needed(initial_cmd_args, + &mod_cmd_args, + &cur_cmd_args); if (code != JNI_OK) { return code; } - - // The command line arguments have been modified to include VMOptionsFile arguments. - if (modified_cmd_line_args.is_set()) { - args = modified_cmd_line_args.get(); - } - - code = match_special_option_and_act(java_options_args.get(), - NULL, NULL); + code = expand_vm_options_as_needed(initial_java_options_args.get(), + &mod_java_options_args, + &cur_java_options_args); if (code != JNI_OK) { return code; } - const char * flags_file = Arguments::get_jvm_flags_file(); + const char* flags_file = Arguments::get_jvm_flags_file(); settings_file_specified = (flags_file != NULL); if (IgnoreUnrecognizedVMOptions) { - // uncast const to modify the flag args->ignoreUnrecognized - *(jboolean*)(&args->ignoreUnrecognized) = true; - java_tool_options_args.get()->ignoreUnrecognized = true; - java_options_args.get()->ignoreUnrecognized = true; + cur_cmd_args->ignoreUnrecognized = true; + cur_java_tool_options_args->ignoreUnrecognized = true; + cur_java_options_args->ignoreUnrecognized = true; } // Parse specified settings file if (settings_file_specified) { - if (!process_settings_file(flags_file, true, args->ignoreUnrecognized)) { + if (!process_settings_file(flags_file, true, + cur_cmd_args->ignoreUnrecognized)) { return JNI_EINVAL; } } else { #ifdef ASSERT // Parse default .hotspotrc settings file - if (!process_settings_file(".hotspotrc", false, args->ignoreUnrecognized)) { + if (!process_settings_file(".hotspotrc", false, + cur_cmd_args->ignoreUnrecognized)) { return JNI_EINVAL; } #else @@ -4044,15 +4103,15 @@ jint Arguments::parse(const JavaVMInitArgs* args) { } if (PrintVMOptions) { - print_options(java_tool_options_args.get()); - print_options(args); - print_options(java_options_args.get()); + print_options(cur_java_tool_options_args); + print_options(cur_cmd_args); + print_options(cur_java_options_args); } // Parse JavaVMInitArgs structure passed in, as well as JAVA_TOOL_OPTIONS and _JAVA_OPTIONS - jint result = parse_vm_init_args(java_tool_options_args.get(), - java_options_args.get(), - args); // command line arguments + jint result = parse_vm_init_args(cur_java_tool_options_args, + cur_java_options_args, + cur_cmd_args); if (result != JNI_OK) { return result; diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index 8ad75aa506a..8115037adee 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -379,12 +379,15 @@ class Arguments : AllStatic { static jint parse_vm_options_file(const char* file_name, ScopedVMInitArgs* vm_args); static jint parse_options_buffer(const char* name, char* buffer, const size_t buf_len, ScopedVMInitArgs* vm_args); static jint insert_vm_options_file(const JavaVMInitArgs* args, - char** vm_options_file, + const char* vm_options_file, const int vm_options_file_pos, ScopedVMInitArgs* vm_options_file_args, ScopedVMInitArgs* args_out); + static bool args_contains_vm_options_file_arg(const JavaVMInitArgs* args); + static jint expand_vm_options_as_needed(const JavaVMInitArgs* args_in, + ScopedVMInitArgs* mod_args, + JavaVMInitArgs** args_out); static jint match_special_option_and_act(const JavaVMInitArgs* args, - char** vm_options_file, ScopedVMInitArgs* args_out); static jint parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args, diff --git a/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java b/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java index 12ee773c196..de7ed44b05a 100644 --- a/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java +++ b/hotspot/test/runtime/CommandLine/VMOptionsFile/TestVMOptionsFile.java @@ -285,6 +285,8 @@ public class TestVMOptionsFile { } private static void testVMOptions() throws Exception { + ProcessBuilder pb; + /* Check that empty VM Option file is accepted without errors */ addVMOptionsFile(VM_OPTION_FILE_EMPTY); @@ -385,6 +387,33 @@ public class TestVMOptionsFile { checkProperty("my.property", "value" + REPEAT_COUNT); checkVMOption("MinHeapFreeRatio", "17"); checkVMOption("MaxHeapFreeRatio", "85"); + + /* Pass VM Option file in _JAVA_OPTIONS environment variable */ + addVMParam("-showversion"); + addVMOptionsToCheck("SurvivorRatio", "MinHeapFreeRatio"); + pb = createProcessBuilder(); + + updateEnvironment(pb, JAVA_OPTIONS, "-XX:VMOptionsFile=" + getAbsolutePathFromSource(VM_OPTION_FILE_1)); + + runJavaCheckExitValue(pb, JVM_SUCCESS); + outputShouldContain("interpreted mode"); + checkProperty("optfile_1", "option_file_1"); + checkVMOption("SurvivorRatio", "16"); + checkVMOption("MinHeapFreeRatio", "22"); + + /* Pass VM Option file in JAVA_TOOL_OPTIONS environment variable */ + addVMOptionsToCheck("UseGCOverheadLimit", "NewRatio", "MinHeapFreeRatio", "MaxFDLimit", "AlwaysPreTouch"); + pb = createProcessBuilder(); + + updateEnvironment(pb, JAVA_TOOL_OPTIONS, "-XX:VMOptionsFile=" + VM_OPTION_FILE_2); + + runJavaCheckExitValue(pb, JVM_SUCCESS); + checkProperty("javax.net.ssl.keyStorePassword", "someVALUE123+"); + checkVMOption("UseGCOverheadLimit", "true"); + checkVMOption("NewRatio", "4"); + checkVMOption("MinHeapFreeRatio", "3"); + checkVMOption("MaxFDLimit", "true"); + checkVMOption("AlwaysPreTouch", "false"); } private static ProcessBuilder prepareTestCase(int testCase) throws Exception { @@ -548,13 +577,13 @@ public class TestVMOptionsFile { addVMOptionsFile(VM_OPTION_FILE_WITH_SAME_VM_OPTION_FILE); runJavaCheckExitValue(JVM_FAIL_WITH_EXIT_CODE_1); - outputShouldContain("The VM Options file can only be specified once and only on the command line."); + outputShouldContain("A VM options file may not refer to a VM options file. Specification of '-XX:VMOptionsFile=' in the options file"); /* Pass VM option file with VM option file option in it */ addVMOptionsFile(VM_OPTION_FILE_WITH_VM_OPTION_FILE); runJavaCheckExitValue(JVM_FAIL_WITH_EXIT_CODE_1); - outputShouldContain("The VM Options file can only be specified once and only on the command line."); + outputShouldContain("A VM options file may not refer to a VM options file. Specification of '-XX:VMOptionsFile=' in the options file"); /* Pass VM option file which is not accessible (without read permissions) */ addVMOptionsFile(getAbsolutePathFromSource(VM_OPTION_FILE_WITHOUT_READ_PERMISSIONS)); @@ -567,7 +596,7 @@ public class TestVMOptionsFile { addVMOptionsFile(VM_OPTION_FILE_2); runJavaCheckExitValue(JVM_FAIL_WITH_EXIT_CODE_1); - outputShouldContain("The VM Options file can only be specified once and only on the command line."); + outputShouldContain("is already specified in the"); /* Pass empty option file i.e. pass "-XX:VMOptionsFile=" */ addVMOptionsFile(""); @@ -586,22 +615,6 @@ public class TestVMOptionsFile { runJavaCheckExitValue(JVM_FAIL_WITH_EXIT_CODE_1); outputShouldContain("Unmatched quote in"); - - /* Pass VM Option file in _JAVA_OPTIONS environment variable */ - pb = createProcessBuilder(); - - updateEnvironment(pb, JAVA_OPTIONS, "-XX:VMOptionsFile=" + getAbsolutePathFromSource(VM_OPTION_FILE_1)); - - runJavaCheckExitValue(pb, JVM_FAIL_WITH_EXIT_CODE_1); - outputShouldContain("VM options file is only supported on the command line"); - - /* Pass VM Option file in JAVA_TOOL_OPTIONS environment variable */ - pb = createProcessBuilder(); - - updateEnvironment(pb, JAVA_TOOL_OPTIONS, "-XX:VMOptionsFile=" + getAbsolutePathFromSource(VM_OPTION_FILE_1)); - - runJavaCheckExitValue(pb, JVM_FAIL_WITH_EXIT_CODE_1); - outputShouldContain("VM options file is only supported on the command line"); } public static void main(String[] args) throws Exception { From 9760f7ac92ca41bb71ceb4928bd21982c65b8194 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Sun, 10 Jan 2016 20:02:50 -0500 Subject: [PATCH 028/212] 8146222: assert(_initialized) failed: TLS not initialized yet! Reviewed-by: dcubed --- hotspot/src/share/vm/runtime/thread.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 94b363d774b..99ded5d7475 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3390,13 +3390,16 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { // Check version if (!is_supported_jni_version(args->version)) return JNI_EVERSION; + // Initialize library-based TLS + ThreadLocalStorage::init(); + // Initialize the output stream module ostream_init(); // Process java launcher properties. Arguments::process_sun_java_launcher_properties(args); - // Initialize the os module before using TLS + // Initialize the os module os::init(); // Record VM creation timing statistics @@ -3451,9 +3454,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { jint adjust_after_os_result = Arguments::adjust_after_os(); if (adjust_after_os_result != JNI_OK) return adjust_after_os_result; - // Initialize library-based TLS - ThreadLocalStorage::init(); - // Initialize output stream logging ostream_init_log(); From b61875dc9b0aff43ff5efa93a79ac1f043ec3e5e Mon Sep 17 00:00:00 2001 From: David Lindholm Date: Mon, 11 Jan 2016 09:14:01 +0100 Subject: [PATCH 029/212] 8146694: Break out shared constants and static BOT functions Reviewed-by: jwilhelm, tbenson --- hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp | 4 +- .../src/share/vm/gc/g1/g1BlockOffsetTable.cpp | 52 +++++------ .../src/share/vm/gc/g1/g1BlockOffsetTable.hpp | 25 ++---- .../vm/gc/g1/g1BlockOffsetTable.inline.hpp | 12 +-- hotspot/src/share/vm/gc/g1/g1RemSet.cpp | 4 +- hotspot/src/share/vm/gc/g1/heapRegionSet.cpp | 4 +- .../share/vm/gc/shared/blockOffsetTable.cpp | 88 +++++++++---------- .../share/vm/gc/shared/blockOffsetTable.hpp | 73 +++++++-------- .../vm/gc/shared/blockOffsetTable.inline.hpp | 6 +- hotspot/src/share/vm/runtime/vmStructs.cpp | 15 ++-- 10 files changed, 134 insertions(+), 149 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp b/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp index e48b0f22c11..f08cd59a059 100644 --- a/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/g1AllocRegion.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -277,7 +277,7 @@ HeapRegion* OldGCAllocRegion::release() { // Determine how far we are from the next card boundary. If it is smaller than // the minimum object size we can allocate into, expand into the next card. HeapWord* top = cur->top(); - HeapWord* aligned_top = (HeapWord*)align_ptr_up(top, G1BlockOffsetTable::N_bytes); + HeapWord* aligned_top = (HeapWord*)align_ptr_up(top, BOTConstants::N_bytes); size_t to_allocate_words = pointer_delta(aligned_top, top, HeapWordSize); diff --git a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp index ef377be6c07..3a50ee45a6b 100644 --- a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,14 +53,14 @@ G1BlockOffsetTable::G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* st bool G1BlockOffsetTable::is_card_boundary(HeapWord* p) const { assert(p >= _reserved.start(), "just checking"); size_t delta = pointer_delta(p, _reserved.start()); - return (delta & right_n_bits(LogN_words)) == (size_t)NoBits; + return (delta & right_n_bits((int)BOTConstants::LogN_words)) == (size_t)NoBits; } #ifdef ASSERT void G1BlockOffsetTable::check_index(size_t index, const char* msg) const { - assert((index) < (_reserved.word_size() >> LogN_words), + assert((index) < (_reserved.word_size() >> BOTConstants::LogN_words), "%s - index: " SIZE_FORMAT ", _vs.committed_size: " SIZE_FORMAT, - msg, (index), (_reserved.word_size() >> LogN_words)); + msg, (index), (_reserved.word_size() >> BOTConstants::LogN_words)); assert(G1CollectedHeap::heap()->is_in_exact(address_for_index_raw(index)), "Index " SIZE_FORMAT " corresponding to " PTR_FORMAT " (%u) is not in committed area.", @@ -128,7 +128,7 @@ void G1BlockOffsetTablePart:: set_remainder_to_point_to_start(HeapWord* start, H size_t start_card = _bot->index_for(start); size_t end_card = _bot->index_for(end-1); assert(start ==_bot->address_for_index(start_card), "Precondition"); - assert(end ==_bot->address_for_index(end_card)+N_words, "Precondition"); + assert(end ==_bot->address_for_index(end_card)+BOTConstants::N_words, "Precondition"); set_remainder_to_point_to_start_incl(start_card, end_card); // closed interval } @@ -140,16 +140,16 @@ void G1BlockOffsetTablePart::set_remainder_to_point_to_start_incl(size_t start_c return; } assert(start_card > _bot->index_for(_space->bottom()), "Cannot be first card"); - assert(_bot->offset_array(start_card-1) <= N_words, + assert(_bot->offset_array(start_card-1) <= BOTConstants::N_words, "Offset card has an unexpected value"); size_t start_card_for_region = start_card; u_char offset = max_jubyte; - for (int i = 0; i < BlockOffsetArray::N_powers; i++) { + for (uint i = 0; i < BOTConstants::N_powers; i++) { // -1 so that the the card with the actual offset is counted. Another -1 // so that the reach ends in this region and not at the start // of the next. - size_t reach = start_card - 1 + (BlockOffsetArray::power_to_cards_back(i+1) - 1); - offset = N_words + i; + size_t reach = start_card - 1 + (BOTConstants::power_to_cards_back(i+1) - 1); + offset = BOTConstants::N_words + i; if (reach >= end_card) { _bot->set_offset_array(start_card_for_region, end_card, offset); start_card_for_region = reach + 1; @@ -170,18 +170,18 @@ void G1BlockOffsetTablePart::check_all_cards(size_t start_card, size_t end_card) if (end_card < start_card) { return; } - guarantee(_bot->offset_array(start_card) == N_words, "Wrong value in second card"); + guarantee(_bot->offset_array(start_card) == BOTConstants::N_words, "Wrong value in second card"); for (size_t c = start_card + 1; c <= end_card; c++ /* yeah! */) { u_char entry = _bot->offset_array(c); - if (c - start_card > BlockOffsetArray::power_to_cards_back(1)) { - guarantee(entry > N_words, + if (c - start_card > BOTConstants::power_to_cards_back(1)) { + guarantee(entry > BOTConstants::N_words, "Should be in logarithmic region - " "entry: %u, " "_array->offset_array(c): %u, " "N_words: %u", - (uint)entry, (uint)_bot->offset_array(c), (uint)N_words); + (uint)entry, (uint)_bot->offset_array(c), BOTConstants::N_words); } - size_t backskip = BlockOffsetArray::entry_to_cards_back(entry); + size_t backskip = BOTConstants::entry_to_cards_back(entry); size_t landing_card = c - backskip; guarantee(landing_card >= (start_card - 1), "Inv"); if (landing_card >= start_card) { @@ -192,10 +192,10 @@ void G1BlockOffsetTablePart::check_all_cards(size_t start_card, size_t end_card) } else { guarantee(landing_card == start_card - 1, "Tautology"); // Note that N_words is the maximum offset value - guarantee(_bot->offset_array(landing_card) <= N_words, + guarantee(_bot->offset_array(landing_card) <= BOTConstants::N_words, "landing card offset: %u, " "N_words: %u", - (uint)_bot->offset_array(landing_card), (uint)N_words); + (uint)_bot->offset_array(landing_card), (uint)BOTConstants::N_words); } } } @@ -217,7 +217,7 @@ HeapWord* G1BlockOffsetTablePart::forward_to_block_containing_addr_slow(HeapWord // Calculate a consistent next boundary. If "n" is not at the boundary // already, step to the boundary. HeapWord* next_boundary = _bot->address_for_index(n_index) + - (n_index == next_index ? 0 : N_words); + (n_index == next_index ? 0 : BOTConstants::N_words); assert(next_boundary <= _bot->_reserved.end(), "next_boundary is beyond the end of the covered region " " next_boundary " PTR_FORMAT " _array->_end " PTR_FORMAT, @@ -257,13 +257,13 @@ void G1BlockOffsetTablePart::alloc_block_work(HeapWord** threshold_, size_t* ind "phantom block"); assert(blk_end > threshold, "should be past threshold"); assert(blk_start <= threshold, "blk_start should be at or before threshold"); - assert(pointer_delta(threshold, blk_start) <= N_words, + assert(pointer_delta(threshold, blk_start) <= BOTConstants::N_words, "offset should be <= BlockOffsetSharedArray::N"); assert(G1CollectedHeap::heap()->is_in_reserved(blk_start), "reference must be into the heap"); assert(G1CollectedHeap::heap()->is_in_reserved(blk_end-1), "limit must be within the heap"); - assert(threshold == _bot->_reserved.start() + index*N_words, + assert(threshold == _bot->_reserved.start() + index*BOTConstants::N_words, "index must agree with threshold"); DEBUG_ONLY(size_t orig_index = index;) @@ -283,14 +283,14 @@ void G1BlockOffsetTablePart::alloc_block_work(HeapWord** threshold_, size_t* ind HeapWord* rem_st = _bot->address_for_index(index + 1); // Calculate rem_end this way because end_index // may be the last valid index in the covered region. - HeapWord* rem_end = _bot->address_for_index(end_index) + N_words; + HeapWord* rem_end = _bot->address_for_index(end_index) + BOTConstants::N_words; set_remainder_to_point_to_start(rem_st, rem_end); } index = end_index + 1; // Calculate threshold_ this way because end_index // may be the last valid index in the covered region. - threshold = _bot->address_for_index(end_index) + N_words; + threshold = _bot->address_for_index(end_index) + BOTConstants::N_words; assert(threshold >= blk_end, "Incorrect offset threshold"); // index_ and threshold_ updated here. @@ -303,7 +303,7 @@ void G1BlockOffsetTablePart::alloc_block_work(HeapWord** threshold_, size_t* ind size_t start_index = _bot->index_for(blk_start); HeapWord* boundary = _bot->address_for_index(start_index); assert((_bot->offset_array(orig_index) == 0 && blk_start == boundary) || - (_bot->offset_array(orig_index) > 0 && _bot->offset_array(orig_index) <= N_words), + (_bot->offset_array(orig_index) > 0 && _bot->offset_array(orig_index) <= BOTConstants::N_words), "offset array should have been set - " "orig_index offset: %u, " "blk_start: " PTR_FORMAT ", " @@ -313,12 +313,12 @@ void G1BlockOffsetTablePart::alloc_block_work(HeapWord** threshold_, size_t* ind for (size_t j = orig_index + 1; j <= end_index; j++) { assert(_bot->offset_array(j) > 0 && _bot->offset_array(j) <= - (u_char) (N_words+BlockOffsetArray::N_powers-1), + (u_char) (BOTConstants::N_words+BOTConstants::N_powers-1), "offset array should have been set - " "%u not > 0 OR %u not <= %u", (uint) _bot->offset_array(j), (uint) _bot->offset_array(j), - (uint) (N_words+BlockOffsetArray::N_powers-1)); + (uint) (BOTConstants::N_words+BOTConstants::N_powers-1)); } #endif } @@ -330,7 +330,7 @@ void G1BlockOffsetTablePart::verify() const { for (size_t current_card = start_card; current_card < end_card; current_card++) { u_char entry = _bot->offset_array(current_card); - if (entry < N_words) { + if (entry < BOTConstants::N_words) { // The entry should point to an object before the current card. Verify that // it is possible to walk from that object in to the current card by just // iterating over the objects following it. @@ -348,7 +348,7 @@ void G1BlockOffsetTablePart::verify() const { // Because we refine the BOT based on which cards are dirty there is not much we can verify here. // We need to make sure that we are going backwards and that we don't pass the start of the // corresponding heap region. But that is about all we can verify. - size_t backskip = BlockOffsetArray::entry_to_cards_back(entry); + size_t backskip = BOTConstants::entry_to_cards_back(entry); guarantee(backskip >= 1, "Must be going back at least one card."); size_t max_backskip = current_card - start_card; diff --git a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp index 3e968e020e4..8ee1e6d8b56 100644 --- a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp +++ b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ #define SHARE_VM_GC_G1_G1BLOCKOFFSETTABLE_HPP #include "gc/g1/g1RegionToSpaceMapper.hpp" +#include "gc/shared/blockOffsetTable.hpp" #include "memory/memRegion.hpp" #include "memory/virtualspace.hpp" #include "utilities/globalDefinitions.hpp" @@ -54,9 +55,9 @@ private: u_char* _offset_array; // byte array keeping backwards offsets void check_offset(size_t offset, const char* msg) const { - assert(offset <= N_words, + assert(offset <= BOTConstants::N_words, "%s - offset: " SIZE_FORMAT ", N_words: %u", - msg, offset, (uint)N_words); + msg, offset, BOTConstants::N_words); } // Bounds checking accessors: @@ -82,22 +83,15 @@ public: // Return the number of slots needed for an offset array // that covers mem_region_words words. static size_t compute_size(size_t mem_region_words) { - size_t number_of_slots = (mem_region_words / N_words); + size_t number_of_slots = (mem_region_words / BOTConstants::N_words); return ReservedSpace::allocation_align_size_up(number_of_slots); } // Returns how many bytes of the heap a single byte of the BOT corresponds to. static size_t heap_map_factor() { - return N_bytes; + return BOTConstants::N_bytes; } - enum SomePublicConstants { - LogN = 9, - LogN_words = LogN - LogHeapWordSize, - N_bytes = 1 << LogN, - N_words = 1 << LogN_words - }; - // Initialize the Block Offset Table to cover the memory region passed // in the heap parameter. G1BlockOffsetTable(MemRegion heap, G1RegionToSpaceMapper* storage); @@ -111,7 +105,7 @@ public: inline HeapWord* address_for_index(size_t index) const; // Variant of address_for_index that does not check the index for validity. inline HeapWord* address_for_index_raw(size_t index) const { - return _reserved.start() + (index << LogN_words); + return _reserved.start() + (index << BOTConstants::LogN_words); } }; @@ -119,11 +113,6 @@ class G1BlockOffsetTablePart VALUE_OBJ_CLASS_SPEC { friend class G1BlockOffsetTable; friend class VMStructs; private: - enum SomePrivateConstants { - N_words = G1BlockOffsetTable::N_words, - LogN = G1BlockOffsetTable::LogN - }; - // allocation boundary at which offset array must be updated HeapWord* _next_offset_threshold; size_t _next_offset_index; // index corresponding to that boundary diff --git a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp index 8341c27f1ca..f207f2586ba 100644 --- a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -76,7 +76,7 @@ void G1BlockOffsetTable::set_offset_array(size_t left, size_t right, u_char offs // Variant of index_for that does not check the index for validity. inline size_t G1BlockOffsetTable::index_for_raw(const void* p) const { - return pointer_delta((char*)p, _reserved.start(), sizeof(char)) >> LogN; + return pointer_delta((char*)p, _reserved.start(), sizeof(char)) >> BOTConstants::LogN; } inline size_t G1BlockOffsetTable::index_for(const void* p) const { @@ -117,15 +117,15 @@ inline HeapWord* G1BlockOffsetTablePart::block_at_or_preceding(const void* addr, HeapWord* q = _bot->address_for_index(index); uint offset = _bot->offset_array(index); // Extend u_char to uint. - while (offset >= N_words) { + while (offset >= BOTConstants::N_words) { // The excess of the offset from N_words indicates a power of Base // to go back by. - size_t n_cards_back = BlockOffsetArray::entry_to_cards_back(offset); - q -= (N_words * n_cards_back); + size_t n_cards_back = BOTConstants::entry_to_cards_back(offset); + q -= (BOTConstants::N_words * n_cards_back); index -= n_cards_back; offset = _bot->offset_array(index); } - assert(offset < N_words, "offset too large"); + assert(offset < BOTConstants::N_words, "offset too large"); q -= offset; return q; } diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp index c1b83e7345b..9258d575a95 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -109,7 +109,7 @@ void ScanRSClosure::scanCard(size_t index, HeapRegion *r) { // Set the "from" region in the closure. _oc->set_region(r); - MemRegion card_region(_bot->address_for_index(index), G1BlockOffsetTable::N_words); + MemRegion card_region(_bot->address_for_index(index), BOTConstants::N_words); MemRegion pre_gc_allocated(r->bottom(), r->scan_top()); MemRegion mr = pre_gc_allocated.intersection(card_region); if (!mr.is_empty() && !_ct_bs->is_card_claimed(index)) { diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp index 620d4facee0..89b5a7f044f 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -389,7 +389,7 @@ void FreeRegionList_test() { bot_rs.size(), os::vm_page_size(), HeapRegion::GrainBytes, - G1BlockOffsetTable::N_bytes, + BOTConstants::N_bytes, mtGC); G1BlockOffsetTable bot(heap, bot_storage); bot_storage->commit_regions(0, num_regions_in_test); diff --git a/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp b/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp index 9588d223bba..f4a3d15662e 100644 --- a/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,7 +87,7 @@ void BlockOffsetSharedArray::resize(size_t new_word_size) { bool BlockOffsetSharedArray::is_card_boundary(HeapWord* p) const { assert(p >= _reserved.start(), "just checking"); size_t delta = pointer_delta(p, _reserved.start()); - return (delta & right_n_bits(LogN_words)) == (size_t)NoBits; + return (delta & right_n_bits((int)BOTConstants::LogN_words)) == (size_t)NoBits; } @@ -104,7 +104,7 @@ BlockOffsetArray::BlockOffsetArray(BlockOffsetSharedArray* array, set_init_to_zero(init_to_zero_); if (!init_to_zero_) { // initialize cards to point back to mr.start() - set_remainder_to_point_to_start(mr.start() + N_words, mr.end()); + set_remainder_to_point_to_start(mr.start() + BOTConstants::N_words, mr.end()); _array->set_offset_array(0, 0); // set first card to 0 } } @@ -160,7 +160,7 @@ set_remainder_to_point_to_start(HeapWord* start, HeapWord* end, bool reducing) { size_t start_card = _array->index_for(start); size_t end_card = _array->index_for(end-1); assert(start ==_array->address_for_index(start_card), "Precondition"); - assert(end ==_array->address_for_index(end_card)+N_words, "Precondition"); + assert(end ==_array->address_for_index(end_card)+BOTConstants::N_words, "Precondition"); set_remainder_to_point_to_start_incl(start_card, end_card, reducing); // closed interval } @@ -176,16 +176,16 @@ BlockOffsetArray::set_remainder_to_point_to_start_incl(size_t start_card, size_t return; } assert(start_card > _array->index_for(_bottom), "Cannot be first card"); - assert(_array->offset_array(start_card-1) <= N_words, + assert(_array->offset_array(start_card-1) <= BOTConstants::N_words, "Offset card has an unexpected value"); size_t start_card_for_region = start_card; u_char offset = max_jubyte; - for (int i = 0; i < N_powers; i++) { + for (uint i = 0; i < BOTConstants::N_powers; i++) { // -1 so that the the card with the actual offset is counted. Another -1 // so that the reach ends in this region and not at the start // of the next. - size_t reach = start_card - 1 + (power_to_cards_back(i+1) - 1); - offset = N_words + i; + size_t reach = start_card - 1 + (BOTConstants::power_to_cards_back(i+1) - 1); + offset = BOTConstants::N_words + i; if (reach >= end_card) { _array->set_offset_array(start_card_for_region, end_card, offset, reducing); start_card_for_region = reach + 1; @@ -206,15 +206,15 @@ void BlockOffsetArray::check_all_cards(size_t start_card, size_t end_card) const if (end_card < start_card) { return; } - guarantee(_array->offset_array(start_card) == N_words, "Wrong value in second card"); - u_char last_entry = N_words; + guarantee(_array->offset_array(start_card) == BOTConstants::N_words, "Wrong value in second card"); + u_char last_entry = BOTConstants::N_words; for (size_t c = start_card + 1; c <= end_card; c++ /* yeah! */) { u_char entry = _array->offset_array(c); guarantee(entry >= last_entry, "Monotonicity"); - if (c - start_card > power_to_cards_back(1)) { - guarantee(entry > N_words, "Should be in logarithmic region"); + if (c - start_card > BOTConstants::power_to_cards_back(1)) { + guarantee(entry > BOTConstants::N_words, "Should be in logarithmic region"); } - size_t backskip = entry_to_cards_back(entry); + size_t backskip = BOTConstants::entry_to_cards_back(entry); size_t landing_card = c - backskip; guarantee(landing_card >= (start_card - 1), "Inv"); if (landing_card >= start_card) { @@ -222,7 +222,7 @@ void BlockOffsetArray::check_all_cards(size_t start_card, size_t end_card) const } else { guarantee(landing_card == (start_card - 1), "Tautology"); // Note that N_words is the maximum offset value - guarantee(_array->offset_array(landing_card) <= N_words, "Offset value"); + guarantee(_array->offset_array(landing_card) <= BOTConstants::N_words, "Offset value"); } last_entry = entry; // remember for monotonicity test } @@ -254,7 +254,7 @@ BlockOffsetArray::do_block_internal(HeapWord* blk_start, uintptr_t start_ui = (uintptr_t)blk_start; // Calculate the last card boundary preceding end of blk intptr_t boundary_before_end = (intptr_t)end_ui; - clear_bits(boundary_before_end, right_n_bits(LogN)); + clear_bits(boundary_before_end, right_n_bits((int)BOTConstants::LogN)); if (start_ui <= (uintptr_t)boundary_before_end) { // blk starts at or crosses a boundary // Calculate index of card on which blk begins @@ -267,7 +267,7 @@ BlockOffsetArray::do_block_internal(HeapWord* blk_start, if (blk_start != boundary) { // blk starts strictly after boundary // adjust card boundary and start_index forward to next card - boundary += N_words; + boundary += BOTConstants::N_words; start_index++; } assert(start_index <= end_index, "monotonicity of index_for()"); @@ -284,8 +284,8 @@ BlockOffsetArray::do_block_internal(HeapWord* blk_start, // We have finished marking the "offset card". We need to now // mark the subsequent cards that this blk spans. if (start_index < end_index) { - HeapWord* rem_st = _array->address_for_index(start_index) + N_words; - HeapWord* rem_end = _array->address_for_index(end_index) + N_words; + HeapWord* rem_st = _array->address_for_index(start_index) + BOTConstants::N_words; + HeapWord* rem_end = _array->address_for_index(end_index) + BOTConstants::N_words; set_remainder_to_point_to_start(rem_st, rem_end, reducing); } break; @@ -450,8 +450,8 @@ void BlockOffsetArrayNonContigSpace::split_block(HeapWord* blk, bool more = true; uint i = 1; // Fix the first power block with back_by > num_pref_cards. - while (more && (i < N_powers)) { - size_t back_by = power_to_cards_back(i); + while (more && (i < BOTConstants::N_powers)) { + size_t back_by = BOTConstants::power_to_cards_back(i); size_t right_index = suff_index + back_by - 1; size_t left_index = right_index - num_pref_cards + 1; if (right_index >= end_index - 1) { // last iteration @@ -466,7 +466,7 @@ void BlockOffsetArrayNonContigSpace::split_block(HeapWord* blk, // is non-null. if (left_index <= right_index) { _array->set_offset_array(left_index, right_index, - N_words + i - 1, true /* reducing */); + BOTConstants::N_words + i - 1, true /* reducing */); } else { more = false; // we are done assert((end_index - 1) == right_index, "Must be at the end."); @@ -477,8 +477,8 @@ void BlockOffsetArrayNonContigSpace::split_block(HeapWord* blk, i++; } // Fix the rest of the power blocks. - while (more && (i < N_powers)) { - size_t back_by = power_to_cards_back(i); + while (more && (i < BOTConstants::N_powers)) { + size_t back_by = BOTConstants::power_to_cards_back(i); size_t right_index = suff_index + back_by - 1; size_t left_index = right_index - num_pref_cards + 1; if (right_index >= end_index - 1) { // last iteration @@ -489,7 +489,7 @@ void BlockOffsetArrayNonContigSpace::split_block(HeapWord* blk, more = false; } assert(left_index <= right_index, "Error"); - _array->set_offset_array(left_index, right_index, N_words + i - 1, true /* reducing */); + _array->set_offset_array(left_index, right_index, BOTConstants::N_words + i - 1, true /* reducing */); i++; } } @@ -530,11 +530,11 @@ HeapWord* BlockOffsetArrayNonContigSpace::block_start_unsafe( HeapWord* q = _array->address_for_index(index); uint offset = _array->offset_array(index); // Extend u_char to uint. - while (offset >= N_words) { + while (offset >= BOTConstants::N_words) { // The excess of the offset from N_words indicates a power of Base // to go back by. - size_t n_cards_back = entry_to_cards_back(offset); - q -= (N_words * n_cards_back); + size_t n_cards_back = BOTConstants::entry_to_cards_back(offset); + q -= (BOTConstants::N_words * n_cards_back); assert(q >= _sp->bottom(), "q = " PTR_FORMAT " crossed below bottom = " PTR_FORMAT, p2i(q), p2i(_sp->bottom())); @@ -544,7 +544,7 @@ HeapWord* BlockOffsetArrayNonContigSpace::block_start_unsafe( index -= n_cards_back; offset = _array->offset_array(index); } - assert(offset < N_words, "offset too large"); + assert(offset < BOTConstants::N_words, "offset too large"); index--; q -= offset; assert(q >= _sp->bottom(), @@ -599,14 +599,14 @@ HeapWord* BlockOffsetArrayNonContigSpace::block_start_careful( uint offset; do { offset = _array->offset_array(index); - if (offset < N_words) { + if (offset < BOTConstants::N_words) { q -= offset; } else { - size_t n_cards_back = entry_to_cards_back(offset); - q -= (n_cards_back * N_words); + size_t n_cards_back = BOTConstants::entry_to_cards_back(offset); + q -= (n_cards_back * BOTConstants::N_words); index -= n_cards_back; } - } while (offset >= N_words); + } while (offset >= BOTConstants::N_words); assert(q <= addr, "block start should be to left of arg"); return q; } @@ -668,22 +668,22 @@ HeapWord* BlockOffsetArrayContigSpace::block_start_unsafe(const void* addr) cons HeapWord* q = _array->address_for_index(index); uint offset = _array->offset_array(index); // Extend u_char to uint. - while (offset > N_words) { + while (offset > BOTConstants::N_words) { // The excess of the offset from N_words indicates a power of Base // to go back by. - size_t n_cards_back = entry_to_cards_back(offset); - q -= (N_words * n_cards_back); + size_t n_cards_back = BOTConstants::entry_to_cards_back(offset); + q -= (BOTConstants::N_words * n_cards_back); assert(q >= _sp->bottom(), "Went below bottom!"); index -= n_cards_back; offset = _array->offset_array(index); } - while (offset == N_words) { + while (offset == BOTConstants::N_words) { assert(q >= _sp->bottom(), "Went below bottom!"); - q -= N_words; + q -= BOTConstants::N_words; index--; offset = _array->offset_array(index); } - assert(offset < N_words, "offset too large"); + assert(offset < BOTConstants::N_words, "offset too large"); q -= offset; HeapWord* n = q; @@ -716,14 +716,14 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, "should be past threshold"); assert(blk_start <= _next_offset_threshold, "blk_start should be at or before threshold"); - assert(pointer_delta(_next_offset_threshold, blk_start) <= N_words, + assert(pointer_delta(_next_offset_threshold, blk_start) <= BOTConstants::N_words, "offset should be <= BlockOffsetSharedArray::N"); assert(Universe::heap()->is_in_reserved(blk_start), "reference must be into the heap"); assert(Universe::heap()->is_in_reserved(blk_end-1), "limit must be within the heap"); assert(_next_offset_threshold == - _array->_reserved.start() + _next_offset_index*N_words, + _array->_reserved.start() + _next_offset_index*BOTConstants::N_words, "index must agree with threshold"); debug_only(size_t orig_next_offset_index = _next_offset_index;) @@ -745,7 +745,7 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, HeapWord* rem_st = _array->address_for_index(_next_offset_index + 1); // Calculate rem_end this way because end_index // may be the last valid index in the covered region. - HeapWord* rem_end = _array->address_for_index(end_index) + N_words; + HeapWord* rem_end = _array->address_for_index(end_index) + BOTConstants::N_words; set_remainder_to_point_to_start(rem_st, rem_end); } @@ -753,7 +753,7 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, _next_offset_index = end_index + 1; // Calculate _next_offset_threshold this way because end_index // may be the last valid index in the covered region. - _next_offset_threshold = _array->address_for_index(end_index) + N_words; + _next_offset_threshold = _array->address_for_index(end_index) + BOTConstants::N_words; assert(_next_offset_threshold >= blk_end, "Incorrect offset threshold"); #ifdef ASSERT @@ -764,11 +764,11 @@ void BlockOffsetArrayContigSpace::alloc_block_work(HeapWord* blk_start, assert((_array->offset_array(orig_next_offset_index) == 0 && blk_start == boundary) || (_array->offset_array(orig_next_offset_index) > 0 && - _array->offset_array(orig_next_offset_index) <= N_words), + _array->offset_array(orig_next_offset_index) <= BOTConstants::N_words), "offset array should have been set"); for (size_t j = orig_next_offset_index + 1; j <= end_index; j++) { assert(_array->offset_array(j) > 0 && - _array->offset_array(j) <= (u_char) (N_words+N_powers-1), + _array->offset_array(j) <= (u_char) (BOTConstants::N_words+BOTConstants::N_powers-1), "offset array should have been set"); } #endif diff --git a/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp b/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp index 0921e932609..05736fb045d 100644 --- a/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp +++ b/hotspot/src/share/vm/gc/shared/blockOffsetTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,34 @@ class ContiguousSpace; +class BOTConstants : public AllStatic { +public: + static const uint LogN = 9; + static const uint LogN_words = LogN - LogHeapWordSize; + static const uint N_bytes = 1 << LogN; + static const uint N_words = 1 << LogN_words; + // entries "e" of at least N_words mean "go back by Base^(e-N_words)." + // All entries are less than "N_words + N_powers". + static const uint LogBase = 4; + static const uint Base = (1 << LogBase); + static const uint N_powers = 14; + + static size_t power_to_cards_back(uint i) { + return (size_t)1 << (LogBase * i); + } + static size_t power_to_words_back(uint i) { + return power_to_cards_back(i) * N_words; + } + static size_t entry_to_cards_back(u_char entry) { + assert(entry >= N_words, "Precondition"); + return power_to_cards_back(entry - N_words); + } + static size_t entry_to_words_back(u_char entry) { + assert(entry >= N_words, "Precondition"); + return power_to_words_back(entry - N_words); + } +}; + ////////////////////////////////////////////////////////////////////////// // The BlockOffsetTable "interface" ////////////////////////////////////////////////////////////////////////// @@ -109,13 +137,6 @@ class BlockOffsetSharedArray: public CHeapObj { friend class VMStructs; private: - enum SomePrivateConstants { - LogN = 9, - LogN_words = LogN - LogHeapWordSize, - N_bytes = 1 << LogN, - N_words = 1 << LogN_words - }; - bool _init_to_zero; // The reserved region covered by the shared array. @@ -163,7 +184,7 @@ class BlockOffsetSharedArray: public CHeapObj { check_reducing_assertion(reducing); assert(index < _vs.committed_size(), "index out of range"); assert(high >= low, "addresses out of order"); - assert(pointer_delta(high, low) <= N_words, "offset too large"); + assert(pointer_delta(high, low) <= BOTConstants::N_words, "offset too large"); assert(!reducing || _offset_array[index] >= (u_char)pointer_delta(high, low), "Not reducing"); _offset_array[index] = (u_char)pointer_delta(high, low); @@ -174,7 +195,7 @@ class BlockOffsetSharedArray: public CHeapObj { assert(index_for(right - 1) < _vs.committed_size(), "right address out of range"); assert(left < right, "Heap addresses out of order"); - size_t num_cards = pointer_delta(right, left) >> LogN_words; + size_t num_cards = pointer_delta(right, left) >> BOTConstants::LogN_words; fill_range(index_for(left), num_cards, offset); } @@ -191,7 +212,7 @@ class BlockOffsetSharedArray: public CHeapObj { void check_offset_array(size_t index, HeapWord* high, HeapWord* low) const { assert(index < _vs.committed_size(), "index out of range"); assert(high >= low, "addresses out of order"); - assert(pointer_delta(high, low) <= N_words, "offset too large"); + assert(pointer_delta(high, low) <= BOTConstants::N_words, "offset too large"); assert(_offset_array[index] == pointer_delta(high, low), "Wrong offset"); } @@ -206,7 +227,7 @@ class BlockOffsetSharedArray: public CHeapObj { // to be reserved. size_t compute_size(size_t mem_region_words) { - size_t number_of_slots = (mem_region_words / N_words) + 1; + size_t number_of_slots = (mem_region_words / BOTConstants::N_words) + 1; return ReservedSpace::allocation_align_size_up(number_of_slots); } @@ -248,7 +269,6 @@ public: ////////////////////////////////////////////////////////////////////////// class BlockOffsetArray: public BlockOffsetTable { friend class VMStructs; - friend class G1BlockOffsetTablePart; // temp. until we restructure and cleanup protected: // The following enums are used by do_block_internal() below enum Action { @@ -258,31 +278,6 @@ class BlockOffsetArray: public BlockOffsetTable { // (see verify_single_block()). }; - enum SomePrivateConstants { - N_words = BlockOffsetSharedArray::N_words, - LogN = BlockOffsetSharedArray::LogN, - // entries "e" of at least N_words mean "go back by Base^(e-N_words)." - // All entries are less than "N_words + N_powers". - LogBase = 4, - Base = (1 << LogBase), - N_powers = 14 - }; - - static size_t power_to_cards_back(uint i) { - return (size_t)1 << (LogBase * i); - } - static size_t power_to_words_back(uint i) { - return power_to_cards_back(i) * N_words; - } - static size_t entry_to_cards_back(u_char entry) { - assert(entry >= N_words, "Precondition"); - return power_to_cards_back(entry - N_words); - } - static size_t entry_to_words_back(u_char entry) { - assert(entry >= N_words, "Precondition"); - return power_to_words_back(entry - N_words); - } - // The shared array, which is shared with other BlockOffsetArray's // corresponding to different spaces within a generation or span of // memory. @@ -344,7 +339,7 @@ class BlockOffsetArray: public BlockOffsetTable { assert(_array->is_card_boundary(new_end), "new _end would not be a card boundary"); // set all the newly added cards - _array->set_offset_array(_end, new_end, N_words); + _array->set_offset_array(_end, new_end, BOTConstants::N_words); } _end = new_end; // update _end } diff --git a/hotspot/src/share/vm/gc/shared/blockOffsetTable.inline.hpp b/hotspot/src/share/vm/gc/shared/blockOffsetTable.inline.hpp index 4014927c6b6..4908c107d14 100644 --- a/hotspot/src/share/vm/gc/shared/blockOffsetTable.inline.hpp +++ b/hotspot/src/share/vm/gc/shared/blockOffsetTable.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,14 +49,14 @@ inline size_t BlockOffsetSharedArray::index_for(const void* p) const { pc < (char*)_reserved.end(), "p not in range."); size_t delta = pointer_delta(pc, _reserved.start(), sizeof(char)); - size_t result = delta >> LogN; + size_t result = delta >> BOTConstants::LogN; assert(result < _vs.committed_size(), "bad index from address"); return result; } inline HeapWord* BlockOffsetSharedArray::address_for_index(size_t index) const { assert(index < _vs.committed_size(), "bad index"); - HeapWord* result = _reserved.start() + (index << LogN_words); + HeapWord* result = _reserved.start() + (index << BOTConstants::LogN_words); assert(result >= _reserved.start() && result < _reserved.end(), "bad address from index"); return result; diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 5be0aaaba95..8885bbb9a24 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2320,12 +2320,13 @@ typedef CompactHashtable SymbolCompactHashTable; declare_constant(BarrierSet::G1SATBCT) \ declare_constant(BarrierSet::G1SATBCTLogging) \ \ - declare_constant(BlockOffsetSharedArray::LogN) \ - declare_constant(BlockOffsetSharedArray::LogN_words) \ - declare_constant(BlockOffsetSharedArray::N_bytes) \ - declare_constant(BlockOffsetSharedArray::N_words) \ - \ - declare_constant(BlockOffsetArray::N_words) \ + declare_constant(BOTConstants::LogN) \ + declare_constant(BOTConstants::LogN_words) \ + declare_constant(BOTConstants::N_bytes) \ + declare_constant(BOTConstants::N_words) \ + declare_constant(BOTConstants::LogBase) \ + declare_constant(BOTConstants::Base) \ + declare_constant(BOTConstants::N_powers) \ \ declare_constant(CardTableModRefBS::clean_card) \ declare_constant(CardTableModRefBS::last_card) \ From a37ef034c17508cfaf9169b4c673ba9399245726 Mon Sep 17 00:00:00 2001 From: Sangheon Kim Date: Thu, 7 Jan 2016 16:19:41 -0800 Subject: [PATCH 030/212] 8144573: TLABWasteIncrement=max_jint fires an assert on SPARC for non-G1 GC mode Changed to use set64 if TLABWasteIncrement is larger than 4095 before add Reviewed-by: tschatzl, iveresov --- .../src/cpu/sparc/vm/macroAssembler_sparc.cpp | 16 +++++++++++++--- hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp | 12 ++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 0920bc90e08..a05284e07f8 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3400,10 +3400,20 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case // Retain tlab and allocate object in shared space if // the amount free in the tlab is too large to discard. cmp(t1, t2); - brx(Assembler::lessEqual, false, Assembler::pt, discard_tlab); + brx(Assembler::lessEqual, false, Assembler::pt, discard_tlab); // increment waste limit to prevent getting stuck on this slow path - delayed()->add(t2, ThreadLocalAllocBuffer::refill_waste_limit_increment(), t2); + if (Assembler::is_simm13(ThreadLocalAllocBuffer::refill_waste_limit_increment())) { + delayed()->add(t2, ThreadLocalAllocBuffer::refill_waste_limit_increment(), t2); + } else { + delayed()->nop(); + // set64 does not use the temp register if the given constant is 32 bit. So + // we can just use any register; using G0 results in ignoring of the upper 32 bit + // of that value. + set64(ThreadLocalAllocBuffer::refill_waste_limit_increment(), t3, G0); + add(t2, t3, t2); + } + st_ptr(t2, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset())); if (TLABStats) { // increment number of slow_allocations diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index 158bb544d9e..a8b1c36159e 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3356,7 +3356,15 @@ void TemplateTable::_new() { __ cmp_and_brx_short(RtlabWasteLimitValue, RfreeValue, Assembler::greaterEqualUnsigned, Assembler::pt, slow_case); // tlab waste is small // increment waste limit to prevent getting stuck on this slow path - __ add(RtlabWasteLimitValue, ThreadLocalAllocBuffer::refill_waste_limit_increment(), RtlabWasteLimitValue); + if (Assembler::is_simm13(ThreadLocalAllocBuffer::refill_waste_limit_increment())) { + __ add(RtlabWasteLimitValue, ThreadLocalAllocBuffer::refill_waste_limit_increment(), RtlabWasteLimitValue); + } else { + // set64 does not use the temp register if the given constant is 32 bit. So + // we can just use any register; using G0 results in ignoring of the upper 32 bit + // of that value. + __ set64(ThreadLocalAllocBuffer::refill_waste_limit_increment(), G4_scratch, G0); + __ add(RtlabWasteLimitValue, G4_scratch, RtlabWasteLimitValue); + } __ st_ptr(RtlabWasteLimitValue, G2_thread, in_bytes(JavaThread::tlab_refill_waste_limit_offset())); } else { // No allocation in the shared eden. From 307d39879bf849344af5b9b66271eaba66ade14d Mon Sep 17 00:00:00 2001 From: Ed Nevill Date: Fri, 8 Jan 2016 11:39:47 +0000 Subject: [PATCH 031/212] 8146678: aarch64: assertion failure: call instruction in an infinite loop Remove assertion Reviewed-by: aph --- hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp index 40b53127487..9b80b0b48ec 100644 --- a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp @@ -87,7 +87,6 @@ void Relocation::pd_set_call_destination(address x) { return; } } - assert(addr() != x, "call instruction in an infinite loop"); MacroAssembler::pd_patch_instruction(addr(), x); assert(pd_call_destination(addr()) == x, "fail in reloc"); } From ad3414f9857dc3f135418bf02673f4356ed888a8 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Fri, 8 Jan 2016 11:41:04 +0100 Subject: [PATCH 032/212] 8146612: C2: Precedence edges specification violated Reviewed-by: kvn --- hotspot/src/share/vm/opto/lcm.cpp | 9 ++++++- hotspot/src/share/vm/opto/node.cpp | 43 +++++++++++++++++------------- hotspot/src/share/vm/opto/node.hpp | 39 ++++++++++++++++++++++++--- 3 files changed, 69 insertions(+), 22 deletions(-) diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp index 57614f7cddf..3edfc5e0ef0 100644 --- a/hotspot/src/share/vm/opto/lcm.cpp +++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -949,6 +949,13 @@ bool PhaseCFG::schedule_local(Block* block, GrowableArray& ready_cnt, Vecto // and the edge will be lost. This is why this code should be // executed only when Precedent (== TypeFunc::Parms) edge is present. Node *x = n->in(TypeFunc::Parms); + if (x != NULL && get_block_for_node(x) == block && n->find_prec_edge(x) != -1) { + // Old edge to node within same block will get removed, but no precedence + // edge will get added because it already exists. Update ready count. + int cnt = ready_cnt.at(n->_idx); + assert(cnt > 1, "MemBar node %d must not get ready here", n->_idx); + ready_cnt.at_put(n->_idx, cnt-1); + } n->del_req(TypeFunc::Parms); n->add_prec(x); } diff --git a/hotspot/src/share/vm/opto/node.cpp b/hotspot/src/share/vm/opto/node.cpp index ac093690bc5..433cfaf0946 100644 --- a/hotspot/src/share/vm/opto/node.cpp +++ b/hotspot/src/share/vm/opto/node.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -796,8 +796,9 @@ void Node::del_req( uint idx ) { // First remove corresponding def-use edge Node *n = in(idx); if (n != NULL) n->del_out((Node *)this); - _in[idx] = in(--_cnt); // Compact the array - _in[_cnt] = NULL; // NULL out emptied slot + _in[idx] = in(--_cnt); // Compact the array + // Avoid spec violation: Gap in prec edges. + close_prec_gap_at(_cnt); Compile::current()->record_modified_node(this); } @@ -810,10 +811,11 @@ void Node::del_req_ordered( uint idx ) { // First remove corresponding def-use edge Node *n = in(idx); if (n != NULL) n->del_out((Node *)this); - if (idx < _cnt - 1) { // Not last edge ? - Copy::conjoint_words_to_lower((HeapWord*)&_in[idx+1], (HeapWord*)&_in[idx], ((_cnt-idx-1)*sizeof(Node*))); + if (idx < --_cnt) { // Not last edge ? + Copy::conjoint_words_to_lower((HeapWord*)&_in[idx+1], (HeapWord*)&_in[idx], ((_cnt-idx)*sizeof(Node*))); } - _in[--_cnt] = NULL; // NULL out emptied slot + // Avoid spec violation: Gap in prec edges. + close_prec_gap_at(_cnt); Compile::current()->record_modified_node(this); } @@ -845,10 +847,12 @@ int Node::replace_edge(Node* old, Node* neww) { uint nrep = 0; for (uint i = 0; i < len(); i++) { if (in(i) == old) { - if (i < req()) + if (i < req()) { set_req(i, neww); - else + } else { + assert(find_prec_edge(neww) == -1, "spec violation: duplicated prec edge (node %d -> %d)", _idx, neww->_idx); set_prec(i, neww); + } nrep++; } } @@ -982,24 +986,27 @@ void Node::add_prec( Node *n ) { // Find a precedence edge to move uint i = _cnt; - while( in(i) != NULL ) i++; + while( in(i) != NULL ) { + if (in(i) == n) return; // Avoid spec violation: duplicated prec edge. + i++; + } _in[i] = n; // Stuff prec edge over NULL if ( n != NULL) n->add_out((Node *)this); // Add mirror edge + +#ifdef ASSERT + while ((++i)<_max) { assert(_in[i] == NULL, "spec violation: Gap in prec edges (node %d)", _idx); } +#endif } //------------------------------rm_prec---------------------------------------- // Remove a precedence input. Precedence inputs are unordered, with // duplicates removed and NULLs packed down at the end. void Node::rm_prec( uint j ) { - - // Find end of precedence list to pack NULLs - uint i; - for( i=j; i<_max; i++ ) - if( !_in[i] ) // Find the NULL at end of prec edge list - break; - if (_in[j] != NULL) _in[j]->del_out((Node *)this); - _in[j] = _in[--i]; // Move last element over removed guy - _in[i] = NULL; // NULL out last element + assert(j < _max, "oob: i=%d, _max=%d", j, _max); + assert(j >= _cnt, "not a precedence edge"); + if (_in[j] == NULL) return; // Avoid spec violation: Gap in prec edges. + _in[j]->del_out((Node *)this); + close_prec_gap_at(j); } //------------------------------size_of---------------------------------------- diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp index d737f537868..559a4495eae 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -423,6 +423,16 @@ protected: } // Find first occurrence of n among my edges: int find_edge(Node* n); + int find_prec_edge(Node* n) { + for (uint i = req(); i < len(); i++) { + if (_in[i] == n) return i; + if (_in[i] == NULL) { + DEBUG_ONLY( while ((++i) < len()) assert(_in[i] == NULL, "Gap in prec edges!"); ) + break; + } + } + return -1; + } int replace_edge(Node* old, Node* neww); int replace_edges_in_range(Node* old, Node* neww, int start, int end); // NULL out all inputs to eliminate incoming Def-Use edges. @@ -476,6 +486,19 @@ private: debug_only(_last_del = n; ++_del_tick); #endif } + // Close gap after removing edge. + void close_prec_gap_at(uint gap) { + assert(_cnt <= gap && gap < _max, "no valid prec edge"); + uint i = gap; + Node *last = NULL; + for (; i < _max-1; ++i) { + Node *next = _in[i+1]; + if (next == NULL) break; + last = next; + } + _in[gap] = last; // Move last slot to empty one. + _in[i] = NULL; // NULL out last slot. + } public: // Globally replace this node by a given new node, updating all uses. @@ -492,13 +515,23 @@ public: // Add or remove precedence edges void add_prec( Node *n ); void rm_prec( uint i ); + + // Note: prec(i) will not necessarily point to n if edge already exists. void set_prec( uint i, Node *n ) { - assert( is_not_dead(n), "can not use dead node"); - assert( i >= _cnt, "not a precedence edge"); + assert(i < _max, "oob: i=%d, _max=%d", i, _max); + assert(is_not_dead(n), "can not use dead node"); + assert(i >= _cnt, "not a precedence edge"); + // Avoid spec violation: duplicated prec edge. + if (_in[i] == n) return; + if (n == NULL || find_prec_edge(n) != -1) { + rm_prec(i); + return; + } if (_in[i] != NULL) _in[i]->del_out((Node *)this); _in[i] = n; if (n != NULL) n->add_out((Node *)this); } + // Set this node's index, used by cisc_version to replace current node void set_idx(uint new_idx) { const node_idx_t* ref = &_idx; From 6a52e93df70574590bb9061f06bfb4690f88a547 Mon Sep 17 00:00:00 2001 From: Vivek Deshpande Date: Fri, 8 Jan 2016 21:06:50 -0800 Subject: [PATCH 033/212] 8143353: update for x86 sin and cos in the math lib Optimize Math.sin() and cos() for 64 and 32 bit X86 architecture using Intel LIBM implementation. Reviewed-by: kvn --- .../cpu/sparc/vm/c1_LIRAssembler_sparc.cpp | 4 +- hotspot/src/cpu/x86/vm/assembler_x86.cpp | 14 + hotspot/src/cpu/x86/vm/assembler_x86.hpp | 2 + .../src/cpu/x86/vm/c1_LIRAssembler_x86.cpp | 9 - .../src/cpu/x86/vm/c1_LIRGenerator_x86.cpp | 45 +- hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp | 4 +- hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp | 4 +- hotspot/src/cpu/x86/vm/globals_x86.hpp | 8 +- hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp | 21 +- hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp | 6 + .../cpu/x86/vm/macroAssembler_libm_x86_32.cpp | 4571 +++++++++++++++++ ...ibm.cpp => macroAssembler_libm_x86_64.cpp} | 3648 +++++-------- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 48 +- hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp | 30 +- .../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 96 +- .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 118 +- .../src/cpu/x86/vm/stubRoutines_x86_32.hpp | 2 +- .../src/cpu/x86/vm/stubRoutines_x86_64.hpp | 2 +- hotspot/src/cpu/x86/vm/x86_32.ad | 42 - hotspot/src/cpu/x86/vm/x86_64.ad | 18 - hotspot/src/share/vm/adlc/formssel.cpp | 2 - hotspot/src/share/vm/c1/c1_LIR.cpp | 4 - hotspot/src/share/vm/c1/c1_LIR.hpp | 4 - hotspot/src/share/vm/c1/c1_LIRAssembler.cpp | 2 - hotspot/src/share/vm/c1/c1_LinearScan.cpp | 2 - hotspot/src/share/vm/c1/c1_Runtime1.cpp | 2 + hotspot/src/share/vm/opto/classes.hpp | 2 - hotspot/src/share/vm/opto/library_call.cpp | 28 +- hotspot/src/share/vm/opto/subnode.cpp | 22 - hotspot/src/share/vm/opto/subnode.hpp | 29 - hotspot/src/share/vm/runtime/stubRoutines.cpp | 4 + hotspot/src/share/vm/runtime/stubRoutines.hpp | 8 + hotspot/src/share/vm/runtime/vmStructs.cpp | 4 +- 33 files changed, 6271 insertions(+), 2534 deletions(-) create mode 100644 hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_32.cpp rename hotspot/src/cpu/x86/vm/{macroAssembler_x86_libm.cpp => macroAssembler_libm_x86_64.cpp} (53%) diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index 82e9bbddf2a..128f6c31171 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @@ -1805,9 +1805,7 @@ void LIR_Assembler::fpop() { void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, LIR_Opr dest, LIR_Op* op) { switch (code) { - case lir_sin: - case lir_tan: - case lir_cos: { + case lir_tan: { assert(thread->is_valid(), "preserve the thread object for performance reasons"); assert(dest->as_double_reg() == F0, "the result will be in f0/f1"); break; diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index 9a7fd0069cf..222d9ba60e2 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -1891,6 +1891,12 @@ void Assembler::divl(Register src) { // Unsigned emit_int8((unsigned char)(0xF0 | encode)); } +void Assembler::imull(Register src) { + int encode = prefix_and_encode(src->encoding()); + emit_int8((unsigned char)0xF7); + emit_int8((unsigned char)(0xE8 | encode)); +} + void Assembler::imull(Register dst, Register src) { int encode = prefix_and_encode(dst->encoding(), src->encoding()); emit_int8(0x0F); @@ -4112,6 +4118,14 @@ void Assembler::testb(Register dst, int imm8) { emit_arith_b(0xF6, 0xC0, dst, imm8); } +void Assembler::testb(Address dst, int imm8) { + InstructionMark im(this); + prefix(dst); + emit_int8((unsigned char)0xF6); + emit_operand(rax, dst, 1); + emit_int8(imm8); +} + void Assembler::testl(Register dst, int32_t imm32) { // not using emit_arith because test // doesn't support sign-extension of diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index 45ecc01f24a..167f44325fa 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -1205,6 +1205,7 @@ private: void idivq(Register src); #endif + void imull(Register src); void imull(Register dst, Register src); void imull(Register dst, Register src, int value); void imull(Register dst, Address src); @@ -1727,6 +1728,7 @@ private: void subss(XMMRegister dst, XMMRegister src); void testb(Register dst, int imm8); + void testb(Address dst, int imm8); void testl(Register dst, int32_t imm32); void testl(Register dst, Register src); diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index 963c1b77df1..fb36620c19b 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -2368,15 +2368,6 @@ void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr unused, L case lir_log10 : __ flog10() ; break; case lir_abs : __ fabs() ; break; case lir_sqrt : __ fsqrt(); break; - case lir_sin : - // Should consider not saving rbx, if not necessary - __ trigfunc('s', op->as_Op2()->fpu_stack_size()); - break; - case lir_cos : - // Should consider not saving rbx, if not necessary - assert(op->as_Op2()->fpu_stack_size() <= 6, "sin and cos need two free stack slots"); - __ trigfunc('c', op->as_Op2()->fpu_stack_size()); - break; case lir_tan : // Should consider not saving rbx, if not necessary __ trigfunc('t', op->as_Op2()->fpu_stack_size()); diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index 63073ac4648..b545d0b6989 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -811,7 +811,8 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type"); if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog || - x->id() == vmIntrinsics::_dpow) { + x->id() == vmIntrinsics::_dpow || x->id() == vmIntrinsics::_dcos || + x->id() == vmIntrinsics::_dsin) { do_LibmIntrinsic(x); return; } @@ -821,11 +822,10 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { bool use_fpu = false; if (UseSSE >= 2) { switch(x->id()) { - case vmIntrinsics::_dsin: - case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: case vmIntrinsics::_dlog10: use_fpu = true; + break; } } else { value.set_destroys_register(); @@ -870,8 +870,6 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { switch(x->id()) { case vmIntrinsics::_dabs: __ abs (calc_input, calc_result, LIR_OprFact::illegalOpr); break; case vmIntrinsics::_dsqrt: __ sqrt (calc_input, calc_result, LIR_OprFact::illegalOpr); break; - case vmIntrinsics::_dsin: __ sin (calc_input, calc_result, tmp1, tmp2); break; - case vmIntrinsics::_dcos: __ cos (calc_input, calc_result, tmp1, tmp2); break; case vmIntrinsics::_dtan: __ tan (calc_input, calc_result, tmp1, tmp2); break; case vmIntrinsics::_dlog10: __ log10(calc_input, calc_result, tmp1); break; default: ShouldNotReachHere(); @@ -923,19 +921,31 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { case vmIntrinsics::_dlog: if (VM_Version::supports_sse2()) { __ call_runtime_leaf(StubRoutines::dlog(), getThreadTemp(), result_reg, cc->args()); - } - else { + } else { __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dlog), getThreadTemp(), result_reg, cc->args()); } break; case vmIntrinsics::_dpow: if (VM_Version::supports_sse2()) { __ call_runtime_leaf(StubRoutines::dpow(), getThreadTemp(), result_reg, cc->args()); - } - else { + } else { __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dpow), getThreadTemp(), result_reg, cc->args()); } break; + case vmIntrinsics::_dsin: + if (VM_Version::supports_sse2() && StubRoutines::dsin() != NULL) { + __ call_runtime_leaf(StubRoutines::dsin(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dsin), getThreadTemp(), result_reg, cc->args()); + } + break; + case vmIntrinsics::_dcos: + if (VM_Version::supports_sse2() && StubRoutines::dcos() != NULL) { + __ call_runtime_leaf(StubRoutines::dcos(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dcos), getThreadTemp(), result_reg, cc->args()); + } + break; default: ShouldNotReachHere(); } #else @@ -949,8 +959,23 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { case vmIntrinsics::_dpow: __ call_runtime_leaf(StubRoutines::dpow(), getThreadTemp(), result_reg, cc->args()); break; + case vmIntrinsics::_dsin: + if (StubRoutines::dsin() != NULL) { + __ call_runtime_leaf(StubRoutines::dsin(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dsin), getThreadTemp(), result_reg, cc->args()); + } + break; + case vmIntrinsics::_dcos: + if (StubRoutines::dcos() != NULL) { + __ call_runtime_leaf(StubRoutines::dcos(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dcos), getThreadTemp(), result_reg, cc->args()); + } + break; + default: ShouldNotReachHere(); } -#endif +#endif // _LP64 __ move(result_reg, calc_result); } diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp index 52924b6e8dc..c3108727fec 100644 --- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp @@ -811,9 +811,7 @@ void FpuStackAllocator::handle_op2(LIR_Op2* op2) { } - case lir_tan: - case lir_sin: - case lir_cos: { + case lir_tan: { // sin, cos and exp need two temporary fpu stack slots, so there are two temporary // registers (stored in right and temp of the operation). // the stack allocator must guarantee that the stack slots are really free, diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp index 3902d974bc0..a5e533696b2 100644 --- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.hpp @@ -67,9 +67,7 @@ inline bool LinearScan::is_caller_save(int assigned_reg) { inline void LinearScan::pd_add_temps(LIR_Op* op) { switch (op->code()) { - case lir_tan: - case lir_sin: - case lir_cos: { + case lir_tan: { // The slow path for these functions may need to save and // restore all live registers but we don't want to save and // restore everything all the time, so mark the xmms as being diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index 57dc051ab5f..2c5b1712430 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -188,5 +188,11 @@ define_pd_global(bool, PreserveFramePointer, false); "Use BMI1 instructions") \ \ product(bool, UseBMI2Instructions, false, \ - "Use BMI2 instructions") + "Use BMI2 instructions") \ + \ + diagnostic(bool, UseLibmSinIntrinsic, true, \ + "Use Libm Sin Intrinsic") \ + \ + diagnostic(bool, UseLibmCosIntrinsic, true, \ + "Use Libm Cos Intrinsic") #endif // CPU_X86_VM_GLOBALS_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp index 6fee997e7a6..150a3abe1fd 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp @@ -116,10 +116,24 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin __ fld_d(Address(rsp, 1*wordSize)); switch (kind) { case Interpreter::java_lang_math_sin : - __ trigfunc('s'); + __ subptr(rsp, 2 * wordSize); + __ fstp_d(Address(rsp, 0)); + if (VM_Version::supports_sse2() && StubRoutines::dsin() != NULL) { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dsin()))); + } else { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dsin))); + } + __ addptr(rsp, 2 * wordSize); break; case Interpreter::java_lang_math_cos : - __ trigfunc('c'); + __ subptr(rsp, 2 * wordSize); + __ fstp_d(Address(rsp, 0)); + if (VM_Version::supports_sse2() && StubRoutines::dcos() != NULL) { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dcos()))); + } else { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dcos))); + } + __ addptr(rsp, 2 * wordSize); break; case Interpreter::java_lang_math_tan : __ trigfunc('t'); @@ -135,8 +149,7 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin __ fstp_d(Address(rsp, 0)); if (VM_Version::supports_sse2()) { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); - } - else { + } else { __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog))); } __ addptr(rsp, 2 * wordSize); diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp index fc783f1182b..ef496ec18cc 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp @@ -259,6 +259,12 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin __ movdbl(xmm1, Address(rsp, wordSize)); __ movdbl(xmm0, Address(rsp, 3 * wordSize)); __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow()))); + } else if (kind == Interpreter::java_lang_math_sin && StubRoutines::dsin() != NULL) { + __ movdbl(xmm0, Address(rsp, wordSize)); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dsin()))); + } else if (kind == Interpreter::java_lang_math_cos && StubRoutines::dcos() != NULL) { + __ movdbl(xmm0, Address(rsp, wordSize)); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dcos()))); } else { __ fld_d(Address(rsp, wordSize)); switch (kind) { diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_32.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_32.cpp new file mode 100644 index 00000000000..923e8fc39b5 --- /dev/null +++ b/hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_32.cpp @@ -0,0 +1,4571 @@ +/* + * Copyright (c) 2015, Intel Corporation. + * Intel Math Library (LIBM) Source Code + * + * 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 "asm/assembler.hpp" +#include "asm/assembler.inline.hpp" +#include "runtime/stubRoutines.hpp" +#include "macroAssembler_x86.hpp" + +#ifdef _MSC_VER +#define ALIGNED_(x) __declspec(align(x)) +#else +#define ALIGNED_(x) __attribute__ ((aligned(x))) +#endif + +// The 32 bit code is at most SSE2 compliant + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - EXP() +// --------------------- +// +// Description: +// Let K = 64 (table size). +// x x/log(2) n +// e = 2 = 2 * T[j] * (1 + P(y)) +// where +// x = m*log(2)/K + y, y in [-log(2)/K..log(2)/K] +// m = n*K + j, m,n,j - signed integer, j in [-K/2..K/2] +// j/K +// values of 2 are tabulated as T[j] = T_hi[j] ( 1 + T_lo[j]). +// +// P(y) is a minimax polynomial approximation of exp(x)-1 +// on small interval [-log(2)/K..log(2)/K] (were calculated by Maple V). +// +// To avoid problems with arithmetic overflow and underflow, +// n n1 n2 +// value of 2 is safely computed as 2 * 2 where n1 in [-BIAS/2..BIAS/2] +// where BIAS is a value of exponent bias. +// +// Special cases: +// exp(NaN) = NaN +// exp(+INF) = +INF +// exp(-INF) = 0 +// exp(x) = 1 for subnormals +// for finite argument, only exp(0)=1 is exact +// For IEEE double +// if x > 709.782712893383973096 then exp(x) overflow +// if x < -745.133219101941108420 then exp(x) underflow +// +/******************************************************************************/ + +ALIGNED_(16) juint _static_const_table[] = +{ + 0x00000000UL, 0xfff00000UL, 0x00000000UL, 0xfff00000UL, 0xffffffc0UL, + 0x00000000UL, 0xffffffc0UL, 0x00000000UL, 0x0000ffc0UL, 0x00000000UL, + 0x0000ffc0UL, 0x00000000UL, 0x00000000UL, 0x43380000UL, 0x00000000UL, + 0x43380000UL, 0x652b82feUL, 0x40571547UL, 0x652b82feUL, 0x40571547UL, + 0xfefa0000UL, 0x3f862e42UL, 0xfefa0000UL, 0x3f862e42UL, 0xbc9e3b3aUL, + 0x3d1cf79aUL, 0xbc9e3b3aUL, 0x3d1cf79aUL, 0xfffffffeUL, 0x3fdfffffUL, + 0xfffffffeUL, 0x3fdfffffUL, 0xe3289860UL, 0x3f56c15cUL, 0x555b9e25UL, + 0x3fa55555UL, 0xc090cf0fUL, 0x3f811115UL, 0x55548ba1UL, 0x3fc55555UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x0e03754dUL, + 0x3cad7bbfUL, 0x3e778060UL, 0x00002c9aUL, 0x3567f613UL, 0x3c8cd252UL, + 0xd3158574UL, 0x000059b0UL, 0x61e6c861UL, 0x3c60f74eUL, 0x18759bc8UL, + 0x00008745UL, 0x5d837b6cUL, 0x3c979aa6UL, 0x6cf9890fUL, 0x0000b558UL, + 0x702f9cd1UL, 0x3c3ebe3dUL, 0x32d3d1a2UL, 0x0000e3ecUL, 0x1e63bcd8UL, + 0x3ca3516eUL, 0xd0125b50UL, 0x00011301UL, 0x26f0387bUL, 0x3ca4c554UL, + 0xaea92ddfUL, 0x0001429aUL, 0x62523fb6UL, 0x3ca95153UL, 0x3c7d517aUL, + 0x000172b8UL, 0x3f1353bfUL, 0x3c8b898cUL, 0xeb6fcb75UL, 0x0001a35bUL, + 0x3e3a2f5fUL, 0x3c9aecf7UL, 0x3168b9aaUL, 0x0001d487UL, 0x44a6c38dUL, + 0x3c8a6f41UL, 0x88628cd6UL, 0x0002063bUL, 0xe3a8a894UL, 0x3c968efdUL, + 0x6e756238UL, 0x0002387aUL, 0x981fe7f2UL, 0x3c80472bUL, 0x65e27cddUL, + 0x00026b45UL, 0x6d09ab31UL, 0x3c82f7e1UL, 0xf51fdee1UL, 0x00029e9dUL, + 0x720c0ab3UL, 0x3c8b3782UL, 0xa6e4030bUL, 0x0002d285UL, 0x4db0abb6UL, + 0x3c834d75UL, 0x0a31b715UL, 0x000306feUL, 0x5dd3f84aUL, 0x3c8fdd39UL, + 0xb26416ffUL, 0x00033c08UL, 0xcc187d29UL, 0x3ca12f8cUL, 0x373aa9caUL, + 0x000371a7UL, 0x738b5e8bUL, 0x3ca7d229UL, 0x34e59ff6UL, 0x0003a7dbUL, + 0xa72a4c6dUL, 0x3c859f48UL, 0x4c123422UL, 0x0003dea6UL, 0x259d9205UL, + 0x3ca8b846UL, 0x21f72e29UL, 0x0004160aUL, 0x60c2ac12UL, 0x3c4363edUL, + 0x6061892dUL, 0x00044e08UL, 0xdaa10379UL, 0x3c6ecce1UL, 0xb5c13cd0UL, + 0x000486a2UL, 0xbb7aafb0UL, 0x3c7690ceUL, 0xd5362a27UL, 0x0004bfdaUL, + 0x9b282a09UL, 0x3ca083ccUL, 0x769d2ca6UL, 0x0004f9b2UL, 0xc1aae707UL, + 0x3ca509b0UL, 0x569d4f81UL, 0x0005342bUL, 0x18fdd78eUL, 0x3c933505UL, + 0x36b527daUL, 0x00056f47UL, 0xe21c5409UL, 0x3c9063e1UL, 0xdd485429UL, + 0x0005ab07UL, 0x2b64c035UL, 0x3c9432e6UL, 0x15ad2148UL, 0x0005e76fUL, + 0x99f08c0aUL, 0x3ca01284UL, 0xb03a5584UL, 0x0006247eUL, 0x0073dc06UL, + 0x3c99f087UL, 0x82552224UL, 0x00066238UL, 0x0da05571UL, 0x3c998d4dUL, + 0x667f3bccUL, 0x0006a09eUL, 0x86ce4786UL, 0x3ca52bb9UL, 0x3c651a2eUL, + 0x0006dfb2UL, 0x206f0dabUL, 0x3ca32092UL, 0xe8ec5f73UL, 0x00071f75UL, + 0x8e17a7a6UL, 0x3ca06122UL, 0x564267c8UL, 0x00075febUL, 0x461e9f86UL, + 0x3ca244acUL, 0x73eb0186UL, 0x0007a114UL, 0xabd66c55UL, 0x3c65ebe1UL, + 0x36cf4e62UL, 0x0007e2f3UL, 0xbbff67d0UL, 0x3c96fe9fUL, 0x994cce12UL, + 0x00082589UL, 0x14c801dfUL, 0x3c951f14UL, 0x9b4492ecUL, 0x000868d9UL, + 0xc1f0eab4UL, 0x3c8db72fUL, 0x422aa0dbUL, 0x0008ace5UL, 0x59f35f44UL, + 0x3c7bf683UL, 0x99157736UL, 0x0008f1aeUL, 0x9c06283cUL, 0x3ca360baUL, + 0xb0cdc5e4UL, 0x00093737UL, 0x20f962aaUL, 0x3c95e8d1UL, 0x9fde4e4fUL, + 0x00097d82UL, 0x2b91ce27UL, 0x3c71affcUL, 0x82a3f090UL, 0x0009c491UL, + 0x589a2ebdUL, 0x3c9b6d34UL, 0x7b5de564UL, 0x000a0c66UL, 0x9ab89880UL, + 0x3c95277cUL, 0xb23e255cUL, 0x000a5503UL, 0x6e735ab3UL, 0x3c846984UL, + 0x5579fdbfUL, 0x000a9e6bUL, 0x92cb3387UL, 0x3c8c1a77UL, 0x995ad3adUL, + 0x000ae89fUL, 0xdc2d1d96UL, 0x3ca22466UL, 0xb84f15faUL, 0x000b33a2UL, + 0xb19505aeUL, 0x3ca1112eUL, 0xf2fb5e46UL, 0x000b7f76UL, 0x0a5fddcdUL, + 0x3c74ffd7UL, 0x904bc1d2UL, 0x000bcc1eUL, 0x30af0cb3UL, 0x3c736eaeUL, + 0xdd85529cUL, 0x000c199bUL, 0xd10959acUL, 0x3c84e08fUL, 0x2e57d14bUL, + 0x000c67f1UL, 0x6c921968UL, 0x3c676b2cUL, 0xdcef9069UL, 0x000cb720UL, + 0x36df99b3UL, 0x3c937009UL, 0x4a07897bUL, 0x000d072dUL, 0xa63d07a7UL, + 0x3c74a385UL, 0xdcfba487UL, 0x000d5818UL, 0xd5c192acUL, 0x3c8e5a50UL, + 0x03db3285UL, 0x000da9e6UL, 0x1c4a9792UL, 0x3c98bb73UL, 0x337b9b5eUL, + 0x000dfc97UL, 0x603a88d3UL, 0x3c74b604UL, 0xe78b3ff6UL, 0x000e502eUL, + 0x92094926UL, 0x3c916f27UL, 0xa2a490d9UL, 0x000ea4afUL, 0x41aa2008UL, + 0x3c8ec3bcUL, 0xee615a27UL, 0x000efa1bUL, 0x31d185eeUL, 0x3c8a64a9UL, + 0x5b6e4540UL, 0x000f5076UL, 0x4d91cd9dUL, 0x3c77893bUL, 0x819e90d8UL, + 0x000fa7c1UL, 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x7ff00000UL, + 0x00000000UL, 0x00000000UL, 0xffffffffUL, 0x7fefffffUL, 0x00000000UL, + 0x00100000UL +}; + +//registers, +// input: (rbp + 8) +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// rax, rdx, rcx, rbx (tmp) + +// Code generated by Intel C compiler for LIBM library + +void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; + Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, B1_3, B1_5, start; + + assert_different_registers(tmp, eax, ecx, edx); + jmp(start); + address static_const_table = (address)_static_const_table; + + bind(start); + subl(rsp, 120); + movl(Address(rsp, 64), tmp); + lea(tmp, ExternalAddress(static_const_table)); + movdqu(xmm0, Address(rsp, 128)); + unpcklpd(xmm0, xmm0); + movdqu(xmm1, Address(tmp, 64)); // 0x652b82feUL, 0x40571547UL, 0x652b82feUL, 0x40571547UL + movdqu(xmm6, Address(tmp, 48)); // 0x00000000UL, 0x43380000UL, 0x00000000UL, 0x43380000UL + movdqu(xmm2, Address(tmp, 80)); // 0xfefa0000UL, 0x3f862e42UL, 0xfefa0000UL, 0x3f862e42UL + movdqu(xmm3, Address(tmp, 96)); // 0xbc9e3b3aUL, 0x3d1cf79aUL, 0xbc9e3b3aUL, 0x3d1cf79aUL + pextrw(eax, xmm0, 3); + andl(eax, 32767); + movl(edx, 16527); + subl(edx, eax); + subl(eax, 15504); + orl(edx, eax); + cmpl(edx, INT_MIN); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); + mulpd(xmm1, xmm0); + addpd(xmm1, xmm6); + movapd(xmm7, xmm1); + subpd(xmm1, xmm6); + mulpd(xmm2, xmm1); + movdqu(xmm4, Address(tmp, 128)); // 0xe3289860UL, 0x3f56c15cUL, 0x555b9e25UL, 0x3fa55555UL + mulpd(xmm3, xmm1); + movdqu(xmm5, Address(tmp, 144)); // 0xc090cf0fUL, 0x3f811115UL, 0x55548ba1UL, 0x3fc55555UL + subpd(xmm0, xmm2); + movdl(eax, xmm7); + movl(ecx, eax); + andl(ecx, 63); + shll(ecx, 4); + sarl(eax, 6); + movl(edx, eax); + movdqu(xmm6, Address(tmp, 16)); // 0xffffffc0UL, 0x00000000UL, 0xffffffc0UL, 0x00000000UL + pand(xmm7, xmm6); + movdqu(xmm6, Address(tmp, 32)); // 0x0000ffc0UL, 0x00000000UL, 0x0000ffc0UL, 0x00000000UL + paddq(xmm7, xmm6); + psllq(xmm7, 46); + subpd(xmm0, xmm3); + movdqu(xmm2, Address(tmp, ecx, Address::times_1, 160)); + mulpd(xmm4, xmm0); + movapd(xmm6, xmm0); + movapd(xmm1, xmm0); + mulpd(xmm6, xmm6); + mulpd(xmm0, xmm6); + addpd(xmm5, xmm4); + mulsd(xmm0, xmm6); + mulpd(xmm6, Address(tmp, 112)); // 0xfffffffeUL, 0x3fdfffffUL, 0xfffffffeUL, 0x3fdfffffUL + addsd(xmm1, xmm2); + unpckhpd(xmm2, xmm2); + mulpd(xmm0, xmm5); + addsd(xmm1, xmm0); + por(xmm2, xmm7); + unpckhpd(xmm0, xmm0); + addsd(xmm0, xmm1); + addsd(xmm0, xmm6); + addl(edx, 894); + cmpl(edx, 1916); + jcc (Assembler::above, L_2TAG_PACKET_1_0_2); + mulsd(xmm0, xmm2); + addsd(xmm0, xmm2); + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_1_0_2); + fnstcw(Address(rsp, 24)); + movzwl(edx, Address(rsp, 24)); + orl(edx, 768); + movw(Address(rsp, 28), edx); + fldcw(Address(rsp, 28)); + movl(edx, eax); + sarl(eax, 1); + subl(edx, eax); + movdqu(xmm6, Address(tmp, 0)); // 0x00000000UL, 0xfff00000UL, 0x00000000UL, 0xfff00000UL + pandn(xmm6, xmm2); + addl(eax, 1023); + movdl(xmm3, eax); + psllq(xmm3, 52); + por(xmm6, xmm3); + addl(edx, 1023); + movdl(xmm4, edx); + psllq(xmm4, 52); + movsd(Address(rsp, 8), xmm0); + fld_d(Address(rsp, 8)); + movsd(Address(rsp, 16), xmm6); + fld_d(Address(rsp, 16)); + fmula(1); + faddp(1); + movsd(Address(rsp, 8), xmm4); + fld_d(Address(rsp, 8)); + fmulp(1); + fstp_d(Address(rsp, 8)); + movsd(xmm0,Address(rsp, 8)); + fldcw(Address(rsp, 24)); + pextrw(ecx, xmm0, 3); + andl(ecx, 32752); + cmpl(ecx, 32752); + jcc(Assembler::greaterEqual, L_2TAG_PACKET_3_0_2); + cmpl(ecx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_4_0_2); + jmp(L_2TAG_PACKET_2_0_2); + cmpl(ecx, INT_MIN); + jcc(Assembler::less, L_2TAG_PACKET_3_0_2); + cmpl(ecx, -1064950997); + jcc(Assembler::less, L_2TAG_PACKET_2_0_2); + jcc(Assembler::greater, L_2TAG_PACKET_4_0_2); + movl(edx, Address(rsp, 128)); + cmpl(edx ,-17155601); + jcc(Assembler::less, L_2TAG_PACKET_2_0_2); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_3_0_2); + movl(edx, 14); + jmp(L_2TAG_PACKET_5_0_2); + + bind(L_2TAG_PACKET_4_0_2); + movl(edx, 15); + + bind(L_2TAG_PACKET_5_0_2); + movsd(Address(rsp, 0), xmm0); + movsd(xmm0, Address(rsp, 128)); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_7_0_2); + cmpl(eax, 2146435072); + jcc(Assembler::greaterEqual, L_2TAG_PACKET_8_0_2); + movl(eax, Address(rsp, 132)); + cmpl(eax, INT_MIN); + jcc(Assembler::greaterEqual, L_2TAG_PACKET_9_0_2); + movsd(xmm0, Address(tmp, 1208)); // 0xffffffffUL, 0x7fefffffUL + mulsd(xmm0, xmm0); + movl(edx, 14); + jmp(L_2TAG_PACKET_5_0_2); + + bind(L_2TAG_PACKET_9_0_2); + movsd(xmm0, Address(tmp, 1216)); + mulsd(xmm0, xmm0); + movl(edx, 15); + jmp(L_2TAG_PACKET_5_0_2); + + bind(L_2TAG_PACKET_8_0_2); + movl(edx, Address(rsp, 128)); + cmpl(eax, 2146435072); + jcc(Assembler::above, L_2TAG_PACKET_10_0_2); + cmpl(edx, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_10_0_2); + movl(eax, Address(rsp, 132)); + cmpl(eax, 2146435072); + jcc(Assembler::notEqual, L_2TAG_PACKET_11_0_2); + movsd(xmm0, Address(tmp, 1192)); // 0x00000000UL, 0x7ff00000UL + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_11_0_2); + movsd(xmm0, Address(tmp, 1200)); // 0x00000000UL, 0x00000000UL + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_10_0_2); + movsd(xmm0, Address(rsp, 128)); + addsd(xmm0, xmm0); + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_0_0_2); + movl(eax, Address(rsp, 132)); + andl(eax, 2147483647); + cmpl(eax, 1083179008); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 128)); + addsd(xmm0, Address(tmp, 1184)); // 0x00000000UL, 0x3ff00000UL + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movsd(Address(rsp, 48), xmm0); + fld_d(Address(rsp, 48)); + + bind(L_2TAG_PACKET_6_0_2); + movl(tmp, Address(rsp, 64)); +} + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - LOG() +// --------------------- +// +// x=2^k * mx, mx in [1,2) +// +// Get B~1/mx based on the output of rcpss instruction (B0) +// B = int((B0*2^7+0.5))/2^7 +// +// Reduced argument: r=B*mx-1.0 (computed accurately in high and low parts) +// +// Result: k*log(2) - log(B) + p(r) if |x-1| >= small value (2^-6) and +// p(r) is a degree 7 polynomial +// -log(B) read from data table (high, low parts) +// Result is formed from high and low parts +// +// Special cases: +// log(NaN) = quiet NaN, and raise invalid exception +// log(+INF) = that INF +// log(0) = -INF with divide-by-zero exception raised +// log(1) = +0 +// log(x) = NaN with invalid exception raised if x < -0, including -INF +// +/******************************************************************************/ + +ALIGNED_(16) juint _static_const_table_log[] = +{ + 0xfefa3800UL, 0x3fe62e42UL, 0x93c76730UL, 0x3d2ef357UL, 0xaa241800UL, + 0x3fe5ee82UL, 0x0cda46beUL, 0x3d220238UL, 0x5c364800UL, 0x3fe5af40UL, + 0xac10c9fbUL, 0x3d2dfa63UL, 0x26bb8c00UL, 0x3fe5707aUL, 0xff3303ddUL, + 0x3d09980bUL, 0x26867800UL, 0x3fe5322eUL, 0x5d257531UL, 0x3d05ccc4UL, + 0x835a5000UL, 0x3fe4f45aUL, 0x6d93b8fbUL, 0xbd2e6c51UL, 0x6f970c00UL, + 0x3fe4b6fdUL, 0xed4c541cUL, 0x3cef7115UL, 0x27e8a400UL, 0x3fe47a15UL, + 0xf94d60aaUL, 0xbd22cb6aUL, 0xf2f92400UL, 0x3fe43d9fUL, 0x481051f7UL, + 0xbcfd984fUL, 0x2125cc00UL, 0x3fe4019cUL, 0x30f0c74cUL, 0xbd26ce79UL, + 0x0c36c000UL, 0x3fe3c608UL, 0x7cfe13c2UL, 0xbd02b736UL, 0x17197800UL, + 0x3fe38ae2UL, 0xbb5569a4UL, 0xbd218b7aUL, 0xad9d8c00UL, 0x3fe35028UL, + 0x9527e6acUL, 0x3d10b83fUL, 0x44340800UL, 0x3fe315daUL, 0xc5a0ed9cUL, + 0xbd274e93UL, 0x57b0e000UL, 0x3fe2dbf5UL, 0x07b9dc11UL, 0xbd17a6e5UL, + 0x6d0ec000UL, 0x3fe2a278UL, 0xe797882dUL, 0x3d206d2bUL, 0x1134dc00UL, + 0x3fe26962UL, 0x05226250UL, 0xbd0b61f1UL, 0xd8bebc00UL, 0x3fe230b0UL, + 0x6e48667bUL, 0x3d12fc06UL, 0x5fc61800UL, 0x3fe1f863UL, 0xc9fe81d3UL, + 0xbd2a7242UL, 0x49ae6000UL, 0x3fe1c078UL, 0xed70e667UL, 0x3cccacdeUL, + 0x40f23c00UL, 0x3fe188eeUL, 0xf8ab4650UL, 0x3d14cc4eUL, 0xf6f29800UL, + 0x3fe151c3UL, 0xa293ae49UL, 0xbd2edd97UL, 0x23c75c00UL, 0x3fe11af8UL, + 0xbb9ddcb2UL, 0xbd258647UL, 0x8611cc00UL, 0x3fe0e489UL, 0x07801742UL, + 0x3d1c2998UL, 0xe2d05400UL, 0x3fe0ae76UL, 0x887e7e27UL, 0x3d1f486bUL, + 0x0533c400UL, 0x3fe078bfUL, 0x41edf5fdUL, 0x3d268122UL, 0xbe760400UL, + 0x3fe04360UL, 0xe79539e0UL, 0xbd04c45fUL, 0xe5b20800UL, 0x3fe00e5aUL, + 0xb1727b1cUL, 0xbd053ba3UL, 0xaf7a4800UL, 0x3fdfb358UL, 0x3c164935UL, + 0x3d0085faUL, 0xee031800UL, 0x3fdf4aa7UL, 0x6f014a8bUL, 0x3d12cde5UL, + 0x56b41000UL, 0x3fdee2a1UL, 0x5a470251UL, 0x3d2f27f4UL, 0xc3ddb000UL, + 0x3fde7b42UL, 0x5372bd08UL, 0xbd246550UL, 0x1a272800UL, 0x3fde148aUL, + 0x07322938UL, 0xbd1326b2UL, 0x484c9800UL, 0x3fddae75UL, 0x60dc616aUL, + 0xbd1ea42dUL, 0x46def800UL, 0x3fdd4902UL, 0xe9a767a8UL, 0x3d235bafUL, + 0x18064800UL, 0x3fdce42fUL, 0x3ec7a6b0UL, 0xbd0797c3UL, 0xc7455800UL, + 0x3fdc7ff9UL, 0xc15249aeUL, 0xbd29b6ddUL, 0x693fa000UL, 0x3fdc1c60UL, + 0x7fe8e180UL, 0x3d2cec80UL, 0x1b80e000UL, 0x3fdbb961UL, 0xf40a666dUL, + 0x3d27d85bUL, 0x04462800UL, 0x3fdb56faUL, 0x2d841995UL, 0x3d109525UL, + 0x5248d000UL, 0x3fdaf529UL, 0x52774458UL, 0xbd217cc5UL, 0x3c8ad800UL, + 0x3fda93edUL, 0xbea77a5dUL, 0x3d1e36f2UL, 0x0224f800UL, 0x3fda3344UL, + 0x7f9d79f5UL, 0x3d23c645UL, 0xea15f000UL, 0x3fd9d32bUL, 0x10d0c0b0UL, + 0xbd26279eUL, 0x43135800UL, 0x3fd973a3UL, 0xa502d9f0UL, 0xbd152313UL, + 0x635bf800UL, 0x3fd914a8UL, 0x2ee6307dUL, 0xbd1766b5UL, 0xa88b3000UL, + 0x3fd8b639UL, 0xe5e70470UL, 0xbd205ae1UL, 0x776dc800UL, 0x3fd85855UL, + 0x3333778aUL, 0x3d2fd56fUL, 0x3bd81800UL, 0x3fd7fafaUL, 0xc812566aUL, + 0xbd272090UL, 0x687cf800UL, 0x3fd79e26UL, 0x2efd1778UL, 0x3d29ec7dUL, + 0x76c67800UL, 0x3fd741d8UL, 0x49dc60b3UL, 0x3d2d8b09UL, 0xe6af1800UL, + 0x3fd6e60eUL, 0x7c222d87UL, 0x3d172165UL, 0x3e9c6800UL, 0x3fd68ac8UL, + 0x2756eba0UL, 0x3d20a0d3UL, 0x0b3ab000UL, 0x3fd63003UL, 0xe731ae00UL, + 0xbd2db623UL, 0xdf596000UL, 0x3fd5d5bdUL, 0x08a465dcUL, 0xbd0a0b2aUL, + 0x53c8d000UL, 0x3fd57bf7UL, 0xee5d40efUL, 0x3d1fadedUL, 0x0738a000UL, + 0x3fd522aeUL, 0x8164c759UL, 0x3d2ebe70UL, 0x9e173000UL, 0x3fd4c9e0UL, + 0x1b0ad8a4UL, 0xbd2e2089UL, 0xc271c800UL, 0x3fd4718dUL, 0x0967d675UL, + 0xbd2f27ceUL, 0x23d5e800UL, 0x3fd419b4UL, 0xec90e09dUL, 0x3d08e436UL, + 0x77333000UL, 0x3fd3c252UL, 0xb606bd5cUL, 0x3d183b54UL, 0x76be1000UL, + 0x3fd36b67UL, 0xb0f177c8UL, 0x3d116ecdUL, 0xe1d36000UL, 0x3fd314f1UL, + 0xd3213cb8UL, 0xbd28e27aUL, 0x7cdc9000UL, 0x3fd2bef0UL, 0x4a5004f4UL, + 0x3d2a9cfaUL, 0x1134d800UL, 0x3fd26962UL, 0xdf5bb3b6UL, 0x3d2c93c1UL, + 0x6d0eb800UL, 0x3fd21445UL, 0xba46baeaUL, 0x3d0a87deUL, 0x635a6800UL, + 0x3fd1bf99UL, 0x5147bdb7UL, 0x3d2ca6edUL, 0xcbacf800UL, 0x3fd16b5cUL, + 0xf7a51681UL, 0x3d2b9acdUL, 0x8227e800UL, 0x3fd1178eUL, 0x63a5f01cUL, + 0xbd2c210eUL, 0x67616000UL, 0x3fd0c42dUL, 0x163ceae9UL, 0x3d27188bUL, + 0x604d5800UL, 0x3fd07138UL, 0x16ed4e91UL, 0x3cf89cdbUL, 0x5626c800UL, + 0x3fd01eaeUL, 0x1485e94aUL, 0xbd16f08cUL, 0x6cb3b000UL, 0x3fcf991cUL, + 0xca0cdf30UL, 0x3d1bcbecUL, 0xe4dd0000UL, 0x3fcef5adUL, 0x65bb8e11UL, + 0xbcca2115UL, 0xffe71000UL, 0x3fce530eUL, 0x6041f430UL, 0x3cc21227UL, + 0xb0d49000UL, 0x3fcdb13dUL, 0xf715b035UL, 0xbd2aff2aUL, 0xf2656000UL, + 0x3fcd1037UL, 0x75b6f6e4UL, 0xbd084a7eUL, 0xc6f01000UL, 0x3fcc6ffbUL, + 0xc5962bd2UL, 0xbcf1ec72UL, 0x383be000UL, 0x3fcbd087UL, 0x595412b6UL, + 0xbd2d4bc4UL, 0x575bd000UL, 0x3fcb31d8UL, 0x4eace1aaUL, 0xbd0c358dUL, + 0x3c8ae000UL, 0x3fca93edUL, 0x50562169UL, 0xbd287243UL, 0x07089000UL, + 0x3fc9f6c4UL, 0x6865817aUL, 0x3d29904dUL, 0xdcf70000UL, 0x3fc95a5aUL, + 0x58a0ff6fUL, 0x3d07f228UL, 0xeb390000UL, 0x3fc8beafUL, 0xaae92cd1UL, + 0xbd073d54UL, 0x6551a000UL, 0x3fc823c1UL, 0x9a631e83UL, 0x3d1e0ddbUL, + 0x85445000UL, 0x3fc7898dUL, 0x70914305UL, 0xbd1c6610UL, 0x8b757000UL, + 0x3fc6f012UL, 0xe59c21e1UL, 0xbd25118dUL, 0xbe8c1000UL, 0x3fc6574eUL, + 0x2c3c2e78UL, 0x3d19cf8bUL, 0x6b544000UL, 0x3fc5bf40UL, 0xeb68981cUL, + 0xbd127023UL, 0xe4a1b000UL, 0x3fc527e5UL, 0xe5697dc7UL, 0x3d2633e8UL, + 0x8333b000UL, 0x3fc4913dUL, 0x54fdb678UL, 0x3d258379UL, 0xa5993000UL, + 0x3fc3fb45UL, 0x7e6a354dUL, 0xbd2cd1d8UL, 0xb0159000UL, 0x3fc365fcUL, + 0x234b7289UL, 0x3cc62fa8UL, 0x0c868000UL, 0x3fc2d161UL, 0xcb81b4a1UL, + 0x3d039d6cUL, 0x2a49c000UL, 0x3fc23d71UL, 0x8fd3df5cUL, 0x3d100d23UL, + 0x7e23f000UL, 0x3fc1aa2bUL, 0x44389934UL, 0x3d2ca78eUL, 0x8227e000UL, + 0x3fc1178eUL, 0xce2d07f2UL, 0x3d21ef78UL, 0xb59e4000UL, 0x3fc08598UL, + 0x7009902cUL, 0xbd27e5ddUL, 0x39dbe000UL, 0x3fbfe891UL, 0x4fa10afdUL, + 0xbd2534d6UL, 0x830a2000UL, 0x3fbec739UL, 0xafe645e0UL, 0xbd2dc068UL, + 0x63844000UL, 0x3fbda727UL, 0x1fa71733UL, 0x3d1a8940UL, 0x01bc4000UL, + 0x3fbc8858UL, 0xc65aacd3UL, 0x3d2646d1UL, 0x8dad6000UL, 0x3fbb6ac8UL, + 0x2bf768e5UL, 0xbd139080UL, 0x40b1c000UL, 0x3fba4e76UL, 0xb94407c8UL, + 0xbd0e42b6UL, 0x5d594000UL, 0x3fb9335eUL, 0x3abd47daUL, 0x3d23115cUL, + 0x2f40e000UL, 0x3fb8197eUL, 0xf96ffdf7UL, 0x3d0f80dcUL, 0x0aeac000UL, + 0x3fb700d3UL, 0xa99ded32UL, 0x3cec1e8dUL, 0x4d97a000UL, 0x3fb5e95aUL, + 0x3c5d1d1eUL, 0xbd2c6906UL, 0x5d208000UL, 0x3fb4d311UL, 0x82f4e1efUL, + 0xbcf53a25UL, 0xa7d1e000UL, 0x3fb3bdf5UL, 0xa5db4ed7UL, 0x3d2cc85eUL, + 0xa4472000UL, 0x3fb2aa04UL, 0xae9c697dUL, 0xbd20b6e8UL, 0xd1466000UL, + 0x3fb1973bUL, 0x560d9e9bUL, 0xbd25325dUL, 0xb59e4000UL, 0x3fb08598UL, + 0x7009902cUL, 0xbd17e5ddUL, 0xc006c000UL, 0x3faeea31UL, 0x4fc93b7bUL, + 0xbd0e113eUL, 0xcdddc000UL, 0x3faccb73UL, 0x47d82807UL, 0xbd1a68f2UL, + 0xd0fb0000UL, 0x3faaaef2UL, 0x353bb42eUL, 0x3d20fc1aUL, 0x149fc000UL, + 0x3fa894aaUL, 0xd05a267dUL, 0xbd197995UL, 0xf2d4c000UL, 0x3fa67c94UL, + 0xec19afa2UL, 0xbd029efbUL, 0xd42e0000UL, 0x3fa466aeUL, 0x75bdfd28UL, + 0xbd2c1673UL, 0x2f8d0000UL, 0x3fa252f3UL, 0xe021b67bUL, 0x3d283e9aUL, + 0x89e74000UL, 0x3fa0415dUL, 0x5cf1d753UL, 0x3d0111c0UL, 0xec148000UL, + 0x3f9c63d2UL, 0x3f9eb2f3UL, 0x3d2578c6UL, 0x28c90000UL, 0x3f984925UL, + 0x325a0c34UL, 0xbd2aa0baUL, 0x25980000UL, 0x3f9432a9UL, 0x928637feUL, + 0x3d098139UL, 0x58938000UL, 0x3f902056UL, 0x06e2f7d2UL, 0xbd23dc5bUL, + 0xa3890000UL, 0x3f882448UL, 0xda74f640UL, 0xbd275577UL, 0x75890000UL, + 0x3f801015UL, 0x999d2be8UL, 0xbd10c76bUL, 0x59580000UL, 0x3f700805UL, + 0xcb31c67bUL, 0x3d2166afUL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x80000000UL, 0xfefa3800UL, 0x3fa62e42UL, 0x93c76730UL, 0x3ceef357UL, + 0x92492492UL, 0x3fc24924UL, 0x00000000UL, 0xbfd00000UL, 0x3d6fb175UL, + 0xbfc5555eUL, 0x55555555UL, 0x3fd55555UL, 0x9999999aUL, 0x3fc99999UL, + 0x00000000UL, 0xbfe00000UL, 0x00000000UL, 0xffffe000UL, 0x00000000UL, + 0xffffe000UL +}; +//registers, +// input: xmm0 +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// rax, rdx, rcx, rbx (tmp) + +void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2; + Label L_2TAG_PACKET_10_0_2, start; + + assert_different_registers(tmp, eax, ecx, edx); + jmp(start); + address static_const_table = (address)_static_const_table_log; + + bind(start); + subl(rsp, 104); + movl(Address(rsp, 40), tmp); + lea(tmp, ExternalAddress(static_const_table)); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + xorpd(xmm3, xmm3); + movl(edx, 30704); + pinsrw(xmm3, edx, 3); + movsd(xmm0, Address(rsp, 112)); + movapd(xmm1, xmm0); + movl(ecx, 32768); + movdl(xmm4, ecx); + movsd(xmm5, Address(tmp, 2128)); // 0x00000000UL, 0xffffe000UL + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + psllq(xmm0, 5); + movl(ecx, 16352); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm1, 12); + pshufd(xmm6, xmm5, 228); + psrlq(xmm1, 12); + subl(eax, 16); + cmpl(eax, 32736); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); + + bind(L_2TAG_PACKET_1_0_2); + paddd(xmm0, xmm4); + por(xmm1, xmm3); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm1); + pand(xmm0, xmm6); + subsd(xmm1, xmm5); + mulpd(xmm5, xmm0); + andl(eax, 32752); + subl(eax, ecx); + cvtsi2sdl(xmm7, eax); + mulsd(xmm1, xmm0); + movsd(xmm6, Address(tmp, 2064)); // 0xfefa3800UL, 0x3fa62e42UL + movdqu(xmm3, Address(tmp, 2080)); // 0x92492492UL, 0x3fc24924UL, 0x00000000UL, 0xbfd00000UL + subsd(xmm5, xmm2); + andl(edx, 16711680); + shrl(edx, 12); + movdqu(xmm0, Address(tmp, edx)); + movdqu(xmm4, Address(tmp, 2096)); // 0x3d6fb175UL, 0xbfc5555eUL, 0x55555555UL, 0x3fd55555UL + addsd(xmm1, xmm5); + movdqu(xmm2, Address(tmp, 2112)); // 0x9999999aUL, 0x3fc99999UL, 0x00000000UL, 0xbfe00000UL + mulsd(xmm6, xmm7); + pshufd(xmm5, xmm1, 68); + mulsd(xmm7, Address(tmp, 2072)); // 0x93c76730UL, 0x3ceef357UL, 0x92492492UL, 0x3fc24924UL + mulsd(xmm3, xmm1); + addsd(xmm0, xmm6); + mulpd(xmm4, xmm5); + mulpd(xmm5, xmm5); + pshufd(xmm6, xmm0, 228); + addsd(xmm0, xmm1); + addpd(xmm4, xmm2); + mulpd(xmm3, xmm5); + subsd(xmm6, xmm0); + mulsd(xmm4, xmm1); + pshufd(xmm2, xmm0, 238); + addsd(xmm1, xmm6); + mulsd(xmm5, xmm5); + addsd(xmm7, xmm2); + addpd(xmm4, xmm3); + addsd(xmm1, xmm7); + mulpd(xmm4, xmm5); + addsd(xmm1, xmm4); + pshufd(xmm5, xmm4, 238); + addsd(xmm1, xmm5); + addsd(xmm0, xmm1); + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_0_0_2); + movsd(xmm0, Address(rsp, 112)); + movdqu(xmm1, xmm0); + addl(eax, 16); + cmpl(eax, 32768); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_3_0_2); + cmpl(eax, 16); + jcc(Assembler::below, L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_5_0_2); + addsd(xmm0, xmm0); + jmp(L_2TAG_PACKET_2_0_2); + + bind(L_2TAG_PACKET_6_0_2); + jcc(Assembler::above, L_2TAG_PACKET_5_0_2); + cmpl(edx, 0); + jcc(Assembler::above, L_2TAG_PACKET_5_0_2); + jmp(L_2TAG_PACKET_7_0_2); + + bind(L_2TAG_PACKET_3_0_2); + movdl(edx, xmm1); + psrlq(xmm1, 32); + movdl(ecx, xmm1); + addl(ecx, ecx); + cmpl(ecx, -2097152); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_6_0_2); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); + + bind(L_2TAG_PACKET_7_0_2); + xorpd(xmm1, xmm1); + xorpd(xmm0, xmm0); + movl(eax, 32752); + pinsrw(xmm1, eax, 3); + movl(edx, 3); + mulsd(xmm0, xmm1); + + bind(L_2TAG_PACKET_9_0_2); + movsd(Address(rsp, 0), xmm0); + movsd(xmm0, Address(rsp, 112)); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_10_0_2); + + bind(L_2TAG_PACKET_8_0_2); + xorpd(xmm1, xmm1); + xorpd(xmm0, xmm0); + movl(eax, 49136); + pinsrw(xmm0, eax, 3); + divsd(xmm0, xmm1); + movl(edx, 2); + jmp(L_2TAG_PACKET_9_0_2); + + bind(L_2TAG_PACKET_4_0_2); + movdl(edx, xmm1); + psrlq(xmm1, 32); + movdl(ecx, xmm1); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); + xorpd(xmm1, xmm1); + movl(eax, 18416); + pinsrw(xmm1, eax, 3); + mulsd(xmm0, xmm1); + movapd(xmm1, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + psllq(xmm0, 5); + movl(ecx, 18416); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm1, 12); + pshufd(xmm6, xmm5, 228); + psrlq(xmm1, 12); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movsd(Address(rsp, 24), xmm0); + fld_d(Address(rsp, 24)); + + bind(L_2TAG_PACKET_10_0_2); + movl(tmp, Address(rsp, 40)); +} + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - POW() +// --------------------- +// +// Let x=2^k * mx, mx in [1,2) +// +// log2(x) calculation: +// +// Get B~1/mx based on the output of rcpps instruction (B0) +// B = int((B0*LH*2^9+0.5))/2^9 +// LH is a short approximation for log2(e) +// +// Reduced argument, scaled by LH: +// r=B*mx-LH (computed accurately in high and low parts) +// +// log2(x) result: k - log2(B) + p(r) +// p(r) is a degree 8 polynomial +// -log2(B) read from data table (high, low parts) +// log2(x) is formed from high and low parts +// For |x| in [1-1/32, 1+1/16), a slower but more accurate computation +// based om the same table design is performed. +// +// Main path is taken if | floor(log2(|log2(|x|)|) + floor(log2|y|) | < 8, +// to filter out all potential OF/UF cases. +// exp2(y*log2(x)) is computed using an 8-bit index table and a degree 5 +// polynomial +// +// Special cases: +// pow(-0,y) = -INF and raises the divide-by-zero exception for y an odd +// integer < 0. +// pow(-0,y) = +INF and raises the divide-by-zero exception for y < 0 and +// not an odd integer. +// pow(-0,y) = -0 for y an odd integer > 0. +// pow(-0,y) = +0 for y > 0 and not an odd integer. +// pow(-1,-INF) = NaN. +// pow(+1,y) = NaN for any y, even a NaN. +// pow(x,-0) = 1 for any x, even a NaN. +// pow(x,y) = a NaN and raises the invalid exception for finite x < 0 and +// finite non-integer y. +// pow(x,-INF) = +INF for |x|<1. +// pow(x,-INF) = +0 for |x|>1. +// pow(x,+INF) = +0 for |x|<1. +// pow(x,+INF) = +INF for |x|>1. +// pow(-INF,y) = -0 for y an odd integer < 0. +// pow(-INF,y) = +0 for y < 0 and not an odd integer. +// pow(-INF,y) = -INF for y an odd integer > 0. +// pow(-INF,y) = +INF for y > 0 and not an odd integer. +// pow(+INF,y) = +0 for y <0. +// pow(+INF,y) = +INF for y >0. +// +/******************************************************************************/ + +ALIGNED_(16) juint _static_const_table_pow[] = +{ + 0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL, 0xf8000000UL, + 0xffffffffUL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0x3ff00000UL, + 0x00000000UL, 0x00000000UL, 0x20000000UL, 0x3feff00aUL, 0x96621f95UL, + 0x3e5b1856UL, 0xe0000000UL, 0x3fefe019UL, 0xe5916f9eUL, 0xbe325278UL, + 0x00000000UL, 0x3fefd02fUL, 0x859a1062UL, 0x3e595fb7UL, 0xc0000000UL, + 0x3fefc049UL, 0xb245f18fUL, 0xbe529c38UL, 0xe0000000UL, 0x3fefb069UL, + 0xad2880a7UL, 0xbe501230UL, 0x60000000UL, 0x3fefa08fUL, 0xc8e72420UL, + 0x3e597bd1UL, 0x80000000UL, 0x3fef90baUL, 0xc30c4500UL, 0xbe5d6c75UL, + 0xe0000000UL, 0x3fef80eaUL, 0x02c63f43UL, 0x3e2e1318UL, 0xc0000000UL, + 0x3fef7120UL, 0xb3d4ccccUL, 0xbe44c52aUL, 0x00000000UL, 0x3fef615cUL, + 0xdbd91397UL, 0xbe4e7d6cUL, 0xa0000000UL, 0x3fef519cUL, 0x65c5cd68UL, + 0xbe522dc8UL, 0xa0000000UL, 0x3fef41e2UL, 0x46d1306cUL, 0xbe5a840eUL, + 0xe0000000UL, 0x3fef322dUL, 0xd2980e94UL, 0x3e5071afUL, 0xa0000000UL, + 0x3fef227eUL, 0x773abadeUL, 0xbe5891e5UL, 0xa0000000UL, 0x3fef12d4UL, + 0xdc6bf46bUL, 0xbe5cccbeUL, 0xe0000000UL, 0x3fef032fUL, 0xbc7247faUL, + 0xbe2bab83UL, 0x80000000UL, 0x3feef390UL, 0xbcaa1e46UL, 0xbe53bb3bUL, + 0x60000000UL, 0x3feee3f6UL, 0x5f6c682dUL, 0xbe54c619UL, 0x80000000UL, + 0x3feed461UL, 0x5141e368UL, 0xbe4b6d86UL, 0xe0000000UL, 0x3feec4d1UL, + 0xec678f76UL, 0xbe369af6UL, 0x80000000UL, 0x3feeb547UL, 0x41301f55UL, + 0xbe2d4312UL, 0x60000000UL, 0x3feea5c2UL, 0x676da6bdUL, 0xbe4d8dd0UL, + 0x60000000UL, 0x3fee9642UL, 0x57a891c4UL, 0x3e51f991UL, 0xa0000000UL, + 0x3fee86c7UL, 0xe4eb491eUL, 0x3e579bf9UL, 0x20000000UL, 0x3fee7752UL, + 0xfddc4a2cUL, 0xbe3356e6UL, 0xc0000000UL, 0x3fee67e1UL, 0xd75b5bf1UL, + 0xbe449531UL, 0x80000000UL, 0x3fee5876UL, 0xbd423b8eUL, 0x3df54fe4UL, + 0x60000000UL, 0x3fee4910UL, 0x330e51b9UL, 0x3e54289cUL, 0x80000000UL, + 0x3fee39afUL, 0x8651a95fUL, 0xbe55aad6UL, 0xa0000000UL, 0x3fee2a53UL, + 0x5e98c708UL, 0xbe2fc4a9UL, 0xe0000000UL, 0x3fee1afcUL, 0x0989328dUL, + 0x3e23958cUL, 0x40000000UL, 0x3fee0babUL, 0xee642abdUL, 0xbe425dd8UL, + 0xa0000000UL, 0x3fedfc5eUL, 0xc394d236UL, 0x3e526362UL, 0x20000000UL, + 0x3feded17UL, 0xe104aa8eUL, 0x3e4ce247UL, 0xc0000000UL, 0x3fedddd4UL, + 0x265a9be4UL, 0xbe5bb77aUL, 0x40000000UL, 0x3fedce97UL, 0x0ecac52fUL, + 0x3e4a7cb1UL, 0xe0000000UL, 0x3fedbf5eUL, 0x124cb3b8UL, 0x3e257024UL, + 0x80000000UL, 0x3fedb02bUL, 0xe6d4febeUL, 0xbe2033eeUL, 0x20000000UL, + 0x3feda0fdUL, 0x39cca00eUL, 0xbe3ddabcUL, 0xc0000000UL, 0x3fed91d3UL, + 0xef8a552aUL, 0xbe543390UL, 0x40000000UL, 0x3fed82afUL, 0xb8e85204UL, + 0x3e513850UL, 0xe0000000UL, 0x3fed738fUL, 0x3d59fe08UL, 0xbe5db728UL, + 0x40000000UL, 0x3fed6475UL, 0x3aa7ead1UL, 0x3e58804bUL, 0xc0000000UL, + 0x3fed555fUL, 0xf8a35ba9UL, 0xbe5298b0UL, 0x00000000UL, 0x3fed464fUL, + 0x9a88dd15UL, 0x3e5a8cdbUL, 0x40000000UL, 0x3fed3743UL, 0xb0b0a190UL, + 0x3e598635UL, 0x80000000UL, 0x3fed283cUL, 0xe2113295UL, 0xbe5c1119UL, + 0x80000000UL, 0x3fed193aUL, 0xafbf1728UL, 0xbe492e9cUL, 0x60000000UL, + 0x3fed0a3dUL, 0xe4a4ccf3UL, 0x3e19b90eUL, 0x20000000UL, 0x3fecfb45UL, + 0xba3cbeb8UL, 0x3e406b50UL, 0xc0000000UL, 0x3fecec51UL, 0x110f7dddUL, + 0x3e0d6806UL, 0x40000000UL, 0x3fecdd63UL, 0x7dd7d508UL, 0xbe5a8943UL, + 0x80000000UL, 0x3fecce79UL, 0x9b60f271UL, 0xbe50676aUL, 0x80000000UL, + 0x3fecbf94UL, 0x0b9ad660UL, 0x3e59174fUL, 0x60000000UL, 0x3fecb0b4UL, + 0x00823d9cUL, 0x3e5bbf72UL, 0x20000000UL, 0x3feca1d9UL, 0x38a6ec89UL, + 0xbe4d38f9UL, 0x80000000UL, 0x3fec9302UL, 0x3a0b7d8eUL, 0x3e53dbfdUL, + 0xc0000000UL, 0x3fec8430UL, 0xc6826b34UL, 0xbe27c5c9UL, 0xc0000000UL, + 0x3fec7563UL, 0x0c706381UL, 0xbe593653UL, 0x60000000UL, 0x3fec669bUL, + 0x7df34ec7UL, 0x3e461ab5UL, 0xe0000000UL, 0x3fec57d7UL, 0x40e5e7e8UL, + 0xbe5c3daeUL, 0x00000000UL, 0x3fec4919UL, 0x5602770fUL, 0xbe55219dUL, + 0xc0000000UL, 0x3fec3a5eUL, 0xec7911ebUL, 0x3e5a5d25UL, 0x60000000UL, + 0x3fec2ba9UL, 0xb39ea225UL, 0xbe53c00bUL, 0x80000000UL, 0x3fec1cf8UL, + 0x967a212eUL, 0x3e5a8ddfUL, 0x60000000UL, 0x3fec0e4cUL, 0x580798bdUL, + 0x3e5f53abUL, 0x00000000UL, 0x3febffa5UL, 0xb8282df6UL, 0xbe46b874UL, + 0x20000000UL, 0x3febf102UL, 0xe33a6729UL, 0x3e54963fUL, 0x00000000UL, + 0x3febe264UL, 0x3b53e88aUL, 0xbe3adce1UL, 0x60000000UL, 0x3febd3caUL, + 0xc2585084UL, 0x3e5cde9fUL, 0x80000000UL, 0x3febc535UL, 0xa335c5eeUL, + 0xbe39fd9cUL, 0x20000000UL, 0x3febb6a5UL, 0x7325b04dUL, 0x3e42ba15UL, + 0x60000000UL, 0x3feba819UL, 0x1564540fUL, 0x3e3a9f35UL, 0x40000000UL, + 0x3feb9992UL, 0x83fff592UL, 0xbe5465ceUL, 0xa0000000UL, 0x3feb8b0fUL, + 0xb9da63d3UL, 0xbe4b1a0aUL, 0x80000000UL, 0x3feb7c91UL, 0x6d6f1ea4UL, + 0x3e557657UL, 0x00000000UL, 0x3feb6e18UL, 0x5e80a1bfUL, 0x3e4ddbb6UL, + 0x00000000UL, 0x3feb5fa3UL, 0x1c9eacb5UL, 0x3e592877UL, 0xa0000000UL, + 0x3feb5132UL, 0x6d40beb3UL, 0xbe51858cUL, 0xa0000000UL, 0x3feb42c6UL, + 0xd740c67bUL, 0x3e427ad2UL, 0x40000000UL, 0x3feb345fUL, 0xa3e0cceeUL, + 0xbe5c2fc4UL, 0x40000000UL, 0x3feb25fcUL, 0x8e752b50UL, 0xbe3da3c2UL, + 0xc0000000UL, 0x3feb179dUL, 0xa892e7deUL, 0x3e1fb481UL, 0xc0000000UL, + 0x3feb0943UL, 0x21ed71e9UL, 0xbe365206UL, 0x20000000UL, 0x3feafaeeUL, + 0x0e1380a3UL, 0x3e5c5b7bUL, 0x20000000UL, 0x3feaec9dUL, 0x3c3d640eUL, + 0xbe5dbbd0UL, 0x60000000UL, 0x3feade50UL, 0x8f97a715UL, 0x3e3a8ec5UL, + 0x20000000UL, 0x3fead008UL, 0x23ab2839UL, 0x3e2fe98aUL, 0x40000000UL, + 0x3feac1c4UL, 0xf4bbd50fUL, 0x3e54d8f6UL, 0xe0000000UL, 0x3feab384UL, + 0x14757c4dUL, 0xbe48774cUL, 0xc0000000UL, 0x3feaa549UL, 0x7c7b0eeaUL, + 0x3e5b51bbUL, 0x20000000UL, 0x3fea9713UL, 0xf56f7013UL, 0x3e386200UL, + 0xe0000000UL, 0x3fea88e0UL, 0xbe428ebeUL, 0xbe514af5UL, 0xe0000000UL, + 0x3fea7ab2UL, 0x8d0e4496UL, 0x3e4f9165UL, 0x60000000UL, 0x3fea6c89UL, + 0xdbacc5d5UL, 0xbe5c063bUL, 0x20000000UL, 0x3fea5e64UL, 0x3f19d970UL, + 0xbe5a0c8cUL, 0x20000000UL, 0x3fea5043UL, 0x09ea3e6bUL, 0x3e5065dcUL, + 0x80000000UL, 0x3fea4226UL, 0x78df246cUL, 0x3e5e05f6UL, 0x40000000UL, + 0x3fea340eUL, 0x4057d4a0UL, 0x3e431b2bUL, 0x40000000UL, 0x3fea25faUL, + 0x82867bb5UL, 0x3e4b76beUL, 0xa0000000UL, 0x3fea17eaUL, 0x9436f40aUL, + 0xbe5aad39UL, 0x20000000UL, 0x3fea09dfUL, 0x4b5253b3UL, 0x3e46380bUL, + 0x00000000UL, 0x3fe9fbd8UL, 0x8fc52466UL, 0xbe386f9bUL, 0x20000000UL, + 0x3fe9edd5UL, 0x22d3f344UL, 0xbe538347UL, 0x60000000UL, 0x3fe9dfd6UL, + 0x1ac33522UL, 0x3e5dbc53UL, 0x00000000UL, 0x3fe9d1dcUL, 0xeabdff1dUL, + 0x3e40fc0cUL, 0xe0000000UL, 0x3fe9c3e5UL, 0xafd30e73UL, 0xbe585e63UL, + 0xe0000000UL, 0x3fe9b5f3UL, 0xa52f226aUL, 0xbe43e8f9UL, 0x20000000UL, + 0x3fe9a806UL, 0xecb8698dUL, 0xbe515b36UL, 0x80000000UL, 0x3fe99a1cUL, + 0xf2b4e89dUL, 0x3e48b62bUL, 0x20000000UL, 0x3fe98c37UL, 0x7c9a88fbUL, + 0x3e44414cUL, 0x00000000UL, 0x3fe97e56UL, 0xda015741UL, 0xbe5d13baUL, + 0xe0000000UL, 0x3fe97078UL, 0x5fdace06UL, 0x3e51b947UL, 0x00000000UL, + 0x3fe962a0UL, 0x956ca094UL, 0x3e518785UL, 0x40000000UL, 0x3fe954cbUL, + 0x01164c1dUL, 0x3e5d5b57UL, 0xc0000000UL, 0x3fe946faUL, 0xe63b3767UL, + 0xbe4f84e7UL, 0x40000000UL, 0x3fe9392eUL, 0xe57cc2a9UL, 0x3e34eda3UL, + 0xe0000000UL, 0x3fe92b65UL, 0x8c75b544UL, 0x3e5766a0UL, 0xc0000000UL, + 0x3fe91da1UL, 0x37d1d087UL, 0xbe5e2ab1UL, 0x80000000UL, 0x3fe90fe1UL, + 0xa953dc20UL, 0x3e5fa1f3UL, 0x80000000UL, 0x3fe90225UL, 0xdbd3f369UL, + 0x3e47d6dbUL, 0xa0000000UL, 0x3fe8f46dUL, 0x1c9be989UL, 0xbe5e2b0aUL, + 0xa0000000UL, 0x3fe8e6b9UL, 0x3c93d76aUL, 0x3e5c8618UL, 0xe0000000UL, + 0x3fe8d909UL, 0x2182fc9aUL, 0xbe41aa9eUL, 0x20000000UL, 0x3fe8cb5eUL, + 0xe6b3539dUL, 0xbe530d19UL, 0x60000000UL, 0x3fe8bdb6UL, 0x49e58cc3UL, + 0xbe3bb374UL, 0xa0000000UL, 0x3fe8b012UL, 0xa7cfeb8fUL, 0x3e56c412UL, + 0x00000000UL, 0x3fe8a273UL, 0x8d52bc19UL, 0x3e1429b8UL, 0x60000000UL, + 0x3fe894d7UL, 0x4dc32c6cUL, 0xbe48604cUL, 0xc0000000UL, 0x3fe8873fUL, + 0x0c868e56UL, 0xbe564ee5UL, 0x00000000UL, 0x3fe879acUL, 0x56aee828UL, + 0x3e5e2fd8UL, 0x60000000UL, 0x3fe86c1cUL, 0x7ceab8ecUL, 0x3e493365UL, + 0xc0000000UL, 0x3fe85e90UL, 0x78d4dadcUL, 0xbe4f7f25UL, 0x00000000UL, + 0x3fe85109UL, 0x0ccd8280UL, 0x3e31e7a2UL, 0x40000000UL, 0x3fe84385UL, + 0x34ba4e15UL, 0x3e328077UL, 0x80000000UL, 0x3fe83605UL, 0xa670975aUL, + 0xbe53eee5UL, 0xa0000000UL, 0x3fe82889UL, 0xf61b77b2UL, 0xbe43a20aUL, + 0xa0000000UL, 0x3fe81b11UL, 0x13e6643bUL, 0x3e5e5fe5UL, 0xc0000000UL, + 0x3fe80d9dUL, 0x82cc94e8UL, 0xbe5ff1f9UL, 0xa0000000UL, 0x3fe8002dUL, + 0x8a0c9c5dUL, 0xbe42b0e7UL, 0x60000000UL, 0x3fe7f2c1UL, 0x22a16f01UL, + 0x3e5d9ea0UL, 0x20000000UL, 0x3fe7e559UL, 0xc38cd451UL, 0x3e506963UL, + 0xc0000000UL, 0x3fe7d7f4UL, 0x9902bc71UL, 0x3e4503d7UL, 0x40000000UL, + 0x3fe7ca94UL, 0xdef2a3c0UL, 0x3e3d98edUL, 0xa0000000UL, 0x3fe7bd37UL, + 0xed49abb0UL, 0x3e24c1ffUL, 0xe0000000UL, 0x3fe7afdeUL, 0xe3b0be70UL, + 0xbe40c467UL, 0x00000000UL, 0x3fe7a28aUL, 0xaf9f193cUL, 0xbe5dff6cUL, + 0xe0000000UL, 0x3fe79538UL, 0xb74cf6b6UL, 0xbe258ed0UL, 0xa0000000UL, + 0x3fe787ebUL, 0x1d9127c7UL, 0x3e345fb0UL, 0x40000000UL, 0x3fe77aa2UL, + 0x1028c21dUL, 0xbe4619bdUL, 0xa0000000UL, 0x3fe76d5cUL, 0x7cb0b5e4UL, + 0x3e40f1a2UL, 0xe0000000UL, 0x3fe7601aUL, 0x2b1bc4adUL, 0xbe32e8bbUL, + 0xe0000000UL, 0x3fe752dcUL, 0x6839f64eUL, 0x3e41f57bUL, 0xc0000000UL, + 0x3fe745a2UL, 0xc4121f7eUL, 0xbe52c40aUL, 0x60000000UL, 0x3fe7386cUL, + 0xd6852d72UL, 0xbe5c4e6bUL, 0xc0000000UL, 0x3fe72b39UL, 0x91d690f7UL, + 0xbe57f88fUL, 0xe0000000UL, 0x3fe71e0aUL, 0x627a2159UL, 0xbe4425d5UL, + 0xc0000000UL, 0x3fe710dfUL, 0x50a54033UL, 0x3e422b7eUL, 0x60000000UL, + 0x3fe703b8UL, 0x3b0b5f91UL, 0x3e5d3857UL, 0xe0000000UL, 0x3fe6f694UL, + 0x84d628a2UL, 0xbe51f090UL, 0x00000000UL, 0x3fe6e975UL, 0x306d8894UL, + 0xbe414d83UL, 0xe0000000UL, 0x3fe6dc58UL, 0x30bf24aaUL, 0xbe4650caUL, + 0x80000000UL, 0x3fe6cf40UL, 0xd4628d69UL, 0xbe5db007UL, 0xc0000000UL, + 0x3fe6c22bUL, 0xa2aae57bUL, 0xbe31d279UL, 0xc0000000UL, 0x3fe6b51aUL, + 0x860edf7eUL, 0xbe2d4c4aUL, 0x80000000UL, 0x3fe6a80dUL, 0xf3559341UL, + 0xbe5f7e98UL, 0xe0000000UL, 0x3fe69b03UL, 0xa885899eUL, 0xbe5c2011UL, + 0xe0000000UL, 0x3fe68dfdUL, 0x2bdc6d37UL, 0x3e224a82UL, 0xa0000000UL, + 0x3fe680fbUL, 0xc12ad1b9UL, 0xbe40cf56UL, 0x00000000UL, 0x3fe673fdUL, + 0x1bcdf659UL, 0xbdf52f2dUL, 0x00000000UL, 0x3fe66702UL, 0x5df10408UL, + 0x3e5663e0UL, 0xc0000000UL, 0x3fe65a0aUL, 0xa4070568UL, 0xbe40b12fUL, + 0x00000000UL, 0x3fe64d17UL, 0x71c54c47UL, 0x3e5f5e8bUL, 0x00000000UL, + 0x3fe64027UL, 0xbd4b7e83UL, 0x3e42ead6UL, 0xa0000000UL, 0x3fe6333aUL, + 0x61598bd2UL, 0xbe4c48d4UL, 0xc0000000UL, 0x3fe62651UL, 0x6f538d61UL, + 0x3e548401UL, 0xa0000000UL, 0x3fe6196cUL, 0x14344120UL, 0xbe529af6UL, + 0x00000000UL, 0x3fe60c8bUL, 0x5982c587UL, 0xbe3e1e4fUL, 0x00000000UL, + 0x3fe5ffadUL, 0xfe51d4eaUL, 0xbe4c897aUL, 0x80000000UL, 0x3fe5f2d2UL, + 0xfd46ebe1UL, 0x3e552e00UL, 0xa0000000UL, 0x3fe5e5fbUL, 0xa4695699UL, + 0x3e5ed471UL, 0x60000000UL, 0x3fe5d928UL, 0x80d118aeUL, 0x3e456b61UL, + 0xa0000000UL, 0x3fe5cc58UL, 0x304c330bUL, 0x3e54dc29UL, 0x80000000UL, + 0x3fe5bf8cUL, 0x0af2dedfUL, 0xbe3aa9bdUL, 0xe0000000UL, 0x3fe5b2c3UL, + 0x15fc9258UL, 0xbe479a37UL, 0xc0000000UL, 0x3fe5a5feUL, 0x9292c7eaUL, + 0x3e188650UL, 0x20000000UL, 0x3fe5993dUL, 0x33b4d380UL, 0x3e5d6d93UL, + 0x20000000UL, 0x3fe58c7fUL, 0x02fd16c7UL, 0x3e2fe961UL, 0xa0000000UL, + 0x3fe57fc4UL, 0x4a05edb6UL, 0xbe4d55b4UL, 0xa0000000UL, 0x3fe5730dUL, + 0x3d443abbUL, 0xbe5e6954UL, 0x00000000UL, 0x3fe5665aUL, 0x024acfeaUL, + 0x3e50e61bUL, 0x00000000UL, 0x3fe559aaUL, 0xcc9edd09UL, 0xbe325403UL, + 0x60000000UL, 0x3fe54cfdUL, 0x1fe26950UL, 0x3e5d500eUL, 0x60000000UL, + 0x3fe54054UL, 0x6c5ae164UL, 0xbe4a79b4UL, 0xc0000000UL, 0x3fe533aeUL, + 0x154b0287UL, 0xbe401571UL, 0xa0000000UL, 0x3fe5270cUL, 0x0673f401UL, + 0xbe56e56bUL, 0xe0000000UL, 0x3fe51a6dUL, 0x751b639cUL, 0x3e235269UL, + 0xa0000000UL, 0x3fe50dd2UL, 0x7c7b2bedUL, 0x3ddec887UL, 0xc0000000UL, + 0x3fe5013aUL, 0xafab4e17UL, 0x3e5e7575UL, 0x60000000UL, 0x3fe4f4a6UL, + 0x2e308668UL, 0x3e59aed6UL, 0x80000000UL, 0x3fe4e815UL, 0xf33e2a76UL, + 0xbe51f184UL, 0xe0000000UL, 0x3fe4db87UL, 0x839f3e3eUL, 0x3e57db01UL, + 0xc0000000UL, 0x3fe4cefdUL, 0xa9eda7bbUL, 0x3e535e0fUL, 0x00000000UL, + 0x3fe4c277UL, 0x2a8f66a5UL, 0x3e5ce451UL, 0xc0000000UL, 0x3fe4b5f3UL, + 0x05192456UL, 0xbe4e8518UL, 0xc0000000UL, 0x3fe4a973UL, 0x4aa7cd1dUL, + 0x3e46784aUL, 0x40000000UL, 0x3fe49cf7UL, 0x8e23025eUL, 0xbe5749f2UL, + 0x00000000UL, 0x3fe4907eUL, 0x18d30215UL, 0x3e360f39UL, 0x20000000UL, + 0x3fe48408UL, 0x63dcf2f3UL, 0x3e5e00feUL, 0xc0000000UL, 0x3fe47795UL, + 0x46182d09UL, 0xbe5173d9UL, 0xa0000000UL, 0x3fe46b26UL, 0x8f0e62aaUL, + 0xbe48f281UL, 0xe0000000UL, 0x3fe45ebaUL, 0x5775c40cUL, 0xbe56aad4UL, + 0x60000000UL, 0x3fe45252UL, 0x0fe25f69UL, 0x3e48bd71UL, 0x40000000UL, + 0x3fe445edUL, 0xe9989ec5UL, 0x3e590d97UL, 0x80000000UL, 0x3fe4398bUL, + 0xb3d9ffe3UL, 0x3e479dbcUL, 0x20000000UL, 0x3fe42d2dUL, 0x388e4d2eUL, + 0xbe5eed80UL, 0xe0000000UL, 0x3fe420d1UL, 0x6f797c18UL, 0x3e554b4cUL, + 0x20000000UL, 0x3fe4147aUL, 0x31048bb4UL, 0xbe5b1112UL, 0x80000000UL, + 0x3fe40825UL, 0x2efba4f9UL, 0x3e48ebc7UL, 0x40000000UL, 0x3fe3fbd4UL, + 0x50201119UL, 0x3e40b701UL, 0x40000000UL, 0x3fe3ef86UL, 0x0a4db32cUL, + 0x3e551de8UL, 0xa0000000UL, 0x3fe3e33bUL, 0x0c9c148bUL, 0xbe50c1f6UL, + 0x20000000UL, 0x3fe3d6f4UL, 0xc9129447UL, 0x3e533fa0UL, 0x00000000UL, + 0x3fe3cab0UL, 0xaae5b5a0UL, 0xbe22b68eUL, 0x20000000UL, 0x3fe3be6fUL, + 0x02305e8aUL, 0xbe54fc08UL, 0x60000000UL, 0x3fe3b231UL, 0x7f908258UL, + 0x3e57dc05UL, 0x00000000UL, 0x3fe3a5f7UL, 0x1a09af78UL, 0x3e08038bUL, + 0xe0000000UL, 0x3fe399bfUL, 0x490643c1UL, 0xbe5dbe42UL, 0xe0000000UL, + 0x3fe38d8bUL, 0x5e8ad724UL, 0xbe3c2b72UL, 0x20000000UL, 0x3fe3815bUL, + 0xc67196b6UL, 0x3e1713cfUL, 0xa0000000UL, 0x3fe3752dUL, 0x6182e429UL, + 0xbe3ec14cUL, 0x40000000UL, 0x3fe36903UL, 0xab6eb1aeUL, 0x3e5a2cc5UL, + 0x40000000UL, 0x3fe35cdcUL, 0xfe5dc064UL, 0xbe5c5878UL, 0x40000000UL, + 0x3fe350b8UL, 0x0ba6b9e4UL, 0x3e51619bUL, 0x80000000UL, 0x3fe34497UL, + 0x857761aaUL, 0x3e5fff53UL, 0x00000000UL, 0x3fe3387aUL, 0xf872d68cUL, + 0x3e484f4dUL, 0xa0000000UL, 0x3fe32c5fUL, 0x087e97c2UL, 0x3e52842eUL, + 0x80000000UL, 0x3fe32048UL, 0x73d6d0c0UL, 0xbe503edfUL, 0x80000000UL, + 0x3fe31434UL, 0x0c1456a1UL, 0xbe5f72adUL, 0xa0000000UL, 0x3fe30823UL, + 0x83a1a4d5UL, 0xbe5e65ccUL, 0xe0000000UL, 0x3fe2fc15UL, 0x855a7390UL, + 0xbe506438UL, 0x40000000UL, 0x3fe2f00bUL, 0xa2898287UL, 0x3e3d22a2UL, + 0xe0000000UL, 0x3fe2e403UL, 0x8b56f66fUL, 0xbe5aa5fdUL, 0x80000000UL, + 0x3fe2d7ffUL, 0x52db119aUL, 0x3e3a2e3dUL, 0x60000000UL, 0x3fe2cbfeUL, + 0xe2ddd4c0UL, 0xbe586469UL, 0x40000000UL, 0x3fe2c000UL, 0x6b01bf10UL, + 0x3e352b9dUL, 0x40000000UL, 0x3fe2b405UL, 0xb07a1cdfUL, 0x3e5c5cdaUL, + 0x80000000UL, 0x3fe2a80dUL, 0xc7b5f868UL, 0xbe5668b3UL, 0xc0000000UL, + 0x3fe29c18UL, 0x185edf62UL, 0xbe563d66UL, 0x00000000UL, 0x3fe29027UL, + 0xf729e1ccUL, 0x3e59a9a0UL, 0x80000000UL, 0x3fe28438UL, 0x6433c727UL, + 0xbe43cc89UL, 0x00000000UL, 0x3fe2784dUL, 0x41782631UL, 0xbe30750cUL, + 0xa0000000UL, 0x3fe26c64UL, 0x914911b7UL, 0xbe58290eUL, 0x40000000UL, + 0x3fe2607fUL, 0x3dcc73e1UL, 0xbe4269cdUL, 0x00000000UL, 0x3fe2549dUL, + 0x2751bf70UL, 0xbe5a6998UL, 0xc0000000UL, 0x3fe248bdUL, 0x4248b9fbUL, + 0xbe4ddb00UL, 0x80000000UL, 0x3fe23ce1UL, 0xf35cf82fUL, 0x3e561b71UL, + 0x60000000UL, 0x3fe23108UL, 0x8e481a2dUL, 0x3e518fb9UL, 0x60000000UL, + 0x3fe22532UL, 0x5ab96edcUL, 0xbe5fafc5UL, 0x40000000UL, 0x3fe2195fUL, + 0x80943911UL, 0xbe07f819UL, 0x40000000UL, 0x3fe20d8fUL, 0x386f2d6cUL, + 0xbe54ba8bUL, 0x40000000UL, 0x3fe201c2UL, 0xf29664acUL, 0xbe5eb815UL, + 0x20000000UL, 0x3fe1f5f8UL, 0x64f03390UL, 0x3e5e320cUL, 0x20000000UL, + 0x3fe1ea31UL, 0x747ff696UL, 0x3e5ef0a5UL, 0x40000000UL, 0x3fe1de6dUL, + 0x3e9ceb51UL, 0xbe5f8d27UL, 0x20000000UL, 0x3fe1d2acUL, 0x4ae0b55eUL, + 0x3e5faa21UL, 0x20000000UL, 0x3fe1c6eeUL, 0x28569a5eUL, 0x3e598a4fUL, + 0x20000000UL, 0x3fe1bb33UL, 0x54b33e07UL, 0x3e46130aUL, 0x20000000UL, + 0x3fe1af7bUL, 0x024f1078UL, 0xbe4dbf93UL, 0x00000000UL, 0x3fe1a3c6UL, + 0xb0783bfaUL, 0x3e419248UL, 0xe0000000UL, 0x3fe19813UL, 0x2f02b836UL, + 0x3e4e02b7UL, 0xc0000000UL, 0x3fe18c64UL, 0x28dec9d4UL, 0x3e09064fUL, + 0x80000000UL, 0x3fe180b8UL, 0x45cbf406UL, 0x3e5b1f46UL, 0x40000000UL, + 0x3fe1750fUL, 0x03d9964cUL, 0x3e5b0a79UL, 0x00000000UL, 0x3fe16969UL, + 0x8b5b882bUL, 0xbe238086UL, 0xa0000000UL, 0x3fe15dc5UL, 0x73bad6f8UL, + 0xbdf1fca4UL, 0x20000000UL, 0x3fe15225UL, 0x5385769cUL, 0x3e5e8d76UL, + 0xa0000000UL, 0x3fe14687UL, 0x1676dc6bUL, 0x3e571d08UL, 0x20000000UL, + 0x3fe13aedUL, 0xa8c41c7fUL, 0xbe598a25UL, 0x60000000UL, 0x3fe12f55UL, + 0xc4e1aaf0UL, 0x3e435277UL, 0xa0000000UL, 0x3fe123c0UL, 0x403638e1UL, + 0xbe21aa7cUL, 0xc0000000UL, 0x3fe1182eUL, 0x557a092bUL, 0xbdd0116bUL, + 0xc0000000UL, 0x3fe10c9fUL, 0x7d779f66UL, 0x3e4a61baUL, 0xc0000000UL, + 0x3fe10113UL, 0x2b09c645UL, 0xbe5d586eUL, 0x20000000UL, 0x3fe0ea04UL, + 0xea2cad46UL, 0x3e5aa97cUL, 0x20000000UL, 0x3fe0d300UL, 0x23190e54UL, + 0x3e50f1a7UL, 0xa0000000UL, 0x3fe0bc07UL, 0x1379a5a6UL, 0xbe51619dUL, + 0x60000000UL, 0x3fe0a51aUL, 0x926a3d4aUL, 0x3e5cf019UL, 0xa0000000UL, + 0x3fe08e38UL, 0xa8c24358UL, 0x3e35241eUL, 0x20000000UL, 0x3fe07762UL, + 0x24317e7aUL, 0x3e512cfaUL, 0x00000000UL, 0x3fe06097UL, 0xfd9cf274UL, + 0xbe55bef3UL, 0x00000000UL, 0x3fe049d7UL, 0x3689b49dUL, 0xbe36d26dUL, + 0x40000000UL, 0x3fe03322UL, 0xf72ef6c4UL, 0xbe54cd08UL, 0xa0000000UL, + 0x3fe01c78UL, 0x23702d2dUL, 0xbe5900bfUL, 0x00000000UL, 0x3fe005daUL, + 0x3f59c14cUL, 0x3e57d80bUL, 0x40000000UL, 0x3fdfde8dUL, 0xad67766dUL, + 0xbe57fad4UL, 0x40000000UL, 0x3fdfb17cUL, 0x644f4ae7UL, 0x3e1ee43bUL, + 0x40000000UL, 0x3fdf8481UL, 0x903234d2UL, 0x3e501a86UL, 0x40000000UL, + 0x3fdf579cUL, 0xafe9e509UL, 0xbe267c3eUL, 0x00000000UL, 0x3fdf2acdUL, + 0xb7dfda0bUL, 0xbe48149bUL, 0x40000000UL, 0x3fdefe13UL, 0x3b94305eUL, + 0x3e5f4ea7UL, 0x80000000UL, 0x3fded16fUL, 0x5d95da61UL, 0xbe55c198UL, + 0x00000000UL, 0x3fdea4e1UL, 0x406960c9UL, 0xbdd99a19UL, 0x00000000UL, + 0x3fde7868UL, 0xd22f3539UL, 0x3e470c78UL, 0x80000000UL, 0x3fde4c04UL, + 0x83eec535UL, 0xbe3e1232UL, 0x40000000UL, 0x3fde1fb6UL, 0x3dfbffcbUL, + 0xbe4b7d71UL, 0x40000000UL, 0x3fddf37dUL, 0x7e1be4e0UL, 0xbe5b8f8fUL, + 0x40000000UL, 0x3fddc759UL, 0x46dae887UL, 0xbe350458UL, 0x80000000UL, + 0x3fdd9b4aUL, 0xed6ecc49UL, 0xbe5f0045UL, 0x80000000UL, 0x3fdd6f50UL, + 0x2e9e883cUL, 0x3e2915daUL, 0x80000000UL, 0x3fdd436bUL, 0xf0bccb32UL, + 0x3e4a68c9UL, 0x80000000UL, 0x3fdd179bUL, 0x9bbfc779UL, 0xbe54a26aUL, + 0x00000000UL, 0x3fdcebe0UL, 0x7cea33abUL, 0x3e43c6b7UL, 0x40000000UL, + 0x3fdcc039UL, 0xe740fd06UL, 0x3e5526c2UL, 0x40000000UL, 0x3fdc94a7UL, + 0x9eadeb1aUL, 0xbe396d8dUL, 0xc0000000UL, 0x3fdc6929UL, 0xf0a8f95aUL, + 0xbe5c0ab2UL, 0x80000000UL, 0x3fdc3dc0UL, 0x6ee2693bUL, 0x3e0992e6UL, + 0xc0000000UL, 0x3fdc126bUL, 0x5ac6b581UL, 0xbe2834b6UL, 0x40000000UL, + 0x3fdbe72bUL, 0x8cc226ffUL, 0x3e3596a6UL, 0x00000000UL, 0x3fdbbbffUL, + 0xf92a74bbUL, 0x3e3c5813UL, 0x00000000UL, 0x3fdb90e7UL, 0x479664c0UL, + 0xbe50d644UL, 0x00000000UL, 0x3fdb65e3UL, 0x5004975bUL, 0xbe55258fUL, + 0x00000000UL, 0x3fdb3af3UL, 0xe4b23194UL, 0xbe588407UL, 0xc0000000UL, + 0x3fdb1016UL, 0xe65d4d0aUL, 0x3e527c26UL, 0x80000000UL, 0x3fdae54eUL, + 0x814fddd6UL, 0x3e5962a2UL, 0x40000000UL, 0x3fdaba9aUL, 0xe19d0913UL, + 0xbe562f4eUL, 0x80000000UL, 0x3fda8ff9UL, 0x43cfd006UL, 0xbe4cfdebUL, + 0x40000000UL, 0x3fda656cUL, 0x686f0a4eUL, 0x3e5e47a8UL, 0xc0000000UL, + 0x3fda3af2UL, 0x7200d410UL, 0x3e5e1199UL, 0xc0000000UL, 0x3fda108cUL, + 0xabd2266eUL, 0x3e5ee4d1UL, 0x40000000UL, 0x3fd9e63aUL, 0x396f8f2cUL, + 0x3e4dbffbUL, 0x00000000UL, 0x3fd9bbfbUL, 0xe32b25ddUL, 0x3e5c3a54UL, + 0x40000000UL, 0x3fd991cfUL, 0x431e4035UL, 0xbe457925UL, 0x80000000UL, + 0x3fd967b6UL, 0x7bed3dd3UL, 0x3e40c61dUL, 0x00000000UL, 0x3fd93db1UL, + 0xd7449365UL, 0x3e306419UL, 0x80000000UL, 0x3fd913beUL, 0x1746e791UL, + 0x3e56fcfcUL, 0x40000000UL, 0x3fd8e9dfUL, 0xf3a9028bUL, 0xbe5041b9UL, + 0xc0000000UL, 0x3fd8c012UL, 0x56840c50UL, 0xbe26e20aUL, 0x40000000UL, + 0x3fd89659UL, 0x19763102UL, 0xbe51f466UL, 0x80000000UL, 0x3fd86cb2UL, + 0x7032de7cUL, 0xbe4d298aUL, 0x80000000UL, 0x3fd8431eUL, 0xdeb39fabUL, + 0xbe4361ebUL, 0x40000000UL, 0x3fd8199dUL, 0x5d01cbe0UL, 0xbe5425b3UL, + 0x80000000UL, 0x3fd7f02eUL, 0x3ce99aa9UL, 0x3e146fa8UL, 0x80000000UL, + 0x3fd7c6d2UL, 0xd1a262b9UL, 0xbe5a1a69UL, 0xc0000000UL, 0x3fd79d88UL, + 0x8606c236UL, 0x3e423a08UL, 0x80000000UL, 0x3fd77451UL, 0x8fd1e1b7UL, + 0x3e5a6a63UL, 0xc0000000UL, 0x3fd74b2cUL, 0xe491456aUL, 0x3e42c1caUL, + 0x40000000UL, 0x3fd7221aUL, 0x4499a6d7UL, 0x3e36a69aUL, 0x00000000UL, + 0x3fd6f91aUL, 0x5237df94UL, 0xbe0f8f02UL, 0x00000000UL, 0x3fd6d02cUL, + 0xb6482c6eUL, 0xbe5abcf7UL, 0x00000000UL, 0x3fd6a750UL, 0x1919fd61UL, + 0xbe57ade2UL, 0x00000000UL, 0x3fd67e86UL, 0xaa7a994dUL, 0xbe3f3fbdUL, + 0x00000000UL, 0x3fd655ceUL, 0x67db014cUL, 0x3e33c550UL, 0x00000000UL, + 0x3fd62d28UL, 0xa82856b7UL, 0xbe1409d1UL, 0xc0000000UL, 0x3fd60493UL, + 0x1e6a300dUL, 0x3e55d899UL, 0x80000000UL, 0x3fd5dc11UL, 0x1222bd5cUL, + 0xbe35bfc0UL, 0xc0000000UL, 0x3fd5b3a0UL, 0x6e8dc2d3UL, 0x3e5d4d79UL, + 0x00000000UL, 0x3fd58b42UL, 0xe0e4ace6UL, 0xbe517303UL, 0x80000000UL, + 0x3fd562f4UL, 0xb306e0a8UL, 0x3e5edf0fUL, 0xc0000000UL, 0x3fd53ab8UL, + 0x6574bc54UL, 0x3e5ee859UL, 0x80000000UL, 0x3fd5128eUL, 0xea902207UL, + 0x3e5f6188UL, 0xc0000000UL, 0x3fd4ea75UL, 0x9f911d79UL, 0x3e511735UL, + 0x80000000UL, 0x3fd4c26eUL, 0xf9c77397UL, 0xbe5b1643UL, 0x40000000UL, + 0x3fd49a78UL, 0x15fc9258UL, 0x3e479a37UL, 0x80000000UL, 0x3fd47293UL, + 0xd5a04dd9UL, 0xbe426e56UL, 0xc0000000UL, 0x3fd44abfUL, 0xe04042f5UL, + 0x3e56f7c6UL, 0x40000000UL, 0x3fd422fdUL, 0x1d8bf2c8UL, 0x3e5d8810UL, + 0x00000000UL, 0x3fd3fb4cUL, 0x88a8ddeeUL, 0xbe311454UL, 0xc0000000UL, + 0x3fd3d3abUL, 0x3e3b5e47UL, 0xbe5d1b72UL, 0x40000000UL, 0x3fd3ac1cUL, + 0xc2ab5d59UL, 0x3e31b02bUL, 0xc0000000UL, 0x3fd3849dUL, 0xd4e34b9eUL, + 0x3e51cb2fUL, 0x40000000UL, 0x3fd35d30UL, 0x177204fbUL, 0xbe2b8cd7UL, + 0x80000000UL, 0x3fd335d3UL, 0xfcd38c82UL, 0xbe4356e1UL, 0x80000000UL, + 0x3fd30e87UL, 0x64f54accUL, 0xbe4e6224UL, 0x00000000UL, 0x3fd2e74cUL, + 0xaa7975d9UL, 0x3e5dc0feUL, 0x80000000UL, 0x3fd2c021UL, 0x516dab3fUL, + 0xbe50ffa3UL, 0x40000000UL, 0x3fd29907UL, 0x2bfb7313UL, 0x3e5674a2UL, + 0xc0000000UL, 0x3fd271fdUL, 0x0549fc99UL, 0x3e385d29UL, 0xc0000000UL, + 0x3fd24b04UL, 0x55b63073UL, 0xbe500c6dUL, 0x00000000UL, 0x3fd2241cUL, + 0x3f91953aUL, 0x3e389977UL, 0xc0000000UL, 0x3fd1fd43UL, 0xa1543f71UL, + 0xbe3487abUL, 0xc0000000UL, 0x3fd1d67bUL, 0x4ec8867cUL, 0x3df6a2dcUL, + 0x00000000UL, 0x3fd1afc4UL, 0x4328e3bbUL, 0x3e41d9c0UL, 0x80000000UL, + 0x3fd1891cUL, 0x2e1cda84UL, 0x3e3bdd87UL, 0x40000000UL, 0x3fd16285UL, + 0x4b5331aeUL, 0xbe53128eUL, 0x00000000UL, 0x3fd13bfeUL, 0xb9aec164UL, + 0xbe52ac98UL, 0xc0000000UL, 0x3fd11586UL, 0xd91e1316UL, 0xbe350630UL, + 0x80000000UL, 0x3fd0ef1fUL, 0x7cacc12cUL, 0x3e3f5219UL, 0x40000000UL, + 0x3fd0c8c8UL, 0xbce277b7UL, 0x3e3d30c0UL, 0x00000000UL, 0x3fd0a281UL, + 0x2a63447dUL, 0xbe541377UL, 0x80000000UL, 0x3fd07c49UL, 0xfac483b5UL, + 0xbe5772ecUL, 0xc0000000UL, 0x3fd05621UL, 0x36b8a570UL, 0xbe4fd4bdUL, + 0xc0000000UL, 0x3fd03009UL, 0xbae505f7UL, 0xbe450388UL, 0x80000000UL, + 0x3fd00a01UL, 0x3e35aeadUL, 0xbe5430fcUL, 0x80000000UL, 0x3fcfc811UL, + 0x707475acUL, 0x3e38806eUL, 0x80000000UL, 0x3fcf7c3fUL, 0xc91817fcUL, + 0xbe40cceaUL, 0x80000000UL, 0x3fcf308cUL, 0xae05d5e9UL, 0xbe4919b8UL, + 0x80000000UL, 0x3fcee4f8UL, 0xae6cc9e6UL, 0xbe530b94UL, 0x00000000UL, + 0x3fce9983UL, 0x1efe3e8eUL, 0x3e57747eUL, 0x00000000UL, 0x3fce4e2dUL, + 0xda78d9bfUL, 0xbe59a608UL, 0x00000000UL, 0x3fce02f5UL, 0x8abe2c2eUL, + 0x3e4a35adUL, 0x00000000UL, 0x3fcdb7dcUL, 0x1495450dUL, 0xbe0872ccUL, + 0x80000000UL, 0x3fcd6ce1UL, 0x86ee0ba0UL, 0xbe4f59a0UL, 0x00000000UL, + 0x3fcd2205UL, 0xe81ca888UL, 0x3e5402c3UL, 0x00000000UL, 0x3fccd747UL, + 0x3b4424b9UL, 0x3e5dfdc3UL, 0x80000000UL, 0x3fcc8ca7UL, 0xd305b56cUL, + 0x3e202da6UL, 0x00000000UL, 0x3fcc4226UL, 0x399a6910UL, 0xbe482a1cUL, + 0x80000000UL, 0x3fcbf7c2UL, 0x747f7938UL, 0xbe587372UL, 0x80000000UL, + 0x3fcbad7cUL, 0x6fc246a0UL, 0x3e50d83dUL, 0x00000000UL, 0x3fcb6355UL, + 0xee9e9be5UL, 0xbe5c35bdUL, 0x80000000UL, 0x3fcb194aUL, 0x8416c0bcUL, + 0x3e546d4fUL, 0x00000000UL, 0x3fcacf5eUL, 0x49f7f08fUL, 0x3e56da76UL, + 0x00000000UL, 0x3fca858fUL, 0x5dc30de2UL, 0x3e5f390cUL, 0x00000000UL, + 0x3fca3bdeUL, 0x950583b6UL, 0xbe5e4169UL, 0x80000000UL, 0x3fc9f249UL, + 0x33631553UL, 0x3e52aeb1UL, 0x00000000UL, 0x3fc9a8d3UL, 0xde8795a6UL, + 0xbe59a504UL, 0x00000000UL, 0x3fc95f79UL, 0x076bf41eUL, 0x3e5122feUL, + 0x80000000UL, 0x3fc9163cUL, 0x2914c8e7UL, 0x3e3dd064UL, 0x00000000UL, + 0x3fc8cd1dUL, 0x3a30eca3UL, 0xbe21b4aaUL, 0x80000000UL, 0x3fc8841aUL, + 0xb2a96650UL, 0xbe575444UL, 0x80000000UL, 0x3fc83b34UL, 0x2376c0cbUL, + 0xbe2a74c7UL, 0x80000000UL, 0x3fc7f26bUL, 0xd8a0b653UL, 0xbe5181b6UL, + 0x00000000UL, 0x3fc7a9bfUL, 0x32257882UL, 0xbe4a78b4UL, 0x00000000UL, + 0x3fc7612fUL, 0x1eee8bd9UL, 0xbe1bfe9dUL, 0x80000000UL, 0x3fc718bbUL, + 0x0c603cc4UL, 0x3e36fdc9UL, 0x80000000UL, 0x3fc6d064UL, 0x3728b8cfUL, + 0xbe1e542eUL, 0x80000000UL, 0x3fc68829UL, 0xc79a4067UL, 0x3e5c380fUL, + 0x00000000UL, 0x3fc6400bUL, 0xf69eac69UL, 0x3e550a84UL, 0x80000000UL, + 0x3fc5f808UL, 0xb7a780a4UL, 0x3e5d9224UL, 0x80000000UL, 0x3fc5b022UL, + 0xad9dfb1eUL, 0xbe55242fUL, 0x00000000UL, 0x3fc56858UL, 0x659b18beUL, + 0xbe4bfda3UL, 0x80000000UL, 0x3fc520a9UL, 0x66ee3631UL, 0xbe57d769UL, + 0x80000000UL, 0x3fc4d916UL, 0x1ec62819UL, 0x3e2427f7UL, 0x80000000UL, + 0x3fc4919fUL, 0xdec25369UL, 0xbe435431UL, 0x00000000UL, 0x3fc44a44UL, + 0xa8acfc4bUL, 0xbe3c62e8UL, 0x00000000UL, 0x3fc40304UL, 0xcf1d3eabUL, + 0xbdfba29fUL, 0x80000000UL, 0x3fc3bbdfUL, 0x79aba3eaUL, 0xbdf1b7c8UL, + 0x80000000UL, 0x3fc374d6UL, 0xb8d186daUL, 0xbe5130cfUL, 0x80000000UL, + 0x3fc32de8UL, 0x9d74f152UL, 0x3e2285b6UL, 0x00000000UL, 0x3fc2e716UL, + 0x50ae7ca9UL, 0xbe503920UL, 0x80000000UL, 0x3fc2a05eUL, 0x6caed92eUL, + 0xbe533924UL, 0x00000000UL, 0x3fc259c2UL, 0x9cb5034eUL, 0xbe510e31UL, + 0x80000000UL, 0x3fc21340UL, 0x12c4d378UL, 0xbe540b43UL, 0x80000000UL, + 0x3fc1ccd9UL, 0xcc418706UL, 0x3e59887aUL, 0x00000000UL, 0x3fc1868eUL, + 0x921f4106UL, 0xbe528e67UL, 0x80000000UL, 0x3fc1405cUL, 0x3969441eUL, + 0x3e5d8051UL, 0x00000000UL, 0x3fc0fa46UL, 0xd941ef5bUL, 0x3e5f9079UL, + 0x80000000UL, 0x3fc0b44aUL, 0x5a3e81b2UL, 0xbe567691UL, 0x00000000UL, + 0x3fc06e69UL, 0x9d66afe7UL, 0xbe4d43fbUL, 0x00000000UL, 0x3fc028a2UL, + 0x0a92a162UL, 0xbe52f394UL, 0x00000000UL, 0x3fbfc5eaUL, 0x209897e5UL, + 0x3e529e37UL, 0x00000000UL, 0x3fbf3ac5UL, 0x8458bd7bUL, 0x3e582831UL, + 0x00000000UL, 0x3fbeafd5UL, 0xb8d8b4b8UL, 0xbe486b4aUL, 0x00000000UL, + 0x3fbe2518UL, 0xe0a3b7b6UL, 0x3e5bafd2UL, 0x00000000UL, 0x3fbd9a90UL, + 0x2bf2710eUL, 0x3e383b2bUL, 0x00000000UL, 0x3fbd103cUL, 0x73eb6ab7UL, + 0xbe56d78dUL, 0x00000000UL, 0x3fbc861bUL, 0x32ceaff5UL, 0xbe32dc5aUL, + 0x00000000UL, 0x3fbbfc2eUL, 0xbee04cb7UL, 0xbe4a71a4UL, 0x00000000UL, + 0x3fbb7274UL, 0x35ae9577UL, 0x3e38142fUL, 0x00000000UL, 0x3fbae8eeUL, + 0xcbaddab4UL, 0xbe5490f0UL, 0x00000000UL, 0x3fba5f9aUL, 0x95ce1114UL, + 0x3e597c71UL, 0x00000000UL, 0x3fb9d67aUL, 0x6d7c0f78UL, 0x3e3abc2dUL, + 0x00000000UL, 0x3fb94d8dUL, 0x2841a782UL, 0xbe566cbcUL, 0x00000000UL, + 0x3fb8c4d2UL, 0x6ed429c6UL, 0xbe3cfff9UL, 0x00000000UL, 0x3fb83c4aUL, + 0xe4a49fbbUL, 0xbe552964UL, 0x00000000UL, 0x3fb7b3f4UL, 0x2193d81eUL, + 0xbe42fa72UL, 0x00000000UL, 0x3fb72bd0UL, 0xdd70c122UL, 0x3e527a8cUL, + 0x00000000UL, 0x3fb6a3dfUL, 0x03108a54UL, 0xbe450393UL, 0x00000000UL, + 0x3fb61c1fUL, 0x30ff7954UL, 0x3e565840UL, 0x00000000UL, 0x3fb59492UL, + 0xdedd460cUL, 0xbe5422b5UL, 0x00000000UL, 0x3fb50d36UL, 0x950f9f45UL, + 0xbe5313f6UL, 0x00000000UL, 0x3fb4860bUL, 0x582cdcb1UL, 0x3e506d39UL, + 0x00000000UL, 0x3fb3ff12UL, 0x7216d3a6UL, 0x3e4aa719UL, 0x00000000UL, + 0x3fb3784aUL, 0x57a423fdUL, 0x3e5a9b9fUL, 0x00000000UL, 0x3fb2f1b4UL, + 0x7a138b41UL, 0xbe50b418UL, 0x00000000UL, 0x3fb26b4eUL, 0x2fbfd7eaUL, + 0x3e23a53eUL, 0x00000000UL, 0x3fb1e519UL, 0x18913ccbUL, 0x3e465fc1UL, + 0x00000000UL, 0x3fb15f15UL, 0x7ea24e21UL, 0x3e042843UL, 0x00000000UL, + 0x3fb0d941UL, 0x7c6d9c77UL, 0x3e59f61eUL, 0x00000000UL, 0x3fb0539eUL, + 0x114efd44UL, 0x3e4ccab7UL, 0x00000000UL, 0x3faf9c56UL, 0x1777f657UL, + 0x3e552f65UL, 0x00000000UL, 0x3fae91d2UL, 0xc317b86aUL, 0xbe5a61e0UL, + 0x00000000UL, 0x3fad87acUL, 0xb7664efbUL, 0xbe41f64eUL, 0x00000000UL, + 0x3fac7de6UL, 0x5d3d03a9UL, 0x3e0807a0UL, 0x00000000UL, 0x3fab7480UL, + 0x743c38ebUL, 0xbe3726e1UL, 0x00000000UL, 0x3faa6b78UL, 0x06a253f1UL, + 0x3e5ad636UL, 0x00000000UL, 0x3fa962d0UL, 0xa35f541bUL, 0x3e5a187aUL, + 0x00000000UL, 0x3fa85a88UL, 0x4b86e446UL, 0xbe508150UL, 0x00000000UL, + 0x3fa7529cUL, 0x2589cacfUL, 0x3e52938aUL, 0x00000000UL, 0x3fa64b10UL, + 0xaf6b11f2UL, 0xbe3454cdUL, 0x00000000UL, 0x3fa543e2UL, 0x97506fefUL, + 0xbe5fdec5UL, 0x00000000UL, 0x3fa43d10UL, 0xe75f7dd9UL, 0xbe388dd3UL, + 0x00000000UL, 0x3fa3369cUL, 0xa4139632UL, 0xbdea5177UL, 0x00000000UL, + 0x3fa23086UL, 0x352d6f1eUL, 0xbe565ad6UL, 0x00000000UL, 0x3fa12accUL, + 0x77449eb7UL, 0xbe50d5c7UL, 0x00000000UL, 0x3fa0256eUL, 0x7478da78UL, + 0x3e404724UL, 0x00000000UL, 0x3f9e40dcUL, 0xf59cef7fUL, 0xbe539d0aUL, + 0x00000000UL, 0x3f9c3790UL, 0x1511d43cUL, 0x3e53c2c8UL, 0x00000000UL, + 0x3f9a2f00UL, 0x9b8bff3cUL, 0xbe43b3e1UL, 0x00000000UL, 0x3f982724UL, + 0xad1e22a5UL, 0x3e46f0bdUL, 0x00000000UL, 0x3f962000UL, 0x130d9356UL, + 0x3e475ba0UL, 0x00000000UL, 0x3f941994UL, 0x8f86f883UL, 0xbe513d0bUL, + 0x00000000UL, 0x3f9213dcUL, 0x914d0dc8UL, 0xbe534335UL, 0x00000000UL, + 0x3f900ed8UL, 0x2d73e5e7UL, 0xbe22ba75UL, 0x00000000UL, 0x3f8c1510UL, + 0xc5b7d70eUL, 0x3e599c5dUL, 0x00000000UL, 0x3f880de0UL, 0x8a27857eUL, + 0xbe3d28c8UL, 0x00000000UL, 0x3f840810UL, 0xda767328UL, 0x3e531b3dUL, + 0x00000000UL, 0x3f8003b0UL, 0x77bacaf3UL, 0xbe5f04e3UL, 0x00000000UL, + 0x3f780150UL, 0xdf4b0720UL, 0x3e5a8bffUL, 0x00000000UL, 0x3f6ffc40UL, + 0x34c48e71UL, 0xbe3fcd99UL, 0x00000000UL, 0x3f5ff6c0UL, 0x1ad218afUL, + 0xbe4c78a7UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x80000000UL, + 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, + 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL, 0x6dc96112UL, 0xbf836578UL, + 0xee241472UL, 0xbf9b0301UL, 0x9f95985aUL, 0xbfb528dbUL, 0xb3841d2aUL, + 0xbfd619b6UL, 0x518775e3UL, 0x3f9004f2UL, 0xac8349bbUL, 0x3fa76c9bUL, + 0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, 0xbf5dabe1UL, 0x9f95985aUL, + 0xbfb528dbUL, 0xf8b5787dUL, 0x3ef2531eUL, 0x486ececbUL, 0x3fc4635eUL, + 0x412055ccUL, 0xbdd61bb2UL, 0x00000000UL, 0xfffffff8UL, 0x00000000UL, + 0xffffffffUL, 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x3b700000UL, + 0xfa5abcbfUL, 0x3ff00b1aUL, 0xa7609f71UL, 0xbc84f6b2UL, 0xa9fb3335UL, + 0x3ff0163dUL, 0x9ab8cdb7UL, 0x3c9b6129UL, 0x143b0281UL, 0x3ff02168UL, + 0x0fc54eb6UL, 0xbc82bf31UL, 0x3e778061UL, 0x3ff02c9aUL, 0x535b085dUL, + 0xbc719083UL, 0x2e11bbccUL, 0x3ff037d4UL, 0xeeade11aUL, 0x3c656811UL, + 0xe86e7f85UL, 0x3ff04315UL, 0x1977c96eUL, 0xbc90a31cUL, 0x72f654b1UL, + 0x3ff04e5fUL, 0x3aa0d08cUL, 0x3c84c379UL, 0xd3158574UL, 0x3ff059b0UL, + 0xa475b465UL, 0x3c8d73e2UL, 0x0e3c1f89UL, 0x3ff0650aUL, 0x5799c397UL, + 0xbc95cb7bUL, 0x29ddf6deUL, 0x3ff0706bUL, 0xe2b13c27UL, 0xbc8c91dfUL, + 0x2b72a836UL, 0x3ff07bd4UL, 0x54458700UL, 0x3c832334UL, 0x18759bc8UL, + 0x3ff08745UL, 0x4bb284ffUL, 0x3c6186beUL, 0xf66607e0UL, 0x3ff092bdUL, + 0x800a3fd1UL, 0xbc968063UL, 0xcac6f383UL, 0x3ff09e3eUL, 0x18316136UL, + 0x3c914878UL, 0x9b1f3919UL, 0x3ff0a9c7UL, 0x873d1d38UL, 0x3c85d16cUL, + 0x6cf9890fUL, 0x3ff0b558UL, 0x4adc610bUL, 0x3c98a62eUL, 0x45e46c85UL, + 0x3ff0c0f1UL, 0x06d21cefUL, 0x3c94f989UL, 0x2b7247f7UL, 0x3ff0cc92UL, + 0x16e24f71UL, 0x3c901edcUL, 0x23395decUL, 0x3ff0d83bUL, 0xe43f316aUL, + 0xbc9bc14dUL, 0x32d3d1a2UL, 0x3ff0e3ecUL, 0x27c57b52UL, 0x3c403a17UL, + 0x5fdfa9c5UL, 0x3ff0efa5UL, 0xbc54021bUL, 0xbc949db9UL, 0xaffed31bUL, + 0x3ff0fb66UL, 0xc44ebd7bUL, 0xbc6b9bedUL, 0x28d7233eUL, 0x3ff10730UL, + 0x1692fdd5UL, 0x3c8d46ebUL, 0xd0125b51UL, 0x3ff11301UL, 0x39449b3aUL, + 0xbc96c510UL, 0xab5e2ab6UL, 0x3ff11edbUL, 0xf703fb72UL, 0xbc9ca454UL, + 0xc06c31ccUL, 0x3ff12abdUL, 0xb36ca5c7UL, 0xbc51b514UL, 0x14f204abUL, + 0x3ff136a8UL, 0xba48dcf0UL, 0xbc67108fUL, 0xaea92de0UL, 0x3ff1429aUL, + 0x9af1369eUL, 0xbc932fbfUL, 0x934f312eUL, 0x3ff14e95UL, 0x39bf44abUL, + 0xbc8b91e8UL, 0xc8a58e51UL, 0x3ff15a98UL, 0xb9eeab0aUL, 0x3c82406aUL, + 0x5471c3c2UL, 0x3ff166a4UL, 0x82ea1a32UL, 0x3c58f23bUL, 0x3c7d517bUL, + 0x3ff172b8UL, 0xb9d78a76UL, 0xbc819041UL, 0x8695bbc0UL, 0x3ff17ed4UL, + 0xe2ac5a64UL, 0x3c709e3fUL, 0x388c8deaUL, 0x3ff18af9UL, 0xd1970f6cUL, + 0xbc911023UL, 0x58375d2fUL, 0x3ff19726UL, 0x85f17e08UL, 0x3c94aaddUL, + 0xeb6fcb75UL, 0x3ff1a35bUL, 0x7b4968e4UL, 0x3c8e5b4cUL, 0xf8138a1cUL, + 0x3ff1af99UL, 0xa4b69280UL, 0x3c97bf85UL, 0x84045cd4UL, 0x3ff1bbe0UL, + 0x352ef607UL, 0xbc995386UL, 0x95281c6bUL, 0x3ff1c82fUL, 0x8010f8c9UL, + 0x3c900977UL, 0x3168b9aaUL, 0x3ff1d487UL, 0x00a2643cUL, 0x3c9e016eUL, + 0x5eb44027UL, 0x3ff1e0e7UL, 0x088cb6deUL, 0xbc96fdd8UL, 0x22fcd91dUL, + 0x3ff1ed50UL, 0x027bb78cUL, 0xbc91df98UL, 0x8438ce4dUL, 0x3ff1f9c1UL, + 0xa097af5cUL, 0xbc9bf524UL, 0x88628cd6UL, 0x3ff2063bUL, 0x814a8495UL, + 0x3c8dc775UL, 0x3578a819UL, 0x3ff212beUL, 0x2cfcaac9UL, 0x3c93592dUL, + 0x917ddc96UL, 0x3ff21f49UL, 0x9494a5eeUL, 0x3c82a97eUL, 0xa27912d1UL, + 0x3ff22bddUL, 0x5577d69fUL, 0x3c8d34fbUL, 0x6e756238UL, 0x3ff2387aUL, + 0xb6c70573UL, 0x3c99b07eUL, 0xfb82140aUL, 0x3ff2451fUL, 0x911ca996UL, + 0x3c8acfccUL, 0x4fb2a63fUL, 0x3ff251ceUL, 0xbef4f4a4UL, 0x3c8ac155UL, + 0x711ece75UL, 0x3ff25e85UL, 0x4ac31b2cUL, 0x3c93e1a2UL, 0x65e27cddUL, + 0x3ff26b45UL, 0x9940e9d9UL, 0x3c82bd33UL, 0x341ddf29UL, 0x3ff2780eUL, + 0x05f9e76cUL, 0x3c9e067cUL, 0xe1f56381UL, 0x3ff284dfUL, 0x8c3f0d7eUL, + 0xbc9a4c3aUL, 0x7591bb70UL, 0x3ff291baUL, 0x28401cbdUL, 0xbc82cc72UL, + 0xf51fdee1UL, 0x3ff29e9dUL, 0xafad1255UL, 0x3c8612e8UL, 0x66d10f13UL, + 0x3ff2ab8aUL, 0x191690a7UL, 0xbc995743UL, 0xd0dad990UL, 0x3ff2b87fUL, + 0xd6381aa4UL, 0xbc410adcUL, 0x39771b2fUL, 0x3ff2c57eUL, 0xa6eb5124UL, + 0xbc950145UL, 0xa6e4030bUL, 0x3ff2d285UL, 0x54db41d5UL, 0x3c900247UL, + 0x1f641589UL, 0x3ff2df96UL, 0xfbbce198UL, 0x3c9d16cfUL, 0xa93e2f56UL, + 0x3ff2ecafUL, 0x45d52383UL, 0x3c71ca0fUL, 0x4abd886bUL, 0x3ff2f9d2UL, + 0x532bda93UL, 0xbc653c55UL, 0x0a31b715UL, 0x3ff306feUL, 0xd23182e4UL, + 0x3c86f46aUL, 0xedeeb2fdUL, 0x3ff31432UL, 0xf3f3fcd1UL, 0x3c8959a3UL, + 0xfc4cd831UL, 0x3ff32170UL, 0x8e18047cUL, 0x3c8a9ce7UL, 0x3ba8ea32UL, + 0x3ff32eb8UL, 0x3cb4f318UL, 0xbc9c45e8UL, 0xb26416ffUL, 0x3ff33c08UL, + 0x843659a6UL, 0x3c932721UL, 0x66e3fa2dUL, 0x3ff34962UL, 0x930881a4UL, + 0xbc835a75UL, 0x5f929ff1UL, 0x3ff356c5UL, 0x5c4e4628UL, 0xbc8b5ceeUL, + 0xa2de883bUL, 0x3ff36431UL, 0xa06cb85eUL, 0xbc8c3144UL, 0x373aa9cbUL, + 0x3ff371a7UL, 0xbf42eae2UL, 0xbc963aeaUL, 0x231e754aUL, 0x3ff37f26UL, + 0x9eceb23cUL, 0xbc99f5caUL, 0x6d05d866UL, 0x3ff38caeUL, 0x3c9904bdUL, + 0xbc9e958dUL, 0x1b7140efUL, 0x3ff39a40UL, 0xfc8e2934UL, 0xbc99a9a5UL, + 0x34e59ff7UL, 0x3ff3a7dbUL, 0xd661f5e3UL, 0xbc75e436UL, 0xbfec6cf4UL, + 0x3ff3b57fUL, 0xe26fff18UL, 0x3c954c66UL, 0xc313a8e5UL, 0x3ff3c32dUL, + 0x375d29c3UL, 0xbc9efff8UL, 0x44ede173UL, 0x3ff3d0e5UL, 0x8c284c71UL, + 0x3c7fe8d0UL, 0x4c123422UL, 0x3ff3dea6UL, 0x11f09ebcUL, 0x3c8ada09UL, + 0xdf1c5175UL, 0x3ff3ec70UL, 0x7b8c9bcaUL, 0xbc8af663UL, 0x04ac801cUL, + 0x3ff3fa45UL, 0xf956f9f3UL, 0xbc97d023UL, 0xc367a024UL, 0x3ff40822UL, + 0xb6f4d048UL, 0x3c8bddf8UL, 0x21f72e2aUL, 0x3ff4160aUL, 0x1c309278UL, + 0xbc5ef369UL, 0x2709468aUL, 0x3ff423fbUL, 0xc0b314ddUL, 0xbc98462dUL, + 0xd950a897UL, 0x3ff431f5UL, 0xe35f7999UL, 0xbc81c7ddUL, 0x3f84b9d4UL, + 0x3ff43ffaUL, 0x9704c003UL, 0x3c8880beUL, 0x6061892dUL, 0x3ff44e08UL, + 0x04ef80d0UL, 0x3c489b7aUL, 0x42a7d232UL, 0x3ff45c20UL, 0x82fb1f8eUL, + 0xbc686419UL, 0xed1d0057UL, 0x3ff46a41UL, 0xd1648a76UL, 0x3c9c944bUL, + 0x668b3237UL, 0x3ff4786dUL, 0xed445733UL, 0xbc9c20f0UL, 0xb5c13cd0UL, + 0x3ff486a2UL, 0xb69062f0UL, 0x3c73c1a3UL, 0xe192aed2UL, 0x3ff494e1UL, + 0x5e499ea0UL, 0xbc83b289UL, 0xf0d7d3deUL, 0x3ff4a32aUL, 0xf3d1be56UL, + 0x3c99cb62UL, 0xea6db7d7UL, 0x3ff4b17dUL, 0x7f2897f0UL, 0xbc8125b8UL, + 0xd5362a27UL, 0x3ff4bfdaUL, 0xafec42e2UL, 0x3c7d4397UL, 0xb817c114UL, + 0x3ff4ce41UL, 0x690abd5dUL, 0x3c905e29UL, 0x99fddd0dUL, 0x3ff4dcb2UL, + 0xbc6a7833UL, 0x3c98ecdbUL, 0x81d8abffUL, 0x3ff4eb2dUL, 0x2e5d7a52UL, + 0xbc95257dUL, 0x769d2ca7UL, 0x3ff4f9b2UL, 0xd25957e3UL, 0xbc94b309UL, + 0x7f4531eeUL, 0x3ff50841UL, 0x49b7465fUL, 0x3c7a249bUL, 0xa2cf6642UL, + 0x3ff516daUL, 0x69bd93efUL, 0xbc8f7685UL, 0xe83f4eefUL, 0x3ff5257dUL, + 0x43efef71UL, 0xbc7c998dUL, 0x569d4f82UL, 0x3ff5342bUL, 0x1db13cadUL, + 0xbc807abeUL, 0xf4f6ad27UL, 0x3ff542e2UL, 0x192d5f7eUL, 0x3c87926dUL, + 0xca5d920fUL, 0x3ff551a4UL, 0xefede59bUL, 0xbc8d689cUL, 0xdde910d2UL, + 0x3ff56070UL, 0x168eebf0UL, 0xbc90fb6eUL, 0x36b527daUL, 0x3ff56f47UL, + 0x011d93adUL, 0x3c99bb2cUL, 0xdbe2c4cfUL, 0x3ff57e27UL, 0x8a57b9c4UL, + 0xbc90b98cUL, 0xd497c7fdUL, 0x3ff58d12UL, 0x5b9a1de8UL, 0x3c8295e1UL, + 0x27ff07ccUL, 0x3ff59c08UL, 0xe467e60fUL, 0xbc97e2ceUL, 0xdd485429UL, + 0x3ff5ab07UL, 0x054647adUL, 0x3c96324cUL, 0xfba87a03UL, 0x3ff5ba11UL, + 0x4c233e1aUL, 0xbc9b77a1UL, 0x8a5946b7UL, 0x3ff5c926UL, 0x816986a2UL, + 0x3c3c4b1bUL, 0x90998b93UL, 0x3ff5d845UL, 0xa8b45643UL, 0xbc9cd6a7UL, + 0x15ad2148UL, 0x3ff5e76fUL, 0x3080e65eUL, 0x3c9ba6f9UL, 0x20dceb71UL, + 0x3ff5f6a3UL, 0xe3cdcf92UL, 0xbc89eaddUL, 0xb976dc09UL, 0x3ff605e1UL, + 0x9b56de47UL, 0xbc93e242UL, 0xe6cdf6f4UL, 0x3ff6152aUL, 0x4ab84c27UL, + 0x3c9e4b3eUL, 0xb03a5585UL, 0x3ff6247eUL, 0x7e40b497UL, 0xbc9383c1UL, + 0x1d1929fdUL, 0x3ff633ddUL, 0xbeb964e5UL, 0x3c984710UL, 0x34ccc320UL, + 0x3ff64346UL, 0x759d8933UL, 0xbc8c483cUL, 0xfebc8fb7UL, 0x3ff652b9UL, + 0xc9a73e09UL, 0xbc9ae3d5UL, 0x82552225UL, 0x3ff66238UL, 0x87591c34UL, + 0xbc9bb609UL, 0xc70833f6UL, 0x3ff671c1UL, 0x586c6134UL, 0xbc8e8732UL, + 0xd44ca973UL, 0x3ff68155UL, 0x44f73e65UL, 0x3c6038aeUL, 0xb19e9538UL, + 0x3ff690f4UL, 0x9aeb445dUL, 0x3c8804bdUL, 0x667f3bcdUL, 0x3ff6a09eUL, + 0x13b26456UL, 0xbc9bdd34UL, 0xfa75173eUL, 0x3ff6b052UL, 0x2c9a9d0eUL, + 0x3c7a38f5UL, 0x750bdabfUL, 0x3ff6c012UL, 0x67ff0b0dUL, 0xbc728956UL, + 0xddd47645UL, 0x3ff6cfdcUL, 0xb6f17309UL, 0x3c9c7aa9UL, 0x3c651a2fUL, + 0x3ff6dfb2UL, 0x683c88abUL, 0xbc6bbe3aUL, 0x98593ae5UL, 0x3ff6ef92UL, + 0x9e1ac8b2UL, 0xbc90b974UL, 0xf9519484UL, 0x3ff6ff7dUL, 0x25860ef6UL, + 0xbc883c0fUL, 0x66f42e87UL, 0x3ff70f74UL, 0xd45aa65fUL, 0x3c59d644UL, + 0xe8ec5f74UL, 0x3ff71f75UL, 0x86887a99UL, 0xbc816e47UL, 0x86ead08aUL, + 0x3ff72f82UL, 0x2cd62c72UL, 0xbc920aa0UL, 0x48a58174UL, 0x3ff73f9aUL, + 0x6c65d53cUL, 0xbc90a8d9UL, 0x35d7cbfdUL, 0x3ff74fbdUL, 0x618a6e1cUL, + 0x3c9047fdUL, 0x564267c9UL, 0x3ff75febUL, 0x57316dd3UL, 0xbc902459UL, + 0xb1ab6e09UL, 0x3ff77024UL, 0x169147f8UL, 0x3c9b7877UL, 0x4fde5d3fUL, + 0x3ff78069UL, 0x0a02162dUL, 0x3c9866b8UL, 0x38ac1cf6UL, 0x3ff790b9UL, + 0x62aadd3eUL, 0x3c9349a8UL, 0x73eb0187UL, 0x3ff7a114UL, 0xee04992fUL, + 0xbc841577UL, 0x0976cfdbUL, 0x3ff7b17bUL, 0x8468dc88UL, 0xbc9bebb5UL, + 0x0130c132UL, 0x3ff7c1edUL, 0xd1164dd6UL, 0x3c9f124cUL, 0x62ff86f0UL, + 0x3ff7d26aUL, 0xfb72b8b4UL, 0x3c91bddbUL, 0x36cf4e62UL, 0x3ff7e2f3UL, + 0xba15797eUL, 0x3c705d02UL, 0x8491c491UL, 0x3ff7f387UL, 0xcf9311aeUL, + 0xbc807f11UL, 0x543e1a12UL, 0x3ff80427UL, 0x626d972bUL, 0xbc927c86UL, + 0xadd106d9UL, 0x3ff814d2UL, 0x0d151d4dUL, 0x3c946437UL, 0x994cce13UL, + 0x3ff82589UL, 0xd41532d8UL, 0xbc9d4c1dUL, 0x1eb941f7UL, 0x3ff8364cUL, + 0x31df2bd5UL, 0x3c999b9aUL, 0x4623c7adUL, 0x3ff8471aUL, 0xa341cdfbUL, + 0xbc88d684UL, 0x179f5b21UL, 0x3ff857f4UL, 0xf8b216d0UL, 0xbc5ba748UL, + 0x9b4492edUL, 0x3ff868d9UL, 0x9bd4f6baUL, 0xbc9fc6f8UL, 0xd931a436UL, + 0x3ff879caUL, 0xd2db47bdUL, 0x3c85d2d7UL, 0xd98a6699UL, 0x3ff88ac7UL, + 0xf37cb53aUL, 0x3c9994c2UL, 0xa478580fUL, 0x3ff89bd0UL, 0x4475202aUL, + 0x3c9d5395UL, 0x422aa0dbUL, 0x3ff8ace5UL, 0x56864b27UL, 0x3c96e9f1UL, + 0xbad61778UL, 0x3ff8be05UL, 0xfc43446eUL, 0x3c9ecb5eUL, 0x16b5448cUL, + 0x3ff8cf32UL, 0x32e9e3aaUL, 0xbc70d55eUL, 0x5e0866d9UL, 0x3ff8e06aUL, + 0x6fc9b2e6UL, 0xbc97114aUL, 0x99157736UL, 0x3ff8f1aeUL, 0xa2e3976cUL, + 0x3c85cc13UL, 0xd0282c8aUL, 0x3ff902feUL, 0x85fe3fd2UL, 0x3c9592caUL, + 0x0b91ffc6UL, 0x3ff9145bUL, 0x2e582524UL, 0xbc9dd679UL, 0x53aa2fe2UL, + 0x3ff925c3UL, 0xa639db7fUL, 0xbc83455fUL, 0xb0cdc5e5UL, 0x3ff93737UL, + 0x81b57ebcUL, 0xbc675fc7UL, 0x2b5f98e5UL, 0x3ff948b8UL, 0x797d2d99UL, + 0xbc8dc3d6UL, 0xcbc8520fUL, 0x3ff95a44UL, 0x96a5f039UL, 0xbc764b7cUL, + 0x9a7670b3UL, 0x3ff96bddUL, 0x7f19c896UL, 0xbc5ba596UL, 0x9fde4e50UL, + 0x3ff97d82UL, 0x7c1b85d1UL, 0xbc9d185bUL, 0xe47a22a2UL, 0x3ff98f33UL, + 0xa24c78ecUL, 0x3c7cabdaUL, 0x70ca07baUL, 0x3ff9a0f1UL, 0x91cee632UL, + 0xbc9173bdUL, 0x4d53fe0dUL, 0x3ff9b2bbUL, 0x4df6d518UL, 0xbc9dd84eUL, + 0x82a3f090UL, 0x3ff9c491UL, 0xb071f2beUL, 0x3c7c7c46UL, 0x194bb8d5UL, + 0x3ff9d674UL, 0xa3dd8233UL, 0xbc9516beUL, 0x19e32323UL, 0x3ff9e863UL, + 0x78e64c6eUL, 0x3c7824caUL, 0x8d07f29eUL, 0x3ff9fa5eUL, 0xaaf1faceUL, + 0xbc84a9ceUL, 0x7b5de565UL, 0x3ffa0c66UL, 0x5d1cd533UL, 0xbc935949UL, + 0xed8eb8bbUL, 0x3ffa1e7aUL, 0xee8be70eUL, 0x3c9c6618UL, 0xec4a2d33UL, + 0x3ffa309bUL, 0x7ddc36abUL, 0x3c96305cUL, 0x80460ad8UL, 0x3ffa42c9UL, + 0x589fb120UL, 0xbc9aa780UL, 0xb23e255dUL, 0x3ffa5503UL, 0xdb8d41e1UL, + 0xbc9d2f6eUL, 0x8af46052UL, 0x3ffa674aUL, 0x30670366UL, 0x3c650f56UL, + 0x1330b358UL, 0x3ffa799eUL, 0xcac563c7UL, 0x3c9bcb7eUL, 0x53c12e59UL, + 0x3ffa8bfeUL, 0xb2ba15a9UL, 0xbc94f867UL, 0x5579fdbfUL, 0x3ffa9e6bUL, + 0x0ef7fd31UL, 0x3c90fac9UL, 0x21356ebaUL, 0x3ffab0e5UL, 0xdae94545UL, + 0x3c889c31UL, 0xbfd3f37aUL, 0x3ffac36bUL, 0xcae76cd0UL, 0xbc8f9234UL, + 0x3a3c2774UL, 0x3ffad5ffUL, 0xb6b1b8e5UL, 0x3c97ef3bUL, 0x995ad3adUL, + 0x3ffae89fUL, 0x345dcc81UL, 0x3c97a1cdUL, 0xe622f2ffUL, 0x3ffafb4cUL, + 0x0f315ecdUL, 0xbc94b2fcUL, 0x298db666UL, 0x3ffb0e07UL, 0x4c80e425UL, + 0xbc9bdef5UL, 0x6c9a8952UL, 0x3ffb20ceUL, 0x4a0756ccUL, 0x3c94dd02UL, + 0xb84f15fbUL, 0x3ffb33a2UL, 0x3084d708UL, 0xbc62805eUL, 0x15b749b1UL, + 0x3ffb4684UL, 0xe9df7c90UL, 0xbc7f763dUL, 0x8de5593aUL, 0x3ffb5972UL, + 0xbbba6de3UL, 0xbc9c71dfUL, 0x29f1c52aUL, 0x3ffb6c6eUL, 0x52883f6eUL, + 0x3c92a8f3UL, 0xf2fb5e47UL, 0x3ffb7f76UL, 0x7e54ac3bUL, 0xbc75584fUL, + 0xf22749e4UL, 0x3ffb928cUL, 0x54cb65c6UL, 0xbc9b7216UL, 0x30a1064aUL, + 0x3ffba5b0UL, 0x0e54292eUL, 0xbc9efcd3UL, 0xb79a6f1fUL, 0x3ffbb8e0UL, + 0xc9696205UL, 0xbc3f52d1UL, 0x904bc1d2UL, 0x3ffbcc1eUL, 0x7a2d9e84UL, + 0x3c823dd0UL, 0xc3f3a207UL, 0x3ffbdf69UL, 0x60ea5b53UL, 0xbc3c2623UL, + 0x5bd71e09UL, 0x3ffbf2c2UL, 0x3f6b9c73UL, 0xbc9efdcaUL, 0x6141b33dUL, + 0x3ffc0628UL, 0xa1fbca34UL, 0xbc8d8a5aUL, 0xdd85529cUL, 0x3ffc199bUL, + 0x895048ddUL, 0x3c811065UL, 0xd9fa652cUL, 0x3ffc2d1cUL, 0x17c8a5d7UL, + 0xbc96e516UL, 0x5fffd07aUL, 0x3ffc40abUL, 0xe083c60aUL, 0x3c9b4537UL, + 0x78fafb22UL, 0x3ffc5447UL, 0x2493b5afUL, 0x3c912f07UL, 0x2e57d14bUL, + 0x3ffc67f1UL, 0xff483cadUL, 0x3c92884dUL, 0x8988c933UL, 0x3ffc7ba8UL, + 0xbe255559UL, 0xbc8e76bbUL, 0x9406e7b5UL, 0x3ffc8f6dUL, 0x48805c44UL, + 0x3c71acbcUL, 0x5751c4dbUL, 0x3ffca340UL, 0xd10d08f5UL, 0xbc87f2beUL, + 0xdcef9069UL, 0x3ffcb720UL, 0xd1e949dbUL, 0x3c7503cbUL, 0x2e6d1675UL, + 0x3ffccb0fUL, 0x86009092UL, 0xbc7d220fUL, 0x555dc3faUL, 0x3ffcdf0bUL, + 0x53829d72UL, 0xbc8dd83bUL, 0x5b5bab74UL, 0x3ffcf315UL, 0xb86dff57UL, + 0xbc9a08e9UL, 0x4a07897cUL, 0x3ffd072dUL, 0x43797a9cUL, 0xbc9cbc37UL, + 0x2b08c968UL, 0x3ffd1b53UL, 0x219a36eeUL, 0x3c955636UL, 0x080d89f2UL, + 0x3ffd2f87UL, 0x719d8578UL, 0xbc9d487bUL, 0xeacaa1d6UL, 0x3ffd43c8UL, + 0xbf5a1614UL, 0x3c93db53UL, 0xdcfba487UL, 0x3ffd5818UL, 0xd75b3707UL, + 0x3c82ed02UL, 0xe862e6d3UL, 0x3ffd6c76UL, 0x4a8165a0UL, 0x3c5fe87aUL, + 0x16c98398UL, 0x3ffd80e3UL, 0x8beddfe8UL, 0xbc911ec1UL, 0x71ff6075UL, + 0x3ffd955dUL, 0xbb9af6beUL, 0x3c9a052dUL, 0x03db3285UL, 0x3ffda9e6UL, + 0x696db532UL, 0x3c9c2300UL, 0xd63a8315UL, 0x3ffdbe7cUL, 0x926b8be4UL, + 0xbc9b76f1UL, 0xf301b460UL, 0x3ffdd321UL, 0x78f018c3UL, 0x3c92da57UL, + 0x641c0658UL, 0x3ffde7d5UL, 0x8e79ba8fUL, 0xbc9ca552UL, 0x337b9b5fUL, + 0x3ffdfc97UL, 0x4f184b5cUL, 0xbc91a5cdUL, 0x6b197d17UL, 0x3ffe1167UL, + 0xbd5c7f44UL, 0xbc72b529UL, 0x14f5a129UL, 0x3ffe2646UL, 0x817a1496UL, + 0xbc97b627UL, 0x3b16ee12UL, 0x3ffe3b33UL, 0x31fdc68bUL, 0xbc99f4a4UL, + 0xe78b3ff6UL, 0x3ffe502eUL, 0x80a9cc8fUL, 0x3c839e89UL, 0x24676d76UL, + 0x3ffe6539UL, 0x7522b735UL, 0xbc863ff8UL, 0xfbc74c83UL, 0x3ffe7a51UL, + 0xca0c8de2UL, 0x3c92d522UL, 0x77cdb740UL, 0x3ffe8f79UL, 0x80b054b1UL, + 0xbc910894UL, 0xa2a490daUL, 0x3ffea4afUL, 0x179c2893UL, 0xbc9e9c23UL, + 0x867cca6eUL, 0x3ffeb9f4UL, 0x2293e4f2UL, 0x3c94832fUL, 0x2d8e67f1UL, + 0x3ffecf48UL, 0xb411ad8cUL, 0xbc9c93f3UL, 0xa2188510UL, 0x3ffee4aaUL, + 0xa487568dUL, 0x3c91c68dUL, 0xee615a27UL, 0x3ffefa1bUL, 0x86a4b6b0UL, + 0x3c9dc7f4UL, 0x1cb6412aUL, 0x3fff0f9cUL, 0x65181d45UL, 0xbc932200UL, + 0x376bba97UL, 0x3fff252bUL, 0xbf0d8e43UL, 0x3c93a1a5UL, 0x48dd7274UL, + 0x3fff3ac9UL, 0x3ed837deUL, 0xbc795a5aUL, 0x5b6e4540UL, 0x3fff5076UL, + 0x2dd8a18bUL, 0x3c99d3e1UL, 0x798844f8UL, 0x3fff6632UL, 0x3539343eUL, + 0x3c9fa37bUL, 0xad9cbe14UL, 0x3fff7bfdUL, 0xd006350aUL, 0xbc9dbb12UL, + 0x02243c89UL, 0x3fff91d8UL, 0xa779f689UL, 0xbc612ea8UL, 0x819e90d8UL, + 0x3fffa7c1UL, 0xf3a5931eUL, 0x3c874853UL, 0x3692d514UL, 0x3fffbdbaUL, + 0x15098eb6UL, 0xbc796773UL, 0x2b8f71f1UL, 0x3fffd3c2UL, 0x966579e7UL, + 0x3c62eb74UL, 0x6b2a23d9UL, 0x3fffe9d9UL, 0x7442fde3UL, 0x3c74a603UL, + 0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL, 0x6fba4e77UL, + 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL, 0xfefa39efUL, 0x3fe62e42UL, + 0x00000000UL, 0x00000000UL, 0xfefa39efUL, 0x3fe62e42UL, 0xfefa39efUL, + 0xbfe62e42UL, 0xf8000000UL, 0xffffffffUL, 0xf8000000UL, 0xffffffffUL, + 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x00000000UL + +}; + +//registers, +// input: xmm0, xmm1 +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// eax, edx, ecx, ebx + +// Code generated by Intel C compiler for LIBM library + +void MacroAssembler::fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; + Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, L_2TAG_PACKET_14_0_2, L_2TAG_PACKET_15_0_2; + Label L_2TAG_PACKET_16_0_2, L_2TAG_PACKET_17_0_2, L_2TAG_PACKET_18_0_2, L_2TAG_PACKET_19_0_2; + Label L_2TAG_PACKET_20_0_2, L_2TAG_PACKET_21_0_2, L_2TAG_PACKET_22_0_2, L_2TAG_PACKET_23_0_2; + Label L_2TAG_PACKET_24_0_2, L_2TAG_PACKET_25_0_2, L_2TAG_PACKET_26_0_2, L_2TAG_PACKET_27_0_2; + Label L_2TAG_PACKET_28_0_2, L_2TAG_PACKET_29_0_2, L_2TAG_PACKET_30_0_2, L_2TAG_PACKET_31_0_2; + Label L_2TAG_PACKET_32_0_2, L_2TAG_PACKET_33_0_2, L_2TAG_PACKET_34_0_2, L_2TAG_PACKET_35_0_2; + Label L_2TAG_PACKET_36_0_2, L_2TAG_PACKET_37_0_2, L_2TAG_PACKET_38_0_2, L_2TAG_PACKET_39_0_2; + Label L_2TAG_PACKET_40_0_2, L_2TAG_PACKET_41_0_2, L_2TAG_PACKET_42_0_2, L_2TAG_PACKET_43_0_2; + Label L_2TAG_PACKET_44_0_2, L_2TAG_PACKET_45_0_2, L_2TAG_PACKET_46_0_2, L_2TAG_PACKET_47_0_2; + Label L_2TAG_PACKET_48_0_2, L_2TAG_PACKET_49_0_2, L_2TAG_PACKET_50_0_2, L_2TAG_PACKET_51_0_2; + Label L_2TAG_PACKET_52_0_2, L_2TAG_PACKET_53_0_2, L_2TAG_PACKET_54_0_2, L_2TAG_PACKET_55_0_2; + Label L_2TAG_PACKET_56_0_2, L_2TAG_PACKET_57_0_2, L_2TAG_PACKET_58_0_2, start; + + assert_different_registers(tmp, eax, ecx, edx); + + address static_const_table_pow = (address)_static_const_table_pow; + + bind(start); + subl(rsp, 120); + movl(Address(rsp, 64), tmp); + lea(tmp, ExternalAddress(static_const_table_pow)); + movsd(xmm0, Address(rsp, 128)); + movsd(xmm1, Address(rsp, 136)); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movl(ecx, 1069088768); + movdl(xmm7, ecx); + movsd(Address(rsp, 16), xmm1); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(Address(rsp, 8), xmm0); + movdqu(xmm3, xmm0); + movl(edx, 8192); + movdl(xmm4, edx); + movdqu(xmm6, Address(tmp, 8240)); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + addl(ecx, 16); + bsrl(ecx, ecx); + psrlq(xmm3, 12); + movl(Address(rsp, 24), rsi); + subl(eax, 16); + cmpl(eax, 32736); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); + movl(rsi, 0); + + bind(L_2TAG_PACKET_1_0_2); + mulss(xmm0, xmm7); + movl(edx, -1); + subl(ecx, 4); + shll(edx); + movdl(xmm5, edx); + por(xmm3, xmm1); + subl(eax, 16351); + cmpl(eax, 1); + jcc(Assembler::belowEqual, L_2TAG_PACKET_2_0_2); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + + bind(L_2TAG_PACKET_3_0_2); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + subl(eax, 1); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + + bind(L_2TAG_PACKET_4_0_2); + mulsd(xmm3, xmm0); + movdqu(xmm1, Address(tmp, 8272)); + subsd(xmm5, xmm2); + movdqu(xmm4, Address(tmp, 8288)); + movl(ecx, eax); + sarl(eax, 31); + addl(ecx, eax); + xorl(eax, ecx); + addl(eax, 1); + bsrl(eax, eax); + unpcklpd(xmm5, xmm3); + movdqu(xmm6, Address(tmp, 8304)); + addsd(xmm3, xmm5); + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm5, Address(tmp, edx, Address::times_1, -3616)); + movdqu(xmm0, Address(tmp, 8320)); + pshufd(xmm2, xmm3, 68); + mulsd(xmm3, xmm3); + mulpd(xmm1, xmm2); + mulpd(xmm4, xmm2); + addsd(xmm5, xmm7); + mulsd(xmm2, xmm3); + addpd(xmm6, xmm1); + mulsd(xmm3, xmm3); + addpd(xmm0, xmm4); + movsd(xmm1, Address(rsp, 16)); + movzwl(ecx, Address(rsp, 22)); + pshufd(xmm7, xmm5, 238); + movsd(xmm4, Address(tmp, 8368)); + mulpd(xmm6, xmm2); + pshufd(xmm3, xmm3, 68); + mulpd(xmm0, xmm2); + shll(eax, 4); + subl(eax, 15872); + andl(ecx, 32752); + addl(eax, ecx); + mulpd(xmm3, xmm6); + cmpl(eax, 624); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_5_0_2); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm1, xmm5); + movdqu(xmm7, xmm6); + addsd(xmm6, xmm4); + addpd(xmm3, xmm0); + movdl(edx, xmm6); + subsd(xmm6, xmm7); + pshufd(xmm0, xmm3, 238); + subsd(xmm4, xmm6); + addsd(xmm0, xmm3); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); + addsd(xmm4, xmm1); + mulsd(xmm2, xmm0); + movdqu(xmm7, Address(tmp, 12480)); + movdqu(xmm3, Address(tmp, 12496)); + shll(ecx, 12); + xorl(ecx, rsi); + andl(ecx, -1048576); + movdl(xmm6, ecx); + addsd(xmm2, xmm4); + movsd(xmm1, Address(tmp, 12512)); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulpd(xmm0, xmm0); + movl(rsi, Address(rsp, 24)); + mulpd(xmm7, xmm4); + pshufd(xmm6, xmm6, 17); + mulsd(xmm1, xmm2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm1, xmm6); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm1); + addsd(xmm0, xmm3); + addsd(xmm0, xmm5); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 128)); + movsd(xmm1, Address(rsp, 136)); + mulsd(xmm0, xmm1); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_0_0_2); + addl(eax, 16); + movl(edx, 32752); + andl(edx, eax); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_9_0_2); + + bind(L_2TAG_PACKET_10_0_2); + movl(ecx, Address(rsp, 16)); + xorl(edx, edx); + testl(ecx, ecx); + movl(ecx, 1); + cmovl(Assembler::notEqual, edx, ecx); + orl(edx, Address(rsp, 20)); + cmpl(edx, 1072693248); + jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, Address(tmp, 8240)); + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(rsi, 0); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_12_0_2); + movl(ecx, Address(rsp, 16)); + xorl(edx, edx); + testl(ecx, ecx); + movl(ecx, 1); + cmovl(Assembler::notEqual, edx, ecx); + orl(edx, Address(rsp, 20)); + cmpl(edx, 1072693248); + jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, Address(tmp, 8240)); + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(rsi, INT_MIN); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_5_0_2); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_13_0_2); + cmpl(eax, 752); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_14_0_2); + + bind(L_2TAG_PACKET_15_0_2); + addsd(xmm0, xmm7); + movsd(xmm2, Address(tmp, 12544)); + addpd(xmm3, xmm0); + xorpd(xmm6, xmm6); + movl(eax, 17080); + pinsrw(xmm6, eax, 3); + pshufd(xmm0, xmm3, 238); + addsd(xmm0, xmm3); + movdqu(xmm3, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm4, xmm2); + subsd(xmm3, xmm5); + movdqu(xmm7, xmm5); + pand(xmm5, xmm2); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm7, xmm5); + addsd(xmm0, xmm3); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm2, xmm0); + movdqu(xmm7, xmm6); + mulsd(xmm1, xmm5); + addsd(xmm6, xmm4); + movdl(eax, xmm6); + subsd(xmm6, xmm7); + addsd(xmm2, xmm1); + movdqu(xmm7, Address(tmp, 12480)); + movdqu(xmm3, Address(tmp, 12496)); + subsd(xmm4, xmm6); + pextrw(edx, xmm6, 3); + movl(ecx, eax); + andl(eax, 255); + addl(eax, eax); + movdqu(xmm5, Address(tmp, eax, Address::times_8, 8384)); + addsd(xmm2, xmm4); + sarl(ecx, 8); + movl(eax, ecx); + sarl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + xorl(ecx, rsi); + movdl(xmm6, ecx); + movsd(xmm1, Address(tmp, 12512)); + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_14_0_2); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm4); + pshufd(xmm6, xmm6, 17); + mulsd(xmm1, xmm2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm1, xmm6); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + shll(eax, 4); + xorpd(xmm4, xmm4); + addl(eax, 16368); + pinsrw(xmm4, eax, 3); + addsd(xmm0, xmm1); + movl(rsi, Address(rsp, 24)); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_18_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_8_0_2); + movsd(xmm1, Address(rsp, 16)); + movsd(xmm0, Address(rsp, 8)); + movdqu(xmm2, xmm0); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_19_0_2); + addsd(xmm0, xmm0); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_20_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_20_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(edx, 29); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_22_0_2); + movsd(xmm0, Address(rsp, 16)); + addpd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_19_0_2); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_23_0_2); + pextrw(eax, xmm2, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_24_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + + bind(L_2TAG_PACKET_24_0_2); + pextrw(eax, xmm0, 3); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_25_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_27_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); + testl(eax, 2); + jcc(Assembler::notEqual, L_2TAG_PACKET_29_0_2); + jmp(L_2TAG_PACKET_28_0_2); + + bind(L_2TAG_PACKET_25_0_2); + shrl(ecx, 20); + andl(ecx, 2047); + cmpl(ecx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_28_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_30_0_2); + cmpl(ecx, 1074); + jcc(Assembler::above, L_2TAG_PACKET_27_0_2); + cmpl(ecx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_28_0_2); + movsd(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); + + bind(L_2TAG_PACKET_29_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_18_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32768); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_28_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); + + bind(L_2TAG_PACKET_31_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32752); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_30_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); + jmp(L_2TAG_PACKET_29_0_2); + + bind(L_2TAG_PACKET_32_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 20); + movdl(edx, xmm1); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_33_0_2); + movsd(xmm0, Address(rsp, 16)); + addsd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_33_0_2); + movsd(xmm0, Address(rsp, 8)); + pextrw(eax, xmm0, 3); + cmpl(eax, 49136); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + movdl(ecx, xmm0); + psrlq(xmm0, 20); + movdl(edx, xmm0); + orl(ecx, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_34_0_2); + movsd(xmm1, Address(rsp, 16)); + andl(eax, 32752); + subl(eax, 16368); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + xorl(eax, edx); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + movl(ecx, 32752); + pinsrw(xmm0, ecx, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_35_0_2); + movdl(eax, xmm1); + cmpl(edx, 17184); + jcc(Assembler::above, L_2TAG_PACKET_36_0_2); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); + testl(eax, 2); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + jmp(L_2TAG_PACKET_39_0_2); + + bind(L_2TAG_PACKET_36_0_2); + testl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + jmp(L_2TAG_PACKET_39_0_2); + + bind(L_2TAG_PACKET_9_0_2); + movsd(xmm2, Address(rsp, 8)); + movdl(eax, xmm2); + psrlq(xmm2, 31); + movdl(ecx, xmm2); + orl(eax, ecx); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(edx, xmm1, 3); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm2, 32); + movdl(ecx, xmm2); + addl(ecx, ecx); + orl(ecx, eax); + jcc(Assembler::equal, L_2TAG_PACKET_40_0_2); + andl(edx, 32752); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_32_0_2); + cmpl(edx, 17200); + jcc(Assembler::above, L_2TAG_PACKET_38_0_2); + cmpl(edx, 17184); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_35_0_2); + cmpl(edx, 16368); + jcc(Assembler::below, L_2TAG_PACKET_37_0_2); + movl(eax, 17208); + xorpd(xmm2, xmm2); + pinsrw(xmm2, eax, 3); + movdqu(xmm4, xmm2); + addsd(xmm2, xmm1); + subsd(xmm4, xmm2); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32767); + jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); + movdl(eax, xmm2); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + + bind(L_2TAG_PACKET_39_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(xmm2, Address(tmp, 8256)); + movsd(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_12_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(rsi, INT_MIN); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_37_0_2); + xorpd(xmm1, xmm1); + movl(eax, 32752); + pinsrw(xmm1, eax, 3); + xorpd(xmm0, xmm0); + mulsd(xmm0, xmm1); + movl(edx, 28); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_38_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(xmm2, Address(tmp, 8256)); + movsd(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_10_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(rsi, 0); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_23_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_26_0_2); + xorpd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_13_0_2); + addl(eax, 384); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_41_0_2); + mulsd(xmm5, xmm1); + addsd(xmm0, xmm7); + shrl(rsi, 31); + addpd(xmm3, xmm0); + pshufd(xmm0, xmm3, 238); + addsd(xmm3, xmm0); + movsd(xmm4, Address(tmp, rsi, Address::times_8, 12528)); + mulsd(xmm1, xmm3); + xorpd(xmm0, xmm0); + movl(eax, 16368); + shll(rsi, 15); + orl(eax, rsi); + pinsrw(xmm0, eax, 3); + addsd(xmm5, xmm1); + movl(rsi, Address(rsp, 24)); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_41_0_2); + movl(rsi, Address(rsp, 24)); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_40_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_42_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(edx, 26); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_11_0_2); + movsd(xmm1, Address(rsp, 16)); + movdqu(xmm2, xmm1); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_43_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + + bind(L_2TAG_PACKET_43_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_42_0_2); + shrl(edx, 21); + cmpl(edx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_44_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_45_0_2); + cmpl(edx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_44_0_2); + movsd(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_44_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_44_0_2); + + bind(L_2TAG_PACKET_46_0_2); + movsd(xmm0, Address(rsp, 8)); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_47_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_45_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_46_0_2); + + bind(L_2TAG_PACKET_44_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_26_0_2); + xorpd(xmm0, xmm0); + + bind(L_2TAG_PACKET_47_0_2); + movl(eax, 16368); + xorpd(xmm1, xmm1); + pinsrw(xmm1, eax, 3); + divsd(xmm1, xmm0); + movdqu(xmm0, xmm1); + movl(edx, 27); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_14_0_2); + movsd(xmm2, Address(rsp, 8)); + movsd(xmm6, Address(rsp, 16)); + pextrw(eax, xmm2, 3); + pextrw(edx, xmm6, 3); + movl(ecx, 32752); + andl(ecx, edx); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); + andl(eax, 32752); + subl(eax, 16368); + xorl(edx, eax); + testl(edx, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_49_0_2); + + bind(L_2TAG_PACKET_50_0_2); + movl(eax, 32736); + pinsrw(xmm0, eax, 3); + shrl(rsi, 16); + orl(eax, rsi); + pinsrw(xmm1, eax, 3); + movl(rsi, Address(rsp, 24)); + mulsd(xmm0, xmm1); + + bind(L_2TAG_PACKET_17_0_2); + movl(edx, 24); + + bind(L_2TAG_PACKET_21_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_49_0_2); + movl(eax, 16); + pinsrw(xmm0, eax, 3); + mulsd(xmm0, xmm0); + testl(rsi, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_51_0_2); + movsd(xmm2, Address(tmp, 12560)); + xorpd(xmm0, xmm2); + + bind(L_2TAG_PACKET_51_0_2); + movl(rsi, Address(rsp, 24)); + movl(edx, 25); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_16_0_2); + pextrw(ecx, xmm5, 3); + pextrw(edx, xmm4, 3); + movl(eax, -1); + andl(ecx, 32752); + subl(ecx, 16368); + andl(edx, 32752); + addl(edx, ecx); + movl(ecx, -31); + sarl(edx, 4); + subl(ecx, edx); + jcc(Assembler::lessEqual, L_2TAG_PACKET_52_0_2); + cmpl(ecx, 20); + jcc(Assembler::above, L_2TAG_PACKET_53_0_2); + shll(eax); + + bind(L_2TAG_PACKET_52_0_2); + movdl(xmm0, eax); + psllq(xmm0, 32); + pand(xmm0, xmm5); + subsd(xmm5, xmm0); + addsd(xmm5, xmm1); + mulsd(xmm0, xmm4); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + + bind(L_2TAG_PACKET_53_0_2); + movl(edx, 25); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movzwl(ecx, Address(rsp, 22)); + movl(edx, INT_MIN); + movdl(xmm1, edx); + xorpd(xmm7, xmm7); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + paddq(xmm1, xmm3); + pand(xmm5, xmm1); + andl(ecx, 32752); + cmpl(ecx, 16560); + jcc(Assembler::below, L_2TAG_PACKET_3_0_2); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + addl(eax, 16351); + shrl(eax, 4); + subl(eax, 1022); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + movsd(xmm4, Address(tmp, 0)); + mulsd(xmm3, xmm0); + movsd(xmm6, Address(tmp, 0)); + subsd(xmm5, xmm2); + movsd(xmm1, Address(tmp, 8)); + pshufd(xmm2, xmm3, 68); + unpcklpd(xmm5, xmm3); + addsd(xmm3, xmm5); + movsd(xmm0, Address(tmp, 8)); + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm7, Address(tmp, edx, Address::times_1, -3616)); + mulsd(xmm4, xmm5); + mulsd(xmm0, xmm5); + mulsd(xmm6, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm2, xmm5); + mulsd(xmm4, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm0, xmm7); + addsd(xmm2, xmm3); + addsd(xmm7, xmm5); + mulsd(xmm6, xmm2); + subsd(xmm0, xmm7); + movdqu(xmm2, xmm7); + addsd(xmm7, xmm4); + addsd(xmm0, xmm5); + subsd(xmm2, xmm7); + addsd(xmm4, xmm2); + pshufd(xmm2, xmm5, 238); + movdqu(xmm5, xmm7); + addsd(xmm7, xmm2); + addsd(xmm4, xmm0); + movdqu(xmm0, Address(tmp, 8272)); + subsd(xmm5, xmm7); + addsd(xmm6, xmm4); + movdqu(xmm4, xmm7); + addsd(xmm5, xmm2); + addsd(xmm7, xmm1); + movdqu(xmm2, Address(tmp, 8336)); + subsd(xmm4, xmm7); + addsd(xmm6, xmm5); + addsd(xmm4, xmm1); + pshufd(xmm5, xmm7, 238); + movdqu(xmm1, xmm7); + addsd(xmm7, xmm5); + subsd(xmm1, xmm7); + addsd(xmm1, xmm5); + movdqu(xmm5, Address(tmp, 8352)); + pshufd(xmm3, xmm3, 68); + addsd(xmm6, xmm4); + addsd(xmm6, xmm1); + movdqu(xmm1, Address(tmp, 8304)); + mulpd(xmm0, xmm3); + mulpd(xmm2, xmm3); + pshufd(xmm4, xmm3, 68); + mulpd(xmm3, xmm3); + addpd(xmm0, xmm1); + addpd(xmm5, xmm2); + mulsd(xmm4, xmm3); + movsd(xmm2, Address(tmp, 16)); + mulpd(xmm3, xmm3); + movsd(xmm1, Address(rsp, 16)); + movzwl(ecx, Address(rsp, 22)); + mulpd(xmm0, xmm4); + pextrw(eax, xmm7, 3); + mulpd(xmm5, xmm4); + mulpd(xmm0, xmm3); + movsd(xmm4, Address(tmp, 8376)); + pand(xmm2, xmm7); + addsd(xmm5, xmm6); + subsd(xmm7, xmm2); + addpd(xmm5, xmm0); + andl(eax, 32752); + subl(eax, 16368); + andl(ecx, 32752); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); + addl(ecx, eax); + cmpl(ecx, 16576); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_54_0_2); + pshufd(xmm0, xmm5, 238); + pand(xmm4, xmm1); + movdqu(xmm3, xmm1); + addsd(xmm5, xmm0); + subsd(xmm1, xmm4); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + addsd(xmm7, xmm5); + mulsd(xmm4, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm5, xmm6); + mulsd(xmm3, xmm7); + addsd(xmm6, xmm4); + addsd(xmm1, xmm3); + movdqu(xmm7, Address(tmp, 12480)); + movdl(edx, xmm6); + subsd(xmm6, xmm5); + movdqu(xmm3, Address(tmp, 12496)); + movsd(xmm2, Address(tmp, 12512)); + subsd(xmm4, xmm6); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); + addsd(xmm4, xmm1); + pextrw(edx, xmm6, 3); + shrl(ecx, 8); + movl(eax, ecx); + shrl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + movdl(xmm6, ecx); + pshufd(xmm0, xmm4, 68); + pshufd(xmm1, xmm4, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm1); + pshufd(xmm6, xmm6, 17); + mulsd(xmm2, xmm4); + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_14_0_2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm2, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm2, xmm6); + pshufd(xmm3, xmm0, 238); + addl(eax, 1023); + shll(eax, 20); + orl(eax, rsi); + movdl(xmm4, eax); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm2); + psllq(xmm4, 32); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + movl(rsi, Address(rsp, 24)); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_55_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_48_0_2); + movl(rsi, Address(rsp, 24)); + + bind(L_2TAG_PACKET_56_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm1, Address(rsp, 16)); + addsd(xmm1, xmm1); + xorpd(xmm2, xmm2); + movl(eax, 49136); + pinsrw(xmm2, eax, 3); + addsd(xmm2, xmm0); + pextrw(eax, xmm2, 3); + cmpl(eax, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_57_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_57_0_2); + movdl(edx, xmm1); + movdqu(xmm3, xmm1); + psrlq(xmm3, 20); + movdl(ecx, xmm3); + orl(ecx, edx); + jcc(Assembler::equal, L_2TAG_PACKET_58_0_2); + addsd(xmm1, xmm1); + movdqu(xmm0, xmm1); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_58_0_2); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + subl(eax, 16368); + xorl(eax, edx); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + movl(edx, 32752); + pinsrw(xmm0, edx, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_54_0_2); + pextrw(eax, xmm1, 3); + pextrw(ecx, xmm2, 3); + xorl(eax, ecx); + testl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_50_0_2); + jmp(L_2TAG_PACKET_49_0_2); + + bind(L_2TAG_PACKET_6_0_2); + movl(tmp, Address(rsp, 64)); + +} + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - SIN() +// --------------------- +// +// 1. RANGE REDUCTION +// +// We perform an initial range reduction from X to r with +// +// X =~= N * pi/32 + r +// +// so that |r| <= pi/64 + epsilon. We restrict inputs to those +// where |N| <= 932560. Beyond this, the range reduction is +// insufficiently accurate. For extremely small inputs, +// denormalization can occur internally, impacting performance. +// This means that the main path is actually only taken for +// 2^-252 <= |X| < 90112. +// +// To avoid branches, we perform the range reduction to full +// accuracy each time. +// +// X - N * (P_1 + P_2 + P_3) +// +// where P_1 and P_2 are 32-bit numbers (so multiplication by N +// is exact) and P_3 is a 53-bit number. Together, these +// approximate pi well enough for all cases in the restricted +// range. +// +// The main reduction sequence is: +// +// y = 32/pi * x +// N = integer(y) +// (computed by adding and subtracting off SHIFTER) +// +// m_1 = N * P_1 +// m_2 = N * P_2 +// r_1 = x - m_1 +// r = r_1 - m_2 +// (this r can be used for most of the calculation) +// +// c_1 = r_1 - r +// m_3 = N * P_3 +// c_2 = c_1 - m_2 +// c = c_2 - m_3 +// +// 2. MAIN ALGORITHM +// +// The algorithm uses a table lookup based on B = M * pi / 32 +// where M = N mod 64. The stored values are: +// sigma closest power of 2 to cos(B) +// C_hl 53-bit cos(B) - sigma +// S_hi + S_lo 2 * 53-bit sin(B) +// +// The computation is organized as follows: +// +// sin(B + r + c) = [sin(B) + sigma * r] + +// r * (cos(B) - sigma) + +// sin(B) * [cos(r + c) - 1] + +// cos(B) * [sin(r + c) - r] +// +// which is approximately: +// +// [S_hi + sigma * r] + +// C_hl * r + +// S_lo + S_hi * [(cos(r) - 1) - r * c] + +// (C_hl + sigma) * [(sin(r) - r) + c] +// +// and this is what is actually computed. We separate this sum +// into four parts: +// +// hi + med + pols + corr +// +// where +// +// hi = S_hi + sigma r +// med = C_hl * r +// pols = S_hi * (cos(r) - 1) + (C_hl + sigma) * (sin(r) - r) +// corr = S_lo + c * ((C_hl + sigma) - S_hi * r) +// +// 3. POLYNOMIAL +// +// The polynomial S_hi * (cos(r) - 1) + (C_hl + sigma) * +// (sin(r) - r) can be rearranged freely, since it is quite +// small, so we exploit parallelism to the fullest. +// +// psc4 = SC_4 * r_1 +// msc4 = psc4 * r +// r2 = r * r +// msc2 = SC_2 * r2 +// r4 = r2 * r2 +// psc3 = SC_3 + msc4 +// psc1 = SC_1 + msc2 +// msc3 = r4 * psc3 +// sincospols = psc1 + msc3 +// pols = sincospols * +// +// +// 4. CORRECTION TERM +// +// This is where the "c" component of the range reduction is +// taken into account; recall that just "r" is used for most of +// the calculation. +// +// -c = m_3 - c_2 +// -d = S_hi * r - (C_hl + sigma) +// corr = -c * -d + S_lo +// +// 5. COMPENSATED SUMMATIONS +// +// The two successive compensated summations add up the high +// and medium parts, leaving just the low parts to add up at +// the end. +// +// rs = sigma * r +// res_int = S_hi + rs +// k_0 = S_hi - res_int +// k_2 = k_0 + rs +// med = C_hl * r +// res_hi = res_int + med +// k_1 = res_int - res_hi +// k_3 = k_1 + med +// +// 6. FINAL SUMMATION +// +// We now add up all the small parts: +// +// res_lo = pols(hi) + pols(lo) + corr + k_1 + k_3 +// +// Now the overall result is just: +// +// res_hi + res_lo +// +// 7. SMALL ARGUMENTS +// +// If |x| < SNN (SNN meaning the smallest normal number), we +// simply perform 0.1111111 cdots 1111 * x. For SNN <= |x|, we +// do 2^-55 * (2^55 * x - x). +// +// Special cases: +// sin(NaN) = quiet NaN, and raise invalid exception +// sin(INF) = NaN and raise invalid exception +// sin(+/-0) = +/-0 +// +/******************************************************************************/ + +ALIGNED_(8) juint _zero_none[] = +{ + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0xbff00000UL +}; + +ALIGNED_(4) juint __4onpi_d[] = +{ + 0x6dc9c883UL, 0x3ff45f30UL +}; + +ALIGNED_(4) juint _TWO_32H[] = +{ + 0x00000000UL, 0x41f80000UL +}; + +ALIGNED_(4) juint _pi04_3d[] = +{ + 0x54442d00UL, 0x3fe921fbUL, 0x98cc5180UL, 0x3ce84698UL, 0xcbb5bf6cUL, + 0xb9dfc8f8UL +}; + +ALIGNED_(4) juint _pi04_5d[] = +{ + 0x54400000UL, 0x3fe921fbUL, 0x1a600000UL, 0x3dc0b461UL, 0x2e000000UL, + 0x3b93198aUL, 0x25200000UL, 0x396b839aUL, 0x533e63a0UL, 0x37027044UL +}; + +ALIGNED_(4) juint _SCALE[] = +{ + 0x00000000UL, 0x32600000UL +}; + +ALIGNED_(4) juint _zeros[] = +{ + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x80000000UL +}; + +ALIGNED_(4) juint _pi04_2d[] = +{ + 0x54400000UL, 0x3fe921fbUL, 0x1a626331UL, 0x3dc0b461UL +}; + +ALIGNED_(4) juint _TWO_12H[] = +{ + 0x00000000UL, 0x40b80000UL +}; + +ALIGNED_(2) jushort __4onpi_31l[] = +{ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x836e, 0xa2f9, + 0x40d8, 0x0000, 0x0000, 0x0000, 0x2a50, 0x9c88, 0x40b7, 0x0000, 0x0000, 0x0000, + 0xabe8, 0xfe13, 0x4099, 0x0000, 0x0000, 0x0000, 0x6ee0, 0xfa9a, 0x4079, 0x0000, + 0x0000, 0x0000, 0x9580, 0xdb62, 0x4058, 0x0000, 0x0000, 0x0000, 0x1c82, 0xc9e2, + 0x403d, 0x0000, 0x0000, 0x0000, 0xb1c0, 0xff28, 0x4019, 0x0000, 0x0000, 0x0000, + 0xef14, 0xaf7a, 0x3ffe, 0x0000, 0x0000, 0x0000, 0x48dc, 0xc36e, 0x3fdf, 0x0000, + 0x0000, 0x0000, 0x3740, 0xe909, 0x3fbe, 0x0000, 0x0000, 0x0000, 0x924a, 0xb801, + 0x3fa2, 0x0000, 0x0000, 0x0000, 0x3a32, 0xdd41, 0x3f83, 0x0000, 0x0000, 0x0000, + 0x8778, 0x873f, 0x3f62, 0x0000, 0x0000, 0x0000, 0x1298, 0xb1cb, 0x3f44, 0x0000, + 0x0000, 0x0000, 0xa208, 0x9cfb, 0x3f26, 0x0000, 0x0000, 0x0000, 0xbaec, 0xd7d4, + 0x3f06, 0x0000, 0x0000, 0x0000, 0xd338, 0x8909, 0x3ee7, 0x0000, 0x0000, 0x0000, + 0x68b8, 0xe04d, 0x3ec7, 0x0000, 0x0000, 0x0000, 0x4e64, 0xdf90, 0x3eaa, 0x0000, + 0x0000, 0x0000, 0xc1a8, 0xeb1c, 0x3e89, 0x0000, 0x0000, 0x0000, 0x2720, 0xce7d, + 0x3e6a, 0x0000, 0x0000, 0x0000, 0x77b8, 0x8bf1, 0x3e4b, 0x0000, 0x0000, 0x0000, + 0xec7e, 0xe4a0, 0x3e2e, 0x0000, 0x0000, 0x0000, 0xffbc, 0xf12f, 0x3e0f, 0x0000, + 0x0000, 0x0000, 0xfdc0, 0xb301, 0x3deb, 0x0000, 0x0000, 0x0000, 0xc5ac, 0x9788, + 0x3dd1, 0x0000, 0x0000, 0x0000, 0x47da, 0x829b, 0x3db2, 0x0000, 0x0000, 0x0000, + 0xd9e4, 0xa6cf, 0x3d93, 0x0000, 0x0000, 0x0000, 0x36e8, 0xf961, 0x3d73, 0x0000, + 0x0000, 0x0000, 0xf668, 0xf463, 0x3d54, 0x0000, 0x0000, 0x0000, 0x5168, 0xf2ff, + 0x3d35, 0x0000, 0x0000, 0x0000, 0x758e, 0xea4f, 0x3d17, 0x0000, 0x0000, 0x0000, + 0xf17a, 0xebe5, 0x3cf8, 0x0000, 0x0000, 0x0000, 0x9cfa, 0x9e83, 0x3cd9, 0x0000, + 0x0000, 0x0000, 0xa4ba, 0xe294, 0x3cba, 0x0000, 0x0000, 0x0000, 0xd7ec, 0x9afe, + 0x3c9a, 0x0000, 0x0000, 0x0000, 0xae80, 0x8fc6, 0x3c79, 0x0000, 0x0000, 0x0000, + 0x3304, 0x8560, 0x3c5c, 0x0000, 0x0000, 0x0000, 0x6d70, 0xdf8f, 0x3c3b, 0x0000, + 0x0000, 0x0000, 0x3ef0, 0xafc3, 0x3c1e, 0x0000, 0x0000, 0x0000, 0xd0d8, 0x826b, + 0x3bfe, 0x0000, 0x0000, 0x0000, 0x1c80, 0xed4f, 0x3bdd, 0x0000, 0x0000, 0x0000, + 0x730c, 0xb0af, 0x3bc1, 0x0000, 0x0000, 0x0000, 0x6660, 0xc219, 0x3ba2, 0x0000, + 0x0000, 0x0000, 0x940c, 0xabe2, 0x3b83, 0x0000, 0x0000, 0x0000, 0xdffc, 0x8408, + 0x3b64, 0x0000, 0x0000, 0x0000, 0x6b98, 0xc402, 0x3b45, 0x0000, 0x0000, 0x0000, + 0x1818, 0x9cc4, 0x3b26, 0x0000, 0x0000, 0x0000, 0x5390, 0xaab6, 0x3b05, 0x0000, + 0x0000, 0x0000, 0xb070, 0xd464, 0x3ae9, 0x0000, 0x0000, 0x0000, 0x231a, 0x9ef0, + 0x3aca, 0x0000, 0x0000, 0x0000, 0x0670, 0xd1f1, 0x3aaa, 0x0000, 0x0000, 0x0000, + 0x7738, 0xd9f3, 0x3a8a, 0x0000, 0x0000, 0x0000, 0xa834, 0x8092, 0x3a6c, 0x0000, + 0x0000, 0x0000, 0xb45c, 0xce23, 0x3a4d, 0x0000, 0x0000, 0x0000, 0x36e8, 0xb0e5, + 0x3a2d, 0x0000, 0x0000, 0x0000, 0xd156, 0xaf44, 0x3a10, 0x0000, 0x0000, 0x0000, + 0x9f52, 0x8c82, 0x39f1, 0x0000, 0x0000, 0x0000, 0x829c, 0xff83, 0x39d1, 0x0000, + 0x0000, 0x0000, 0x7d06, 0xefc6, 0x39b3, 0x0000, 0x0000, 0x0000, 0x93e0, 0xb0b7, + 0x3992, 0x0000, 0x0000, 0x0000, 0xedde, 0xc193, 0x3975, 0x0000, 0x0000, 0x0000, + 0xbbc0, 0xcf49, 0x3952, 0x0000, 0x0000, 0x0000, 0xbdf0, 0xd63c, 0x3937, 0x0000, + 0x0000, 0x0000, 0x1f34, 0x9f3a, 0x3918, 0x0000, 0x0000, 0x0000, 0x3f8e, 0xe579, + 0x38f9, 0x0000, 0x0000, 0x0000, 0x90c8, 0xc3f8, 0x38d9, 0x0000, 0x0000, 0x0000, + 0x48c0, 0xf8f8, 0x38b7, 0x0000, 0x0000, 0x0000, 0xed56, 0xafa6, 0x389c, 0x0000, + 0x0000, 0x0000, 0x8218, 0xb969, 0x387d, 0x0000, 0x0000, 0x0000, 0x1852, 0xec57, + 0x385e, 0x0000, 0x0000, 0x0000, 0x670c, 0xd674, 0x383e, 0x0000, 0x0000, 0x0000, + 0xad40, 0xc2c4, 0x3820, 0x0000, 0x0000, 0x0000, 0x2e80, 0xa696, 0x3801, 0x0000, + 0x0000, 0x0000, 0xd800, 0xc467, 0x37dc, 0x0000, 0x0000, 0x0000, 0x3c72, 0xc5ae, + 0x37c3, 0x0000, 0x0000, 0x0000, 0xb006, 0xac69, 0x37a4, 0x0000, 0x0000, 0x0000, + 0x34a0, 0x8cdf, 0x3782, 0x0000, 0x0000, 0x0000, 0x9ed2, 0xd25e, 0x3766, 0x0000, + 0x0000, 0x0000, 0x6fec, 0xaaaa, 0x3747, 0x0000, 0x0000, 0x0000, 0x6040, 0xfb5c, + 0x3726, 0x0000, 0x0000, 0x0000, 0x764c, 0xa3fc, 0x3708, 0x0000, 0x0000, 0x0000, + 0xb254, 0x954e, 0x36e9, 0x0000, 0x0000, 0x0000, 0x3e1c, 0xf5dc, 0x36ca, 0x0000, + 0x0000, 0x0000, 0x7b06, 0xc635, 0x36ac, 0x0000, 0x0000, 0x0000, 0xa8ba, 0xd738, + 0x368d, 0x0000, 0x0000, 0x0000, 0x06cc, 0xb24e, 0x366d, 0x0000, 0x0000, 0x0000, + 0x7108, 0xac76, 0x364f, 0x0000, 0x0000, 0x0000, 0x2324, 0xa7cb, 0x3630, 0x0000, + 0x0000, 0x0000, 0xac40, 0xef15, 0x360f, 0x0000, 0x0000, 0x0000, 0xae46, 0xd516, + 0x35f2, 0x0000, 0x0000, 0x0000, 0x615e, 0xe003, 0x35d3, 0x0000, 0x0000, 0x0000, + 0x0cf0, 0xefe7, 0x35b1, 0x0000, 0x0000, 0x0000, 0xfb50, 0xf98c, 0x3595, 0x0000, + 0x0000, 0x0000, 0x0abc, 0xf333, 0x3575, 0x0000, 0x0000, 0x0000, 0xdd60, 0xca3f, + 0x3555, 0x0000, 0x0000, 0x0000, 0x7eb6, 0xd87f, 0x3538, 0x0000, 0x0000, 0x0000, + 0x44f4, 0xb291, 0x3519, 0x0000, 0x0000, 0x0000, 0xff80, 0xc982, 0x34f6, 0x0000, + 0x0000, 0x0000, 0x9de0, 0xd9b8, 0x34db, 0x0000, 0x0000, 0x0000, 0xcd42, 0x9366, + 0x34bc, 0x0000, 0x0000, 0x0000, 0xbef0, 0xfaee, 0x349d, 0x0000, 0x0000, 0x0000, + 0xdac4, 0xb6f1, 0x347d, 0x0000, 0x0000, 0x0000, 0xf140, 0x94de, 0x345d, 0x0000, + 0x0000, 0x0000, 0xa218, 0x8b4b, 0x343e, 0x0000, 0x0000, 0x0000, 0x6380, 0xa135, + 0x341e, 0x0000, 0x0000, 0x0000, 0xb184, 0x8cb2, 0x3402, 0x0000, 0x0000, 0x0000, + 0x196e, 0xdc61, 0x33e3, 0x0000, 0x0000, 0x0000, 0x0c00, 0xde05, 0x33c4, 0x0000, + 0x0000, 0x0000, 0xef9a, 0xbd38, 0x33a5, 0x0000, 0x0000, 0x0000, 0xc1a0, 0xdf00, + 0x3385, 0x0000, 0x0000, 0x0000, 0x1090, 0x9973, 0x3365, 0x0000, 0x0000, 0x0000, + 0x4882, 0x8301, 0x3348, 0x0000, 0x0000, 0x0000, 0x7abe, 0xadc7, 0x3329, 0x0000, + 0x0000, 0x0000, 0x7cba, 0xec2b, 0x330a, 0x0000, 0x0000, 0x0000, 0xa520, 0x8f21, + 0x32e9, 0x0000, 0x0000, 0x0000, 0x710c, 0x8d36, 0x32cc, 0x0000, 0x0000, 0x0000, + 0x5212, 0xc6ed, 0x32ad, 0x0000, 0x0000, 0x0000, 0x7308, 0xfd76, 0x328d, 0x0000, + 0x0000, 0x0000, 0x5014, 0xd548, 0x326f, 0x0000, 0x0000, 0x0000, 0xd3f2, 0xb499, + 0x3250, 0x0000, 0x0000, 0x0000, 0x7f74, 0xa606, 0x3230, 0x0000, 0x0000, 0x0000, + 0xf0a8, 0xd720, 0x3212, 0x0000, 0x0000, 0x0000, 0x185c, 0xe20f, 0x31f2, 0x0000, + 0x0000, 0x0000, 0xa5a8, 0x8738, 0x31d4, 0x0000, 0x0000, 0x0000, 0xdd74, 0xcafb, + 0x31b4, 0x0000, 0x0000, 0x0000, 0x98b6, 0xbd8e, 0x3196, 0x0000, 0x0000, 0x0000, + 0xe9de, 0x977f, 0x3177, 0x0000, 0x0000, 0x0000, 0x67c0, 0x818d, 0x3158, 0x0000, + 0x0000, 0x0000, 0xe52a, 0x9322, 0x3139, 0x0000, 0x0000, 0x0000, 0xe568, 0x9b6c, + 0x3119, 0x0000, 0x0000, 0x0000, 0x2358, 0xaa0a, 0x30fa, 0x0000, 0x0000, 0x0000, + 0xe480, 0xe13b, 0x30d9, 0x0000, 0x0000, 0x0000, 0x3024, 0x90a1, 0x30bd, 0x0000, + 0x0000, 0x0000, 0x9620, 0xda30, 0x309d, 0x0000, 0x0000, 0x0000, 0x898a, 0xb388, + 0x307f, 0x0000, 0x0000, 0x0000, 0xb24c, 0xc891, 0x3060, 0x0000, 0x0000, 0x0000, + 0x8056, 0xf98b, 0x3041, 0x0000, 0x0000, 0x0000, 0x72a4, 0xa1ea, 0x3021, 0x0000, + 0x0000, 0x0000, 0x6af8, 0x9488, 0x3001, 0x0000, 0x0000, 0x0000, 0xe00c, 0xdfcb, + 0x2fe4, 0x0000, 0x0000, 0x0000, 0xeeec, 0xc941, 0x2fc4, 0x0000, 0x0000, 0x0000, + 0x53e0, 0xe70f, 0x2fa4, 0x0000, 0x0000, 0x0000, 0x8f60, 0x9c07, 0x2f85, 0x0000, + 0x0000, 0x0000, 0xb328, 0xc3e7, 0x2f68, 0x0000, 0x0000, 0x0000, 0x9404, 0xf8c7, + 0x2f48, 0x0000, 0x0000, 0x0000, 0x38e0, 0xc99f, 0x2f29, 0x0000, 0x0000, 0x0000, + 0x9778, 0xd984, 0x2f09, 0x0000, 0x0000, 0x0000, 0xe700, 0xd142, 0x2eea, 0x0000, + 0x0000, 0x0000, 0xd904, 0x9443, 0x2ecd, 0x0000, 0x0000, 0x0000, 0xd4ba, 0xae7e, + 0x2eae, 0x0000, 0x0000, 0x0000, 0x8e5e, 0x8524, 0x2e8f, 0x0000, 0x0000, 0x0000, + 0xb550, 0xc9ed, 0x2e6e, 0x0000, 0x0000, 0x0000, 0x53b8, 0x8648, 0x2e51, 0x0000, + 0x0000, 0x0000, 0xdae4, 0x87f9, 0x2e32, 0x0000, 0x0000, 0x0000, 0x2942, 0xd966, + 0x2e13, 0x0000, 0x0000, 0x0000, 0x4f28, 0xcf3c, 0x2df3, 0x0000, 0x0000, 0x0000, + 0xfa40, 0xc4ef, 0x2dd1, 0x0000, 0x0000, 0x0000, 0x4424, 0xbca7, 0x2db5, 0x0000, + 0x0000, 0x0000, 0x2e62, 0xcdc5, 0x2d97, 0x0000, 0x0000, 0x0000, 0xed88, 0x996b, + 0x2d78, 0x0000, 0x0000, 0x0000, 0x7c30, 0xd97d, 0x2d56, 0x0000, 0x0000, 0x0000, + 0xed26, 0xbf6e, 0x2d3a, 0x0000, 0x0000, 0x0000, 0x2918, 0x921b, 0x2d1a, 0x0000, + 0x0000, 0x0000, 0x4e24, 0xe84e, 0x2cfb, 0x0000, 0x0000, 0x0000, 0x6dc0, 0x92ec, + 0x2cdd, 0x0000, 0x0000, 0x0000, 0x4f2c, 0xacf8, 0x2cbd, 0x0000, 0x0000, 0x0000, + 0xc634, 0xf094, 0x2c9e, 0x0000, 0x0000, 0x0000, 0xdc70, 0xe5d3, 0x2c7e, 0x0000, + 0x0000, 0x0000, 0x2180, 0xa600, 0x2c5b, 0x0000, 0x0000, 0x0000, 0x8480, 0xd680, + 0x2c3c, 0x0000, 0x0000, 0x0000, 0x8b24, 0xd63b, 0x2c22, 0x0000, 0x0000, 0x0000, + 0x02e0, 0xaa47, 0x2c00, 0x0000, 0x0000, 0x0000, 0x9ad0, 0xee84, 0x2be3, 0x0000, + 0x0000, 0x0000, 0xf7dc, 0xf699, 0x2bc6, 0x0000, 0x0000, 0x0000, 0xddde, 0xe490, + 0x2ba7, 0x0000, 0x0000, 0x0000, 0x34a0, 0xb4fd, 0x2b85, 0x0000, 0x0000, 0x0000, + 0x91b4, 0x8ef6, 0x2b68, 0x0000, 0x0000, 0x0000, 0xa3e0, 0xa2a7, 0x2b47, 0x0000, + 0x0000, 0x0000, 0xcce4, 0x82b3, 0x2b2a, 0x0000, 0x0000, 0x0000, 0xe4be, 0x8207, + 0x2b0c, 0x0000, 0x0000, 0x0000, 0x1d92, 0xab43, 0x2aed, 0x0000, 0x0000, 0x0000, + 0xe818, 0xf9f6, 0x2acd, 0x0000, 0x0000, 0x0000, 0xff12, 0xba80, 0x2aaf, 0x0000, + 0x0000, 0x0000, 0x5254, 0x8529, 0x2a90, 0x0000, 0x0000, 0x0000, 0x1b88, 0xe032, + 0x2a71, 0x0000, 0x0000, 0x0000, 0x3248, 0xd86d, 0x2a50, 0x0000, 0x0000, 0x0000, + 0x3140, 0xc9d5, 0x2a2e, 0x0000, 0x0000, 0x0000, 0x14e6, 0xbd47, 0x2a14, 0x0000, + 0x0000, 0x0000, 0x5c10, 0xe544, 0x29f4, 0x0000, 0x0000, 0x0000, 0x9f50, 0x90b6, + 0x29d4, 0x0000, 0x0000, 0x0000, 0x9850, 0xab55, 0x29b6, 0x0000, 0x0000, 0x0000, + 0x2750, 0x9d07, 0x2998, 0x0000, 0x0000, 0x0000, 0x6700, 0x8bbb, 0x2973, 0x0000, + 0x0000, 0x0000, 0x5dba, 0xed31, 0x295a, 0x0000, 0x0000, 0x0000, 0x61dc, 0x85fe, + 0x293a, 0x0000, 0x0000, 0x0000, 0x9ba2, 0xd6b4, 0x291c, 0x0000, 0x0000, 0x0000, + 0x2d30, 0xe3a5, 0x28fb, 0x0000, 0x0000, 0x0000, 0x6630, 0xb566, 0x28dd, 0x0000, + 0x0000, 0x0000, 0x5ad4, 0xa829, 0x28bf, 0x0000, 0x0000, 0x0000, 0x89d8, 0xe290, + 0x28a0, 0x0000, 0x0000, 0x0000, 0x3916, 0xc428, 0x2881, 0x0000, 0x0000, 0x0000, + 0x0490, 0xbea4, 0x2860, 0x0000, 0x0000, 0x0000, 0xee06, 0x80ee, 0x2843, 0x0000, + 0x0000, 0x0000, 0xfc00, 0xf327, 0x2820, 0x0000, 0x0000, 0x0000, 0xea40, 0xa871, + 0x2800, 0x0000, 0x0000, 0x0000, 0x63d8, 0x9c26, 0x27e4, 0x0000, 0x0000, 0x0000, + 0x07ba, 0xc0c9, 0x27c7, 0x0000, 0x0000, 0x0000, 0x3fa2, 0x9797, 0x27a8, 0x0000, + 0x0000, 0x0000, 0x21c6, 0xfeca, 0x2789, 0x0000, 0x0000, 0x0000, 0xde40, 0x860d, + 0x2768, 0x0000, 0x0000, 0x0000, 0x9cc8, 0x98ce, 0x2749, 0x0000, 0x0000, 0x0000, + 0x3778, 0xa31c, 0x272a, 0x0000, 0x0000, 0x0000, 0xe778, 0xf6e2, 0x270b, 0x0000, + 0x0000, 0x0000, 0x59b8, 0xf841, 0x26ed, 0x0000, 0x0000, 0x0000, 0x02e0, 0xad04, + 0x26cd, 0x0000, 0x0000, 0x0000, 0x5a92, 0x9380, 0x26b0, 0x0000, 0x0000, 0x0000, + 0xc740, 0x8886, 0x268d, 0x0000, 0x0000, 0x0000, 0x0680, 0xfaf8, 0x266c, 0x0000, + 0x0000, 0x0000, 0xfb60, 0x897f, 0x2653, 0x0000, 0x0000, 0x0000, 0x8760, 0xf903, + 0x2634, 0x0000, 0x0000, 0x0000, 0xad2a, 0xc2c8, 0x2615, 0x0000, 0x0000, 0x0000, + 0x2d86, 0x8aef, 0x25f6, 0x0000, 0x0000, 0x0000, 0x1ef4, 0xe627, 0x25d6, 0x0000, + 0x0000, 0x0000, 0x09e4, 0x8020, 0x25b7, 0x0000, 0x0000, 0x0000, 0x7548, 0xd227, + 0x2598, 0x0000, 0x0000, 0x0000, 0x75dc, 0xfb5b, 0x2579, 0x0000, 0x0000, 0x0000, + 0xea84, 0xc8b6, 0x255a, 0x0000, 0x0000, 0x0000, 0xe4d0, 0x8145, 0x253b, 0x0000, + 0x0000, 0x0000, 0x3640, 0x9768, 0x251c, 0x0000, 0x0000, 0x0000, 0x246a, 0xccec, + 0x24fe, 0x0000, 0x0000, 0x0000, 0x51d0, 0xa075, 0x24dd, 0x0000, 0x0000, 0x0000, + 0x4638, 0xa385, 0x24bf, 0x0000, 0x0000, 0x0000, 0xd788, 0xd776, 0x24a1, 0x0000, + 0x0000, 0x0000, 0x1370, 0x8997, 0x2482, 0x0000, 0x0000, 0x0000, 0x1e88, 0x9b67, + 0x2462, 0x0000, 0x0000, 0x0000, 0x6c08, 0xd975, 0x2444, 0x0000, 0x0000, 0x0000, + 0xfdb0, 0xcfc0, 0x2422, 0x0000, 0x0000, 0x0000, 0x3100, 0xc026, 0x2406, 0x0000, + 0x0000, 0x0000, 0xc5b4, 0xae64, 0x23e6, 0x0000, 0x0000, 0x0000, 0x2280, 0xf687, + 0x23c3, 0x0000, 0x0000, 0x0000, 0x2de0, 0x9006, 0x23a9, 0x0000, 0x0000, 0x0000, + 0x24bc, 0xf631, 0x238a, 0x0000, 0x0000, 0x0000, 0xb8d4, 0xa975, 0x236b, 0x0000, + 0x0000, 0x0000, 0xd9a4, 0xb949, 0x234b, 0x0000, 0x0000, 0x0000, 0xb54e, 0xbd39, + 0x232d, 0x0000, 0x0000, 0x0000, 0x4aac, 0x9a52, 0x230e, 0x0000, 0x0000, 0x0000, + 0xbbbc, 0xd085, 0x22ef, 0x0000, 0x0000, 0x0000, 0xdf18, 0xc633, 0x22cf, 0x0000, + 0x0000, 0x0000, 0x16d0, 0xeca5, 0x22af, 0x0000, 0x0000, 0x0000, 0xf2a0, 0xdf6f, + 0x228e, 0x0000, 0x0000, 0x0000, 0x8c44, 0xe86b, 0x2272, 0x0000, 0x0000, 0x0000, + 0x35c0, 0xbbf4, 0x2253, 0x0000, 0x0000, 0x0000, 0x0c40, 0xdafb, 0x2230, 0x0000, + 0x0000, 0x0000, 0x92dc, 0x9935, 0x2216, 0x0000, 0x0000, 0x0000, 0x0ca0, 0xbda6, + 0x21f3, 0x0000, 0x0000, 0x0000, 0x5958, 0xa6fd, 0x21d6, 0x0000, 0x0000, 0x0000, + 0xa3dc, 0x9d7f, 0x21b9, 0x0000, 0x0000, 0x0000, 0x79dc, 0xfcb5, 0x2199, 0x0000, + 0x0000, 0x0000, 0xf264, 0xcebb, 0x217b, 0x0000, 0x0000, 0x0000, 0x0abe, 0x8308, + 0x215c, 0x0000, 0x0000, 0x0000, 0x30ae, 0xb463, 0x213d, 0x0000, 0x0000, 0x0000, + 0x6228, 0xb040, 0x211c, 0x0000, 0x0000, 0x0000, 0xc9b2, 0xf43b, 0x20ff, 0x0000, + 0x0000, 0x0000, 0x3d8e, 0xa4b3, 0x20e0, 0x0000, 0x0000, 0x0000, 0x84e6, 0x8dab, + 0x20c1, 0x0000, 0x0000, 0x0000, 0xa124, 0x9b74, 0x20a1, 0x0000, 0x0000, 0x0000, + 0xc276, 0xd497, 0x2083, 0x0000, 0x0000, 0x0000, 0x6354, 0xa466, 0x2063, 0x0000, + 0x0000, 0x0000, 0x8654, 0xaf0a, 0x2044, 0x0000, 0x0000, 0x0000, 0x1d20, 0xfa5c, + 0x2024, 0x0000, 0x0000, 0x0000, 0xbcd0, 0xf3f0, 0x2004, 0x0000, 0x0000, 0x0000, + 0xedf0, 0xf0b6, 0x1fe7, 0x0000, 0x0000, 0x0000, 0x45bc, 0x9182, 0x1fc9, 0x0000, + 0x0000, 0x0000, 0xe254, 0xdc85, 0x1faa, 0x0000, 0x0000, 0x0000, 0xb898, 0xe9b1, + 0x1f8a, 0x0000, 0x0000, 0x0000, 0x0ebe, 0xe6f0, 0x1f6c, 0x0000, 0x0000, 0x0000, + 0xa9b8, 0xf584, 0x1f4c, 0x0000, 0x0000, 0x0000, 0x12e8, 0xdf6b, 0x1f2e, 0x0000, + 0x0000, 0x0000, 0x9f9e, 0xcd55, 0x1f0f, 0x0000, 0x0000, 0x0000, 0x05a0, 0xec3a, + 0x1eef, 0x0000, 0x0000, 0x0000, 0xd8e0, 0x96f8, 0x1ed1, 0x0000, 0x0000, 0x0000, + 0x3bd4, 0xccc6, 0x1eb1, 0x0000, 0x0000, 0x0000, 0x4910, 0xb87b, 0x1e93, 0x0000, + 0x0000, 0x0000, 0xbefc, 0xd40b, 0x1e73, 0x0000, 0x0000, 0x0000, 0x317e, 0xa406, + 0x1e55, 0x0000, 0x0000, 0x0000, 0x6bb2, 0xc2b2, 0x1e36, 0x0000, 0x0000, 0x0000, + 0xb87e, 0xbb78, 0x1e17, 0x0000, 0x0000, 0x0000, 0xa03c, 0xdbbd, 0x1df7, 0x0000, + 0x0000, 0x0000, 0x5b6c, 0xe3c8, 0x1dd9, 0x0000, 0x0000, 0x0000, 0x8968, 0xca8e, + 0x1dba, 0x0000, 0x0000, 0x0000, 0xc024, 0xe6ab, 0x1d9a, 0x0000, 0x0000, 0x0000, + 0x4110, 0xd4eb, 0x1d7a, 0x0000, 0x0000, 0x0000, 0xa168, 0xbdb5, 0x1d5d, 0x0000, + 0x0000, 0x0000, 0x012e, 0xa5fa, 0x1d3e, 0x0000, 0x0000, 0x0000, 0x6838, 0x9c1f, + 0x1d1e, 0x0000, 0x0000, 0x0000, 0xa158, 0xaa76, 0x1d00, 0x0000, 0x0000, 0x0000, + 0x090a, 0xbd95, 0x1ce1, 0x0000, 0x0000, 0x0000, 0xf73e, 0x8b6d, 0x1cc2, 0x0000, + 0x0000, 0x0000, 0x5fda, 0xbcbf, 0x1ca3, 0x0000, 0x0000, 0x0000, 0xdbe8, 0xb89f, + 0x1c84, 0x0000, 0x0000, 0x0000, 0x6e4c, 0x96c7, 0x1c64, 0x0000, 0x0000, 0x0000, + 0x19c2, 0xf2a4, 0x1c46, 0x0000, 0x0000, 0x0000, 0xb800, 0xf855, 0x1c1e, 0x0000, + 0x0000, 0x0000, 0x87fc, 0x85ff, 0x1c08, 0x0000, 0x0000, 0x0000, 0x1418, 0x839f, + 0x1be9, 0x0000, 0x0000, 0x0000, 0x6186, 0xd9d8, 0x1bca, 0x0000, 0x0000, 0x0000, + 0xf500, 0xabaa, 0x1ba6, 0x0000, 0x0000, 0x0000, 0x7b36, 0xdafe, 0x1b8c, 0x0000, + 0x0000, 0x0000, 0xf394, 0xe6d8, 0x1b6c, 0x0000, 0x0000, 0x0000, 0x6efc, 0x9e55, + 0x1b4e, 0x0000, 0x0000, 0x0000, 0x5e10, 0xc523, 0x1b2e, 0x0000, 0x0000, 0x0000, + 0x8210, 0xb6f9, 0x1b0d, 0x0000, 0x0000, 0x0000, 0x9ab0, 0x96e3, 0x1af1, 0x0000, + 0x0000, 0x0000, 0x3864, 0x92e7, 0x1ad1, 0x0000, 0x0000, 0x0000, 0x9878, 0xdc65, + 0x1ab1, 0x0000, 0x0000, 0x0000, 0xfa20, 0xd6cb, 0x1a94, 0x0000, 0x0000, 0x0000, + 0x6c00, 0xa4e4, 0x1a70, 0x0000, 0x0000, 0x0000, 0xab40, 0xb41b, 0x1a53, 0x0000, + 0x0000, 0x0000, 0x43a4, 0x8ede, 0x1a37, 0x0000, 0x0000, 0x0000, 0x22e0, 0x9314, + 0x1a15, 0x0000, 0x0000, 0x0000, 0x6170, 0xb949, 0x19f8, 0x0000, 0x0000, 0x0000, + 0x6b00, 0xe056, 0x19d8, 0x0000, 0x0000, 0x0000, 0x9ba8, 0xa94c, 0x19b9, 0x0000, + 0x0000, 0x0000, 0xfaa0, 0xaa16, 0x199b, 0x0000, 0x0000, 0x0000, 0x899a, 0xf627, + 0x197d, 0x0000, 0x0000, 0x0000, 0x9f20, 0xfb70, 0x195d, 0x0000, 0x0000, 0x0000, + 0xa4b8, 0xc176, 0x193e, 0x0000, 0x0000, 0x0000, 0xb21c, 0x85c3, 0x1920, 0x0000, + 0x0000, 0x0000, 0x50d2, 0x9b19, 0x1901, 0x0000, 0x0000, 0x0000, 0xd4b0, 0xb708, + 0x18e0, 0x0000, 0x0000, 0x0000, 0xfb88, 0xf510, 0x18c1, 0x0000, 0x0000, 0x0000, + 0x31ec, 0xdc8d, 0x18a3, 0x0000, 0x0000, 0x0000, 0x3c00, 0xbff9, 0x1885, 0x0000, + 0x0000, 0x0000, 0x5020, 0xc30b, 0x1862, 0x0000, 0x0000, 0x0000, 0xd4f0, 0xda0c, + 0x1844, 0x0000, 0x0000, 0x0000, 0x20d2, 0x99a5, 0x1828, 0x0000, 0x0000, 0x0000, + 0x852e, 0xd159, 0x1809, 0x0000, 0x0000, 0x0000, 0x7cd8, 0x97a1, 0x17e9, 0x0000, + 0x0000, 0x0000, 0x423a, 0x997b, 0x17cb, 0x0000, 0x0000, 0x0000, 0xc1c0, 0xbe7d, + 0x17a8, 0x0000, 0x0000, 0x0000, 0xe8bc, 0xdcdd, 0x178d, 0x0000, 0x0000, 0x0000, + 0x8b28, 0xae06, 0x176e, 0x0000, 0x0000, 0x0000, 0x102e, 0xb8d4, 0x174f, 0x0000, + 0x0000, 0x0000, 0xaa00, 0xaa5c, 0x172f, 0x0000, 0x0000, 0x0000, 0x51f0, 0x9fc0, + 0x170e, 0x0000, 0x0000, 0x0000, 0xf858, 0xe181, 0x16f2, 0x0000, 0x0000, 0x0000, + 0x91a8, 0x8162, 0x16d3, 0x0000, 0x0000, 0x0000, 0x5f40, 0xcb6f, 0x16b1, 0x0000, + 0x0000, 0x0000, 0xbb50, 0xe55f, 0x1693, 0x0000, 0x0000, 0x0000, 0xacd2, 0xd895, + 0x1676, 0x0000, 0x0000, 0x0000, 0xef30, 0x97bf, 0x1654, 0x0000, 0x0000, 0x0000, + 0xf700, 0xb3d7, 0x1633, 0x0000, 0x0000, 0x0000, 0x3454, 0xa7b5, 0x1619, 0x0000, + 0x0000, 0x0000, 0x6b00, 0xa929, 0x15f6, 0x0000, 0x0000, 0x0000, 0x9f04, 0x89f7, + 0x15db, 0x0000, 0x0000, 0x0000, 0xad78, 0xd985, 0x15bc, 0x0000, 0x0000, 0x0000, + 0xa46a, 0xae3f, 0x159d, 0x0000, 0x0000, 0x0000, 0x63a0, 0xd0da, 0x157c, 0x0000, + 0x0000, 0x0000, 0x5e90, 0x817d, 0x155e, 0x0000, 0x0000, 0x0000, 0x1494, 0xb13f, + 0x1540, 0x0000, 0x0000, 0x0000, 0x0090, 0x9c40, 0x1521, 0x0000, 0x0000, 0x0000, + 0xdd70, 0xcc86, 0x1500, 0x0000, 0x0000, 0x0000, 0x64f8, 0xdb6f, 0x14e1, 0x0000, + 0x0000, 0x0000, 0xe22c, 0xac17, 0x14c3, 0x0000, 0x0000, 0x0000, 0x60e0, 0xa9ad, + 0x14a3, 0x0000, 0x0000, 0x0000, 0x4640, 0xd658, 0x1481, 0x0000, 0x0000, 0x0000, + 0x6490, 0xa181, 0x1467, 0x0000, 0x0000, 0x0000, 0x1df4, 0xaaa2, 0x1447, 0x0000, + 0x0000, 0x0000, 0xb94a, 0x8f61, 0x1429, 0x0000, 0x0000, 0x0000, 0x5198, 0x9d83, + 0x1409, 0x0000, 0x0000, 0x0000, 0x0f7a, 0xa818, 0x13eb, 0x0000, 0x0000, 0x0000, + 0xc45e, 0xc06c, 0x13cc, 0x0000, 0x0000, 0x0000, 0x4ec0, 0xfa29, 0x13a8, 0x0000, + 0x0000, 0x0000, 0x6418, 0x8cad, 0x138c, 0x0000, 0x0000, 0x0000, 0xbcc8, 0xe7d1, + 0x136f, 0x0000, 0x0000, 0x0000, 0xc934, 0xf9b0, 0x134f, 0x0000, 0x0000, 0x0000, + 0x6ce0, 0x98df, 0x1331, 0x0000, 0x0000, 0x0000, 0x3516, 0xe5e9, 0x1312, 0x0000, + 0x0000, 0x0000, 0xc6c0, 0xef8b, 0x12ef, 0x0000, 0x0000, 0x0000, 0xaf02, 0x913d, + 0x12d4, 0x0000, 0x0000, 0x0000, 0xd230, 0xe1d5, 0x12b5, 0x0000, 0x0000, 0x0000, + 0xfba8, 0xc232, 0x1295, 0x0000, 0x0000, 0x0000, 0x7ba4, 0xabeb, 0x1277, 0x0000, + 0x0000, 0x0000, 0x6e5c, 0xc692, 0x1258, 0x0000, 0x0000, 0x0000, 0x76a2, 0x9756, + 0x1239, 0x0000, 0x0000, 0x0000, 0xe180, 0xe423, 0x1214, 0x0000, 0x0000, 0x0000, + 0x8c3c, 0x90f8, 0x11fb, 0x0000, 0x0000, 0x0000, 0x9f3c, 0x9fd2, 0x11dc, 0x0000, + 0x0000, 0x0000, 0x53e0, 0xb73e, 0x11bd, 0x0000, 0x0000, 0x0000, 0x45be, 0x88d6, + 0x119e, 0x0000, 0x0000, 0x0000, 0x111a, 0x8bc0, 0x117f, 0x0000, 0x0000, 0x0000, + 0xe26a, 0xd7ff, 0x1160, 0x0000, 0x0000, 0x0000, 0xfb60, 0xdd8d, 0x113f, 0x0000, + 0x0000, 0x0000, 0x9370, 0xc108, 0x1120, 0x0000, 0x0000, 0x0000, 0x9654, 0x8baf, + 0x1103, 0x0000, 0x0000, 0x0000, 0xd6ec, 0xd6b9, 0x10e4, 0x0000, 0x0000, 0x0000, + 0x23e4, 0xd7b7, 0x10c4, 0x0000, 0x0000, 0x0000, 0x1aa6, 0xa847, 0x10a6, 0x0000, + 0x0000, 0x0000, 0xbee6, 0x9fef, 0x1087, 0x0000, 0x0000, 0x0000, 0x26d0, 0xa6eb, + 0x1066, 0x0000, 0x0000, 0x0000, 0x5b86, 0xa880, 0x1049, 0x0000, 0x0000, 0x0000, + 0x125c, 0xd971, 0x1029, 0x0000, 0x0000, 0x0000, 0x1f78, 0x9d18, 0x100a, 0x0000, + 0x0000, 0x0000, 0x0e84, 0xb15b, 0x0feb, 0x0000, 0x0000, 0x0000, 0xd0c0, 0xc150, + 0x0fcc, 0x0000, 0x0000, 0x0000, 0xa330, 0xc40c, 0x0fad, 0x0000, 0x0000, 0x0000, + 0x5202, 0xfc2c, 0x0f8f, 0x0000, 0x0000, 0x0000, 0x3f7c, 0xecf5, 0x0f6f, 0x0000, + 0x0000, 0x0000, 0xef44, 0xfdfd, 0x0f50, 0x0000, 0x0000, 0x0000, 0x3f6c, 0xab1b, + 0x0f31, 0x0000, 0x0000, 0x0000, 0xf658, 0x89ec, 0x0f11, 0x0000, 0x0000, 0x0000, + 0xbfc8, 0x9ba8, 0x0ef4, 0x0000, 0x0000, 0x0000, 0x3d40, 0xbe21, 0x0ed5, 0x0000, + 0x0000, 0x0000, 0xbbc4, 0xc70d, 0x0eb6, 0x0000, 0x0000, 0x0000, 0x5158, 0xdb16, + 0x0e96, 0x0000, 0x0000, 0x0000, 0xb5a8, 0xa8d8, 0x0e78, 0x0000, 0x0000, 0x0000, + 0xcccc, 0xb40e, 0x0e58, 0x0000, 0x0000, 0x0000, 0x448c, 0xcb62, 0x0e3a, 0x0000, + 0x0000, 0x0000, 0xf12a, 0x8aed, 0x0e1b, 0x0000, 0x0000, 0x0000, 0x79d0, 0xc59c, + 0x0dfb, 0x0000, 0x0000, 0x0000, 0x06b4, 0xcdc9, 0x0ddd, 0x0000, 0x0000, 0x0000, + 0xae70, 0xa979, 0x0dbe, 0x0000, 0x0000, 0x0000, 0x317c, 0xa8fb, 0x0d9e, 0x0000, + 0x0000, 0x0000, 0x5fe0, 0x8a50, 0x0d7d, 0x0000, 0x0000, 0x0000, 0x70b6, 0xfdfa, + 0x0d61, 0x0000, 0x0000, 0x0000, 0x1640, 0x9dc7, 0x0d41, 0x0000, 0x0000, 0x0000, + 0x9a9c, 0xdc50, 0x0d23, 0x0000, 0x0000, 0x0000, 0x4fcc, 0x9a9b, 0x0d04, 0x0000, + 0x0000, 0x0000, 0x7e48, 0x8f77, 0x0ce5, 0x0000, 0x0000, 0x0000, 0x84e4, 0xd4b9, + 0x0cc6, 0x0000, 0x0000, 0x0000, 0x84e0, 0xbd10, 0x0ca6, 0x0000, 0x0000, 0x0000, + 0x1b0a, 0xc8d9, 0x0c88, 0x0000, 0x0000, 0x0000, 0x6a48, 0xfc81, 0x0c68, 0x0000, + 0x0000, 0x0000, 0x070a, 0xbef6, 0x0c4a, 0x0000, 0x0000, 0x0000, 0x8a70, 0xf096, + 0x0c2b, 0x0000, 0x0000, 0x0000, 0xecc2, 0xc994, 0x0c0c, 0x0000, 0x0000, 0x0000, + 0x1540, 0x9537, 0x0bea, 0x0000, 0x0000, 0x0000, 0x1b02, 0xab5b, 0x0bce, 0x0000, + 0x0000, 0x0000, 0x5dc0, 0xb0c8, 0x0bad, 0x0000, 0x0000, 0x0000, 0xc928, 0xe034, + 0x0b8f, 0x0000, 0x0000, 0x0000, 0x2d12, 0xb4b0, 0x0b71, 0x0000, 0x0000, 0x0000, + 0x8fc2, 0xbb94, 0x0b52, 0x0000, 0x0000, 0x0000, 0xe236, 0xe22f, 0x0b33, 0x0000, + 0x0000, 0x0000, 0xb97c, 0xbe9e, 0x0b13, 0x0000, 0x0000, 0x0000, 0xe1a6, 0xe16d, + 0x0af5, 0x0000, 0x0000, 0x0000, 0xd330, 0xbaf0, 0x0ad6, 0x0000, 0x0000, 0x0000, + 0xc0bc, 0xbbd0, 0x0ab7, 0x0000, 0x0000, 0x0000, 0x8e66, 0xdd9b, 0x0a98, 0x0000, + 0x0000, 0x0000, 0xc95c, 0xf799, 0x0a79, 0x0000, 0x0000, 0x0000, 0xdac0, 0xbe4c, + 0x0a55, 0x0000, 0x0000, 0x0000, 0xafc0, 0xc378, 0x0a37, 0x0000, 0x0000, 0x0000, + 0xa880, 0xe341, 0x0a19, 0x0000, 0x0000, 0x0000, 0xc242, 0x81f6, 0x09fd, 0x0000, + 0x0000, 0x0000, 0x7470, 0xc777, 0x09de, 0x0000, 0x0000, 0x0000, 0x62bc, 0xb684, + 0x09be, 0x0000, 0x0000, 0x0000, 0x43ac, 0x8c58, 0x099f, 0x0000, 0x0000, 0x0000, + 0xcc3c, 0xf9ac, 0x0981, 0x0000, 0x0000, 0x0000, 0x1526, 0xb670, 0x0962, 0x0000, + 0x0000, 0x0000, 0xc9fe, 0xdf50, 0x0943, 0x0000, 0x0000, 0x0000, 0x6ae6, 0xc065, + 0x0924, 0x0000, 0x0000, 0x0000, 0xb114, 0xcf29, 0x0905, 0x0000, 0x0000, 0x0000, + 0xd388, 0x922a, 0x08e4, 0x0000, 0x0000, 0x0000, 0xcf54, 0xb926, 0x08c7, 0x0000, + 0x0000, 0x0000, 0x3826, 0xe855, 0x08a8, 0x0000, 0x0000, 0x0000, 0xe7c8, 0x829b, + 0x0888, 0x0000, 0x0000, 0x0000, 0x546c, 0xa903, 0x086a, 0x0000, 0x0000, 0x0000, + 0x8768, 0x99cc, 0x0849, 0x0000, 0x0000, 0x0000, 0x00ac, 0xf529, 0x082b, 0x0000, + 0x0000, 0x0000, 0x2658, 0x9f0b, 0x080c, 0x0000, 0x0000, 0x0000, 0xfe5c, 0x9e21, + 0x07ee, 0x0000, 0x0000, 0x0000, 0x6da2, 0x9910, 0x07cf, 0x0000, 0x0000, 0x0000, + 0x9220, 0xf9b3, 0x07b0, 0x0000, 0x0000, 0x0000, 0x3d90, 0xa541, 0x0791, 0x0000, + 0x0000, 0x0000, 0x6e4c, 0xe7cc, 0x0771, 0x0000, 0x0000, 0x0000, 0xa8fa, 0xe80a, + 0x0753, 0x0000, 0x0000, 0x0000, 0x4e14, 0xc3a7, 0x0734, 0x0000, 0x0000, 0x0000, + 0xf7e0, 0xbad9, 0x0712, 0x0000, 0x0000, 0x0000, 0xfea0, 0xeff2, 0x06f5, 0x0000, + 0x0000, 0x0000, 0xcef6, 0xbd48, 0x06d7, 0x0000, 0x0000, 0x0000, 0x7544, 0xf559, + 0x06b7, 0x0000, 0x0000, 0x0000, 0x2388, 0xf655, 0x0698, 0x0000, 0x0000, 0x0000, + 0xe900, 0xad56, 0x0676, 0x0000, 0x0000, 0x0000, 0x2cc0, 0x8437, 0x0659, 0x0000, + 0x0000, 0x0000, 0x3068, 0xc544, 0x063b, 0x0000, 0x0000, 0x0000, 0xdc70, 0xe73c, + 0x061b, 0x0000, 0x0000, 0x0000, 0xee50, 0x9d49, 0x05fc, 0x0000, 0x0000, 0x0000, + 0x93d2, 0x81f6, 0x05df, 0x0000, 0x0000, 0x0000, 0x941c, 0xadff, 0x05bf, 0x0000, + 0x0000, 0x0000, 0x2ce2, 0x8e45, 0x05a1, 0x0000, 0x0000, 0x0000, 0x4a60, 0x95fd, + 0x0581, 0x0000, 0x0000, 0x0000, 0x79f8, 0xb83a, 0x0563, 0x0000, 0x0000, 0x0000, + 0xcb58, 0xa1f5, 0x0543, 0x0000, 0x0000, 0x0000, 0x2a3a, 0xdc36, 0x0525, 0x0000, + 0x0000, 0x0000, 0x14ee, 0x890e, 0x0506, 0x0000, 0x0000, 0x0000, 0x8f20, 0xc432, + 0x04e3, 0x0000, 0x0000, 0x0000, 0x8440, 0xb21d, 0x04c6, 0x0000, 0x0000, 0x0000, + 0x5430, 0xf698, 0x04a7, 0x0000, 0x0000, 0x0000, 0x04ae, 0x8b20, 0x048a, 0x0000, + 0x0000, 0x0000, 0x04d0, 0xe872, 0x046b, 0x0000, 0x0000, 0x0000, 0xc78e, 0x8893, + 0x044c, 0x0000, 0x0000, 0x0000, 0x0f78, 0x9895, 0x042b, 0x0000, 0x0000, 0x0000, + 0x11d4, 0xdf2e, 0x040d, 0x0000, 0x0000, 0x0000, 0xe84c, 0x89d5, 0x03ef, 0x0000, + 0x0000, 0x0000, 0xf7be, 0x8a67, 0x03d0, 0x0000, 0x0000, 0x0000, 0x95d0, 0xc906, + 0x03b1, 0x0000, 0x0000, 0x0000, 0x64ce, 0xd96c, 0x0392, 0x0000, 0x0000, 0x0000, + 0x97ba, 0xa16f, 0x0373, 0x0000, 0x0000, 0x0000, 0x463c, 0xc51a, 0x0354, 0x0000, + 0x0000, 0x0000, 0xef0a, 0xe93e, 0x0335, 0x0000, 0x0000, 0x0000, 0x526a, 0xa466, + 0x0316, 0x0000, 0x0000, 0x0000, 0x4140, 0xa94d, 0x02f5, 0x0000, 0x0000, 0x0000, + 0xb4ec, 0xce68, 0x02d8, 0x0000, 0x0000, 0x0000, 0x4fa2, 0x8490, 0x02b9, 0x0000, + 0x0000, 0x0000, 0x4e60, 0xca98, 0x0298, 0x0000, 0x0000, 0x0000, 0x08dc, 0xe09c, + 0x027a, 0x0000, 0x0000, 0x0000, 0x2b90, 0xc7e3, 0x025c, 0x0000, 0x0000, 0x0000, + 0x5a7c, 0xf8ef, 0x023c, 0x0000, 0x0000, 0x0000, 0x5022, 0x9d58, 0x021e, 0x0000, + 0x0000, 0x0000, 0x553a, 0xe242, 0x01ff, 0x0000, 0x0000, 0x0000, 0x7e6e, 0xb54d, + 0x01e0, 0x0000, 0x0000, 0x0000, 0xd2d4, 0xa88c, 0x01c1, 0x0000, 0x0000, 0x0000, + 0x75b6, 0xfe6d, 0x01a2, 0x0000, 0x0000, 0x0000, 0x3bb2, 0xf04c, 0x0183, 0x0000, + 0x0000, 0x0000, 0xc2d0, 0xc046, 0x0163, 0x0000, 0x0000, 0x0000, 0x250c, 0xf9d6, + 0x0145, 0x0000, 0x0000, 0x0000, 0xb7b4, 0x8a0d, 0x0126, 0x0000, 0x0000, 0x0000, + 0x1a72, 0xe4f5, 0x0107, 0x0000, 0x0000, 0x0000, 0x825c, 0xa9b8, 0x00e8, 0x0000, + 0x0000, 0x0000, 0x6c90, 0xc9ad, 0x00c6, 0x0000, 0x0000, 0x0000, 0x4d00, 0xd1bb, + 0x00aa, 0x0000, 0x0000, 0x0000, 0xa4a0, 0xee01, 0x0087, 0x0000, 0x0000, 0x0000, + 0x89a8, 0xbe9f, 0x006b, 0x0000, 0x0000, 0x0000, 0x038e, 0xc80c, 0x004d, 0x0000, + 0x0000, 0x0000, 0xfe26, 0x8384, 0x002e, 0x0000, 0x0000, 0x0000, 0xcd90, 0xca57, + 0x000e, 0x0000 +}; + +void MacroAssembler::libm_reduce_pi04l(Register eax, Register ecx, Register edx, Register ebx, Register esi, Register edi, Register ebp, Register esp) { + Label B1_1, B1_2, B1_3, B1_4, B1_5, B1_6, B1_7, B1_8, B1_9, B1_10, B1_11, B1_12; + Label B1_13, B1_14, B1_15; + + assert_different_registers(ebx, eax, ecx, edx, esi, edi, ebp, esp); + + address zero_none = (address)_zero_none; + address _4onpi_d = (address)__4onpi_d; + address TWO_32H = (address)_TWO_32H; + address pi04_3d = (address)_pi04_3d; + address pi04_5d = (address)_pi04_5d; + address SCALE = (address)_SCALE; + address zeros = (address)_zeros; + address pi04_2d = (address)_pi04_2d; + address TWO_12H = (address)_TWO_12H; + address _4onpi_31l = (address)__4onpi_31l; + + bind(B1_1); + push(ebp); + movl(ebp, esp); + andl(esp, -16); + push(esi); + push(edi); + push(ebx); + subl(esp, 20); + movzwl(ebx, Address(ebp, 16)); + andl(ebx, 32767); + movl(eax, Address(ebp, 20)); + cmpl(ebx, 16413); + movl(esi, Address(ebp, 24)); + movl(Address(esp, 4), eax); + jcc(Assembler::greaterEqual, B1_8); + + bind(B1_2); + fld_x(Address(ebp, 8)); + fld_d(ExternalAddress(_4onpi_d)); //0x6dc9c883UL, 0x3ff45f30UL + fmul(1); + fstp_x(Address(esp, 8)); + movzwl(ecx, Address(esp, 16)); + negl(ecx); + addl(ecx, 30); + movl(eax, Address(esp, 12)); + shrl(eax); + cmpl(Address(esp, 4), 0); + jcc(Assembler::notEqual, B1_4); + + bind(B1_3); + lea(ecx, Address(eax, 1)); + andl(ecx, -2); + jmp(B1_5); + + bind(B1_4); + movl(ecx, eax); + addl(eax, Address(esp, 4)); + movl(edx, eax); + andl(edx, 1); + addl(ecx, edx); + + bind(B1_5); + fld_d(ExternalAddress(TWO_32H)); //0x00000000UL, 0x41f80000UL + cmpl(ebx, 16400); + movl(Address(esp, 0), ecx); + fild_s(Address(esp, 0)); + jcc(Assembler::greaterEqual, B1_7); + + bind(B1_6); + fld_d(ExternalAddress(pi04_3d)); //0x54442d00UL, 0x3fe921fbUL + fmul(1); + fsubp(3); + fxch(1); + fmul(2); + fld_s(2); + fadd(1); + fsubrp(1); + fld_s(0); + fxch(1); + fsuba(3); + fld_d(ExternalAddress(8 + pi04_3d)); //0x98cc5180UL, 0x3ce84698UL + fmul(3); + fsuba(2); + fxch(1); + fsub(2); + fsubrp(1); + faddp(3); + fld_d(ExternalAddress(16 + pi04_3d)); //0xcbb5bf6cUL, 0xb9dfc8f8UL + fmulp(2); + fld_s(1); + fsubr(1); + fsuba(1); + fxch(2); + fsubp(1); + faddp(2); + fxch(1); + jmp(B1_15); + + bind(B1_7); + fld_d(ExternalAddress(pi04_5d)); //0x54400000UL, 0x3fe921fbUL + fmul(1); + fsubp(3); + fxch(1); + fmul(2); + fld_s(2); + fadd(1); + fsubrp(1); + fld_s(0); + fxch(1); + fsuba(3); + fld_d(ExternalAddress(8 + pi04_5d)); //0x1a600000UL, 0x3dc0b461UL + fmul(3); + fsuba(2); + fxch(1); + fsub(2); + fsubrp(1); + faddp(3); + fld_d(ExternalAddress(16 + pi04_5d)); //0x2e000000UL, 0x3b93198aUL + fmul(2); + fld_s(0); + fsubr(2); + fsuba(2); + fxch(1); + fsubp(2); + fxch(1); + faddp(3); + fld_d(ExternalAddress(24 + pi04_5d)); //0x25200000UL, 0x396b839aUL + fmul(2); + fld_s(0); + fsubr(2); + fsuba(2); + fxch(1); + fsubp(2); + fxch(1); + faddp(3); + fld_d(ExternalAddress(32 + pi04_5d)); //0x533e63a0UL, 0x37027044UL + fmulp(2); + fld_s(1); + fsubr(1); + fsuba(1); + fxch(2); + fsubp(1); + faddp(2); + fxch(1); + jmp(B1_15); + + bind(B1_8); + fld_x(Address(ebp, 8)); + addl(ebx, -16417); + fmul_d(as_Address(ExternalAddress(SCALE))); //0x00000000UL, 0x32600000UL + movl(eax, -2078209981); + imull(ebx); + addl(edx, ebx); + movl(ecx, ebx); + sarl(edx, 4); + sarl(ecx, 31); + subl(edx, ecx); + movl(eax, edx); + shll(eax, 5); + fstp_x(Address(ebp, 8)); + fld_x(Address(ebp, 8)); + subl(eax, edx); + movl(Address(ebp, 8), 0); + subl(ebx, eax); + fld_x(Address(ebp, 8)); + cmpl(ebx, 17); + fsuba(1); + jcc(Assembler::less, B1_10); + + bind(B1_9); + lea(eax, Address(noreg, edx, Address::times_8)); + lea(ecx, Address(eax, edx, Address::times_4)); + incl(edx); + fld_x(Address(_4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmul(2); + fld_x(Address(12 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmul(2); + fld_s(0); + fadd(2); + fsuba(2); + fxch(1); + faddp(2); + fld_s(1); + fadd(1); + fstp_x(Address(esp, 8)); + andl(Address(esp, 8), -16777216); + fld_x(Address(esp, 8)); + fsubp(1); + jmp(B1_11); + + bind(B1_10); + fld_d(ExternalAddress(zeros)); //0x00000000UL, 0x00000000UL + fld_s(0); + + bind(B1_11); + fld_s(0); + lea(eax, Address(noreg, edx, Address::times_8)); + fld_s(3); + lea(edx, Address(eax, edx, Address::times_4)); + fld_x(Address(_4onpi_31l, RelocationHolder::none).plus_disp(edx, Address::times_1)); + fmul(6); + movl(Address(esp, 0), edx); + fadda(2); + fxch(2); + fsuba(3); + fxch(2); + faddp(3); + fxch(2); + faddp(3); + fld_x(Address(12 + _4onpi_31l, RelocationHolder::none).plus_disp(edx, Address::times_1)); + fmula(2); + fld_s(2); + fadd(2); + fld_s(0); + fxch(1); + fsubra(3); + fxch(3); + fchs(); + faddp(4); + fxch(3); + faddp(4); + fxch(2); + fadd(3); + fxch(2); + fmul(5); + fadda(2); + fld_s(4); + fld_x(Address(24 + _4onpi_31l, RelocationHolder::none).plus_disp(edx, Address::times_1)); + fmula(1); + fxch(1); + fadda(4); + fxch(4); + fstp_x(Address(esp, 8)); + movzwl(ebx, Address(esp, 16)); + andl(ebx, 32767); + cmpl(ebx, 16415); + jcc(Assembler::greaterEqual, B1_13); + + bind(B1_12); + negl(ebx); + addl(ebx, 30); + movl(ecx, ebx); + movl(eax, Address(esp, 12)); + shrl(eax); + shll(eax); + movl(Address(esp, 12), eax); + movl(Address(esp, 8), 0); + shrl(eax); + jmp(B1_14); + + bind(B1_13); + negl(ebx); + addl(ebx, 30); + movl(ecx, ebx); + movl(edx, Address(esp, 8)); + shrl(edx); + shll(edx); + negl(ecx); + movl(eax, Address(esp, 12)); + shll(eax); + movl(ecx, ebx); + movl(Address(esp, 8), edx); + shrl(edx); + orl(eax, edx); + + bind(B1_14); + fld_x(Address(esp, 8)); + addl(eax, Address(esp, 4)); + fsubp(3); + fmul(6); + fld_s(4); + movl(edx, eax); + andl(edx, 1); + fadd(3); + movl(ecx, Address(esp, 0)); + fsuba(3); + fxch(3); + faddp(5); + fld_s(1); + fxch(3); + fadd_d(Address(zero_none, RelocationHolder::none).plus_disp(edx, Address::times_8)); + fadda(3); + fsub(3); + faddp(2); + fxch(1); + faddp(4); + fld_s(2); + fadd(2); + fsuba(2); + fxch(3); + faddp(2); + fxch(1); + faddp(3); + fld_s(0); + fadd(2); + fsuba(2); + fxch(1); + faddp(2); + fxch(1); + faddp(2); + fld_s(2); + fld_x(Address(36 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmula(1); + fld_s(1); + fadd(3); + fsuba(3); + fxch(2); + faddp(3); + fxch(2); + faddp(3); + fxch(1); + fmul(4); + fld_s(0); + fadd(2); + fsuba(2); + fxch(1); + faddp(2); + fxch(1); + faddp(2); + fld_s(2); + fld_x(Address(48 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmula(1); + fld_s(1); + fadd(3); + fsuba(3); + fxch(2); + faddp(3); + fxch(2); + faddp(3); + fld_s(3); + fxch(2); + fmul(5); + fld_x(Address(60 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmula(3); + fxch(3); + faddp(1); + fld_s(0); + fadd(2); + fsuba(2); + fxch(1); + faddp(2); + fxch(1); + faddp(3); + fld_s(3); + fxch(2); + fmul(5); + fld_x(Address(72 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmula(3); + fxch(3); + faddp(1); + fld_s(0); + fadd(2); + fsuba(2); + fxch(1); + faddp(2); + fxch(1); + faddp(3); + fxch(1); + fmulp(4); + fld_x(Address(84 + _4onpi_31l, RelocationHolder::none).plus_disp(ecx, Address::times_1)); + fmulp(3); + fxch(2); + faddp(3); + fld_s(2); + fadd(2); + fld_d(ExternalAddress(TWO_32H)); //0x00000000UL, 0x41f80000UL + fmul(1); + fadda(1); + fsubp(1); + fsuba(2); + fxch(3); + faddp(2); + faddp(1); + fld_d(ExternalAddress(pi04_2d)); //0x54400000UL, 0x3fe921fbUL + fld_s(0); + fmul(2); + fxch(2); + fadd(3); + fxch(1); + fmulp(3); + fmul_d(as_Address(ExternalAddress(8 + pi04_2d))); //0x1a626331UL, 0x3dc0b461UL + faddp(1); + + bind(B1_15); + fld_d(ExternalAddress(TWO_12H)); //0x00000000UL, 0x40b80000UL + fld_s(2); + fadd(2); + fmula(1); + fstp_x(Address(esp, 8)); + fld_x(Address(esp, 8)); + fadd(1); + fsubrp(1); + fst_d(Address(esi, 0)); + fsubp(2); + faddp(1); + fstp_d(Address(esi, 8)); + addl(esp, 20); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); +} + +ALIGNED_(16) juint _L_2il0floatpacket_0[] = +{ + 0xffffffffUL, 0x7fffffffUL, 0x00000000UL, 0x00000000UL +}; + +ALIGNED_(16) juint _Pi4Inv[] = +{ + 0x6dc9c883UL, 0x3ff45f30UL +}; + +ALIGNED_(16) juint _Pi4x3[] = +{ + 0x54443000UL, 0xbfe921fbUL, 0x3b39a000UL, 0x3d373dcbUL, 0xe0e68948UL, + 0xba845c06UL +}; + +ALIGNED_(16) juint _Pi4x4[] = +{ + 0x54400000UL, 0xbfe921fbUL, 0x1a600000UL, 0xbdc0b461UL, 0x2e000000UL, + 0xbb93198aUL, 0x252049c1UL, 0xb96b839aUL +}; + +ALIGNED_(16) jushort _SP[] = +{ + 0xaaab, 0xaaaa, 0xaaaa, 0xaaaa, 0xbffc, 0x0000, 0x8887, 0x8888, 0x8888, 0x8888, + 0x3ff8, 0x0000, 0xc527, 0x0d00, 0x00d0, 0xd00d, 0xbff2, 0x0000, 0x45f6, 0xb616, + 0x1d2a, 0xb8ef, 0x3fec, 0x0000, 0x825b, 0x3997, 0x2b3f, 0xd732, 0xbfe5, 0x0000, + 0xbf33, 0x8bb4, 0x2fda, 0xb092, 0x3fde, 0x0000, 0x44a6, 0xed1a, 0x29ef, 0xd73e, + 0xbfd6, 0x0000, 0x8610, 0x307f, 0x62a1, 0xc921, 0x3fce, 0x0000 +}; + +ALIGNED_(16) jushort _CP[] = +{ + 0x0000, 0x0000, 0x0000, 0x8000, 0xbffe, 0x0000, 0xaaa5, 0xaaaa, 0xaaaa, 0xaaaa, + 0x3ffa, 0x0000, 0x9c2f, 0x0b60, 0x60b6, 0xb60b, 0xbff5, 0x0000, 0xf024, 0x0cac, + 0x00d0, 0xd00d, 0x3fef, 0x0000, 0x03fe, 0x3f65, 0x7dbb, 0x93f2, 0xbfe9, 0x0000, + 0xd84d, 0xadee, 0xc698, 0x8f76, 0x3fe2, 0x0000, 0xdaba, 0xfe79, 0xea36, 0xc9c9, + 0xbfda, 0x0000, 0x3ac6, 0x0ba0, 0x07ce, 0xd585, 0x3fd2, 0x0000 +}; + +ALIGNED_(16) juint _ones[] = +{ + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0xbff00000UL +}; + +void MacroAssembler::libm_sincos_huge(XMMRegister xmm0, XMMRegister xmm1, Register eax, Register ecx, Register edx, Register ebx, Register esi, Register edi, Register ebp, Register esp) { + Label B1_1, B1_2, B1_3, B1_4, B1_5, B1_6, B1_7, B1_8, B1_9, B1_10, B1_11, B1_12; + Label B1_13, B1_14, B1_15, B1_16, B1_17, B1_18, B1_19, B1_20, B1_21, B1_22, B1_23; + Label B1_24, B1_25, B1_26, B1_27, B1_28, B1_29, B1_30, B1_31, B1_32, B1_33, B1_34; + Label B1_35, B1_36, B1_37, B1_38, B1_39, B1_40, B1_41, B1_42, B1_43, B1_44, B1_45, B1_46; + + assert_different_registers(ebx, eax, ecx, edx, esi, edi, ebp, esp); + + address L_2il0floatpacket_0 = (address)_L_2il0floatpacket_0; + address Pi4Inv = (address)_Pi4Inv; + address Pi4x3 = (address)_Pi4x3; + address Pi4x4 = (address)_Pi4x4; + address ones = (address)_ones; + address CP = (address)_CP; + address SP = (address)_SP; + + bind(B1_1); + push(ebp); + movl(ebp, esp); + andl(esp, -64); + push(esi); + push(edi); + push(ebx); + subl(esp, 52); + movl(eax, Address(ebp, 16)); + movl(edx, Address(ebp, 20)); + movl(Address(esp, 32), eax); + movl(Address(esp, 36), edx); + + bind(B1_2); + fnstcw(Address(esp, 30)); + + bind(B1_3); + movsd(xmm1, Address(ebp, 8)); + movl(esi, Address(ebp, 12)); + movl(eax, esi); + andl(eax, 2147483647); + andps(xmm1, ExternalAddress(L_2il0floatpacket_0)); //0xffffffffUL, 0x7fffffffUL, 0x00000000UL, 0x00000000UL + shrl(esi, 31); + movl(Address(esp, 40), eax); + cmpl(eax, 1104150528); + movsd(Address(ebp, 8), xmm1); + jcc(Assembler::aboveEqual, B1_11); + + bind(B1_4); + movsd(xmm0, ExternalAddress(Pi4Inv)); //0x6dc9c883UL, 0x3ff45f30UL + mulsd(xmm0, xmm1); + movzwl(edx, Address(esp, 30)); + movl(eax, edx); + andl(eax, 768); + movsd(Address(esp, 0), xmm0); + cmpl(eax, 768); + jcc(Assembler::equal, B1_42); + + bind(B1_5); + orl(edx, -64768); + movw(Address(esp, 28), edx); + + bind(B1_6); + fldcw(Address(esp, 28)); + + bind(B1_7); + movsd(xmm1, Address(ebp, 8)); + movl(ebx, 1); + + bind(B1_8); + movl(Address(esp, 12), ebx); + movl(ebx, Address(esp, 4)); + movl(eax, ebx); + movl(Address(esp, 8), esi); + movl(esi, ebx); + shrl(esi, 20); + andl(eax, 1048575); + movl(ecx, esi); + orl(eax, 1048576); + negl(ecx); + movl(edx, eax); + addl(ecx, 19); + addl(esi, 13); + movl(Address(esp, 24), ecx); + shrl(edx); + movl(ecx, esi); + shll(eax); + movl(ecx, Address(esp, 24)); + movl(esi, Address(esp, 0)); + shrl(esi); + orl(eax, esi); + cmpl(ebx, 1094713344); + movsd(Address(esp, 16), xmm1); + fld_d(Address(esp, 16)); + cmov32(Assembler::below, eax, edx); + movl(esi, Address(esp, 8)); + lea(edx, Address(eax, 1)); + movl(ebx, edx); + andl(ebx, -2); + movl(Address(esp, 16), ebx); + fild_s(Address(esp, 16)); + movl(ebx, Address(esp, 12)); + cmpl(Address(esp, 40), 1094713344); + jcc(Assembler::aboveEqual, B1_10); + + bind(B1_9); + fld_d(ExternalAddress(Pi4x3)); //0x54443000UL, 0xbfe921fbUL + fmul(1); + faddp(2); + fld_d(ExternalAddress(8 + Pi4x3)); //0x3b39a000UL, 0x3d373dcbUL + fmul(1); + faddp(2); + fld_d(ExternalAddress(16 + Pi4x3)); //0xe0e68948UL, 0xba845c06UL + fmulp(1); + faddp(1); + jmp(B1_17); + + bind(B1_10); + fld_d(ExternalAddress(Pi4x4)); //0x54400000UL, 0xbfe921fbUL + fmul(1); + faddp(2); + fld_d(ExternalAddress(8 + Pi4x4)); //0x1a600000UL, 0xbdc0b461UL + fmul(1); + faddp(2); + fld_d(ExternalAddress(16 + Pi4x4)); //0x2e000000UL, 0xbb93198aUL + fmul(1); + faddp(2); + fld_d(ExternalAddress(24 + Pi4x4)); //0x252049c1UL, 0xb96b839aUL + fmulp(1); + faddp(1); + jmp(B1_17); + + bind(B1_11); + movzwl(edx, Address(esp, 30)); + movl(eax, edx); + andl(eax, 768); + cmpl(eax, 768); + jcc(Assembler::equal, B1_43); + bind(B1_12); + orl(edx, -64768); + movw(Address(esp, 28), edx); + + bind(B1_13); + fldcw(Address(esp, 28)); + + bind(B1_14); + movsd(xmm1, Address(ebp, 8)); + movl(ebx, 1); + + bind(B1_15); + movsd(Address(esp, 16), xmm1); + fld_d(Address(esp, 16)); + addl(esp, -32); + lea(eax, Address(esp, 32)); + fstp_x(Address(esp, 0)); + movl(Address(esp, 12), 0); + movl(Address(esp, 16), eax); + call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlibm_reduce_pi04l()))); + + bind(B1_46); + addl(esp, 32); + + bind(B1_16); + fld_d(Address(esp, 0)); + lea(edx, Address(eax, 1)); + fld_d(Address(esp, 8)); + faddp(1); + + bind(B1_17); + movl(ecx, edx); + addl(eax, 3); + shrl(ecx, 2); + andl(ecx, 1); + shrl(eax, 2); + xorl(esi, ecx); + movl(ecx, Address(esp, 36)); + andl(eax, 1); + andl(ecx, 3); + cmpl(ecx, 3); + jcc(Assembler::notEqual, B1_25); + + bind(B1_18); + fld_x(ExternalAddress(84 + SP)); //0x8610, 0x307f, 0x62 + fld_s(1); + fmul((2)); + testb(edx, 2); + fmula((1)); + fld_x(ExternalAddress(72 + SP)); //0x44a6, 0xed1a, 0x29 + faddp(2); + fmula(1); + fld_x(ExternalAddress(60 + SP)); //0xbf33, 0x8bb4, 0x2f + faddp(2); + fmula(1); + fld_x(ExternalAddress(48 + SP)); //0x825b, 0x3997, 0x2b + faddp(2); + fmula(1); + fld_x(ExternalAddress(36 + SP)); //0x45f6, 0xb616, 0x1d + faddp(2); + fmula(1); + fld_x(ExternalAddress(24 + SP)); //0xc527, 0x0d00, 0x00 + faddp(2); + fmula(1); + fld_x(ExternalAddress(12 + SP)); //0x8887, 0x8888, 0x88 + faddp(2); + fmula(1); + fld_x(ExternalAddress(SP)); //0xaaab, 0xaaaa, 0xaa + faddp(2); + fmula(1); + fld_x(ExternalAddress(84 + CP)); //0x3ac6, 0x0ba0, 0x07 + fmul(1); + fld_x(ExternalAddress(72 + CP)); //0xdaba, 0xfe79, 0xea + faddp(1); + fmul(1); + fld_x(ExternalAddress(62 + CP)); //0xd84d, 0xadee, 0xc6 + faddp(1); + fmul(1); + fld_x(ExternalAddress(48 + CP)); //0x03fe, 0x3f65, 0x7d + faddp(1); + fmul(1); + fld_x(ExternalAddress(36 + CP)); //0xf024, 0x0cac, 0x00 + faddp(1); + fmul(1); + fld_x(ExternalAddress(24 + CP)); //0x9c2f, 0x0b60, 0x60 + faddp(1); + fmul(1); + fld_x(ExternalAddress(12 + CP)); //0xaaa5, 0xaaaa, 0xaa + faddp(1); + fmul(1); + fld_x(ExternalAddress(CP)); //0x0000, 0x0000, 0x00 + faddp(1); + fmulp(1); + fld_d(Address(ones, RelocationHolder::none).plus_disp(esi, Address::times_8)); + fld_d(Address(ones, RelocationHolder::none).plus_disp(eax, Address::times_8)); + jcc(Assembler::equal, B1_22); + + bind(B1_19); + fmulp(4); + testl(ebx, ebx); + fxch(2); + fmul(3); + movl(eax, Address(esp, 2)); + faddp(3); + fxch(2); + fstp_d(Address(eax, 0)); + fmula(1); + faddp(1); + fstp_d(Address(eax, 8)); + jcc(Assembler::equal, B1_21); + + bind(B1_20); + fldcw(Address(esp, 30)); + + bind(B1_21); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + + bind(B1_22); + fxch(1); + fmulp(4); + testl(ebx, ebx); + fxch(2); + fmul(3); + movl(eax, Address(esp, 32)); + faddp(3); + fxch(2); + fstp_d(Address(eax, 8)); + fmula(1); + faddp(1); + fstp_d(Address(eax, 0)); + jcc(Assembler::equal, B1_24); + + bind(B1_23); + fldcw(Address(esp, 30)); + + bind(B1_24); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + + bind(B1_25); + testb(Address(esp, 36), 2); + jcc(Assembler::equal, B1_33); + + bind(B1_26); + fld_s(0); + testb(edx, 2); + fmul(1); + fld_s(0); + fmul(1); + jcc(Assembler::equal, B1_30); + + bind(B1_27); + fstp_d(2); + fld_x(ExternalAddress(84 + CP)); //0x3ac6, 0x0ba0, 0x07 + testl(ebx, ebx); + fmul(2); + fld_x(ExternalAddress(72 + CP)); //0xdaba, 0xfe79, 0xea + fmul(3); + fld_x(ExternalAddress(60 + CP)); //0xd84d, 0xadee, 0xc6 + movl(eax, Address(rsp, 32)); + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(48 + CP)); //0x03fe, 0x3f65, 0x7d + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(36 + CP)); //0xf024, 0x0cac, 0x00 + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(24 + CP)); //0x9c2f, 0x0b60, 0x60 + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(12 + CP)); //0xaaa5, 0xaaaa, 0xaa + faddp(2); + fxch(1); + fmulp(3); + fld_x(ExternalAddress(CP)); //0x0000, 0x0000, 0x00 + faddp(1); + fmulp(1); + faddp(1); + fld_d(Address(ones, RelocationHolder::none).plus_disp(rsi, Address::times_8)); + fmula(1); + faddp(1); + fstp_d(Address(eax, 8)); + jcc(Assembler::equal, B1_29); + + bind(B1_28); + fldcw(Address(esp, 30)); + + bind(B1_29); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + + bind(B1_30); + fld_x(ExternalAddress(84 + SP)); //0x8610, 0x307f, 0x62 + testl(ebx, ebx); + fmul(1); + fld_x(ExternalAddress(72 + SP)); //0x44a6, 0xed1a, 0x29 + fmul(2); + fld_x(ExternalAddress(60 + SP)); //0xbf33, 0x8bb4, 0x2f + movl(eax, Address(rsp, 32)); + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(48 + SP)); //0x825b, 0x3997, 0x2b + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(36 + SP)); //0x45f6, 0xb616, 0x1d + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(24 + SP)); //0xc527, 0x0d00, 0x00 + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(12 + SP)); //0x8887, 0x8888, 0x88 + faddp(2); + fxch(1); + fmulp(2); + fld_x(ExternalAddress(SP)); //0xaaab, 0xaaaa, 0xaa + faddp(1); + fmulp(2); + faddp(1); + fld_d(Address(ones, RelocationHolder::none).plus_disp(rsi, Address::times_8)); + fmulp(2); + fmul(1); + faddp(1); + fstp_d(Address(eax, 8)); + jcc(Assembler::equal, B1_32); + + bind(B1_31); + fldcw(Address(esp, 30)); + + bind(B1_32); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + + bind(B1_33); + testb(Address(esp, 36), 1); + jcc(Assembler::equal, B1_41); + + bind(B1_34); + fld_s(0); + testb(edx, 2); + fmul(1); + fld_s(0); + fmul(1); + jcc(Assembler::equal, B1_38); + + bind(B1_35); + fld_x(ExternalAddress(84 + SP)); //0x8610, 0x307f, 0x62 + testl(ebx, ebx); + fmul(1); + fld_x(ExternalAddress(72 + SP)); //0x44a6, 0xed1a, 0x29 + fmul(2); + fld_x(ExternalAddress(60 + SP)); //0xbf33, 0x8bb4, 0x2f + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(48 + SP)); //0x825b, 0x3997, 0x2b + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(36 + SP)); //0x45f6, 0xb616, 0x1d + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(24 + SP)); //0xc527, 0x0d00, 0x00 + faddp(2); + fxch(1); + fmul(2); + fld_x(ExternalAddress(12 + SP)); //0x8887, 0x8888, 0x88 + faddp(2); + fxch(1); + fmulp(2); + fld_x(ExternalAddress(SP)); //0xaaab, 0xaaaa, 0xaa + faddp(1); + fmulp(2); + faddp(1); + fld_d(Address(ones, RelocationHolder::none).plus_disp(eax, Address::times_8)); + fmulp(2); + fmul(1); + movl(eax, Address(esp, 32)); + faddp(1); + fstp_d(Address(eax, 0)); + jcc(Assembler::equal, B1_37); + + bind(B1_36); + fldcw(Address(esp, 30)); + + bind(B1_37); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + + bind(B1_38); + fstp_d(2); + fld_x(ExternalAddress(84 + CP)); //0x3ac6, 0x0ba0, 0x07 + testl(ebx, ebx); + fmul(2); + fld_x(ExternalAddress(72 + CP)); //0xdaba, 0xfe79, 0xea + fmul(3); + fld_x(ExternalAddress(60 + CP)); //0xd84d, 0xadee, 0xc6 + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(48 + CP)); //0x03fe, 0x3f65, 0x7d + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(36 + CP)); //0xf024, 0x0cac, 0x00 + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(24 + CP)); //0x9c2f, 0x0b60, 0x60 + faddp(2); + fxch(1); + fmul(3); + fld_x(ExternalAddress(12 + CP)); //0xaaa5, 0xaaaa, 0xaa + faddp(2); + fxch(1); + fmulp(3); + fld_x(ExternalAddress(CP)); //0x0000, 0x0000, 0x00 + faddp(1); + fmulp(1); + faddp(1); + fld_d(Address(ones, RelocationHolder::none).plus_disp(eax, Address::times_8)); + fmula(1); + movl(eax, Address(esp, 32)); + faddp(1); + fstp_d(Address(eax, 0)); + jcc(Assembler::equal, B1_40); + + bind(B1_39); + fldcw(Address(esp, 30)); + bind(B1_40); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + bind(B1_41); + fstp_d(0); + addl(esp, 52); + pop(ebx); + pop(edi); + pop(esi); + movl(esp, ebp); + pop(ebp); + ret(0); + bind(B1_42); + xorl(ebx, ebx); + jmp(B1_8); + bind(B1_43); + xorl(ebx, ebx); + jmp(B1_15); +} + +ALIGNED_(16) juint _static_const_table_sin[] = +{ + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, 0xbf73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, + 0xc0000000UL, 0xbc626d19UL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, + 0xbfa60beaUL, 0x2ed59f06UL, 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, + 0x00000000UL, 0x3ff00000UL, 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, + 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, 0x00000000UL, 0x3ff00000UL, + 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, 0x20000000UL, + 0x3c5e0d89UL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, 0xbfc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0x3ff00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, + 0x20000000UL, 0x3c68076aUL, 0x00000000UL, 0x3ff00000UL, 0x99fcef32UL, + 0x3fca8279UL, 0x667f3bcdUL, 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, + 0x00000000UL, 0x3fe00000UL, 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, + 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, 0x00000000UL, 0x3fe00000UL, + 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, 0xe0000000UL, + 0x3c39f630UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, 0xbf9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0x3fe00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0x3fed906bUL, + 0x20000000UL, 0x3c7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x76acf82dUL, + 0x3fa4a031UL, 0x56c62ddaUL, 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, + 0x00000000UL, 0x3fd00000UL, 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, + 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, 0x00000000UL, 0x3fd00000UL, + 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, 0x40000000UL, + 0xbc887df6UL, 0x00000000UL, 0x3fc00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, + 0x40000000UL, 0xbc887df6UL, 0x00000000UL, 0xbfc00000UL, 0x0e5967d5UL, + 0x3fac1d1fUL, 0xcff75cb0UL, 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, + 0x00000000UL, 0xbfd00000UL, 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, + 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, 0x00000000UL, 0xbfd00000UL, + 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, 0x3fed906bUL, 0x20000000UL, + 0x3c7457e6UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, 0x3f9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, + 0xe0000000UL, 0x3c39f630UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, + 0xbfc133ccUL, 0x6b151741UL, 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, + 0x00000000UL, 0xbfe00000UL, 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, + 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, 0x00000000UL, 0xbfe00000UL, + 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, 0x20000000UL, + 0x3c68076aUL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, 0x3fc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, + 0x20000000UL, 0x3c5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, + 0x3fb37ca1UL, 0xa6aea963UL, 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, + 0x00000000UL, 0xbff00000UL, 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, + 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, 0x00000000UL, 0xbff00000UL, + 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, 0xc0000000UL, + 0xbc626d19UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, 0x3f73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0xbff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, + 0x3f73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0xbff00000UL, 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, + 0xbfc8f8b8UL, 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0xbff00000UL, + 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, + 0x3c75d28dUL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, 0x3fb37ca1UL, + 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, 0x3c672cedUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0xbfde2b5dUL, + 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, + 0x3fc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0xbff00000UL, 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, + 0xbfe44cf3UL, 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0xbff00000UL, + 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, + 0x3c8bdd34UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, 0xbfc133ccUL, + 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, 0x3c82c5e1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0xbfea9b66UL, + 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, + 0x3f9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0xbfe00000UL, 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, + 0xbfed906bUL, 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0xbfe00000UL, + 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, + 0xbc8760b1UL, 0x00000000UL, 0xbfd00000UL, 0x0e5967d5UL, 0x3fac1d1fUL, + 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, 0xbc756217UL, 0x00000000UL, + 0xbfd00000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0xbfefd88dUL, + 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0xbfc00000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, + 0xbfefd88dUL, 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0x3fc00000UL, + 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, + 0xbc756217UL, 0x00000000UL, 0x3fd00000UL, 0x76acf82dUL, 0x3fa4a031UL, + 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, 0xbc8760b1UL, 0x00000000UL, + 0x3fd00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0xbfed906bUL, + 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, + 0xbf9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0x3fe00000UL, 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, + 0xbfea9b66UL, 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0x3fe00000UL, + 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, + 0x3c82c5e1UL, 0x00000000UL, 0x3fe00000UL, 0x99fcef32UL, 0x3fca8279UL, + 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, 0x3c8bdd34UL, 0x00000000UL, + 0x3fe00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0xbfe44cf3UL, + 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, + 0xbfc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0x3ff00000UL, 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, + 0xbfde2b5dUL, 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0x3ff00000UL, + 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, + 0x3c672cedUL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, 0xbfa60beaUL, + 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, 0x3c75d28dUL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0xbfc8f8b8UL, + 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, + 0xbf73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0x3ff00000UL, 0x55555555UL, 0xbfc55555UL, 0x00000000UL, + 0xbfe00000UL, 0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL, + 0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL, 0xa556c734UL, + 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL, 0x1a600000UL, 0x3d90b461UL, + 0x1a600000UL, 0x3d90b461UL, 0x54400000UL, 0x3fb921fbUL, 0x00000000UL, + 0x00000000UL, 0x2e037073UL, 0x3b63198aUL, 0x00000000UL, 0x00000000UL, + 0x6dc9c883UL, 0x40245f30UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x43380000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x43600000UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x3c800000UL, 0x00000000UL, + 0x00000000UL, 0xffffffffUL, 0x3fefffffUL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x80000000UL, 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x3fe00000UL, + 0x00000000UL, 0x3fe00000UL +}; + +void MacroAssembler::fast_sin(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ebx, Register edx) { + + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, start; + assert_different_registers(eax, ebx, edx); + address static_const_table_sin = (address)_static_const_table_sin; + + bind(start); + subl(rsp, 120); + movl(Address(rsp, 56), ebx); + lea(ebx, ExternalAddress(static_const_table_sin)); + movsd(xmm0, Address(rsp, 128)); + pextrw(eax, xmm0, 3); + andl(eax, 32767); + subl(eax, 12336); + cmpl(eax, 4293); + jcc(Assembler::above, L_2TAG_PACKET_0_0_2); + movsd(xmm1, Address(ebx, 2160)); + mulsd(xmm1, xmm0); + movsd(xmm5, Address(ebx, 2272)); + movdqu(xmm4, Address(ebx, 2256)); + pand(xmm4, xmm0); + por(xmm5, xmm4); + movsd(xmm3, Address(ebx, 2128)); + movdqu(xmm2, Address(ebx, 2112)); + addpd(xmm1, xmm5); + cvttsd2sil(edx, xmm1); + cvtsi2sdl(xmm1, edx); + mulsd(xmm3, xmm1); + unpcklpd(xmm1, xmm1); + addl(edx, 1865216); + movdqu(xmm4, xmm0); + andl(edx, 63); + movdqu(xmm5, Address(ebx, 2096)); + lea(eax, Address(ebx, 0)); + shll(edx, 5); + addl(eax, edx); + mulpd(xmm2, xmm1); + subsd(xmm0, xmm3); + mulsd(xmm1, Address(ebx, 2144)); + subsd(xmm4, xmm3); + movsd(xmm7, Address(eax, 8)); + unpcklpd(xmm0, xmm0); + movapd(xmm3, xmm4); + subsd(xmm4, xmm2); + mulpd(xmm5, xmm0); + subpd(xmm0, xmm2); + movdqu(xmm6, Address(ebx, 2064)); + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm2); + movdqu(xmm2, Address(eax, 0)); + subsd(xmm1, xmm3); + movsd(xmm3, Address(eax, 24)); + addsd(xmm2, xmm3); + subsd(xmm7, xmm2); + mulsd(xmm2, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, Address(ebx, 2080)); + mulsd(xmm4, Address(eax, 0)); + addpd(xmm6, Address(ebx, 2048)); + mulpd(xmm5, xmm0); + movapd(xmm0, xmm3); + addsd(xmm3, Address(eax, 8)); + mulpd(xmm1, xmm7); + movapd(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movsd(xmm5, Address(eax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(eax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm5, xmm0); + addsd(xmm3, xmm7); + addsd(xmm1, xmm5); + addsd(xmm1, xmm3); + addsd(xmm1, xmm6); + unpckhpd(xmm6, xmm6); + addsd(xmm1, xmm6); + addsd(xmm4, xmm1); + movsd(Address(rsp, 0), xmm4); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_0_0_2); + jcc(Assembler::greater, L_2TAG_PACKET_2_0_2); + shrl(eax, 4); + cmpl(eax, 268434685); + jcc(Assembler::notEqual, L_2TAG_PACKET_3_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_3_0_2); + movsd(xmm3, Address(ebx, 2192)); + mulsd(xmm3, xmm0); + subsd(xmm3, xmm0); + mulsd(xmm3, Address(ebx, 2208)); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movl(eax, Address(rsp, 132)); + andl(eax, 2146435072); + cmpl(eax, 2146435072); + jcc(Assembler::equal, L_2TAG_PACKET_4_0_2); + subl(rsp, 32); + movsd(Address(rsp, 0), xmm0); + lea(eax, Address(rsp, 40)); + movl(Address(rsp, 8), eax); + movl(eax, 2); + movl(Address(rsp, 12), eax); + call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlibm_sin_cos_huge()))); + addl(rsp, 32); + fld_d(Address(rsp, 16)); + jmp(L_2TAG_PACKET_1_0_2); + bind(L_2TAG_PACKET_4_0_2); + fld_d(Address(rsp, 128)); + fmul_d(Address(ebx, 2240)); + bind(L_2TAG_PACKET_1_0_2); + movl(ebx, Address(rsp, 56)); +} + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - COS() +// --------------------- +// +// 1. RANGE REDUCTION +// +// We perform an initial range reduction from X to r with +// +// X =~= N * pi/32 + r +// +// so that |r| <= pi/64 + epsilon. We restrict inputs to those +// where |N| <= 932560. Beyond this, the range reduction is +// insufficiently accurate. For extremely small inputs, +// denormalization can occur internally, impacting performance. +// This means that the main path is actually only taken for +// 2^-252 <= |X| < 90112. +// +// To avoid branches, we perform the range reduction to full +// accuracy each time. +// +// X - N * (P_1 + P_2 + P_3) +// +// where P_1 and P_2 are 32-bit numbers (so multiplication by N +// is exact) and P_3 is a 53-bit number. Together, these +// approximate pi well enough for all cases in the restricted +// range. +// +// The main reduction sequence is: +// +// y = 32/pi * x +// N = integer(y) +// (computed by adding and subtracting off SHIFTER) +// +// m_1 = N * P_1 +// m_2 = N * P_2 +// r_1 = x - m_1 +// r = r_1 - m_2 +// (this r can be used for most of the calculation) +// +// c_1 = r_1 - r +// m_3 = N * P_3 +// c_2 = c_1 - m_2 +// c = c_2 - m_3 +// +// 2. MAIN ALGORITHM +// +// The algorithm uses a table lookup based on B = M * pi / 32 +// where M = N mod 64. The stored values are: +// sigma closest power of 2 to cos(B) +// C_hl 53-bit cos(B) - sigma +// S_hi + S_lo 2 * 53-bit sin(B) +// +// The computation is organized as follows: +// +// sin(B + r + c) = [sin(B) + sigma * r] + +// r * (cos(B) - sigma) + +// sin(B) * [cos(r + c) - 1] + +// cos(B) * [sin(r + c) - r] +// +// which is approximately: +// +// [S_hi + sigma * r] + +// C_hl * r + +// S_lo + S_hi * [(cos(r) - 1) - r * c] + +// (C_hl + sigma) * [(sin(r) - r) + c] +// +// and this is what is actually computed. We separate this sum +// into four parts: +// +// hi + med + pols + corr +// +// where +// +// hi = S_hi + sigma r +// med = C_hl * r +// pols = S_hi * (cos(r) - 1) + (C_hl + sigma) * (sin(r) - r) +// corr = S_lo + c * ((C_hl + sigma) - S_hi * r) +// +// 3. POLYNOMIAL +// +// The polynomial S_hi * (cos(r) - 1) + (C_hl + sigma) * +// (sin(r) - r) can be rearranged freely, since it is quite +// small, so we exploit parallelism to the fullest. +// +// psc4 = SC_4 * r_1 +// msc4 = psc4 * r +// r2 = r * r +// msc2 = SC_2 * r2 +// r4 = r2 * r2 +// psc3 = SC_3 + msc4 +// psc1 = SC_1 + msc2 +// msc3 = r4 * psc3 +// sincospols = psc1 + msc3 +// pols = sincospols * +// +// +// 4. CORRECTION TERM +// +// This is where the "c" component of the range reduction is +// taken into account; recall that just "r" is used for most of +// the calculation. +// +// -c = m_3 - c_2 +// -d = S_hi * r - (C_hl + sigma) +// corr = -c * -d + S_lo +// +// 5. COMPENSATED SUMMATIONS +// +// The two successive compensated summations add up the high +// and medium parts, leaving just the low parts to add up at +// the end. +// +// rs = sigma * r +// res_int = S_hi + rs +// k_0 = S_hi - res_int +// k_2 = k_0 + rs +// med = C_hl * r +// res_hi = res_int + med +// k_1 = res_int - res_hi +// k_3 = k_1 + med +// +// 6. FINAL SUMMATION +// +// We now add up all the small parts: +// +// res_lo = pols(hi) + pols(lo) + corr + k_1 + k_3 +// +// Now the overall result is just: +// +// res_hi + res_lo +// +// 7. SMALL ARGUMENTS +// +// Inputs with |X| < 2^-252 are treated specially as +// 1 - |x|. +// +// Special cases: +// cos(NaN) = quiet NaN, and raise invalid exception +// cos(INF) = NaN and raise invalid exception +// cos(0) = 1 +// +/******************************************************************************/ + +ALIGNED_(16) juint _static_const_table_cos[] = +{ + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, 0xbf73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, + 0xc0000000UL, 0xbc626d19UL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, + 0xbfa60beaUL, 0x2ed59f06UL, 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, + 0x00000000UL, 0x3ff00000UL, 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, + 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, 0x00000000UL, 0x3ff00000UL, + 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, 0x20000000UL, + 0x3c5e0d89UL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, 0xbfc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0x3ff00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, + 0x20000000UL, 0x3c68076aUL, 0x00000000UL, 0x3ff00000UL, 0x99fcef32UL, + 0x3fca8279UL, 0x667f3bcdUL, 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, + 0x00000000UL, 0x3fe00000UL, 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, + 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, 0x00000000UL, 0x3fe00000UL, + 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, 0xe0000000UL, + 0x3c39f630UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, 0xbf9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0x3fe00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0x3fed906bUL, + 0x20000000UL, 0x3c7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x76acf82dUL, + 0x3fa4a031UL, 0x56c62ddaUL, 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, + 0x00000000UL, 0x3fd00000UL, 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, + 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, 0x00000000UL, 0x3fd00000UL, + 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, 0x40000000UL, + 0xbc887df6UL, 0x00000000UL, 0x3fc00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, + 0x40000000UL, 0xbc887df6UL, 0x00000000UL, 0xbfc00000UL, 0x0e5967d5UL, + 0x3fac1d1fUL, 0xcff75cb0UL, 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, + 0x00000000UL, 0xbfd00000UL, 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, + 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, 0x00000000UL, 0xbfd00000UL, + 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, 0x3fed906bUL, 0x20000000UL, + 0x3c7457e6UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, 0x3f9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, + 0xe0000000UL, 0x3c39f630UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, + 0xbfc133ccUL, 0x6b151741UL, 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, + 0x00000000UL, 0xbfe00000UL, 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, + 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, 0x00000000UL, 0xbfe00000UL, + 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, 0x20000000UL, + 0x3c68076aUL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, 0x3fc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, + 0x20000000UL, 0x3c5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, + 0x3fb37ca1UL, 0xa6aea963UL, 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, + 0x00000000UL, 0xbff00000UL, 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, + 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, 0x00000000UL, 0xbff00000UL, + 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, 0xc0000000UL, + 0xbc626d19UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, 0x3f73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0xbff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, + 0x3f73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0xbff00000UL, 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, + 0xbfc8f8b8UL, 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0xbff00000UL, + 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, + 0x3c75d28dUL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, 0x3fb37ca1UL, + 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, 0x3c672cedUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0xbfde2b5dUL, + 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, + 0x3fc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0xbff00000UL, 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, + 0xbfe44cf3UL, 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0xbff00000UL, + 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, + 0x3c8bdd34UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, 0xbfc133ccUL, + 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, 0x3c82c5e1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0xbfea9b66UL, + 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, + 0x3f9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0xbfe00000UL, 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, + 0xbfed906bUL, 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0xbfe00000UL, + 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, + 0xbc8760b1UL, 0x00000000UL, 0xbfd00000UL, 0x0e5967d5UL, 0x3fac1d1fUL, + 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, 0xbc756217UL, 0x00000000UL, + 0xbfd00000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0xbfefd88dUL, + 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0xbfc00000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, + 0xbfefd88dUL, 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0x3fc00000UL, + 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, + 0xbc756217UL, 0x00000000UL, 0x3fd00000UL, 0x76acf82dUL, 0x3fa4a031UL, + 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, 0xbc8760b1UL, 0x00000000UL, + 0x3fd00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0xbfed906bUL, + 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, + 0xbf9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0x3fe00000UL, 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, + 0xbfea9b66UL, 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0x3fe00000UL, + 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, + 0x3c82c5e1UL, 0x00000000UL, 0x3fe00000UL, 0x99fcef32UL, 0x3fca8279UL, + 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, 0x3c8bdd34UL, 0x00000000UL, + 0x3fe00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0xbfe44cf3UL, + 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, + 0xbfc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0x3ff00000UL, 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, + 0xbfde2b5dUL, 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0x3ff00000UL, + 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, + 0x3c672cedUL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, 0xbfa60beaUL, + 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, 0x3c75d28dUL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0xbfc8f8b8UL, + 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, + 0xbf73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0x3ff00000UL, 0x55555555UL, 0xbfc55555UL, 0x00000000UL, + 0xbfe00000UL, 0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL, + 0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL, 0xa556c734UL, + 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL, 0x1a600000UL, 0x3d90b461UL, + 0x1a600000UL, 0x3d90b461UL, 0x54400000UL, 0x3fb921fbUL, 0x00000000UL, + 0x00000000UL, 0x2e037073UL, 0x3b63198aUL, 0x00000000UL, 0x00000000UL, + 0x6dc9c883UL, 0x40245f30UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x43380000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x3ff00000UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x80000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL +}; + +//registers, +// input: (rbp + 8) +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// rax, rdx, rcx, rbx (tmp) + +// Code generated by Intel C compiler for LIBM library + +void MacroAssembler::fast_cos(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; + Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, B1_3, B1_5, start; + + assert_different_registers(tmp, eax, ecx, edx); + + address static_const_table_cos = (address)_static_const_table_cos; + + bind(start); + subl(rsp, 120); + movl(Address(rsp, 56), tmp); + lea(tmp, ExternalAddress(static_const_table_cos)); + movsd(xmm0, Address(rsp, 128)); + pextrw(eax, xmm0, 3); + andl(eax, 32767); + subl(eax, 12336); + cmpl(eax, 4293); + jcc(Assembler::above, L_2TAG_PACKET_0_0_2); + movsd(xmm1, Address(tmp, 2160)); + mulsd(xmm1, xmm0); + movdqu(xmm5, Address(tmp, 2240)); + movsd(xmm4, Address(tmp, 2224)); + pand(xmm4, xmm0); + por(xmm5, xmm4); + movsd(xmm3, Address(tmp, 2128)); + movdqu(xmm2, Address(tmp, 2112)); + addpd(xmm1, xmm5); + cvttsd2sil(edx, xmm1); + cvtsi2sdl(xmm1, edx); + mulsd(xmm3, xmm1); + unpcklpd(xmm1, xmm1); + addl(edx, 1865232); + movdqu(xmm4, xmm0); + andl(edx, 63); + movdqu(xmm5, Address(tmp, 2096)); + lea(eax, Address(tmp, 0)); + shll(edx, 5); + addl(eax, edx); + mulpd(xmm2, xmm1); + subsd(xmm0, xmm3); + mulsd(xmm1, Address(tmp, 2144)); + subsd(xmm4, xmm3); + movsd(xmm7, Address(eax, 8)); + unpcklpd(xmm0, xmm0); + movapd(xmm3, xmm4); + subsd(xmm4, xmm2); + mulpd(xmm5, xmm0); + subpd(xmm0, xmm2); + movdqu(xmm6, Address(tmp, 2064)); + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm2); + movdqu(xmm2, Address(eax, 0)); + subsd(xmm1, xmm3); + movsd(xmm3, Address(eax, 24)); + addsd(xmm2, xmm3); + subsd(xmm7, xmm2); + mulsd(xmm2, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, Address(tmp, 2080)); + mulsd(xmm4, Address(eax, 0)); + addpd(xmm6, Address(tmp, 2048)); + mulpd(xmm5, xmm0); + movapd(xmm0, xmm3); + addsd(xmm3, Address(eax, 8)); + mulpd(xmm1, xmm7); + movapd(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movsd(xmm5, Address(eax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(eax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm5, xmm0); + addsd(xmm3, xmm7); + addsd(xmm1, xmm5); + addsd(xmm1, xmm3); + addsd(xmm1, xmm6); + unpckhpd(xmm6, xmm6); + addsd(xmm1, xmm6); + addsd(xmm4, xmm1); + movsd(Address(rsp, 0), xmm4); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_0_0_2); + jcc(Assembler::greater, L_2TAG_PACKET_2_0_2); + pextrw(eax, xmm0, 3); + andl(eax, 32767); + pinsrw(xmm0, eax, 3); + movsd(xmm1, Address(tmp, 2192)); + subsd(xmm1, xmm0); + movsd(Address(rsp, 0), xmm1); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movl(eax, Address(rsp, 132)); + andl(eax, 2146435072); + cmpl(eax, 2146435072); + jcc(Assembler::equal, L_2TAG_PACKET_3_0_2); + subl(rsp, 32); + movsd(Address(rsp, 0), xmm0); + lea(eax, Address(rsp, 40)); + movl(Address(rsp, 8), eax); + movl(eax, 1); + movl(Address(rsp, 12), eax); + call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlibm_sin_cos_huge()))); + addl(rsp, 32); + fld_d(Address(rsp, 8)); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_3_0_2); + fld_d(Address(rsp, 128)); + fmul_d(Address(tmp, 2208)); + + bind(L_2TAG_PACKET_1_0_2); + movl(tmp, Address(rsp, 56)); +} + diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_64.cpp similarity index 53% rename from hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp rename to hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_64.cpp index e94f1d7136f..f2f2211d88b 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_libm_x86_64.cpp @@ -35,7 +35,7 @@ #define ALIGNED_(x) __attribute__ ((aligned(x))) #endif -// The 32 bit and 64 bit code is at most SSE2 compliant +// The 64 bit code is at most SSE2 compliant /******************************************************************************/ // ALGORITHM DESCRIPTION - EXP() @@ -71,8 +71,6 @@ // /******************************************************************************/ -#ifdef _LP64 - ALIGNED_(16) juint _cv[] = { 0x652b82feUL, 0x40571547UL, 0x652b82feUL, 0x40571547UL, 0xfefa0000UL, @@ -411,273 +409,6 @@ void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm addq(rsp, 24); } -#endif // _LP64 - -#ifndef _LP64 - -ALIGNED_(16) juint _static_const_table[] = -{ - 0x00000000UL, 0xfff00000UL, 0x00000000UL, 0xfff00000UL, 0xffffffc0UL, - 0x00000000UL, 0xffffffc0UL, 0x00000000UL, 0x0000ffc0UL, 0x00000000UL, - 0x0000ffc0UL, 0x00000000UL, 0x00000000UL, 0x43380000UL, 0x00000000UL, - 0x43380000UL, 0x652b82feUL, 0x40571547UL, 0x652b82feUL, 0x40571547UL, - 0xfefa0000UL, 0x3f862e42UL, 0xfefa0000UL, 0x3f862e42UL, 0xbc9e3b3aUL, - 0x3d1cf79aUL, 0xbc9e3b3aUL, 0x3d1cf79aUL, 0xfffffffeUL, 0x3fdfffffUL, - 0xfffffffeUL, 0x3fdfffffUL, 0xe3289860UL, 0x3f56c15cUL, 0x555b9e25UL, - 0x3fa55555UL, 0xc090cf0fUL, 0x3f811115UL, 0x55548ba1UL, 0x3fc55555UL, - 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x0e03754dUL, - 0x3cad7bbfUL, 0x3e778060UL, 0x00002c9aUL, 0x3567f613UL, 0x3c8cd252UL, - 0xd3158574UL, 0x000059b0UL, 0x61e6c861UL, 0x3c60f74eUL, 0x18759bc8UL, - 0x00008745UL, 0x5d837b6cUL, 0x3c979aa6UL, 0x6cf9890fUL, 0x0000b558UL, - 0x702f9cd1UL, 0x3c3ebe3dUL, 0x32d3d1a2UL, 0x0000e3ecUL, 0x1e63bcd8UL, - 0x3ca3516eUL, 0xd0125b50UL, 0x00011301UL, 0x26f0387bUL, 0x3ca4c554UL, - 0xaea92ddfUL, 0x0001429aUL, 0x62523fb6UL, 0x3ca95153UL, 0x3c7d517aUL, - 0x000172b8UL, 0x3f1353bfUL, 0x3c8b898cUL, 0xeb6fcb75UL, 0x0001a35bUL, - 0x3e3a2f5fUL, 0x3c9aecf7UL, 0x3168b9aaUL, 0x0001d487UL, 0x44a6c38dUL, - 0x3c8a6f41UL, 0x88628cd6UL, 0x0002063bUL, 0xe3a8a894UL, 0x3c968efdUL, - 0x6e756238UL, 0x0002387aUL, 0x981fe7f2UL, 0x3c80472bUL, 0x65e27cddUL, - 0x00026b45UL, 0x6d09ab31UL, 0x3c82f7e1UL, 0xf51fdee1UL, 0x00029e9dUL, - 0x720c0ab3UL, 0x3c8b3782UL, 0xa6e4030bUL, 0x0002d285UL, 0x4db0abb6UL, - 0x3c834d75UL, 0x0a31b715UL, 0x000306feUL, 0x5dd3f84aUL, 0x3c8fdd39UL, - 0xb26416ffUL, 0x00033c08UL, 0xcc187d29UL, 0x3ca12f8cUL, 0x373aa9caUL, - 0x000371a7UL, 0x738b5e8bUL, 0x3ca7d229UL, 0x34e59ff6UL, 0x0003a7dbUL, - 0xa72a4c6dUL, 0x3c859f48UL, 0x4c123422UL, 0x0003dea6UL, 0x259d9205UL, - 0x3ca8b846UL, 0x21f72e29UL, 0x0004160aUL, 0x60c2ac12UL, 0x3c4363edUL, - 0x6061892dUL, 0x00044e08UL, 0xdaa10379UL, 0x3c6ecce1UL, 0xb5c13cd0UL, - 0x000486a2UL, 0xbb7aafb0UL, 0x3c7690ceUL, 0xd5362a27UL, 0x0004bfdaUL, - 0x9b282a09UL, 0x3ca083ccUL, 0x769d2ca6UL, 0x0004f9b2UL, 0xc1aae707UL, - 0x3ca509b0UL, 0x569d4f81UL, 0x0005342bUL, 0x18fdd78eUL, 0x3c933505UL, - 0x36b527daUL, 0x00056f47UL, 0xe21c5409UL, 0x3c9063e1UL, 0xdd485429UL, - 0x0005ab07UL, 0x2b64c035UL, 0x3c9432e6UL, 0x15ad2148UL, 0x0005e76fUL, - 0x99f08c0aUL, 0x3ca01284UL, 0xb03a5584UL, 0x0006247eUL, 0x0073dc06UL, - 0x3c99f087UL, 0x82552224UL, 0x00066238UL, 0x0da05571UL, 0x3c998d4dUL, - 0x667f3bccUL, 0x0006a09eUL, 0x86ce4786UL, 0x3ca52bb9UL, 0x3c651a2eUL, - 0x0006dfb2UL, 0x206f0dabUL, 0x3ca32092UL, 0xe8ec5f73UL, 0x00071f75UL, - 0x8e17a7a6UL, 0x3ca06122UL, 0x564267c8UL, 0x00075febUL, 0x461e9f86UL, - 0x3ca244acUL, 0x73eb0186UL, 0x0007a114UL, 0xabd66c55UL, 0x3c65ebe1UL, - 0x36cf4e62UL, 0x0007e2f3UL, 0xbbff67d0UL, 0x3c96fe9fUL, 0x994cce12UL, - 0x00082589UL, 0x14c801dfUL, 0x3c951f14UL, 0x9b4492ecUL, 0x000868d9UL, - 0xc1f0eab4UL, 0x3c8db72fUL, 0x422aa0dbUL, 0x0008ace5UL, 0x59f35f44UL, - 0x3c7bf683UL, 0x99157736UL, 0x0008f1aeUL, 0x9c06283cUL, 0x3ca360baUL, - 0xb0cdc5e4UL, 0x00093737UL, 0x20f962aaUL, 0x3c95e8d1UL, 0x9fde4e4fUL, - 0x00097d82UL, 0x2b91ce27UL, 0x3c71affcUL, 0x82a3f090UL, 0x0009c491UL, - 0x589a2ebdUL, 0x3c9b6d34UL, 0x7b5de564UL, 0x000a0c66UL, 0x9ab89880UL, - 0x3c95277cUL, 0xb23e255cUL, 0x000a5503UL, 0x6e735ab3UL, 0x3c846984UL, - 0x5579fdbfUL, 0x000a9e6bUL, 0x92cb3387UL, 0x3c8c1a77UL, 0x995ad3adUL, - 0x000ae89fUL, 0xdc2d1d96UL, 0x3ca22466UL, 0xb84f15faUL, 0x000b33a2UL, - 0xb19505aeUL, 0x3ca1112eUL, 0xf2fb5e46UL, 0x000b7f76UL, 0x0a5fddcdUL, - 0x3c74ffd7UL, 0x904bc1d2UL, 0x000bcc1eUL, 0x30af0cb3UL, 0x3c736eaeUL, - 0xdd85529cUL, 0x000c199bUL, 0xd10959acUL, 0x3c84e08fUL, 0x2e57d14bUL, - 0x000c67f1UL, 0x6c921968UL, 0x3c676b2cUL, 0xdcef9069UL, 0x000cb720UL, - 0x36df99b3UL, 0x3c937009UL, 0x4a07897bUL, 0x000d072dUL, 0xa63d07a7UL, - 0x3c74a385UL, 0xdcfba487UL, 0x000d5818UL, 0xd5c192acUL, 0x3c8e5a50UL, - 0x03db3285UL, 0x000da9e6UL, 0x1c4a9792UL, 0x3c98bb73UL, 0x337b9b5eUL, - 0x000dfc97UL, 0x603a88d3UL, 0x3c74b604UL, 0xe78b3ff6UL, 0x000e502eUL, - 0x92094926UL, 0x3c916f27UL, 0xa2a490d9UL, 0x000ea4afUL, 0x41aa2008UL, - 0x3c8ec3bcUL, 0xee615a27UL, 0x000efa1bUL, 0x31d185eeUL, 0x3c8a64a9UL, - 0x5b6e4540UL, 0x000f5076UL, 0x4d91cd9dUL, 0x3c77893bUL, 0x819e90d8UL, - 0x000fa7c1UL, 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x7ff00000UL, - 0x00000000UL, 0x00000000UL, 0xffffffffUL, 0x7fefffffUL, 0x00000000UL, - 0x00100000UL -}; - -//registers, -// input: (rbp + 8) -// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 -// rax, rdx, rcx, rbx (tmp) - -// Code generated by Intel C compiler for LIBM library - -void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { - Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; - Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; - Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; - Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, B1_3, B1_5, start; - - assert_different_registers(tmp, eax, ecx, edx); - jmp(start); - address static_const_table = (address)_static_const_table; - - bind(start); - subl(rsp, 120); - movl(Address(rsp, 64), tmp); - lea(tmp, ExternalAddress(static_const_table)); - movdqu(xmm0, Address(rsp, 128)); - unpcklpd(xmm0, xmm0); - movdqu(xmm1, Address(tmp, 64)); // 0x652b82feUL, 0x40571547UL, 0x652b82feUL, 0x40571547UL - movdqu(xmm6, Address(tmp, 48)); // 0x00000000UL, 0x43380000UL, 0x00000000UL, 0x43380000UL - movdqu(xmm2, Address(tmp, 80)); // 0xfefa0000UL, 0x3f862e42UL, 0xfefa0000UL, 0x3f862e42UL - movdqu(xmm3, Address(tmp, 96)); // 0xbc9e3b3aUL, 0x3d1cf79aUL, 0xbc9e3b3aUL, 0x3d1cf79aUL - pextrw(eax, xmm0, 3); - andl(eax, 32767); - movl(edx, 16527); - subl(edx, eax); - subl(eax, 15504); - orl(edx, eax); - cmpl(edx, INT_MIN); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); - mulpd(xmm1, xmm0); - addpd(xmm1, xmm6); - movapd(xmm7, xmm1); - subpd(xmm1, xmm6); - mulpd(xmm2, xmm1); - movdqu(xmm4, Address(tmp, 128)); // 0xe3289860UL, 0x3f56c15cUL, 0x555b9e25UL, 0x3fa55555UL - mulpd(xmm3, xmm1); - movdqu(xmm5, Address(tmp, 144)); // 0xc090cf0fUL, 0x3f811115UL, 0x55548ba1UL, 0x3fc55555UL - subpd(xmm0, xmm2); - movdl(eax, xmm7); - movl(ecx, eax); - andl(ecx, 63); - shll(ecx, 4); - sarl(eax, 6); - movl(edx, eax); - movdqu(xmm6, Address(tmp, 16)); // 0xffffffc0UL, 0x00000000UL, 0xffffffc0UL, 0x00000000UL - pand(xmm7, xmm6); - movdqu(xmm6, Address(tmp, 32)); // 0x0000ffc0UL, 0x00000000UL, 0x0000ffc0UL, 0x00000000UL - paddq(xmm7, xmm6); - psllq(xmm7, 46); - subpd(xmm0, xmm3); - movdqu(xmm2, Address(tmp, ecx, Address::times_1, 160)); - mulpd(xmm4, xmm0); - movapd(xmm6, xmm0); - movapd(xmm1, xmm0); - mulpd(xmm6, xmm6); - mulpd(xmm0, xmm6); - addpd(xmm5, xmm4); - mulsd(xmm0, xmm6); - mulpd(xmm6, Address(tmp, 112)); // 0xfffffffeUL, 0x3fdfffffUL, 0xfffffffeUL, 0x3fdfffffUL - addsd(xmm1, xmm2); - unpckhpd(xmm2, xmm2); - mulpd(xmm0, xmm5); - addsd(xmm1, xmm0); - por(xmm2, xmm7); - unpckhpd(xmm0, xmm0); - addsd(xmm0, xmm1); - addsd(xmm0, xmm6); - addl(edx, 894); - cmpl(edx, 1916); - jcc (Assembler::above, L_2TAG_PACKET_1_0_2); - mulsd(xmm0, xmm2); - addsd(xmm0, xmm2); - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_1_0_2); - fnstcw(Address(rsp, 24)); - movzwl(edx, Address(rsp, 24)); - orl(edx, 768); - movw(Address(rsp, 28), edx); - fldcw(Address(rsp, 28)); - movl(edx, eax); - sarl(eax, 1); - subl(edx, eax); - movdqu(xmm6, Address(tmp, 0)); // 0x00000000UL, 0xfff00000UL, 0x00000000UL, 0xfff00000UL - pandn(xmm6, xmm2); - addl(eax, 1023); - movdl(xmm3, eax); - psllq(xmm3, 52); - por(xmm6, xmm3); - addl(edx, 1023); - movdl(xmm4, edx); - psllq(xmm4, 52); - movsd(Address(rsp, 8), xmm0); - fld_d(Address(rsp, 8)); - movsd(Address(rsp, 16), xmm6); - fld_d(Address(rsp, 16)); - fmula(1); - faddp(1); - movsd(Address(rsp, 8), xmm4); - fld_d(Address(rsp, 8)); - fmulp(1); - fstp_d(Address(rsp, 8)); - movsd(xmm0,Address(rsp, 8)); - fldcw(Address(rsp, 24)); - pextrw(ecx, xmm0, 3); - andl(ecx, 32752); - cmpl(ecx, 32752); - jcc(Assembler::greaterEqual, L_2TAG_PACKET_3_0_2); - cmpl(ecx, 0); - jcc(Assembler::equal, L_2TAG_PACKET_4_0_2); - jmp(L_2TAG_PACKET_2_0_2); - cmpl(ecx, INT_MIN); - jcc(Assembler::less, L_2TAG_PACKET_3_0_2); - cmpl(ecx, -1064950997); - jcc(Assembler::less, L_2TAG_PACKET_2_0_2); - jcc(Assembler::greater, L_2TAG_PACKET_4_0_2); - movl(edx, Address(rsp, 128)); - cmpl(edx ,-17155601); - jcc(Assembler::less, L_2TAG_PACKET_2_0_2); - jmp(L_2TAG_PACKET_4_0_2); - - bind(L_2TAG_PACKET_3_0_2); - movl(edx, 14); - jmp(L_2TAG_PACKET_5_0_2); - - bind(L_2TAG_PACKET_4_0_2); - movl(edx, 15); - - bind(L_2TAG_PACKET_5_0_2); - movsd(Address(rsp, 0), xmm0); - movsd(xmm0, Address(rsp, 128)); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); - - bind(L_2TAG_PACKET_7_0_2); - cmpl(eax, 2146435072); - jcc(Assembler::greaterEqual, L_2TAG_PACKET_8_0_2); - movl(eax, Address(rsp, 132)); - cmpl(eax, INT_MIN); - jcc(Assembler::greaterEqual, L_2TAG_PACKET_9_0_2); - movsd(xmm0, Address(tmp, 1208)); // 0xffffffffUL, 0x7fefffffUL - mulsd(xmm0, xmm0); - movl(edx, 14); - jmp(L_2TAG_PACKET_5_0_2); - - bind(L_2TAG_PACKET_9_0_2); - movsd(xmm0, Address(tmp, 1216)); - mulsd(xmm0, xmm0); - movl(edx, 15); - jmp(L_2TAG_PACKET_5_0_2); - - bind(L_2TAG_PACKET_8_0_2); - movl(edx, Address(rsp, 128)); - cmpl(eax, 2146435072); - jcc(Assembler::above, L_2TAG_PACKET_10_0_2); - cmpl(edx, 0); - jcc(Assembler::notEqual, L_2TAG_PACKET_10_0_2); - movl(eax, Address(rsp, 132)); - cmpl(eax, 2146435072); - jcc(Assembler::notEqual, L_2TAG_PACKET_11_0_2); - movsd(xmm0, Address(tmp, 1192)); // 0x00000000UL, 0x7ff00000UL - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_11_0_2); - movsd(xmm0, Address(tmp, 1200)); // 0x00000000UL, 0x00000000UL - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_10_0_2); - movsd(xmm0, Address(rsp, 128)); - addsd(xmm0, xmm0); - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_0_0_2); - movl(eax, Address(rsp, 132)); - andl(eax, 2147483647); - cmpl(eax, 1083179008); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_7_0_2); - movsd(xmm0, Address(rsp, 128)); - addsd(xmm0, Address(tmp, 1184)); // 0x00000000UL, 0x3ff00000UL - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_2_0_2); - movsd(Address(rsp, 48), xmm0); - fld_d(Address(rsp, 48)); - - bind(L_2TAG_PACKET_6_0_2); - movl(tmp, Address(rsp, 64)); -} - -#endif // !_LP64 - /******************************************************************************/ // ALGORITHM DESCRIPTION - LOG() // --------------------- @@ -703,8 +434,6 @@ void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm // /******************************************************************************/ -#ifdef _LP64 - ALIGNED_(16) juint _L_tbl[] = { 0xfefa3800UL, 0x3fe62e42UL, 0x93c76730UL, 0x3d2ef357UL, 0xaa241800UL, @@ -1007,298 +736,6 @@ void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm addq(rsp, 24); } -#endif // _LP64 - -#ifndef _LP64 - -ALIGNED_(16) juint _static_const_table_log[] = -{ - 0xfefa3800UL, 0x3fe62e42UL, 0x93c76730UL, 0x3d2ef357UL, 0xaa241800UL, - 0x3fe5ee82UL, 0x0cda46beUL, 0x3d220238UL, 0x5c364800UL, 0x3fe5af40UL, - 0xac10c9fbUL, 0x3d2dfa63UL, 0x26bb8c00UL, 0x3fe5707aUL, 0xff3303ddUL, - 0x3d09980bUL, 0x26867800UL, 0x3fe5322eUL, 0x5d257531UL, 0x3d05ccc4UL, - 0x835a5000UL, 0x3fe4f45aUL, 0x6d93b8fbUL, 0xbd2e6c51UL, 0x6f970c00UL, - 0x3fe4b6fdUL, 0xed4c541cUL, 0x3cef7115UL, 0x27e8a400UL, 0x3fe47a15UL, - 0xf94d60aaUL, 0xbd22cb6aUL, 0xf2f92400UL, 0x3fe43d9fUL, 0x481051f7UL, - 0xbcfd984fUL, 0x2125cc00UL, 0x3fe4019cUL, 0x30f0c74cUL, 0xbd26ce79UL, - 0x0c36c000UL, 0x3fe3c608UL, 0x7cfe13c2UL, 0xbd02b736UL, 0x17197800UL, - 0x3fe38ae2UL, 0xbb5569a4UL, 0xbd218b7aUL, 0xad9d8c00UL, 0x3fe35028UL, - 0x9527e6acUL, 0x3d10b83fUL, 0x44340800UL, 0x3fe315daUL, 0xc5a0ed9cUL, - 0xbd274e93UL, 0x57b0e000UL, 0x3fe2dbf5UL, 0x07b9dc11UL, 0xbd17a6e5UL, - 0x6d0ec000UL, 0x3fe2a278UL, 0xe797882dUL, 0x3d206d2bUL, 0x1134dc00UL, - 0x3fe26962UL, 0x05226250UL, 0xbd0b61f1UL, 0xd8bebc00UL, 0x3fe230b0UL, - 0x6e48667bUL, 0x3d12fc06UL, 0x5fc61800UL, 0x3fe1f863UL, 0xc9fe81d3UL, - 0xbd2a7242UL, 0x49ae6000UL, 0x3fe1c078UL, 0xed70e667UL, 0x3cccacdeUL, - 0x40f23c00UL, 0x3fe188eeUL, 0xf8ab4650UL, 0x3d14cc4eUL, 0xf6f29800UL, - 0x3fe151c3UL, 0xa293ae49UL, 0xbd2edd97UL, 0x23c75c00UL, 0x3fe11af8UL, - 0xbb9ddcb2UL, 0xbd258647UL, 0x8611cc00UL, 0x3fe0e489UL, 0x07801742UL, - 0x3d1c2998UL, 0xe2d05400UL, 0x3fe0ae76UL, 0x887e7e27UL, 0x3d1f486bUL, - 0x0533c400UL, 0x3fe078bfUL, 0x41edf5fdUL, 0x3d268122UL, 0xbe760400UL, - 0x3fe04360UL, 0xe79539e0UL, 0xbd04c45fUL, 0xe5b20800UL, 0x3fe00e5aUL, - 0xb1727b1cUL, 0xbd053ba3UL, 0xaf7a4800UL, 0x3fdfb358UL, 0x3c164935UL, - 0x3d0085faUL, 0xee031800UL, 0x3fdf4aa7UL, 0x6f014a8bUL, 0x3d12cde5UL, - 0x56b41000UL, 0x3fdee2a1UL, 0x5a470251UL, 0x3d2f27f4UL, 0xc3ddb000UL, - 0x3fde7b42UL, 0x5372bd08UL, 0xbd246550UL, 0x1a272800UL, 0x3fde148aUL, - 0x07322938UL, 0xbd1326b2UL, 0x484c9800UL, 0x3fddae75UL, 0x60dc616aUL, - 0xbd1ea42dUL, 0x46def800UL, 0x3fdd4902UL, 0xe9a767a8UL, 0x3d235bafUL, - 0x18064800UL, 0x3fdce42fUL, 0x3ec7a6b0UL, 0xbd0797c3UL, 0xc7455800UL, - 0x3fdc7ff9UL, 0xc15249aeUL, 0xbd29b6ddUL, 0x693fa000UL, 0x3fdc1c60UL, - 0x7fe8e180UL, 0x3d2cec80UL, 0x1b80e000UL, 0x3fdbb961UL, 0xf40a666dUL, - 0x3d27d85bUL, 0x04462800UL, 0x3fdb56faUL, 0x2d841995UL, 0x3d109525UL, - 0x5248d000UL, 0x3fdaf529UL, 0x52774458UL, 0xbd217cc5UL, 0x3c8ad800UL, - 0x3fda93edUL, 0xbea77a5dUL, 0x3d1e36f2UL, 0x0224f800UL, 0x3fda3344UL, - 0x7f9d79f5UL, 0x3d23c645UL, 0xea15f000UL, 0x3fd9d32bUL, 0x10d0c0b0UL, - 0xbd26279eUL, 0x43135800UL, 0x3fd973a3UL, 0xa502d9f0UL, 0xbd152313UL, - 0x635bf800UL, 0x3fd914a8UL, 0x2ee6307dUL, 0xbd1766b5UL, 0xa88b3000UL, - 0x3fd8b639UL, 0xe5e70470UL, 0xbd205ae1UL, 0x776dc800UL, 0x3fd85855UL, - 0x3333778aUL, 0x3d2fd56fUL, 0x3bd81800UL, 0x3fd7fafaUL, 0xc812566aUL, - 0xbd272090UL, 0x687cf800UL, 0x3fd79e26UL, 0x2efd1778UL, 0x3d29ec7dUL, - 0x76c67800UL, 0x3fd741d8UL, 0x49dc60b3UL, 0x3d2d8b09UL, 0xe6af1800UL, - 0x3fd6e60eUL, 0x7c222d87UL, 0x3d172165UL, 0x3e9c6800UL, 0x3fd68ac8UL, - 0x2756eba0UL, 0x3d20a0d3UL, 0x0b3ab000UL, 0x3fd63003UL, 0xe731ae00UL, - 0xbd2db623UL, 0xdf596000UL, 0x3fd5d5bdUL, 0x08a465dcUL, 0xbd0a0b2aUL, - 0x53c8d000UL, 0x3fd57bf7UL, 0xee5d40efUL, 0x3d1fadedUL, 0x0738a000UL, - 0x3fd522aeUL, 0x8164c759UL, 0x3d2ebe70UL, 0x9e173000UL, 0x3fd4c9e0UL, - 0x1b0ad8a4UL, 0xbd2e2089UL, 0xc271c800UL, 0x3fd4718dUL, 0x0967d675UL, - 0xbd2f27ceUL, 0x23d5e800UL, 0x3fd419b4UL, 0xec90e09dUL, 0x3d08e436UL, - 0x77333000UL, 0x3fd3c252UL, 0xb606bd5cUL, 0x3d183b54UL, 0x76be1000UL, - 0x3fd36b67UL, 0xb0f177c8UL, 0x3d116ecdUL, 0xe1d36000UL, 0x3fd314f1UL, - 0xd3213cb8UL, 0xbd28e27aUL, 0x7cdc9000UL, 0x3fd2bef0UL, 0x4a5004f4UL, - 0x3d2a9cfaUL, 0x1134d800UL, 0x3fd26962UL, 0xdf5bb3b6UL, 0x3d2c93c1UL, - 0x6d0eb800UL, 0x3fd21445UL, 0xba46baeaUL, 0x3d0a87deUL, 0x635a6800UL, - 0x3fd1bf99UL, 0x5147bdb7UL, 0x3d2ca6edUL, 0xcbacf800UL, 0x3fd16b5cUL, - 0xf7a51681UL, 0x3d2b9acdUL, 0x8227e800UL, 0x3fd1178eUL, 0x63a5f01cUL, - 0xbd2c210eUL, 0x67616000UL, 0x3fd0c42dUL, 0x163ceae9UL, 0x3d27188bUL, - 0x604d5800UL, 0x3fd07138UL, 0x16ed4e91UL, 0x3cf89cdbUL, 0x5626c800UL, - 0x3fd01eaeUL, 0x1485e94aUL, 0xbd16f08cUL, 0x6cb3b000UL, 0x3fcf991cUL, - 0xca0cdf30UL, 0x3d1bcbecUL, 0xe4dd0000UL, 0x3fcef5adUL, 0x65bb8e11UL, - 0xbcca2115UL, 0xffe71000UL, 0x3fce530eUL, 0x6041f430UL, 0x3cc21227UL, - 0xb0d49000UL, 0x3fcdb13dUL, 0xf715b035UL, 0xbd2aff2aUL, 0xf2656000UL, - 0x3fcd1037UL, 0x75b6f6e4UL, 0xbd084a7eUL, 0xc6f01000UL, 0x3fcc6ffbUL, - 0xc5962bd2UL, 0xbcf1ec72UL, 0x383be000UL, 0x3fcbd087UL, 0x595412b6UL, - 0xbd2d4bc4UL, 0x575bd000UL, 0x3fcb31d8UL, 0x4eace1aaUL, 0xbd0c358dUL, - 0x3c8ae000UL, 0x3fca93edUL, 0x50562169UL, 0xbd287243UL, 0x07089000UL, - 0x3fc9f6c4UL, 0x6865817aUL, 0x3d29904dUL, 0xdcf70000UL, 0x3fc95a5aUL, - 0x58a0ff6fUL, 0x3d07f228UL, 0xeb390000UL, 0x3fc8beafUL, 0xaae92cd1UL, - 0xbd073d54UL, 0x6551a000UL, 0x3fc823c1UL, 0x9a631e83UL, 0x3d1e0ddbUL, - 0x85445000UL, 0x3fc7898dUL, 0x70914305UL, 0xbd1c6610UL, 0x8b757000UL, - 0x3fc6f012UL, 0xe59c21e1UL, 0xbd25118dUL, 0xbe8c1000UL, 0x3fc6574eUL, - 0x2c3c2e78UL, 0x3d19cf8bUL, 0x6b544000UL, 0x3fc5bf40UL, 0xeb68981cUL, - 0xbd127023UL, 0xe4a1b000UL, 0x3fc527e5UL, 0xe5697dc7UL, 0x3d2633e8UL, - 0x8333b000UL, 0x3fc4913dUL, 0x54fdb678UL, 0x3d258379UL, 0xa5993000UL, - 0x3fc3fb45UL, 0x7e6a354dUL, 0xbd2cd1d8UL, 0xb0159000UL, 0x3fc365fcUL, - 0x234b7289UL, 0x3cc62fa8UL, 0x0c868000UL, 0x3fc2d161UL, 0xcb81b4a1UL, - 0x3d039d6cUL, 0x2a49c000UL, 0x3fc23d71UL, 0x8fd3df5cUL, 0x3d100d23UL, - 0x7e23f000UL, 0x3fc1aa2bUL, 0x44389934UL, 0x3d2ca78eUL, 0x8227e000UL, - 0x3fc1178eUL, 0xce2d07f2UL, 0x3d21ef78UL, 0xb59e4000UL, 0x3fc08598UL, - 0x7009902cUL, 0xbd27e5ddUL, 0x39dbe000UL, 0x3fbfe891UL, 0x4fa10afdUL, - 0xbd2534d6UL, 0x830a2000UL, 0x3fbec739UL, 0xafe645e0UL, 0xbd2dc068UL, - 0x63844000UL, 0x3fbda727UL, 0x1fa71733UL, 0x3d1a8940UL, 0x01bc4000UL, - 0x3fbc8858UL, 0xc65aacd3UL, 0x3d2646d1UL, 0x8dad6000UL, 0x3fbb6ac8UL, - 0x2bf768e5UL, 0xbd139080UL, 0x40b1c000UL, 0x3fba4e76UL, 0xb94407c8UL, - 0xbd0e42b6UL, 0x5d594000UL, 0x3fb9335eUL, 0x3abd47daUL, 0x3d23115cUL, - 0x2f40e000UL, 0x3fb8197eUL, 0xf96ffdf7UL, 0x3d0f80dcUL, 0x0aeac000UL, - 0x3fb700d3UL, 0xa99ded32UL, 0x3cec1e8dUL, 0x4d97a000UL, 0x3fb5e95aUL, - 0x3c5d1d1eUL, 0xbd2c6906UL, 0x5d208000UL, 0x3fb4d311UL, 0x82f4e1efUL, - 0xbcf53a25UL, 0xa7d1e000UL, 0x3fb3bdf5UL, 0xa5db4ed7UL, 0x3d2cc85eUL, - 0xa4472000UL, 0x3fb2aa04UL, 0xae9c697dUL, 0xbd20b6e8UL, 0xd1466000UL, - 0x3fb1973bUL, 0x560d9e9bUL, 0xbd25325dUL, 0xb59e4000UL, 0x3fb08598UL, - 0x7009902cUL, 0xbd17e5ddUL, 0xc006c000UL, 0x3faeea31UL, 0x4fc93b7bUL, - 0xbd0e113eUL, 0xcdddc000UL, 0x3faccb73UL, 0x47d82807UL, 0xbd1a68f2UL, - 0xd0fb0000UL, 0x3faaaef2UL, 0x353bb42eUL, 0x3d20fc1aUL, 0x149fc000UL, - 0x3fa894aaUL, 0xd05a267dUL, 0xbd197995UL, 0xf2d4c000UL, 0x3fa67c94UL, - 0xec19afa2UL, 0xbd029efbUL, 0xd42e0000UL, 0x3fa466aeUL, 0x75bdfd28UL, - 0xbd2c1673UL, 0x2f8d0000UL, 0x3fa252f3UL, 0xe021b67bUL, 0x3d283e9aUL, - 0x89e74000UL, 0x3fa0415dUL, 0x5cf1d753UL, 0x3d0111c0UL, 0xec148000UL, - 0x3f9c63d2UL, 0x3f9eb2f3UL, 0x3d2578c6UL, 0x28c90000UL, 0x3f984925UL, - 0x325a0c34UL, 0xbd2aa0baUL, 0x25980000UL, 0x3f9432a9UL, 0x928637feUL, - 0x3d098139UL, 0x58938000UL, 0x3f902056UL, 0x06e2f7d2UL, 0xbd23dc5bUL, - 0xa3890000UL, 0x3f882448UL, 0xda74f640UL, 0xbd275577UL, 0x75890000UL, - 0x3f801015UL, 0x999d2be8UL, 0xbd10c76bUL, 0x59580000UL, 0x3f700805UL, - 0xcb31c67bUL, 0x3d2166afUL, 0x00000000UL, 0x00000000UL, 0x00000000UL, - 0x80000000UL, 0xfefa3800UL, 0x3fa62e42UL, 0x93c76730UL, 0x3ceef357UL, - 0x92492492UL, 0x3fc24924UL, 0x00000000UL, 0xbfd00000UL, 0x3d6fb175UL, - 0xbfc5555eUL, 0x55555555UL, 0x3fd55555UL, 0x9999999aUL, 0x3fc99999UL, - 0x00000000UL, 0xbfe00000UL, 0x00000000UL, 0xffffe000UL, 0x00000000UL, - 0xffffe000UL -}; -//registers, -// input: xmm0 -// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 -// rax, rdx, rcx, rbx (tmp) - -void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { - Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; - Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; - Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2; - Label L_2TAG_PACKET_10_0_2, start; - - assert_different_registers(tmp, eax, ecx, edx); - jmp(start); - address static_const_table = (address)_static_const_table_log; - - bind(start); - subl(rsp, 104); - movl(Address(rsp, 40), tmp); - lea(tmp, ExternalAddress(static_const_table)); - xorpd(xmm2, xmm2); - movl(eax, 16368); - pinsrw(xmm2, eax, 3); - xorpd(xmm3, xmm3); - movl(edx, 30704); - pinsrw(xmm3, edx, 3); - movsd(xmm0, Address(rsp, 112)); - movapd(xmm1, xmm0); - movl(ecx, 32768); - movdl(xmm4, ecx); - movsd(xmm5, Address(tmp, 2128)); // 0x00000000UL, 0xffffe000UL - pextrw(eax, xmm0, 3); - por(xmm0, xmm2); - psllq(xmm0, 5); - movl(ecx, 16352); - psrlq(xmm0, 34); - rcpss(xmm0, xmm0); - psllq(xmm1, 12); - pshufd(xmm6, xmm5, 228); - psrlq(xmm1, 12); - subl(eax, 16); - cmpl(eax, 32736); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); - - bind(L_2TAG_PACKET_1_0_2); - paddd(xmm0, xmm4); - por(xmm1, xmm3); - movdl(edx, xmm0); - psllq(xmm0, 29); - pand(xmm5, xmm1); - pand(xmm0, xmm6); - subsd(xmm1, xmm5); - mulpd(xmm5, xmm0); - andl(eax, 32752); - subl(eax, ecx); - cvtsi2sdl(xmm7, eax); - mulsd(xmm1, xmm0); - movsd(xmm6, Address(tmp, 2064)); // 0xfefa3800UL, 0x3fa62e42UL - movdqu(xmm3, Address(tmp, 2080)); // 0x92492492UL, 0x3fc24924UL, 0x00000000UL, 0xbfd00000UL - subsd(xmm5, xmm2); - andl(edx, 16711680); - shrl(edx, 12); - movdqu(xmm0, Address(tmp, edx)); - movdqu(xmm4, Address(tmp, 2096)); // 0x3d6fb175UL, 0xbfc5555eUL, 0x55555555UL, 0x3fd55555UL - addsd(xmm1, xmm5); - movdqu(xmm2, Address(tmp, 2112)); // 0x9999999aUL, 0x3fc99999UL, 0x00000000UL, 0xbfe00000UL - mulsd(xmm6, xmm7); - pshufd(xmm5, xmm1, 68); - mulsd(xmm7, Address(tmp, 2072)); // 0x93c76730UL, 0x3ceef357UL, 0x92492492UL, 0x3fc24924UL - mulsd(xmm3, xmm1); - addsd(xmm0, xmm6); - mulpd(xmm4, xmm5); - mulpd(xmm5, xmm5); - pshufd(xmm6, xmm0, 228); - addsd(xmm0, xmm1); - addpd(xmm4, xmm2); - mulpd(xmm3, xmm5); - subsd(xmm6, xmm0); - mulsd(xmm4, xmm1); - pshufd(xmm2, xmm0, 238); - addsd(xmm1, xmm6); - mulsd(xmm5, xmm5); - addsd(xmm7, xmm2); - addpd(xmm4, xmm3); - addsd(xmm1, xmm7); - mulpd(xmm4, xmm5); - addsd(xmm1, xmm4); - pshufd(xmm5, xmm4, 238); - addsd(xmm1, xmm5); - addsd(xmm0, xmm1); - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_0_0_2); - movsd(xmm0, Address(rsp, 112)); - movdqu(xmm1, xmm0); - addl(eax, 16); - cmpl(eax, 32768); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_3_0_2); - cmpl(eax, 16); - jcc(Assembler::below, L_2TAG_PACKET_4_0_2); - - bind(L_2TAG_PACKET_5_0_2); - addsd(xmm0, xmm0); - jmp(L_2TAG_PACKET_2_0_2); - - bind(L_2TAG_PACKET_6_0_2); - jcc(Assembler::above, L_2TAG_PACKET_5_0_2); - cmpl(edx, 0); - jcc(Assembler::above, L_2TAG_PACKET_5_0_2); - jmp(L_2TAG_PACKET_7_0_2); - - bind(L_2TAG_PACKET_3_0_2); - movdl(edx, xmm1); - psrlq(xmm1, 32); - movdl(ecx, xmm1); - addl(ecx, ecx); - cmpl(ecx, -2097152); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_6_0_2); - orl(edx, ecx); - cmpl(edx, 0); - jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); - - bind(L_2TAG_PACKET_7_0_2); - xorpd(xmm1, xmm1); - xorpd(xmm0, xmm0); - movl(eax, 32752); - pinsrw(xmm1, eax, 3); - movl(edx, 3); - mulsd(xmm0, xmm1); - - bind(L_2TAG_PACKET_9_0_2); - movsd(Address(rsp, 0), xmm0); - movsd(xmm0, Address(rsp, 112)); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_10_0_2); - - bind(L_2TAG_PACKET_8_0_2); - xorpd(xmm1, xmm1); - xorpd(xmm0, xmm0); - movl(eax, 49136); - pinsrw(xmm0, eax, 3); - divsd(xmm0, xmm1); - movl(edx, 2); - jmp(L_2TAG_PACKET_9_0_2); - - bind(L_2TAG_PACKET_4_0_2); - movdl(edx, xmm1); - psrlq(xmm1, 32); - movdl(ecx, xmm1); - orl(edx, ecx); - cmpl(edx, 0); - jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); - xorpd(xmm1, xmm1); - movl(eax, 18416); - pinsrw(xmm1, eax, 3); - mulsd(xmm0, xmm1); - movapd(xmm1, xmm0); - pextrw(eax, xmm0, 3); - por(xmm0, xmm2); - psllq(xmm0, 5); - movl(ecx, 18416); - psrlq(xmm0, 34); - rcpss(xmm0, xmm0); - psllq(xmm1, 12); - pshufd(xmm6, xmm5, 228); - psrlq(xmm1, 12); - jmp(L_2TAG_PACKET_1_0_2); - - bind(L_2TAG_PACKET_2_0_2); - movsd(Address(rsp, 24), xmm0); - fld_d(Address(rsp, 24)); - - bind(L_2TAG_PACKET_10_0_2); - movl(tmp, Address(rsp, 40)); -} - -#endif // !_LP64 - /******************************************************************************/ // ALGORITHM DESCRIPTION - POW() // --------------------- @@ -1351,7 +788,6 @@ void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm // /******************************************************************************/ -#ifdef _LP64 ALIGNED_(16) juint _HIGHSIGMASK[] = { 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL @@ -3109,1749 +2545,1401 @@ void MacroAssembler::fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm bind(B1_5); addq(rsp, 40); } -#endif // _LP64 -#ifndef _LP64 +/******************************************************************************/ +// ALGORITHM DESCRIPTION - SIN() +// --------------------- +// +// 1. RANGE REDUCTION +// +// We perform an initial range reduction from X to r with +// +// X =~= N * pi/32 + r +// +// so that |r| <= pi/64 + epsilon. We restrict inputs to those +// where |N| <= 932560. Beyond this, the range reduction is +// insufficiently accurate. For extremely small inputs, +// denormalization can occur internally, impacting performance. +// This means that the main path is actually only taken for +// 2^-252 <= |X| < 90112. +// +// To avoid branches, we perform the range reduction to full +// accuracy each time. +// +// X - N * (P_1 + P_2 + P_3) +// +// where P_1 and P_2 are 32-bit numbers (so multiplication by N +// is exact) and P_3 is a 53-bit number. Together, these +// approximate pi well enough for all cases in the restricted +// range. +// +// The main reduction sequence is: +// +// y = 32/pi * x +// N = integer(y) +// (computed by adding and subtracting off SHIFTER) +// +// m_1 = N * P_1 +// m_2 = N * P_2 +// r_1 = x - m_1 +// r = r_1 - m_2 +// (this r can be used for most of the calculation) +// +// c_1 = r_1 - r +// m_3 = N * P_3 +// c_2 = c_1 - m_2 +// c = c_2 - m_3 +// +// 2. MAIN ALGORITHM +// +// The algorithm uses a table lookup based on B = M * pi / 32 +// where M = N mod 64. The stored values are: +// sigma closest power of 2 to cos(B) +// C_hl 53-bit cos(B) - sigma +// S_hi + S_lo 2 * 53-bit sin(B) +// +// The computation is organized as follows: +// +// sin(B + r + c) = [sin(B) + sigma * r] + +// r * (cos(B) - sigma) + +// sin(B) * [cos(r + c) - 1] + +// cos(B) * [sin(r + c) - r] +// +// which is approximately: +// +// [S_hi + sigma * r] + +// C_hl * r + +// S_lo + S_hi * [(cos(r) - 1) - r * c] + +// (C_hl + sigma) * [(sin(r) - r) + c] +// +// and this is what is actually computed. We separate this sum +// into four parts: +// +// hi + med + pols + corr +// +// where +// +// hi = S_hi + sigma r +// med = C_hl * r +// pols = S_hi * (cos(r) - 1) + (C_hl + sigma) * (sin(r) - r) +// corr = S_lo + c * ((C_hl + sigma) - S_hi * r) +// +// 3. POLYNOMIAL +// +// The polynomial S_hi * (cos(r) - 1) + (C_hl + sigma) * +// (sin(r) - r) can be rearranged freely, since it is quite +// small, so we exploit parallelism to the fullest. +// +// psc4 = SC_4 * r_1 +// msc4 = psc4 * r +// r2 = r * r +// msc2 = SC_2 * r2 +// r4 = r2 * r2 +// psc3 = SC_3 + msc4 +// psc1 = SC_1 + msc2 +// msc3 = r4 * psc3 +// sincospols = psc1 + msc3 +// pols = sincospols * +// +// +// 4. CORRECTION TERM +// +// This is where the "c" component of the range reduction is +// taken into account; recall that just "r" is used for most of +// the calculation. +// +// -c = m_3 - c_2 +// -d = S_hi * r - (C_hl + sigma) +// corr = -c * -d + S_lo +// +// 5. COMPENSATED SUMMATIONS +// +// The two successive compensated summations add up the high +// and medium parts, leaving just the low parts to add up at +// the end. +// +// rs = sigma * r +// res_int = S_hi + rs +// k_0 = S_hi - res_int +// k_2 = k_0 + rs +// med = C_hl * r +// res_hi = res_int + med +// k_1 = res_int - res_hi +// k_3 = k_1 + med +// +// 6. FINAL SUMMATION +// +// We now add up all the small parts: +// +// res_lo = pols(hi) + pols(lo) + corr + k_1 + k_3 +// +// Now the overall result is just: +// +// res_hi + res_lo +// +// 7. SMALL ARGUMENTS +// +// If |x| < SNN (SNN meaning the smallest normal number), we +// simply perform 0.1111111 cdots 1111 * x. For SNN <= |x|, we +// do 2^-55 * (2^55 * x - x). +// +// Special cases: +// sin(NaN) = quiet NaN, and raise invalid exception +// sin(INF) = NaN and raise invalid exception +// sin(+/-0) = +/-0 +// +/******************************************************************************/ -ALIGNED_(16) juint _static_const_table_pow[] = +ALIGNED_(16) juint _ONEHALF[] = { - 0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL, 0xf8000000UL, - 0xffffffffUL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0x3ff00000UL, - 0x00000000UL, 0x00000000UL, 0x20000000UL, 0x3feff00aUL, 0x96621f95UL, - 0x3e5b1856UL, 0xe0000000UL, 0x3fefe019UL, 0xe5916f9eUL, 0xbe325278UL, - 0x00000000UL, 0x3fefd02fUL, 0x859a1062UL, 0x3e595fb7UL, 0xc0000000UL, - 0x3fefc049UL, 0xb245f18fUL, 0xbe529c38UL, 0xe0000000UL, 0x3fefb069UL, - 0xad2880a7UL, 0xbe501230UL, 0x60000000UL, 0x3fefa08fUL, 0xc8e72420UL, - 0x3e597bd1UL, 0x80000000UL, 0x3fef90baUL, 0xc30c4500UL, 0xbe5d6c75UL, - 0xe0000000UL, 0x3fef80eaUL, 0x02c63f43UL, 0x3e2e1318UL, 0xc0000000UL, - 0x3fef7120UL, 0xb3d4ccccUL, 0xbe44c52aUL, 0x00000000UL, 0x3fef615cUL, - 0xdbd91397UL, 0xbe4e7d6cUL, 0xa0000000UL, 0x3fef519cUL, 0x65c5cd68UL, - 0xbe522dc8UL, 0xa0000000UL, 0x3fef41e2UL, 0x46d1306cUL, 0xbe5a840eUL, - 0xe0000000UL, 0x3fef322dUL, 0xd2980e94UL, 0x3e5071afUL, 0xa0000000UL, - 0x3fef227eUL, 0x773abadeUL, 0xbe5891e5UL, 0xa0000000UL, 0x3fef12d4UL, - 0xdc6bf46bUL, 0xbe5cccbeUL, 0xe0000000UL, 0x3fef032fUL, 0xbc7247faUL, - 0xbe2bab83UL, 0x80000000UL, 0x3feef390UL, 0xbcaa1e46UL, 0xbe53bb3bUL, - 0x60000000UL, 0x3feee3f6UL, 0x5f6c682dUL, 0xbe54c619UL, 0x80000000UL, - 0x3feed461UL, 0x5141e368UL, 0xbe4b6d86UL, 0xe0000000UL, 0x3feec4d1UL, - 0xec678f76UL, 0xbe369af6UL, 0x80000000UL, 0x3feeb547UL, 0x41301f55UL, - 0xbe2d4312UL, 0x60000000UL, 0x3feea5c2UL, 0x676da6bdUL, 0xbe4d8dd0UL, - 0x60000000UL, 0x3fee9642UL, 0x57a891c4UL, 0x3e51f991UL, 0xa0000000UL, - 0x3fee86c7UL, 0xe4eb491eUL, 0x3e579bf9UL, 0x20000000UL, 0x3fee7752UL, - 0xfddc4a2cUL, 0xbe3356e6UL, 0xc0000000UL, 0x3fee67e1UL, 0xd75b5bf1UL, - 0xbe449531UL, 0x80000000UL, 0x3fee5876UL, 0xbd423b8eUL, 0x3df54fe4UL, - 0x60000000UL, 0x3fee4910UL, 0x330e51b9UL, 0x3e54289cUL, 0x80000000UL, - 0x3fee39afUL, 0x8651a95fUL, 0xbe55aad6UL, 0xa0000000UL, 0x3fee2a53UL, - 0x5e98c708UL, 0xbe2fc4a9UL, 0xe0000000UL, 0x3fee1afcUL, 0x0989328dUL, - 0x3e23958cUL, 0x40000000UL, 0x3fee0babUL, 0xee642abdUL, 0xbe425dd8UL, - 0xa0000000UL, 0x3fedfc5eUL, 0xc394d236UL, 0x3e526362UL, 0x20000000UL, - 0x3feded17UL, 0xe104aa8eUL, 0x3e4ce247UL, 0xc0000000UL, 0x3fedddd4UL, - 0x265a9be4UL, 0xbe5bb77aUL, 0x40000000UL, 0x3fedce97UL, 0x0ecac52fUL, - 0x3e4a7cb1UL, 0xe0000000UL, 0x3fedbf5eUL, 0x124cb3b8UL, 0x3e257024UL, - 0x80000000UL, 0x3fedb02bUL, 0xe6d4febeUL, 0xbe2033eeUL, 0x20000000UL, - 0x3feda0fdUL, 0x39cca00eUL, 0xbe3ddabcUL, 0xc0000000UL, 0x3fed91d3UL, - 0xef8a552aUL, 0xbe543390UL, 0x40000000UL, 0x3fed82afUL, 0xb8e85204UL, - 0x3e513850UL, 0xe0000000UL, 0x3fed738fUL, 0x3d59fe08UL, 0xbe5db728UL, - 0x40000000UL, 0x3fed6475UL, 0x3aa7ead1UL, 0x3e58804bUL, 0xc0000000UL, - 0x3fed555fUL, 0xf8a35ba9UL, 0xbe5298b0UL, 0x00000000UL, 0x3fed464fUL, - 0x9a88dd15UL, 0x3e5a8cdbUL, 0x40000000UL, 0x3fed3743UL, 0xb0b0a190UL, - 0x3e598635UL, 0x80000000UL, 0x3fed283cUL, 0xe2113295UL, 0xbe5c1119UL, - 0x80000000UL, 0x3fed193aUL, 0xafbf1728UL, 0xbe492e9cUL, 0x60000000UL, - 0x3fed0a3dUL, 0xe4a4ccf3UL, 0x3e19b90eUL, 0x20000000UL, 0x3fecfb45UL, - 0xba3cbeb8UL, 0x3e406b50UL, 0xc0000000UL, 0x3fecec51UL, 0x110f7dddUL, - 0x3e0d6806UL, 0x40000000UL, 0x3fecdd63UL, 0x7dd7d508UL, 0xbe5a8943UL, - 0x80000000UL, 0x3fecce79UL, 0x9b60f271UL, 0xbe50676aUL, 0x80000000UL, - 0x3fecbf94UL, 0x0b9ad660UL, 0x3e59174fUL, 0x60000000UL, 0x3fecb0b4UL, - 0x00823d9cUL, 0x3e5bbf72UL, 0x20000000UL, 0x3feca1d9UL, 0x38a6ec89UL, - 0xbe4d38f9UL, 0x80000000UL, 0x3fec9302UL, 0x3a0b7d8eUL, 0x3e53dbfdUL, - 0xc0000000UL, 0x3fec8430UL, 0xc6826b34UL, 0xbe27c5c9UL, 0xc0000000UL, - 0x3fec7563UL, 0x0c706381UL, 0xbe593653UL, 0x60000000UL, 0x3fec669bUL, - 0x7df34ec7UL, 0x3e461ab5UL, 0xe0000000UL, 0x3fec57d7UL, 0x40e5e7e8UL, - 0xbe5c3daeUL, 0x00000000UL, 0x3fec4919UL, 0x5602770fUL, 0xbe55219dUL, - 0xc0000000UL, 0x3fec3a5eUL, 0xec7911ebUL, 0x3e5a5d25UL, 0x60000000UL, - 0x3fec2ba9UL, 0xb39ea225UL, 0xbe53c00bUL, 0x80000000UL, 0x3fec1cf8UL, - 0x967a212eUL, 0x3e5a8ddfUL, 0x60000000UL, 0x3fec0e4cUL, 0x580798bdUL, - 0x3e5f53abUL, 0x00000000UL, 0x3febffa5UL, 0xb8282df6UL, 0xbe46b874UL, - 0x20000000UL, 0x3febf102UL, 0xe33a6729UL, 0x3e54963fUL, 0x00000000UL, - 0x3febe264UL, 0x3b53e88aUL, 0xbe3adce1UL, 0x60000000UL, 0x3febd3caUL, - 0xc2585084UL, 0x3e5cde9fUL, 0x80000000UL, 0x3febc535UL, 0xa335c5eeUL, - 0xbe39fd9cUL, 0x20000000UL, 0x3febb6a5UL, 0x7325b04dUL, 0x3e42ba15UL, - 0x60000000UL, 0x3feba819UL, 0x1564540fUL, 0x3e3a9f35UL, 0x40000000UL, - 0x3feb9992UL, 0x83fff592UL, 0xbe5465ceUL, 0xa0000000UL, 0x3feb8b0fUL, - 0xb9da63d3UL, 0xbe4b1a0aUL, 0x80000000UL, 0x3feb7c91UL, 0x6d6f1ea4UL, - 0x3e557657UL, 0x00000000UL, 0x3feb6e18UL, 0x5e80a1bfUL, 0x3e4ddbb6UL, - 0x00000000UL, 0x3feb5fa3UL, 0x1c9eacb5UL, 0x3e592877UL, 0xa0000000UL, - 0x3feb5132UL, 0x6d40beb3UL, 0xbe51858cUL, 0xa0000000UL, 0x3feb42c6UL, - 0xd740c67bUL, 0x3e427ad2UL, 0x40000000UL, 0x3feb345fUL, 0xa3e0cceeUL, - 0xbe5c2fc4UL, 0x40000000UL, 0x3feb25fcUL, 0x8e752b50UL, 0xbe3da3c2UL, - 0xc0000000UL, 0x3feb179dUL, 0xa892e7deUL, 0x3e1fb481UL, 0xc0000000UL, - 0x3feb0943UL, 0x21ed71e9UL, 0xbe365206UL, 0x20000000UL, 0x3feafaeeUL, - 0x0e1380a3UL, 0x3e5c5b7bUL, 0x20000000UL, 0x3feaec9dUL, 0x3c3d640eUL, - 0xbe5dbbd0UL, 0x60000000UL, 0x3feade50UL, 0x8f97a715UL, 0x3e3a8ec5UL, - 0x20000000UL, 0x3fead008UL, 0x23ab2839UL, 0x3e2fe98aUL, 0x40000000UL, - 0x3feac1c4UL, 0xf4bbd50fUL, 0x3e54d8f6UL, 0xe0000000UL, 0x3feab384UL, - 0x14757c4dUL, 0xbe48774cUL, 0xc0000000UL, 0x3feaa549UL, 0x7c7b0eeaUL, - 0x3e5b51bbUL, 0x20000000UL, 0x3fea9713UL, 0xf56f7013UL, 0x3e386200UL, - 0xe0000000UL, 0x3fea88e0UL, 0xbe428ebeUL, 0xbe514af5UL, 0xe0000000UL, - 0x3fea7ab2UL, 0x8d0e4496UL, 0x3e4f9165UL, 0x60000000UL, 0x3fea6c89UL, - 0xdbacc5d5UL, 0xbe5c063bUL, 0x20000000UL, 0x3fea5e64UL, 0x3f19d970UL, - 0xbe5a0c8cUL, 0x20000000UL, 0x3fea5043UL, 0x09ea3e6bUL, 0x3e5065dcUL, - 0x80000000UL, 0x3fea4226UL, 0x78df246cUL, 0x3e5e05f6UL, 0x40000000UL, - 0x3fea340eUL, 0x4057d4a0UL, 0x3e431b2bUL, 0x40000000UL, 0x3fea25faUL, - 0x82867bb5UL, 0x3e4b76beUL, 0xa0000000UL, 0x3fea17eaUL, 0x9436f40aUL, - 0xbe5aad39UL, 0x20000000UL, 0x3fea09dfUL, 0x4b5253b3UL, 0x3e46380bUL, - 0x00000000UL, 0x3fe9fbd8UL, 0x8fc52466UL, 0xbe386f9bUL, 0x20000000UL, - 0x3fe9edd5UL, 0x22d3f344UL, 0xbe538347UL, 0x60000000UL, 0x3fe9dfd6UL, - 0x1ac33522UL, 0x3e5dbc53UL, 0x00000000UL, 0x3fe9d1dcUL, 0xeabdff1dUL, - 0x3e40fc0cUL, 0xe0000000UL, 0x3fe9c3e5UL, 0xafd30e73UL, 0xbe585e63UL, - 0xe0000000UL, 0x3fe9b5f3UL, 0xa52f226aUL, 0xbe43e8f9UL, 0x20000000UL, - 0x3fe9a806UL, 0xecb8698dUL, 0xbe515b36UL, 0x80000000UL, 0x3fe99a1cUL, - 0xf2b4e89dUL, 0x3e48b62bUL, 0x20000000UL, 0x3fe98c37UL, 0x7c9a88fbUL, - 0x3e44414cUL, 0x00000000UL, 0x3fe97e56UL, 0xda015741UL, 0xbe5d13baUL, - 0xe0000000UL, 0x3fe97078UL, 0x5fdace06UL, 0x3e51b947UL, 0x00000000UL, - 0x3fe962a0UL, 0x956ca094UL, 0x3e518785UL, 0x40000000UL, 0x3fe954cbUL, - 0x01164c1dUL, 0x3e5d5b57UL, 0xc0000000UL, 0x3fe946faUL, 0xe63b3767UL, - 0xbe4f84e7UL, 0x40000000UL, 0x3fe9392eUL, 0xe57cc2a9UL, 0x3e34eda3UL, - 0xe0000000UL, 0x3fe92b65UL, 0x8c75b544UL, 0x3e5766a0UL, 0xc0000000UL, - 0x3fe91da1UL, 0x37d1d087UL, 0xbe5e2ab1UL, 0x80000000UL, 0x3fe90fe1UL, - 0xa953dc20UL, 0x3e5fa1f3UL, 0x80000000UL, 0x3fe90225UL, 0xdbd3f369UL, - 0x3e47d6dbUL, 0xa0000000UL, 0x3fe8f46dUL, 0x1c9be989UL, 0xbe5e2b0aUL, - 0xa0000000UL, 0x3fe8e6b9UL, 0x3c93d76aUL, 0x3e5c8618UL, 0xe0000000UL, - 0x3fe8d909UL, 0x2182fc9aUL, 0xbe41aa9eUL, 0x20000000UL, 0x3fe8cb5eUL, - 0xe6b3539dUL, 0xbe530d19UL, 0x60000000UL, 0x3fe8bdb6UL, 0x49e58cc3UL, - 0xbe3bb374UL, 0xa0000000UL, 0x3fe8b012UL, 0xa7cfeb8fUL, 0x3e56c412UL, - 0x00000000UL, 0x3fe8a273UL, 0x8d52bc19UL, 0x3e1429b8UL, 0x60000000UL, - 0x3fe894d7UL, 0x4dc32c6cUL, 0xbe48604cUL, 0xc0000000UL, 0x3fe8873fUL, - 0x0c868e56UL, 0xbe564ee5UL, 0x00000000UL, 0x3fe879acUL, 0x56aee828UL, - 0x3e5e2fd8UL, 0x60000000UL, 0x3fe86c1cUL, 0x7ceab8ecUL, 0x3e493365UL, - 0xc0000000UL, 0x3fe85e90UL, 0x78d4dadcUL, 0xbe4f7f25UL, 0x00000000UL, - 0x3fe85109UL, 0x0ccd8280UL, 0x3e31e7a2UL, 0x40000000UL, 0x3fe84385UL, - 0x34ba4e15UL, 0x3e328077UL, 0x80000000UL, 0x3fe83605UL, 0xa670975aUL, - 0xbe53eee5UL, 0xa0000000UL, 0x3fe82889UL, 0xf61b77b2UL, 0xbe43a20aUL, - 0xa0000000UL, 0x3fe81b11UL, 0x13e6643bUL, 0x3e5e5fe5UL, 0xc0000000UL, - 0x3fe80d9dUL, 0x82cc94e8UL, 0xbe5ff1f9UL, 0xa0000000UL, 0x3fe8002dUL, - 0x8a0c9c5dUL, 0xbe42b0e7UL, 0x60000000UL, 0x3fe7f2c1UL, 0x22a16f01UL, - 0x3e5d9ea0UL, 0x20000000UL, 0x3fe7e559UL, 0xc38cd451UL, 0x3e506963UL, - 0xc0000000UL, 0x3fe7d7f4UL, 0x9902bc71UL, 0x3e4503d7UL, 0x40000000UL, - 0x3fe7ca94UL, 0xdef2a3c0UL, 0x3e3d98edUL, 0xa0000000UL, 0x3fe7bd37UL, - 0xed49abb0UL, 0x3e24c1ffUL, 0xe0000000UL, 0x3fe7afdeUL, 0xe3b0be70UL, - 0xbe40c467UL, 0x00000000UL, 0x3fe7a28aUL, 0xaf9f193cUL, 0xbe5dff6cUL, - 0xe0000000UL, 0x3fe79538UL, 0xb74cf6b6UL, 0xbe258ed0UL, 0xa0000000UL, - 0x3fe787ebUL, 0x1d9127c7UL, 0x3e345fb0UL, 0x40000000UL, 0x3fe77aa2UL, - 0x1028c21dUL, 0xbe4619bdUL, 0xa0000000UL, 0x3fe76d5cUL, 0x7cb0b5e4UL, - 0x3e40f1a2UL, 0xe0000000UL, 0x3fe7601aUL, 0x2b1bc4adUL, 0xbe32e8bbUL, - 0xe0000000UL, 0x3fe752dcUL, 0x6839f64eUL, 0x3e41f57bUL, 0xc0000000UL, - 0x3fe745a2UL, 0xc4121f7eUL, 0xbe52c40aUL, 0x60000000UL, 0x3fe7386cUL, - 0xd6852d72UL, 0xbe5c4e6bUL, 0xc0000000UL, 0x3fe72b39UL, 0x91d690f7UL, - 0xbe57f88fUL, 0xe0000000UL, 0x3fe71e0aUL, 0x627a2159UL, 0xbe4425d5UL, - 0xc0000000UL, 0x3fe710dfUL, 0x50a54033UL, 0x3e422b7eUL, 0x60000000UL, - 0x3fe703b8UL, 0x3b0b5f91UL, 0x3e5d3857UL, 0xe0000000UL, 0x3fe6f694UL, - 0x84d628a2UL, 0xbe51f090UL, 0x00000000UL, 0x3fe6e975UL, 0x306d8894UL, - 0xbe414d83UL, 0xe0000000UL, 0x3fe6dc58UL, 0x30bf24aaUL, 0xbe4650caUL, - 0x80000000UL, 0x3fe6cf40UL, 0xd4628d69UL, 0xbe5db007UL, 0xc0000000UL, - 0x3fe6c22bUL, 0xa2aae57bUL, 0xbe31d279UL, 0xc0000000UL, 0x3fe6b51aUL, - 0x860edf7eUL, 0xbe2d4c4aUL, 0x80000000UL, 0x3fe6a80dUL, 0xf3559341UL, - 0xbe5f7e98UL, 0xe0000000UL, 0x3fe69b03UL, 0xa885899eUL, 0xbe5c2011UL, - 0xe0000000UL, 0x3fe68dfdUL, 0x2bdc6d37UL, 0x3e224a82UL, 0xa0000000UL, - 0x3fe680fbUL, 0xc12ad1b9UL, 0xbe40cf56UL, 0x00000000UL, 0x3fe673fdUL, - 0x1bcdf659UL, 0xbdf52f2dUL, 0x00000000UL, 0x3fe66702UL, 0x5df10408UL, - 0x3e5663e0UL, 0xc0000000UL, 0x3fe65a0aUL, 0xa4070568UL, 0xbe40b12fUL, - 0x00000000UL, 0x3fe64d17UL, 0x71c54c47UL, 0x3e5f5e8bUL, 0x00000000UL, - 0x3fe64027UL, 0xbd4b7e83UL, 0x3e42ead6UL, 0xa0000000UL, 0x3fe6333aUL, - 0x61598bd2UL, 0xbe4c48d4UL, 0xc0000000UL, 0x3fe62651UL, 0x6f538d61UL, - 0x3e548401UL, 0xa0000000UL, 0x3fe6196cUL, 0x14344120UL, 0xbe529af6UL, - 0x00000000UL, 0x3fe60c8bUL, 0x5982c587UL, 0xbe3e1e4fUL, 0x00000000UL, - 0x3fe5ffadUL, 0xfe51d4eaUL, 0xbe4c897aUL, 0x80000000UL, 0x3fe5f2d2UL, - 0xfd46ebe1UL, 0x3e552e00UL, 0xa0000000UL, 0x3fe5e5fbUL, 0xa4695699UL, - 0x3e5ed471UL, 0x60000000UL, 0x3fe5d928UL, 0x80d118aeUL, 0x3e456b61UL, - 0xa0000000UL, 0x3fe5cc58UL, 0x304c330bUL, 0x3e54dc29UL, 0x80000000UL, - 0x3fe5bf8cUL, 0x0af2dedfUL, 0xbe3aa9bdUL, 0xe0000000UL, 0x3fe5b2c3UL, - 0x15fc9258UL, 0xbe479a37UL, 0xc0000000UL, 0x3fe5a5feUL, 0x9292c7eaUL, - 0x3e188650UL, 0x20000000UL, 0x3fe5993dUL, 0x33b4d380UL, 0x3e5d6d93UL, - 0x20000000UL, 0x3fe58c7fUL, 0x02fd16c7UL, 0x3e2fe961UL, 0xa0000000UL, - 0x3fe57fc4UL, 0x4a05edb6UL, 0xbe4d55b4UL, 0xa0000000UL, 0x3fe5730dUL, - 0x3d443abbUL, 0xbe5e6954UL, 0x00000000UL, 0x3fe5665aUL, 0x024acfeaUL, - 0x3e50e61bUL, 0x00000000UL, 0x3fe559aaUL, 0xcc9edd09UL, 0xbe325403UL, - 0x60000000UL, 0x3fe54cfdUL, 0x1fe26950UL, 0x3e5d500eUL, 0x60000000UL, - 0x3fe54054UL, 0x6c5ae164UL, 0xbe4a79b4UL, 0xc0000000UL, 0x3fe533aeUL, - 0x154b0287UL, 0xbe401571UL, 0xa0000000UL, 0x3fe5270cUL, 0x0673f401UL, - 0xbe56e56bUL, 0xe0000000UL, 0x3fe51a6dUL, 0x751b639cUL, 0x3e235269UL, - 0xa0000000UL, 0x3fe50dd2UL, 0x7c7b2bedUL, 0x3ddec887UL, 0xc0000000UL, - 0x3fe5013aUL, 0xafab4e17UL, 0x3e5e7575UL, 0x60000000UL, 0x3fe4f4a6UL, - 0x2e308668UL, 0x3e59aed6UL, 0x80000000UL, 0x3fe4e815UL, 0xf33e2a76UL, - 0xbe51f184UL, 0xe0000000UL, 0x3fe4db87UL, 0x839f3e3eUL, 0x3e57db01UL, - 0xc0000000UL, 0x3fe4cefdUL, 0xa9eda7bbUL, 0x3e535e0fUL, 0x00000000UL, - 0x3fe4c277UL, 0x2a8f66a5UL, 0x3e5ce451UL, 0xc0000000UL, 0x3fe4b5f3UL, - 0x05192456UL, 0xbe4e8518UL, 0xc0000000UL, 0x3fe4a973UL, 0x4aa7cd1dUL, - 0x3e46784aUL, 0x40000000UL, 0x3fe49cf7UL, 0x8e23025eUL, 0xbe5749f2UL, - 0x00000000UL, 0x3fe4907eUL, 0x18d30215UL, 0x3e360f39UL, 0x20000000UL, - 0x3fe48408UL, 0x63dcf2f3UL, 0x3e5e00feUL, 0xc0000000UL, 0x3fe47795UL, - 0x46182d09UL, 0xbe5173d9UL, 0xa0000000UL, 0x3fe46b26UL, 0x8f0e62aaUL, - 0xbe48f281UL, 0xe0000000UL, 0x3fe45ebaUL, 0x5775c40cUL, 0xbe56aad4UL, - 0x60000000UL, 0x3fe45252UL, 0x0fe25f69UL, 0x3e48bd71UL, 0x40000000UL, - 0x3fe445edUL, 0xe9989ec5UL, 0x3e590d97UL, 0x80000000UL, 0x3fe4398bUL, - 0xb3d9ffe3UL, 0x3e479dbcUL, 0x20000000UL, 0x3fe42d2dUL, 0x388e4d2eUL, - 0xbe5eed80UL, 0xe0000000UL, 0x3fe420d1UL, 0x6f797c18UL, 0x3e554b4cUL, - 0x20000000UL, 0x3fe4147aUL, 0x31048bb4UL, 0xbe5b1112UL, 0x80000000UL, - 0x3fe40825UL, 0x2efba4f9UL, 0x3e48ebc7UL, 0x40000000UL, 0x3fe3fbd4UL, - 0x50201119UL, 0x3e40b701UL, 0x40000000UL, 0x3fe3ef86UL, 0x0a4db32cUL, - 0x3e551de8UL, 0xa0000000UL, 0x3fe3e33bUL, 0x0c9c148bUL, 0xbe50c1f6UL, - 0x20000000UL, 0x3fe3d6f4UL, 0xc9129447UL, 0x3e533fa0UL, 0x00000000UL, - 0x3fe3cab0UL, 0xaae5b5a0UL, 0xbe22b68eUL, 0x20000000UL, 0x3fe3be6fUL, - 0x02305e8aUL, 0xbe54fc08UL, 0x60000000UL, 0x3fe3b231UL, 0x7f908258UL, - 0x3e57dc05UL, 0x00000000UL, 0x3fe3a5f7UL, 0x1a09af78UL, 0x3e08038bUL, - 0xe0000000UL, 0x3fe399bfUL, 0x490643c1UL, 0xbe5dbe42UL, 0xe0000000UL, - 0x3fe38d8bUL, 0x5e8ad724UL, 0xbe3c2b72UL, 0x20000000UL, 0x3fe3815bUL, - 0xc67196b6UL, 0x3e1713cfUL, 0xa0000000UL, 0x3fe3752dUL, 0x6182e429UL, - 0xbe3ec14cUL, 0x40000000UL, 0x3fe36903UL, 0xab6eb1aeUL, 0x3e5a2cc5UL, - 0x40000000UL, 0x3fe35cdcUL, 0xfe5dc064UL, 0xbe5c5878UL, 0x40000000UL, - 0x3fe350b8UL, 0x0ba6b9e4UL, 0x3e51619bUL, 0x80000000UL, 0x3fe34497UL, - 0x857761aaUL, 0x3e5fff53UL, 0x00000000UL, 0x3fe3387aUL, 0xf872d68cUL, - 0x3e484f4dUL, 0xa0000000UL, 0x3fe32c5fUL, 0x087e97c2UL, 0x3e52842eUL, - 0x80000000UL, 0x3fe32048UL, 0x73d6d0c0UL, 0xbe503edfUL, 0x80000000UL, - 0x3fe31434UL, 0x0c1456a1UL, 0xbe5f72adUL, 0xa0000000UL, 0x3fe30823UL, - 0x83a1a4d5UL, 0xbe5e65ccUL, 0xe0000000UL, 0x3fe2fc15UL, 0x855a7390UL, - 0xbe506438UL, 0x40000000UL, 0x3fe2f00bUL, 0xa2898287UL, 0x3e3d22a2UL, - 0xe0000000UL, 0x3fe2e403UL, 0x8b56f66fUL, 0xbe5aa5fdUL, 0x80000000UL, - 0x3fe2d7ffUL, 0x52db119aUL, 0x3e3a2e3dUL, 0x60000000UL, 0x3fe2cbfeUL, - 0xe2ddd4c0UL, 0xbe586469UL, 0x40000000UL, 0x3fe2c000UL, 0x6b01bf10UL, - 0x3e352b9dUL, 0x40000000UL, 0x3fe2b405UL, 0xb07a1cdfUL, 0x3e5c5cdaUL, - 0x80000000UL, 0x3fe2a80dUL, 0xc7b5f868UL, 0xbe5668b3UL, 0xc0000000UL, - 0x3fe29c18UL, 0x185edf62UL, 0xbe563d66UL, 0x00000000UL, 0x3fe29027UL, - 0xf729e1ccUL, 0x3e59a9a0UL, 0x80000000UL, 0x3fe28438UL, 0x6433c727UL, - 0xbe43cc89UL, 0x00000000UL, 0x3fe2784dUL, 0x41782631UL, 0xbe30750cUL, - 0xa0000000UL, 0x3fe26c64UL, 0x914911b7UL, 0xbe58290eUL, 0x40000000UL, - 0x3fe2607fUL, 0x3dcc73e1UL, 0xbe4269cdUL, 0x00000000UL, 0x3fe2549dUL, - 0x2751bf70UL, 0xbe5a6998UL, 0xc0000000UL, 0x3fe248bdUL, 0x4248b9fbUL, - 0xbe4ddb00UL, 0x80000000UL, 0x3fe23ce1UL, 0xf35cf82fUL, 0x3e561b71UL, - 0x60000000UL, 0x3fe23108UL, 0x8e481a2dUL, 0x3e518fb9UL, 0x60000000UL, - 0x3fe22532UL, 0x5ab96edcUL, 0xbe5fafc5UL, 0x40000000UL, 0x3fe2195fUL, - 0x80943911UL, 0xbe07f819UL, 0x40000000UL, 0x3fe20d8fUL, 0x386f2d6cUL, - 0xbe54ba8bUL, 0x40000000UL, 0x3fe201c2UL, 0xf29664acUL, 0xbe5eb815UL, - 0x20000000UL, 0x3fe1f5f8UL, 0x64f03390UL, 0x3e5e320cUL, 0x20000000UL, - 0x3fe1ea31UL, 0x747ff696UL, 0x3e5ef0a5UL, 0x40000000UL, 0x3fe1de6dUL, - 0x3e9ceb51UL, 0xbe5f8d27UL, 0x20000000UL, 0x3fe1d2acUL, 0x4ae0b55eUL, - 0x3e5faa21UL, 0x20000000UL, 0x3fe1c6eeUL, 0x28569a5eUL, 0x3e598a4fUL, - 0x20000000UL, 0x3fe1bb33UL, 0x54b33e07UL, 0x3e46130aUL, 0x20000000UL, - 0x3fe1af7bUL, 0x024f1078UL, 0xbe4dbf93UL, 0x00000000UL, 0x3fe1a3c6UL, - 0xb0783bfaUL, 0x3e419248UL, 0xe0000000UL, 0x3fe19813UL, 0x2f02b836UL, - 0x3e4e02b7UL, 0xc0000000UL, 0x3fe18c64UL, 0x28dec9d4UL, 0x3e09064fUL, - 0x80000000UL, 0x3fe180b8UL, 0x45cbf406UL, 0x3e5b1f46UL, 0x40000000UL, - 0x3fe1750fUL, 0x03d9964cUL, 0x3e5b0a79UL, 0x00000000UL, 0x3fe16969UL, - 0x8b5b882bUL, 0xbe238086UL, 0xa0000000UL, 0x3fe15dc5UL, 0x73bad6f8UL, - 0xbdf1fca4UL, 0x20000000UL, 0x3fe15225UL, 0x5385769cUL, 0x3e5e8d76UL, - 0xa0000000UL, 0x3fe14687UL, 0x1676dc6bUL, 0x3e571d08UL, 0x20000000UL, - 0x3fe13aedUL, 0xa8c41c7fUL, 0xbe598a25UL, 0x60000000UL, 0x3fe12f55UL, - 0xc4e1aaf0UL, 0x3e435277UL, 0xa0000000UL, 0x3fe123c0UL, 0x403638e1UL, - 0xbe21aa7cUL, 0xc0000000UL, 0x3fe1182eUL, 0x557a092bUL, 0xbdd0116bUL, - 0xc0000000UL, 0x3fe10c9fUL, 0x7d779f66UL, 0x3e4a61baUL, 0xc0000000UL, - 0x3fe10113UL, 0x2b09c645UL, 0xbe5d586eUL, 0x20000000UL, 0x3fe0ea04UL, - 0xea2cad46UL, 0x3e5aa97cUL, 0x20000000UL, 0x3fe0d300UL, 0x23190e54UL, - 0x3e50f1a7UL, 0xa0000000UL, 0x3fe0bc07UL, 0x1379a5a6UL, 0xbe51619dUL, - 0x60000000UL, 0x3fe0a51aUL, 0x926a3d4aUL, 0x3e5cf019UL, 0xa0000000UL, - 0x3fe08e38UL, 0xa8c24358UL, 0x3e35241eUL, 0x20000000UL, 0x3fe07762UL, - 0x24317e7aUL, 0x3e512cfaUL, 0x00000000UL, 0x3fe06097UL, 0xfd9cf274UL, - 0xbe55bef3UL, 0x00000000UL, 0x3fe049d7UL, 0x3689b49dUL, 0xbe36d26dUL, - 0x40000000UL, 0x3fe03322UL, 0xf72ef6c4UL, 0xbe54cd08UL, 0xa0000000UL, - 0x3fe01c78UL, 0x23702d2dUL, 0xbe5900bfUL, 0x00000000UL, 0x3fe005daUL, - 0x3f59c14cUL, 0x3e57d80bUL, 0x40000000UL, 0x3fdfde8dUL, 0xad67766dUL, - 0xbe57fad4UL, 0x40000000UL, 0x3fdfb17cUL, 0x644f4ae7UL, 0x3e1ee43bUL, - 0x40000000UL, 0x3fdf8481UL, 0x903234d2UL, 0x3e501a86UL, 0x40000000UL, - 0x3fdf579cUL, 0xafe9e509UL, 0xbe267c3eUL, 0x00000000UL, 0x3fdf2acdUL, - 0xb7dfda0bUL, 0xbe48149bUL, 0x40000000UL, 0x3fdefe13UL, 0x3b94305eUL, - 0x3e5f4ea7UL, 0x80000000UL, 0x3fded16fUL, 0x5d95da61UL, 0xbe55c198UL, - 0x00000000UL, 0x3fdea4e1UL, 0x406960c9UL, 0xbdd99a19UL, 0x00000000UL, - 0x3fde7868UL, 0xd22f3539UL, 0x3e470c78UL, 0x80000000UL, 0x3fde4c04UL, - 0x83eec535UL, 0xbe3e1232UL, 0x40000000UL, 0x3fde1fb6UL, 0x3dfbffcbUL, - 0xbe4b7d71UL, 0x40000000UL, 0x3fddf37dUL, 0x7e1be4e0UL, 0xbe5b8f8fUL, - 0x40000000UL, 0x3fddc759UL, 0x46dae887UL, 0xbe350458UL, 0x80000000UL, - 0x3fdd9b4aUL, 0xed6ecc49UL, 0xbe5f0045UL, 0x80000000UL, 0x3fdd6f50UL, - 0x2e9e883cUL, 0x3e2915daUL, 0x80000000UL, 0x3fdd436bUL, 0xf0bccb32UL, - 0x3e4a68c9UL, 0x80000000UL, 0x3fdd179bUL, 0x9bbfc779UL, 0xbe54a26aUL, - 0x00000000UL, 0x3fdcebe0UL, 0x7cea33abUL, 0x3e43c6b7UL, 0x40000000UL, - 0x3fdcc039UL, 0xe740fd06UL, 0x3e5526c2UL, 0x40000000UL, 0x3fdc94a7UL, - 0x9eadeb1aUL, 0xbe396d8dUL, 0xc0000000UL, 0x3fdc6929UL, 0xf0a8f95aUL, - 0xbe5c0ab2UL, 0x80000000UL, 0x3fdc3dc0UL, 0x6ee2693bUL, 0x3e0992e6UL, - 0xc0000000UL, 0x3fdc126bUL, 0x5ac6b581UL, 0xbe2834b6UL, 0x40000000UL, - 0x3fdbe72bUL, 0x8cc226ffUL, 0x3e3596a6UL, 0x00000000UL, 0x3fdbbbffUL, - 0xf92a74bbUL, 0x3e3c5813UL, 0x00000000UL, 0x3fdb90e7UL, 0x479664c0UL, - 0xbe50d644UL, 0x00000000UL, 0x3fdb65e3UL, 0x5004975bUL, 0xbe55258fUL, - 0x00000000UL, 0x3fdb3af3UL, 0xe4b23194UL, 0xbe588407UL, 0xc0000000UL, - 0x3fdb1016UL, 0xe65d4d0aUL, 0x3e527c26UL, 0x80000000UL, 0x3fdae54eUL, - 0x814fddd6UL, 0x3e5962a2UL, 0x40000000UL, 0x3fdaba9aUL, 0xe19d0913UL, - 0xbe562f4eUL, 0x80000000UL, 0x3fda8ff9UL, 0x43cfd006UL, 0xbe4cfdebUL, - 0x40000000UL, 0x3fda656cUL, 0x686f0a4eUL, 0x3e5e47a8UL, 0xc0000000UL, - 0x3fda3af2UL, 0x7200d410UL, 0x3e5e1199UL, 0xc0000000UL, 0x3fda108cUL, - 0xabd2266eUL, 0x3e5ee4d1UL, 0x40000000UL, 0x3fd9e63aUL, 0x396f8f2cUL, - 0x3e4dbffbUL, 0x00000000UL, 0x3fd9bbfbUL, 0xe32b25ddUL, 0x3e5c3a54UL, - 0x40000000UL, 0x3fd991cfUL, 0x431e4035UL, 0xbe457925UL, 0x80000000UL, - 0x3fd967b6UL, 0x7bed3dd3UL, 0x3e40c61dUL, 0x00000000UL, 0x3fd93db1UL, - 0xd7449365UL, 0x3e306419UL, 0x80000000UL, 0x3fd913beUL, 0x1746e791UL, - 0x3e56fcfcUL, 0x40000000UL, 0x3fd8e9dfUL, 0xf3a9028bUL, 0xbe5041b9UL, - 0xc0000000UL, 0x3fd8c012UL, 0x56840c50UL, 0xbe26e20aUL, 0x40000000UL, - 0x3fd89659UL, 0x19763102UL, 0xbe51f466UL, 0x80000000UL, 0x3fd86cb2UL, - 0x7032de7cUL, 0xbe4d298aUL, 0x80000000UL, 0x3fd8431eUL, 0xdeb39fabUL, - 0xbe4361ebUL, 0x40000000UL, 0x3fd8199dUL, 0x5d01cbe0UL, 0xbe5425b3UL, - 0x80000000UL, 0x3fd7f02eUL, 0x3ce99aa9UL, 0x3e146fa8UL, 0x80000000UL, - 0x3fd7c6d2UL, 0xd1a262b9UL, 0xbe5a1a69UL, 0xc0000000UL, 0x3fd79d88UL, - 0x8606c236UL, 0x3e423a08UL, 0x80000000UL, 0x3fd77451UL, 0x8fd1e1b7UL, - 0x3e5a6a63UL, 0xc0000000UL, 0x3fd74b2cUL, 0xe491456aUL, 0x3e42c1caUL, - 0x40000000UL, 0x3fd7221aUL, 0x4499a6d7UL, 0x3e36a69aUL, 0x00000000UL, - 0x3fd6f91aUL, 0x5237df94UL, 0xbe0f8f02UL, 0x00000000UL, 0x3fd6d02cUL, - 0xb6482c6eUL, 0xbe5abcf7UL, 0x00000000UL, 0x3fd6a750UL, 0x1919fd61UL, - 0xbe57ade2UL, 0x00000000UL, 0x3fd67e86UL, 0xaa7a994dUL, 0xbe3f3fbdUL, - 0x00000000UL, 0x3fd655ceUL, 0x67db014cUL, 0x3e33c550UL, 0x00000000UL, - 0x3fd62d28UL, 0xa82856b7UL, 0xbe1409d1UL, 0xc0000000UL, 0x3fd60493UL, - 0x1e6a300dUL, 0x3e55d899UL, 0x80000000UL, 0x3fd5dc11UL, 0x1222bd5cUL, - 0xbe35bfc0UL, 0xc0000000UL, 0x3fd5b3a0UL, 0x6e8dc2d3UL, 0x3e5d4d79UL, - 0x00000000UL, 0x3fd58b42UL, 0xe0e4ace6UL, 0xbe517303UL, 0x80000000UL, - 0x3fd562f4UL, 0xb306e0a8UL, 0x3e5edf0fUL, 0xc0000000UL, 0x3fd53ab8UL, - 0x6574bc54UL, 0x3e5ee859UL, 0x80000000UL, 0x3fd5128eUL, 0xea902207UL, - 0x3e5f6188UL, 0xc0000000UL, 0x3fd4ea75UL, 0x9f911d79UL, 0x3e511735UL, - 0x80000000UL, 0x3fd4c26eUL, 0xf9c77397UL, 0xbe5b1643UL, 0x40000000UL, - 0x3fd49a78UL, 0x15fc9258UL, 0x3e479a37UL, 0x80000000UL, 0x3fd47293UL, - 0xd5a04dd9UL, 0xbe426e56UL, 0xc0000000UL, 0x3fd44abfUL, 0xe04042f5UL, - 0x3e56f7c6UL, 0x40000000UL, 0x3fd422fdUL, 0x1d8bf2c8UL, 0x3e5d8810UL, - 0x00000000UL, 0x3fd3fb4cUL, 0x88a8ddeeUL, 0xbe311454UL, 0xc0000000UL, - 0x3fd3d3abUL, 0x3e3b5e47UL, 0xbe5d1b72UL, 0x40000000UL, 0x3fd3ac1cUL, - 0xc2ab5d59UL, 0x3e31b02bUL, 0xc0000000UL, 0x3fd3849dUL, 0xd4e34b9eUL, - 0x3e51cb2fUL, 0x40000000UL, 0x3fd35d30UL, 0x177204fbUL, 0xbe2b8cd7UL, - 0x80000000UL, 0x3fd335d3UL, 0xfcd38c82UL, 0xbe4356e1UL, 0x80000000UL, - 0x3fd30e87UL, 0x64f54accUL, 0xbe4e6224UL, 0x00000000UL, 0x3fd2e74cUL, - 0xaa7975d9UL, 0x3e5dc0feUL, 0x80000000UL, 0x3fd2c021UL, 0x516dab3fUL, - 0xbe50ffa3UL, 0x40000000UL, 0x3fd29907UL, 0x2bfb7313UL, 0x3e5674a2UL, - 0xc0000000UL, 0x3fd271fdUL, 0x0549fc99UL, 0x3e385d29UL, 0xc0000000UL, - 0x3fd24b04UL, 0x55b63073UL, 0xbe500c6dUL, 0x00000000UL, 0x3fd2241cUL, - 0x3f91953aUL, 0x3e389977UL, 0xc0000000UL, 0x3fd1fd43UL, 0xa1543f71UL, - 0xbe3487abUL, 0xc0000000UL, 0x3fd1d67bUL, 0x4ec8867cUL, 0x3df6a2dcUL, - 0x00000000UL, 0x3fd1afc4UL, 0x4328e3bbUL, 0x3e41d9c0UL, 0x80000000UL, - 0x3fd1891cUL, 0x2e1cda84UL, 0x3e3bdd87UL, 0x40000000UL, 0x3fd16285UL, - 0x4b5331aeUL, 0xbe53128eUL, 0x00000000UL, 0x3fd13bfeUL, 0xb9aec164UL, - 0xbe52ac98UL, 0xc0000000UL, 0x3fd11586UL, 0xd91e1316UL, 0xbe350630UL, - 0x80000000UL, 0x3fd0ef1fUL, 0x7cacc12cUL, 0x3e3f5219UL, 0x40000000UL, - 0x3fd0c8c8UL, 0xbce277b7UL, 0x3e3d30c0UL, 0x00000000UL, 0x3fd0a281UL, - 0x2a63447dUL, 0xbe541377UL, 0x80000000UL, 0x3fd07c49UL, 0xfac483b5UL, - 0xbe5772ecUL, 0xc0000000UL, 0x3fd05621UL, 0x36b8a570UL, 0xbe4fd4bdUL, - 0xc0000000UL, 0x3fd03009UL, 0xbae505f7UL, 0xbe450388UL, 0x80000000UL, - 0x3fd00a01UL, 0x3e35aeadUL, 0xbe5430fcUL, 0x80000000UL, 0x3fcfc811UL, - 0x707475acUL, 0x3e38806eUL, 0x80000000UL, 0x3fcf7c3fUL, 0xc91817fcUL, - 0xbe40cceaUL, 0x80000000UL, 0x3fcf308cUL, 0xae05d5e9UL, 0xbe4919b8UL, - 0x80000000UL, 0x3fcee4f8UL, 0xae6cc9e6UL, 0xbe530b94UL, 0x00000000UL, - 0x3fce9983UL, 0x1efe3e8eUL, 0x3e57747eUL, 0x00000000UL, 0x3fce4e2dUL, - 0xda78d9bfUL, 0xbe59a608UL, 0x00000000UL, 0x3fce02f5UL, 0x8abe2c2eUL, - 0x3e4a35adUL, 0x00000000UL, 0x3fcdb7dcUL, 0x1495450dUL, 0xbe0872ccUL, - 0x80000000UL, 0x3fcd6ce1UL, 0x86ee0ba0UL, 0xbe4f59a0UL, 0x00000000UL, - 0x3fcd2205UL, 0xe81ca888UL, 0x3e5402c3UL, 0x00000000UL, 0x3fccd747UL, - 0x3b4424b9UL, 0x3e5dfdc3UL, 0x80000000UL, 0x3fcc8ca7UL, 0xd305b56cUL, - 0x3e202da6UL, 0x00000000UL, 0x3fcc4226UL, 0x399a6910UL, 0xbe482a1cUL, - 0x80000000UL, 0x3fcbf7c2UL, 0x747f7938UL, 0xbe587372UL, 0x80000000UL, - 0x3fcbad7cUL, 0x6fc246a0UL, 0x3e50d83dUL, 0x00000000UL, 0x3fcb6355UL, - 0xee9e9be5UL, 0xbe5c35bdUL, 0x80000000UL, 0x3fcb194aUL, 0x8416c0bcUL, - 0x3e546d4fUL, 0x00000000UL, 0x3fcacf5eUL, 0x49f7f08fUL, 0x3e56da76UL, - 0x00000000UL, 0x3fca858fUL, 0x5dc30de2UL, 0x3e5f390cUL, 0x00000000UL, - 0x3fca3bdeUL, 0x950583b6UL, 0xbe5e4169UL, 0x80000000UL, 0x3fc9f249UL, - 0x33631553UL, 0x3e52aeb1UL, 0x00000000UL, 0x3fc9a8d3UL, 0xde8795a6UL, - 0xbe59a504UL, 0x00000000UL, 0x3fc95f79UL, 0x076bf41eUL, 0x3e5122feUL, - 0x80000000UL, 0x3fc9163cUL, 0x2914c8e7UL, 0x3e3dd064UL, 0x00000000UL, - 0x3fc8cd1dUL, 0x3a30eca3UL, 0xbe21b4aaUL, 0x80000000UL, 0x3fc8841aUL, - 0xb2a96650UL, 0xbe575444UL, 0x80000000UL, 0x3fc83b34UL, 0x2376c0cbUL, - 0xbe2a74c7UL, 0x80000000UL, 0x3fc7f26bUL, 0xd8a0b653UL, 0xbe5181b6UL, - 0x00000000UL, 0x3fc7a9bfUL, 0x32257882UL, 0xbe4a78b4UL, 0x00000000UL, - 0x3fc7612fUL, 0x1eee8bd9UL, 0xbe1bfe9dUL, 0x80000000UL, 0x3fc718bbUL, - 0x0c603cc4UL, 0x3e36fdc9UL, 0x80000000UL, 0x3fc6d064UL, 0x3728b8cfUL, - 0xbe1e542eUL, 0x80000000UL, 0x3fc68829UL, 0xc79a4067UL, 0x3e5c380fUL, - 0x00000000UL, 0x3fc6400bUL, 0xf69eac69UL, 0x3e550a84UL, 0x80000000UL, - 0x3fc5f808UL, 0xb7a780a4UL, 0x3e5d9224UL, 0x80000000UL, 0x3fc5b022UL, - 0xad9dfb1eUL, 0xbe55242fUL, 0x00000000UL, 0x3fc56858UL, 0x659b18beUL, - 0xbe4bfda3UL, 0x80000000UL, 0x3fc520a9UL, 0x66ee3631UL, 0xbe57d769UL, - 0x80000000UL, 0x3fc4d916UL, 0x1ec62819UL, 0x3e2427f7UL, 0x80000000UL, - 0x3fc4919fUL, 0xdec25369UL, 0xbe435431UL, 0x00000000UL, 0x3fc44a44UL, - 0xa8acfc4bUL, 0xbe3c62e8UL, 0x00000000UL, 0x3fc40304UL, 0xcf1d3eabUL, - 0xbdfba29fUL, 0x80000000UL, 0x3fc3bbdfUL, 0x79aba3eaUL, 0xbdf1b7c8UL, - 0x80000000UL, 0x3fc374d6UL, 0xb8d186daUL, 0xbe5130cfUL, 0x80000000UL, - 0x3fc32de8UL, 0x9d74f152UL, 0x3e2285b6UL, 0x00000000UL, 0x3fc2e716UL, - 0x50ae7ca9UL, 0xbe503920UL, 0x80000000UL, 0x3fc2a05eUL, 0x6caed92eUL, - 0xbe533924UL, 0x00000000UL, 0x3fc259c2UL, 0x9cb5034eUL, 0xbe510e31UL, - 0x80000000UL, 0x3fc21340UL, 0x12c4d378UL, 0xbe540b43UL, 0x80000000UL, - 0x3fc1ccd9UL, 0xcc418706UL, 0x3e59887aUL, 0x00000000UL, 0x3fc1868eUL, - 0x921f4106UL, 0xbe528e67UL, 0x80000000UL, 0x3fc1405cUL, 0x3969441eUL, - 0x3e5d8051UL, 0x00000000UL, 0x3fc0fa46UL, 0xd941ef5bUL, 0x3e5f9079UL, - 0x80000000UL, 0x3fc0b44aUL, 0x5a3e81b2UL, 0xbe567691UL, 0x00000000UL, - 0x3fc06e69UL, 0x9d66afe7UL, 0xbe4d43fbUL, 0x00000000UL, 0x3fc028a2UL, - 0x0a92a162UL, 0xbe52f394UL, 0x00000000UL, 0x3fbfc5eaUL, 0x209897e5UL, - 0x3e529e37UL, 0x00000000UL, 0x3fbf3ac5UL, 0x8458bd7bUL, 0x3e582831UL, - 0x00000000UL, 0x3fbeafd5UL, 0xb8d8b4b8UL, 0xbe486b4aUL, 0x00000000UL, - 0x3fbe2518UL, 0xe0a3b7b6UL, 0x3e5bafd2UL, 0x00000000UL, 0x3fbd9a90UL, - 0x2bf2710eUL, 0x3e383b2bUL, 0x00000000UL, 0x3fbd103cUL, 0x73eb6ab7UL, - 0xbe56d78dUL, 0x00000000UL, 0x3fbc861bUL, 0x32ceaff5UL, 0xbe32dc5aUL, - 0x00000000UL, 0x3fbbfc2eUL, 0xbee04cb7UL, 0xbe4a71a4UL, 0x00000000UL, - 0x3fbb7274UL, 0x35ae9577UL, 0x3e38142fUL, 0x00000000UL, 0x3fbae8eeUL, - 0xcbaddab4UL, 0xbe5490f0UL, 0x00000000UL, 0x3fba5f9aUL, 0x95ce1114UL, - 0x3e597c71UL, 0x00000000UL, 0x3fb9d67aUL, 0x6d7c0f78UL, 0x3e3abc2dUL, - 0x00000000UL, 0x3fb94d8dUL, 0x2841a782UL, 0xbe566cbcUL, 0x00000000UL, - 0x3fb8c4d2UL, 0x6ed429c6UL, 0xbe3cfff9UL, 0x00000000UL, 0x3fb83c4aUL, - 0xe4a49fbbUL, 0xbe552964UL, 0x00000000UL, 0x3fb7b3f4UL, 0x2193d81eUL, - 0xbe42fa72UL, 0x00000000UL, 0x3fb72bd0UL, 0xdd70c122UL, 0x3e527a8cUL, - 0x00000000UL, 0x3fb6a3dfUL, 0x03108a54UL, 0xbe450393UL, 0x00000000UL, - 0x3fb61c1fUL, 0x30ff7954UL, 0x3e565840UL, 0x00000000UL, 0x3fb59492UL, - 0xdedd460cUL, 0xbe5422b5UL, 0x00000000UL, 0x3fb50d36UL, 0x950f9f45UL, - 0xbe5313f6UL, 0x00000000UL, 0x3fb4860bUL, 0x582cdcb1UL, 0x3e506d39UL, - 0x00000000UL, 0x3fb3ff12UL, 0x7216d3a6UL, 0x3e4aa719UL, 0x00000000UL, - 0x3fb3784aUL, 0x57a423fdUL, 0x3e5a9b9fUL, 0x00000000UL, 0x3fb2f1b4UL, - 0x7a138b41UL, 0xbe50b418UL, 0x00000000UL, 0x3fb26b4eUL, 0x2fbfd7eaUL, - 0x3e23a53eUL, 0x00000000UL, 0x3fb1e519UL, 0x18913ccbUL, 0x3e465fc1UL, - 0x00000000UL, 0x3fb15f15UL, 0x7ea24e21UL, 0x3e042843UL, 0x00000000UL, - 0x3fb0d941UL, 0x7c6d9c77UL, 0x3e59f61eUL, 0x00000000UL, 0x3fb0539eUL, - 0x114efd44UL, 0x3e4ccab7UL, 0x00000000UL, 0x3faf9c56UL, 0x1777f657UL, - 0x3e552f65UL, 0x00000000UL, 0x3fae91d2UL, 0xc317b86aUL, 0xbe5a61e0UL, - 0x00000000UL, 0x3fad87acUL, 0xb7664efbUL, 0xbe41f64eUL, 0x00000000UL, - 0x3fac7de6UL, 0x5d3d03a9UL, 0x3e0807a0UL, 0x00000000UL, 0x3fab7480UL, - 0x743c38ebUL, 0xbe3726e1UL, 0x00000000UL, 0x3faa6b78UL, 0x06a253f1UL, - 0x3e5ad636UL, 0x00000000UL, 0x3fa962d0UL, 0xa35f541bUL, 0x3e5a187aUL, - 0x00000000UL, 0x3fa85a88UL, 0x4b86e446UL, 0xbe508150UL, 0x00000000UL, - 0x3fa7529cUL, 0x2589cacfUL, 0x3e52938aUL, 0x00000000UL, 0x3fa64b10UL, - 0xaf6b11f2UL, 0xbe3454cdUL, 0x00000000UL, 0x3fa543e2UL, 0x97506fefUL, - 0xbe5fdec5UL, 0x00000000UL, 0x3fa43d10UL, 0xe75f7dd9UL, 0xbe388dd3UL, - 0x00000000UL, 0x3fa3369cUL, 0xa4139632UL, 0xbdea5177UL, 0x00000000UL, - 0x3fa23086UL, 0x352d6f1eUL, 0xbe565ad6UL, 0x00000000UL, 0x3fa12accUL, - 0x77449eb7UL, 0xbe50d5c7UL, 0x00000000UL, 0x3fa0256eUL, 0x7478da78UL, - 0x3e404724UL, 0x00000000UL, 0x3f9e40dcUL, 0xf59cef7fUL, 0xbe539d0aUL, - 0x00000000UL, 0x3f9c3790UL, 0x1511d43cUL, 0x3e53c2c8UL, 0x00000000UL, - 0x3f9a2f00UL, 0x9b8bff3cUL, 0xbe43b3e1UL, 0x00000000UL, 0x3f982724UL, - 0xad1e22a5UL, 0x3e46f0bdUL, 0x00000000UL, 0x3f962000UL, 0x130d9356UL, - 0x3e475ba0UL, 0x00000000UL, 0x3f941994UL, 0x8f86f883UL, 0xbe513d0bUL, - 0x00000000UL, 0x3f9213dcUL, 0x914d0dc8UL, 0xbe534335UL, 0x00000000UL, - 0x3f900ed8UL, 0x2d73e5e7UL, 0xbe22ba75UL, 0x00000000UL, 0x3f8c1510UL, - 0xc5b7d70eUL, 0x3e599c5dUL, 0x00000000UL, 0x3f880de0UL, 0x8a27857eUL, - 0xbe3d28c8UL, 0x00000000UL, 0x3f840810UL, 0xda767328UL, 0x3e531b3dUL, - 0x00000000UL, 0x3f8003b0UL, 0x77bacaf3UL, 0xbe5f04e3UL, 0x00000000UL, - 0x3f780150UL, 0xdf4b0720UL, 0x3e5a8bffUL, 0x00000000UL, 0x3f6ffc40UL, - 0x34c48e71UL, 0xbe3fcd99UL, 0x00000000UL, 0x3f5ff6c0UL, 0x1ad218afUL, - 0xbe4c78a7UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x80000000UL, - 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, - 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL, 0x6dc96112UL, 0xbf836578UL, - 0xee241472UL, 0xbf9b0301UL, 0x9f95985aUL, 0xbfb528dbUL, 0xb3841d2aUL, - 0xbfd619b6UL, 0x518775e3UL, 0x3f9004f2UL, 0xac8349bbUL, 0x3fa76c9bUL, - 0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, 0xbf5dabe1UL, 0x9f95985aUL, - 0xbfb528dbUL, 0xf8b5787dUL, 0x3ef2531eUL, 0x486ececbUL, 0x3fc4635eUL, - 0x412055ccUL, 0xbdd61bb2UL, 0x00000000UL, 0xfffffff8UL, 0x00000000UL, - 0xffffffffUL, 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x3b700000UL, - 0xfa5abcbfUL, 0x3ff00b1aUL, 0xa7609f71UL, 0xbc84f6b2UL, 0xa9fb3335UL, - 0x3ff0163dUL, 0x9ab8cdb7UL, 0x3c9b6129UL, 0x143b0281UL, 0x3ff02168UL, - 0x0fc54eb6UL, 0xbc82bf31UL, 0x3e778061UL, 0x3ff02c9aUL, 0x535b085dUL, - 0xbc719083UL, 0x2e11bbccUL, 0x3ff037d4UL, 0xeeade11aUL, 0x3c656811UL, - 0xe86e7f85UL, 0x3ff04315UL, 0x1977c96eUL, 0xbc90a31cUL, 0x72f654b1UL, - 0x3ff04e5fUL, 0x3aa0d08cUL, 0x3c84c379UL, 0xd3158574UL, 0x3ff059b0UL, - 0xa475b465UL, 0x3c8d73e2UL, 0x0e3c1f89UL, 0x3ff0650aUL, 0x5799c397UL, - 0xbc95cb7bUL, 0x29ddf6deUL, 0x3ff0706bUL, 0xe2b13c27UL, 0xbc8c91dfUL, - 0x2b72a836UL, 0x3ff07bd4UL, 0x54458700UL, 0x3c832334UL, 0x18759bc8UL, - 0x3ff08745UL, 0x4bb284ffUL, 0x3c6186beUL, 0xf66607e0UL, 0x3ff092bdUL, - 0x800a3fd1UL, 0xbc968063UL, 0xcac6f383UL, 0x3ff09e3eUL, 0x18316136UL, - 0x3c914878UL, 0x9b1f3919UL, 0x3ff0a9c7UL, 0x873d1d38UL, 0x3c85d16cUL, - 0x6cf9890fUL, 0x3ff0b558UL, 0x4adc610bUL, 0x3c98a62eUL, 0x45e46c85UL, - 0x3ff0c0f1UL, 0x06d21cefUL, 0x3c94f989UL, 0x2b7247f7UL, 0x3ff0cc92UL, - 0x16e24f71UL, 0x3c901edcUL, 0x23395decUL, 0x3ff0d83bUL, 0xe43f316aUL, - 0xbc9bc14dUL, 0x32d3d1a2UL, 0x3ff0e3ecUL, 0x27c57b52UL, 0x3c403a17UL, - 0x5fdfa9c5UL, 0x3ff0efa5UL, 0xbc54021bUL, 0xbc949db9UL, 0xaffed31bUL, - 0x3ff0fb66UL, 0xc44ebd7bUL, 0xbc6b9bedUL, 0x28d7233eUL, 0x3ff10730UL, - 0x1692fdd5UL, 0x3c8d46ebUL, 0xd0125b51UL, 0x3ff11301UL, 0x39449b3aUL, - 0xbc96c510UL, 0xab5e2ab6UL, 0x3ff11edbUL, 0xf703fb72UL, 0xbc9ca454UL, - 0xc06c31ccUL, 0x3ff12abdUL, 0xb36ca5c7UL, 0xbc51b514UL, 0x14f204abUL, - 0x3ff136a8UL, 0xba48dcf0UL, 0xbc67108fUL, 0xaea92de0UL, 0x3ff1429aUL, - 0x9af1369eUL, 0xbc932fbfUL, 0x934f312eUL, 0x3ff14e95UL, 0x39bf44abUL, - 0xbc8b91e8UL, 0xc8a58e51UL, 0x3ff15a98UL, 0xb9eeab0aUL, 0x3c82406aUL, - 0x5471c3c2UL, 0x3ff166a4UL, 0x82ea1a32UL, 0x3c58f23bUL, 0x3c7d517bUL, - 0x3ff172b8UL, 0xb9d78a76UL, 0xbc819041UL, 0x8695bbc0UL, 0x3ff17ed4UL, - 0xe2ac5a64UL, 0x3c709e3fUL, 0x388c8deaUL, 0x3ff18af9UL, 0xd1970f6cUL, - 0xbc911023UL, 0x58375d2fUL, 0x3ff19726UL, 0x85f17e08UL, 0x3c94aaddUL, - 0xeb6fcb75UL, 0x3ff1a35bUL, 0x7b4968e4UL, 0x3c8e5b4cUL, 0xf8138a1cUL, - 0x3ff1af99UL, 0xa4b69280UL, 0x3c97bf85UL, 0x84045cd4UL, 0x3ff1bbe0UL, - 0x352ef607UL, 0xbc995386UL, 0x95281c6bUL, 0x3ff1c82fUL, 0x8010f8c9UL, - 0x3c900977UL, 0x3168b9aaUL, 0x3ff1d487UL, 0x00a2643cUL, 0x3c9e016eUL, - 0x5eb44027UL, 0x3ff1e0e7UL, 0x088cb6deUL, 0xbc96fdd8UL, 0x22fcd91dUL, - 0x3ff1ed50UL, 0x027bb78cUL, 0xbc91df98UL, 0x8438ce4dUL, 0x3ff1f9c1UL, - 0xa097af5cUL, 0xbc9bf524UL, 0x88628cd6UL, 0x3ff2063bUL, 0x814a8495UL, - 0x3c8dc775UL, 0x3578a819UL, 0x3ff212beUL, 0x2cfcaac9UL, 0x3c93592dUL, - 0x917ddc96UL, 0x3ff21f49UL, 0x9494a5eeUL, 0x3c82a97eUL, 0xa27912d1UL, - 0x3ff22bddUL, 0x5577d69fUL, 0x3c8d34fbUL, 0x6e756238UL, 0x3ff2387aUL, - 0xb6c70573UL, 0x3c99b07eUL, 0xfb82140aUL, 0x3ff2451fUL, 0x911ca996UL, - 0x3c8acfccUL, 0x4fb2a63fUL, 0x3ff251ceUL, 0xbef4f4a4UL, 0x3c8ac155UL, - 0x711ece75UL, 0x3ff25e85UL, 0x4ac31b2cUL, 0x3c93e1a2UL, 0x65e27cddUL, - 0x3ff26b45UL, 0x9940e9d9UL, 0x3c82bd33UL, 0x341ddf29UL, 0x3ff2780eUL, - 0x05f9e76cUL, 0x3c9e067cUL, 0xe1f56381UL, 0x3ff284dfUL, 0x8c3f0d7eUL, - 0xbc9a4c3aUL, 0x7591bb70UL, 0x3ff291baUL, 0x28401cbdUL, 0xbc82cc72UL, - 0xf51fdee1UL, 0x3ff29e9dUL, 0xafad1255UL, 0x3c8612e8UL, 0x66d10f13UL, - 0x3ff2ab8aUL, 0x191690a7UL, 0xbc995743UL, 0xd0dad990UL, 0x3ff2b87fUL, - 0xd6381aa4UL, 0xbc410adcUL, 0x39771b2fUL, 0x3ff2c57eUL, 0xa6eb5124UL, - 0xbc950145UL, 0xa6e4030bUL, 0x3ff2d285UL, 0x54db41d5UL, 0x3c900247UL, - 0x1f641589UL, 0x3ff2df96UL, 0xfbbce198UL, 0x3c9d16cfUL, 0xa93e2f56UL, - 0x3ff2ecafUL, 0x45d52383UL, 0x3c71ca0fUL, 0x4abd886bUL, 0x3ff2f9d2UL, - 0x532bda93UL, 0xbc653c55UL, 0x0a31b715UL, 0x3ff306feUL, 0xd23182e4UL, - 0x3c86f46aUL, 0xedeeb2fdUL, 0x3ff31432UL, 0xf3f3fcd1UL, 0x3c8959a3UL, - 0xfc4cd831UL, 0x3ff32170UL, 0x8e18047cUL, 0x3c8a9ce7UL, 0x3ba8ea32UL, - 0x3ff32eb8UL, 0x3cb4f318UL, 0xbc9c45e8UL, 0xb26416ffUL, 0x3ff33c08UL, - 0x843659a6UL, 0x3c932721UL, 0x66e3fa2dUL, 0x3ff34962UL, 0x930881a4UL, - 0xbc835a75UL, 0x5f929ff1UL, 0x3ff356c5UL, 0x5c4e4628UL, 0xbc8b5ceeUL, - 0xa2de883bUL, 0x3ff36431UL, 0xa06cb85eUL, 0xbc8c3144UL, 0x373aa9cbUL, - 0x3ff371a7UL, 0xbf42eae2UL, 0xbc963aeaUL, 0x231e754aUL, 0x3ff37f26UL, - 0x9eceb23cUL, 0xbc99f5caUL, 0x6d05d866UL, 0x3ff38caeUL, 0x3c9904bdUL, - 0xbc9e958dUL, 0x1b7140efUL, 0x3ff39a40UL, 0xfc8e2934UL, 0xbc99a9a5UL, - 0x34e59ff7UL, 0x3ff3a7dbUL, 0xd661f5e3UL, 0xbc75e436UL, 0xbfec6cf4UL, - 0x3ff3b57fUL, 0xe26fff18UL, 0x3c954c66UL, 0xc313a8e5UL, 0x3ff3c32dUL, - 0x375d29c3UL, 0xbc9efff8UL, 0x44ede173UL, 0x3ff3d0e5UL, 0x8c284c71UL, - 0x3c7fe8d0UL, 0x4c123422UL, 0x3ff3dea6UL, 0x11f09ebcUL, 0x3c8ada09UL, - 0xdf1c5175UL, 0x3ff3ec70UL, 0x7b8c9bcaUL, 0xbc8af663UL, 0x04ac801cUL, - 0x3ff3fa45UL, 0xf956f9f3UL, 0xbc97d023UL, 0xc367a024UL, 0x3ff40822UL, - 0xb6f4d048UL, 0x3c8bddf8UL, 0x21f72e2aUL, 0x3ff4160aUL, 0x1c309278UL, - 0xbc5ef369UL, 0x2709468aUL, 0x3ff423fbUL, 0xc0b314ddUL, 0xbc98462dUL, - 0xd950a897UL, 0x3ff431f5UL, 0xe35f7999UL, 0xbc81c7ddUL, 0x3f84b9d4UL, - 0x3ff43ffaUL, 0x9704c003UL, 0x3c8880beUL, 0x6061892dUL, 0x3ff44e08UL, - 0x04ef80d0UL, 0x3c489b7aUL, 0x42a7d232UL, 0x3ff45c20UL, 0x82fb1f8eUL, - 0xbc686419UL, 0xed1d0057UL, 0x3ff46a41UL, 0xd1648a76UL, 0x3c9c944bUL, - 0x668b3237UL, 0x3ff4786dUL, 0xed445733UL, 0xbc9c20f0UL, 0xb5c13cd0UL, - 0x3ff486a2UL, 0xb69062f0UL, 0x3c73c1a3UL, 0xe192aed2UL, 0x3ff494e1UL, - 0x5e499ea0UL, 0xbc83b289UL, 0xf0d7d3deUL, 0x3ff4a32aUL, 0xf3d1be56UL, - 0x3c99cb62UL, 0xea6db7d7UL, 0x3ff4b17dUL, 0x7f2897f0UL, 0xbc8125b8UL, - 0xd5362a27UL, 0x3ff4bfdaUL, 0xafec42e2UL, 0x3c7d4397UL, 0xb817c114UL, - 0x3ff4ce41UL, 0x690abd5dUL, 0x3c905e29UL, 0x99fddd0dUL, 0x3ff4dcb2UL, - 0xbc6a7833UL, 0x3c98ecdbUL, 0x81d8abffUL, 0x3ff4eb2dUL, 0x2e5d7a52UL, - 0xbc95257dUL, 0x769d2ca7UL, 0x3ff4f9b2UL, 0xd25957e3UL, 0xbc94b309UL, - 0x7f4531eeUL, 0x3ff50841UL, 0x49b7465fUL, 0x3c7a249bUL, 0xa2cf6642UL, - 0x3ff516daUL, 0x69bd93efUL, 0xbc8f7685UL, 0xe83f4eefUL, 0x3ff5257dUL, - 0x43efef71UL, 0xbc7c998dUL, 0x569d4f82UL, 0x3ff5342bUL, 0x1db13cadUL, - 0xbc807abeUL, 0xf4f6ad27UL, 0x3ff542e2UL, 0x192d5f7eUL, 0x3c87926dUL, - 0xca5d920fUL, 0x3ff551a4UL, 0xefede59bUL, 0xbc8d689cUL, 0xdde910d2UL, - 0x3ff56070UL, 0x168eebf0UL, 0xbc90fb6eUL, 0x36b527daUL, 0x3ff56f47UL, - 0x011d93adUL, 0x3c99bb2cUL, 0xdbe2c4cfUL, 0x3ff57e27UL, 0x8a57b9c4UL, - 0xbc90b98cUL, 0xd497c7fdUL, 0x3ff58d12UL, 0x5b9a1de8UL, 0x3c8295e1UL, - 0x27ff07ccUL, 0x3ff59c08UL, 0xe467e60fUL, 0xbc97e2ceUL, 0xdd485429UL, - 0x3ff5ab07UL, 0x054647adUL, 0x3c96324cUL, 0xfba87a03UL, 0x3ff5ba11UL, - 0x4c233e1aUL, 0xbc9b77a1UL, 0x8a5946b7UL, 0x3ff5c926UL, 0x816986a2UL, - 0x3c3c4b1bUL, 0x90998b93UL, 0x3ff5d845UL, 0xa8b45643UL, 0xbc9cd6a7UL, - 0x15ad2148UL, 0x3ff5e76fUL, 0x3080e65eUL, 0x3c9ba6f9UL, 0x20dceb71UL, - 0x3ff5f6a3UL, 0xe3cdcf92UL, 0xbc89eaddUL, 0xb976dc09UL, 0x3ff605e1UL, - 0x9b56de47UL, 0xbc93e242UL, 0xe6cdf6f4UL, 0x3ff6152aUL, 0x4ab84c27UL, - 0x3c9e4b3eUL, 0xb03a5585UL, 0x3ff6247eUL, 0x7e40b497UL, 0xbc9383c1UL, - 0x1d1929fdUL, 0x3ff633ddUL, 0xbeb964e5UL, 0x3c984710UL, 0x34ccc320UL, - 0x3ff64346UL, 0x759d8933UL, 0xbc8c483cUL, 0xfebc8fb7UL, 0x3ff652b9UL, - 0xc9a73e09UL, 0xbc9ae3d5UL, 0x82552225UL, 0x3ff66238UL, 0x87591c34UL, - 0xbc9bb609UL, 0xc70833f6UL, 0x3ff671c1UL, 0x586c6134UL, 0xbc8e8732UL, - 0xd44ca973UL, 0x3ff68155UL, 0x44f73e65UL, 0x3c6038aeUL, 0xb19e9538UL, - 0x3ff690f4UL, 0x9aeb445dUL, 0x3c8804bdUL, 0x667f3bcdUL, 0x3ff6a09eUL, - 0x13b26456UL, 0xbc9bdd34UL, 0xfa75173eUL, 0x3ff6b052UL, 0x2c9a9d0eUL, - 0x3c7a38f5UL, 0x750bdabfUL, 0x3ff6c012UL, 0x67ff0b0dUL, 0xbc728956UL, - 0xddd47645UL, 0x3ff6cfdcUL, 0xb6f17309UL, 0x3c9c7aa9UL, 0x3c651a2fUL, - 0x3ff6dfb2UL, 0x683c88abUL, 0xbc6bbe3aUL, 0x98593ae5UL, 0x3ff6ef92UL, - 0x9e1ac8b2UL, 0xbc90b974UL, 0xf9519484UL, 0x3ff6ff7dUL, 0x25860ef6UL, - 0xbc883c0fUL, 0x66f42e87UL, 0x3ff70f74UL, 0xd45aa65fUL, 0x3c59d644UL, - 0xe8ec5f74UL, 0x3ff71f75UL, 0x86887a99UL, 0xbc816e47UL, 0x86ead08aUL, - 0x3ff72f82UL, 0x2cd62c72UL, 0xbc920aa0UL, 0x48a58174UL, 0x3ff73f9aUL, - 0x6c65d53cUL, 0xbc90a8d9UL, 0x35d7cbfdUL, 0x3ff74fbdUL, 0x618a6e1cUL, - 0x3c9047fdUL, 0x564267c9UL, 0x3ff75febUL, 0x57316dd3UL, 0xbc902459UL, - 0xb1ab6e09UL, 0x3ff77024UL, 0x169147f8UL, 0x3c9b7877UL, 0x4fde5d3fUL, - 0x3ff78069UL, 0x0a02162dUL, 0x3c9866b8UL, 0x38ac1cf6UL, 0x3ff790b9UL, - 0x62aadd3eUL, 0x3c9349a8UL, 0x73eb0187UL, 0x3ff7a114UL, 0xee04992fUL, - 0xbc841577UL, 0x0976cfdbUL, 0x3ff7b17bUL, 0x8468dc88UL, 0xbc9bebb5UL, - 0x0130c132UL, 0x3ff7c1edUL, 0xd1164dd6UL, 0x3c9f124cUL, 0x62ff86f0UL, - 0x3ff7d26aUL, 0xfb72b8b4UL, 0x3c91bddbUL, 0x36cf4e62UL, 0x3ff7e2f3UL, - 0xba15797eUL, 0x3c705d02UL, 0x8491c491UL, 0x3ff7f387UL, 0xcf9311aeUL, - 0xbc807f11UL, 0x543e1a12UL, 0x3ff80427UL, 0x626d972bUL, 0xbc927c86UL, - 0xadd106d9UL, 0x3ff814d2UL, 0x0d151d4dUL, 0x3c946437UL, 0x994cce13UL, - 0x3ff82589UL, 0xd41532d8UL, 0xbc9d4c1dUL, 0x1eb941f7UL, 0x3ff8364cUL, - 0x31df2bd5UL, 0x3c999b9aUL, 0x4623c7adUL, 0x3ff8471aUL, 0xa341cdfbUL, - 0xbc88d684UL, 0x179f5b21UL, 0x3ff857f4UL, 0xf8b216d0UL, 0xbc5ba748UL, - 0x9b4492edUL, 0x3ff868d9UL, 0x9bd4f6baUL, 0xbc9fc6f8UL, 0xd931a436UL, - 0x3ff879caUL, 0xd2db47bdUL, 0x3c85d2d7UL, 0xd98a6699UL, 0x3ff88ac7UL, - 0xf37cb53aUL, 0x3c9994c2UL, 0xa478580fUL, 0x3ff89bd0UL, 0x4475202aUL, - 0x3c9d5395UL, 0x422aa0dbUL, 0x3ff8ace5UL, 0x56864b27UL, 0x3c96e9f1UL, - 0xbad61778UL, 0x3ff8be05UL, 0xfc43446eUL, 0x3c9ecb5eUL, 0x16b5448cUL, - 0x3ff8cf32UL, 0x32e9e3aaUL, 0xbc70d55eUL, 0x5e0866d9UL, 0x3ff8e06aUL, - 0x6fc9b2e6UL, 0xbc97114aUL, 0x99157736UL, 0x3ff8f1aeUL, 0xa2e3976cUL, - 0x3c85cc13UL, 0xd0282c8aUL, 0x3ff902feUL, 0x85fe3fd2UL, 0x3c9592caUL, - 0x0b91ffc6UL, 0x3ff9145bUL, 0x2e582524UL, 0xbc9dd679UL, 0x53aa2fe2UL, - 0x3ff925c3UL, 0xa639db7fUL, 0xbc83455fUL, 0xb0cdc5e5UL, 0x3ff93737UL, - 0x81b57ebcUL, 0xbc675fc7UL, 0x2b5f98e5UL, 0x3ff948b8UL, 0x797d2d99UL, - 0xbc8dc3d6UL, 0xcbc8520fUL, 0x3ff95a44UL, 0x96a5f039UL, 0xbc764b7cUL, - 0x9a7670b3UL, 0x3ff96bddUL, 0x7f19c896UL, 0xbc5ba596UL, 0x9fde4e50UL, - 0x3ff97d82UL, 0x7c1b85d1UL, 0xbc9d185bUL, 0xe47a22a2UL, 0x3ff98f33UL, - 0xa24c78ecUL, 0x3c7cabdaUL, 0x70ca07baUL, 0x3ff9a0f1UL, 0x91cee632UL, - 0xbc9173bdUL, 0x4d53fe0dUL, 0x3ff9b2bbUL, 0x4df6d518UL, 0xbc9dd84eUL, - 0x82a3f090UL, 0x3ff9c491UL, 0xb071f2beUL, 0x3c7c7c46UL, 0x194bb8d5UL, - 0x3ff9d674UL, 0xa3dd8233UL, 0xbc9516beUL, 0x19e32323UL, 0x3ff9e863UL, - 0x78e64c6eUL, 0x3c7824caUL, 0x8d07f29eUL, 0x3ff9fa5eUL, 0xaaf1faceUL, - 0xbc84a9ceUL, 0x7b5de565UL, 0x3ffa0c66UL, 0x5d1cd533UL, 0xbc935949UL, - 0xed8eb8bbUL, 0x3ffa1e7aUL, 0xee8be70eUL, 0x3c9c6618UL, 0xec4a2d33UL, - 0x3ffa309bUL, 0x7ddc36abUL, 0x3c96305cUL, 0x80460ad8UL, 0x3ffa42c9UL, - 0x589fb120UL, 0xbc9aa780UL, 0xb23e255dUL, 0x3ffa5503UL, 0xdb8d41e1UL, - 0xbc9d2f6eUL, 0x8af46052UL, 0x3ffa674aUL, 0x30670366UL, 0x3c650f56UL, - 0x1330b358UL, 0x3ffa799eUL, 0xcac563c7UL, 0x3c9bcb7eUL, 0x53c12e59UL, - 0x3ffa8bfeUL, 0xb2ba15a9UL, 0xbc94f867UL, 0x5579fdbfUL, 0x3ffa9e6bUL, - 0x0ef7fd31UL, 0x3c90fac9UL, 0x21356ebaUL, 0x3ffab0e5UL, 0xdae94545UL, - 0x3c889c31UL, 0xbfd3f37aUL, 0x3ffac36bUL, 0xcae76cd0UL, 0xbc8f9234UL, - 0x3a3c2774UL, 0x3ffad5ffUL, 0xb6b1b8e5UL, 0x3c97ef3bUL, 0x995ad3adUL, - 0x3ffae89fUL, 0x345dcc81UL, 0x3c97a1cdUL, 0xe622f2ffUL, 0x3ffafb4cUL, - 0x0f315ecdUL, 0xbc94b2fcUL, 0x298db666UL, 0x3ffb0e07UL, 0x4c80e425UL, - 0xbc9bdef5UL, 0x6c9a8952UL, 0x3ffb20ceUL, 0x4a0756ccUL, 0x3c94dd02UL, - 0xb84f15fbUL, 0x3ffb33a2UL, 0x3084d708UL, 0xbc62805eUL, 0x15b749b1UL, - 0x3ffb4684UL, 0xe9df7c90UL, 0xbc7f763dUL, 0x8de5593aUL, 0x3ffb5972UL, - 0xbbba6de3UL, 0xbc9c71dfUL, 0x29f1c52aUL, 0x3ffb6c6eUL, 0x52883f6eUL, - 0x3c92a8f3UL, 0xf2fb5e47UL, 0x3ffb7f76UL, 0x7e54ac3bUL, 0xbc75584fUL, - 0xf22749e4UL, 0x3ffb928cUL, 0x54cb65c6UL, 0xbc9b7216UL, 0x30a1064aUL, - 0x3ffba5b0UL, 0x0e54292eUL, 0xbc9efcd3UL, 0xb79a6f1fUL, 0x3ffbb8e0UL, - 0xc9696205UL, 0xbc3f52d1UL, 0x904bc1d2UL, 0x3ffbcc1eUL, 0x7a2d9e84UL, - 0x3c823dd0UL, 0xc3f3a207UL, 0x3ffbdf69UL, 0x60ea5b53UL, 0xbc3c2623UL, - 0x5bd71e09UL, 0x3ffbf2c2UL, 0x3f6b9c73UL, 0xbc9efdcaUL, 0x6141b33dUL, - 0x3ffc0628UL, 0xa1fbca34UL, 0xbc8d8a5aUL, 0xdd85529cUL, 0x3ffc199bUL, - 0x895048ddUL, 0x3c811065UL, 0xd9fa652cUL, 0x3ffc2d1cUL, 0x17c8a5d7UL, - 0xbc96e516UL, 0x5fffd07aUL, 0x3ffc40abUL, 0xe083c60aUL, 0x3c9b4537UL, - 0x78fafb22UL, 0x3ffc5447UL, 0x2493b5afUL, 0x3c912f07UL, 0x2e57d14bUL, - 0x3ffc67f1UL, 0xff483cadUL, 0x3c92884dUL, 0x8988c933UL, 0x3ffc7ba8UL, - 0xbe255559UL, 0xbc8e76bbUL, 0x9406e7b5UL, 0x3ffc8f6dUL, 0x48805c44UL, - 0x3c71acbcUL, 0x5751c4dbUL, 0x3ffca340UL, 0xd10d08f5UL, 0xbc87f2beUL, - 0xdcef9069UL, 0x3ffcb720UL, 0xd1e949dbUL, 0x3c7503cbUL, 0x2e6d1675UL, - 0x3ffccb0fUL, 0x86009092UL, 0xbc7d220fUL, 0x555dc3faUL, 0x3ffcdf0bUL, - 0x53829d72UL, 0xbc8dd83bUL, 0x5b5bab74UL, 0x3ffcf315UL, 0xb86dff57UL, - 0xbc9a08e9UL, 0x4a07897cUL, 0x3ffd072dUL, 0x43797a9cUL, 0xbc9cbc37UL, - 0x2b08c968UL, 0x3ffd1b53UL, 0x219a36eeUL, 0x3c955636UL, 0x080d89f2UL, - 0x3ffd2f87UL, 0x719d8578UL, 0xbc9d487bUL, 0xeacaa1d6UL, 0x3ffd43c8UL, - 0xbf5a1614UL, 0x3c93db53UL, 0xdcfba487UL, 0x3ffd5818UL, 0xd75b3707UL, - 0x3c82ed02UL, 0xe862e6d3UL, 0x3ffd6c76UL, 0x4a8165a0UL, 0x3c5fe87aUL, - 0x16c98398UL, 0x3ffd80e3UL, 0x8beddfe8UL, 0xbc911ec1UL, 0x71ff6075UL, - 0x3ffd955dUL, 0xbb9af6beUL, 0x3c9a052dUL, 0x03db3285UL, 0x3ffda9e6UL, - 0x696db532UL, 0x3c9c2300UL, 0xd63a8315UL, 0x3ffdbe7cUL, 0x926b8be4UL, - 0xbc9b76f1UL, 0xf301b460UL, 0x3ffdd321UL, 0x78f018c3UL, 0x3c92da57UL, - 0x641c0658UL, 0x3ffde7d5UL, 0x8e79ba8fUL, 0xbc9ca552UL, 0x337b9b5fUL, - 0x3ffdfc97UL, 0x4f184b5cUL, 0xbc91a5cdUL, 0x6b197d17UL, 0x3ffe1167UL, - 0xbd5c7f44UL, 0xbc72b529UL, 0x14f5a129UL, 0x3ffe2646UL, 0x817a1496UL, - 0xbc97b627UL, 0x3b16ee12UL, 0x3ffe3b33UL, 0x31fdc68bUL, 0xbc99f4a4UL, - 0xe78b3ff6UL, 0x3ffe502eUL, 0x80a9cc8fUL, 0x3c839e89UL, 0x24676d76UL, - 0x3ffe6539UL, 0x7522b735UL, 0xbc863ff8UL, 0xfbc74c83UL, 0x3ffe7a51UL, - 0xca0c8de2UL, 0x3c92d522UL, 0x77cdb740UL, 0x3ffe8f79UL, 0x80b054b1UL, - 0xbc910894UL, 0xa2a490daUL, 0x3ffea4afUL, 0x179c2893UL, 0xbc9e9c23UL, - 0x867cca6eUL, 0x3ffeb9f4UL, 0x2293e4f2UL, 0x3c94832fUL, 0x2d8e67f1UL, - 0x3ffecf48UL, 0xb411ad8cUL, 0xbc9c93f3UL, 0xa2188510UL, 0x3ffee4aaUL, - 0xa487568dUL, 0x3c91c68dUL, 0xee615a27UL, 0x3ffefa1bUL, 0x86a4b6b0UL, - 0x3c9dc7f4UL, 0x1cb6412aUL, 0x3fff0f9cUL, 0x65181d45UL, 0xbc932200UL, - 0x376bba97UL, 0x3fff252bUL, 0xbf0d8e43UL, 0x3c93a1a5UL, 0x48dd7274UL, - 0x3fff3ac9UL, 0x3ed837deUL, 0xbc795a5aUL, 0x5b6e4540UL, 0x3fff5076UL, - 0x2dd8a18bUL, 0x3c99d3e1UL, 0x798844f8UL, 0x3fff6632UL, 0x3539343eUL, - 0x3c9fa37bUL, 0xad9cbe14UL, 0x3fff7bfdUL, 0xd006350aUL, 0xbc9dbb12UL, - 0x02243c89UL, 0x3fff91d8UL, 0xa779f689UL, 0xbc612ea8UL, 0x819e90d8UL, - 0x3fffa7c1UL, 0xf3a5931eUL, 0x3c874853UL, 0x3692d514UL, 0x3fffbdbaUL, - 0x15098eb6UL, 0xbc796773UL, 0x2b8f71f1UL, 0x3fffd3c2UL, 0x966579e7UL, - 0x3c62eb74UL, 0x6b2a23d9UL, 0x3fffe9d9UL, 0x7442fde3UL, 0x3c74a603UL, - 0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL, 0x6fba4e77UL, - 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL, 0xfefa39efUL, 0x3fe62e42UL, - 0x00000000UL, 0x00000000UL, 0xfefa39efUL, 0x3fe62e42UL, 0xfefa39efUL, - 0xbfe62e42UL, 0xf8000000UL, 0xffffffffUL, 0xf8000000UL, 0xffffffffUL, - 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x00000000UL - + 0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL }; -//registers, -// input: xmm0, xmm1 -// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 -// eax, edx, ecx, ebx +ALIGNED_(16) juint _P_2[] = +{ + 0x1a600000UL, 0x3d90b461UL, 0x1a600000UL, 0x3d90b461UL +}; -// Code generated by Intel C compiler for LIBM library +ALIGNED_(16) juint _SC_4[] = +{ + 0xa556c734UL, 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL +}; -void MacroAssembler::fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { - Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; - Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; - Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; - Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, L_2TAG_PACKET_14_0_2, L_2TAG_PACKET_15_0_2; - Label L_2TAG_PACKET_16_0_2, L_2TAG_PACKET_17_0_2, L_2TAG_PACKET_18_0_2, L_2TAG_PACKET_19_0_2; - Label L_2TAG_PACKET_20_0_2, L_2TAG_PACKET_21_0_2, L_2TAG_PACKET_22_0_2, L_2TAG_PACKET_23_0_2; - Label L_2TAG_PACKET_24_0_2, L_2TAG_PACKET_25_0_2, L_2TAG_PACKET_26_0_2, L_2TAG_PACKET_27_0_2; - Label L_2TAG_PACKET_28_0_2, L_2TAG_PACKET_29_0_2, L_2TAG_PACKET_30_0_2, L_2TAG_PACKET_31_0_2; - Label L_2TAG_PACKET_32_0_2, L_2TAG_PACKET_33_0_2, L_2TAG_PACKET_34_0_2, L_2TAG_PACKET_35_0_2; - Label L_2TAG_PACKET_36_0_2, L_2TAG_PACKET_37_0_2, L_2TAG_PACKET_38_0_2, L_2TAG_PACKET_39_0_2; - Label L_2TAG_PACKET_40_0_2, L_2TAG_PACKET_41_0_2, L_2TAG_PACKET_42_0_2, L_2TAG_PACKET_43_0_2; - Label L_2TAG_PACKET_44_0_2, L_2TAG_PACKET_45_0_2, L_2TAG_PACKET_46_0_2, L_2TAG_PACKET_47_0_2; - Label L_2TAG_PACKET_48_0_2, L_2TAG_PACKET_49_0_2, L_2TAG_PACKET_50_0_2, L_2TAG_PACKET_51_0_2; - Label L_2TAG_PACKET_52_0_2, L_2TAG_PACKET_53_0_2, L_2TAG_PACKET_54_0_2, L_2TAG_PACKET_55_0_2; - Label L_2TAG_PACKET_56_0_2, L_2TAG_PACKET_57_0_2, L_2TAG_PACKET_58_0_2, start; +ALIGNED_(16) juint _Ctable[] = +{ + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, 0xbf73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, + 0xc0000000UL, 0xbc626d19UL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, + 0xbfa60beaUL, 0x2ed59f06UL, 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, + 0x00000000UL, 0x3ff00000UL, 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, + 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, 0x00000000UL, 0x3ff00000UL, + 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, 0x20000000UL, + 0x3c5e0d89UL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, 0xbfc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0x3ff00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, + 0x20000000UL, 0x3c68076aUL, 0x00000000UL, 0x3ff00000UL, 0x99fcef32UL, + 0x3fca8279UL, 0x667f3bcdUL, 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, + 0x00000000UL, 0x3fe00000UL, 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, + 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, 0x00000000UL, 0x3fe00000UL, + 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, 0xe0000000UL, + 0x3c39f630UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, 0xbf9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0x3fe00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0x3fed906bUL, + 0x20000000UL, 0x3c7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x76acf82dUL, + 0x3fa4a031UL, 0x56c62ddaUL, 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, + 0x00000000UL, 0x3fd00000UL, 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, + 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, 0x00000000UL, 0x3fd00000UL, + 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, 0x40000000UL, + 0xbc887df6UL, 0x00000000UL, 0x3fc00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0x3fefd88dUL, + 0x40000000UL, 0xbc887df6UL, 0x00000000UL, 0xbfc00000UL, 0x0e5967d5UL, + 0x3fac1d1fUL, 0xcff75cb0UL, 0x3fef6297UL, 0x20000000UL, 0x3c756217UL, + 0x00000000UL, 0xbfd00000UL, 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, + 0x3fee9f41UL, 0xe0000000UL, 0x3c8760b1UL, 0x00000000UL, 0xbfd00000UL, + 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, 0x3fed906bUL, 0x20000000UL, + 0x3c7457e6UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, 0x3f9d4a2cUL, + 0xf180bdb1UL, 0x3fec38b2UL, 0x80000000UL, 0xbc76e0b1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0x3fea9b66UL, + 0xe0000000UL, 0x3c39f630UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, + 0xbfc133ccUL, 0x6b151741UL, 0x3fe8bc80UL, 0x20000000UL, 0xbc82c5e1UL, + 0x00000000UL, 0xbfe00000UL, 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, + 0x3fe6a09eUL, 0x20000000UL, 0xbc8bdd34UL, 0x00000000UL, 0xbfe00000UL, + 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, 0x3fe44cf3UL, 0x20000000UL, + 0x3c68076aUL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, 0x3fc59267UL, + 0x39ae68c8UL, 0x3fe1c73bUL, 0x20000000UL, 0x3c8b25ddUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0x3fde2b5dUL, + 0x20000000UL, 0x3c5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, + 0x3fb37ca1UL, 0xa6aea963UL, 0x3fd87de2UL, 0xe0000000UL, 0xbc672cedUL, + 0x00000000UL, 0xbff00000UL, 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, + 0x3fd29406UL, 0xa0000000UL, 0xbc75d28dUL, 0x00000000UL, 0xbff00000UL, + 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, 0x3fc8f8b8UL, 0xc0000000UL, + 0xbc626d19UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, 0x3f73b92eUL, + 0xbc29b42cUL, 0x3fb917a6UL, 0xe0000000UL, 0xbc3e2718UL, 0x00000000UL, + 0xbff00000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x176d6d31UL, + 0x3f73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0xbff00000UL, 0x011469fbUL, 0x3f93ad06UL, 0x3c69a60bUL, + 0xbfc8f8b8UL, 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0xbff00000UL, + 0x939d225aUL, 0x3fa60beaUL, 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, + 0x3c75d28dUL, 0x00000000UL, 0xbff00000UL, 0x866b95cfUL, 0x3fb37ca1UL, + 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, 0x3c672cedUL, 0x00000000UL, + 0xbff00000UL, 0x73fa1279UL, 0x3fbe3a68UL, 0x3806f63bUL, 0xbfde2b5dUL, + 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0xbff00000UL, 0x5bc57974UL, + 0x3fc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0xbff00000UL, 0x53aba2fdUL, 0x3fcd0dfeUL, 0x25091dd6UL, + 0xbfe44cf3UL, 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0xbff00000UL, + 0x99fcef32UL, 0xbfca8279UL, 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, + 0x3c8bdd34UL, 0x00000000UL, 0xbfe00000UL, 0x94247758UL, 0xbfc133ccUL, + 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, 0x3c82c5e1UL, 0x00000000UL, + 0xbfe00000UL, 0x9ae68c87UL, 0xbfac73b3UL, 0x290ea1a3UL, 0xbfea9b66UL, + 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0xbfe00000UL, 0x7f909c4eUL, + 0x3f9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0xbfe00000UL, 0x65455a75UL, 0x3fbe0875UL, 0xcf328d46UL, + 0xbfed906bUL, 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0xbfe00000UL, + 0x76acf82dUL, 0xbfa4a031UL, 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, + 0xbc8760b1UL, 0x00000000UL, 0xbfd00000UL, 0x0e5967d5UL, 0x3fac1d1fUL, + 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, 0xbc756217UL, 0x00000000UL, + 0xbfd00000UL, 0x0f592f50UL, 0x3f9ba165UL, 0xa3d12526UL, 0xbfefd88dUL, + 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0xbfc00000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0xbff00000UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x00000000UL, 0x0f592f50UL, 0xbf9ba165UL, 0xa3d12526UL, + 0xbfefd88dUL, 0x40000000UL, 0x3c887df6UL, 0x00000000UL, 0x3fc00000UL, + 0x0e5967d5UL, 0xbfac1d1fUL, 0xcff75cb0UL, 0xbfef6297UL, 0x20000000UL, + 0xbc756217UL, 0x00000000UL, 0x3fd00000UL, 0x76acf82dUL, 0x3fa4a031UL, + 0x56c62ddaUL, 0xbfee9f41UL, 0xe0000000UL, 0xbc8760b1UL, 0x00000000UL, + 0x3fd00000UL, 0x65455a75UL, 0xbfbe0875UL, 0xcf328d46UL, 0xbfed906bUL, + 0x20000000UL, 0xbc7457e6UL, 0x00000000UL, 0x3fe00000UL, 0x7f909c4eUL, + 0xbf9d4a2cUL, 0xf180bdb1UL, 0xbfec38b2UL, 0x80000000UL, 0x3c76e0b1UL, + 0x00000000UL, 0x3fe00000UL, 0x9ae68c87UL, 0x3fac73b3UL, 0x290ea1a3UL, + 0xbfea9b66UL, 0xe0000000UL, 0xbc39f630UL, 0x00000000UL, 0x3fe00000UL, + 0x94247758UL, 0x3fc133ccUL, 0x6b151741UL, 0xbfe8bc80UL, 0x20000000UL, + 0x3c82c5e1UL, 0x00000000UL, 0x3fe00000UL, 0x99fcef32UL, 0x3fca8279UL, + 0x667f3bcdUL, 0xbfe6a09eUL, 0x20000000UL, 0x3c8bdd34UL, 0x00000000UL, + 0x3fe00000UL, 0x53aba2fdUL, 0xbfcd0dfeUL, 0x25091dd6UL, 0xbfe44cf3UL, + 0x20000000UL, 0xbc68076aUL, 0x00000000UL, 0x3ff00000UL, 0x5bc57974UL, + 0xbfc59267UL, 0x39ae68c8UL, 0xbfe1c73bUL, 0x20000000UL, 0xbc8b25ddUL, + 0x00000000UL, 0x3ff00000UL, 0x73fa1279UL, 0xbfbe3a68UL, 0x3806f63bUL, + 0xbfde2b5dUL, 0x20000000UL, 0xbc5e0d89UL, 0x00000000UL, 0x3ff00000UL, + 0x866b95cfUL, 0xbfb37ca1UL, 0xa6aea963UL, 0xbfd87de2UL, 0xe0000000UL, + 0x3c672cedUL, 0x00000000UL, 0x3ff00000UL, 0x939d225aUL, 0xbfa60beaUL, + 0x2ed59f06UL, 0xbfd29406UL, 0xa0000000UL, 0x3c75d28dUL, 0x00000000UL, + 0x3ff00000UL, 0x011469fbUL, 0xbf93ad06UL, 0x3c69a60bUL, 0xbfc8f8b8UL, + 0xc0000000UL, 0x3c626d19UL, 0x00000000UL, 0x3ff00000UL, 0x176d6d31UL, + 0xbf73b92eUL, 0xbc29b42cUL, 0xbfb917a6UL, 0xe0000000UL, 0x3c3e2718UL, + 0x00000000UL, 0x3ff00000UL +}; - assert_different_registers(tmp, eax, ecx, edx); +ALIGNED_(16) juint _SC_2[] = +{ + 0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL +}; - address static_const_table_pow = (address)_static_const_table_pow; +ALIGNED_(16) juint _SC_3[] = +{ + 0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL +}; + +ALIGNED_(16) juint _SC_1[] = +{ + 0x55555555UL, 0xbfc55555UL, 0x00000000UL, 0xbfe00000UL +}; + +ALIGNED_(16) juint _PI_INV_TABLE[] = +{ + 0x00000000UL, 0x00000000UL, 0xa2f9836eUL, 0x4e441529UL, 0xfc2757d1UL, + 0xf534ddc0UL, 0xdb629599UL, 0x3c439041UL, 0xfe5163abUL, 0xdebbc561UL, + 0xb7246e3aUL, 0x424dd2e0UL, 0x06492eeaUL, 0x09d1921cUL, 0xfe1deb1cUL, + 0xb129a73eUL, 0xe88235f5UL, 0x2ebb4484UL, 0xe99c7026UL, 0xb45f7e41UL, + 0x3991d639UL, 0x835339f4UL, 0x9c845f8bUL, 0xbdf9283bUL, 0x1ff897ffUL, + 0xde05980fUL, 0xef2f118bUL, 0x5a0a6d1fUL, 0x6d367ecfUL, 0x27cb09b7UL, + 0x4f463f66UL, 0x9e5fea2dUL, 0x7527bac7UL, 0xebe5f17bUL, 0x3d0739f7UL, + 0x8a5292eaUL, 0x6bfb5fb1UL, 0x1f8d5d08UL, 0x56033046UL, 0xfc7b6babUL, + 0xf0cfbc21UL +}; + +ALIGNED_(8) juint _PI_4[] = +{ + 0x40000000UL, 0x3fe921fbUL, 0x18469899UL, 0x3e64442dUL +}; + +ALIGNED_(8) juint _PI32INV[] = +{ + 0x6dc9c883UL, 0x40245f30UL +}; + +ALIGNED_(8) juint _SHIFTER[] = +{ + 0x00000000UL, 0x43380000UL +}; + +ALIGNED_(8) juint _SIGN_MASK[] = +{ + 0x00000000UL, 0x80000000UL +}; + +ALIGNED_(8) juint _P_3[] = +{ + 0x2e037073UL, 0x3b63198aUL +}; + +ALIGNED_(8) juint _ALL_ONES[] = +{ + 0xffffffffUL, 0x3fefffffUL +}; + +ALIGNED_(8) juint _TWO_POW_55[] = +{ + 0x00000000UL, 0x43600000UL +}; + +ALIGNED_(8) juint _TWO_POW_M55[] = +{ + 0x00000000UL, 0x3c800000ULL +}; + +ALIGNED_(8) juint _P_1[] = +{ + 0x54400000UL, 0x3fb921fbUL +}; + +ALIGNED_(8) juint _NEG_ZERO[] = +{ + 0x00000000UL, 0x80000000UL +}; + +void MacroAssembler::fast_sin(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ebx, Register ecx, Register edx, Register tmp1, Register tmp2, Register tmp3, Register tmp4) { + Label L_2TAG_PACKET_0_0_1, L_2TAG_PACKET_1_0_1, L_2TAG_PACKET_2_0_1, L_2TAG_PACKET_3_0_1; + Label L_2TAG_PACKET_4_0_1, L_2TAG_PACKET_5_0_1, L_2TAG_PACKET_6_0_1, L_2TAG_PACKET_7_0_1; + Label L_2TAG_PACKET_8_0_1, L_2TAG_PACKET_9_0_1, L_2TAG_PACKET_10_0_1, L_2TAG_PACKET_11_0_1; + Label L_2TAG_PACKET_13_0_1, L_2TAG_PACKET_14_0_1; + Label L_2TAG_PACKET_12_0_1, B1_1, B1_2, B1_4, start; + + assert_different_registers(tmp1, tmp2, tmp3, tmp4, eax, ebx, ecx, edx); + address ONEHALF = (address)_ONEHALF; + address P_2 = (address)_P_2; + address SC_4 = (address)_SC_4; + address Ctable = (address)_Ctable; + address SC_2 = (address)_SC_2; + address SC_3 = (address)_SC_3; + address SC_1 = (address)_SC_1; + address PI_INV_TABLE = (address)_PI_INV_TABLE; + address PI_4 = (address)_PI_4; + address PI32INV = (address)_PI32INV; + address SHIFTER = (address)_SHIFTER; + address SIGN_MASK = (address)_SIGN_MASK; + address P_3 = (address)_P_3; + address ALL_ONES = (address)_ALL_ONES; + address TWO_POW_55 = (address)_TWO_POW_55; + address TWO_POW_M55 = (address)_TWO_POW_M55; + address P_1 = (address)_P_1; + address NEG_ZERO = (address)_NEG_ZERO; bind(start); - subl(rsp, 120); - movl(Address(rsp, 64), tmp); - lea(tmp, ExternalAddress(static_const_table_pow)); - movsd(xmm0, Address(rsp, 128)); - movsd(xmm1, Address(rsp, 136)); - xorpd(xmm2, xmm2); - movl(eax, 16368); - pinsrw(xmm2, eax, 3); - movl(ecx, 1069088768); - movdl(xmm7, ecx); - movsd(Address(rsp, 16), xmm1); - xorpd(xmm1, xmm1); - movl(edx, 30704); - pinsrw(xmm1, edx, 3); + push(rbx); + subq(rsp, 16); movsd(Address(rsp, 8), xmm0); - movdqu(xmm3, xmm0); - movl(edx, 8192); - movdl(xmm4, edx); - movdqu(xmm6, Address(tmp, 8240)); - pextrw(eax, xmm0, 3); - por(xmm0, xmm2); - psllq(xmm0, 5); - movsd(xmm2, Address(tmp, 8256)); - psrlq(xmm0, 34); - movl(edx, eax); - andl(edx, 32752); - subl(edx, 16368); - movl(ecx, edx); - sarl(edx, 31); - addl(ecx, edx); - xorl(ecx, edx); - rcpss(xmm0, xmm0); - psllq(xmm3, 12); - addl(ecx, 16); - bsrl(ecx, ecx); - psrlq(xmm3, 12); - movl(Address(rsp, 24), rsi); - subl(eax, 16); - cmpl(eax, 32736); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); - movl(rsi, 0); - - bind(L_2TAG_PACKET_1_0_2); - mulss(xmm0, xmm7); - movl(edx, -1); - subl(ecx, 4); - shll(edx); - movdl(xmm5, edx); - por(xmm3, xmm1); - subl(eax, 16351); - cmpl(eax, 1); - jcc(Assembler::belowEqual, L_2TAG_PACKET_2_0_2); - paddd(xmm0, xmm4); - psllq(xmm5, 32); - movdl(edx, xmm0); - psllq(xmm0, 29); - pand(xmm5, xmm3); - - bind(L_2TAG_PACKET_3_0_2); - pand(xmm0, xmm6); - subsd(xmm3, xmm5); - subl(eax, 1); - sarl(eax, 4); - cvtsi2sdl(xmm7, eax); - mulpd(xmm5, xmm0); - - bind(L_2TAG_PACKET_4_0_2); - mulsd(xmm3, xmm0); - movdqu(xmm1, Address(tmp, 8272)); - subsd(xmm5, xmm2); - movdqu(xmm4, Address(tmp, 8288)); - movl(ecx, eax); - sarl(eax, 31); - addl(ecx, eax); - xorl(eax, ecx); - addl(eax, 1); - bsrl(eax, eax); - unpcklpd(xmm5, xmm3); - movdqu(xmm6, Address(tmp, 8304)); - addsd(xmm3, xmm5); - andl(edx, 16760832); - shrl(edx, 10); - addpd(xmm5, Address(tmp, edx, Address::times_1, -3616)); - movdqu(xmm0, Address(tmp, 8320)); - pshufd(xmm2, xmm3, 68); - mulsd(xmm3, xmm3); - mulpd(xmm1, xmm2); - mulpd(xmm4, xmm2); - addsd(xmm5, xmm7); - mulsd(xmm2, xmm3); - addpd(xmm6, xmm1); - mulsd(xmm3, xmm3); - addpd(xmm0, xmm4); - movsd(xmm1, Address(rsp, 16)); - movzwl(ecx, Address(rsp, 22)); - pshufd(xmm7, xmm5, 238); - movsd(xmm4, Address(tmp, 8368)); - mulpd(xmm6, xmm2); - pshufd(xmm3, xmm3, 68); - mulpd(xmm0, xmm2); - shll(eax, 4); - subl(eax, 15872); - andl(ecx, 32752); - addl(eax, ecx); - mulpd(xmm3, xmm6); - cmpl(eax, 624); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_5_0_2); - xorpd(xmm6, xmm6); - movl(edx, 17080); - pinsrw(xmm6, edx, 3); - movdqu(xmm2, xmm1); - pand(xmm4, xmm1); - subsd(xmm1, xmm4); - mulsd(xmm4, xmm5); - addsd(xmm0, xmm7); - mulsd(xmm1, xmm5); - movdqu(xmm7, xmm6); - addsd(xmm6, xmm4); - addpd(xmm3, xmm0); - movdl(edx, xmm6); - subsd(xmm6, xmm7); - pshufd(xmm0, xmm3, 238); - subsd(xmm4, xmm6); - addsd(xmm0, xmm3); - movl(ecx, edx); - andl(edx, 255); - addl(edx, edx); - movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); - addsd(xmm4, xmm1); - mulsd(xmm2, xmm0); - movdqu(xmm7, Address(tmp, 12480)); - movdqu(xmm3, Address(tmp, 12496)); - shll(ecx, 12); - xorl(ecx, rsi); - andl(ecx, -1048576); - movdl(xmm6, ecx); - addsd(xmm2, xmm4); - movsd(xmm1, Address(tmp, 12512)); - pshufd(xmm0, xmm2, 68); - pshufd(xmm4, xmm2, 68); - mulpd(xmm0, xmm0); - movl(rsi, Address(rsp, 24)); - mulpd(xmm7, xmm4); - pshufd(xmm6, xmm6, 17); - mulsd(xmm1, xmm2); - mulsd(xmm0, xmm0); - paddd(xmm5, xmm6); - addpd(xmm3, xmm7); - mulsd(xmm1, xmm5); - pshufd(xmm6, xmm5, 238); - mulpd(xmm0, xmm3); - addsd(xmm1, xmm6); - pshufd(xmm3, xmm0, 238); - mulsd(xmm0, xmm5); - mulsd(xmm3, xmm5); - addsd(xmm0, xmm1); - addsd(xmm0, xmm3); - addsd(xmm0, xmm5); - movsd(Address(rsp, 0), xmm0); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); - - bind(L_2TAG_PACKET_7_0_2); - movsd(xmm0, Address(rsp, 128)); - movsd(xmm1, Address(rsp, 136)); - mulsd(xmm0, xmm1); - movsd(Address(rsp, 0), xmm0); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); - - bind(L_2TAG_PACKET_0_0_2); - addl(eax, 16); - movl(edx, 32752); - andl(edx, eax); - cmpl(edx, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); - testl(eax, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_9_0_2); - - bind(L_2TAG_PACKET_10_0_2); - movl(ecx, Address(rsp, 16)); - xorl(edx, edx); - testl(ecx, ecx); - movl(ecx, 1); - cmovl(Assembler::notEqual, edx, ecx); - orl(edx, Address(rsp, 20)); - cmpl(edx, 1072693248); - jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); - movsd(xmm0, Address(rsp, 8)); - movsd(xmm3, Address(rsp, 8)); - movdl(edx, xmm3); - psrlq(xmm3, 32); - movdl(ecx, xmm3); - orl(edx, ecx); - cmpl(edx, 0); - jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); - xorpd(xmm3, xmm3); - movl(eax, 18416); - pinsrw(xmm3, eax, 3); - mulsd(xmm0, xmm3); - xorpd(xmm2, xmm2); - movl(eax, 16368); - pinsrw(xmm2, eax, 3); - movdqu(xmm3, xmm0); - pextrw(eax, xmm0, 3); - por(xmm0, xmm2); - movl(ecx, 18416); - psllq(xmm0, 5); - movsd(xmm2, Address(tmp, 8256)); - psrlq(xmm0, 34); - rcpss(xmm0, xmm0); - psllq(xmm3, 12); - movdqu(xmm6, Address(tmp, 8240)); - psrlq(xmm3, 12); - mulss(xmm0, xmm7); - movl(edx, -1024); - movdl(xmm5, edx); - por(xmm3, xmm1); - paddd(xmm0, xmm4); - psllq(xmm5, 32); - movdl(edx, xmm0); - psllq(xmm0, 29); - pand(xmm5, xmm3); - movl(rsi, 0); - pand(xmm0, xmm6); - subsd(xmm3, xmm5); - andl(eax, 32752); - subl(eax, 18416); - sarl(eax, 4); - cvtsi2sdl(xmm7, eax); - mulpd(xmm5, xmm0); - jmp(L_2TAG_PACKET_4_0_2); - - bind(L_2TAG_PACKET_12_0_2); - movl(ecx, Address(rsp, 16)); - xorl(edx, edx); - testl(ecx, ecx); - movl(ecx, 1); - cmovl(Assembler::notEqual, edx, ecx); - orl(edx, Address(rsp, 20)); - cmpl(edx, 1072693248); - jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); - movsd(xmm0, Address(rsp, 8)); - movsd(xmm3, Address(rsp, 8)); - movdl(edx, xmm3); - psrlq(xmm3, 32); - movdl(ecx, xmm3); - orl(edx, ecx); - cmpl(edx, 0); - jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); - xorpd(xmm3, xmm3); - movl(eax, 18416); - pinsrw(xmm3, eax, 3); - mulsd(xmm0, xmm3); - xorpd(xmm2, xmm2); - movl(eax, 16368); - pinsrw(xmm2, eax, 3); - movdqu(xmm3, xmm0); - pextrw(eax, xmm0, 3); - por(xmm0, xmm2); - movl(ecx, 18416); - psllq(xmm0, 5); - movsd(xmm2, Address(tmp, 8256)); - psrlq(xmm0, 34); - rcpss(xmm0, xmm0); - psllq(xmm3, 12); - movdqu(xmm6, Address(tmp, 8240)); - psrlq(xmm3, 12); - mulss(xmm0, xmm7); - movl(edx, -1024); - movdl(xmm5, edx); - por(xmm3, xmm1); - paddd(xmm0, xmm4); - psllq(xmm5, 32); - movdl(edx, xmm0); - psllq(xmm0, 29); - pand(xmm5, xmm3); - movl(rsi, INT_MIN); - pand(xmm0, xmm6); - subsd(xmm3, xmm5); - andl(eax, 32752); - subl(eax, 18416); - sarl(eax, 4); - cvtsi2sdl(xmm7, eax); - mulpd(xmm5, xmm0); - jmp(L_2TAG_PACKET_4_0_2); - - bind(L_2TAG_PACKET_5_0_2); - cmpl(eax, 0); - jcc(Assembler::less, L_2TAG_PACKET_13_0_2); - cmpl(eax, 752); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_14_0_2); - - bind(L_2TAG_PACKET_15_0_2); - addsd(xmm0, xmm7); - movsd(xmm2, Address(tmp, 12544)); - addpd(xmm3, xmm0); - xorpd(xmm6, xmm6); - movl(eax, 17080); - pinsrw(xmm6, eax, 3); - pshufd(xmm0, xmm3, 238); - addsd(xmm0, xmm3); - movdqu(xmm3, xmm5); - addsd(xmm5, xmm0); - movdqu(xmm4, xmm2); - subsd(xmm3, xmm5); - movdqu(xmm7, xmm5); - pand(xmm5, xmm2); - movdqu(xmm2, xmm1); - pand(xmm4, xmm1); - subsd(xmm7, xmm5); - addsd(xmm0, xmm3); - subsd(xmm1, xmm4); - mulsd(xmm4, xmm5); - addsd(xmm0, xmm7); - mulsd(xmm2, xmm0); - movdqu(xmm7, xmm6); - mulsd(xmm1, xmm5); - addsd(xmm6, xmm4); - movdl(eax, xmm6); - subsd(xmm6, xmm7); - addsd(xmm2, xmm1); - movdqu(xmm7, Address(tmp, 12480)); - movdqu(xmm3, Address(tmp, 12496)); - subsd(xmm4, xmm6); - pextrw(edx, xmm6, 3); - movl(ecx, eax); - andl(eax, 255); - addl(eax, eax); - movdqu(xmm5, Address(tmp, eax, Address::times_8, 8384)); - addsd(xmm2, xmm4); - sarl(ecx, 8); - movl(eax, ecx); - sarl(ecx, 1); - subl(eax, ecx); - shll(ecx, 20); - xorl(ecx, rsi); - movdl(xmm6, ecx); - movsd(xmm1, Address(tmp, 12512)); - andl(edx, 32767); - cmpl(edx, 16529); - jcc(Assembler::above, L_2TAG_PACKET_14_0_2); - pshufd(xmm0, xmm2, 68); - pshufd(xmm4, xmm2, 68); - mulpd(xmm0, xmm0); - mulpd(xmm7, xmm4); - pshufd(xmm6, xmm6, 17); - mulsd(xmm1, xmm2); - mulsd(xmm0, xmm0); - paddd(xmm5, xmm6); - addpd(xmm3, xmm7); - mulsd(xmm1, xmm5); - pshufd(xmm6, xmm5, 238); - mulpd(xmm0, xmm3); - addsd(xmm1, xmm6); - pshufd(xmm3, xmm0, 238); - mulsd(xmm0, xmm5); - mulsd(xmm3, xmm5); - shll(eax, 4); - xorpd(xmm4, xmm4); - addl(eax, 16368); - pinsrw(xmm4, eax, 3); - addsd(xmm0, xmm1); - movl(rsi, Address(rsp, 24)); - addsd(xmm0, xmm3); - movdqu(xmm1, xmm0); - addsd(xmm0, xmm5); - mulsd(xmm0, xmm4); - pextrw(eax, xmm0, 3); - andl(eax, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); - cmpl(eax, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); - - bind(L_2TAG_PACKET_18_0_2); - movsd(Address(rsp, 0), xmm0); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); - - bind(L_2TAG_PACKET_8_0_2); - movsd(xmm1, Address(rsp, 16)); - movsd(xmm0, Address(rsp, 8)); - movdqu(xmm2, xmm0); - movdl(eax, xmm2); - psrlq(xmm2, 20); - movdl(edx, xmm2); - orl(eax, edx); - jcc(Assembler::equal, L_2TAG_PACKET_19_0_2); - addsd(xmm0, xmm0); - movdl(eax, xmm1); - psrlq(xmm1, 32); - movdl(edx, xmm1); - movl(ecx, edx); - addl(edx, edx); - orl(eax, edx); - jcc(Assembler::equal, L_2TAG_PACKET_20_0_2); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_20_0_2); - xorpd(xmm0, xmm0); - movl(eax, 16368); - pinsrw(xmm0, eax, 3); - movl(edx, 29); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_22_0_2); - movsd(xmm0, Address(rsp, 16)); - addpd(xmm0, xmm0); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_19_0_2); - movdl(eax, xmm1); - movdqu(xmm2, xmm1); - psrlq(xmm1, 32); - movdl(edx, xmm1); - movl(ecx, edx); - addl(edx, edx); - orl(eax, edx); - jcc(Assembler::equal, L_2TAG_PACKET_23_0_2); - pextrw(eax, xmm2, 3); - andl(eax, 32752); - cmpl(eax, 32752); - jcc(Assembler::notEqual, L_2TAG_PACKET_24_0_2); - movdl(eax, xmm2); - psrlq(xmm2, 20); - movdl(edx, xmm2); - orl(eax, edx); - jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); - - bind(L_2TAG_PACKET_24_0_2); - pextrw(eax, xmm0, 3); - testl(eax, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_25_0_2); - testl(ecx, INT_MIN); - jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_27_0_2); - movsd(xmm1, Address(rsp, 16)); - movdl(eax, xmm1); - testl(eax, 1); - jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); - testl(eax, 2); - jcc(Assembler::notEqual, L_2TAG_PACKET_29_0_2); - jmp(L_2TAG_PACKET_28_0_2); - - bind(L_2TAG_PACKET_25_0_2); - shrl(ecx, 20); - andl(ecx, 2047); - cmpl(ecx, 1075); - jcc(Assembler::above, L_2TAG_PACKET_28_0_2); - jcc(Assembler::equal, L_2TAG_PACKET_30_0_2); - cmpl(ecx, 1074); - jcc(Assembler::above, L_2TAG_PACKET_27_0_2); - cmpl(ecx, 1023); - jcc(Assembler::below, L_2TAG_PACKET_28_0_2); - movsd(xmm1, Address(rsp, 16)); - movl(eax, 17208); - xorpd(xmm3, xmm3); - pinsrw(xmm3, eax, 3); - movdqu(xmm4, xmm3); - addsd(xmm3, xmm1); + movl(eax, Address(rsp, 12)); + movq(xmm1, ExternalAddress(PI32INV)); //0x6dc9c883UL, 0x40245f30UL + movq(xmm2, ExternalAddress(SHIFTER)); //0x00000000UL, 0x43380000UL + andl(eax, 2147418112); + subl(eax, 808452096); + cmpl(eax, 281346048); + jcc(Assembler::above, L_2TAG_PACKET_0_0_1); + mulsd(xmm1, xmm0); + movdqu(xmm5, ExternalAddress(ONEHALF)); //0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL + movq(xmm4, ExternalAddress(SIGN_MASK)); //0x00000000UL, 0x80000000UL + pand(xmm4, xmm0); + por(xmm5, xmm4); + addpd(xmm1, xmm5); + cvttsd2sil(edx, xmm1); + cvtsi2sdl(xmm1, edx); + movdqu(xmm6, ExternalAddress(P_2)); //0x1a600000UL, 0x3d90b461UL, 0x1a600000UL, 0x3d90b461UL + mov64(r8, 0x3fb921fb54400000); + movdq(xmm3, r8); + movdqu(xmm5, ExternalAddress(SC_4)); //0xa556c734UL, 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL + pshufd(xmm4, xmm0, 68); + mulsd(xmm3, xmm1); + movddup(xmm1, xmm1); + andl(edx, 63); + shll(edx, 5); + lea(rax, ExternalAddress(Ctable)); + addq(rax, rdx); + mulpd(xmm6, xmm1); + mulsd(xmm1, ExternalAddress(P_3)); //0x2e037073UL, 0x3b63198aUL subsd(xmm4, xmm3); - addsd(xmm1, xmm4); - pextrw(eax, xmm1, 3); - andl(eax, 32752); - jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); - movdl(eax, xmm3); - andl(eax, 1); - jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); - - bind(L_2TAG_PACKET_29_0_2); - movsd(xmm1, Address(rsp, 16)); - pextrw(eax, xmm1, 3); - andl(eax, 32768); - jcc(Assembler::equal, L_2TAG_PACKET_18_0_2); - xorpd(xmm0, xmm0); - movl(eax, 32768); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_28_0_2); - movsd(xmm1, Address(rsp, 16)); - pextrw(eax, xmm1, 3); - andl(eax, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); - - bind(L_2TAG_PACKET_31_0_2); - xorpd(xmm0, xmm0); - movl(eax, 32752); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_30_0_2); - movsd(xmm1, Address(rsp, 16)); - movdl(eax, xmm1); - andl(eax, 1); - jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); - jmp(L_2TAG_PACKET_29_0_2); - - bind(L_2TAG_PACKET_32_0_2); - movdl(eax, xmm1); - psrlq(xmm1, 20); - movdl(edx, xmm1); - orl(eax, edx); - jcc(Assembler::equal, L_2TAG_PACKET_33_0_2); - movsd(xmm0, Address(rsp, 16)); - addsd(xmm0, xmm0); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_33_0_2); - movsd(xmm0, Address(rsp, 8)); - pextrw(eax, xmm0, 3); - cmpl(eax, 49136); - jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); - movdl(ecx, xmm0); - psrlq(xmm0, 20); - movdl(edx, xmm0); - orl(ecx, edx); - jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); - xorpd(xmm0, xmm0); - movl(eax, 32760); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_34_0_2); - movsd(xmm1, Address(rsp, 16)); - andl(eax, 32752); - subl(eax, 16368); - pextrw(edx, xmm1, 3); - xorpd(xmm0, xmm0); - xorl(eax, edx); - andl(eax, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); - movl(ecx, 32752); - pinsrw(xmm0, ecx, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_35_0_2); - movdl(eax, xmm1); - cmpl(edx, 17184); - jcc(Assembler::above, L_2TAG_PACKET_36_0_2); - testl(eax, 1); - jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); - testl(eax, 2); - jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); - jmp(L_2TAG_PACKET_39_0_2); - - bind(L_2TAG_PACKET_36_0_2); - testl(eax, 1); - jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); - jmp(L_2TAG_PACKET_39_0_2); - - bind(L_2TAG_PACKET_9_0_2); - movsd(xmm2, Address(rsp, 8)); - movdl(eax, xmm2); - psrlq(xmm2, 31); - movdl(ecx, xmm2); - orl(eax, ecx); - jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); - movsd(xmm1, Address(rsp, 16)); - pextrw(edx, xmm1, 3); - movdl(eax, xmm1); - movdqu(xmm2, xmm1); - psrlq(xmm2, 32); - movdl(ecx, xmm2); - addl(ecx, ecx); - orl(ecx, eax); - jcc(Assembler::equal, L_2TAG_PACKET_40_0_2); - andl(edx, 32752); - cmpl(edx, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_32_0_2); - cmpl(edx, 17200); - jcc(Assembler::above, L_2TAG_PACKET_38_0_2); - cmpl(edx, 17184); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_35_0_2); - cmpl(edx, 16368); - jcc(Assembler::below, L_2TAG_PACKET_37_0_2); - movl(eax, 17208); - xorpd(xmm2, xmm2); - pinsrw(xmm2, eax, 3); - movdqu(xmm4, xmm2); - addsd(xmm2, xmm1); - subsd(xmm4, xmm2); - addsd(xmm1, xmm4); - pextrw(eax, xmm1, 3); - andl(eax, 32767); - jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); - movdl(eax, xmm2); - andl(eax, 1); - jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); - - bind(L_2TAG_PACKET_39_0_2); - xorpd(xmm1, xmm1); - movl(edx, 30704); - pinsrw(xmm1, edx, 3); - movsd(xmm2, Address(tmp, 8256)); - movsd(xmm4, Address(rsp, 8)); - pextrw(eax, xmm4, 3); - movl(edx, 8192); - movdl(xmm4, edx); - andl(eax, 32767); - subl(eax, 16); - jcc(Assembler::less, L_2TAG_PACKET_12_0_2); - movl(edx, eax); - andl(edx, 32752); - subl(edx, 16368); - movl(ecx, edx); - sarl(edx, 31); - addl(ecx, edx); - xorl(ecx, edx); - addl(ecx, 16); - bsrl(ecx, ecx); - movl(rsi, INT_MIN); - jmp(L_2TAG_PACKET_1_0_2); - - bind(L_2TAG_PACKET_37_0_2); - xorpd(xmm1, xmm1); - movl(eax, 32752); - pinsrw(xmm1, eax, 3); - xorpd(xmm0, xmm0); - mulsd(xmm0, xmm1); - movl(edx, 28); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_38_0_2); - xorpd(xmm1, xmm1); - movl(edx, 30704); - pinsrw(xmm1, edx, 3); - movsd(xmm2, Address(tmp, 8256)); - movsd(xmm4, Address(rsp, 8)); - pextrw(eax, xmm4, 3); - movl(edx, 8192); - movdl(xmm4, edx); - andl(eax, 32767); - subl(eax, 16); - jcc(Assembler::less, L_2TAG_PACKET_10_0_2); - movl(edx, eax); - andl(edx, 32752); - subl(edx, 16368); - movl(ecx, edx); - sarl(edx, 31); - addl(ecx, edx); - xorl(ecx, edx); - addl(ecx, 16); - bsrl(ecx, ecx); - movl(rsi, 0); - jmp(L_2TAG_PACKET_1_0_2); - - bind(L_2TAG_PACKET_23_0_2); - xorpd(xmm0, xmm0); - movl(eax, 16368); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_26_0_2); - xorpd(xmm0, xmm0); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_13_0_2); - addl(eax, 384); - cmpl(eax, 0); - jcc(Assembler::less, L_2TAG_PACKET_41_0_2); - mulsd(xmm5, xmm1); - addsd(xmm0, xmm7); - shrl(rsi, 31); - addpd(xmm3, xmm0); - pshufd(xmm0, xmm3, 238); - addsd(xmm3, xmm0); - movsd(xmm4, Address(tmp, rsi, Address::times_8, 12528)); - mulsd(xmm1, xmm3); - xorpd(xmm0, xmm0); - movl(eax, 16368); - shll(rsi, 15); - orl(eax, rsi); - pinsrw(xmm0, eax, 3); - addsd(xmm5, xmm1); - movl(rsi, Address(rsp, 24)); - mulsd(xmm5, xmm4); - addsd(xmm0, xmm5); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_41_0_2); - movl(rsi, Address(rsp, 24)); - xorpd(xmm0, xmm0); - movl(eax, 16368); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_40_0_2); - xorpd(xmm0, xmm0); - movl(eax, 16368); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_42_0_2); - xorpd(xmm0, xmm0); - movl(eax, 16368); - pinsrw(xmm0, eax, 3); - movl(edx, 26); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_11_0_2); - movsd(xmm1, Address(rsp, 16)); - movdqu(xmm2, xmm1); - pextrw(eax, xmm1, 3); - andl(eax, 32752); - cmpl(eax, 32752); - jcc(Assembler::notEqual, L_2TAG_PACKET_43_0_2); - movdl(eax, xmm2); - psrlq(xmm2, 20); - movdl(edx, xmm2); - orl(eax, edx); - jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); - - bind(L_2TAG_PACKET_43_0_2); - movdl(eax, xmm1); - psrlq(xmm1, 32); - movdl(edx, xmm1); - movl(ecx, edx); - addl(edx, edx); - orl(eax, edx); - jcc(Assembler::equal, L_2TAG_PACKET_42_0_2); - shrl(edx, 21); - cmpl(edx, 1075); - jcc(Assembler::above, L_2TAG_PACKET_44_0_2); - jcc(Assembler::equal, L_2TAG_PACKET_45_0_2); - cmpl(edx, 1023); - jcc(Assembler::below, L_2TAG_PACKET_44_0_2); - movsd(xmm1, Address(rsp, 16)); - movl(eax, 17208); - xorpd(xmm3, xmm3); - pinsrw(xmm3, eax, 3); - movdqu(xmm4, xmm3); - addsd(xmm3, xmm1); - subsd(xmm4, xmm3); - addsd(xmm1, xmm4); - pextrw(eax, xmm1, 3); - andl(eax, 32752); - jcc(Assembler::notEqual, L_2TAG_PACKET_44_0_2); - movdl(eax, xmm3); - andl(eax, 1); - jcc(Assembler::equal, L_2TAG_PACKET_44_0_2); - - bind(L_2TAG_PACKET_46_0_2); - movsd(xmm0, Address(rsp, 8)); - testl(ecx, INT_MIN); - jcc(Assembler::notEqual, L_2TAG_PACKET_47_0_2); - jmp(L_2TAG_PACKET_18_0_2); - - bind(L_2TAG_PACKET_45_0_2); - movsd(xmm1, Address(rsp, 16)); - movdl(eax, xmm1); - testl(eax, 1); - jcc(Assembler::notEqual, L_2TAG_PACKET_46_0_2); - - bind(L_2TAG_PACKET_44_0_2); - testl(ecx, INT_MIN); - jcc(Assembler::equal, L_2TAG_PACKET_26_0_2); - xorpd(xmm0, xmm0); - - bind(L_2TAG_PACKET_47_0_2); - movl(eax, 16368); - xorpd(xmm1, xmm1); - pinsrw(xmm1, eax, 3); - divsd(xmm1, xmm0); - movdqu(xmm0, xmm1); - movl(edx, 27); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_14_0_2); - movsd(xmm2, Address(rsp, 8)); - movsd(xmm6, Address(rsp, 16)); - pextrw(eax, xmm2, 3); - pextrw(edx, xmm6, 3); - movl(ecx, 32752); - andl(ecx, edx); - cmpl(ecx, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); - andl(eax, 32752); - subl(eax, 16368); - xorl(edx, eax); - testl(edx, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_49_0_2); - - bind(L_2TAG_PACKET_50_0_2); - movl(eax, 32736); - pinsrw(xmm0, eax, 3); - shrl(rsi, 16); - orl(eax, rsi); - pinsrw(xmm1, eax, 3); - movl(rsi, Address(rsp, 24)); - mulsd(xmm0, xmm1); - - bind(L_2TAG_PACKET_17_0_2); - movl(edx, 24); - - bind(L_2TAG_PACKET_21_0_2); - movsd(Address(rsp, 0), xmm0); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); - - bind(L_2TAG_PACKET_49_0_2); - movl(eax, 16); - pinsrw(xmm0, eax, 3); - mulsd(xmm0, xmm0); - testl(rsi, INT_MIN); - jcc(Assembler::equal, L_2TAG_PACKET_51_0_2); - movsd(xmm2, Address(tmp, 12560)); - xorpd(xmm0, xmm2); - - bind(L_2TAG_PACKET_51_0_2); - movl(rsi, Address(rsp, 24)); - movl(edx, 25); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_16_0_2); - pextrw(ecx, xmm5, 3); - pextrw(edx, xmm4, 3); - movl(eax, -1); - andl(ecx, 32752); - subl(ecx, 16368); - andl(edx, 32752); - addl(edx, ecx); - movl(ecx, -31); - sarl(edx, 4); - subl(ecx, edx); - jcc(Assembler::lessEqual, L_2TAG_PACKET_52_0_2); - cmpl(ecx, 20); - jcc(Assembler::above, L_2TAG_PACKET_53_0_2); - shll(eax); - - bind(L_2TAG_PACKET_52_0_2); - movdl(xmm0, eax); - psllq(xmm0, 32); - pand(xmm0, xmm5); - subsd(xmm5, xmm0); - addsd(xmm5, xmm1); - mulsd(xmm0, xmm4); - mulsd(xmm5, xmm4); - addsd(xmm0, xmm5); - - bind(L_2TAG_PACKET_53_0_2); - movl(edx, 25); - jmp(L_2TAG_PACKET_21_0_2); - - bind(L_2TAG_PACKET_2_0_2); - movzwl(ecx, Address(rsp, 22)); - movl(edx, INT_MIN); - movdl(xmm1, edx); - xorpd(xmm7, xmm7); - paddd(xmm0, xmm4); - psllq(xmm5, 32); - movdl(edx, xmm0); - psllq(xmm0, 29); - paddq(xmm1, xmm3); - pand(xmm5, xmm1); - andl(ecx, 32752); - cmpl(ecx, 16560); - jcc(Assembler::below, L_2TAG_PACKET_3_0_2); - pand(xmm0, xmm6); - subsd(xmm3, xmm5); - addl(eax, 16351); - shrl(eax, 4); - subl(eax, 1022); - cvtsi2sdl(xmm7, eax); + movq(xmm7, Address(rax, 8)); + subsd(xmm0, xmm3); + movddup(xmm3, xmm4); + subsd(xmm4, xmm6); + pshufd(xmm0, xmm0, 68); + movdqu(xmm2, Address(rax, 0)); mulpd(xmm5, xmm0); - movsd(xmm4, Address(tmp, 0)); - mulsd(xmm3, xmm0); - movsd(xmm6, Address(tmp, 0)); - subsd(xmm5, xmm2); - movsd(xmm1, Address(tmp, 8)); - pshufd(xmm2, xmm3, 68); - unpcklpd(xmm5, xmm3); - addsd(xmm3, xmm5); - movsd(xmm0, Address(tmp, 8)); - andl(edx, 16760832); - shrl(edx, 10); - addpd(xmm7, Address(tmp, edx, Address::times_1, -3616)); - mulsd(xmm4, xmm5); - mulsd(xmm0, xmm5); - mulsd(xmm6, xmm2); - mulsd(xmm1, xmm2); - movdqu(xmm2, xmm5); - mulsd(xmm4, xmm5); - addsd(xmm5, xmm0); - movdqu(xmm0, xmm7); + subpd(xmm0, xmm6); + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm6); + movdqu(xmm6, ExternalAddress(SC_2)); //0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL + subsd(xmm1, xmm3); + movq(xmm3, Address(rax, 24)); addsd(xmm2, xmm3); - addsd(xmm7, xmm5); - mulsd(xmm6, xmm2); - subsd(xmm0, xmm7); - movdqu(xmm2, xmm7); - addsd(xmm7, xmm4); - addsd(xmm0, xmm5); - subsd(xmm2, xmm7); - addsd(xmm4, xmm2); - pshufd(xmm2, xmm5, 238); - movdqu(xmm5, xmm7); - addsd(xmm7, xmm2); - addsd(xmm4, xmm0); - movdqu(xmm0, Address(tmp, 8272)); - subsd(xmm5, xmm7); - addsd(xmm6, xmm4); - movdqu(xmm4, xmm7); - addsd(xmm5, xmm2); - addsd(xmm7, xmm1); - movdqu(xmm2, Address(tmp, 8336)); - subsd(xmm4, xmm7); - addsd(xmm6, xmm5); - addsd(xmm4, xmm1); - pshufd(xmm5, xmm7, 238); - movdqu(xmm1, xmm7); - addsd(xmm7, xmm5); - subsd(xmm1, xmm7); - addsd(xmm1, xmm5); - movdqu(xmm5, Address(tmp, 8352)); - pshufd(xmm3, xmm3, 68); - addsd(xmm6, xmm4); - addsd(xmm6, xmm1); - movdqu(xmm1, Address(tmp, 8304)); - mulpd(xmm0, xmm3); - mulpd(xmm2, xmm3); - pshufd(xmm4, xmm3, 68); - mulpd(xmm3, xmm3); - addpd(xmm0, xmm1); - addpd(xmm5, xmm2); - mulsd(xmm4, xmm3); - movsd(xmm2, Address(tmp, 16)); - mulpd(xmm3, xmm3); - movsd(xmm1, Address(rsp, 16)); - movzwl(ecx, Address(rsp, 22)); - mulpd(xmm0, xmm4); - pextrw(eax, xmm7, 3); - mulpd(xmm5, xmm4); - mulpd(xmm0, xmm3); - movsd(xmm4, Address(tmp, 8376)); - pand(xmm2, xmm7); - addsd(xmm5, xmm6); subsd(xmm7, xmm2); - addpd(xmm5, xmm0); - andl(eax, 32752); - subl(eax, 16368); - andl(ecx, 32752); - cmpl(ecx, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); - addl(ecx, eax); - cmpl(ecx, 16576); - jcc(Assembler::aboveEqual, L_2TAG_PACKET_54_0_2); - pshufd(xmm0, xmm5, 238); - pand(xmm4, xmm1); - movdqu(xmm3, xmm1); - addsd(xmm5, xmm0); - subsd(xmm1, xmm4); - xorpd(xmm6, xmm6); - movl(edx, 17080); - pinsrw(xmm6, edx, 3); - addsd(xmm7, xmm5); - mulsd(xmm4, xmm2); - mulsd(xmm1, xmm2); - movdqu(xmm5, xmm6); - mulsd(xmm3, xmm7); - addsd(xmm6, xmm4); - addsd(xmm1, xmm3); - movdqu(xmm7, Address(tmp, 12480)); - movdl(edx, xmm6); - subsd(xmm6, xmm5); - movdqu(xmm3, Address(tmp, 12496)); - movsd(xmm2, Address(tmp, 12512)); - subsd(xmm4, xmm6); - movl(ecx, edx); - andl(edx, 255); - addl(edx, edx); - movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); - addsd(xmm4, xmm1); - pextrw(edx, xmm6, 3); - shrl(ecx, 8); - movl(eax, ecx); - shrl(ecx, 1); - subl(eax, ecx); - shll(ecx, 20); - movdl(xmm6, ecx); - pshufd(xmm0, xmm4, 68); - pshufd(xmm1, xmm4, 68); - mulpd(xmm0, xmm0); - mulpd(xmm7, xmm1); - pshufd(xmm6, xmm6, 17); mulsd(xmm2, xmm4); - andl(edx, 32767); - cmpl(edx, 16529); - jcc(Assembler::above, L_2TAG_PACKET_14_0_2); - mulsd(xmm0, xmm0); - paddd(xmm5, xmm6); - addpd(xmm3, xmm7); - mulsd(xmm2, xmm5); - pshufd(xmm6, xmm5, 238); - mulpd(xmm0, xmm3); - addsd(xmm2, xmm6); - pshufd(xmm3, xmm0, 238); - addl(eax, 1023); - shll(eax, 20); - orl(eax, rsi); - movdl(xmm4, eax); - mulsd(xmm0, xmm5); - mulsd(xmm3, xmm5); - addsd(xmm0, xmm2); - psllq(xmm4, 32); - addsd(xmm0, xmm3); - movdqu(xmm1, xmm0); - addsd(xmm0, xmm5); - movl(rsi, Address(rsp, 24)); - mulsd(xmm0, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, ExternalAddress(SC_3)); //0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL + mulsd(xmm4, Address(rax, 0)); + addpd(xmm6, ExternalAddress(SC_1)); //0x55555555UL, 0xbfc55555UL, 0x00000000UL, 0xbfe00000UL + mulpd(xmm5, xmm0); + movdqu(xmm0, xmm3); + addsd(xmm3, Address(rax, 8)); + mulpd(xmm1, xmm7); + movdqu(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movq(xmm5, Address(rax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(rax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm5, xmm0); + addsd(xmm3, xmm7); + addsd(xmm1, xmm5); + addsd(xmm1, xmm3); + addsd(xmm1, xmm6); + unpckhpd(xmm6, xmm6); + movdqu(xmm0, xmm4); + addsd(xmm1, xmm6); + addsd(xmm0, xmm1); + jmp(B1_4); + + bind(L_2TAG_PACKET_0_0_1); + jcc(Assembler::greater, L_2TAG_PACKET_1_0_1); + shrl(eax, 20); + cmpl(eax, 3325); + jcc(Assembler::notEqual, L_2TAG_PACKET_2_0_1); + mulsd(xmm0, ExternalAddress(ALL_ONES)); //0xffffffffUL, 0x3fefffffUL + jmp(B1_4); + + bind(L_2TAG_PACKET_2_0_1); + movq(xmm3, ExternalAddress(TWO_POW_55)); //0x00000000UL, 0x43600000UL + mulsd(xmm3, xmm0); + subsd(xmm3, xmm0); + mulsd(xmm3, ExternalAddress(TWO_POW_M55)); //0x00000000UL, 0x3c800000UL + jmp(B1_4); + + bind(L_2TAG_PACKET_1_0_1); pextrw(eax, xmm0, 3); andl(eax, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); cmpl(eax, 32752); - jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_3_0_1); + pextrw(ecx, xmm0, 3); + andl(ecx, 32752); + subl(ecx, 16224); + shrl(ecx, 7); + andl(ecx, 65532); + lea(r11, ExternalAddress(PI_INV_TABLE)); + addq(rcx, r11); + movdq(rax, xmm0); + movl(r10, Address(rcx, 20)); + movl(r8, Address(rcx, 24)); + movl(edx, eax); + shrq(rax, 21); + orl(eax, INT_MIN); + shrl(eax, 11); + movl(r9, r10); + imulq(r10, rdx); + imulq(r9, rax); + imulq(r8, rax); + movl(rsi, Address(rcx, 16)); + movl(rdi, Address(rcx, 12)); + movl(r11, r10); + shrq(r10, 32); + addq(r9, r10); + addq(r11, r8); + movl(r8, r11); + shrq(r11, 32); + addq(r9, r11); + movl(r10, rsi); + imulq(rsi, rdx); + imulq(r10, rax); + movl(r11, rdi); + imulq(rdi, rdx); + movl(ebx, rsi); + shrq(rsi, 32); + addq(r9, rbx); + movl(ebx, r9); + shrq(r9, 32); + addq(r10, rsi); + addq(r10, r9); + shlq(rbx, 32); + orq(r8, rbx); + imulq(r11, rax); + movl(r9, Address(rcx, 8)); + movl(rsi, Address(rcx, 4)); + movl(ebx, rdi); + shrq(rdi, 32); + addq(r10, rbx); + movl(ebx, r10); + shrq(r10, 32); + addq(r11, rdi); + addq(r11, r10); + movq(rdi, r9); + imulq(r9, rdx); + imulq(rdi, rax); + movl(r10, r9); + shrq(r9, 32); + addq(r11, r10); + movl(r10, r11); + shrq(r11, 32); + addq(rdi, r9); + addq(rdi, r11); + movq(r9, rsi); + imulq(rsi, rdx); + imulq(r9, rax); + shlq(r10, 32); + orq(r10, rbx); + movl(eax, Address(rcx, 0)); + movl(r11, rsi); + shrq(rsi, 32); + addq(rdi, r11); + movl(r11, rdi); + shrq(rdi, 32); + addq(r9, rsi); + addq(r9, rdi); + imulq(rdx, rax); + pextrw(ebx, xmm0, 3); + lea(rdi, ExternalAddress(PI_INV_TABLE)); + subq(rcx, rdi); + addl(ecx, ecx); + addl(ecx, ecx); + addl(ecx, ecx); + addl(ecx, 19); + movl(rsi, 32768); + andl(rsi, ebx); + shrl(ebx, 4); + andl(ebx, 2047); + subl(ebx, 1023); + subl(ecx, ebx); + addq(r9, rdx); + movl(edx, ecx); + addl(edx, 32); + cmpl(ecx, 1); + jcc(Assembler::less, L_2TAG_PACKET_4_0_1); + negl(ecx); + addl(ecx, 29); + shll(r9); + movl(rdi, r9); + andl(r9, 536870911); + testl(r9, 268435456); + jcc(Assembler::notEqual, L_2TAG_PACKET_5_0_1); + shrl(r9); + movl(ebx, 0); + shlq(r9, 32); + orq(r9, r11); - bind(L_2TAG_PACKET_55_0_2); - movsd(Address(rsp, 0), xmm0); - fld_d(Address(rsp, 0)); - jmp(L_2TAG_PACKET_6_0_2); + bind(L_2TAG_PACKET_6_0_1); - bind(L_2TAG_PACKET_48_0_2); - movl(rsi, Address(rsp, 24)); + bind(L_2TAG_PACKET_7_0_1); - bind(L_2TAG_PACKET_56_0_2); - movsd(xmm0, Address(rsp, 8)); - movsd(xmm1, Address(rsp, 16)); - addsd(xmm1, xmm1); - xorpd(xmm2, xmm2); - movl(eax, 49136); - pinsrw(xmm2, eax, 3); - addsd(xmm2, xmm0); - pextrw(eax, xmm2, 3); - cmpl(eax, 0); - jcc(Assembler::notEqual, L_2TAG_PACKET_57_0_2); + cmpq(r9, 0); + jcc(Assembler::equal, L_2TAG_PACKET_8_0_1); + + bind(L_2TAG_PACKET_9_0_1); + bsrq(r11, r9); + movl(ecx, 29); + subl(ecx, r11); + jcc(Assembler::lessEqual, L_2TAG_PACKET_10_0_1); + shlq(r9); + movq(rax, r10); + shlq(r10); + addl(edx, ecx); + negl(ecx); + addl(ecx, 64); + shrq(rax); + shrq(r8); + orq(r9, rax); + orq(r10, r8); + + bind(L_2TAG_PACKET_11_0_1); + cvtsi2sdq(xmm0, r9); + shrq(r10, 1); + cvtsi2sdq(xmm3, r10); + xorpd(xmm4, xmm4); + shll(edx, 4); + negl(edx); + addl(edx, 16368); + orl(edx, rsi); + xorl(edx, ebx); + pinsrw(xmm4, edx, 3); + movq(xmm2, ExternalAddress(PI_4)); //0x40000000UL, 0x3fe921fbUL, 0x18469899UL, 0x3e64442dUL + movq(xmm6, ExternalAddress(8 + PI_4)); //0x3fe921fbUL, 0x18469899UL, 0x3e64442dUL + xorpd(xmm5, xmm5); + subl(edx, 1008); + pinsrw(xmm5, edx, 3); + mulsd(xmm0, xmm4); + shll(rsi, 16); + sarl(rsi, 31); + mulsd(xmm3, xmm5); + movdqu(xmm1, xmm0); + mulsd(xmm0, xmm2); + shrl(rdi, 29); + addsd(xmm1, xmm3); + mulsd(xmm3, xmm2); + addl(rdi, rsi); + xorl(rdi, rsi); + mulsd(xmm6, xmm1); + movl(eax, rdi); + addsd(xmm6, xmm3); + movdqu(xmm2, xmm0); + addsd(xmm0, xmm6); + subsd(xmm2, xmm0); + addsd(xmm6, xmm2); + + bind(L_2TAG_PACKET_12_0_1); + movq(xmm1, ExternalAddress(PI32INV)); //0x6dc9c883UL, 0x40245f30UL + mulsd(xmm1, xmm0); + movq(xmm5, ExternalAddress(ONEHALF)); //0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL + movq(xmm4, ExternalAddress(SIGN_MASK)); //0x00000000UL, 0x80000000UL + pand(xmm4, xmm0); + por(xmm5, xmm4); + addpd(xmm1, xmm5); + cvttsd2sil(edx, xmm1); + cvtsi2sdl(xmm1, edx); + movq(xmm3, ExternalAddress(P_1)); //0x54400000UL, 0x3fb921fbUL + movdqu(xmm2, ExternalAddress(P_2)); //0x1a600000UL, 0x3d90b461UL, 0x1a600000UL, 0x3d90b461UL + mulsd(xmm3, xmm1); + unpcklpd(xmm1, xmm1); + shll(eax, 3); + addl(edx, 1865216); + movdqu(xmm4, xmm0); + addl(edx, eax); + andl(edx, 63); + movdqu(xmm5, ExternalAddress(SC_4)); //0x54400000UL, 0x3fb921fbUL + lea(rax, ExternalAddress(Ctable)); + shll(edx, 5); + addq(rax, rdx); + mulpd(xmm2, xmm1); + subsd(xmm0, xmm3); + mulsd(xmm1, ExternalAddress(P_3)); //0x2e037073UL, 0x3b63198aUL + subsd(xmm4, xmm3); + movq(xmm7, Address(rax, 8)); + unpcklpd(xmm0, xmm0); + movdqu(xmm3, xmm4); + subsd(xmm4, xmm2); + mulpd(xmm5, xmm0); + subpd(xmm0, xmm2); + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm2); + movdqu(xmm2, Address(rax, 0)); + subsd(xmm1, xmm3); + movq(xmm3, Address(rax, 24)); + addsd(xmm2, xmm3); + subsd(xmm7, xmm2); + subsd(xmm1, xmm6); + movdqu(xmm6, ExternalAddress(SC_2)); //0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL + mulsd(xmm2, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, ExternalAddress(SC_3)); //0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL + mulsd(xmm4, Address(rax, 0)); + addpd(xmm6, ExternalAddress(SC_1)); //0x55555555UL, 0xbfc55555UL, 0x00000000UL, 0xbfe00000UL + mulpd(xmm5, xmm0); + movdqu(xmm0, xmm3); + addsd(xmm3, Address(rax, 8)); + mulpd(xmm1, xmm7); + movdqu(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movq(xmm5, Address(rax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(rax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm5, xmm0); + addsd(xmm3, xmm7); + addsd(xmm1, xmm5); + addsd(xmm1, xmm3); + addsd(xmm1, xmm6); + unpckhpd(xmm6, xmm6); + movdqu(xmm0, xmm4); + addsd(xmm1, xmm6); + addsd(xmm0, xmm1); + jmp(B1_4); + + bind(L_2TAG_PACKET_8_0_1); + addl(edx, 64); + movq(r9, r10); + movq(r10, r8); + movl(r8, 0); + cmpq(r9, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_9_0_1); + addl(edx, 64); + movq(r9, r10); + movq(r10, r8); + cmpq(r9, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_9_0_1); xorpd(xmm0, xmm0); - movl(eax, 32760); - pinsrw(xmm0, eax, 3); - jmp(L_2TAG_PACKET_18_0_2); + xorpd(xmm6, xmm6); + jmp(L_2TAG_PACKET_12_0_1); - bind(L_2TAG_PACKET_57_0_2); - movdl(edx, xmm1); - movdqu(xmm3, xmm1); - psrlq(xmm3, 20); - movdl(ecx, xmm3); - orl(ecx, edx); - jcc(Assembler::equal, L_2TAG_PACKET_58_0_2); - addsd(xmm1, xmm1); - movdqu(xmm0, xmm1); - jmp(L_2TAG_PACKET_18_0_2); + bind(L_2TAG_PACKET_10_0_1); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_1); + negl(ecx); + shrq(r10); + movq(rax, r9); + shrq(r9); + subl(edx, ecx); + negl(ecx); + addl(ecx, 64); + shlq(rax); + orq(r10, rax); + jmp(L_2TAG_PACKET_11_0_1); - bind(L_2TAG_PACKET_58_0_2); - pextrw(eax, xmm0, 3); - andl(eax, 32752); - pextrw(edx, xmm1, 3); - xorpd(xmm0, xmm0); - subl(eax, 16368); - xorl(eax, edx); - testl(eax, 32768); - jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); - movl(edx, 32752); - pinsrw(xmm0, edx, 3); - jmp(L_2TAG_PACKET_18_0_2); + bind(L_2TAG_PACKET_4_0_1); + negl(ecx); + shlq(r9, 32); + orq(r9, r11); + shlq(r9); + movq(rdi, r9); + testl(r9, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_13_0_1); + shrl(r9); + movl(ebx, 0); + shrq(rdi, 3); + jmp(L_2TAG_PACKET_7_0_1); - bind(L_2TAG_PACKET_54_0_2); - pextrw(eax, xmm1, 3); - pextrw(ecx, xmm2, 3); - xorl(eax, ecx); - testl(eax, 32768); - jcc(Assembler::equal, L_2TAG_PACKET_50_0_2); - jmp(L_2TAG_PACKET_49_0_2); + bind(L_2TAG_PACKET_5_0_1); + shrl(r9); + movl(ebx, 536870912); + shrl(ebx); + shlq(r9, 32); + orq(r9, r11); + shlq(rbx, 32); + addl(rdi, 536870912); + movl(rcx, 0); + movl(r11, 0); + subq(rcx, r8); + sbbq(r11, r10); + sbbq(rbx, r9); + movq(r8, rcx); + movq(r10, r11); + movq(r9, rbx); + movl(ebx, 32768); + jmp(L_2TAG_PACKET_6_0_1); - bind(L_2TAG_PACKET_6_0_2); - movl(tmp, Address(rsp, 64)); + bind(L_2TAG_PACKET_13_0_1); + shrl(r9); + mov64(rbx, 0x100000000); + shrq(rbx); + movl(rcx, 0); + movl(r11, 0); + subq(rcx, r8); + sbbq(r11, r10); + sbbq(rbx, r9); + movq(r8, rcx); + movq(r10, r11); + movq(r9, rbx); + movl(ebx, 32768); + shrq(rdi, 3); + addl(rdi, 536870912); + jmp(L_2TAG_PACKET_7_0_1); + bind(L_2TAG_PACKET_3_0_1); + movq(xmm0, Address(rsp, 8)); + mulsd(xmm0, ExternalAddress(NEG_ZERO)); //0x00000000UL, 0x80000000UL + movq(Address(rsp, 0), xmm0); + + bind(L_2TAG_PACKET_14_0_1); + + bind(B1_4); + addq(rsp, 16); + pop(rbx); } -#endif // !_LP64 +/******************************************************************************/ +// ALGORITHM DESCRIPTION - COS() +// --------------------- +// +// 1. RANGE REDUCTION +// +// We perform an initial range reduction from X to r with +// +// X =~= N * pi/32 + r +// +// so that |r| <= pi/64 + epsilon. We restrict inputs to those +// where |N| <= 932560. Beyond this, the range reduction is +// insufficiently accurate. For extremely small inputs, +// denormalization can occur internally, impacting performance. +// This means that the main path is actually only taken for +// 2^-252 <= |X| < 90112. +// +// To avoid branches, we perform the range reduction to full +// accuracy each time. +// +// X - N * (P_1 + P_2 + P_3) +// +// where P_1 and P_2 are 32-bit numbers (so multiplication by N +// is exact) and P_3 is a 53-bit number. Together, these +// approximate pi well enough for all cases in the restricted +// range. +// +// The main reduction sequence is: +// +// y = 32/pi * x +// N = integer(y) +// (computed by adding and subtracting off SHIFTER) +// +// m_1 = N * P_1 +// m_2 = N * P_2 +// r_1 = x - m_1 +// r = r_1 - m_2 +// (this r can be used for most of the calculation) +// +// c_1 = r_1 - r +// m_3 = N * P_3 +// c_2 = c_1 - m_2 +// c = c_2 - m_3 +// +// 2. MAIN ALGORITHM +// +// The algorithm uses a table lookup based on B = M * pi / 32 +// where M = N mod 64. The stored values are: +// sigma closest power of 2 to cos(B) +// C_hl 53-bit cos(B) - sigma +// S_hi + S_lo 2 * 53-bit sin(B) +// +// The computation is organized as follows: +// +// sin(B + r + c) = [sin(B) + sigma * r] + +// r * (cos(B) - sigma) + +// sin(B) * [cos(r + c) - 1] + +// cos(B) * [sin(r + c) - r] +// +// which is approximately: +// +// [S_hi + sigma * r] + +// C_hl * r + +// S_lo + S_hi * [(cos(r) - 1) - r * c] + +// (C_hl + sigma) * [(sin(r) - r) + c] +// +// and this is what is actually computed. We separate this sum +// into four parts: +// +// hi + med + pols + corr +// +// where +// +// hi = S_hi + sigma r +// med = C_hl * r +// pols = S_hi * (cos(r) - 1) + (C_hl + sigma) * (sin(r) - r) +// corr = S_lo + c * ((C_hl + sigma) - S_hi * r) +// +// 3. POLYNOMIAL +// +// The polynomial S_hi * (cos(r) - 1) + (C_hl + sigma) * +// (sin(r) - r) can be rearranged freely, since it is quite +// small, so we exploit parallelism to the fullest. +// +// psc4 = SC_4 * r_1 +// msc4 = psc4 * r +// r2 = r * r +// msc2 = SC_2 * r2 +// r4 = r2 * r2 +// psc3 = SC_3 + msc4 +// psc1 = SC_1 + msc2 +// msc3 = r4 * psc3 +// sincospols = psc1 + msc3 +// pols = sincospols * +// +// +// 4. CORRECTION TERM +// +// This is where the "c" component of the range reduction is +// taken into account; recall that just "r" is used for most of +// the calculation. +// +// -c = m_3 - c_2 +// -d = S_hi * r - (C_hl + sigma) +// corr = -c * -d + S_lo +// +// 5. COMPENSATED SUMMATIONS +// +// The two successive compensated summations add up the high +// and medium parts, leaving just the low parts to add up at +// the end. +// +// rs = sigma * r +// res_int = S_hi + rs +// k_0 = S_hi - res_int +// k_2 = k_0 + rs +// med = C_hl * r +// res_hi = res_int + med +// k_1 = res_int - res_hi +// k_3 = k_1 + med +// +// 6. FINAL SUMMATION +// +// We now add up all the small parts: +// +// res_lo = pols(hi) + pols(lo) + corr + k_1 + k_3 +// +// Now the overall result is just: +// +// res_hi + res_lo +// +// 7. SMALL ARGUMENTS +// +// Inputs with |X| < 2^-252 are treated specially as +// 1 - |x|. +// +// Special cases: +// cos(NaN) = quiet NaN, and raise invalid exception +// cos(INF) = NaN and raise invalid exception +// cos(0) = 1 +// +/******************************************************************************/ + +ALIGNED_(8) juint _ONE[] = +{ + 0x00000000UL, 0x3ff00000UL +}; + +void MacroAssembler::fast_cos(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register r8, Register r9, Register r10, Register r11) { + Label L_2TAG_PACKET_0_0_1, L_2TAG_PACKET_1_0_1, L_2TAG_PACKET_2_0_1, L_2TAG_PACKET_3_0_1; + Label L_2TAG_PACKET_4_0_1, L_2TAG_PACKET_5_0_1, L_2TAG_PACKET_6_0_1, L_2TAG_PACKET_7_0_1; + Label L_2TAG_PACKET_8_0_1, L_2TAG_PACKET_9_0_1, L_2TAG_PACKET_10_0_1, L_2TAG_PACKET_11_0_1; + Label L_2TAG_PACKET_12_0_1, L_2TAG_PACKET_13_0_1, B1_2, B1_3, B1_4, B1_5, start; + + assert_different_registers(r8, r9, r10, r11, eax, ecx, edx); + + address ONEHALF = (address)_ONEHALF; + address P_2 = (address)_P_2; + address SC_4 = (address)_SC_4; + address Ctable = (address)_Ctable; + address SC_2 = (address)_SC_2; + address SC_3 = (address)_SC_3; + address SC_1 = (address)_SC_1; + address PI_INV_TABLE = (address)_PI_INV_TABLE; + address PI_4 = (address)_PI_4; + address PI32INV = (address)_PI32INV; + address SIGN_MASK = (address)_SIGN_MASK; + address P_1 = (address)_P_1; + address P_3 = (address)_P_3; + address ONE = (address)_ONE; + address NEG_ZERO = (address)_NEG_ZERO; + + bind(start); + push(rbx); + subq(rsp, 16); + movsd(Address(rsp, 8), xmm0); + + bind(B1_2); + movl(eax, Address(rsp, 12)); + movq(xmm1, ExternalAddress(PI32INV)); //0x6dc9c883UL, 0x40245f30UL + andl(eax, 2147418112); + subl(eax, 808452096); + cmpl(eax, 281346048); + jcc(Assembler::above, L_2TAG_PACKET_0_0_1); + mulsd(xmm1, xmm0); + movdqu(xmm5, ExternalAddress(ONEHALF)); //0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL + movq(xmm4, ExternalAddress(SIGN_MASK)); //0x00000000UL, 0x80000000UL + pand(xmm4, xmm0); + por(xmm5, xmm4); + addpd(xmm1, xmm5); + cvttsd2sil(edx, xmm1); + cvtsi2sdl(xmm1, edx); + movdqu(xmm2, ExternalAddress(P_2)); //0x1a600000UL, 0x3d90b461UL, 0x1a600000UL, 0x3d90b461UL + movq(xmm3, ExternalAddress(P_1)); //0x54400000UL, 0x3fb921fbUL + mulsd(xmm3, xmm1); + unpcklpd(xmm1, xmm1); + addq(rdx, 1865232); + movdqu(xmm4, xmm0); + andq(rdx, 63); + movdqu(xmm5, ExternalAddress(SC_4)); //0xa556c734UL, 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL + lea(rax, ExternalAddress(Ctable)); + shlq(rdx, 5); + addq(rax, rdx); + mulpd(xmm2, xmm1); + subsd(xmm0, xmm3); + mulsd(xmm1, ExternalAddress(P_3)); //0x2e037073UL, 0x3b63198aUL + subsd(xmm4, xmm3); + movq(xmm7, Address(rax, 8)); + unpcklpd(xmm0, xmm0); + movdqu(xmm3, xmm4); + subsd(xmm4, xmm2); + mulpd(xmm5, xmm0); + subpd(xmm0, xmm2); + movdqu(xmm6, ExternalAddress(SC_2)); //0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm2); + movdqu(xmm2, Address(rax, 0)); + subsd(xmm1, xmm3); + movq(xmm3, Address(rax, 24)); + addsd(xmm2, xmm3); + subsd(xmm7, xmm2); + mulsd(xmm2, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, ExternalAddress(SC_3)); //0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL + mulsd(xmm4, Address(rax, 0)); + addpd(xmm6, ExternalAddress(SC_1)); //0x55555555UL, 0xbfc55555UL, 0x00000000UL, 0xbfe00000UL + mulpd(xmm5, xmm0); + movdqu(xmm0, xmm3); + addsd(xmm3, Address(rax, 8)); + mulpd(xmm1, xmm7); + movdqu(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movq(xmm5, Address(rax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(rax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm0, xmm5); + addsd(xmm3, xmm7); + addsd(xmm0, xmm1); + addsd(xmm0, xmm3); + addsd(xmm0, xmm6); + unpckhpd(xmm6, xmm6); + addsd(xmm0, xmm6); + addsd(xmm0, xmm4); + jmp(B1_4); + + bind(L_2TAG_PACKET_0_0_1); + jcc(Assembler::greater, L_2TAG_PACKET_1_0_1); + pextrw(eax, xmm0, 3); + andl(eax, 32767); + pinsrw(xmm0, eax, 3); + movq(xmm1, ExternalAddress(ONE)); //0x00000000UL, 0x3ff00000UL + subsd(xmm1, xmm0); + movdqu(xmm0, xmm1); + jmp(B1_4); + + bind(L_2TAG_PACKET_1_0_1); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_2_0_1); + pextrw(ecx, xmm0, 3); + andl(ecx, 32752); + subl(ecx, 16224); + shrl(ecx, 7); + andl(ecx, 65532); + lea(r11, ExternalAddress(PI_INV_TABLE)); + addq(rcx, r11); + movdq(rax, xmm0); + movl(r10, Address(rcx, 20)); + movl(r8, Address(rcx, 24)); + movl(edx, eax); + shrq(rax, 21); + orl(eax, INT_MIN); + shrl(eax, 11); + movl(r9, r10); + imulq(r10, rdx); + imulq(r9, rax); + imulq(r8, rax); + movl(rsi, Address(rcx, 16)); + movl(rdi, Address(rcx, 12)); + movl(r11, r10); + shrq(r10, 32); + addq(r9, r10); + addq(r11, r8); + movl(r8, r11); + shrq(r11, 32); + addq(r9, r11); + movl(r10, rsi); + imulq(rsi, rdx); + imulq(r10, rax); + movl(r11, rdi); + imulq(rdi, rdx); + movl(rbx, rsi); + shrq(rsi, 32); + addq(r9, rbx); + movl(rbx, r9); + shrq(r9, 32); + addq(r10, rsi); + addq(r10, r9); + shlq(rbx, 32); + orq(r8, rbx); + imulq(r11, rax); + movl(r9, Address(rcx, 8)); + movl(rsi, Address(rcx, 4)); + movl(rbx, rdi); + shrq(rdi, 32); + addq(r10, rbx); + movl(rbx, r10); + shrq(r10, 32); + addq(r11, rdi); + addq(r11, r10); + movq(rdi, r9); + imulq(r9, rdx); + imulq(rdi, rax); + movl(r10, r9); + shrq(r9, 32); + addq(r11, r10); + movl(r10, r11); + shrq(r11, 32); + addq(rdi, r9); + addq(rdi, r11); + movq(r9, rsi); + imulq(rsi, rdx); + imulq(r9, rax); + shlq(r10, 32); + orq(r10, rbx); + movl(eax, Address(rcx, 0)); + movl(r11, rsi); + shrq(rsi, 32); + addq(rdi, r11); + movl(r11, rdi); + shrq(rdi, 32); + addq(r9, rsi); + addq(r9, rdi); + imulq(rdx, rax); + pextrw(rbx, xmm0, 3); + lea(rdi, ExternalAddress(PI_INV_TABLE)); + subq(rcx, rdi); + addl(ecx, ecx); + addl(ecx, ecx); + addl(ecx, ecx); + addl(ecx, 19); + movl(rsi, 32768); + andl(rsi, rbx); + shrl(rbx, 4); + andl(rbx, 2047); + subl(rbx, 1023); + subl(ecx, rbx); + addq(r9, rdx); + movl(edx, ecx); + addl(edx, 32); + cmpl(ecx, 1); + jcc(Assembler::less, L_2TAG_PACKET_3_0_1); + negl(ecx); + addl(ecx, 29); + shll(r9); + movl(rdi, r9); + andl(r9, 536870911); + testl(r9, 268435456); + jcc(Assembler::notEqual, L_2TAG_PACKET_4_0_1); + shrl(r9); + movl(rbx, 0); + shlq(r9, 32); + orq(r9, r11); + + bind(L_2TAG_PACKET_5_0_1); + + bind(L_2TAG_PACKET_6_0_1); + cmpq(r9, 0); + jcc(Assembler::equal, L_2TAG_PACKET_7_0_1); + + bind(L_2TAG_PACKET_8_0_1); + bsrq(r11, r9); + movl(ecx, 29); + subl(ecx, r11); + jcc(Assembler::lessEqual, L_2TAG_PACKET_9_0_1); + shlq(r9); + movq(rax, r10); + shlq(r10); + addl(edx, ecx); + negl(ecx); + addl(ecx, 64); + shrq(rax); + shrq(r8); + orq(r9, rax); + orq(r10, r8); + + bind(L_2TAG_PACKET_10_0_1); + cvtsi2sdq(xmm0, r9); + shrq(r10, 1); + cvtsi2sdq(xmm3, r10); + xorpd(xmm4, xmm4); + shll(edx, 4); + negl(edx); + addl(edx, 16368); + orl(edx, rsi); + xorl(edx, rbx); + pinsrw(xmm4, edx, 3); + movq(xmm2, ExternalAddress(PI_4)); //0x40000000UL, 0x3fe921fbUL, 0x18469899UL, 0x3e64442dUL + movq(xmm6, ExternalAddress(8 + PI_4)); //0x3fe921fbUL, 0x18469899UL, 0x3e64442dUL + xorpd(xmm5, xmm5); + subl(edx, 1008); + pinsrw(xmm5, edx, 3); + mulsd(xmm0, xmm4); + shll(rsi, 16); + sarl(rsi, 31); + mulsd(xmm3, xmm5); + movdqu(xmm1, xmm0); + mulsd(xmm0, xmm2); + shrl(rdi, 29); + addsd(xmm1, xmm3); + mulsd(xmm3, xmm2); + addl(rdi, rsi); + xorl(rdi, rsi); + mulsd(xmm6, xmm1); + movl(eax, rdi); + addsd(xmm6, xmm3); + movdqu(xmm2, xmm0); + addsd(xmm0, xmm6); + subsd(xmm2, xmm0); + addsd(xmm6, xmm2); + + bind(L_2TAG_PACKET_11_0_1); + movq(xmm1, ExternalAddress(PI32INV)); //0x6dc9c883UL, 0x40245f30UL + mulsd(xmm1, xmm0); + movq(xmm5, ExternalAddress(ONEHALF)); //0x00000000UL, 0x3fe00000UL, 0x00000000UL, 0x3fe00000UL + movq(xmm4, ExternalAddress(SIGN_MASK)); //0x00000000UL, 0x80000000UL + pand(xmm4, xmm0); + por(xmm5, xmm4); + addpd(xmm1, xmm5); + cvttsd2siq(rdx, xmm1); + cvtsi2sdq(xmm1, rdx); + movq(xmm3, ExternalAddress(P_1)); //0x54400000UL, 0x3fb921fbUL + movdqu(xmm2, ExternalAddress(P_2)); //0x1a600000UL, 0x3d90b461UL, 0x1a600000UL, 0x3d90b461UL + mulsd(xmm3, xmm1); + unpcklpd(xmm1, xmm1); + shll(eax, 3); + addl(edx, 1865232); + movdqu(xmm4, xmm0); + addl(edx, eax); + andl(edx, 63); + movdqu(xmm5, ExternalAddress(SC_4)); //0xa556c734UL, 0x3ec71de3UL, 0x1a01a01aUL, 0x3efa01a0UL + lea(rax, ExternalAddress(Ctable)); + shll(edx, 5); + addq(rax, rdx); + mulpd(xmm2, xmm1); + subsd(xmm0, xmm3); + mulsd(xmm1, ExternalAddress(P_3)); //0x2e037073UL, 0x3b63198aUL + subsd(xmm4, xmm3); + movq(xmm7, Address(rax, 8)); + unpcklpd(xmm0, xmm0); + movdqu(xmm3, xmm4); + subsd(xmm4, xmm2); + mulpd(xmm5, xmm0); + subpd(xmm0, xmm2); + mulsd(xmm7, xmm4); + subsd(xmm3, xmm4); + mulpd(xmm5, xmm0); + mulpd(xmm0, xmm0); + subsd(xmm3, xmm2); + movdqu(xmm2, Address(rax, 0)); + subsd(xmm1, xmm3); + movq(xmm3, Address(rax, 24)); + addsd(xmm2, xmm3); + subsd(xmm7, xmm2); + subsd(xmm1, xmm6); + movdqu(xmm6, ExternalAddress(SC_2)); //0x11111111UL, 0x3f811111UL, 0x55555555UL, 0x3fa55555UL + mulsd(xmm2, xmm4); + mulpd(xmm6, xmm0); + mulsd(xmm3, xmm4); + mulpd(xmm2, xmm0); + mulpd(xmm0, xmm0); + addpd(xmm5, ExternalAddress(SC_3)); //0x1a01a01aUL, 0xbf2a01a0UL, 0x16c16c17UL, 0xbf56c16cUL + mulsd(xmm4, Address(rax, 0)); + addpd(xmm6, ExternalAddress(SC_1)); //0x55555555UL, 0xbfc55555UL, 0x00000000UL, 0xbfe00000UL + mulpd(xmm5, xmm0); + movdqu(xmm0, xmm3); + addsd(xmm3, Address(rax, 8)); + mulpd(xmm1, xmm7); + movdqu(xmm7, xmm4); + addsd(xmm4, xmm3); + addpd(xmm6, xmm5); + movq(xmm5, Address(rax, 8)); + subsd(xmm5, xmm3); + subsd(xmm3, xmm4); + addsd(xmm1, Address(rax, 16)); + mulpd(xmm6, xmm2); + addsd(xmm5, xmm0); + addsd(xmm3, xmm7); + addsd(xmm1, xmm5); + addsd(xmm1, xmm3); + addsd(xmm1, xmm6); + unpckhpd(xmm6, xmm6); + movdqu(xmm0, xmm4); + addsd(xmm1, xmm6); + addsd(xmm0, xmm1); + jmp(B1_4); + + bind(L_2TAG_PACKET_7_0_1); + addl(edx, 64); + movq(r9, r10); + movq(r10, r8); + movl(r8, 0); + cmpq(r9, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_8_0_1); + addl(edx, 64); + movq(r9, r10); + movq(r10, r8); + cmpq(r9, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_8_0_1); + xorpd(xmm0, xmm0); + xorpd(xmm6, xmm6); + jmp(L_2TAG_PACKET_11_0_1); + + bind(L_2TAG_PACKET_9_0_1); + jcc(Assembler::equal, L_2TAG_PACKET_10_0_1); + negl(ecx); + shrq(r10); + movq(rax, r9); + shrq(r9); + subl(edx, ecx); + negl(ecx); + addl(ecx, 64); + shlq(rax); + orq(r10, rax); + jmp(L_2TAG_PACKET_10_0_1); + bind(L_2TAG_PACKET_3_0_1); + negl(ecx); + shlq(r9, 32); + orq(r9, r11); + shlq(r9); + movq(rdi, r9); + testl(r9, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_12_0_1); + shrl(r9); + movl(rbx, 0); + shrq(rdi, 3); + jmp(L_2TAG_PACKET_6_0_1); + + bind(L_2TAG_PACKET_4_0_1); + shrl(r9); + movl(rbx, 536870912); + shrl(rbx); + shlq(r9, 32); + orq(r9, r11); + shlq(rbx, 32); + addl(rdi, 536870912); + movl(rcx, 0); + movl(r11, 0); + subq(rcx, r8); + sbbq(r11, r10); + sbbq(rbx, r9); + movq(r8, rcx); + movq(r10, r11); + movq(r9, rbx); + movl(rbx, 32768); + jmp(L_2TAG_PACKET_5_0_1); + + bind(L_2TAG_PACKET_12_0_1); + shrl(r9); + mov64(rbx, 0x100000000); + shrq(rbx); + movl(rcx, 0); + movl(r11, 0); + subq(rcx, r8); + sbbq(r11, r10); + sbbq(rbx, r9); + movq(r8, rcx); + movq(r10, r11); + movq(r9, rbx); + movl(rbx, 32768); + shrq(rdi, 3); + addl(rdi, 536870912); + jmp(L_2TAG_PACKET_6_0_1); + + bind(L_2TAG_PACKET_2_0_1); + movsd(xmm0, Address(rsp, 8)); + mulsd(xmm0, ExternalAddress(NEG_ZERO)); //0x00000000UL, 0x80000000UL + movq(Address(rsp, 0), xmm0); + + bind(L_2TAG_PACKET_13_0_1); + + bind(B1_4); + addq(rsp, 16); + pop(rbx); +} diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 0f869d6bdf6..09715b42db9 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -972,6 +972,15 @@ void MacroAssembler::addss(XMMRegister dst, AddressLiteral src) { } } +void MacroAssembler::addpd(XMMRegister dst, AddressLiteral src) { + if (reachable(src)) { + Assembler::addpd(dst, as_Address(src)); + } else { + lea(rscratch1, src); + Assembler::addpd(dst, Address(rscratch1, 0)); + } +} + void MacroAssembler::align(int modulus) { align(modulus, offset()); } @@ -5732,34 +5741,22 @@ void MacroAssembler::trigfunc(char trig, int num_fpu_regs_in_use) { } Label slow_case, done; + if (trig == 't') { + ExternalAddress pi4_adr = (address)&pi_4; + if (reachable(pi4_adr)) { + // x ?<= pi/4 + fld_d(pi4_adr); + fld_s(1); // Stack: X PI/4 X + fabs(); // Stack: |X| PI/4 X + fcmp(tmp); + jcc(Assembler::above, slow_case); - ExternalAddress pi4_adr = (address)&pi_4; - if (reachable(pi4_adr)) { - // x ?<= pi/4 - fld_d(pi4_adr); - fld_s(1); // Stack: X PI/4 X - fabs(); // Stack: |X| PI/4 X - fcmp(tmp); - jcc(Assembler::above, slow_case); - - // fastest case: -pi/4 <= x <= pi/4 - switch(trig) { - case 's': - fsin(); - break; - case 'c': - fcos(); - break; - case 't': + // fastest case: -pi/4 <= x <= pi/4 ftan(); - break; - default: - assert(false, "bad intrinsic"); - break; - } - jmp(done); - } + jmp(done); + } + } // slow case: runtime call bind(slow_case); @@ -5792,7 +5789,6 @@ void MacroAssembler::trigfunc(char trig, int num_fpu_regs_in_use) { } } - // Look up the method for a megamorphic invokeinterface call. // The target method is determined by . // The receiver klass is in recv_klass. diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index 0b7fc6d90c0..8a13da7eb0b 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -872,6 +872,7 @@ class MacroAssembler: public Assembler { void andpd(XMMRegister dst, Address src) { Assembler::andpd(dst, src); } void andpd(XMMRegister dst, AddressLiteral src); + void andpd(XMMRegister dst, XMMRegister src) { Assembler::andpd(dst, src); } void andps(XMMRegister dst, XMMRegister src) { Assembler::andps(dst, src); } void andps(XMMRegister dst, Address src) { Assembler::andps(dst, src); } @@ -907,10 +908,6 @@ class MacroAssembler: public Assembler { void ldmxcsr(Address src) { Assembler::ldmxcsr(src); } void ldmxcsr(AddressLiteral src); - // compute pow(x,y) and exp(x) with x86 instructions. Don't cover - // all corner cases and may result in NaN and require fallback to a - // runtime call. - void fast_pow(); void fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register rax, Register rcx, Register rdx, Register tmp); @@ -918,11 +915,32 @@ class MacroAssembler: public Assembler { void fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register rax, Register rcx, Register rdx, Register tmp1 LP64_ONLY(COMMA Register tmp2)); + void fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register rax, Register rcx, Register rdx NOT_LP64(COMMA Register tmp) LP64_ONLY(COMMA Register tmp1) LP64_ONLY(COMMA Register tmp2) LP64_ONLY(COMMA Register tmp3) LP64_ONLY(COMMA Register tmp4)); + void fast_sin(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, + XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, + Register rax, Register rbx LP64_ONLY(COMMA Register rcx), Register rdx + LP64_ONLY(COMMA Register tmp1) LP64_ONLY(COMMA Register tmp2) + LP64_ONLY(COMMA Register tmp3) LP64_ONLY(COMMA Register tmp4)); + + void fast_cos(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, + XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, + Register rax, Register rcx, Register rdx NOT_LP64(COMMA Register tmp) + LP64_ONLY(COMMA Register r8) LP64_ONLY(COMMA Register r9) + LP64_ONLY(COMMA Register r10) LP64_ONLY(COMMA Register r11)); + +#ifndef _LP64 + void libm_sincos_huge(XMMRegister xmm0, XMMRegister xmm1, Register eax, Register ecx, + Register edx, Register ebx, Register esi, Register edi, + Register ebp, Register esp); + void libm_reduce_pi04l(Register eax, Register ecx, Register edx, Register ebx, + Register esi, Register edi, Register ebp, Register esp); +#endif + void increase_precision(); void restore_precision(); @@ -951,6 +969,10 @@ public: void addss(XMMRegister dst, Address src) { Assembler::addss(dst, src); } void addss(XMMRegister dst, AddressLiteral src); + void addpd(XMMRegister dst, XMMRegister src) { Assembler::addpd(dst, src); } + void addpd(XMMRegister dst, Address src) { Assembler::addpd(dst, src); } + void addpd(XMMRegister dst, AddressLiteral src); + void divsd(XMMRegister dst, XMMRegister src) { Assembler::divsd(dst, src); } void divsd(XMMRegister dst, Address src) { Assembler::divsd(dst, src); } void divsd(XMMRegister dst, AddressLiteral src); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index b1895f639dc..894e4cb3319 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -2102,22 +2102,6 @@ class StubGenerator: public StubCodeGenerator { __ flog10(); __ ret(0); } - { - StubCodeMark mark(this, "StubRoutines", "sin"); - StubRoutines::_intrinsic_sin = (double (*)(double)) __ pc(); - - __ fld_d(Address(rsp, 4)); - __ trigfunc('s'); - __ ret(0); - } - { - StubCodeMark mark(this, "StubRoutines", "cos"); - StubRoutines::_intrinsic_cos = (double (*)(double)) __ pc(); - - __ fld_d(Address(rsp, 4)); - __ trigfunc('c'); - __ ret(0); - } { StubCodeMark mark(this, "StubRoutines", "tan"); StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc(); @@ -3441,6 +3425,76 @@ class StubGenerator: public StubCodeGenerator { } + address generate_libm_reduce_pi04l() { + address start = __ pc(); + + BLOCK_COMMENT("Entry:"); + __ libm_reduce_pi04l(rax, rcx, rdx, rbx, rsi, rdi, rbp, rsp); + + return start; + + } + + address generate_libm_sin_cos_huge() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + + BLOCK_COMMENT("Entry:"); + __ libm_sincos_huge(x0, x1, rax, rcx, rdx, rbx, rsi, rdi, rbp, rsp); + + return start; + + } + + address generate_libmSin() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + __ fast_sin(x0, x1, x2, x3, x4, x5, x6, x7, rax, rbx, rdx); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } + + address generate_libmCos() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + const Register tmp = rbx; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + __ fast_cos(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } // Safefetch stubs. void generate_safefetch(const char* name, int size, address* entry, @@ -3669,6 +3723,16 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_dexp = generate_libmExp(); StubRoutines::_dlog = generate_libmLog(); StubRoutines::_dpow = generate_libmPow(); + if (UseLibmSinIntrinsic || UseLibmCosIntrinsic) { + StubRoutines::_dlibm_reduce_pi04l = generate_libm_reduce_pi04l(); + StubRoutines::_dlibm_sin_cos_huge = generate_libm_sin_cos_huge(); + } + if (UseLibmSinIntrinsic) { + StubRoutines::_dsin = generate_libmSin(); + } + if (UseLibmCosIntrinsic) { + StubRoutines::_dcos = generate_libmCos(); + } } } diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index f2fd002295a..db518d804db 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -2986,32 +2986,6 @@ class StubGenerator: public StubCodeGenerator { __ addq(rsp, 8); __ ret(0); } - { - StubCodeMark mark(this, "StubRoutines", "sin"); - StubRoutines::_intrinsic_sin = (double (*)(double)) __ pc(); - - __ subq(rsp, 8); - __ movdbl(Address(rsp, 0), xmm0); - __ fld_d(Address(rsp, 0)); - __ trigfunc('s'); - __ fstp_d(Address(rsp, 0)); - __ movdbl(xmm0, Address(rsp, 0)); - __ addq(rsp, 8); - __ ret(0); - } - { - StubCodeMark mark(this, "StubRoutines", "cos"); - StubRoutines::_intrinsic_cos = (double (*)(double)) __ pc(); - - __ subq(rsp, 8); - __ movdbl(Address(rsp, 0), xmm0); - __ fld_d(Address(rsp, 0)); - __ trigfunc('c'); - __ fstp_d(Address(rsp, 0)); - __ movdbl(xmm0, Address(rsp, 0)); - __ addq(rsp, 8); - __ ret(0); - } { StubCodeMark mark(this, "StubRoutines", "tan"); StubRoutines::_intrinsic_tan = (double (*)(double)) __ pc(); @@ -4640,6 +4614,92 @@ class StubGenerator: public StubCodeGenerator { #endif __ fast_pow(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4); +#ifdef _WIN64 + // restore xmm regs belonging to calling function + __ movdqu(xmm6, Address(rsp, 0)); + __ movdqu(xmm7, Address(rsp, 2 * wordSize)); + __ addptr(rsp, 4 * wordSize); +#endif + + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } + + address generate_libmSin() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + const Register tmp1 = r8; + const Register tmp2 = r9; + const Register tmp3 = r10; + const Register tmp4 = r11; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + +#ifdef _WIN64 + // save the xmm registers which must be preserved 6-7 + __ subptr(rsp, 4 * wordSize); + __ movdqu(Address(rsp, 0), xmm6); + __ movdqu(Address(rsp, 2 * wordSize), xmm7); +#endif + __ fast_sin(x0, x1, x2, x3, x4, x5, x6, x7, rax, rbx, rcx, rdx, tmp1, tmp2, tmp3, tmp4); + +#ifdef _WIN64 + // restore xmm regs belonging to calling function + __ movdqu(xmm6, Address(rsp, 0)); + __ movdqu(xmm7, Address(rsp, 2 * wordSize)); + __ addptr(rsp, 4 * wordSize); +#endif + + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } + + address generate_libmCos() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + const Register tmp1 = r8; + const Register tmp2 = r9; + const Register tmp3 = r10; + const Register tmp4 = r11; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + +#ifdef _WIN64 + // save the xmm registers which must be preserved 6-7 + __ subptr(rsp, 4 * wordSize); + __ movdqu(Address(rsp, 0), xmm6); + __ movdqu(Address(rsp, 2 * wordSize), xmm7); +#endif + __ fast_cos(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4); + #ifdef _WIN64 // restore xmm regs belonging to calling function __ movdqu(xmm6, Address(rsp, 0)); @@ -4849,6 +4909,12 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_dexp = generate_libmExp(); StubRoutines::_dlog = generate_libmLog(); StubRoutines::_dpow = generate_libmPow(); + if (UseLibmSinIntrinsic) { + StubRoutines::_dsin = generate_libmSin(); + } + if (UseLibmCosIntrinsic) { + StubRoutines::_dcos = generate_libmCos(); + } } } diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp index c1ea0223389..17f76e8f876 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp @@ -30,7 +30,7 @@ // extend it. enum platform_dependent_constants { - code_size1 = 9000, // simply increase if too small (assembler will crash if too small) + code_size1 = 20000, // simply increase if too small (assembler will crash if too small) code_size2 = 33800 // simply increase if too small (assembler will crash if too small) }; diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp index 6f39276dc05..b4750ff4f90 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp @@ -32,7 +32,7 @@ static bool returns_to_call_stub(address return_pc) { return return_pc == _call_stub_return_address; } enum platform_dependent_constants { - code_size1 = 19000, // simply increase if too small (assembler will crash if too small) + code_size1 = 30000, // simply increase if too small (assembler will crash if too small) code_size2 = 35000 // simply increase if too small (assembler will crash if too small) }; diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index cebd468acb6..a5b9804e7e5 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -9791,48 +9791,6 @@ instruct modD_reg(regD dst, regD src0, regD src1, eAXRegI rax, eFlagsReg cr) %{ ins_pipe( pipe_slow ); %} -instruct sinDPR_reg(regDPR1 dst, regDPR1 src) %{ - predicate (UseSSE<=1); - match(Set dst (SinD src)); - ins_cost(1800); - format %{ "DSIN $dst" %} - opcode(0xD9, 0xFE); - ins_encode( OpcP, OpcS ); - ins_pipe( pipe_slow ); -%} - -instruct sinD_reg(regD dst, eFlagsReg cr) %{ - predicate (UseSSE>=2); - match(Set dst (SinD dst)); - effect(KILL cr); // Push_{Src|Result}D() uses "{SUB|ADD} ESP,8" - ins_cost(1800); - format %{ "DSIN $dst" %} - opcode(0xD9, 0xFE); - ins_encode( Push_SrcD(dst), OpcP, OpcS, Push_ResultD(dst) ); - ins_pipe( pipe_slow ); -%} - -instruct cosDPR_reg(regDPR1 dst, regDPR1 src) %{ - predicate (UseSSE<=1); - match(Set dst (CosD src)); - ins_cost(1800); - format %{ "DCOS $dst" %} - opcode(0xD9, 0xFF); - ins_encode( OpcP, OpcS ); - ins_pipe( pipe_slow ); -%} - -instruct cosD_reg(regD dst, eFlagsReg cr) %{ - predicate (UseSSE>=2); - match(Set dst (CosD dst)); - effect(KILL cr); // Push_{Src|Result}D() uses "{SUB|ADD} ESP,8" - ins_cost(1800); - format %{ "DCOS $dst" %} - opcode(0xD9, 0xFF); - ins_encode( Push_SrcD(dst), OpcP, OpcS, Push_ResultD(dst) ); - ins_pipe( pipe_slow ); -%} - instruct tanDPR_reg(regDPR1 dst, regDPR1 src) %{ predicate (UseSSE<=1); match(Set dst(TanD src)); diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 9def843e07e..96edd46cdc5 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -9819,24 +9819,6 @@ instruct cmpD_imm(rRegI dst, regD src, immD con, rFlagsReg cr) %{ %} // -----------Trig and Trancendental Instructions------------------------------ -instruct cosD_reg(regD dst) %{ - match(Set dst (CosD dst)); - - format %{ "dcos $dst\n\t" %} - opcode(0xD9, 0xFF); - ins_encode( Push_SrcXD(dst), OpcP, OpcS, Push_ResultXD(dst) ); - ins_pipe( pipe_slow ); -%} - -instruct sinD_reg(regD dst) %{ - match(Set dst (SinD dst)); - - format %{ "dsin $dst\n\t" %} - opcode(0xD9, 0xFE); - ins_encode( Push_SrcXD(dst), OpcP, OpcS, Push_ResultXD(dst) ); - ins_pipe( pipe_slow ); -%} - instruct tanD_reg(regD dst) %{ match(Set dst (TanD dst)); diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index 4e5fe365e52..d408c904c6c 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -4010,7 +4010,6 @@ int MatchRule::is_expensive() const { if( _rChild ) { const char *opType = _rChild->_opType; if( strcmp(opType,"AtanD")==0 || - strcmp(opType,"CosD")==0 || strcmp(opType,"DivD")==0 || strcmp(opType,"DivF")==0 || strcmp(opType,"DivI")==0 || @@ -4018,7 +4017,6 @@ int MatchRule::is_expensive() const { strcmp(opType,"ModD")==0 || strcmp(opType,"ModF")==0 || strcmp(opType,"ModI")==0 || - strcmp(opType,"SinD")==0 || strcmp(opType,"SqrtD")==0 || strcmp(opType,"TanD")==0 || strcmp(opType,"ConvD2F")==0 || diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp index 8397df6a048..6077c282472 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.cpp +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -729,8 +729,6 @@ void LIR_OpVisitState::visit(LIR_Op* op) { case lir_tan: - case lir_sin: - case lir_cos: case lir_log10: { assert(op->as_Op2() != NULL, "must be"); LIR_Op2* op2 = (LIR_Op2*)op; @@ -1740,8 +1738,6 @@ const char * LIR_Op::name() const { case lir_rem: s = "rem"; break; case lir_abs: s = "abs"; break; case lir_sqrt: s = "sqrt"; break; - case lir_sin: s = "sin"; break; - case lir_cos: s = "cos"; break; case lir_tan: s = "tan"; break; case lir_log10: s = "log10"; break; case lir_logic_and: s = "logic_and"; break; diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp index ade1fbd31cc..c5e52dec265 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.hpp +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp @@ -958,8 +958,6 @@ enum LIR_Code { , lir_rem , lir_sqrt , lir_abs - , lir_sin - , lir_cos , lir_tan , lir_log10 , lir_logic_and @@ -2194,8 +2192,6 @@ class LIR_List: public CompilationResourceObj { void abs (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_abs , from, tmp, to)); } void sqrt(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_sqrt, from, tmp, to)); } void log10 (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_log10, from, LIR_OprFact::illegalOpr, to, tmp)); } - void sin (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_sin , from, tmp1, to, tmp2)); } - void cos (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_cos , from, tmp1, to, tmp2)); } void tan (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_tan , from, tmp1, to, tmp2)); } void add (LIR_Opr left, LIR_Opr right, LIR_Opr res) { append(new LIR_Op2(lir_add, left, right, res)); } diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp index 4d016513ee7..7f33a2c4d22 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -736,9 +736,7 @@ void LIR_Assembler::emit_op2(LIR_Op2* op) { case lir_abs: case lir_sqrt: - case lir_sin: case lir_tan: - case lir_cos: case lir_log10: intrinsic_op(op->code(), op->in_opr1(), op->in_opr2(), op->result_opr(), op); break; diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index f474b00d20b..cda969cb4b8 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -6599,8 +6599,6 @@ void LinearScanStatistic::collect(LinearScan* allocator) { case lir_div_strictfp: case lir_rem: case lir_sqrt: - case lir_sin: - case lir_cos: case lir_abs: case lir_log10: case lir_logic_and: diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 1810017fdc8..668ae3e91dd 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -320,6 +320,8 @@ const char* Runtime1::name_for_address(address entry) { FUNCTION_CASE(entry, StubRoutines::dexp()); FUNCTION_CASE(entry, StubRoutines::dlog()); FUNCTION_CASE(entry, StubRoutines::dpow()); + FUNCTION_CASE(entry, StubRoutines::dsin()); + FUNCTION_CASE(entry, StubRoutines::dcos()); #undef FUNCTION_CASE diff --git a/hotspot/src/share/vm/opto/classes.hpp b/hotspot/src/share/vm/opto/classes.hpp index 16ccc5817b6..e101a9768a2 100644 --- a/hotspot/src/share/vm/opto/classes.hpp +++ b/hotspot/src/share/vm/opto/classes.hpp @@ -112,7 +112,6 @@ macro(ConvI2L) macro(ConvL2D) macro(ConvL2F) macro(ConvL2I) -macro(CosD) macro(CountedLoop) macro(CountedLoopEnd) macro(CountLeadingZerosI) @@ -229,7 +228,6 @@ macro(RoundFloat) macro(SafePoint) macro(SafePointScalarObject) macro(SCMemProj) -macro(SinD) macro(SqrtD) macro(Start) macro(StartOSR) diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 5bcd0b06623..408b4d09f3b 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -1628,8 +1628,6 @@ bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) { Node* n = NULL; switch (id) { - case vmIntrinsics::_dsin: n = new SinDNode(C, control(), arg); break; - case vmIntrinsics::_dcos: n = new CosDNode(C, control(), arg); break; case vmIntrinsics::_dtan: n = new TanDNode(C, control(), arg); break; default: fatal_unexpected_iid(id); break; } @@ -1692,16 +1690,6 @@ bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) { // Slow path - non-blocking leaf call Node* call = NULL; switch (id) { - case vmIntrinsics::_dsin: - call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(), - CAST_FROM_FN_PTR(address, SharedRuntime::dsin), - "Sin", NULL, arg, top()); - break; - case vmIntrinsics::_dcos: - call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(), - CAST_FROM_FN_PTR(address, SharedRuntime::dcos), - "Cos", NULL, arg, top()); - break; case vmIntrinsics::_dtan: call = make_runtime_call(RC_LEAF, OptoRuntime::Math_D_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dtan), @@ -1752,17 +1740,21 @@ bool LibraryCallKit::inline_math_native(vmIntrinsics::ID id) { #define FN_PTR(f) CAST_FROM_FN_PTR(address, f) switch (id) { // These intrinsics are not properly supported on all hardware - case vmIntrinsics::_dcos: return Matcher::has_match_rule(Op_CosD) ? inline_trig(id) : - runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dcos), "COS"); - case vmIntrinsics::_dsin: return Matcher::has_match_rule(Op_SinD) ? inline_trig(id) : - runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dsin), "SIN"); + case vmIntrinsics::_dsin: + return StubRoutines::dsin() != NULL ? + runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dsin(), "dsin") : + runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dsin), "SIN"); + case vmIntrinsics::_dcos: + return StubRoutines::dcos() != NULL ? + runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dcos(), "dcos") : + runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dcos), "COS"); case vmIntrinsics::_dtan: return Matcher::has_match_rule(Op_TanD) ? inline_trig(id) : runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dtan), "TAN"); case vmIntrinsics::_dlog: return StubRoutines::dlog() != NULL ? - runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dlog(), "dlog") : - runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dlog), "LOG"); + runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dlog(), "dlog") : + runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dlog), "LOG"); case vmIntrinsics::_dlog10: return Matcher::has_match_rule(Op_Log10D) ? inline_math(id) : runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dlog10), "LOG10"); diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 6e27f53c0a4..76531d7a569 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -1475,28 +1475,6 @@ const Type *SqrtDNode::Value( PhaseTransform *phase ) const { return TypeD::make( sqrt( d ) ); } -//============================================================================= -//------------------------------Value------------------------------------------ -// Compute cos -const Type *CosDNode::Value( PhaseTransform *phase ) const { - const Type *t1 = phase->type( in(1) ); - if( t1 == Type::TOP ) return Type::TOP; - if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; - double d = t1->getd(); - return TypeD::make( StubRoutines::intrinsic_cos( d ) ); -} - -//============================================================================= -//------------------------------Value------------------------------------------ -// Compute sin -const Type *SinDNode::Value( PhaseTransform *phase ) const { - const Type *t1 = phase->type( in(1) ); - if( t1 == Type::TOP ) return Type::TOP; - if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; - double d = t1->getd(); - return TypeD::make( StubRoutines::intrinsic_sin( d ) ); -} - //============================================================================= //------------------------------Value------------------------------------------ // Compute tan diff --git a/hotspot/src/share/vm/opto/subnode.hpp b/hotspot/src/share/vm/opto/subnode.hpp index 3ee7b4763b1..fe5c840a776 100644 --- a/hotspot/src/share/vm/opto/subnode.hpp +++ b/hotspot/src/share/vm/opto/subnode.hpp @@ -408,35 +408,6 @@ public: virtual uint ideal_reg() const { return Op_RegD; } }; -//------------------------------CosDNode--------------------------------------- -// Cosinus of a double -class CosDNode : public Node { -public: - CosDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) { - init_flags(Flag_is_expensive); - C->add_expensive_node(this); - } - virtual int Opcode() const; - const Type *bottom_type() const { return Type::DOUBLE; } - virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; -}; - -//------------------------------CosDNode--------------------------------------- -// Sinus of a double -class SinDNode : public Node { -public: - SinDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) { - init_flags(Flag_is_expensive); - C->add_expensive_node(this); - } - virtual int Opcode() const; - const Type *bottom_type() const { return Type::DOUBLE; } - virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; -}; - - //------------------------------TanDNode--------------------------------------- // tangens of a double class TanDNode : public Node { diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index 2682be50945..0f2c5b65e17 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -155,6 +155,10 @@ address StubRoutines::_vectorizedMismatch = NULL; address StubRoutines::_dexp = NULL; address StubRoutines::_dlog = NULL; address StubRoutines::_dpow = NULL; +address StubRoutines::_dsin = NULL; +address StubRoutines::_dcos = NULL; +address StubRoutines::_dlibm_sin_cos_huge = NULL; +address StubRoutines::_dlibm_reduce_pi04l = NULL; double (* StubRoutines::_intrinsic_log10 )(double) = NULL; double (* StubRoutines::_intrinsic_sin )(double) = NULL; diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index a3f905aed11..38fe86e631b 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -214,6 +214,10 @@ class StubRoutines: AllStatic { static address _dexp; static address _dlog; static address _dpow; + static address _dsin; + static address _dcos; + static address _dlibm_sin_cos_huge; + static address _dlibm_reduce_pi04l; // These are versions of the java.lang.Math methods which perform // the same operations as the intrinsic version. They are used for @@ -388,6 +392,10 @@ class StubRoutines: AllStatic { static address dexp() { return _dexp; } static address dlog() { return _dlog; } static address dpow() { return _dpow; } + static address dsin() { return _dsin; } + static address dcos() { return _dcos; } + static address dlibm_reduce_pi04l() { return _dlibm_reduce_pi04l; } + static address dlibm_sin_cos_huge() { return _dlibm_sin_cos_huge; } static address select_fill_function(BasicType t, bool aligned, const char* &name); diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index e20dbbbb00a..89beb13b39d 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -862,6 +862,8 @@ typedef CompactHashtable SymbolCompactHashTable; static_field(StubRoutines, _dexp, address) \ static_field(StubRoutines, _dlog, address) \ static_field(StubRoutines, _dpow, address) \ + static_field(StubRoutines, _dsin, address) \ + static_field(StubRoutines, _dcos, address) \ static_field(StubRoutines, _vectorizedMismatch, address) \ static_field(StubRoutines, _jbyte_arraycopy, address) \ static_field(StubRoutines, _jshort_arraycopy, address) \ @@ -2056,8 +2058,6 @@ typedef CompactHashtable SymbolCompactHashTable; declare_c2_type(NegNode, Node) \ declare_c2_type(NegFNode, NegNode) \ declare_c2_type(NegDNode, NegNode) \ - declare_c2_type(CosDNode, Node) \ - declare_c2_type(SinDNode, Node) \ declare_c2_type(TanDNode, Node) \ declare_c2_type(AtanDNode, Node) \ declare_c2_type(SqrtDNode, Node) \ From f642bbcecdc07ceda69cb0ce99767b95daaade38 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Fri, 8 Jan 2016 10:14:02 +0100 Subject: [PATCH 034/212] 8146613: PPC64: C2 does no longer respect int to long conversion for stub calls Reviewed-by: kvn, goetz --- hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp | 16 ++--- hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp | 8 +-- hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp | 71 ++++++++++++++----- 3 files changed, 65 insertions(+), 30 deletions(-) diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index 1ba560b3160..69077c76286 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2016 SAP AG. 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 @@ -3656,9 +3656,9 @@ int MacroAssembler::crc32_table_columns(Register table, Register tc0, Register t assert_different_registers(table, tc0, tc1, tc2); assert(table == tc3, "must be!"); - if (ix0 != 0) addi(tc0, table, ix0); - if (ix1 != 0) addi(tc1, table, ix1); - if (ix2 != 0) addi(tc2, table, ix2); + addi(tc0, table, ix0); + addi(tc1, table, ix1); + addi(tc2, table, ix2); if (ix3 != 0) addi(tc3, table, ix3); return ix3; @@ -3724,14 +3724,14 @@ void MacroAssembler::update_byteLoop_crc32(Register crc, Register buf, Register const int mainLoop_alignment = loopAlignment ? 32 : 4; // (InputForNewCode > 4 ? InputForNewCode : 32) : 4; // Process all bytes in a single-byte loop. - cmpdi(CCR0, len, 0); // Anything to do? - mtctr(len); + clrldi_(len, len, 32); // Enforce 32 bit. Anything to do? beq(CCR0, L_done); if (invertCRC) { nand(crc, crc, crc); // ~c } + mtctr(len); align(mainLoop_alignment); BIND(L_mainLoop); lbz(data, 0, buf); // Byte from buffer, zero-extended. @@ -3947,7 +3947,7 @@ void MacroAssembler::kernel_crc32_1word(Register crc, Register buf, Register len #else Register crc_rv = tmp; // Load_reverse needs separate registers to work on. // Occupies tmp, but frees up crc. - load_reverse_32(crc_rv, crc); // evert byte order because we are dealing with big-endian data. + load_reverse_32(crc_rv, crc); // Revert byte order because we are dealing with big-endian data. tmp = crc; #endif diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index 60d6bfc6202..14d8d4188c6 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2016 SAP AG. 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 @@ -3437,9 +3437,9 @@ static void reverse_words(unsigned long *s, unsigned long *d, int len) { void SharedRuntime::montgomery_multiply(jint *a_ints, jint *b_ints, jint *n_ints, jint len, jlong inv, jint *m_ints) { + len = len & 0x7fffFFFF; // C2 does not respect int to long conversion for stub calls. assert(len % 2 == 0, "array length in montgomery_multiply must be even"); int longwords = len/2; - assert(longwords > 0, "unsupported"); // Make very sure we don't use so much space that the stack might // overflow. 512 jints corresponds to an 16384-bit integer and @@ -3467,9 +3467,9 @@ void SharedRuntime::montgomery_multiply(jint *a_ints, jint *b_ints, jint *n_ints void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints, jint len, jlong inv, jint *m_ints) { + len = len & 0x7fffFFFF; // C2 does not respect int to long conversion for stub calls. assert(len % 2 == 0, "array length in montgomery_square must be even"); int longwords = len/2; - assert(longwords > 0, "unsupported"); // Make very sure we don't use so much space that the stack might // overflow. 512 jints corresponds to an 16384-bit integer and diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index 19dd372f083..f28a3da667e 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2016 SAP AG. 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 @@ -1077,6 +1077,12 @@ class StubGenerator: public StubCodeGenerator { return start; } + inline void assert_positive_int(Register count) { +#ifdef ASSERT + __ srdi_(R0, count, 31); + __ asm_assert_eq("missing zero extend", 0xAFFE); +#endif + } // Generate overlap test for array copy stubs. // @@ -1089,10 +1095,7 @@ class StubGenerator: public StubCodeGenerator { Register tmp1 = R6_ARG4; Register tmp2 = R7_ARG5; -#ifdef ASSERT - __ srdi_(tmp2, R5_ARG3, 31); - __ asm_assert_eq("missing zero extend", 0xAFFE); -#endif + assert_positive_int(R5_ARG3); __ subf(tmp1, R3_ARG1, R4_ARG2); // distance in bytes __ sldi(tmp2, R5_ARG3, log2_elem_size); // size in bytes @@ -1132,14 +1135,15 @@ class StubGenerator: public StubCodeGenerator { address generate_disjoint_byte_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); + assert_positive_int(R5_ARG3); Register tmp1 = R6_ARG4; Register tmp2 = R7_ARG5; Register tmp3 = R8_ARG6; Register tmp4 = R9_ARG7; - Label l_1, l_2, l_3, l_4, l_5, l_6, l_7, l_8, l_9; + // Don't try anything fancy if arrays don't have many elements. __ li(tmp3, 0); __ cmpwi(CCR0, R5_ARG3, 17); @@ -1264,6 +1268,7 @@ class StubGenerator: public StubCodeGenerator { address generate_conjoint_byte_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); + assert_positive_int(R5_ARG3); Register tmp1 = R6_ARG4; Register tmp2 = R7_ARG5; @@ -1356,8 +1361,10 @@ class StubGenerator: public StubCodeGenerator { Register tmp4 = R9_ARG7; address start = __ function_entry(); + assert_positive_int(R5_ARG3); Label l_1, l_2, l_3, l_4, l_5, l_6, l_7, l_8; + // don't try anything fancy if arrays don't have many elements __ li(tmp3, 0); __ cmpwi(CCR0, R5_ARG3, 9); @@ -1486,6 +1493,7 @@ class StubGenerator: public StubCodeGenerator { address generate_conjoint_short_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); + assert_positive_int(R5_ARG3); Register tmp1 = R6_ARG4; Register tmp2 = R7_ARG5; @@ -1528,6 +1536,7 @@ class StubGenerator: public StubCodeGenerator { Register tmp4 = R0; Label l_1, l_2, l_3, l_4, l_5, l_6; + // for short arrays, just do single element copy __ li(tmp3, 0); __ cmpwi(CCR0, R5_ARG3, 5); @@ -1610,6 +1619,7 @@ class StubGenerator: public StubCodeGenerator { address generate_disjoint_int_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); + assert_positive_int(R5_ARG3); generate_disjoint_int_copy_core(aligned); __ li(R3_RET, 0); // return 0 __ blr(); @@ -1695,7 +1705,7 @@ class StubGenerator: public StubCodeGenerator { address generate_conjoint_int_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); - + assert_positive_int(R5_ARG3); address nooverlap_target = aligned ? STUB_ENTRY(arrayof_jint_disjoint_arraycopy) : STUB_ENTRY(jint_disjoint_arraycopy); @@ -1782,6 +1792,7 @@ class StubGenerator: public StubCodeGenerator { address generate_disjoint_long_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); + assert_positive_int(R5_ARG3); generate_disjoint_long_copy_core(aligned); __ li(R3_RET, 0); // return 0 __ blr(); @@ -1865,7 +1876,7 @@ class StubGenerator: public StubCodeGenerator { address generate_conjoint_long_copy(bool aligned, const char * name) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); - + assert_positive_int(R5_ARG3); address nooverlap_target = aligned ? STUB_ENTRY(arrayof_jlong_disjoint_arraycopy) : STUB_ENTRY(jlong_disjoint_arraycopy); @@ -1892,7 +1903,7 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); - + assert_positive_int(R5_ARG3); address nooverlap_target = aligned ? STUB_ENTRY(arrayof_oop_disjoint_arraycopy) : STUB_ENTRY(oop_disjoint_arraycopy); @@ -1929,7 +1940,7 @@ class StubGenerator: public StubCodeGenerator { address generate_disjoint_oop_copy(bool aligned, const char * name, bool dest_uninitialized) { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); - + assert_positive_int(R5_ARG3); gen_write_ref_array_pre_barrier(R3_ARG1, R4_ARG2, R5_ARG3, dest_uninitialized, R9_ARG7); // save some arguments, disjoint_long_copy_core destroys them. @@ -2003,7 +2014,24 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); - // TODO: Assert that int is 64 bit sign extended and arrays are not conjoint. + // Assert that int is 64 bit sign extended and arrays are not conjoint. +#ifdef ASSERT + { + assert_positive_int(R5_ARG3); + const Register tmp1 = R11_scratch1, tmp2 = R12_scratch2; + Label no_overlap; + __ subf(tmp1, R3_ARG1, R4_ARG2); // distance in bytes + __ sldi(tmp2, R5_ARG3, LogBytesPerHeapOop); // size in bytes + __ cmpld(CCR0, R3_ARG1, R4_ARG2); // Use unsigned comparison! + __ cmpld(CCR1, tmp1, tmp2); + __ crnand(CCR0, Assembler::less, CCR1, Assembler::less); + // Overlaps if Src before dst and distance smaller than size. + // Branch to forward copy routine otherwise. + __ blt(CCR0, no_overlap); + __ stop("overlap in checkcast_copy", 0x9543); + __ bind(no_overlap); + } +#endif gen_write_ref_array_pre_barrier(R3_from, R4_to, R5_count, dest_uninitialized, R12_tmp, /* preserve: */ R6_ckoff, R7_ckval); @@ -2452,12 +2480,14 @@ class StubGenerator: public StubCodeGenerator { STUB_ENTRY(checkcast_arraycopy)); // fill routines - StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill"); - StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill"); - StubRoutines::_jint_fill = generate_fill(T_INT, false, "jint_fill"); - StubRoutines::_arrayof_jbyte_fill = generate_fill(T_BYTE, true, "arrayof_jbyte_fill"); - StubRoutines::_arrayof_jshort_fill = generate_fill(T_SHORT, true, "arrayof_jshort_fill"); - StubRoutines::_arrayof_jint_fill = generate_fill(T_INT, true, "arrayof_jint_fill"); + if (OptimizeFill) { + StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill"); + StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill"); + StubRoutines::_jint_fill = generate_fill(T_INT, false, "jint_fill"); + StubRoutines::_arrayof_jbyte_fill = generate_fill(T_BYTE, true, "arrayof_jbyte_fill"); + StubRoutines::_arrayof_jshort_fill = generate_fill(T_SHORT, true, "arrayof_jshort_fill"); + StubRoutines::_arrayof_jint_fill = generate_fill(T_INT, true, "arrayof_jint_fill"); + } } // Safefetch stubs. @@ -2542,6 +2572,11 @@ class StubGenerator: public StubCodeGenerator { BLOCK_COMMENT("Entry:"); + // C2 does not respect int to long conversion for stub calls. + __ clrldi(xlen, xlen, 32); + __ clrldi(ylen, ylen, 32); + __ clrldi(zlen, zlen, 32); + // Save non-volatile regs (frameless). int current_offs = 8; __ std(R24, -current_offs, R1_SP); current_offs += 8; From f17b4db4548f7aad1f24b94e69e0aca7c176a9ae Mon Sep 17 00:00:00 2001 From: Sangheon Kim Date: Fri, 8 Jan 2016 08:51:18 -0800 Subject: [PATCH 035/212] 8146695: FinalizeTest04 crashes VM with EXCEPTION_INT_DIVIDE_BY_ZERO Reviewed-by: jwilhelm, jprovino --- hotspot/src/share/vm/gc/serial/defNewGeneration.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp index dae4e8a14c8..765a45c7358 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -375,7 +375,7 @@ size_t DefNewGeneration::adjust_for_thread_increase(size_t new_size_candidate, // 1. Check an overflow at 'threads_count * NewSizeThreadIncrease'. threads_count = Threads::number_of_non_daemon_threads(); - if (NewSizeThreadIncrease <= max_uintx / threads_count) { + if (threads_count > 0 && NewSizeThreadIncrease <= max_uintx / threads_count) { thread_increase_size = threads_count * NewSizeThreadIncrease; // 2. Check an overflow at 'new_size_candidate + thread_increase_size'. From 5be1924e8937ac777e939b106a6bc751800f9649 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Mon, 11 Jan 2016 14:23:35 +0100 Subject: [PATCH 036/212] 8146705: Improve JVMCI support for blocking compilation Reviewed-by: twisti, never, iveresov --- .../src/share/vm/compiler/compileBroker.cpp | 81 ++++++++++++++----- .../src/share/vm/compiler/compileBroker.hpp | 3 + hotspot/src/share/vm/compiler/compileTask.cpp | 1 + hotspot/src/share/vm/compiler/compileTask.hpp | 8 ++ .../vm/runtime/advancedThresholdPolicy.cpp | 18 ++++- .../share/vm/runtime/compilationPolicy.cpp | 22 ++++- .../share/vm/runtime/compilationPolicy.hpp | 2 + .../vm/runtime/simpleThresholdPolicy.cpp | 2 +- 8 files changed, 113 insertions(+), 24 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 41151324bec..98eafe35d8e 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -227,6 +227,11 @@ bool compileBroker_init() { CompileTaskWrapper::CompileTaskWrapper(CompileTask* task) { CompilerThread* thread = CompilerThread::current(); thread->set_task(task); +#if INCLUDE_JVMCI + if (task->is_blocking() && CompileBroker::compiler(task->comp_level())->is_jvmci()) { + task->set_jvmci_compiler_thread(thread); + } +#endif CompileLog* log = thread->log(); if (log != NULL) task->log_task_start(log); } @@ -245,10 +250,12 @@ CompileTaskWrapper::~CompileTaskWrapper() { MutexLocker notifier(task->lock(), thread); task->mark_complete(); #if INCLUDE_JVMCI - if (CompileBroker::compiler(task->comp_level())->is_jvmci() && - !task->has_waiter()) { - // The waiting thread timed out and thus did not free the task. - free_task = true; + if (CompileBroker::compiler(task->comp_level())->is_jvmci()) { + if (!task->has_waiter()) { + // The waiting thread timed out and thus did not free the task. + free_task = true; + } + task->set_jvmci_compiler_thread(NULL); } #endif if (!free_task) { @@ -1332,11 +1339,56 @@ CompileTask* CompileBroker::create_compile_task(CompileQueue* queue, return new_task; } -// 1 second should be long enough to complete most JVMCI compilations -// and not too long to stall a blocking JVMCI compilation that -// is trying to acquire a lock held by the app thread that submitted the -// compilation. -static const long BLOCKING_JVMCI_COMPILATION_TIMEOUT = 1000; +#if INCLUDE_JVMCI +// The number of milliseconds to wait before checking if the +// JVMCI compiler thread is blocked. +static const long BLOCKING_JVMCI_COMPILATION_WAIT_TIMESLICE = 500; + +// The number of successive times the above check is allowed to +// see a blocked JVMCI compiler thread before unblocking the +// thread waiting for the compilation to finish. +static const int BLOCKING_JVMCI_COMPILATION_WAIT_TO_UNBLOCK_ATTEMPTS = 5; + +/** + * Waits for a JVMCI compiler to complete a given task. This thread + * waits until either the task completes or it sees the JVMCI compiler + * thread is blocked for N consecutive milliseconds where N is + * BLOCKING_JVMCI_COMPILATION_WAIT_TIMESLICE * + * BLOCKING_JVMCI_COMPILATION_WAIT_TO_UNBLOCK_ATTEMPTS. + * + * @return true if this thread needs to free/recycle the task + */ +bool CompileBroker::wait_for_jvmci_completion(CompileTask* task, JavaThread* thread) { + MutexLocker waiter(task->lock(), thread); + int consecutively_blocked = 0; + while (task->lock()->wait(!Mutex::_no_safepoint_check_flag, BLOCKING_JVMCI_COMPILATION_WAIT_TIMESLICE)) { + CompilerThread* jvmci_compiler_thread = task->jvmci_compiler_thread(); + if (jvmci_compiler_thread != NULL) { + JavaThreadState state; + { + // A JVMCI compiler thread should not disappear at this point + // but let's be extra safe. + MutexLocker mu(Threads_lock, thread); + state = jvmci_compiler_thread->thread_state(); + } + if (state == _thread_blocked) { + if (++consecutively_blocked == BLOCKING_JVMCI_COMPILATION_WAIT_TO_UNBLOCK_ATTEMPTS) { + if (PrintCompilation) { + task->print(tty, "wait for blocking compilation timed out"); + } + break; + } + } else { + consecutively_blocked = 0; + } + } else { + // Still waiting on JVMCI compiler queue + } + } + task->clear_waiter(); + return task->is_complete(); +} +#endif /** * Wait for the compilation task to complete. @@ -1356,16 +1408,7 @@ void CompileBroker::wait_for_completion(CompileTask* task) { bool free_task; #if INCLUDE_JVMCI if (compiler(task->comp_level())->is_jvmci()) { - MutexLocker waiter(task->lock(), thread); - // No need to check if compilation has completed - just - // rely on the time out. The JVMCI compiler thread will - // recycle the CompileTask. - task->lock()->wait(!Mutex::_no_safepoint_check_flag, BLOCKING_JVMCI_COMPILATION_TIMEOUT); - // If the compilation completes while has_waiter is true then - // this thread is responsible for freeing the task. Otherwise - // the compiler thread will free the task. - task->clear_waiter(); - free_task = task->is_complete(); + free_task = wait_for_jvmci_completion(task, thread); } else #endif { diff --git a/hotspot/src/share/vm/compiler/compileBroker.hpp b/hotspot/src/share/vm/compiler/compileBroker.hpp index 448f1f8897d..d74646b8855 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.hpp +++ b/hotspot/src/share/vm/compiler/compileBroker.hpp @@ -233,6 +233,9 @@ class CompileBroker: AllStatic { const char* comment, bool blocking); static void wait_for_completion(CompileTask* task); +#if INCLUDE_JVMCI + static bool wait_for_jvmci_completion(CompileTask* task, JavaThread* thread); +#endif static void invoke_compiler_on_method(CompileTask* task); static void post_compile(CompilerThread* thread, CompileTask* task, EventCompilation& event, bool success, ciEnv* ci_env); diff --git a/hotspot/src/share/vm/compiler/compileTask.cpp b/hotspot/src/share/vm/compiler/compileTask.cpp index a0efba91365..a59aa55c5c4 100644 --- a/hotspot/src/share/vm/compiler/compileTask.cpp +++ b/hotspot/src/share/vm/compiler/compileTask.cpp @@ -91,6 +91,7 @@ void CompileTask::initialize(int compile_id, _osr_bci = osr_bci; _is_blocking = is_blocking; JVMCI_ONLY(_has_waiter = CompileBroker::compiler(comp_level)->is_jvmci();) + JVMCI_ONLY(_jvmci_compiler_thread = NULL;) _comp_level = comp_level; _num_inlined_bytecodes = 0; diff --git a/hotspot/src/share/vm/compiler/compileTask.hpp b/hotspot/src/share/vm/compiler/compileTask.hpp index 17f77b34dee..92f74dc569b 100644 --- a/hotspot/src/share/vm/compiler/compileTask.hpp +++ b/hotspot/src/share/vm/compiler/compileTask.hpp @@ -56,6 +56,8 @@ class CompileTask : public CHeapObj { bool _is_blocking; #if INCLUDE_JVMCI bool _has_waiter; + // Compiler thread for a blocking JVMCI compilation + CompilerThread* _jvmci_compiler_thread; #endif int _comp_level; int _num_inlined_bytecodes; @@ -92,6 +94,12 @@ class CompileTask : public CHeapObj { #if INCLUDE_JVMCI bool has_waiter() const { return _has_waiter; } void clear_waiter() { _has_waiter = false; } + CompilerThread* jvmci_compiler_thread() const { return _jvmci_compiler_thread; } + void set_jvmci_compiler_thread(CompilerThread* t) { + assert(is_blocking(), "must be"); + assert((t == NULL) != (_jvmci_compiler_thread == NULL), "must be"); + _jvmci_compiler_thread = t; + } #endif nmethodLocker* code_handle() const { return _code_handle; } diff --git a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp index 5d9a3096787..1d046e6abe0 100644 --- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp +++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp @@ -165,7 +165,7 @@ bool AdvancedThresholdPolicy::is_method_profiled(Method* method) { // Called with the queue locked and with at least one element CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) { #if INCLUDE_JVMCI - CompileTask *max_non_jvmci_task = NULL; + CompileTask *max_blocking_task = NULL; #endif CompileTask *max_task = NULL; Method* max_method = NULL; @@ -197,13 +197,25 @@ CompileTask* AdvancedThresholdPolicy::select_task(CompileQueue* compile_queue) { max_method = method; } } +#if INCLUDE_JVMCI + if (UseJVMCICompiler && task->is_blocking()) { + if (max_blocking_task == NULL || compare_methods(method, max_blocking_task->method())) { + max_blocking_task = task; + } + } +#endif task = next_task; } #if INCLUDE_JVMCI if (UseJVMCICompiler) { - if (max_non_jvmci_task != NULL) { - max_task = max_non_jvmci_task; + if (max_blocking_task != NULL) { + // In blocking compilation mode, the CompileBroker will make + // compilations submitted by a JVMCI compiler thread non-blocking. These + // compilations should be scheduled after all blocking compilations + // to service non-compiler related compilations sooner and reduce the + // chance of such compilations timing out. + max_task = max_blocking_task; max_method = max_task->method(); } } diff --git a/hotspot/src/share/vm/runtime/compilationPolicy.cpp b/hotspot/src/share/vm/runtime/compilationPolicy.cpp index d6c45d1247f..aa0333968e7 100644 --- a/hotspot/src/share/vm/runtime/compilationPolicy.cpp +++ b/hotspot/src/share/vm/runtime/compilationPolicy.cpp @@ -159,6 +159,26 @@ bool CompilationPolicy::is_compilation_enabled() { return !delay_compilation_during_startup() && CompileBroker::should_compile_new_jobs(); } +CompileTask* CompilationPolicy::select_task_helper(CompileQueue* compile_queue) { +#if INCLUDE_JVMCI + if (UseJVMCICompiler && !BackgroundCompilation) { + /* + * In blocking compilation mode, the CompileBroker will make + * compilations submitted by a JVMCI compiler thread non-blocking. These + * compilations should be scheduled after all blocking compilations + * to service non-compiler related compilations sooner and reduce the + * chance of such compilations timing out. + */ + for (CompileTask* task = compile_queue->first(); task != NULL; task = task->next()) { + if (task->is_blocking()) { + return task; + } + } + } +#endif + return compile_queue->first(); +} + #ifndef PRODUCT void CompilationPolicy::print_time() { tty->print_cr ("Accumulated compilationPolicy times:"); @@ -339,7 +359,7 @@ void NonTieredCompPolicy::disable_compilation(Method* method) { } CompileTask* NonTieredCompPolicy::select_task(CompileQueue* compile_queue) { - return compile_queue->first(); + return select_task_helper(compile_queue); } bool NonTieredCompPolicy::is_mature(Method* method) { diff --git a/hotspot/src/share/vm/runtime/compilationPolicy.hpp b/hotspot/src/share/vm/runtime/compilationPolicy.hpp index 054671a846d..ae2128adb30 100644 --- a/hotspot/src/share/vm/runtime/compilationPolicy.hpp +++ b/hotspot/src/share/vm/runtime/compilationPolicy.hpp @@ -58,6 +58,8 @@ public: static void set_policy(CompilationPolicy* policy) { _policy = policy; } static CompilationPolicy* policy() { return _policy; } + static CompileTask* select_task_helper(CompileQueue* compile_queue); + // Profiling elapsedTimer* accumulated_time() { return &_accumulated_time; } void print_time() PRODUCT_RETURN; diff --git a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp index db3c1cc1089..187d3b1e208 100644 --- a/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp +++ b/hotspot/src/share/vm/runtime/simpleThresholdPolicy.cpp @@ -168,7 +168,7 @@ void SimpleThresholdPolicy::handle_counter_overflow(Method* method) { // Called with the queue locked and with at least one element CompileTask* SimpleThresholdPolicy::select_task(CompileQueue* compile_queue) { - return compile_queue->first(); + return select_task_helper(compile_queue); } void SimpleThresholdPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) { From 631c143469584030d668c720d3f5d03fe81de97a Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Mon, 11 Jan 2016 16:33:27 +0100 Subject: [PATCH 037/212] 8145322: Code generated from unsafe loops can be slightly improved Improve code generated from checkIndex and unsafe loops Reviewed-by: kvn, thartmann --- hotspot/src/cpu/x86/vm/x86_32.ad | 2 + hotspot/src/cpu/x86/vm/x86_64.ad | 1 + hotspot/src/share/vm/opto/castnode.cpp | 62 +++++++++++++++++++++++++ hotspot/src/share/vm/opto/castnode.hpp | 1 + hotspot/src/share/vm/opto/cfgnode.cpp | 28 +++++------ hotspot/src/share/vm/opto/loopnode.cpp | 7 ++- hotspot/src/share/vm/opto/superword.cpp | 10 ++-- 7 files changed, 93 insertions(+), 18 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index a5b9804e7e5..42fdc0ee693 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -1009,6 +1009,7 @@ static int vec_stack_to_stack_helper(CodeBuffer *cbuf, bool do_size, int src_off __ vmovdqu(xmm0, Address(rsp, src_offset)); __ vmovdqu(Address(rsp, dst_offset), xmm0); __ vmovdqu(xmm0, Address(rsp, -32)); + break; case Op_VecZ: __ evmovdqul(Address(rsp, -64), xmm0, 2); __ evmovdqul(xmm0, Address(rsp, src_offset), 2); @@ -1049,6 +1050,7 @@ static int vec_stack_to_stack_helper(CodeBuffer *cbuf, bool do_size, int src_off "vmovdqu [rsp + #%d], xmm0\n\t" "vmovdqu xmm0, [rsp - #32]", src_offset, dst_offset); + break; case Op_VecZ: st->print("vmovdqu [rsp - #64], xmm0\t# 512-bit mem-mem spill\n\t" "vmovdqu xmm0, [rsp + #%d]\n\t" diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 96edd46cdc5..455354834ea 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -1079,6 +1079,7 @@ static void vec_stack_to_stack_helper(CodeBuffer *cbuf, int src_offset, __ vmovdqu(xmm0, Address(rsp, src_offset)); __ vmovdqu(Address(rsp, dst_offset), xmm0); __ vmovdqu(xmm0, Address(rsp, -32)); + break; case Op_VecZ: __ evmovdqul(Address(rsp, -64), xmm0, 2); __ evmovdqul(xmm0, Address(rsp, src_offset), 2); diff --git a/hotspot/src/share/vm/opto/castnode.cpp b/hotspot/src/share/vm/opto/castnode.cpp index fb2c99f70e4..e89144767e1 100644 --- a/hotspot/src/share/vm/opto/castnode.cpp +++ b/hotspot/src/share/vm/opto/castnode.cpp @@ -215,6 +215,68 @@ const Type *CastIINode::Value(PhaseTransform *phase) const { return res; } +Node *CastIINode::Ideal(PhaseGVN *phase, bool can_reshape) { + Node* progress = ConstraintCastNode::Ideal(phase, can_reshape); + if (progress != NULL) { + return progress; + } + + // transform: + // (CastII (AddI x const)) -> (AddI (CastII x) const) + // So the AddI has a chance to be optimized out + if (in(1)->Opcode() == Op_AddI) { + Node* in2 = in(1)->in(2); + const TypeInt* in2_t = phase->type(in2)->isa_int(); + if (in2_t != NULL && in2_t->singleton()) { + int in2_const = in2_t->_lo; + const TypeInt* current_type = _type->is_int(); + jlong new_lo_long = ((jlong)current_type->_lo) - in2_const; + jlong new_hi_long = ((jlong)current_type->_hi) - in2_const; + int new_lo = (int)new_lo_long; + int new_hi = (int)new_hi_long; + if (((jlong)new_lo) == new_lo_long && ((jlong)new_hi) == new_hi_long) { + Node* in1 = in(1)->in(1); + CastIINode* new_cast = (CastIINode*)clone(); + AddINode* new_add = (AddINode*)in(1)->clone(); + new_cast->set_type(TypeInt::make(new_lo, new_hi, current_type->_widen)); + new_cast->set_req(1, in1); + new_add->set_req(1, phase->transform(new_cast)); + return new_add; + } + } + } + // Similar to ConvI2LNode::Ideal() for the same reasons + if (can_reshape && !phase->C->major_progress()) { + const TypeInt* this_type = this->type()->is_int(); + const TypeInt* in_type = phase->type(in(1))->isa_int(); + if (in_type != NULL && this_type != NULL && + (in_type->_lo != this_type->_lo || + in_type->_hi != this_type->_hi)) { + int lo1 = this_type->_lo; + int hi1 = this_type->_hi; + int w1 = this_type->_widen; + + if (lo1 >= 0) { + // Keep a range assertion of >=0. + lo1 = 0; hi1 = max_jint; + } else if (hi1 < 0) { + // Keep a range assertion of <0. + lo1 = min_jint; hi1 = -1; + } else { + lo1 = min_jint; hi1 = max_jint; + } + const TypeInt* wtype = TypeInt::make(MAX2(in_type->_lo, lo1), + MIN2(in_type->_hi, hi1), + MAX2((int)in_type->_widen, w1)); + if (wtype != type()) { + set_type(wtype); + return this; + } + } + } + return NULL; +} + //============================================================================= //------------------------------Identity--------------------------------------- // If input is already higher or equal to cast type, then this is an identity. diff --git a/hotspot/src/share/vm/opto/castnode.hpp b/hotspot/src/share/vm/opto/castnode.hpp index 1d317d21047..79e5d919f0d 100644 --- a/hotspot/src/share/vm/opto/castnode.hpp +++ b/hotspot/src/share/vm/opto/castnode.hpp @@ -68,6 +68,7 @@ class CastIINode: public ConstraintCastNode { virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); }; //------------------------------CastPPNode------------------------------------- diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp index f1360ad1ad3..0a2d702a468 100644 --- a/hotspot/src/share/vm/opto/cfgnode.cpp +++ b/hotspot/src/share/vm/opto/cfgnode.cpp @@ -903,23 +903,25 @@ const Type *PhiNode::Value( PhaseTransform *phase ) const { return Type::TOP; // Check for trip-counted loop. If so, be smarter. - CountedLoopNode *l = r->is_CountedLoop() ? r->as_CountedLoop() : NULL; - if( l && l->can_be_counted_loop(phase) && - ((const Node*)l->phi() == this) ) { // Trip counted loop! + CountedLoopNode* l = r->is_CountedLoop() ? r->as_CountedLoop() : NULL; + if (l && l->can_be_counted_loop(phase) && + ((const Node*)l->phi() == this)) { // Trip counted loop! // protect against init_trip() or limit() returning NULL const Node *init = l->init_trip(); const Node *limit = l->limit(); - if( init != NULL && limit != NULL && l->stride_is_con() ) { - const TypeInt *lo = init ->bottom_type()->isa_int(); - const TypeInt *hi = limit->bottom_type()->isa_int(); - if( lo && hi ) { // Dying loops might have TOP here - int stride = l->stride_con(); - if( stride < 0 ) { // Down-counter loop - const TypeInt *tmp = lo; lo = hi; hi = tmp; - stride = -stride; + const Node* stride = l->stride(); + if (init != NULL && limit != NULL && stride != NULL) { + const TypeInt* lo = phase->type(init)->isa_int(); + const TypeInt* hi = phase->type(limit)->isa_int(); + const TypeInt* stride_t = phase->type(stride)->isa_int(); + if (lo != NULL && hi != NULL && stride_t != NULL) { // Dying loops might have TOP here + assert(stride_t->_hi >= stride_t->_lo, "bad stride type"); + if (stride_t->_hi < 0) { // Down-counter loop + swap(lo, hi); + return TypeInt::make(MIN2(lo->_lo, hi->_lo) , hi->_hi, 3); + } else if (stride_t->_lo >= 0) { + return TypeInt::make(lo->_lo, MAX2(lo->_hi, hi->_hi), 3); } - if( lo->_hi < hi->_lo ) // Reversed endpoints are well defined :-( - return TypeInt::make(lo->_lo,hi->_hi,3); } } } diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index 3faa0c2d319..19f67619b15 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -815,6 +815,11 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { C->print_method(PHASE_AFTER_CLOOPS, 3); + // Capture bounds of the loop in the induction variable Phi before + // subsequent transformation (iteration splitting) obscures the + // bounds + l->phi()->as_Phi()->set_type(l->phi()->Value(&_igvn)); + return true; } @@ -3483,7 +3488,7 @@ void PhaseIdealLoop::build_loop_late( VectorSet &visited, Node_List &worklist, N // Second pass finds latest legal placement, and ideal loop placement. void PhaseIdealLoop::build_loop_late_post( Node *n ) { - if (n->req() == 2 && n->Opcode() == Op_ConvI2L && !C->major_progress() && !_verify_only) { + if (n->req() == 2 && (n->Opcode() == Op_ConvI2L || n->Opcode() == Op_CastII) && !C->major_progress() && !_verify_only) { _igvn._worklist.push(n); // Maybe we'll normalize it, if no more loops. } diff --git a/hotspot/src/share/vm/opto/superword.cpp b/hotspot/src/share/vm/opto/superword.cpp index 67d27e35bf8..b0cd632d79e 100644 --- a/hotspot/src/share/vm/opto/superword.cpp +++ b/hotspot/src/share/vm/opto/superword.cpp @@ -3438,10 +3438,12 @@ bool SWPointer::offset_plus_k(Node* n, bool negate) { if (opc == Op_ConvI2L) { n = n->in(1); } - _negate_invar = negate; - _invar = n; - NOT_PRODUCT(_tracer.offset_plus_k_10(n, _invar, _negate_invar, _offset);) - return true; + if (n->bottom_type()->isa_int()) { + _negate_invar = negate; + _invar = n; + NOT_PRODUCT(_tracer.offset_plus_k_10(n, _invar, _negate_invar, _offset);) + return true; + } } NOT_PRODUCT(_tracer.offset_plus_k_11(n);) From dfa6539a6ae00b1d1d84366d8c9350671129a3cc Mon Sep 17 00:00:00 2001 From: Zoltan Majo Date: Tue, 12 Jan 2016 09:19:09 +0100 Subject: [PATCH 038/212] 8086053: Address inconsistencies regarding ZeroTLAB Add zero-initialization to C1 for fast TLAB refills; strenghten C2 conditions for skipping zero-initialization. Reviewed-by: kvn, thartmann --- .../cpu/sparc/vm/c1_MacroAssembler_sparc.cpp | 60 +++++---- .../cpu/sparc/vm/c1_MacroAssembler_sparc.hpp | 3 +- .../src/cpu/sparc/vm/c1_Runtime1_sparc.cpp | 8 +- .../src/cpu/sparc/vm/macroAssembler_sparc.cpp | 16 +++ .../src/cpu/sparc/vm/macroAssembler_sparc.hpp | 1 + .../src/cpu/x86/vm/c1_MacroAssembler_x86.cpp | 119 ++++++------------ .../src/cpu/x86/vm/c1_MacroAssembler_x86.hpp | 3 +- hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp | 8 +- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 66 +++++++++- hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp | 2 + .../vm/gc/shared/threadLocalAllocBuffer.cpp | 4 +- .../vm/gc/shared/threadLocalAllocBuffer.hpp | 4 +- hotspot/src/share/vm/opto/library_call.cpp | 2 +- hotspot/src/share/vm/opto/macro.cpp | 3 +- hotspot/src/share/vm/opto/macroArrayCopy.cpp | 2 +- hotspot/src/share/vm/opto/memnode.cpp | 4 +- hotspot/test/TEST.groups | 1 + .../memoryinitialization/ZeroTLABTest.java | 37 ++++++ 18 files changed, 215 insertions(+), 128 deletions(-) create mode 100644 hotspot/test/compiler/memoryinitialization/ZeroTLABTest.java diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp index 2e4bb6bac7d..fbd0e1ce6b4 100644 --- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp @@ -205,12 +205,7 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register void C1_MacroAssembler::initialize_body(Register base, Register index) { - assert_different_registers(base, index); - Label loop; - bind(loop); - subcc(index, HeapWordSize, index); - brx(Assembler::greaterEqual, true, Assembler::pt, loop); - delayed()->st_ptr(G0, base, index); + zero_memory(base, index); } @@ -237,7 +232,7 @@ void C1_MacroAssembler::allocate_object( } try_allocate(obj, noreg, obj_size * wordSize, t2, t3, slow_case); - initialize_object(obj, klass, noreg, obj_size * HeapWordSize, t1, t2); + initialize_object(obj, klass, noreg, obj_size * HeapWordSize, t1, t2, /* is_tlab_allocated */ UseTLAB); } void C1_MacroAssembler::initialize_object( @@ -246,7 +241,8 @@ void C1_MacroAssembler::initialize_object( Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise int con_size_in_bytes, // object size in bytes if known at compile time Register t1, // temp register - Register t2 // temp register + Register t2, // temp register + bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB ) { const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize; @@ -269,31 +265,33 @@ void C1_MacroAssembler::initialize_object( #endif - // initialize body - const int threshold = 5 * HeapWordSize; // approximate break even point for code size - if (var_size_in_bytes != noreg) { - // use a loop - add(obj, hdr_size_in_bytes, t1); // compute address of first element - sub(var_size_in_bytes, hdr_size_in_bytes, t2); // compute size of body - initialize_body(t1, t2); + if (!(UseTLAB && ZeroTLAB && is_tlab_allocated)) { + // initialize body + const int threshold = 5 * HeapWordSize; // approximate break even point for code size + if (var_size_in_bytes != noreg) { + // use a loop + add(obj, hdr_size_in_bytes, t1); // compute address of first element + sub(var_size_in_bytes, hdr_size_in_bytes, t2); // compute size of body + initialize_body(t1, t2); #ifndef _LP64 - } else if (con_size_in_bytes < threshold * 2) { - // on v9 we can do double word stores to fill twice as much space. - assert(hdr_size_in_bytes % 8 == 0, "double word aligned"); - assert(con_size_in_bytes % 8 == 0, "double word aligned"); - for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += 2 * HeapWordSize) stx(G0, obj, i); + } else if (con_size_in_bytes < threshold * 2) { + // on v9 we can do double word stores to fill twice as much space. + assert(hdr_size_in_bytes % 8 == 0, "double word aligned"); + assert(con_size_in_bytes % 8 == 0, "double word aligned"); + for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += 2 * HeapWordSize) stx(G0, obj, i); #endif - } else if (con_size_in_bytes <= threshold) { - // use explicit NULL stores - for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += HeapWordSize) st_ptr(G0, obj, i); - } else if (con_size_in_bytes > hdr_size_in_bytes) { - // use a loop - const Register base = t1; - const Register index = t2; - add(obj, hdr_size_in_bytes, base); // compute address of first element - // compute index = number of words to clear - set(con_size_in_bytes - hdr_size_in_bytes, index); - initialize_body(base, index); + } else if (con_size_in_bytes <= threshold) { + // use explicit NULL stores + for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += HeapWordSize) st_ptr(G0, obj, i); + } else if (con_size_in_bytes > hdr_size_in_bytes) { + // use a loop + const Register base = t1; + const Register index = t2; + add(obj, hdr_size_in_bytes, base); // compute address of first element + // compute index = number of words to clear + set(con_size_in_bytes - hdr_size_in_bytes, index); + initialize_body(base, index); + } } if (CURRENT_ENV->dtrace_alloc_probes()) { diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp index 492ca678d89..695ac7f4d27 100644 --- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.hpp @@ -50,7 +50,8 @@ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise int con_size_in_bytes, // object size in bytes if known at compile time Register t1, // temp register - Register t2 // temp register + Register t2, // temp register + bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB ); // allocation of fixed-size objects diff --git a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp index 45bfab26f45..283f260886d 100644 --- a/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp @@ -435,7 +435,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ tlab_allocate(O0_obj, G1_obj_size, 0, G3_t1, slow_path); - __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); + __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2, /* is_tlab_allocated */ true); __ verify_oop(O0_obj); __ mov(O0, I0); __ ret(); @@ -447,7 +447,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ eden_allocate(O0_obj, G1_obj_size, 0, G3_t1, G4_t2, slow_path); __ incr_allocated_bytes(G1_obj_size, G3_t1, G4_t2); - __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2); + __ initialize_object(O0_obj, G5_klass, G1_obj_size, 0, G3_t1, G4_t2, /* is_tlab_allocated */ false); __ verify_oop(O0_obj); __ mov(O0, I0); __ ret(); @@ -542,7 +542,9 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ ldub(klass_lh, G3_t1, klass_lh_header_size_offset); __ sub(G1_arr_size, G3_t1, O1_t2); // body length __ add(O0_obj, G3_t1, G3_t1); // body start - __ initialize_body(G3_t1, O1_t2); + if (!ZeroTLAB) { + __ initialize_body(G3_t1, O1_t2); + } __ verify_oop(O0_obj); __ retl(); __ delayed()->nop(); diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index b8b1bbf9ddf..5861f71c098 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -3459,11 +3459,27 @@ void MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case add(top, t1, top); // t1 is tlab_size sub(top, ThreadLocalAllocBuffer::alignment_reserve_in_bytes(), top); st_ptr(top, G2_thread, in_bytes(JavaThread::tlab_end_offset())); + + if (ZeroTLAB) { + // This is a fast TLAB refill, therefore the GC is not notified of it. + // So compiled code must fill the new TLAB with zeroes. + ld_ptr(G2_thread, in_bytes(JavaThread::tlab_start_offset()), t2); + zero_memory(t2, t1); + } verify_tlab(); ba(retry); delayed()->nop(); } +void MacroAssembler::zero_memory(Register base, Register index) { + assert_different_registers(base, index); + Label loop; + bind(loop); + subcc(index, HeapWordSize, index); + brx(Assembler::greaterEqual, true, Assembler::pt, loop); + delayed()->st_ptr(G0, base, index); +} + void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes, Register t1, Register t2) { // Bump total bytes allocated by this thread diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp index eb6188a3b9a..fe0c36ace97 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp @@ -1278,6 +1278,7 @@ public: Label& slow_case // continuation point if fast allocation fails ); void tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); + void zero_memory(Register base, Register index); void incr_allocated_bytes(RegisterOrConstant size_in_bytes, Register t1, Register t2); diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp index 76d160ac113..24cdaa46024 100644 --- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp @@ -182,54 +182,13 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register // preserves obj, destroys len_in_bytes void C1_MacroAssembler::initialize_body(Register obj, Register len_in_bytes, int hdr_size_in_bytes, Register t1) { + assert(hdr_size_in_bytes >= 0, "header size must be positive or 0"); Label done; - assert(obj != len_in_bytes && obj != t1 && t1 != len_in_bytes, "registers must be different"); - assert((hdr_size_in_bytes & (BytesPerWord - 1)) == 0, "header size is not a multiple of BytesPerWord"); - Register index = len_in_bytes; - // index is positive and ptr sized - subptr(index, hdr_size_in_bytes); - jcc(Assembler::zero, done); - // initialize topmost word, divide index by 2, check if odd and test if zero - // note: for the remaining code to work, index must be a multiple of BytesPerWord -#ifdef ASSERT - { Label L; - testptr(index, BytesPerWord - 1); - jcc(Assembler::zero, L); - stop("index is not a multiple of BytesPerWord"); - bind(L); - } -#endif - xorptr(t1, t1); // use _zero reg to clear memory (shorter code) - if (UseIncDec) { - shrptr(index, 3); // divide by 8/16 and set carry flag if bit 2 was set - } else { - shrptr(index, 2); // use 2 instructions to avoid partial flag stall - shrptr(index, 1); - } -#ifndef _LP64 - // index could have been not a multiple of 8 (i.e., bit 2 was set) - { Label even; - // note: if index was a multiple of 8, than it cannot - // be 0 now otherwise it must have been 0 before - // => if it is even, we don't need to check for 0 again - jcc(Assembler::carryClear, even); - // clear topmost word (no jump needed if conditional assignment would work here) - movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - 0*BytesPerWord), t1); - // index could be 0 now, need to check again - jcc(Assembler::zero, done); - bind(even); - } -#endif // !_LP64 - // initialize remaining object fields: rdx is a multiple of 2 now - { Label loop; - bind(loop); - movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - 1*BytesPerWord), t1); - NOT_LP64(movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - 2*BytesPerWord), t1);) - decrement(index); - jcc(Assembler::notZero, loop); - } - // done + // len_in_bytes is positive and ptr sized + subptr(len_in_bytes, hdr_size_in_bytes); + jcc(Assembler::zero, done); + zero_memory(obj, len_in_bytes, hdr_size_in_bytes, t1); bind(done); } @@ -241,47 +200,49 @@ void C1_MacroAssembler::allocate_object(Register obj, Register t1, Register t2, try_allocate(obj, noreg, object_size * BytesPerWord, t1, t2, slow_case); - initialize_object(obj, klass, noreg, object_size * HeapWordSize, t1, t2); + initialize_object(obj, klass, noreg, object_size * HeapWordSize, t1, t2, UseTLAB); } -void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2) { +void C1_MacroAssembler::initialize_object(Register obj, Register klass, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2, bool is_tlab_allocated) { assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0, "con_size_in_bytes is not multiple of alignment"); const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize; initialize_header(obj, klass, noreg, t1, t2); - // clear rest of allocated space - const Register t1_zero = t1; - const Register index = t2; - const int threshold = 6 * BytesPerWord; // approximate break even point for code size (see comments below) - if (var_size_in_bytes != noreg) { - mov(index, var_size_in_bytes); - initialize_body(obj, index, hdr_size_in_bytes, t1_zero); - } else if (con_size_in_bytes <= threshold) { - // use explicit null stores - // code size = 2 + 3*n bytes (n = number of fields to clear) - xorptr(t1_zero, t1_zero); // use t1_zero reg to clear memory (shorter code) - for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += BytesPerWord) - movptr(Address(obj, i), t1_zero); - } else if (con_size_in_bytes > hdr_size_in_bytes) { - // use loop to null out the fields - // code size = 16 bytes for even n (n = number of fields to clear) - // initialize last object field first if odd number of fields - xorptr(t1_zero, t1_zero); // use t1_zero reg to clear memory (shorter code) - movptr(index, (con_size_in_bytes - hdr_size_in_bytes) >> 3); - // initialize last object field if constant size is odd - if (((con_size_in_bytes - hdr_size_in_bytes) & 4) != 0) - movptr(Address(obj, con_size_in_bytes - (1*BytesPerWord)), t1_zero); - // initialize remaining object fields: rdx is a multiple of 2 - { Label loop; - bind(loop); - movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - (1*BytesPerWord)), - t1_zero); - NOT_LP64(movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - (2*BytesPerWord)), - t1_zero);) - decrement(index); - jcc(Assembler::notZero, loop); + if (!(UseTLAB && ZeroTLAB && is_tlab_allocated)) { + // clear rest of allocated space + const Register t1_zero = t1; + const Register index = t2; + const int threshold = 6 * BytesPerWord; // approximate break even point for code size (see comments below) + if (var_size_in_bytes != noreg) { + mov(index, var_size_in_bytes); + initialize_body(obj, index, hdr_size_in_bytes, t1_zero); + } else if (con_size_in_bytes <= threshold) { + // use explicit null stores + // code size = 2 + 3*n bytes (n = number of fields to clear) + xorptr(t1_zero, t1_zero); // use t1_zero reg to clear memory (shorter code) + for (int i = hdr_size_in_bytes; i < con_size_in_bytes; i += BytesPerWord) + movptr(Address(obj, i), t1_zero); + } else if (con_size_in_bytes > hdr_size_in_bytes) { + // use loop to null out the fields + // code size = 16 bytes for even n (n = number of fields to clear) + // initialize last object field first if odd number of fields + xorptr(t1_zero, t1_zero); // use t1_zero reg to clear memory (shorter code) + movptr(index, (con_size_in_bytes - hdr_size_in_bytes) >> 3); + // initialize last object field if constant size is odd + if (((con_size_in_bytes - hdr_size_in_bytes) & 4) != 0) + movptr(Address(obj, con_size_in_bytes - (1*BytesPerWord)), t1_zero); + // initialize remaining object fields: rdx is a multiple of 2 + { Label loop; + bind(loop); + movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - (1*BytesPerWord)), + t1_zero); + NOT_LP64(movptr(Address(obj, index, Address::times_8, hdr_size_in_bytes - (2*BytesPerWord)), + t1_zero);) + decrement(index); + jcc(Assembler::notZero, loop); + } } } diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp index 5695dad2251..829db55b196 100644 --- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.hpp @@ -65,7 +65,8 @@ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise int con_size_in_bytes, // object size in bytes if known at compile time Register t1, // temp register - Register t2 // temp register + Register t2, // temp register + bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB ); // allocation of fixed-size objects diff --git a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp index c977465cfc5..1d057e20adf 100644 --- a/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp @@ -1040,7 +1040,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ tlab_allocate(obj, obj_size, 0, t1, t2, slow_path); - __ initialize_object(obj, klass, obj_size, 0, t1, t2); + __ initialize_object(obj, klass, obj_size, 0, t1, t2, /* is_tlab_allocated */ true); __ verify_oop(obj); __ pop(rbx); __ pop(rdi); @@ -1053,7 +1053,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ eden_allocate(obj, obj_size, 0, t1, slow_path); __ incr_allocated_bytes(thread, obj_size, 0); - __ initialize_object(obj, klass, obj_size, 0, t1, t2); + __ initialize_object(obj, klass, obj_size, 0, t1, t2, /* is_tlab_allocated */ false); __ verify_oop(obj); __ pop(rbx); __ pop(rdi); @@ -1169,7 +1169,9 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ andptr(t1, Klass::_lh_header_size_mask); __ subptr(arr_size, t1); // body length __ addptr(t1, obj); // body start - __ initialize_body(t1, arr_size, 0, t2); + if (!ZeroTLAB) { + __ initialize_body(t1, arr_size, 0, t2); + } __ verify_oop(obj); __ ret(0); diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index a4f49e72e26..4aafe4a8341 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -5426,7 +5426,7 @@ Register MacroAssembler::tlab_refill(Label& retry, Label& try_eden, Label& slow_case) { Register top = rax; - Register t1 = rcx; + Register t1 = rcx; // object size Register t2 = rsi; Register thread_reg = NOT_LP64(rdi) LP64_ONLY(r15_thread); assert_different_registers(top, thread_reg, t1, t2, /* preserve: */ rbx, rdx); @@ -5522,12 +5522,76 @@ Register MacroAssembler::tlab_refill(Label& retry, addptr(top, t1); subptr(top, (int32_t)ThreadLocalAllocBuffer::alignment_reserve_in_bytes()); movptr(Address(thread_reg, in_bytes(JavaThread::tlab_end_offset())), top); + + if (ZeroTLAB) { + // This is a fast TLAB refill, therefore the GC is not notified of it. + // So compiled code must fill the new TLAB with zeroes. + movptr(top, Address(thread_reg, in_bytes(JavaThread::tlab_start_offset()))); + zero_memory(top, t1, 0, t2); + } + verify_tlab(); jmp(retry); return thread_reg; // for use by caller } +// Preserves the contents of address, destroys the contents length_in_bytes and temp. +void MacroAssembler::zero_memory(Register address, Register length_in_bytes, int offset_in_bytes, Register temp) { + assert(address != length_in_bytes && address != temp && temp != length_in_bytes, "registers must be different"); + assert((offset_in_bytes & (BytesPerWord - 1)) == 0, "offset must be a multiple of BytesPerWord"); + Label done; + + testptr(length_in_bytes, length_in_bytes); + jcc(Assembler::zero, done); + + // initialize topmost word, divide index by 2, check if odd and test if zero + // note: for the remaining code to work, index must be a multiple of BytesPerWord +#ifdef ASSERT + { + Label L; + testptr(length_in_bytes, BytesPerWord - 1); + jcc(Assembler::zero, L); + stop("length must be a multiple of BytesPerWord"); + bind(L); + } +#endif + Register index = length_in_bytes; + xorptr(temp, temp); // use _zero reg to clear memory (shorter code) + if (UseIncDec) { + shrptr(index, 3); // divide by 8/16 and set carry flag if bit 2 was set + } else { + shrptr(index, 2); // use 2 instructions to avoid partial flag stall + shrptr(index, 1); + } +#ifndef _LP64 + // index could have not been a multiple of 8 (i.e., bit 2 was set) + { + Label even; + // note: if index was a multiple of 8, then it cannot + // be 0 now otherwise it must have been 0 before + // => if it is even, we don't need to check for 0 again + jcc(Assembler::carryClear, even); + // clear topmost word (no jump would be needed if conditional assignment worked here) + movptr(Address(address, index, Address::times_8, offset_in_bytes - 0*BytesPerWord), temp); + // index could be 0 now, must check again + jcc(Assembler::zero, done); + bind(even); + } +#endif // !_LP64 + // initialize remaining object fields: index is a multiple of 2 now + { + Label loop; + bind(loop); + movptr(Address(address, index, Address::times_8, offset_in_bytes - 1*BytesPerWord), temp); + NOT_LP64(movptr(Address(address, index, Address::times_8, offset_in_bytes - 2*BytesPerWord), temp);) + decrement(index); + jcc(Assembler::notZero, loop); + } + + bind(done); +} + void MacroAssembler::incr_allocated_bytes(Register thread, Register var_size_in_bytes, int con_size_in_bytes, diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index da22ca32545..95931ad2b24 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -522,6 +522,8 @@ class MacroAssembler: public Assembler { Label& slow_case // continuation point if fast allocation fails ); Register tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); // returns TLS address + void zero_memory(Register address, Register length_in_bytes, int offset_in_bytes, Register temp); + void incr_allocated_bytes(Register thread, Register var_size_in_bytes, int con_size_in_bytes, Register t1 = noreg); diff --git a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp index 43389fb4613..d2b688ffc5b 100644 --- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp +++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp @@ -105,7 +105,7 @@ void ThreadLocalAllocBuffer::accumulate_statistics() { // an illusion of a contiguous Eden and optionally retires the tlab. // Waste accounting should be done in caller as appropriate; see, // for example, clear_before_allocation(). -void ThreadLocalAllocBuffer::make_parsable(bool retire) { +void ThreadLocalAllocBuffer::make_parsable(bool retire, bool zap) { if (end() != NULL) { invariants(); @@ -113,7 +113,7 @@ void ThreadLocalAllocBuffer::make_parsable(bool retire) { myThread()->incr_allocated_bytes(used_bytes()); } - CollectedHeap::fill_with_object(top(), hard_end(), retire); + CollectedHeap::fill_with_object(top(), hard_end(), retire && zap); if (retire || ZeroTLAB) { // "Reset" the TLAB set_start(NULL); diff --git a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp index eca56006510..2af19576191 100644 --- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp +++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp @@ -145,8 +145,8 @@ public: // Initialization at startup static void startup_initialization(); - // Make an in-use tlab parsable, optionally also retiring it. - void make_parsable(bool retire); + // Make an in-use tlab parsable, optionally retiring and/or zapping it. + void make_parsable(bool retire, bool zap = true); // Retire in-use tlab before allocation of a new tlab void clear_before_allocation(); diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index d4d2d563a88..97b511aa97e 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -3077,7 +3077,7 @@ bool LibraryCallKit::inline_native_isInterrupted() { set_control( _gvn.transform(new IfTrueNode(iff_arg))); #else // To return true on Windows you must read the _interrupted field - // and check the the event state i.e. take the slow path. + // and check the event state i.e. take the slow path. #endif // TARGET_OS_FAMILY_windows // (d) Otherwise, go to the slow path. diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp index 93c93b58206..a58a859c10d 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -1813,10 +1813,11 @@ PhaseMacroExpand::initialize_object(AllocateNode* alloc, // there can be two Allocates to one Initialize. The answer in all these // edge cases is safety first. It is always safe to clear immediately // within an Allocate, and then (maybe or maybe not) clear some more later. - if (!ZeroTLAB) + if (!(UseTLAB && ZeroTLAB)) { rawmem = ClearArrayNode::clear_memory(control, rawmem, object, header_size, size_in_bytes, &_igvn); + } } else { if (!init->is_complete()) { // Try to win by zeroing only what the init does not store. diff --git a/hotspot/src/share/vm/opto/macroArrayCopy.cpp b/hotspot/src/share/vm/opto/macroArrayCopy.cpp index 7e3279c68aa..82816b2462b 100644 --- a/hotspot/src/share/vm/opto/macroArrayCopy.cpp +++ b/hotspot/src/share/vm/opto/macroArrayCopy.cpp @@ -295,7 +295,7 @@ Node* PhaseMacroExpand::generate_arraycopy(ArrayCopyNode *ac, AllocateArrayNode* // out-edges of the dest, we need to avoid making derived pointers // from it until we have checked its uses.) if (ReduceBulkZeroing - && !ZeroTLAB // pointless if already zeroed + && !(UseTLAB && ZeroTLAB) // pointless if already zeroed && basic_elem_type != T_CONFLICT // avoid corner case && !src->eqv_uncast(dest) && alloc != NULL diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp index 2995b7dfade..c4eef2cfed5 100644 --- a/hotspot/src/share/vm/opto/memnode.cpp +++ b/hotspot/src/share/vm/opto/memnode.cpp @@ -3850,7 +3850,7 @@ Node* InitializeNode::complete_stores(Node* rawctl, Node* rawmem, Node* rawptr, bool do_zeroing = true; // we might give up if inits are very sparse int big_init_gaps = 0; // how many large gaps have we seen? - if (ZeroTLAB) do_zeroing = false; + if (UseTLAB && ZeroTLAB) do_zeroing = false; if (!ReduceFieldZeroing && !ReduceBulkZeroing) do_zeroing = false; for (uint i = InitializeNode::RawStores, limit = req(); i < limit; i++) { @@ -3951,7 +3951,7 @@ Node* InitializeNode::complete_stores(Node* rawctl, Node* rawmem, Node* rawptr, remove_extra_zeroes(); // clear out all the zmems left over add_req(inits); - if (!ZeroTLAB) { + if (!(UseTLAB && ZeroTLAB)) { // If anything remains to be zeroed, zero it all now. zeroes_done = align_size_down(zeroes_done, BytesPerInt); // if it is the last unused 4 bytes of an instance, forget about it diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index c0b6324416a..bcfd335f022 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -288,6 +288,7 @@ hotspot_compiler_3 = \ compiler/jsr292/ \ compiler/loopopts/ \ compiler/macronodes/ \ + compiler/memoryinitialization/ \ compiler/osr/ \ compiler/regalloc/ \ compiler/runtime/ \ diff --git a/hotspot/test/compiler/memoryinitialization/ZeroTLABTest.java b/hotspot/test/compiler/memoryinitialization/ZeroTLABTest.java new file mode 100644 index 00000000000..9be412a6db2 --- /dev/null +++ b/hotspot/test/compiler/memoryinitialization/ZeroTLABTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8086053 + * @run main/othervm -Xcomp -XX:+UseTLAB -XX:+ZeroTLAB ZeroTLABTest + * @run main/othervm -Xcomp -XX:+UseTLAB -XX:-ZeroTLAB ZeroTLABTest + * @run main/othervm -Xcomp -XX:-UseTLAB -XX:+ZeroTLAB ZeroTLABTest + * @run main/othervm -Xcomp -XX:-UseTLAB -XX:-ZeroTLAB ZeroTLABTest + */ +public class ZeroTLABTest { + public static void main(String args[]) { + System.out.println("Test PASSED"); + } +} From 1a8c7d97b12078e58134fd8b4d10f67f29fa1c67 Mon Sep 17 00:00:00 2001 From: Konstantin Shefov Date: Tue, 12 Jan 2016 13:57:48 +0300 Subject: [PATCH 039/212] 8141615: Add new public methods to sun.reflect.ConstantPool Reviewed-by: twisti, iignatyev, coleenp --- hotspot/make/share/makefiles/mapfile-vers | 4 ++ hotspot/src/share/vm/prims/jvm.cpp | 72 +++++++++++++++++++++++ hotspot/src/share/vm/prims/jvm.h | 14 ++++- 3 files changed, 89 insertions(+), 1 deletion(-) diff --git a/hotspot/make/share/makefiles/mapfile-vers b/hotspot/make/share/makefiles/mapfile-vers index 2085a98b459..28338d046f6 100644 --- a/hotspot/make/share/makefiles/mapfile-vers +++ b/hotspot/make/share/makefiles/mapfile-vers @@ -13,6 +13,7 @@ JVM_Clone; JVM_ConstantPoolGetClassAt; JVM_ConstantPoolGetClassAtIfLoaded; + JVM_ConstantPoolGetClassRefIndexAt; JVM_ConstantPoolGetDoubleAt; JVM_ConstantPoolGetFieldAt; JVM_ConstantPoolGetFieldAtIfLoaded; @@ -22,8 +23,11 @@ JVM_ConstantPoolGetMethodAt; JVM_ConstantPoolGetMethodAtIfLoaded; JVM_ConstantPoolGetMemberRefInfoAt; + JVM_ConstantPoolGetNameAndTypeRefInfoAt; + JVM_ConstantPoolGetNameAndTypeRefIndexAt; JVM_ConstantPoolGetSize; JVM_ConstantPoolGetStringAt; + JVM_ConstantPoolGetTagAt; JVM_ConstantPoolGetUTF8At; JVM_CountStackFrames; JVM_CurrentClassLoader; diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index afbb1daee44..8ec52313339 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -2104,6 +2104,56 @@ JVM_ENTRY(jobjectArray, JVM_ConstantPoolGetMemberRefInfoAt(JNIEnv *env, jobject } JVM_END +JVM_ENTRY(jint, JVM_ConstantPoolGetClassRefIndexAt(JNIEnv *env, jobject obj, jobject unused, jint index)) +{ + JVMWrapper("JVM_ConstantPoolGetClassRefIndexAt"); + JvmtiVMObjectAllocEventCollector oam; + constantPoolHandle cp(THREAD, sun_reflect_ConstantPool::get_cp(JNIHandles::resolve_non_null(obj))); + bounds_check(cp, index, CHECK_0); + constantTag tag = cp->tag_at(index); + if (!tag.is_field_or_method()) { + THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index"); + } + return (jint) cp->uncached_klass_ref_index_at(index); +} +JVM_END + +JVM_ENTRY(jint, JVM_ConstantPoolGetNameAndTypeRefIndexAt(JNIEnv *env, jobject obj, jobject unused, jint index)) +{ + JVMWrapper("JVM_ConstantPoolGetNameAndTypeRefIndexAt"); + JvmtiVMObjectAllocEventCollector oam; + constantPoolHandle cp(THREAD, sun_reflect_ConstantPool::get_cp(JNIHandles::resolve_non_null(obj))); + bounds_check(cp, index, CHECK_0); + constantTag tag = cp->tag_at(index); + if (!tag.is_invoke_dynamic() && !tag.is_field_or_method()) { + THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index"); + } + return (jint) cp->uncached_name_and_type_ref_index_at(index); +} +JVM_END + +JVM_ENTRY(jobjectArray, JVM_ConstantPoolGetNameAndTypeRefInfoAt(JNIEnv *env, jobject obj, jobject unused, jint index)) +{ + JVMWrapper("JVM_ConstantPoolGetNameAndTypeRefInfoAt"); + JvmtiVMObjectAllocEventCollector oam; + constantPoolHandle cp(THREAD, sun_reflect_ConstantPool::get_cp(JNIHandles::resolve_non_null(obj))); + bounds_check(cp, index, CHECK_NULL); + constantTag tag = cp->tag_at(index); + if (!tag.is_name_and_type()) { + THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "Wrong type at constant pool index"); + } + Symbol* member_name = cp->symbol_at(cp->name_ref_index_at(index)); + Symbol* member_sig = cp->symbol_at(cp->signature_ref_index_at(index)); + objArrayOop dest_o = oopFactory::new_objArray(SystemDictionary::String_klass(), 2, CHECK_NULL); + objArrayHandle dest(THREAD, dest_o); + Handle str = java_lang_String::create_from_symbol(member_name, CHECK_NULL); + dest->obj_at_put(0, str()); + str = java_lang_String::create_from_symbol(member_sig, CHECK_NULL); + dest->obj_at_put(1, str()); + return (jobjectArray) JNIHandles::make_local(dest()); +} +JVM_END + JVM_ENTRY(jint, JVM_ConstantPoolGetIntAt(JNIEnv *env, jobject obj, jobject unused, jint index)) { JVMWrapper("JVM_ConstantPoolGetIntAt"); @@ -2186,6 +2236,28 @@ JVM_ENTRY(jstring, JVM_ConstantPoolGetUTF8At(JNIEnv *env, jobject obj, jobject u } JVM_END +JVM_ENTRY(jbyte, JVM_ConstantPoolGetTagAt(JNIEnv *env, jobject obj, jobject unused, jint index)) +{ + JVMWrapper("JVM_ConstantPoolGetTagAt"); + constantPoolHandle cp = constantPoolHandle(THREAD, sun_reflect_ConstantPool::get_cp(JNIHandles::resolve_non_null(obj))); + bounds_check(cp, index, CHECK_0); + constantTag tag = cp->tag_at(index); + jbyte result = tag.value(); + // If returned tag values are not from the JVM spec, e.g. tags from 100 to 105, + // they are changed to the corresponding tags from the JVM spec, so that java code in + // sun.reflect.ConstantPool will return only tags from the JVM spec, not internal ones. + if (tag.is_klass_or_reference()) { + result = JVM_CONSTANT_Class; + } else if (tag.is_string_index()) { + result = JVM_CONSTANT_String; + } else if (tag.is_method_type_in_error()) { + result = JVM_CONSTANT_MethodType; + } else if (tag.is_method_handle_in_error()) { + result = JVM_CONSTANT_MethodHandle; + } + return result; +} +JVM_END // Assertion support. ////////////////////////////////////////////////////////// diff --git a/hotspot/src/share/vm/prims/jvm.h b/hotspot/src/share/vm/prims/jvm.h index 2e995cabf4d..af12c25bf1d 100644 --- a/hotspot/src/share/vm/prims/jvm.h +++ b/hotspot/src/share/vm/prims/jvm.h @@ -87,7 +87,7 @@ extern "C" { * class. */ -#define JVM_INTERFACE_VERSION 4 +#define JVM_INTERFACE_VERSION 5 JNIEXPORT jobjectArray JNICALL JVM_GetMethodParameters(JNIEnv *env, jobject method); @@ -532,6 +532,15 @@ JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt (JNIEnv *env, jobject obj, jobject unused, jint index); +JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetNameAndTypeRefInfoAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + +JNIEXPORT jint JNICALL JVM_ConstantPoolGetNameAndTypeRefIndexAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + +JNIEXPORT jint JNICALL JVM_ConstantPoolGetClassRefIndexAt +(JNIEnv *env, jobject obj, jobject unused, jint index); + JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt (JNIEnv *env, jobject obj, jobject unused, jint index); @@ -550,6 +559,9 @@ JNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At (JNIEnv *env, jobject obj, jobject unused, jint index); +JNIEXPORT jbyte JNICALL JVM_ConstantPoolGetTagAt +(JNIEnv *env, jobject unused, jobject jcpool, jint index); + /* * java.security.* */ From 69b52aa28be9054ea53bf9587ef7b563a658e510 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Tue, 12 Jan 2016 12:55:09 +0100 Subject: [PATCH 040/212] 8146629: Make phase->is_IterGVN() accessible from Node::Identity and Node::Value Change arguments of Node::Identity() and Node::Value() from PhaseTransform* to PhaseGVN*. Reviewed-by: kvn, roland --- hotspot/src/share/vm/opto/addnode.cpp | 16 +++---- hotspot/src/share/vm/opto/addnode.hpp | 20 ++++----- hotspot/src/share/vm/opto/callnode.cpp | 12 ++--- hotspot/src/share/vm/opto/callnode.hpp | 14 +++--- hotspot/src/share/vm/opto/castnode.cpp | 18 ++++---- hotspot/src/share/vm/opto/castnode.hpp | 18 ++++---- hotspot/src/share/vm/opto/cfgnode.cpp | 22 ++++----- hotspot/src/share/vm/opto/cfgnode.hpp | 26 +++++------ hotspot/src/share/vm/opto/convertnode.cpp | 50 ++++++++++----------- hotspot/src/share/vm/opto/convertnode.hpp | 50 ++++++++++----------- hotspot/src/share/vm/opto/countbitsnode.cpp | 8 ++-- hotspot/src/share/vm/opto/countbitsnode.hpp | 8 ++-- hotspot/src/share/vm/opto/divnode.cpp | 24 +++++----- hotspot/src/share/vm/opto/divnode.hpp | 28 ++++++------ hotspot/src/share/vm/opto/ifnode.cpp | 4 +- hotspot/src/share/vm/opto/intrinsicnode.cpp | 4 +- hotspot/src/share/vm/opto/intrinsicnode.hpp | 4 +- hotspot/src/share/vm/opto/locknode.hpp | 4 +- hotspot/src/share/vm/opto/loopnode.cpp | 4 +- hotspot/src/share/vm/opto/loopnode.hpp | 4 +- hotspot/src/share/vm/opto/machnode.cpp | 2 +- hotspot/src/share/vm/opto/machnode.hpp | 2 +- hotspot/src/share/vm/opto/mathexactnode.cpp | 4 +- hotspot/src/share/vm/opto/mathexactnode.hpp | 4 +- hotspot/src/share/vm/opto/memnode.cpp | 44 +++++++++--------- hotspot/src/share/vm/opto/memnode.hpp | 44 +++++++++--------- hotspot/src/share/vm/opto/movenode.cpp | 12 ++--- hotspot/src/share/vm/opto/movenode.hpp | 12 ++--- hotspot/src/share/vm/opto/mulnode.cpp | 34 +++++++------- hotspot/src/share/vm/opto/mulnode.hpp | 34 +++++++------- hotspot/src/share/vm/opto/multnode.cpp | 2 +- hotspot/src/share/vm/opto/multnode.hpp | 2 +- hotspot/src/share/vm/opto/narrowptrnode.cpp | 16 +++---- hotspot/src/share/vm/opto/narrowptrnode.hpp | 16 +++---- hotspot/src/share/vm/opto/node.cpp | 6 +-- hotspot/src/share/vm/opto/node.hpp | 6 +-- hotspot/src/share/vm/opto/opaquenode.cpp | 4 +- hotspot/src/share/vm/opto/opaquenode.hpp | 4 +- hotspot/src/share/vm/opto/rootnode.cpp | 2 +- hotspot/src/share/vm/opto/rootnode.hpp | 6 +-- hotspot/src/share/vm/opto/subnode.cpp | 22 ++++----- hotspot/src/share/vm/opto/subnode.hpp | 22 ++++----- 42 files changed, 319 insertions(+), 319 deletions(-) diff --git a/hotspot/src/share/vm/opto/addnode.cpp b/hotspot/src/share/vm/opto/addnode.cpp index de7356db4b9..416b9c35ff9 100644 --- a/hotspot/src/share/vm/opto/addnode.cpp +++ b/hotspot/src/share/vm/opto/addnode.cpp @@ -52,7 +52,7 @@ uint AddNode::hash() const { //------------------------------Identity--------------------------------------- // If either input is a constant 0, return the other input. -Node *AddNode::Identity( PhaseTransform *phase ) { +Node* AddNode::Identity(PhaseGVN* phase) { const Type *zero = add_id(); // The additive identity if( phase->type( in(1) )->higher_equal( zero ) ) return in(2); if( phase->type( in(2) )->higher_equal( zero ) ) return in(1); @@ -204,7 +204,7 @@ Node *AddNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value----------------------------------------- // An add node sums it's two _in. If one input is an RSD, we must mixin // the other input's symbols. -const Type *AddNode::Value( PhaseTransform *phase ) const { +const Type* AddNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -326,7 +326,7 @@ Node *AddINode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // Fold (x-y)+y OR y+(x-y) into x -Node *AddINode::Identity( PhaseTransform *phase ) { +Node* AddINode::Identity(PhaseGVN* phase) { if( in(1)->Opcode() == Op_SubI && phase->eqv(in(1)->in(2),in(2)) ) { return in(1)->in(1); } @@ -443,7 +443,7 @@ Node *AddLNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // Fold (x-y)+y OR y+(x-y) into x -Node *AddLNode::Identity( PhaseTransform *phase ) { +Node* AddLNode::Identity(PhaseGVN* phase) { if( in(1)->Opcode() == Op_SubL && phase->eqv(in(1)->in(2),in(2)) ) { return in(1)->in(1); } @@ -561,7 +561,7 @@ Node *AddDNode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Identity--------------------------------------- // If one input is a constant 0, return the other input. -Node *AddPNode::Identity( PhaseTransform *phase ) { +Node* AddPNode::Identity(PhaseGVN* phase) { return ( phase->type( in(Offset) )->higher_equal( TypeX_ZERO ) ) ? in(Address) : this; } @@ -659,7 +659,7 @@ const Type *AddPNode::bottom_type() const { } //------------------------------Value------------------------------------------ -const Type *AddPNode::Value( PhaseTransform *phase ) const { +const Type* AddPNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(Address) ); const Type *t2 = phase->type( in(Offset) ); @@ -733,7 +733,7 @@ uint AddPNode::match_edge(uint idx) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *OrINode::Identity( PhaseTransform *phase ) { +Node* OrINode::Identity(PhaseGVN* phase) { // x | x => x if (phase->eqv(in(1), in(2))) { return in(1); @@ -774,7 +774,7 @@ const Type *OrINode::add_ring( const Type *t0, const Type *t1 ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *OrLNode::Identity( PhaseTransform *phase ) { +Node* OrLNode::Identity(PhaseGVN* phase) { // x | x => x if (phase->eqv(in(1), in(2))) { return in(1); diff --git a/hotspot/src/share/vm/opto/addnode.hpp b/hotspot/src/share/vm/opto/addnode.hpp index 31aed490e78..8166050d228 100644 --- a/hotspot/src/share/vm/opto/addnode.hpp +++ b/hotspot/src/share/vm/opto/addnode.hpp @@ -47,7 +47,7 @@ public: // Handle algebraic identities here. If we have an identity, return the Node // we are equivalent to. We look for "add of zero" as an identity. - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // We also canonicalize the Node, moving constants to the right input, // and flatten expressions (so that 1+x+2 becomes x+3). @@ -55,7 +55,7 @@ public: // Compute a new Type for this node. Basically we just do the pre-check, // then call the virtual add() to set the type. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; // Check if this addition involves the additive identity virtual const Type *add_of_identity( const Type *t1, const Type *t2 ) const; @@ -80,7 +80,7 @@ public: virtual const Type *add_id() const { return TypeInt::ZERO; } virtual const Type *bottom_type() const { return TypeInt::INT; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegI; } }; @@ -94,7 +94,7 @@ public: virtual const Type *add_id() const { return TypeLong::ZERO; } virtual const Type *bottom_type() const { return TypeLong::LONG; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegL; } }; @@ -109,7 +109,7 @@ public: virtual const Type *add_ring( const Type *, const Type * ) const; virtual const Type *add_id() const { return TypeF::ZERO; } virtual const Type *bottom_type() const { return Type::FLOAT; } - virtual Node *Identity( PhaseTransform *phase ) { return this; } + virtual Node* Identity(PhaseGVN* phase) { return this; } virtual uint ideal_reg() const { return Op_RegF; } }; @@ -124,7 +124,7 @@ public: virtual const Type *add_ring( const Type *, const Type * ) const; virtual const Type *add_id() const { return TypeD::ZERO; } virtual const Type *bottom_type() const { return Type::DOUBLE; } - virtual Node *Identity( PhaseTransform *phase ) { return this; } + virtual Node* Identity(PhaseGVN* phase) { return this; } virtual uint ideal_reg() const { return Op_RegD; } }; @@ -142,9 +142,9 @@ public: init_class_id(Class_AddP); } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const; virtual uint ideal_reg() const { return Op_RegP; } Node *base_node() { assert( req() > Base, "Missing base"); return in(Base); } @@ -170,7 +170,7 @@ public: virtual const Type *add_ring( const Type *, const Type * ) const; virtual const Type *add_id() const { return TypeInt::ZERO; } virtual const Type *bottom_type() const { return TypeInt::INT; } - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegI; } }; @@ -184,7 +184,7 @@ public: virtual const Type *add_ring( const Type *, const Type * ) const; virtual const Type *add_id() const { return TypeLong::ZERO; } virtual const Type *bottom_type() const { return TypeLong::LONG; } - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegL; } }; diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp index ffdf6a2d29b..ffe97dc68ab 100644 --- a/hotspot/src/share/vm/opto/callnode.cpp +++ b/hotspot/src/share/vm/opto/callnode.cpp @@ -49,7 +49,7 @@ uint StartNode::size_of() const { return sizeof(*this); } uint StartNode::cmp( const Node &n ) const { return _domain == ((StartNode&)n)._domain; } const Type *StartNode::bottom_type() const { return _domain; } -const Type *StartNode::Value(PhaseTransform *phase) const { return _domain; } +const Type* StartNode::Value(PhaseGVN* phase) const { return _domain; } #ifndef PRODUCT void StartNode::dump_spec(outputStream *st) const { st->print(" #"); _domain->dump_on(st);} void StartNode::dump_compact_spec(outputStream *st) const { /* empty */ } @@ -173,7 +173,7 @@ Node *ReturnNode::Ideal(PhaseGVN *phase, bool can_reshape){ return remove_dead_region(phase, can_reshape) ? this : NULL; } -const Type *ReturnNode::Value( PhaseTransform *phase ) const { +const Type* ReturnNode::Value(PhaseGVN* phase) const { return ( phase->type(in(TypeFunc::Control)) == Type::TOP) ? Type::TOP : Type::BOTTOM; @@ -218,7 +218,7 @@ Node *RethrowNode::Ideal(PhaseGVN *phase, bool can_reshape){ return remove_dead_region(phase, can_reshape) ? this : NULL; } -const Type *RethrowNode::Value( PhaseTransform *phase ) const { +const Type* RethrowNode::Value(PhaseGVN* phase) const { return (phase->type(in(TypeFunc::Control)) == Type::TOP) ? Type::TOP : Type::BOTTOM; @@ -685,7 +685,7 @@ void CallNode::dump_spec(outputStream *st) const { #endif const Type *CallNode::bottom_type() const { return tf()->range(); } -const Type *CallNode::Value(PhaseTransform *phase) const { +const Type* CallNode::Value(PhaseGVN* phase) const { if (phase->type(in(0)) == Type::TOP) return Type::TOP; return tf()->range(); } @@ -1133,7 +1133,7 @@ Node *SafePointNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // Remove obviously duplicate safepoints -Node *SafePointNode::Identity( PhaseTransform *phase ) { +Node* SafePointNode::Identity(PhaseGVN* phase) { // If you have back to back safepoints, remove one if( in(TypeFunc::Control)->is_SafePoint() ) @@ -1156,7 +1156,7 @@ Node *SafePointNode::Identity( PhaseTransform *phase ) { } //------------------------------Value------------------------------------------ -const Type *SafePointNode::Value( PhaseTransform *phase ) const { +const Type* SafePointNode::Value(PhaseGVN* phase) const { if( phase->type(in(0)) == Type::TOP ) return Type::TOP; if( phase->eqv( in(0), this ) ) return Type::TOP; // Dead infinite loop return Type::CONTROL; diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp index cbe9d90e773..00979ae0d53 100644 --- a/hotspot/src/share/vm/opto/callnode.hpp +++ b/hotspot/src/share/vm/opto/callnode.hpp @@ -76,7 +76,7 @@ public: virtual bool pinned() const { return true; }; virtual const Type *bottom_type() const; virtual const TypePtr *adr_type() const { return TypePtr::BOTTOM; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual void calling_convention( BasicType* sig_bt, VMRegPair *parm_reg, uint length ) const; virtual const RegMask &in_RegMask(uint) const; @@ -127,7 +127,7 @@ public: virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash virtual bool depends_only_on_test() const { return false; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return NotAMachineReg; } virtual uint match_edge(uint idx) const; #ifndef PRODUCT @@ -148,7 +148,7 @@ class RethrowNode : public Node { virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash virtual bool depends_only_on_test() const { return false; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint match_edge(uint idx) const; virtual uint ideal_reg() const { return NotAMachineReg; } #ifndef PRODUCT @@ -465,11 +465,11 @@ public: // Standard Node stuff virtual int Opcode() const; virtual bool pinned() const { return true; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return Type::CONTROL; } virtual const TypePtr *adr_type() const { return _adr_type; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return 0; } virtual const RegMask &in_RegMask(uint) const; virtual const RegMask &out_RegMask() const; @@ -593,9 +593,9 @@ public: void set_generator(CallGenerator* cg) { _generator = cg; } virtual const Type *bottom_type() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ) { return this; } + virtual Node* Identity(PhaseGVN* phase) { return this; } virtual uint cmp( const Node &n ) const; virtual uint size_of() const = 0; virtual void calling_convention( BasicType* sig_bt, VMRegPair *parm_regs, uint argcnt ) const; diff --git a/hotspot/src/share/vm/opto/castnode.cpp b/hotspot/src/share/vm/opto/castnode.cpp index e89144767e1..8bcfe904724 100644 --- a/hotspot/src/share/vm/opto/castnode.cpp +++ b/hotspot/src/share/vm/opto/castnode.cpp @@ -34,7 +34,7 @@ //============================================================================= // If input is already higher or equal to cast type, then this is an identity. -Node *ConstraintCastNode::Identity(PhaseTransform *phase) { +Node* ConstraintCastNode::Identity(PhaseGVN* phase) { Node* dom = dominating_cast(phase); if (dom != NULL) { assert(_carry_dependency, "only for casts that carry a dependency"); @@ -48,7 +48,7 @@ Node *ConstraintCastNode::Identity(PhaseTransform *phase) { //------------------------------Value------------------------------------------ // Take 'join' of input and cast-up type -const Type *ConstraintCastNode::Value(PhaseTransform *phase) const { +const Type* ConstraintCastNode::Value(PhaseGVN* phase) const { if (in(0) && phase->type(in(0)) == Type::TOP) return Type::TOP; const Type* ft = phase->type(in(1))->filter_speculative(_type); @@ -149,7 +149,7 @@ void ConstraintCastNode::dump_spec(outputStream *st) const { } #endif -const Type *CastIINode::Value(PhaseTransform *phase) const { +const Type* CastIINode::Value(PhaseGVN* phase) const { const Type *res = ConstraintCastNode::Value(phase); // Try to improve the type of the CastII if we recognize a CmpI/If @@ -280,7 +280,7 @@ Node *CastIINode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Identity--------------------------------------- // If input is already higher or equal to cast type, then this is an identity. -Node *CheckCastPPNode::Identity( PhaseTransform *phase ) { +Node* CheckCastPPNode::Identity(PhaseGVN* phase) { Node* dom = dominating_cast(phase); if (dom != NULL) { assert(_carry_dependency, "only for casts that carry a dependency"); @@ -296,7 +296,7 @@ Node *CheckCastPPNode::Identity( PhaseTransform *phase ) { //------------------------------Value------------------------------------------ // Take 'join' of input and cast-up type, unless working with an Interface -const Type *CheckCastPPNode::Value( PhaseTransform *phase ) const { +const Type* CheckCastPPNode::Value(PhaseGVN* phase) const { if( in(0) && phase->type(in(0)) == Type::TOP ) return Type::TOP; const Type *inn = phase->type(in(1)); @@ -379,7 +379,7 @@ const Type *CheckCastPPNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *CastX2PNode::Value( PhaseTransform *phase ) const { +const Type* CastX2PNode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; if (t->base() == Type_X && t->singleton()) { @@ -443,14 +443,14 @@ Node *CastX2PNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Identity--------------------------------------- -Node *CastX2PNode::Identity( PhaseTransform *phase ) { +Node* CastX2PNode::Identity(PhaseGVN* phase) { if (in(1)->Opcode() == Op_CastP2X) return in(1)->in(1); return this; } //============================================================================= //------------------------------Value------------------------------------------ -const Type *CastP2XNode::Value( PhaseTransform *phase ) const { +const Type* CastP2XNode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; if (t->base() == Type::RawPtr && t->singleton()) { @@ -465,7 +465,7 @@ Node *CastP2XNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Identity--------------------------------------- -Node *CastP2XNode::Identity( PhaseTransform *phase ) { +Node* CastP2XNode::Identity(PhaseGVN* phase) { if (in(1)->Opcode() == Op_CastX2P) return in(1)->in(1); return this; } diff --git a/hotspot/src/share/vm/opto/castnode.hpp b/hotspot/src/share/vm/opto/castnode.hpp index 79e5d919f0d..0e024e8f409 100644 --- a/hotspot/src/share/vm/opto/castnode.hpp +++ b/hotspot/src/share/vm/opto/castnode.hpp @@ -44,8 +44,8 @@ class ConstraintCastNode: public TypeNode { init_class_id(Class_ConstraintCast); init_req(1, n); } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual int Opcode() const; virtual uint ideal_reg() const = 0; @@ -67,7 +67,7 @@ class CastIINode: public ConstraintCastNode { : ConstraintCastNode(n, t, carry_dependency) {} virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); }; @@ -92,8 +92,8 @@ class CheckCastPPNode: public ConstraintCastNode { init_req(0, c); } - virtual Node *Identity(PhaseTransform *phase); - virtual const Type *Value(PhaseTransform *phase) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegP; } }; @@ -105,9 +105,9 @@ class CastX2PNode : public Node { public: CastX2PNode( Node *n ) : Node(NULL, n) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegP; } virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; } }; @@ -119,9 +119,9 @@ class CastP2XNode : public Node { public: CastP2XNode( Node *ctrl, Node *n ) : Node(ctrl, n) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegX; } virtual const Type *bottom_type() const { return TypeX_X; } // Return false to keep node from moving away from an associated card mark. diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp index 0a2d702a468..b784c205701 100644 --- a/hotspot/src/share/vm/opto/cfgnode.cpp +++ b/hotspot/src/share/vm/opto/cfgnode.cpp @@ -48,7 +48,7 @@ //============================================================================= //------------------------------Value------------------------------------------ // Compute the type of the RegionNode. -const Type *RegionNode::Value( PhaseTransform *phase ) const { +const Type* RegionNode::Value(PhaseGVN* phase) const { for( uint i=1; itype(in(1)) : Type::TOP; @@ -1145,7 +1145,7 @@ Node* PhiNode::is_cmove_id(PhaseTransform* phase, int true_path) { //------------------------------Identity--------------------------------------- // Check for Region being Identity. -Node *PhiNode::Identity( PhaseTransform *phase ) { +Node* PhiNode::Identity(PhaseGVN* phase) { // Check for no merging going on // (There used to be special-case code here when this->region->is_Loop. // It would check for a tributary phi on the backedge that the main phi @@ -2069,13 +2069,13 @@ void PhiNode::dump_spec(outputStream *st) const { //============================================================================= -const Type *GotoNode::Value( PhaseTransform *phase ) const { +const Type* GotoNode::Value(PhaseGVN* phase) const { // If the input is reachable, then we are executed. // If the input is not reachable, then we are not executed. return phase->type(in(0)); } -Node *GotoNode::Identity( PhaseTransform *phase ) { +Node* GotoNode::Identity(PhaseGVN* phase) { return in(0); // Simple copy of incoming control } @@ -2137,7 +2137,7 @@ const Type *PCTableNode::bottom_type() const { //------------------------------Value------------------------------------------ // Compute the type of the PCTableNode. If reachable it is a tuple of // Control, otherwise the table targets are not reachable -const Type *PCTableNode::Value( PhaseTransform *phase ) const { +const Type* PCTableNode::Value(PhaseGVN* phase) const { if( phase->type(in(0)) == Type::CONTROL ) return bottom_type(); return Type::TOP; // All paths dead? Then so are we @@ -2182,7 +2182,7 @@ void JumpProjNode::related(GrowableArray *in_rel, GrowableArray *o //------------------------------Value------------------------------------------ // Check for being unreachable, or for coming from a Rethrow. Rethrow's cannot // have the default "fall_through_index" path. -const Type *CatchNode::Value( PhaseTransform *phase ) const { +const Type* CatchNode::Value(PhaseGVN* phase) const { // Unreachable? Then so are all paths from here. if( phase->type(in(0)) == Type::TOP ) return Type::TOP; // First assume all paths are reachable @@ -2226,7 +2226,7 @@ uint CatchProjNode::cmp( const Node &n ) const { //------------------------------Identity--------------------------------------- // If only 1 target is possible, choose it if it is the main control -Node *CatchProjNode::Identity( PhaseTransform *phase ) { +Node* CatchProjNode::Identity(PhaseGVN* phase) { // If my value is control and no other value is, then treat as ID const TypeTuple *t = phase->type(in(0))->is_tuple(); if (t->field_at(_con) != Type::CONTROL) return this; @@ -2269,7 +2269,7 @@ void CatchProjNode::dump_spec(outputStream *st) const { //============================================================================= //------------------------------Identity--------------------------------------- // Check for CreateEx being Identity. -Node *CreateExNode::Identity( PhaseTransform *phase ) { +Node* CreateExNode::Identity(PhaseGVN* phase) { if( phase->type(in(1)) == Type::TOP ) return in(1); if( phase->type(in(0)) == Type::TOP ) return in(0); // We only come from CatchProj, unless the CatchProj goes away. @@ -2285,7 +2285,7 @@ Node *CreateExNode::Identity( PhaseTransform *phase ) { //============================================================================= //------------------------------Value------------------------------------------ // Check for being unreachable. -const Type *NeverBranchNode::Value( PhaseTransform *phase ) const { +const Type* NeverBranchNode::Value(PhaseGVN* phase) const { if (!in(0) || in(0)->is_top()) return Type::TOP; return bottom_type(); } diff --git a/hotspot/src/share/vm/opto/cfgnode.hpp b/hotspot/src/share/vm/opto/cfgnode.hpp index b248c70846b..baea8b48450 100644 --- a/hotspot/src/share/vm/opto/cfgnode.hpp +++ b/hotspot/src/share/vm/opto/cfgnode.hpp @@ -91,8 +91,8 @@ public: virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash virtual bool depends_only_on_test() const { return false; } virtual const Type *bottom_type() const { return Type::CONTROL; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const RegMask &out_RegMask() const; bool try_clean_mem_phi(PhaseGVN *phase); @@ -205,8 +205,8 @@ public: type()->higher_equal(tp); } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const RegMask &out_RegMask() const; virtual const RegMask &in_RegMask(uint) const; @@ -234,8 +234,8 @@ public: virtual const Node *is_block_proj() const { return this; } virtual bool depends_only_on_test() const { return false; } virtual const Type *bottom_type() const { return Type::CONTROL; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual const RegMask &out_RegMask() const; #ifndef PRODUCT @@ -384,7 +384,7 @@ public: virtual bool pinned() const { return true; } virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual int required_outcnt() const { return 2; } virtual const RegMask &out_RegMask() const; Node* fold_compares(PhaseIterGVN* phase); @@ -418,7 +418,7 @@ public: class IfProjNode : public CProjNode { public: IfProjNode(IfNode *ifnode, uint idx) : CProjNode(ifnode,idx) {} - virtual Node *Identity(PhaseTransform *phase); + virtual Node* Identity(PhaseGVN* phase); protected: // Type of If input when this branch is always taken @@ -472,7 +472,7 @@ public: init_req(1, idx); } virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *bottom_type() const; virtual bool pinned() const { return true; } @@ -532,7 +532,7 @@ public: init_class_id(Class_Catch); } virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; // CatchProjNode controls which exception handler is targetted after a call. @@ -560,7 +560,7 @@ public: } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual const Type *bottom_type() const { return Type::CONTROL; } int handler_bci() const { return _handler_bci; } bool is_handler_proj() const { return _handler_bci >= 0; } @@ -579,7 +579,7 @@ public: init_req(1, i_o); } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual bool pinned() const { return true; } uint match_edge(uint idx) const { return 0; } virtual uint ideal_reg() const { return Op_RegP; } @@ -595,7 +595,7 @@ public: virtual int Opcode() const; virtual bool pinned() const { return true; }; virtual const Type *bottom_type() const { return TypeTuple::IFBOTH; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual int required_outcnt() const { return 2; } virtual void emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { } diff --git a/hotspot/src/share/vm/opto/convertnode.cpp b/hotspot/src/share/vm/opto/convertnode.cpp index 63a391abc97..7f72ea16344 100644 --- a/hotspot/src/share/vm/opto/convertnode.cpp +++ b/hotspot/src/share/vm/opto/convertnode.cpp @@ -32,7 +32,7 @@ //============================================================================= //------------------------------Identity--------------------------------------- -Node *Conv2BNode::Identity( PhaseTransform *phase ) { +Node* Conv2BNode::Identity(PhaseGVN* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); if( t == TypeInt::ZERO ) return in(1); @@ -42,7 +42,7 @@ Node *Conv2BNode::Identity( PhaseTransform *phase ) { } //------------------------------Value------------------------------------------ -const Type *Conv2BNode::Value( PhaseTransform *phase ) const { +const Type* Conv2BNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == TypeInt::ZERO ) return TypeInt::ZERO; @@ -64,7 +64,7 @@ const Type *Conv2BNode::Value( PhaseTransform *phase ) const { // The conversions operations are all Alpha sorted. Please keep it that way! //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvD2FNode::Value( PhaseTransform *phase ) const { +const Type* ConvD2FNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::DOUBLE ) return Type::FLOAT; @@ -75,13 +75,13 @@ const Type *ConvD2FNode::Value( PhaseTransform *phase ) const { //------------------------------Identity--------------------------------------- // Float's can be converted to doubles with no loss of bits. Hence // converting a float to a double and back to a float is a NOP. -Node *ConvD2FNode::Identity(PhaseTransform *phase) { +Node* ConvD2FNode::Identity(PhaseGVN* phase) { return (in(1)->Opcode() == Op_ConvF2D) ? in(1)->in(1) : this; } //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvD2INode::Value( PhaseTransform *phase ) const { +const Type* ConvD2INode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::DOUBLE ) return TypeInt::INT; @@ -100,13 +100,13 @@ Node *ConvD2INode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // Int's can be converted to doubles with no loss of bits. Hence // converting an integer to a double and back to an integer is a NOP. -Node *ConvD2INode::Identity(PhaseTransform *phase) { +Node* ConvD2INode::Identity(PhaseGVN* phase) { return (in(1)->Opcode() == Op_ConvI2D) ? in(1)->in(1) : this; } //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvD2LNode::Value( PhaseTransform *phase ) const { +const Type* ConvD2LNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::DOUBLE ) return TypeLong::LONG; @@ -115,7 +115,7 @@ const Type *ConvD2LNode::Value( PhaseTransform *phase ) const { } //------------------------------Identity--------------------------------------- -Node *ConvD2LNode::Identity(PhaseTransform *phase) { +Node* ConvD2LNode::Identity(PhaseGVN* phase) { // Remove ConvD2L->ConvL2D->ConvD2L sequences. if( in(1) ->Opcode() == Op_ConvL2D && in(1)->in(1)->Opcode() == Op_ConvD2L ) @@ -133,7 +133,7 @@ Node *ConvD2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvF2DNode::Value( PhaseTransform *phase ) const { +const Type* ConvF2DNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::FLOAT ) return Type::DOUBLE; @@ -143,7 +143,7 @@ const Type *ConvF2DNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvF2INode::Value( PhaseTransform *phase ) const { +const Type* ConvF2INode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::FLOAT ) return TypeInt::INT; @@ -152,7 +152,7 @@ const Type *ConvF2INode::Value( PhaseTransform *phase ) const { } //------------------------------Identity--------------------------------------- -Node *ConvF2INode::Identity(PhaseTransform *phase) { +Node* ConvF2INode::Identity(PhaseGVN* phase) { // Remove ConvF2I->ConvI2F->ConvF2I sequences. if( in(1) ->Opcode() == Op_ConvI2F && in(1)->in(1)->Opcode() == Op_ConvF2I ) @@ -170,7 +170,7 @@ Node *ConvF2INode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvF2LNode::Value( PhaseTransform *phase ) const { +const Type* ConvF2LNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::FLOAT ) return TypeLong::LONG; @@ -179,7 +179,7 @@ const Type *ConvF2LNode::Value( PhaseTransform *phase ) const { } //------------------------------Identity--------------------------------------- -Node *ConvF2LNode::Identity(PhaseTransform *phase) { +Node* ConvF2LNode::Identity(PhaseGVN* phase) { // Remove ConvF2L->ConvL2F->ConvF2L sequences. if( in(1) ->Opcode() == Op_ConvL2F && in(1)->in(1)->Opcode() == Op_ConvF2L ) @@ -197,7 +197,7 @@ Node *ConvF2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvI2DNode::Value( PhaseTransform *phase ) const { +const Type* ConvI2DNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeInt *ti = t->is_int(); @@ -207,7 +207,7 @@ const Type *ConvI2DNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvI2FNode::Value( PhaseTransform *phase ) const { +const Type* ConvI2FNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeInt *ti = t->is_int(); @@ -216,7 +216,7 @@ const Type *ConvI2FNode::Value( PhaseTransform *phase ) const { } //------------------------------Identity--------------------------------------- -Node *ConvI2FNode::Identity(PhaseTransform *phase) { +Node* ConvI2FNode::Identity(PhaseGVN* phase) { // Remove ConvI2F->ConvF2I->ConvI2F sequences. if( in(1) ->Opcode() == Op_ConvF2I && in(1)->in(1)->Opcode() == Op_ConvI2F ) @@ -226,7 +226,7 @@ Node *ConvI2FNode::Identity(PhaseTransform *phase) { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvI2LNode::Value( PhaseTransform *phase ) const { +const Type* ConvI2LNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeInt *ti = t->is_int(); @@ -390,7 +390,7 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvL2DNode::Value( PhaseTransform *phase ) const { +const Type* ConvL2DNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeLong *tl = t->is_long(); @@ -400,7 +400,7 @@ const Type *ConvL2DNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ConvL2FNode::Value( PhaseTransform *phase ) const { +const Type* ConvL2FNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeLong *tl = t->is_long(); @@ -410,14 +410,14 @@ const Type *ConvL2FNode::Value( PhaseTransform *phase ) const { //============================================================================= //----------------------------Identity----------------------------------------- -Node *ConvL2INode::Identity( PhaseTransform *phase ) { +Node* ConvL2INode::Identity(PhaseGVN* phase) { // Convert L2I(I2L(x)) => x if (in(1)->Opcode() == Op_ConvI2L) return in(1)->in(1); return this; } //------------------------------Value------------------------------------------ -const Type *ConvL2INode::Value( PhaseTransform *phase ) const { +const Type* ConvL2INode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeLong *tl = t->is_long(); @@ -469,7 +469,7 @@ Node *ConvL2INode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Identity--------------------------------------- // Remove redundant roundings -Node *RoundFloatNode::Identity( PhaseTransform *phase ) { +Node* RoundFloatNode::Identity(PhaseGVN* phase) { assert(Matcher::strict_fp_requires_explicit_rounding, "should only generate for Intel"); // Do not round constants if (phase->type(in(1))->base() == Type::FloatCon) return in(1); @@ -483,14 +483,14 @@ Node *RoundFloatNode::Identity( PhaseTransform *phase ) { } //------------------------------Value------------------------------------------ -const Type *RoundFloatNode::Value( PhaseTransform *phase ) const { +const Type* RoundFloatNode::Value(PhaseGVN* phase) const { return phase->type( in(1) ); } //============================================================================= //------------------------------Identity--------------------------------------- // Remove redundant roundings. Incoming arguments are already rounded. -Node *RoundDoubleNode::Identity( PhaseTransform *phase ) { +Node* RoundDoubleNode::Identity(PhaseGVN* phase) { assert(Matcher::strict_fp_requires_explicit_rounding, "should only generate for Intel"); // Do not round constants if (phase->type(in(1))->base() == Type::DoubleCon) return in(1); @@ -506,7 +506,7 @@ Node *RoundDoubleNode::Identity( PhaseTransform *phase ) { } //------------------------------Value------------------------------------------ -const Type *RoundDoubleNode::Value( PhaseTransform *phase ) const { +const Type* RoundDoubleNode::Value(PhaseGVN* phase) const { return phase->type( in(1) ); } diff --git a/hotspot/src/share/vm/opto/convertnode.hpp b/hotspot/src/share/vm/opto/convertnode.hpp index ff19db51e55..0a3e78b18dc 100644 --- a/hotspot/src/share/vm/opto/convertnode.hpp +++ b/hotspot/src/share/vm/opto/convertnode.hpp @@ -36,8 +36,8 @@ class Conv2BNode : public Node { Conv2BNode( Node *i ) : Node(0,i) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::BOOL; } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return Op_RegI; } }; @@ -49,8 +49,8 @@ class ConvD2FNode : public Node { ConvD2FNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::FLOAT; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegF; } }; @@ -61,8 +61,8 @@ class ConvD2INode : public Node { ConvD2INode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegI; } }; @@ -74,8 +74,8 @@ class ConvD2LNode : public Node { ConvD2LNode( Node *dbl ) : Node(0,dbl) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeLong::LONG; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegL; } }; @@ -87,7 +87,7 @@ class ConvF2DNode : public Node { ConvF2DNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::DOUBLE; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return Op_RegD; } }; @@ -98,8 +98,8 @@ class ConvF2INode : public Node { ConvF2INode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegI; } }; @@ -111,8 +111,8 @@ class ConvF2LNode : public Node { ConvF2LNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeLong::LONG; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegL; } }; @@ -124,7 +124,7 @@ class ConvI2DNode : public Node { ConvI2DNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::DOUBLE; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return Op_RegD; } }; @@ -135,8 +135,8 @@ class ConvI2FNode : public Node { ConvI2FNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::FLOAT; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual uint ideal_reg() const { return Op_RegF; } }; @@ -148,7 +148,7 @@ class ConvI2LNode : public TypeNode { : TypeNode(t, 2) { init_req(1, in1); } virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegL; } }; @@ -160,7 +160,7 @@ class ConvL2DNode : public Node { ConvL2DNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::DOUBLE; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return Op_RegD; } }; @@ -171,7 +171,7 @@ class ConvL2FNode : public Node { ConvL2FNode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::FLOAT; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const { return Op_RegF; } }; @@ -182,8 +182,8 @@ class ConvL2INode : public Node { ConvL2INode( Node *in1 ) : Node(0,in1) {} virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return Op_RegI; } }; @@ -195,8 +195,8 @@ class RoundFloatNode: public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; }; @@ -207,8 +207,8 @@ class RoundDoubleNode: public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; }; diff --git a/hotspot/src/share/vm/opto/countbitsnode.cpp b/hotspot/src/share/vm/opto/countbitsnode.cpp index 152c7699ca7..f9de303ffe4 100644 --- a/hotspot/src/share/vm/opto/countbitsnode.cpp +++ b/hotspot/src/share/vm/opto/countbitsnode.cpp @@ -29,7 +29,7 @@ #include "opto/type.hpp" //------------------------------Value------------------------------------------ -const Type* CountLeadingZerosINode::Value(PhaseTransform* phase) const { +const Type* CountLeadingZerosINode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; const TypeInt* ti = t->isa_int(); @@ -51,7 +51,7 @@ const Type* CountLeadingZerosINode::Value(PhaseTransform* phase) const { } //------------------------------Value------------------------------------------ -const Type* CountLeadingZerosLNode::Value(PhaseTransform* phase) const { +const Type* CountLeadingZerosLNode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; const TypeLong* tl = t->isa_long(); @@ -74,7 +74,7 @@ const Type* CountLeadingZerosLNode::Value(PhaseTransform* phase) const { } //------------------------------Value------------------------------------------ -const Type* CountTrailingZerosINode::Value(PhaseTransform* phase) const { +const Type* CountTrailingZerosINode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; const TypeInt* ti = t->isa_int(); @@ -96,7 +96,7 @@ const Type* CountTrailingZerosINode::Value(PhaseTransform* phase) const { } //------------------------------Value------------------------------------------ -const Type* CountTrailingZerosLNode::Value(PhaseTransform* phase) const { +const Type* CountTrailingZerosLNode::Value(PhaseGVN* phase) const { const Type* t = phase->type(in(1)); if (t == Type::TOP) return Type::TOP; const TypeLong* tl = t->isa_long(); diff --git a/hotspot/src/share/vm/opto/countbitsnode.hpp b/hotspot/src/share/vm/opto/countbitsnode.hpp index 0ead252ee89..1a8a65269ab 100644 --- a/hotspot/src/share/vm/opto/countbitsnode.hpp +++ b/hotspot/src/share/vm/opto/countbitsnode.hpp @@ -44,7 +44,7 @@ class CountLeadingZerosINode : public CountBitsNode { public: CountLeadingZerosINode(Node* in1) : CountBitsNode(in1) {} virtual int Opcode() const; - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //---------- CountLeadingZerosLNode -------------------------------------------- @@ -53,7 +53,7 @@ class CountLeadingZerosLNode : public CountBitsNode { public: CountLeadingZerosLNode(Node* in1) : CountBitsNode(in1) {} virtual int Opcode() const; - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //---------- CountTrailingZerosINode ------------------------------------------- @@ -62,7 +62,7 @@ class CountTrailingZerosINode : public CountBitsNode { public: CountTrailingZerosINode(Node* in1) : CountBitsNode(in1) {} virtual int Opcode() const; - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //---------- CountTrailingZerosLNode ------------------------------------------- @@ -71,7 +71,7 @@ class CountTrailingZerosLNode : public CountBitsNode { public: CountTrailingZerosLNode(Node* in1) : CountBitsNode(in1) {} virtual int Opcode() const; - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //---------- PopCountINode ----------------------------------------------------- diff --git a/hotspot/src/share/vm/opto/divnode.cpp b/hotspot/src/share/vm/opto/divnode.cpp index 002417d0f55..de839cc2c6b 100644 --- a/hotspot/src/share/vm/opto/divnode.cpp +++ b/hotspot/src/share/vm/opto/divnode.cpp @@ -457,7 +457,7 @@ static Node *transform_long_divide( PhaseGVN *phase, Node *dividend, jlong divis //============================================================================= //------------------------------Identity--------------------------------------- // If the divisor is 1, we are an identity on the dividend. -Node *DivINode::Identity( PhaseTransform *phase ) { +Node* DivINode::Identity(PhaseGVN* phase) { return (phase->type( in(2) )->higher_equal(TypeInt::ONE)) ? in(1) : this; } @@ -493,7 +493,7 @@ Node *DivINode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A DivINode divides its inputs. The third input is a Control input, used to // prevent hoisting the divide above an unsafe test. -const Type *DivINode::Value( PhaseTransform *phase ) const { +const Type* DivINode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -559,7 +559,7 @@ const Type *DivINode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- // If the divisor is 1, we are an identity on the dividend. -Node *DivLNode::Identity( PhaseTransform *phase ) { +Node* DivLNode::Identity(PhaseGVN* phase) { return (phase->type( in(2) )->higher_equal(TypeLong::ONE)) ? in(1) : this; } @@ -595,7 +595,7 @@ Node *DivLNode::Ideal( PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A DivLNode divides its inputs. The third input is a Control input, used to // prevent hoisting the divide above an unsafe test. -const Type *DivLNode::Value( PhaseTransform *phase ) const { +const Type* DivLNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -662,7 +662,7 @@ const Type *DivLNode::Value( PhaseTransform *phase ) const { //------------------------------Value------------------------------------------ // An DivFNode divides its inputs. The third input is a Control input, used to // prevent hoisting the divide above an unsafe test. -const Type *DivFNode::Value( PhaseTransform *phase ) const { +const Type* DivFNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -705,7 +705,7 @@ const Type *DivFNode::Value( PhaseTransform *phase ) const { //------------------------------isA_Copy--------------------------------------- // Dividing by self is 1. // If the divisor is 1, we are an identity on the dividend. -Node *DivFNode::Identity( PhaseTransform *phase ) { +Node* DivFNode::Identity(PhaseGVN* phase) { return (phase->type( in(2) ) == TypeF::ONE) ? in(1) : this; } @@ -750,7 +750,7 @@ Node *DivFNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // An DivDNode divides its inputs. The third input is a Control input, used to // prevent hoisting the divide above an unsafe test. -const Type *DivDNode::Value( PhaseTransform *phase ) const { +const Type* DivDNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -800,7 +800,7 @@ const Type *DivDNode::Value( PhaseTransform *phase ) const { //------------------------------isA_Copy--------------------------------------- // Dividing by self is 1. // If the divisor is 1, we are an identity on the dividend. -Node *DivDNode::Identity( PhaseTransform *phase ) { +Node* DivDNode::Identity(PhaseGVN* phase) { return (phase->type( in(2) ) == TypeD::ONE) ? in(1) : this; } @@ -972,7 +972,7 @@ Node *ModINode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type *ModINode::Value( PhaseTransform *phase ) const { +const Type* ModINode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -1145,7 +1145,7 @@ Node *ModLNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type *ModLNode::Value( PhaseTransform *phase ) const { +const Type* ModLNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -1186,7 +1186,7 @@ const Type *ModLNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ModFNode::Value( PhaseTransform *phase ) const { +const Type* ModFNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -1230,7 +1230,7 @@ const Type *ModFNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *ModDNode::Value( PhaseTransform *phase ) const { +const Type* ModDNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); diff --git a/hotspot/src/share/vm/opto/divnode.hpp b/hotspot/src/share/vm/opto/divnode.hpp index 195803e2000..b1bf06e6750 100644 --- a/hotspot/src/share/vm/opto/divnode.hpp +++ b/hotspot/src/share/vm/opto/divnode.hpp @@ -44,9 +44,9 @@ class DivINode : public Node { public: DivINode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor ) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } }; @@ -57,9 +57,9 @@ class DivLNode : public Node { public: DivLNode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor ) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } }; @@ -70,9 +70,9 @@ class DivFNode : public Node { public: DivFNode( Node *c, Node *dividend, Node *divisor ) : Node(c, dividend, divisor) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } }; @@ -83,9 +83,9 @@ class DivDNode : public Node { public: DivDNode( Node *c, Node *dividend, Node *divisor ) : Node(c,dividend, divisor) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } }; @@ -96,7 +96,7 @@ class ModINode : public Node { public: ModINode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } @@ -108,7 +108,7 @@ class ModLNode : public Node { public: ModLNode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } @@ -120,7 +120,7 @@ class ModFNode : public Node { public: ModFNode( Node *c, Node *in1, Node *in2 ) : Node(c,in1, in2) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } }; @@ -131,7 +131,7 @@ class ModDNode : public Node { public: ModDNode( Node *c, Node *in1, Node *in2 ) : Node(c, in1, in2) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } }; @@ -147,9 +147,9 @@ public: mod_proj_num = 1 // remainder }; virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ) { return this; } + virtual Node* Identity(PhaseGVN* phase) { return this; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape) { return NULL; } - virtual const Type *Value( PhaseTransform *phase ) const { return bottom_type(); } + virtual const Type* Value(PhaseGVN* phase) const { return bottom_type(); } virtual uint hash() const { return Node::hash(); } virtual bool is_CFG() const { return false; } virtual uint ideal_reg() const { return NotAMachineReg; } diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp index c8205690bb0..443de49f09a 100644 --- a/hotspot/src/share/vm/opto/ifnode.cpp +++ b/hotspot/src/share/vm/opto/ifnode.cpp @@ -45,7 +45,7 @@ extern int explicit_null_checks_elided; //============================================================================= //------------------------------Value------------------------------------------ // Return a tuple for whichever arm of the IF is reachable -const Type *IfNode::Value( PhaseTransform *phase ) const { +const Type* IfNode::Value(PhaseGVN* phase) const { if( !in(0) ) return Type::TOP; if( phase->type(in(0)) == Type::TOP ) return Type::TOP; @@ -1527,7 +1527,7 @@ Node* IfNode::search_identical(int dist) { //------------------------------Identity--------------------------------------- // If the test is constant & we match, then we are the input Control -Node *IfProjNode::Identity(PhaseTransform *phase) { +Node* IfProjNode::Identity(PhaseGVN* phase) { // Can only optimize if cannot go the other way const TypeTuple *t = phase->type(in(0))->is_tuple(); if (t == TypeTuple::IFNEITHER || diff --git a/hotspot/src/share/vm/opto/intrinsicnode.cpp b/hotspot/src/share/vm/opto/intrinsicnode.cpp index e72c3e221e1..064e73aab2c 100644 --- a/hotspot/src/share/vm/opto/intrinsicnode.cpp +++ b/hotspot/src/share/vm/opto/intrinsicnode.cpp @@ -55,7 +55,7 @@ Node* StrIntrinsicNode::Ideal(PhaseGVN* phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type* StrIntrinsicNode::Value(PhaseTransform* phase) const { +const Type* StrIntrinsicNode::Value(PhaseGVN* phase) const { if (in(0) && phase->type(in(0)) == Type::TOP) return Type::TOP; return bottom_type(); } @@ -93,7 +93,7 @@ Node* EncodeISOArrayNode::Ideal(PhaseGVN* phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type* EncodeISOArrayNode::Value(PhaseTransform* phase) const { +const Type* EncodeISOArrayNode::Value(PhaseGVN* phase) const { if (in(0) && phase->type(in(0)) == Type::TOP) return Type::TOP; return bottom_type(); } diff --git a/hotspot/src/share/vm/opto/intrinsicnode.hpp b/hotspot/src/share/vm/opto/intrinsicnode.hpp index d5bc0c70742..450638076b8 100644 --- a/hotspot/src/share/vm/opto/intrinsicnode.hpp +++ b/hotspot/src/share/vm/opto/intrinsicnode.hpp @@ -77,7 +77,7 @@ class StrIntrinsicNode: public Node { virtual uint match_edge(uint idx) const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; ArgEncoding encoding() const { return _encoding; } }; @@ -177,7 +177,7 @@ class EncodeISOArrayNode: public Node { virtual uint match_edge(uint idx) const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; }; #endif // SHARE_VM_OPTO_INTRINSICNODE_HPP diff --git a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp index 515a40c4663..b0e62ecef00 100644 --- a/hotspot/src/share/vm/opto/locknode.hpp +++ b/hotspot/src/share/vm/opto/locknode.hpp @@ -96,7 +96,7 @@ public: virtual uint size_of() const; virtual uint cmp( const Node &n ) const ; // Always fail, except on self virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const { return TypeInt::CC; } + virtual const Type* Value(PhaseGVN* phase) const { return TypeInt::CC; } const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;} void create_lock_counter(JVMState* s); @@ -123,7 +123,7 @@ public: virtual uint hash() const ; // { return NO_HASH; } virtual uint cmp( const Node &n ) const ; // Always fail, except on self virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const { return TypeInt::CC; } + virtual const Type* Value(PhaseGVN* phase) const { return TypeInt::CC; } const Type *sub(const Type *t1, const Type *t2) const { return TypeInt::CC;} }; diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index 19f67619b15..8996def6d6f 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -902,7 +902,7 @@ int CountedLoopEndNode::stride_con() const { //============================================================================= //------------------------------Value----------------------------------------- -const Type *LoopLimitNode::Value( PhaseTransform *phase ) const { +const Type* LoopLimitNode::Value(PhaseGVN* phase) const { const Type* init_t = phase->type(in(Init)); const Type* limit_t = phase->type(in(Limit)); const Type* stride_t = phase->type(in(Stride)); @@ -1016,7 +1016,7 @@ Node *LoopLimitNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // If stride == 1 return limit node. -Node *LoopLimitNode::Identity( PhaseTransform *phase ) { +Node* LoopLimitNode::Identity(PhaseGVN* phase) { int stride_con = phase->type(in(Stride))->is_int()->get_con(); if (stride_con == 1 || stride_con == -1) return in(Limit); diff --git a/hotspot/src/share/vm/opto/loopnode.hpp b/hotspot/src/share/vm/opto/loopnode.hpp index 59cfc690c7e..2e20eaf40b0 100644 --- a/hotspot/src/share/vm/opto/loopnode.hpp +++ b/hotspot/src/share/vm/opto/loopnode.hpp @@ -339,9 +339,9 @@ class LoopLimitNode : public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); }; // -----------------------------IdealLoopTree---------------------------------- diff --git a/hotspot/src/share/vm/opto/machnode.cpp b/hotspot/src/share/vm/opto/machnode.cpp index c4e6953ab9f..fc5b08625e5 100644 --- a/hotspot/src/share/vm/opto/machnode.cpp +++ b/hotspot/src/share/vm/opto/machnode.cpp @@ -652,7 +652,7 @@ const RegMask &MachSafePointNode::in_RegMask( uint idx ) const { uint MachCallNode::cmp( const Node &n ) const { return _tf == ((MachCallNode&)n)._tf; } const Type *MachCallNode::bottom_type() const { return tf()->range(); } -const Type *MachCallNode::Value(PhaseTransform *phase) const { return tf()->range(); } +const Type* MachCallNode::Value(PhaseGVN* phase) const { return tf()->range(); } #ifndef PRODUCT void MachCallNode::dump_spec(outputStream *st) const { diff --git a/hotspot/src/share/vm/opto/machnode.hpp b/hotspot/src/share/vm/opto/machnode.hpp index 25cbdc648e7..60bdc9b8768 100644 --- a/hotspot/src/share/vm/opto/machnode.hpp +++ b/hotspot/src/share/vm/opto/machnode.hpp @@ -863,7 +863,7 @@ public: virtual const Type *bottom_type() const; virtual bool pinned() const { return false; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const RegMask &in_RegMask(uint) const; virtual int ret_addr_offset() { return 0; } diff --git a/hotspot/src/share/vm/opto/mathexactnode.cpp b/hotspot/src/share/vm/opto/mathexactnode.cpp index 4c167d255a8..196dd343e06 100644 --- a/hotspot/src/share/vm/opto/mathexactnode.cpp +++ b/hotspot/src/share/vm/opto/mathexactnode.cpp @@ -247,11 +247,11 @@ Node* OverflowLNode::Ideal(PhaseGVN* phase, bool can_reshape) { return IdealHelper::Ideal(this, phase, can_reshape); } -const Type* OverflowINode::Value(PhaseTransform* phase) const { +const Type* OverflowINode::Value(PhaseGVN* phase) const { return IdealHelper::Value(this, phase); } -const Type* OverflowLNode::Value(PhaseTransform* phase) const { +const Type* OverflowLNode::Value(PhaseGVN* phase) const { return IdealHelper::Value(this, phase); } diff --git a/hotspot/src/share/vm/opto/mathexactnode.hpp b/hotspot/src/share/vm/opto/mathexactnode.hpp index 3e037cf568b..0c948e3dc34 100644 --- a/hotspot/src/share/vm/opto/mathexactnode.hpp +++ b/hotspot/src/share/vm/opto/mathexactnode.hpp @@ -48,7 +48,7 @@ public: OverflowINode(Node* in1, Node* in2) : OverflowNode(in1, in2) {} virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual bool will_overflow(jint v1, jint v2) const = 0; virtual bool can_overflow(const Type* t1, const Type* t2) const = 0; @@ -61,7 +61,7 @@ public: OverflowLNode(Node* in1, Node* in2) : OverflowNode(in1, in2) {} virtual Node* Ideal(PhaseGVN* phase, bool can_reshape); - virtual const Type* Value(PhaseTransform* phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual bool will_overflow(jlong v1, jlong v2) const = 0; virtual bool can_overflow(const Type* t1, const Type* t2) const = 0; diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp index c4eef2cfed5..44483491a9e 100644 --- a/hotspot/src/share/vm/opto/memnode.cpp +++ b/hotspot/src/share/vm/opto/memnode.cpp @@ -1069,7 +1069,7 @@ bool LoadNode::is_instance_field_load_with_local_phi(Node* ctrl) { //------------------------------Identity--------------------------------------- // Loads are identity if previous store is to same address -Node *LoadNode::Identity( PhaseTransform *phase ) { +Node* LoadNode::Identity(PhaseGVN* phase) { // If the previous store-maker is the right kind of Store, and the store is // to the same address, then we are equal to the value stored. Node* mem = in(Memory); @@ -1615,7 +1615,7 @@ static const Type* fold_stable_ary_elem(const TypeAryPtr* ary, int off, BasicTyp } //------------------------------Value----------------------------------------- -const Type *LoadNode::Value( PhaseTransform *phase ) const { +const Type* LoadNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP Node* mem = in(MemNode::Memory); const Type *t1 = phase->type(mem); @@ -1901,7 +1901,7 @@ Node *LoadBNode::Ideal(PhaseGVN *phase, bool can_reshape) { return LoadNode::Ideal(phase, can_reshape); } -const Type* LoadBNode::Value(PhaseTransform *phase) const { +const Type* LoadBNode::Value(PhaseGVN* phase) const { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); if (value != NULL && value->is_Con() && @@ -1931,7 +1931,7 @@ Node* LoadUBNode::Ideal(PhaseGVN* phase, bool can_reshape) { return LoadNode::Ideal(phase, can_reshape); } -const Type* LoadUBNode::Value(PhaseTransform *phase) const { +const Type* LoadUBNode::Value(PhaseGVN* phase) const { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); if (value != NULL && value->is_Con() && @@ -1961,7 +1961,7 @@ Node *LoadUSNode::Ideal(PhaseGVN *phase, bool can_reshape) { return LoadNode::Ideal(phase, can_reshape); } -const Type* LoadUSNode::Value(PhaseTransform *phase) const { +const Type* LoadUSNode::Value(PhaseGVN* phase) const { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); if (value != NULL && value->is_Con() && @@ -1993,7 +1993,7 @@ Node *LoadSNode::Ideal(PhaseGVN *phase, bool can_reshape) { return LoadNode::Ideal(phase, can_reshape); } -const Type* LoadSNode::Value(PhaseTransform *phase) const { +const Type* LoadSNode::Value(PhaseGVN* phase) const { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); if (value != NULL && value->is_Con() && @@ -2026,7 +2026,7 @@ Node* LoadKlassNode::make(PhaseGVN& gvn, Node* ctl, Node* mem, Node* adr, const } //------------------------------Value------------------------------------------ -const Type *LoadKlassNode::Value( PhaseTransform *phase ) const { +const Type* LoadKlassNode::Value(PhaseGVN* phase) const { return klass_value_common(phase); } @@ -2036,7 +2036,7 @@ bool LoadKlassNode::can_remove_control() const { return false; } -const Type *LoadNode::klass_value_common( PhaseTransform *phase ) const { +const Type* LoadNode::klass_value_common(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(MemNode::Memory) ); if (t1 == Type::TOP) return Type::TOP; @@ -2172,11 +2172,11 @@ const Type *LoadNode::klass_value_common( PhaseTransform *phase ) const { //------------------------------Identity--------------------------------------- // To clean up reflective code, simplify k.java_mirror.as_klass to plain k. // Also feed through the klass in Allocate(...klass...)._klass. -Node* LoadKlassNode::Identity( PhaseTransform *phase ) { +Node* LoadKlassNode::Identity(PhaseGVN* phase) { return klass_identity_common(phase); } -Node* LoadNode::klass_identity_common(PhaseTransform *phase ) { +Node* LoadNode::klass_identity_common(PhaseGVN* phase) { Node* x = LoadNode::Identity(phase); if (x != this) return x; @@ -2231,7 +2231,7 @@ Node* LoadNode::klass_identity_common(PhaseTransform *phase ) { //------------------------------Value------------------------------------------ -const Type *LoadNKlassNode::Value( PhaseTransform *phase ) const { +const Type* LoadNKlassNode::Value(PhaseGVN* phase) const { const Type *t = klass_value_common(phase); if (t == Type::TOP) return t; @@ -2242,7 +2242,7 @@ const Type *LoadNKlassNode::Value( PhaseTransform *phase ) const { //------------------------------Identity--------------------------------------- // To clean up reflective code, simplify k.java_mirror.as_klass to narrow k. // Also feed through the klass in Allocate(...klass...)._klass. -Node* LoadNKlassNode::Identity( PhaseTransform *phase ) { +Node* LoadNKlassNode::Identity(PhaseGVN* phase) { Node *x = klass_identity_common(phase); const Type *t = phase->type( x ); @@ -2254,7 +2254,7 @@ Node* LoadNKlassNode::Identity( PhaseTransform *phase ) { } //------------------------------Value----------------------------------------- -const Type *LoadRangeNode::Value( PhaseTransform *phase ) const { +const Type* LoadRangeNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(MemNode::Memory) ); if( t1 == Type::TOP ) return Type::TOP; @@ -2302,7 +2302,7 @@ Node *LoadRangeNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Identity--------------------------------------- // Feed through the length in AllocateArray(...length...)._length. -Node* LoadRangeNode::Identity( PhaseTransform *phase ) { +Node* LoadRangeNode::Identity(PhaseGVN* phase) { Node* x = LoadINode::Identity(phase); if (x != this) return x; @@ -2473,7 +2473,7 @@ Node *StoreNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value----------------------------------------- -const Type *StoreNode::Value( PhaseTransform *phase ) const { +const Type* StoreNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(MemNode::Memory) ); if( t1 == Type::TOP ) return Type::TOP; @@ -2488,7 +2488,7 @@ const Type *StoreNode::Value( PhaseTransform *phase ) const { // Remove redundant stores: // Store(m, p, Load(m, p)) changes to m. // Store(, p, x) -> Store(m, p, x) changes to Store(m, p, x). -Node *StoreNode::Identity( PhaseTransform *phase ) { +Node* StoreNode::Identity(PhaseGVN* phase) { Node* mem = in(MemNode::Memory); Node* adr = in(MemNode::Address); Node* val = in(MemNode::ValueIn); @@ -2642,7 +2642,7 @@ Node *StoreCNode::Ideal(PhaseGVN *phase, bool can_reshape){ //============================================================================= //------------------------------Identity--------------------------------------- -Node *StoreCMNode::Identity( PhaseTransform *phase ) { +Node* StoreCMNode::Identity(PhaseGVN* phase) { // No need to card mark when storing a null ptr Node* my_store = in(MemNode::OopStore); if (my_store->is_Store()) { @@ -2671,7 +2671,7 @@ Node *StoreCMNode::Ideal(PhaseGVN *phase, bool can_reshape){ } //------------------------------Value----------------------------------------- -const Type *StoreCMNode::Value( PhaseTransform *phase ) const { +const Type* StoreCMNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t = phase->type( in(MemNode::Memory) ); if( t == Type::TOP ) return Type::TOP; @@ -2689,7 +2689,7 @@ const Type *StoreCMNode::Value( PhaseTransform *phase ) const { //============================================================================= //----------------------------------SCMemProjNode------------------------------ -const Type * SCMemProjNode::Value( PhaseTransform *phase ) const +const Type* SCMemProjNode::Value(PhaseGVN* phase) const { return bottom_type(); } @@ -2745,7 +2745,7 @@ uint ClearArrayNode::match_edge(uint idx) const { //------------------------------Identity--------------------------------------- // Clearing a zero length array does nothing -Node *ClearArrayNode::Identity( PhaseTransform *phase ) { +Node* ClearArrayNode::Identity(PhaseGVN* phase) { return phase->type(in(2))->higher_equal(TypeX::ZERO) ? in(1) : this; } @@ -3001,7 +3001,7 @@ Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type *MemBarNode::Value( PhaseTransform *phase ) const { +const Type* MemBarNode::Value(PhaseGVN* phase) const { if( !in(0) ) return Type::TOP; if( phase->type(in(0)) == Type::TOP ) return Type::TOP; @@ -4143,7 +4143,7 @@ uint MergeMemNode::cmp( const Node &n ) const { } //------------------------------Identity--------------------------------------- -Node* MergeMemNode::Identity(PhaseTransform *phase) { +Node* MergeMemNode::Identity(PhaseGVN* phase) { // Identity if this merge point does not record any interesting memory // disambiguations. Node* base_mem = base_memory(); diff --git a/hotspot/src/share/vm/opto/memnode.hpp b/hotspot/src/share/vm/opto/memnode.hpp index cab41bcdf0d..994b782dfbb 100644 --- a/hotspot/src/share/vm/opto/memnode.hpp +++ b/hotspot/src/share/vm/opto/memnode.hpp @@ -207,7 +207,7 @@ public: // Handle algebraic identities here. If we have an identity, return the Node // we are equivalent to. We look for Load of a Store. - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // If the load is from Field memory and the pointer is non-null, it might be possible to // zero out the control input. @@ -223,11 +223,11 @@ public: // Compute a new Type for this node. Basically we just do the pre-check, // then call the virtual add() to set the type. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; // Common methods for LoadKlass and LoadNKlass nodes. - const Type *klass_value_common( PhaseTransform *phase ) const; - Node *klass_identity_common( PhaseTransform *phase ); + const Type* klass_value_common(PhaseGVN* phase) const; + Node* klass_identity_common(PhaseGVN* phase); virtual uint ideal_reg() const; virtual const Type *bottom_type() const; @@ -284,7 +284,7 @@ public: virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value(PhaseTransform *phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual int store_Opcode() const { return Op_StoreB; } virtual BasicType memory_type() const { return T_BYTE; } }; @@ -298,7 +298,7 @@ public: virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node* Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value(PhaseTransform *phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual int store_Opcode() const { return Op_StoreB; } virtual BasicType memory_type() const { return T_BYTE; } }; @@ -312,7 +312,7 @@ public: virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value(PhaseTransform *phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual int store_Opcode() const { return Op_StoreC; } virtual BasicType memory_type() const { return T_CHAR; } }; @@ -326,7 +326,7 @@ public: virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value(PhaseTransform *phase) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual int store_Opcode() const { return Op_StoreC; } virtual BasicType memory_type() const { return T_SHORT; } }; @@ -350,8 +350,8 @@ public: LoadRangeNode(Node *c, Node *mem, Node *adr, const TypeInt *ti = TypeInt::POS) : LoadINode(c, mem, adr, TypeAryPtr::RANGE, ti, MemNode::unordered) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); }; @@ -483,8 +483,8 @@ public: LoadKlassNode(Node *c, Node *mem, Node *adr, const TypePtr *at, const TypeKlassPtr *tk, MemOrd mo) : LoadPNode(c, mem, adr, at, tk, mo) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual bool depends_only_on_test() const { return true; } // Polymorphic factory method: @@ -503,8 +503,8 @@ public: virtual int store_Opcode() const { return Op_StoreNKlass; } virtual BasicType memory_type() const { return T_NARROWKLASS; } - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); virtual bool depends_only_on_test() const { return true; } }; @@ -581,10 +581,10 @@ public: // Compute a new Type for this node. Basically we just do the pre-check, // then call the virtual add() to set the type. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; // Check for identity function on memory (Load then Store at same address) - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // Do not match memory edge virtual uint match_edge(uint idx) const; @@ -746,9 +746,9 @@ public: "bad oop alias idx"); } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual BasicType memory_type() const { return T_VOID; } // unspecific int oop_alias_idx() const { return _oop_alias_idx; } }; @@ -782,7 +782,7 @@ public: return ctrl->in(MemNode::Memory)->adr_type(); } virtual uint ideal_reg() const { return 0;} // memory projections don't have a register - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; #ifndef PRODUCT virtual void dump_spec(outputStream *st) const {}; #endif @@ -934,7 +934,7 @@ public: // ClearArray modifies array elements, and so affects only the // array memory addressed by the bottom_type of its base address. virtual const class TypePtr *adr_type() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint match_edge(uint idx) const; @@ -983,7 +983,7 @@ public: MemBarNode(Compile* C, int alias_idx, Node* precedent); virtual int Opcode() const = 0; virtual const class TypePtr *adr_type() const { return _adr_type; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint match_edge(uint idx) const { return 0; } virtual const Type *bottom_type() const { return TypeTuple::MEMBAR; } @@ -1199,7 +1199,7 @@ public: static MergeMemNode* make(Node* base_memory); virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); virtual uint ideal_reg() const { return NotAMachineReg; } virtual uint match_edge(uint idx) const { return 0; } diff --git a/hotspot/src/share/vm/opto/movenode.cpp b/hotspot/src/share/vm/opto/movenode.cpp index ee797cf5d28..32c9877f64e 100644 --- a/hotspot/src/share/vm/opto/movenode.cpp +++ b/hotspot/src/share/vm/opto/movenode.cpp @@ -121,7 +121,7 @@ Node *CMoveNode::is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f //------------------------------Identity--------------------------------------- // Conditional-move is an identity if both inputs are the same, or the test // true or false. -Node *CMoveNode::Identity( PhaseTransform *phase ) { +Node* CMoveNode::Identity(PhaseGVN* phase) { if( phase->eqv(in(IfFalse),in(IfTrue)) ) // C-moving identical inputs? return in(IfFalse); // Then it doesn't matter if( phase->type(in(Condition)) == TypeInt::ZERO ) @@ -149,7 +149,7 @@ Node *CMoveNode::Identity( PhaseTransform *phase ) { //------------------------------Value------------------------------------------ // Result is the meet of inputs -const Type *CMoveNode::Value( PhaseTransform *phase ) const { +const Type* CMoveNode::Value(PhaseGVN* phase) const { if( phase->type(in(Condition)) == Type::TOP ) return Type::TOP; return phase->type(in(IfFalse))->meet_speculative(phase->type(in(IfTrue))); @@ -351,7 +351,7 @@ Node *CMoveDNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type *MoveL2DNode::Value( PhaseTransform *phase ) const { +const Type* MoveL2DNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeLong *tl = t->is_long(); @@ -362,7 +362,7 @@ const Type *MoveL2DNode::Value( PhaseTransform *phase ) const { } //------------------------------Value------------------------------------------ -const Type *MoveI2FNode::Value( PhaseTransform *phase ) const { +const Type* MoveI2FNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; const TypeInt *ti = t->is_int(); @@ -373,7 +373,7 @@ const Type *MoveI2FNode::Value( PhaseTransform *phase ) const { } //------------------------------Value------------------------------------------ -const Type *MoveF2INode::Value( PhaseTransform *phase ) const { +const Type* MoveF2INode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::FLOAT ) return TypeInt::INT; @@ -384,7 +384,7 @@ const Type *MoveF2INode::Value( PhaseTransform *phase ) const { } //------------------------------Value------------------------------------------ -const Type *MoveD2LNode::Value( PhaseTransform *phase ) const { +const Type* MoveD2LNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return Type::TOP; if( t == Type::DOUBLE ) return TypeLong::LONG; diff --git a/hotspot/src/share/vm/opto/movenode.hpp b/hotspot/src/share/vm/opto/movenode.hpp index 4cd94185063..b84e784a285 100644 --- a/hotspot/src/share/vm/opto/movenode.hpp +++ b/hotspot/src/share/vm/opto/movenode.hpp @@ -45,8 +45,8 @@ class CMoveNode : public TypeNode { init_req(IfTrue,right); } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); static CMoveNode *make(Node *c, Node *bol, Node *left, Node *right, const Type *t); // Helper function to spot cmove graph shapes static Node *is_cmove_id( PhaseTransform *phase, Node *cmp, Node *t, Node *f, BoolNode *b ); @@ -104,7 +104,7 @@ class MoveI2FNode : public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::FLOAT; } virtual uint ideal_reg() const { return Op_RegF; } - virtual const Type* Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; class MoveL2DNode : public Node { @@ -113,7 +113,7 @@ class MoveL2DNode : public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type* Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; class MoveF2INode : public Node { @@ -122,7 +122,7 @@ class MoveF2INode : public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } - virtual const Type* Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; class MoveD2LNode : public Node { @@ -131,7 +131,7 @@ class MoveD2LNode : public Node { virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } - virtual const Type* Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //------------------------------BinaryNode------------------------------------- diff --git a/hotspot/src/share/vm/opto/mulnode.cpp b/hotspot/src/share/vm/opto/mulnode.cpp index 4e796ce72d3..d5a7de73e92 100644 --- a/hotspot/src/share/vm/opto/mulnode.cpp +++ b/hotspot/src/share/vm/opto/mulnode.cpp @@ -46,7 +46,7 @@ uint MulNode::hash() const { //------------------------------Identity--------------------------------------- // Multiplying a one preserves the other argument -Node *MulNode::Identity( PhaseTransform *phase ) { +Node* MulNode::Identity(PhaseGVN* phase) { register const Type *one = mul_id(); // The multiplicative identity if( phase->type( in(1) )->higher_equal( one ) ) return in(2); if( phase->type( in(2) )->higher_equal( one ) ) return in(1); @@ -139,7 +139,7 @@ Node *MulNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value----------------------------------------- -const Type *MulNode::Value( PhaseTransform *phase ) const { +const Type* MulNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); // Either input is TOP ==> the result is TOP @@ -381,7 +381,7 @@ const Type *MulDNode::mul_ring(const Type *t0, const Type *t1) const { //============================================================================= //------------------------------Value------------------------------------------ -const Type *MulHiLNode::Value( PhaseTransform *phase ) const { +const Type* MulHiLNode::Value(PhaseGVN* phase) const { // Either input is TOP ==> the result is TOP const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -432,7 +432,7 @@ const Type *AndINode::mul_ring( const Type *t0, const Type *t1 ) const { //------------------------------Identity--------------------------------------- // Masking off the high bits of an unsigned load is not required -Node *AndINode::Identity( PhaseTransform *phase ) { +Node* AndINode::Identity(PhaseGVN* phase) { // x & x => x if (phase->eqv(in(1), in(2))) return in(1); @@ -562,7 +562,7 @@ const Type *AndLNode::mul_ring( const Type *t0, const Type *t1 ) const { //------------------------------Identity--------------------------------------- // Masking off the high bits of an unsigned load is not required -Node *AndLNode::Identity( PhaseTransform *phase ) { +Node* AndLNode::Identity(PhaseGVN* phase) { // x & x => x if (phase->eqv(in(1), in(2))) return in(1); @@ -639,7 +639,7 @@ Node *AndLNode::Ideal(PhaseGVN *phase, bool can_reshape) { //============================================================================= //------------------------------Identity--------------------------------------- -Node *LShiftINode::Identity( PhaseTransform *phase ) { +Node* LShiftINode::Identity(PhaseGVN* phase) { const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerInt - 1 ) ) == 0 ) ? in(1) : this; } @@ -704,7 +704,7 @@ Node *LShiftINode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A LShiftINode shifts its input2 left by input1 amount. -const Type *LShiftINode::Value( PhaseTransform *phase ) const { +const Type* LShiftINode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); // Either input is TOP ==> the result is TOP @@ -751,7 +751,7 @@ const Type *LShiftINode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *LShiftLNode::Identity( PhaseTransform *phase ) { +Node* LShiftLNode::Identity(PhaseGVN* phase) { const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this; } @@ -813,7 +813,7 @@ Node *LShiftLNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A LShiftLNode shifts its input2 left by input1 amount. -const Type *LShiftLNode::Value( PhaseTransform *phase ) const { +const Type* LShiftLNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); // Either input is TOP ==> the result is TOP @@ -860,7 +860,7 @@ const Type *LShiftLNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *RShiftINode::Identity( PhaseTransform *phase ) { +Node* RShiftINode::Identity(PhaseGVN* phase) { const TypeInt *t2 = phase->type(in(2))->isa_int(); if( !t2 ) return this; if ( t2->is_con() && ( t2->get_con() & ( BitsPerInt - 1 ) ) == 0 ) @@ -959,7 +959,7 @@ Node *RShiftINode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A RShiftINode shifts its input2 right by input1 amount. -const Type *RShiftINode::Value( PhaseTransform *phase ) const { +const Type* RShiftINode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); // Either input is TOP ==> the result is TOP @@ -1014,14 +1014,14 @@ const Type *RShiftINode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *RShiftLNode::Identity( PhaseTransform *phase ) { +Node* RShiftLNode::Identity(PhaseGVN* phase) { const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this; } //------------------------------Value------------------------------------------ // A RShiftLNode shifts its input2 right by input1 amount. -const Type *RShiftLNode::Value( PhaseTransform *phase ) const { +const Type* RShiftLNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); // Either input is TOP ==> the result is TOP @@ -1072,7 +1072,7 @@ const Type *RShiftLNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *URShiftINode::Identity( PhaseTransform *phase ) { +Node* URShiftINode::Identity(PhaseGVN* phase) { const TypeInt *ti = phase->type( in(2) )->isa_int(); if ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerInt - 1 ) ) == 0 ) return in(1); @@ -1168,7 +1168,7 @@ Node *URShiftINode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A URShiftINode shifts its input2 right by input1 amount. -const Type *URShiftINode::Value( PhaseTransform *phase ) const { +const Type* URShiftINode::Value(PhaseGVN* phase) const { // (This is a near clone of RShiftINode::Value.) const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); @@ -1242,7 +1242,7 @@ const Type *URShiftINode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Identity--------------------------------------- -Node *URShiftLNode::Identity( PhaseTransform *phase ) { +Node* URShiftLNode::Identity(PhaseGVN* phase) { const TypeInt *ti = phase->type( in(2) )->isa_int(); // shift count is an int return ( ti && ti->is_con() && ( ti->get_con() & ( BitsPerLong - 1 ) ) == 0 ) ? in(1) : this; } @@ -1297,7 +1297,7 @@ Node *URShiftLNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // A URShiftINode shifts its input2 right by input1 amount. -const Type *URShiftLNode::Value( PhaseTransform *phase ) const { +const Type* URShiftLNode::Value(PhaseGVN* phase) const { // (This is a near clone of RShiftLNode::Value.) const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); diff --git a/hotspot/src/share/vm/opto/mulnode.hpp b/hotspot/src/share/vm/opto/mulnode.hpp index c3adc433fda..987f2e9e695 100644 --- a/hotspot/src/share/vm/opto/mulnode.hpp +++ b/hotspot/src/share/vm/opto/mulnode.hpp @@ -47,7 +47,7 @@ public: // Handle algebraic identities here. If we have an identity, return the Node // we are equivalent to. We look for "add of zero" as an identity. - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // We also canonicalize the Node, moving constants to the right input, // and flatten expressions (so that 1+x+2 becomes x+3). @@ -55,7 +55,7 @@ public: // Compute a new Type for this node. Basically we just do the pre-check, // then call the virtual add() to set the type. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; // Supplied function returns the product of the inputs. // This also type-checks the inputs for sanity. Guaranteed never to @@ -146,7 +146,7 @@ class MulHiLNode : public Node { public: MulHiLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } }; @@ -159,7 +159,7 @@ public: AndINode( Node *in1, Node *in2 ) : MulINode(in1,in2) {} virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeInt::MINUS_1; } const Type *add_id() const { return TypeInt::ZERO; } @@ -176,7 +176,7 @@ public: AndLNode( Node *in1, Node *in2 ) : MulLNode(in1,in2) {} virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual const Type *mul_ring( const Type *, const Type * ) const; const Type *mul_id() const { return TypeLong::MINUS_1; } const Type *add_id() const { return TypeLong::ZERO; } @@ -191,9 +191,9 @@ class LShiftINode : public Node { public: LShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } }; @@ -204,9 +204,9 @@ class LShiftLNode : public Node { public: LShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } }; @@ -217,9 +217,9 @@ class RShiftINode : public Node { public: RShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } }; @@ -230,8 +230,8 @@ class RShiftLNode : public Node { public: RShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } }; @@ -243,9 +243,9 @@ class URShiftINode : public Node { public: URShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeInt::INT; } virtual uint ideal_reg() const { return Op_RegI; } }; @@ -256,9 +256,9 @@ class URShiftLNode : public Node { public: URShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {} virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type *bottom_type() const { return TypeLong::LONG; } virtual uint ideal_reg() const { return Op_RegL; } }; diff --git a/hotspot/src/share/vm/opto/multnode.cpp b/hotspot/src/share/vm/opto/multnode.cpp index 83ef36b7621..184e6a94bf4 100644 --- a/hotspot/src/share/vm/opto/multnode.cpp +++ b/hotspot/src/share/vm/opto/multnode.cpp @@ -147,7 +147,7 @@ void ProjNode::check_con() const { } //------------------------------Value------------------------------------------ -const Type *ProjNode::Value( PhaseTransform *phase ) const { +const Type* ProjNode::Value(PhaseGVN* phase) const { if (in(0) == NULL) return Type::TOP; return proj_type(phase->type(in(0))); } diff --git a/hotspot/src/share/vm/opto/multnode.hpp b/hotspot/src/share/vm/opto/multnode.hpp index 25f8c503436..ec32fea977b 100644 --- a/hotspot/src/share/vm/opto/multnode.hpp +++ b/hotspot/src/share/vm/opto/multnode.hpp @@ -81,7 +81,7 @@ public: virtual const Type *bottom_type() const; virtual const TypePtr *adr_type() const; virtual bool pinned() const; - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual uint ideal_reg() const; virtual const RegMask &out_RegMask() const; diff --git a/hotspot/src/share/vm/opto/narrowptrnode.cpp b/hotspot/src/share/vm/opto/narrowptrnode.cpp index de88eb6393b..412ecae69c5 100644 --- a/hotspot/src/share/vm/opto/narrowptrnode.cpp +++ b/hotspot/src/share/vm/opto/narrowptrnode.cpp @@ -26,7 +26,7 @@ #include "opto/narrowptrnode.hpp" #include "opto/phaseX.hpp" -Node* DecodeNNode::Identity(PhaseTransform* phase) { +Node* DecodeNNode::Identity(PhaseGVN* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); @@ -37,7 +37,7 @@ Node* DecodeNNode::Identity(PhaseTransform* phase) { return this; } -const Type *DecodeNNode::Value( PhaseTransform *phase ) const { +const Type* DecodeNNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if (t == Type::TOP) return Type::TOP; if (t == TypeNarrowOop::NULL_PTR) return TypePtr::NULL_PTR; @@ -46,7 +46,7 @@ const Type *DecodeNNode::Value( PhaseTransform *phase ) const { return t->make_ptr(); } -Node* EncodePNode::Identity(PhaseTransform* phase) { +Node* EncodePNode::Identity(PhaseGVN* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); @@ -57,7 +57,7 @@ Node* EncodePNode::Identity(PhaseTransform* phase) { return this; } -const Type *EncodePNode::Value( PhaseTransform *phase ) const { +const Type* EncodePNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if (t == Type::TOP) return Type::TOP; if (t == TypePtr::NULL_PTR) return TypeNarrowOop::NULL_PTR; @@ -67,7 +67,7 @@ const Type *EncodePNode::Value( PhaseTransform *phase ) const { } -Node* DecodeNKlassNode::Identity(PhaseTransform* phase) { +Node* DecodeNKlassNode::Identity(PhaseGVN* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); @@ -78,7 +78,7 @@ Node* DecodeNKlassNode::Identity(PhaseTransform* phase) { return this; } -const Type *DecodeNKlassNode::Value( PhaseTransform *phase ) const { +const Type* DecodeNKlassNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if (t == Type::TOP) return Type::TOP; assert(t != TypeNarrowKlass::NULL_PTR, "null klass?"); @@ -87,7 +87,7 @@ const Type *DecodeNKlassNode::Value( PhaseTransform *phase ) const { return t->make_ptr(); } -Node* EncodePKlassNode::Identity(PhaseTransform* phase) { +Node* EncodePKlassNode::Identity(PhaseGVN* phase) { const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); @@ -98,7 +98,7 @@ Node* EncodePKlassNode::Identity(PhaseTransform* phase) { return this; } -const Type *EncodePKlassNode::Value( PhaseTransform *phase ) const { +const Type* EncodePKlassNode::Value(PhaseGVN* phase) const { const Type *t = phase->type( in(1) ); if (t == Type::TOP) return Type::TOP; assert (t != TypePtr::NULL_PTR, "null klass?"); diff --git a/hotspot/src/share/vm/opto/narrowptrnode.hpp b/hotspot/src/share/vm/opto/narrowptrnode.hpp index feecbd0b906..e900bf7d93e 100644 --- a/hotspot/src/share/vm/opto/narrowptrnode.hpp +++ b/hotspot/src/share/vm/opto/narrowptrnode.hpp @@ -52,8 +52,8 @@ class EncodePNode : public EncodeNarrowPtrNode { init_class_id(Class_EncodeP); } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; }; //------------------------------EncodePKlass-------------------------------- @@ -67,8 +67,8 @@ class EncodePKlassNode : public EncodeNarrowPtrNode { init_class_id(Class_EncodePKlass); } virtual int Opcode() const; - virtual Node *Identity( PhaseTransform *phase ); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual Node* Identity(PhaseGVN* phase); + virtual const Type* Value(PhaseGVN* phase) const; }; //------------------------------DecodeNarrowPtr-------------------------------- @@ -95,8 +95,8 @@ class DecodeNNode : public DecodeNarrowPtrNode { init_class_id(Class_DecodeN); } virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); }; //------------------------------DecodeNKlass-------------------------------- @@ -110,8 +110,8 @@ class DecodeNKlassNode : public DecodeNarrowPtrNode { init_class_id(Class_DecodeNKlass); } virtual int Opcode() const; - virtual const Type *Value( PhaseTransform *phase ) const; - virtual Node *Identity( PhaseTransform *phase ); + virtual const Type* Value(PhaseGVN* phase) const; + virtual Node* Identity(PhaseGVN* phase); }; #endif // SHARE_VM_OPTO_NARROWPTRNODE_HPP diff --git a/hotspot/src/share/vm/opto/node.cpp b/hotspot/src/share/vm/opto/node.cpp index b9ccd2a142f..ff02a8ae8ca 100644 --- a/hotspot/src/share/vm/opto/node.cpp +++ b/hotspot/src/share/vm/opto/node.cpp @@ -1071,13 +1071,13 @@ void Node::raise_bottom_type(const Type* new_type) { //------------------------------Identity--------------------------------------- // Return a node that the given node is equivalent to. -Node *Node::Identity( PhaseTransform * ) { +Node* Node::Identity(PhaseGVN* phase) { return this; // Default to no identities } //------------------------------Value------------------------------------------ // Compute a new Type for a node using the Type of the inputs. -const Type *Node::Value( PhaseTransform * ) const { +const Type* Node::Value(PhaseGVN* phase) const { return bottom_type(); // Default to worst-case Type } @@ -2456,7 +2456,7 @@ uint TypeNode::hash() const { uint TypeNode::cmp( const Node &n ) const { return !Type::cmp( _type, ((TypeNode&)n)._type ); } const Type *TypeNode::bottom_type() const { return _type; } -const Type *TypeNode::Value( PhaseTransform * ) const { return _type; } +const Type* TypeNode::Value(PhaseGVN* phase) const { return _type; } //------------------------------ideal_reg-------------------------------------- uint TypeNode::ideal_reg() const { diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp index 559a4495eae..9ac0628f5f6 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -926,10 +926,10 @@ public: // Return an existing node which computes the same function as this node. // The optimistic combined algorithm requires this to return a Node which // is a small number of steps away (e.g., one of my inputs). - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // Return the set of values this Node can take on at runtime. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; // Return a node which is more "ideal" than the current node. // The invariants on this call are subtle. If in doubt, read the @@ -1696,7 +1696,7 @@ public: TypeNode( const Type *t, uint required ) : Node(required), _type(t) { init_class_id(Class_Type); } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const; virtual uint ideal_reg() const; #ifndef PRODUCT diff --git a/hotspot/src/share/vm/opto/opaquenode.cpp b/hotspot/src/share/vm/opto/opaquenode.cpp index cc0bdebc79e..f6afc7ebccf 100644 --- a/hotspot/src/share/vm/opto/opaquenode.cpp +++ b/hotspot/src/share/vm/opto/opaquenode.cpp @@ -40,7 +40,7 @@ uint Opaque1Node::cmp( const Node &n ) const { // call to IterGVN and any chance of hitting this code. Hence there's no // phase-ordering problem with stripping Opaque1 in IGVN followed by some // more loop optimizations that require it. -Node *Opaque1Node::Identity( PhaseTransform *phase ) { +Node* Opaque1Node::Identity(PhaseGVN* phase) { return phase->C->major_progress() ? this : in(1); } @@ -76,7 +76,7 @@ Node *ProfileBooleanNode::Ideal(PhaseGVN *phase, bool can_reshape) { } } -Node *ProfileBooleanNode::Identity( PhaseTransform *phase ) { +Node* ProfileBooleanNode::Identity(PhaseGVN* phase) { if (_delay_removal) { return this; } else { diff --git a/hotspot/src/share/vm/opto/opaquenode.hpp b/hotspot/src/share/vm/opto/opaquenode.hpp index ba298864486..5c4c7e42100 100644 --- a/hotspot/src/share/vm/opto/opaquenode.hpp +++ b/hotspot/src/share/vm/opto/opaquenode.hpp @@ -50,7 +50,7 @@ class Opaque1Node : public Node { Node* original_loop_limit() { return req()==3 ? in(2) : NULL; } virtual int Opcode() const; virtual const Type *bottom_type() const { return TypeInt::INT; } - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); }; //------------------------------Opaque2Node------------------------------------ @@ -109,7 +109,7 @@ class ProfileBooleanNode : public Node { virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual Node *Identity(PhaseTransform *phase); + virtual Node* Identity(PhaseGVN* phase); virtual const Type *bottom_type() const { return TypeInt::BOOL; } }; diff --git a/hotspot/src/share/vm/opto/rootnode.cpp b/hotspot/src/share/vm/opto/rootnode.cpp index e5542f6ff74..dab56c1cf2b 100644 --- a/hotspot/src/share/vm/opto/rootnode.cpp +++ b/hotspot/src/share/vm/opto/rootnode.cpp @@ -79,7 +79,7 @@ Node *HaltNode::Ideal(PhaseGVN *phase, bool can_reshape) { } //------------------------------Value------------------------------------------ -const Type *HaltNode::Value( PhaseTransform *phase ) const { +const Type* HaltNode::Value(PhaseGVN* phase) const { return ( phase->type(in(TypeFunc::Control)) == Type::TOP) ? Type::TOP : Type::BOTTOM; diff --git a/hotspot/src/share/vm/opto/rootnode.hpp b/hotspot/src/share/vm/opto/rootnode.hpp index 3be5dfa7673..a15d9edf6d7 100644 --- a/hotspot/src/share/vm/opto/rootnode.hpp +++ b/hotspot/src/share/vm/opto/rootnode.hpp @@ -42,9 +42,9 @@ public: virtual int Opcode() const; virtual const Node *is_block_proj() const { return this; } virtual const Type *bottom_type() const { return Type::BOTTOM; } - virtual Node *Identity( PhaseTransform *phase ) { return this; } + virtual Node* Identity(PhaseGVN* phase) { return this; } virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const { return Type::BOTTOM; } + virtual const Type* Value(PhaseGVN* phase) const { return Type::BOTTOM; } }; //------------------------------HaltNode--------------------------------------- @@ -55,7 +55,7 @@ public: virtual int Opcode() const; virtual bool pinned() const { return true; }; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const; virtual bool is_CFG() const { return true; } virtual uint hash() const { return NO_HASH; } // CFG nodes do not hash diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 76531d7a569..4250c6b8a20 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -46,7 +46,7 @@ //============================================================================= //------------------------------Identity--------------------------------------- // If right input is a constant 0, return the left input. -Node *SubNode::Identity( PhaseTransform *phase ) { +Node* SubNode::Identity(PhaseGVN* phase) { assert(in(1) != this, "Must already have called Value"); assert(in(2) != this, "Must already have called Value"); @@ -100,7 +100,7 @@ const Type* SubNode::Value_common(PhaseTransform *phase) const { return NULL; } -const Type* SubNode::Value(PhaseTransform *phase) const { +const Type* SubNode::Value(PhaseGVN* phase) const { const Type* t = Value_common(phase); if (t != NULL) { return t; @@ -378,7 +378,7 @@ const Type *SubLNode::sub( const Type *t1, const Type *t2 ) const { //============================================================================= //------------------------------Value------------------------------------------ // A subtract node differences its two inputs. -const Type *SubFPNode::Value( PhaseTransform *phase ) const { +const Type* SubFPNode::Value(PhaseGVN* phase) const { const Node* in1 = in(1); const Node* in2 = in(2); // Either input is TOP ==> the result is TOP @@ -494,7 +494,7 @@ const Type *SubDNode::sub( const Type *t1, const Type *t2 ) const { // Unlike SubNodes, compare must still flatten return value to the // range -1, 0, 1. // And optimizations like those for (X + Y) - X fail if overflow happens. -Node *CmpNode::Identity( PhaseTransform *phase ) { +Node* CmpNode::Identity(PhaseGVN* phase) { return this; } @@ -611,7 +611,7 @@ const Type *CmpUNode::sub( const Type *t1, const Type *t2 ) const { return TypeInt::CC; // else use worst case results } -const Type* CmpUNode::Value(PhaseTransform *phase) const { +const Type* CmpUNode::Value(PhaseGVN* phase) const { const Type* t = SubNode::Value_common(phase); if (t != NULL) { return t; @@ -1053,7 +1053,7 @@ Node *CmpNNode::Ideal( PhaseGVN *phase, bool can_reshape ) { //------------------------------Value------------------------------------------ // Simplify an CmpF (compare 2 floats ) node, based on local information. // If both inputs are constants, compare them. -const Type *CmpFNode::Value( PhaseTransform *phase ) const { +const Type* CmpFNode::Value(PhaseGVN* phase) const { const Node* in1 = in(1); const Node* in2 = in(2); // Either input is TOP ==> the result is TOP @@ -1083,7 +1083,7 @@ const Type *CmpFNode::Value( PhaseTransform *phase ) const { //------------------------------Value------------------------------------------ // Simplify an CmpD (compare 2 doubles ) node, based on local information. // If both inputs are constants, compare them. -const Type *CmpDNode::Value( PhaseTransform *phase ) const { +const Type* CmpDNode::Value(PhaseGVN* phase) const { const Node* in1 = in(1); const Node* in2 = in(2); // Either input is TOP ==> the result is TOP @@ -1423,7 +1423,7 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) { //------------------------------Value------------------------------------------ // Simplify a Bool (convert condition codes to boolean (1 or 0)) node, // based on local information. If the input is constant, do it. -const Type *BoolNode::Value( PhaseTransform *phase ) const { +const Type* BoolNode::Value(PhaseGVN* phase) const { return _test.cc2logical( phase->type( in(1) ) ); } @@ -1466,7 +1466,7 @@ bool BoolNode::is_counted_loop_exit_test() { //============================================================================= //------------------------------Value------------------------------------------ // Compute sqrt -const Type *SqrtDNode::Value( PhaseTransform *phase ) const { +const Type* SqrtDNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; @@ -1478,7 +1478,7 @@ const Type *SqrtDNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ // Compute tan -const Type *TanDNode::Value( PhaseTransform *phase ) const { +const Type* TanDNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; @@ -1489,7 +1489,7 @@ const Type *TanDNode::Value( PhaseTransform *phase ) const { //============================================================================= //------------------------------Value------------------------------------------ // Compute log10 -const Type *Log10DNode::Value( PhaseTransform *phase ) const { +const Type* Log10DNode::Value(PhaseGVN* phase) const { const Type *t1 = phase->type( in(1) ); if( t1 == Type::TOP ) return Type::TOP; if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; diff --git a/hotspot/src/share/vm/opto/subnode.hpp b/hotspot/src/share/vm/opto/subnode.hpp index fe5c840a776..1812853a8a9 100644 --- a/hotspot/src/share/vm/opto/subnode.hpp +++ b/hotspot/src/share/vm/opto/subnode.hpp @@ -45,11 +45,11 @@ public: // Handle algebraic identities here. If we have an identity, return the Node // we are equivalent to. We look for "add of zero" as an identity. - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); // Compute a new Type for this node. Basically we just do the pre-check, // then call the virtual add() to set the type. - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; const Type* Value_common( PhaseTransform *phase ) const; // Supplied function returns the subtractend of the inputs. @@ -97,7 +97,7 @@ class SubFPNode : public SubNode { protected: SubFPNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {} public: - const Type *Value( PhaseTransform *phase ) const; + const Type* Value(PhaseGVN* phase) const; }; // NOTE: SubFNode should be taken away and replaced by add and negate @@ -135,7 +135,7 @@ public: CmpNode( Node *in1, Node *in2 ) : SubNode(in1,in2) { init_class_id(Class_Cmp); } - virtual Node *Identity( PhaseTransform *phase ); + virtual Node* Identity(PhaseGVN* phase); const Type *add_id() const { return TypeInt::ZERO; } const Type *bottom_type() const { return TypeInt::CC; } virtual uint ideal_reg() const { return Op_RegFlags; } @@ -165,7 +165,7 @@ public: CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {} virtual int Opcode() const; virtual const Type *sub( const Type *, const Type * ) const; - const Type *Value( PhaseTransform *phase ) const; + const Type* Value(PhaseGVN* phase) const; bool is_index_range_check() const; }; @@ -219,7 +219,7 @@ public: CmpFNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {} virtual int Opcode() const; virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; } - const Type *Value( PhaseTransform *phase ) const; + const Type* Value(PhaseGVN* phase) const; }; //------------------------------CmpF3Node-------------------------------------- @@ -247,7 +247,7 @@ public: CmpDNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {} virtual int Opcode() const; virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; } - const Type *Value( PhaseTransform *phase ) const; + const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); }; @@ -309,7 +309,7 @@ public: BoolNode* negate(PhaseGVN* phase); virtual int Opcode() const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; virtual const Type *bottom_type() const { return TypeInt::BOOL; } uint match_edge(uint idx) const { return 0; } virtual uint ideal_reg() const { return Op_RegI; } @@ -419,7 +419,7 @@ public: virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; @@ -445,7 +445,7 @@ public: virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //------------------------------Log10DNode--------------------------------------- @@ -459,7 +459,7 @@ public: virtual int Opcode() const; const Type *bottom_type() const { return Type::DOUBLE; } virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; + virtual const Type* Value(PhaseGVN* phase) const; }; //-------------------------------ReverseBytesINode-------------------------------- From 0e1b2cd198d5f32415faf4096c6167cd63333a5a Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Tue, 12 Jan 2016 12:55:37 +0100 Subject: [PATCH 041/212] 8136469: OptimizeStringConcat fails on pre-sized StringBuilder shapes Cut off dead if branch already during parsing (GVN). Reviewed-by: shade, kvn, roland --- hotspot/src/share/vm/opto/ifnode.cpp | 17 ++++++++++------- hotspot/src/share/vm/opto/macro.cpp | 2 +- hotspot/src/share/vm/opto/stringopts.cpp | 10 ++++++++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp index 443de49f09a..c68a5136572 100644 --- a/hotspot/src/share/vm/opto/ifnode.cpp +++ b/hotspot/src/share/vm/opto/ifnode.cpp @@ -1530,13 +1530,16 @@ Node* IfNode::search_identical(int dist) { Node* IfProjNode::Identity(PhaseGVN* phase) { // Can only optimize if cannot go the other way const TypeTuple *t = phase->type(in(0))->is_tuple(); - if (t == TypeTuple::IFNEITHER || - // kill dead branch first otherwise the IfNode's control will - // have 2 control uses (the IfNode that doesn't go away because - // it still has uses and this branch of the - // If). Node::has_special_unique_user() will cause this node to - // be reprocessed once the dead branch is killed. - (always_taken(t) && in(0)->outcnt() == 1)) { + if (t == TypeTuple::IFNEITHER || (always_taken(t) && + // During parsing (GVN) we don't remove dead code aggressively. + // Cut off dead branch and let PhaseRemoveUseless take care of it. + (!phase->is_IterGVN() || + // During IGVN, first wait for the dead branch to be killed. + // Otherwise, the IfNode's control will have two control uses (the IfNode + // that doesn't go away because it still has uses and this branch of the + // If) which breaks other optimizations. Node::has_special_unique_user() + // will cause this node to be reprocessed once the dead branch is killed. + in(0)->outcnt() == 1))) { // IfNode control return in(0)->in(0); } diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp index a58a859c10d..80584956ffb 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -244,7 +244,7 @@ void PhaseMacroExpand::eliminate_card_mark(Node* p2x) { } else { // G1 pre/post barriers assert(p2x->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes"); - // It could be only one user, URShift node, in Object.clone() instrinsic + // It could be only one user, URShift node, in Object.clone() intrinsic // but the new allocation is passed to arraycopy stub and it could not // be scalar replaced. So we don't check the case. diff --git a/hotspot/src/share/vm/opto/stringopts.cpp b/hotspot/src/share/vm/opto/stringopts.cpp index 241384eccc6..8a7556490f2 100644 --- a/hotspot/src/share/vm/opto/stringopts.cpp +++ b/hotspot/src/share/vm/opto/stringopts.cpp @@ -822,11 +822,10 @@ bool StringConcat::validate_mem_flow() { } } else if (ctrl->is_IfTrue()) { // null checks, class checks iff = ctrl->in(0)->as_If(); - assert(iff->is_If(), "must be if"); // Verify that the other arm is an uncommon trap Node* otherproj = iff->proj_out(1 - ctrl->as_Proj()->_con); CallStaticJavaNode* call = otherproj->unique_out()->isa_CallStaticJava(); - assert(strcmp(call->_name, "uncommon_trap") == 0, "must be uncommond trap"); + assert(strcmp(call->_name, "uncommon_trap") == 0, "must be uncommon trap"); ctrl = iff->in(0); } else { break; @@ -914,6 +913,13 @@ bool StringConcat::validate_control_flow() { BoolNode* b = iff->in(1)->isa_Bool(); if (b == NULL) { +#ifndef PRODUCT + if (PrintOptimizeStringConcat) { + tty->print_cr("unexpected input to IfNode"); + iff->in(1)->dump(); + tty->cr(); + } +#endif fail = true; break; } From 8629682d55eca25105cad0f097d3db64ee58fc0f Mon Sep 17 00:00:00 2001 From: Ed Nevill Date: Tue, 12 Jan 2016 14:21:58 +0000 Subject: [PATCH 042/212] 8146886: aarch64: fails to build following 8136525 and 8139864 Fix several build errors and warnings Reviewed-by: aph --- hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp | 2 +- .../aarch64/vm/templateInterpreterGenerator_aarch64.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp index c64f1277aab..f1149812ad0 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp @@ -3938,7 +3938,7 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) { // was post-decremented.) Skip this address by starting at i=1, and // touch a few more pages below. N.B. It is important to touch all // the way down to and including i=StackShadowPages. - for (int i = 0; i < (JavaThread::stack_shadow_zone_size() / os::vm_page_size()) - 1; i++) { + for (int i = 0; i < (int)(JavaThread::stack_shadow_zone_size() / os::vm_page_size()) - 1; i++) { // this could be any sized move but this is can be a debugging crumb // so the bigger the better. lea(tmp, Address(tmp, -os::vm_page_size())); diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp index 37176c78072..c363bcabb56 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp @@ -716,7 +716,7 @@ address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { // If G1 is not enabled then attempt to go through the accessor entry point // Reference.get is an accessor - return generate_accessor_entry(); + return NULL; } /** @@ -842,7 +842,7 @@ void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { // an interpreter frame with greater than a page of locals, so each page // needs to be checked. Only true for non-native. if (UseStackBanging) { - const int size_t n_shadow_pages = JavaThread::stack_shadow_zone_size() / os::vm_page_size(); + const int n_shadow_pages = JavaThread::stack_shadow_zone_size() / os::vm_page_size(); const int start_page = native_call ? n_shadow_pages : 1; const int page_size = os::vm_page_size(); for (int pages = start_page; pages <= n_shadow_pages ; pages++) { @@ -1184,8 +1184,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { { Label no_reguard; __ lea(rscratch1, Address(rthread, in_bytes(JavaThread::stack_guard_state_offset()))); - __ ldrb(rscratch1, Address(rscratch1)); - __ cmp(rscratch1, JavaThread::stack_guard_yellow_disabled); + __ ldrw(rscratch1, Address(rscratch1)); + __ cmp(rscratch1, JavaThread::stack_guard_yellow_reserved_disabled); __ br(Assembler::NE, no_reguard); __ pusha(); // XXX only save smashed registers From 148c6a3e7715a482d12db9c81fc099819b738869 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Tue, 12 Jan 2016 10:44:41 -1000 Subject: [PATCH 043/212] 8146246: JVMCICompiler::abort_on_pending_exception: assert(!thread->owns_locks()) failed: must release all locks when leaving VM Reviewed-by: coleenp, kvn --- hotspot/src/share/vm/classfile/javaClasses.cpp | 14 ++++++++++++++ hotspot/src/share/vm/classfile/javaClasses.hpp | 1 + hotspot/src/share/vm/jvmci/jvmciCompiler.cpp | 11 ++--------- hotspot/src/share/vm/runtime/java.cpp | 3 +-- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index b80899d324a..10e2f01f08d 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -1784,6 +1784,20 @@ void java_lang_Throwable::print_stack_trace(Handle throwable, outputStream* st) } } +/** + * Print the throwable stack trace by calling the Java method java.lang.Throwable.printStackTrace(). + */ +void java_lang_Throwable::java_printStackTrace(Handle throwable, TRAPS) { + assert(throwable->is_a(SystemDictionary::Throwable_klass()), "Throwable instance expected"); + JavaValue result(T_VOID); + JavaCalls::call_virtual(&result, + throwable, + KlassHandle(THREAD, SystemDictionary::Throwable_klass()), + vmSymbols::printStackTrace_name(), + vmSymbols::void_method_signature(), + THREAD); +} + void java_lang_Throwable::fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS) { if (!StackTraceInThrowable) return; ResourceMark rm(THREAD); diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 3ac5b4191ea..1f23baae975 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -554,6 +554,7 @@ class java_lang_Throwable: AllStatic { // Printing static void print(Handle throwable, outputStream* st); static void print_stack_trace(Handle throwable, outputStream* st); + static void java_printStackTrace(Handle throwable, TRAPS); // Debugging friend class JavaClasses; }; diff --git a/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp b/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp index 8e5a2ff86f7..ceaf1ecc04f 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp @@ -162,10 +162,7 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV Handle exception(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - { - ttyLocker ttyl; - java_lang_Throwable::print_stack_trace(exception, tty); - } + java_lang_Throwable::java_printStackTrace(exception, THREAD); // Something went wrong so disable compilation at this level method->set_not_compilable(CompLevel_full_optimization); @@ -181,11 +178,7 @@ void JVMCICompiler::abort_on_pending_exception(Handle exception, const char* mes Thread* THREAD = Thread::current(); CLEAR_PENDING_EXCEPTION; - { - ttyLocker ttyl; - tty->print_raw_cr(message); - java_lang_Throwable::print_stack_trace(exception, tty); - } + java_lang_Throwable::java_printStackTrace(exception, THREAD); // Give other aborting threads to also print their stack traces. // This can be very useful when debugging class initialization diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index aa57bbc4601..9df11977229 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -432,8 +432,7 @@ void before_exit(JavaThread* thread) { if (HAS_PENDING_EXCEPTION) { Handle exception(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - ttyLocker ttyl; - java_lang_Throwable::print_stack_trace(exception, tty); + java_lang_Throwable::java_printStackTrace(exception, THREAD); } #endif From 3b0e147813de7d49506711e70395878785e00896 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Mon, 11 Jan 2016 16:02:42 +0100 Subject: [PATCH 044/212] 8146792: Predicate moved after partial peel may lead to broken graph Partial peel can leave a pinned node between predicates and loop and prevent some loop predication Reviewed-by: kvn --- hotspot/src/share/vm/opto/loopPredicate.cpp | 27 +- .../BadPredicateAfterPartialPeel.java | 312 ++++++++++++++++++ 2 files changed, 338 insertions(+), 1 deletion(-) create mode 100644 hotspot/test/compiler/loopopts/BadPredicateAfterPartialPeel.java diff --git a/hotspot/src/share/vm/opto/loopPredicate.cpp b/hotspot/src/share/vm/opto/loopPredicate.cpp index 9cc6961931e..56d21451ef8 100644 --- a/hotspot/src/share/vm/opto/loopPredicate.cpp +++ b/hotspot/src/share/vm/opto/loopPredicate.cpp @@ -519,7 +519,31 @@ class Invariance : public StackObj { _lpt(lpt), _phase(lpt->_phase), _visited(area), _invariant(area), _stack(area, 10 /* guess */), _clone_visited(area), _old_new(area) - {} + { + Node* head = _lpt->_head; + Node* entry = head->in(LoopNode::EntryControl); + if (entry->outcnt() != 1) { + // If a node is pinned between the predicates and the loop + // entry, we won't be able to move any node in the loop that + // depends on it above it in a predicate. Mark all those nodes + // as non loop invariatnt. + Unique_Node_List wq; + wq.push(entry); + for (uint next = 0; next < wq.size(); ++next) { + Node *n = wq.at(next); + for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { + Node* u = n->fast_out(i); + if (!u->is_CFG()) { + Node* c = _phase->get_ctrl(u); + if (_lpt->is_member(_phase->get_loop(c)) || _phase->is_dominator(c, head)) { + _visited.set(u->_idx); + wq.push(u); + } + } + } + } + } + } // Map old to n for invariance computation and clone void map_ctrl(Node* old, Node* n) { @@ -641,6 +665,7 @@ BoolNode* PhaseIdealLoop::rc_predicate(IdealLoopTree *loop, Node* ctrl, if (scale != 1) { ConNode* con_scale = _igvn.intcon(scale); + set_ctrl(con_scale, C->root()); max_idx_expr = new MulINode(max_idx_expr, con_scale); register_new_node(max_idx_expr, ctrl); if (TraceLoopPredicate) predString->print("* %d ", scale); diff --git a/hotspot/test/compiler/loopopts/BadPredicateAfterPartialPeel.java b/hotspot/test/compiler/loopopts/BadPredicateAfterPartialPeel.java new file mode 100644 index 00000000000..186f1cc1a7d --- /dev/null +++ b/hotspot/test/compiler/loopopts/BadPredicateAfterPartialPeel.java @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * @test + * @bug 8146792 + * @summary Predicate moved after partial peel may lead to broken graph + * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileOnly=BadPredicateAfterPartialPeel::m -XX:CompileCommand=dontinline,BadPredicateAfterPartialPeel::not_inlined* -XX:CompileCommand=quiet BadPredicateAfterPartialPeel + * + */ + +public class BadPredicateAfterPartialPeel { + + static void not_inlined1() {} + static void not_inlined4() {} + + static int m_helper(int i, int i3, int i4) { + return i3 == 4 ? i4 : i; + } + + static float[] array = new float[1000]; + static int[] array2 = new int[1000]; + + boolean flag; + int j; + + static void m(BadPredicateAfterPartialPeel o1, BadPredicateAfterPartialPeel o2, BadPredicateAfterPartialPeel o, int i4) { + int i1 = 1; + + // To delay partial peeling to the loop opts pass right before CCP + int i2 = 0; + for (; i2 < 10; i2 += i1); + i2 = i2 / 10; + + // Simplified during CCP: + int i3 = 2; + for (; i3 < 4; i3 *= 2); + + // Loop is partial peeled right before CCP + int i = 0; + boolean b = true; + + not_inlined1(); + + array[0] = -1; + do { + // peeled section starts here + o.flag = false; + o.j = 0; + + if (b) { + // The following store will be pinned between + // predicates and the loop after partial peeling. All + // control flow will be optimized out and so nothing + // will prevent predicates from being moved out the + // loop. + array[i] = 0; + } + if (array[0] != 0) { + } + if (i >= 10) { + // peeled section ends here + return; + } + i += i2; + b = false; + int i5 = m_helper(i, i3, i4); // This will be simpliflied during CCP + if (array[i5] != 0) { // and this will become a predicate + } + if (o2.flag) { + } + // A bunch of stuff to grow loop body size and prevent peeling: + array2[0] = 0; + array2[1] = 0; + array2[2] = 0; + array2[3] = 0; + array2[4] = 0; + array2[5] = 0; + array2[6] = 0; + array2[7] = 0; + array2[8] = 0; + array2[9] = 0; + array2[10] = 0; + array2[11] = 0; + array2[12] = 0; + array2[13] = 0; + array2[14] = 0; + array2[15] = 0; + array2[16] = 0; + array2[17] = 0; + array2[18] = 0; + array2[19] = 0; + array2[20] = 0; + array2[21] = 0; + array2[22] = 0; + array2[23] = 0; + array2[24] = 0; + array2[25] = 0; + array2[26] = 0; + array2[27] = 0; + array2[28] = 0; + array2[29] = 0; + array2[30] = 0; + array2[31] = 0; + array2[32] = 0; + array2[33] = 0; + array2[34] = 0; + array2[35] = 0; + array2[36] = 0; + array2[37] = 0; + array2[38] = 0; + array2[39] = 0; + array2[40] = 0; + array2[41] = 0; + array2[42] = 0; + array2[43] = 0; + array2[44] = 0; + array2[45] = 0; + array2[46] = 0; + array2[47] = 0; + array2[48] = 0; + array2[49] = 0; + array2[50] = 0; + array2[51] = 0; + array2[52] = 0; + array2[53] = 0; + array2[54] = 0; + array2[55] = 0; + array2[56] = 0; + array2[57] = 0; + array2[58] = 0; + array2[59] = 0; + array2[60] = 0; + array2[61] = 0; + array2[62] = 0; + array2[63] = 0; + array2[64] = 0; + array2[65] = 0; + array2[66] = 0; + array2[67] = 0; + array2[68] = 0; + array2[69] = 0; + array2[70] = 0; + array2[71] = 0; + array2[72] = 0; + array2[73] = 0; + array2[74] = 0; + array2[75] = 0; + array2[76] = 0; + array2[77] = 0; + array2[78] = 0; + array2[79] = 0; + array2[80] = 0; + array2[81] = 0; + array2[82] = 0; + array2[83] = 0; + array2[84] = 0; + array2[85] = 0; + array2[86] = 0; + array2[87] = 0; + array2[88] = 0; + array2[89] = 0; + array2[90] = 0; + array2[91] = 0; + array2[92] = 0; + array2[93] = 0; + array2[94] = 0; + array2[95] = 0; + array2[96] = 0; + array2[97] = 0; + array2[98] = 0; + array2[99] = 0; + + array2[100] = 0; + array2[101] = 0; + array2[102] = 0; + array2[103] = 0; + array2[104] = 0; + array2[105] = 0; + array2[106] = 0; + array2[107] = 0; + array2[108] = 0; + array2[109] = 0; + array2[110] = 0; + array2[111] = 0; + array2[112] = 0; + array2[113] = 0; + array2[114] = 0; + array2[115] = 0; + array2[116] = 0; + array2[117] = 0; + array2[118] = 0; + array2[119] = 0; + array2[120] = 0; + array2[121] = 0; + array2[122] = 0; + array2[123] = 0; + array2[124] = 0; + array2[125] = 0; + array2[126] = 0; + array2[127] = 0; + array2[128] = 0; + array2[129] = 0; + array2[130] = 0; + array2[131] = 0; + array2[132] = 0; + array2[133] = 0; + array2[134] = 0; + array2[135] = 0; + array2[136] = 0; + array2[137] = 0; + array2[138] = 0; + array2[139] = 0; + array2[140] = 0; + array2[141] = 0; + array2[142] = 0; + array2[143] = 0; + array2[144] = 0; + array2[145] = 0; + array2[146] = 0; + array2[147] = 0; + array2[148] = 0; + array2[149] = 0; + array2[150] = 0; + array2[151] = 0; + array2[152] = 0; + array2[153] = 0; + array2[154] = 0; + array2[155] = 0; + array2[156] = 0; + array2[157] = 0; + array2[158] = 0; + array2[159] = 0; + array2[160] = 0; + array2[161] = 0; + array2[162] = 0; + array2[163] = 0; + array2[164] = 0; + array2[165] = 0; + array2[166] = 0; + array2[167] = 0; + array2[168] = 0; + array2[169] = 0; + array2[170] = 0; + array2[171] = 0; + array2[172] = 0; + array2[173] = 0; + array2[174] = 0; + array2[175] = 0; + array2[176] = 0; + array2[177] = 0; + array2[178] = 0; + array2[179] = 0; + array2[180] = 0; + array2[181] = 0; + array2[182] = 0; + array2[183] = 0; + array2[184] = 0; + array2[185] = 0; + array2[186] = 0; + array2[187] = 0; + array2[188] = 0; + array2[189] = 0; + array2[190] = 0; + array2[191] = 0; + array2[192] = 0; + array2[193] = 0; + array2[194] = 0; + array2[195] = 0; + array2[196] = 0; + array2[197] = 0; + array2[198] = 0; + array2[199] = 0; + if (o1.j >= 20) { + break; + } + o1.j++; + } while(true); + not_inlined4(); + } + + static public void main(String[] args) { + BadPredicateAfterPartialPeel o1 = new BadPredicateAfterPartialPeel(); + BadPredicateAfterPartialPeel o2 = new BadPredicateAfterPartialPeel(); + for (int i = 0; i < 20000; i++) { + o1.j = 0; + m(o1, o2, o2, 0); + m_helper(i, 2, i); // pollute profile + } + } +} From 75c1b868591f227a5a18ab5319c6f4f029e60990 Mon Sep 17 00:00:00 2001 From: Alexander Harlap Date: Mon, 11 Jan 2016 14:26:00 -0500 Subject: [PATCH 045/212] 8145038: Simplify mut_process_buffer worker id management Remove some wasted code Reviewed-by: kbarrett, tschatzl --- hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp | 44 ++++--------------- hotspot/src/share/vm/runtime/thread.cpp | 3 -- hotspot/src/share/vm/runtime/thread.hpp | 8 ---- 3 files changed, 8 insertions(+), 47 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp index ee9ae50a0d9..155faa0be5a 100644 --- a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp @@ -190,47 +190,19 @@ void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) { bool DirtyCardQueueSet::mut_process_buffer(void** buf) { guarantee(_free_ids != NULL, "must be"); - // Used to determine if we had already claimed a par_id - // before entering this method. - bool already_claimed = false; - // We grab the current JavaThread. - JavaThread* thread = JavaThread::current(); + // claim a par id + uint worker_i = _free_ids->claim_par_id(); - // We get the the number of any par_id that this thread - // might have already claimed. - uint worker_i = thread->get_claimed_par_id(); - - // If worker_i is not UINT_MAX then the thread has already claimed - // a par_id. We make note of it using the already_claimed value - if (worker_i != UINT_MAX) { - already_claimed = true; - } else { - - // Otherwise we need to claim a par id - worker_i = _free_ids->claim_par_id(); - - // And store the par_id value in the thread - thread->set_claimed_par_id(worker_i); + bool b = DirtyCardQueue::apply_closure_to_buffer(_mut_process_closure, buf, 0, + _sz, true, worker_i); + if (b) { + Atomic::inc(&_processed_buffers_mut); } - bool b = false; - if (worker_i != UINT_MAX) { - b = DirtyCardQueue::apply_closure_to_buffer(_mut_process_closure, buf, 0, - _sz, true, worker_i); - if (b) Atomic::inc(&_processed_buffers_mut); + // release the id + _free_ids->release_par_id(worker_i); - // If we had not claimed an id before entering the method - // then we must release the id. - if (!already_claimed) { - - // we release the id - _free_ids->release_par_id(worker_i); - - // and set the claimed_id in the thread to UINT_MAX - thread->set_claimed_par_id(UINT_MAX); - } - } return b; } diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 99ded5d7475..8a430f143de 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -1419,9 +1419,6 @@ void JavaThread::collect_counters(typeArrayOop array) { void JavaThread::initialize() { // Initialize fields - // Set the claimed par_id to UINT_MAX (ie not claiming any par_ids) - set_claimed_par_id(UINT_MAX); - set_saved_exception_pc(NULL); set_threadObj(NULL); _anchor.clear(); diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index 6904cd5c36c..0be7faed0c5 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -1964,14 +1964,6 @@ class JavaThread: public Thread { bool is_attaching_via_jni() const { return _jni_attach_state == _attaching_via_jni; } bool has_attached_via_jni() const { return is_attaching_via_jni() || _jni_attach_state == _attached_via_jni; } inline void set_done_attaching_via_jni(); - private: - // This field is used to determine if a thread has claimed - // a par_id: it is UINT_MAX if the thread has not claimed a par_id; - // otherwise its value is the par_id that has been claimed. - uint _claimed_par_id; - public: - uint get_claimed_par_id() { return _claimed_par_id; } - void set_claimed_par_id(uint id) { _claimed_par_id = id; } }; // Inline implementation of JavaThread::current From 8a4f6e9b216c9e359c494fb3e2618fab64b638da Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Tue, 12 Jan 2016 11:11:21 +0100 Subject: [PATCH 046/212] 8146620: CodelistTest.java fails with "Test failed on: jdk.internal.misc.Unsafe.getUnsafe()Ljdk/internal/misc/Unsafe;" Reviewed-by: sla --- .../test/serviceability/dcmd/compiler/CodelistTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java index 95307f682f7..0201e2ceeec 100644 --- a/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java +++ b/hotspot/test/serviceability/dcmd/compiler/CodelistTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -80,7 +80,8 @@ public class CodelistTest { // int compileLevel = Integer.parseInt(parts[1]); String methodPrintedInLogFormat = parts[2]; - // skip inits, clinits and methodHandles - they can not be reflected + // skip inits, clinits, methodHandles and getUnsafe - + // they can not be reflected if (methodPrintedInLogFormat.contains("")) { continue; } @@ -93,6 +94,9 @@ public class CodelistTest { if (methodPrintedInLogFormat.contains("sun.misc.Unsafe.getUnsafe")) { continue; } + if (methodPrintedInLogFormat.contains("jdk.internal.misc.Unsafe.getUnsafe")) { + continue; + } MethodIdentifierParser mf = new MethodIdentifierParser(methodPrintedInLogFormat); Method m = null; From 6622e25b6140f5d1c2ff50b27335ea6d5039943b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Gr=C3=B6nlund?= Date: Tue, 12 Jan 2016 15:38:56 +0100 Subject: [PATCH 047/212] 8145788: JVM crashes with -XX:+EnableTracing Reviewed-by: dholmes, ysuenaga, mlarsson --- hotspot/src/share/vm/trace/traceEventClasses.xsl | 2 -- hotspot/src/share/vm/trace/traceStream.hpp | 11 +++-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/hotspot/src/share/vm/trace/traceEventClasses.xsl b/hotspot/src/share/vm/trace/traceEventClasses.xsl index fe097e0b370..f7c90ad758f 100644 --- a/hotspot/src/share/vm/trace/traceEventClasses.xsl +++ b/hotspot/src/share/vm/trace/traceEventClasses.xsl @@ -36,7 +36,6 @@ // Some parts of traceEvent.hpp are used outside of // INCLUDE_TRACE -#include "memory/resourceArea.hpp" #include "tracefiles/traceTypes.hpp" #include "trace/traceEvent.hpp" #include "utilities/macros.hpp" @@ -136,7 +135,6 @@ public: void writeEvent(void) { - ResourceMark rm; if (UseLockedTracing) { ttyLocker lock; writeEventContent(); diff --git a/hotspot/src/share/vm/trace/traceStream.hpp b/hotspot/src/share/vm/trace/traceStream.hpp index e2c982a2cd6..405e462522e 100644 --- a/hotspot/src/share/vm/trace/traceStream.hpp +++ b/hotspot/src/share/vm/trace/traceStream.hpp @@ -27,6 +27,7 @@ #include "utilities/macros.hpp" #if INCLUDE_TRACE +#include "memory/resourceArea.hpp" #include "oops/klass.hpp" #include "oops/method.hpp" #include "oops/symbol.hpp" @@ -79,11 +80,8 @@ class TraceStream : public StackObj { _st.print("%s = %f", label, val); } - // Caller is machine generated code located in traceEventClasses.hpp - // Event::writeEvent() (pseudocode) contains the - // necessary ResourceMark for the resource allocations below. - // See traceEventClasses.xsl for details. void print_val(const char* label, const Klass* const val) { + ResourceMark rm; const char* description = "NULL"; if (val != NULL) { Symbol* name = val->name(); @@ -94,11 +92,8 @@ class TraceStream : public StackObj { _st.print("%s = %s", label, description); } - // Caller is machine generated code located in traceEventClasses.hpp - // Event::writeEvent() (pseudocode) contains the - // necessary ResourceMark for the resource allocations below. - // See traceEventClasses.xsl for details. void print_val(const char* label, const Method* const val) { + ResourceMark rm; const char* description = "NULL"; if (val != NULL) { description = val->name_and_sig_as_C_string(); From 543ed0a868fb079c038e5ba71246c2ab82efcd69 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Tue, 12 Jan 2016 15:01:52 +0000 Subject: [PATCH 048/212] 8146891: AArch64 needs patch for 8032463 Reviewed-by: kvn --- hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp | 1 + hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp index 865b4c20374..3b51e62e7ca 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_CodeStubs_aarch64.cpp @@ -256,6 +256,7 @@ void PatchingStub::emit_code(LIR_Assembler* ce) { void DeoptimizeStub::emit_code(LIR_Assembler* ce) { __ bind(_entry); + ce->store_parameter(_trap_request, 0); __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::deoptimize_id))); ce->add_call_info_here(_info); DEBUG_ONLY(__ should_not_reach_here()); diff --git a/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp index 77498c35972..0ae7e24e1b0 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp @@ -1066,7 +1066,9 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { { StubFrame f(sasm, "deoptimize", dont_gc_arguments); OopMap* oop_map = save_live_registers(sasm); - int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize)); + f.load_argument(0, c_rarg1); + int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, deoptimize), c_rarg1); + oop_maps = new OopMapSet(); oop_maps->add_gc_map(call_offset, oop_map); restore_live_registers(sasm); From 80d217964494a018f8d9f6a2e39c4febe1e4d3da Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Wed, 13 Jan 2016 11:33:21 +0100 Subject: [PATCH 049/212] 8146978: PPC64: Fix build after integration of C++ interpreter removal Reviewed-by: goetz --- hotspot/src/cpu/ppc/vm/register_ppc.hpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.hpp b/hotspot/src/cpu/ppc/vm/register_ppc.hpp index def1f6e3872..9f1dc28a2a3 100644 --- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp @@ -609,13 +609,11 @@ REGISTER_DECLARATION(Register, R26_tmp6, R26); REGISTER_DECLARATION(Register, R27_tmp7, R27); REGISTER_DECLARATION(Register, R28_tmp8, R28); REGISTER_DECLARATION(Register, R29_tmp9, R29); -#ifndef CC_INTERP REGISTER_DECLARATION(Register, R24_dispatch_addr, R24); REGISTER_DECLARATION(Register, R25_templateTableBase, R25); REGISTER_DECLARATION(Register, R26_monitor, R26); REGISTER_DECLARATION(Register, R27_constPoolCache, R27); REGISTER_DECLARATION(Register, R28_mdx, R28); -#endif // CC_INTERP REGISTER_DECLARATION(Register, R19_inline_cache_reg, R19); REGISTER_DECLARATION(Register, R29_TOC, R29); @@ -638,12 +636,9 @@ REGISTER_DECLARATION(Register, R29_TOC, R29); #define R26_monitor AS_REGISTER(Register, R26) #define R27_constPoolCache AS_REGISTER(Register, R27) #define R28_mdx AS_REGISTER(Register, R28) -#endif #define R19_inline_cache_reg AS_REGISTER(Register, R19) #define R29_TOC AS_REGISTER(Register, R29) - -#define CCR4_is_synced AS_REGISTER(ConditionRegister, CCR4) #endif // Scratch registers are volatile. From ee1e04726905094c071faebd168e80d31d6eb133 Mon Sep 17 00:00:00 2001 From: Zoltan Majo Date: Thu, 14 Jan 2016 09:30:31 +0100 Subject: [PATCH 050/212] 8071864: compiler/c2/6772683/InterruptedTest.java failed in nightly Increase the amount of time the main thread waits for the worker thread. Reviewed-by: kvn --- .../compiler/c2/6772683/InterruptedTest.java | 46 +++++++++++++++---- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/hotspot/test/compiler/c2/6772683/InterruptedTest.java b/hotspot/test/compiler/c2/6772683/InterruptedTest.java index ca7fd5a98b5..aa513fa02aa 100644 --- a/hotspot/test/compiler/c2/6772683/InterruptedTest.java +++ b/hotspot/test/compiler/c2/6772683/InterruptedTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,12 +26,39 @@ * @test * @bug 6772683 * @summary Thread.isInterrupted() fails to return true on multiprocessor PC - * @run main/othervm InterruptedTest + * @run main/othervm InterruptedTest 100 */ public class InterruptedTest { public static void main(String[] args) throws Exception { + /* The value of the threshold determines for how many seconds + * the main thread must wait for the worker thread. On highly + * loaded systems it can take a while until the worker thread + * obtains CPU time and is able to check if it was interrupted + * by the main thread. The higher the threshold the likelier + * the worker thread can check if it was interrupted (that is + * required for successul test execution). + */ + int threshold = 100; + + if (args.length != 1) { + System.out.println("Incorrect number of arguments"); + System.exit(1); + } + + try { + threshold = Integer.parseInt(args[0]); + } catch (NumberFormatException e) { + System.out.println("Invalid argument format"); + System.exit(1); + } + + if (threshold < 1) { + System.out.println("Threshold must be at least 1"); + System.exit(1); + } + Thread workerThread = new Thread("worker") { public void run() { System.out.println("Worker thread: running..."); @@ -42,24 +69,27 @@ public class InterruptedTest { }; System.out.println("Main thread: starts a worker thread..."); workerThread.start(); - System.out.println("Main thread: waits at most 5s for the worker thread to die..."); + System.out.println("Main thread: waits 5 seconds after starting the worker thread"); workerThread.join(5000); // Wait 5 sec to let run() method to be compiled + int ntries = 0; - while (workerThread.isAlive() && ntries < 5) { + while (workerThread.isAlive() && ntries < threshold) { System.out.println("Main thread: interrupts the worker thread..."); workerThread.interrupt(); if (workerThread.isInterrupted()) { System.out.println("Main thread: worker thread is interrupted"); } ntries++; - System.out.println("Main thread: waits for the worker thread to die..."); + System.out.println("Main thread: waits 1 second for the worker thread to die..."); workerThread.join(1000); // Wait 1 sec and try again } - if (ntries == 5) { - System.out.println("Main thread: the worker thread dod not die"); + + if (ntries == threshold) { + System.out.println("Main thread: the worker thread did not die after " + + ntries + " seconds have elapsed"); System.exit(97); } + System.out.println("Main thread: bye"); } - } From 48b6051ee73fac6ce5d758171bbc54a0ba6616ff Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Thu, 14 Jan 2016 13:24:03 +0100 Subject: [PATCH 051/212] 8145331: SEGV in DirectivesStack::release(DirectiveSet*) GetDefaultDirective was not updated in 8144873 Reviewed-by: twisti, kvn --- .../share/vm/compiler/compilerDirectives.cpp | 37 +++++++------------ hotspot/src/share/vm/prims/whitebox.cpp | 5 ++- .../intrinsics/IntrinsicAvailableTest.java | 13 ++++--- 3 files changed, 23 insertions(+), 32 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.cpp b/hotspot/src/share/vm/compiler/compilerDirectives.cpp index ba35617fc27..28b09f6cb61 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp @@ -164,20 +164,15 @@ int CompilerDirectives::refcount() { DirectiveSet* CompilerDirectives::get_for(AbstractCompiler *comp) { assert(DirectivesStack_lock->owned_by_self(), ""); - inc_refcount(); // The compiling thread is responsible to decrement this when finished. if (comp == NULL) { // Xint return _c1_store; - } else if (comp->is_c2()) { + } else if (comp->is_c2()) { return _c2_store; - } else if (comp->is_c1()) { + } else { + // use c1_store as default + assert(comp->is_c1() || comp->is_jvmci() || comp->is_shark(), ""); return _c1_store; - } else if (comp->is_shark()) { - return NULL; - } else if (comp->is_jvmci()) { - return NULL; } - ShouldNotReachHere(); - return NULL; } // In the list of disabled intrinsics, the ID of the disabled intrinsics can separated: @@ -459,6 +454,7 @@ DirectiveSet* DirectivesStack::getDefaultDirective(AbstractCompiler* comp) { MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag); assert(_bottom != NULL, "Must never be empty"); + _bottom->inc_refcount(); return _bottom->get_for(comp); } @@ -521,12 +517,13 @@ void DirectivesStack::print(outputStream* st) { } void DirectivesStack::release(DirectiveSet* set) { + assert(set != NULL, "Never NULL"); MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag); if (set->is_exclusive_copy()) { // Old CompilecCmmands forced us to create an exclusive copy delete set; } else { - assert(set->directive() != NULL, ""); + assert(set->directive() != NULL, "Never NULL"); release(set->directive()); } } @@ -553,26 +550,18 @@ DirectiveSet* DirectivesStack::getMatchingDirective(methodHandle method, Abstrac while (dir != NULL) { if (dir->is_default_directive() || dir->match(method)) { match = dir->get_for(comp); - if (match == NULL) { - // temporary workaround for compilers without directives. - if (dir->is_default_directive()) { - // default dir is always enabled - // match c1 store - it contains all common flags even if C1 is unavailable - match = dir->_c1_store; - break; - } - } else { - if (match->EnableOption) { - // The directiveSet for this compile is also enabled -> success - break; - } + assert(match != NULL, "Consistency"); + if (match->EnableOption) { + // The directiveSet for this compile is also enabled -> success + dir->inc_refcount(); + break; } } dir = dir->next(); } } - guarantee(match != NULL, "There should always be a default directive that matches"); + // Check for legacy compile commands update, without DirectivesStack_lock return match->compilecommand_compatibility_init(method); } diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 39e8a4bde15..67bed192a3b 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -565,14 +565,15 @@ WB_ENTRY(jboolean, WB_IsIntrinsicAvailable(JNIEnv* env, jobject o, jobject metho methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(method_id)); DirectiveSet* directive; + AbstractCompiler* comp = CompileBroker::compiler((int)compLevel); if (compilation_context != NULL) { compilation_context_id = reflected_method_to_jmid(thread, env, compilation_context); CHECK_JNI_EXCEPTION_(env, JNI_FALSE); methodHandle cch(THREAD, Method::checked_resolve_jmethod_id(compilation_context_id)); - directive = DirectivesStack::getMatchingDirective(cch, CompileBroker::compiler((int)compLevel)); + directive = DirectivesStack::getMatchingDirective(cch, comp); } else { // Calling with NULL matches default directive - directive = DirectivesStack::getDefaultDirective(CompileBroker::compiler((int)compLevel)); + directive = DirectivesStack::getDefaultDirective(comp); } bool result = CompileBroker::compiler(compLevel)->is_intrinsic_available(mh, directive); DirectivesStack::release(directive); diff --git a/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java b/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java index d48702e6da0..ff2c7e366df 100644 --- a/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java +++ b/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java @@ -23,6 +23,8 @@ import java.lang.reflect.Executable; import java.util.concurrent.Callable; import java.util.Objects; + +import jdk.test.lib.*; import compiler.whitebox.CompilerWhiteBoxTest; /* * @test @@ -105,17 +107,16 @@ public class IntrinsicAvailableTest extends CompilerWhiteBoxTest { } } - protected boolean isServerVM() { - return VMName.toLowerCase().contains("server"); - } - public void test() throws Exception { Executable intrinsicMethod = testCase.getExecutable(); - if (isServerVM()) { + if (Platform.isServer()) { if (TIERED_COMPILATION) { checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_SIMPLE); } - checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_FULL_OPTIMIZATION); + // Dont bother check JVMCI compiler - returns false on all intrinsics. + if (!Boolean.valueOf(getVMOption("UseJVMCICompiler"))) { + checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_FULL_OPTIMIZATION); + } } else { checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_SIMPLE); } From 394ff6ff9a26dae4df144ce709bc16b4699d8af2 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Thu, 14 Jan 2016 14:34:36 +0100 Subject: [PATCH 052/212] 8146364: Remove @ServiceProvider mechanism from JVMCI Reviewed-by: twisti --- hotspot/.mx.jvmci/mx_jvmci.py | 18 +- hotspot/.mx.jvmci/suite.py | 73 ++---- hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk | 104 --------- ...k.vm.ci.hotspot.HotSpotJVMCIBackendFactory | 3 + .../AArch64HotSpotJVMCIBackendFactory.java | 5 +- .../AMD64HotSpotJVMCIBackendFactory.java | 2 - .../SPARCHotSpotJVMCIBackendFactory.java | 2 - .../hotspot/HotSpotJVMCICompilerConfig.java | 2 +- .../vm/ci/hotspot/HotSpotJVMCIRuntime.java | 2 +- .../javax.annotation.processing.Processor | 1 - .../processor/ServiceProviderProcessor.java | 119 ---------- .../jdk.vm.ci.service/.checkstyle_checks.xml | 213 ------------------ .../jdk/vm/ci/service/ServiceProvider.java | 39 ---- .../src/jdk/vm/ci/services}/Services.java | 2 +- 14 files changed, 38 insertions(+), 547 deletions(-) delete mode 100644 hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk create mode 100644 hotspot/src/jdk.vm.ci/share/classes/META-INF/services/jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/META-INF/services/javax.annotation.processing.Processor delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/jdk/vm/ci/service/processor/ServiceProviderProcessor.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/.checkstyle_checks.xml delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/ServiceProvider.java rename hotspot/src/jdk.vm.ci/share/classes/{jdk.vm.ci.service/src/jdk/vm/ci/service => jdk.vm.ci.services/src/jdk/vm/ci/services}/Services.java (99%) diff --git a/hotspot/.mx.jvmci/mx_jvmci.py b/hotspot/.mx.jvmci/mx_jvmci.py index d1069e6284c..097fca7423b 100644 --- a/hotspot/.mx.jvmci/mx_jvmci.py +++ b/hotspot/.mx.jvmci/mx_jvmci.py @@ -153,6 +153,13 @@ class JvmciJDKDeployedDist(object): def deploy(self, jdkDir): mx.nyi('deploy', self) + def post_parse_cmd_line(self): + self.set_archiveparticipant() + + def set_archiveparticipant(self): + dist = self.dist() + dist.set_archiveparticipant(JVMCIArchiveParticipant(dist)) + class ExtJDKDeployedDist(JvmciJDKDeployedDist): def __init__(self, name): JvmciJDKDeployedDist.__init__(self, name) @@ -668,15 +675,10 @@ class JVMCIArchiveParticipant: def __opened__(self, arc, srcArc, services): self.services = services + self.jvmciServices = services self.arc = arc def __add__(self, arcname, contents): - if arcname.startswith('META-INF/jvmci.providers/'): - provider = arcname[len('META-INF/jvmci.providers/'):] - for service in contents.strip().split(os.linesep): - assert service - self.services.setdefault(service, []).append(provider) - return True return False def __addsrc__(self, arcname, contents): @@ -864,6 +866,4 @@ def mx_post_parse_cmd_line(opts): _vm.update(jvmVariant, debugLevel, jvmciMode) for jdkDist in jdkDeployedDists: - dist = jdkDist.dist() - if isinstance(jdkDist, JvmciJDKDeployedDist): - dist.set_archiveparticipant(JVMCIArchiveParticipant(dist)) + jdkDist.post_parse_cmd_line() diff --git a/hotspot/.mx.jvmci/suite.py b/hotspot/.mx.jvmci/suite.py index 05d0027a8bb..3f79b9998c1 100644 --- a/hotspot/.mx.jvmci/suite.py +++ b/hotspot/.mx.jvmci/suite.py @@ -59,28 +59,19 @@ suite = { # ------------- JVMCI:Service ------------- - "jdk.vm.ci.service" : { + "jdk.vm.ci.services" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, - "jdk.vm.ci.service.processor" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "sourceDirs" : ["src"], - "dependencies" : ["jdk.vm.ci.service"], - "checkstyle" : "jdk.vm.ci.service", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,Codegen,HotSpot", - }, - # ------------- JVMCI:API ------------- "jdk.vm.ci.common" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -88,7 +79,7 @@ suite = { "jdk.vm.ci.meta" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -97,7 +88,7 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.meta"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -108,7 +99,7 @@ suite = { "dependencies" : [ "jdk.vm.ci.code", ], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -121,7 +112,7 @@ suite = { "jdk.vm.ci.common", "jdk.vm.ci.runtime", ], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -129,7 +120,7 @@ suite = { "jdk.vm.ci.inittimer" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI", }, @@ -140,7 +131,7 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.code"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,AArch64", }, @@ -149,7 +140,7 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.code"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,AMD64", }, @@ -158,7 +149,7 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.code"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,SPARC", }, @@ -171,9 +162,9 @@ suite = { "jdk.vm.ci.common", "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", - "jdk.vm.ci.service", + "jdk.vm.ci.services", ], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI", }, @@ -181,7 +172,7 @@ suite = { "jdk.vm.ci.hotspotvmconfig" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], - "checkstyle" : "jdk.vm.ci.service", + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,HotSpot", }, @@ -193,10 +184,7 @@ suite = { "jdk.vm.ci.aarch64", "jdk.vm.ci.hotspot", ], - "checkstyle" : "jdk.vm.ci.service", - "annotationProcessors" : [ - "JVMCI_SERVICE_PROCESSOR", - ], + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,HotSpot,AArch64", }, @@ -208,10 +196,7 @@ suite = { "jdk.vm.ci.amd64", "jdk.vm.ci.hotspot", ], - "checkstyle" : "jdk.vm.ci.service", - "annotationProcessors" : [ - "JVMCI_SERVICE_PROCESSOR", - ], + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,HotSpot,AMD64", }, @@ -223,10 +208,7 @@ suite = { "jdk.vm.ci.sparc", "jdk.vm.ci.hotspot", ], - "checkstyle" : "jdk.vm.ci.service", - "annotationProcessors" : [ - "JVMCI_SERVICE_PROCESSOR", - ], + "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", "workingSets" : "JVMCI,HotSpot,SPARC", }, @@ -241,9 +223,9 @@ suite = { # ------------- Distributions ------------- - "JVMCI_SERVICE" : { + "JVMCI_SERVICES" : { "subDir" : "src/jdk.vm.ci/share/classes", - "dependencies" : ["jdk.vm.ci.service"], + "dependencies" : ["jdk.vm.ci.services"], }, "JVMCI_API" : { @@ -257,7 +239,7 @@ suite = { "jdk.vm.ci.sparc", ], "distDependencies" : [ - "JVMCI_SERVICE", + "JVMCI_SERVICES", ], }, @@ -277,7 +259,7 @@ suite = { ], "distDependencies" : [ "JVMCI_HOTSPOTVMCONFIG", - "JVMCI_SERVICE", + "JVMCI_SERVICES", "JVMCI_API", ], }, @@ -293,28 +275,18 @@ suite = { "exclude" : ["mx:JUNIT"], }, - - "JVMCI_SERVICE_PROCESSOR" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "dependencies" : ["jdk.vm.ci.service.processor"], - "distDependencies" : [ - "JVMCI_SERVICE", - ], - }, - # This exists to have a monolithic jvmci.jar file which simplifies # using the -Xoverride option in JDK9. "JVMCI" : { "subDir" : "src/jdk.vm.ci/share/classes", "overlaps" : [ "JVMCI_API", - "JVMCI_SERVICE", + "JVMCI_SERVICES", "JVMCI_HOTSPOT", "JVMCI_HOTSPOTVMCONFIG", - "JVMCI_SERVICE_PROCESSOR", ], "dependencies" : [ - "jdk.vm.ci.service", + "jdk.vm.ci.services", "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", "jdk.vm.ci.common", @@ -325,7 +297,6 @@ suite = { "jdk.vm.ci.hotspot.aarch64", "jdk.vm.ci.hotspot.amd64", "jdk.vm.ci.hotspot.sparc", - "jdk.vm.ci.service.processor" ], }, }, diff --git a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk deleted file mode 100644 index 969330eec19..00000000000 --- a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk +++ /dev/null @@ -1,104 +0,0 @@ -# -# Copyright (c) 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. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -default: all - -include $(SPEC) -include MakeBase.gmk -include JavaCompilation.gmk -include SetupJavaCompilers.gmk - -GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.vm.ci -SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes - -################################################################################ -# Compile the annotation processor - -$(eval $(call SetupJavaCompilation, BUILD_JVMCI_SERVICE, \ - SETUP := GENERATE_OLDBYTECODE, \ - SRC := $(SRC_DIR)/jdk.vm.ci.service/src \ - $(SRC_DIR)/jdk.vm.ci.service.processor/src, \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/jvmci_service, \ - JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.service.jar, \ -)) - -################################################################################ - -PROC_SRC_SUBDIRS := \ - jdk.vm.ci.hotspot \ - jdk.vm.ci.hotspot.aarch64 \ - jdk.vm.ci.hotspot.amd64 \ - jdk.vm.ci.hotspot.sparc \ - jdk.vm.ci.runtime \ - # - -PROC_SRC_DIRS := $(patsubst %, $(SRC_DIR)/%/src, $(PROC_SRC_SUBDIRS)) - -PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS))) - -ALL_SRC_DIRS := $(wildcard $(SRC_DIR)/*/src) -SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS)) -PROCESSOR_PATH := $(call PathList, \ - $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.service.jar) - -$(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) \ - $(BUILD_JVMCI_SERVICE) - $(MKDIR) -p $(@D) - $(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files)) - $(JAVA_SMALL) $(NEW_JAVAC) \ - -XDignore.symbol.file \ - -sourcepath $(SOURCEPATH) \ - -implicit:none \ - -proc:only \ - -processorpath $(PROCESSOR_PATH) \ - -d $(GENSRC_DIR) \ - -s $(GENSRC_DIR) \ - @$(@D)/_gensrc_proc_files - $(TOUCH) $@ - -TARGETS += $(GENSRC_DIR)/_gensrc_proc_done - -################################################################################ - -$(GENSRC_DIR)/_providers_converted: $(GENSRC_DIR)/_gensrc_proc_done - $(MKDIR) -p $(GENSRC_DIR)/META-INF/services - ($(CD) $(GENSRC_DIR)/META-INF/jvmci.providers && \ - for i in $$($(LS)); do \ - c=$$($(CAT) $$i | $(TR) -d '\n\r'); \ - $(ECHO) $$i >> $(GENSRC_DIR)/META-INF/services/$$c.tmp; \ - done) - ($(CD) $(GENSRC_DIR)/META-INF/services && \ - for i in $$($(LS) *.tmp); do \ - $(MV) $$i $${i%.tmp}; \ - done) - $(TOUCH) $@ - -TARGETS += $(GENSRC_DIR)/_providers_converted - -################################################################################ - -all: $(TARGETS) - -.PHONY: default all diff --git a/hotspot/src/jdk.vm.ci/share/classes/META-INF/services/jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory b/hotspot/src/jdk.vm.ci/share/classes/META-INF/services/jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory new file mode 100644 index 00000000000..fe3a4573058 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/META-INF/services/jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory @@ -0,0 +1,3 @@ +jdk.vm.ci.hotspot.aarch64.AArch64HotSpotJVMCIBackendFactory +jdk.vm.ci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory +jdk.vm.ci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java index 6981820018b..79caafca05a 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java @@ -41,9 +41,7 @@ import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.inittimer.InitTimer; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.runtime.JVMCIBackend; -import jdk.vm.ci.service.ServiceProvider; -@ServiceProvider(HotSpotJVMCIBackendFactory.class) public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { protected EnumSet computeFeatures(@SuppressWarnings("unused") HotSpotVMConfig config) { @@ -124,8 +122,7 @@ public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFac } } - protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, - StackIntrospection stackIntrospection) { + protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, StackIntrospection stackIntrospection) { return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection); } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java index fb6eba20f92..69a31604560 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java @@ -41,9 +41,7 @@ import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.inittimer.InitTimer; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.runtime.JVMCIBackend; -import jdk.vm.ci.service.ServiceProvider; -@ServiceProvider(HotSpotJVMCIBackendFactory.class) public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { protected EnumSet computeFeatures(HotSpotVMConfig config) { diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java index f0f0b05190e..703167d99e3 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java @@ -39,11 +39,9 @@ import jdk.vm.ci.hotspot.HotSpotStackIntrospection; import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.inittimer.InitTimer; import jdk.vm.ci.runtime.JVMCIBackend; -import jdk.vm.ci.service.ServiceProvider; import jdk.vm.ci.sparc.SPARC; import jdk.vm.ci.sparc.SPARC.CPUFeature; -@ServiceProvider(HotSpotJVMCIBackendFactory.class) public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { protected TargetDescription createTarget(HotSpotVMConfig config) { diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java index 1e242413b63..c43e1dd5667 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java @@ -27,7 +27,7 @@ import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.runtime.JVMCICompilerFactory; import jdk.vm.ci.runtime.JVMCIRuntime; -import jdk.vm.ci.service.Services; +import jdk.vm.ci.services.Services; final class HotSpotJVMCICompilerConfig { diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index bf7f255d4db..8e0136362a4 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -48,7 +48,7 @@ import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.runtime.JVMCICompiler; -import jdk.vm.ci.service.Services; +import jdk.vm.ci.services.Services; import sun.misc.VM; //JaCoCo Exclude diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/META-INF/services/javax.annotation.processing.Processor deleted file mode 100644 index 72506df9cb8..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/META-INF/services/javax.annotation.processing.Processor +++ /dev/null @@ -1 +0,0 @@ -jdk.vm.ci.service.processor.ServiceProviderProcessor diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/jdk/vm/ci/service/processor/ServiceProviderProcessor.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/jdk/vm/ci/service/processor/ServiceProviderProcessor.java deleted file mode 100644 index d8aea467257..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service.processor/src/jdk/vm/ci/service/processor/ServiceProviderProcessor.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.service.processor; - -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.util.HashSet; -import java.util.Set; - -import javax.annotation.processing.AbstractProcessor; -import javax.annotation.processing.RoundEnvironment; -import javax.annotation.processing.SupportedAnnotationTypes; -import javax.lang.model.SourceVersion; -import javax.lang.model.element.Element; -import javax.lang.model.element.TypeElement; -import javax.lang.model.type.MirroredTypeException; -import javax.lang.model.type.TypeMirror; -import javax.tools.Diagnostic.Kind; -import javax.tools.FileObject; -import javax.tools.StandardLocation; - -import jdk.vm.ci.service.ServiceProvider; - -@SupportedAnnotationTypes("jdk.vm.ci.service.ServiceProvider") -public class ServiceProviderProcessor extends AbstractProcessor { - - private final Set processed = new HashSet<>(); - - @Override - public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latest(); - } - - private boolean verifyAnnotation(TypeMirror serviceInterface, TypeElement serviceProvider) { - if (!processingEnv.getTypeUtils().isSubtype(serviceProvider.asType(), serviceInterface)) { - String msg = String.format("Service provider class %s must implement service interface %s", serviceProvider.getSimpleName(), serviceInterface); - processingEnv.getMessager().printMessage(Kind.ERROR, msg, serviceProvider); - return false; - } - - return true; - } - - private void processElement(TypeElement serviceProvider) { - if (processed.contains(serviceProvider)) { - return; - } - - processed.add(serviceProvider); - ServiceProvider annotation = serviceProvider.getAnnotation(ServiceProvider.class); - if (annotation != null) { - try { - annotation.value(); - } catch (MirroredTypeException ex) { - TypeMirror serviceInterface = ex.getTypeMirror(); - if (verifyAnnotation(serviceInterface, serviceProvider)) { - String interfaceName = ex.getTypeMirror().toString(); - createProviderFile(serviceProvider, interfaceName); - } - } - } - } - - private void createProviderFile(TypeElement serviceProvider, String interfaceName) { - if (serviceProvider.getNestingKind().isNested()) { - // This is a simplifying constraint that means we don't have to - // processed the qualified name to insert '$' characters at - // the relevant positions. - String msg = String.format("Service provider class %s must be a top level class", serviceProvider.getSimpleName()); - processingEnv.getMessager().printMessage(Kind.ERROR, msg, serviceProvider); - return; - } - - String filename = "META-INF/jvmci.providers/" + serviceProvider.getQualifiedName(); - try { - FileObject file = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", filename, serviceProvider); - PrintWriter writer = new PrintWriter(new OutputStreamWriter(file.openOutputStream(), "UTF-8")); - writer.println(interfaceName); - writer.close(); - } catch (IOException e) { - processingEnv.getMessager().printMessage(Kind.ERROR, e.getMessage(), serviceProvider); - } - } - - @Override - public boolean process(Set annotations, RoundEnvironment roundEnv) { - if (roundEnv.processingOver()) { - return true; - } - - for (Element element : roundEnv.getElementsAnnotatedWith(ServiceProvider.class)) { - assert element.getKind().isClass(); - processElement((TypeElement) element); - } - - return true; - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/.checkstyle_checks.xml b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/.checkstyle_checks.xml deleted file mode 100644 index 003d8f7dcb5..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/.checkstyle_checks.xml +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/ServiceProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/ServiceProvider.java deleted file mode 100644 index 4d8a7f9692b..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/ServiceProvider.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.service; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotates a service provider than can be loaded via {@linkplain Services#load(Class)} or - * {@link Services#loadSingle(Class, boolean)}. - */ -@Retention(RetentionPolicy.CLASS) -@Target(ElementType.TYPE) -public @interface ServiceProvider { - - Class value(); -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/Services.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java similarity index 99% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/Services.java rename to hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java index 9a6263a9b99..be4a1cc1afa 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.service/src/jdk/vm/ci/service/Services.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.vm.ci.service; +package jdk.vm.ci.services; import java.util.Formatter; import java.util.Iterator; From 4b3b8b4f59097da2d222db421769a16e86b55a32 Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Fri, 15 Jan 2016 16:36:43 +0300 Subject: [PATCH 053/212] 8145025: compiler/compilercontrol/commandfile/CompileOnlyTest.java and compiler/compilercontrol/commands/CompileOnlyTest.java fail: java.lang.RuntimeException: Fix incorrect compileonly setting Reviewed-by: kvn, neliasso --- .../share/scenario/AbstractCommandBuilder.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java b/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java index 0d78cadd8e0..eafbefb31f1 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java @@ -105,15 +105,15 @@ public abstract class AbstractCommandBuilder Map states = new HashMap<>(); for (Pair> pair : METHODS) { Executable exec = pair.first; - State state = getState(commandList, states, exec); + State state = getState(commandList, exec); states.put(exec, state); } return states; } private State getState(List commandList, - Map states, Executable exec) { - State state = states.getOrDefault(exec, new State()); + Executable exec) { + State state = new State(); MethodDescriptor execDesc = new MethodDescriptor(exec); for (CompileCommand compileCommand : commandList) { if (compileCommand.isValid()) { @@ -149,7 +149,8 @@ public abstract class AbstractCommandBuilder && (compileCommand.command == Command.COMPILEONLY)) { MethodDescriptor md = compileCommand.methodDescriptor; if (!execDesc.getCanonicalString().matches(md.getRegexp()) - && (state.getCompilableOptional( + // if compilation state wasn't set before + && (!state.getCompilableOptional( // no matter C1, C2 or both Scenario.Compiler.C2).isPresent())) { /* compileonly excludes only methods that haven't been From 28046ae3214d6cbf5a7dae97507c6d65de2fbbe8 Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Fri, 15 Jan 2016 21:56:40 +0300 Subject: [PATCH 054/212] 8140001: _allocateInstance intrinsic does not throw InstantiationException for abstract classes and interfaces Reviewed-by: kvn, shade --- hotspot/src/share/vm/ci/ciInstanceKlass.hpp | 6 ++- hotspot/src/share/vm/opto/escape.cpp | 1 + hotspot/src/share/vm/opto/graphKit.cpp | 3 +- .../test/runtime/Unsafe/AllocateInstance.java | 50 +++++++++++++------ 4 files changed, 42 insertions(+), 18 deletions(-) diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp index b0d3234af6e..d55d272842d 100644 --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp @@ -174,7 +174,6 @@ public: return 2; } } - bool has_default_methods() { assert(is_loaded(), "must be loaded"); return _has_default_methods; @@ -261,6 +260,11 @@ public: return NULL; } + bool can_be_instantiated() { + assert(is_loaded(), "must be loaded"); + return !is_interface() && !is_abstract(); + } + // Dump the current state of this klass for compilation replay. virtual void dump_replay_data(outputStream* out); }; diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index 98bade2457e..310ac7fa70e 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -810,6 +810,7 @@ void ConnectionGraph::add_call_node(CallNode* call) { if (cik->is_subclass_of(_compile->env()->Thread_klass()) || cik->is_subclass_of(_compile->env()->Reference_klass()) || !cik->is_instance_klass() || // StressReflectiveCode + !cik->as_instance_klass()->can_be_instantiated() || cik->as_instance_klass()->has_finalizer()) { es = PointsToNode::GlobalEscape; } diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index 97ae61503a0..3b9ce36cfaa 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -3407,8 +3407,7 @@ Node* GraphKit::new_instance(Node* klass_node, if (layout_is_con) { assert(!StressReflectiveCode, "stress mode does not use these paths"); bool must_go_slow = Klass::layout_helper_needs_slow_path(layout_con); - initial_slow_test = must_go_slow? intcon(1): extra_slow_test; - + initial_slow_test = must_go_slow ? intcon(1) : extra_slow_test; } else { // reflective case // This reflective path is used by Unsafe.allocateInstance. // (It may be stress-tested by specifying StressReflectiveCode.) diff --git a/hotspot/test/runtime/Unsafe/AllocateInstance.java b/hotspot/test/runtime/Unsafe/AllocateInstance.java index 9beb7219e0b..4393a081de4 100644 --- a/hotspot/test/runtime/Unsafe/AllocateInstance.java +++ b/hotspot/test/runtime/Unsafe/AllocateInstance.java @@ -35,21 +35,7 @@ import sun.misc.Unsafe; import static jdk.test.lib.Asserts.*; public class AllocateInstance { - public static void main(String args[]) throws Exception { - Unsafe unsafe = Utils.getUnsafe(); - - // allocateInstance() should not result in a call to the constructor - TestClass tc = (TestClass)unsafe.allocateInstance(TestClass.class); - assertFalse(tc.calledConstructor); - - // allocateInstance() on an abstract class should result in an InstantiationException - try { - AbstractClass ac = (AbstractClass)unsafe.allocateInstance(AbstractClass.class); - throw new RuntimeException("Did not get expected InstantiationException"); - } catch (InstantiationException e) { - // Expected - } - } + static final Unsafe UNSAFE = Utils.getUnsafe(); class TestClass { public boolean calledConstructor = false; @@ -59,7 +45,41 @@ public class AllocateInstance { } } + static void testConstructorCall() throws InstantiationException { + // allocateInstance() should not result in a call to the constructor + TestClass tc = (TestClass)UNSAFE.allocateInstance(TestClass.class); + assertFalse(tc.calledConstructor); + } + abstract class AbstractClass { public AbstractClass() {} } + + static void testAbstractClass() { + try { + AbstractClass ac = (AbstractClass) UNSAFE.allocateInstance(AbstractClass.class); + throw new AssertionError("Should throw InstantiationException for an abstract class"); + } catch (InstantiationException e) { + // Expected + } + } + + interface AnInterface {} + + static void testInterface() { + try { + AnInterface ai = (AnInterface) UNSAFE.allocateInstance(AnInterface.class); + throw new AssertionError("Should throw InstantiationException for an interface"); + } catch (InstantiationException e) { + // Expected + } + } + + public static void main(String args[]) throws Exception { + for (int i = 0; i < 20_000; i++) { + testConstructorCall(); + testAbstractClass(); + testInterface(); + } + } } From 281c7eb89506ab0e93a57d0ecadbfa695cb45115 Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Fri, 15 Jan 2016 21:56:42 +0300 Subject: [PATCH 055/212] 6985422: flush the output streams before OnError commands Reviewed-by: kvn --- hotspot/src/share/vm/utilities/vmError.cpp | 66 +++++++++++----------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index 23c3195db4d..2f90eff698b 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -1234,38 +1234,6 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt log_done = true; } - - static bool skip_OnError = false; - if (!skip_OnError && OnError && OnError[0]) { - skip_OnError = true; - - out.print_raw_cr("#"); - out.print_raw ("# -XX:OnError=\""); - out.print_raw (OnError); - out.print_raw_cr("\""); - - char* cmd; - const char* ptr = OnError; - while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){ - out.print_raw ("# Executing "); -#if defined(LINUX) || defined(_ALLBSD_SOURCE) - out.print_raw ("/bin/sh -c "); -#elif defined(SOLARIS) - out.print_raw ("/usr/bin/sh -c "); -#endif - out.print_raw ("\""); - out.print_raw (cmd); - out.print_raw_cr("\" ..."); - - if (os::fork_and_exec(cmd) < 0) { - out.print_cr("os::fork_and_exec failed: %s (%d)", strerror(errno), errno); - } - } - - // done with OnError - OnError = NULL; - } - static bool skip_replay = ReplayCompiles; // Do not overwrite file during replay if (DumpReplayDataOnError && _thread && _thread->is_Compiler_thread() && !skip_replay) { skip_replay = true; @@ -1295,6 +1263,40 @@ void VMError::report_and_die(int id, const char* message, const char* detail_fmt print_bug_submit_message(&out, _thread); } + static bool skip_OnError = false; + if (!skip_OnError && OnError && OnError[0]) { + skip_OnError = true; + + // Flush output and finish logs before running OnError commands. + ostream_abort(); + + out.print_raw_cr("#"); + out.print_raw ("# -XX:OnError=\""); + out.print_raw (OnError); + out.print_raw_cr("\""); + + char* cmd; + const char* ptr = OnError; + while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){ + out.print_raw ("# Executing "); +#if defined(LINUX) || defined(_ALLBSD_SOURCE) + out.print_raw ("/bin/sh -c "); +#elif defined(SOLARIS) + out.print_raw ("/usr/bin/sh -c "); +#endif + out.print_raw ("\""); + out.print_raw (cmd); + out.print_raw_cr("\" ..."); + + if (os::fork_and_exec(cmd) < 0) { + out.print_cr("os::fork_and_exec failed: %s (%d)", strerror(errno), errno); + } + } + + // done with OnError + OnError = NULL; + } + if (!UseOSErrorReporting) { // os::abort() will call abort hooks, try it first. static bool skip_os_abort = false; From 22de0c428de84811adab0640ca6ba949dbc13e3e Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Fri, 15 Jan 2016 21:56:43 +0300 Subject: [PATCH 056/212] 8146983: C1: assert(appendix.not_null()) failed for invokehandle bytecode Reviewed-by: roland --- hotspot/src/share/vm/c1/c1_Runtime1.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 6af956bb672..e0f9060eb56 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -964,7 +964,7 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i assert(cache_index >= 0 && cache_index < pool->cache()->length(), "unexpected cache index"); ConstantPoolCacheEntry* cpce = pool->cache()->entry_at(cache_index); cpce->set_method_handle(pool, info); - appendix = info.resolved_appendix(); // just in case somebody already resolved the entry + appendix = cpce->appendix_if_resolved(pool); // just in case somebody already resolved the entry break; } case Bytecodes::_invokedynamic: { @@ -975,8 +975,6 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i } default: fatal("unexpected bytecode for load_appendix_patching_id"); } - assert(appendix.not_null(), "%s @ %d (%s)", - caller_method->name_and_sig_as_C_string(), bci, Bytecodes::name(bc)); } else { ShouldNotReachHere(); } From 01f58aa4da0070ba21cea9f5fb7041e342815ecf Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Fri, 15 Jan 2016 13:08:40 -1000 Subject: [PATCH 057/212] 8146820: JVMCI options should not use System.getProperty directly Reviewed-by: kvn, dnsimon --- .../HotSpotConstantReflectionProvider.java | 10 +- .../vm/ci/hotspot/HotSpotJVMCIRuntime.java | 110 ++++++++++++++++-- .../hotspot/HotSpotResolvedJavaFieldImpl.java | 8 +- .../HotSpotResolvedJavaMethodImpl.java | 6 +- .../src/jdk/vm/ci/inittimer/InitTimer.java | 5 +- 5 files changed, 109 insertions(+), 30 deletions(-) diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java index ffe53825947..285994a4994 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java @@ -27,6 +27,7 @@ import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import java.lang.reflect.Array; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.JavaConstant; @@ -42,11 +43,6 @@ import jdk.vm.ci.meta.ResolvedJavaType; */ public class HotSpotConstantReflectionProvider implements ConstantReflectionProvider, HotSpotProxified { - /** - * Determines whether to treat {@code final} fields with default values as constant. - */ - private static final boolean TrustFinalDefaultFields = HotSpotJVMCIRuntime.getBooleanProperty("TrustFinalDefaultFields", true); - protected final HotSpotJVMCIRuntimeProvider runtime; protected final HotSpotMethodHandleAccessProvider methodHandleAccess; protected final HotSpotMemoryAccessProviderImpl memoryAccess; @@ -249,14 +245,14 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv * Determines if a value read from a {@code final} instance field is considered constant. The * implementation in {@link HotSpotConstantReflectionProvider} returns true if {@code value} is * not the {@link JavaConstant#isDefaultForKind default value} for its kind or if - * {@link #TrustFinalDefaultFields} is true. + * {@link Option#TrustFinalDefaultFields} is true. * * @param value a value read from a {@code final} instance field * @param receiverClass the {@link Object#getClass() class} of object from which the * {@code value} was read */ protected boolean isFinalInstanceFieldValueConstant(JavaConstant value, Class receiverClass) { - return !value.isDefaultForKind() || TrustFinalDefaultFields; + return !value.isDefaultForKind() || Option.TrustFinalDefaultFields.getBoolean(); } /** diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index 9bbca3ec278..440d901cab6 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -26,6 +26,7 @@ import static jdk.vm.ci.inittimer.InitTimer.timer; import java.io.IOException; import java.io.OutputStream; +import java.io.PrintStream; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.Method; @@ -85,19 +86,95 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H } /** - * Gets a boolean value based on a system property {@linkplain VM#getSavedProperty(String) - * saved} at system initialization time. The property name is prefixed with "{@code jvmci.}". - * - * @param name the name of the system property to derive a boolean value from using - * {@link Boolean#parseBoolean(String)} - * @param def the value to return if there is no system property corresponding to {@code name} + * A list of all supported JVMCI options. */ - public static boolean getBooleanProperty(String name, boolean def) { - String value = VM.getSavedProperty("jvmci." + name); - if (value == null) { - return def; + public enum Option { + ImplicitStableValues(boolean.class, true, "Mark well-known stable fields as such."), + // Note: The following one is not used (see InitTimer.ENABLED). + InitTimer(boolean.class, false, "Specifies if initialization timing is enabled."), + PrintConfig(boolean.class, false, "Prints all HotSpotVMConfig fields."), + PrintFlags(boolean.class, false, "Prints all JVMCI flags and exits."), + ShowFlags(boolean.class, false, "Prints all JVMCI flags and continues."), + TraceMethodDataFilter(String.class, null, ""), + TrustFinalDefaultFields(boolean.class, true, "Determines whether to treat final fields with default values as constant."); + + /** + * The prefix for system properties that are JVMCI options. + */ + private static final String JVMCI_OPTION_PROPERTY_PREFIX = "jvmci."; + + /** + * Marker for uninitialized flags. + */ + private static final String UNINITIALIZED = "UNINITIALIZED"; + + private final Class type; + private Object value; + private final Object defaultValue; + private boolean isDefault; + private final String help; + + private Option(Class type, Object defaultValue, String help) { + assert Character.isUpperCase(name().charAt(0)) : "Option name must start with upper-case letter: " + name(); + this.type = type; + this.value = UNINITIALIZED; + this.defaultValue = defaultValue; + this.help = help; + } + + private Object getValue() { + if (value == UNINITIALIZED) { + String propertyValue = VM.getSavedProperty(JVMCI_OPTION_PROPERTY_PREFIX + name()); + if (propertyValue == null) { + this.value = defaultValue; + this.isDefault = true; + } else { + if (type == boolean.class) { + this.value = Boolean.parseBoolean(propertyValue); + } else if (type == String.class) { + this.value = propertyValue; + } else { + throw new JVMCIError("Unexpected option type " + type); + } + this.isDefault = false; + } + // Saved properties should not be interned - let's be sure + assert value != UNINITIALIZED; + } + return value; + } + + /** + * Returns the option's value as boolean. + * + * @return option's value + */ + public boolean getBoolean() { + return (boolean) getValue(); + } + + /** + * Returns the option's value as String. + * + * @return option's value + */ + public String getString() { + return (String) getValue(); + } + + /** + * Prints all option flags to {@code out}. + * + * @param out stream to print to + */ + public static void printFlags(PrintStream out) { + out.println("[List of JVMCI options]"); + for (Option option : values()) { + Object value = option.getValue(); + String assign = option.isDefault ? ":=" : " ="; + out.printf("%9s %-40s %s %-14s %s%n", option.type.getSimpleName(), option, assign, value, option.help); + } } - return Boolean.parseBoolean(value); } public static HotSpotJVMCIBackendFactory findFactory(String architecture) { @@ -164,7 +241,16 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H } metaAccessContext = context; - if (Boolean.valueOf(System.getProperty("jvmci.printconfig"))) { + boolean printFlags = Option.PrintFlags.getBoolean(); + boolean showFlags = Option.ShowFlags.getBoolean(); + if (printFlags || showFlags) { + Option.printFlags(System.out); + if (printFlags) { + System.exit(0); + } + } + + if (Option.PrintConfig.getBoolean()) { printConfig(config, compilerToVm); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java index c6f4dabc0fb..f516412fa6e 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java @@ -29,6 +29,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Field; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.LocationIdentity; import jdk.vm.ci.meta.MetaAccessProvider; @@ -41,11 +42,6 @@ import jdk.vm.ci.meta.ResolvedJavaType; */ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField, HotSpotProxified { - /** - * Mark well-known stable fields as such. - */ - private static final boolean ImplicitStableValues = HotSpotJVMCIRuntime.getBooleanProperty("ImplicitStableValues", true); - private final HotSpotResolvedObjectTypeImpl holder; private final String name; private JavaType type; @@ -198,7 +194,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField, HotSpotP return true; } assert getAnnotation(Stable.class) == null; - if (ImplicitStableValues && isImplicitStableField()) { + if (Option.ImplicitStableValues.getBoolean() && isImplicitStableField()) { return true; } return false; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java index 5999d8c204f..9017ffde58d 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.Map; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.ConstantPool; import jdk.vm.ci.meta.DefaultProfilingInfo; @@ -417,8 +418,6 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp return false; } - private static final String TraceMethodDataFilter = System.getProperty("jvmci.traceMethodDataFilter"); - @Override public ProfilingInfo getProfilingInfo(boolean includeNormal, boolean includeOSR) { ProfilingInfo info; @@ -427,7 +426,8 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp long metaspaceMethodData = UNSAFE.getAddress(metaspaceMethod + config().methodDataOffset); if (metaspaceMethodData != 0) { methodData = new HotSpotMethodData(metaspaceMethodData, this); - if (TraceMethodDataFilter != null && this.format("%H.%n").contains(TraceMethodDataFilter)) { + String methodDataFilter = Option.TraceMethodDataFilter.getString(); + if (methodDataFilter != null && this.format("%H.%n").contains(methodDataFilter)) { System.out.println("Raw method data for " + this.format("%H.%n(%p)") + ":"); System.out.println(methodData.toString()); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java index 921b537bfb1..01fad3d82be 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java @@ -65,9 +65,10 @@ public final class InitTimer implements AutoCloseable { } /** - * Specifies if initialization timing is enabled. + * Specifies if initialization timing is enabled. Note: This property cannot use + * {@code HotSpotJVMCIRuntime.Option} since that class is not visible from this package. */ - private static final boolean ENABLED = Boolean.getBoolean("jvmci.inittimer") || Boolean.getBoolean("jvmci.runtime.TimeInit"); + private static final boolean ENABLED = Boolean.getBoolean("jvmci.InitTimer"); public static final AtomicInteger nesting = ENABLED ? new AtomicInteger() : null; public static final String SPACES = " "; From 90ac004ff6f2e7bfd788dc12afa590a47ca45dfc Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Mon, 18 Jan 2016 08:25:26 +0100 Subject: [PATCH 058/212] 8147444: compiler/jsr292/NonInlinedCall/RedefineTest.java fails with NullPointerException in ClassFileInstaller Removed installing of unused class. Added error output to ClassFileInstaller. Reviewed-by: vlivanov, zmajo --- .../test/compiler/jsr292/NonInlinedCall/RedefineTest.java | 3 +-- hotspot/test/testlibrary/ClassFileInstaller.java | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java index 884295cf77e..51481e87bb4 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,6 @@ * sun.hotspot.WhiteBox$WhiteBoxPermission * java.lang.invoke.RedefineTest * Agent - * jdk.test.lib.Asserts * @run main Agent agent.jar java.lang.invoke.RedefineTest * @run main/othervm -Xbootclasspath/a:. -javaagent:agent.jar * -XX:+IgnoreUnrecognizedVMOptions diff --git a/hotspot/test/testlibrary/ClassFileInstaller.java b/hotspot/test/testlibrary/ClassFileInstaller.java index 303e96e5a87..4e042dacde4 100644 --- a/hotspot/test/testlibrary/ClassFileInstaller.java +++ b/hotspot/test/testlibrary/ClassFileInstaller.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,6 +21,7 @@ * questions. */ +import java.io.FileNotFoundException; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; @@ -42,6 +43,9 @@ public class ClassFileInstaller { // Convert dotted class name to a path to a class file String pathName = arg.replace('.', '/').concat(".class"); InputStream is = cl.getResourceAsStream(pathName); + if (is == null) { + throw new FileNotFoundException(pathName); + } // Create the class file's package directory Path p = Paths.get(pathName); From 01a4b31e786ed2d4ec632e9369e6fe72956cf12e Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Mon, 18 Jan 2016 08:34:14 +0100 Subject: [PATCH 059/212] 8144212: JDK 9 b93 breaks Apache Lucene due to compact strings String compress/inflate intrinsics need to capture char and byte memory. Reviewed-by: aph, roland, kvn --- hotspot/src/share/vm/opto/graphKit.cpp | 47 +++++++++-- hotspot/src/share/vm/opto/graphKit.hpp | 5 +- hotspot/src/share/vm/opto/library_call.cpp | 6 +- hotspot/src/share/vm/opto/stringopts.cpp | 2 +- .../string/TestStringIntrinsicMemoryFlow.java | 83 +++++++++++++++++++ 5 files changed, 129 insertions(+), 14 deletions(-) create mode 100644 hotspot/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index 3b9ce36cfaa..adbda86808b 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -4340,20 +4340,51 @@ void GraphKit::store_String_coder(Node* ctrl, Node* str, Node* value) { value, T_BYTE, coder_field_idx, MemNode::unordered); } -Node* GraphKit::compress_string(Node* src, Node* dst, Node* count) { +// Capture src and dst memory state with a MergeMemNode +Node* GraphKit::capture_memory(const TypePtr* src_type, const TypePtr* dst_type) { + if (src_type == dst_type) { + // Types are equal, we don't need a MergeMemNode + return memory(src_type); + } + MergeMemNode* merge = MergeMemNode::make(map()->memory()); + record_for_igvn(merge); // fold it up later, if possible + int src_idx = C->get_alias_index(src_type); + int dst_idx = C->get_alias_index(dst_type); + merge->set_memory_at(src_idx, memory(src_idx)); + merge->set_memory_at(dst_idx, memory(dst_idx)); + return merge; +} + +Node* GraphKit::compress_string(Node* src, const TypeAryPtr* src_type, Node* dst, Node* count) { assert(Matcher::match_rule_supported(Op_StrCompressedCopy), "Intrinsic not supported"); - uint idx = C->get_alias_index(TypeAryPtr::BYTES); - StrCompressedCopyNode* str = new StrCompressedCopyNode(control(), memory(idx), src, dst, count); + assert(src_type == TypeAryPtr::BYTES || src_type == TypeAryPtr::CHARS, "invalid source type"); + // If input and output memory types differ, capture both states to preserve + // the dependency between preceding and subsequent loads/stores. + // For example, the following program: + // StoreB + // compress_string + // LoadB + // has this memory graph (use->def): + // LoadB -> compress_string -> CharMem + // ... -> StoreB -> ByteMem + // The intrinsic hides the dependency between LoadB and StoreB, causing + // the load to read from memory not containing the result of the StoreB. + // The correct memory graph should look like this: + // LoadB -> compress_string -> MergeMem(CharMem, StoreB(ByteMem)) + Node* mem = capture_memory(src_type, TypeAryPtr::BYTES); + StrCompressedCopyNode* str = new StrCompressedCopyNode(control(), mem, src, dst, count); Node* res_mem = _gvn.transform(new SCMemProjNode(str)); - set_memory(res_mem, idx); + set_memory(res_mem, TypeAryPtr::BYTES); return str; } -void GraphKit::inflate_string(Node* src, Node* dst, Node* count) { +void GraphKit::inflate_string(Node* src, Node* dst, const TypeAryPtr* dst_type, Node* count) { assert(Matcher::match_rule_supported(Op_StrInflatedCopy), "Intrinsic not supported"); - uint idx = C->get_alias_index(TypeAryPtr::BYTES); - StrInflatedCopyNode* str = new StrInflatedCopyNode(control(), memory(idx), src, dst, count); - set_memory(_gvn.transform(str), idx); + assert(dst_type == TypeAryPtr::BYTES || dst_type == TypeAryPtr::CHARS, "invalid dest type"); + // Capture src and dst memory (see comment in 'compress_string'). + Node* mem = capture_memory(TypeAryPtr::BYTES, dst_type); + StrInflatedCopyNode* str = new StrInflatedCopyNode(control(), mem, src, dst, count); + set_memory(_gvn.transform(str), dst_type); } void GraphKit::inflate_string_slow(Node* src, Node* dst, Node* start, Node* count) { diff --git a/hotspot/src/share/vm/opto/graphKit.hpp b/hotspot/src/share/vm/opto/graphKit.hpp index 4b4be335cd3..1c3ec75f26b 100644 --- a/hotspot/src/share/vm/opto/graphKit.hpp +++ b/hotspot/src/share/vm/opto/graphKit.hpp @@ -881,8 +881,9 @@ class GraphKit : public Phase { Node* load_String_coder(Node* ctrl, Node* str); void store_String_value(Node* ctrl, Node* str, Node* value); void store_String_coder(Node* ctrl, Node* str, Node* value); - Node* compress_string(Node* src, Node* dst, Node* count); - void inflate_string(Node* src, Node* dst, Node* count); + Node* capture_memory(const TypePtr* src_type, const TypePtr* dst_type); + Node* compress_string(Node* src, const TypeAryPtr* src_type, Node* dst, Node* count); + void inflate_string(Node* src, Node* dst, const TypeAryPtr* dst_type, Node* count); void inflate_string_slow(Node* src, Node* dst, Node* start, Node* count); // Handy for making control flow diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 97b511aa97e..867cb00ec9b 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -1359,9 +1359,9 @@ bool LibraryCallKit::inline_string_copy(bool compress) { // 'dst_start' points to dst array + scaled offset Node* count = NULL; if (compress) { - count = compress_string(src_start, dst_start, length); + count = compress_string(src_start, TypeAryPtr::get_array_body_type(src_elem), dst_start, length); } else { - inflate_string(src_start, dst_start, length); + inflate_string(src_start, dst_start, TypeAryPtr::get_array_body_type(dst_elem), length); } if (alloc != NULL) { @@ -1587,7 +1587,7 @@ bool LibraryCallKit::inline_string_char_access(bool is_store) { (void) store_to_memory(control(), adr, ch, T_CHAR, TypeAryPtr::BYTES, MemNode::unordered, false, false, true /* mismatched */); } else { - ch = make_load(control(), adr, TypeInt::CHAR, T_CHAR, MemNode::unordered, + ch = make_load(control(), adr, TypeInt::CHAR, T_CHAR, TypeAryPtr::BYTES, MemNode::unordered, LoadNode::DependsOnlyOnTest, false, false, true /* mismatched */); set_result(ch); } diff --git a/hotspot/src/share/vm/opto/stringopts.cpp b/hotspot/src/share/vm/opto/stringopts.cpp index 8a7556490f2..79036c9d539 100644 --- a/hotspot/src/share/vm/opto/stringopts.cpp +++ b/hotspot/src/share/vm/opto/stringopts.cpp @@ -1466,7 +1466,7 @@ void PhaseStringOpts::copy_latin1_string(GraphKit& kit, IdealKit& ideal, Node* s // Use fast intrinsic Node* src = kit.array_element_address(src_array, kit.intcon(0), T_BYTE); Node* dst = kit.array_element_address(dst_array, start, T_BYTE); - kit.inflate_string(src, dst, __ value(count)); + kit.inflate_string(src, dst, TypeAryPtr::BYTES, __ value(count)); } else { // No intrinsic available, use slow method kit.inflate_string_slow(src_array, dst_array, start, __ value(count)); diff --git a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java new file mode 100644 index 00000000000..86d7b309179 --- /dev/null +++ b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsicMemoryFlow.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import jdk.test.lib.Asserts; + +/* + * @test + * @bug 8144212 + * @summary Check for correct memory flow with the String compress/inflate intrinsics. + * @library /testlibrary + * @run main TestStringIntrinsicMemoryFlow + */ +public class TestStringIntrinsicMemoryFlow { + + public static void main(String[] args) { + for (int i = 0; i < 100_000; ++i) { + String s = "MyString"; + char[] c = {'M'}; + char res = testInflate1(s); + Asserts.assertEquals(res, 'M', "testInflate1 failed"); + res = testInflate2(s); + Asserts.assertEquals(res, (char)42, "testInflate2 failed"); + res = testCompress1(c); + Asserts.assertEquals(res, 'M', "testCompress1 failed"); + byte resB = testCompress2(c); + Asserts.assertEquals(resB, (byte)42, "testCompress2 failed"); + } + } + + private static char testInflate1(String s) { + char c[] = new char[1]; + // Inflate String from byte[] to char[] + s.getChars(0, 1, c, 0); + // Read char[] memory written by inflate intrinsic + return c[0]; + } + + private static char testInflate2(String s) { + char c1[] = new char[1]; + char c2[] = new char[1]; + c2[0] = 42; + // Inflate String from byte[] to char[] + s.getChars(0, 1, c1, 0); + // Read char[] memory written before inflation + return c2[0]; + } + + private static char testCompress1(char[] c) { + // Compress String from char[] to byte[] + String s = new String(c); + // Read the memory written by compress intrinsic + return s.charAt(0); + } + + private static byte testCompress2(char[] c) { + byte b1[] = new byte[1]; + b1[0] = 42; + // Compress String from char[] to byte[] + new String(c); + // Read byte[] memory written before compression + return b1[0]; + } +} From ca5620097762c364439116298b7d5c17e2c70bf4 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Mon, 18 Jan 2016 08:40:25 +0100 Subject: [PATCH 060/212] 6675699: need comprehensive fix for unconstrained ConvI2L with narrowed type Emit CastII to make narrow ConvI2L dependent on the corresponding range check. Reviewed-by: kvn, roland --- hotspot/src/share/vm/opto/arraycopynode.hpp | 1 - hotspot/src/share/vm/opto/castnode.cpp | 17 +++ hotspot/src/share/vm/opto/castnode.hpp | 24 ++++- hotspot/src/share/vm/opto/cfgnode.hpp | 7 -- hotspot/src/share/vm/opto/compile.cpp | 67 +++++++++++- hotspot/src/share/vm/opto/compile.hpp | 25 ++++- hotspot/src/share/vm/opto/convertnode.cpp | 18 +++- hotspot/src/share/vm/opto/graphKit.cpp | 47 +++++--- hotspot/src/share/vm/opto/graphKit.hpp | 4 +- hotspot/src/share/vm/opto/ifnode.cpp | 3 +- hotspot/src/share/vm/opto/loopTransform.cpp | 23 +++- hotspot/src/share/vm/opto/loopopts.cpp | 4 + hotspot/src/share/vm/opto/node.cpp | 15 +++ hotspot/src/share/vm/opto/node.hpp | 3 + hotspot/src/share/vm/opto/parse2.cpp | 14 ++- hotspot/src/share/vm/opto/phaseX.cpp | 5 + hotspot/src/share/vm/opto/superword.cpp | 11 ++ .../compiler/loopopts/TestLoopPeeling.java | 100 ++++++++++++++++++ 18 files changed, 344 insertions(+), 44 deletions(-) create mode 100644 hotspot/test/compiler/loopopts/TestLoopPeeling.java diff --git a/hotspot/src/share/vm/opto/arraycopynode.hpp b/hotspot/src/share/vm/opto/arraycopynode.hpp index 468b5463da2..e17ea1f57a6 100644 --- a/hotspot/src/share/vm/opto/arraycopynode.hpp +++ b/hotspot/src/share/vm/opto/arraycopynode.hpp @@ -89,7 +89,6 @@ private: static const TypePtr* get_address_type(PhaseGVN *phase, Node* n); Node* try_clone_instance(PhaseGVN *phase, bool can_reshape, int count); - Node* conv_I2X_offset(PhaseGVN *phase, Node* offset, const TypeAryPtr* ary_t); bool prepare_array_copy(PhaseGVN *phase, bool can_reshape, Node*& adr_src, Node*& base_src, Node*& adr_dest, Node*& base_dest, BasicType& copy_type, const Type*& value_type, bool& disjoint_bases); diff --git a/hotspot/src/share/vm/opto/castnode.cpp b/hotspot/src/share/vm/opto/castnode.cpp index 8bcfe904724..634ec0bcc1b 100644 --- a/hotspot/src/share/vm/opto/castnode.cpp +++ b/hotspot/src/share/vm/opto/castnode.cpp @@ -277,6 +277,23 @@ Node *CastIINode::Ideal(PhaseGVN *phase, bool can_reshape) { return NULL; } +uint CastIINode::cmp(const Node &n) const { + return ConstraintCastNode::cmp(n) && ((CastIINode&)n)._range_check_dependency == _range_check_dependency; +} + +uint CastIINode::size_of() const { + return sizeof(*this); +} + +#ifndef PRODUCT +void CastIINode::dump_spec(outputStream* st) const { + ConstraintCastNode::dump_spec(st); + if (_range_check_dependency) { + st->print(" range check dependency"); + } +} +#endif + //============================================================================= //------------------------------Identity--------------------------------------- // If input is already higher or equal to cast type, then this is an identity. diff --git a/hotspot/src/share/vm/opto/castnode.hpp b/hotspot/src/share/vm/opto/castnode.hpp index 0e024e8f409..9c2dfcb2e9d 100644 --- a/hotspot/src/share/vm/opto/castnode.hpp +++ b/hotspot/src/share/vm/opto/castnode.hpp @@ -62,13 +62,33 @@ class ConstraintCastNode: public TypeNode { //------------------------------CastIINode------------------------------------- // cast integer to integer (different range) class CastIINode: public ConstraintCastNode { + protected: + // Is this node dependent on a range check? + const bool _range_check_dependency; + virtual uint cmp(const Node &n) const; + virtual uint size_of() const; + public: - CastIINode(Node *n, const Type *t, bool carry_dependency = false) - : ConstraintCastNode(n, t, carry_dependency) {} + CastIINode(Node* n, const Type* t, bool carry_dependency = false, bool range_check_dependency = false) + : ConstraintCastNode(n, t, carry_dependency), _range_check_dependency(range_check_dependency) { + init_class_id(Class_CastII); + } virtual int Opcode() const; virtual uint ideal_reg() const { return Op_RegI; } virtual const Type* Value(PhaseGVN* phase) const; virtual Node *Ideal(PhaseGVN *phase, bool can_reshape); + const bool has_range_check() { +#ifdef _LP64 + return _range_check_dependency; +#else + assert(!_range_check_dependency, "Should not have range check dependency"); + return false; +#endif + } + +#ifndef PRODUCT + virtual void dump_spec(outputStream* st) const; +#endif }; //------------------------------CastPPNode------------------------------------- diff --git a/hotspot/src/share/vm/opto/cfgnode.hpp b/hotspot/src/share/vm/opto/cfgnode.hpp index baea8b48450..8651b672121 100644 --- a/hotspot/src/share/vm/opto/cfgnode.hpp +++ b/hotspot/src/share/vm/opto/cfgnode.hpp @@ -277,13 +277,6 @@ class IfNode : public MultiBranchNode { virtual uint size_of() const { return sizeof(*this); } private: - ProjNode* range_check_trap_proj() { - int flip_test = 0; - Node* l = NULL; - Node* r = NULL; - return range_check_trap_proj(flip_test, l, r); - } - // Helper methods for fold_compares bool cmpi_folds(PhaseIterGVN* igvn); bool is_ctrl_folds(Node* ctrl, PhaseIterGVN* igvn); diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index b55fa571e58..c569b0217c7 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -38,6 +38,7 @@ #include "opto/c2compiler.hpp" #include "opto/callGenerator.hpp" #include "opto/callnode.hpp" +#include "opto/castnode.hpp" #include "opto/cfgnode.hpp" #include "opto/chaitin.hpp" #include "opto/compile.hpp" @@ -402,6 +403,13 @@ void Compile::remove_useless_nodes(Unique_Node_List &useful) { remove_macro_node(n); } } + // Remove useless CastII nodes with range check dependency + for (int i = range_check_cast_count() - 1; i >= 0; i--) { + Node* cast = range_check_cast_node(i); + if (!useful.member(cast)) { + remove_range_check_cast(cast); + } + } // Remove useless expensive node for (int i = C->expensive_count()-1; i >= 0; i--) { Node* n = C->expensive_node(i); @@ -1178,6 +1186,7 @@ void Compile::Init(int aliaslevel) { _macro_nodes = new(comp_arena()) GrowableArray(comp_arena(), 8, 0, NULL); _predicate_opaqs = new(comp_arena()) GrowableArray(comp_arena(), 8, 0, NULL); _expensive_nodes = new(comp_arena()) GrowableArray(comp_arena(), 8, 0, NULL); + _range_check_casts = new(comp_arena()) GrowableArray(comp_arena(), 8, 0, NULL); register_library_intrinsics(); } @@ -1924,6 +1933,22 @@ void Compile::cleanup_loop_predicates(PhaseIterGVN &igvn) { assert(predicate_count()==0, "should be clean!"); } +void Compile::add_range_check_cast(Node* n) { + assert(n->isa_CastII()->has_range_check(), "CastII should have range check dependency"); + assert(!_range_check_casts->contains(n), "duplicate entry in range check casts"); + _range_check_casts->append(n); +} + +// Remove all range check dependent CastIINodes. +void Compile::remove_range_check_casts(PhaseIterGVN &igvn) { + for (int i = range_check_cast_count(); i > 0; i--) { + Node* cast = range_check_cast_node(i-1); + assert(cast->isa_CastII()->has_range_check(), "CastII should have range check dependency"); + igvn.replace_node(cast, cast->in(1)); + } + assert(range_check_cast_count() == 0, "should be empty"); +} + // StringOpts and late inlining of string methods void Compile::inline_string_calls(bool parse_time) { { @@ -2284,6 +2309,12 @@ void Compile::Optimize() { PhaseIdealLoop::verify(igvn); } + if (range_check_cast_count() > 0) { + // No more loop optimizations. Remove all range check dependent CastIINodes. + C->remove_range_check_casts(igvn); + igvn.optimize(); + } + { TracePhase tp("macroExpand", &timers[_t_macroExpand]); PhaseMacroExpand mex(igvn); @@ -3087,6 +3118,16 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) { #endif +#ifdef ASSERT + case Op_CastII: + // Verify that all range check dependent CastII nodes were removed. + if (n->isa_CastII()->has_range_check()) { + n->dump(3); + assert(false, "Range check dependent CastII node was not removed"); + } + break; +#endif + case Op_ModI: if (UseDivMod) { // Check if a%b and a/b both exist @@ -3962,7 +4003,7 @@ int Compile::static_subtype_check(ciKlass* superk, ciKlass* subk) { return SSC_full_test; } -Node* Compile::conv_I2X_index(PhaseGVN *phase, Node* idx, const TypeInt* sizetype) { +Node* Compile::conv_I2X_index(PhaseGVN* phase, Node* idx, const TypeInt* sizetype, Node* ctrl) { #ifdef _LP64 // The scaled index operand to AddP must be a clean 64-bit value. // Java allows a 32-bit int to be incremented to a negative @@ -3975,13 +4016,31 @@ Node* Compile::conv_I2X_index(PhaseGVN *phase, Node* idx, const TypeInt* sizetyp // number. (The prior range check has ensured this.) // This assertion is used by ConvI2LNode::Ideal. int index_max = max_jint - 1; // array size is max_jint, index is one less - if (sizetype != NULL) index_max = sizetype->_hi - 1; - const TypeLong* lidxtype = TypeLong::make(CONST64(0), index_max, Type::WidenMax); - idx = phase->transform(new ConvI2LNode(idx, lidxtype)); + if (sizetype != NULL) index_max = sizetype->_hi - 1; + const TypeInt* iidxtype = TypeInt::make(0, index_max, Type::WidenMax); + idx = constrained_convI2L(phase, idx, iidxtype, ctrl); #endif return idx; } +// Convert integer value to a narrowed long type dependent on ctrl (for example, a range check) +Node* Compile::constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl) { + if (ctrl != NULL) { + // Express control dependency by a CastII node with a narrow type. + value = new CastIINode(value, itype, false, true /* range check dependency */); + // Make the CastII node dependent on the control input to prevent the narrowed ConvI2L + // node from floating above the range check during loop optimizations. Otherwise, the + // ConvI2L node may be eliminated independently of the range check, causing the data path + // to become TOP while the control path is still there (although it's unreachable). + value->set_req(0, ctrl); + // Save CastII node to remove it after loop optimizations. + phase->C->add_range_check_cast(value); + value = phase->transform(value); + } + const TypeLong* ltype = TypeLong::make(itype->_lo, itype->_hi, itype->_widen); + return phase->transform(new ConvI2LNode(value, ltype)); +} + // The message about the current inlining is accumulated in // _print_inlining_stream and transfered into the _print_inlining_list // once we know whether inlining succeeds or not. For regular diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp index e012ea660f1..871abe245a7 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -400,6 +400,7 @@ class Compile : public Phase { GrowableArray* _macro_nodes; // List of nodes which need to be expanded before matching. GrowableArray* _predicate_opaqs; // List of Opaque1 nodes for the loop predicates. GrowableArray* _expensive_nodes; // List of nodes that are expensive to compute and that we'd better not let the GVN freely common + GrowableArray* _range_check_casts; // List of CastII nodes with a range check dependency ConnectionGraph* _congraph; #ifndef PRODUCT IdealGraphPrinter* _printer; @@ -753,7 +754,7 @@ class Compile : public Phase { void set_congraph(ConnectionGraph* congraph) { _congraph = congraph;} void add_macro_node(Node * n) { //assert(n->is_macro(), "must be a macro node"); - assert(!_macro_nodes->contains(n), " duplicate entry in expand list"); + assert(!_macro_nodes->contains(n), "duplicate entry in expand list"); _macro_nodes->append(n); } void remove_macro_node(Node * n) { @@ -773,10 +774,23 @@ class Compile : public Phase { } } void add_predicate_opaq(Node * n) { - assert(!_predicate_opaqs->contains(n), " duplicate entry in predicate opaque1"); + assert(!_predicate_opaqs->contains(n), "duplicate entry in predicate opaque1"); assert(_macro_nodes->contains(n), "should have already been in macro list"); _predicate_opaqs->append(n); } + + // Range check dependent CastII nodes that can be removed after loop optimizations + void add_range_check_cast(Node* n); + void remove_range_check_cast(Node* n) { + if (_range_check_casts->contains(n)) { + _range_check_casts->remove(n); + } + } + Node* range_check_cast_node(int idx) const { return _range_check_casts->at(idx); } + int range_check_cast_count() const { return _range_check_casts->length(); } + // Remove all range check dependent CastIINodes. + void remove_range_check_casts(PhaseIterGVN &igvn); + // remove the opaque nodes that protect the predicates so that the unused checks and // uncommon traps will be eliminated from the graph. void cleanup_loop_predicates(PhaseIterGVN &igvn); @@ -1292,7 +1306,12 @@ class Compile : public Phase { enum { SSC_always_false, SSC_always_true, SSC_easy_test, SSC_full_test }; int static_subtype_check(ciKlass* superk, ciKlass* subk); - static Node* conv_I2X_index(PhaseGVN *phase, Node* offset, const TypeInt* sizetype); + static Node* conv_I2X_index(PhaseGVN* phase, Node* offset, const TypeInt* sizetype, + // Optional control dependency (for example, on range check) + Node* ctrl = NULL); + + // Convert integer value to a narrowed long type dependent on ctrl (for example, a range check) + static Node* constrained_convI2L(PhaseGVN* phase, Node* value, const TypeInt* itype, Node* ctrl); // Auxiliary method for randomized fuzzing/stressing static bool randomized_select(int count); diff --git a/hotspot/src/share/vm/opto/convertnode.cpp b/hotspot/src/share/vm/opto/convertnode.cpp index 7f72ea16344..bc111ccae7a 100644 --- a/hotspot/src/share/vm/opto/convertnode.cpp +++ b/hotspot/src/share/vm/opto/convertnode.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "opto/addnode.hpp" +#include "opto/castnode.hpp" #include "opto/convertnode.hpp" #include "opto/matcher.hpp" #include "opto/phaseX.hpp" @@ -293,7 +294,8 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { } #ifdef _LP64 - // Convert ConvI2L(AddI(x, y)) to AddL(ConvI2L(x), ConvI2L(y)) , + // Convert ConvI2L(AddI(x, y)) to AddL(ConvI2L(x), ConvI2L(y)) or + // ConvI2L(CastII(AddI(x, y))) to AddL(ConvI2L(CastII(x)), ConvI2L(CastII(y))), // but only if x and y have subranges that cannot cause 32-bit overflow, // under the assumption that x+y is in my own subrange this->type(). @@ -317,6 +319,13 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node* z = in(1); int op = z->Opcode(); + Node* ctrl = NULL; + if (op == Op_CastII && z->as_CastII()->has_range_check()) { + // Skip CastII node but save control dependency + ctrl = z->in(0); + z = z->in(1); + op = z->Opcode(); + } if (op == Op_AddI || op == Op_SubI) { Node* x = z->in(1); Node* y = z->in(2); @@ -374,9 +383,10 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) { rylo = -ryhi; ryhi = -rylo0; } - - Node* cx = phase->transform( new ConvI2LNode(x, TypeLong::make(rxlo, rxhi, widen)) ); - Node* cy = phase->transform( new ConvI2LNode(y, TypeLong::make(rylo, ryhi, widen)) ); + assert(rxlo == (int)rxlo && rxhi == (int)rxhi, "x should not overflow"); + assert(rylo == (int)rylo && ryhi == (int)ryhi, "y should not overflow"); + Node* cx = phase->C->constrained_convI2L(phase, x, TypeInt::make(rxlo, rxhi, widen), ctrl); + Node* cy = phase->C->constrained_convI2L(phase, y, TypeInt::make(rylo, ryhi, widen), ctrl); switch (op) { case Op_AddI: return new AddLNode(cx, cy); case Op_SubI: return new SubLNode(cx, cy); diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index adbda86808b..f3389bd969b 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -1658,7 +1658,7 @@ Node* GraphKit::store_oop_to_unknown(Node* ctl, //-------------------------array_element_address------------------------- Node* GraphKit::array_element_address(Node* ary, Node* idx, BasicType elembt, - const TypeInt* sizetype) { + const TypeInt* sizetype, Node* ctrl) { uint shift = exact_log2(type2aelembytes(elembt)); uint header = arrayOopDesc::base_offset_in_bytes(elembt); @@ -1671,7 +1671,7 @@ Node* GraphKit::array_element_address(Node* ary, Node* idx, BasicType elembt, // must be correct type for alignment purposes Node* base = basic_plus_adr(ary, header); - idx = Compile::conv_I2X_index(&_gvn, idx, sizetype); + idx = Compile::conv_I2X_index(&_gvn, idx, sizetype, ctrl); Node* scale = _gvn.transform( new LShiftXNode(idx, intcon(shift)) ); return basic_plus_adr(ary, base, scale); } @@ -3506,10 +3506,6 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable) Node* initial_slow_cmp = _gvn.transform( new CmpUNode( length, intcon( fast_size_limit ) ) ); Node* initial_slow_test = _gvn.transform( new BoolNode( initial_slow_cmp, BoolTest::gt ) ); - if (initial_slow_test->is_Bool()) { - // Hide it behind a CMoveI, or else PhaseIdealLoop::split_up will get sick. - initial_slow_test = initial_slow_test->as_Bool()->as_int_value(&_gvn); - } // --- Size Computation --- // array_size = round_to_heap(array_header + (length << elem_shift)); @@ -3555,13 +3551,35 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable) Node* lengthx = ConvI2X(length); Node* headerx = ConvI2X(header_size); #ifdef _LP64 - { const TypeLong* tllen = _gvn.find_long_type(lengthx); - if (tllen != NULL && tllen->_lo < 0) { + { const TypeInt* tilen = _gvn.find_int_type(length); + if (tilen != NULL && tilen->_lo < 0) { // Add a manual constraint to a positive range. Cf. array_element_address. - jlong size_max = arrayOopDesc::max_array_length(T_BYTE); - if (size_max > tllen->_hi) size_max = tllen->_hi; - const TypeLong* tlcon = TypeLong::make(CONST64(0), size_max, Type::WidenMin); - lengthx = _gvn.transform( new ConvI2LNode(length, tlcon)); + jint size_max = fast_size_limit; + if (size_max > tilen->_hi) size_max = tilen->_hi; + const TypeInt* tlcon = TypeInt::make(0, size_max, Type::WidenMin); + + // Only do a narrow I2L conversion if the range check passed. + IfNode* iff = new IfNode(control(), initial_slow_test, PROB_MIN, COUNT_UNKNOWN); + _gvn.transform(iff); + RegionNode* region = new RegionNode(3); + _gvn.set_type(region, Type::CONTROL); + lengthx = new PhiNode(region, TypeLong::LONG); + _gvn.set_type(lengthx, TypeLong::LONG); + + // Range check passed. Use ConvI2L node with narrow type. + Node* passed = IfFalse(iff); + region->init_req(1, passed); + // Make I2L conversion control dependent to prevent it from + // floating above the range check during loop optimizations. + lengthx->init_req(1, C->constrained_convI2L(&_gvn, length, tlcon, passed)); + + // Range check failed. Use ConvI2L with wide type because length may be invalid. + region->init_req(2, IfTrue(iff)); + lengthx->init_req(2, ConvI2X(length)); + + set_control(region); + record_for_igvn(region); + record_for_igvn(lengthx); } } #endif @@ -3592,6 +3610,11 @@ Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable) Node *mem = reset_memory(); set_all_memory(mem); // Create new memory state + if (initial_slow_test->is_Bool()) { + // Hide it behind a CMoveI, or else PhaseIdealLoop::split_up will get sick. + initial_slow_test = initial_slow_test->as_Bool()->as_int_value(&_gvn); + } + // Create the AllocateArrayNode and its result projections AllocateArrayNode* alloc = new AllocateArrayNode(C, AllocateArrayNode::alloc_type(TypeInt::INT), diff --git a/hotspot/src/share/vm/opto/graphKit.hpp b/hotspot/src/share/vm/opto/graphKit.hpp index 1c3ec75f26b..7bb1f6946db 100644 --- a/hotspot/src/share/vm/opto/graphKit.hpp +++ b/hotspot/src/share/vm/opto/graphKit.hpp @@ -634,7 +634,9 @@ class GraphKit : public Phase { // Return addressing for an array element. Node* array_element_address(Node* ary, Node* idx, BasicType elembt, // Optional constraint on the array size: - const TypeInt* sizetype = NULL); + const TypeInt* sizetype = NULL, + // Optional control dependency (for example, on range check) + Node* ctrl = NULL); // Return a load of array element at idx. Node* load_array_element(Node* ctl, Node* ary, Node* idx, const TypeAryPtr* arytype); diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp index c68a5136572..a2cea88273f 100644 --- a/hotspot/src/share/vm/opto/ifnode.cpp +++ b/hotspot/src/share/vm/opto/ifnode.cpp @@ -1104,7 +1104,8 @@ void IfNode::improve_address_types(Node* l, Node* r, ProjNode* fail, PhaseIterGV if (ctrl == fail) { Node* init_n = stack.node_at(1); assert(init_n->Opcode() == Op_ConvI2L, "unexpected first node"); - Node* new_n = igvn->C->conv_I2X_index(igvn, l, array_size); + // Create a new narrow ConvI2L node that is dependent on the range check + Node* new_n = igvn->C->conv_I2X_index(igvn, l, array_size, fail); // The type of the ConvI2L may be widen and so the new // ConvI2L may not be better than an existing ConvI2L diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index cbff6c2b879..dd05872370a 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -2660,7 +2660,7 @@ bool IdealLoopTree::iteration_split( PhaseIdealLoop *phase, Node_List &old_new ) //============================================================================= // Process all the loops in the loop tree and replace any fill -// patterns with an intrisc version. +// patterns with an intrinsic version. bool PhaseIdealLoop::do_intrinsify_fill() { bool changed = false; for (LoopTreeIterator iter(_ltree_root); !iter.done(); iter.next()) { @@ -2758,8 +2758,9 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st } // Make sure the address expression can be handled. It should be - // head->phi * elsize + con. head->phi might have a ConvI2L. + // head->phi * elsize + con. head->phi might have a ConvI2L(CastII()). Node* elements[4]; + Node* cast = NULL; Node* conv = NULL; bool found_index = false; int count = store->in(MemNode::Address)->as_AddP()->unpack_offsets(elements, ARRAY_SIZE(elements)); @@ -2774,6 +2775,12 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st conv = value; value = value->in(1); } + if (value->Opcode() == Op_CastII && + value->as_CastII()->has_range_check()) { + // Skip range check dependent CastII nodes + cast = value; + value = value->in(1); + } #endif if (value != head->phi()) { msg = "unhandled shift in address"; @@ -2786,9 +2793,16 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st } } } else if (n->Opcode() == Op_ConvI2L && conv == NULL) { - if (n->in(1) == head->phi()) { + conv = n; + n = n->in(1); + if (n->Opcode() == Op_CastII && + n->as_CastII()->has_range_check()) { + // Skip range check dependent CastII nodes + cast = n; + n = n->in(1); + } + if (n == head->phi()) { found_index = true; - conv = n; } else { msg = "unhandled input to ConvI2L"; } @@ -2847,6 +2861,7 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st // Address elements are ok if (con) ok.set(con->_idx); if (shift) ok.set(shift->_idx); + if (cast) ok.set(cast->_idx); if (conv) ok.set(conv->_idx); for (uint i = 0; msg == NULL && i < lpt->_body.size(); i++) { diff --git a/hotspot/src/share/vm/opto/loopopts.cpp b/hotspot/src/share/vm/opto/loopopts.cpp index 7a6e94e72e7..8246600f82f 100644 --- a/hotspot/src/share/vm/opto/loopopts.cpp +++ b/hotspot/src/share/vm/opto/loopopts.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" #include "opto/addnode.hpp" +#include "opto/castnode.hpp" #include "opto/connode.hpp" #include "opto/castnode.hpp" #include "opto/divnode.hpp" @@ -997,6 +998,9 @@ static bool merge_point_safe(Node* region) { #ifdef _LP64 if (m->Opcode() == Op_ConvI2L) return false; + if (m->is_CastII() && m->isa_CastII()->has_range_check()) { + return false; + } #endif } } diff --git a/hotspot/src/share/vm/opto/node.cpp b/hotspot/src/share/vm/opto/node.cpp index ff02a8ae8ca..42ca23d212a 100644 --- a/hotspot/src/share/vm/opto/node.cpp +++ b/hotspot/src/share/vm/opto/node.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "libadt/vectset.hpp" #include "memory/allocation.inline.hpp" +#include "opto/castnode.hpp" #include "opto/cfgnode.hpp" #include "opto/connode.hpp" #include "opto/loopnode.hpp" @@ -516,6 +517,11 @@ Node *Node::clone() const { C->add_macro_node(n); if (is_expensive()) C->add_expensive_node(n); + // If the cloned node is a range check dependent CastII, add it to the list. + CastIINode* cast = n->isa_CastII(); + if (cast != NULL && cast->has_range_check()) { + C->add_range_check_cast(cast); + } n->set_idx(C->next_unique()); // Get new unique index as well debug_only( n->verify_construction() ); @@ -644,6 +650,11 @@ void Node::destruct() { if (is_expensive()) { compile->remove_expensive_node(this); } + CastIINode* cast = isa_CastII(); + if (cast != NULL && cast->has_range_check()) { + compile->remove_range_check_cast(cast); + } + if (is_SafePoint()) { as_SafePoint()->delete_replaced_nodes(); } @@ -1379,6 +1390,10 @@ static void kill_dead_code( Node *dead, PhaseIterGVN *igvn ) { if (dead->is_expensive()) { igvn->C->remove_expensive_node(dead); } + CastIINode* cast = dead->isa_CastII(); + if (cast != NULL && cast->has_range_check()) { + igvn->C->remove_range_check_cast(cast); + } igvn->C->record_dead_node(dead->_idx); // Kill all inputs to the dead guy for (uint i=0; i < dead->req(); i++) { diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp index 9ac0628f5f6..7f19372a1ec 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -51,6 +51,7 @@ class CallLeafNode; class CallNode; class CallRuntimeNode; class CallStaticJavaNode; +class CastIINode; class CatchNode; class CatchProjNode; class CheckCastPPNode; @@ -653,6 +654,7 @@ public: DEFINE_CLASS_ID(Type, Node, 2) DEFINE_CLASS_ID(Phi, Type, 0) DEFINE_CLASS_ID(ConstraintCast, Type, 1) + DEFINE_CLASS_ID(CastII, ConstraintCast, 0) DEFINE_CLASS_ID(CheckCastPP, Type, 2) DEFINE_CLASS_ID(CMove, Type, 3) DEFINE_CLASS_ID(SafePointScalarObject, Type, 4) @@ -784,6 +786,7 @@ public: DEFINE_CLASS_QUERY(Catch) DEFINE_CLASS_QUERY(CatchProj) DEFINE_CLASS_QUERY(CheckCastPP) + DEFINE_CLASS_QUERY(CastII) DEFINE_CLASS_QUERY(ConstraintCast) DEFINE_CLASS_QUERY(ClearArray) DEFINE_CLASS_QUERY(CMove) diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp index f6adb5d6241..e03abd4f931 100644 --- a/hotspot/src/share/vm/opto/parse2.cpp +++ b/hotspot/src/share/vm/opto/parse2.cpp @@ -166,7 +166,9 @@ Node* Parse::array_addressing(BasicType type, int vals, const Type* *result2) { // Check for always knowing you are throwing a range-check exception if (stopped()) return top(); - Node* ptr = array_element_address(ary, idx, type, sizetype); + // Make array address computation control dependent to prevent it + // from floating above the range check during loop optimizations. + Node* ptr = array_element_address(ary, idx, type, sizetype, control()); if (result2 != NULL) *result2 = elemtype; @@ -466,12 +468,14 @@ bool Parse::create_jump_tables(Node* key_val, SwitchRange* lo, SwitchRange* hi) // of all possible ranges for a switch statement // The key_val input must be converted to a pointer offset and scaled. // Compare Parse::array_addressing above. -#ifdef _LP64 + // Clean the 32-bit int into a real 64-bit offset. // Otherwise, the jint value 0 might turn into an offset of 0x0800000000. - const TypeLong* lkeytype = TypeLong::make(CONST64(0), num_cases-1, Type::WidenMin); - key_val = _gvn.transform( new ConvI2LNode(key_val, lkeytype) ); -#endif + const TypeInt* ikeytype = TypeInt::make(0, num_cases, Type::WidenMin); + // Make I2L conversion control dependent to prevent it from + // floating above the range check during loop optimizations. + key_val = C->conv_I2X_index(&_gvn, key_val, ikeytype, control()); + // Shift the value by wordsize so we have an index into the table, rather // than a switch value Node *shiftWord = _gvn.MakeConX(wordSize); diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp index 241cb0307c7..1f6de0d1700 100644 --- a/hotspot/src/share/vm/opto/phaseX.cpp +++ b/hotspot/src/share/vm/opto/phaseX.cpp @@ -26,6 +26,7 @@ #include "memory/allocation.inline.hpp" #include "opto/block.hpp" #include "opto/callnode.hpp" +#include "opto/castnode.hpp" #include "opto/cfgnode.hpp" #include "opto/idealGraphPrinter.hpp" #include "opto/loopnode.hpp" @@ -1412,6 +1413,10 @@ void PhaseIterGVN::remove_globally_dead_node( Node *dead ) { if (dead->is_expensive()) { C->remove_expensive_node(dead); } + CastIINode* cast = dead->isa_CastII(); + if (cast != NULL && cast->has_range_check()) { + C->remove_range_check_cast(cast); + } } } // while (_stack.is_nonempty()) } diff --git a/hotspot/src/share/vm/opto/superword.cpp b/hotspot/src/share/vm/opto/superword.cpp index b0cd632d79e..b7495936443 100644 --- a/hotspot/src/share/vm/opto/superword.cpp +++ b/hotspot/src/share/vm/opto/superword.cpp @@ -3343,6 +3343,11 @@ bool SWPointer::scaled_iv(Node* n) { return true; } } else if (opc == Op_ConvI2L) { + if (n->in(1)->Opcode() == Op_CastII && + n->in(1)->as_CastII()->has_range_check()) { + // Skip range check dependent CastII nodes + n = n->in(1); + } if (scaled_iv_plus_offset(n->in(1))) { NOT_PRODUCT(_tracer.scaled_iv_7(n);) return true; @@ -3437,6 +3442,12 @@ bool SWPointer::offset_plus_k(Node* n, bool negate) { if (invariant(n)) { if (opc == Op_ConvI2L) { n = n->in(1); + if (n->Opcode() == Op_CastII && + n->as_CastII()->has_range_check()) { + // Skip range check dependent CastII nodes + assert(invariant(n), "sanity"); + n = n->in(1); + } } if (n->bottom_type()->isa_int()) { _negate_invar = negate; diff --git a/hotspot/test/compiler/loopopts/TestLoopPeeling.java b/hotspot/test/compiler/loopopts/TestLoopPeeling.java new file mode 100644 index 00000000000..d2d2e3d7848 --- /dev/null +++ b/hotspot/test/compiler/loopopts/TestLoopPeeling.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8078262 + * @summary Tests correct dominator information after loop peeling. + * @run main/othervm -Xcomp -XX:CompileCommand=compileonly,TestLoopPeeling::test* TestLoopPeeling + */ +public class TestLoopPeeling { + + public int[] array = new int[100]; + + public static void main(String args[]) { + TestLoopPeeling test = new TestLoopPeeling(); + try { + test.testArrayAccess(0, 1); + test.testArrayAllocation(0, 1); + } catch (Exception e) { + // Ignore exceptions + } + } + + public void testArrayAccess(int index, int inc) { + int storeIndex = -1; + + for (; index < 10; index += inc) { + // This loop invariant check triggers loop peeling because it can + // be moved out of the loop (see 'IdealLoopTree::policy_peeling'). + if (inc == 42) return; + + // This loop variant usage of LShiftL( ConvI2L( Phi(storeIndex) ) ) + // prevents the split if optimization that would otherwise clone the + // LShiftL and ConvI2L nodes and assign them to their corresponding array + // address computation (see 'PhaseIdealLoop::split_if_with_blocks_post'). + if (storeIndex > 0 && array[storeIndex] == 42) return; + + if (index == 42) { + // This store and the corresponding range check are moved out of the + // loop and both used after old loop and the peeled iteration exit. + // For the peeled iteration, storeIndex is always -1 and the ConvI2L + // is replaced by TOP. However, the range check is not folded because + // we don't do the split if optimization in PhaseIdealLoop2. + // As a result, we have a (dead) control path from the peeled iteration + // to the StoreI but the data path is removed. + array[storeIndex] = 1; + return; + } + + storeIndex++; + } + } + + public byte[] testArrayAllocation(int index, int inc) { + int allocationCount = -1; + byte[] result; + + for (; index < 10; index += inc) { + // This loop invariant check triggers loop peeling because it can + // be moved out of the loop (see 'IdealLoopTree::policy_peeling'). + if (inc == 42) return null; + + if (index == 42) { + // This allocation and the corresponding size check are moved out of the + // loop and both used after old loop and the peeled iteration exit. + // For the peeled iteration, allocationCount is always -1 and the ConvI2L + // is replaced by TOP. However, the size check is not folded because + // we don't do the split if optimization in PhaseIdealLoop2. + // As a result, we have a (dead) control path from the peeled iteration + // to the allocation but the data path is removed. + result = new byte[allocationCount]; + return result; + } + + allocationCount++; + } + return null; + } +} + From 3301846a214a77dfd80a902e7c99f4f70cbc5d9a Mon Sep 17 00:00:00 2001 From: Zoltan Majo Date: Mon, 18 Jan 2016 08:50:57 +0100 Subject: [PATCH 061/212] 8147441: Unchecked pending exceptions in the WhiteBox API's implementation Add checks for pending exceptions. Reviewed-by: kvn --- hotspot/src/share/vm/prims/whitebox.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 67bed192a3b..9e993f7afad 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -1096,6 +1096,7 @@ WB_ENTRY(jobjectArray, WB_GetNMethod(JNIEnv* env, jobject o, jobject method, jbo CodeBlobStub stub(code); jobjectArray codeBlob = codeBlob2objectArray(thread, env, &stub); + CHECK_JNI_EXCEPTION_(env, NULL); env->SetObjectArrayElement(result, 0, codeBlob); jobject level = integerBox(thread, env, code->comp_level()); @@ -1181,6 +1182,7 @@ WB_ENTRY(jobjectArray, WB_GetCodeHeapEntries(JNIEnv* env, jobject o, jint blob_t for (GrowableArrayIterator it = blobs.begin(); it != blobs.end(); ++it) { jobjectArray obj = codeBlob2objectArray(thread, env, *it); + CHECK_JNI_EXCEPTION_(env, NULL); env->SetObjectArrayElement(result, i, obj); ++i; } From 75901ea0cb4278777e78f13f4db586df4c6d0afe Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Mon, 18 Jan 2016 11:07:40 -0800 Subject: [PATCH 062/212] 8147433: PrintNMethods no longer works with JVMCI Reviewed-by: kvn, twisti --- hotspot/src/share/vm/c1/c1_Compilation.cpp | 3 +-- hotspot/src/share/vm/c1/c1_Compilation.hpp | 1 + hotspot/src/share/vm/ci/ciEnv.cpp | 7 ------- hotspot/src/share/vm/ci/ciEnv.hpp | 3 --- hotspot/src/share/vm/compiler/compileBroker.cpp | 10 +++++++++- hotspot/src/share/vm/opto/compile.cpp | 1 - 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/hotspot/src/share/vm/c1/c1_Compilation.cpp b/hotspot/src/share/vm/c1/c1_Compilation.cpp index c8db6252c85..1a102cabe8b 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.cpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp @@ -420,8 +420,7 @@ void Compilation::install_code(int frame_size) { implicit_exception_table(), compiler(), has_unsafe_access(), - SharedRuntime::is_wide_vector(max_vector_size()), - directive() + SharedRuntime::is_wide_vector(max_vector_size()) ); } diff --git a/hotspot/src/share/vm/c1/c1_Compilation.hpp b/hotspot/src/share/vm/c1/c1_Compilation.hpp index f9f6eca889c..3bc07da9f7d 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.hpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.hpp @@ -28,6 +28,7 @@ #include "ci/ciEnv.hpp" #include "ci/ciMethodData.hpp" #include "code/exceptionHandlerTable.hpp" +#include "compiler/compilerDirectives.hpp" #include "memory/resourceArea.hpp" #include "runtime/deoptimization.hpp" diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp index cea5712ab4f..9a5409d797a 100644 --- a/hotspot/src/share/vm/ci/ciEnv.cpp +++ b/hotspot/src/share/vm/ci/ciEnv.cpp @@ -38,7 +38,6 @@ #include "code/scopeDesc.hpp" #include "compiler/compileBroker.hpp" #include "compiler/compileLog.hpp" -#include "compiler/compilerDirectives.hpp" #include "compiler/disassembler.hpp" #include "gc/shared/collectedHeap.inline.hpp" #include "interpreter/linkResolver.hpp" @@ -959,7 +958,6 @@ void ciEnv::register_method(ciMethod* target, AbstractCompiler* compiler, bool has_unsafe_access, bool has_wide_vectors, - DirectiveSet* directives, RTMState rtm_state) { VM_ENTRY_MARK; nmethod* nm = NULL; @@ -1041,11 +1039,6 @@ void ciEnv::register_method(ciMethod* target, code_buffer->free_blob(); if (nm != NULL) { - bool printnmethods = directives->PrintAssemblyOption || directives->PrintNMethodsOption; - if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) { - nm->print_nmethod(printnmethods); - } - nm->set_has_unsafe_access(has_unsafe_access); nm->set_has_wide_vectors(has_wide_vectors); #if INCLUDE_RTM_OPT diff --git a/hotspot/src/share/vm/ci/ciEnv.hpp b/hotspot/src/share/vm/ci/ciEnv.hpp index b1a95bd38f6..cd7138d33b2 100644 --- a/hotspot/src/share/vm/ci/ciEnv.hpp +++ b/hotspot/src/share/vm/ci/ciEnv.hpp @@ -32,11 +32,9 @@ #include "code/dependencies.hpp" #include "code/exceptionHandlerTable.hpp" #include "compiler/oopMap.hpp" -#include "compiler/compilerDirectives.hpp" #include "runtime/thread.hpp" class CompileTask; -class DirectiveSet; // ciEnv // @@ -372,7 +370,6 @@ public: AbstractCompiler* compiler, bool has_unsafe_access, bool has_wide_vectors, - DirectiveSet* directives, RTMState rtm_state = NoRTM); diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 98eafe35d8e..6583a69b5dd 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -1884,7 +1884,6 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { post_compile(thread, task, event, !ci_env.failing(), &ci_env); } - DirectivesStack::release(directive); pop_jni_handle_block(); methodHandle method(thread, task->method()); @@ -1893,6 +1892,15 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { collect_statistics(thread, time, task); + bool printnmethods = directive->PrintAssemblyOption || directive->PrintNMethodsOption; + if (printnmethods || PrintDebugInfo || PrintRelocations || PrintDependencies || PrintExceptionHandlers) { + nmethod* nm = task->code(); + if (nm != NULL) { + nm->print_nmethod(printnmethods); + } + } + DirectivesStack::release(directive); + if (PrintCompilation && PrintCompilation2) { tty->print("%7d ", (int) tty->time_stamp().milliseconds()); // print timestamp tty->print("%4d ", compile_id); // print compilation number diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index c569b0217c7..bf5597753b6 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -934,7 +934,6 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr compiler, has_unsafe_access(), SharedRuntime::is_wide_vector(max_vector_size()), - _directive, rtm_state() ); From 40ea9a6025d2af99499f970e3d33ce33384f9e30 Mon Sep 17 00:00:00 2001 From: Ed Nevill Date: Tue, 12 Jan 2016 14:55:15 +0000 Subject: [PATCH 063/212] 8146843: aarch64: add scheduling support for FP and vector instructions Add pipeline classes for FP/vector pipeline Reviewed-by: aph --- hotspot/src/cpu/aarch64/vm/aarch64.ad | 783 +++++++++++++++++++++----- 1 file changed, 639 insertions(+), 144 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index f19eb0e71c7..670591d4cfa 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -6673,6 +6673,14 @@ opclass iRegIorL2I(iRegI, iRegL2I); //----------PIPELINE----------------------------------------------------------- // Rules which define the behavior of the target architectures pipeline. + +// For specific pipelines, eg A53, define the stages of that pipeline +//pipe_desc(ISS, EX1, EX2, WR); +#define ISS S0 +#define EX1 S1 +#define EX2 S2 +#define WR S3 + // Integer ALU reg operation pipeline %{ @@ -6707,12 +6715,499 @@ resources( INS0, INS1, INS01 = INS0 | INS1, //----------PIPELINE DESCRIPTION----------------------------------------------- // Pipeline Description specifies the stages in the machine's pipeline -pipe_desc(ISS, EX1, EX2, WR); +// Define the pipeline as a generic 6 stage pipeline +pipe_desc(S0, S1, S2, S3, S4, S5); //----------PIPELINE CLASSES--------------------------------------------------- // Pipeline Classes describe the stages in which input and output are // referenced by the hardware pipeline. +pipe_class fp_dop_reg_reg_s(vRegF dst, vRegF src1, vRegF src2) +%{ + single_instruction; + src1 : S1(read); + src2 : S2(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_dop_reg_reg_d(vRegD dst, vRegD src1, vRegD src2) +%{ + single_instruction; + src1 : S1(read); + src2 : S2(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_uop_s(vRegF dst, vRegF src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_uop_d(vRegD dst, vRegD src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_d2f(vRegF dst, vRegD src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_f2d(vRegD dst, vRegF src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_f2i(iRegINoSp dst, vRegF src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_f2l(iRegLNoSp dst, vRegF src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_i2f(vRegF dst, iRegIorL2I src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_l2f(vRegF dst, iRegL src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_d2i(iRegINoSp dst, vRegD src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_d2l(iRegLNoSp dst, vRegD src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_i2d(vRegD dst, iRegIorL2I src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_l2d(vRegD dst, iRegIorL2I src) +%{ + single_instruction; + src : S1(read); + dst : S5(write); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_div_s(vRegF dst, vRegF src1, vRegF src2) +%{ + single_instruction; + src1 : S1(read); + src2 : S2(read); + dst : S5(write); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_div_d(vRegD dst, vRegD src1, vRegD src2) +%{ + single_instruction; + src1 : S1(read); + src2 : S2(read); + dst : S5(write); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class fp_cond_reg_reg_s(vRegF dst, vRegF src1, vRegF src2, rFlagsReg cr) +%{ + single_instruction; + cr : S1(read); + src1 : S1(read); + src2 : S1(read); + dst : S3(write); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class fp_cond_reg_reg_d(vRegD dst, vRegD src1, vRegD src2, rFlagsReg cr) +%{ + single_instruction; + cr : S1(read); + src1 : S1(read); + src2 : S1(read); + dst : S3(write); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class fp_imm_s(vRegF dst) +%{ + single_instruction; + dst : S3(write); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class fp_imm_d(vRegD dst) +%{ + single_instruction; + dst : S3(write); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class fp_load_constant_s(vRegF dst) +%{ + single_instruction; + dst : S4(write); + INS01 : ISS; + NEON_FP : S4; +%} + +pipe_class fp_load_constant_d(vRegD dst) +%{ + single_instruction; + dst : S4(write); + INS01 : ISS; + NEON_FP : S4; +%} + +pipe_class vmul64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class vmul128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vmla64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + dst : S1(read); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class vmla128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + dst : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vdop64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S4(write); + src1 : S2(read); + src2 : S2(read); + INS01 : ISS; + NEON_FP : S4; +%} + +pipe_class vdop128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S4(write); + src1 : S2(read); + src2 : S2(read); + INS0 : ISS; + NEON_FP : S4; +%} + +pipe_class vlogical64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S3(write); + src1 : S2(read); + src2 : S2(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vlogical128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S3(write); + src1 : S2(read); + src2 : S2(read); + INS0 : ISS; + NEON_FP : S3; +%} + +pipe_class vshift64(vecD dst, vecD src, vecX shift) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + shift : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vshift128(vecX dst, vecX src, vecX shift) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + shift : S1(read); + INS0 : ISS; + NEON_FP : S3; +%} + +pipe_class vshift64_imm(vecD dst, vecD src, immI shift) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vshift128_imm(vecX dst, vecX src, immI shift) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS0 : ISS; + NEON_FP : S3; +%} + +pipe_class vdop_fp64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class vdop_fp128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vmuldiv_fp64(vecD dst, vecD src1, vecD src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vmuldiv_fp128(vecX dst, vecX src1, vecX src2) +%{ + single_instruction; + dst : S5(write); + src1 : S1(read); + src2 : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vsqrt_fp128(vecX dst, vecX src) +%{ + single_instruction; + dst : S5(write); + src : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vunop_fp64(vecD dst, vecD src) +%{ + single_instruction; + dst : S5(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S5; +%} + +pipe_class vunop_fp128(vecX dst, vecX src) +%{ + single_instruction; + dst : S5(write); + src : S1(read); + INS0 : ISS; + NEON_FP : S5; +%} + +pipe_class vdup_reg_reg64(vecD dst, iRegI src) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vdup_reg_reg128(vecX dst, iRegI src) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vdup_reg_freg64(vecD dst, vRegF src) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vdup_reg_freg128(vecX dst, vRegF src) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vdup_reg_dreg128(vecX dst, vRegD src) +%{ + single_instruction; + dst : S3(write); + src : S1(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vmovi_reg_imm64(vecD dst) +%{ + single_instruction; + dst : S3(write); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vmovi_reg_imm128(vecX dst) +%{ + single_instruction; + dst : S3(write); + INS0 : ISS; + NEON_FP : S3; +%} + +pipe_class vload_reg_mem64(vecD dst, vmem mem) +%{ + single_instruction; + dst : S5(write); + mem : ISS(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vload_reg_mem128(vecX dst, vmem mem) +%{ + single_instruction; + dst : S5(write); + mem : ISS(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vstore_reg_mem64(vecD src, vmem mem) +%{ + single_instruction; + mem : ISS(read); + src : S2(read); + INS01 : ISS; + NEON_FP : S3; +%} + +pipe_class vstore_reg_mem128(vecD src, vmem mem) +%{ + single_instruction; + mem : ISS(read); + src : S2(read); + INS01 : ISS; + NEON_FP : S3; +%} + //------- Integer ALU operations -------------------------- // Integer ALU reg-reg operation @@ -7559,7 +8054,7 @@ instruct loadConF_packed(vRegF dst, immFPacked con) %{ __ fmovs(as_FloatRegister($dst$$reg), (double)$con$$constant); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_imm_s); %} // Load Float Constant @@ -7577,7 +8072,7 @@ instruct loadConF(vRegF dst, immF con) %{ __ ldrs(as_FloatRegister($dst$$reg), $constantaddress($con)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_load_constant_s); %} // Load Packed Double Constant @@ -7590,7 +8085,7 @@ instruct loadConD_packed(vRegD dst, immDPacked con) %{ __ fmovd(as_FloatRegister($dst$$reg), $con$$constant); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_imm_d); %} // Load Double Constant @@ -7607,7 +8102,7 @@ instruct loadConD(vRegD dst, immD con) %{ __ ldrd(as_FloatRegister($dst$$reg), $constantaddress($con)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_load_constant_d); %} // Store Instructions @@ -9615,7 +10110,7 @@ instruct cmovF_reg(cmpOp cmp, rFlagsReg cr, vRegF dst, vRegF src1, vRegF src2) cond); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_cond_reg_reg_s); %} instruct cmovUF_reg(cmpOpU cmp, rFlagsRegU cr, vRegF dst, vRegF src1, vRegF src2) @@ -9633,7 +10128,7 @@ instruct cmovUF_reg(cmpOpU cmp, rFlagsRegU cr, vRegF dst, vRegF src1, vRegF src cond); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_cond_reg_reg_s); %} instruct cmovD_reg(cmpOp cmp, rFlagsReg cr, vRegD dst, vRegD src1, vRegD src2) @@ -9651,7 +10146,7 @@ instruct cmovD_reg(cmpOp cmp, rFlagsReg cr, vRegD dst, vRegD src1, vRegD src2) cond); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_cond_reg_reg_d); %} instruct cmovUD_reg(cmpOpU cmp, rFlagsRegU cr, vRegD dst, vRegD src1, vRegD src2) @@ -9669,7 +10164,7 @@ instruct cmovUD_reg(cmpOpU cmp, rFlagsRegU cr, vRegD dst, vRegD src1, vRegD src cond); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_cond_reg_reg_d); %} // ============================================================================ @@ -12033,7 +12528,7 @@ instruct addF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_s); %} instruct addD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ @@ -12048,7 +12543,7 @@ instruct addD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_d); %} instruct subF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ @@ -12063,7 +12558,7 @@ instruct subF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_s); %} instruct subD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ @@ -12078,7 +12573,7 @@ instruct subD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_d); %} instruct mulF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ @@ -12093,7 +12588,7 @@ instruct mulF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_s); %} instruct mulD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ @@ -12108,7 +12603,7 @@ instruct mulD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_dop_reg_reg_d); %} // We cannot use these fused mul w add/sub ops because they don't @@ -12256,7 +12751,7 @@ instruct divF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_div_s); %} instruct divD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ @@ -12271,7 +12766,7 @@ instruct divD_reg_reg(vRegD dst, vRegD src1, vRegD src2) %{ as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_div_d); %} instruct negF_reg_reg(vRegF dst, vRegF src) %{ @@ -12285,7 +12780,7 @@ instruct negF_reg_reg(vRegF dst, vRegF src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_uop_s); %} instruct negD_reg_reg(vRegD dst, vRegD src) %{ @@ -12299,7 +12794,7 @@ instruct negD_reg_reg(vRegD dst, vRegD src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_uop_d); %} instruct absF_reg(vRegF dst, vRegF src) %{ @@ -12312,7 +12807,7 @@ instruct absF_reg(vRegF dst, vRegF src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_uop_s); %} instruct absD_reg(vRegD dst, vRegD src) %{ @@ -12325,7 +12820,7 @@ instruct absD_reg(vRegD dst, vRegD src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_uop_d); %} instruct sqrtD_reg(vRegD dst, vRegD src) %{ @@ -12338,7 +12833,7 @@ instruct sqrtD_reg(vRegD dst, vRegD src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_div_s); %} instruct sqrtF_reg(vRegF dst, vRegF src) %{ @@ -12351,7 +12846,7 @@ instruct sqrtF_reg(vRegF dst, vRegF src) %{ as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_div_d); %} // ============================================================================ @@ -12638,7 +13133,7 @@ instruct convD2F_reg(vRegF dst, vRegD src) %{ __ fcvtd(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_d2f); %} instruct convF2D_reg(vRegD dst, vRegF src) %{ @@ -12651,7 +13146,7 @@ instruct convF2D_reg(vRegD dst, vRegF src) %{ __ fcvts(as_FloatRegister($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_f2d); %} instruct convF2I_reg_reg(iRegINoSp dst, vRegF src) %{ @@ -12664,7 +13159,7 @@ instruct convF2I_reg_reg(iRegINoSp dst, vRegF src) %{ __ fcvtzsw(as_Register($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_f2i); %} instruct convF2L_reg_reg(iRegLNoSp dst, vRegF src) %{ @@ -12677,7 +13172,7 @@ instruct convF2L_reg_reg(iRegLNoSp dst, vRegF src) %{ __ fcvtzs(as_Register($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_f2l); %} instruct convI2F_reg_reg(vRegF dst, iRegIorL2I src) %{ @@ -12690,7 +13185,7 @@ instruct convI2F_reg_reg(vRegF dst, iRegIorL2I src) %{ __ scvtfws(as_FloatRegister($dst$$reg), as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_i2f); %} instruct convL2F_reg_reg(vRegF dst, iRegL src) %{ @@ -12703,7 +13198,7 @@ instruct convL2F_reg_reg(vRegF dst, iRegL src) %{ __ scvtfs(as_FloatRegister($dst$$reg), as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_l2f); %} instruct convD2I_reg_reg(iRegINoSp dst, vRegD src) %{ @@ -12716,7 +13211,7 @@ instruct convD2I_reg_reg(iRegINoSp dst, vRegD src) %{ __ fcvtzdw(as_Register($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_d2i); %} instruct convD2L_reg_reg(iRegLNoSp dst, vRegD src) %{ @@ -12729,7 +13224,7 @@ instruct convD2L_reg_reg(iRegLNoSp dst, vRegD src) %{ __ fcvtzd(as_Register($dst$$reg), as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_d2l); %} instruct convI2D_reg_reg(vRegD dst, iRegIorL2I src) %{ @@ -12742,7 +13237,7 @@ instruct convI2D_reg_reg(vRegD dst, iRegIorL2I src) %{ __ scvtfwd(as_FloatRegister($dst$$reg), as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_i2d); %} instruct convL2D_reg_reg(vRegD dst, iRegL src) %{ @@ -12755,7 +13250,7 @@ instruct convL2D_reg_reg(vRegD dst, iRegL src) %{ __ scvtfd(as_FloatRegister($dst$$reg), as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(fp_l2d); %} // stack <-> reg and reg <-> reg shuffles with no conversion @@ -14500,7 +14995,7 @@ instruct loadV4(vecD dst, vmem mem) ins_cost(4 * INSN_COST); format %{ "ldrs $dst,$mem\t# vector (32 bits)" %} ins_encode( aarch64_enc_ldrvS(dst, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vload_reg_mem64); %} // Load vector (64 bits) @@ -14511,7 +15006,7 @@ instruct loadV8(vecD dst, vmem mem) ins_cost(4 * INSN_COST); format %{ "ldrd $dst,$mem\t# vector (64 bits)" %} ins_encode( aarch64_enc_ldrvD(dst, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vload_reg_mem64); %} // Load Vector (128 bits) @@ -14522,7 +15017,7 @@ instruct loadV16(vecX dst, vmem mem) ins_cost(4 * INSN_COST); format %{ "ldrq $dst,$mem\t# vector (128 bits)" %} ins_encode( aarch64_enc_ldrvQ(dst, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vload_reg_mem128); %} // Store Vector (32 bits) @@ -14533,7 +15028,7 @@ instruct storeV4(vecD src, vmem mem) ins_cost(4 * INSN_COST); format %{ "strs $mem,$src\t# vector (32 bits)" %} ins_encode( aarch64_enc_strvS(src, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vstore_reg_mem64); %} // Store Vector (64 bits) @@ -14544,7 +15039,7 @@ instruct storeV8(vecD src, vmem mem) ins_cost(4 * INSN_COST); format %{ "strd $mem,$src\t# vector (64 bits)" %} ins_encode( aarch64_enc_strvD(src, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vstore_reg_mem64); %} // Store Vector (128 bits) @@ -14555,7 +15050,7 @@ instruct storeV16(vecX src, vmem mem) ins_cost(4 * INSN_COST); format %{ "strq $mem,$src\t# vector (128 bits)" %} ins_encode( aarch64_enc_strvQ(src, mem) ); - ins_pipe(pipe_class_memory); + ins_pipe(vstore_reg_mem128); %} instruct replicate8B(vecD dst, iRegIorL2I src) @@ -14568,7 +15063,7 @@ instruct replicate8B(vecD dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T8B, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg64); %} instruct replicate16B(vecX dst, iRegIorL2I src) @@ -14580,7 +15075,7 @@ instruct replicate16B(vecX dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T16B, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} instruct replicate8B_imm(vecD dst, immI con) @@ -14593,7 +15088,7 @@ instruct replicate8B_imm(vecD dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T8B, $con$$constant & 0xff); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm64); %} instruct replicate16B_imm(vecX dst, immI con) @@ -14605,7 +15100,7 @@ instruct replicate16B_imm(vecX dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T16B, $con$$constant & 0xff); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm128); %} instruct replicate4S(vecD dst, iRegIorL2I src) @@ -14618,7 +15113,7 @@ instruct replicate4S(vecD dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T4H, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg64); %} instruct replicate8S(vecX dst, iRegIorL2I src) @@ -14630,7 +15125,7 @@ instruct replicate8S(vecX dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T8H, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} instruct replicate4S_imm(vecD dst, immI con) @@ -14643,7 +15138,7 @@ instruct replicate4S_imm(vecD dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T4H, $con$$constant & 0xffff); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm64); %} instruct replicate8S_imm(vecX dst, immI con) @@ -14655,7 +15150,7 @@ instruct replicate8S_imm(vecX dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T8H, $con$$constant & 0xffff); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm128); %} instruct replicate2I(vecD dst, iRegIorL2I src) @@ -14667,7 +15162,7 @@ instruct replicate2I(vecD dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T2S, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg64); %} instruct replicate4I(vecX dst, iRegIorL2I src) @@ -14679,7 +15174,7 @@ instruct replicate4I(vecX dst, iRegIorL2I src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T4S, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} instruct replicate2I_imm(vecD dst, immI con) @@ -14691,7 +15186,7 @@ instruct replicate2I_imm(vecD dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T2S, $con$$constant); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm64); %} instruct replicate4I_imm(vecX dst, immI con) @@ -14703,7 +15198,7 @@ instruct replicate4I_imm(vecX dst, immI con) ins_encode %{ __ mov(as_FloatRegister($dst$$reg), __ T4S, $con$$constant); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm128); %} instruct replicate2L(vecX dst, iRegL src) @@ -14715,7 +15210,7 @@ instruct replicate2L(vecX dst, iRegL src) ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T2D, as_Register($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} instruct replicate2L_zero(vecX dst, immI0 zero) @@ -14729,7 +15224,7 @@ instruct replicate2L_zero(vecX dst, immI0 zero) as_FloatRegister($dst$$reg), as_FloatRegister($dst$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmovi_reg_imm128); %} instruct replicate2F(vecD dst, vRegF src) @@ -14742,7 +15237,7 @@ instruct replicate2F(vecD dst, vRegF src) __ dup(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_freg64); %} instruct replicate4F(vecX dst, vRegF src) @@ -14755,7 +15250,7 @@ instruct replicate4F(vecX dst, vRegF src) __ dup(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_freg128); %} instruct replicate2D(vecX dst, vRegD src) @@ -14768,7 +15263,7 @@ instruct replicate2D(vecX dst, vRegD src) __ dup(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_dreg128); %} // ====================REDUCTION ARITHMETIC==================================== @@ -15014,7 +15509,7 @@ instruct vadd8B(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vadd16B(vecX dst, vecX src1, vecX src2) @@ -15028,7 +15523,7 @@ instruct vadd16B(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vadd4S(vecD dst, vecD src1, vecD src2) @@ -15043,7 +15538,7 @@ instruct vadd4S(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vadd8S(vecX dst, vecX src1, vecX src2) @@ -15057,7 +15552,7 @@ instruct vadd8S(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vadd2I(vecD dst, vecD src1, vecD src2) @@ -15071,7 +15566,7 @@ instruct vadd2I(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vadd4I(vecX dst, vecX src1, vecX src2) @@ -15085,7 +15580,7 @@ instruct vadd4I(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vadd2L(vecX dst, vecX src1, vecX src2) @@ -15099,7 +15594,7 @@ instruct vadd2L(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vadd2F(vecD dst, vecD src1, vecD src2) @@ -15113,7 +15608,7 @@ instruct vadd2F(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp64); %} instruct vadd4F(vecX dst, vecX src1, vecX src2) @@ -15127,7 +15622,7 @@ instruct vadd4F(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp128); %} instruct vadd2D(vecX dst, vecX src1, vecX src2) @@ -15140,7 +15635,7 @@ instruct vadd2D(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp128); %} // --------------------------------- SUB -------------------------------------- @@ -15157,7 +15652,7 @@ instruct vsub8B(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vsub16B(vecX dst, vecX src1, vecX src2) @@ -15171,7 +15666,7 @@ instruct vsub16B(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vsub4S(vecD dst, vecD src1, vecD src2) @@ -15186,7 +15681,7 @@ instruct vsub4S(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vsub8S(vecX dst, vecX src1, vecX src2) @@ -15200,7 +15695,7 @@ instruct vsub8S(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vsub2I(vecD dst, vecD src1, vecD src2) @@ -15214,7 +15709,7 @@ instruct vsub2I(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop64); %} instruct vsub4I(vecX dst, vecX src1, vecX src2) @@ -15228,7 +15723,7 @@ instruct vsub4I(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vsub2L(vecX dst, vecX src1, vecX src2) @@ -15242,7 +15737,7 @@ instruct vsub2L(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop128); %} instruct vsub2F(vecD dst, vecD src1, vecD src2) @@ -15256,7 +15751,7 @@ instruct vsub2F(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp64); %} instruct vsub4F(vecX dst, vecX src1, vecX src2) @@ -15270,7 +15765,7 @@ instruct vsub4F(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp128); %} instruct vsub2D(vecX dst, vecX src1, vecX src2) @@ -15284,7 +15779,7 @@ instruct vsub2D(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdop_fp128); %} // --------------------------------- MUL -------------------------------------- @@ -15301,7 +15796,7 @@ instruct vmul4S(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmul64); %} instruct vmul8S(vecX dst, vecX src1, vecX src2) @@ -15315,7 +15810,7 @@ instruct vmul8S(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmul128); %} instruct vmul2I(vecD dst, vecD src1, vecD src2) @@ -15329,7 +15824,7 @@ instruct vmul2I(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmul64); %} instruct vmul4I(vecX dst, vecX src1, vecX src2) @@ -15343,7 +15838,7 @@ instruct vmul4I(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmul128); %} instruct vmul2F(vecD dst, vecD src1, vecD src2) @@ -15357,7 +15852,7 @@ instruct vmul2F(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp64); %} instruct vmul4F(vecX dst, vecX src1, vecX src2) @@ -15371,7 +15866,7 @@ instruct vmul4F(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp128); %} instruct vmul2D(vecX dst, vecX src1, vecX src2) @@ -15385,7 +15880,7 @@ instruct vmul2D(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp128); %} // --------------------------------- MLA -------------------------------------- @@ -15402,7 +15897,7 @@ instruct vmla4S(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla64); %} instruct vmla8S(vecX dst, vecX src1, vecX src2) @@ -15416,7 +15911,7 @@ instruct vmla8S(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla128); %} instruct vmla2I(vecD dst, vecD src1, vecD src2) @@ -15430,7 +15925,7 @@ instruct vmla2I(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla64); %} instruct vmla4I(vecX dst, vecX src1, vecX src2) @@ -15444,7 +15939,7 @@ instruct vmla4I(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla128); %} // --------------------------------- MLS -------------------------------------- @@ -15461,7 +15956,7 @@ instruct vmls4S(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla64); %} instruct vmls8S(vecX dst, vecX src1, vecX src2) @@ -15475,7 +15970,7 @@ instruct vmls8S(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla128); %} instruct vmls2I(vecD dst, vecD src1, vecD src2) @@ -15489,7 +15984,7 @@ instruct vmls2I(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla64); %} instruct vmls4I(vecX dst, vecX src1, vecX src2) @@ -15503,7 +15998,7 @@ instruct vmls4I(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmla128); %} // --------------------------------- DIV -------------------------------------- @@ -15519,7 +16014,7 @@ instruct vdiv2F(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp64); %} instruct vdiv4F(vecX dst, vecX src1, vecX src2) @@ -15533,7 +16028,7 @@ instruct vdiv4F(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp128); %} instruct vdiv2D(vecX dst, vecX src1, vecX src2) @@ -15547,7 +16042,7 @@ instruct vdiv2D(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vmuldiv_fp128); %} // --------------------------------- SQRT ------------------------------------- @@ -15561,7 +16056,7 @@ instruct vsqrt2D(vecX dst, vecX src) __ fsqrt(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vsqrt_fp128); %} // --------------------------------- ABS -------------------------------------- @@ -15576,7 +16071,7 @@ instruct vabs2F(vecD dst, vecD src) __ fabs(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp64); %} instruct vabs4F(vecX dst, vecX src) @@ -15589,7 +16084,7 @@ instruct vabs4F(vecX dst, vecX src) __ fabs(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp128); %} instruct vabs2D(vecX dst, vecX src) @@ -15602,7 +16097,7 @@ instruct vabs2D(vecX dst, vecX src) __ fabs(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp128); %} // --------------------------------- NEG -------------------------------------- @@ -15617,7 +16112,7 @@ instruct vneg2F(vecD dst, vecD src) __ fneg(as_FloatRegister($dst$$reg), __ T2S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp64); %} instruct vneg4F(vecX dst, vecX src) @@ -15630,7 +16125,7 @@ instruct vneg4F(vecX dst, vecX src) __ fneg(as_FloatRegister($dst$$reg), __ T4S, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp128); %} instruct vneg2D(vecX dst, vecX src) @@ -15643,7 +16138,7 @@ instruct vneg2D(vecX dst, vecX src) __ fneg(as_FloatRegister($dst$$reg), __ T2D, as_FloatRegister($src$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vunop_fp128); %} // --------------------------------- AND -------------------------------------- @@ -15660,7 +16155,7 @@ instruct vand8B(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical64); %} instruct vand16B(vecX dst, vecX src1, vecX src2) @@ -15674,7 +16169,7 @@ instruct vand16B(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical128); %} // --------------------------------- OR --------------------------------------- @@ -15691,7 +16186,7 @@ instruct vor8B(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical64); %} instruct vor16B(vecX dst, vecX src1, vecX src2) @@ -15705,7 +16200,7 @@ instruct vor16B(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical128); %} // --------------------------------- XOR -------------------------------------- @@ -15722,7 +16217,7 @@ instruct vxor8B(vecD dst, vecD src1, vecD src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical64); %} instruct vxor16B(vecX dst, vecX src1, vecX src2) @@ -15736,7 +16231,7 @@ instruct vxor16B(vecX dst, vecX src1, vecX src2) as_FloatRegister($src1$$reg), as_FloatRegister($src2$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vlogical128); %} // ------------------------------ Shift --------------------------------------- @@ -15747,7 +16242,7 @@ instruct vshiftcntL(vecX dst, iRegIorL2I cnt) %{ ins_encode %{ __ dup(as_FloatRegister($dst$$reg), __ T16B, as_Register($cnt$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} // Right shifts on aarch64 SIMD are implemented as left shift by -ve amount @@ -15758,7 +16253,7 @@ instruct vshiftcntR(vecX dst, iRegIorL2I cnt) %{ __ dup(as_FloatRegister($dst$$reg), __ T16B, as_Register($cnt$$reg)); __ negr(as_FloatRegister($dst$$reg), __ T16B, as_FloatRegister($dst$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vdup_reg_reg128); %} instruct vsll8B(vecD dst, vecD src, vecX shift) %{ @@ -15773,7 +16268,7 @@ instruct vsll8B(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64); %} instruct vsll16B(vecX dst, vecX src, vecX shift) %{ @@ -15787,7 +16282,7 @@ instruct vsll16B(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsrl8B(vecD dst, vecD src, vecX shift) %{ @@ -15801,7 +16296,7 @@ instruct vsrl8B(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64); %} instruct vsrl16B(vecX dst, vecX src, vecX shift) %{ @@ -15814,7 +16309,7 @@ instruct vsrl16B(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsll8B_imm(vecD dst, vecD src, immI shift) %{ @@ -15834,7 +16329,7 @@ instruct vsll8B_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), sh); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsll16B_imm(vecX dst, vecX src, immI shift) %{ @@ -15853,7 +16348,7 @@ instruct vsll16B_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), sh); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsra8B_imm(vecD dst, vecD src, immI shift) %{ @@ -15869,7 +16364,7 @@ instruct vsra8B_imm(vecD dst, vecD src, immI shift) %{ __ sshr(as_FloatRegister($dst$$reg), __ T8B, as_FloatRegister($src$$reg), sh); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsra16B_imm(vecX dst, vecX src, immI shift) %{ @@ -15884,7 +16379,7 @@ instruct vsra16B_imm(vecX dst, vecX src, immI shift) %{ __ sshr(as_FloatRegister($dst$$reg), __ T16B, as_FloatRegister($src$$reg), sh); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsrl8B_imm(vecD dst, vecD src, immI shift) %{ @@ -15904,7 +16399,7 @@ instruct vsrl8B_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), -sh & 7); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsrl16B_imm(vecX dst, vecX src, immI shift) %{ @@ -15923,7 +16418,7 @@ instruct vsrl16B_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -sh & 7); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsll4S(vecD dst, vecD src, vecX shift) %{ @@ -15938,7 +16433,7 @@ instruct vsll4S(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64); %} instruct vsll8S(vecX dst, vecX src, vecX shift) %{ @@ -15952,7 +16447,7 @@ instruct vsll8S(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsrl4S(vecD dst, vecD src, vecX shift) %{ @@ -15966,7 +16461,7 @@ instruct vsrl4S(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64); %} instruct vsrl8S(vecX dst, vecX src, vecX shift) %{ @@ -15979,7 +16474,7 @@ instruct vsrl8S(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsll4S_imm(vecD dst, vecD src, immI shift) %{ @@ -15999,7 +16494,7 @@ instruct vsll4S_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), sh); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsll8S_imm(vecX dst, vecX src, immI shift) %{ @@ -16018,7 +16513,7 @@ instruct vsll8S_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), sh); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsra4S_imm(vecD dst, vecD src, immI shift) %{ @@ -16034,7 +16529,7 @@ instruct vsra4S_imm(vecD dst, vecD src, immI shift) %{ __ sshr(as_FloatRegister($dst$$reg), __ T4H, as_FloatRegister($src$$reg), sh); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsra8S_imm(vecX dst, vecX src, immI shift) %{ @@ -16049,7 +16544,7 @@ instruct vsra8S_imm(vecX dst, vecX src, immI shift) %{ __ sshr(as_FloatRegister($dst$$reg), __ T8H, as_FloatRegister($src$$reg), sh); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsrl4S_imm(vecD dst, vecD src, immI shift) %{ @@ -16069,7 +16564,7 @@ instruct vsrl4S_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), -sh & 15); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsrl8S_imm(vecX dst, vecX src, immI shift) %{ @@ -16088,7 +16583,7 @@ instruct vsrl8S_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -sh & 15); } %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsll2I(vecD dst, vecD src, vecX shift) %{ @@ -16102,7 +16597,7 @@ instruct vsll2I(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsll4I(vecX dst, vecX src, vecX shift) %{ @@ -16116,7 +16611,7 @@ instruct vsll4I(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsrl2I(vecD dst, vecD src, vecX shift) %{ @@ -16129,7 +16624,7 @@ instruct vsrl2I(vecD dst, vecD src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsrl4I(vecX dst, vecX src, vecX shift) %{ @@ -16142,7 +16637,7 @@ instruct vsrl4I(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsll2I_imm(vecD dst, vecD src, immI shift) %{ @@ -16155,7 +16650,7 @@ instruct vsll2I_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), (int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsll4I_imm(vecX dst, vecX src, immI shift) %{ @@ -16168,7 +16663,7 @@ instruct vsll4I_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), (int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsra2I_imm(vecD dst, vecD src, immI shift) %{ @@ -16181,7 +16676,7 @@ instruct vsra2I_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsra4I_imm(vecX dst, vecX src, immI shift) %{ @@ -16194,7 +16689,7 @@ instruct vsra4I_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsrl2I_imm(vecD dst, vecD src, immI shift) %{ @@ -16207,7 +16702,7 @@ instruct vsrl2I_imm(vecD dst, vecD src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift64_imm); %} instruct vsrl4I_imm(vecX dst, vecX src, immI shift) %{ @@ -16220,7 +16715,7 @@ instruct vsrl4I_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 31); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsll2L(vecX dst, vecX src, vecX shift) %{ @@ -16234,7 +16729,7 @@ instruct vsll2L(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsrl2L(vecX dst, vecX src, vecX shift) %{ @@ -16247,7 +16742,7 @@ instruct vsrl2L(vecX dst, vecX src, vecX shift) %{ as_FloatRegister($src$$reg), as_FloatRegister($shift$$reg)); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsll2L_imm(vecX dst, vecX src, immI shift) %{ @@ -16260,7 +16755,7 @@ instruct vsll2L_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), (int)$shift$$constant & 63); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128); %} instruct vsra2L_imm(vecX dst, vecX src, immI shift) %{ @@ -16273,7 +16768,7 @@ instruct vsra2L_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 63); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} instruct vsrl2L_imm(vecX dst, vecX src, immI shift) %{ @@ -16286,7 +16781,7 @@ instruct vsrl2L_imm(vecX dst, vecX src, immI shift) %{ as_FloatRegister($src$$reg), -(int)$shift$$constant & 63); %} - ins_pipe(pipe_class_default); + ins_pipe(vshift128_imm); %} //----------PEEPHOLE RULES----------------------------------------------------- From f4555ca41f78b4aca422f6998e9ec6103f34144f Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Tue, 12 Jan 2016 12:35:08 -0500 Subject: [PATCH 064/212] 8144953: runtime/CommandLine/TraceExceptionsTest.java fails when exception is thrown in compiled code Added long-form logging message to three places in code, allowing TraceExceptionsTest.java to pass with compiled code. Reviewed-by: dholmes, coleenp, lfoltan --- hotspot/src/share/vm/c1/c1_Runtime1.cpp | 13 ++++---- .../vm/interpreter/bytecodeInterpreter.cpp | 32 +++++++++---------- .../vm/interpreter/interpreterRuntime.cpp | 16 ++-------- hotspot/src/share/vm/utilities/exceptions.cpp | 17 +++++++++- hotspot/src/share/vm/utilities/exceptions.hpp | 6 +++- .../test/runtime/logging/ExceptionsTest.java | 4 +-- 6 files changed, 48 insertions(+), 40 deletions(-) diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index 73cbdc53a50..1d9f17c527c 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -551,12 +551,11 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // tracing if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT - ") thrown in compiled method <%s> at PC " INTPTR_FORMAT - " for thread " INTPTR_FORMAT, - exception->print_value_string(), - p2i((address)exception()), - nm->method()->print_value_string(), p2i(pc), p2i(thread)); + stringStream tempst; + tempst.print("compiled method <%s>\n" + " at PC" INTPTR_FORMAT " for thread " INTPTR_FORMAT, + nm->method()->print_value_string(), p2i(pc), p2i(thread)); + Exceptions::log_exception(exception, tempst); } // for AbortVMOnException flag Exceptions::debug_check_abort(exception); diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 09e3d579ea0..74c0a3b4a49 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2780,14 +2780,14 @@ run: MORE_STACK(1); pc = METHOD->code_base() + continuation_bci; if (log_is_enabled(Info, exceptions)) { - ResourceMark rm; - log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n" - " thrown in interpreter method <%s>\n" - " at bci %d, continuing at %d for thread " INTPTR_FORMAT, - except_oop->print_value_string(), p2i(except_oop()), - METHOD->print_value_string(), - (int)(istate->bcp() - METHOD->code_base()), - (int)continuation_bci, p2i(THREAD)); + ResourceMark rm(thread); + stringStream tempst; + tempst.print("interpreter method <%s>\n" + " at bci %d, continuing at %d for thread " INTPTR_FORMAT, + METHOD->print_value_string(), + (int)(istate->bcp() - METHOD->code_base()), + (int)continuation_bci, p2i(THREAD)); + Exceptions::log_exception(except_oop, tempst); } // for AbortVMOnException flag Exceptions::debug_check_abort(except_oop); @@ -2798,13 +2798,13 @@ run: } if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n" - " thrown in interpreter method <%s>\n" - " at bci %d, unwinding for thread " INTPTR_FORMAT, - except_oop->print_value_string(), p2i(except_oop()), - METHOD->print_value_string(), - (int)(istate->bcp() - METHOD->code_base()), - p2i(THREAD)); + stringStream tempst; + tempst.print("interpreter method <%s>\n" + " at bci %d, unwinding for thread " INTPTR_FORMAT, + METHOD->print_value_string(), + (int)(istate->bcp() - METHOD->code_base()), + p2i(THREAD)); + Exceptions::log_exception(except_oop, tempst); } // for AbortVMOnException flag Exceptions::debug_check_abort(except_oop); diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 686402ddad3..a77328198cd 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -459,21 +459,11 @@ IRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea // tracing if (log_is_enabled(Info, exceptions)) { ResourceMark rm(thread); - Symbol* message = java_lang_Throwable::detail_message(h_exception()); stringStream tempst; - if (message != NULL) { - tempst.print("Exception <%s: %s> (" INTPTR_FORMAT ")\n", - h_exception->print_value_string(), message->as_C_string(), - p2i(h_exception())); - } else { - tempst.print("Exception <%s> (" INTPTR_FORMAT ")\n", - h_exception->print_value_string(), - p2i(h_exception())); - } - tempst.print(" thrown in interpreter method <%s>\n" + tempst.print("interpreter method <%s>\n" " at bci %d for thread " INTPTR_FORMAT, h_method->print_value_string(), current_bci, p2i(thread)); - LogHandle(exceptions)::info_stream()->print_raw_cr(tempst.as_string()); + Exceptions::log_exception(h_exception, tempst); } // Don't go paging in something which won't be used. // else if (extable->length() == 0) { diff --git a/hotspot/src/share/vm/utilities/exceptions.cpp b/hotspot/src/share/vm/utilities/exceptions.cpp index d0847c4c021..71b3e95a11a 100644 --- a/hotspot/src/share/vm/utilities/exceptions.cpp +++ b/hotspot/src/share/vm/utilities/exceptions.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -502,3 +502,18 @@ void Exceptions::debug_check_abort_helper(Handle exception, const char* message) } debug_check_abort(exception()->klass()->external_name(), message); } + +// for logging exceptions +void Exceptions::log_exception(Handle exception, stringStream tempst) { + ResourceMark rm; + Symbol* message = java_lang_Throwable::detail_message(exception()); + if (message != NULL) { + log_info(exceptions)("Exception <%s: %s> (" INTPTR_FORMAT ")\n thrown in %s", + exception->print_value_string(), + message->as_C_string(), p2i(exception()), tempst.as_string()); + } else { + log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n thrown in %s", + exception->print_value_string(), + p2i(exception()), tempst.as_string()); + } +} diff --git a/hotspot/src/share/vm/utilities/exceptions.hpp b/hotspot/src/share/vm/utilities/exceptions.hpp index 02d9110ef74..ae72f0c23d9 100644 --- a/hotspot/src/share/vm/utilities/exceptions.hpp +++ b/hotspot/src/share/vm/utilities/exceptions.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ #include "memory/allocation.hpp" #include "oops/oopsHierarchy.hpp" +#include "utilities/ostream.hpp" #include "utilities/sizes.hpp" // This file provides the basic support for exception handling in the VM. @@ -177,6 +178,9 @@ class Exceptions { static void debug_check_abort(Handle exception, const char* message = NULL); static void debug_check_abort_helper(Handle exception, const char* message = NULL); static void debug_check_abort(const char *value_string, const char* message = NULL); + + // for logging exceptions + static void log_exception(Handle exception, stringStream tempst); }; diff --git a/hotspot/test/runtime/logging/ExceptionsTest.java b/hotspot/test/runtime/logging/ExceptionsTest.java index 0fefed85e9d..bac3dd0cdb0 100644 --- a/hotspot/test/runtime/logging/ExceptionsTest.java +++ b/hotspot/test/runtime/logging/ExceptionsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ public class ExceptionsTest { OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(""); output.shouldContain(" thrown in interpreter method "); - output.shouldContain(") thrown in compiled method "); + output.shouldContain(" thrown in compiled method "); output.shouldContain("Exception 2 caught."); output.shouldHaveExitValue(0); } From 5d7f8cf015aa9a6a821179b70f20ba4b0ed3dd99 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Tue, 12 Jan 2016 13:14:41 -0500 Subject: [PATCH 065/212] 8146410: Interpreter functions are declared and defined in the wrong files Moved functions to the correct files. Reviewed-by: goetz, aph, twisti, mockner --- ...64.cpp => abstractInterpreter_aarch64.cpp} | 6 - .../cpu/aarch64/vm/interpreter_aarch64.cpp | 260 -------- .../templateInterpreterGenerator_aarch64.cpp | 215 ++++++- ...er_ppc.cpp => abstractInterpreter_ppc.cpp} | 30 +- hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp | 555 ------------------ .../vm/templateInterpreterGenerator_ppc.cpp | 511 +++++++++++++++- ...parc.cpp => abstractInterpreter_sparc.cpp} | 12 - .../src/cpu/sparc/vm/interpreter_sparc.cpp | 231 -------- .../vm/templateInterpreterGenerator_sparc.cpp | 207 ++++++- ...er_x86.cpp => abstractInterpreter_x86.cpp} | 10 - .../cpu/x86/vm/interpreterGenerator_x86.cpp | 53 -- hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp | 185 ------ hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp | 299 ---------- .../vm/templateInterpreterGenerator_x86.cpp | 59 +- .../templateInterpreterGenerator_x86_32.cpp | 113 +++- .../templateInterpreterGenerator_x86_64.cpp | 228 ++++++- .../cpu/zero/vm/abstractInterpreter_zero.cpp | 124 ++++ .../cpu/zero/vm/bytecodeInterpreter_zero.cpp | 41 +- ...o.cpp => cppInterpreterGenerator_zero.cpp} | 64 +- .../src/cpu/zero/vm/cppInterpreter_zero.cpp | 205 +------ hotspot/src/cpu/zero/vm/interp_masm_zero.cpp | 42 -- .../cpu/zero/vm/register_definitions_zero.cpp | 32 - hotspot/src/cpu/zero/vm/stack_zero.cpp | 9 +- hotspot/src/cpu/zero/vm/stack_zero.hpp | 7 +- hotspot/src/cpu/zero/vm/stack_zero.inline.hpp | 11 +- hotspot/src/os/aix/vm/os_aix.inline.hpp | 4 +- hotspot/src/os/bsd/vm/os_bsd.inline.hpp | 4 +- hotspot/src/os/linux/vm/os_linux.inline.hpp | 4 +- .../src/os/solaris/vm/os_solaris.inline.hpp | 4 +- .../src/os/windows/vm/os_windows.inline.hpp | 4 +- .../vm/interpreter/abstractInterpreter.cpp | 420 +++++++++++++ .../vm/interpreter/abstractInterpreter.hpp | 18 +- .../share/vm/interpreter/cppInterpreter.cpp | 109 +--- .../interpreter/cppInterpreterGenerator.cpp | 125 ++++ .../interpreter/cppInterpreterGenerator.hpp | 4 +- .../src/share/vm/interpreter/interpreter.cpp | 417 +------------ .../vm/interpreter/templateInterpreter.cpp | 454 +------------- .../vm/interpreter/templateInterpreter.hpp | 9 +- .../templateInterpreterGenerator.cpp | 492 ++++++++++++++++ .../templateInterpreterGenerator.hpp | 5 +- hotspot/src/share/vm/runtime/javaCalls.cpp | 4 +- hotspot/src/share/vm/runtime/os.hpp | 4 +- 42 files changed, 2635 insertions(+), 2955 deletions(-) rename hotspot/src/cpu/aarch64/vm/{templateInterpreter_aarch64.cpp => abstractInterpreter_aarch64.cpp} (96%) delete mode 100644 hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp rename hotspot/src/cpu/ppc/vm/{templateInterpreter_ppc.cpp => abstractInterpreter_ppc.cpp} (94%) delete mode 100644 hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp rename hotspot/src/cpu/sparc/vm/{templateInterpreter_sparc.cpp => abstractInterpreter_sparc.cpp} (96%) delete mode 100644 hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp rename hotspot/src/cpu/x86/vm/{templateInterpreter_x86.cpp => abstractInterpreter_x86.cpp} (95%) delete mode 100644 hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp delete mode 100644 hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp delete mode 100644 hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp create mode 100644 hotspot/src/cpu/zero/vm/abstractInterpreter_zero.cpp rename hotspot/src/cpu/zero/vm/{interpreter_zero.cpp => cppInterpreterGenerator_zero.cpp} (56%) delete mode 100644 hotspot/src/cpu/zero/vm/interp_masm_zero.cpp delete mode 100644 hotspot/src/cpu/zero/vm/register_definitions_zero.cpp create mode 100644 hotspot/src/share/vm/interpreter/abstractInterpreter.cpp create mode 100644 hotspot/src/share/vm/interpreter/cppInterpreterGenerator.cpp create mode 100644 hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/abstractInterpreter_aarch64.cpp similarity index 96% rename from hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp rename to hotspot/src/cpu/aarch64/vm/abstractInterpreter_aarch64.cpp index b067af82d44..77f49a72854 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/abstractInterpreter_aarch64.cpp @@ -31,12 +31,6 @@ #include "utilities/debug.hpp" #include "utilities/macros.hpp" -// Size of interpreter code. Increase if too small. Interpreter will -// fail with a guarantee ("not enough space for interpreter generation"); -// if too small. -// Run with +PrintInterpreter to get the VM to print out the size. -// Max size with JVMTI -int TemplateInterpreter::InterpreterCodeSize = 200 * 1024; int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; diff --git a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp deleted file mode 100644 index cdb6d5eecc4..00000000000 --- a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * 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 "asm/macroAssembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif - -#define __ _masm-> - - -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - address entry = __ pc(); - - __ andr(esp, esp, -16); - __ mov(c_rarg3, esp); - // rmethod - // rlocals - // c_rarg3: first stack arg - wordSize - - // adjust sp - __ sub(sp, c_rarg3, 18 * wordSize); - __ str(lr, Address(__ pre(sp, -2 * wordSize))); - __ call_VM(noreg, - CAST_FROM_FN_PTR(address, - InterpreterRuntime::slow_signature_handler), - rmethod, rlocals, c_rarg3); - - // r0: result handler - - // Stack layout: - // rsp: return address <- sp - // 1 garbage - // 8 integer args (if static first is unused) - // 1 float/double identifiers - // 8 double args - // stack args <- esp - // garbage - // expression stack bottom - // bcp (NULL) - // ... - - // Restore LR - __ ldr(lr, Address(__ post(sp, 2 * wordSize))); - - // Do FP first so we can use c_rarg3 as temp - __ ldrw(c_rarg3, Address(sp, 9 * wordSize)); // float/double identifiers - - for (int i = 0; i < Argument::n_float_register_parameters_c; i++) { - const FloatRegister r = as_FloatRegister(i); - - Label d, done; - - __ tbnz(c_rarg3, i, d); - __ ldrs(r, Address(sp, (10 + i) * wordSize)); - __ b(done); - __ bind(d); - __ ldrd(r, Address(sp, (10 + i) * wordSize)); - __ bind(done); - } - - // c_rarg0 contains the result from the call of - // InterpreterRuntime::slow_signature_handler so we don't touch it - // here. It will be loaded with the JNIEnv* later. - __ ldr(c_rarg1, Address(sp, 1 * wordSize)); - for (int i = c_rarg2->encoding(); i <= c_rarg7->encoding(); i += 2) { - Register rm = as_Register(i), rn = as_Register(i+1); - __ ldp(rm, rn, Address(sp, i * wordSize)); - } - - __ add(sp, sp, 18 * wordSize); - __ ret(lr); - - return entry; -} - - -// -// Various method entries -// - -address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { - // rmethod: Method* - // r13: sender sp - // esp: args - - if (!InlineIntrinsics) return NULL; // Generate a vanilla entry - - // These don't need a safepoint check because they aren't virtually - // callable. We won't enter these intrinsics from compiled code. - // If in the future we added an intrinsic which was virtually callable - // we'd have to worry about how to safepoint so that this code is used. - - // mathematical functions inlined by compiler - // (interpreter must provide identical implementation - // in order to avoid monotonicity bugs when switching - // from interpreter to compiler in the middle of some - // computation) - // - // stack: - // [ arg ] <-- esp - // [ arg ] - // retaddr in lr - - address entry_point = NULL; - Register continuation = lr; - switch (kind) { - case Interpreter::java_lang_math_abs: - entry_point = __ pc(); - __ ldrd(v0, Address(esp)); - __ fabsd(v0, v0); - __ mov(sp, r13); // Restore caller's SP - break; - case Interpreter::java_lang_math_sqrt: - entry_point = __ pc(); - __ ldrd(v0, Address(esp)); - __ fsqrtd(v0, v0); - __ mov(sp, r13); - break; - case Interpreter::java_lang_math_sin : - case Interpreter::java_lang_math_cos : - case Interpreter::java_lang_math_tan : - case Interpreter::java_lang_math_log : - case Interpreter::java_lang_math_log10 : - case Interpreter::java_lang_math_exp : - entry_point = __ pc(); - __ ldrd(v0, Address(esp)); - __ mov(sp, r13); - __ mov(r19, lr); - continuation = r19; // The first callee-saved register - generate_transcendental_entry(kind, 1); - break; - case Interpreter::java_lang_math_pow : - entry_point = __ pc(); - __ mov(r19, lr); - continuation = r19; - __ ldrd(v0, Address(esp, 2 * Interpreter::stackElementSize)); - __ ldrd(v1, Address(esp)); - __ mov(sp, r13); - generate_transcendental_entry(kind, 2); - break; - default: - ; - } - if (entry_point) { - __ br(continuation); - } - - return entry_point; -} - - // double trigonometrics and transcendentals - // static jdouble dsin(jdouble x); - // static jdouble dcos(jdouble x); - // static jdouble dtan(jdouble x); - // static jdouble dlog(jdouble x); - // static jdouble dlog10(jdouble x); - // static jdouble dexp(jdouble x); - // static jdouble dpow(jdouble x, jdouble y); - -void TemplateInterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs) { - address fn; - switch (kind) { - case Interpreter::java_lang_math_sin : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dsin); - break; - case Interpreter::java_lang_math_cos : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dcos); - break; - case Interpreter::java_lang_math_tan : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dtan); - break; - case Interpreter::java_lang_math_log : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog); - break; - case Interpreter::java_lang_math_log10 : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog10); - break; - case Interpreter::java_lang_math_exp : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dexp); - break; - case Interpreter::java_lang_math_pow : - fpargs = 2; - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dpow); - break; - default: - ShouldNotReachHere(); - } - const int gpargs = 0, rtype = 3; - __ mov(rscratch1, fn); - __ blrt(rscratch1, gpargs, fpargs, rtype); -} - -// Abstract method entry -// Attempt to execute abstract method. Throw exception -address TemplateInterpreterGenerator::generate_abstract_entry(void) { - // rmethod: Method* - // r13: sender SP - - address entry_point = __ pc(); - - // abstract method entry - - // pop return address, reset last_sp to NULL - __ empty_expression_stack(); - __ restore_bcp(); // bcp must be correct for exception handler (was destroyed) - __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) - - // throw exception - __ call_VM(noreg, CAST_FROM_FN_PTR(address, - InterpreterRuntime::throw_AbstractMethodError)); - // the call_VM checks for exception, so we should never return here. - __ should_not_reach_here(); - - return entry_point; -} diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp index 1edb46adf16..4257aecba15 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -57,6 +57,13 @@ #include "../../../../../../simulator/simulator.hpp" #endif +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +int TemplateInterpreter::InterpreterCodeSize = 200 * 1024; + #define __ _masm-> //----------------------------------------------------------------------------- @@ -65,6 +72,212 @@ extern "C" void entry(CodeBuffer*); //----------------------------------------------------------------------------- +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + address entry = __ pc(); + + __ andr(esp, esp, -16); + __ mov(c_rarg3, esp); + // rmethod + // rlocals + // c_rarg3: first stack arg - wordSize + + // adjust sp + __ sub(sp, c_rarg3, 18 * wordSize); + __ str(lr, Address(__ pre(sp, -2 * wordSize))); + __ call_VM(noreg, + CAST_FROM_FN_PTR(address, + InterpreterRuntime::slow_signature_handler), + rmethod, rlocals, c_rarg3); + + // r0: result handler + + // Stack layout: + // rsp: return address <- sp + // 1 garbage + // 8 integer args (if static first is unused) + // 1 float/double identifiers + // 8 double args + // stack args <- esp + // garbage + // expression stack bottom + // bcp (NULL) + // ... + + // Restore LR + __ ldr(lr, Address(__ post(sp, 2 * wordSize))); + + // Do FP first so we can use c_rarg3 as temp + __ ldrw(c_rarg3, Address(sp, 9 * wordSize)); // float/double identifiers + + for (int i = 0; i < Argument::n_float_register_parameters_c; i++) { + const FloatRegister r = as_FloatRegister(i); + + Label d, done; + + __ tbnz(c_rarg3, i, d); + __ ldrs(r, Address(sp, (10 + i) * wordSize)); + __ b(done); + __ bind(d); + __ ldrd(r, Address(sp, (10 + i) * wordSize)); + __ bind(done); + } + + // c_rarg0 contains the result from the call of + // InterpreterRuntime::slow_signature_handler so we don't touch it + // here. It will be loaded with the JNIEnv* later. + __ ldr(c_rarg1, Address(sp, 1 * wordSize)); + for (int i = c_rarg2->encoding(); i <= c_rarg7->encoding(); i += 2) { + Register rm = as_Register(i), rn = as_Register(i+1); + __ ldp(rm, rn, Address(sp, i * wordSize)); + } + + __ add(sp, sp, 18 * wordSize); + __ ret(lr); + + return entry; +} + + +// +// Various method entries +// + +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { + // rmethod: Method* + // r13: sender sp + // esp: args + + if (!InlineIntrinsics) return NULL; // Generate a vanilla entry + + // These don't need a safepoint check because they aren't virtually + // callable. We won't enter these intrinsics from compiled code. + // If in the future we added an intrinsic which was virtually callable + // we'd have to worry about how to safepoint so that this code is used. + + // mathematical functions inlined by compiler + // (interpreter must provide identical implementation + // in order to avoid monotonicity bugs when switching + // from interpreter to compiler in the middle of some + // computation) + // + // stack: + // [ arg ] <-- esp + // [ arg ] + // retaddr in lr + + address entry_point = NULL; + Register continuation = lr; + switch (kind) { + case Interpreter::java_lang_math_abs: + entry_point = __ pc(); + __ ldrd(v0, Address(esp)); + __ fabsd(v0, v0); + __ mov(sp, r13); // Restore caller's SP + break; + case Interpreter::java_lang_math_sqrt: + entry_point = __ pc(); + __ ldrd(v0, Address(esp)); + __ fsqrtd(v0, v0); + __ mov(sp, r13); + break; + case Interpreter::java_lang_math_sin : + case Interpreter::java_lang_math_cos : + case Interpreter::java_lang_math_tan : + case Interpreter::java_lang_math_log : + case Interpreter::java_lang_math_log10 : + case Interpreter::java_lang_math_exp : + entry_point = __ pc(); + __ ldrd(v0, Address(esp)); + __ mov(sp, r13); + __ mov(r19, lr); + continuation = r19; // The first callee-saved register + generate_transcendental_entry(kind, 1); + break; + case Interpreter::java_lang_math_pow : + entry_point = __ pc(); + __ mov(r19, lr); + continuation = r19; + __ ldrd(v0, Address(esp, 2 * Interpreter::stackElementSize)); + __ ldrd(v1, Address(esp)); + __ mov(sp, r13); + generate_transcendental_entry(kind, 2); + break; + default: + ; + } + if (entry_point) { + __ br(continuation); + } + + return entry_point; +} + + // double trigonometrics and transcendentals + // static jdouble dsin(jdouble x); + // static jdouble dcos(jdouble x); + // static jdouble dtan(jdouble x); + // static jdouble dlog(jdouble x); + // static jdouble dlog10(jdouble x); + // static jdouble dexp(jdouble x); + // static jdouble dpow(jdouble x, jdouble y); + +void TemplateInterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs) { + address fn; + switch (kind) { + case Interpreter::java_lang_math_sin : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dsin); + break; + case Interpreter::java_lang_math_cos : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dcos); + break; + case Interpreter::java_lang_math_tan : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dtan); + break; + case Interpreter::java_lang_math_log : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog); + break; + case Interpreter::java_lang_math_log10 : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog10); + break; + case Interpreter::java_lang_math_exp : + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dexp); + break; + case Interpreter::java_lang_math_pow : + fpargs = 2; + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dpow); + break; + default: + ShouldNotReachHere(); + } + const int gpargs = 0, rtype = 3; + __ mov(rscratch1, fn); + __ blrt(rscratch1, gpargs, fpargs, rtype); +} + +// Abstract method entry +// Attempt to execute abstract method. Throw exception +address TemplateInterpreterGenerator::generate_abstract_entry(void) { + // rmethod: Method* + // r13: sender SP + + address entry_point = __ pc(); + + // abstract method entry + + // pop return address, reset last_sp to NULL + __ empty_expression_stack(); + __ restore_bcp(); // bcp must be correct for exception handler (was destroyed) + __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) + + // throw exception + __ call_VM(noreg, CAST_FROM_FN_PTR(address, + InterpreterRuntime::throw_AbstractMethodError)); + // the call_VM checks for exception, so we should never return here. + __ should_not_reach_here(); + + return entry_point; +} + address TemplateInterpreterGenerator::generate_StackOverflowError_handler() { address entry = __ pc(); diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/abstractInterpreter_ppc.cpp similarity index 94% rename from hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp rename to hotspot/src/cpu/ppc/vm/abstractInterpreter_ppc.cpp index 8cd02dca4b3..e720242a6d5 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/abstractInterpreter_ppc.cpp @@ -31,13 +31,6 @@ #include "utilities/debug.hpp" #include "utilities/macros.hpp" -// Size of interpreter code. Increase if too small. Interpreter will -// fail with a guarantee ("not enough space for interpreter generation"); -// if too small. -// Run with +PrintInterpreter to get the VM to print out the size. -// Max size with JVMTI -int TemplateInterpreter::InterpreterCodeSize = 230*K; - int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; switch (type) { @@ -58,10 +51,19 @@ int AbstractInterpreter::BasicType_as_index(BasicType type) { return i; } +// Support abs and sqrt like in compiler. +// For others we can use a normal (native) entry. +bool AbstractInterpreter::math_entry_available(AbstractInterpreter::MethodKind kind) { + if (!InlineIntrinsics) return false; + + return ((kind==Interpreter::java_lang_math_sqrt && VM_Version::has_fsqrt()) || + (kind==Interpreter::java_lang_math_abs)); +} + // These should never be compiled since the interpreter will prefer // the compiled version to the intrinsic version. bool AbstractInterpreter::can_be_compiled(methodHandle m) { - return !TemplateInterpreter::math_entry_available(method_kind(m)); + return !math_entry_available(method_kind(m)); } // How much stack a method activation needs in stack slots. @@ -159,15 +161,3 @@ void AbstractInterpreter::layout_activation(Method* method, interpreter_frame->interpreter_frame_set_sender_sp(sender_sp); } } - -// Support abs and sqrt like in compiler. -// For others we can use a normal (native) entry. - -bool TemplateInterpreter::math_entry_available(AbstractInterpreter::MethodKind kind) { - if (!InlineIntrinsics) return false; - - return ((kind==Interpreter::java_lang_math_sqrt && VM_Version::has_fsqrt()) || - (kind==Interpreter::java_lang_math_abs)); -} - - diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp deleted file mode 100644 index bd3488f9873..00000000000 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp +++ /dev/null @@ -1,555 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. 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 "asm/macroAssembler.inline.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif - -#define __ _masm-> - -#ifdef PRODUCT -#define BLOCK_COMMENT(str) // nothing -#else -#define BLOCK_COMMENT(str) __ block_comment(str) -#endif - -#define BIND(label) bind(label); BLOCK_COMMENT(#label ":") - -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - // Slow_signature handler that respects the PPC C calling conventions. - // - // We get called by the native entry code with our output register - // area == 8. First we call InterpreterRuntime::get_result_handler - // to copy the pointer to the signature string temporarily to the - // first C-argument and to return the result_handler in - // R3_RET. Since native_entry will copy the jni-pointer to the - // first C-argument slot later on, it is OK to occupy this slot - // temporarilly. Then we copy the argument list on the java - // expression stack into native varargs format on the native stack - // and load arguments into argument registers. Integer arguments in - // the varargs vector will be sign-extended to 8 bytes. - // - // On entry: - // R3_ARG1 - intptr_t* Address of java argument list in memory. - // R15_prev_state - BytecodeInterpreter* Address of interpreter state for - // this method - // R19_method - // - // On exit (just before return instruction): - // R3_RET - contains the address of the result_handler. - // R4_ARG2 - is not updated for static methods and contains "this" otherwise. - // R5_ARG3-R10_ARG8: - When the (i-2)th Java argument is not of type float or double, - // ARGi contains this argument. Otherwise, ARGi is not updated. - // F1_ARG1-F13_ARG13 - contain the first 13 arguments of type float or double. - - const int LogSizeOfTwoInstructions = 3; - - // FIXME: use Argument:: GL: Argument names different numbers! - const int max_fp_register_arguments = 13; - const int max_int_register_arguments = 6; // first 2 are reserved - - const Register arg_java = R21_tmp1; - const Register arg_c = R22_tmp2; - const Register signature = R23_tmp3; // is string - const Register sig_byte = R24_tmp4; - const Register fpcnt = R25_tmp5; - const Register argcnt = R26_tmp6; - const Register intSlot = R27_tmp7; - const Register target_sp = R28_tmp8; - const FloatRegister floatSlot = F0; - - address entry = __ function_entry(); - - __ save_LR_CR(R0); - __ save_nonvolatile_gprs(R1_SP, _spill_nonvolatiles_neg(r14)); - // We use target_sp for storing arguments in the C frame. - __ mr(target_sp, R1_SP); - __ push_frame_reg_args_nonvolatiles(0, R11_scratch1); - - __ mr(arg_java, R3_ARG1); - - __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::get_signature), R16_thread, R19_method); - - // Signature is in R3_RET. Signature is callee saved. - __ mr(signature, R3_RET); - - // Get the result handler. - __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::get_result_handler), R16_thread, R19_method); - - { - Label L; - // test if static - // _access_flags._flags must be at offset 0. - // TODO PPC port: requires change in shared code. - //assert(in_bytes(AccessFlags::flags_offset()) == 0, - // "MethodDesc._access_flags == MethodDesc._access_flags._flags"); - // _access_flags must be a 32 bit value. - assert(sizeof(AccessFlags) == 4, "wrong size"); - __ lwa(R11_scratch1/*access_flags*/, method_(access_flags)); - // testbit with condition register. - __ testbitdi(CCR0, R0, R11_scratch1/*access_flags*/, JVM_ACC_STATIC_BIT); - __ btrue(CCR0, L); - // For non-static functions, pass "this" in R4_ARG2 and copy it - // to 2nd C-arg slot. - // We need to box the Java object here, so we use arg_java - // (address of current Java stack slot) as argument and don't - // dereference it as in case of ints, floats, etc. - __ mr(R4_ARG2, arg_java); - __ addi(arg_java, arg_java, -BytesPerWord); - __ std(R4_ARG2, _abi(carg_2), target_sp); - __ bind(L); - } - - // Will be incremented directly after loop_start. argcnt=0 - // corresponds to 3rd C argument. - __ li(argcnt, -1); - // arg_c points to 3rd C argument - __ addi(arg_c, target_sp, _abi(carg_3)); - // no floating-point args parsed so far - __ li(fpcnt, 0); - - Label move_intSlot_to_ARG, move_floatSlot_to_FARG; - Label loop_start, loop_end; - Label do_int, do_long, do_float, do_double, do_dontreachhere, do_object, do_array, do_boxed; - - // signature points to '(' at entry -#ifdef ASSERT - __ lbz(sig_byte, 0, signature); - __ cmplwi(CCR0, sig_byte, '('); - __ bne(CCR0, do_dontreachhere); -#endif - - __ bind(loop_start); - - __ addi(argcnt, argcnt, 1); - __ lbzu(sig_byte, 1, signature); - - __ cmplwi(CCR0, sig_byte, ')'); // end of signature - __ beq(CCR0, loop_end); - - __ cmplwi(CCR0, sig_byte, 'B'); // byte - __ beq(CCR0, do_int); - - __ cmplwi(CCR0, sig_byte, 'C'); // char - __ beq(CCR0, do_int); - - __ cmplwi(CCR0, sig_byte, 'D'); // double - __ beq(CCR0, do_double); - - __ cmplwi(CCR0, sig_byte, 'F'); // float - __ beq(CCR0, do_float); - - __ cmplwi(CCR0, sig_byte, 'I'); // int - __ beq(CCR0, do_int); - - __ cmplwi(CCR0, sig_byte, 'J'); // long - __ beq(CCR0, do_long); - - __ cmplwi(CCR0, sig_byte, 'S'); // short - __ beq(CCR0, do_int); - - __ cmplwi(CCR0, sig_byte, 'Z'); // boolean - __ beq(CCR0, do_int); - - __ cmplwi(CCR0, sig_byte, 'L'); // object - __ beq(CCR0, do_object); - - __ cmplwi(CCR0, sig_byte, '['); // array - __ beq(CCR0, do_array); - - // __ cmplwi(CCR0, sig_byte, 'V'); // void cannot appear since we do not parse the return type - // __ beq(CCR0, do_void); - - __ bind(do_dontreachhere); - - __ unimplemented("ShouldNotReachHere in slow_signature_handler", 120); - - __ bind(do_array); - - { - Label start_skip, end_skip; - - __ bind(start_skip); - __ lbzu(sig_byte, 1, signature); - __ cmplwi(CCR0, sig_byte, '['); - __ beq(CCR0, start_skip); // skip further brackets - __ cmplwi(CCR0, sig_byte, '9'); - __ bgt(CCR0, end_skip); // no optional size - __ cmplwi(CCR0, sig_byte, '0'); - __ bge(CCR0, start_skip); // skip optional size - __ bind(end_skip); - - __ cmplwi(CCR0, sig_byte, 'L'); - __ beq(CCR0, do_object); // for arrays of objects, the name of the object must be skipped - __ b(do_boxed); // otherwise, go directly to do_boxed - } - - __ bind(do_object); - { - Label L; - __ bind(L); - __ lbzu(sig_byte, 1, signature); - __ cmplwi(CCR0, sig_byte, ';'); - __ bne(CCR0, L); - } - // Need to box the Java object here, so we use arg_java (address of - // current Java stack slot) as argument and don't dereference it as - // in case of ints, floats, etc. - Label do_null; - __ bind(do_boxed); - __ ld(R0,0, arg_java); - __ cmpdi(CCR0, R0, 0); - __ li(intSlot,0); - __ beq(CCR0, do_null); - __ mr(intSlot, arg_java); - __ bind(do_null); - __ std(intSlot, 0, arg_c); - __ addi(arg_java, arg_java, -BytesPerWord); - __ addi(arg_c, arg_c, BytesPerWord); - __ cmplwi(CCR0, argcnt, max_int_register_arguments); - __ blt(CCR0, move_intSlot_to_ARG); - __ b(loop_start); - - __ bind(do_int); - __ lwa(intSlot, 0, arg_java); - __ std(intSlot, 0, arg_c); - __ addi(arg_java, arg_java, -BytesPerWord); - __ addi(arg_c, arg_c, BytesPerWord); - __ cmplwi(CCR0, argcnt, max_int_register_arguments); - __ blt(CCR0, move_intSlot_to_ARG); - __ b(loop_start); - - __ bind(do_long); - __ ld(intSlot, -BytesPerWord, arg_java); - __ std(intSlot, 0, arg_c); - __ addi(arg_java, arg_java, - 2 * BytesPerWord); - __ addi(arg_c, arg_c, BytesPerWord); - __ cmplwi(CCR0, argcnt, max_int_register_arguments); - __ blt(CCR0, move_intSlot_to_ARG); - __ b(loop_start); - - __ bind(do_float); - __ lfs(floatSlot, 0, arg_java); -#if defined(LINUX) - // Linux uses ELF ABI. Both original ELF and ELFv2 ABIs have float - // in the least significant word of an argument slot. -#if defined(VM_LITTLE_ENDIAN) - __ stfs(floatSlot, 0, arg_c); -#else - __ stfs(floatSlot, 4, arg_c); -#endif -#elif defined(AIX) - // Although AIX runs on big endian CPU, float is in most significant - // word of an argument slot. - __ stfs(floatSlot, 0, arg_c); -#else -#error "unknown OS" -#endif - __ addi(arg_java, arg_java, -BytesPerWord); - __ addi(arg_c, arg_c, BytesPerWord); - __ cmplwi(CCR0, fpcnt, max_fp_register_arguments); - __ blt(CCR0, move_floatSlot_to_FARG); - __ b(loop_start); - - __ bind(do_double); - __ lfd(floatSlot, - BytesPerWord, arg_java); - __ stfd(floatSlot, 0, arg_c); - __ addi(arg_java, arg_java, - 2 * BytesPerWord); - __ addi(arg_c, arg_c, BytesPerWord); - __ cmplwi(CCR0, fpcnt, max_fp_register_arguments); - __ blt(CCR0, move_floatSlot_to_FARG); - __ b(loop_start); - - __ bind(loop_end); - - __ pop_frame(); - __ restore_nonvolatile_gprs(R1_SP, _spill_nonvolatiles_neg(r14)); - __ restore_LR_CR(R0); - - __ blr(); - - Label move_int_arg, move_float_arg; - __ bind(move_int_arg); // each case must consist of 2 instructions (otherwise adapt LogSizeOfTwoInstructions) - __ mr(R5_ARG3, intSlot); __ b(loop_start); - __ mr(R6_ARG4, intSlot); __ b(loop_start); - __ mr(R7_ARG5, intSlot); __ b(loop_start); - __ mr(R8_ARG6, intSlot); __ b(loop_start); - __ mr(R9_ARG7, intSlot); __ b(loop_start); - __ mr(R10_ARG8, intSlot); __ b(loop_start); - - __ bind(move_float_arg); // each case must consist of 2 instructions (otherwise adapt LogSizeOfTwoInstructions) - __ fmr(F1_ARG1, floatSlot); __ b(loop_start); - __ fmr(F2_ARG2, floatSlot); __ b(loop_start); - __ fmr(F3_ARG3, floatSlot); __ b(loop_start); - __ fmr(F4_ARG4, floatSlot); __ b(loop_start); - __ fmr(F5_ARG5, floatSlot); __ b(loop_start); - __ fmr(F6_ARG6, floatSlot); __ b(loop_start); - __ fmr(F7_ARG7, floatSlot); __ b(loop_start); - __ fmr(F8_ARG8, floatSlot); __ b(loop_start); - __ fmr(F9_ARG9, floatSlot); __ b(loop_start); - __ fmr(F10_ARG10, floatSlot); __ b(loop_start); - __ fmr(F11_ARG11, floatSlot); __ b(loop_start); - __ fmr(F12_ARG12, floatSlot); __ b(loop_start); - __ fmr(F13_ARG13, floatSlot); __ b(loop_start); - - __ bind(move_intSlot_to_ARG); - __ sldi(R0, argcnt, LogSizeOfTwoInstructions); - __ load_const(R11_scratch1, move_int_arg); // Label must be bound here. - __ add(R11_scratch1, R0, R11_scratch1); - __ mtctr(R11_scratch1/*branch_target*/); - __ bctr(); - __ bind(move_floatSlot_to_FARG); - __ sldi(R0, fpcnt, LogSizeOfTwoInstructions); - __ addi(fpcnt, fpcnt, 1); - __ load_const(R11_scratch1, move_float_arg); // Label must be bound here. - __ add(R11_scratch1, R0, R11_scratch1); - __ mtctr(R11_scratch1/*branch_target*/); - __ bctr(); - - return entry; -} - -address AbstractInterpreterGenerator::generate_result_handler_for(BasicType type) { - // - // Registers alive - // R3_RET - // LR - // - // Registers updated - // R3_RET - // - - Label done; - address entry = __ pc(); - - switch (type) { - case T_BOOLEAN: - // convert !=0 to 1 - __ neg(R0, R3_RET); - __ orr(R0, R3_RET, R0); - __ srwi(R3_RET, R0, 31); - break; - case T_BYTE: - // sign extend 8 bits - __ extsb(R3_RET, R3_RET); - break; - case T_CHAR: - // zero extend 16 bits - __ clrldi(R3_RET, R3_RET, 48); - break; - case T_SHORT: - // sign extend 16 bits - __ extsh(R3_RET, R3_RET); - break; - case T_INT: - // sign extend 32 bits - __ extsw(R3_RET, R3_RET); - break; - case T_LONG: - break; - case T_OBJECT: - // unbox result if not null - __ cmpdi(CCR0, R3_RET, 0); - __ beq(CCR0, done); - __ ld(R3_RET, 0, R3_RET); - __ verify_oop(R3_RET); - break; - case T_FLOAT: - break; - case T_DOUBLE: - break; - case T_VOID: - break; - default: ShouldNotReachHere(); - } - - __ BIND(done); - __ blr(); - - return entry; -} - -// Abstract method entry. -// -address TemplateInterpreterGenerator::generate_abstract_entry(void) { - address entry = __ pc(); - - // - // Registers alive - // R16_thread - JavaThread* - // R19_method - callee's method (method to be invoked) - // R1_SP - SP prepared such that caller's outgoing args are near top - // LR - return address to caller - // - // Stack layout at this point: - // - // 0 [TOP_IJAVA_FRAME_ABI] <-- R1_SP - // alignment (optional) - // [outgoing Java arguments] - // ... - // PARENT [PARENT_IJAVA_FRAME_ABI] - // ... - // - - // Can't use call_VM here because we have not set up a new - // interpreter state. Make the call to the vm and make it look like - // our caller set up the JavaFrameAnchor. - __ set_top_ijava_frame_at_SP_as_last_Java_frame(R1_SP, R12_scratch2/*tmp*/); - - // Push a new C frame and save LR. - __ save_LR_CR(R0); - __ push_frame_reg_args(0, R11_scratch1); - - // This is not a leaf but we have a JavaFrameAnchor now and we will - // check (create) exceptions afterward so this is ok. - __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError), - R16_thread); - - // Pop the C frame and restore LR. - __ pop_frame(); - __ restore_LR_CR(R0); - - // Reset JavaFrameAnchor from call_VM_leaf above. - __ reset_last_Java_frame(); - - // We don't know our caller, so jump to the general forward exception stub, - // which will also pop our full frame off. Satisfy the interface of - // SharedRuntime::generate_forward_exception() - __ load_const_optimized(R11_scratch1, StubRoutines::forward_exception_entry(), R0); - __ mtctr(R11_scratch1); - __ bctr(); - - return entry; -} - -// Interpreter intrinsic for WeakReference.get(). -// 1. Don't push a full blown frame and go on dispatching, but fetch the value -// into R8 and return quickly -// 2. If G1 is active we *must* execute this intrinsic for corrrectness: -// It contains a GC barrier which puts the reference into the satb buffer -// to indicate that someone holds a strong reference to the object the -// weak ref points to! -address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { - // Code: _aload_0, _getfield, _areturn - // parameter size = 1 - // - // The code that gets generated by this routine is split into 2 parts: - // 1. the "intrinsified" code for G1 (or any SATB based GC), - // 2. the slow path - which is an expansion of the regular method entry. - // - // Notes: - // * In the G1 code we do not check whether we need to block for - // a safepoint. If G1 is enabled then we must execute the specialized - // code for Reference.get (except when the Reference object is null) - // so that we can log the value in the referent field with an SATB - // update buffer. - // If the code for the getfield template is modified so that the - // G1 pre-barrier code is executed when the current method is - // Reference.get() then going through the normal method entry - // will be fine. - // * The G1 code can, however, check the receiver object (the instance - // of java.lang.Reference) and jump to the slow path if null. If the - // Reference object is null then we obviously cannot fetch the referent - // and so we don't need to call the G1 pre-barrier. Thus we can use the - // regular method entry code to generate the NPE. - // - - if (UseG1GC) { - address entry = __ pc(); - - const int referent_offset = java_lang_ref_Reference::referent_offset; - guarantee(referent_offset > 0, "referent offset not initialized"); - - Label slow_path; - - // Debugging not possible, so can't use __ skip_if_jvmti_mode(slow_path, GR31_SCRATCH); - - // In the G1 code we don't check if we need to reach a safepoint. We - // continue and the thread will safepoint at the next bytecode dispatch. - - // If the receiver is null then it is OK to jump to the slow path. - __ ld(R3_RET, Interpreter::stackElementSize, R15_esp); // get receiver - - // Check if receiver == NULL and go the slow path. - __ cmpdi(CCR0, R3_RET, 0); - __ beq(CCR0, slow_path); - - // Load the value of the referent field. - __ load_heap_oop(R3_RET, referent_offset, R3_RET); - - // Generate the G1 pre-barrier code to log the value of - // the referent field in an SATB buffer. Note with - // these parameters the pre-barrier does not generate - // the load of the previous value. - - // Restore caller sp for c2i case. -#ifdef ASSERT - __ ld(R9_ARG7, 0, R1_SP); - __ ld(R10_ARG8, 0, R21_sender_SP); - __ cmpd(CCR0, R9_ARG7, R10_ARG8); - __ asm_assert_eq("backlink", 0x544); -#endif // ASSERT - __ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started. - - __ g1_write_barrier_pre(noreg, // obj - noreg, // offset - R3_RET, // pre_val - R11_scratch1, // tmp - R12_scratch2, // tmp - true); // needs_frame - - __ blr(); - - // Generate regular method entry. - __ bind(slow_path); - __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::zerolocals), R11_scratch1); - return entry; - } - - return NULL; -} diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp index 1972e21f743..3bc1ee7d673 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -51,6 +51,13 @@ #undef __ #define __ _masm-> +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +int TemplateInterpreter::InterpreterCodeSize = 230*K; + #ifdef PRODUCT #define BLOCK_COMMENT(str) /* nothing */ #else @@ -61,6 +68,500 @@ //----------------------------------------------------------------------------- +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + // Slow_signature handler that respects the PPC C calling conventions. + // + // We get called by the native entry code with our output register + // area == 8. First we call InterpreterRuntime::get_result_handler + // to copy the pointer to the signature string temporarily to the + // first C-argument and to return the result_handler in + // R3_RET. Since native_entry will copy the jni-pointer to the + // first C-argument slot later on, it is OK to occupy this slot + // temporarilly. Then we copy the argument list on the java + // expression stack into native varargs format on the native stack + // and load arguments into argument registers. Integer arguments in + // the varargs vector will be sign-extended to 8 bytes. + // + // On entry: + // R3_ARG1 - intptr_t* Address of java argument list in memory. + // R15_prev_state - BytecodeInterpreter* Address of interpreter state for + // this method + // R19_method + // + // On exit (just before return instruction): + // R3_RET - contains the address of the result_handler. + // R4_ARG2 - is not updated for static methods and contains "this" otherwise. + // R5_ARG3-R10_ARG8: - When the (i-2)th Java argument is not of type float or double, + // ARGi contains this argument. Otherwise, ARGi is not updated. + // F1_ARG1-F13_ARG13 - contain the first 13 arguments of type float or double. + + const int LogSizeOfTwoInstructions = 3; + + // FIXME: use Argument:: GL: Argument names different numbers! + const int max_fp_register_arguments = 13; + const int max_int_register_arguments = 6; // first 2 are reserved + + const Register arg_java = R21_tmp1; + const Register arg_c = R22_tmp2; + const Register signature = R23_tmp3; // is string + const Register sig_byte = R24_tmp4; + const Register fpcnt = R25_tmp5; + const Register argcnt = R26_tmp6; + const Register intSlot = R27_tmp7; + const Register target_sp = R28_tmp8; + const FloatRegister floatSlot = F0; + + address entry = __ function_entry(); + + __ save_LR_CR(R0); + __ save_nonvolatile_gprs(R1_SP, _spill_nonvolatiles_neg(r14)); + // We use target_sp for storing arguments in the C frame. + __ mr(target_sp, R1_SP); + __ push_frame_reg_args_nonvolatiles(0, R11_scratch1); + + __ mr(arg_java, R3_ARG1); + + __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::get_signature), R16_thread, R19_method); + + // Signature is in R3_RET. Signature is callee saved. + __ mr(signature, R3_RET); + + // Get the result handler. + __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::get_result_handler), R16_thread, R19_method); + + { + Label L; + // test if static + // _access_flags._flags must be at offset 0. + // TODO PPC port: requires change in shared code. + //assert(in_bytes(AccessFlags::flags_offset()) == 0, + // "MethodDesc._access_flags == MethodDesc._access_flags._flags"); + // _access_flags must be a 32 bit value. + assert(sizeof(AccessFlags) == 4, "wrong size"); + __ lwa(R11_scratch1/*access_flags*/, method_(access_flags)); + // testbit with condition register. + __ testbitdi(CCR0, R0, R11_scratch1/*access_flags*/, JVM_ACC_STATIC_BIT); + __ btrue(CCR0, L); + // For non-static functions, pass "this" in R4_ARG2 and copy it + // to 2nd C-arg slot. + // We need to box the Java object here, so we use arg_java + // (address of current Java stack slot) as argument and don't + // dereference it as in case of ints, floats, etc. + __ mr(R4_ARG2, arg_java); + __ addi(arg_java, arg_java, -BytesPerWord); + __ std(R4_ARG2, _abi(carg_2), target_sp); + __ bind(L); + } + + // Will be incremented directly after loop_start. argcnt=0 + // corresponds to 3rd C argument. + __ li(argcnt, -1); + // arg_c points to 3rd C argument + __ addi(arg_c, target_sp, _abi(carg_3)); + // no floating-point args parsed so far + __ li(fpcnt, 0); + + Label move_intSlot_to_ARG, move_floatSlot_to_FARG; + Label loop_start, loop_end; + Label do_int, do_long, do_float, do_double, do_dontreachhere, do_object, do_array, do_boxed; + + // signature points to '(' at entry +#ifdef ASSERT + __ lbz(sig_byte, 0, signature); + __ cmplwi(CCR0, sig_byte, '('); + __ bne(CCR0, do_dontreachhere); +#endif + + __ bind(loop_start); + + __ addi(argcnt, argcnt, 1); + __ lbzu(sig_byte, 1, signature); + + __ cmplwi(CCR0, sig_byte, ')'); // end of signature + __ beq(CCR0, loop_end); + + __ cmplwi(CCR0, sig_byte, 'B'); // byte + __ beq(CCR0, do_int); + + __ cmplwi(CCR0, sig_byte, 'C'); // char + __ beq(CCR0, do_int); + + __ cmplwi(CCR0, sig_byte, 'D'); // double + __ beq(CCR0, do_double); + + __ cmplwi(CCR0, sig_byte, 'F'); // float + __ beq(CCR0, do_float); + + __ cmplwi(CCR0, sig_byte, 'I'); // int + __ beq(CCR0, do_int); + + __ cmplwi(CCR0, sig_byte, 'J'); // long + __ beq(CCR0, do_long); + + __ cmplwi(CCR0, sig_byte, 'S'); // short + __ beq(CCR0, do_int); + + __ cmplwi(CCR0, sig_byte, 'Z'); // boolean + __ beq(CCR0, do_int); + + __ cmplwi(CCR0, sig_byte, 'L'); // object + __ beq(CCR0, do_object); + + __ cmplwi(CCR0, sig_byte, '['); // array + __ beq(CCR0, do_array); + + // __ cmplwi(CCR0, sig_byte, 'V'); // void cannot appear since we do not parse the return type + // __ beq(CCR0, do_void); + + __ bind(do_dontreachhere); + + __ unimplemented("ShouldNotReachHere in slow_signature_handler", 120); + + __ bind(do_array); + + { + Label start_skip, end_skip; + + __ bind(start_skip); + __ lbzu(sig_byte, 1, signature); + __ cmplwi(CCR0, sig_byte, '['); + __ beq(CCR0, start_skip); // skip further brackets + __ cmplwi(CCR0, sig_byte, '9'); + __ bgt(CCR0, end_skip); // no optional size + __ cmplwi(CCR0, sig_byte, '0'); + __ bge(CCR0, start_skip); // skip optional size + __ bind(end_skip); + + __ cmplwi(CCR0, sig_byte, 'L'); + __ beq(CCR0, do_object); // for arrays of objects, the name of the object must be skipped + __ b(do_boxed); // otherwise, go directly to do_boxed + } + + __ bind(do_object); + { + Label L; + __ bind(L); + __ lbzu(sig_byte, 1, signature); + __ cmplwi(CCR0, sig_byte, ';'); + __ bne(CCR0, L); + } + // Need to box the Java object here, so we use arg_java (address of + // current Java stack slot) as argument and don't dereference it as + // in case of ints, floats, etc. + Label do_null; + __ bind(do_boxed); + __ ld(R0,0, arg_java); + __ cmpdi(CCR0, R0, 0); + __ li(intSlot,0); + __ beq(CCR0, do_null); + __ mr(intSlot, arg_java); + __ bind(do_null); + __ std(intSlot, 0, arg_c); + __ addi(arg_java, arg_java, -BytesPerWord); + __ addi(arg_c, arg_c, BytesPerWord); + __ cmplwi(CCR0, argcnt, max_int_register_arguments); + __ blt(CCR0, move_intSlot_to_ARG); + __ b(loop_start); + + __ bind(do_int); + __ lwa(intSlot, 0, arg_java); + __ std(intSlot, 0, arg_c); + __ addi(arg_java, arg_java, -BytesPerWord); + __ addi(arg_c, arg_c, BytesPerWord); + __ cmplwi(CCR0, argcnt, max_int_register_arguments); + __ blt(CCR0, move_intSlot_to_ARG); + __ b(loop_start); + + __ bind(do_long); + __ ld(intSlot, -BytesPerWord, arg_java); + __ std(intSlot, 0, arg_c); + __ addi(arg_java, arg_java, - 2 * BytesPerWord); + __ addi(arg_c, arg_c, BytesPerWord); + __ cmplwi(CCR0, argcnt, max_int_register_arguments); + __ blt(CCR0, move_intSlot_to_ARG); + __ b(loop_start); + + __ bind(do_float); + __ lfs(floatSlot, 0, arg_java); +#if defined(LINUX) + // Linux uses ELF ABI. Both original ELF and ELFv2 ABIs have float + // in the least significant word of an argument slot. +#if defined(VM_LITTLE_ENDIAN) + __ stfs(floatSlot, 0, arg_c); +#else + __ stfs(floatSlot, 4, arg_c); +#endif +#elif defined(AIX) + // Although AIX runs on big endian CPU, float is in most significant + // word of an argument slot. + __ stfs(floatSlot, 0, arg_c); +#else +#error "unknown OS" +#endif + __ addi(arg_java, arg_java, -BytesPerWord); + __ addi(arg_c, arg_c, BytesPerWord); + __ cmplwi(CCR0, fpcnt, max_fp_register_arguments); + __ blt(CCR0, move_floatSlot_to_FARG); + __ b(loop_start); + + __ bind(do_double); + __ lfd(floatSlot, - BytesPerWord, arg_java); + __ stfd(floatSlot, 0, arg_c); + __ addi(arg_java, arg_java, - 2 * BytesPerWord); + __ addi(arg_c, arg_c, BytesPerWord); + __ cmplwi(CCR0, fpcnt, max_fp_register_arguments); + __ blt(CCR0, move_floatSlot_to_FARG); + __ b(loop_start); + + __ bind(loop_end); + + __ pop_frame(); + __ restore_nonvolatile_gprs(R1_SP, _spill_nonvolatiles_neg(r14)); + __ restore_LR_CR(R0); + + __ blr(); + + Label move_int_arg, move_float_arg; + __ bind(move_int_arg); // each case must consist of 2 instructions (otherwise adapt LogSizeOfTwoInstructions) + __ mr(R5_ARG3, intSlot); __ b(loop_start); + __ mr(R6_ARG4, intSlot); __ b(loop_start); + __ mr(R7_ARG5, intSlot); __ b(loop_start); + __ mr(R8_ARG6, intSlot); __ b(loop_start); + __ mr(R9_ARG7, intSlot); __ b(loop_start); + __ mr(R10_ARG8, intSlot); __ b(loop_start); + + __ bind(move_float_arg); // each case must consist of 2 instructions (otherwise adapt LogSizeOfTwoInstructions) + __ fmr(F1_ARG1, floatSlot); __ b(loop_start); + __ fmr(F2_ARG2, floatSlot); __ b(loop_start); + __ fmr(F3_ARG3, floatSlot); __ b(loop_start); + __ fmr(F4_ARG4, floatSlot); __ b(loop_start); + __ fmr(F5_ARG5, floatSlot); __ b(loop_start); + __ fmr(F6_ARG6, floatSlot); __ b(loop_start); + __ fmr(F7_ARG7, floatSlot); __ b(loop_start); + __ fmr(F8_ARG8, floatSlot); __ b(loop_start); + __ fmr(F9_ARG9, floatSlot); __ b(loop_start); + __ fmr(F10_ARG10, floatSlot); __ b(loop_start); + __ fmr(F11_ARG11, floatSlot); __ b(loop_start); + __ fmr(F12_ARG12, floatSlot); __ b(loop_start); + __ fmr(F13_ARG13, floatSlot); __ b(loop_start); + + __ bind(move_intSlot_to_ARG); + __ sldi(R0, argcnt, LogSizeOfTwoInstructions); + __ load_const(R11_scratch1, move_int_arg); // Label must be bound here. + __ add(R11_scratch1, R0, R11_scratch1); + __ mtctr(R11_scratch1/*branch_target*/); + __ bctr(); + __ bind(move_floatSlot_to_FARG); + __ sldi(R0, fpcnt, LogSizeOfTwoInstructions); + __ addi(fpcnt, fpcnt, 1); + __ load_const(R11_scratch1, move_float_arg); // Label must be bound here. + __ add(R11_scratch1, R0, R11_scratch1); + __ mtctr(R11_scratch1/*branch_target*/); + __ bctr(); + + return entry; +} + +address TemplateInterpreterGenerator::generate_result_handler_for(BasicType type) { + // + // Registers alive + // R3_RET + // LR + // + // Registers updated + // R3_RET + // + + Label done; + address entry = __ pc(); + + switch (type) { + case T_BOOLEAN: + // convert !=0 to 1 + __ neg(R0, R3_RET); + __ orr(R0, R3_RET, R0); + __ srwi(R3_RET, R0, 31); + break; + case T_BYTE: + // sign extend 8 bits + __ extsb(R3_RET, R3_RET); + break; + case T_CHAR: + // zero extend 16 bits + __ clrldi(R3_RET, R3_RET, 48); + break; + case T_SHORT: + // sign extend 16 bits + __ extsh(R3_RET, R3_RET); + break; + case T_INT: + // sign extend 32 bits + __ extsw(R3_RET, R3_RET); + break; + case T_LONG: + break; + case T_OBJECT: + // unbox result if not null + __ cmpdi(CCR0, R3_RET, 0); + __ beq(CCR0, done); + __ ld(R3_RET, 0, R3_RET); + __ verify_oop(R3_RET); + break; + case T_FLOAT: + break; + case T_DOUBLE: + break; + case T_VOID: + break; + default: ShouldNotReachHere(); + } + + BIND(done); + __ blr(); + + return entry; +} + +// Abstract method entry. +// +address TemplateInterpreterGenerator::generate_abstract_entry(void) { + address entry = __ pc(); + + // + // Registers alive + // R16_thread - JavaThread* + // R19_method - callee's method (method to be invoked) + // R1_SP - SP prepared such that caller's outgoing args are near top + // LR - return address to caller + // + // Stack layout at this point: + // + // 0 [TOP_IJAVA_FRAME_ABI] <-- R1_SP + // alignment (optional) + // [outgoing Java arguments] + // ... + // PARENT [PARENT_IJAVA_FRAME_ABI] + // ... + // + + // Can't use call_VM here because we have not set up a new + // interpreter state. Make the call to the vm and make it look like + // our caller set up the JavaFrameAnchor. + __ set_top_ijava_frame_at_SP_as_last_Java_frame(R1_SP, R12_scratch2/*tmp*/); + + // Push a new C frame and save LR. + __ save_LR_CR(R0); + __ push_frame_reg_args(0, R11_scratch1); + + // This is not a leaf but we have a JavaFrameAnchor now and we will + // check (create) exceptions afterward so this is ok. + __ call_VM_leaf(CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError), + R16_thread); + + // Pop the C frame and restore LR. + __ pop_frame(); + __ restore_LR_CR(R0); + + // Reset JavaFrameAnchor from call_VM_leaf above. + __ reset_last_Java_frame(); + + // We don't know our caller, so jump to the general forward exception stub, + // which will also pop our full frame off. Satisfy the interface of + // SharedRuntime::generate_forward_exception() + __ load_const_optimized(R11_scratch1, StubRoutines::forward_exception_entry(), R0); + __ mtctr(R11_scratch1); + __ bctr(); + + return entry; +} + +// Interpreter intrinsic for WeakReference.get(). +// 1. Don't push a full blown frame and go on dispatching, but fetch the value +// into R8 and return quickly +// 2. If G1 is active we *must* execute this intrinsic for corrrectness: +// It contains a GC barrier which puts the reference into the satb buffer +// to indicate that someone holds a strong reference to the object the +// weak ref points to! +address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { + // Code: _aload_0, _getfield, _areturn + // parameter size = 1 + // + // The code that gets generated by this routine is split into 2 parts: + // 1. the "intrinsified" code for G1 (or any SATB based GC), + // 2. the slow path - which is an expansion of the regular method entry. + // + // Notes: + // * In the G1 code we do not check whether we need to block for + // a safepoint. If G1 is enabled then we must execute the specialized + // code for Reference.get (except when the Reference object is null) + // so that we can log the value in the referent field with an SATB + // update buffer. + // If the code for the getfield template is modified so that the + // G1 pre-barrier code is executed when the current method is + // Reference.get() then going through the normal method entry + // will be fine. + // * The G1 code can, however, check the receiver object (the instance + // of java.lang.Reference) and jump to the slow path if null. If the + // Reference object is null then we obviously cannot fetch the referent + // and so we don't need to call the G1 pre-barrier. Thus we can use the + // regular method entry code to generate the NPE. + // + + if (UseG1GC) { + address entry = __ pc(); + + const int referent_offset = java_lang_ref_Reference::referent_offset; + guarantee(referent_offset > 0, "referent offset not initialized"); + + Label slow_path; + + // Debugging not possible, so can't use __ skip_if_jvmti_mode(slow_path, GR31_SCRATCH); + + // In the G1 code we don't check if we need to reach a safepoint. We + // continue and the thread will safepoint at the next bytecode dispatch. + + // If the receiver is null then it is OK to jump to the slow path. + __ ld(R3_RET, Interpreter::stackElementSize, R15_esp); // get receiver + + // Check if receiver == NULL and go the slow path. + __ cmpdi(CCR0, R3_RET, 0); + __ beq(CCR0, slow_path); + + // Load the value of the referent field. + __ load_heap_oop(R3_RET, referent_offset, R3_RET); + + // Generate the G1 pre-barrier code to log the value of + // the referent field in an SATB buffer. Note with + // these parameters the pre-barrier does not generate + // the load of the previous value. + + // Restore caller sp for c2i case. +#ifdef ASSERT + __ ld(R9_ARG7, 0, R1_SP); + __ ld(R10_ARG8, 0, R21_sender_SP); + __ cmpd(CCR0, R9_ARG7, R10_ARG8); + __ asm_assert_eq("backlink", 0x544); +#endif // ASSERT + __ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started. + + __ g1_write_barrier_pre(noreg, // obj + noreg, // offset + R3_RET, // pre_val + R11_scratch1, // tmp + R12_scratch2, // tmp + true); // needs_frame + + __ blr(); + + // Generate regular method entry. + __ bind(slow_path); + __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::zerolocals), R11_scratch1); + return entry; + } + + return NULL; +} + // Actually we should never reach here since we do stack overflow checks before pushing any frame. address TemplateInterpreterGenerator::generate_StackOverflowError_handler() { address entry = __ pc(); @@ -222,12 +723,6 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, i return entry; } -// A result handler converts the native result into java format. -// Use the shared code between c++ and template interpreter. -address TemplateInterpreterGenerator::generate_result_handler_for(BasicType type) { - return AbstractInterpreterGenerator::generate_result_handler_for(type); -} - address TemplateInterpreterGenerator::generate_safept_entry_for(TosState state, address runtime_entry) { address entry = __ pc(); @@ -606,7 +1101,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call, Regist // End of helpers address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { - if (!TemplateInterpreter::math_entry_available(kind)) { + if (!Interpreter::math_entry_available(kind)) { NOT_PRODUCT(__ should_not_reach_here();) return NULL; } diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/abstractInterpreter_sparc.cpp similarity index 96% rename from hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp rename to hotspot/src/cpu/sparc/vm/abstractInterpreter_sparc.cpp index b1bc7fc6136..d85bd78bbbd 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/abstractInterpreter_sparc.cpp @@ -31,18 +31,6 @@ #include "runtime/synchronizer.hpp" #include "utilities/macros.hpp" -// Size of interpreter code. Increase if too small. Interpreter will -// fail with a guarantee ("not enough space for interpreter generation"); -// if too small. -// Run with +PrintInterpreter to get the VM to print out the size. -// Max size with JVMTI -#ifdef _LP64 - // The sethi() instruction generates lots more instructions when shell - // stack limit is unlimited, so that's why this is much bigger. -int TemplateInterpreter::InterpreterCodeSize = 260 * K; -#else -int TemplateInterpreter::InterpreterCodeSize = 230 * K; -#endif int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp deleted file mode 100644 index cf22a6c6f2e..00000000000 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 1997, 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 "asm/macroAssembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif - - - -// Generation of Interpreter -// -// The TemplateInterpreterGenerator generates the interpreter into Interpreter::_code. - - -#define __ _masm-> - - -//---------------------------------------------------------------------------------------------------- - -#ifndef _LP64 -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - address entry = __ pc(); - Argument argv(0, true); - - // We are in the jni transition frame. Save the last_java_frame corresponding to the - // outer interpreter frame - // - __ set_last_Java_frame(FP, noreg); - // make sure the interpreter frame we've pushed has a valid return pc - __ mov(O7, I7); - __ mov(Lmethod, G3_scratch); - __ mov(Llocals, G4_scratch); - __ save_frame(0); - __ mov(G2_thread, L7_thread_cache); - __ add(argv.address_in_frame(), O3); - __ mov(G2_thread, O0); - __ mov(G3_scratch, O1); - __ call(CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), relocInfo::runtime_call_type); - __ delayed()->mov(G4_scratch, O2); - __ mov(L7_thread_cache, G2_thread); - __ reset_last_Java_frame(); - - // load the register arguments (the C code packed them as varargs) - for (Argument ldarg = argv.successor(); ldarg.is_register(); ldarg = ldarg.successor()) { - __ ld_ptr(ldarg.address_in_frame(), ldarg.as_register()); - } - __ ret(); - __ delayed()-> - restore(O0, 0, Lscratch); // caller's Lscratch gets the result handler - return entry; -} - - -#else -// LP64 passes floating point arguments in F1, F3, F5, etc. instead of -// O0, O1, O2 etc.. -// Doubles are passed in D0, D2, D4 -// We store the signature of the first 16 arguments in the first argument -// slot because it will be overwritten prior to calling the native -// function, with the pointer to the JNIEnv. -// If LP64 there can be up to 16 floating point arguments in registers -// or 6 integer registers. -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - - enum { - non_float = 0, - float_sig = 1, - double_sig = 2, - sig_mask = 3 - }; - - address entry = __ pc(); - Argument argv(0, true); - - // We are in the jni transition frame. Save the last_java_frame corresponding to the - // outer interpreter frame - // - __ set_last_Java_frame(FP, noreg); - // make sure the interpreter frame we've pushed has a valid return pc - __ mov(O7, I7); - __ mov(Lmethod, G3_scratch); - __ mov(Llocals, G4_scratch); - __ save_frame(0); - __ mov(G2_thread, L7_thread_cache); - __ add(argv.address_in_frame(), O3); - __ mov(G2_thread, O0); - __ mov(G3_scratch, O1); - __ call(CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), relocInfo::runtime_call_type); - __ delayed()->mov(G4_scratch, O2); - __ mov(L7_thread_cache, G2_thread); - __ reset_last_Java_frame(); - - - // load the register arguments (the C code packed them as varargs) - Address Sig = argv.address_in_frame(); // Argument 0 holds the signature - __ ld_ptr( Sig, G3_scratch ); // Get register argument signature word into G3_scratch - __ mov( G3_scratch, G4_scratch); - __ srl( G4_scratch, 2, G4_scratch); // Skip Arg 0 - Label done; - for (Argument ldarg = argv.successor(); ldarg.is_float_register(); ldarg = ldarg.successor()) { - Label NonFloatArg; - Label LoadFloatArg; - Label LoadDoubleArg; - Label NextArg; - Address a = ldarg.address_in_frame(); - __ andcc(G4_scratch, sig_mask, G3_scratch); - __ br(Assembler::zero, false, Assembler::pt, NonFloatArg); - __ delayed()->nop(); - - __ cmp(G3_scratch, float_sig ); - __ br(Assembler::equal, false, Assembler::pt, LoadFloatArg); - __ delayed()->nop(); - - __ cmp(G3_scratch, double_sig ); - __ br(Assembler::equal, false, Assembler::pt, LoadDoubleArg); - __ delayed()->nop(); - - __ bind(NonFloatArg); - // There are only 6 integer register arguments! - if ( ldarg.is_register() ) - __ ld_ptr(ldarg.address_in_frame(), ldarg.as_register()); - else { - // Optimization, see if there are any more args and get out prior to checking - // all 16 float registers. My guess is that this is rare. - // If is_register is false, then we are done the first six integer args. - __ br_null_short(G4_scratch, Assembler::pt, done); - } - __ ba(NextArg); - __ delayed()->srl( G4_scratch, 2, G4_scratch ); - - __ bind(LoadFloatArg); - __ ldf( FloatRegisterImpl::S, a, ldarg.as_float_register(), 4); - __ ba(NextArg); - __ delayed()->srl( G4_scratch, 2, G4_scratch ); - - __ bind(LoadDoubleArg); - __ ldf( FloatRegisterImpl::D, a, ldarg.as_double_register() ); - __ ba(NextArg); - __ delayed()->srl( G4_scratch, 2, G4_scratch ); - - __ bind(NextArg); - - } - - __ bind(done); - __ ret(); - __ delayed()-> - restore(O0, 0, Lscratch); // caller's Lscratch gets the result handler - return entry; -} -#endif - -void TemplateInterpreterGenerator::generate_counter_overflow(Label& Lcontinue) { - - // Generate code to initiate compilation on the counter overflow. - - // InterpreterRuntime::frequency_counter_overflow takes two arguments, - // the first indicates if the counter overflow occurs at a backwards branch (NULL bcp) - // and the second is only used when the first is true. We pass zero for both. - // The call returns the address of the verified entry point for the method or NULL - // if the compilation did not complete (either went background or bailed out). - __ set((int)false, O2); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), O2, O2, true); - // returns verified_entry_point or NULL - // we ignore it in any case - __ ba_short(Lcontinue); - -} - - -// End of helpers - -// Various method entries - -// Abstract method entry -// Attempt to execute abstract method. Throw exception -// -address TemplateInterpreterGenerator::generate_abstract_entry(void) { - address entry = __ pc(); - // abstract method entry - // throw exception - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); - // the call_VM checks for exception, so we should never return here. - __ should_not_reach_here(); - return entry; - -} diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp index b8ac98b61cf..172221ab47b 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,6 +52,18 @@ #endif #undef FAST_DISPATCH +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +#ifdef _LP64 + // The sethi() instruction generates lots more instructions when shell + // stack limit is unlimited, so that's why this is much bigger. +int TemplateInterpreter::InterpreterCodeSize = 260 * K; +#else +int TemplateInterpreter::InterpreterCodeSize = 230 * K; +#endif // Generation of Interpreter // @@ -63,6 +75,174 @@ //---------------------------------------------------------------------------------------------------- +#ifndef _LP64 +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + address entry = __ pc(); + Argument argv(0, true); + + // We are in the jni transition frame. Save the last_java_frame corresponding to the + // outer interpreter frame + // + __ set_last_Java_frame(FP, noreg); + // make sure the interpreter frame we've pushed has a valid return pc + __ mov(O7, I7); + __ mov(Lmethod, G3_scratch); + __ mov(Llocals, G4_scratch); + __ save_frame(0); + __ mov(G2_thread, L7_thread_cache); + __ add(argv.address_in_frame(), O3); + __ mov(G2_thread, O0); + __ mov(G3_scratch, O1); + __ call(CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), relocInfo::runtime_call_type); + __ delayed()->mov(G4_scratch, O2); + __ mov(L7_thread_cache, G2_thread); + __ reset_last_Java_frame(); + + // load the register arguments (the C code packed them as varargs) + for (Argument ldarg = argv.successor(); ldarg.is_register(); ldarg = ldarg.successor()) { + __ ld_ptr(ldarg.address_in_frame(), ldarg.as_register()); + } + __ ret(); + __ delayed()-> + restore(O0, 0, Lscratch); // caller's Lscratch gets the result handler + return entry; +} + + +#else +// LP64 passes floating point arguments in F1, F3, F5, etc. instead of +// O0, O1, O2 etc.. +// Doubles are passed in D0, D2, D4 +// We store the signature of the first 16 arguments in the first argument +// slot because it will be overwritten prior to calling the native +// function, with the pointer to the JNIEnv. +// If LP64 there can be up to 16 floating point arguments in registers +// or 6 integer registers. +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + + enum { + non_float = 0, + float_sig = 1, + double_sig = 2, + sig_mask = 3 + }; + + address entry = __ pc(); + Argument argv(0, true); + + // We are in the jni transition frame. Save the last_java_frame corresponding to the + // outer interpreter frame + // + __ set_last_Java_frame(FP, noreg); + // make sure the interpreter frame we've pushed has a valid return pc + __ mov(O7, I7); + __ mov(Lmethod, G3_scratch); + __ mov(Llocals, G4_scratch); + __ save_frame(0); + __ mov(G2_thread, L7_thread_cache); + __ add(argv.address_in_frame(), O3); + __ mov(G2_thread, O0); + __ mov(G3_scratch, O1); + __ call(CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), relocInfo::runtime_call_type); + __ delayed()->mov(G4_scratch, O2); + __ mov(L7_thread_cache, G2_thread); + __ reset_last_Java_frame(); + + + // load the register arguments (the C code packed them as varargs) + Address Sig = argv.address_in_frame(); // Argument 0 holds the signature + __ ld_ptr( Sig, G3_scratch ); // Get register argument signature word into G3_scratch + __ mov( G3_scratch, G4_scratch); + __ srl( G4_scratch, 2, G4_scratch); // Skip Arg 0 + Label done; + for (Argument ldarg = argv.successor(); ldarg.is_float_register(); ldarg = ldarg.successor()) { + Label NonFloatArg; + Label LoadFloatArg; + Label LoadDoubleArg; + Label NextArg; + Address a = ldarg.address_in_frame(); + __ andcc(G4_scratch, sig_mask, G3_scratch); + __ br(Assembler::zero, false, Assembler::pt, NonFloatArg); + __ delayed()->nop(); + + __ cmp(G3_scratch, float_sig ); + __ br(Assembler::equal, false, Assembler::pt, LoadFloatArg); + __ delayed()->nop(); + + __ cmp(G3_scratch, double_sig ); + __ br(Assembler::equal, false, Assembler::pt, LoadDoubleArg); + __ delayed()->nop(); + + __ bind(NonFloatArg); + // There are only 6 integer register arguments! + if ( ldarg.is_register() ) + __ ld_ptr(ldarg.address_in_frame(), ldarg.as_register()); + else { + // Optimization, see if there are any more args and get out prior to checking + // all 16 float registers. My guess is that this is rare. + // If is_register is false, then we are done the first six integer args. + __ br_null_short(G4_scratch, Assembler::pt, done); + } + __ ba(NextArg); + __ delayed()->srl( G4_scratch, 2, G4_scratch ); + + __ bind(LoadFloatArg); + __ ldf( FloatRegisterImpl::S, a, ldarg.as_float_register(), 4); + __ ba(NextArg); + __ delayed()->srl( G4_scratch, 2, G4_scratch ); + + __ bind(LoadDoubleArg); + __ ldf( FloatRegisterImpl::D, a, ldarg.as_double_register() ); + __ ba(NextArg); + __ delayed()->srl( G4_scratch, 2, G4_scratch ); + + __ bind(NextArg); + + } + + __ bind(done); + __ ret(); + __ delayed()-> + restore(O0, 0, Lscratch); // caller's Lscratch gets the result handler + return entry; +} +#endif + +void TemplateInterpreterGenerator::generate_counter_overflow(Label& Lcontinue) { + + // Generate code to initiate compilation on the counter overflow. + + // InterpreterRuntime::frequency_counter_overflow takes two arguments, + // the first indicates if the counter overflow occurs at a backwards branch (NULL bcp) + // and the second is only used when the first is true. We pass zero for both. + // The call returns the address of the verified entry point for the method or NULL + // if the compilation did not complete (either went background or bailed out). + __ set((int)false, O2); + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), O2, O2, true); + // returns verified_entry_point or NULL + // we ignore it in any case + __ ba_short(Lcontinue); + +} + + +// End of helpers + +// Various method entries + +// Abstract method entry +// Attempt to execute abstract method. Throw exception +// +address TemplateInterpreterGenerator::generate_abstract_entry(void) { + address entry = __ pc(); + // abstract method entry + // throw exception + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); + // the call_VM checks for exception, so we should never return here. + __ should_not_reach_here(); + return entry; + +} void TemplateInterpreterGenerator::save_native_result(void) { // result potentially in O0/O1: save it across calls @@ -911,6 +1091,31 @@ address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(Abstract address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { return NULL; } + +// TODO: rather than touching all pages, check against stack_overflow_limit and bang yellow page to +// generate exception +void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { + // Quick & dirty stack overflow checking: bang the stack & handle trap. + // Note that we do the banging after the frame is setup, since the exception + // handling code expects to find a valid interpreter frame on the stack. + // Doing the banging earlier fails if the caller frame is not an interpreter + // frame. + // (Also, the exception throwing code expects to unlock any synchronized + // method receiever, so do the banging after locking the receiver.) + + // Bang each page in the shadow zone. We can't assume it's been done for + // an interpreter frame with greater than a page of locals, so each page + // needs to be checked. Only true for non-native. + if (UseStackBanging) { + const int page_size = os::vm_page_size(); + const int n_shadow_pages = ((int)JavaThread::stack_shadow_zone_size()) / page_size; + const int start_page = native_call ? n_shadow_pages : 1; + for (int pages = start_page; pages <= n_shadow_pages; pages++) { + __ bang_stack_with_offset(pages*page_size); + } + } +} + // // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the native method diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/abstractInterpreter_x86.cpp similarity index 95% rename from hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp rename to hotspot/src/cpu/x86/vm/abstractInterpreter_x86.cpp index 0e3cd9927c1..ed991d5c1b8 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp +++ b/hotspot/src/cpu/x86/vm/abstractInterpreter_x86.cpp @@ -27,16 +27,6 @@ #include "interpreter/interpreter.hpp" #include "runtime/frame.inline.hpp" -// Size of interpreter code. Increase if too small. Interpreter will -// fail with a guarantee ("not enough space for interpreter generation"); -// if too small. -// Run with +PrintInterpreter to get the VM to print out the size. -// Max size with JVMTI -#ifdef AMD64 -int TemplateInterpreter::InterpreterCodeSize = 256 * 1024; -#else -int TemplateInterpreter::InterpreterCodeSize = 224 * 1024; -#endif // AMD64 // asm based interpreter deoptimization helpers int AbstractInterpreter::size_activation(int max_stack, diff --git a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp deleted file mode 100644 index c91580ae124..00000000000 --- a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2014, 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 "asm/macroAssembler.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" - -#define __ _masm-> - -// Abstract method entry -// Attempt to execute abstract method. Throw exception -address TemplateInterpreterGenerator::generate_abstract_entry(void) { - - address entry_point = __ pc(); - - // abstract method entry - - // pop return address, reset last_sp to NULL - __ empty_expression_stack(); - __ restore_bcp(); // rsi must be correct for exception handler (was destroyed) - __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) - - // throw exception - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); - // the call_VM checks for exception, so we should never return here. - __ should_not_reach_here(); - - return entry_point; -} diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp deleted file mode 100644 index efc8525c333..00000000000 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 1997, 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 "asm/macroAssembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif - -#define __ _masm-> - -//------------------------------------------------------------------------------------------------------------------------ - -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - address entry = __ pc(); - // rbx,: method - // rcx: temporary - // rdi: pointer to locals - // rsp: end of copied parameters area - __ mov(rcx, rsp); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), rbx, rdi, rcx); - __ ret(0); - return entry; -} - - -address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { - - // rbx,: Method* - // rcx: scratrch - // rsi: sender sp - - if (!InlineIntrinsics) return NULL; // Generate a vanilla entry - - address entry_point = __ pc(); - - // These don't need a safepoint check because they aren't virtually - // callable. We won't enter these intrinsics from compiled code. - // If in the future we added an intrinsic which was virtually callable - // we'd have to worry about how to safepoint so that this code is used. - - // mathematical functions inlined by compiler - // (interpreter must provide identical implementation - // in order to avoid monotonicity bugs when switching - // from interpreter to compiler in the middle of some - // computation) - // - // stack: [ ret adr ] <-- rsp - // [ lo(arg) ] - // [ hi(arg) ] - // - - // Note: For JDK 1.2 StrictMath doesn't exist and Math.sin/cos/sqrt are - // native methods. Interpreter::method_kind(...) does a check for - // native methods first before checking for intrinsic methods and - // thus will never select this entry point. Make sure it is not - // called accidentally since the SharedRuntime entry points will - // not work for JDK 1.2. - // - // We no longer need to check for JDK 1.2 since it's EOL'ed. - // The following check existed in pre 1.6 implementation, - // if (Universe::is_jdk12x_version()) { - // __ should_not_reach_here(); - // } - // Universe::is_jdk12x_version() always returns false since - // the JDK version is not yet determined when this method is called. - // This method is called during interpreter_init() whereas - // JDK version is only determined when universe2_init() is called. - - // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are - // java methods. Interpreter::method_kind(...) will select - // this entry point for the corresponding methods in JDK 1.3. - // get argument - __ fld_d(Address(rsp, 1*wordSize)); - switch (kind) { - case Interpreter::java_lang_math_sin : - __ trigfunc('s'); - break; - case Interpreter::java_lang_math_cos : - __ trigfunc('c'); - break; - case Interpreter::java_lang_math_tan : - __ trigfunc('t'); - break; - case Interpreter::java_lang_math_sqrt: - __ fsqrt(); - break; - case Interpreter::java_lang_math_abs: - __ fabs(); - break; - case Interpreter::java_lang_math_log: - __ subptr(rsp, 2 * wordSize); - __ fstp_d(Address(rsp, 0)); - if (VM_Version::supports_sse2()) { - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); - } - else { - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog))); - } - __ addptr(rsp, 2 * wordSize); - break; - case Interpreter::java_lang_math_log10: - __ flog10(); - // Store to stack to convert 80bit precision back to 64bits - __ push_fTOS(); - __ pop_fTOS(); - break; - case Interpreter::java_lang_math_pow: - __ fld_d(Address(rsp, 3*wordSize)); // second argument - __ pow_with_fallback(0); - // Store to stack to convert 80bit precision back to 64bits - __ push_fTOS(); - __ pop_fTOS(); - break; - case Interpreter::java_lang_math_exp: - __ subptr(rsp, 2*wordSize); - __ fstp_d(Address(rsp, 0)); - if (VM_Version::supports_sse2()) { - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp()))); - } else { - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dexp))); - } - __ addptr(rsp, 2*wordSize); - break; - default : - ShouldNotReachHere(); - } - - // return double result in xmm0 for interpreter and compilers. - if (UseSSE >= 2) { - __ subptr(rsp, 2*wordSize); - __ fstp_d(Address(rsp, 0)); - __ movdbl(xmm0, Address(rsp, 0)); - __ addptr(rsp, 2*wordSize); - } - - // done, result in FPU ST(0) or XMM0 - __ pop(rdi); // get return address - __ mov(rsp, rsi); // set sp to sender sp - __ jmp(rdi); - - return entry_point; -} diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp deleted file mode 100644 index 9e597042095..00000000000 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright (c) 2003, 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 "asm/macroAssembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif - -#define __ _masm-> - -#ifdef _WIN64 -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - address entry = __ pc(); - - // rbx: method - // r14: pointer to locals - // c_rarg3: first stack arg - wordSize - __ mov(c_rarg3, rsp); - // adjust rsp - __ subptr(rsp, 4 * wordSize); - __ call_VM(noreg, - CAST_FROM_FN_PTR(address, - InterpreterRuntime::slow_signature_handler), - rbx, r14, c_rarg3); - - // rax: result handler - - // Stack layout: - // rsp: 3 integer or float args (if static first is unused) - // 1 float/double identifiers - // return address - // stack args - // garbage - // expression stack bottom - // bcp (NULL) - // ... - - // Do FP first so we can use c_rarg3 as temp - __ movl(c_rarg3, Address(rsp, 3 * wordSize)); // float/double identifiers - - for ( int i= 0; i < Argument::n_int_register_parameters_c-1; i++ ) { - XMMRegister floatreg = as_XMMRegister(i+1); - Label isfloatordouble, isdouble, next; - - __ testl(c_rarg3, 1 << (i*2)); // Float or Double? - __ jcc(Assembler::notZero, isfloatordouble); - - // Do Int register here - switch ( i ) { - case 0: - __ movl(rscratch1, Address(rbx, Method::access_flags_offset())); - __ testl(rscratch1, JVM_ACC_STATIC); - __ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0)); - break; - case 1: - __ movptr(c_rarg2, Address(rsp, wordSize)); - break; - case 2: - __ movptr(c_rarg3, Address(rsp, 2 * wordSize)); - break; - default: - break; - } - - __ jmp (next); - - __ bind(isfloatordouble); - __ testl(c_rarg3, 1 << ((i*2)+1)); // Double? - __ jcc(Assembler::notZero, isdouble); - -// Do Float Here - __ movflt(floatreg, Address(rsp, i * wordSize)); - __ jmp(next); - -// Do Double here - __ bind(isdouble); - __ movdbl(floatreg, Address(rsp, i * wordSize)); - - __ bind(next); - } - - - // restore rsp - __ addptr(rsp, 4 * wordSize); - - __ ret(0); - - return entry; -} -#else -address AbstractInterpreterGenerator::generate_slow_signature_handler() { - address entry = __ pc(); - - // rbx: method - // r14: pointer to locals - // c_rarg3: first stack arg - wordSize - __ mov(c_rarg3, rsp); - // adjust rsp - __ subptr(rsp, 14 * wordSize); - __ call_VM(noreg, - CAST_FROM_FN_PTR(address, - InterpreterRuntime::slow_signature_handler), - rbx, r14, c_rarg3); - - // rax: result handler - - // Stack layout: - // rsp: 5 integer args (if static first is unused) - // 1 float/double identifiers - // 8 double args - // return address - // stack args - // garbage - // expression stack bottom - // bcp (NULL) - // ... - - // Do FP first so we can use c_rarg3 as temp - __ movl(c_rarg3, Address(rsp, 5 * wordSize)); // float/double identifiers - - for (int i = 0; i < Argument::n_float_register_parameters_c; i++) { - const XMMRegister r = as_XMMRegister(i); - - Label d, done; - - __ testl(c_rarg3, 1 << i); - __ jcc(Assembler::notZero, d); - __ movflt(r, Address(rsp, (6 + i) * wordSize)); - __ jmp(done); - __ bind(d); - __ movdbl(r, Address(rsp, (6 + i) * wordSize)); - __ bind(done); - } - - // Now handle integrals. Only do c_rarg1 if not static. - __ movl(c_rarg3, Address(rbx, Method::access_flags_offset())); - __ testl(c_rarg3, JVM_ACC_STATIC); - __ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0)); - - __ movptr(c_rarg2, Address(rsp, wordSize)); - __ movptr(c_rarg3, Address(rsp, 2 * wordSize)); - __ movptr(c_rarg4, Address(rsp, 3 * wordSize)); - __ movptr(c_rarg5, Address(rsp, 4 * wordSize)); - - // restore rsp - __ addptr(rsp, 14 * wordSize); - - __ ret(0); - - return entry; -} -#endif - - -// -// Various method entries -// - -address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { - - // rbx,: Method* - // rcx: scratrch - // r13: sender sp - - if (!InlineIntrinsics) return NULL; // Generate a vanilla entry - - address entry_point = __ pc(); - - // These don't need a safepoint check because they aren't virtually - // callable. We won't enter these intrinsics from compiled code. - // If in the future we added an intrinsic which was virtually callable - // we'd have to worry about how to safepoint so that this code is used. - - // mathematical functions inlined by compiler - // (interpreter must provide identical implementation - // in order to avoid monotonicity bugs when switching - // from interpreter to compiler in the middle of some - // computation) - // - // stack: [ ret adr ] <-- rsp - // [ lo(arg) ] - // [ hi(arg) ] - // - - // Note: For JDK 1.2 StrictMath doesn't exist and Math.sin/cos/sqrt are - // native methods. Interpreter::method_kind(...) does a check for - // native methods first before checking for intrinsic methods and - // thus will never select this entry point. Make sure it is not - // called accidentally since the SharedRuntime entry points will - // not work for JDK 1.2. - // - // We no longer need to check for JDK 1.2 since it's EOL'ed. - // The following check existed in pre 1.6 implementation, - // if (Universe::is_jdk12x_version()) { - // __ should_not_reach_here(); - // } - // Universe::is_jdk12x_version() always returns false since - // the JDK version is not yet determined when this method is called. - // This method is called during interpreter_init() whereas - // JDK version is only determined when universe2_init() is called. - - // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are - // java methods. Interpreter::method_kind(...) will select - // this entry point for the corresponding methods in JDK 1.3. - // get argument - - if (kind == Interpreter::java_lang_math_sqrt) { - __ sqrtsd(xmm0, Address(rsp, wordSize)); - } else if (kind == Interpreter::java_lang_math_exp) { - __ movdbl(xmm0, Address(rsp, wordSize)); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp()))); - } else if (kind == Interpreter::java_lang_math_log) { - __ movdbl(xmm0, Address(rsp, wordSize)); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); - } else { - __ fld_d(Address(rsp, wordSize)); - switch (kind) { - case Interpreter::java_lang_math_sin : - __ trigfunc('s'); - break; - case Interpreter::java_lang_math_cos : - __ trigfunc('c'); - break; - case Interpreter::java_lang_math_tan : - __ trigfunc('t'); - break; - case Interpreter::java_lang_math_abs: - __ fabs(); - break; - case Interpreter::java_lang_math_log10: - __ flog10(); - break; - case Interpreter::java_lang_math_pow: - __ fld_d(Address(rsp, 3*wordSize)); // second argument (one - // empty stack slot) - __ pow_with_fallback(0); - break; - default : - ShouldNotReachHere(); - } - - // return double result in xmm0 for interpreter and compilers. - __ subptr(rsp, 2*wordSize); - // Round to 64bit precision - __ fstp_d(Address(rsp, 0)); - __ movdbl(xmm0, Address(rsp, 0)); - __ addptr(rsp, 2*wordSize); - } - - - __ pop(rax); - __ mov(rsp, r13); - __ jmp(rax); - - return entry_point; -} diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp index db047dfd0d4..eb155c20be9 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,6 +49,17 @@ #define __ _masm-> +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +#ifdef AMD64 +int TemplateInterpreter::InterpreterCodeSize = 256 * 1024; +#else +int TemplateInterpreter::InterpreterCodeSize = 224 * 1024; +#endif // AMD64 + // Global Register Names static const Register rbcp = LP64_ONLY(r13) NOT_LP64(rsi); static const Register rlocals = LP64_ONLY(r14) NOT_LP64(rdi); @@ -57,6 +68,7 @@ const int method_offset = frame::interpreter_frame_method_offset * wordSize; const int bcp_offset = frame::interpreter_frame_bcp_offset * wordSize; const int locals_offset = frame::interpreter_frame_locals_offset * wordSize; + //----------------------------------------------------------------------------- address TemplateInterpreterGenerator::generate_StackOverflowError_handler() { @@ -778,6 +790,30 @@ address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { return NULL; } +// TODO: rather than touching all pages, check against stack_overflow_limit and bang yellow page to +// generate exception. Windows might need this to map the shadow pages though. +void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { + // Quick & dirty stack overflow checking: bang the stack & handle trap. + // Note that we do the banging after the frame is setup, since the exception + // handling code expects to find a valid interpreter frame on the stack. + // Doing the banging earlier fails if the caller frame is not an interpreter + // frame. + // (Also, the exception throwing code expects to unlock any synchronized + // method receiever, so do the banging after locking the receiver.) + + // Bang each page in the shadow zone. We can't assume it's been done for + // an interpreter frame with greater than a page of locals, so each page + // needs to be checked. Only true for non-native. + if (UseStackBanging) { + const int page_size = os::vm_page_size(); + const int n_shadow_pages = ((int)JavaThread::stack_shadow_zone_size()) / page_size; + const int start_page = native_call ? n_shadow_pages : 1; + for (int pages = start_page; pages <= n_shadow_pages; pages++) { + __ bang_stack_with_offset(pages*page_size); + } + } +} + // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the // native method than the typical interpreter frame setup. @@ -1304,6 +1340,27 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { return entry_point; } +// Abstract method entry +// Attempt to execute abstract method. Throw exception +address TemplateInterpreterGenerator::generate_abstract_entry(void) { + + address entry_point = __ pc(); + + // abstract method entry + + // pop return address, reset last_sp to NULL + __ empty_expression_stack(); + __ restore_bcp(); // rsi must be correct for exception handler (was destroyed) + __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) + + // throw exception + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); + // the call_VM checks for exception, so we should never return here. + __ should_not_reach_here(); + + return entry_point; +} + // // Generic interpreted method entry to (asm) interpreter // diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp index c3496b3f4ce..82337e5b5a5 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,12 +26,26 @@ #include "asm/macroAssembler.hpp" #include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" #include "interpreter/templateInterpreterGenerator.hpp" #include "runtime/arguments.hpp" +#include "runtime/sharedRuntime.hpp" #define __ _masm-> +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + address entry = __ pc(); + // rbx,: method + // rcx: temporary + // rdi: pointer to locals + // rsp: end of copied parameters area + __ mov(rcx, rsp); + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), rbx, rdi, rcx); + __ ret(0); + return entry; +} + /** * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) @@ -301,3 +315,100 @@ address TemplateInterpreterGenerator::generate_Double_doubleToRawLongBits_entry( return NULL; } + +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { + + // rbx,: Method* + // rcx: scratrch + // rsi: sender sp + + if (!InlineIntrinsics) return NULL; // Generate a vanilla entry + + address entry_point = __ pc(); + + // These don't need a safepoint check because they aren't virtually + // callable. We won't enter these intrinsics from compiled code. + // If in the future we added an intrinsic which was virtually callable + // we'd have to worry about how to safepoint so that this code is used. + + // mathematical functions inlined by compiler + // (interpreter must provide identical implementation + // in order to avoid monotonicity bugs when switching + // from interpreter to compiler in the middle of some + // computation) + // + // stack: [ ret adr ] <-- rsp + // [ lo(arg) ] + // [ hi(arg) ] + // + + __ fld_d(Address(rsp, 1*wordSize)); + switch (kind) { + case Interpreter::java_lang_math_sin : + __ trigfunc('s'); + break; + case Interpreter::java_lang_math_cos : + __ trigfunc('c'); + break; + case Interpreter::java_lang_math_tan : + __ trigfunc('t'); + break; + case Interpreter::java_lang_math_sqrt: + __ fsqrt(); + break; + case Interpreter::java_lang_math_abs: + __ fabs(); + break; + case Interpreter::java_lang_math_log: + __ subptr(rsp, 2 * wordSize); + __ fstp_d(Address(rsp, 0)); + if (VM_Version::supports_sse2()) { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); + } + else { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dlog))); + } + __ addptr(rsp, 2 * wordSize); + break; + case Interpreter::java_lang_math_log10: + __ flog10(); + // Store to stack to convert 80bit precision back to 64bits + __ push_fTOS(); + __ pop_fTOS(); + break; + case Interpreter::java_lang_math_pow: + __ fld_d(Address(rsp, 3*wordSize)); // second argument + __ pow_with_fallback(0); + // Store to stack to convert 80bit precision back to 64bits + __ push_fTOS(); + __ pop_fTOS(); + break; + case Interpreter::java_lang_math_exp: + __ subptr(rsp, 2*wordSize); + __ fstp_d(Address(rsp, 0)); + if (VM_Version::supports_sse2()) { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp()))); + } else { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dexp))); + } + __ addptr(rsp, 2*wordSize); + break; + default : + ShouldNotReachHere(); + } + + // return double result in xmm0 for interpreter and compilers. + if (UseSSE >= 2) { + __ subptr(rsp, 2*wordSize); + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addptr(rsp, 2*wordSize); + } + + // done, result in FPU ST(0) or XMM0 + __ pop(rdi); // get return address + __ mov(rsp, rsi); // set sp to sender sp + __ jmp(rdi); + + return entry_point; +} diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp index e645a9ffe7e..7986b1846d9 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,11 +26,155 @@ #include "asm/macroAssembler.hpp" #include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" #include "interpreter/templateInterpreterGenerator.hpp" #include "runtime/arguments.hpp" #define __ _masm-> +#ifdef _WIN64 +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + address entry = __ pc(); + + // rbx: method + // r14: pointer to locals + // c_rarg3: first stack arg - wordSize + __ mov(c_rarg3, rsp); + // adjust rsp + __ subptr(rsp, 4 * wordSize); + __ call_VM(noreg, + CAST_FROM_FN_PTR(address, + InterpreterRuntime::slow_signature_handler), + rbx, r14, c_rarg3); + + // rax: result handler + + // Stack layout: + // rsp: 3 integer or float args (if static first is unused) + // 1 float/double identifiers + // return address + // stack args + // garbage + // expression stack bottom + // bcp (NULL) + // ... + + // Do FP first so we can use c_rarg3 as temp + __ movl(c_rarg3, Address(rsp, 3 * wordSize)); // float/double identifiers + + for ( int i= 0; i < Argument::n_int_register_parameters_c-1; i++ ) { + XMMRegister floatreg = as_XMMRegister(i+1); + Label isfloatordouble, isdouble, next; + + __ testl(c_rarg3, 1 << (i*2)); // Float or Double? + __ jcc(Assembler::notZero, isfloatordouble); + + // Do Int register here + switch ( i ) { + case 0: + __ movl(rscratch1, Address(rbx, Method::access_flags_offset())); + __ testl(rscratch1, JVM_ACC_STATIC); + __ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0)); + break; + case 1: + __ movptr(c_rarg2, Address(rsp, wordSize)); + break; + case 2: + __ movptr(c_rarg3, Address(rsp, 2 * wordSize)); + break; + default: + break; + } + + __ jmp (next); + + __ bind(isfloatordouble); + __ testl(c_rarg3, 1 << ((i*2)+1)); // Double? + __ jcc(Assembler::notZero, isdouble); + +// Do Float Here + __ movflt(floatreg, Address(rsp, i * wordSize)); + __ jmp(next); + +// Do Double here + __ bind(isdouble); + __ movdbl(floatreg, Address(rsp, i * wordSize)); + + __ bind(next); + } + + + // restore rsp + __ addptr(rsp, 4 * wordSize); + + __ ret(0); + + return entry; +} +#else +address TemplateInterpreterGenerator::generate_slow_signature_handler() { + address entry = __ pc(); + + // rbx: method + // r14: pointer to locals + // c_rarg3: first stack arg - wordSize + __ mov(c_rarg3, rsp); + // adjust rsp + __ subptr(rsp, 14 * wordSize); + __ call_VM(noreg, + CAST_FROM_FN_PTR(address, + InterpreterRuntime::slow_signature_handler), + rbx, r14, c_rarg3); + + // rax: result handler + + // Stack layout: + // rsp: 5 integer args (if static first is unused) + // 1 float/double identifiers + // 8 double args + // return address + // stack args + // garbage + // expression stack bottom + // bcp (NULL) + // ... + + // Do FP first so we can use c_rarg3 as temp + __ movl(c_rarg3, Address(rsp, 5 * wordSize)); // float/double identifiers + + for (int i = 0; i < Argument::n_float_register_parameters_c; i++) { + const XMMRegister r = as_XMMRegister(i); + + Label d, done; + + __ testl(c_rarg3, 1 << i); + __ jcc(Assembler::notZero, d); + __ movflt(r, Address(rsp, (6 + i) * wordSize)); + __ jmp(done); + __ bind(d); + __ movdbl(r, Address(rsp, (6 + i) * wordSize)); + __ bind(done); + } + + // Now handle integrals. Only do c_rarg1 if not static. + __ movl(c_rarg3, Address(rbx, Method::access_flags_offset())); + __ testl(c_rarg3, JVM_ACC_STATIC); + __ cmovptr(Assembler::zero, c_rarg1, Address(rsp, 0)); + + __ movptr(c_rarg2, Address(rsp, wordSize)); + __ movptr(c_rarg3, Address(rsp, 2 * wordSize)); + __ movptr(c_rarg4, Address(rsp, 3 * wordSize)); + __ movptr(c_rarg5, Address(rsp, 4 * wordSize)); + + // restore rsp + __ addptr(rsp, 14 * wordSize); + + __ ret(0); + + return entry; +} +#endif // __WIN64 + /** * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) @@ -193,3 +337,85 @@ address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(Abstract return NULL; } + +// +// Various method entries +// + +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { + + // rbx,: Method* + // rcx: scratrch + // r13: sender sp + + if (!InlineIntrinsics) return NULL; // Generate a vanilla entry + + address entry_point = __ pc(); + + // These don't need a safepoint check because they aren't virtually + // callable. We won't enter these intrinsics from compiled code. + // If in the future we added an intrinsic which was virtually callable + // we'd have to worry about how to safepoint so that this code is used. + + // mathematical functions inlined by compiler + // (interpreter must provide identical implementation + // in order to avoid monotonicity bugs when switching + // from interpreter to compiler in the middle of some + // computation) + // + // stack: [ ret adr ] <-- rsp + // [ lo(arg) ] + // [ hi(arg) ] + // + + + if (kind == Interpreter::java_lang_math_sqrt) { + __ sqrtsd(xmm0, Address(rsp, wordSize)); + } else if (kind == Interpreter::java_lang_math_exp) { + __ movdbl(xmm0, Address(rsp, wordSize)); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dexp()))); + } else if (kind == Interpreter::java_lang_math_log) { + __ movdbl(xmm0, Address(rsp, wordSize)); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); + } else { + __ fld_d(Address(rsp, wordSize)); + switch (kind) { + case Interpreter::java_lang_math_sin : + __ trigfunc('s'); + break; + case Interpreter::java_lang_math_cos : + __ trigfunc('c'); + break; + case Interpreter::java_lang_math_tan : + __ trigfunc('t'); + break; + case Interpreter::java_lang_math_abs: + __ fabs(); + break; + case Interpreter::java_lang_math_log10: + __ flog10(); + break; + case Interpreter::java_lang_math_pow: + __ fld_d(Address(rsp, 3*wordSize)); // second argument (one + // empty stack slot) + __ pow_with_fallback(0); + break; + default : + ShouldNotReachHere(); + } + + // return double result in xmm0 for interpreter and compilers. + __ subptr(rsp, 2*wordSize); + // Round to 64bit precision + __ fstp_d(Address(rsp, 0)); + __ movdbl(xmm0, Address(rsp, 0)); + __ addptr(rsp, 2*wordSize); + } + + + __ pop(rax); + __ mov(rsp, r13); + __ jmp(rax); + + return entry_point; +} diff --git a/hotspot/src/cpu/zero/vm/abstractInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/abstractInterpreter_zero.cpp new file mode 100644 index 00000000000..de1a9584aeb --- /dev/null +++ b/hotspot/src/cpu/zero/vm/abstractInterpreter_zero.cpp @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + * 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 "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/cppInterpreter.hpp" +#include "runtime/frame.inline.hpp" +#include "utilities/globalDefinitions.hpp" + +bool AbstractInterpreter::can_be_compiled(methodHandle m) { + return true; +} + +int AbstractInterpreter::BasicType_as_index(BasicType type) { + int i = 0; + switch (type) { + case T_BOOLEAN: i = 0; break; + case T_CHAR : i = 1; break; + case T_BYTE : i = 2; break; + case T_SHORT : i = 3; break; + case T_INT : i = 4; break; + case T_LONG : i = 5; break; + case T_VOID : i = 6; break; + case T_FLOAT : i = 7; break; + case T_DOUBLE : i = 8; break; + case T_OBJECT : i = 9; break; + case T_ARRAY : i = 9; break; + default : ShouldNotReachHere(); + } + assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, + "index out of bounds"); + return i; +} + +// Deoptimization helpers + +int AbstractInterpreter::size_activation(int max_stack, + int tempcount, + int extra_args, + int moncount, + int callee_param_count, + int callee_locals, + bool is_top_frame) { + int header_words = InterpreterFrame::header_words; + int monitor_words = moncount * frame::interpreter_frame_monitor_size(); + int stack_words = is_top_frame ? max_stack : tempcount; + int callee_extra_locals = callee_locals - callee_param_count; + + return header_words + monitor_words + stack_words + callee_extra_locals; +} + +void AbstractInterpreter::layout_activation(Method* method, + int tempcount, + int popframe_extra_args, + int moncount, + int caller_actual_parameters, + int callee_param_count, + int callee_locals, + frame* caller, + frame* interpreter_frame, + bool is_top_frame, + bool is_bottom_frame) { + assert(popframe_extra_args == 0, "what to do?"); + assert(!is_top_frame || (!callee_locals && !callee_param_count), + "top frame should have no caller"); + + // This code must exactly match what InterpreterFrame::build + // does (the full InterpreterFrame::build, that is, not the + // one that creates empty frames for the deoptimizer). + // + // interpreter_frame will be filled in. It's size is determined by + // a previous call to the size_activation() method, + // + // Note that tempcount is the current size of the expression + // stack. For top most frames we will allocate a full sized + // expression stack and not the trimmed version that non-top + // frames have. + + int monitor_words = moncount * frame::interpreter_frame_monitor_size(); + intptr_t *locals = interpreter_frame->fp() + method->max_locals(); + interpreterState istate = interpreter_frame->get_interpreterState(); + intptr_t *monitor_base = (intptr_t*) istate; + intptr_t *stack_base = monitor_base - monitor_words; + intptr_t *stack = stack_base - tempcount - 1; + + BytecodeInterpreter::layout_interpreterState(istate, + caller, + NULL, + method, + locals, + stack, + stack_base, + monitor_base, + NULL, + is_top_frame); +} + +// Helper for (runtime) stack overflow checks + +int AbstractInterpreter::size_top_interpreter_activation(Method* method) { + return 0; +} diff --git a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp index e632d821792..2290f59d1b1 100644 --- a/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2008 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -25,7 +25,6 @@ #include "precompiled.hpp" #include "asm/assembler.hpp" -#include "interp_masm_zero.hpp" #include "interpreter/bytecodeInterpreter.hpp" #include "interpreter/bytecodeInterpreter.inline.hpp" #include "interpreter/interpreter.hpp" @@ -33,8 +32,6 @@ #include "oops/methodData.hpp" #include "oops/method.hpp" #include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" #include "runtime/deoptimization.hpp" #include "runtime/frame.inline.hpp" #include "runtime/sharedRuntime.hpp" @@ -68,4 +65,40 @@ const char *BytecodeInterpreter::name_of_field_at_address(address addr) { return NULL; } +void BytecodeInterpreter::layout_interpreterState(interpreterState istate, + frame* caller, + frame* current, + Method* method, + intptr_t* locals, + intptr_t* stack, + intptr_t* stack_base, + intptr_t* monitor_base, + intptr_t* frame_bottom, + bool is_top_frame) { + istate->set_locals(locals); + istate->set_method(method); + istate->set_self_link(istate); + istate->set_prev_link(NULL); + // thread will be set by a hacky repurposing of frame::patch_pc() + // bcp will be set by vframeArrayElement::unpack_on_stack() + istate->set_constants(method->constants()->cache()); + istate->set_msg(BytecodeInterpreter::method_resume); + istate->set_bcp_advance(0); + istate->set_oop_temp(NULL); + istate->set_mdx(NULL); + if (caller->is_interpreted_frame()) { + interpreterState prev = caller->get_interpreterState(); + prev->set_callee(method); + if (*prev->bcp() == Bytecodes::_invokeinterface) + prev->set_bcp_advance(5); + else + prev->set_bcp_advance(3); + } + istate->set_callee(NULL); + istate->set_monitor_base((BasicObjectLock *) monitor_base); + istate->set_stack_base(stack_base); + istate->set_stack(stack); + istate->set_stack_limit(stack_base - method->max_stack() - 1); +} + #endif // CC_INTERP diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.cpp similarity index 56% rename from hotspot/src/cpu/zero/vm/interpreter_zero.cpp rename to hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.cpp index 4675ecb4db1..2a10782bddd 100644 --- a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.cpp @@ -27,32 +27,12 @@ #include "asm/assembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/cppInterpreterGenerator.hpp" -#include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" #include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "prims/methodHandles.hpp" #include "runtime/arguments.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef COMPILER1 -#include "c1/c1_Runtime1.hpp" -#endif -#ifdef CC_INTERP #include "interpreter/cppInterpreter.hpp" -#endif -address AbstractInterpreterGenerator::generate_slow_signature_handler() { +address CppInterpreterGenerator::generate_slow_signature_handler() { _masm->advance(1); return (address) InterpreterRuntime::slow_signature_handler; } @@ -70,6 +50,44 @@ address CppInterpreterGenerator::generate_abstract_entry() { return generate_entry((address) ShouldNotCallThisEntry()); } -bool AbstractInterpreter::can_be_compiled(methodHandle m) { - return true; +address CppInterpreterGenerator::generate_empty_entry() { + if (!UseFastEmptyMethods) + return NULL; + + return generate_entry((address) CppInterpreter::empty_entry); +} + +address CppInterpreterGenerator::generate_accessor_entry() { + if (!UseFastAccessorMethods) + return NULL; + + return generate_entry((address) CppInterpreter::accessor_entry); +} + +address CppInterpreterGenerator::generate_Reference_get_entry(void) { +#if INCLUDE_ALL_GCS + if (UseG1GC) { + // We need to generate have a routine that generates code to: + // * load the value in the referent field + // * passes that value to the pre-barrier. + // + // In the case of G1 this will record the value of the + // referent in an SATB buffer if marking is active. + // This will cause concurrent marking to mark the referent + // field as live. + Unimplemented(); + } +#endif // INCLUDE_ALL_GCS + + // If G1 is not enabled then attempt to go through the normal entry point + // Reference.get could be instrumented by jvmti + return NULL; +} + +address CppInterpreterGenerator::generate_native_entry(bool synchronized) { + return generate_entry((address) CppInterpreter::native_entry); +} + +address CppInterpreterGenerator::generate_normal_entry(bool synchronized) { + return generate_entry((address) CppInterpreter::normal_entry); } diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 1bb7809ea43..387733de06d 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -747,92 +747,6 @@ InterpreterFrame *InterpreterFrame::build(Method* const method, TRAPS) { return (InterpreterFrame *) fp; } -int AbstractInterpreter::BasicType_as_index(BasicType type) { - int i = 0; - switch (type) { - case T_BOOLEAN: i = 0; break; - case T_CHAR : i = 1; break; - case T_BYTE : i = 2; break; - case T_SHORT : i = 3; break; - case T_INT : i = 4; break; - case T_LONG : i = 5; break; - case T_VOID : i = 6; break; - case T_FLOAT : i = 7; break; - case T_DOUBLE : i = 8; break; - case T_OBJECT : i = 9; break; - case T_ARRAY : i = 9; break; - default : ShouldNotReachHere(); - } - assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, - "index out of bounds"); - return i; -} - -BasicType CppInterpreter::result_type_of(Method* method) { - BasicType t; - switch (method->result_index()) { - case 0 : t = T_BOOLEAN; break; - case 1 : t = T_CHAR; break; - case 2 : t = T_BYTE; break; - case 3 : t = T_SHORT; break; - case 4 : t = T_INT; break; - case 5 : t = T_LONG; break; - case 6 : t = T_VOID; break; - case 7 : t = T_FLOAT; break; - case 8 : t = T_DOUBLE; break; - case 9 : t = T_OBJECT; break; - default: ShouldNotReachHere(); - } - assert(AbstractInterpreter::BasicType_as_index(t) == method->result_index(), - "out of step with AbstractInterpreter::BasicType_as_index"); - return t; -} - -address CppInterpreterGenerator::generate_empty_entry() { - if (!UseFastEmptyMethods) - return NULL; - - return generate_entry((address) CppInterpreter::empty_entry); -} - -address CppInterpreterGenerator::generate_accessor_entry() { - if (!UseFastAccessorMethods) - return NULL; - - return generate_entry((address) CppInterpreter::accessor_entry); -} - -address CppInterpreterGenerator::generate_Reference_get_entry(void) { -#if INCLUDE_ALL_GCS - if (UseG1GC) { - // We need to generate have a routine that generates code to: - // * load the value in the referent field - // * passes that value to the pre-barrier. - // - // In the case of G1 this will record the value of the - // referent in an SATB buffer if marking is active. - // This will cause concurrent marking to mark the referent - // field as live. - Unimplemented(); - } -#endif // INCLUDE_ALL_GCS - - // If G1 is not enabled then attempt to go through the normal entry point - // Reference.get could be instrumented by jvmti - return NULL; -} - -address CppInterpreterGenerator::generate_native_entry(bool synchronized) { - return generate_entry((address) CppInterpreter::native_entry); -} - -address CppInterpreterGenerator::generate_normal_entry(bool synchronized) { - return generate_entry((address) CppInterpreter::normal_entry); -} - - -// Deoptimization helpers - InterpreterFrame *InterpreterFrame::build(int size, TRAPS) { ZeroStack *stack = ((JavaThread *) THREAD)->zero_stack(); @@ -858,101 +772,24 @@ InterpreterFrame *InterpreterFrame::build(int size, TRAPS) { return (InterpreterFrame *) fp; } -int AbstractInterpreter::size_activation(int max_stack, - int tempcount, - int extra_args, - int moncount, - int callee_param_count, - int callee_locals, - bool is_top_frame) { - int header_words = InterpreterFrame::header_words; - int monitor_words = moncount * frame::interpreter_frame_monitor_size(); - int stack_words = is_top_frame ? max_stack : tempcount; - int callee_extra_locals = callee_locals - callee_param_count; - - return header_words + monitor_words + stack_words + callee_extra_locals; -} - -void AbstractInterpreter::layout_activation(Method* method, - int tempcount, - int popframe_extra_args, - int moncount, - int caller_actual_parameters, - int callee_param_count, - int callee_locals, - frame* caller, - frame* interpreter_frame, - bool is_top_frame, - bool is_bottom_frame) { - assert(popframe_extra_args == 0, "what to do?"); - assert(!is_top_frame || (!callee_locals && !callee_param_count), - "top frame should have no caller"); - - // This code must exactly match what InterpreterFrame::build - // does (the full InterpreterFrame::build, that is, not the - // one that creates empty frames for the deoptimizer). - // - // interpreter_frame will be filled in. It's size is determined by - // a previous call to the size_activation() method, - // - // Note that tempcount is the current size of the expression - // stack. For top most frames we will allocate a full sized - // expression stack and not the trimmed version that non-top - // frames have. - - int monitor_words = moncount * frame::interpreter_frame_monitor_size(); - intptr_t *locals = interpreter_frame->fp() + method->max_locals(); - interpreterState istate = interpreter_frame->get_interpreterState(); - intptr_t *monitor_base = (intptr_t*) istate; - intptr_t *stack_base = monitor_base - monitor_words; - intptr_t *stack = stack_base - tempcount - 1; - - BytecodeInterpreter::layout_interpreterState(istate, - caller, - NULL, - method, - locals, - stack, - stack_base, - monitor_base, - NULL, - is_top_frame); -} - -void BytecodeInterpreter::layout_interpreterState(interpreterState istate, - frame* caller, - frame* current, - Method* method, - intptr_t* locals, - intptr_t* stack, - intptr_t* stack_base, - intptr_t* monitor_base, - intptr_t* frame_bottom, - bool is_top_frame) { - istate->set_locals(locals); - istate->set_method(method); - istate->set_self_link(istate); - istate->set_prev_link(NULL); - // thread will be set by a hacky repurposing of frame::patch_pc() - // bcp will be set by vframeArrayElement::unpack_on_stack() - istate->set_constants(method->constants()->cache()); - istate->set_msg(BytecodeInterpreter::method_resume); - istate->set_bcp_advance(0); - istate->set_oop_temp(NULL); - istate->set_mdx(NULL); - if (caller->is_interpreted_frame()) { - interpreterState prev = caller->get_interpreterState(); - prev->set_callee(method); - if (*prev->bcp() == Bytecodes::_invokeinterface) - prev->set_bcp_advance(5); - else - prev->set_bcp_advance(3); +BasicType CppInterpreter::result_type_of(Method* method) { + BasicType t; + switch (method->result_index()) { + case 0 : t = T_BOOLEAN; break; + case 1 : t = T_CHAR; break; + case 2 : t = T_BYTE; break; + case 3 : t = T_SHORT; break; + case 4 : t = T_INT; break; + case 5 : t = T_LONG; break; + case 6 : t = T_VOID; break; + case 7 : t = T_FLOAT; break; + case 8 : t = T_DOUBLE; break; + case 9 : t = T_OBJECT; break; + default: ShouldNotReachHere(); } - istate->set_callee(NULL); - istate->set_monitor_base((BasicObjectLock *) monitor_base); - istate->set_stack_base(stack_base); - istate->set_stack(stack); - istate->set_stack_limit(stack_base - method->max_stack() - 1); + assert(AbstractInterpreter::BasicType_as_index(t) == method->result_index(), + "out of step with AbstractInterpreter::BasicType_as_index"); + return t; } address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { @@ -964,12 +801,6 @@ address CppInterpreter::deopt_entry(TosState state, int length) { return NULL; } -// Helper for (runtime) stack overflow checks - -int AbstractInterpreter::size_top_interpreter_activation(Method* method) { - return 0; -} - // Helper for figuring out if frames are interpreter frames bool CppInterpreter::contains(address pc) { diff --git a/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp b/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp deleted file mode 100644 index a2e85ede0dd..00000000000 --- a/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 Red Hat, Inc. - * 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 "interp_masm_zero.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "oops/arrayOop.hpp" -#include "oops/markOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiRedefineClassesTrace.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/basicLock.hpp" -#include "runtime/biasedLocking.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/thread.inline.hpp" - -// This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp b/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp deleted file mode 100644 index 4ed89fe2b28..00000000000 --- a/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 Red Hat, Inc. - * 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 "asm/assembler.hpp" -#include "asm/register.hpp" -#include "interp_masm_zero.hpp" -#include "register_zero.hpp" - -// This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/stack_zero.cpp b/hotspot/src/cpu/zero/vm/stack_zero.cpp index 747199f5492..1acb96e97ec 100644 --- a/hotspot/src/cpu/zero/vm/stack_zero.cpp +++ b/hotspot/src/cpu/zero/vm/stack_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -25,9 +25,16 @@ #include "precompiled.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "runtime/thread.hpp" #include "stack_zero.hpp" #include "stack_zero.inline.hpp" +// Inlined causes circular inclusion with thread.hpp +ZeroStack::ZeroStack() + : _base(NULL), _top(NULL), _sp(NULL) { + _shadow_pages_size = JavaThread::stack_shadow_zone_size(); + } + int ZeroStack::suggest_size(Thread *thread) const { assert(needs_setup(), "already set up"); int abi_available = abi_stack_available(thread); diff --git a/hotspot/src/cpu/zero/vm/stack_zero.hpp b/hotspot/src/cpu/zero/vm/stack_zero.hpp index df1ea7235c8..6048cf2ac83 100644 --- a/hotspot/src/cpu/zero/vm/stack_zero.hpp +++ b/hotspot/src/cpu/zero/vm/stack_zero.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -38,10 +38,7 @@ class ZeroStack { int _shadow_pages_size; // how much ABI stack must we keep free? public: - ZeroStack() - : _base(NULL), _top(NULL), _sp(NULL) { - _shadow_pages_size = JavaThread::stack_shadow_zone_size(); - } + ZeroStack(); bool needs_setup() const { return _base == NULL; diff --git a/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp b/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp index 7123098dfbb..02d12e8e96d 100644 --- a/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -49,11 +49,10 @@ inline void ZeroStack::overflow_check(int required_words, TRAPS) { // value can be negative. inline int ZeroStack::abi_stack_available(Thread *thread) const { guarantee(Thread::current() == thread, "should run in the same thread"); - assert(thread->stack_size() - - (thread->stack_base() - (address) &stack_used + - JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size()) == - (address)&stack_used - thread->stack_overflow_limit(), "sanity"); - return (address)&stack_used - stack_overflow_limit(); + int stack_used = thread->stack_base() - (address) &stack_used + + (JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size()); + int stack_free = thread->stack_size() - stack_used; + return stack_free; } #endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP diff --git a/hotspot/src/os/aix/vm/os_aix.inline.hpp b/hotspot/src/os/aix/vm/os_aix.inline.hpp index 5d0deea22f7..a12c5d4f424 100644 --- a/hotspot/src/os/aix/vm/os_aix.inline.hpp +++ b/hotspot/src/os/aix/vm/os_aix.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -65,7 +65,7 @@ inline void os::pd_split_reserved_memory(char *base, size_t size, } // Bang the shadow pages if they need to be touched to be mapped. -inline void os::bang_stack_shadow_pages() { +inline void os::map_stack_shadow_pages() { } inline void os::dll_unload(void *lib) { diff --git a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp index 4a654614c2b..b4a89aa4d8f 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp +++ b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -68,7 +68,7 @@ inline void os::pd_split_reserved_memory(char *base, size_t size, // Bang the shadow pages if they need to be touched to be mapped. -inline void os::bang_stack_shadow_pages() { +inline void os::map_stack_shadow_pages() { } inline void os::dll_unload(void *lib) { diff --git a/hotspot/src/os/linux/vm/os_linux.inline.hpp b/hotspot/src/os/linux/vm/os_linux.inline.hpp index 7559cde3d00..935b7c3ebd0 100644 --- a/hotspot/src/os/linux/vm/os_linux.inline.hpp +++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ inline void os::pd_split_reserved_memory(char *base, size_t size, // Bang the shadow pages if they need to be touched to be mapped. -inline void os::bang_stack_shadow_pages() { +inline void os::map_stack_shadow_pages() { } inline void os::dll_unload(void *lib) { diff --git a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp index 4ececaf1ceb..24f44704470 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp +++ b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,7 @@ inline void os::pd_split_reserved_memory(char *base, size_t size, // Bang the shadow pages if they need to be touched to be mapped. -inline void os::bang_stack_shadow_pages() { +inline void os::map_stack_shadow_pages() { } inline void os::dll_unload(void *lib) { ::dlclose(lib); } diff --git a/hotspot/src/os/windows/vm/os_windows.inline.hpp b/hotspot/src/os/windows/vm/os_windows.inline.hpp index 09590cf9ca4..cf4a3005aae 100644 --- a/hotspot/src/os/windows/vm/os_windows.inline.hpp +++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,7 @@ inline int os::readdir_buf_size(const char *path) } // Bang the shadow pages if they need to be touched to be mapped. -inline void os::bang_stack_shadow_pages() { +inline void os::map_stack_shadow_pages() { // Write to each page of our new frame to force OS mapping. // If we decrement stack pointer more than one page // the OS may not map an intervening page into our space diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.cpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.cpp new file mode 100644 index 00000000000..96fb64403cd --- /dev/null +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.cpp @@ -0,0 +1,420 @@ +/* + * Copyright (c) 1997, 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 "asm/macroAssembler.hpp" +#include "asm/macroAssembler.inline.hpp" +#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" +#include "interpreter/templateTable.hpp" +#include "memory/allocation.inline.hpp" +#include "memory/resourceArea.hpp" +#include "oops/arrayOop.hpp" +#include "oops/methodData.hpp" +#include "oops/method.hpp" +#include "oops/oop.inline.hpp" +#include "prims/forte.hpp" +#include "prims/jvmtiExport.hpp" +#include "prims/methodHandles.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/timer.hpp" + +# define __ _masm-> + +//------------------------------------------------------------------------------------------------------------------------ +// Implementation of platform independent aspects of Interpreter + +void AbstractInterpreter::initialize() { + if (_code != NULL) return; + + // make sure 'imported' classes are initialized + if (CountBytecodes || TraceBytecodes || StopInterpreterAt) BytecodeCounter::reset(); + if (PrintBytecodeHistogram) BytecodeHistogram::reset(); + if (PrintBytecodePairHistogram) BytecodePairHistogram::reset(); + + InvocationCounter::reinitialize(DelayCompilationDuringStartup); + +} + +void AbstractInterpreter::print() { + tty->cr(); + tty->print_cr("----------------------------------------------------------------------"); + tty->print_cr("Interpreter"); + tty->cr(); + tty->print_cr("code size = %6dK bytes", (int)_code->used_space()/1024); + tty->print_cr("total space = %6dK bytes", (int)_code->total_space()/1024); + tty->print_cr("wasted space = %6dK bytes", (int)_code->available_space()/1024); + tty->cr(); + tty->print_cr("# of codelets = %6d" , _code->number_of_stubs()); + if (_code->number_of_stubs() != 0) { + tty->print_cr("avg codelet size = %6d bytes", _code->used_space() / _code->number_of_stubs()); + tty->cr(); + } + _code->print(); + tty->print_cr("----------------------------------------------------------------------"); + tty->cr(); +} + + +//------------------------------------------------------------------------------------------------------------------------ +// Implementation of interpreter + +StubQueue* AbstractInterpreter::_code = NULL; +bool AbstractInterpreter::_notice_safepoints = false; +address AbstractInterpreter::_rethrow_exception_entry = NULL; + +address AbstractInterpreter::_native_entry_begin = NULL; +address AbstractInterpreter::_native_entry_end = NULL; +address AbstractInterpreter::_slow_signature_handler; +address AbstractInterpreter::_entry_table [AbstractInterpreter::number_of_method_entries]; +address AbstractInterpreter::_native_abi_to_tosca [AbstractInterpreter::number_of_result_handlers]; + +//------------------------------------------------------------------------------------------------------------------------ +// Generation of complete interpreter + +AbstractInterpreterGenerator::AbstractInterpreterGenerator(StubQueue* _code) { + _masm = NULL; +} + + +//------------------------------------------------------------------------------------------------------------------------ +// Entry points + +AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) { + // Abstract method? + if (m->is_abstract()) return abstract; + + // Method handle primitive? + if (m->is_method_handle_intrinsic()) { + vmIntrinsics::ID id = m->intrinsic_id(); + assert(MethodHandles::is_signature_polymorphic(id), "must match an intrinsic"); + MethodKind kind = (MethodKind)( method_handle_invoke_FIRST + + ((int)id - vmIntrinsics::FIRST_MH_SIG_POLY) ); + assert(kind <= method_handle_invoke_LAST, "parallel enum ranges"); + return kind; + } + +#ifndef CC_INTERP + if (UseCRC32Intrinsics && m->is_native()) { + // Use optimized stub code for CRC32 native methods. + switch (m->intrinsic_id()) { + case vmIntrinsics::_updateCRC32 : return java_util_zip_CRC32_update; + case vmIntrinsics::_updateBytesCRC32 : return java_util_zip_CRC32_updateBytes; + case vmIntrinsics::_updateByteBufferCRC32 : return java_util_zip_CRC32_updateByteBuffer; + } + } + if (UseCRC32CIntrinsics) { + // Use optimized stub code for CRC32C methods. + switch (m->intrinsic_id()) { + case vmIntrinsics::_updateBytesCRC32C : return java_util_zip_CRC32C_updateBytes; + case vmIntrinsics::_updateDirectByteBufferCRC32C : return java_util_zip_CRC32C_updateDirectByteBuffer; + } + } + + switch(m->intrinsic_id()) { + case vmIntrinsics::_intBitsToFloat: return java_lang_Float_intBitsToFloat; + case vmIntrinsics::_floatToRawIntBits: return java_lang_Float_floatToRawIntBits; + case vmIntrinsics::_longBitsToDouble: return java_lang_Double_longBitsToDouble; + case vmIntrinsics::_doubleToRawLongBits: return java_lang_Double_doubleToRawLongBits; + } + +#endif // CC_INTERP + + // Native method? + // Note: This test must come _before_ the test for intrinsic + // methods. See also comments below. + if (m->is_native()) { + assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out"); + return m->is_synchronized() ? native_synchronized : native; + } + + // Synchronized? + if (m->is_synchronized()) { + return zerolocals_synchronized; + } + + if (RegisterFinalizersAtInit && m->code_size() == 1 && + m->intrinsic_id() == vmIntrinsics::_Object_init) { + // We need to execute the special return bytecode to check for + // finalizer registration so create a normal frame. + return zerolocals; + } + + // Empty method? + if (m->is_empty_method()) { + return empty; + } + + // Special intrinsic method? + // Note: This test must come _after_ the test for native methods, + // otherwise we will run into problems with JDK 1.2, see also + // TemplateInterpreterGenerator::generate_method_entry() for + // for details. + switch (m->intrinsic_id()) { + case vmIntrinsics::_dsin : return java_lang_math_sin ; + case vmIntrinsics::_dcos : return java_lang_math_cos ; + case vmIntrinsics::_dtan : return java_lang_math_tan ; + case vmIntrinsics::_dabs : return java_lang_math_abs ; + case vmIntrinsics::_dsqrt : return java_lang_math_sqrt ; + case vmIntrinsics::_dlog : return java_lang_math_log ; + case vmIntrinsics::_dlog10: return java_lang_math_log10; + case vmIntrinsics::_dpow : return java_lang_math_pow ; + case vmIntrinsics::_dexp : return java_lang_math_exp ; + + case vmIntrinsics::_Reference_get: + return java_lang_ref_reference_get; + } + + // Accessor method? + if (m->is_getter()) { + // TODO: We should have used ::is_accessor above, but fast accessors in Zero expect only getters. + // See CppInterpreter::accessor_entry in cppInterpreter_zero.cpp. This should be fixed in Zero, + // then the call above updated to ::is_accessor + assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1"); + return accessor; + } + + // Note: for now: zero locals for all non-empty methods + return zerolocals; +} + + +void AbstractInterpreter::set_entry_for_kind(AbstractInterpreter::MethodKind kind, address entry) { + assert(kind >= method_handle_invoke_FIRST && + kind <= method_handle_invoke_LAST, "late initialization only for MH entry points"); + assert(_entry_table[kind] == _entry_table[abstract], "previous value must be AME entry"); + _entry_table[kind] = entry; +} + + +// Return true if the interpreter can prove that the given bytecode has +// not yet been executed (in Java semantics, not in actual operation). +bool AbstractInterpreter::is_not_reached(const methodHandle& method, int bci) { + Bytecodes::Code code = method()->code_at(bci); + + if (!Bytecodes::must_rewrite(code)) { + // might have been reached + return false; + } + + // the bytecode might not be rewritten if the method is an accessor, etc. + address ientry = method->interpreter_entry(); + if (ientry != entry_for_kind(AbstractInterpreter::zerolocals) && + ientry != entry_for_kind(AbstractInterpreter::zerolocals_synchronized)) + return false; // interpreter does not run this method! + + // otherwise, we can be sure this bytecode has never been executed + return true; +} + + +#ifndef PRODUCT +void AbstractInterpreter::print_method_kind(MethodKind kind) { + switch (kind) { + case zerolocals : tty->print("zerolocals" ); break; + case zerolocals_synchronized: tty->print("zerolocals_synchronized"); break; + case native : tty->print("native" ); break; + case native_synchronized : tty->print("native_synchronized" ); break; + case empty : tty->print("empty" ); break; + case accessor : tty->print("accessor" ); break; + case abstract : tty->print("abstract" ); break; + case java_lang_math_sin : tty->print("java_lang_math_sin" ); break; + case java_lang_math_cos : tty->print("java_lang_math_cos" ); break; + case java_lang_math_tan : tty->print("java_lang_math_tan" ); break; + case java_lang_math_abs : tty->print("java_lang_math_abs" ); break; + case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; + case java_lang_math_log : tty->print("java_lang_math_log" ); break; + case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break; + case java_util_zip_CRC32_update : tty->print("java_util_zip_CRC32_update"); break; + case java_util_zip_CRC32_updateBytes : tty->print("java_util_zip_CRC32_updateBytes"); break; + case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break; + case java_util_zip_CRC32C_updateBytes : tty->print("java_util_zip_CRC32C_updateBytes"); break; + case java_util_zip_CRC32C_updateDirectByteBuffer: tty->print("java_util_zip_CRC32C_updateDirectByteByffer"); break; + default: + if (kind >= method_handle_invoke_FIRST && + kind <= method_handle_invoke_LAST) { + const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind)); + if (kind_name[0] == '_') kind_name = &kind_name[1]; // '_invokeExact' => 'invokeExact' + tty->print("method_handle_%s", kind_name); + break; + } + ShouldNotReachHere(); + break; + } +} +#endif // PRODUCT + + +//------------------------------------------------------------------------------------------------------------------------ +// Deoptimization support + +/** + * If a deoptimization happens, this function returns the point of next bytecode to continue execution. + */ +address AbstractInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) { + assert(method->contains(bcp), "just checkin'"); + + // Get the original and rewritten bytecode. + Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); + assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); + + const int bci = method->bci_from(bcp); + + // compute continuation length + const int length = Bytecodes::length_at(method, bcp); + + // compute result type + BasicType type = T_ILLEGAL; + + switch (code) { + case Bytecodes::_invokevirtual : + case Bytecodes::_invokespecial : + case Bytecodes::_invokestatic : + case Bytecodes::_invokeinterface: { + Thread *thread = Thread::current(); + ResourceMark rm(thread); + methodHandle mh(thread, method); + type = Bytecode_invoke(mh, bci).result_type(); + // since the cache entry might not be initialized: + // (NOT needed for the old calling convension) + if (!is_top_frame) { + int index = Bytes::get_native_u2(bcp+1); + method->constants()->cache()->entry_at(index)->set_parameter_size(callee_parameters); + } + break; + } + + case Bytecodes::_invokedynamic: { + Thread *thread = Thread::current(); + ResourceMark rm(thread); + methodHandle mh(thread, method); + type = Bytecode_invoke(mh, bci).result_type(); + // since the cache entry might not be initialized: + // (NOT needed for the old calling convension) + if (!is_top_frame) { + int index = Bytes::get_native_u4(bcp+1); + method->constants()->invokedynamic_cp_cache_entry_at(index)->set_parameter_size(callee_parameters); + } + break; + } + + case Bytecodes::_ldc : + case Bytecodes::_ldc_w : // fall through + case Bytecodes::_ldc2_w: + { + Thread *thread = Thread::current(); + ResourceMark rm(thread); + methodHandle mh(thread, method); + type = Bytecode_loadconstant(mh, bci).result_type(); + break; + } + + default: + type = Bytecodes::result_type(code); + break; + } + + // return entry point for computed continuation state & bytecode length + return + is_top_frame + ? Interpreter::deopt_entry (as_TosState(type), length) + : Interpreter::return_entry(as_TosState(type), length, code); +} + +// If deoptimization happens, this function returns the point where the interpreter reexecutes +// the bytecode. +// Note: Bytecodes::_athrow is a special case in that it does not return +// Interpreter::deopt_entry(vtos, 0) like others +address AbstractInterpreter::deopt_reexecute_entry(Method* method, address bcp) { + assert(method->contains(bcp), "just checkin'"); + Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); +#if defined(COMPILER1) || INCLUDE_JVMCI + if(code == Bytecodes::_athrow ) { + return Interpreter::rethrow_exception_entry(); + } +#endif /* COMPILER1 || INCLUDE_JVMCI */ + return Interpreter::deopt_entry(vtos, 0); +} + +// If deoptimization happens, the interpreter should reexecute these bytecodes. +// This function mainly helps the compilers to set up the reexecute bit. +bool AbstractInterpreter::bytecode_should_reexecute(Bytecodes::Code code) { + switch (code) { + case Bytecodes::_lookupswitch: + case Bytecodes::_tableswitch: + case Bytecodes::_fast_binaryswitch: + case Bytecodes::_fast_linearswitch: + // recompute condtional expression folded into _if + case Bytecodes::_lcmp : + case Bytecodes::_fcmpl : + case Bytecodes::_fcmpg : + case Bytecodes::_dcmpl : + case Bytecodes::_dcmpg : + case Bytecodes::_ifnull : + case Bytecodes::_ifnonnull : + case Bytecodes::_goto : + case Bytecodes::_goto_w : + case Bytecodes::_ifeq : + case Bytecodes::_ifne : + case Bytecodes::_iflt : + case Bytecodes::_ifge : + case Bytecodes::_ifgt : + case Bytecodes::_ifle : + case Bytecodes::_if_icmpeq : + case Bytecodes::_if_icmpne : + case Bytecodes::_if_icmplt : + case Bytecodes::_if_icmpge : + case Bytecodes::_if_icmpgt : + case Bytecodes::_if_icmple : + case Bytecodes::_if_acmpeq : + case Bytecodes::_if_acmpne : + // special cases + case Bytecodes::_getfield : + case Bytecodes::_putfield : + case Bytecodes::_getstatic : + case Bytecodes::_putstatic : + case Bytecodes::_aastore : +#ifdef COMPILER1 + //special case of reexecution + case Bytecodes::_athrow : +#endif + return true; + + default: + return false; + } +} + +void AbstractInterpreter::initialize_method_handle_entries() { + // method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate: + for (int i = method_handle_invoke_FIRST; i <= method_handle_invoke_LAST; i++) { + MethodKind kind = (MethodKind) i; + _entry_table[kind] = _entry_table[Interpreter::abstract]; + } +} diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index 62d1947e227..8be852bae60 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -284,6 +284,12 @@ class AbstractInterpreter: AllStatic { default: ShouldNotReachHere(); } } + + static void initialize_method_handle_entries(); + + // PPC-only: Support abs and sqrt like in compiler. + // For others we can use a normal (native) entry. + static bool math_entry_available(MethodKind kind); }; //------------------------------------------------------------------------------------------------------------------------ @@ -294,16 +300,6 @@ class AbstractInterpreterGenerator: public StackObj { protected: InterpreterMacroAssembler* _masm; - // shared code sequences - // Converter for native abi result to tosca result - address generate_result_handler_for(BasicType type); - address generate_slow_signature_handler(); - - void bang_stack_shadow_pages(bool native_call); - - void generate_all(); - void initialize_method_handle_entries(); - public: AbstractInterpreterGenerator(StubQueue* _code); }; diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.cpp b/hotspot/src/share/vm/interpreter/cppInterpreter.cpp index 318dbd9a74a..cbcfccbd759 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,12 +46,11 @@ void CppInterpreter::initialize() { int code_size = InterpreterCodeSize; NOT_PRODUCT(code_size *= 4;) // debug uses extra interpreter code space _code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL, - "Interpreter"); + "Interpreter"); CppInterpreterGenerator g(_code); if (PrintInterpreter) print(); } - // Allow c++ interpreter to do one initialization now that switches are set, etc. BytecodeInterpreter start_msg(BytecodeInterpreter::initialize); if (JvmtiExport::can_post_interpreter_events()) @@ -73,114 +72,10 @@ void CppInterpreter::invoke_osr(Method* method, } -CppInterpreterGenerator::CppInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { - generate_all(); -} - -static const BasicType types[Interpreter::number_of_result_handlers] = { - T_BOOLEAN, - T_CHAR , - T_BYTE , - T_SHORT , - T_INT , - T_LONG , - T_VOID , - T_FLOAT , - T_DOUBLE , - T_OBJECT -}; - -void CppInterpreterGenerator::generate_all() { - AbstractInterpreterGenerator::generate_all(); - - -#define method_entry(kind) Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind) - - { CodeletMark cm(_masm, "(kind = frame_manager)"); - // all non-native method kinds - method_entry(zerolocals); - method_entry(zerolocals_synchronized); - method_entry(empty); - method_entry(accessor); - method_entry(abstract); - method_entry(java_lang_math_sin ); - method_entry(java_lang_math_cos ); - method_entry(java_lang_math_tan ); - method_entry(java_lang_math_abs ); - method_entry(java_lang_math_sqrt ); - method_entry(java_lang_math_log ); - method_entry(java_lang_math_log10 ); - method_entry(java_lang_math_pow ); - method_entry(java_lang_math_exp ); - method_entry(java_lang_ref_reference_get); - - initialize_method_handle_entries(); - - Interpreter::_native_entry_begin = Interpreter::code()->code_end(); - method_entry(native); - method_entry(native_synchronized); - Interpreter::_native_entry_end = Interpreter::code()->code_end(); - } - - -#undef method_entry -} InterpreterCodelet* CppInterpreter::codelet_containing(address pc) { // FIXME: I'm pretty sure _code is null and this is never called, which is why it's copied. return (InterpreterCodelet*)_code->stub_containing(pc); } -// Generate method entries -address CppInterpreterGenerator::generate_method_entry( - AbstractInterpreter::MethodKind kind) { - // determine code generation flags - bool native = false; - bool synchronized = false; - address entry_point = NULL; - - switch (kind) { - case Interpreter::zerolocals : break; - case Interpreter::zerolocals_synchronized: synchronized = true; break; - case Interpreter::native : native = true; break; - case Interpreter::native_synchronized : native = true; synchronized = true; break; - case Interpreter::empty : entry_point = generate_empty_entry(); break; - case Interpreter::accessor : entry_point = generate_accessor_entry(); break; - case Interpreter::abstract : entry_point = generate_abstract_entry(); break; - - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : // fall thru - case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; - case Interpreter::java_lang_ref_reference_get - : entry_point = generate_Reference_get_entry(); break; - default: - fatal("unexpected method kind: %d", kind); - break; - } - - if (entry_point) { - return entry_point; - } - - // We expect the normal and native entry points to be generated first so we can reuse them. - if (native) { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); - if (entry_point == NULL) { - entry_point = generate_native_entry(synchronized); - } - } else { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); - if (entry_point == NULL) { - entry_point = generate_normal_entry(synchronized); - } - } - - return entry_point; -} #endif // CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.cpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.cpp new file mode 100644 index 00000000000..db808a9d477 --- /dev/null +++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.cpp @@ -0,0 +1,125 @@ +/* + * Copyright (c) 1997, 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 "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/cppInterpreterGenerator.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" + +#ifdef CC_INTERP + +CppInterpreterGenerator::CppInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { + generate_all(); +} + +void CppInterpreterGenerator::generate_all() { + { CodeletMark cm(_masm, "slow signature handler"); + AbstractInterpreter::_slow_signature_handler = generate_slow_signature_handler(); + } + +#define method_entry(kind) Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind) + + { CodeletMark cm(_masm, "(kind = frame_manager)"); + // all non-native method kinds + method_entry(zerolocals); + method_entry(zerolocals_synchronized); + method_entry(empty); + method_entry(accessor); + method_entry(abstract); + method_entry(java_lang_math_sin ); + method_entry(java_lang_math_cos ); + method_entry(java_lang_math_tan ); + method_entry(java_lang_math_abs ); + method_entry(java_lang_math_sqrt ); + method_entry(java_lang_math_log ); + method_entry(java_lang_math_log10 ); + method_entry(java_lang_math_pow ); + method_entry(java_lang_math_exp ); + method_entry(java_lang_ref_reference_get); + + AbstractInterpreter::initialize_method_handle_entries(); + + Interpreter::_native_entry_begin = Interpreter::code()->code_end(); + method_entry(native); + method_entry(native_synchronized); + Interpreter::_native_entry_end = Interpreter::code()->code_end(); + } + +#undef method_entry +} + +// Generate method entries +address CppInterpreterGenerator::generate_method_entry( + AbstractInterpreter::MethodKind kind) { + // determine code generation flags + bool native = false; + bool synchronized = false; + address entry_point = NULL; + + switch (kind) { + case Interpreter::zerolocals : break; + case Interpreter::zerolocals_synchronized: synchronized = true; break; + case Interpreter::native : native = true; break; + case Interpreter::native_synchronized : native = true; synchronized = true; break; + case Interpreter::empty : entry_point = generate_empty_entry(); break; + case Interpreter::accessor : entry_point = generate_accessor_entry(); break; + case Interpreter::abstract : entry_point = generate_abstract_entry(); break; + + case Interpreter::java_lang_math_sin : // fall thru + case Interpreter::java_lang_math_cos : // fall thru + case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_abs : // fall thru + case Interpreter::java_lang_math_log : // fall thru + case Interpreter::java_lang_math_log10 : // fall thru + case Interpreter::java_lang_math_sqrt : // fall thru + case Interpreter::java_lang_math_pow : // fall thru + case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; + case Interpreter::java_lang_ref_reference_get + : entry_point = generate_Reference_get_entry(); break; + default: + fatal("unexpected method kind: %d", kind); + break; + } + + if (entry_point) { + return entry_point; + } + + // We expect the normal and native entry points to be generated first so we can reuse them. + if (native) { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); + if (entry_point == NULL) { + entry_point = generate_native_entry(synchronized); + } + } else { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); + if (entry_point == NULL) { + entry_point = generate_normal_entry(synchronized); + } + } + + return entry_point; +} +#endif // CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp index 69072c7f50c..c9fbd30fff0 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,8 @@ class CppInterpreterGenerator: public AbstractInterpreterGenerator { private: void generate_all(); + address generate_slow_signature_handler(); + address generate_method_entry(AbstractInterpreter::MethodKind kind); address generate_normal_entry(bool synchronized); address generate_native_entry(bool synchronized); diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index 3101d3628f6..d23803eb7ba 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -111,40 +111,6 @@ CodeletMark::~CodeletMark() { *_masm = NULL; } -//------------------------------------------------------------------------------------------------------------------------ -// Implementation of platform independent aspects of Interpreter - -void AbstractInterpreter::initialize() { - if (_code != NULL) return; - - // make sure 'imported' classes are initialized - if (CountBytecodes || TraceBytecodes || StopInterpreterAt) BytecodeCounter::reset(); - if (PrintBytecodeHistogram) BytecodeHistogram::reset(); - if (PrintBytecodePairHistogram) BytecodePairHistogram::reset(); - - InvocationCounter::reinitialize(DelayCompilationDuringStartup); - -} - -void AbstractInterpreter::print() { - tty->cr(); - tty->print_cr("----------------------------------------------------------------------"); - tty->print_cr("Interpreter"); - tty->cr(); - tty->print_cr("code size = %6dK bytes", (int)_code->used_space()/1024); - tty->print_cr("total space = %6dK bytes", (int)_code->total_space()/1024); - tty->print_cr("wasted space = %6dK bytes", (int)_code->available_space()/1024); - tty->cr(); - tty->print_cr("# of codelets = %6d" , _code->number_of_stubs()); - if (_code->number_of_stubs() != 0) { - tty->print_cr("avg codelet size = %6d bytes", _code->used_space() / _code->number_of_stubs()); - tty->cr(); - } - _code->print(); - tty->print_cr("----------------------------------------------------------------------"); - tty->cr(); -} - void interpreter_init() { Interpreter::initialize(); @@ -166,384 +132,3 @@ void interpreter_init() { AbstractInterpreter::code()->code_end()); } } - -//------------------------------------------------------------------------------------------------------------------------ -// Implementation of interpreter - -StubQueue* AbstractInterpreter::_code = NULL; -bool AbstractInterpreter::_notice_safepoints = false; -address AbstractInterpreter::_rethrow_exception_entry = NULL; - -address AbstractInterpreter::_native_entry_begin = NULL; -address AbstractInterpreter::_native_entry_end = NULL; -address AbstractInterpreter::_slow_signature_handler; -address AbstractInterpreter::_entry_table [AbstractInterpreter::number_of_method_entries]; -address AbstractInterpreter::_native_abi_to_tosca [AbstractInterpreter::number_of_result_handlers]; - -//------------------------------------------------------------------------------------------------------------------------ -// Generation of complete interpreter - -AbstractInterpreterGenerator::AbstractInterpreterGenerator(StubQueue* _code) { - _masm = NULL; -} - - -static const BasicType types[Interpreter::number_of_result_handlers] = { - T_BOOLEAN, - T_CHAR , - T_BYTE , - T_SHORT , - T_INT , - T_LONG , - T_VOID , - T_FLOAT , - T_DOUBLE , - T_OBJECT -}; - -void AbstractInterpreterGenerator::generate_all() { - - - { CodeletMark cm(_masm, "slow signature handler"); - Interpreter::_slow_signature_handler = generate_slow_signature_handler(); - } - -} - -//------------------------------------------------------------------------------------------------------------------------ -// Entry points - -AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) { - // Abstract method? - if (m->is_abstract()) return abstract; - - // Method handle primitive? - if (m->is_method_handle_intrinsic()) { - vmIntrinsics::ID id = m->intrinsic_id(); - assert(MethodHandles::is_signature_polymorphic(id), "must match an intrinsic"); - MethodKind kind = (MethodKind)( method_handle_invoke_FIRST + - ((int)id - vmIntrinsics::FIRST_MH_SIG_POLY) ); - assert(kind <= method_handle_invoke_LAST, "parallel enum ranges"); - return kind; - } - -#ifndef CC_INTERP - if (UseCRC32Intrinsics && m->is_native()) { - // Use optimized stub code for CRC32 native methods. - switch (m->intrinsic_id()) { - case vmIntrinsics::_updateCRC32 : return java_util_zip_CRC32_update; - case vmIntrinsics::_updateBytesCRC32 : return java_util_zip_CRC32_updateBytes; - case vmIntrinsics::_updateByteBufferCRC32 : return java_util_zip_CRC32_updateByteBuffer; - } - } - if (UseCRC32CIntrinsics) { - // Use optimized stub code for CRC32C methods. - switch (m->intrinsic_id()) { - case vmIntrinsics::_updateBytesCRC32C : return java_util_zip_CRC32C_updateBytes; - case vmIntrinsics::_updateDirectByteBufferCRC32C : return java_util_zip_CRC32C_updateDirectByteBuffer; - } - } - - switch(m->intrinsic_id()) { - case vmIntrinsics::_intBitsToFloat: return java_lang_Float_intBitsToFloat; - case vmIntrinsics::_floatToRawIntBits: return java_lang_Float_floatToRawIntBits; - case vmIntrinsics::_longBitsToDouble: return java_lang_Double_longBitsToDouble; - case vmIntrinsics::_doubleToRawLongBits: return java_lang_Double_doubleToRawLongBits; - } - -#endif // CC_INTERP - - // Native method? - // Note: This test must come _before_ the test for intrinsic - // methods. See also comments below. - if (m->is_native()) { - assert(!m->is_method_handle_intrinsic(), "overlapping bits here, watch out"); - return m->is_synchronized() ? native_synchronized : native; - } - - // Synchronized? - if (m->is_synchronized()) { - return zerolocals_synchronized; - } - - if (RegisterFinalizersAtInit && m->code_size() == 1 && - m->intrinsic_id() == vmIntrinsics::_Object_init) { - // We need to execute the special return bytecode to check for - // finalizer registration so create a normal frame. - return zerolocals; - } - - // Empty method? - if (m->is_empty_method()) { - return empty; - } - - // Special intrinsic method? - // Note: This test must come _after_ the test for native methods, - // otherwise we will run into problems with JDK 1.2, see also - // TemplateInterpreterGenerator::generate_method_entry() for - // for details. - switch (m->intrinsic_id()) { - case vmIntrinsics::_dsin : return java_lang_math_sin ; - case vmIntrinsics::_dcos : return java_lang_math_cos ; - case vmIntrinsics::_dtan : return java_lang_math_tan ; - case vmIntrinsics::_dabs : return java_lang_math_abs ; - case vmIntrinsics::_dsqrt : return java_lang_math_sqrt ; - case vmIntrinsics::_dlog : return java_lang_math_log ; - case vmIntrinsics::_dlog10: return java_lang_math_log10; - case vmIntrinsics::_dpow : return java_lang_math_pow ; - case vmIntrinsics::_dexp : return java_lang_math_exp ; - - case vmIntrinsics::_Reference_get: - return java_lang_ref_reference_get; - } - - // Accessor method? - if (m->is_getter()) { - // TODO: We should have used ::is_accessor above, but fast accessors in Zero expect only getters. - // See CppInterpreter::accessor_entry in cppInterpreter_zero.cpp. This should be fixed in Zero, - // then the call above updated to ::is_accessor - assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1"); - return accessor; - } - - // Note: for now: zero locals for all non-empty methods - return zerolocals; -} - - -void AbstractInterpreter::set_entry_for_kind(AbstractInterpreter::MethodKind kind, address entry) { - assert(kind >= method_handle_invoke_FIRST && - kind <= method_handle_invoke_LAST, "late initialization only for MH entry points"); - assert(_entry_table[kind] == _entry_table[abstract], "previous value must be AME entry"); - _entry_table[kind] = entry; -} - - -// Return true if the interpreter can prove that the given bytecode has -// not yet been executed (in Java semantics, not in actual operation). -bool AbstractInterpreter::is_not_reached(const methodHandle& method, int bci) { - Bytecodes::Code code = method()->code_at(bci); - - if (!Bytecodes::must_rewrite(code)) { - // might have been reached - return false; - } - - // the bytecode might not be rewritten if the method is an accessor, etc. - address ientry = method->interpreter_entry(); - if (ientry != entry_for_kind(AbstractInterpreter::zerolocals) && - ientry != entry_for_kind(AbstractInterpreter::zerolocals_synchronized)) - return false; // interpreter does not run this method! - - // otherwise, we can be sure this bytecode has never been executed - return true; -} - - -#ifndef PRODUCT -void AbstractInterpreter::print_method_kind(MethodKind kind) { - switch (kind) { - case zerolocals : tty->print("zerolocals" ); break; - case zerolocals_synchronized: tty->print("zerolocals_synchronized"); break; - case native : tty->print("native" ); break; - case native_synchronized : tty->print("native_synchronized" ); break; - case empty : tty->print("empty" ); break; - case accessor : tty->print("accessor" ); break; - case abstract : tty->print("abstract" ); break; - case java_lang_math_sin : tty->print("java_lang_math_sin" ); break; - case java_lang_math_cos : tty->print("java_lang_math_cos" ); break; - case java_lang_math_tan : tty->print("java_lang_math_tan" ); break; - case java_lang_math_abs : tty->print("java_lang_math_abs" ); break; - case java_lang_math_sqrt : tty->print("java_lang_math_sqrt" ); break; - case java_lang_math_log : tty->print("java_lang_math_log" ); break; - case java_lang_math_log10 : tty->print("java_lang_math_log10" ); break; - case java_util_zip_CRC32_update : tty->print("java_util_zip_CRC32_update"); break; - case java_util_zip_CRC32_updateBytes : tty->print("java_util_zip_CRC32_updateBytes"); break; - case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break; - case java_util_zip_CRC32C_updateBytes : tty->print("java_util_zip_CRC32C_updateBytes"); break; - case java_util_zip_CRC32C_updateDirectByteBuffer: tty->print("java_util_zip_CRC32C_updateDirectByteByffer"); break; - default: - if (kind >= method_handle_invoke_FIRST && - kind <= method_handle_invoke_LAST) { - const char* kind_name = vmIntrinsics::name_at(method_handle_intrinsic(kind)); - if (kind_name[0] == '_') kind_name = &kind_name[1]; // '_invokeExact' => 'invokeExact' - tty->print("method_handle_%s", kind_name); - break; - } - ShouldNotReachHere(); - break; - } -} -#endif // PRODUCT - - -//------------------------------------------------------------------------------------------------------------------------ -// Deoptimization support - -/** - * If a deoptimization happens, this function returns the point of next bytecode to continue execution. - */ -address AbstractInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) { - assert(method->contains(bcp), "just checkin'"); - - // Get the original and rewritten bytecode. - Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); - assert(!Interpreter::bytecode_should_reexecute(code), "should not reexecute"); - - const int bci = method->bci_from(bcp); - - // compute continuation length - const int length = Bytecodes::length_at(method, bcp); - - // compute result type - BasicType type = T_ILLEGAL; - - switch (code) { - case Bytecodes::_invokevirtual : - case Bytecodes::_invokespecial : - case Bytecodes::_invokestatic : - case Bytecodes::_invokeinterface: { - Thread *thread = Thread::current(); - ResourceMark rm(thread); - methodHandle mh(thread, method); - type = Bytecode_invoke(mh, bci).result_type(); - // since the cache entry might not be initialized: - // (NOT needed for the old calling convension) - if (!is_top_frame) { - int index = Bytes::get_native_u2(bcp+1); - method->constants()->cache()->entry_at(index)->set_parameter_size(callee_parameters); - } - break; - } - - case Bytecodes::_invokedynamic: { - Thread *thread = Thread::current(); - ResourceMark rm(thread); - methodHandle mh(thread, method); - type = Bytecode_invoke(mh, bci).result_type(); - // since the cache entry might not be initialized: - // (NOT needed for the old calling convension) - if (!is_top_frame) { - int index = Bytes::get_native_u4(bcp+1); - method->constants()->invokedynamic_cp_cache_entry_at(index)->set_parameter_size(callee_parameters); - } - break; - } - - case Bytecodes::_ldc : - case Bytecodes::_ldc_w : // fall through - case Bytecodes::_ldc2_w: - { - Thread *thread = Thread::current(); - ResourceMark rm(thread); - methodHandle mh(thread, method); - type = Bytecode_loadconstant(mh, bci).result_type(); - break; - } - - default: - type = Bytecodes::result_type(code); - break; - } - - // return entry point for computed continuation state & bytecode length - return - is_top_frame - ? Interpreter::deopt_entry (as_TosState(type), length) - : Interpreter::return_entry(as_TosState(type), length, code); -} - -// If deoptimization happens, this function returns the point where the interpreter reexecutes -// the bytecode. -// Note: Bytecodes::_athrow is a special case in that it does not return -// Interpreter::deopt_entry(vtos, 0) like others -address AbstractInterpreter::deopt_reexecute_entry(Method* method, address bcp) { - assert(method->contains(bcp), "just checkin'"); - Bytecodes::Code code = Bytecodes::java_code_at(method, bcp); -#if defined(COMPILER1) || INCLUDE_JVMCI - if(code == Bytecodes::_athrow ) { - return Interpreter::rethrow_exception_entry(); - } -#endif /* COMPILER1 || INCLUDE_JVMCI */ - return Interpreter::deopt_entry(vtos, 0); -} - -// If deoptimization happens, the interpreter should reexecute these bytecodes. -// This function mainly helps the compilers to set up the reexecute bit. -bool AbstractInterpreter::bytecode_should_reexecute(Bytecodes::Code code) { - switch (code) { - case Bytecodes::_lookupswitch: - case Bytecodes::_tableswitch: - case Bytecodes::_fast_binaryswitch: - case Bytecodes::_fast_linearswitch: - // recompute condtional expression folded into _if - case Bytecodes::_lcmp : - case Bytecodes::_fcmpl : - case Bytecodes::_fcmpg : - case Bytecodes::_dcmpl : - case Bytecodes::_dcmpg : - case Bytecodes::_ifnull : - case Bytecodes::_ifnonnull : - case Bytecodes::_goto : - case Bytecodes::_goto_w : - case Bytecodes::_ifeq : - case Bytecodes::_ifne : - case Bytecodes::_iflt : - case Bytecodes::_ifge : - case Bytecodes::_ifgt : - case Bytecodes::_ifle : - case Bytecodes::_if_icmpeq : - case Bytecodes::_if_icmpne : - case Bytecodes::_if_icmplt : - case Bytecodes::_if_icmpge : - case Bytecodes::_if_icmpgt : - case Bytecodes::_if_icmple : - case Bytecodes::_if_acmpeq : - case Bytecodes::_if_acmpne : - // special cases - case Bytecodes::_getfield : - case Bytecodes::_putfield : - case Bytecodes::_getstatic : - case Bytecodes::_putstatic : - case Bytecodes::_aastore : -#ifdef COMPILER1 - //special case of reexecution - case Bytecodes::_athrow : -#endif - return true; - - default: - return false; - } -} - -void AbstractInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { - // Quick & dirty stack overflow checking: bang the stack & handle trap. - // Note that we do the banging after the frame is setup, since the exception - // handling code expects to find a valid interpreter frame on the stack. - // Doing the banging earlier fails if the caller frame is not an interpreter - // frame. - // (Also, the exception throwing code expects to unlock any synchronized - // method receiever, so do the banging after locking the receiver.) - - // Bang each page in the shadow zone. We can't assume it's been done for - // an interpreter frame with greater than a page of locals, so each page - // needs to be checked. Only true for non-native. - if (UseStackBanging) { - const int page_size = os::vm_page_size(); - const int n_shadow_pages = ((int)JavaThread::stack_shadow_zone_size()) / page_size; - const int start_page = native_call ? n_shadow_pages : 1; - for (int pages = start_page; pages <= n_shadow_pages; pages++) { - __ bang_stack_with_offset(pages*page_size); - } - } -} - -void AbstractInterpreterGenerator::initialize_method_handle_entries() { - // method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate: - for (int i = Interpreter::method_handle_invoke_FIRST; i <= Interpreter::method_handle_invoke_LAST; i++) { - Interpreter::MethodKind kind = (Interpreter::MethodKind) i; - Interpreter::_entry_table[kind] = Interpreter::_entry_table[Interpreter::abstract]; - } -} diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 96e8faeafa8..c68f6858da6 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,6 +30,7 @@ #include "interpreter/templateInterpreter.hpp" #include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" +#include "memory/resourceArea.hpp" #ifndef CC_INTERP @@ -219,376 +220,6 @@ DispatchTable TemplateInterpreter::_normal_table; DispatchTable TemplateInterpreter::_safept_table; address TemplateInterpreter::_wentry_point[DispatchTable::length]; -TemplateInterpreterGenerator::TemplateInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { - _unimplemented_bytecode = NULL; - _illegal_bytecode_sequence = NULL; - generate_all(); -} - -static const BasicType types[Interpreter::number_of_result_handlers] = { - T_BOOLEAN, - T_CHAR , - T_BYTE , - T_SHORT , - T_INT , - T_LONG , - T_VOID , - T_FLOAT , - T_DOUBLE , - T_OBJECT -}; - -void TemplateInterpreterGenerator::generate_all() { - // Loop, in case we need several variants of the interpreter entries - do { - if (!CodeCacheExtensions::skip_code_generation()) { - // bypass code generation when useless - AbstractInterpreterGenerator::generate_all(); - - { CodeletMark cm(_masm, "error exits"); - _unimplemented_bytecode = generate_error_exit("unimplemented bytecode"); - _illegal_bytecode_sequence = generate_error_exit("illegal bytecode sequence - method not verified"); - } - -#ifndef PRODUCT - if (TraceBytecodes) { - CodeletMark cm(_masm, "bytecode tracing support"); - Interpreter::_trace_code = - EntryPoint( - generate_trace_code(btos), - generate_trace_code(ctos), - generate_trace_code(stos), - generate_trace_code(atos), - generate_trace_code(itos), - generate_trace_code(ltos), - generate_trace_code(ftos), - generate_trace_code(dtos), - generate_trace_code(vtos) - ); - } -#endif // !PRODUCT - - { CodeletMark cm(_masm, "return entry points"); - const int index_size = sizeof(u2); - for (int i = 0; i < Interpreter::number_of_return_entries; i++) { - Interpreter::_return_entry[i] = - EntryPoint( - generate_return_entry_for(itos, i, index_size), - generate_return_entry_for(itos, i, index_size), - generate_return_entry_for(itos, i, index_size), - generate_return_entry_for(atos, i, index_size), - generate_return_entry_for(itos, i, index_size), - generate_return_entry_for(ltos, i, index_size), - generate_return_entry_for(ftos, i, index_size), - generate_return_entry_for(dtos, i, index_size), - generate_return_entry_for(vtos, i, index_size) - ); - } - } - - { CodeletMark cm(_masm, "invoke return entry points"); - const TosState states[] = {itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos}; - const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic); - const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface); - const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic); - - for (int i = 0; i < Interpreter::number_of_return_addrs; i++) { - TosState state = states[i]; - Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2)); - Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2)); - Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4)); - } - } - - { CodeletMark cm(_masm, "earlyret entry points"); - Interpreter::_earlyret_entry = - EntryPoint( - generate_earlyret_entry_for(btos), - generate_earlyret_entry_for(ctos), - generate_earlyret_entry_for(stos), - generate_earlyret_entry_for(atos), - generate_earlyret_entry_for(itos), - generate_earlyret_entry_for(ltos), - generate_earlyret_entry_for(ftos), - generate_earlyret_entry_for(dtos), - generate_earlyret_entry_for(vtos) - ); - } - - { CodeletMark cm(_masm, "deoptimization entry points"); - for (int i = 0; i < Interpreter::number_of_deopt_entries; i++) { - Interpreter::_deopt_entry[i] = - EntryPoint( - generate_deopt_entry_for(itos, i), - generate_deopt_entry_for(itos, i), - generate_deopt_entry_for(itos, i), - generate_deopt_entry_for(atos, i), - generate_deopt_entry_for(itos, i), - generate_deopt_entry_for(ltos, i), - generate_deopt_entry_for(ftos, i), - generate_deopt_entry_for(dtos, i), - generate_deopt_entry_for(vtos, i) - ); - } - } - - { CodeletMark cm(_masm, "result handlers for native calls"); - // The various result converter stublets. - int is_generated[Interpreter::number_of_result_handlers]; - memset(is_generated, 0, sizeof(is_generated)); - - for (int i = 0; i < Interpreter::number_of_result_handlers; i++) { - BasicType type = types[i]; - if (!is_generated[Interpreter::BasicType_as_index(type)]++) { - Interpreter::_native_abi_to_tosca[Interpreter::BasicType_as_index(type)] = generate_result_handler_for(type); - } - } - } - - { CodeletMark cm(_masm, "continuation entry points"); - Interpreter::_continuation_entry = - EntryPoint( - generate_continuation_for(btos), - generate_continuation_for(ctos), - generate_continuation_for(stos), - generate_continuation_for(atos), - generate_continuation_for(itos), - generate_continuation_for(ltos), - generate_continuation_for(ftos), - generate_continuation_for(dtos), - generate_continuation_for(vtos) - ); - } - - { CodeletMark cm(_masm, "safepoint entry points"); - Interpreter::_safept_entry = - EntryPoint( - generate_safept_entry_for(btos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(ctos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(stos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(atos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(itos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(ltos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(ftos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(dtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), - generate_safept_entry_for(vtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)) - ); - } - - { CodeletMark cm(_masm, "exception handling"); - // (Note: this is not safepoint safe because thread may return to compiled code) - generate_throw_exception(); - } - - { CodeletMark cm(_masm, "throw exception entrypoints"); - Interpreter::_throw_ArrayIndexOutOfBoundsException_entry = generate_ArrayIndexOutOfBounds_handler("java/lang/ArrayIndexOutOfBoundsException"); - Interpreter::_throw_ArrayStoreException_entry = generate_klass_exception_handler("java/lang/ArrayStoreException" ); - Interpreter::_throw_ArithmeticException_entry = generate_exception_handler("java/lang/ArithmeticException" , "/ by zero"); - Interpreter::_throw_ClassCastException_entry = generate_ClassCastException_handler(); - Interpreter::_throw_NullPointerException_entry = generate_exception_handler("java/lang/NullPointerException" , NULL ); - Interpreter::_throw_StackOverflowError_entry = generate_StackOverflowError_handler(); - } - - - -#define method_entry(kind) \ - { CodeletMark cm(_masm, "method entry point (kind = " #kind ")"); \ - Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind); \ - } - - // all non-native method kinds - method_entry(zerolocals) - method_entry(zerolocals_synchronized) - method_entry(empty) - method_entry(accessor) - method_entry(abstract) - method_entry(java_lang_math_sin ) - method_entry(java_lang_math_cos ) - method_entry(java_lang_math_tan ) - method_entry(java_lang_math_abs ) - method_entry(java_lang_math_sqrt ) - method_entry(java_lang_math_log ) - method_entry(java_lang_math_log10) - method_entry(java_lang_math_exp ) - method_entry(java_lang_math_pow ) - method_entry(java_lang_ref_reference_get) - - initialize_method_handle_entries(); - - // all native method kinds (must be one contiguous block) - Interpreter::_native_entry_begin = Interpreter::code()->code_end(); - method_entry(native) - method_entry(native_synchronized) - Interpreter::_native_entry_end = Interpreter::code()->code_end(); - - if (UseCRC32Intrinsics) { - method_entry(java_util_zip_CRC32_update) - method_entry(java_util_zip_CRC32_updateBytes) - method_entry(java_util_zip_CRC32_updateByteBuffer) - } - - if (UseCRC32CIntrinsics) { - method_entry(java_util_zip_CRC32C_updateBytes) - method_entry(java_util_zip_CRC32C_updateDirectByteBuffer) - } - - method_entry(java_lang_Float_intBitsToFloat); - method_entry(java_lang_Float_floatToRawIntBits); - method_entry(java_lang_Double_longBitsToDouble); - method_entry(java_lang_Double_doubleToRawLongBits); - -#undef method_entry - - // Bytecodes - set_entry_points_for_all_bytes(); - } - } while (CodeCacheExtensions::needs_other_interpreter_variant()); - - // installation of code in other places in the runtime - // (ExcutableCodeManager calls not needed to copy the entries) - set_safepoints_for_all_bytes(); -} - -//------------------------------------------------------------------------------------------------------------------------ - -address TemplateInterpreterGenerator::generate_error_exit(const char* msg) { - address entry = __ pc(); - __ stop(msg); - return entry; -} - - -//------------------------------------------------------------------------------------------------------------------------ - -void TemplateInterpreterGenerator::set_entry_points_for_all_bytes() { - for (int i = 0; i < DispatchTable::length; i++) { - Bytecodes::Code code = (Bytecodes::Code)i; - if (Bytecodes::is_defined(code)) { - set_entry_points(code); - } else { - set_unimplemented(i); - } - } -} - - -void TemplateInterpreterGenerator::set_safepoints_for_all_bytes() { - for (int i = 0; i < DispatchTable::length; i++) { - Bytecodes::Code code = (Bytecodes::Code)i; - if (Bytecodes::is_defined(code)) Interpreter::_safept_table.set_entry(code, Interpreter::_safept_entry); - } -} - - -void TemplateInterpreterGenerator::set_unimplemented(int i) { - address e = _unimplemented_bytecode; - EntryPoint entry(e, e, e, e, e, e, e, e, e); - Interpreter::_normal_table.set_entry(i, entry); - Interpreter::_wentry_point[i] = _unimplemented_bytecode; -} - - -void TemplateInterpreterGenerator::set_entry_points(Bytecodes::Code code) { - if (CodeCacheExtensions::skip_template_interpreter_entries(code)) { - return; - } - CodeletMark cm(_masm, Bytecodes::name(code), code); - // initialize entry points - assert(_unimplemented_bytecode != NULL, "should have been generated before"); - assert(_illegal_bytecode_sequence != NULL, "should have been generated before"); - address bep = _illegal_bytecode_sequence; - address cep = _illegal_bytecode_sequence; - address sep = _illegal_bytecode_sequence; - address aep = _illegal_bytecode_sequence; - address iep = _illegal_bytecode_sequence; - address lep = _illegal_bytecode_sequence; - address fep = _illegal_bytecode_sequence; - address dep = _illegal_bytecode_sequence; - address vep = _unimplemented_bytecode; - address wep = _unimplemented_bytecode; - // code for short & wide version of bytecode - if (Bytecodes::is_defined(code)) { - Template* t = TemplateTable::template_for(code); - assert(t->is_valid(), "just checking"); - set_short_entry_points(t, bep, cep, sep, aep, iep, lep, fep, dep, vep); - } - if (Bytecodes::wide_is_defined(code)) { - Template* t = TemplateTable::template_for_wide(code); - assert(t->is_valid(), "just checking"); - set_wide_entry_point(t, wep); - } - // set entry points - EntryPoint entry(bep, cep, sep, aep, iep, lep, fep, dep, vep); - Interpreter::_normal_table.set_entry(code, entry); - Interpreter::_wentry_point[code] = wep; - CodeCacheExtensions::completed_template_interpreter_entries(_masm, code); -} - - -void TemplateInterpreterGenerator::set_wide_entry_point(Template* t, address& wep) { - assert(t->is_valid(), "template must exist"); - assert(t->tos_in() == vtos, "only vtos tos_in supported for wide instructions"); - wep = __ pc(); generate_and_dispatch(t); -} - - -void TemplateInterpreterGenerator::set_short_entry_points(Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep) { - assert(t->is_valid(), "template must exist"); - switch (t->tos_in()) { - case btos: - case ctos: - case stos: - ShouldNotReachHere(); // btos/ctos/stos should use itos. - break; - case atos: vep = __ pc(); __ pop(atos); aep = __ pc(); generate_and_dispatch(t); break; - case itos: vep = __ pc(); __ pop(itos); iep = __ pc(); generate_and_dispatch(t); break; - case ltos: vep = __ pc(); __ pop(ltos); lep = __ pc(); generate_and_dispatch(t); break; - case ftos: vep = __ pc(); __ pop(ftos); fep = __ pc(); generate_and_dispatch(t); break; - case dtos: vep = __ pc(); __ pop(dtos); dep = __ pc(); generate_and_dispatch(t); break; - case vtos: set_vtos_entry_points(t, bep, cep, sep, aep, iep, lep, fep, dep, vep); break; - default : ShouldNotReachHere(); break; - } -} - - -//------------------------------------------------------------------------------------------------------------------------ - -void TemplateInterpreterGenerator::generate_and_dispatch(Template* t, TosState tos_out) { - if (PrintBytecodeHistogram) histogram_bytecode(t); -#ifndef PRODUCT - // debugging code - if (CountBytecodes || TraceBytecodes || StopInterpreterAt > 0) count_bytecode(); - if (PrintBytecodePairHistogram) histogram_bytecode_pair(t); - if (TraceBytecodes) trace_bytecode(t); - if (StopInterpreterAt > 0) stop_interpreter_at(); - __ verify_FPU(1, t->tos_in()); -#endif // !PRODUCT - int step = 0; - if (!t->does_dispatch()) { - step = t->is_wide() ? Bytecodes::wide_length_for(t->bytecode()) : Bytecodes::length_for(t->bytecode()); - if (tos_out == ilgl) tos_out = t->tos_out(); - // compute bytecode size - assert(step > 0, "just checkin'"); - // setup stuff for dispatching next bytecode - if (ProfileInterpreter && VerifyDataPointer - && MethodData::bytecode_has_profile(t->bytecode())) { - __ verify_method_data_pointer(); - } - __ dispatch_prolog(tos_out, step); - } - // generate template - t->generate(_masm); - // advance - if (t->does_dispatch()) { -#ifdef ASSERT - // make sure execution doesn't go beyond this point if code is broken - __ should_not_reach_here(); -#endif // ASSERT - } else { - // dispatch to next bytecode - __ dispatch_epilog(tos_out, step); - } -} //------------------------------------------------------------------------------------------------------------------------ // Entry points @@ -724,85 +355,4 @@ InterpreterCodelet* TemplateInterpreter::codelet_containing(address pc) { return (InterpreterCodelet*)_code->stub_containing(pc); } -// Generate method entries -address TemplateInterpreterGenerator::generate_method_entry( - AbstractInterpreter::MethodKind kind) { - // determine code generation flags - bool native = false; - bool synchronized = false; - address entry_point = NULL; - - switch (kind) { - case Interpreter::zerolocals : break; - case Interpreter::zerolocals_synchronized: synchronized = true; break; - case Interpreter::native : native = true; break; - case Interpreter::native_synchronized : native = true; synchronized = true; break; - case Interpreter::empty : break; - case Interpreter::accessor : break; - case Interpreter::abstract : entry_point = generate_abstract_entry(); break; - - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : // fall thru - case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; - case Interpreter::java_lang_ref_reference_get - : entry_point = generate_Reference_get_entry(); break; - case Interpreter::java_util_zip_CRC32_update - : native = true; entry_point = generate_CRC32_update_entry(); break; - case Interpreter::java_util_zip_CRC32_updateBytes - : // fall thru - case Interpreter::java_util_zip_CRC32_updateByteBuffer - : native = true; entry_point = generate_CRC32_updateBytes_entry(kind); break; - case Interpreter::java_util_zip_CRC32C_updateBytes - : // fall thru - case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer - : entry_point = generate_CRC32C_updateBytes_entry(kind); break; -#ifdef IA32 - // On x86_32 platforms, a special entry is generated for the following four methods. - // On other platforms the normal entry is used to enter these methods. - case Interpreter::java_lang_Float_intBitsToFloat - : native = true; entry_point = generate_Float_intBitsToFloat_entry(); break; - case Interpreter::java_lang_Float_floatToRawIntBits - : native = true; entry_point = generate_Float_floatToRawIntBits_entry(); break; - case Interpreter::java_lang_Double_longBitsToDouble - : native = true; entry_point = generate_Double_longBitsToDouble_entry(); break; - case Interpreter::java_lang_Double_doubleToRawLongBits - : native = true; entry_point = generate_Double_doubleToRawLongBits_entry(); break; -#else - case Interpreter::java_lang_Float_intBitsToFloat: - case Interpreter::java_lang_Float_floatToRawIntBits: - case Interpreter::java_lang_Double_longBitsToDouble: - case Interpreter::java_lang_Double_doubleToRawLongBits: - native = true; - break; -#endif // defined(TARGET_ARCH_x86) && !defined(_LP64) - default: - fatal("unexpected method kind: %d", kind); - break; - } - - if (entry_point) { - return entry_point; - } - - // We expect the normal and native entry points to be generated first so we can reuse them. - if (native) { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); - if (entry_point == NULL) { - entry_point = generate_native_entry(synchronized); - } - } else { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); - if (entry_point == NULL) { - entry_point = generate_normal_entry(synchronized); - } - } - - return entry_point; -} #endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 8a5f4910283..1955cae20cb 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -193,13 +193,6 @@ class TemplateInterpreter: public AbstractInterpreter { // Size of interpreter code. Max size with JVMTI static int InterpreterCodeSize; - -#ifdef PPC - public: - // PPC-only: Support abs and sqrt like in compiler. - // For others we can use a normal (native) entry. - static bool math_entry_available(AbstractInterpreter::MethodKind kind); -#endif }; #endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp new file mode 100644 index 00000000000..0fbe6f8ddac --- /dev/null +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.cpp @@ -0,0 +1,492 @@ +/* + * Copyright (c) 1997, 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 "code/codeCacheExtensions.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreter.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" +#include "interpreter/templateTable.hpp" + +#ifndef CC_INTERP + +# define __ _masm-> + +TemplateInterpreterGenerator::TemplateInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { + _unimplemented_bytecode = NULL; + _illegal_bytecode_sequence = NULL; + generate_all(); +} + +static const BasicType types[Interpreter::number_of_result_handlers] = { + T_BOOLEAN, + T_CHAR , + T_BYTE , + T_SHORT , + T_INT , + T_LONG , + T_VOID , + T_FLOAT , + T_DOUBLE , + T_OBJECT +}; + +void TemplateInterpreterGenerator::generate_all() { + // Loop, in case we need several variants of the interpreter entries + do { + if (!CodeCacheExtensions::skip_code_generation()) { + // bypass code generation when useless + { CodeletMark cm(_masm, "slow signature handler"); + AbstractInterpreter::_slow_signature_handler = generate_slow_signature_handler(); + } + + { CodeletMark cm(_masm, "error exits"); + _unimplemented_bytecode = generate_error_exit("unimplemented bytecode"); + _illegal_bytecode_sequence = generate_error_exit("illegal bytecode sequence - method not verified"); + } + +#ifndef PRODUCT + if (TraceBytecodes) { + CodeletMark cm(_masm, "bytecode tracing support"); + Interpreter::_trace_code = + EntryPoint( + generate_trace_code(btos), + generate_trace_code(ctos), + generate_trace_code(stos), + generate_trace_code(atos), + generate_trace_code(itos), + generate_trace_code(ltos), + generate_trace_code(ftos), + generate_trace_code(dtos), + generate_trace_code(vtos) + ); + } +#endif // !PRODUCT + + { CodeletMark cm(_masm, "return entry points"); + const int index_size = sizeof(u2); + for (int i = 0; i < Interpreter::number_of_return_entries; i++) { + Interpreter::_return_entry[i] = + EntryPoint( + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(atos, i, index_size), + generate_return_entry_for(itos, i, index_size), + generate_return_entry_for(ltos, i, index_size), + generate_return_entry_for(ftos, i, index_size), + generate_return_entry_for(dtos, i, index_size), + generate_return_entry_for(vtos, i, index_size) + ); + } + } + + { CodeletMark cm(_masm, "invoke return entry points"); + const TosState states[] = {itos, itos, itos, itos, ltos, ftos, dtos, atos, vtos}; + const int invoke_length = Bytecodes::length_for(Bytecodes::_invokestatic); + const int invokeinterface_length = Bytecodes::length_for(Bytecodes::_invokeinterface); + const int invokedynamic_length = Bytecodes::length_for(Bytecodes::_invokedynamic); + + for (int i = 0; i < Interpreter::number_of_return_addrs; i++) { + TosState state = states[i]; + Interpreter::_invoke_return_entry[i] = generate_return_entry_for(state, invoke_length, sizeof(u2)); + Interpreter::_invokeinterface_return_entry[i] = generate_return_entry_for(state, invokeinterface_length, sizeof(u2)); + Interpreter::_invokedynamic_return_entry[i] = generate_return_entry_for(state, invokedynamic_length, sizeof(u4)); + } + } + + { CodeletMark cm(_masm, "earlyret entry points"); + Interpreter::_earlyret_entry = + EntryPoint( + generate_earlyret_entry_for(btos), + generate_earlyret_entry_for(ctos), + generate_earlyret_entry_for(stos), + generate_earlyret_entry_for(atos), + generate_earlyret_entry_for(itos), + generate_earlyret_entry_for(ltos), + generate_earlyret_entry_for(ftos), + generate_earlyret_entry_for(dtos), + generate_earlyret_entry_for(vtos) + ); + } + + { CodeletMark cm(_masm, "deoptimization entry points"); + for (int i = 0; i < Interpreter::number_of_deopt_entries; i++) { + Interpreter::_deopt_entry[i] = + EntryPoint( + generate_deopt_entry_for(itos, i), + generate_deopt_entry_for(itos, i), + generate_deopt_entry_for(itos, i), + generate_deopt_entry_for(atos, i), + generate_deopt_entry_for(itos, i), + generate_deopt_entry_for(ltos, i), + generate_deopt_entry_for(ftos, i), + generate_deopt_entry_for(dtos, i), + generate_deopt_entry_for(vtos, i) + ); + } + } + + { CodeletMark cm(_masm, "result handlers for native calls"); + // The various result converter stublets. + int is_generated[Interpreter::number_of_result_handlers]; + memset(is_generated, 0, sizeof(is_generated)); + + for (int i = 0; i < Interpreter::number_of_result_handlers; i++) { + BasicType type = types[i]; + if (!is_generated[Interpreter::BasicType_as_index(type)]++) { + Interpreter::_native_abi_to_tosca[Interpreter::BasicType_as_index(type)] = generate_result_handler_for(type); + } + } + } + + { CodeletMark cm(_masm, "continuation entry points"); + Interpreter::_continuation_entry = + EntryPoint( + generate_continuation_for(btos), + generate_continuation_for(ctos), + generate_continuation_for(stos), + generate_continuation_for(atos), + generate_continuation_for(itos), + generate_continuation_for(ltos), + generate_continuation_for(ftos), + generate_continuation_for(dtos), + generate_continuation_for(vtos) + ); + } + + { CodeletMark cm(_masm, "safepoint entry points"); + Interpreter::_safept_entry = + EntryPoint( + generate_safept_entry_for(btos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(ctos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(stos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(atos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(itos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(ltos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(ftos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(dtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)), + generate_safept_entry_for(vtos, CAST_FROM_FN_PTR(address, InterpreterRuntime::at_safepoint)) + ); + } + + { CodeletMark cm(_masm, "exception handling"); + // (Note: this is not safepoint safe because thread may return to compiled code) + generate_throw_exception(); + } + + { CodeletMark cm(_masm, "throw exception entrypoints"); + Interpreter::_throw_ArrayIndexOutOfBoundsException_entry = generate_ArrayIndexOutOfBounds_handler("java/lang/ArrayIndexOutOfBoundsException"); + Interpreter::_throw_ArrayStoreException_entry = generate_klass_exception_handler("java/lang/ArrayStoreException" ); + Interpreter::_throw_ArithmeticException_entry = generate_exception_handler("java/lang/ArithmeticException" , "/ by zero"); + Interpreter::_throw_ClassCastException_entry = generate_ClassCastException_handler(); + Interpreter::_throw_NullPointerException_entry = generate_exception_handler("java/lang/NullPointerException" , NULL ); + Interpreter::_throw_StackOverflowError_entry = generate_StackOverflowError_handler(); + } + + + +#define method_entry(kind) \ + { CodeletMark cm(_masm, "method entry point (kind = " #kind ")"); \ + Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind); \ + } + + // all non-native method kinds + method_entry(zerolocals) + method_entry(zerolocals_synchronized) + method_entry(empty) + method_entry(accessor) + method_entry(abstract) + method_entry(java_lang_math_sin ) + method_entry(java_lang_math_cos ) + method_entry(java_lang_math_tan ) + method_entry(java_lang_math_abs ) + method_entry(java_lang_math_sqrt ) + method_entry(java_lang_math_log ) + method_entry(java_lang_math_log10) + method_entry(java_lang_math_exp ) + method_entry(java_lang_math_pow ) + method_entry(java_lang_ref_reference_get) + + AbstractInterpreter::initialize_method_handle_entries(); + + // all native method kinds (must be one contiguous block) + Interpreter::_native_entry_begin = Interpreter::code()->code_end(); + method_entry(native) + method_entry(native_synchronized) + Interpreter::_native_entry_end = Interpreter::code()->code_end(); + + if (UseCRC32Intrinsics) { + method_entry(java_util_zip_CRC32_update) + method_entry(java_util_zip_CRC32_updateBytes) + method_entry(java_util_zip_CRC32_updateByteBuffer) + } + + if (UseCRC32CIntrinsics) { + method_entry(java_util_zip_CRC32C_updateBytes) + method_entry(java_util_zip_CRC32C_updateDirectByteBuffer) + } + + method_entry(java_lang_Float_intBitsToFloat); + method_entry(java_lang_Float_floatToRawIntBits); + method_entry(java_lang_Double_longBitsToDouble); + method_entry(java_lang_Double_doubleToRawLongBits); + +#undef method_entry + + // Bytecodes + set_entry_points_for_all_bytes(); + } + } while (CodeCacheExtensions::needs_other_interpreter_variant()); + + // installation of code in other places in the runtime + // (ExcutableCodeManager calls not needed to copy the entries) + set_safepoints_for_all_bytes(); +} + +//------------------------------------------------------------------------------------------------------------------------ + +address TemplateInterpreterGenerator::generate_error_exit(const char* msg) { + address entry = __ pc(); + __ stop(msg); + return entry; +} + + +//------------------------------------------------------------------------------------------------------------------------ + +void TemplateInterpreterGenerator::set_entry_points_for_all_bytes() { + for (int i = 0; i < DispatchTable::length; i++) { + Bytecodes::Code code = (Bytecodes::Code)i; + if (Bytecodes::is_defined(code)) { + set_entry_points(code); + } else { + set_unimplemented(i); + } + } +} + + +void TemplateInterpreterGenerator::set_safepoints_for_all_bytes() { + for (int i = 0; i < DispatchTable::length; i++) { + Bytecodes::Code code = (Bytecodes::Code)i; + if (Bytecodes::is_defined(code)) Interpreter::_safept_table.set_entry(code, Interpreter::_safept_entry); + } +} + + +void TemplateInterpreterGenerator::set_unimplemented(int i) { + address e = _unimplemented_bytecode; + EntryPoint entry(e, e, e, e, e, e, e, e, e); + Interpreter::_normal_table.set_entry(i, entry); + Interpreter::_wentry_point[i] = _unimplemented_bytecode; +} + + +void TemplateInterpreterGenerator::set_entry_points(Bytecodes::Code code) { + if (CodeCacheExtensions::skip_template_interpreter_entries(code)) { + return; + } + CodeletMark cm(_masm, Bytecodes::name(code), code); + // initialize entry points + assert(_unimplemented_bytecode != NULL, "should have been generated before"); + assert(_illegal_bytecode_sequence != NULL, "should have been generated before"); + address bep = _illegal_bytecode_sequence; + address cep = _illegal_bytecode_sequence; + address sep = _illegal_bytecode_sequence; + address aep = _illegal_bytecode_sequence; + address iep = _illegal_bytecode_sequence; + address lep = _illegal_bytecode_sequence; + address fep = _illegal_bytecode_sequence; + address dep = _illegal_bytecode_sequence; + address vep = _unimplemented_bytecode; + address wep = _unimplemented_bytecode; + // code for short & wide version of bytecode + if (Bytecodes::is_defined(code)) { + Template* t = TemplateTable::template_for(code); + assert(t->is_valid(), "just checking"); + set_short_entry_points(t, bep, cep, sep, aep, iep, lep, fep, dep, vep); + } + if (Bytecodes::wide_is_defined(code)) { + Template* t = TemplateTable::template_for_wide(code); + assert(t->is_valid(), "just checking"); + set_wide_entry_point(t, wep); + } + // set entry points + EntryPoint entry(bep, cep, sep, aep, iep, lep, fep, dep, vep); + Interpreter::_normal_table.set_entry(code, entry); + Interpreter::_wentry_point[code] = wep; + CodeCacheExtensions::completed_template_interpreter_entries(_masm, code); +} + + +void TemplateInterpreterGenerator::set_wide_entry_point(Template* t, address& wep) { + assert(t->is_valid(), "template must exist"); + assert(t->tos_in() == vtos, "only vtos tos_in supported for wide instructions"); + wep = __ pc(); generate_and_dispatch(t); +} + + +void TemplateInterpreterGenerator::set_short_entry_points(Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep) { + assert(t->is_valid(), "template must exist"); + switch (t->tos_in()) { + case btos: + case ctos: + case stos: + ShouldNotReachHere(); // btos/ctos/stos should use itos. + break; + case atos: vep = __ pc(); __ pop(atos); aep = __ pc(); generate_and_dispatch(t); break; + case itos: vep = __ pc(); __ pop(itos); iep = __ pc(); generate_and_dispatch(t); break; + case ltos: vep = __ pc(); __ pop(ltos); lep = __ pc(); generate_and_dispatch(t); break; + case ftos: vep = __ pc(); __ pop(ftos); fep = __ pc(); generate_and_dispatch(t); break; + case dtos: vep = __ pc(); __ pop(dtos); dep = __ pc(); generate_and_dispatch(t); break; + case vtos: set_vtos_entry_points(t, bep, cep, sep, aep, iep, lep, fep, dep, vep); break; + default : ShouldNotReachHere(); break; + } +} + + +//------------------------------------------------------------------------------------------------------------------------ + +void TemplateInterpreterGenerator::generate_and_dispatch(Template* t, TosState tos_out) { + if (PrintBytecodeHistogram) histogram_bytecode(t); +#ifndef PRODUCT + // debugging code + if (CountBytecodes || TraceBytecodes || StopInterpreterAt > 0) count_bytecode(); + if (PrintBytecodePairHistogram) histogram_bytecode_pair(t); + if (TraceBytecodes) trace_bytecode(t); + if (StopInterpreterAt > 0) stop_interpreter_at(); + __ verify_FPU(1, t->tos_in()); +#endif // !PRODUCT + int step = 0; + if (!t->does_dispatch()) { + step = t->is_wide() ? Bytecodes::wide_length_for(t->bytecode()) : Bytecodes::length_for(t->bytecode()); + if (tos_out == ilgl) tos_out = t->tos_out(); + // compute bytecode size + assert(step > 0, "just checkin'"); + // setup stuff for dispatching next bytecode + if (ProfileInterpreter && VerifyDataPointer + && MethodData::bytecode_has_profile(t->bytecode())) { + __ verify_method_data_pointer(); + } + __ dispatch_prolog(tos_out, step); + } + // generate template + t->generate(_masm); + // advance + if (t->does_dispatch()) { +#ifdef ASSERT + // make sure execution doesn't go beyond this point if code is broken + __ should_not_reach_here(); +#endif // ASSERT + } else { + // dispatch to next bytecode + __ dispatch_epilog(tos_out, step); + } +} + +// Generate method entries +address TemplateInterpreterGenerator::generate_method_entry( + AbstractInterpreter::MethodKind kind) { + // determine code generation flags + bool native = false; + bool synchronized = false; + address entry_point = NULL; + + switch (kind) { + case Interpreter::zerolocals : break; + case Interpreter::zerolocals_synchronized: synchronized = true; break; + case Interpreter::native : native = true; break; + case Interpreter::native_synchronized : native = true; synchronized = true; break; + case Interpreter::empty : break; + case Interpreter::accessor : break; + case Interpreter::abstract : entry_point = generate_abstract_entry(); break; + + case Interpreter::java_lang_math_sin : // fall thru + case Interpreter::java_lang_math_cos : // fall thru + case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_abs : // fall thru + case Interpreter::java_lang_math_log : // fall thru + case Interpreter::java_lang_math_log10 : // fall thru + case Interpreter::java_lang_math_sqrt : // fall thru + case Interpreter::java_lang_math_pow : // fall thru + case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; + case Interpreter::java_lang_ref_reference_get + : entry_point = generate_Reference_get_entry(); break; + case Interpreter::java_util_zip_CRC32_update + : native = true; entry_point = generate_CRC32_update_entry(); break; + case Interpreter::java_util_zip_CRC32_updateBytes + : // fall thru + case Interpreter::java_util_zip_CRC32_updateByteBuffer + : native = true; entry_point = generate_CRC32_updateBytes_entry(kind); break; + case Interpreter::java_util_zip_CRC32C_updateBytes + : // fall thru + case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer + : entry_point = generate_CRC32C_updateBytes_entry(kind); break; +#ifdef IA32 + // On x86_32 platforms, a special entry is generated for the following four methods. + // On other platforms the normal entry is used to enter these methods. + case Interpreter::java_lang_Float_intBitsToFloat + : native = true; entry_point = generate_Float_intBitsToFloat_entry(); break; + case Interpreter::java_lang_Float_floatToRawIntBits + : native = true; entry_point = generate_Float_floatToRawIntBits_entry(); break; + case Interpreter::java_lang_Double_longBitsToDouble + : native = true; entry_point = generate_Double_longBitsToDouble_entry(); break; + case Interpreter::java_lang_Double_doubleToRawLongBits + : native = true; entry_point = generate_Double_doubleToRawLongBits_entry(); break; +#else + case Interpreter::java_lang_Float_intBitsToFloat: + case Interpreter::java_lang_Float_floatToRawIntBits: + case Interpreter::java_lang_Double_longBitsToDouble: + case Interpreter::java_lang_Double_doubleToRawLongBits: + native = true; + break; +#endif // defined(TARGET_ARCH_x86) && !defined(_LP64) + default: + fatal("unexpected method kind: %d", kind); + break; + } + + if (entry_point) { + return entry_point; + } + + // We expect the normal and native entry points to be generated first so we can reuse them. + if (native) { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); + if (entry_point == NULL) { + entry_point = generate_native_entry(synchronized); + } + } else { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); + if (entry_point == NULL) { + entry_point = generate_normal_entry(synchronized); + } + } + + return entry_point; +} +#endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp index e53e6ac0211..3f45525224a 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,6 +61,8 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { void lock_method(); + void bang_stack_shadow_pages(bool native_call); + // Instruction generation void generate_and_dispatch (Template* t, TosState tos_out = ilgl); void set_vtos_entry_points (Template* t, address& bep, address& cep, address& sep, address& aep, address& iep, address& lep, address& fep, address& dep, address& vep); @@ -113,7 +115,6 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { #endif // SPARC #ifdef AARCH64 - void bang_stack_shadow_pages(bool native_call); void generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs); #endif // AARCH64 diff --git a/hotspot/src/share/vm/runtime/javaCalls.cpp b/hotspot/src/share/vm/runtime/javaCalls.cpp index e0a04e6d3bc..bf8aa7cefa7 100644 --- a/hotspot/src/share/vm/runtime/javaCalls.cpp +++ b/hotspot/src/share/vm/runtime/javaCalls.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -385,7 +385,7 @@ void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaC return; } else { // Touch pages checked if the OS needs them to be touched to be mapped. - os::bang_stack_shadow_pages(); + os::map_stack_shadow_pages(); } #if INCLUDE_JVMCI diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index 3dda79cf0ce..323407bc43d 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -262,7 +262,7 @@ class os: AllStatic { // pages for stack overflow checking. static bool uses_stack_guard_pages(); static bool allocate_stack_guard_pages(); - static void bang_stack_shadow_pages(); + static void map_stack_shadow_pages(); static bool stack_shadow_pages_available(Thread *thread, const methodHandle& method); // OS interface to Virtual Memory From 50bcef8c75690890a0f5801f4ec450e298ddb799 Mon Sep 17 00:00:00 2001 From: Jiangli Zhou Date: Tue, 12 Jan 2016 19:15:42 -0500 Subject: [PATCH 066/212] 8146523: VirtualMemoryTracker::remove_released_region double count unmapped CDS shared memory Skip tracking release for unmapped CDS shared space. Reviewed-by: dholmes, coleenp, iklam, gtriantafill --- hotspot/src/share/vm/services/virtualMemoryTracker.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/services/virtualMemoryTracker.cpp b/hotspot/src/share/vm/services/virtualMemoryTracker.cpp index 56fe27a1029..16f249b82e9 100644 --- a/hotspot/src/share/vm/services/virtualMemoryTracker.cpp +++ b/hotspot/src/share/vm/services/virtualMemoryTracker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -416,6 +416,14 @@ bool VirtualMemoryTracker::remove_released_region(address addr, size_t size) { return false; } + if (reserved_rgn->flag() == mtClassShared && + reserved_rgn->contain_region(addr, size) && + !reserved_rgn->same_region(addr, size)) { + // This is an unmapped CDS region, which is part of the reserved shared + // memory region. + // See special handling in VirtualMemoryTracker::add_reserved_region also. + return true; + } VirtualMemorySummary::record_released_memory(size, reserved_rgn->flag()); From 93ca986bae86a3f54afa8b947712702e4b88f8be Mon Sep 17 00:00:00 2001 From: David Holmes Date: Tue, 12 Jan 2016 19:48:00 -0500 Subject: [PATCH 067/212] 8146855: Update hotspot sources to recognize Solaris Studio 12u4 compiler Reviewed-by: dcubed, gthornbr --- hotspot/make/solaris/makefiles/sparcWorks.make | 8 ++++---- hotspot/src/share/vm/runtime/vm_version.cpp | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/hotspot/make/solaris/makefiles/sparcWorks.make b/hotspot/make/solaris/makefiles/sparcWorks.make index 062732b14dc..9bdab00ba66 100644 --- a/hotspot/make/solaris/makefiles/sparcWorks.make +++ b/hotspot/make/solaris/makefiles/sparcWorks.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -48,9 +48,9 @@ CC_COMPILER_REV := \ $(shell $(CC) -V 2>&1 | sed -n 's/^.*[ ,\t]C[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p') # Pick which compiler is validated -# Validated compiler for JDK9 is SS12.3 (5.12) -VALIDATED_COMPILER_REVS := 5.12 -VALIDATED_CC_COMPILER_REVS := 5.12 +# Validated compiler for JDK9 is SS12.4 (5.13) +VALIDATED_COMPILER_REVS := 5.13 +VALIDATED_CC_COMPILER_REVS := 5.13 # Warning messages about not using the above validated versions ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := $(strip ${VALIDATED_COMPILER_REVS}) diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index 03c38e18736..8acdaba2a7c 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -211,6 +211,8 @@ const char* Abstract_VM_Version::internal_vm_info_string() { #define HOTSPOT_BUILD_COMPILER "Sun Studio 12u1" #elif __SUNPRO_CC == 0x5120 #define HOTSPOT_BUILD_COMPILER "Sun Studio 12u3" + #elif __SUNPRO_CC == 0x5130 + #define HOTSPOT_BUILD_COMPILER "Sun Studio 12u4" #else #define HOTSPOT_BUILD_COMPILER "unknown Workshop:" XSTR(__SUNPRO_CC) #endif From 29169fd975edfe71283c17f4a425be5d42cba6da Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Wed, 13 Jan 2016 11:43:07 +0300 Subject: [PATCH 068/212] 8145127: VM warning: WaitForMultipleObjects timed out (0) .. Increase number of tracked threads, and set exiting-process flag earlier Reviewed-by: dholmes, dcubed --- hotspot/src/os/windows/vm/os_windows.cpp | 75 ++++++++++++++++-------- 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index d96fb961d52..f0ab29c3486 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -3815,6 +3815,7 @@ HINSTANCE os::win32::load_Windows_dll(const char* name, char *ebuf, return NULL; } +#define MAXIMUM_THREADS_TO_KEEP (16 * MAXIMUM_WAIT_OBJECTS) #define EXIT_TIMEOUT 300000 /* 5 minutes */ static BOOL CALLBACK init_crit_sect_call(PINIT_ONCE, PVOID pcrit_sect, PVOID*) { @@ -3833,7 +3834,7 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { // _endthreadex(). // Should be large enough to avoid blocking the exiting thread due to lack of // a free slot. - static HANDLE handles[MAXIMUM_WAIT_OBJECTS]; + static HANDLE handles[MAXIMUM_THREADS_TO_KEEP]; static int handle_count = 0; static INIT_ONCE init_once_crit_sect = INIT_ONCE_STATIC_INIT; @@ -3847,6 +3848,11 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { if (!InitOnceExecuteOnce(&init_once_crit_sect, init_crit_sect_call, &crit_sect, NULL)) { warning("crit_sect initialization failed in %s: %d\n", __FILE__, __LINE__); } else if (OrderAccess::load_acquire(&process_exiting) == 0) { + if (what != EPT_THREAD) { + // Atomically set process_exiting before the critical section + // to increase the visibility between racing threads. + Atomic::cmpxchg((jint)GetCurrentThreadId(), &process_exiting, 0); + } EnterCriticalSection(&crit_sect); if (what == EPT_THREAD && OrderAccess::load_acquire(&process_exiting) == 0) { @@ -3867,14 +3873,14 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { // If there's no free slot in the array of the kept handles, we'll have to // wait until at least one thread completes exiting. - if ((handle_count = j) == MAXIMUM_WAIT_OBJECTS) { + if ((handle_count = j) == MAXIMUM_THREADS_TO_KEEP) { // Raise the priority of the oldest exiting thread to increase its chances // to complete sooner. SetThreadPriority(handles[0], THREAD_PRIORITY_ABOVE_NORMAL); res = WaitForMultipleObjects(MAXIMUM_WAIT_OBJECTS, handles, FALSE, EXIT_TIMEOUT); if (res >= WAIT_OBJECT_0 && res < (WAIT_OBJECT_0 + MAXIMUM_WAIT_OBJECTS)) { i = (res - WAIT_OBJECT_0); - handle_count = MAXIMUM_WAIT_OBJECTS - 1; + handle_count = MAXIMUM_THREADS_TO_KEEP - 1; for (; i < handle_count; ++i) { handles[i] = handles[i + 1]; } @@ -3883,7 +3889,7 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { (res == WAIT_FAILED ? "failed" : "timed out"), GetLastError(), __FILE__, __LINE__); // Don't keep handles, if we failed waiting for them. - for (i = 0; i < MAXIMUM_WAIT_OBJECTS; ++i) { + for (i = 0; i < MAXIMUM_THREADS_TO_KEEP; ++i) { CloseHandle(handles[i]); } handle_count = 0; @@ -3904,42 +3910,59 @@ int os::win32::exit_process_or_thread(Ept what, int exit_code) { // The current exiting thread has stored its handle in the array, and now // should leave the critical section before calling _endthreadex(). - } else if (what != EPT_THREAD) { - if (handle_count > 0) { - // Before ending the process, make sure all the threads that had called - // _endthreadex() completed. + } else if (what != EPT_THREAD && handle_count > 0) { + jlong start_time, finish_time, timeout_left; + // Before ending the process, make sure all the threads that had called + // _endthreadex() completed. - // Set the priority level of the current thread to the same value as - // the priority level of exiting threads. - // This is to ensure it will be given a fair chance to execute if - // the timeout expires. - hthr = GetCurrentThread(); - SetThreadPriority(hthr, THREAD_PRIORITY_ABOVE_NORMAL); - for (i = 0; i < handle_count; ++i) { - SetThreadPriority(handles[i], THREAD_PRIORITY_ABOVE_NORMAL); + // Set the priority level of the current thread to the same value as + // the priority level of exiting threads. + // This is to ensure it will be given a fair chance to execute if + // the timeout expires. + hthr = GetCurrentThread(); + SetThreadPriority(hthr, THREAD_PRIORITY_ABOVE_NORMAL); + start_time = os::javaTimeNanos(); + finish_time = start_time + ((jlong)EXIT_TIMEOUT * 1000000L); + for (i = 0; ; ) { + int portion_count = handle_count - i; + if (portion_count > MAXIMUM_WAIT_OBJECTS) { + portion_count = MAXIMUM_WAIT_OBJECTS; } - res = WaitForMultipleObjects(handle_count, handles, TRUE, EXIT_TIMEOUT); + for (j = 0; j < portion_count; ++j) { + SetThreadPriority(handles[i + j], THREAD_PRIORITY_ABOVE_NORMAL); + } + timeout_left = (finish_time - start_time) / 1000000L; + if (timeout_left < 0) { + timeout_left = 0; + } + res = WaitForMultipleObjects(portion_count, handles + i, TRUE, timeout_left); if (res == WAIT_FAILED || res == WAIT_TIMEOUT) { warning("WaitForMultipleObjects %s (%u) in %s: %d\n", (res == WAIT_FAILED ? "failed" : "timed out"), GetLastError(), __FILE__, __LINE__); + // Reset portion_count so we close the remaining + // handles due to this error. + portion_count = handle_count - i; } - for (i = 0; i < handle_count; ++i) { - CloseHandle(handles[i]); + for (j = 0; j < portion_count; ++j) { + CloseHandle(handles[i + j]); } - handle_count = 0; + if ((i += portion_count) >= handle_count) { + break; + } + start_time = os::javaTimeNanos(); } - - OrderAccess::release_store(&process_exiting, 1); + handle_count = 0; } LeaveCriticalSection(&crit_sect); } - if (what == EPT_THREAD) { - while (OrderAccess::load_acquire(&process_exiting) != 0) { - // Some other thread is about to call exit(), so we - // don't let the current thread proceed to _endthreadex() + if (OrderAccess::load_acquire(&process_exiting) != 0 && + process_exiting != (jint)GetCurrentThreadId()) { + // Some other thread is about to call exit(), so we + // don't let the current thread proceed to exit() or _endthreadex() + while (true) { SuspendThread(GetCurrentThread()); // Avoid busy-wait loop, if SuspendThread() failed. Sleep(EXIT_TIMEOUT); From 380897b206bc9dfcf58ca689f832f08d1cc0a23d Mon Sep 17 00:00:00 2001 From: Dmitry Fazunenko Date: Tue, 12 Jan 2016 21:17:13 +0400 Subject: [PATCH 069/212] 8146889: Update @requires expression for GC tests to run if GC is default Reviewed-by: tschatzl, jwilhelm --- hotspot/test/gc/arguments/TestInitialTenuringThreshold.java | 4 ++-- hotspot/test/gc/arguments/TestObjectTenuringFlags.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java index e9045709c59..e9abbf7563c 100644 --- a/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java +++ b/hotspot/test/gc/arguments/TestInitialTenuringThreshold.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test TestInitialTenuringThreshold * @key gc * @bug 8014765 - * @requires vm.gc=="Parallel" + * @requires vm.gc=="Parallel" | vm.gc=="null" * @summary Tests argument processing for initial tenuring threshold * @library /testlibrary * @modules java.base/sun.misc diff --git a/hotspot/test/gc/arguments/TestObjectTenuringFlags.java b/hotspot/test/gc/arguments/TestObjectTenuringFlags.java index e62be2e9f57..11c1c69e26d 100644 --- a/hotspot/test/gc/arguments/TestObjectTenuringFlags.java +++ b/hotspot/test/gc/arguments/TestObjectTenuringFlags.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. +* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ * @test TestObjectTenuringFlags * @key gc * @bug 6521376 - * @requires vm.gc=="Parallel" + * @requires vm.gc=="Parallel" | vm.gc=="null" * @summary Tests argument processing for NeverTenure, AlwaysTenure, * and MaxTenuringThreshold * @library /testlibrary From ad0c208a5a5e2d6014c182d3f8e6f1333df1d4c8 Mon Sep 17 00:00:00 2001 From: David Lindholm Date: Thu, 14 Jan 2016 13:26:19 +0100 Subject: [PATCH 070/212] 8146690: Make all classes in GC follow the naming convention Reviewed-by: dholmes, stefank --- .../cpu/aarch64/vm/sharedRuntime_aarch64.cpp | 6 +- hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp | 10 +- .../src/cpu/sparc/vm/sharedRuntime_sparc.cpp | 10 +- .../src/cpu/x86/vm/sharedRuntime_x86_32.cpp | 10 +- .../src/cpu/x86/vm/sharedRuntime_x86_64.cpp | 10 +- hotspot/src/share/vm/asm/codeBuffer.cpp | 2 +- hotspot/src/share/vm/ci/ciEnv.cpp | 2 +- .../share/vm/classfile/classFileParser.cpp | 6 +- .../share/vm/classfile/classLoaderData.cpp | 6 +- .../src/share/vm/classfile/javaClasses.cpp | 4 +- .../src/share/vm/classfile/stringTable.cpp | 2 +- .../src/share/vm/classfile/symbolTable.cpp | 8 +- .../share/vm/classfile/systemDictionary.cpp | 14 +- hotspot/src/share/vm/classfile/verifier.cpp | 2 +- hotspot/src/share/vm/code/codeCache.cpp | 2 +- hotspot/src/share/vm/code/dependencies.hpp | 4 +- hotspot/src/share/vm/code/nmethod.cpp | 6 +- .../src/share/vm/compiler/compileBroker.cpp | 2 +- .../src/share/vm/gc/cms/cmsOopClosures.hpp | 66 ++++----- .../share/vm/gc/cms/cmsOopClosures.inline.hpp | 4 +- .../vm/gc/cms/compactibleFreeListSpace.cpp | 64 ++++----- .../vm/gc/cms/compactibleFreeListSpace.hpp | 6 +- .../gc/cms/concurrentMarkSweepGeneration.cpp | 134 +++++++++--------- .../gc/cms/concurrentMarkSweepGeneration.hpp | 28 ++-- .../concurrentMarkSweepGeneration.inline.hpp | 4 +- .../src/share/vm/gc/cms/parNewGeneration.cpp | 4 +- .../src/share/vm/gc/cms/parNewGeneration.hpp | 4 +- .../src/share/vm/gc/cms/vmCMSOperations.cpp | 2 +- .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 20 +-- .../src/share/vm/gc/g1/g1CollectorPolicy.hpp | 4 +- .../share/vm/gc/g1/g1ParScanThreadState.hpp | 2 +- .../src/share/vm/gc/g1/g1StringDedupQueue.cpp | 2 +- .../src/share/vm/gc/g1/g1StringDedupTable.cpp | 2 +- .../vm/gc/parallel/parallelScavengeHeap.cpp | 6 +- .../src/share/vm/gc/parallel/psMarkSweep.cpp | 2 +- hotspot/src/share/vm/gc/parallel/psOldGen.cpp | 2 +- .../vm/gc/parallel/psParallelCompact.cpp | 2 +- .../src/share/vm/gc/parallel/psScavenge.cpp | 2 +- .../share/vm/gc/parallel/vmPSOperations.cpp | 2 +- .../share/vm/gc/serial/defNewGeneration.cpp | 6 +- .../share/vm/gc/serial/defNewGeneration.hpp | 4 +- hotspot/src/share/vm/gc/shared/ageTable.cpp | 8 +- hotspot/src/share/vm/gc/shared/ageTable.hpp | 6 +- .../src/share/vm/gc/shared/cardGeneration.cpp | 2 +- .../share/vm/gc/shared/collectorPolicy.cpp | 14 +- hotspot/src/share/vm/gc/shared/gcLocker.cpp | 54 +++---- hotspot/src/share/vm/gc/shared/gcLocker.hpp | 104 +++++++------- .../share/vm/gc/shared/gcLocker.inline.hpp | 4 +- .../share/vm/gc/shared/genCollectedHeap.cpp | 2 +- hotspot/src/share/vm/gc/shared/space.cpp | 6 +- hotspot/src/share/vm/gc/shared/space.hpp | 8 +- .../vm/gc/shared/specialized_oop_closures.hpp | 16 +-- .../src/share/vm/gc/shared/vmGCOperations.cpp | 12 +- hotspot/src/share/vm/interpreter/rewriter.cpp | 2 +- hotspot/src/share/vm/oops/constMethod.cpp | 2 +- hotspot/src/share/vm/oops/instanceKlass.cpp | 2 +- hotspot/src/share/vm/oops/klassVtable.cpp | 2 +- hotspot/src/share/vm/oops/method.cpp | 6 +- hotspot/src/share/vm/oops/methodData.cpp | 2 +- hotspot/src/share/vm/opto/runtime.cpp | 2 +- hotspot/src/share/vm/prims/jni.cpp | 14 +- hotspot/src/share/vm/prims/jvmtiEnvBase.cpp | 2 +- hotspot/src/share/vm/prims/jvmtiExport.cpp | 2 +- .../share/vm/prims/jvmtiRedefineClasses.cpp | 6 +- .../src/share/vm/prims/jvmtiThreadState.cpp | 8 +- hotspot/src/share/vm/prims/methodHandles.cpp | 4 +- hotspot/src/share/vm/runtime/arguments.cpp | 6 +- .../src/share/vm/runtime/deoptimization.cpp | 2 +- hotspot/src/share/vm/runtime/globals.hpp | 2 +- .../src/share/vm/runtime/interfaceSupport.hpp | 4 +- hotspot/src/share/vm/runtime/safepoint.cpp | 4 +- .../src/share/vm/runtime/sharedRuntime.cpp | 4 +- hotspot/src/share/vm/runtime/synchronizer.cpp | 6 +- hotspot/src/share/vm/runtime/thread.cpp | 4 +- hotspot/src/share/vm/runtime/thread.hpp | 10 +- hotspot/src/share/vm/runtime/vmStructs.cpp | 8 +- hotspot/src/share/vm/services/heapDumper.cpp | 4 +- 77 files changed, 411 insertions(+), 411 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp index bf677ce43dc..9e05aa4b8de 100644 --- a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp @@ -1075,7 +1075,7 @@ static void restore_args(MacroAssembler *masm, int arg_count, int first_arg, VMR } -// Check GC_locker::needs_gc and enter the runtime if it's true. This +// Check GCLocker::needs_gc and enter the runtime if it's true. This // keeps a new JNI critical region from starting until a GC has been // forced. Save down any oops in registers and describe them in an // OopMap. @@ -1257,14 +1257,14 @@ static void gen_special_dispatch(MacroAssembler* masm, // GetPrimtiveArrayCritical and disallow the use of any other JNI // functions. The wrapper is expected to unpack the arguments before // passing them to the callee and perform checks before and after the -// native call to ensure that they GC_locker +// native call to ensure that they GCLocker // lock_critical/unlock_critical semantics are followed. Some other // parts of JNI setup are skipped like the tear down of the JNI handle // block and the check for pending exceptions it's impossible for them // to be thrown. // // They are roughly structured like this: -// if (GC_locker::needs_gc()) +// if (GCLocker::needs_gc()) // SharedRuntime::block_for_jni_critical(); // tranistion to thread_in_native // unpack arrray arguments and call native entry point diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index d6642b5ca9b..97b3f9803ea 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -1474,7 +1474,7 @@ static void save_or_restore_arguments(MacroAssembler* masm, } } -// Check GC_locker::needs_gc and enter the runtime if it's true. This +// Check GCLocker::needs_gc and enter the runtime if it's true. This // keeps a new JNI critical region from starting until a GC has been // forced. Save down any oops in registers and describe them in an // OopMap. @@ -1486,9 +1486,9 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm, VMRegPair* in_regs, BasicType* in_sig_bt, Register tmp_reg ) { - __ block_comment("check GC_locker::needs_gc"); + __ block_comment("check GCLocker::needs_gc"); Label cont; - __ lbz(tmp_reg, (RegisterOrConstant)(intptr_t)GC_locker::needs_gc_address()); + __ lbz(tmp_reg, (RegisterOrConstant)(intptr_t)GCLocker::needs_gc_address()); __ cmplwi(CCR0, tmp_reg, 0); __ beq(CCR0, cont); @@ -1687,14 +1687,14 @@ static void gen_special_dispatch(MacroAssembler* masm, // GetPrimtiveArrayCritical and disallow the use of any other JNI // functions. The wrapper is expected to unpack the arguments before // passing them to the callee and perform checks before and after the -// native call to ensure that they GC_locker +// native call to ensure that they GCLocker // lock_critical/unlock_critical semantics are followed. Some other // parts of JNI setup are skipped like the tear down of the JNI handle // block and the check for pending exceptions it's impossible for them // to be thrown. // // They are roughly structured like this: -// if (GC_locker::needs_gc()) +// if (GCLocker::needs_gc()) // SharedRuntime::block_for_jni_critical(); // tranistion to thread_in_native // unpack arrray arguments and call native entry point diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index 2c3e3b7c10a..1c5a563a4e3 100644 --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -1748,7 +1748,7 @@ static void save_or_restore_arguments(MacroAssembler* masm, } -// Check GC_locker::needs_gc and enter the runtime if it's true. This +// Check GCLocker::needs_gc and enter the runtime if it's true. This // keeps a new JNI critical region from starting until a GC has been // forced. Save down any oops in registers and describe them in an // OopMap. @@ -1759,9 +1759,9 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm, OopMapSet* oop_maps, VMRegPair* in_regs, BasicType* in_sig_bt) { - __ block_comment("check GC_locker::needs_gc"); + __ block_comment("check GCLocker::needs_gc"); Label cont; - AddressLiteral sync_state(GC_locker::needs_gc_address()); + AddressLiteral sync_state(GCLocker::needs_gc_address()); __ load_bool_contents(sync_state, G3_scratch); __ cmp_zero_and_br(Assembler::equal, G3_scratch, cont); __ delayed()->nop(); @@ -1936,14 +1936,14 @@ static void gen_special_dispatch(MacroAssembler* masm, // GetPrimtiveArrayCritical and disallow the use of any other JNI // functions. The wrapper is expected to unpack the arguments before // passing them to the callee and perform checks before and after the -// native call to ensure that they GC_locker +// native call to ensure that they GCLocker // lock_critical/unlock_critical semantics are followed. Some other // parts of JNI setup are skipped like the tear down of the JNI handle // block and the check for pending exceptions it's impossible for them // to be thrown. // // They are roughly structured like this: -// if (GC_locker::needs_gc()) +// if (GCLocker::needs_gc()) // SharedRuntime::block_for_jni_critical(); // tranistion to thread_in_native // unpack arrray arguments and call native entry point diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index 2125d7aa9fb..ede8f752139 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -1271,7 +1271,7 @@ static void save_or_restore_arguments(MacroAssembler* masm, } } -// Check GC_locker::needs_gc and enter the runtime if it's true. This +// Check GCLocker::needs_gc and enter the runtime if it's true. This // keeps a new JNI critical region from starting until a GC has been // forced. Save down any oops in registers and describe them in an // OopMap. @@ -1284,9 +1284,9 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm, OopMapSet* oop_maps, VMRegPair* in_regs, BasicType* in_sig_bt) { - __ block_comment("check GC_locker::needs_gc"); + __ block_comment("check GCLocker::needs_gc"); Label cont; - __ cmp8(ExternalAddress((address)GC_locker::needs_gc_address()), false); + __ cmp8(ExternalAddress((address)GCLocker::needs_gc_address()), false); __ jcc(Assembler::equal, cont); // Save down any incoming oops and call into the runtime to halt for a GC @@ -1469,14 +1469,14 @@ static void gen_special_dispatch(MacroAssembler* masm, // GetPrimtiveArrayCritical and disallow the use of any other JNI // functions. The wrapper is expected to unpack the arguments before // passing them to the callee and perform checks before and after the -// native call to ensure that they GC_locker +// native call to ensure that they GCLocker // lock_critical/unlock_critical semantics are followed. Some other // parts of JNI setup are skipped like the tear down of the JNI handle // block and the check for pending exceptions it's impossible for them // to be thrown. // // They are roughly structured like this: -// if (GC_locker::needs_gc()) +// if (GCLocker::needs_gc()) // SharedRuntime::block_for_jni_critical(); // tranistion to thread_in_native // unpack arrray arguments and call native entry point diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index c2892ed2a88..40e9cbb6e70 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -1416,7 +1416,7 @@ static void save_or_restore_arguments(MacroAssembler* masm, } -// Check GC_locker::needs_gc and enter the runtime if it's true. This +// Check GCLocker::needs_gc and enter the runtime if it's true. This // keeps a new JNI critical region from starting until a GC has been // forced. Save down any oops in registers and describe them in an // OopMap. @@ -1428,9 +1428,9 @@ static void check_needs_gc_for_critical_native(MacroAssembler* masm, OopMapSet* oop_maps, VMRegPair* in_regs, BasicType* in_sig_bt) { - __ block_comment("check GC_locker::needs_gc"); + __ block_comment("check GCLocker::needs_gc"); Label cont; - __ cmp8(ExternalAddress((address)GC_locker::needs_gc_address()), false); + __ cmp8(ExternalAddress((address)GCLocker::needs_gc_address()), false); __ jcc(Assembler::equal, cont); // Save down any incoming oops and call into the runtime to halt for a GC @@ -1795,14 +1795,14 @@ static void gen_special_dispatch(MacroAssembler* masm, // GetPrimtiveArrayCritical and disallow the use of any other JNI // functions. The wrapper is expected to unpack the arguments before // passing them to the callee and perform checks before and after the -// native call to ensure that they GC_locker +// native call to ensure that they GCLocker // lock_critical/unlock_critical semantics are followed. Some other // parts of JNI setup are skipped like the tear down of the JNI handle // block and the check for pending exceptions it's impossible for them // to be thrown. // // They are roughly structured like this: -// if (GC_locker::needs_gc()) +// if (GCLocker::needs_gc()) // SharedRuntime::block_for_jni_critical(); // tranistion to thread_in_native // unpack arrray arguments and call native entry point diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp index 4ffcf0c81a2..74eb082393c 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.cpp +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -510,7 +510,7 @@ static void append_oop_references(GrowableArray* oops, Klass* k) { } void CodeBuffer::finalize_oop_references(const methodHandle& mh) { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; GrowableArray oops; diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp index 9c9d7b300c2..b3c4eddded6 100644 --- a/hotspot/src/share/vm/ci/ciEnv.cpp +++ b/hotspot/src/share/vm/ci/ciEnv.cpp @@ -971,7 +971,7 @@ void ciEnv::register_method(ciMethod* target, // and invalidating our dependencies until we install this method. // No safepoints are allowed. Otherwise, class redefinition can occur in between. MutexLocker ml(Compile_lock); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // Change in Jvmti state may invalidate compilation. if (!failing() && jvmti_state_changed()) { diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 60c559e9056..77bc7ee87ec 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -863,7 +863,7 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream, initialize_hashtable(interface_names); bool dup = false; { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) for (index = 0; index < itfs_len; index++) { const Klass* const k = _local_interfaces->at(index); const Symbol* const name = InstanceKlass::cast(k)->name(); @@ -1620,7 +1620,7 @@ void ClassFileParser::parse_fields(const ClassFileStream* const cfs, initialize_hashtable(names_and_sigs); bool dup = false; { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) for (AllFieldStream fs(_fields, cp); !fs.done(); fs.next()) { const Symbol* const name = fs.name(); const Symbol* const sig = fs.signature(); @@ -2885,7 +2885,7 @@ void ClassFileParser::parse_methods(const ClassFileStream* const cfs, initialize_hashtable(names_and_sigs); bool dup = false; { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) for (int i = 0; i < length; i++) { const Method* const m = _methods->at(i); // If no duplicates, add name/signature in hashtable names_and_sigs. diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp index 7415ab64ba6..31de9b4836f 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.cpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp @@ -574,9 +574,9 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous, TRA // actual ClassLoaderData object. ClassLoaderData::Dependencies dependencies(CHECK_NULL); - No_Safepoint_Verifier no_safepoints; // we mustn't GC until we've installed the - // ClassLoaderData in the graph since the CLD - // contains unhandled oops + NoSafepointVerifier no_safepoints; // we mustn't GC until we've installed the + // ClassLoaderData in the graph since the CLD + // contains unhandled oops ClassLoaderData* cld = new ClassLoaderData(loader, is_anonymous, dependencies); diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index 1d9179aa9ef..6677acd9134 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -1536,7 +1536,7 @@ class BacktraceBuilder: public StackObj { objArrayOop _mirrors; typeArrayOop _cprefs; // needed to insulate method name against redefinition int _index; - No_Safepoint_Verifier _nsv; + NoSafepointVerifier _nsv; public: @@ -1595,7 +1595,7 @@ class BacktraceBuilder: public StackObj { void expand(TRAPS) { objArrayHandle old_head(THREAD, _head); - Pause_No_Safepoint_Verifier pnsv(&_nsv); + PauseNoSafepointVerifier pnsv(&_nsv); objArrayOop head = oopFactory::new_objectArray(trace_size, CHECK); objArrayHandle new_head(THREAD, head); diff --git a/hotspot/src/share/vm/classfile/stringTable.cpp b/hotspot/src/share/vm/classfile/stringTable.cpp index 59a78bbb221..9d3340e8054 100644 --- a/hotspot/src/share/vm/classfile/stringTable.cpp +++ b/hotspot/src/share/vm/classfile/stringTable.cpp @@ -136,7 +136,7 @@ oop StringTable::basic_add(int index_arg, Handle string, jchar* name, assert(java_lang_String::equals(string(), name, len), "string must be properly initialized"); // Cannot hit a safepoint in this function because the "this" pointer can move. - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // Check if the symbol table has been rehashed, if so, need to recalculate // the hash value and index before second lookup. diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp index ae5dc8b7c20..964df1d18dd 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.cpp +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp @@ -264,7 +264,7 @@ Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) { unsigned int hashValue; char* name; { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) name = (char*)sym->base() + begin; len = end - begin; @@ -288,7 +288,7 @@ Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) { buffer[i] = name[i]; } // Make sure there is no safepoint in the code above since name can't move. - // We can't include the code in No_Safepoint_Verifier because of the + // We can't include the code in NoSafepointVerifier because of the // ResourceMark. // Grab SymbolTable_lock first. @@ -405,7 +405,7 @@ Symbol* SymbolTable::basic_add(int index_arg, u1 *name, int len, } // Cannot hit a safepoint in this function because the "this" pointer can move. - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // Check if the symbol table has been rehashed, if so, need to recalculate // the hash value and index. @@ -454,7 +454,7 @@ bool SymbolTable::basic_add(ClassLoaderData* loader_data, const constantPoolHand } // Cannot hit a safepoint in this function because the "this" pointer can move. - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; for (int i=0; iadd_protection_domain(d_index, d_hash, klass, loader_data, protection_domain, THREAD); } @@ -908,11 +908,11 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, MutexLocker mu(SystemDictionary_lock, THREAD); // Note that we have an entry, and entries can be deleted only during GC, // so we cannot allow GC to occur while we're holding this entry. - // We're using a No_Safepoint_Verifier to catch any place where we + // We're using a NoSafepointVerifier to catch any place where we // might potentially do a GC at all. // Dictionary::do_unloading() asserts that classes in SD are only // unloaded at a safepoint. Anonymous classes are not in SD. - No_Safepoint_Verifier nosafepoint; + NoSafepointVerifier nosafepoint; if (dictionary()->is_valid_protection_domain(d_index, d_hash, name, loader_data, protection_domain)) { @@ -961,11 +961,11 @@ Klass* SystemDictionary::find(Symbol* class_name, { // Note that we have an entry, and entries can be deleted only during GC, // so we cannot allow GC to occur while we're holding this entry. - // We're using a No_Safepoint_Verifier to catch any place where we + // We're using a NoSafepointVerifier to catch any place where we // might potentially do a GC at all. // Dictionary::do_unloading() asserts that classes in SD are only // unloaded at a safepoint. Anonymous classes are not in SD. - No_Safepoint_Verifier nosafepoint; + NoSafepointVerifier nosafepoint; return dictionary()->find(d_index, d_hash, class_name, loader_data, protection_domain, THREAD); } @@ -2210,7 +2210,7 @@ bool SystemDictionary::add_loader_constraint(Symbol* class_name, MutexLocker mu_s(SystemDictionary_lock, THREAD); // Better never do a GC while we're holding these oops - No_Safepoint_Verifier nosafepoint; + NoSafepointVerifier nosafepoint; Klass* klass1 = find_class(d_index1, d_hash1, constraint_name, loader_data1); Klass* klass2 = find_class(d_index2, d_hash2, constraint_name, loader_data2); diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index 6a49093918a..c2759287c3f 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -2004,7 +2004,7 @@ bool ClassVerifier::is_protected_access(instanceKlassHandle this_class, Symbol* field_name, Symbol* field_sig, bool is_method) { - No_Safepoint_Verifier nosafepoint; + NoSafepointVerifier nosafepoint; // If target class isn't a super class of this class, we don't worry about this case if (!this_class->is_subclass_of(target_class)) { diff --git a/hotspot/src/share/vm/code/codeCache.cpp b/hotspot/src/share/vm/code/codeCache.cpp index 864f04d8f65..314365dda91 100644 --- a/hotspot/src/share/vm/code/codeCache.cpp +++ b/hotspot/src/share/vm/code/codeCache.cpp @@ -1034,7 +1034,7 @@ int CodeCache::mark_for_deoptimization(DepChange& changes) { // implementor. // nmethod::check_all_dependencies works only correctly, if no safepoint // can happen - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; for (DepChange::ContextStream str(changes, nsv); str.next(); ) { Klass* d = str.klass(); number_of_marked_CodeBlobs += InstanceKlass::cast(d)->mark_dependent_nmethods(changes); diff --git a/hotspot/src/share/vm/code/dependencies.hpp b/hotspot/src/share/vm/code/dependencies.hpp index e9c26011695..172b1c4f39e 100644 --- a/hotspot/src/share/vm/code/dependencies.hpp +++ b/hotspot/src/share/vm/code/dependencies.hpp @@ -59,7 +59,7 @@ class CompileLog; class DepChange; class KlassDepChange; class CallSiteDepChange; -class No_Safepoint_Verifier; +class NoSafepointVerifier; class Dependencies: public ResourceObj { public: @@ -713,7 +713,7 @@ class DepChange : public StackObj { : _changes(changes) { start(); } - ContextStream(DepChange& changes, No_Safepoint_Verifier& nsv) + ContextStream(DepChange& changes, NoSafepointVerifier& nsv) : _changes(changes) // the nsv argument makes it safe to hold oops like _klass { start(); } diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 5ff6520581b..7fa9729ae4d 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -692,7 +692,7 @@ nmethod::nmethod( _native_basic_lock_sp_offset(basic_lock_sp_offset) { { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) assert_locked_or_safepoint(CodeCache_lock); init_defaults(); @@ -796,7 +796,7 @@ nmethod::nmethod( { assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR"); { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) assert_locked_or_safepoint(CodeCache_lock); init_defaults(); @@ -1404,7 +1404,7 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) { // Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below. nmethodLocker nml(this); methodHandle the_method(method()); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // during patching, depending on the nmethod state we must notify the GC that // code has been unloaded, unregistering it. We cannot do this right while diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index e5eac46910c..bf740dc7241 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -373,7 +373,7 @@ CompileTask* CompileQueue::get() { CompileTask* task; { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; task = CompilationPolicy::policy()->select_task(this); } diff --git a/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp b/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp index 2887914b5a4..e85dc681e3b 100644 --- a/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp +++ b/hotspot/src/share/vm/gc/cms/cmsOopClosures.hpp @@ -37,7 +37,7 @@ class CMSBitMap; class CMSMarkStack; class CMSCollector; class MarkFromRootsClosure; -class Par_MarkFromRootsClosure; +class ParMarkFromRootsClosure; // Decode the oop and call do_oop on it. #define DO_OOP_WORK_DEFN \ @@ -82,14 +82,14 @@ class MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure { virtual void do_oop(narrowOop* p); }; -class Par_MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure { +class ParMarkRefsIntoClosure: public MetadataAwareOopsInGenClosure { private: const MemRegion _span; CMSBitMap* _bitMap; protected: DO_OOP_WORK_DEFN public: - Par_MarkRefsIntoClosure(MemRegion span, CMSBitMap* bitMap); + ParMarkRefsIntoClosure(MemRegion span, CMSBitMap* bitMap); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); }; @@ -141,7 +141,7 @@ class PushAndMarkClosure: public MetadataAwareOopClosure { // synchronization (for instance, via CAS). The marking stack // used in the non-parallel case above is here replaced with // an OopTaskQueue structure to allow efficient work stealing. -class Par_PushAndMarkClosure: public MetadataAwareOopClosure { +class ParPushAndMarkClosure: public MetadataAwareOopClosure { private: CMSCollector* _collector; MemRegion _span; @@ -150,15 +150,15 @@ class Par_PushAndMarkClosure: public MetadataAwareOopClosure { protected: DO_OOP_WORK_DEFN public: - Par_PushAndMarkClosure(CMSCollector* collector, - MemRegion span, - ReferenceProcessor* rp, - CMSBitMap* bit_map, - OopTaskQueue* work_queue); + ParPushAndMarkClosure(CMSCollector* collector, + MemRegion span, + ReferenceProcessor* rp, + CMSBitMap* bit_map, + OopTaskQueue* work_queue); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { Par_PushAndMarkClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { Par_PushAndMarkClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p) { ParPushAndMarkClosure::do_oop_work(p); } + inline void do_oop_nv(narrowOop* p) { ParPushAndMarkClosure::do_oop_work(p); } }; // The non-parallel version (the parallel version appears further below). @@ -203,25 +203,25 @@ class MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { // stack and the bitMap are shared, so access needs to be suitably // synchronized. An OopTaskQueue structure, supporting efficient // work stealing, replaces a CMSMarkStack for storing grey objects. -class Par_MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { +class ParMarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { private: - MemRegion _span; - CMSBitMap* _bit_map; - OopTaskQueue* _work_queue; - const uint _low_water_mark; - Par_PushAndMarkClosure _par_pushAndMarkClosure; + MemRegion _span; + CMSBitMap* _bit_map; + OopTaskQueue* _work_queue; + const uint _low_water_mark; + ParPushAndMarkClosure _parPushAndMarkClosure; protected: DO_OOP_WORK_DEFN public: - Par_MarkRefsIntoAndScanClosure(CMSCollector* collector, + ParMarkRefsIntoAndScanClosure(CMSCollector* collector, MemRegion span, ReferenceProcessor* rp, CMSBitMap* bit_map, OopTaskQueue* work_queue); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { Par_MarkRefsIntoAndScanClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { Par_MarkRefsIntoAndScanClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } + inline void do_oop_nv(narrowOop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } void trim_queue(uint size); }; @@ -261,8 +261,8 @@ class PushOrMarkClosure: public MetadataAwareOopClosure { // A parallel (MT) version of the above. // This closure is used during the concurrent marking phase // following the first checkpoint. Its use is buried in -// the closure Par_MarkFromRootsClosure. -class Par_PushOrMarkClosure: public MetadataAwareOopClosure { +// the closure ParMarkFromRootsClosure. +class ParPushOrMarkClosure: public MetadataAwareOopClosure { private: CMSCollector* _collector; MemRegion _whole_span; @@ -272,23 +272,23 @@ class Par_PushOrMarkClosure: public MetadataAwareOopClosure { CMSMarkStack* _overflow_stack; HeapWord* const _finger; HeapWord** const _global_finger_addr; - Par_MarkFromRootsClosure* const + ParMarkFromRootsClosure* const _parent; protected: DO_OOP_WORK_DEFN public: - Par_PushOrMarkClosure(CMSCollector* cms_collector, - MemRegion span, - CMSBitMap* bit_map, - OopTaskQueue* work_queue, - CMSMarkStack* mark_stack, - HeapWord* finger, - HeapWord** global_finger_addr, - Par_MarkFromRootsClosure* parent); + ParPushOrMarkClosure(CMSCollector* cms_collector, + MemRegion span, + CMSBitMap* bit_map, + OopTaskQueue* work_queue, + CMSMarkStack* mark_stack, + HeapWord* finger, + HeapWord** global_finger_addr, + ParMarkFromRootsClosure* parent); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p) { Par_PushOrMarkClosure::do_oop_work(p); } - inline void do_oop_nv(narrowOop* p) { Par_PushOrMarkClosure::do_oop_work(p); } + inline void do_oop_nv(oop* p) { ParPushOrMarkClosure::do_oop_work(p); } + inline void do_oop_nv(narrowOop* p) { ParPushOrMarkClosure::do_oop_work(p); } // Deal with a stack overflow condition void handle_stack_overflow(HeapWord* lost); diff --git a/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp b/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp index 3740795614f..363097543c8 100644 --- a/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/cms/cmsOopClosures.inline.hpp @@ -31,7 +31,7 @@ #include "oops/oop.inline.hpp" // Trim our work_queue so its length is below max at return -inline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) { +inline void ParMarkRefsIntoAndScanClosure::trim_queue(uint max) { while (_work_queue->size() > max) { oop newOop; if (_work_queue->pop_local(newOop)) { @@ -40,7 +40,7 @@ inline void Par_MarkRefsIntoAndScanClosure::trim_queue(uint max) { "only grey objects on this stack"); // iterate over the oops in this oop, marking and pushing // the ones in CMS heap (i.e. in _span). - newOop->oop_iterate(&_par_pushAndMarkClosure); + newOop->oop_iterate(&_parPushAndMarkClosure); } } } diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp index 9d99a44b703..6c9a4ea4fae 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp @@ -576,7 +576,7 @@ void CompactibleFreeListSpace::set_end(HeapWord* value) { } } -class FreeListSpace_DCTOC : public Filtering_DCTOC { +class FreeListSpaceDCTOC : public FilteringDCTOC { CompactibleFreeListSpace* _cfls; CMSCollector* _collector; bool _parallel; @@ -596,21 +596,21 @@ protected: walk_mem_region_with_cl_DECL(FilteringClosure); public: - FreeListSpace_DCTOC(CompactibleFreeListSpace* sp, - CMSCollector* collector, - ExtendedOopClosure* cl, - CardTableModRefBS::PrecisionStyle precision, - HeapWord* boundary, - bool parallel) : - Filtering_DCTOC(sp, cl, precision, boundary), + FreeListSpaceDCTOC(CompactibleFreeListSpace* sp, + CMSCollector* collector, + ExtendedOopClosure* cl, + CardTableModRefBS::PrecisionStyle precision, + HeapWord* boundary, + bool parallel) : + FilteringDCTOC(sp, cl, precision, boundary), _cfls(sp), _collector(collector), _parallel(parallel) {} }; // We de-virtualize the block-related calls below, since we know that our // space is a CompactibleFreeListSpace. -#define FreeListSpace_DCTOC__walk_mem_region_with_cl_DEFN(ClosureType) \ -void FreeListSpace_DCTOC::walk_mem_region_with_cl(MemRegion mr, \ +#define FreeListSpaceDCTOC__walk_mem_region_with_cl_DEFN(ClosureType) \ +void FreeListSpaceDCTOC::walk_mem_region_with_cl(MemRegion mr, \ HeapWord* bottom, \ HeapWord* top, \ ClosureType* cl) { \ @@ -620,10 +620,10 @@ void FreeListSpace_DCTOC::walk_mem_region_with_cl(MemRegion mr, walk_mem_region_with_cl_nopar(mr, bottom, top, cl); \ } \ } \ -void FreeListSpace_DCTOC::walk_mem_region_with_cl_par(MemRegion mr, \ - HeapWord* bottom, \ - HeapWord* top, \ - ClosureType* cl) { \ +void FreeListSpaceDCTOC::walk_mem_region_with_cl_par(MemRegion mr, \ + HeapWord* bottom, \ + HeapWord* top, \ + ClosureType* cl) { \ /* Skip parts that are before "mr", in case "block_start" sent us \ back too far. */ \ HeapWord* mr_start = mr.start(); \ @@ -647,10 +647,10 @@ void FreeListSpace_DCTOC::walk_mem_region_with_cl_par(MemRegion mr, } \ } \ } \ -void FreeListSpace_DCTOC::walk_mem_region_with_cl_nopar(MemRegion mr, \ - HeapWord* bottom, \ - HeapWord* top, \ - ClosureType* cl) { \ +void FreeListSpaceDCTOC::walk_mem_region_with_cl_nopar(MemRegion mr, \ + HeapWord* bottom, \ + HeapWord* top, \ + ClosureType* cl) { \ /* Skip parts that are before "mr", in case "block_start" sent us \ back too far. */ \ HeapWord* mr_start = mr.start(); \ @@ -678,15 +678,15 @@ void FreeListSpace_DCTOC::walk_mem_region_with_cl_nopar(MemRegion mr, // (There are only two of these, rather than N, because the split is due // only to the introduction of the FilteringClosure, a local part of the // impl of this abstraction.) -FreeListSpace_DCTOC__walk_mem_region_with_cl_DEFN(ExtendedOopClosure) -FreeListSpace_DCTOC__walk_mem_region_with_cl_DEFN(FilteringClosure) +FreeListSpaceDCTOC__walk_mem_region_with_cl_DEFN(ExtendedOopClosure) +FreeListSpaceDCTOC__walk_mem_region_with_cl_DEFN(FilteringClosure) DirtyCardToOopClosure* CompactibleFreeListSpace::new_dcto_cl(ExtendedOopClosure* cl, CardTableModRefBS::PrecisionStyle precision, HeapWord* boundary, bool parallel) { - return new FreeListSpace_DCTOC(this, _collector, cl, precision, boundary, parallel); + return new FreeListSpaceDCTOC(this, _collector, cl, precision, boundary, parallel); } @@ -2413,7 +2413,7 @@ void CompactibleFreeListSpace::printFLCensus(size_t sweep_count) const { } /////////////////////////////////////////////////////////////////////////// -// CFLS_LAB +// CompactibleFreeListSpaceLAB /////////////////////////////////////////////////////////////////////////// #define VECTOR_257(x) \ @@ -2432,12 +2432,12 @@ void CompactibleFreeListSpace::printFLCensus(size_t sweep_count) const { // generic OldPLABSize, whose static default is different; if overridden at the // command-line, this will get reinitialized via a call to // modify_initialization() below. -AdaptiveWeightedAverage CFLS_LAB::_blocks_to_claim[] = - VECTOR_257(AdaptiveWeightedAverage(OldPLABWeight, (float)CFLS_LAB::_default_dynamic_old_plab_size)); -size_t CFLS_LAB::_global_num_blocks[] = VECTOR_257(0); -uint CFLS_LAB::_global_num_workers[] = VECTOR_257(0); +AdaptiveWeightedAverage CompactibleFreeListSpaceLAB::_blocks_to_claim[] = + VECTOR_257(AdaptiveWeightedAverage(OldPLABWeight, (float)CompactibleFreeListSpaceLAB::_default_dynamic_old_plab_size)); +size_t CompactibleFreeListSpaceLAB::_global_num_blocks[] = VECTOR_257(0); +uint CompactibleFreeListSpaceLAB::_global_num_workers[] = VECTOR_257(0); -CFLS_LAB::CFLS_LAB(CompactibleFreeListSpace* cfls) : +CompactibleFreeListSpaceLAB::CompactibleFreeListSpaceLAB(CompactibleFreeListSpace* cfls) : _cfls(cfls) { assert(CompactibleFreeListSpace::IndexSetSize == 257, "Modify VECTOR_257() macro above"); @@ -2451,7 +2451,7 @@ CFLS_LAB::CFLS_LAB(CompactibleFreeListSpace* cfls) : static bool _CFLS_LAB_modified = false; -void CFLS_LAB::modify_initialization(size_t n, unsigned wt) { +void CompactibleFreeListSpaceLAB::modify_initialization(size_t n, unsigned wt) { assert(!_CFLS_LAB_modified, "Call only once"); _CFLS_LAB_modified = true; for (size_t i = CompactibleFreeListSpace::IndexSetStart; @@ -2461,7 +2461,7 @@ void CFLS_LAB::modify_initialization(size_t n, unsigned wt) { } } -HeapWord* CFLS_LAB::alloc(size_t word_sz) { +HeapWord* CompactibleFreeListSpaceLAB::alloc(size_t word_sz) { FreeChunk* res; assert(word_sz == _cfls->adjustObjectSize(word_sz), "Error"); if (word_sz >= CompactibleFreeListSpace::IndexSetSize) { @@ -2491,7 +2491,7 @@ HeapWord* CFLS_LAB::alloc(size_t word_sz) { // Get a chunk of blocks of the right size and update related // book-keeping stats -void CFLS_LAB::get_from_global_pool(size_t word_sz, AdaptiveFreeList* fl) { +void CompactibleFreeListSpaceLAB::get_from_global_pool(size_t word_sz, AdaptiveFreeList* fl) { // Get the #blocks we want to claim size_t n_blks = (size_t)_blocks_to_claim[word_sz].average(); assert(n_blks > 0, "Error"); @@ -2525,7 +2525,7 @@ void CFLS_LAB::get_from_global_pool(size_t word_sz, AdaptiveFreeList* _num_blocks[word_sz] += fl->count(); } -void CFLS_LAB::compute_desired_plab_size() { +void CompactibleFreeListSpaceLAB::compute_desired_plab_size() { for (size_t i = CompactibleFreeListSpace::IndexSetStart; i < CompactibleFreeListSpace::IndexSetSize; i += CompactibleFreeListSpace::IndexSetStride) { @@ -2551,7 +2551,7 @@ void CFLS_LAB::compute_desired_plab_size() { // access, one would need to take the FL locks and, // depending on how it is used, stagger access from // parallel threads to reduce contention. -void CFLS_LAB::retire(int tid) { +void CompactibleFreeListSpaceLAB::retire(int tid) { // We run this single threaded with the world stopped; // so no need for locks and such. NOT_PRODUCT(Thread* t = Thread::current();) diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp index 5c233452a16..c9f9af242be 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp @@ -75,7 +75,7 @@ class CompactibleFreeListSpace: public CompactibleSpace { friend class ConcurrentMarkSweepGeneration; friend class CMSCollector; // Local alloc buffer for promotion into this space. - friend class CFLS_LAB; + friend class CompactibleFreeListSpaceLAB; // Allow scan_and_* functions to call (private) overrides of the auxiliary functions on this class template friend void CompactibleSpace::scan_and_adjust_pointers(SpaceType* space); @@ -662,7 +662,7 @@ class CompactibleFreeListSpace: public CompactibleSpace { // A parallel-GC-thread-local allocation buffer for allocation into a // CompactibleFreeListSpace. -class CFLS_LAB : public CHeapObj { +class CompactibleFreeListSpaceLAB : public CHeapObj { // The space that this buffer allocates into. CompactibleFreeListSpace* _cfls; @@ -686,7 +686,7 @@ public: static const int _default_dynamic_old_plab_size = 16; static const int _default_static_old_plab_size = 50; - CFLS_LAB(CompactibleFreeListSpace* cfls); + CompactibleFreeListSpaceLAB(CompactibleFreeListSpace* cfls); // Allocate and return a block of the given size, or else return NULL. HeapWord* alloc(size_t word_sz); diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp index 3e335a8e164..f852e9d0017 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp @@ -183,7 +183,7 @@ NOT_PRODUCT(CompactibleFreeListSpace* debug_cms_space;) // young-gen collection. class CMSParGCThreadState: public CHeapObj { public: - CFLS_LAB lab; + CompactibleFreeListSpaceLAB lab; PromotionInfo promo; // Constructor. @@ -1110,7 +1110,7 @@ bool ConcurrentMarkSweepGeneration::should_collect(bool full, bool CMSCollector::shouldConcurrentCollect() { if (_full_gc_requested) { - log_trace(gc)("CMSCollector: collect because of explicit gc request (or gc_locker)"); + log_trace(gc)("CMSCollector: collect because of explicit gc request (or GCLocker)"); return true; } @@ -1269,12 +1269,12 @@ void CMSCollector::collect(bool full, { // The following "if" branch is present for defensive reasons. // In the current uses of this interface, it can be replaced with: - // assert(!GC_locker.is_active(), "Can't be called otherwise"); + // assert(!GCLocker.is_active(), "Can't be called otherwise"); // But I am not placing that assert here to allow future // generality in invoking this interface. - if (GC_locker::is_active()) { - // A consistency test for GC_locker - assert(GC_locker::needs_gc(), "Should have been set already"); + if (GCLocker::is_active()) { + // A consistency test for GCLocker + assert(GCLocker::needs_gc(), "Should have been set already"); // Skip this foreground collection, instead // expanding the heap if necessary. // Need the free list locks for the call to free() in compute_new_size() @@ -3272,10 +3272,10 @@ void CMSConcMarkingTask::do_scan_and_mark(int i, CompactibleFreeListSpace* sp) { // Do the marking work within a non-empty span -- // the last argument to the constructor indicates whether the // iteration should be incremental with periodic yields. - Par_MarkFromRootsClosure cl(this, _collector, my_span, - &_collector->_markBitMap, - work_queue(i), - &_collector->_markStack); + ParMarkFromRootsClosure cl(this, _collector, my_span, + &_collector->_markBitMap, + work_queue(i), + &_collector->_markStack); _collector->_markBitMap.iterate(&cl, my_span.start(), my_span.end()); } // else nothing to do for this task } // else nothing to do for this task @@ -3291,7 +3291,7 @@ void CMSConcMarkingTask::do_scan_and_mark(int i, CompactibleFreeListSpace* sp) { pst->all_tasks_completed(); } -class Par_ConcMarkingClosure: public MetadataAwareOopClosure { +class ParConcMarkingClosure: public MetadataAwareOopClosure { private: CMSCollector* _collector; CMSConcMarkingTask* _task; @@ -3302,8 +3302,8 @@ class Par_ConcMarkingClosure: public MetadataAwareOopClosure { protected: DO_OOP_WORK_DEFN public: - Par_ConcMarkingClosure(CMSCollector* collector, CMSConcMarkingTask* task, OopTaskQueue* work_queue, - CMSBitMap* bit_map, CMSMarkStack* overflow_stack): + ParConcMarkingClosure(CMSCollector* collector, CMSConcMarkingTask* task, OopTaskQueue* work_queue, + CMSBitMap* bit_map, CMSMarkStack* overflow_stack): MetadataAwareOopClosure(collector->ref_processor()), _collector(collector), _task(task), @@ -3330,7 +3330,7 @@ class Par_ConcMarkingClosure: public MetadataAwareOopClosure { // already have been initialized (else they would not have // been published), so we do not need to check for // uninitialized objects before pushing here. -void Par_ConcMarkingClosure::do_oop(oop obj) { +void ParConcMarkingClosure::do_oop(oop obj) { assert(obj->is_oop_or_null(true), "Expected an oop or NULL at " PTR_FORMAT, p2i(obj)); HeapWord* addr = (HeapWord*)obj; // Check if oop points into the CMS generation @@ -3366,10 +3366,10 @@ void Par_ConcMarkingClosure::do_oop(oop obj) { } } -void Par_ConcMarkingClosure::do_oop(oop* p) { Par_ConcMarkingClosure::do_oop_work(p); } -void Par_ConcMarkingClosure::do_oop(narrowOop* p) { Par_ConcMarkingClosure::do_oop_work(p); } +void ParConcMarkingClosure::do_oop(oop* p) { ParConcMarkingClosure::do_oop_work(p); } +void ParConcMarkingClosure::do_oop(narrowOop* p) { ParConcMarkingClosure::do_oop_work(p); } -void Par_ConcMarkingClosure::trim_queue(size_t max) { +void ParConcMarkingClosure::trim_queue(size_t max) { while (_work_queue->size() > max) { oop new_oop; if (_work_queue->pop_local(new_oop)) { @@ -3385,7 +3385,7 @@ void Par_ConcMarkingClosure::trim_queue(size_t max) { // Upon stack overflow, we discard (part of) the stack, // remembering the least address amongst those discarded // in CMSCollector's _restart_address. -void Par_ConcMarkingClosure::handle_stack_overflow(HeapWord* lost) { +void ParConcMarkingClosure::handle_stack_overflow(HeapWord* lost) { // We need to do this under a mutex to prevent other // workers from interfering with the work done below. MutexLockerEx ml(_overflow_stack->par_lock(), @@ -3404,7 +3404,7 @@ void CMSConcMarkingTask::do_work_steal(int i) { CMSBitMap* bm = &(_collector->_markBitMap); CMSMarkStack* ovflw = &(_collector->_markStack); int* seed = _collector->hash_seed(i); - Par_ConcMarkingClosure cl(_collector, this, work_q, bm, ovflw); + ParConcMarkingClosure cl(_collector, this, work_q, bm, ovflw); while (true) { cl.trim_queue(0); assert(work_q->size() == 0, "Should have been emptied above"); @@ -4246,7 +4246,7 @@ void CMSParInitialMarkTask::work(uint worker_id) { // ---------- scan from roots -------------- _timer.start(); GenCollectedHeap* gch = GenCollectedHeap::heap(); - Par_MarkRefsIntoClosure par_mri_cl(_collector->_span, &(_collector->_markBitMap)); + ParMarkRefsIntoClosure par_mri_cl(_collector->_span, &(_collector->_markBitMap)); // ---------- young gen roots -------------- { @@ -4312,10 +4312,10 @@ class CMSParRemarkTask: public CMSParMarkTask { private: // ... of dirty cards in old space void do_dirty_card_rescan_tasks(CompactibleFreeListSpace* sp, int i, - Par_MarkRefsIntoAndScanClosure* cl); + ParMarkRefsIntoAndScanClosure* cl); // ... work stealing for the above - void do_work_steal(int i, Par_MarkRefsIntoAndScanClosure* cl, int* seed); + void do_work_steal(int i, ParMarkRefsIntoAndScanClosure* cl, int* seed); }; class RemarkKlassClosure : public KlassClosure { @@ -4361,7 +4361,7 @@ void CMSParMarkTask::work_on_young_gen_roots(uint worker_id, OopsInGenClosure* c } // work_queue(i) is passed to the closure -// Par_MarkRefsIntoAndScanClosure. The "i" parameter +// ParMarkRefsIntoAndScanClosure. The "i" parameter // also is passed to do_dirty_card_rescan_tasks() and to // do_work_steal() to select the i-th task_queue. @@ -4373,7 +4373,7 @@ void CMSParRemarkTask::work(uint worker_id) { // ---------- rescan from roots -------------- _timer.start(); GenCollectedHeap* gch = GenCollectedHeap::heap(); - Par_MarkRefsIntoAndScanClosure par_mrias_cl(_collector, + ParMarkRefsIntoAndScanClosure par_mrias_cl(_collector, _collector->_span, _collector->ref_processor(), &(_collector->_markBitMap), work_queue(worker_id)); @@ -4522,7 +4522,7 @@ CMSParMarkTask::do_young_space_rescan(uint worker_id, void CMSParRemarkTask::do_dirty_card_rescan_tasks( CompactibleFreeListSpace* sp, int i, - Par_MarkRefsIntoAndScanClosure* cl) { + ParMarkRefsIntoAndScanClosure* cl) { // Until all tasks completed: // . claim an unclaimed task // . compute region boundaries corresponding to task claimed @@ -4614,7 +4614,7 @@ CMSParRemarkTask::do_dirty_card_rescan_tasks( // . see if we can share work_queues with ParNew? XXX void -CMSParRemarkTask::do_work_steal(int i, Par_MarkRefsIntoAndScanClosure* cl, +CMSParRemarkTask::do_work_steal(int i, ParMarkRefsIntoAndScanClosure* cl, int* seed) { OopTaskQueue* work_q = work_queue(i); NOT_PRODUCT(int num_steals = 0;) @@ -5832,7 +5832,7 @@ void MarkRefsIntoClosure::do_oop(oop obj) { void MarkRefsIntoClosure::do_oop(oop* p) { MarkRefsIntoClosure::do_oop_work(p); } void MarkRefsIntoClosure::do_oop(narrowOop* p) { MarkRefsIntoClosure::do_oop_work(p); } -Par_MarkRefsIntoClosure::Par_MarkRefsIntoClosure( +ParMarkRefsIntoClosure::ParMarkRefsIntoClosure( MemRegion span, CMSBitMap* bitMap): _span(span), _bitMap(bitMap) @@ -5841,7 +5841,7 @@ Par_MarkRefsIntoClosure::Par_MarkRefsIntoClosure( assert(_bitMap->covers(_span), "_bitMap/_span mismatch"); } -void Par_MarkRefsIntoClosure::do_oop(oop obj) { +void ParMarkRefsIntoClosure::do_oop(oop obj) { // if p points into _span, then mark corresponding bit in _markBitMap assert(obj->is_oop(), "expected an oop"); HeapWord* addr = (HeapWord*)obj; @@ -5851,8 +5851,8 @@ void Par_MarkRefsIntoClosure::do_oop(oop obj) { } } -void Par_MarkRefsIntoClosure::do_oop(oop* p) { Par_MarkRefsIntoClosure::do_oop_work(p); } -void Par_MarkRefsIntoClosure::do_oop(narrowOop* p) { Par_MarkRefsIntoClosure::do_oop_work(p); } +void ParMarkRefsIntoClosure::do_oop(oop* p) { ParMarkRefsIntoClosure::do_oop_work(p); } +void ParMarkRefsIntoClosure::do_oop(narrowOop* p) { ParMarkRefsIntoClosure::do_oop_work(p); } // A variant of the above, used for CMS marking verification. MarkRefsIntoVerifyClosure::MarkRefsIntoVerifyClosure( @@ -5989,10 +5989,10 @@ void MarkRefsIntoAndScanClosure::do_yield_work() { } /////////////////////////////////////////////////////////// -// Par_MarkRefsIntoAndScanClosure: a parallel version of -// MarkRefsIntoAndScanClosure +// ParMarkRefsIntoAndScanClosure: a parallel version of +// MarkRefsIntoAndScanClosure /////////////////////////////////////////////////////////// -Par_MarkRefsIntoAndScanClosure::Par_MarkRefsIntoAndScanClosure( +ParMarkRefsIntoAndScanClosure::ParMarkRefsIntoAndScanClosure( CMSCollector* collector, MemRegion span, ReferenceProcessor* rp, CMSBitMap* bit_map, OopTaskQueue* work_queue): _span(span), @@ -6000,7 +6000,7 @@ Par_MarkRefsIntoAndScanClosure::Par_MarkRefsIntoAndScanClosure( _work_queue(work_queue), _low_water_mark(MIN2((work_queue->max_elems()/4), ((uint)CMSWorkQueueDrainThreshold * ParallelGCThreads))), - _par_pushAndMarkClosure(collector, span, rp, bit_map, work_queue) + _parPushAndMarkClosure(collector, span, rp, bit_map, work_queue) { // FIXME: Should initialize in base class constructor. assert(rp != NULL, "ref_processor shouldn't be NULL"); @@ -6014,7 +6014,7 @@ Par_MarkRefsIntoAndScanClosure::Par_MarkRefsIntoAndScanClosure( // the scan phase whence they are also available for stealing by parallel // threads. Since the marking bit map is shared, updates are // synchronized (via CAS). -void Par_MarkRefsIntoAndScanClosure::do_oop(oop obj) { +void ParMarkRefsIntoAndScanClosure::do_oop(oop obj) { if (obj != NULL) { // Ignore mark word because this could be an already marked oop // that may be chained at the end of the overflow list. @@ -6041,8 +6041,8 @@ void Par_MarkRefsIntoAndScanClosure::do_oop(oop obj) { } } -void Par_MarkRefsIntoAndScanClosure::do_oop(oop* p) { Par_MarkRefsIntoAndScanClosure::do_oop_work(p); } -void Par_MarkRefsIntoAndScanClosure::do_oop(narrowOop* p) { Par_MarkRefsIntoAndScanClosure::do_oop_work(p); } +void ParMarkRefsIntoAndScanClosure::do_oop(oop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } +void ParMarkRefsIntoAndScanClosure::do_oop(narrowOop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } // This closure is used to rescan the marked objects on the dirty cards // in the mod union table and the card table proper. @@ -6426,7 +6426,7 @@ void MarkFromRootsClosure::scanOopsInOop(HeapWord* ptr) { assert(_markStack->isEmpty(), "tautology, emphasizing post-condition"); } -Par_MarkFromRootsClosure::Par_MarkFromRootsClosure(CMSConcMarkingTask* task, +ParMarkFromRootsClosure::ParMarkFromRootsClosure(CMSConcMarkingTask* task, CMSCollector* collector, MemRegion span, CMSBitMap* bit_map, OopTaskQueue* work_queue, @@ -6449,7 +6449,7 @@ Par_MarkFromRootsClosure::Par_MarkFromRootsClosure(CMSConcMarkingTask* task, // Should revisit to see if this should be restructured for // greater efficiency. -bool Par_MarkFromRootsClosure::do_bit(size_t offset) { +bool ParMarkFromRootsClosure::do_bit(size_t offset) { if (_skip_bits > 0) { _skip_bits--; return true; @@ -6474,7 +6474,7 @@ bool Par_MarkFromRootsClosure::do_bit(size_t offset) { return true; } -void Par_MarkFromRootsClosure::scan_oops_in_oop(HeapWord* ptr) { +void ParMarkFromRootsClosure::scan_oops_in_oop(HeapWord* ptr) { assert(_bit_map->isMarked(ptr), "expected bit to be set"); // Should we assert that our work queue is empty or // below some drain limit? @@ -6524,12 +6524,12 @@ void Par_MarkFromRootsClosure::scan_oops_in_oop(HeapWord* ptr) { // Note: the local finger doesn't advance while we drain // the stack below, but the global finger sure can and will. HeapWord** gfa = _task->global_finger_addr(); - Par_PushOrMarkClosure pushOrMarkClosure(_collector, - _span, _bit_map, - _work_queue, - _overflow_stack, - _finger, - gfa, this); + ParPushOrMarkClosure pushOrMarkClosure(_collector, + _span, _bit_map, + _work_queue, + _overflow_stack, + _finger, + gfa, this); bool res = _work_queue->push(obj); // overflow could occur here assert(res, "Will hold once we use workqueues"); while (true) { @@ -6557,7 +6557,7 @@ void Par_MarkFromRootsClosure::scan_oops_in_oop(HeapWord* ptr) { // Yield in response to a request from VM Thread or // from mutators. -void Par_MarkFromRootsClosure::do_yield_work() { +void ParMarkFromRootsClosure::do_yield_work() { assert(_task != NULL, "sanity"); _task->yield(); } @@ -6684,14 +6684,14 @@ PushOrMarkClosure::PushOrMarkClosure(CMSCollector* collector, _parent(parent) { } -Par_PushOrMarkClosure::Par_PushOrMarkClosure(CMSCollector* collector, - MemRegion span, - CMSBitMap* bit_map, - OopTaskQueue* work_queue, - CMSMarkStack* overflow_stack, - HeapWord* finger, - HeapWord** global_finger_addr, - Par_MarkFromRootsClosure* parent) : +ParPushOrMarkClosure::ParPushOrMarkClosure(CMSCollector* collector, + MemRegion span, + CMSBitMap* bit_map, + OopTaskQueue* work_queue, + CMSMarkStack* overflow_stack, + HeapWord* finger, + HeapWord** global_finger_addr, + ParMarkFromRootsClosure* parent) : MetadataAwareOopClosure(collector->ref_processor()), _collector(collector), _whole_span(collector->_span), @@ -6729,7 +6729,7 @@ void PushOrMarkClosure::handle_stack_overflow(HeapWord* lost) { // Upon stack overflow, we discard (part of) the stack, // remembering the least address amongst those discarded // in CMSCollector's _restart_address. -void Par_PushOrMarkClosure::handle_stack_overflow(HeapWord* lost) { +void ParPushOrMarkClosure::handle_stack_overflow(HeapWord* lost) { // We need to do this under a mutex to prevent other // workers from interfering with the work done below. MutexLockerEx ml(_overflow_stack->par_lock(), @@ -6776,7 +6776,7 @@ void PushOrMarkClosure::do_oop(oop obj) { void PushOrMarkClosure::do_oop(oop* p) { PushOrMarkClosure::do_oop_work(p); } void PushOrMarkClosure::do_oop(narrowOop* p) { PushOrMarkClosure::do_oop_work(p); } -void Par_PushOrMarkClosure::do_oop(oop obj) { +void ParPushOrMarkClosure::do_oop(oop obj) { // Ignore mark word because we are running concurrent with mutators. assert(obj->is_oop_or_null(true), "Expected an oop or NULL at " PTR_FORMAT, p2i(obj)); HeapWord* addr = (HeapWord*)obj; @@ -6822,8 +6822,8 @@ void Par_PushOrMarkClosure::do_oop(oop obj) { } } -void Par_PushOrMarkClosure::do_oop(oop* p) { Par_PushOrMarkClosure::do_oop_work(p); } -void Par_PushOrMarkClosure::do_oop(narrowOop* p) { Par_PushOrMarkClosure::do_oop_work(p); } +void ParPushOrMarkClosure::do_oop(oop* p) { ParPushOrMarkClosure::do_oop_work(p); } +void ParPushOrMarkClosure::do_oop(narrowOop* p) { ParPushOrMarkClosure::do_oop_work(p); } PushAndMarkClosure::PushAndMarkClosure(CMSCollector* collector, MemRegion span, @@ -6900,11 +6900,11 @@ void PushAndMarkClosure::do_oop(oop obj) { } } -Par_PushAndMarkClosure::Par_PushAndMarkClosure(CMSCollector* collector, - MemRegion span, - ReferenceProcessor* rp, - CMSBitMap* bit_map, - OopTaskQueue* work_queue): +ParPushAndMarkClosure::ParPushAndMarkClosure(CMSCollector* collector, + MemRegion span, + ReferenceProcessor* rp, + CMSBitMap* bit_map, + OopTaskQueue* work_queue): MetadataAwareOopClosure(rp), _collector(collector), _span(span), @@ -6919,7 +6919,7 @@ void PushAndMarkClosure::do_oop(narrowOop* p) { PushAndMarkClosure::do_oop_work( // Grey object rescan during second checkpoint phase -- // the parallel version. -void Par_PushAndMarkClosure::do_oop(oop obj) { +void ParPushAndMarkClosure::do_oop(oop obj) { // In the assert below, we ignore the mark word because // this oop may point to an already visited object that is // on the overflow stack (in which case the mark word has @@ -6959,8 +6959,8 @@ void Par_PushAndMarkClosure::do_oop(oop obj) { } } -void Par_PushAndMarkClosure::do_oop(oop* p) { Par_PushAndMarkClosure::do_oop_work(p); } -void Par_PushAndMarkClosure::do_oop(narrowOop* p) { Par_PushAndMarkClosure::do_oop_work(p); } +void ParPushAndMarkClosure::do_oop(oop* p) { ParPushAndMarkClosure::do_oop_work(p); } +void ParPushAndMarkClosure::do_oop(narrowOop* p) { ParPushAndMarkClosure::do_oop_work(p); } void CMSPrecleanRefsYieldClosure::do_yield_work() { Mutex* bml = _collector->bitMapLock(); diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp index ead101fce85..29636c60060 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp @@ -510,17 +510,17 @@ class CMSCollector: public CHeapObj { friend class ScanMarkedObjectsAgainCarefullyClosure; // for sampling eden friend class SurvivorSpacePrecleanClosure; // --- ditto ------- friend class PushOrMarkClosure; // to access _restart_addr - friend class Par_PushOrMarkClosure; // to access _restart_addr + friend class ParPushOrMarkClosure; // to access _restart_addr friend class MarkFromRootsClosure; // -- ditto -- // ... and for clearing cards - friend class Par_MarkFromRootsClosure; // to access _restart_addr + friend class ParMarkFromRootsClosure; // to access _restart_addr // ... and for clearing cards - friend class Par_ConcMarkingClosure; // to access _restart_addr etc. + friend class ParConcMarkingClosure; // to access _restart_addr etc. friend class MarkFromRootsVerifyClosure; // to access _restart_addr friend class PushAndMarkVerifyClosure; // -- ditto -- friend class MarkRefsIntoAndScanClosure; // to access _overflow_list friend class PushAndMarkClosure; // -- ditto -- - friend class Par_PushAndMarkClosure; // -- ditto -- + friend class ParPushAndMarkClosure; // -- ditto -- friend class CMSKeepAliveClosure; // -- ditto -- friend class CMSDrainMarkingStackClosure; // -- ditto -- friend class CMSInnerParMarkAndPushClosure; // -- ditto -- @@ -1282,7 +1282,7 @@ class MarkFromRootsClosure: public BitMapClosure { // marking from the roots following the first checkpoint. // XXX This should really be a subclass of The serial version // above, but i have not had the time to refactor things cleanly. -class Par_MarkFromRootsClosure: public BitMapClosure { +class ParMarkFromRootsClosure: public BitMapClosure { CMSCollector* _collector; MemRegion _whole_span; MemRegion _span; @@ -1295,11 +1295,11 @@ class Par_MarkFromRootsClosure: public BitMapClosure { HeapWord* _threshold; CMSConcMarkingTask* _task; public: - Par_MarkFromRootsClosure(CMSConcMarkingTask* task, CMSCollector* collector, - MemRegion span, - CMSBitMap* bit_map, - OopTaskQueue* work_queue, - CMSMarkStack* overflow_stack); + ParMarkFromRootsClosure(CMSConcMarkingTask* task, CMSCollector* collector, + MemRegion span, + CMSBitMap* bit_map, + OopTaskQueue* work_queue, + CMSMarkStack* overflow_stack); bool do_bit(size_t offset); inline void do_yield_check(); @@ -1400,8 +1400,8 @@ class ScanMarkedObjectsAgainClosure: public UpwardsObjectClosure { bool _parallel; CMSBitMap* _bit_map; union { - MarkRefsIntoAndScanClosure* _scan_closure; - Par_MarkRefsIntoAndScanClosure* _par_scan_closure; + MarkRefsIntoAndScanClosure* _scan_closure; + ParMarkRefsIntoAndScanClosure* _par_scan_closure; }; public: @@ -1425,7 +1425,7 @@ class ScanMarkedObjectsAgainClosure: public UpwardsObjectClosure { ReferenceProcessor* rp, CMSBitMap* bit_map, OopTaskQueue* work_queue, - Par_MarkRefsIntoAndScanClosure* cl): + ParMarkRefsIntoAndScanClosure* cl): #ifdef ASSERT _collector(collector), _span(span), @@ -1470,7 +1470,7 @@ class MarkFromDirtyCardsClosure: public MemRegionClosure { CompactibleFreeListSpace* space, CMSBitMap* bit_map, OopTaskQueue* work_queue, - Par_MarkRefsIntoAndScanClosure* cl): + ParMarkRefsIntoAndScanClosure* cl): _space(space), _num_dirty_cards(0), _scan_cl(collector, span, collector->ref_processor(), bit_map, diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.inline.hpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.inline.hpp index d2a76256702..97ff69d611c 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.inline.hpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.inline.hpp @@ -381,7 +381,7 @@ inline void MarkFromRootsClosure::do_yield_check() { } } -inline void Par_MarkFromRootsClosure::do_yield_check() { +inline void ParMarkFromRootsClosure::do_yield_check() { if (ConcurrentMarkSweepThread::should_yield() && !_collector->foregroundGCIsActive()) { do_yield_work(); @@ -392,7 +392,7 @@ inline void PushOrMarkClosure::do_yield_check() { _parent->do_yield_check(); } -inline void Par_PushOrMarkClosure::do_yield_check() { +inline void ParPushOrMarkClosure::do_yield_check() { _parent->do_yield_check(); } diff --git a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp index 2cd32b097dc..9918dd00edc 100644 --- a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp @@ -455,7 +455,7 @@ void ParScanThreadStateSet::flush() { // Every thread has its own age table. We need to merge // them all into one. - ageTable *local_table = par_scan_state.age_table(); + AgeTable *local_table = par_scan_state.age_table(); _young_gen.age_table()->merge(local_table); // Inform old gen that we're done. @@ -469,7 +469,7 @@ void ParScanThreadStateSet::flush() { // to avoid this by reorganizing the code a bit, I am loathe // to do that unless we find cases where ergo leads to bad // performance. - CFLS_LAB::compute_desired_plab_size(); + CompactibleFreeListSpaceLAB::compute_desired_plab_size(); } } diff --git a/hotspot/src/share/vm/gc/cms/parNewGeneration.hpp b/hotspot/src/share/vm/gc/cms/parNewGeneration.hpp index 428c195f96c..765ea72962e 100644 --- a/hotspot/src/share/vm/gc/cms/parNewGeneration.hpp +++ b/hotspot/src/share/vm/gc/cms/parNewGeneration.hpp @@ -94,7 +94,7 @@ class ParScanThreadState { int _hash_seed; int _thread_num; - ageTable _ageTable; + AgeTable _ageTable; bool _to_space_full; @@ -132,7 +132,7 @@ class ParScanThreadState { ParallelTaskTerminator& term_); public: - ageTable* age_table() {return &_ageTable;} + AgeTable* age_table() {return &_ageTable;} ObjToScanQueue* work_queue() { return _work_queue; } diff --git a/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp b/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp index dcdfa854377..e26b3842a9a 100644 --- a/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp +++ b/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp @@ -203,7 +203,7 @@ void VM_GenCollectFullConcurrent::doit() { gch->do_full_collection(gch->must_clear_all_soft_refs(), GenCollectedHeap::YoungGen); } // Else no need for a foreground young gc assert((_gc_count_before < gch->total_collections()) || - (GC_locker::is_active() /* gc may have been skipped */ + (GCLocker::is_active() /* gc may have been skipped */ && (_gc_count_before == gch->total_collections())), "total_collections() should be monotonically increasing"); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index 1bd7a8faedb..3cca38b143f 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -601,7 +601,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, return result; } - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { if (g1_policy()->can_expand_young_list()) { // No need for an ergo verbose message here, // can_expand_young_list() does this when it returns true. @@ -617,7 +617,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, // returns true). In this case we do not try this GC and // wait until the GCLocker initiated GC is performed, and // then retry the allocation. - if (GC_locker::needs_gc()) { + if (GCLocker::needs_gc()) { should_try_gc = false; } else { // Read the GC count while still holding the Heap_lock. @@ -653,7 +653,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, // The GCLocker is either active or the GCLocker initiated // GC has not yet been performed. Stall until it is and // then retry the allocation. - GC_locker::stall_until_clear(); + GCLocker::stall_until_clear(); (*gclocker_retry_count_ret) += 1; } @@ -1028,7 +1028,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, return result; } - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { should_try_gc = false; } else { // The GCLocker may not be active but the GCLocker initiated @@ -1036,7 +1036,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, // returns true). In this case we do not try this GC and // wait until the GCLocker initiated GC is performed, and // then retry the allocation. - if (GC_locker::needs_gc()) { + if (GCLocker::needs_gc()) { should_try_gc = false; } else { // Read the GC count while still holding the Heap_lock. @@ -1076,7 +1076,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, // The GCLocker is either active or the GCLocker initiated // GC has not yet been performed. Stall until it is and // then retry the allocation. - GC_locker::stall_until_clear(); + GCLocker::stall_until_clear(); (*gclocker_retry_count_ret) += 1; } @@ -1211,7 +1211,7 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, bool clear_all_soft_refs) { assert_at_safepoint(true /* should_be_vm_thread */); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return false; } @@ -2396,8 +2396,8 @@ void G1CollectedHeap::collect(GCCause::Cause cause) { } if (retry_gc) { - if (GC_locker::is_active_and_needs_gc()) { - GC_locker::stall_until_clear(); + if (GCLocker::is_active_and_needs_gc()) { + GCLocker::stall_until_clear(); } } } @@ -3629,7 +3629,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { assert_at_safepoint(true /* should_be_vm_thread */); guarantee(!is_gc_active(), "collection is not reentrant"); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return false; } diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp index d742f852a49..530eddb8f74 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp @@ -841,7 +841,7 @@ private: HeapRegion* _recorded_survivor_head; HeapRegion* _recorded_survivor_tail; - ageTable _survivors_age_table; + AgeTable _survivors_age_table; public: uint tenuring_threshold() const { return _tenuring_threshold; } @@ -882,7 +882,7 @@ public: return _recorded_survivor_regions; } - void record_age_table(ageTable* age_table) { + void record_age_table(AgeTable* age_table) { _survivors_age_table.merge(age_table); } diff --git a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp index 9f3ace0705b..47c5328d2b9 100644 --- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp +++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp @@ -50,7 +50,7 @@ class G1ParScanThreadState : public CHeapObj { G1PLABAllocator* _plab_allocator; - ageTable _age_table; + AgeTable _age_table; InCSetState _dest[InCSetState::Num]; // Local tenuring threshold. uint _tenuring_threshold; diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp index 95b5bccff10..3e092fe8c38 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp @@ -96,7 +96,7 @@ void G1StringDedupQueue::push(uint worker_id, oop java_string) { oop G1StringDedupQueue::pop() { assert(!SafepointSynchronize::is_at_safepoint(), "Must not be at safepoint"); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // Try all queues before giving up for (size_t tries = 0; tries < _queue->_nqueues; tries++) { diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp index 16519b4a3e5..47a8f40b460 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp @@ -299,7 +299,7 @@ unsigned int G1StringDedupTable::hash_code(typeArrayOop value, bool latin1) { void G1StringDedupTable::deduplicate(oop java_string, G1StringDedupStat& stat) { assert(java_lang_String::is_instance(java_string), "Must be a string"); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; stat.inc_inspected(); diff --git a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp index f14aefa7943..cfe23356b5a 100644 --- a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp @@ -250,7 +250,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate( } // Failed to allocate without a gc. - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { // If this thread is not in a jni critical section, we stall // the requestor until the critical section has cleared and // GC allowed. When the critical section clears, a GC is @@ -260,7 +260,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate( JavaThread* jthr = JavaThread::current(); if (!jthr->in_critical()) { MutexUnlocker mul(Heap_lock); - GC_locker::stall_until_clear(); + GCLocker::stall_until_clear(); gclocker_stalled_count += 1; continue; } else { @@ -350,7 +350,7 @@ ParallelScavengeHeap::death_march_check(HeapWord* const addr, size_t size) { } HeapWord* ParallelScavengeHeap::mem_allocate_old_gen(size_t size) { - if (!should_alloc_in_eden(size) || GC_locker::is_active_and_needs_gc()) { + if (!should_alloc_in_eden(size) || GCLocker::is_active_and_needs_gc()) { // Size is too big for eden, or gc is locked out. return old_gen()->allocate(size); } diff --git a/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp b/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp index 75fed6c0c40..4b8bcf77c71 100644 --- a/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp +++ b/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp @@ -109,7 +109,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); assert(ref_processor() != NULL, "Sanity"); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return false; } diff --git a/hotspot/src/share/vm/gc/parallel/psOldGen.cpp b/hotspot/src/share/vm/gc/parallel/psOldGen.cpp index 42160922637..0a89c5f9d22 100644 --- a/hotspot/src/share/vm/gc/parallel/psOldGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/psOldGen.cpp @@ -257,7 +257,7 @@ void PSOldGen::expand(size_t bytes) { success = expand_to_reserved(); } - if (success && GC_locker::is_active_and_needs_gc()) { + if (success && GCLocker::is_active_and_needs_gc()) { log_debug(gc)("Garbage collection disabled, expanded heap instead"); } } diff --git a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp index 2e5e266a4fd..2198705943a 100644 --- a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp @@ -1717,7 +1717,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); assert(ref_processor() != NULL, "Sanity"); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return false; } diff --git a/hotspot/src/share/vm/gc/parallel/psScavenge.cpp b/hotspot/src/share/vm/gc/parallel/psScavenge.cpp index 648db23dab7..6b9e9318b0b 100644 --- a/hotspot/src/share/vm/gc/parallel/psScavenge.cpp +++ b/hotspot/src/share/vm/gc/parallel/psScavenge.cpp @@ -268,7 +268,7 @@ bool PSScavenge::invoke_no_policy() { scavenge_entry.update(); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return false; } diff --git a/hotspot/src/share/vm/gc/parallel/vmPSOperations.cpp b/hotspot/src/share/vm/gc/parallel/vmPSOperations.cpp index 931ec86313d..4b77aded056 100644 --- a/hotspot/src/share/vm/gc/parallel/vmPSOperations.cpp +++ b/hotspot/src/share/vm/gc/parallel/vmPSOperations.cpp @@ -45,7 +45,7 @@ void VM_ParallelGCFailedAllocation::doit() { GCCauseSetter gccs(heap, _gc_cause); _result = heap->failed_mem_allocate(_word_size); - if (_result == NULL && GC_locker::is_active_and_needs_gc()) { + if (_result == NULL && GCLocker::is_active_and_needs_gc()) { set_gc_locked(); } } diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp index 765a45c7358..e86037cc5d9 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp @@ -357,7 +357,7 @@ bool DefNewGeneration::expand(size_t bytes) { // For example if the first expand fail for unknown reasons, // but the second succeeds and expands the heap to its maximum // value. - if (GC_locker::is_active()) { + if (GCLocker::is_active()) { log_debug(gc)("Garbage collection disabled, expanded heap instead"); } @@ -527,7 +527,7 @@ void DefNewGeneration::space_iterate(SpaceClosure* blk, // The last collection bailed out, we are running out of heap space, // so we try to allocate the from-space, too. HeapWord* DefNewGeneration::allocate_from_space(size_t size) { - bool should_try_alloc = should_allocate_from_space() || GC_locker::is_active_and_needs_gc(); + bool should_try_alloc = should_allocate_from_space() || GCLocker::is_active_and_needs_gc(); // If the Heap_lock is not locked by this thread, this will be called // again later with the Heap_lock held. @@ -910,7 +910,7 @@ bool DefNewGeneration::collection_attempt_is_safe() { void DefNewGeneration::gc_epilogue(bool full) { DEBUG_ONLY(static bool seen_incremental_collection_failed = false;) - assert(!GC_locker::is_active(), "We should not be executing here"); + assert(!GCLocker::is_active(), "We should not be executing here"); // Check if the heap is approaching full after a collection has // been done. Generally the young generation is empty at // a minimum at the end of a collection. If it is not, then diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp index 70f719e7917..f42c8ed8b47 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp @@ -47,11 +47,11 @@ class DefNewGeneration: public Generation { protected: Generation* _old_gen; uint _tenuring_threshold; // Tenuring threshold for next collection. - ageTable _age_table; + AgeTable _age_table; // Size of object to pretenure in words; command line provides bytes size_t _pretenure_size_threshold_words; - ageTable* age_table() { return &_age_table; } + AgeTable* age_table() { return &_age_table; } // Initialize state to optimistically assume no promotion failure will // happen. diff --git a/hotspot/src/share/vm/gc/shared/ageTable.cpp b/hotspot/src/share/vm/gc/shared/ageTable.cpp index 2b9b46321c2..cf6542ddf11 100644 --- a/hotspot/src/share/vm/gc/shared/ageTable.cpp +++ b/hotspot/src/share/vm/gc/shared/ageTable.cpp @@ -34,7 +34,7 @@ /* Copyright (c) 1992, 2015, Oracle and/or its affiliates, and Stanford University. See the LICENSE file for license information. */ -ageTable::ageTable(bool global) { +AgeTable::AgeTable(bool global) { clear(); @@ -61,19 +61,19 @@ ageTable::ageTable(bool global) { } } -void ageTable::clear() { +void AgeTable::clear() { for (size_t* p = sizes; p < sizes + table_size; ++p) { *p = 0; } } -void ageTable::merge(ageTable* subTable) { +void AgeTable::merge(AgeTable* subTable) { for (int i = 0; i < table_size; i++) { sizes[i]+= subTable->sizes[i]; } } -uint ageTable::compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCounters* gc_counters) { +uint AgeTable::compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCounters* gc_counters) { size_t desired_survivor_size = (size_t)((((double) survivor_capacity)*TargetSurvivorRatio)/100); uint result; diff --git a/hotspot/src/share/vm/gc/shared/ageTable.hpp b/hotspot/src/share/vm/gc/shared/ageTable.hpp index 588cd9e5c72..b0724101642 100644 --- a/hotspot/src/share/vm/gc/shared/ageTable.hpp +++ b/hotspot/src/share/vm/gc/shared/ageTable.hpp @@ -38,7 +38,7 @@ class GCPolicyCounters; // // Note: all sizes are in oops -class ageTable VALUE_OBJ_CLASS_SPEC { +class AgeTable VALUE_OBJ_CLASS_SPEC { friend class VMStructs; public: @@ -50,7 +50,7 @@ class ageTable VALUE_OBJ_CLASS_SPEC { // constructor. "global" indicates that this is the global age table // (as opposed to gc-thread-local) - ageTable(bool global = true); + AgeTable(bool global = true); // clear table void clear(); @@ -67,7 +67,7 @@ class ageTable VALUE_OBJ_CLASS_SPEC { // Merge another age table with the current one. Used // for parallel young generation gc. - void merge(ageTable* subTable); + void merge(AgeTable* subTable); // calculate new tenuring threshold based on age information uint compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCounters* gc_counters); diff --git a/hotspot/src/share/vm/gc/shared/cardGeneration.cpp b/hotspot/src/share/vm/gc/shared/cardGeneration.cpp index c43f0822358..dd448d4cf25 100644 --- a/hotspot/src/share/vm/gc/shared/cardGeneration.cpp +++ b/hotspot/src/share/vm/gc/shared/cardGeneration.cpp @@ -131,7 +131,7 @@ bool CardGeneration::expand(size_t bytes, size_t expand_bytes) { if (!success) { success = grow_to_reserved(); } - if (success && GC_locker::is_active_and_needs_gc()) { + if (success && GCLocker::is_active_and_needs_gc()) { log_trace(gc, heap)("Garbage collection disabled, expanded heap instead"); } diff --git a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp index 223c9063b12..c958c0da70b 100644 --- a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp @@ -620,7 +620,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size, return result; } - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { if (is_tlab) { return NULL; // Caller will retry allocating individual object. } @@ -647,7 +647,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size, if (!jthr->in_critical()) { MutexUnlocker mul(Heap_lock); // Wait for JNI critical section to be exited - GC_locker::stall_until_clear(); + GCLocker::stall_until_clear(); gclocker_stalled_count += 1; continue; } else { @@ -728,7 +728,7 @@ HeapWord* GenCollectorPolicy::satisfy_failed_allocation(size_t size, HeapWord* result = NULL; assert(size != 0, "Precondition violated"); - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { // GC locker is active; instead of a collection we will attempt // to expand the heap, if there's room for expansion. if (!gch->is_maximal_no_gc()) { @@ -815,8 +815,8 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation( return result; } - if (GC_locker::is_active_and_needs_gc()) { - // If the GC_locker is active, just expand and allocate. + if (GCLocker::is_active_and_needs_gc()) { + // If the GCLocker is active, just expand and allocate. // If that does not succeed, wait if this thread is not // in a critical section itself. result = @@ -828,7 +828,7 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation( JavaThread* jthr = JavaThread::current(); if (!jthr->in_critical()) { // Wait for JNI critical section to be exited - GC_locker::stall_until_clear(); + GCLocker::stall_until_clear(); // The GC invoked by the last thread leaving the critical // section will be a young collection and a full collection // is (currently) needed for unloading classes so continue @@ -887,7 +887,7 @@ bool GenCollectorPolicy::should_try_older_generation_allocation( GenCollectedHeap* gch = GenCollectedHeap::heap(); size_t young_capacity = gch->young_gen()->capacity_before_gc(); return (word_size > heap_word_size(young_capacity)) - || GC_locker::is_active_and_needs_gc() + || GCLocker::is_active_and_needs_gc() || gch->incremental_collection_failed(); } diff --git a/hotspot/src/share/vm/gc/shared/gcLocker.cpp b/hotspot/src/share/vm/gc/shared/gcLocker.cpp index 3b3b8448f7d..115115d0a61 100644 --- a/hotspot/src/share/vm/gc/shared/gcLocker.cpp +++ b/hotspot/src/share/vm/gc/shared/gcLocker.cpp @@ -30,17 +30,17 @@ #include "runtime/atomic.inline.hpp" #include "runtime/thread.inline.hpp" -volatile jint GC_locker::_jni_lock_count = 0; -volatile bool GC_locker::_needs_gc = false; -volatile bool GC_locker::_doing_gc = false; +volatile jint GCLocker::_jni_lock_count = 0; +volatile bool GCLocker::_needs_gc = false; +volatile bool GCLocker::_doing_gc = false; #ifdef ASSERT -volatile jint GC_locker::_debug_jni_lock_count = 0; +volatile jint GCLocker::_debug_jni_lock_count = 0; #endif #ifdef ASSERT -void GC_locker::verify_critical_count() { +void GCLocker::verify_critical_count() { if (SafepointSynchronize::is_at_safepoint()) { assert(!needs_gc() || _debug_jni_lock_count == _jni_lock_count, "must agree"); int count = 0; @@ -63,18 +63,18 @@ void GC_locker::verify_critical_count() { } // In debug mode track the locking state at all times -void GC_locker::increment_debug_jni_lock_count() { +void GCLocker::increment_debug_jni_lock_count() { assert(_debug_jni_lock_count >= 0, "bad value"); Atomic::inc(&_debug_jni_lock_count); } -void GC_locker::decrement_debug_jni_lock_count() { +void GCLocker::decrement_debug_jni_lock_count() { assert(_debug_jni_lock_count > 0, "bad value"); Atomic::dec(&_debug_jni_lock_count); } #endif -void GC_locker::log_debug_jni(const char* msg) { +void GCLocker::log_debug_jni(const char* msg) { LogHandle(gc, jni) log; if (log.is_debug()) { ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 @@ -82,7 +82,7 @@ void GC_locker::log_debug_jni(const char* msg) { } } -bool GC_locker::check_active_before_gc() { +bool GCLocker::check_active_before_gc() { assert(SafepointSynchronize::is_at_safepoint(), "only read at safepoint"); if (is_active() && !_needs_gc) { verify_critical_count(); @@ -92,7 +92,7 @@ bool GC_locker::check_active_before_gc() { return is_active(); } -void GC_locker::stall_until_clear() { +void GCLocker::stall_until_clear() { assert(!JavaThread::current()->in_critical(), "Would deadlock"); MutexLocker ml(JNICritical_lock); @@ -106,7 +106,7 @@ void GC_locker::stall_until_clear() { } } -void GC_locker::jni_lock(JavaThread* thread) { +void GCLocker::jni_lock(JavaThread* thread) { assert(!thread->in_critical(), "shouldn't currently be in a critical region"); MutexLocker mu(JNICritical_lock); // Block entering threads if we know at least one thread is in a @@ -122,7 +122,7 @@ void GC_locker::jni_lock(JavaThread* thread) { increment_debug_jni_lock_count(); } -void GC_locker::jni_unlock(JavaThread* thread) { +void GCLocker::jni_unlock(JavaThread* thread) { assert(thread->in_last_critical(), "should be exiting critical region"); MutexLocker mu(JNICritical_lock); _jni_lock_count--; @@ -143,49 +143,49 @@ void GC_locker::jni_unlock(JavaThread* thread) { } } -// Implementation of No_GC_Verifier +// Implementation of NoGCVerifier #ifdef ASSERT -No_GC_Verifier::No_GC_Verifier(bool verifygc) { +NoGCVerifier::NoGCVerifier(bool verifygc) { _verifygc = verifygc; if (_verifygc) { CollectedHeap* h = Universe::heap(); - assert(!h->is_gc_active(), "GC active during No_GC_Verifier"); + assert(!h->is_gc_active(), "GC active during NoGCVerifier"); _old_invocations = h->total_collections(); } } -No_GC_Verifier::~No_GC_Verifier() { +NoGCVerifier::~NoGCVerifier() { if (_verifygc) { CollectedHeap* h = Universe::heap(); - assert(!h->is_gc_active(), "GC active during No_GC_Verifier"); + assert(!h->is_gc_active(), "GC active during NoGCVerifier"); if (_old_invocations != h->total_collections()) { - fatal("collection in a No_GC_Verifier secured function"); + fatal("collection in a NoGCVerifier secured function"); } } } -Pause_No_GC_Verifier::Pause_No_GC_Verifier(No_GC_Verifier * ngcv) { +PauseNoGCVerifier::PauseNoGCVerifier(NoGCVerifier * ngcv) { _ngcv = ngcv; if (_ngcv->_verifygc) { // if we were verifying, then make sure that nothing is // wrong before we "pause" verification CollectedHeap* h = Universe::heap(); - assert(!h->is_gc_active(), "GC active during No_GC_Verifier"); + assert(!h->is_gc_active(), "GC active during NoGCVerifier"); if (_ngcv->_old_invocations != h->total_collections()) { - fatal("collection in a No_GC_Verifier secured function"); + fatal("collection in a NoGCVerifier secured function"); } } } -Pause_No_GC_Verifier::~Pause_No_GC_Verifier() { +PauseNoGCVerifier::~PauseNoGCVerifier() { if (_ngcv->_verifygc) { // if we were verifying before, then reenable verification CollectedHeap* h = Universe::heap(); - assert(!h->is_gc_active(), "GC active during No_GC_Verifier"); + assert(!h->is_gc_active(), "GC active during NoGCVerifier"); _ngcv->_old_invocations = h->total_collections(); } } @@ -201,16 +201,16 @@ Pause_No_GC_Verifier::~Pause_No_GC_Verifier() { // 6) reaching a safepoint // 7) running too long // Nor may any method it calls. -JRT_Leaf_Verifier::JRT_Leaf_Verifier() - : No_Safepoint_Verifier(true, JRT_Leaf_Verifier::should_verify_GC()) +JRTLeafVerifier::JRTLeafVerifier() + : NoSafepointVerifier(true, JRTLeafVerifier::should_verify_GC()) { } -JRT_Leaf_Verifier::~JRT_Leaf_Verifier() +JRTLeafVerifier::~JRTLeafVerifier() { } -bool JRT_Leaf_Verifier::should_verify_GC() { +bool JRTLeafVerifier::should_verify_GC() { switch (JavaThread::current()->thread_state()) { case _thread_in_Java: // is in a leaf routine, there must be no safepoint. diff --git a/hotspot/src/share/vm/gc/shared/gcLocker.hpp b/hotspot/src/share/vm/gc/shared/gcLocker.hpp index d4134dc2fb6..846242376f4 100644 --- a/hotspot/src/share/vm/gc/shared/gcLocker.hpp +++ b/hotspot/src/share/vm/gc/shared/gcLocker.hpp @@ -33,12 +33,12 @@ // The direct lock/unlock calls do not force a collection if an unlock // decrements the count to zero. Avoid calling these if at all possible. -class GC_locker: public AllStatic { +class GCLocker: public AllStatic { private: // The _jni_lock_count keeps track of the number of threads that are // currently in a critical region. It's only kept up to date when // _needs_gc is true. The current value is computed during - // safepointing and decremented during the slow path of GC_locker + // safepointing and decremented during the slow path of GCLocker // unlocking. static volatile jint _jni_lock_count; // number of jni active instances. static volatile bool _needs_gc; // heap is filling, we need a GC @@ -103,7 +103,7 @@ class GC_locker: public AllStatic { static void stall_until_clear(); // The following two methods are used for JNI critical regions. - // If we find that we failed to perform a GC because the GC_locker + // If we find that we failed to perform a GC because the GCLocker // was active, arrange for one as soon as possible by allowing // all threads in critical regions to complete, but not allowing // other critical regions to be entered. The reasons for that are: @@ -126,7 +126,7 @@ class GC_locker: public AllStatic { // _needs_gc is initially false and every java thread will go // through the fast path, which simply increments or decrements the // current thread's critical count. When GC happens at a safepoint, - // GC_locker::is_active() is checked. Since there is no safepoint in + // GCLocker::is_active() is checked. Since there is no safepoint in // the fast path of lock_critical() and unlock_critical(), there is // no race condition between the fast path and GC. After _needs_gc // is set at a safepoint, every thread will go through the slow path @@ -142,14 +142,14 @@ class GC_locker: public AllStatic { }; -// A No_GC_Verifier object can be placed in methods where one assumes that +// A NoGCVerifier object can be placed in methods where one assumes that // no garbage collection will occur. The destructor will verify this property // unless the constructor is called with argument false (not verifygc). // // The check will only be done in debug mode and if verifygc true. -class No_GC_Verifier: public StackObj { - friend class Pause_No_GC_Verifier; +class NoGCVerifier: public StackObj { + friend class PauseNoGCVerifier; protected: bool _verifygc; @@ -157,51 +157,51 @@ class No_GC_Verifier: public StackObj { public: #ifdef ASSERT - No_GC_Verifier(bool verifygc = true); - ~No_GC_Verifier(); + NoGCVerifier(bool verifygc = true); + ~NoGCVerifier(); #else - No_GC_Verifier(bool verifygc = true) {} - ~No_GC_Verifier() {} + NoGCVerifier(bool verifygc = true) {} + ~NoGCVerifier() {} #endif }; -// A Pause_No_GC_Verifier is used to temporarily pause the behavior -// of a No_GC_Verifier object. If we are not in debug mode or if the -// No_GC_Verifier object has a _verifygc value of false, then there +// A PauseNoGCVerifier is used to temporarily pause the behavior +// of a NoGCVerifier object. If we are not in debug mode or if the +// NoGCVerifier object has a _verifygc value of false, then there // is nothing to do. -class Pause_No_GC_Verifier: public StackObj { +class PauseNoGCVerifier: public StackObj { private: - No_GC_Verifier * _ngcv; + NoGCVerifier * _ngcv; public: #ifdef ASSERT - Pause_No_GC_Verifier(No_GC_Verifier * ngcv); - ~Pause_No_GC_Verifier(); + PauseNoGCVerifier(NoGCVerifier * ngcv); + ~PauseNoGCVerifier(); #else - Pause_No_GC_Verifier(No_GC_Verifier * ngcv) {} - ~Pause_No_GC_Verifier() {} + PauseNoGCVerifier(NoGCVerifier * ngcv) {} + ~PauseNoGCVerifier() {} #endif }; -// A No_Safepoint_Verifier object will throw an assertion failure if +// A NoSafepointVerifier object will throw an assertion failure if // the current thread passes a possible safepoint while this object is // instantiated. A safepoint, will either be: an oop allocation, blocking // on a Mutex or JavaLock, or executing a VM operation. // -// If StrictSafepointChecks is turned off, it degrades into a No_GC_Verifier +// If StrictSafepointChecks is turned off, it degrades into a NoGCVerifier // -class No_Safepoint_Verifier : public No_GC_Verifier { - friend class Pause_No_Safepoint_Verifier; +class NoSafepointVerifier : public NoGCVerifier { + friend class PauseNoSafepointVerifier; private: bool _activated; Thread *_thread; public: #ifdef ASSERT - No_Safepoint_Verifier(bool activated = true, bool verifygc = true ) : - No_GC_Verifier(verifygc), + NoSafepointVerifier(bool activated = true, bool verifygc = true ) : + NoGCVerifier(verifygc), _activated(activated) { _thread = Thread::current(); if (_activated) { @@ -210,33 +210,33 @@ class No_Safepoint_Verifier : public No_GC_Verifier { } } - ~No_Safepoint_Verifier() { + ~NoSafepointVerifier() { if (_activated) { _thread->_allow_allocation_count--; _thread->_allow_safepoint_count--; } } #else - No_Safepoint_Verifier(bool activated = true, bool verifygc = true) : No_GC_Verifier(verifygc){} - ~No_Safepoint_Verifier() {} + NoSafepointVerifier(bool activated = true, bool verifygc = true) : NoGCVerifier(verifygc){} + ~NoSafepointVerifier() {} #endif }; -// A Pause_No_Safepoint_Verifier is used to temporarily pause the -// behavior of a No_Safepoint_Verifier object. If we are not in debug -// mode then there is nothing to do. If the No_Safepoint_Verifier +// A PauseNoSafepointVerifier is used to temporarily pause the +// behavior of a NoSafepointVerifier object. If we are not in debug +// mode then there is nothing to do. If the NoSafepointVerifier // object has an _activated value of false, then there is nothing to // do for safepoint and allocation checking, but there may still be -// something to do for the underlying No_GC_Verifier object. +// something to do for the underlying NoGCVerifier object. -class Pause_No_Safepoint_Verifier : public Pause_No_GC_Verifier { +class PauseNoSafepointVerifier : public PauseNoGCVerifier { private: - No_Safepoint_Verifier * _nsv; + NoSafepointVerifier * _nsv; public: #ifdef ASSERT - Pause_No_Safepoint_Verifier(No_Safepoint_Verifier * nsv) - : Pause_No_GC_Verifier(nsv) { + PauseNoSafepointVerifier(NoSafepointVerifier * nsv) + : PauseNoGCVerifier(nsv) { _nsv = nsv; if (_nsv->_activated) { @@ -245,16 +245,16 @@ class Pause_No_Safepoint_Verifier : public Pause_No_GC_Verifier { } } - ~Pause_No_Safepoint_Verifier() { + ~PauseNoSafepointVerifier() { if (_nsv->_activated) { _nsv->_thread->_allow_allocation_count++; _nsv->_thread->_allow_safepoint_count++; } } #else - Pause_No_Safepoint_Verifier(No_Safepoint_Verifier * nsv) - : Pause_No_GC_Verifier(nsv) {} - ~Pause_No_Safepoint_Verifier() {} + PauseNoSafepointVerifier(NoSafepointVerifier * nsv) + : PauseNoGCVerifier(nsv) {} + ~PauseNoSafepointVerifier() {} #endif }; @@ -287,19 +287,19 @@ class SkipGCALot : public StackObj { // _thread_in_native mode. In _thread_in_native, it is ok // for another thread to trigger GC. The rest of the JRT_LEAF // rules apply. -class JRT_Leaf_Verifier : public No_Safepoint_Verifier { +class JRTLeafVerifier : public NoSafepointVerifier { static bool should_verify_GC(); public: #ifdef ASSERT - JRT_Leaf_Verifier(); - ~JRT_Leaf_Verifier(); + JRTLeafVerifier(); + ~JRTLeafVerifier(); #else - JRT_Leaf_Verifier() {} - ~JRT_Leaf_Verifier() {} + JRTLeafVerifier() {} + ~JRTLeafVerifier() {} #endif }; -// A No_Alloc_Verifier object can be placed in methods where one assumes that +// A NoAllocVerifier object can be placed in methods where one assumes that // no allocation will occur. The destructor will verify this property // unless the constructor is called with argument false (not activated). // @@ -307,23 +307,23 @@ class JRT_Leaf_Verifier : public No_Safepoint_Verifier { // Note: this only makes sense at safepoints (otherwise, other threads may // allocate concurrently.) -class No_Alloc_Verifier : public StackObj { +class NoAllocVerifier : public StackObj { private: bool _activated; public: #ifdef ASSERT - No_Alloc_Verifier(bool activated = true) { + NoAllocVerifier(bool activated = true) { _activated = activated; if (_activated) Thread::current()->_allow_allocation_count++; } - ~No_Alloc_Verifier() { + ~NoAllocVerifier() { if (_activated) Thread::current()->_allow_allocation_count--; } #else - No_Alloc_Verifier(bool activated = true) {} - ~No_Alloc_Verifier() {} + NoAllocVerifier(bool activated = true) {} + ~NoAllocVerifier() {} #endif }; diff --git a/hotspot/src/share/vm/gc/shared/gcLocker.inline.hpp b/hotspot/src/share/vm/gc/shared/gcLocker.inline.hpp index 6e677ed529c..a1a92fb7f78 100644 --- a/hotspot/src/share/vm/gc/shared/gcLocker.inline.hpp +++ b/hotspot/src/share/vm/gc/shared/gcLocker.inline.hpp @@ -27,7 +27,7 @@ #include "gc/shared/gcLocker.hpp" -inline void GC_locker::lock_critical(JavaThread* thread) { +inline void GCLocker::lock_critical(JavaThread* thread) { if (!thread->in_critical()) { if (needs_gc()) { // jni_lock call calls enter_critical under the lock so that the @@ -40,7 +40,7 @@ inline void GC_locker::lock_critical(JavaThread* thread) { thread->enter_critical(); } -inline void GC_locker::unlock_critical(JavaThread* thread) { +inline void GCLocker::unlock_critical(JavaThread* thread) { if (thread->in_last_critical()) { if (needs_gc()) { // jni_unlock call calls exit_critical under the lock so that diff --git a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp index 5c732a15ced..6afef5c5494 100644 --- a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp @@ -409,7 +409,7 @@ void GenCollectedHeap::do_collection(bool full, "the requesting thread should have the Heap_lock"); guarantee(!is_gc_active(), "collection is not reentrant"); - if (GC_locker::check_active_before_gc()) { + if (GCLocker::check_active_before_gc()) { return; // GC is disabled (e.g. JNI GetXXXCritical operation) } diff --git a/hotspot/src/share/vm/gc/shared/space.cpp b/hotspot/src/share/vm/gc/shared/space.cpp index 44d0583b8f8..fe339a08412 100644 --- a/hotspot/src/share/vm/gc/shared/space.cpp +++ b/hotspot/src/share/vm/gc/shared/space.cpp @@ -208,9 +208,9 @@ HeapWord* ContiguousSpaceDCTOC::get_actual_top(HeapWord* top, return top; } -void Filtering_DCTOC::walk_mem_region(MemRegion mr, - HeapWord* bottom, - HeapWord* top) { +void FilteringDCTOC::walk_mem_region(MemRegion mr, + HeapWord* bottom, + HeapWord* top) { // Note that this assumption won't hold if we have a concurrent // collector in this space, which may have freed up objects after // they were dirtied and before the stop-the-world GC that is diff --git a/hotspot/src/share/vm/gc/shared/space.hpp b/hotspot/src/share/vm/gc/shared/space.hpp index 036677410bd..c44383d18f3 100644 --- a/hotspot/src/share/vm/gc/shared/space.hpp +++ b/hotspot/src/share/vm/gc/shared/space.hpp @@ -676,7 +676,7 @@ class ContiguousSpace: public CompactibleSpace { // A dirty card to oop closure that does filtering. // It knows how to filter out objects that are outside of the _boundary. -class Filtering_DCTOC : public DirtyCardToOopClosure { +class FilteringDCTOC : public DirtyCardToOopClosure { protected: // Override. void walk_mem_region(MemRegion mr, @@ -697,7 +697,7 @@ protected: FilteringClosure* cl) = 0; public: - Filtering_DCTOC(Space* sp, ExtendedOopClosure* cl, + FilteringDCTOC(Space* sp, ExtendedOopClosure* cl, CardTableModRefBS::PrecisionStyle precision, HeapWord* boundary) : DirtyCardToOopClosure(sp, cl, precision, boundary) {} @@ -713,7 +713,7 @@ public: // 2. That the space is really made up of objects and not just // blocks. -class ContiguousSpaceDCTOC : public Filtering_DCTOC { +class ContiguousSpaceDCTOC : public FilteringDCTOC { protected: // Overrides. HeapWord* get_actual_top(HeapWord* top, HeapWord* top_obj); @@ -729,7 +729,7 @@ public: ContiguousSpaceDCTOC(ContiguousSpace* sp, ExtendedOopClosure* cl, CardTableModRefBS::PrecisionStyle precision, HeapWord* boundary) : - Filtering_DCTOC(sp, cl, precision, boundary) + FilteringDCTOC(sp, cl, precision, boundary) {} }; diff --git a/hotspot/src/share/vm/gc/shared/specialized_oop_closures.hpp b/hotspot/src/share/vm/gc/shared/specialized_oop_closures.hpp index 0dce402952d..f84ad0db1b1 100644 --- a/hotspot/src/share/vm/gc/shared/specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/gc/shared/specialized_oop_closures.hpp @@ -49,11 +49,11 @@ class ParScanWithBarrierClosure; class ParScanWithoutBarrierClosure; // CMS class MarkRefsIntoAndScanClosure; -class Par_MarkRefsIntoAndScanClosure; +class ParMarkRefsIntoAndScanClosure; class PushAndMarkClosure; -class Par_PushAndMarkClosure; +class ParPushAndMarkClosure; class PushOrMarkClosure; -class Par_PushOrMarkClosure; +class ParPushOrMarkClosure; class CMSKeepAliveClosure; class CMSInnerParMarkAndPushClosure; // Misc @@ -95,11 +95,11 @@ class NoHeaderExtendedOopClosure; #if INCLUDE_ALL_GCS #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f) \ f(MarkRefsIntoAndScanClosure,_nv) \ - f(Par_MarkRefsIntoAndScanClosure,_nv) \ + f(ParMarkRefsIntoAndScanClosure,_nv) \ f(PushAndMarkClosure,_nv) \ - f(Par_PushAndMarkClosure,_nv) \ + f(ParPushAndMarkClosure,_nv) \ f(PushOrMarkClosure,_nv) \ - f(Par_PushOrMarkClosure,_nv) \ + f(ParPushOrMarkClosure,_nv) \ f(CMSKeepAliveClosure,_nv) \ f(CMSInnerParMarkAndPushClosure,_nv) #endif @@ -136,8 +136,8 @@ class NoHeaderExtendedOopClosure; #define SPECIALIZED_PAR_OOP_ITERATE_CLOSURES(f) \ f(MarkRefsIntoAndScanClosure,_nv) \ f(PushAndMarkClosure,_nv) \ - f(Par_MarkRefsIntoAndScanClosure,_nv) \ - f(Par_PushAndMarkClosure,_nv) + f(ParMarkRefsIntoAndScanClosure,_nv) \ + f(ParPushAndMarkClosure,_nv) #define ALL_PAR_OOP_ITERATE_CLOSURES(f) \ f(ExtendedOopClosure,_v) \ diff --git a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp index 57ffc4eb40a..755681afe8a 100644 --- a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp +++ b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp @@ -84,10 +84,10 @@ bool VM_GC_Operation::skip_operation() const { if (_full && skip) { skip = (_full_gc_count_before != Universe::heap()->total_full_collections()); } - if (!skip && GC_locker::is_active_and_needs_gc()) { + if (!skip && GCLocker::is_active_and_needs_gc()) { skip = Universe::heap()->is_maximal_no_gc(); assert(!(skip && (_gc_cause == GCCause::_gc_locker)), - "GC_locker cannot be active when initiating GC"); + "GCLocker cannot be active when initiating GC"); } return skip; } @@ -136,7 +136,7 @@ bool VM_GC_HeapInspection::skip_operation() const { } bool VM_GC_HeapInspection::collect() { - if (GC_locker::is_active()) { + if (GCLocker::is_active()) { return false; } Universe::heap()->collect_as_vm_thread(GCCause::_heap_inspection); @@ -146,7 +146,7 @@ bool VM_GC_HeapInspection::collect() { void VM_GC_HeapInspection::doit() { HandleMark hm; Universe::heap()->ensure_parsability(false); // must happen, even if collection does - // not happen (e.g. due to GC_locker) + // not happen (e.g. due to GCLocker) // or _full_gc being false if (_full_gc) { if (!collect()) { @@ -177,7 +177,7 @@ void VM_GenCollectForAllocation::doit() { _result = gch->satisfy_failed_allocation(_word_size, _tlab); assert(gch->is_in_reserved_or_null(_result), "result not in heap"); - if (_result == NULL && GC_locker::is_active_and_needs_gc()) { + if (_result == NULL && GCLocker::is_active_and_needs_gc()) { set_gc_locked(); } } @@ -289,7 +289,7 @@ void VM_CollectForMetadataAllocation::doit() { log_debug(gc)("After Metaspace GC failed to allocate size " SIZE_FORMAT, _size); - if (GC_locker::is_active_and_needs_gc()) { + if (GCLocker::is_active_and_needs_gc()) { set_gc_locked(); } } diff --git a/hotspot/src/share/vm/interpreter/rewriter.cpp b/hotspot/src/share/vm/interpreter/rewriter.cpp index e5e51af1e2e..55cec0f70e3 100644 --- a/hotspot/src/share/vm/interpreter/rewriter.cpp +++ b/hotspot/src/share/vm/interpreter/rewriter.cpp @@ -340,7 +340,7 @@ void Rewriter::scan_method(Method* method, bool reverse, bool* invokespecial_err // We cannot tolerate a GC in this block, because we've // cached the bytecodes in 'code_base'. If the Method* // moves, the bytecodes will also move. - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; Bytecodes::Code c; // Bytecodes and their length diff --git a/hotspot/src/share/vm/oops/constMethod.cpp b/hotspot/src/share/vm/oops/constMethod.cpp index 5b66ab2b6c9..ae3b1ae1076 100644 --- a/hotspot/src/share/vm/oops/constMethod.cpp +++ b/hotspot/src/share/vm/oops/constMethod.cpp @@ -49,7 +49,7 @@ ConstMethod::ConstMethod(int byte_code_size, MethodType method_type, int size) { - No_Safepoint_Verifier no_safepoint; + NoSafepointVerifier no_safepoint; init_fingerprint(); set_constants(NULL); set_stackmap_data(NULL); diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index d54d593594b..4c8986bdcec 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -2624,7 +2624,7 @@ nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_le bool InstanceKlass::add_member_name(Handle mem_name) { jweak mem_name_wref = JNIHandles::make_weak_global(mem_name); MutexLocker ml(MemberNameTable_lock); - DEBUG_ONLY(No_Safepoint_Verifier nsv); + DEBUG_ONLY(NoSafepointVerifier nsv); // Check if method has been redefined while taking out MemberNameTable_lock, if so // return false. We cannot cache obsolete methods. They will crash when the function diff --git a/hotspot/src/share/vm/oops/klassVtable.cpp b/hotspot/src/share/vm/oops/klassVtable.cpp index a64fda544e0..164532185e9 100644 --- a/hotspot/src/share/vm/oops/klassVtable.cpp +++ b/hotspot/src/share/vm/oops/klassVtable.cpp @@ -59,7 +59,7 @@ void klassVtable::compute_vtable_size_and_num_mirandas( Array* methods, AccessFlags class_flags, Handle classloader, Symbol* classname, Array* local_interfaces, TRAPS) { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // set up default result values int vtable_length = 0; diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index d1a7c297dfd..186c80102b2 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -77,7 +77,7 @@ Method* Method::allocate(ClassLoaderData* loader_data, } Method::Method(ConstMethod* xconst, AccessFlags access_flags) { - No_Safepoint_Verifier no_safepoint; + NoSafepointVerifier no_safepoint; set_constMethod(xconst); set_access_flags(access_flags); #ifdef CC_INTERP @@ -998,7 +998,7 @@ void Method::restore_unshareable_info(TRAPS) { // or adapter that it points to is still live and valid. // This function must not hit a safepoint! address Method::verified_code_entry() { - debug_only(No_Safepoint_Verifier nsv;) + debug_only(NoSafepointVerifier nsv;) assert(_from_compiled_entry != NULL, "must be set"); return _from_compiled_entry; } @@ -1548,7 +1548,7 @@ void Method::sort_methods(Array* methods, bool idempotent, bool set_idn int length = methods->length(); if (length > 1) { { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; QuickSort::sort(methods->data(), length, method_comparator, idempotent); } // Reset method ordering diff --git a/hotspot/src/share/vm/oops/methodData.cpp b/hotspot/src/share/vm/oops/methodData.cpp index f460028393f..5f278176275 100644 --- a/hotspot/src/share/vm/oops/methodData.cpp +++ b/hotspot/src/share/vm/oops/methodData.cpp @@ -1140,7 +1140,7 @@ MethodData::MethodData(const methodHandle& method, int size, TRAPS) } void MethodData::initialize() { - No_Safepoint_Verifier no_safepoint; // init function atomic wrt GC + NoSafepointVerifier no_safepoint; // init function atomic wrt GC ResourceMark rm; init(); diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index 7e249dd5b30..478f4f6344a 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -1383,7 +1383,7 @@ address OptoRuntime::handle_exception_C(JavaThread* thread) { // However, there needs to be a safepoint check in the middle! So compiled // safepoints are completely watertight. // -// Thus, it cannot be a leaf since it contains the No_GC_Verifier. +// Thus, it cannot be a leaf since it contains the NoGCVerifier. // // *THIS IS NOT RECOMMENDED PROGRAMMING STYLE* // diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 54d8248e718..981a19c96aa 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -204,7 +204,7 @@ intptr_t jfieldIDWorkaround::encode_klass_hash(Klass* k, intptr_t offset) { field_klass = super_klass; // super contains the field also super_klass = field_klass->super(); } - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) uintptr_t klass_hash = field_klass->identity_hash(); return ((klass_hash & klass_mask) << klass_shift) | checked_mask_in_place; } else { @@ -224,7 +224,7 @@ bool jfieldIDWorkaround::klass_hash_ok(Klass* k, jfieldID id) { uintptr_t as_uint = (uintptr_t) id; intptr_t klass_hash = (as_uint >> klass_shift) & klass_mask; do { - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) // Could use a non-blocking query for identity_hash here... if ((k->identity_hash() & klass_mask) == klass_hash) return true; @@ -1124,7 +1124,7 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive selected_method = m; } else if (!m->has_itable_index()) { // non-interface call -- for that little speed boost, don't handlize - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) // jni_GetMethodID makes sure class is linked and initialized // so m should have a valid vtable index. assert(m->valid_vtable_index(), "no valid vtable index"); @@ -3157,7 +3157,7 @@ JNI_END JNI_ENTRY(void*, jni_GetPrimitiveArrayCritical(JNIEnv *env, jarray array, jboolean *isCopy)) JNIWrapper("GetPrimitiveArrayCritical"); HOTSPOT_JNI_GETPRIMITIVEARRAYCRITICAL_ENTRY(env, array, (uintptr_t *) isCopy); - GC_locker::lock_critical(thread); + GCLocker::lock_critical(thread); if (isCopy != NULL) { *isCopy = JNI_FALSE; } @@ -3179,7 +3179,7 @@ JNI_ENTRY(void, jni_ReleasePrimitiveArrayCritical(JNIEnv *env, jarray array, voi JNIWrapper("ReleasePrimitiveArrayCritical"); HOTSPOT_JNI_RELEASEPRIMITIVEARRAYCRITICAL_ENTRY(env, array, carray, mode); // The array, carray and mode arguments are ignored - GC_locker::unlock_critical(thread); + GCLocker::unlock_critical(thread); HOTSPOT_JNI_RELEASEPRIMITIVEARRAYCRITICAL_RETURN(); JNI_END @@ -3187,7 +3187,7 @@ JNI_END JNI_ENTRY(const jchar*, jni_GetStringCritical(JNIEnv *env, jstring string, jboolean *isCopy)) JNIWrapper("GetStringCritical"); HOTSPOT_JNI_GETSTRINGCRITICAL_ENTRY(env, string, (uintptr_t *) isCopy); - GC_locker::lock_critical(thread); + GCLocker::lock_critical(thread); oop s = JNIHandles::resolve_non_null(string); typeArrayOop s_value = java_lang_String::value(s); bool is_latin1 = java_lang_String::is_latin1(s); @@ -3225,7 +3225,7 @@ JNI_ENTRY(void, jni_ReleaseStringCritical(JNIEnv *env, jstring str, const jchar // This assumes that ReleaseStringCritical bookends GetStringCritical. FREE_C_HEAP_ARRAY(jchar, chars); } - GC_locker::unlock_critical(thread); + GCLocker::unlock_critical(thread); HOTSPOT_JNI_RELEASESTRINGCRITICAL_RETURN(); JNI_END diff --git a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp index e8327c2e0ea..5b2bff54305 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.cpp @@ -95,7 +95,7 @@ JvmtiEnvBase::initialize() { { // This block of code must not contain any safepoints, as list deallocation // (which occurs at a safepoint) cannot occur simultaneously with this list - // addition. Note: No_Safepoint_Verifier cannot, currently, be used before + // addition. Note: NoSafepointVerifier cannot, currently, be used before // threads exist. JvmtiEnvIterator it; JvmtiEnvBase *previous_env = NULL; diff --git a/hotspot/src/share/vm/prims/jvmtiExport.cpp b/hotspot/src/share/vm/prims/jvmtiExport.cpp index 54a4bac002d..2c352044f02 100644 --- a/hotspot/src/share/vm/prims/jvmtiExport.cpp +++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp @@ -1904,7 +1904,7 @@ void JvmtiExport::record_vm_internal_object_allocation(oop obj) { Thread* thread = Thread::current_or_null(); if (thread != NULL && thread->is_Java_thread()) { // Can not take safepoint here. - No_Safepoint_Verifier no_sfpt; + NoSafepointVerifier no_sfpt; // Can not take safepoint here so can not use state_for to get // jvmti thread state. JvmtiThreadState *state = ((JavaThread*)thread)->jvmti_thread_state(); diff --git a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp index a4ce6c7fee4..8823e6670a6 100644 --- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp +++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp @@ -1674,10 +1674,10 @@ void VM_RedefineClasses::rewrite_cp_refs_in_method(methodHandle method, // We cache a pointer to the bytecodes here in code_base. If GC // moves the Method*, then the bytecodes will also move which - // will likely cause a crash. We create a No_Safepoint_Verifier + // will likely cause a crash. We create a NoSafepointVerifier // object to detect whether we pass a possible safepoint in this // code block. - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; // Bytecodes and their length address code_base = method->code_base(); @@ -1735,7 +1735,7 @@ void VM_RedefineClasses::rewrite_cp_refs_in_method(methodHandle method, Relocator rc(method, NULL /* no RelocatorListener needed */); methodHandle m; { - Pause_No_Safepoint_Verifier pnsv(&nsv); + PauseNoSafepointVerifier pnsv(&nsv); // ldc is 2 bytes and ldc_w is 3 bytes m = rc.insert_space_at(bci, 3, inst_buffer, CHECK); diff --git a/hotspot/src/share/vm/prims/jvmtiThreadState.cpp b/hotspot/src/share/vm/prims/jvmtiThreadState.cpp index b5ed5fb9146..e98891e8ef3 100644 --- a/hotspot/src/share/vm/prims/jvmtiThreadState.cpp +++ b/hotspot/src/share/vm/prims/jvmtiThreadState.cpp @@ -86,7 +86,7 @@ JvmtiThreadState::JvmtiThreadState(JavaThread* thread) { // The thread state list manipulation code must not have safepoints. // See periodic_clean_up(). - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) _prev = NULL; _next = _head; @@ -123,7 +123,7 @@ JvmtiThreadState::~JvmtiThreadState() { { // The thread state list manipulation code must not have safepoints. // See periodic_clean_up(). - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) if (_prev == NULL) { assert(_head == this, "sanity check"); @@ -147,7 +147,7 @@ JvmtiThreadState::periodic_clean_up() { // This iteration is initialized with "_head" instead of "JvmtiThreadState::first()" // because the latter requires the JvmtiThreadState_lock. - // This iteration is safe at a safepoint as well, see the No_Safepoint_Verifier + // This iteration is safe at a safepoint as well, see the NoSafepointVerifier // asserts at all list manipulation sites. for (JvmtiThreadState *state = _head; state != NULL; state = state->next()) { // For each environment thread state corresponding to an invalid environment @@ -182,7 +182,7 @@ void JvmtiThreadState::add_env(JvmtiEnvBase *env) { // add this environment thread state to the end of the list (order is important) { // list deallocation (which occurs at a safepoint) cannot occur simultaneously - debug_only(No_Safepoint_Verifier nosafepoint;) + debug_only(NoSafepointVerifier nosafepoint;) JvmtiEnvThreadStateIterator it(this); JvmtiEnvThreadState* previous_ets = NULL; diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp index 99e8a785f10..c58f0d3f773 100644 --- a/hotspot/src/share/vm/prims/methodHandles.cpp +++ b/hotspot/src/share/vm/prims/methodHandles.cpp @@ -981,7 +981,7 @@ void MethodHandles::flush_dependent_nmethods(Handle call_site, Handle target) { int marked = 0; CallSiteDepChange changes(call_site(), target()); { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag); oop context = java_lang_invoke_CallSite::context(call_site()); @@ -1339,7 +1339,7 @@ JVM_ENTRY(void, MHN_clearCallSiteContext(JNIEnv* env, jobject igcls, jobject con int marked = 0; { - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag); assert(safe_to_expunge(), "removal is not safe"); DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context()); diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 9a53981e33e..2ab8f7b32b3 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -1681,16 +1681,16 @@ void Arguments::set_cms_and_parnew_gc_flags() { // OldPLAB sizing manually turned off: Use a larger default setting, // unless it was manually specified. This is because a too-low value // will slow down scavenges. - FLAG_SET_ERGO(size_t, OldPLABSize, CFLS_LAB::_default_static_old_plab_size); // default value before 6631166 + FLAG_SET_ERGO(size_t, OldPLABSize, CompactibleFreeListSpaceLAB::_default_static_old_plab_size); // default value before 6631166 } else { - FLAG_SET_DEFAULT(OldPLABSize, CFLS_LAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default + FLAG_SET_DEFAULT(OldPLABSize, CompactibleFreeListSpaceLAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default } } // If either of the static initialization defaults have changed, note this // modification. if (!FLAG_IS_DEFAULT(OldPLABSize) || !FLAG_IS_DEFAULT(OldPLABWeight)) { - CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight); + CompactibleFreeListSpaceLAB::modify_initialization(OldPLABSize, OldPLABWeight); } if (!ClassUnloading) { diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index a1711971464..af3d7afe6fb 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -296,7 +296,7 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread // Ensure that no safepoint is taken after pointers have been stored // in fields of rematerialized objects. If a safepoint occurs from here on // out the java state residing in the vframeArray will be missed. - No_Safepoint_Verifier no_safepoint; + NoSafepointVerifier no_safepoint; vframeArray* array = create_vframeArray(thread, deoptee, &map, chunk, realloc_failures); #if defined(COMPILER2) || INCLUDE_JVMCI diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index c4f4627bdb0..084af0b2740 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -883,7 +883,7 @@ public: \ notproduct(bool, StrictSafepointChecks, trueInDebug, \ "Enable strict checks that safepoints cannot happen for threads " \ - "that use No_Safepoint_Verifier") \ + "that use NoSafepointVerifier") \ \ notproduct(bool, VerifyLastFrame, false, \ "Verify oops on last frame on entry to VM") \ diff --git a/hotspot/src/share/vm/runtime/interfaceSupport.hpp b/hotspot/src/share/vm/runtime/interfaceSupport.hpp index aa628e3a7fa..47cfcfdfaaa 100644 --- a/hotspot/src/share/vm/runtime/interfaceSupport.hpp +++ b/hotspot/src/share/vm/runtime/interfaceSupport.hpp @@ -451,7 +451,7 @@ class RuntimeHistogramElement : public HistogramElement { #define IRT_LEAF(result_type, header) \ result_type header { \ VM_LEAF_BASE(result_type, header) \ - debug_only(No_Safepoint_Verifier __nspv(true);) + debug_only(NoSafepointVerifier __nspv(true);) #define IRT_ENTRY_NO_ASYNC(result_type, header) \ @@ -475,7 +475,7 @@ class RuntimeHistogramElement : public HistogramElement { #define JRT_LEAF(result_type, header) \ result_type header { \ VM_LEAF_BASE(result_type, header) \ - debug_only(JRT_Leaf_Verifier __jlv;) + debug_only(JRTLeafVerifier __jlv;) #define JRT_ENTRY_NO_ASYNC(result_type, header) \ diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index 09f6ea8d1a4..437e3bd4176 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -363,7 +363,7 @@ void SafepointSynchronize::begin() { #endif // ASSERT // Update the count of active JNI critical regions - GC_locker::set_jni_lock_count(_current_jni_active_count); + GCLocker::set_jni_lock_count(_current_jni_active_count); if (log_is_enabled(Debug, safepoint)) { VM_Operation *op = VMThread::vm_operation(); @@ -563,7 +563,7 @@ void SafepointSynchronize::check_for_lazy_critical_native(JavaThread *thread, Ja if (!thread->do_critical_native_unlock()) { #ifdef ASSERT if (!thread->in_critical()) { - GC_locker::increment_debug_jni_lock_count(); + GCLocker::increment_debug_jni_lock_count(); } #endif thread->enter_critical(); diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index 12a657ea589..592d5db15b7 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -2742,8 +2742,8 @@ JRT_ENTRY_NO_ASYNC(void, SharedRuntime::block_for_jni_critical(JavaThread* threa return; } // Lock and unlock a critical section to give the system a chance to block - GC_locker::lock_critical(thread); - GC_locker::unlock_critical(thread); + GCLocker::lock_critical(thread); + GCLocker::unlock_critical(thread); JRT_END // ------------------------------------------------------------------------- diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp index f74f78a98ef..971012fbb11 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.cpp +++ b/hotspot/src/share/vm/runtime/synchronizer.cpp @@ -159,7 +159,7 @@ bool ObjectSynchronizer::quick_notify(oopDesc * obj, Thread * self, bool all) { assert(!SafepointSynchronize::is_at_safepoint(), "invariant"); assert(self->is_Java_thread(), "invariant"); assert(((JavaThread *) self)->thread_state() == _thread_in_Java, "invariant"); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; if (obj == NULL) return false; // slow-path for invalid obj const markOop mark = obj->mark(); @@ -209,7 +209,7 @@ bool ObjectSynchronizer::quick_enter(oop obj, Thread * Self, assert(!SafepointSynchronize::is_at_safepoint(), "invariant"); assert(Self->is_Java_thread(), "invariant"); assert(((JavaThread *) Self)->thread_state() == _thread_in_Java, "invariant"); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; if (obj == NULL) return false; // Need to throw NPE const markOop mark = obj->mark(); @@ -1734,7 +1734,7 @@ class ReleaseJavaMonitorsClosure: public MonitorClosure { void ObjectSynchronizer::release_monitors_owned_by_thread(TRAPS) { assert(THREAD == JavaThread::current(), "must be current Java thread"); - No_Safepoint_Verifier nsv; + NoSafepointVerifier nsv; ReleaseJavaMonitorsClosure rjmc(THREAD); Thread::muxAcquire(&gListLock, "release_monitors_owned_by_thread"); ObjectSynchronizer::monitors_iterate(&rjmc); diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 8a430f143de..a81dfc926e8 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -2440,7 +2440,7 @@ void JavaThread::check_special_condition_for_native_trans(JavaThread *thread) { // normal checks but also performs the transition back into // thread_in_Java state. This is required so that critical natives // can potentially block and perform a GC if they are the last thread -// exiting the GC_locker. +// exiting the GCLocker. void JavaThread::check_special_condition_for_native_trans_and_transition(JavaThread *thread) { check_special_condition_for_native_trans(thread); @@ -2449,7 +2449,7 @@ void JavaThread::check_special_condition_for_native_trans_and_transition(JavaThr if (thread->do_critical_native_unlock()) { ThreadInVMfromJavaNoAsyncException tiv(thread); - GC_locker::unlock_critical(thread); + GCLocker::unlock_critical(thread); thread->clear_critical_native_unlock(); } } diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index 0be7faed0c5..1c8722cbea8 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -255,7 +255,7 @@ class Thread: public ThreadShadow { // If !allow_allocation(), then an assertion failure will happen during allocation // (Hence, !allow_safepoint() => !allow_allocation()). // - // The two classes No_Safepoint_Verifier and No_Allocation_Verifier are used to set these counters. + // The two classes NoSafepointVerifier and No_Allocation_Verifier are used to set these counters. // NOT_PRODUCT(int _allow_safepoint_count;) // If 0, thread allow a safepoint to happen debug_only(int _allow_allocation_count;) // If 0, the thread is allowed to allocate oops. @@ -263,10 +263,10 @@ class Thread: public ThreadShadow { // Used by SkipGCALot class. NOT_PRODUCT(bool _skip_gcalot;) // Should we elide gc-a-lot? - friend class No_Alloc_Verifier; - friend class No_Safepoint_Verifier; - friend class Pause_No_Safepoint_Verifier; - friend class GC_locker; + friend class NoAllocVerifier; + friend class NoSafepointVerifier; + friend class PauseNoSafepointVerifier; + friend class GCLocker; ThreadLocalAllocBuffer _tlab; // Thread-local eden jlong _allocated_bytes; // Cumulative number of bytes allocated on diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 7f2fde47b2e..a127f71a3d9 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -503,7 +503,7 @@ typedef CompactHashtable SymbolCompactHashTable; /* Generation and Space hierarchies */ \ /**********************************************************************************/ \ \ - unchecked_nonstatic_field(ageTable, sizes, sizeof(ageTable::sizes)) \ + unchecked_nonstatic_field(AgeTable, sizes, sizeof(AgeTable::sizes)) \ \ nonstatic_field(BarrierSet, _fake_rtti, BarrierSet::FakeRtti) \ \ @@ -560,7 +560,7 @@ typedef CompactHashtable SymbolCompactHashTable; \ nonstatic_field(DefNewGeneration, _old_gen, Generation*) \ nonstatic_field(DefNewGeneration, _tenuring_threshold, uint) \ - nonstatic_field(DefNewGeneration, _age_table, ageTable) \ + nonstatic_field(DefNewGeneration, _age_table, AgeTable) \ nonstatic_field(DefNewGeneration, _eden_space, ContiguousSpace*) \ nonstatic_field(DefNewGeneration, _from_space, ContiguousSpace*) \ nonstatic_field(DefNewGeneration, _to_space, ContiguousSpace*) \ @@ -1600,7 +1600,7 @@ typedef CompactHashtable SymbolCompactHashTable; \ /* Miscellaneous other GC types */ \ \ - declare_toplevel_type(ageTable) \ + declare_toplevel_type(AgeTable) \ declare_toplevel_type(Generation::StatRecord) \ declare_toplevel_type(GenerationSpec) \ declare_toplevel_type(HeapWord) \ @@ -2310,7 +2310,7 @@ typedef CompactHashtable SymbolCompactHashTable; /* Generation and Space Hierarchy Constants */ \ /********************************************/ \ \ - declare_constant(ageTable::table_size) \ + declare_constant(AgeTable::table_size) \ \ declare_constant(BarrierSet::ModRef) \ declare_constant(BarrierSet::CardTableModRef) \ diff --git a/hotspot/src/share/vm/services/heapDumper.cpp b/hotspot/src/share/vm/services/heapDumper.cpp index 96ea8d7a744..a956ee870b1 100644 --- a/hotspot/src/share/vm/services/heapDumper.cpp +++ b/hotspot/src/share/vm/services/heapDumper.cpp @@ -1708,10 +1708,10 @@ void VM_HeapDumper::doit() { CollectedHeap* ch = Universe::heap(); ch->ensure_parsability(false); // must happen, even if collection does - // not happen (e.g. due to GC_locker) + // not happen (e.g. due to GCLocker) if (_gc_before_heap_dump) { - if (GC_locker::is_active()) { + if (GCLocker::is_active()) { warning("GC locker is held; pre-heapdump GC was skipped"); } else { ch->collect_as_vm_thread(GCCause::_heap_dump); From f8b5f55021c49b201f1ba4cb43caa4af1cd13e77 Mon Sep 17 00:00:00 2001 From: Alexander Kulyakhtin Date: Thu, 14 Jan 2016 15:35:21 +0300 Subject: [PATCH 071/212] 8130063: Refactoring tmtools jstat and jstack tests to jtreg Some of the jstat and jstack tests refactored to be run with the jtreg Reviewed-by: jbachorik --- hotspot/test/TEST.groups | 6 +- .../tmtools/jstack/DaemonThreadTest.java | 95 +++++++ .../tmtools/jstack/JstackTool.java | 36 +++ .../tmtools/jstack/SpreadLockTest.java | 195 +++++++++++++ .../tmtools/jstack/ThreadNamesTest.java | 77 +++++ .../tmtools/jstack/TraveledLockTest.java | 207 ++++++++++++++ .../tmtools/jstack/WaitNotifyThreadTest.java | 192 +++++++++++++ .../tmtools/jstack/utils/Consts.java | 47 ++++ .../tmtools/jstack/utils/DefaultFormat.java | 266 ++++++++++++++++++ .../tmtools/jstack/utils/Format.java | 34 +++ .../tmtools/jstack/utils/JStack.java | 80 ++++++ .../tmtools/jstack/utils/LockInfo.java | 41 +++ .../tmtools/jstack/utils/MethodInfo.java | 137 +++++++++ .../tmtools/jstack/utils/MonitorInfo.java | 82 ++++++ .../tmtools/jstack/utils/ThreadStack.java | 175 ++++++++++++ .../tmtools/jstack/utils/Utils.java | 56 ++++ .../tmtools/jstat/GcCapacityTest.java | 65 +++++ .../tmtools/jstat/GcCauseTest01.java | 72 +++++ .../tmtools/jstat/GcCauseTest02.java | 62 ++++ .../tmtools/jstat/GcCauseTest03.java | 61 ++++ .../tmtools/jstat/GcNewTest.java | 77 +++++ .../tmtools/jstat/GcTest01.java | 78 +++++ .../tmtools/jstat/GcTest02.java | 67 +++++ .../tmtools/jstat/utils/ClassLoadUtils.java | 149 ++++++++++ .../tmtools/jstat/utils/GcProvoker.java | 55 ++++ .../tmtools/jstat/utils/GcProvokerImpl.java | 110 ++++++++ .../jstat/utils/GeneratedClassProducer.java | 71 +++++ .../jstat/utils/GeneratingClassLoader.java | 195 +++++++++++++ .../jstat/utils/JstatGcCapacityResults.java | 159 +++++++++++ .../jstat/utils/JstatGcCapacityTool.java | 37 +++ .../jstat/utils/JstatGcCauseResults.java | 103 +++++++ .../tmtools/jstat/utils/JstatGcCauseTool.java | 37 +++ .../jstat/utils/JstatGcNewResults.java | 93 ++++++ .../tmtools/jstat/utils/JstatGcNewTool.java | 37 +++ .../tmtools/jstat/utils/JstatGcResults.java | 132 +++++++++ .../tmtools/jstat/utils/JstatGcTool.java | 37 +++ .../tmtools/jstat/utils/JstatResults.java | 147 ++++++++++ .../tmtools/jstat/utils/Pools.java | 105 +++++++ .../tmtools/jstat/utils/StringOfValues.java | 58 ++++ .../tmtools/jstat/utils/TemplateClass.java | 26 ++ .../tmtools/share/common/TmTool.java | 67 +++++ .../tmtools/share/common/ToolResults.java | 89 ++++++ .../tmtools/share/common/ToolRunner.java | 78 +++++ 43 files changed, 3992 insertions(+), 1 deletion(-) create mode 100644 hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/JstackTool.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/utils/Consts.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/utils/DefaultFormat.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/utils/Format.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/utils/JStack.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/utils/LockInfo.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/utils/MethodInfo.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/utils/MonitorInfo.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/utils/ThreadStack.java create mode 100644 hotspot/test/serviceability/tmtools/jstack/utils/Utils.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/GcNewTest.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/GcTest01.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/GcTest02.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/ClassLoadUtils.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/GeneratedClassProducer.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/GeneratingClassLoader.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityTool.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseTool.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewTool.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/JstatGcTool.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/Pools.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/StringOfValues.java create mode 100644 hotspot/test/serviceability/tmtools/jstat/utils/TemplateClass.java create mode 100644 hotspot/test/serviceability/tmtools/share/common/TmTool.java create mode 100644 hotspot/test/serviceability/tmtools/share/common/ToolResults.java create mode 100644 hotspot/test/serviceability/tmtools/share/common/ToolRunner.java diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index 0ab5b18b6e1..9e3d65dc007 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -97,7 +97,8 @@ needs_jdk = \ runtime/XCheckJniJsig/XCheckJSig.java \ serviceability/attach/AttachWithStalePidFile.java \ serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java \ - serviceability/dcmd/vm/DynLibsTest.java + serviceability/dcmd/vm/DynLibsTest.java \ + serviceability/tmtools # JRE adds further tests to compact3 @@ -361,3 +362,6 @@ needs_nashorn = \ not_needs_nashorn = \ :jdk \ -:needs_nashorn + +hotspot_tmtools = \ + serviceability/tmtools diff --git a/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java new file mode 100644 index 00000000000..6b154ecc890 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java @@ -0,0 +1,95 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @summary Create daemon and non-deamon threads. + * Check the correctness of thread's status from jstack. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * + * @run main/othervm -XX:+UsePerfData DaemonThreadTest + */ +import common.ToolResults; +import utils.*; + +public class DaemonThreadTest { + + static class NormalThread extends Thread { + + NormalThread() { + } + + @Override + public void run() { + Utils.sleep(); + } + + } + + static class DaemonThread extends Thread { + + DaemonThread() { + setDaemon(true); + } + + @Override + public void run() { + Utils.sleep(); + } + + } + + public static void main(String[] args) throws Exception { + testNoDaemon(); + testDaemon(); + } + + private static void testNoDaemon() throws Exception { + testThread(new NormalThread(), ""); + } + + private static void testDaemon() throws Exception { + testThread(new DaemonThread(), "daemon"); + } + + private static void testThread(Thread thread, String expectedType) throws Exception { + // Start the thread + thread.start(); + + // Run jstack tool and collect the output + JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + ToolResults results = jstackTool.measure(); + + // Analyze the jstack output for the correct thread type + JStack jstack = new DefaultFormat().parse(results.getStdoutString()); + ThreadStack ti = jstack.getThreadStack(thread.getName()); + + if (!ti.getType().trim().equals(expectedType)) { + throw new RuntimeException("incorrect thread type '" + ti.getType() + "' for the thread '" + thread.getName() + "'"); + } + + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/JstackTool.java b/hotspot/test/serviceability/tmtools/jstack/JstackTool.java new file mode 100644 index 00000000000..0bc4c799ecb --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/JstackTool.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 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. + */ + +import common.TmTool; +import common.ToolResults; + +/** + * This tool executes "jstack " and returns the results + */ +public class JstackTool extends TmTool { + + public JstackTool(long pid) { + super(ToolResults.class, "jstack", String.valueOf(pid)); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java b/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java new file mode 100644 index 00000000000..92bd5e5c90a --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @summary Create a thread which stops in methods a(), a()->b(), a()->b()->c(), + * synchronizing on one monitor inside of each method. + * After checking that lock info is correct invoke another method + * and get the lock again. Repeat this action. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * + * @run main/othervm -XX:+UsePerfData SpreadLockTest + */ +import common.ToolResults; +import java.util.Iterator; +import utils.*; + +class SpreadLockDebuggee extends Thread { + + static final String THREAD_NAME = "MyThread"; + + SpreadLockDebuggee() { + setName(THREAD_NAME); + } + + Object monitor = new Object(); + + public void c() { + synchronized (monitor) { + Utils.sleep(); + } + } + + public void b() { + synchronized (monitor) { + try { + while (true) { + Thread.sleep(Long.MAX_VALUE); + } + } catch (InterruptedException e) { + c(); + } + } + } + + public void a() { + synchronized (monitor) { + try { + while (true) { + Thread.sleep(Long.MAX_VALUE); + } + } catch (InterruptedException e) { + b(); + } + } + } + + @Override + public void run() { + a(); + } + +} + +public class SpreadLockTest { + + public static void main(String[] args) throws Exception { + new SpreadLockTest().doTest(); + } + + private void doTest() throws Exception { + SpreadLockDebuggee debuggee = new SpreadLockDebuggee(); + + // Start in method a() + debuggee.start(); + + // Collect output from the jstack tool + JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + ToolResults results1 = jstackTool.measure(); + + // Go to method b() + debuggee.interrupt(); + + // Collect output from the jstack tool + ToolResults results2 = jstackTool.measure(); + + // Go to method c() + debuggee.interrupt(); + + // Collect output from the jstack tool + ToolResults results3 = jstackTool.measure(); + + analyse(results1.getStdoutString(), results2.getStdoutString(), results3.getStdoutString()); + } + + // Analyzing the outputs from the 3 jstack runs + public void analyse(String result1, String result2, String result3) { + String jstackStr1 = result1; + String jstackStr2 = result2; + String jstackStr3 = result3; + + if (jstackStr1 == null) { + throw new RuntimeException("First jstack output is empty"); + } + if (jstackStr2 == null) { + throw new RuntimeException("Second jstack output is empty"); + } + if (jstackStr3 == null) { + throw new RuntimeException("Third jstack output is empty"); + } + + Format format = new DefaultFormat(); + JStack jstack1 = format.parse(jstackStr1); + JStack jstack2 = format.parse(jstackStr2); + JStack jstack3 = format.parse(jstackStr3); + + ThreadStack ts1 = jstack1.getThreadStack(SpreadLockDebuggee.THREAD_NAME); + ThreadStack ts2 = jstack2.getThreadStack(SpreadLockDebuggee.THREAD_NAME); + ThreadStack ts3 = jstack3.getThreadStack(SpreadLockDebuggee.THREAD_NAME); + + if (ts1 == null || ts2 == null || ts3 == null) { + throw new RuntimeException( + "One of thread stack trace is null in the first jstack output : " + + ts1 + ", " + ts2 + ", " + ts3); + } + + MonitorInfo[] monitorInfo = new MonitorInfo[6]; + int counter = 0; + + Iterator it = ts1.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".a")) { + monitorInfo[counter++] = haveToHaveOneLock(mi); + } + } + + it = ts2.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".a") + || mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".b")) { + monitorInfo[counter++] = haveToHaveOneLock(mi); + } + } + + it = ts3.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".a") + || mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".b") + || mi.getName().startsWith(SpreadLockDebuggee.class.getName() + ".c")) { + monitorInfo[counter++] = haveToHaveOneLock(mi); + } + } + + System.out.println("All monitors found - passed"); + + } + + private MonitorInfo haveToHaveOneLock(MethodInfo mi) { + if (mi.getLocks().size() == 1) { + System.out.println("Method \"" + mi.getName() + + "\" contain 1 lock - correct"); + return mi.getLocks().getFirst(); + } else { + throw new RuntimeException("Lock count (" + + mi.getLocks().size() + ") is incorrect in method \"" + + mi.getName() + "\""); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java b/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java new file mode 100644 index 00000000000..c5943d11e98 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @summary Checks that jstack correctly prints the thread names + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * + * @run main/othervm -XX:+UsePerfData ThreadNamesTest + */ +import common.ToolResults; +import utils.*; + +public class ThreadNamesTest { + + private static final String STRANGE_NAME = "-_?+!@#$%^*()"; + private static final String LONG_NAME = "loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong"; + + static class NamedThread extends Thread { + + NamedThread(String name) { + setName(name); + } + + @Override + public void run() { + Utils.sleep(); + } + } + + public static void main(String[] args) throws Exception { + testWithName(STRANGE_NAME); + testWithName(""); + testWithName(LONG_NAME); + } + + private static void testWithName(String name) throws Exception { + // Start a thread with some strange name + NamedThread thread = new NamedThread(name); + thread.start(); + + // Run jstack tool and collect the output + JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + ToolResults results = jstackTool.measure(); + + // Analyze the jstack output for the strange thread name + JStack jstack1 = new DefaultFormat().parse(results.getStdoutString()); + ThreadStack ti1 = jstack1.getThreadStack(name); + + if (ti1 == null) { + throw new RuntimeException("jstack output doesn't contain thread info for the thread '" + name + "'"); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java b/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java new file mode 100644 index 00000000000..9f478158a3f --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java @@ -0,0 +1,207 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @summary Create a thread which stops in methods a(), a()->b(), a()->b()->c(), + * synchronizing on one monitor inside of each method. + * After checking that lock info is correct free the lock and + * invoke another method. Repeat this action. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * + * @run main/othervm -XX:+UsePerfData TraveledLockTest + */ +import common.ToolResults; +import java.util.Iterator; +import utils.*; + +class TraveledLockDebuggee extends Thread { + + static final String THREAD_NAME = "MyThread"; + + TraveledLockDebuggee() { + setName(THREAD_NAME); + } + + Object monitor = new Object(); + + public void c() { + synchronized (monitor) { + Utils.sleep(); + } + } + + public void b() { + try { + synchronized (monitor) { + while (true) { + Thread.sleep(Long.MAX_VALUE); + } + } + } catch (InterruptedException e) { + c(); + } + } + + public void a() { + try { + synchronized (monitor) { + while (true) { + Thread.sleep(Long.MAX_VALUE); + } + } + } catch (InterruptedException e) { + b(); + } + } + + public void run() { + a(); + } + +} + +public class TraveledLockTest { + + public static void main(String[] args) throws Exception { + new TraveledLockTest().doTest(); + } + + private void doTest() throws Exception { + TraveledLockDebuggee debuggee = new TraveledLockDebuggee(); + + // Start in method a() + debuggee.start(); + + // Collect output from the jstack tool + JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + ToolResults results1 = jstackTool.measure(); + + // Go to method b() + debuggee.interrupt(); + + // Collect output from the jstack tool + ToolResults results2 = jstackTool.measure(); + + // Go to method c() + debuggee.interrupt(); + + // Collect output from the jstack tool + ToolResults results3 = jstackTool.measure(); + + analyse(results1.getStdoutString(), results2.getStdoutString(), results3.getStdoutString()); + } + + // Analyzsing the outputs from the 3 jstack runs + public void analyse(String results1, String results2, String results3) { + + String jstackStr1 = results1; + String jstackStr2 = results2; + String jstackStr3 = results3; + + if (jstackStr1 == null) { + throw new RuntimeException("First jstack output is empty"); + } + if (jstackStr2 == null) { + throw new RuntimeException("Second jstack output is empty"); + } + if (jstackStr3 == null) { + throw new RuntimeException("Third jstack output is empty"); + } + + Format format = new DefaultFormat(); + JStack jstack1 = format.parse(jstackStr1); + JStack jstack2 = format.parse(jstackStr2); + JStack jstack3 = format.parse(jstackStr3); + + ThreadStack ts1 = jstack1.getThreadStack(TraveledLockDebuggee.THREAD_NAME); + ThreadStack ts2 = jstack2.getThreadStack(TraveledLockDebuggee.THREAD_NAME); + ThreadStack ts3 = jstack3.getThreadStack(TraveledLockDebuggee.THREAD_NAME); + + if (ts1 == null || ts2 == null || ts3 == null) { + throw new RuntimeException( + "One of thread stack trace is null in the first jstack output : " + + ts1 + ", " + ts2 + ", " + ts3); + } + + MonitorInfo monitorInfo1 = null; + MonitorInfo monitorInfo2 = null; + MonitorInfo monitorInfo3 = null; + + Iterator it = ts1.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".a")) { + monitorInfo1 = haveToHaveOneLock(mi); + } + } + + it = ts2.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".a")) { + haveToBeEmpty(mi); + } else if (mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".b")) { + monitorInfo2 = haveToHaveOneLock(mi); + } + } + + it = ts3.getStack().iterator(); + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".a") + || mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".b")) { + haveToBeEmpty(mi); + } else if (mi.getName().startsWith(TraveledLockDebuggee.class.getName() + ".c")) { + monitorInfo3 = haveToHaveOneLock(mi); + } + } + + System.out.println("All monitors found - passed"); + } + + private MonitorInfo haveToHaveOneLock(MethodInfo mi) { + if (mi.getLocks().size() == 1) { + System.out.println("Method \"" + mi.getName() + + "\" contain 1 lock - correct"); + return mi.getLocks().getFirst(); + } else { + throw new RuntimeException("Lock count (" + + mi.getLocks().size() + ") is incorrect in method \"" + + mi.getName() + "\""); + } + } + + private void haveToBeEmpty(MethodInfo mi) { + if (mi.getLocks().size() == 0) { + System.out.println("Method \"" + mi.getName() + + "\" does not lock anything - correct"); + } else { + throw new RuntimeException( + "Unexpected lock found in method \"" + mi.getName() + "\""); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java new file mode 100644 index 00000000000..75b04597cd2 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java @@ -0,0 +1,192 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @summary Call Object.wait() method. Check that monitor information + * presented in the stack is correct. Call notifyAll method + * monitor info have to disappear from the stack. + * Repeats the same scenario calling interrupt() method + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * + * @run main/othervm -XX:+UsePerfData WaitNotifyThreadTest + */ +import common.ToolResults; +import java.util.Iterator; +import utils.*; + +public class WaitNotifyThreadTest { + + private Object monitor = new Object(); + private final String OBJECT = "a java.lang.Object"; + private final String OBJECT_WAIT = "java.lang.Object.wait"; + + interface Action { + + void doAction(Thread thread); + } + + class ActionNotify implements Action { + + @Override + public void doAction(Thread thread) { + //Notify the waiting thread, so it stops waiting and sleeps + synchronized (monitor) { + monitor.notifyAll(); + } + } + } + + class ActionInterrupt implements Action { + + @Override + public void doAction(Thread thread) { + // Interrupt the thread + thread.interrupt(); + } + } + + class WaitThread extends Thread { + + @Override + public void run() { + try { + synchronized (monitor) { + monitor.wait(); + } + } catch (InterruptedException x) { + + } + Utils.sleep(); + } + } + + public static void main(String[] args) throws Exception { + new WaitNotifyThreadTest().doTest(); + } + + private void doTest() throws Exception { + // Verify stack trace consistency when notifying the thread + doTest(new ActionNotify()); + + // Verify stack trace consistency when interrupting the thread + doTest(new ActionInterrupt()); + } + + private void doTest(Action action) throws Exception { + + final String WAITING_THREAD_NAME = "MyWaitingThread"; + + // Start athread that just waits + WaitThread waitThread = new WaitThread(); + waitThread.setName(WAITING_THREAD_NAME); + waitThread.start(); + + // Collect output from the jstack tool + JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + ToolResults results = jstackTool.measure(); + + // Analyze the jstack output for the patterns needed + JStack jstack1 = new DefaultFormat().parse(results.getStdoutString()); + ThreadStack ti1 = jstack1.getThreadStack(WAITING_THREAD_NAME); + analyzeThreadStackWaiting(ti1); + + action.doAction(waitThread); + + // Collect output from the jstack tool again + results = jstackTool.measure(); + + // Analyze the output again + JStack jstack2 = new DefaultFormat().parse(results.getStdoutString()); + ThreadStack ti2 = jstack2.getThreadStack(WAITING_THREAD_NAME); + analyzeThreadStackNoWaiting(ti2); + + } + + private void analyzeThreadStackWaiting(ThreadStack ti1) { + Iterator it = ti1.getStack().iterator(); + + String monitorAddress = null; + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getName().startsWith(OBJECT_WAIT) && mi.getCompilationUnit() == null /*native method*/) { + if (mi.getLocks().size() == 1) { + MonitorInfo monInfo = mi.getLocks().getFirst(); + if (monInfo.getType().equals("waiting on") + && monInfo.getMonitorClass().equals(OBJECT)) { + monitorAddress = monInfo.getMonitorAddress(); + } else { + System.err.println("Error: incorrect monitor info: " + monInfo.getType() + ", " + monInfo.getMonitorClass()); + throw new RuntimeException("Incorrect lock record in " + + OBJECT_WAIT + " method"); + } + + } else { + throw new RuntimeException(OBJECT_WAIT + + " method has to contain one lock record bu it contains " + mi.getLocks().size()); + } + } + + if (mi.getName().startsWith("WaitThread.run")) { + if (monitorAddress == null) { + throw new RuntimeException("Cannot found monitor info associated with " + OBJECT_WAIT + " method"); + } + + int numLocks = mi.getLocks().size(); + for (int i = 0; i < numLocks - 1; ++i) { + assertMonitorInfo("waiting to re-lock in wait()", mi.getLocks().get(i), monitorAddress); + } + assertMonitorInfo("locked", mi.getLocks().getLast(), monitorAddress); + } + } + + } + + private void assertMonitorInfo(String expectedMessage, MonitorInfo monInfo, String monitorAddress) { + if (monInfo.getType().equals(expectedMessage) + && monInfo.getMonitorClass().equals(OBJECT + "11") + && monInfo.getMonitorAddress().equals( + monitorAddress)) { + System.out.println("Correct monitor info found"); + } else { + System.err.println("Error: incorrect monitor info: " + monInfo.getType() + ", " + monInfo.getMonitorClass() + ", " + monInfo.getMonitorAddress()); + System.err.println("Expected: " + expectedMessage + ", a java.lang.Object, " + monitorAddress); + throw new RuntimeException("Incorrect lock record in 'run' method"); + } + } + + private void analyzeThreadStackNoWaiting(ThreadStack ti2) { + Iterator it = ti2.getStack().iterator(); + + while (it.hasNext()) { + MethodInfo mi = it.next(); + if (mi.getLocks().size() != 0) { + throw new RuntimeException("Unexpected lock record in " + + mi.getName() + " method"); + } + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/Consts.java b/hotspot/test/serviceability/tmtools/jstack/utils/Consts.java new file mode 100644 index 00000000000..0a85cb0a153 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/Consts.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 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. + */ +package utils; + +/** + * + * Class includes reused constants across jstack's tests + * + */ +public class Consts { + + public static final String UNKNOWN = "XXXXXX"; + public static final String JNI_GLOBAL_REF = "JNI global references: "; + public static final String SCENARIO_NAME = "scenario"; + public static final String SEPARATOR = " "; + + public static String REENTRANT_LOCK_NONFAIR = "a java.util.concurrent.locks.ReentrantLock$NonfairSync"; + public static String REENTRANT_LOCK_FAIR = "a java.util.concurrent.locks.ReentrantLock$FairSync"; + public static final String FFORMAT_REENTRANT_LOCK_NONFAIR = "a java/util/concurrent/locks/ReentrantLock$NonfairSync"; + public static final String FFORMAT_REENTRANT_LOCK_FAIR = "a java/util/concurrent/locks/ReentrantLock$FairSync"; + + public static String REENTRANT_RW_LOCK_NONFAIR = "a java.util.concurrent.locks.ReentrantReadWriteLock$NonfairSync"; + public static String REENTRANT_RW_LOCK_FAIR = "a java.util.concurrent.locks.ReentrantReadWriteLock$FairSync"; + public static final String FFORMAT_REENTRANT_RW_LOCK_NONFAIR = "a java/util/concurrent/locks/ReentrantReadWriteLock$NonfairSync"; + public static final String FFORMAT_REENTRANT_RW_LOCK_FAIR = "a java/util/concurrent/locks/ReentrantReadWriteLock$FairSync"; + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/DefaultFormat.java b/hotspot/test/serviceability/tmtools/jstack/utils/DefaultFormat.java new file mode 100644 index 00000000000..4c753a5c0c9 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/DefaultFormat.java @@ -0,0 +1,266 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import java.util.Map; +import java.util.Scanner; +import java.util.regex.MatchResult; + +/** + * + * jstack default format 2008-03-05 18:36:26 Full thread dump Java HotSpot(TM) + * Client VM (11.0-b11 mixed mode): + * + * "Thread-16" #10 daemon prio=3 os_prio=0 tid=0x0814d800 nid=0x1d runnable + * [0xf394d000..0xf394d9f0] java.lang.Thread.State: RUNNABLE at + * java.net.SocketInputStream.socketRead0(Native Method) at + * java.net.SocketInputStream.read(SocketInputStream.java:129) at + * java.net.SocketInputStream.read(SocketInputStream.java:182) at + * java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2249) + * at + * java.io.ObjectInputStream$BlockDataInputStream.peek(ObjectInputStream.java:2542) + * at + * java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2552) + * at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1297) at + * java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at + * tmtools.share.debuggee.DebuggeeProtocolHandler.run(DebuggeeProtocolHandler.java:32) + * + * Locked ownable synchronizers: - None .... + * + * Note that os_prio field is optional and will be printed only if JVM was able + * to get native thread priority. + */ +public class DefaultFormat implements Format { + + protected String threadInfoPattern() { + return "^\"(.*)\"\\s(#\\d+\\s|)(daemon\\s|)prio=(.+)\\s(os_prio=(.+)\\s|)tid=(.+)\\snid=(.+)\\s(" + + Consts.UNKNOWN + + "|runnable|waiting\\son\\scondition|in\\sObject\\.wait\\(\\)|waiting\\sfor\\smonitor\\sentry)((.*))$"; + } + + protected String methodInfoPattern() { + return "^\\s+at\\s(.+)\\((.*?)(\\:|\\))((.*?))\\)?$"; + } + + protected String extendedStatusPattern() { + return "\\s+java\\.lang\\.Thread\\.State\\:\\s((.+))$"; + } + + protected String jniGlobalRefInfoPattern() { + return "^JNI\\sglobal\\sreferences:\\s((.+))$"; + } + + protected String monitorInfoPattern() { + return "^\\s+\\-\\s(locked|waiting\\son|waiting\\sto\\slock)\\s\\<(.*)\\>\\s\\(((.*))\\)$"; + } + + protected String vmVersionInfoPattern() { + return "Full\\sthread\\sdump\\s.*"; + } + + protected String ownableSynchronizersPattern() { + return "^\\s+\\-\\s(\\<.*\\>\\s\\(((.*))\\)|None)$"; + } + + public JStack parse(String stack) { + JStack result = new JStack(); + Scanner scanner = new Scanner(stack); + + // parsing thread stacks + ThreadStack currentThreadStack = null; + MethodInfo currentMethodInfo = null; + + try { + while (scanner.hasNextLine()) { + String line = scanner.nextLine(); + if (line.matches(threadInfoPattern())) { + currentThreadStack = parseThreadInfo(line); + result.addThreadStack(currentThreadStack.getThreadName(), currentThreadStack); + } else if (line.matches(methodInfoPattern())) { + currentMethodInfo = parseMethodInfo(line); + currentThreadStack.addMethod(currentMethodInfo); + } else if (line.matches(monitorInfoPattern())) { + MonitorInfo mi = parseMonitorInfo(line); + currentMethodInfo.getLocks().add(mi); + } else if (line.matches(extendedStatusPattern())) { + currentThreadStack.setExtendedStatus(parseExtendedStatus(line)); + } else if (line.matches(vmVersionInfoPattern())) { + result.setVmVersion(line); + } else if (line.matches(ownableSynchronizersPattern())) { + currentThreadStack.getLockOSList().add(parseLockInfo(line)); + } else if (line.matches(jniGlobalRefInfoPattern())) { + result.setJniGlobalReferences(parseJNIGlobalRefs(line)); + } else if (line.length() != 0) { + System.err.println("[Warning] Unknown string: " + line); + } + } + + scanner.close(); + + } catch (NullPointerException e) { + e.printStackTrace(); + throw new RuntimeException("Unexpected format in jstack output"); + } + + return result; + } + + private MonitorInfo parseMonitorInfo(String line) { + Scanner s = new Scanner(line); + s.findInLine(monitorInfoPattern()); + MonitorInfo mi = new MonitorInfo(); + MatchResult res = s.match(); + + mi.setType(res.group(1)); + mi.setMonitorAddress(res.group(2)); + mi.setMonitorClass(res.group(3)); + + return mi; + } + + protected String parseExtendedStatus(String line) { + Scanner s = new Scanner(line); + s.findInLine(extendedStatusPattern()); + String result = s.match().group(1); + s.close(); + return result; + } + + protected String parseJNIGlobalRefs(String line) { + Scanner s = new Scanner(line); + s.findInLine(jniGlobalRefInfoPattern()); + String result = s.match().group(1); + s.close(); + return result; + } + + protected ThreadStack parseThreadInfo(String threadInfo) { + Scanner s = new Scanner(threadInfo); + ThreadStack result = new ThreadStack(); + + // parsing thread info + s.findInLine(threadInfoPattern()); + MatchResult res = s.match(); + + result.setThreadName(res.group(1)); + + result.setType(res.group(3)); + + result.setPriority(res.group(4)); + result.setTid(res.group(7)); + result.setNid(res.group(8)); + result.setStatus(res.group(9)); + + s.close(); + return result; + } + + protected MethodInfo parseMethodInfo(String line) { + + MethodInfo result = new MethodInfo(); + Scanner s = new Scanner(line); + + s.findInLine(methodInfoPattern()); + MatchResult rexp = s.match(); + if (rexp.group(4) != null && rexp.group(4).length() > 0) { + // line " at tmtools.jstack.share.utils.Utils.sleep(Utils.java:29)" + result.setName(rexp.group(1)); + result.setCompilationUnit(rexp.group(2)); + result.setLine(rexp.group(4)); + + } else { + // line " at java.lang.Thread.sleep(Native Method)" + result.setName(rexp.group(1)); + } + + s.close(); + return result; + } + + public String dumpStackTraces() { + StringBuffer result = new StringBuffer(); + Map stacks = Thread.getAllStackTraces(); + + // adding data and vm version + result.append(Consts.UNKNOWN + "\n"); + result.append(Consts.UNKNOWN + "\n\n"); + + for (Thread t : stacks.keySet()) { + + result.append("\"" + t.getName() + "\""); + result.append(Consts.SEPARATOR); + + // status + if (t.isDaemon()) { + result.append("daemon"); + result.append(Consts.SEPARATOR); + } + + // priority + result.append("prio=" + t.getPriority()); + result.append(Consts.SEPARATOR); + + // tid + result.append("tid=" + Consts.UNKNOWN); + result.append(Consts.SEPARATOR); + + // nid + result.append("nid=" + Consts.UNKNOWN); + result.append(Consts.SEPARATOR); + + // status + result.append(Consts.UNKNOWN); + result.append(Consts.SEPARATOR); + + result.append("\n"); + + // extended status + result.append(" java.lang.Thread.State: " + + String.valueOf(Thread.currentThread().getState())); + result.append(Consts.SEPARATOR); + result.append("\n"); + + for (StackTraceElement st : stacks.get(t)) { + result.append(" at " + st.toString() + "\n"); + } + result.append("\n"); + } + + result.append(Consts.JNI_GLOBAL_REF + Consts.UNKNOWN + "\n"); + return result.toString(); + } + + protected LockInfo parseLockInfo(String line) { + LockInfo res = new LockInfo(); + + Scanner s = new Scanner(line); + s.findInLine(ownableSynchronizersPattern()); + + MatchResult matchRes = s.match(); + String lock = matchRes.group(1).equals("None") ? matchRes.group(1) : matchRes.group(2); + res.setLock(lock); + + return res; + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/Format.java b/hotspot/test/serviceability/tmtools/jstack/utils/Format.java new file mode 100644 index 00000000000..43ad5edbacc --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/Format.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 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. + */ +package utils; + +/** + * + * Base class for all formats + * + */ +public interface Format { + + public JStack parse(String stack); + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/JStack.java b/hotspot/test/serviceability/tmtools/jstack/utils/JStack.java new file mode 100644 index 00000000000..1aa23eef052 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/JStack.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import java.util.HashMap; + +/** + * + * Represents stack of all threads + some extra information + * + */ +public class JStack { + + private String date; + private String vmVersion; + private HashMap threads = new HashMap(); + private String jniGlobalReferences; + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + public String getVmVersion() { + return vmVersion; + } + + public void setVmVersion(String vmVersion) { + this.vmVersion = vmVersion; + } + + public HashMap getThreads() { + return threads; + } + + public void setThreads(HashMap threads) { + this.threads = threads; + } + + public void addThreadStack(String threadName, ThreadStack ts) { + System.out.println("Adding thread stack for thread: " + threadName); + threads.put(threadName, ts); + } + + public String getJniGlobalReferences() { + return jniGlobalReferences; + } + + public void setJniGlobalReferences(String jniGlobalReferences) { + this.jniGlobalReferences = jniGlobalReferences; + } + + public ThreadStack getThreadStack(String threadName) { + return threads.get(threadName); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/LockInfo.java b/hotspot/test/serviceability/tmtools/jstack/utils/LockInfo.java new file mode 100644 index 00000000000..8637041bba5 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/LockInfo.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 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. + */ +package utils; + +/** + * + * Represents lock info string + * + */ +public class LockInfo { + + private String lock; + + public String getLock() { + return lock; + } + + public void setLock(String lock) { + this.lock = lock; + } +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/MethodInfo.java b/hotspot/test/serviceability/tmtools/jstack/utils/MethodInfo.java new file mode 100644 index 00000000000..7cfc40b3860 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/MethodInfo.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import java.util.LinkedList; + +/** + * + * Represents method info string + * + */ +public class MethodInfo { + + private String name; + private String compilationUnit; + private String args; + private String bci; + private String line; + private String frameType; + + private LinkedList locks = new LinkedList(); + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCompilationUnit() { + return compilationUnit; + } + + public void setCompilationUnit(String compilationUnit) { + this.compilationUnit = compilationUnit; + } + + public String getArgs() { + return args; + } + + public void setArgs(String args) { + this.args = args; + } + + public String getBci() { + return bci; + } + + public void setBci(String bci) { + this.bci = bci; + } + + public String getLine() { + return line; + } + + public void setLine(String line) { + this.line = line; + } + + public String getFrameType() { + return frameType; + } + + public void setFrameType(String frameType) { + this.frameType = frameType; + } + + public LinkedList getLocks() { + return locks; + } + + public void setLocks(LinkedList locks) { + this.locks = locks; + } + + public boolean equals(MethodInfo another) { + + boolean result = true; + + if (!Utils.compareStrings(name, another.name)) { + Utils.log("name", name, another.name); + result = false; + } + + if (!Utils.compareStrings(compilationUnit, another.compilationUnit)) { + Utils.log("compilationUnit", compilationUnit, another.compilationUnit); + result = false; + } + + /* + if (!Utils.compareStrings(args, another.args)) { + Utils.log("args", args, another.args); + result = false; + } + + if (!Utils.compareStrings(bci, another.bci)) { + Utils.log("bci", bci, another.bci); + result = false; + } + + if (!Utils.compareStrings(frameType, another.frameType)) { + Utils.log("frameType", frameType, another.frameType); + result = false; + } + */ + if (!Utils.compareStrings(line, another.line)) { + Utils.log("line", line, another.line); + result = false; + } + + return result; + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/MonitorInfo.java b/hotspot/test/serviceability/tmtools/jstack/utils/MonitorInfo.java new file mode 100644 index 00000000000..e94033d6662 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/MonitorInfo.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 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. + */ +package utils; + +/** + * + * Represents monitor info string + * + */ +public class MonitorInfo { + + private String type; + private String monitorAddress; + private String monitorClass; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getMonitorAddress() { + return monitorAddress; + } + + public void setMonitorAddress(String monitorAddress) { + this.monitorAddress = monitorAddress; + } + + public String getMonitorClass() { + return monitorClass; + } + + public void setMonitorClass(String monitorClass) { + this.monitorClass = monitorClass; + } + + public boolean equals(MonitorInfo another) { + if (!type.equals(another.type)) { + Utils.log("type", type, another.type); + return false; + } + + if (!monitorAddress.equals(another.monitorAddress)) { + Utils.log("monitorAddress", monitorAddress, another.monitorAddress); + return false; + } + + if (!monitorClass.equals(another.monitorClass)) { + Utils.log("monitorClass", monitorClass, another.monitorClass); + return false; + } + + return true; + } + + public String toString() { + return type + " <" + monitorAddress + "> (" + monitorClass + ")"; + } +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/ThreadStack.java b/hotspot/test/serviceability/tmtools/jstack/utils/ThreadStack.java new file mode 100644 index 00000000000..5e92fb8d2dc --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/ThreadStack.java @@ -0,0 +1,175 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import java.util.Iterator; +import java.util.LinkedList; + +/** + * + * Represents the stack of the thread + * + */ +public class ThreadStack { + + private String threadType; // Thread / RealtimeThread / NoHeapRealtimeThread + private String threadName; + private String type; //daemon or not + private String priority; + private String tid; + private String nid; + + /** + * runnable or waiting on condition + */ + private String status; + private String pointerRange; + + /** + * i.e. java.lang.Thread.State: WAITING (on object monitor) + */ + private String extendedStatus; + + private LinkedList stack = new LinkedList(); + + private LinkedList lockOSList = new LinkedList(); + + public String getThreadName() { + return threadName; + } + + public void setThreadName(String threadName) { + this.threadName = threadName; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public String getTid() { + return tid; + } + + public void setTid(String tid) { + this.tid = tid; + } + + public String getNid() { + return nid; + } + + public void setNid(String nid) { + this.nid = nid; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getPointerRange() { + return pointerRange; + } + + public void setPointerRange(String pointerRange) { + this.pointerRange = pointerRange; + } + + public String getExtendedStatus() { + return extendedStatus; + } + + public void setExtendedStatus(String extendedStatus) { + this.extendedStatus = extendedStatus; + } + + public LinkedList getStack() { + return stack; + } + + public LinkedList getLockOSList() { + return lockOSList; + } + + public void setLockOSList(LinkedList lockOSList) { + this.lockOSList = lockOSList; + } + + public void addMethod(MethodInfo mi) { + stack.add(mi); + } + + public boolean hasEqualStack(ThreadStack another) { + boolean result = true; + + Iterator it1 = stack.iterator(); + Iterator it2 = another.stack.iterator(); + + while (it1.hasNext() && it2.hasNext()) { + + MethodInfo mi1 = it1.next(); + MethodInfo mi2 = it2.next(); + + if (mi1 == null && mi2 == null) { + break; + } + + boolean oneOfMethodInfoIsNull = mi1 == null && mi2 != null || mi1 != null && mi2 == null; + + if (oneOfMethodInfoIsNull || !mi1.equals(mi2)) { + result = false; + } + } + + if (it1.hasNext() || it2.hasNext()) { + Utils.log("stack sizes", String.valueOf(stack.size()), String.valueOf(another.stack.size())); + result = false; + } + + return result; + } + + public String getThreadType() { + return threadType; + } + + public void setThreadType(String threadType) { + this.threadType = threadType; + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstack/utils/Utils.java b/hotspot/test/serviceability/tmtools/jstack/utils/Utils.java new file mode 100644 index 00000000000..33e0414486f --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstack/utils/Utils.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 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. + */ +package utils; + +public class Utils { + + public static void log(String field, String val1, String val2) { + System.out.println(field + " mismatch. " + val1 + " vs " + val2); + } + + public static boolean compareStrings(String s1, String s2) { + + if (s1 != null && s1.equals(Consts.UNKNOWN) + || s2 != null && s2.equals(Consts.UNKNOWN)) { + return true; + } + + if (s1 == null && s2 != null || s1 != null && s2 == null) { + return false; + } + + if (s1 == null || s2 == null) { + return true; + } + return s1.equals(s2); + } + + public static void sleep() { + try { + while (true) { + Thread.sleep(Long.MAX_VALUE); + } + } catch (InterruptedException e) { + } + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java new file mode 100644 index 00000000000..791a6841042 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 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. + */ + +import utils.*; + +/* + * @test + * @summary Test checks the consistency of the output + * displayed with jstat -gccapacity. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * @build utils.* + * @run main/othervm -XX:+UsePerfData GcCapacityTest + */ +public class GcCapacityTest { + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcCapacityTool jstatGcTool = new JstatGcCapacityTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcCapacityResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + // Provoke a gc and verify the changed values + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + gcProvoker.provokeGc(); + JstatGcCapacityResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert that the GC events count has increased + JstatResults.assertGCEventsIncreased(measurement1, measurement2); + + // Provoke a gc again and verify the changed values + gcProvoker.provokeGc(); + JstatGcCapacityResults measurement3 = jstatGcTool.measure(); + measurement3.assertConsistency(); + + // Assert that the GC events count has increased + JstatResults.assertGCEventsIncreased(measurement1, measurement2); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java new file mode 100644 index 00000000000..4507683136b --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @summary Test checks output displayed with jstat -gccause. + * Test scenario: + * test several times provokes garbage collection in the debuggee application and after each garbage + * collection runs jstat. jstat should show that after garbage collection number of GC events and garbage + * collection time increase. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * @build utils.* + * + * @run main/othervm -XX:+UsePerfData GcCauseTest01 + */ +import utils.*; + +public class GcCauseTest01 { + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcCauseResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + + // Provoke GC then run the tool again and get the results asserting that they are reasonable + gcProvoker.provokeGc(); + JstatGcCauseResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + JstatResults.assertGCEventsIncreased(measurement1, measurement2); + JstatResults.assertGCTimeIncreased(measurement1, measurement2); + + // Provoke GC 3rd time then run the tool 3rd time twice and get the results + // asserting that they are reasonable + gcProvoker.provokeGc(); + JstatGcCauseResults measurement3 = jstatGcTool.measure(); + measurement3.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + JstatResults.assertGCEventsIncreased(measurement2, measurement3); + JstatResults.assertGCTimeIncreased(measurement2, measurement3); + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java new file mode 100644 index 00000000000..bc8f0058034 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @summary Test checks output displayed with jstat -gccause. + * Test scenario: + * tests forces debuggee application eat ~70% of heap and runs jstat. + * jstat should show that ~70% of heap (OC/OU ~= 70%). + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * @build utils.* + * + * @run main/othervm -XX:+UsePerfData -Xms128M -XX:MaxMetaspaceSize=128M GcCauseTest02 + */ +import utils.*; + +public class GcCauseTest02 { + + private final static float targetMemoryUsagePercent = 0.7f; + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcCauseResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + + // Eat metaspace and heap then run the tool again and get the results asserting that they are reasonable + gcProvoker.eatMetaspaceAndHeap(targetMemoryUsagePercent); + JstatGcCauseResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert that space has been utilized acordingly + JstatResults.assertSpaceUtilization(measurement2, targetMemoryUsagePercent); + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java new file mode 100644 index 00000000000..1ebb98b00b5 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @summary Test checks output displayed with jstat -gccause. + * Test scenario: + * test forces debuggee application call System.gc(), runs jstat and checks that + * cause of last garbage collection displayed by jstat (LGCC) is 'System.gc()'. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * @build utils.* + * + * @run main/othervm -XX:+UsePerfData -Xms128M -XX:MaxMetaspaceSize=128M GcCauseTest03 + */ +import utils.*; + +public class GcCauseTest03 { + + private final static float targetMemoryUsagePercent = 0.7f; + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid()); + + System.gc(); + + // Run once and get the results asserting that they are reasonable + JstatGcCauseResults measurement = jstatGcTool.measure(); + measurement.assertConsistency(); + + if (measurement.valueExists("LGCC")) { + if (!"System.gc()".equals(measurement.getStringValue("LGCC"))) { + throw new RuntimeException("Unexpected GC cause: " + measurement.getStringValue("LGCC") + ", expected System.gc()"); + } + } + + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java b/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java new file mode 100644 index 00000000000..e91ee8ecdf6 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 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. + */ + +import utils.*; +/* + * @test + * @summary Test checks output displayed with jstat -gcnew. + * Test scenario: + * test several times provokes garbage collection in the debuggee application and after each garbage + * collection runs jstat. jstat should show that after garbage collection number of GC events and garbage + * collection time increase. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * @build utils.* + * @run main/othervm -XX:+UsePerfData GcNewTest + */ + +public class GcNewTest { + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcNewTool jstatGcTool = new JstatGcNewTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcNewResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + + // Provoke GC and run the tool again + gcProvoker.provokeGc(); + JstatGcNewResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + assertThat(measurement2.getFloatValue("YGC") > measurement1.getFloatValue("YGC"), "YGC didn't increase between measurements 1 and 2"); + assertThat(measurement2.getFloatValue("YGCT") > measurement1.getFloatValue("YGCT"), "YGCT time didn't increase between measurements 1 and 2"); + + // Provoke GC and run the tool again + gcProvoker.provokeGc(); + JstatGcNewResults measurement3 = jstatGcTool.measure(); + measurement3.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + assertThat(measurement3.getFloatValue("YGC") > measurement2.getFloatValue("YGC"), "YGC didn't increase between measurements 1 and 2"); + assertThat(measurement3.getFloatValue("YGCT") > measurement2.getFloatValue("YGCT"), "YGCT time didn't increase between measurements 1 and 2"); + + } + + private static void assertThat(boolean result, String message) { + if (!result) { + throw new RuntimeException(message); + }; + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java new file mode 100644 index 00000000000..f0fc30fbb18 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 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. + */ + +/* + * @test + * @summary Test checks output displayed with jstat -gc. + * Test scenario: + * test several times provokes garbage collection + * in the debuggee application + * and after each garbage collection runs jstat. + * jstat should show that after garbage collection + * number of GC events and garbage + * collection time increase. + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * @build utils.* + * + * @run main/othervm -XX:+UsePerfData GcTest01 + */ +import utils.*; + +public class GcTest01 { + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + + // Provoke GC then run the tool again and get the results + // asserting that they are reasonable + gcProvoker.provokeGc(); + JstatGcResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + JstatResults.assertGCEventsIncreased(measurement1, measurement2); + JstatResults.assertGCTimeIncreased(measurement1, measurement2); + + // Provoke GC again and get the results + // asserting that they are reasonable + gcProvoker.provokeGc(); + JstatGcResults measurement3 = jstatGcTool.measure(); + measurement3.assertConsistency(); + + // Assert the increase in GC events and time between the measurements + JstatResults.assertGCEventsIncreased(measurement2, measurement3); + JstatResults.assertGCTimeIncreased(measurement2, measurement3); + + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest02.java b/hotspot/test/serviceability/tmtools/jstat/GcTest02.java new file mode 100644 index 00000000000..c2e55229688 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GcTest02.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 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. + */ + +import utils.*; +/* + * @test + * @summary Test checks output displayed with jstat -gc. + * Test scenario: + * tests forces debuggee application eat ~70% of heap and runs jstat. + * jstat should show that ~70% of heap is utilized (OC/OU ~= 70%). + * @library /test/lib/share/classes + * @library ../share + * @build common.* + * @build utils.* + * @run main/othervm -XX:+UsePerfData -Xms128M -XX:MaxMetaspaceSize=128M GcTest02 + */ + +public class GcTest02 { + + private final static float targetMemoryUsagePercent = 0.7f; + + public static void main(String[] args) throws Exception { + + // We will be running "jstat -gc" tool + JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().getPid()); + + // Run once and get the results asserting that they are reasonable + JstatGcResults measurement1 = jstatGcTool.measure(); + measurement1.assertConsistency(); + + GcProvoker gcProvoker = GcProvoker.createGcProvoker(); + + // Eat metaspace and heap then run the tool again and get the results asserting that they are reasonable + gcProvoker.eatMetaspaceAndHeap(targetMemoryUsagePercent); + JstatGcResults measurement2 = jstatGcTool.measure(); + measurement2.assertConsistency(); + + // Assert that space has been utilized acordingly + JstatResults.assertSpaceUtilization(measurement2, targetMemoryUsagePercent); + } + + private static void assertThat(boolean result, String message) { + if (!result) { + throw new RuntimeException(message); + }; + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/ClassLoadUtils.java b/hotspot/test/serviceability/tmtools/jstat/utils/ClassLoadUtils.java new file mode 100644 index 00000000000..f233d62d174 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/ClassLoadUtils.java @@ -0,0 +1,149 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.FileInputStream; + +public class ClassLoadUtils { + + private ClassLoadUtils() { + } + + /** + * Get filename of class file from classpath for given class name. + * + * @param className class name + * @return filename or null if not found + */ + public static String getClassPath(String className) { + String fileName = className.replace(".", File.separator) + ".class"; + String[] classPath = System.getProperty("java.class.path").split(File.pathSeparator); + File target = null; + int i; + for (i = 0; i < classPath.length; ++i) { + target = new File(classPath[i] + File.separator + fileName); + System.out.println("Try: " + target); + if (target.exists()) { + break; + } + } + if (i != classPath.length) { + return classPath[i]; + } + return null; + } + + /** + * Get filename of class file from classpath for given class name. + * + * @param className class name + * @return filename or null if not found + */ + public static String getClassPathFileName(String className) { + String fileName = className.replace(".", File.separator) + ".class"; + String[] classPath = System.getProperty("java.class.path").split(File.pathSeparator); + File target = null; + int i; + for (i = 0; i < classPath.length; ++i) { + target = new File(classPath[i] + File.separator + fileName); + System.out.println("Try: " + target); + if (target.exists()) { + break; + } + } + if (i != classPath.length) { + try { + return target.getCanonicalPath(); + } catch (IOException e) { + return null; + } + } + return null; + } + + public static String getRedefineClassFileName(String dir, String className) { + String fileName = getClassPathFileName(className); + if (fileName == null) { + return null; + } + if (fileName.contains("classes")) { + return fileName.replace("classes", dir); + } else { + String classPath = getClassPath(className); + if (classPath != null) { + return classPath + File.separator + "newclass" + File.separator + className.replace(".", File.separator) + ".class"; + } else { + return null; + } + } + } + + /** + * Get filename of class file which is to be redefined. + */ + public static String getRedefineClassFileName(String className) { + return getRedefineClassFileName("newclass", className); + } + + /** + * Read whole file. + * + * @param file file + * @return contents of file as byte array + */ + public static byte[] readFile(File file) throws IOException { + InputStream in = new FileInputStream(file); + long countl = file.length(); + if (countl > Integer.MAX_VALUE) { + throw new IOException("File is too huge"); + } + int count = (int) countl; + byte[] buffer = new byte[count]; + int n = 0; + try { + while (n < count) { + int k = in.read(buffer, n, count - n); + if (k < 0) { + throw new IOException("Unexpected EOF"); + } + n += k; + } + } finally { + in.close(); + } + return buffer; + } + + /** + * Read whole file. + * + * @param name file name + * @return contents of file as byte array + */ + public static byte[] readFile(String name) throws IOException { + return readFile(new File(name)); + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java new file mode 100644 index 00000000000..697b4225452 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 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. + */ +package utils; + +/** + * This is an interface used to provoke GC and perform other GC-related + * procedures + * + */ +public interface GcProvoker { + + /** + * The default implementation + * + * @return the default GC provoker + */ + public static GcProvoker createGcProvoker() { + return new GcProvokerImpl(); + } + + /** + * This method provokes a GC + */ + public void provokeGc(); + + /** + * Eats heap and metaspace Upon exit targetMemoryUsagePercent percents of + * heap and metaspace is have been eaten + * + * @param targetMemoryUsagePercent how many percent of heap and metaspace to + * eat + */ + public void eatMetaspaceAndHeap(float targetMemoryUsagePercent); + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java new file mode 100644 index 00000000000..309a5bd76db --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryUsage; +import java.util.ArrayList; +import java.util.List; + +/** + * + * Utilities to provoke GC in various ways + */ +public class GcProvokerImpl implements GcProvoker { + + private static List eatenMetaspace; + private static List eatenMemory; + + static List eatHeapMemory(float targetUsage) { + long maxMemory = Runtime.getRuntime().maxMemory(); + // uses fixed small objects to avoid Humongous objects allocation in G1 + int memoryChunk = 2048; + List list = new ArrayList<>(); + float used = 0; + while (used < targetUsage * maxMemory) { + try { + list.add(new byte[memoryChunk]); + used += memoryChunk; + } catch (OutOfMemoryError e) { + list = null; + throw new RuntimeException("Unexpected OOME while eating " + targetUsage + " of heap memory."); + } + } + return list; + } + + @Override + public void provokeGc() { + for (int i = 0; i < 3; i++) { + long edenSize = Pools.getEdenCommittedSize(); + long heapSize = Pools.getHeapCommittedSize(); + float targetPercent = ((float) edenSize) / (heapSize); + if ((targetPercent <= 0) || (targetPercent > 1.0)) { + throw new RuntimeException("Error in the percent calculation" + " (eden size: " + edenSize + ", heap size: " + heapSize + ", calculated eden percent: " + targetPercent + ")"); + } + eatHeapMemory(targetPercent); + eatHeapMemory(targetPercent); + System.gc(); + } + } + + @Override + public void eatMetaspaceAndHeap(float targetMemoryUsagePercent) { + eatenMemory = eatHeapMemory(targetMemoryUsagePercent); + eatenMetaspace = eatMetaspace(targetMemoryUsagePercent); + } + + private static List eatMetaspace(float targetUsage) { + List list = new ArrayList<>(); + final String metaspacePoolName = "Metaspace"; + MemoryPoolMXBean metaspacePool = null; + for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) { + if (pool.getName().contains(metaspacePoolName)) { + metaspacePool = pool; + break; + } + } + if (metaspacePool == null) { + throw new RuntimeException("MXBean for Metaspace pool wasn't found"); + } + float currentUsage; + GeneratedClassProducer gp = new GeneratedClassProducer(); + do { + try { + list.add(gp.create(0)); + } catch (OutOfMemoryError oome) { + list = null; + throw new RuntimeException("Unexpected OOME while eating " + targetUsage + " of Metaspace."); + } + MemoryUsage memoryUsage = metaspacePool.getUsage(); + currentUsage = (((float) memoryUsage.getUsed()) / memoryUsage.getMax()); + } while (currentUsage < targetUsage); + return list; + } + + public GcProvokerImpl() { + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GeneratedClassProducer.java b/hotspot/test/serviceability/tmtools/jstat/utils/GeneratedClassProducer.java new file mode 100644 index 00000000000..e93498750c6 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GeneratedClassProducer.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 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. + */ +package utils; + +/** + * Garbage producer that creates classes loaded with GeneratingClassLoader. + * + * Note: this class is not thread-safe. + */ +class GeneratedClassProducer { + + private int number; + private String className; + private StringBuilder sb = new StringBuilder(); + private int minPerClassLoader = 50; + private int maxPerClassLoader = 150; + private int count; + private GeneratingClassLoader loader = new GeneratingClassLoader(); + + GeneratedClassProducer() { + this(GeneratingClassLoader.DEFAULT_CLASSNAME); + } + + GeneratedClassProducer(String className) { + this.className = className; + } + + String getNewName() { + sb.delete(0, sb.length()); + sb.append("Class"); + sb.append(number); + int n = loader.getNameLength() - sb.length(); + for (int i = 0; i < n; ++i) { + sb.append('_'); + } + return sb.toString(); + } + + Class create(long memory) { + try { + if (number++ > maxPerClassLoader || loader == null) { + loader = new GeneratingClassLoader(className); + count = 50; + number = 0; + } + return loader.loadClass(getNewName()); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GeneratingClassLoader.java b/hotspot/test/serviceability/tmtools/jstat/utils/GeneratingClassLoader.java new file mode 100644 index 00000000000..fd819d88422 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GeneratingClassLoader.java @@ -0,0 +1,195 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import java.io.*; +import java.util.*; + +/** + * Classloader that generates classes on the fly. + * + * This classloader can load classes with name starting with 'Class'. It will + * use TemplateClass as template and will replace class name in the bytecode of + * template class. It can be used for example to detect memory leaks in class + * loading or to quickly fill PermGen. + */ +class GeneratingClassLoader extends ClassLoader { + + public synchronized Class loadClass(String name) throws ClassNotFoundException { + return loadClass(name, false); + } + + public synchronized Class loadClass(String name, boolean resolve) + throws ClassNotFoundException { + Class c = findLoadedClass(name); + if (c != null) { + return c; + } + if (!name.startsWith(PREFIX)) { + return super.loadClass(name, resolve); + } + if (name.length() != templateClassName.length()) { + throw new ClassNotFoundException("Only can load classes with name.length() = " + getNameLength() + " got: '" + name + "' length: " + name.length()); + } + byte[] bytecode = getPatchedByteCode(name); + c = defineClass(name, bytecode, 0, bytecode.length); + if (resolve) { + resolveClass(c); + } + return c; + } + + /** + * Create generating class loader that will use class file for given class + * from classpath as template. + */ + GeneratingClassLoader(String templateClassName) { + this.templateClassName = templateClassName; + classPath = System.getProperty("java.class.path").split(File.pathSeparator); + try { + templateClassNameBytes = templateClassName.getBytes(encoding); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } + + /** + * Create generating class loader that will use class file for + * nsk.share.classload.TemplateClass as template. + */ + GeneratingClassLoader() { + this(TemplateClass.class.getName()); + } + + int getNameLength() { + return templateClassName.length(); + } + + String getPrefix() { + return PREFIX; + } + + String getClassName(int number) { + StringBuffer sb = new StringBuffer(); + sb.append(PREFIX); + sb.append(number); + int n = templateClassName.length() - sb.length(); + for (int i = 0; i < n; ++i) { + sb.append("_"); + } + return sb.toString(); + } + + private byte[] getPatchedByteCode(String name) throws ClassNotFoundException { + try { + byte[] bytecode = getByteCode(); + String fname = name.replace(".", File.separator); + byte[] replaceBytes = fname.getBytes(encoding); + for (int offset : offsets) { + for (int i = 0; i < replaceBytes.length; ++i) { + bytecode[offset + i] = replaceBytes[i]; + } + } + return bytecode; + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } + + private byte[] getByteCode() throws ClassNotFoundException { + if (bytecode == null) { + readByteCode(); + } + if (offsets == null) { + getOffsets(bytecode); + if (offsets == null) { + throw new RuntimeException("Class name not found in template class file"); + } + } + return (byte[]) bytecode.clone(); + } + + private void readByteCode() throws ClassNotFoundException { + String fname = templateClassName.replace(".", File.separator) + ".class"; + File target = null; + for (int i = 0; i < classPath.length; ++i) { + target = new File(classPath[i] + File.separator + fname); + if (target.exists()) { + break; + } + } + + if (target == null || !target.exists()) { + throw new ClassNotFoundException("File not found: " + target); + } + try { + bytecode = ClassLoadUtils.readFile(target); + } catch (IOException e) { + throw new ClassNotFoundException(templateClassName, e); + } + } + + private void getOffsets(byte[] bytecode) { + List offsets = new ArrayList(); + if (this.offsets == null) { + String pname = templateClassName.replace(".", "/"); + try { + byte[] pnameb = pname.getBytes(encoding); + int i = 0; + while (true) { + while (i < bytecode.length) { + int j = 0; + while (j < pnameb.length && bytecode[i + j] == pnameb[j]) { + ++j; + } + if (j == pnameb.length) { + break; + } + i++; + } + if (i == bytecode.length) { + break; + } + offsets.add(new Integer(i)); + i++; + } + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + this.offsets = new int[offsets.size()]; + for (int i = 0; i < offsets.size(); ++i) { + this.offsets[i] = offsets.get(i).intValue(); + } + } + } + + static final String DEFAULT_CLASSNAME = TemplateClass.class.getName(); + static final String PREFIX = "Class"; + + private final String[] classPath; + private byte[] bytecode; + private int[] offsets; + private final String encoding = "UTF8"; + private final String templateClassName; + private final byte[] templateClassNameBytes; +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java new file mode 100644 index 00000000000..c4eb9bdbda2 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java @@ -0,0 +1,159 @@ +/* + * Copyright (c) 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. + */ + +/* + * Results of running the JstatGcTool ("jstat -gccapacity ") + * + * Output example: + * NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC MCMN MCMX MC YGC FGC + * 41984.0 671744.0 41984.0 5248.0 5248.0 31488.0 83968.0 1343488.0 83968.0 83968.0 512.0 110592.0 4480.0 0 0 + + * Output description: + * NGCMN Minimum new generation capacity (KB). + * NGCMX Maximum new generation capacity (KB). + * NGC Current new generation capacity (KB). + * S0C Current survivor space 0 capacity (KB). + * S1C Current survivor space 1 capacity (KB). + * EC Current eden space capacity (KB). + * OGCMN Minimum old generation capacity (KB). + * OGCMX Maximum old generation capacity (KB). + * OGC Current old generation capacity (KB). + * OC Current old space capacity (KB). + * MCMN Minimum metaspace capacity (KB). + * MCMX Maximum metaspace capacity (KB). + * MC Current metaspace capacity (KB). + * YGC Number of Young generation GC Events. + * FGC Number of Full GC Events. + */ +package utils; + +import common.ToolResults; +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.util.Arrays; +import java.util.List; + +public class JstatGcCapacityResults extends JstatResults { + + public JstatGcCapacityResults(ToolResults rawResults) { + super(rawResults); + } + + /** + * Checks the overall consistency of the results reported by the tool + */ + public void assertConsistency() { + + // Check exit code + assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); + + // Check Young Gen consistency + float NGCMN = getFloatValue("NGCMN"); + float NGCMX = getFloatValue("NGCMX"); + assertThat(NGCMX >= NGCMN, "NGCMN > NGCMX (min generation capacity > max generation capacity)"); + + float NGC = getFloatValue("NGC"); + assertThat(NGC >= NGCMN, "NGC < NGCMN (generation capacity < min generation capacity)"); + assertThat(NGC <= NGCMX, "NGC > NGCMX (generation capacity > max generation capacity)"); + + float S0C = getFloatValue("S0C"); + assertThat(S0C < NGC, "S0C >= NGC (survivor space 0 capacity >= new generation capacity)"); + + float S1C = getFloatValue("S1C"); + assertThat(S1C < NGC, "S1C >= NGC (survivor space 1 capacity >= new generation capacity)"); + + float EC = getFloatValue("EC"); + assertThat(EC <= NGC, "EC > NGC (eden space capacity > new generation capacity)"); + + // Verify relative size of NGC and S0C + S1C + EC. + // The rule depends on if the tenured GC is parallel or not. + // For parallell GC: NGC >= S0C + S1C + EC + // For non-parallell GC: NGC == S0C + S1C + EC + boolean isTenuredParallelGC = isTenuredParallelGC(); + String errMsg = String.format( + "NGC %s (S0C + S1C + EC) (NGC = %.1f, S0C = %.1f, S1C = %.1f, EC = %.1f, (S0C + S1C + EC) = %.1f)", + isTenuredParallelGC ? "<" : "!=", NGC, S0C, S1C, EC, S0C + S1C + EC); + if (isTenuredParallelGC) { + assertThat(NGC >= S0C + S1C + EC, errMsg); + } else { + assertThat(checkFloatIsSum(NGC, S0C, S1C, EC), errMsg); + } + + // Check Old Gen consistency + float OGCMN = getFloatValue("OGCMN"); + float OGCMX = getFloatValue("OGCMX"); + assertThat(OGCMX >= OGCMN, "OGCMN > OGCMX (min generation capacity > max generation capacity)"); + + float OGC = getFloatValue("OGC"); + assertThat(OGC >= OGCMN, "OGC < OGCMN (generation capacity < min generation capacity)"); + assertThat(OGC <= OGCMX, "OGC > OGCMX (generation capacity > max generation capacity)"); + float OC = getFloatValue("OC"); + assertThat(OC == OGC, "OC != OGC (old generation capacity != old space capacity (these values should be equal since old space is made up only from one old generation))"); + + // Check Metaspace consistency + float MCMN = getFloatValue("MCMN"); + float MCMX = getFloatValue("MCMX"); + assertThat(MCMX >= MCMN, "MCMN > MCMX (min generation capacity > max generation capacity)"); + float MC = getFloatValue("MC"); + assertThat(MC >= MCMN, "MC < MCMN (generation capacity < min generation capacity)"); + assertThat(MC <= MCMX, "MGC > MCMX (generation capacity > max generation capacity)"); + + + } + + /** + * Check if the tenured generation are currently using a parallel GC. + */ + protected static boolean isTenuredParallelGC() { + // Currently the only parallel GC for the tenured generation is PS MarkSweep. + List parallelGCs = Arrays.asList(new String[] { "PS MarkSweep"}); + try { + List beans = ManagementFactory.getGarbageCollectorMXBeans(); + for (GarbageCollectorMXBean bean : beans) { + if (parallelGCs.contains(bean.getName())) { + return true; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f; + + private static boolean checkFloatIsSum(float sum, float... floats) { + for (float f : floats) { + sum -= f; + } + + return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE; + } + + private void assertThat(boolean b, String message) { + if (!b) { + throw new RuntimeException(message); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityTool.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityTool.java new file mode 100644 index 00000000000..74cffa150ce --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityTool.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import common.TmTool; + +/** + * This tool executes "jstat -gccapacity " and returns the results as + * JstatGcCapacityoolResults + */ +public class JstatGcCapacityTool extends TmTool { + + public JstatGcCapacityTool(long pid) { + super(JstatGcCapacityResults.class, "jstat", "-gccapacity " + pid); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java new file mode 100644 index 00000000000..3bb708dd7ba --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 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. + */ + +/* + * Results of running the JstatGcTool ("jstat -gccause ") + * + * Output example: + * S0 S1 E O M CCS YGC YGCT FGC FGCT GCT LGCC GCC + * 0.00 6.25 46.19 0.34 57.98 54.63 15305 1270.551 0 0.000 1270.551 Allocation Failure No GC + + * Output description: + * S0 Survivor space 0 utilization as a percentage of the space's current capacity. + * S1 Survivor space 1 utilization as a percentage of the space's current capacity. + * E Eden space utilization as a percentage of the space's current capacity. + * O Old space utilization as a percentage of the space's current capacity. + * M Metaspace utilization as a percentage of the space's current capacity. + * CCS Compressed Class Space + * YGC Number of young generation GC events. + * YGCT Young generation garbage collection time. + * FGC Number of full GC events. + * FGCT Full garbage collection time. + * GCT Total garbage collection time. + * LGCC Cause of last Garbage Collection. + * GCC Cause of current Garbage Collection. + */ +package utils; + +import common.ToolResults; + +public class JstatGcCauseResults extends JstatResults { + + public JstatGcCauseResults(ToolResults rawResults) { + super(rawResults); + } + + /** + * Checks the overall consistency of the results reported by the tool + */ + public void assertConsistency() { + + assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); + + int YGC = getIntValue("YGC"); + float YGCT = getFloatValue("YGCT"); + assertThat(YGCT >= 0, "Incorrect time value for YGCT"); + if (YGC > 0) { + assertThat(YGCT > 0, "Number of young generation GC Events is " + YGC + ", but YGCT is 0"); + } + + float GCT = getFloatValue("GCT"); + assertThat(GCT >= 0, "Incorrect time value for GCT"); + assertThat(GCT >= YGCT, "GCT < YGCT (total garbage collection time < young generation garbage collection time)"); + + int FGC = getIntValue("FGC"); + float FGCT = getFloatValue("FGCT"); + assertThat(FGCT >= 0, "Incorrect time value for FGCT"); + if (FGC > 0) { + assertThat(FGCT > 0, "Number of full GC events is " + FGC + ", but FGCT is 0"); + } + + assertThat(GCT >= FGCT, "GCT < YGCT (total garbage collection time < full generation garbage collection time)"); + + assertThat(checkFloatIsSum(GCT, YGCT, FGCT), "GCT != (YGCT + FGCT) " + "(GCT = " + GCT + ", YGCT = " + YGCT + + ", FGCT = " + FGCT + ", (YCGT + FGCT) = " + (YGCT + FGCT) + ")"); + } + + private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f; + + private static boolean checkFloatIsSum(float sum, float... floats) { + for (float f : floats) { + sum -= f; + } + + return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE; + } + + private void assertThat(boolean b, String message) { + if (!b) { + throw new RuntimeException(message); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseTool.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseTool.java new file mode 100644 index 00000000000..c0dd36d8abb --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseTool.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import common.TmTool; + +/** + * This tool executes "jstat -gc " and returns the results as + * JstatGcToolResults + */ +public class JstatGcCauseTool extends TmTool { + + public JstatGcCauseTool(long pid) { + super(JstatGcCauseResults.class, "jstat", "-gc " + pid); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java new file mode 100644 index 00000000000..24ff4490b80 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 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. + */ + +/* + * Results of running the JstatGcTool ("jstat -gcnew ") + * + * Output example: + * S0C S1C S0U S1U TT MTT DSS EC EU YGC YGCT + * 11264.0 11264.0 0.0 0.0 15 15 0.0 67584.0 1351.7 0 0.000 + + * Output description: + * S0C Current survivor space 0 capacity (KB). + * S1C Current survivor space 1 capacity (KB). + * S0U Survivor space 0 utilization (KB). + * S1U Survivor space 1 utilization (KB). + * TT Tenuring threshold. + * MTT Maximum tenuring threshold. + * DSS Desired survivor size (KB). + * EC Current eden space capacity (KB). + * EU Eden space utilization (KB). + * YGC Number of young generation GC events. + * YGCT Young generation garbage collection time. + */ +package utils; + +import common.ToolResults; + +public class JstatGcNewResults extends JstatResults { + + public JstatGcNewResults(ToolResults rawResults) { + super(rawResults); + } + + /** + * Checks the overall consistency of the results reported by the tool + */ + public void assertConsistency() { + + assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); + + float S0C = getFloatValue("S0C"); + float S0U = getFloatValue("S0U"); + + assertThat(S0U <= S0C, "S0U > S0C (utilization > capacity)"); + + float S1C = getFloatValue("S1C"); + float S1U = getFloatValue("S1U"); + + assertThat(S1U <= S1C, "S1U > S1C (utilization > capacity)"); + + float EC = getFloatValue("EC"); + float EU = getFloatValue("EU"); + + assertThat(EU <= EC, "EU > EC (utilization > capacity)"); + + int YGC = getIntValue("YGC"); + float YGCT = getFloatValue("YGCT"); + + if (YGC > 0) { + assertThat(YGCT > 0, "Number of young generation GC Events is " + YGC + ", but YGCT is 0"); + } + + int TT = getIntValue("TT"); + int MTT = getIntValue("MTT"); + assertThat(TT <= MTT, "TT > MTT (tenuring threshold > maximum tenuring threshold)"); + } + + private void assertThat(boolean b, String message) { + if (!b) { + throw new RuntimeException(message); + } + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewTool.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewTool.java new file mode 100644 index 00000000000..ed3f20a6c20 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewTool.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import common.TmTool; + +/** + * This tool executes "jstat -gcnew " and returns the results as + * JstatGcNewResults + */ +public class JstatGcNewTool extends TmTool { + + public JstatGcNewTool(long pid) { + super(JstatGcNewResults.class, "jstat", "-gcnew " + pid); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java new file mode 100644 index 00000000000..95905418a37 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 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. + */ + +/* + * Results of running the JstatGcTool ("jstat -gc ") + * + * Output example: + * (S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT + * 512.0 512.0 32.0 0.0 288768.0 168160.6 83968.0 288.1 4864.0 2820.3 512.0 279.7 18510 1559.208 0 0.000 1559.208 + * + * Output description: + * S0C Current survivor space 0 capacity (KB). + * S1C Current survivor space 1 capacity (KB). + * S0U Survivor space 0 utilization (KB). + * S1U Survivor space 1 utilization (KB). + * EC Current eden space capacity (KB). + * EU Eden space utilization (KB). + * OC Current old space capacity (KB). + * OU Old space utilization (KB). + * MC Current metaspace capacity (KB). + * MU Metaspace utilization (KB). + * CCSC Compressed Class Space capacity + * CCSU Compressed Class Space utilization + * YGC Number of young generation GC Events. + * YGCT Young generation garbage collection time. + * FGC Number of full GC events. + * FGCT Full garbage collection time. + * GCT Total garbage collection time. + * + */ +package utils; + +import common.ToolResults; + +public class JstatGcResults extends JstatResults { + + public JstatGcResults(ToolResults rawResults) { + super(rawResults); + } + + /** + * Checks the overall consistency of the results reported by the tool + */ + public void assertConsistency() { + + assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); + + float OC = getFloatValue("OC"); + float OU = getFloatValue("OU"); + assertThat(OU <= OC, "OU > OC (utilization > capacity)"); + + float MC = getFloatValue("MC"); + float MU = getFloatValue("MU"); + assertThat(MU <= MC, "MU > MC (utilization > capacity)"); + + float CCSC = getFloatValue("CCSC"); + float CCSU = getFloatValue("CCSU"); + assertThat(CCSU <= CCSC, "CCSU > CCSC (utilization > capacity)"); + + float S0C = getFloatValue("S0C"); + float S0U = getFloatValue("S0U"); + assertThat(S0U <= S0C, "S0U > S0C (utilization > capacity)"); + + float S1C = getFloatValue("S1C"); + float S1U = getFloatValue("S1U"); + assertThat(S1U <= S1C, "S1U > S1C (utilization > capacity)"); + + float EC = getFloatValue("EC"); + float EU = getFloatValue("EU"); + assertThat(EU <= EC, "EU > EC (utilization > capacity)"); + + int YGC = getIntValue("YGC"); + float YGCT = getFloatValue("YGCT"); + assertThat(YGCT >= 0, "Incorrect time value for YGCT"); + if (YGC > 0) { + assertThat(YGCT > 0, "Number of young generation GC Events is " + YGC + ", but YGCT is 0"); + } + + float GCT = getFloatValue("GCT"); + assertThat(GCT >= 0, "Incorrect time value for GCT"); + assertThat(GCT >= YGCT, "GCT < YGCT (total garbage collection time < young generation garbage collection time)"); + + int FGC = getIntValue("FGC"); + float FGCT = getFloatValue("FGCT"); + assertThat(FGCT >= 0, "Incorrect time value for FGCT"); + if (FGC > 0) { + assertThat(FGCT > 0, "Number of full GC events is " + FGC + ", but FGCT is 0"); + } + + assertThat(GCT >= FGCT, "GCT < YGCT (total garbage collection time < full generation garbage collection time)"); + + assertThat(checkFloatIsSum(GCT, YGCT, FGCT), "GCT != (YGCT + FGCT) " + "(GCT = " + GCT + ", YGCT = " + YGCT + + ", FGCT = " + FGCT + ", (YCGT + FGCT) = " + (YGCT + FGCT) + ")"); + } + + private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f; + + private static boolean checkFloatIsSum(float sum, float... floats) { + for (float f : floats) { + sum -= f; + } + + return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE; + } + + private void assertThat(boolean b, String message) { + if (!b) { + throw new RuntimeException(message); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcTool.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcTool.java new file mode 100644 index 00000000000..e046768a46f --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcTool.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import common.TmTool; + +/** + * This tool executes "jstat -gc " and returns the results as + * JstatGcToolResults + */ +public class JstatGcTool extends TmTool { + + public JstatGcTool(long pid) { + super(JstatGcResults.class, "jstat", "-gc " + pid); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java new file mode 100644 index 00000000000..d4f961051f8 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java @@ -0,0 +1,147 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import common.ToolResults; + +/** + * Results of running the jstat tool Concrete subclasses will detail the jstat + * tool options + */ +abstract public class JstatResults extends ToolResults { + + public JstatResults(ToolResults rawResults) { + super(rawResults); + } + + /** + * Gets a string result from the column labeled 'name' + * + * @param name - name of the column + * @return the result + */ + public String getStringValue(String name) { + int valueNdx = new StringOfValues(getStdoutLine(0)).getIndex(name); + return new StringOfValues(getStdoutLine(1)).getValue(valueNdx); + } + + /** + * Gets a float result from the column labeled 'name' + * + * @param name - name of the column + * @return the result + */ + public float getFloatValue(String name) { + int valueNdx = new StringOfValues(getStdoutLine(0)).getIndex(name); + return Float.valueOf(new StringOfValues(getStdoutLine(1)).getValue(valueNdx)); + } + + /** + * Gets an integer result from the column labeled 'name' + * + * @param name - name of the column + * @return the result + */ + public int getIntValue(String name) { + int valueNdx = new StringOfValues(getStdoutLine(0)).getIndex(name); + return Integer.valueOf(new StringOfValues(getStdoutLine(1)).getValue(valueNdx)); + } + + /** + * Checks if a column with a given name exists + * + * @param name - name of the column + * @return true if the column exist, false otherwise + */ + public boolean valueExists(String name) { + return new StringOfValues(getStdoutLine(0)).getIndex(name) != -1; + } + + /** + * Helper function to assert the increase of the GC events between 2 + * measurements + * + * @param measurement1 -first measurement + * @param measurement2 -first measurement + */ + public static void assertGCEventsIncreased(JstatResults measurement1, JstatResults measurement2) { + assertThat(measurement2.getFloatValue("YGC") > measurement1.getFloatValue("YGC"), "YGC didn't increase between measurements 1 and 2"); + assertThat(measurement2.getFloatValue("FGC") > measurement1.getFloatValue("FGC"), "FGC didn't increase between measurements 2 and 3"); + } + + /** + * Helper function to assert the increase of the GC time between 2 + * measurements + * + * @param measurement1 -first measurement + * @param measurement2 -first measurement + */ + public static void assertGCTimeIncreased(JstatResults measurement1, JstatResults measurement2) { + assertThat(measurement2.getFloatValue("YGCT") > measurement1.getFloatValue("YGCT"), "YGCT time didn't increase between measurements 1 and 2"); + assertThat(measurement2.getFloatValue("FGCT") > measurement1.getFloatValue("FGCT"), "FGCT time didn't increase between measurements 1 and 2"); + assertThat(measurement2.getFloatValue("GCT") > measurement1.getFloatValue("GCT"), "GCT time didn't increase between measurements 1 and 2"); + } + + /** + * Helper function to assert the utilization of the space + * + * @param measurement - measurement results to analyze + * @param targetMemoryUsagePercent -assert that not less than this amount of + * space has been utilized + */ + public static void assertSpaceUtilization(JstatResults measurement, float targetMemoryUsagePercent) { + + if (measurement.valueExists("OU")) { + float OC = measurement.getFloatValue("OC"); + float OU = measurement.getFloatValue("OU"); + assertThat((OU / OC) > targetMemoryUsagePercent, "Old space utilization should be > " + + (targetMemoryUsagePercent * 100) + "%, actually OU / OC = " + (OU / OC)); + } + + if (measurement.valueExists("MU")) { + float MC = measurement.getFloatValue("MC"); + float MU = measurement.getFloatValue("MU"); + assertThat((MU / MC) > targetMemoryUsagePercent, "Metaspace utilization should be > " + + (targetMemoryUsagePercent * 100) + "%, actually MU / MC = " + (MU / MC)); + } + + if (measurement.valueExists("O")) { + float O = measurement.getFloatValue("O"); + assertThat(O > targetMemoryUsagePercent * 100, "Old space utilization should be > " + + (targetMemoryUsagePercent * 100) + "%, actually O = " + O); + } + + if (measurement.valueExists("M")) { + float M = measurement.getFloatValue("M"); + assertThat(M > targetMemoryUsagePercent * 100, "Metaspace utilization should be > " + + (targetMemoryUsagePercent * 100) + "%, actually M = " + M); + } + } + + private static void assertThat(boolean result, String message) { + if (!result) { + throw new RuntimeException(message); + } + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/Pools.java b/hotspot/test/serviceability/tmtools/jstat/utils/Pools.java new file mode 100644 index 00000000000..3d9b8e96b77 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/Pools.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 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. + */ +package utils; + +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryPoolMXBean; + +/** + * Utility to obtain memory pools statistics + * + */ +public class Pools { + + private static final String EDEN_SPACE_POOL = "Eden Space"; + private static final String OLD_GEN_POOL = "Old Gen"; + private static final String METASPACE_POOL = "Metaspace"; + private static final String SURVIVOR_SPACE = "Survivor Space"; + + public static long getNGMaxSize() { + // NewGen is consists of Eden and two Survivor spaces + return getPoolMaxSize(EDEN_SPACE_POOL) + 2 * getPoolMaxSize(SURVIVOR_SPACE); + } + + public static long getHeapCommittedSize() { + return ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getCommitted() / 1024; + } + + public static long getEdenCommittedSize() { + return getPoolCommittedSize(EDEN_SPACE_POOL); + } + + public static long getOldGenCommittedSize() { + return getPoolCommittedSize(OLD_GEN_POOL); + } + + public static long getMetaspaceCommittedSize() { + return getPoolCommittedSize(METASPACE_POOL); + } + + private static long getPoolMaxSize(String poolName) { + long result; + MemoryPoolMXBean pool = findPool(poolName); + if (pool != null) { + if (pool.getUsage().getMax() == -1) { + result = -1; + } else { + result = pool.getUsage().getCommitted() / 1024; + } + } else { + throw new RuntimeException("Pool '" + poolName + "' wasn't found"); + } + log("Max size of the pool '" + poolName + "' is " + result); + return result; + } + + private static long getPoolCommittedSize(String poolName) { + long result; + MemoryPoolMXBean pool = findPool(poolName); + if (pool != null) { + if (pool.getUsage().getCommitted() == -1) { + result = -1; + } else { + result = pool.getUsage().getCommitted() / 1024; + } + } else { + throw new RuntimeException("Pool '" + poolName + "' wasn't found"); + } + log("Committed size of the pool '" + poolName + "' is " + result); + return result; + } + + private static MemoryPoolMXBean findPool(String poolName) { + for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) { + if (pool.getName().contains(poolName)) { + return pool; + } + } + return null; + } + + private static void log(String s) { + System.out.println(s); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/StringOfValues.java b/hotspot/test/serviceability/tmtools/jstat/utils/StringOfValues.java new file mode 100644 index 00000000000..275d0e7e5c0 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/StringOfValues.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 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. + */ + +package utils; + +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +/** + * Helper class to get the values from tools output + */ +class StringOfValues { + + private List values; + + StringOfValues(String s) { + this.values = new ArrayList<>(); + StringTokenizer st = new StringTokenizer(s); + while (st.hasMoreTokens()) { + values.add(st.nextToken()); + } + } + + int getIndex(String val) { + for (int ndx = 0; ndx < values.size(); ++ndx) { + if (values.get(ndx).equals(val)) { + return ndx; + } + } + return -1; + } + + String getValue(int ndx) { + return values.get(ndx); + } + +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/TemplateClass.java b/hotspot/test/serviceability/tmtools/jstat/utils/TemplateClass.java new file mode 100644 index 00000000000..2168abc0ffe --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/TemplateClass.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 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. + */ +package utils; + +class TemplateClass { +} diff --git a/hotspot/test/serviceability/tmtools/share/common/TmTool.java b/hotspot/test/serviceability/tmtools/share/common/TmTool.java new file mode 100644 index 00000000000..cdcc8f5123b --- /dev/null +++ b/hotspot/test/serviceability/tmtools/share/common/TmTool.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 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. + + */ +package common; + +import java.nio.file.Path; +import java.nio.file.Paths; +import jdk.test.lib.Platform; + +/** + * A tool, such as jstat, jmap, etc Specific tools are defined as subclasses + * parameterized by their corresponding ToolResults subclasses + */ +public abstract class TmTool { + + private final Class resultsClz; + private final String cmdLine; + + public TmTool(Class resultsClz, String toolName, String otherArgs) { + this.resultsClz = resultsClz; + this.cmdLine = adjustForTestJava(toolName) + " " + otherArgs; + } + + /** + * Runs the tool to completion and returns the results + * + * @return the tool results + * @throws Exception if anything goes wrong + */ + public T measure() throws Exception { + ToolRunner runner = new ToolRunner(cmdLine); + ToolResults rawResults = runner.runToCompletion(); + System.out.println("Process output: " + rawResults); + return resultsClz.getDeclaredConstructor(ToolResults.class).newInstance(rawResults); + } + + private String adjustForTestJava(String toolName) { + // We need to make sure we are running the tol from the JDK under testing + String jdkPath = System.getProperty("test.jdk"); + if (jdkPath == null || !Paths.get(jdkPath).toFile().exists()) { + throw new RuntimeException("property test.jdk not not set"); + } + Path toolPath = Paths.get("bin", toolName + (Platform.isWindows() ? ".exe" : "")); + return Paths.get(jdkPath, toolPath.toString()).toString(); + } + +} diff --git a/hotspot/test/serviceability/tmtools/share/common/ToolResults.java b/hotspot/test/serviceability/tmtools/share/common/ToolResults.java new file mode 100644 index 00000000000..057c51598f9 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/share/common/ToolResults.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 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. + */ +package common; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * Common results of running an executable such as the saved exit code, the + * saved stdout and stderr + */ +public class ToolResults { + + public int getExitCode() { + return exitCode; + } + + public List getStdout() { + return stdout; + } + + public List getStderr() { + return stderr; + } + + public String getStdoutString() { + return stdout.stream().collect(Collectors.joining(System.getProperty("line.separator"))); + } + + /** + * Helper function to return a specified line from the saved stdout + * + * @return the line indexed with ndx from the saved stdout. The indexes are + * zero-based so that getStdoutLine(0) returns the first line. + */ + public String getStdoutLine(int ndx) { + return stdout.get(ndx); + } + + public ToolResults(int exitCode, List stdin, List stderr) { + this.exitCode = exitCode; + this.stdout = stdin; + this.stderr = stderr; + } + + public ToolResults(ToolResults rawResults) { + this(rawResults.exitCode, rawResults.stdout, rawResults.stderr); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Exit code: ").append(exitCode).append("\n"); + sb.append("stdout:"); + stdout.stream().forEach((s) -> { + sb.append(s).append("\n"); + }); + sb.append("stderr:"); + stderr.stream().forEach((s) -> { + sb.append(s).append("\n"); + }); + return sb.toString(); + } + + private final int exitCode; + private final List stdout; + private final List stderr; + +} diff --git a/hotspot/test/serviceability/tmtools/share/common/ToolRunner.java b/hotspot/test/serviceability/tmtools/share/common/ToolRunner.java new file mode 100644 index 00000000000..b9ca940ca13 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/share/common/ToolRunner.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 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. + */ +package common; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.StringTokenizer; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +/** + * This class starts a process specified by the passed command line waits till + * the process completes and returns the process exit code and stdout and stderr + * output as ToolResults + */ +class ToolRunner { + + private final List cmdArgs = new LinkedList<>(); + + ToolRunner(String cmdLine) { + StringTokenizer st = new StringTokenizer(cmdLine); + while (st.hasMoreTokens()) { + cmdArgs.add(st.nextToken()); + } + } + + /** + * Starts the process, waits for the process completion and returns the + * results + * + * @return process results + * @throws Exception if anything goes wrong + */ + ToolResults runToCompletion() throws Exception { + + ProcessBuilder pb = new ProcessBuilder(cmdArgs); + OutputAnalyzer oa = ProcessTools.executeProcess(pb); + + return new ToolResults(oa.getExitValue(), + stringToList(oa.getStdout()), + stringToList(oa.getStderr())); + + } + + private static List stringToList(String s) throws IOException { + BufferedReader reader = new BufferedReader(new StringReader(s)); + List strings = new ArrayList<>(); + for (String line = reader.readLine(); line != null; line = reader.readLine()) { + strings.add(line); + } + reader.close(); + return strings; + } +} From 7401022e64766194c2e068ec69b4a1eb9a4919b1 Mon Sep 17 00:00:00 2001 From: Erik Helin Date: Thu, 14 Jan 2016 14:32:16 +0100 Subject: [PATCH 072/212] 8146871: Make the clean target silent in hotspot/test/Makefile Reviewed-by: erikj, mikael --- hotspot/test/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/test/Makefile b/hotspot/test/Makefile index 41538dec380..2556fbadfa0 100644 --- a/hotspot/test/Makefile +++ b/hotspot/test/Makefile @@ -253,8 +253,8 @@ prep: clean # Cleanup clean: - $(RM) -r $(ABS_TEST_OUTPUT_DIR) - $(RM) $(ARCHIVE_BUNDLE) + @$(RM) -r $(ABS_TEST_OUTPUT_DIR) + @$(RM) $(ARCHIVE_BUNDLE) ################################################################ From f93feda30855b95ac25f8475bc5db4a475570302 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 14 Jan 2016 15:45:31 -0500 Subject: [PATCH 073/212] 8145940: TempNewSymbol should have correct copy and assignment functions Add clear() to the assignment operator and add copy constructor. Reviewed-by: mgronlun, lfoltan, kbarrett, jrose --- .../src/share/vm/classfile/symbolTable.cpp | 52 ++++++++++++++++++- .../src/share/vm/classfile/symbolTable.hpp | 50 +++++++++++++----- hotspot/src/share/vm/prims/jni.cpp | 4 +- 3 files changed, 90 insertions(+), 16 deletions(-) diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp index 964df1d18dd..93ed78520cb 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.cpp +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -667,3 +667,53 @@ int SymboltableDCmd::num_arguments() { return 0; } } + +#ifndef PRODUCT +// Internal test of TempNewSymbol +void Test_TempNewSymbol() { + // Assert messages assume these symbols are unique, and the refcounts start at + // one, but code does not rely on this. + Thread* THREAD = Thread::current(); + Symbol* abc = SymbolTable::new_symbol("abc", CATCH); + int abccount = abc->refcount(); + TempNewSymbol ss = abc; + assert(ss->refcount() == abccount, "only one abc"); + assert(ss->refcount() == abc->refcount(), "should match TempNewSymbol"); + + Symbol* efg = SymbolTable::new_symbol("efg", CATCH); + Symbol* hij = SymbolTable::new_symbol("hij", CATCH); + int efgcount = efg->refcount(); + int hijcount = hij->refcount(); + + TempNewSymbol s1 = efg; + TempNewSymbol s2 = hij; + assert(s1->refcount() == efgcount, "one efg"); + assert(s2->refcount() == hijcount, "one hij"); + + // Assignment operator + s1 = s2; + assert(hij->refcount() == hijcount + 1, "should be two hij"); + assert(efg->refcount() == efgcount - 1, "should be no efg"); + + s1 = ss; // s1 is abc + assert(s1->refcount() == abccount + 1, "should be two abc (s1 and ss)"); + assert(hij->refcount() == hijcount, "should only have one hij now (s2)"); + + s1 = s1; // self assignment + assert(s1->refcount() == abccount + 1, "should still be two abc (s1 and ss)"); + + TempNewSymbol s3; + Symbol* klm = SymbolTable::new_symbol("klm", CATCH); + int klmcount = klm->refcount(); + s3 = klm; // assignment + assert(s3->refcount() == klmcount, "only one klm now"); + + Symbol* xyz = SymbolTable::new_symbol("xyz", CATCH); + int xyzcount = xyz->refcount(); + { // inner scope + TempNewSymbol s_inner = xyz; + } + assert(xyz->refcount() == (xyzcount - 1), + "Should have been decremented by dtor in inner scope"); +} +#endif // PRODUCT diff --git a/hotspot/src/share/vm/classfile/symbolTable.hpp b/hotspot/src/share/vm/classfile/symbolTable.hpp index 8f310e70e1b..364a07a8c75 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.hpp +++ b/hotspot/src/share/vm/classfile/symbolTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,8 +42,17 @@ class BoolObjectClosure; class outputStream; -// Class to hold a newly created or referenced Symbol* temporarily in scope. -// new_symbol() and lookup() will create a Symbol* if not already in the +// TempNewSymbol acts as a handle class in a handle/body idiom and is +// responsible for proper resource management of the body (which is a Symbol*). +// The body is resource managed by a reference counting scheme. +// TempNewSymbol can therefore be used to properly hold a newly created or referenced +// Symbol* temporarily in scope. +// +// Routines in SymbolTable will initialize the reference count of a Symbol* before +// it becomes "managed" by TempNewSymbol instances. As a handle class, TempNewSymbol +// needs to maintain proper reference counting in context of copy semantics. +// +// In SymbolTable, new_symbol() and lookup() will create a Symbol* if not already in the // symbol table and add to the symbol's reference count. // probe() and lookup_only() will increment the refcount if symbol is found. class TempNewSymbol : public StackObj { @@ -51,25 +60,38 @@ class TempNewSymbol : public StackObj { public: TempNewSymbol() : _temp(NULL) {} - // Creating or looking up a symbol increments the symbol's reference count + + // Conversion from a Symbol* to a TempNewSymbol. + // Does not increment the current reference count. TempNewSymbol(Symbol *s) : _temp(s) {} - // Operator= increments reference count. - void operator=(const TempNewSymbol &s) { - //clear(); //FIXME - _temp = s._temp; - if (_temp !=NULL) _temp->increment_refcount(); + // Copy constructor increments reference count. + TempNewSymbol(const TempNewSymbol& rhs) : _temp(rhs._temp) { + if (_temp != NULL) { + _temp->increment_refcount(); + } } - // Decrement reference counter so it can go away if it's unique - void clear() { if (_temp != NULL) _temp->decrement_refcount(); _temp = NULL; } + // Assignment operator uses a c++ trick called copy and swap idiom. + // rhs is passed by value so within the scope of this method it is a copy. + // At method exit it contains the former value of _temp, triggering the correct refcount + // decrement upon destruction. + void operator=(TempNewSymbol rhs) { + Symbol* tmp = rhs._temp; + rhs._temp = _temp; + _temp = tmp; + } - ~TempNewSymbol() { clear(); } + // Decrement reference counter so it can go away if it's unused + ~TempNewSymbol() { + if (_temp != NULL) { + _temp->decrement_refcount(); + } + } - // Operators so they can be used like Symbols + // Symbol* conversion operators Symbol* operator -> () const { return _temp; } bool operator == (Symbol* o) const { return _temp == o; } - // Sneaky conversion function operator Symbol*() { return _temp; } }; diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 981a19c96aa..f0371c3741c 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -3889,6 +3889,7 @@ void Test_linked_list(); void TestResourcehash_test(); void TestChunkedList_test(); void Test_log_length(); +void Test_TempNewSymbol(); #if INCLUDE_ALL_GCS void TestOldFreeSpaceCalculation_test(); void TestG1BiasedArray_test(); @@ -3932,6 +3933,7 @@ void execute_internal_vm_tests() { run_unit_test(JSONTest::test()); run_unit_test(Test_log_length()); run_unit_test(DirectivesParser::test()); + run_unit_test(Test_TempNewSymbol()); #if INCLUDE_VM_STRUCTS run_unit_test(VMStructs::test()); #endif From f14cf0149e2cfada20043f696e639a0b08c338f8 Mon Sep 17 00:00:00 2001 From: Sebastian Sickelmann Date: Thu, 14 Jan 2016 22:52:54 -0500 Subject: [PATCH 074/212] 8143558: evaluate if thr_sigsetmask can be removed from hotspot (solaris) codebase Reviewed-by: dholmes --- hotspot/src/os/solaris/vm/os_solaris.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 2a88667f34b..12784f90785 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -819,19 +819,19 @@ static OSThread* create_os_thread(Thread* thread, thread_t thread_id) { void os::Solaris::hotspot_sigmask(Thread* thread) { //Save caller's signal mask sigset_t sigmask; - thr_sigsetmask(SIG_SETMASK, NULL, &sigmask); + pthread_sigmask(SIG_SETMASK, NULL, &sigmask); OSThread *osthread = thread->osthread(); osthread->set_caller_sigmask(sigmask); - thr_sigsetmask(SIG_UNBLOCK, os::Solaris::unblocked_signals(), NULL); + pthread_sigmask(SIG_UNBLOCK, os::Solaris::unblocked_signals(), NULL); if (!ReduceSignalUsage) { if (thread->is_VM_thread()) { // Only the VM thread handles BREAK_SIGNAL ... - thr_sigsetmask(SIG_UNBLOCK, vm_signals(), NULL); + pthread_sigmask(SIG_UNBLOCK, vm_signals(), NULL); } else { // ... all other threads block BREAK_SIGNAL assert(!sigismember(vm_signals(), SIGINT), "SIGINT should not be blocked"); - thr_sigsetmask(SIG_BLOCK, vm_signals(), NULL); + pthread_sigmask(SIG_BLOCK, vm_signals(), NULL); } } } @@ -1188,7 +1188,7 @@ void os::free_thread(OSThread* osthread) { if (Thread::current()->osthread() == osthread) { // Restore caller's signal mask sigset_t sigmask = osthread->caller_sigmask(); - thr_sigsetmask(SIG_SETMASK, &sigmask, NULL); + pthread_sigmask(SIG_SETMASK, &sigmask, NULL); } delete osthread; } @@ -3561,7 +3561,7 @@ void os::Solaris::SR_handler(Thread* thread, ucontext_t* uc) { sigset_t suspend_set; // signals for sigsuspend() // get current set of blocked signals and unblock resume signal - thr_sigsetmask(SIG_BLOCK, NULL, &suspend_set); + pthread_sigmask(SIG_BLOCK, NULL, &suspend_set); sigdelset(&suspend_set, os::Solaris::SIGasync()); sr_semaphore.signal(); @@ -3838,7 +3838,7 @@ static bool call_chained_handler(struct sigaction *actp, int sig, // try to honor the signal mask sigset_t oset; - thr_sigsetmask(SIG_SETMASK, &(actp->sa_mask), &oset); + pthread_sigmask(SIG_SETMASK, &(actp->sa_mask), &oset); // call into the chained handler if (siginfo_flag_set) { @@ -3848,7 +3848,7 @@ static bool call_chained_handler(struct sigaction *actp, int sig, } // restore the signal mask - thr_sigsetmask(SIG_SETMASK, &oset, 0); + pthread_sigmask(SIG_SETMASK, &oset, 0); } // Tell jvm's signal handler the signal is taken care of. return true; @@ -5492,7 +5492,7 @@ void Parker::park(bool isAbsolute, jlong time) { // (This allows a debugger to break into the running thread.) sigset_t oldsigs; sigset_t* allowdebug_blocked = os::Solaris::allowdebug_blocked_signals(); - thr_sigsetmask(SIG_BLOCK, allowdebug_blocked, &oldsigs); + pthread_sigmask(SIG_BLOCK, allowdebug_blocked, &oldsigs); #endif OSThreadWaitState osts(thread->osthread(), false /* not Object.wait() */); @@ -5519,7 +5519,7 @@ void Parker::park(bool isAbsolute, jlong time) { status, "cond_timedwait"); #ifdef ASSERT - thr_sigsetmask(SIG_SETMASK, &oldsigs, NULL); + pthread_sigmask(SIG_SETMASK, &oldsigs, NULL); #endif _counter = 0; status = os::Solaris::mutex_unlock(_mutex); From 0173335479227efb1950e39fa0168b74341af18e Mon Sep 17 00:00:00 2001 From: Marcus Larsson Date: Thu, 14 Jan 2016 16:03:03 +0100 Subject: [PATCH 075/212] 8147079: Add serviceability/logging folder to hotspot_serviceability test group Reviewed-by: jbachorik, sspitsyn --- hotspot/test/TEST.groups | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index 3c5dffff035..541a429be00 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -340,7 +340,8 @@ hotspot_runtime = \ hotspot_serviceability = \ sanity/ExecuteInternalVMTests.java \ - serviceability/dcmd/compiler + serviceability/dcmd/compiler \ + serviceability/logging hotspot_jprt = \ :hotspot_compiler_1 \ From dcf563b6a6850eecacd8c40b82886ebe56d879e0 Mon Sep 17 00:00:00 2001 From: Dmitry Fazunenko Date: Fri, 15 Jan 2016 16:03:46 +0400 Subject: [PATCH 076/212] 8147075: Rename old GC JTreg tests to the new naming scheme Test/gc/7072527, test/gc/6845368, test/gc/6581734 renamed Reviewed-by: jwilhelm, pliden --- hotspot/test/TEST.groups | 8 ++-- .../{6845368/bigobj.java => TestBigObj.java} | 45 ++++++++++++++----- .../gc/{7072527 => }/TestFullGCCount.java | 16 ++++--- .../TestMBeanCMS.java} | 26 ++++++----- 4 files changed, 64 insertions(+), 31 deletions(-) rename hotspot/test/gc/{6845368/bigobj.java => TestBigObj.java} (99%) rename hotspot/test/gc/{7072527 => }/TestFullGCCount.java (89%) rename hotspot/test/gc/{6581734/Test6581734.java => cms/TestMBeanCMS.java} (90%) diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index 541a429be00..d93eefb068a 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -131,13 +131,12 @@ compact3 = \ # Tests that require compact3 API's # needs_compact3 = \ - gc/6581734/Test6581734.java \ - gc/7072527/TestFullGCCount.java \ - gc/g1/TestHumongousAllocInitialMark.java \ + gc/TestFullGCCount.java \ gc/arguments/TestG1HeapRegionSize.java \ - gc/metaspace/TestMetaspaceMemoryPool.java \ gc/arguments/TestDynMinHeapFreeRatio.java \ gc/arguments/TestDynMaxHeapFreeRatio.java \ + gc/cms/TestMBeanCMS.java \ + gc/g1/TestHumongousAllocInitialMark.java \ gc/g1/TestShrinkAuxiliaryData00.java \ gc/g1/TestShrinkAuxiliaryData05.java \ gc/g1/TestShrinkAuxiliaryData10.java \ @@ -145,6 +144,7 @@ needs_compact3 = \ gc/g1/TestShrinkAuxiliaryData20.java \ gc/g1/TestShrinkAuxiliaryData25.java \ gc/g1/TestShrinkAuxiliaryData30.java \ + gc/metaspace/TestMetaspaceMemoryPool.java \ gc/survivorAlignment \ runtime/InternalApi/ThreadCpuTimesDeadlock.java \ runtime/NMT/JcmdSummaryDiff.java \ diff --git a/hotspot/test/gc/6845368/bigobj.java b/hotspot/test/gc/TestBigObj.java similarity index 99% rename from hotspot/test/gc/6845368/bigobj.java rename to hotspot/test/gc/TestBigObj.java index 5185326bb4a..299e46b3068 100644 --- a/hotspot/test/gc/6845368/bigobj.java +++ b/hotspot/test/gc/TestBigObj.java @@ -1,10 +1,32 @@ /* - @test - @bug 6845368 - @summary ensure gc updates references > 64K bytes from the start of the obj - @author John Coomes - @run main/othervm/timeout=720 -Xmx64m bigobj -*/ + * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test TestBigObj + * @bug 6845368 + * @summary ensure gc updates references > 64K bytes from the start of the obj + * @run main/othervm/timeout=720 -Xmx64m -verbose:gc TestBigObj + */ // Allocate an object with a block of reference fields that starts more // than 64K bytes from the start of the object. This is done with @@ -21,13 +43,16 @@ // block to a known object, provoke GC, then make sure the field was // updated properly. -public class bigobj extends bigparent { +public class TestBigObj extends BigParent { + public static Object trash; public static void main(String argv[]) { - bigobj c = new bigobj(); + TestBigObj c = new TestBigObj(); Object o = c.o = new Object(); // Provoke GC so o is moved (if this is a moving collector). - for (int i = 0; i < 64 * 1024 * 1024; i++) new Object(); + for (int i = 0; i < 64 * 1024 * 1024; i++) { + trash = new Object(); + } if (o != c.o) { System.out.println("failed: o=" + o + " != c.o=" + c.o); @@ -38,7 +63,7 @@ public class bigobj extends bigparent { Object o; } -class bigparent { +class BigParent { public long l00001; public long l00002; public long l00003; diff --git a/hotspot/test/gc/7072527/TestFullGCCount.java b/hotspot/test/gc/TestFullGCCount.java similarity index 89% rename from hotspot/test/gc/7072527/TestFullGCCount.java rename to hotspot/test/gc/TestFullGCCount.java index 6732a01c355..9e5dddf4d7d 100644 --- a/hotspot/test/gc/7072527/TestFullGCCount.java +++ b/hotspot/test/gc/TestFullGCCount.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,14 +22,18 @@ */ /* - * @test TestFullGCount.java + * @test TestFullGCCount.java * @bug 7072527 * @summary CMS: JMM GC counters overcount in some cases * @modules java.management * @run main/othervm -Xlog:gc TestFullGCCount */ -import java.util.*; -import java.lang.management.*; + +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; /* * Originally for a specific failure in CMS, this test now monitors all @@ -43,12 +47,12 @@ public class TestFullGCCount { int iterations = 20; boolean failed = false; String errorMessage = ""; - HashMap counts = new HashMap(); + HashMap counts = new HashMap<>(); // Prime the collection of count lists for all collectors. for (int i = 0; i < collectors.size(); i++) { GarbageCollectorMXBean collector = collectors.get(i); - counts.put(collector.getName(), new ArrayList(iterations)); + counts.put(collector.getName(), new ArrayList<>(iterations)); } // Perform some gc, record collector counts. diff --git a/hotspot/test/gc/6581734/Test6581734.java b/hotspot/test/gc/cms/TestMBeanCMS.java similarity index 90% rename from hotspot/test/gc/6581734/Test6581734.java rename to hotspot/test/gc/cms/TestMBeanCMS.java index 5201a751dfa..045ac3ce314 100644 --- a/hotspot/test/gc/6581734/Test6581734.java +++ b/hotspot/test/gc/cms/TestMBeanCMS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,16 +22,20 @@ */ /* - * @test Test6581734.java + * @test TestMBeanCMS.java * @bug 6581734 * @requires vm.gc=="ConcMarkSweep" | vm.gc=="null" * @summary CMS Old Gen's collection usage is zero after GC which is incorrect * @modules java.management - * @run main/othervm -Xmx512m -verbose:gc -XX:+UseConcMarkSweepGC Test6581734 + * @run main/othervm -Xmx512m -verbose:gc -XX:+UseConcMarkSweepGC TestMBeanCMS * */ -import java.util.*; -import java.lang.management.*; + +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryPoolMXBean; +import java.util.LinkedList; +import java.util.List; // 6581734 states that memory pool usage via the mbean is wrong // for CMS (zero, even after a collection). @@ -41,29 +45,29 @@ import java.lang.management.*; // -- closed as dup of 6581734 as the same fix resolves both. -public class Test6581734 { +public class TestMBeanCMS { private String poolName = "CMS"; private String collectorName = "ConcurrentMarkSweep"; public static void main(String [] args) { - Test6581734 t = null; + TestMBeanCMS t = null; if (args.length==2) { - t = new Test6581734(args[0], args[1]); + t = new TestMBeanCMS(args[0], args[1]); } else { System.out.println("Defaulting to monitor CMS pool and collector."); - t = new Test6581734(); + t = new TestMBeanCMS(); } t.run(); } - public Test6581734(String pool, String collector) { + public TestMBeanCMS(String pool, String collector) { poolName = pool; collectorName = collector; } - public Test6581734() { + public TestMBeanCMS() { } public void run() { From 33104c61ae0b5a494103862da79ccd50fdb67ee1 Mon Sep 17 00:00:00 2001 From: Poonam Bajaj Date: Fri, 15 Jan 2016 06:27:35 -0800 Subject: [PATCH 077/212] 8072725: Provide more granular levels for GC verification Add option VerifySubSet to selectively verify the memory sub-systems Reviewed-by: kevinw, jmasa, tschatzl, dfazunen --- hotspot/src/share/vm/memory/universe.cpp | 115 ++++++++++++++++++----- hotspot/src/share/vm/memory/universe.hpp | 19 +++- hotspot/src/share/vm/runtime/globals.hpp | 10 +- hotspot/test/gc/TestVerifySubSet.java | 94 ++++++++++++++++++ 4 files changed, 215 insertions(+), 23 deletions(-) create mode 100644 hotspot/test/gc/TestVerifySubSet.java diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index d9c17bc71d1..ac36a988d97 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -129,6 +129,7 @@ oop Universe::_delayed_stack_overflow_error_message = NULL; objArrayOop Universe::_preallocated_out_of_memory_error_array = NULL; volatile jint Universe::_preallocated_out_of_memory_error_avail_count = 0; bool Universe::_verify_in_progress = false; +long Universe::verify_flags = Universe::Verify_All; oop Universe::_null_ptr_exception_instance = NULL; oop Universe::_arithmetic_exception_instance = NULL; oop Universe::_virtual_machine_error_instance = NULL; @@ -669,6 +670,9 @@ jint universe_init() { MetaspaceShared::prepare_for_dumping(); } } + if (strlen(VerifySubSet) > 0) { + Universe::initialize_verify_flags(); + } return JNI_OK; } @@ -1103,6 +1107,53 @@ void Universe::print_heap_after_gc() { } } +void Universe::initialize_verify_flags() { + verify_flags = 0; + const char delimiter[] = " ,"; + + size_t length = strlen(VerifySubSet); + char* subset_list = NEW_C_HEAP_ARRAY(char, length + 1, mtInternal); + strncpy(subset_list, VerifySubSet, length + 1); + + char* token = strtok(subset_list, delimiter); + while (token != NULL) { + if (strcmp(token, "threads") == 0) { + verify_flags |= Verify_Threads; + } else if (strcmp(token, "heap") == 0) { + verify_flags |= Verify_Heap; + } else if (strcmp(token, "symbol_table") == 0) { + verify_flags |= Verify_SymbolTable; + } else if (strcmp(token, "string_table") == 0) { + verify_flags |= Verify_StringTable; + } else if (strcmp(token, "codecache") == 0) { + verify_flags |= Verify_CodeCache; + } else if (strcmp(token, "dictionary") == 0) { + verify_flags |= Verify_SystemDictionary; + } else if (strcmp(token, "classloader_data_graph") == 0) { + verify_flags |= Verify_ClassLoaderDataGraph; + } else if (strcmp(token, "metaspace") == 0) { + verify_flags |= Verify_MetaspaceAux; + } else if (strcmp(token, "jni_handles") == 0) { + verify_flags |= Verify_JNIHandles; + } else if (strcmp(token, "c-heap") == 0) { + verify_flags |= Verify_CHeap; + } else if (strcmp(token, "codecache_oops") == 0) { + verify_flags |= Verify_CodeCacheOops; + } else { + vm_exit_during_initialization(err_msg("VerifySubSet: \'%s\' memory sub-system is unknown, please correct it", token)); + } + token = strtok(NULL, delimiter); + } + FREE_C_HEAP_ARRAY(char, subset_list); +} + +bool Universe::should_verify_subset(uint subset) { + if (verify_flags & subset) { + return true; + } + return false; +} + void Universe::verify(VerifyOption option, const char* prefix) { // The use of _verify_in_progress is a temporary work around for // 6320749. Don't bother with a creating a class to set and clear @@ -1122,33 +1173,55 @@ void Universe::verify(VerifyOption option, const char* prefix) { FormatBuffer<> title("Verifying %s", prefix); GCTraceTime(Info, gc, verify) tm(title.buffer()); - log_debug(gc, verify)("Threads"); - Threads::verify(); - log_debug(gc, verify)("Heap"); - heap()->verify(option); - log_debug(gc, verify)("SymbolTable"); - SymbolTable::verify(); - log_debug(gc, verify)("StringTable"); - StringTable::verify(); + if (should_verify_subset(Verify_Threads)) { + log_debug(gc, verify)("Threads"); + Threads::verify(); + } + if (should_verify_subset(Verify_Heap)) { + log_debug(gc, verify)("Heap"); + heap()->verify(option); + } + if (should_verify_subset(Verify_SymbolTable)) { + log_debug(gc, verify)("SymbolTable"); + SymbolTable::verify(); + } + if (should_verify_subset(Verify_StringTable)) { + log_debug(gc, verify)("StringTable"); + StringTable::verify(); + } + if (should_verify_subset(Verify_CodeCache)) { { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); log_debug(gc, verify)("CodeCache"); CodeCache::verify(); } - log_debug(gc, verify)("SystemDictionary"); - SystemDictionary::verify(); + } + if (should_verify_subset(Verify_SystemDictionary)) { + log_debug(gc, verify)("SystemDictionary"); + SystemDictionary::verify(); + } #ifndef PRODUCT - log_debug(gc, verify)("ClassLoaderDataGraph"); - ClassLoaderDataGraph::verify(); + if (should_verify_subset(Verify_ClassLoaderDataGraph)) { + log_debug(gc, verify)("ClassLoaderDataGraph"); + ClassLoaderDataGraph::verify(); + } #endif - log_debug(gc, verify)("MetaspaceAux"); - MetaspaceAux::verify_free_chunks(); - log_debug(gc, verify)("JNIHandles"); - JNIHandles::verify(); - log_debug(gc, verify)("C-heap"); - os::check_heap(); - log_debug(gc, verify)("CodeCache Oops"); - CodeCache::verify_oops(); + if (should_verify_subset(Verify_MetaspaceAux)) { + log_debug(gc, verify)("MetaspaceAux"); + MetaspaceAux::verify_free_chunks(); + } + if (should_verify_subset(Verify_JNIHandles)) { + log_debug(gc, verify)("JNIHandles"); + JNIHandles::verify(); + } + if (should_verify_subset(Verify_CHeap)) { + log_debug(gc, verify)("C-heap"); + os::check_heap(); + } + if (should_verify_subset(Verify_CodeCacheOops)) { + log_debug(gc, verify)("CodeCache Oops"); + CodeCache::verify_oops(); + } _verify_in_progress = false; } diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index e7ba90dba12..fe10e849121 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -255,6 +255,7 @@ class Universe: AllStatic { // True during call to verify(). Should only be set/cleared in verify(). static bool _verify_in_progress; + static long verify_flags; static uintptr_t _verify_oop_mask; static uintptr_t _verify_oop_bits; @@ -463,6 +464,22 @@ class Universe: AllStatic { static void init_self_patching_vtbl_list(void** list, int count); // Debugging + enum VERIFY_FLAGS { + Verify_Threads = 1, + Verify_Heap = 2, + Verify_SymbolTable = 4, + Verify_StringTable = 8, + Verify_CodeCache = 16, + Verify_SystemDictionary = 32, + Verify_ClassLoaderDataGraph = 64, + Verify_MetaspaceAux = 128, + Verify_JNIHandles = 256, + Verify_CHeap = 512, + Verify_CodeCacheOops = 1024, + Verify_All = -1 + }; + static void initialize_verify_flags(); + static bool should_verify_subset(uint subset); static bool verify_in_progress() { return _verify_in_progress; } static void verify(VerifyOption option, const char* prefix); static void verify(const char* prefix) { diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index d34c04bf176..c3df46be9b2 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2334,6 +2334,14 @@ public: diagnostic(bool, VerifyDuringGC, false, \ "Verify memory system during GC (between phases)") \ \ + diagnostic(ccstrlist, VerifySubSet, "", \ + "Memory sub-systems to verify when Verify*GC flag(s) " \ + "are enabled. One or more sub-systems can be specified " \ + "in a comma separated string. Sub-systems are: " \ + "threads, heap, symbol_table, string_table, codecache, " \ + "dictionary, classloader_data_graph, metaspace, jni_handles, " \ + "c-heap, codecache_oops") \ + \ diagnostic(bool, GCParallelVerificationEnabled, true, \ "Enable parallel memory system verification") \ \ diff --git a/hotspot/test/gc/TestVerifySubSet.java b/hotspot/test/gc/TestVerifySubSet.java new file mode 100644 index 00000000000..ca201633bba --- /dev/null +++ b/hotspot/test/gc/TestVerifySubSet.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test TestVerifySubSet.java + * @key gc + * @bug 8072725 + * @summary Test VerifySubSet option + * @library /testlibrary + * @modules java.base/sun.misc + * java.management + */ + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; +import java.util.ArrayList; +import java.util.Collections; + +class RunSystemGC { + public static void main(String args[]) throws Exception { + System.gc(); + } +} + +public class TestVerifySubSet { + private static String[] getTestJavaOpts() { + String testVmOptsStr = System.getProperty("test.java.opts"); + if (!testVmOptsStr.isEmpty()) { + return testVmOptsStr.split(" "); + } else { + return new String[] {}; + } + } + + private static OutputAnalyzer runTest(String subset) throws Exception { + ArrayList vmOpts = new ArrayList(); + + Collections.addAll(vmOpts, getTestJavaOpts()); + Collections.addAll(vmOpts, new String[] {"-XX:+UnlockDiagnosticVMOptions", + "-XX:+VerifyBeforeGC", + "-XX:+VerifyAfterGC", + "-Xlog:gc+verify=debug", + "-XX:VerifySubSet="+subset, + RunSystemGC.class.getName()}); + ProcessBuilder pb = + ProcessTools.createJavaProcessBuilder(vmOpts.toArray(new String[vmOpts.size()])); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + System.out.println("Output:\n" + output.getOutput()); + return output; + } + + public static void main(String args[]) throws Exception { + + OutputAnalyzer output; + + output = runTest("heap, threads, codecache, metaspace"); + output.shouldContain("Heap"); + output.shouldContain("Threads"); + output.shouldContain("CodeCache"); + output.shouldContain("MetaspaceAux"); + output.shouldNotContain("SymbolTable"); + output.shouldNotContain("StringTable"); + output.shouldNotContain("SystemDictionary"); + output.shouldNotContain("CodeCache Oops"); + output.shouldHaveExitValue(0); + + output = runTest("hello, threads, codecache, metaspace"); + output.shouldContain("memory sub-system is unknown, please correct it"); + output.shouldNotContain("Threads"); + output.shouldNotContain("CodeCache"); + output.shouldNotContain("MetaspaceAux"); + output.shouldHaveExitValue(1); + } +} From 1980bc42dd1a8a671cb0defc8f5b1e4f6d4069c8 Mon Sep 17 00:00:00 2001 From: Poonam Bajaj Date: Fri, 15 Jan 2016 10:34:52 -0800 Subject: [PATCH 078/212] 8145442: Add the facility to verify remembered sets for G1 Implement remembered sets verification for G1 with option VerifyRememberedSets Reviewed-by: jmasa, mgerdin --- .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 22 +++ hotspot/src/share/vm/gc/g1/heapRegion.cpp | 182 +++++++++++++----- hotspot/src/share/vm/gc/g1/heapRegion.hpp | 3 + 3 files changed, 160 insertions(+), 47 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index 3cca38b143f..51888ca0b2f 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -3535,6 +3535,16 @@ void G1CollectedHeap::register_humongous_regions_with_cset() { cl.flush_rem_set_entries(); } +class VerifyRegionRemSetClosure : public HeapRegionClosure { + public: + bool doHeapRegion(HeapRegion* hr) { + if (!hr->is_archive() && !hr->is_continues_humongous()) { + hr->verify_rem_set(); + } + return false; + } +}; + #ifdef ASSERT class VerifyCSetClosure: public HeapRegionClosure { public: @@ -3724,6 +3734,12 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { increment_total_collections(false /* full gc */); increment_gc_time_stamp(); + if (VerifyRememberedSets) { + log_info(gc, verify)("[Verifying RemSets before GC]"); + VerifyRegionRemSetClosure v_cl; + heap_region_iterate(&v_cl); + } + verify_before_gc(); check_bitmaps("GC Start"); @@ -3928,6 +3944,12 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { // scanning cards (see CR 7039627). increment_gc_time_stamp(); + if (VerifyRememberedSets) { + log_info(gc, verify)("[Verifying RemSets after GC]"); + VerifyRegionRemSetClosure v_cl; + heap_region_iterate(&v_cl); + } + verify_after_gc(); check_bitmaps("GC End"); diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.cpp b/hotspot/src/share/vm/gc/g1/heapRegion.cpp index 1a63fa377ed..8ade4641c36 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp @@ -599,8 +599,8 @@ void HeapRegion::print_on(outputStream* st) const { p2i(prev_top_at_mark_start()), p2i(next_top_at_mark_start())); } -class VerifyLiveClosure: public OopClosure { -private: +class G1VerificationClosure : public OopClosure { +protected: G1CollectedHeap* _g1h; CardTableModRefBS* _bs; oop _containing_obj; @@ -611,10 +611,10 @@ public: // _vo == UsePrevMarking -> use "prev" marking information, // _vo == UseNextMarking -> use "next" marking information, // _vo == UseMarkWord -> use mark word from object header. - VerifyLiveClosure(G1CollectedHeap* g1h, VerifyOption vo) : + G1VerificationClosure(G1CollectedHeap* g1h, VerifyOption vo) : _g1h(g1h), _bs(barrier_set_cast(g1h->barrier_set())), - _containing_obj(NULL), _failures(false), _n_failures(0), _vo(vo) - { } + _containing_obj(NULL), _failures(false), _n_failures(0), _vo(vo) { + } void set_containing_obj(oop obj) { _containing_obj = obj; @@ -623,9 +623,6 @@ public: bool failures() { return _failures; } int n_failures() { return _n_failures; } - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop( oop* p) { do_oop_work(p); } - void print_object(outputStream* out, oop obj) { #ifdef PRODUCT Klass* k = obj->klass(); @@ -635,12 +632,24 @@ public: obj->print_on(out); #endif // PRODUCT } +}; + +class VerifyLiveClosure : public G1VerificationClosure { +public: + VerifyLiveClosure(G1CollectedHeap* g1h, VerifyOption vo) : G1VerificationClosure(g1h, vo) {} + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } template void do_oop_work(T* p) { assert(_containing_obj != NULL, "Precondition"); assert(!_g1h->is_obj_dead_cond(_containing_obj, _vo), - "Precondition"); + "Precondition"); + verify_liveness(p); + } + + template + void verify_liveness(T* p) { T heap_oop = oopDesc::load_heap_oop(p); LogHandle(gc, verify) log; if (!oopDesc::is_null(heap_oop)) { @@ -648,7 +657,7 @@ public: bool failed = false; if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _vo)) { MutexLockerEx x(ParGCRareEvent_lock, - Mutex::_no_safepoint_check_flag); + Mutex::_no_safepoint_check_flag); if (!_failures) { log.info("----------"); @@ -657,17 +666,17 @@ public: if (!_g1h->is_in_closed_subset(obj)) { HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); log.info("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); + p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); print_object(log.info_stream(), _containing_obj); log.info("points to obj " PTR_FORMAT " not in the heap", p2i(obj)); } else { HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); - HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj); + HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj); log.info("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); + p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); print_object(log.info_stream(), _containing_obj); log.info("points to dead obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(obj), p2i(to->bottom()), p2i(to->end())); + p2i(obj), p2i(to->bottom()), p2i(to->end())); print_object(log.info_stream(), obj); } log.info("----------"); @@ -675,42 +684,64 @@ public: failed = true; _n_failures++; } + } + } +}; - if (!_g1h->collector_state()->full_collection() || G1VerifyRSetsDuringFullGC) { - HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); - HeapRegion* to = _g1h->heap_region_containing(obj); - if (from != NULL && to != NULL && - from != to && - !to->is_pinned()) { - jbyte cv_obj = *_bs->byte_for_const(_containing_obj); - jbyte cv_field = *_bs->byte_for_const(p); - const jbyte dirty = CardTableModRefBS::dirty_card_val(); +class VerifyRemSetClosure : public G1VerificationClosure { +public: + VerifyRemSetClosure(G1CollectedHeap* g1h, VerifyOption vo) : G1VerificationClosure(g1h, vo) {} + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } - bool is_bad = !(from->is_young() - || to->rem_set()->contains_reference(p) - || !G1HRRSFlushLogBuffersOnVerify && // buffers were not flushed - (_containing_obj->is_objArray() ? - cv_field == dirty - : cv_obj == dirty || cv_field == dirty)); - if (is_bad) { - MutexLockerEx x(ParGCRareEvent_lock, - Mutex::_no_safepoint_check_flag); + template + void do_oop_work(T* p) { + assert(_containing_obj != NULL, "Precondition"); + assert(!_g1h->is_obj_dead_cond(_containing_obj, _vo), + "Precondition"); + verify_remembered_set(p); + } - if (!_failures) { - log.info("----------"); - } - log.info("Missing rem set entry:"); - log.info("Field " PTR_FORMAT " of obj " PTR_FORMAT ", in region " HR_FORMAT, - p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from)); - ResourceMark rm; - _containing_obj->print_on(log.info_stream()); - log.info("points to obj " PTR_FORMAT " in region " HR_FORMAT, p2i(obj), HR_FORMAT_PARAMS(to)); - obj->print_on(log.info_stream()); - log.info("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field); + template + void verify_remembered_set(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + LogHandle(gc, verify) log; + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + bool failed = false; + HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); + HeapRegion* to = _g1h->heap_region_containing(obj); + if (from != NULL && to != NULL && + from != to && + !to->is_pinned()) { + jbyte cv_obj = *_bs->byte_for_const(_containing_obj); + jbyte cv_field = *_bs->byte_for_const(p); + const jbyte dirty = CardTableModRefBS::dirty_card_val(); + + bool is_bad = !(from->is_young() + || to->rem_set()->contains_reference(p) + || !G1HRRSFlushLogBuffersOnVerify && // buffers were not flushed + (_containing_obj->is_objArray() ? + cv_field == dirty + : cv_obj == dirty || cv_field == dirty)); + if (is_bad) { + MutexLockerEx x(ParGCRareEvent_lock, + Mutex::_no_safepoint_check_flag); + + if (!_failures) { log.info("----------"); - _failures = true; - if (!failed) _n_failures++; } + log.info("Missing rem set entry:"); + log.info("Field " PTR_FORMAT " of obj " PTR_FORMAT ", in region " HR_FORMAT, + p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from)); + ResourceMark rm; + _containing_obj->print_on(log.info_stream()); + log.info("points to obj " PTR_FORMAT " in region " HR_FORMAT, p2i(obj), HR_FORMAT_PARAMS(to)); + obj->print_on(log.info_stream()); + log.info("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field); + log.info("----------"); + _failures = true; + if (!failed) _n_failures++; } } } @@ -727,6 +758,7 @@ void HeapRegion::verify(VerifyOption vo, HeapWord* p = bottom(); HeapWord* prev_p = NULL; VerifyLiveClosure vl_cl(g1, vo); + VerifyRemSetClosure vr_cl(g1, vo); bool is_region_humongous = is_humongous(); size_t object_num = 0; while (p < top()) { @@ -752,7 +784,23 @@ void HeapRegion::verify(VerifyOption vo, return; } else { vl_cl.set_containing_obj(obj); - obj->oop_iterate_no_header(&vl_cl); + if (!g1->collector_state()->full_collection() || G1VerifyRSetsDuringFullGC) { + // verify liveness and rem_set + vr_cl.set_containing_obj(obj); + G1Mux2Closure mux(&vl_cl, &vr_cl); + obj->oop_iterate_no_header(&mux); + + if (vr_cl.failures()) { + *failures = true; + } + if (G1MaxVerifyFailures >= 0 && + vr_cl.n_failures() >= G1MaxVerifyFailures) { + return; + } + } else { + // verify only liveness + obj->oop_iterate_no_header(&vl_cl); + } if (vl_cl.failures()) { *failures = true; } @@ -762,7 +810,7 @@ void HeapRegion::verify(VerifyOption vo, } } } else { - log_info(gc, verify)(PTR_FORMAT " no an oop", p2i(obj)); + log_info(gc, verify)(PTR_FORMAT " not an oop", p2i(obj)); *failures = true; return; } @@ -852,6 +900,46 @@ void HeapRegion::verify() const { verify(VerifyOption_G1UsePrevMarking, /* failures */ &dummy); } +void HeapRegion::verify_rem_set(VerifyOption vo, bool* failures) const { + G1CollectedHeap* g1 = G1CollectedHeap::heap(); + *failures = false; + HeapWord* p = bottom(); + HeapWord* prev_p = NULL; + VerifyRemSetClosure vr_cl(g1, vo); + while (p < top()) { + oop obj = oop(p); + size_t obj_size = block_size(p); + + if (!g1->is_obj_dead_cond(obj, this, vo)) { + if (obj->is_oop()) { + vr_cl.set_containing_obj(obj); + obj->oop_iterate_no_header(&vr_cl); + + if (vr_cl.failures()) { + *failures = true; + } + if (G1MaxVerifyFailures >= 0 && + vr_cl.n_failures() >= G1MaxVerifyFailures) { + return; + } + } else { + log_info(gc, verify)(PTR_FORMAT " not an oop", p2i(obj)); + *failures = true; + return; + } + } + + prev_p = p; + p += obj_size; + } +} + +void HeapRegion::verify_rem_set() const { + bool failures = false; + verify_rem_set(VerifyOption_G1UsePrevMarking, &failures); + guarantee(!failures, "HeapRegion RemSet verification failed"); +} + void HeapRegion::prepare_for_compaction(CompactPoint* cp) { scan_and_forward(this, cp); } diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.hpp b/hotspot/src/share/vm/gc/g1/heapRegion.hpp index 171db485327..5c88a476c91 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.hpp @@ -745,6 +745,9 @@ class HeapRegion: public G1ContiguousSpace { // Override; it uses the "prev" marking information virtual void verify() const; + + void verify_rem_set(VerifyOption vo, bool *failures) const; + void verify_rem_set() const; }; // HeapRegionClosure is used for iterating over regions. From 86897064bf18aeac7018de956335e92fb01caf8d Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 13 Jan 2016 17:55:57 +0100 Subject: [PATCH 079/212] 8145184: [aix] Implement os::platform_print_native_stack on AIX Reviewed-by: goetz --- hotspot/src/os/aix/vm/decoder_aix.hpp | 6 +- hotspot/src/os/aix/vm/misc_aix.hpp | 1 - hotspot/src/os/aix/vm/os_aix.cpp | 89 +--- hotspot/src/os/aix/vm/porting_aix.cpp | 501 +++++++++++++++++-- hotspot/src/os/aix/vm/porting_aix.hpp | 45 +- hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp | 7 + hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp | 4 + 7 files changed, 509 insertions(+), 144 deletions(-) diff --git a/hotspot/src/os/aix/vm/decoder_aix.hpp b/hotspot/src/os/aix/vm/decoder_aix.hpp index c415e4b3296..6158179c81b 100644 --- a/hotspot/src/os/aix/vm/decoder_aix.hpp +++ b/hotspot/src/os/aix/vm/decoder_aix.hpp @@ -36,13 +36,15 @@ class AIXDecoder: public AbstractDecoder { virtual bool can_decode_C_frame_in_vm() const { return true; } - virtual bool demangle(const char* symbol, char* buf, int buflen) { return false; } // demangled by getFuncName + virtual bool demangle(const char* symbol, char* buf, int buflen) { return false; } // use AixSymbols::get_function_name to demangle virtual bool decode(address addr, char* buf, int buflen, int* offset, const char* modulepath, bool demangle) { - return (::getFuncName((codeptr_t)addr, buf, buflen, offset, 0, 0, 0, demangle) == 0); + return AixSymbols::get_function_name(addr, buf, buflen, offset, 0, demangle); } virtual bool decode(address addr, char *buf, int buflen, int* offset, const void *base) { ShouldNotReachHere(); return false; } + }; + diff --git a/hotspot/src/os/aix/vm/misc_aix.hpp b/hotspot/src/os/aix/vm/misc_aix.hpp index ba38bda137b..38d9383cfa2 100644 --- a/hotspot/src/os/aix/vm/misc_aix.hpp +++ b/hotspot/src/os/aix/vm/misc_aix.hpp @@ -41,7 +41,6 @@ fputc('\n', stderr); fflush(stderr); \ } \ } -#define ERRBYE(s) { trcVerbose(s); return -1; } #define assert0(b) assert((b), "") #define guarantee0(b) guarantee((b), "") diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index 43314d7dfac..9f6ad76875a 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -130,61 +130,10 @@ extern "C" int getargs (procsinfo*, int, char*, int); #define ERROR_MP_VMGETINFO_FAILED 102 #define ERROR_MP_VMGETINFO_CLAIMS_NO_SUPPORT_FOR_64K 103 -// The semantics in this file are thus that codeptr_t is a *real code ptr*. -// This means that any function taking codeptr_t as arguments will assume -// a real codeptr and won't handle function descriptors (eg getFuncName), -// whereas functions taking address as args will deal with function -// descriptors (eg os::dll_address_to_library_name). -typedef unsigned int* codeptr_t; - -// Typedefs for stackslots, stack pointers, pointers to op codes. -typedef unsigned long stackslot_t; -typedef stackslot_t* stackptr_t; - // Query dimensions of the stack of the calling thread. static bool query_stack_dimensions(address* p_stack_base, size_t* p_stack_size); static address resolve_function_descriptor_to_code_pointer(address p); -// Function to check a given stack pointer against given stack limits. -inline bool is_valid_stackpointer(stackptr_t sp, stackptr_t stack_base, size_t stack_size) { - if (((uintptr_t)sp) & 0x7) { - return false; - } - if (sp > stack_base) { - return false; - } - if (sp < (stackptr_t) ((address)stack_base - stack_size)) { - return false; - } - return true; -} - -// Returns true if function is a valid codepointer. -inline bool is_valid_codepointer(codeptr_t p) { - if (!p) { - return false; - } - if (((uintptr_t)p) & 0x3) { - return false; - } - if (LoadedLibraries::find_for_text_address(p, NULL) == NULL) { - return false; - } - return true; -} - -// Macro to check a given stack pointer against given stack limits and to die if test fails. -#define CHECK_STACK_PTR(sp, stack_base, stack_size) { \ - guarantee(is_valid_stackpointer((stackptr_t)(sp), (stackptr_t)(stack_base), stack_size), "Stack Pointer Invalid"); \ -} - -// Macro to check the current stack pointer against given stacklimits. -#define CHECK_CURRENT_STACK_PTR(stack_base, stack_size) { \ - address sp; \ - sp = os::current_stack_pointer(); \ - CHECK_STACK_PTR(sp, stack_base, stack_size); \ -} - static void vmembk_print_on(outputStream* os); //////////////////////////////////////////////////////////////////////////////// @@ -859,9 +808,6 @@ static void *java_start(Thread *thread) { trcVerbose("Thread " UINT64_FORMAT ": stack not in data segment.", (uint64_t) pthread_id); } - // Do some sanity checks. - CHECK_CURRENT_STACK_PTR(thread->stack_base(), thread->stack_size()); - // Try to randomize the cache line index of hot stack frames. // This helps when threads of the same stack traces evict each other's // cache lines. The threads can be either from the same JVM instance, or @@ -1028,9 +974,6 @@ bool os::create_attached_thread(JavaThread* thread) { // initialize floating point control register os::Aix::init_thread_fpu_state(); - // some sanity checks - CHECK_CURRENT_STACK_PTR(thread->stack_base(), thread->stack_size()); - // Initial thread state is RUNNABLE osthread->set_state(RUNNABLE); @@ -1382,32 +1325,7 @@ bool os::dll_address_to_function_name(address addr, char *buf, return false; } - // Go through Decoder::decode to call getFuncName which reads the name from the traceback table. - return Decoder::decode(addr, buf, buflen, offset, demangle); -} - -static int getModuleName(codeptr_t pc, // [in] program counter - char* p_name, size_t namelen, // [out] optional: function name - char* p_errmsg, size_t errmsglen // [out] optional: user provided buffer for error messages - ) { - - if (p_name && namelen > 0) { - *p_name = '\0'; - } - if (p_errmsg && errmsglen > 0) { - *p_errmsg = '\0'; - } - - if (p_name && namelen > 0) { - loaded_module_t lm; - if (LoadedLibraries::find_for_text_address(pc, &lm) != NULL) { - strncpy(p_name, lm.shortname, namelen); - p_name[namelen - 1] = '\0'; - } - return 0; - } - - return -1; + return AixSymbols::get_function_name(addr, buf, buflen, offset, NULL, demangle); } bool os::dll_address_to_library_name(address addr, char* buf, @@ -1425,10 +1343,7 @@ bool os::dll_address_to_library_name(address addr, char* buf, return false; } - if (::getModuleName((codeptr_t) addr, buf, buflen, 0, 0) == 0) { - return true; - } - return false; + return AixSymbols::get_module_name(addr, buf, buflen); } // Loads .dll/.so and in case of error it checks if .dll/.so was built diff --git a/hotspot/src/os/aix/vm/porting_aix.cpp b/hotspot/src/os/aix/vm/porting_aix.cpp index d5e8e881872..40078547dc1 100644 --- a/hotspot/src/os/aix/vm/porting_aix.cpp +++ b/hotspot/src/os/aix/vm/porting_aix.cpp @@ -23,30 +23,35 @@ */ #include "asm/assembler.hpp" +#include "compiler/disassembler.hpp" #include "loadlib_aix.hpp" #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" -// For CritSect #include "misc_aix.hpp" #include "porting_aix.hpp" #include "runtime/os.hpp" +#include "runtime/thread.hpp" #include "utilities/debug.hpp" #include #include +#include ////////////////////////////////// // Provide implementation for dladdr based on LoadedLibraries pool and -// traceback table scan (see getFuncName). +// traceback table scan // Search traceback table in stack, // return procedure name from trace back table. #define MAX_FUNC_SEARCH_LEN 0x10000 -// Any PC below this value is considered toast. -#define MINIMUM_VALUE_FOR_PC ((unsigned int*)0x1024) #define PTRDIFF_BYTES(p1,p2) (((ptrdiff_t)p1) - ((ptrdiff_t)p2)) +// Typedefs for stackslots, stack pointers, pointers to op codes. +typedef unsigned long stackslot_t; +typedef stackslot_t* stackptr_t; +typedef unsigned int* codeptr_t; + // Unfortunately, the interface of dladdr makes the implementator // responsible for maintaining memory for function name/library // name. I guess this is because most OS's keep those values as part @@ -91,15 +96,12 @@ class fixed_strings { static fixed_strings dladdr_fixed_strings; -// Given a code pointer, returns the function name and the displacement. -// Function looks for the traceback table at the end of the function. -extern "C" int getFuncName( - codeptr_t pc, // [in] program counter +bool AixSymbols::get_function_name ( + address pc0, // [in] program counter char* p_name, size_t namelen, // [out] optional: function name ("" if not available) int* p_displacement, // [out] optional: displacement (-1 if not available) const struct tbtable** p_tb, // [out] optional: ptr to traceback table to get further // information (NULL if not available) - char* p_errmsg, size_t errmsglen,// [out] optional: user provided buffer for error messages bool demangle // [in] whether to demangle the name ) { struct tbtable* tb = 0; @@ -109,9 +111,6 @@ extern "C" int getFuncName( if (p_name && namelen > 0) { *p_name = '\0'; } - if (p_errmsg && errmsglen > 0) { - *p_errmsg = '\0'; - } if (p_displacement) { *p_displacement = -1; } @@ -119,9 +118,12 @@ extern "C" int getFuncName( *p_tb = NULL; } + codeptr_t pc = (codeptr_t)pc0; + // weed out obvious bogus states - if (pc < MINIMUM_VALUE_FOR_PC) { - ERRBYE("invalid program counter"); + if (pc < (codeptr_t)0x1000) { + trcVerbose("invalid program counter"); + return false; } // We see random but frequent crashes in this function since some months mainly on shutdown @@ -130,7 +132,8 @@ extern "C" int getFuncName( // As the pc cannot be trusted to be anything sensible lets make all reads via SafeFetch. Also // bail if this is not a text address right now. if (!LoadedLibraries::find_for_text_address(pc, NULL)) { - ERRBYE("not a text address"); + trcVerbose("not a text address"); + return false; } // .. (Note that is_readable_pointer returns true if safefetch stubs are not there yet; @@ -138,10 +141,11 @@ extern "C" int getFuncName( // error files than not having a callstack.) #define CHECK_POINTER_READABLE(p) \ if (!MiscUtils::is_readable_pointer(p)) { \ - ERRBYE("pc not readable"); \ + trcVerbose("pc not readable"); \ + return false; \ } - codeptr_t pc2 = pc; + codeptr_t pc2 = (codeptr_t) pc; // Make sure the pointer is word aligned. pc2 = (codeptr_t) align_ptr_up((char*)pc2, 4); @@ -154,7 +158,8 @@ extern "C" int getFuncName( pc2++; } if (*pc2 != 0) { - ERRBYE("no traceback table found"); + trcVerbose("no traceback table found"); + return false; } // // Set up addressability to the traceback table @@ -166,7 +171,8 @@ extern "C" int getFuncName( if (tb->tb.lang >= 0xf && tb->tb.lang <= 0xfb) { // Language specifiers, go from 0 (C) to 14 (Objective C). // According to spec, 0xf-0xfa reserved, 0xfb-0xff reserved for ibm. - ERRBYE("no traceback table found"); + trcVerbose("no traceback table found"); + return false; } // Existence of fields in the tbtable extension are contingent upon @@ -188,7 +194,8 @@ extern "C" int getFuncName( // Weed out the cases where we did find the wrong traceback table. if (pc < start_of_procedure) { - ERRBYE("no traceback table found"); + trcVerbose("no traceback table found"); + return false; } // return the displacement @@ -218,23 +225,19 @@ extern "C" int getFuncName( if (p_name && namelen > 0) { if (tb->tb.name_present) { // Copy name from text because it may not be zero terminated. - // 256 is good enough for most cases; do not use large buffers here. - char buf[256]; - const short l = MIN2(*((short*)pc2), sizeof(buf) - 1); + const short l = MIN2(*((short*)pc2), namelen - 1); // Be very careful. int i = 0; char* const p = (char*)pc2 + sizeof(short); while (i < l && MiscUtils::is_readable_pointer(p + i)) { - buf[i] = p[i]; + p_name[i] = p[i]; i++; } - buf[i] = '\0'; - - p_name[0] = '\0'; + p_name[i] = '\0'; // If it is a C++ name, try and demangle it using the Demangle interface (see demangle.h). if (demangle) { char* rest; - Name* const name = Demangle(buf, rest); + Name* const name = Demangle(p_name, rest); if (name) { const char* const demangled_name = name->Text(); if (demangled_name) { @@ -244,24 +247,35 @@ extern "C" int getFuncName( delete name; } } - - // Fallback: if demangling did not work, just provide the unmangled name. - if (p_name[0] == '\0') { - strncpy(p_name, buf, namelen-1); - p_name[namelen-1] = '\0'; - } - } else { strncpy(p_name, "", namelen-1); p_name[namelen-1] = '\0'; } } + // Return traceback table, if user wants it. if (p_tb) { (*p_tb) = tb; } - return 0; + return true; + +} + +bool AixSymbols::get_module_name(address pc, + char* p_name, size_t namelen) { + + if (p_name && namelen > 0) { + p_name[0] = '\0'; + loaded_module_t lm; + if (LoadedLibraries::find_for_text_address(pc, &lm) != NULL) { + strncpy(p_name, lm.shortname, namelen); + p_name[namelen - 1] = '\0'; + return true; + } + } + + return false; } // Special implementation of dladdr for Aix based on LoadedLibraries @@ -341,8 +355,8 @@ int dladdr(void* addr, Dl_info* info) { char funcname[256] = ""; int displacement = 0; - if (getFuncName((codeptr_t) p, funcname, sizeof(funcname), &displacement, - NULL, NULL, 0, false) == 0) { + if (AixSymbols::get_function_name(p, funcname, sizeof(funcname), + &displacement, NULL, true)) { if (funcname[0] != '\0') { const char* const interned = dladdr_fixed_strings.intern(funcname); info->dli_sname = interned; @@ -385,3 +399,414 @@ int dladdr(void* addr, Dl_info* info) { return rc; // error: return 0 [sic] } + +///////////////////////////////////////////////////////////////////////////// +// Native callstack dumping + +// Print the traceback table for one stack frame. +static void print_tbtable (outputStream* st, const struct tbtable* p_tb) { + + if (p_tb == NULL) { + st->print(""); + return; + } + + switch(p_tb->tb.lang) { + case TB_C: st->print("C"); break; + case TB_FORTRAN: st->print("FORTRAN"); break; + case TB_PASCAL: st->print("PASCAL"); break; + case TB_ADA: st->print("ADA"); break; + case TB_PL1: st->print("PL1"); break; + case TB_BASIC: st->print("BASIC"); break; + case TB_LISP: st->print("LISP"); break; + case TB_COBOL: st->print("COBOL"); break; + case TB_MODULA2: st->print("MODULA2"); break; + case TB_CPLUSPLUS: st->print("C++"); break; + case TB_RPG: st->print("RPG"); break; + case TB_PL8: st->print("PL8"); break; + case TB_ASM: st->print("ASM"); break; + case TB_HPJ: st->print("HPJ"); break; + default: st->print("unknown"); + } + st->print(" "); + + if (p_tb->tb.globallink) { + st->print("globallink "); + } + if (p_tb->tb.is_eprol) { + st->print("eprol "); + } + if (p_tb->tb.int_proc) { + st->print("int_proc "); + } + if (p_tb->tb.tocless) { + st->print("tocless "); + } + if (p_tb->tb.fp_present) { + st->print("fp_present "); + } + if (p_tb->tb.int_hndl) { + st->print("interrupt_handler "); + } + if (p_tb->tb.uses_alloca) { + st->print("uses_alloca "); + } + if (p_tb->tb.saves_cr) { + st->print("saves_cr "); + } + if (p_tb->tb.saves_lr) { + st->print("saves_lr "); + } + if (p_tb->tb.stores_bc) { + st->print("stores_bc "); + } + if (p_tb->tb.fixup) { + st->print("fixup "); + } + if (p_tb->tb.fpr_saved > 0) { + st->print("fpr_saved:%d ", p_tb->tb.fpr_saved); + } + if (p_tb->tb.gpr_saved > 0) { + st->print("gpr_saved:%d ", p_tb->tb.gpr_saved); + } + if (p_tb->tb.fixedparms > 0) { + st->print("fixedparms:%d ", p_tb->tb.fixedparms); + } + if (p_tb->tb.floatparms > 0) { + st->print("floatparms:%d ", p_tb->tb.floatparms); + } + if (p_tb->tb.parmsonstk > 0) { + st->print("parmsonstk:%d", p_tb->tb.parmsonstk); + } +} + +// Print information for pc (module, function, displacement, traceback table) +// on one line. +static void print_info_for_pc (outputStream* st, codeptr_t pc, char* buf, + size_t buf_size, bool demangle) { + const struct tbtable* tb = NULL; + int displacement = -1; + + if (!MiscUtils::is_readable_pointer(pc)) { + st->print("(invalid)"); + return; + } + + if (AixSymbols::get_module_name((address)pc, buf, buf_size)) { + st->print("%s", buf); + } else { + st->print("(unknown module)"); + } + st->print("::"); + if (AixSymbols::get_function_name((address)pc, buf, buf_size, + &displacement, &tb, demangle)) { + st->print("%s", buf); + } else { + st->print("(unknown function)"); + } + if (displacement == -1) { + st->print("+?"); + } else { + st->print("+0x%x", displacement); + } + if (tb) { + st->fill_to(64); + st->print(" ("); + print_tbtable(st, tb); + st->print(")"); + } +} + +static void print_stackframe(outputStream* st, stackptr_t sp, char* buf, + size_t buf_size, bool demangle) { + + stackptr_t sp2 = sp; + + // skip backchain + + sp2++; + + // skip crsave + + sp2++; + + // retrieve lrsave. That is the only info I need to get the function/displacement + + codeptr_t lrsave = (codeptr_t) *(sp2); + st->print (PTR64_FORMAT " - " PTR64_FORMAT " ", sp2, lrsave); + + if (lrsave != NULL) { + print_info_for_pc(st, lrsave, buf, buf_size, demangle); + } + +} + +// Function to check a given stack pointer against given stack limits. +static bool is_valid_stackpointer(stackptr_t sp, stackptr_t stack_base, size_t stack_size) { + if (((uintptr_t)sp) & 0x7) { + return false; + } + if (sp > stack_base) { + return false; + } + if (sp < (stackptr_t) ((address)stack_base - stack_size)) { + return false; + } + return true; +} + +// Returns true if function is a valid codepointer. +static bool is_valid_codepointer(codeptr_t p) { + if (!p) { + return false; + } + if (((uintptr_t)p) & 0x3) { + return false; + } + if (LoadedLibraries::find_for_text_address(p, NULL) == NULL) { + return false; + } + return true; +} + +// Function tries to guess if the given combination of stack pointer, stack base +// and stack size is a valid stack frame. +static bool is_valid_frame (stackptr_t p, stackptr_t stack_base, size_t stack_size) { + + if (!is_valid_stackpointer(p, stack_base, stack_size)) { + return false; + } + + // First check - the occurrence of a valid backchain pointer up the stack, followed by a + // valid codeptr, counts as a good candidate. + stackptr_t sp2 = (stackptr_t) *p; + if (is_valid_stackpointer(sp2, stack_base, stack_size) && // found a valid stack pointer in the stack... + ((sp2 - p) > 6) && // ... pointing upwards and not into my frame... + is_valid_codepointer((codeptr_t)(*(sp2 + 2)))) // ... followed by a code pointer after two slots... + { + return true; + } + + return false; +} + +// Try to relocate a stack back chain in a given stack. +// Used in callstack dumping, when the backchain is broken by an overwriter +static stackptr_t try_find_backchain (stackptr_t last_known_good_frame, + stackptr_t stack_base, size_t stack_size) +{ + if (!is_valid_stackpointer(last_known_good_frame, stack_base, stack_size)) { + return NULL; + } + + stackptr_t sp = last_known_good_frame; + + sp += 6; // Omit next fixed frame slots. + while (sp < stack_base) { + if (is_valid_frame(sp, stack_base, stack_size)) { + return sp; + } + sp ++; + } + + return NULL; +} + +static void decode_instructions_at_pc(const char* header, + codeptr_t pc, int num_before, + int num_after, outputStream* st) { + // TODO: PPC port Disassembler::decode(pc, 16, 16, st); +} + + +void AixNativeCallstack::print_callstack_for_context(outputStream* st, const ucontext_t* context, + bool demangle, char* buf, size_t buf_size) { + +#define MAX_CALLSTACK_DEPTH 50 + + unsigned long* sp; + unsigned long* sp_last; + int frame; + + // To print the first frame, use the current value of iar: + // current entry indicated by iar (the current pc) + codeptr_t cur_iar = 0; + stackptr_t cur_sp = 0; + codeptr_t cur_rtoc = 0; + codeptr_t cur_lr = 0; + + const ucontext_t* uc = (const ucontext_t*) context; + + // fallback: use the current context + ucontext_t local_context; + if (!uc) { + if (getcontext(&local_context) == 0) { + uc = &local_context; + } else { + st->print_cr("No context given and getcontext failed. "); + return; + } + } + + cur_iar = (codeptr_t)uc->uc_mcontext.jmp_context.iar; + cur_sp = (stackptr_t)uc->uc_mcontext.jmp_context.gpr[1]; + cur_rtoc = (codeptr_t)uc->uc_mcontext.jmp_context.gpr[2]; + cur_lr = (codeptr_t)uc->uc_mcontext.jmp_context.lr; + + // syntax used here: + // n -------------- <-- stack_base, stack_to + // n-1 | | + // ... | older | + // ... | frames | | + // | | | stack grows downward + // ... | younger | | + // ... | frames | V + // | | + // |------------| <-- cur_sp, current stack ptr + // | | + // | unsused | + // | stack | + // | | + // . . + // . . + // . . + // . . + // | | + // 0 -------------- <-- stack_from + // + + // Retrieve current stack base, size from the current thread. If there is none, + // retrieve it from the OS. + stackptr_t stack_base = NULL; + size_t stack_size = NULL; + Thread* const thread = Thread::current_or_null_safe(); + if (thread) { + stack_base = (stackptr_t) thread->stack_base(); + stack_size = thread->stack_size(); + } else { + stack_base = (stackptr_t) os::current_stack_base(); + stack_size = os::current_stack_size(); + } + + st->print_cr("------ current frame:"); + st->print("iar: " PTR64_FORMAT " ", p2i(cur_iar)); + print_info_for_pc(st, cur_iar, buf, buf_size, demangle); + st->cr(); + + if (cur_iar && MiscUtils::is_readable_pointer(cur_iar)) { + decode_instructions_at_pc( + "Decoded instructions at iar:", + cur_iar, 32, 16, st); + } + + // Print out lr too, which may be interesting if we did jump to some bogus location; + // in those cases the new frame is not built up yet and the caller location is only + // preserved via lr register. + st->print("lr: " PTR64_FORMAT " ", p2i(cur_lr)); + print_info_for_pc(st, cur_lr, buf, buf_size, demangle); + st->cr(); + + if (cur_lr && MiscUtils::is_readable_pointer(cur_lr)) { + decode_instructions_at_pc( + "Decoded instructions at lr:", + cur_lr, 32, 16, st); + } + + // Check and print sp. + st->print("sp: " PTR64_FORMAT " ", p2i(cur_sp)); + if (!is_valid_stackpointer(cur_sp, stack_base, stack_size)) { + st->print("(invalid) "); + goto cleanup; + } else { + st->print("(base - 0x%X) ", PTRDIFF_BYTES(stack_base, cur_sp)); + } + st->cr(); + + // Check and print rtoc. + st->print("rtoc: " PTR64_FORMAT " ", p2i(cur_rtoc)); + if (cur_rtoc == NULL || cur_rtoc == (codeptr_t)-1 || + !MiscUtils::is_readable_pointer(cur_rtoc)) { + st->print("(invalid)"); + } else if (((uintptr_t)cur_rtoc) & 0x7) { + st->print("(unaligned)"); + } + st->cr(); + + st->print_cr("|---stackaddr----| |----lrsave------|: "); + + /// + // Walk callstack. + // + // (if no context was given, use the current stack) + sp = (unsigned long*)(*(unsigned long*)cur_sp); // Stack pointer + sp_last = cur_sp; + + frame = 0; + + while (frame < MAX_CALLSTACK_DEPTH) { + + // Check sp. + bool retry = false; + if (sp == NULL) { + // The backchain pointer was NULL. This normally means the end of the chain. But the + // stack might be corrupted, and it may be worth looking for the stack chain. + if (is_valid_stackpointer(sp_last, stack_base, stack_size) && (stack_base - 0x10) > sp_last) { + // If we are not within 0x10 stackslots of the stack base, we assume that this + // is indeed not the end of the chain but that the stack was corrupted. So lets try to + // find the end of the chain. + st->print_cr("*** back chain pointer is NULL - end of stack or broken backchain ? ***"); + retry = true; + } else { + st->print_cr("*** end of backchain ***"); + goto end_walk_callstack; + } + } else if (!is_valid_stackpointer(sp, stack_base, stack_size)) { + st->print_cr("*** stack pointer invalid - backchain corrupted (" PTR_FORMAT ") ***", p2i(sp)); + retry = true; + } else if (sp < sp_last) { + st->print_cr("invalid stack pointer: " PTR_FORMAT " (not monotone raising)", p2i(sp)); + retry = true; + } + + // If backchain is broken, try to recover, by manually scanning the stack for a pattern + // which looks like a valid stack. + if (retry) { + st->print_cr("trying to recover and find backchain..."); + sp = try_find_backchain(sp_last, stack_base, stack_size); + if (sp) { + st->print_cr("found something which looks like a backchain at " PTR64_FORMAT ", after 0x%x bytes... ", + p2i(sp), PTRDIFF_BYTES(sp, sp_last)); + } else { + st->print_cr("did not find a backchain, giving up."); + goto end_walk_callstack; + } + } + + // Print stackframe. + print_stackframe(st, sp, buf, buf_size, demangle); + st->cr(); + frame ++; + + // Next stack frame and link area. + sp_last = sp; + sp = (unsigned long*)(*sp); + } + + // Prevent endless loops in case of invalid callstacks. + if (frame == MAX_CALLSTACK_DEPTH) { + st->print_cr("...(stopping after %d frames.", MAX_CALLSTACK_DEPTH); + } + +end_walk_callstack: + + st->print_cr("-----------------------"); + +cleanup: + + return; + +} + + + + diff --git a/hotspot/src/os/aix/vm/porting_aix.hpp b/hotspot/src/os/aix/vm/porting_aix.hpp index 6a004df5b8b..196f93fa06f 100644 --- a/hotspot/src/os/aix/vm/porting_aix.hpp +++ b/hotspot/src/os/aix/vm/porting_aix.hpp @@ -61,24 +61,37 @@ extern "C" #endif int dladdr(void *addr, Dl_info *info); -typedef unsigned int* codeptr_t; - struct tbtable; -// helper function - given a program counter, tries to locate the traceback table and -// returns info from it (like, most importantly, function name, displacement of the -// pc inside the function, and the traceback table itself. -#ifdef __cplusplus -extern "C" -#endif -int getFuncName( - codeptr_t pc, // [in] program counter - char* p_name, size_t namelen, // [out] optional: user provided buffer for the function name - int* p_displacement, // [out] optional: displacement - const struct tbtable** p_tb, // [out] optional: ptr to traceback table to get further information - char* p_errmsg, size_t errmsglen, // [out] optional: user provided buffer for error messages - bool demangle // [in] whether to demangle the name - ); +class AixSymbols { + public: + + // Given a program counter, tries to locate the traceback table and returns info from + // it - e.g. function name, displacement of the pc inside the function, and the traceback + // table itself. + static bool get_function_name ( + address pc, // [in] program counter + char* p_name, size_t namelen, // [out] optional: user provided buffer for the function name + int* p_displacement, // [out] optional: displacement + const struct tbtable** p_tb, // [out] optional: ptr to traceback table to get further information + bool demangle // [in] whether to demangle the name + ); + + // Given a program counter, returns the name of the module (library and module) the pc points to + static bool get_module_name ( + address pc, // [in] program counter + char* p_name, size_t namelen // [out] module name + ); + +}; + +class AixNativeCallstack { + public: + static void print_callstack_for_context(outputStream* st, const ucontext_t* uc, + bool demangle, + char* buf, size_t buf_size); +}; + #endif // OS_AIX_VM_PORTING_AIX_HPP diff --git a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp index d89c28fa85b..b447b3fd7be 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp @@ -40,6 +40,7 @@ #include "prims/jniFastGetField.hpp" #include "prims/jvm.h" #include "prims/jvm_misc.hpp" +#include "porting_aix.hpp" #include "runtime/arguments.hpp" #include "runtime/extendedPC.hpp" #include "runtime/frame.inline.hpp" @@ -579,3 +580,9 @@ int os::extra_bang_size_in_bytes() { return 0; } +bool os::platform_print_native_stack(outputStream* st, void* context, char *buf, int buf_size) { + AixNativeCallstack::print_callstack_for_context(st, (const ucontext_t*)context, true, buf, (size_t) buf_size); + return true; +} + + diff --git a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp index 44fa7db3838..3bda955a8a8 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp @@ -32,4 +32,8 @@ // Note: Currently only used in 64 bit Windows implementations static bool register_code_area(char *low, char *high) { return true; } +#define PLATFORM_PRINT_NATIVE_STACK 1 +static bool platform_print_native_stack(outputStream* st, void* context, + char *buf, int buf_size); + #endif // OS_CPU_AIX_PPC_VM_OS_AIX_PPC_HPP From 459ed3c70ad1a6283620d011b12065f83a9223a1 Mon Sep 17 00:00:00 2001 From: Kirill Zhaldybin Date: Wed, 13 Jan 2016 20:19:15 +0300 Subject: [PATCH 080/212] 8132720: Add tests which checks that Humongous objects are not moved after Full GC Reviewed-by: jmasa, dfazunen --- .../TestHumongousMovement.java | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 hotspot/test/gc/g1/humongousObjects/TestHumongousMovement.java diff --git a/hotspot/test/gc/g1/humongousObjects/TestHumongousMovement.java b/hotspot/test/gc/g1/humongousObjects/TestHumongousMovement.java new file mode 100644 index 00000000000..66ca21bf05e --- /dev/null +++ b/hotspot/test/gc/g1/humongousObjects/TestHumongousMovement.java @@ -0,0 +1,138 @@ +/* + * Copyright (c) 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. + * + */ + +package gc.g1.humongousObjects; + +import gc.testlibrary.Helpers; +import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; +import sun.hotspot.WhiteBox; + +import java.io.PrintStream; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; +import java.util.stream.Collectors; + +/** + * @test TestHumongousMovement + * @summary Checks that Humongous objects are not moved during GC + * @requires vm.gc=="G1" | vm.gc=="null" + * @library /testlibrary /test/lib / + * @modules java.management + * @build sun.hotspot.WhiteBox + * gc.testlibrary.Helpers + * gc.g1.humongousObjects.TestHumongousMovement + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M -Xms200m -Xmx200m -XX:InitiatingHeapOccupancyPercent=100 + * -Xlog:gc=info:file=TestHumongousMovement.log + * gc.g1.humongousObjects.TestHumongousMovement + */ + +public class TestHumongousMovement { + + private static class AllocationData { + private final byte[] allocation; + public final BigInteger objectAddress; + + public AllocationData(byte[] byteArray) { + allocation = byteArray; + objectAddress = new BigInteger(Long.toUnsignedString((WB.getObjectAddress(allocation)))); + } + + public boolean isAddressChanged() { + return !new BigInteger(Long.toUnsignedString((WB.getObjectAddress(allocation)))).equals(objectAddress); + } + + public void printDetails(PrintStream out) { + BigInteger objectAddressAfterGC = + new BigInteger(Long.toUnsignedString((WB.getObjectAddress(allocation)))); + + out.println(String.format("Object stored address = %d\nObject address after GC = %d\n" + + "They are %sequals", objectAddress, + objectAddressAfterGC, !objectAddress.equals(objectAddressAfterGC) ? "not " : "")); + } + + } + + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + + // How many allocated humongous objects should be deleted + private static final double HUMONGOUS_OBJECTS_DELETED_FACTOR = 0.5D; + // How many of free g1 regions should be used for humongous allocations + private static final double ALLOCATED_HUMONGOUS_REGIONS_FACTOR = 0.25D; + + public static void main(String[] args) { + + int g1RegionSize = WB.g1RegionSize(); + int byteArrayMemoryOverhead = Helpers.detectByteArrayAllocationOverhead(); + + System.out.println("Total " + WB.g1NumMaxRegions() + " regions"); + System.out.println("Total " + WB.g1NumFreeRegions() + " free regions"); + + int regionsToAllocate = (int) (WB.g1NumFreeRegions() * ALLOCATED_HUMONGOUS_REGIONS_FACTOR); + + // Sanity check + Asserts.assertGreaterThan(regionsToAllocate, 0, "Test Bug: no regions to allocate"); + + System.out.println("Allocating " + regionsToAllocate + " humongous objects, each 90% of g1 region size"); + + List allocations = new ArrayList<>(); + + // 90 % of maximum byte[] that takes one region + int hSize = (int) ((g1RegionSize - byteArrayMemoryOverhead) * 0.9); + + // Sanity check + Asserts.assertGreaterThan(hSize, g1RegionSize / 2, "Test Bug: allocation size is not humongous"); + + for (int i = 0; i < regionsToAllocate; ++i) { + allocations.add(new AllocationData(new byte[hSize])); + } + + Random rnd = Utils.getRandomInstance(); + + int toDelete = (int) (allocations.size() * HUMONGOUS_OBJECTS_DELETED_FACTOR); + + for (int i = 0; i < toDelete; ++i) { + allocations.remove(rnd.nextInt(allocations.size())); + } + + WB.fullGC(); + + List movedObjects = allocations.stream() + .filter(AllocationData::isAddressChanged) + .collect(Collectors.toList()); + + if (movedObjects.size() > 0) { + System.out.println("Test failed - some humongous objects moved after Full GC"); + movedObjects.stream().forEach(a -> a.printDetails(System.out)); + throw new Error("Test failed - some humongous objects moved after Full GC"); + } else { + System.out.println("Passed"); + } + } +} From bbe36d6b8f7c1c919faa8fe9e28ebde32b90f3cd Mon Sep 17 00:00:00 2001 From: Kirill Zhaldybin Date: Wed, 13 Jan 2016 20:26:54 +0300 Subject: [PATCH 081/212] 8132717: Add tests checking that instances of j.l.Classes of a large size are allocated as Humongous Reviewed-by: jmasa, dfazunen --- .../gc/g1/humongousObjects/G1SampleClass.java | 93 +++++++++++++ .../TestHumongousNonArrayAllocation.java | 123 ++++++++++++++++++ 2 files changed, 216 insertions(+) create mode 100644 hotspot/test/gc/g1/humongousObjects/G1SampleClass.java create mode 100644 hotspot/test/gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java diff --git a/hotspot/test/gc/g1/humongousObjects/G1SampleClass.java b/hotspot/test/gc/g1/humongousObjects/G1SampleClass.java new file mode 100644 index 00000000000..62892c2c88b --- /dev/null +++ b/hotspot/test/gc/g1/humongousObjects/G1SampleClass.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 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. + * + */ + +package gc.g1.humongousObjects; + +import gc.testlibrary.Helpers; +import sun.hotspot.WhiteBox; + +import java.io.IOException; +import java.nio.file.Path; + +/** + * Provides generated and compiled sample classes and theirs expected sizes. + */ +public enum G1SampleClass { + + LARGEST_NON_HUMONGOUS { + @Override + public long expectedInstanceSize() { + return HALF_G1_REGION_SIZE; + } + }, + SMALLEST_HUMONGOUS { + @Override + public long expectedInstanceSize() { + return HALF_G1_REGION_SIZE + Helpers.SIZE_OF_LONG; + } + }, + ONE_REGION_HUMONGOUS { + @Override + public long expectedInstanceSize() { + return G1_REGION_SIZE; + } + }, + TWO_REGION_HUMONGOUS { + @Override + public long expectedInstanceSize() { + return G1_REGION_SIZE + Helpers.SIZE_OF_LONG; + } + }, + MORE_THAN_TWO_REGION_HUMONGOUS { + @Override + public long expectedInstanceSize() { + return G1_REGION_SIZE * 2 + Helpers.SIZE_OF_LONG; + } + }; + + private static final long G1_REGION_SIZE = WhiteBox.getWhiteBox().g1RegionSize(); + private static final long HALF_G1_REGION_SIZE = G1_REGION_SIZE / 2; + + /** + * Generates and compiles class with instance of specified size and loads it in specified class loader + * + * @param classLoader class loader which will be used to load class + * @param wrkDir working dir where generated classes are put and compiled + * @param classNamePrefix prefix for service classes (ones we use to create chain of inheritance) + * @return a class with instances of the specified size loaded in specified class loader + * @throws IOException + * @throws ClassNotFoundException + */ + + public Class getCls(ClassLoader classLoader, Path wrkDir, String classNamePrefix) + throws IOException, ClassNotFoundException { + return Helpers.generateCompileAndLoad(classLoader, Helpers.enumNameToClassName(name()) + "Class", + expectedInstanceSize(), wrkDir, classNamePrefix); + } + + /** + * @return G1SampleClass instance expected size + */ + public abstract long expectedInstanceSize(); +} diff --git a/hotspot/test/gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java b/hotspot/test/gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java new file mode 100644 index 00000000000..118c3114b0c --- /dev/null +++ b/hotspot/test/gc/g1/humongousObjects/TestHumongousNonArrayAllocation.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 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. + * + */ + +package gc.g1.humongousObjects; + +import jdk.test.lib.Asserts; +import sun.hotspot.WhiteBox; + +import java.io.IOException; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +/** + * @test gc.g1.humongousObjects.TestHumongousNonArrayAllocation + * @summary Checks that huge class' instances (ie with huge amount of fields) are allocated successfully + * @requires vm.gc=="G1" | vm.gc=="null" + * @requires vm.opt.G1HeapRegionSize == "null" | vm.opt.G1HeapRegionSize == "1M" + * @library /testlibrary /test/lib / + * @modules java.management + * @build sun.hotspot.WhiteBox + * gc.testlibrary.Helpers + * gc.g1.humongousObjects.G1SampleClass + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation + * + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * + * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation LARGEST_NON_HUMONGOUS + * + * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation SMALLEST_HUMONGOUS + * + * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation ONE_REGION_HUMONGOUS + * + * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation TWO_REGION_HUMONGOUS + * + * @run main/othervm -Xms128M -Xmx128M -XX:+UseG1GC -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:G1HeapRegionSize=1M + * gc.g1.humongousObjects.TestHumongousNonArrayAllocation MORE_THAN_TWO_REGION_HUMONGOUS + * + */ + +/** + * The test for objects which are instances of classes with a huge amount of fields. It's an alternative way to create + * a humongous object rather to allocate a long array. + * The size of a class object depends on the field declared in the class. So, the tests generates such classes to cover + * the following cases: + * largest non-humongous object (exactly half a region) + * smallest humongous object (half a region + sizeof(long)) + * humongous object that takes exactly one region + * humongous object that takes more than one region (region + sizeof(long)) + * humongous object that takes more than two regions (region * 2 + sizeof(long)) + * + */ +public class TestHumongousNonArrayAllocation { + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + private static final String CLASS_NAME_PREFIX = TestHumongousNonArrayAllocation.class.getSimpleName() + "_"; + + public static void main(String[] args) throws ClassNotFoundException, InstantiationException, + IllegalAccessException, IOException { + + if (args.length != 1) { + throw new Error("Test Bug: Expected class name wasn't provided as command line argument"); + } + G1SampleClass sampleClass = G1SampleClass.valueOf(args[0]); + + Path wrkDir = Files.createTempDirectory(Paths.get(""), CLASS_NAME_PREFIX); + URL[] url = {wrkDir.toUri().toURL()}; + URLClassLoader urlLoader = new URLClassLoader(url); + + Object sampleObject; + try { + sampleObject = sampleClass.getCls(urlLoader, wrkDir, CLASS_NAME_PREFIX).newInstance(); + } catch (Throwable throwable) { + throw new AssertionError("Test Bug: Cannot create object of provided class", throwable); + } + + boolean isHumongous = WB.g1IsHumongous(sampleObject); + boolean shouldBeHumongous = (sampleClass.expectedInstanceSize() > (WB.g1RegionSize() / 2)); + + // Sanity check + Asserts.assertEquals(WB.getObjectSize(sampleObject), sampleClass.expectedInstanceSize(), + String.format("Test Bug: Object of class %s is expected to take %d bytes but it takes %d.", + sampleClass.name(), sampleClass.expectedInstanceSize(), WB.getObjectSize(sampleObject))); + + // Test check + Asserts.assertEquals(isHumongous, shouldBeHumongous, + String.format("Object of class %s is expected to be %shumongous but it is not", + sampleClass.name(), (shouldBeHumongous ? "" : "non-"))); + } + +} From 45b28571f032829c871bc5ea1b80c20061b47054 Mon Sep 17 00:00:00 2001 From: Max Ockner Date: Wed, 13 Jan 2016 14:56:17 -0500 Subject: [PATCH 082/212] 8146800: Reorganize logging alias code Logging alias code has been reorganized to use internal Unified Logging methods. Reviewed-by: dholmes, hseigel, mlarsson, rprotacio --- hotspot/src/share/vm/runtime/arguments.cpp | 56 ++++++++++------------ hotspot/src/share/vm/runtime/arguments.hpp | 14 +++++- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index f8be77fafc1..9a53981e33e 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/taskqueue.hpp" #include "logging/log.hpp" +#include "logging/logTag.hpp" #include "logging/logConfiguration.hpp" #include "memory/allocation.inline.hpp" #include "memory/universe.inline.hpp" @@ -399,14 +400,11 @@ static AliasedFlag const aliased_jvm_flags[] = { { NULL, NULL} }; -static AliasedFlag const aliased_jvm_logging_flags[] = { - { "-XX:+TraceClassResolution", "-Xlog:classresolve=info"}, - { "-XX:-TraceClassResolution", "-Xlog:classresolve=off"}, - { "-XX:+TraceExceptions", "-Xlog:exceptions=info" }, - { "-XX:-TraceExceptions", "-Xlog:exceptions=off" }, - { "-XX:+TraceMonitorInflation", "-Xlog:monitorinflation=debug" }, - { "-XX:-TraceMonitorInflation", "-Xlog:monitorinflation=off" }, - { NULL, NULL } +static AliasedLoggingFlag const aliased_logging_flags[] = { + { "TraceClassResolution", LogLevel::Info, true, LogTag::_classresolve }, + { "TraceExceptions", LogLevel::Info, true, LogTag::_exceptions }, + { "TraceMonitorInflation", LogLevel::Debug, true, LogTag::_monitorinflation }, + { NULL, LogLevel::Off, false, LogTag::__NO_TAG } }; // Return true if "v" is less than "other", where "other" may be "undefined". @@ -939,18 +937,15 @@ const char* Arguments::handle_aliases_and_deprecation(const char* arg, bool warn return NULL; } -// lookup_logging_aliases -// Called from parse_each_vm_init_arg(). Should be called on -XX options before specific cases are checked. -// If arg matches any aliased_jvm_logging_flags entry, look up the real name and copy it into buffer. -bool Arguments::lookup_logging_aliases(const char* arg, char* buffer) { - for (size_t i = 0; aliased_jvm_logging_flags[i].alias_name != NULL; i++) { - const AliasedFlag& flag_status = aliased_jvm_logging_flags[i]; - if (strcmp(flag_status.alias_name, arg) == 0) { - strcpy(buffer, flag_status.real_name); - return true; +AliasedLoggingFlag Arguments::catch_logging_aliases(const char* name){ + for (size_t i = 0; aliased_logging_flags[i].alias_name != NULL; i++) { + const AliasedLoggingFlag& alf = aliased_logging_flags[i]; + if (strcmp(alf.alias_name, name) == 0) { + return alf; } } - return false; + AliasedLoggingFlag a = {NULL, LogLevel::Off, false, LogTag::__NO_TAG}; + return a; } bool Arguments::parse_argument(const char* arg, Flag::Flags origin) { @@ -962,8 +957,14 @@ bool Arguments::parse_argument(const char* arg, Flag::Flags origin) { char dummy; const char* real_name; bool warn_if_deprecated = true; + AliasedLoggingFlag alf; if (sscanf(arg, "-%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) { + alf = catch_logging_aliases(name); + if (alf.alias_name != NULL){ + LogConfiguration::configure_stdout(LogLevel::Off, alf.exactMatch, alf.tag, LogTag::__NO_TAG); + return true; + } real_name = handle_aliases_and_deprecation(name, warn_if_deprecated); if (real_name == NULL) { return false; @@ -971,6 +972,11 @@ bool Arguments::parse_argument(const char* arg, Flag::Flags origin) { return set_bool_flag(real_name, false, origin); } if (sscanf(arg, "+%" XSTR(BUFLEN) NAME_RANGE "%c", name, &dummy) == 1) { + alf = catch_logging_aliases(name); + if (alf.alias_name != NULL){ + LogConfiguration::configure_stdout(alf.level, alf.exactMatch, alf.tag, LogTag::__NO_TAG); + return true; + } real_name = handle_aliases_and_deprecation(name, warn_if_deprecated); if (real_name == NULL) { return false; @@ -2629,7 +2635,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, for (int index = 0; index < args->nOptions; index++) { bool is_absolute_path = false; // for -agentpath vs -agentlib - JavaVMOption* option = args->options + index; + const JavaVMOption* option = args->options + index; if (!match_option(option, "-Djava.class.path", &tail) && !match_option(option, "-Dsun.java.command", &tail) && @@ -2643,16 +2649,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, build_jvm_args(option->optionString); } - // char buffer to store looked up logging option. - char aliased_logging_option[256]; - - // Catch -XX options which are aliased to Unified logging commands. - if (match_option(option, "-XX:", &tail)) { - if (lookup_logging_aliases(option->optionString, aliased_logging_option)) { - option->optionString = aliased_logging_option; - } - } - // -verbose:[class/gc/jni] if (match_option(option, "-verbose", &tail)) { if (!strcmp(tail, ":class") || !strcmp(tail, "")) { diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index 8115037adee..a6918fde8e7 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,8 @@ #ifndef SHARE_VM_RUNTIME_ARGUMENTS_HPP #define SHARE_VM_RUNTIME_ARGUMENTS_HPP +#include "logging/logLevel.hpp" +#include "logging/logTag.hpp" #include "runtime/java.hpp" #include "runtime/os.hpp" #include "runtime/perfData.hpp" @@ -223,6 +225,14 @@ class AgentLibraryList VALUE_OBJ_CLASS_SPEC { // Helper class for controlling the lifetime of JavaVMInitArgs objects. class ScopedVMInitArgs; +// Most logging functions require 5 tags. Some of them may be _NO_TAG. +typedef struct { + const char* alias_name; + LogLevelType level; + bool exactMatch; + LogTagType tag; +} AliasedLoggingFlag; + class Arguments : AllStatic { friend class VMStructs; friend class JvmtiExport; @@ -449,7 +459,7 @@ class Arguments : AllStatic { // Return NULL if the arg has expired. static const char* handle_aliases_and_deprecation(const char* arg, bool warn); static bool lookup_logging_aliases(const char* arg, char* buffer); - + static AliasedLoggingFlag catch_logging_aliases(const char* name); static short CompileOnlyClassesNum; static short CompileOnlyClassesMax; static char** CompileOnlyClasses; From f16c6f2d9f3b73ac6aa0bc363f1bf98757858f96 Mon Sep 17 00:00:00 2001 From: David Holmes Date: Thu, 14 Jan 2016 01:25:30 -0500 Subject: [PATCH 083/212] 8077648: ARM: BREAKPOINT is wrong for thumb Reviewed-by: dlong --- .../src/share/vm/utilities/globalDefinitions_gcc.hpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp index afeafa384ee..bdcc095ba94 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -212,16 +212,8 @@ extern "C" { #define DEBUG_EXCEPTION ::abort(); -#ifdef ARM32 -#ifdef SOLARIS -#define BREAKPOINT __asm__ volatile (".long 0xe1200070") -#else -#define BREAKPOINT __asm__ volatile (".long 0xe7f001f0") -#endif -#else extern "C" void breakpoint(); #define BREAKPOINT ::breakpoint() -#endif // checking for nanness #ifdef SOLARIS From 49d61bdeb6ffd68de6b3adbc932faf41a5c7fbf1 Mon Sep 17 00:00:00 2001 From: Bengt Rutisson Date: Thu, 14 Jan 2016 09:18:11 +0100 Subject: [PATCH 084/212] 8147000: VM crashes during initialization trying to print log message Reviewed-by: kbarrett, dholmes --- hotspot/src/share/vm/gc/shared/gcId.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/gc/shared/gcId.cpp b/hotspot/src/share/vm/gc/shared/gcId.cpp index 1fd75130b80..55b54ed3288 100644 --- a/hotspot/src/share/vm/gc/shared/gcId.cpp +++ b/hotspot/src/share/vm/gc/shared/gcId.cpp @@ -26,7 +26,6 @@ #include "gc/shared/gcId.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" -#include "runtime/threadLocalStorage.hpp" uint GCId::_next_id = 0; @@ -53,7 +52,8 @@ const uint GCId::current_raw() { } size_t GCId::print_prefix(char* buf, size_t len) { - if (ThreadLocalStorage::is_initialized() && ThreadLocalStorage::thread()->is_Named_thread()) { + Thread* thread = Thread::current_or_null(); + if (thread != NULL && thread->is_Named_thread()) { uint gc_id = current_raw(); if (gc_id != undefined()) { int ret = jio_snprintf(buf, len, "GC(%u) ", gc_id); From 46579944356795795b7e573ecc3f58f3c45c5cc0 Mon Sep 17 00:00:00 2001 From: Erik Helin Date: Thu, 14 Jan 2016 14:50:40 +0100 Subject: [PATCH 085/212] 8146990: Convert CollectorPolicy to use log_warning instead of warning Reviewed-by: sjohanss, brutisso --- .../share/vm/gc/shared/collectorPolicy.cpp | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp index c958c0da70b..fa1e2eaddbc 100644 --- a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp @@ -303,7 +303,7 @@ void GenCollectorPolicy::initialize_flags() { // Make sure NewSize allows an old generation to fit even if set on the command line if (FLAG_IS_CMDLINE(NewSize) && NewSize >= _initial_heap_byte_size) { - warning("NewSize was set larger than initial heap size, will use initial heap size."); + log_warning(gc, ergo)("NewSize was set larger than initial heap size, will use initial heap size."); NewSize = bound_minus_alignment(NewSize, _initial_heap_byte_size); } @@ -325,9 +325,9 @@ void GenCollectorPolicy::initialize_flags() { // Make sure there is room for an old generation size_t smaller_max_new_size = MaxHeapSize - _gen_alignment; if (FLAG_IS_CMDLINE(MaxNewSize)) { - warning("MaxNewSize (" SIZE_FORMAT "k) is equal to or greater than the entire " - "heap (" SIZE_FORMAT "k). A new max generation size of " SIZE_FORMAT "k will be used.", - MaxNewSize/K, MaxHeapSize/K, smaller_max_new_size/K); + log_warning(gc, ergo)("MaxNewSize (" SIZE_FORMAT "k) is equal to or greater than the entire " + "heap (" SIZE_FORMAT "k). A new max generation size of " SIZE_FORMAT "k will be used.", + MaxNewSize/K, MaxHeapSize/K, smaller_max_new_size/K); } FLAG_SET_ERGO(size_t, MaxNewSize, smaller_max_new_size); if (NewSize > MaxNewSize) { @@ -346,9 +346,9 @@ void GenCollectorPolicy::initialize_flags() { // At this point this should only happen if the user specifies a large NewSize and/or // a small (but not too small) MaxNewSize. if (FLAG_IS_CMDLINE(MaxNewSize)) { - warning("NewSize (" SIZE_FORMAT "k) is greater than the MaxNewSize (" SIZE_FORMAT "k). " - "A new max generation size of " SIZE_FORMAT "k will be used.", - NewSize/K, MaxNewSize/K, NewSize/K); + log_warning(gc, ergo)("NewSize (" SIZE_FORMAT "k) is greater than the MaxNewSize (" SIZE_FORMAT "k). " + "A new max generation size of " SIZE_FORMAT "k will be used.", + NewSize/K, MaxNewSize/K, NewSize/K); } FLAG_SET_ERGO(size_t, MaxNewSize, NewSize); _max_young_size = MaxNewSize; @@ -516,10 +516,10 @@ void GenCollectorPolicy::initialize_size_info() { // The generation minimums and the overall heap minimum should // be within one generation alignment. if (_initial_old_size > _max_old_size) { - warning("Inconsistency between maximum heap size and maximum " - "generation sizes: using maximum heap = " SIZE_FORMAT - " -XX:OldSize flag is being ignored", - _max_heap_byte_size); + log_warning(gc, ergo)("Inconsistency between maximum heap size and maximum " + "generation sizes: using maximum heap = " SIZE_FORMAT + ", -XX:OldSize flag is being ignored", + _max_heap_byte_size); _initial_old_size = _max_old_size; } @@ -531,8 +531,8 @@ void GenCollectorPolicy::initialize_size_info() { // differs from JDK8 where the generation sizes have higher priority // than the initial heap size. if ((_initial_old_size + _initial_young_size) != _initial_heap_byte_size) { - warning("Inconsistency between generation sizes and heap size, resizing " - "the generations to fit the heap."); + log_warning(gc, ergo)("Inconsistency between generation sizes and heap size, resizing " + "the generations to fit the heap."); size_t desired_young_size = _initial_heap_byte_size - _initial_old_size; if (_initial_heap_byte_size < _initial_old_size) { @@ -697,8 +697,8 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size, // Give a warning if we seem to be looping forever. if ((QueuedAllocationWarningCount > 0) && (try_count % QueuedAllocationWarningCount == 0)) { - warning("GenCollectorPolicy::mem_allocate_work retries %d times \n\t" - " size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : ""); + log_warning(gc, ergo)("GenCollectorPolicy::mem_allocate_work retries %d times," + " size=" SIZE_FORMAT " %s", try_count, size, is_tlab ? "(TLAB)" : ""); } } } @@ -870,8 +870,8 @@ MetaWord* CollectorPolicy::satisfy_failed_metadata_allocation( loop_count++; if ((QueuedAllocationWarningCount > 0) && (loop_count % QueuedAllocationWarningCount == 0)) { - warning("satisfy_failed_metadata_allocation() retries %d times \n\t" - " size=" SIZE_FORMAT, loop_count, word_size); + log_warning(gc, ergo)("satisfy_failed_metadata_allocation() retries %d times," + " size=" SIZE_FORMAT, loop_count, word_size); } } while (true); // Until a GC is done } From f0d0aaf18d6c5bb0cbea05846732b799a5d188b0 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Sat, 16 Jan 2016 13:56:49 +0300 Subject: [PATCH 086/212] 8145698: Memory leak in add_lib_info_fd of libproc_impl.c:174 Added missed free call Reviewed-by: jbachorik, sspitsyn --- .../src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c | 1 + .../src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c index 84154be4eb0..c12f82d1bf6 100644 --- a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c +++ b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c @@ -171,6 +171,7 @@ lib_info* add_lib_info_fd(struct ps_prochandle* ph, const char* libname, int fd, if (strlen(libname) >= sizeof(newlib->name)) { print_debug("libname %s too long\n", libname); + free(newlib); return NULL; } strcpy(newlib->name, libname); diff --git a/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c index b8ba361b8a9..b84c6505997 100644 --- a/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c +++ b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c @@ -217,6 +217,7 @@ lib_info* add_lib_info_fd(struct ps_prochandle* ph, const char* libname, int fd, if (strlen(libname) >= sizeof(newlib->name)) { print_debug("libname %s too long\n", libname); + free(newlib); return NULL; } strcpy(newlib->name, libname); From 72a8d2948fc7c63496db88be07cfb82992979425 Mon Sep 17 00:00:00 2001 From: Severin Gehwolf Date: Sat, 16 Jan 2016 13:04:23 -0500 Subject: [PATCH 087/212] 8147482: Zero build fails after 8144953 Reviewed-by: coleenp, simonis --- hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 74c0a3b4a49..cab530d379c 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -2780,7 +2780,7 @@ run: MORE_STACK(1); pc = METHOD->code_base() + continuation_bci; if (log_is_enabled(Info, exceptions)) { - ResourceMark rm(thread); + ResourceMark rm(THREAD); stringStream tempst; tempst.print("interpreter method <%s>\n" " at bci %d, continuing at %d for thread " INTPTR_FORMAT, From 75f5093aa15ef75cdd978cda9ad89280f6469a66 Mon Sep 17 00:00:00 2001 From: Erik Helin Date: Thu, 14 Jan 2016 15:09:11 +0100 Subject: [PATCH 088/212] 8146994: Move internal vm tests to a separate file Reviewed-by: coleenp, stefank, kbarrett, mikael --- hotspot/src/share/vm/prims/jni.cpp | 113 +-------------- .../share/vm/utilities/internalVMTests.cpp | 132 ++++++++++++++++++ .../share/vm/utilities/internalVMTests.hpp | 39 ++++++ 3 files changed, 175 insertions(+), 109 deletions(-) create mode 100644 hotspot/src/share/vm/utilities/internalVMTests.cpp create mode 100644 hotspot/src/share/vm/utilities/internalVMTests.hpp diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index d751b5db3b9..e3251d14e56 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -78,6 +78,7 @@ #include "utilities/dtrace.hpp" #include "utilities/events.hpp" #include "utilities/histogram.hpp" +#include "utilities/internalVMTests.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS #include "gc/g1/g1SATBCardTableModRefBS.hpp" @@ -3850,114 +3851,6 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_GetDefaultJavaVMInitArgs(void *args_) { return ret; } -#ifndef PRODUCT - -#include "gc/shared/collectedHeap.hpp" -#include "gc/shared/gcTimer.hpp" -#if INCLUDE_ALL_GCS -#include "gc/g1/heapRegionRemSet.hpp" -#endif -#include "compiler/directivesParser.hpp" -#include "memory/guardedMemory.hpp" -#include "utilities/json.hpp" -#include "utilities/ostream.hpp" -#include "utilities/quickSort.hpp" -#if INCLUDE_VM_STRUCTS -#include "runtime/vmStructs.hpp" -#endif - -#define run_unit_test(unit_test_function_call) \ - tty->print_cr("Running test: " #unit_test_function_call); \ - unit_test_function_call - -// Forward declaration -void TestDependencyContext_test(); -void test_semaphore(); -void TestOS_test(); -void TestReservedSpace_test(); -void TestReserveMemorySpecial_test(); -void TestVirtualSpace_test(); -void TestMetaspaceAux_test(); -void TestMetachunk_test(); -void TestVirtualSpaceNode_test(); -void TestNewSize_test(); -void TestOldSize_test(); -void TestKlass_test(); -void TestBitMap_test(); -void TestAsUtf8(); -void Test_linked_list(); -void TestResourcehash_test(); -void TestChunkedList_test(); -void Test_log_length(); -void Test_TempNewSymbol(); -#if INCLUDE_ALL_GCS -void TestOldFreeSpaceCalculation_test(); -void TestG1BiasedArray_test(); -void TestBufferingOopClosure_test(); -void TestCodeCacheRemSet_test(); -void FreeRegionList_test(); -void IHOP_test(); -void test_memset_with_concurrent_readers() NOT_DEBUG_RETURN; -void TestPredictions_test(); -void WorkerDataArray_test(); -#endif - -void execute_internal_vm_tests() { - if (ExecuteInternalVMTests) { - tty->print_cr("Running internal VM tests"); - run_unit_test(TestDependencyContext_test()); - run_unit_test(test_semaphore()); - run_unit_test(TestOS_test()); - run_unit_test(TestReservedSpace_test()); - run_unit_test(TestReserveMemorySpecial_test()); - run_unit_test(TestVirtualSpace_test()); - run_unit_test(TestMetaspaceAux_test()); - run_unit_test(TestMetachunk_test()); - run_unit_test(TestVirtualSpaceNode_test()); - run_unit_test(GlobalDefinitions::test_globals()); - run_unit_test(GCTimerAllTest::all()); - run_unit_test(arrayOopDesc::test_max_array_length()); - run_unit_test(CollectedHeap::test_is_in()); - run_unit_test(QuickSort::test_quick_sort()); - run_unit_test(GuardedMemory::test_guarded_memory()); - run_unit_test(AltHashing::test_alt_hash()); - run_unit_test(TestNewSize_test()); - run_unit_test(TestOldSize_test()); - run_unit_test(TestKlass_test()); - run_unit_test(TestBitMap_test()); - run_unit_test(TestAsUtf8()); - run_unit_test(TestResourcehash_test()); - run_unit_test(ObjectMonitor::sanity_checks()); - run_unit_test(Test_linked_list()); - run_unit_test(TestChunkedList_test()); - run_unit_test(JSONTest::test()); - run_unit_test(Test_log_length()); - run_unit_test(DirectivesParser::test()); - run_unit_test(Test_TempNewSymbol()); -#if INCLUDE_VM_STRUCTS - run_unit_test(VMStructs::test()); -#endif -#if INCLUDE_ALL_GCS - run_unit_test(TestOldFreeSpaceCalculation_test()); - run_unit_test(TestG1BiasedArray_test()); - run_unit_test(TestBufferingOopClosure_test()); - run_unit_test(TestCodeCacheRemSet_test()); - if (UseG1GC) { - run_unit_test(FreeRegionList_test()); - run_unit_test(IHOP_test()); - } - run_unit_test(test_memset_with_concurrent_readers()); - run_unit_test(TestPredictions_test()); - run_unit_test(WorkerDataArray_test()); -#endif - tty->print_cr("All internal VM tests passed"); - } -} - -#undef run_unit_test - -#endif - DT_RETURN_MARK_DECL(CreateJavaVM, jint , HOTSPOT_JNI_CREATEJAVAVM_RETURN(_ret_ref)); @@ -4058,7 +3951,9 @@ static jint JNI_CreateJavaVM_inner(JavaVM **vm, void **penv, void *args) { // Some platforms (like Win*) need a wrapper around these test // functions in order to properly handle error conditions. test_error_handler(); - execute_internal_vm_tests(); + if (ExecuteInternalVMTests) { + InternalVMTests::run(); + } #endif // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving. diff --git a/hotspot/src/share/vm/utilities/internalVMTests.cpp b/hotspot/src/share/vm/utilities/internalVMTests.cpp new file mode 100644 index 00000000000..0b34edcb6d3 --- /dev/null +++ b/hotspot/src/share/vm/utilities/internalVMTests.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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" + +#ifndef PRODUCT + +#include "classfile/altHashing.hpp" +#include "compiler/directivesParser.hpp" +#include "gc/shared/collectedHeap.hpp" +#include "gc/shared/gcTimer.hpp" +#include "memory/guardedMemory.hpp" +#include "utilities/internalVMTests.hpp" +#include "utilities/json.hpp" +#include "utilities/macros.hpp" +#include "utilities/ostream.hpp" +#include "utilities/quickSort.hpp" +#if INCLUDE_ALL_GCS +#include "gc/g1/heapRegionRemSet.hpp" +#endif +#if INCLUDE_VM_STRUCTS +#include "runtime/vmStructs.hpp" +#endif + +#define run_unit_test(unit_test_function_call) \ + tty->print_cr("Running test: " #unit_test_function_call); \ + unit_test_function_call + +// Forward declaration +void TestDependencyContext_test(); +void test_semaphore(); +void TestOS_test(); +void TestReservedSpace_test(); +void TestReserveMemorySpecial_test(); +void TestVirtualSpace_test(); +void TestMetaspaceAux_test(); +void TestMetachunk_test(); +void TestVirtualSpaceNode_test(); +void TestNewSize_test(); +void TestOldSize_test(); +void TestKlass_test(); +void TestBitMap_test(); +void TestAsUtf8(); +void Test_linked_list(); +void TestResourcehash_test(); +void TestChunkedList_test(); +void Test_log_length(); +void Test_TempNewSymbol(); +#if INCLUDE_ALL_GCS +void TestOldFreeSpaceCalculation_test(); +void TestG1BiasedArray_test(); +void TestBufferingOopClosure_test(); +void TestCodeCacheRemSet_test(); +void FreeRegionList_test(); +void IHOP_test(); +void test_memset_with_concurrent_readers() NOT_DEBUG_RETURN; +void TestPredictions_test(); +void WorkerDataArray_test(); +#endif + +void InternalVMTests::run() { + tty->print_cr("Running internal VM tests"); + run_unit_test(TestDependencyContext_test()); + run_unit_test(test_semaphore()); + run_unit_test(TestOS_test()); + run_unit_test(TestReservedSpace_test()); + run_unit_test(TestReserveMemorySpecial_test()); + run_unit_test(TestVirtualSpace_test()); + run_unit_test(TestMetaspaceAux_test()); + run_unit_test(TestMetachunk_test()); + run_unit_test(TestVirtualSpaceNode_test()); + run_unit_test(GlobalDefinitions::test_globals()); + run_unit_test(GCTimerAllTest::all()); + run_unit_test(arrayOopDesc::test_max_array_length()); + run_unit_test(CollectedHeap::test_is_in()); + run_unit_test(QuickSort::test_quick_sort()); + run_unit_test(GuardedMemory::test_guarded_memory()); + run_unit_test(AltHashing::test_alt_hash()); + run_unit_test(TestNewSize_test()); + run_unit_test(TestOldSize_test()); + run_unit_test(TestKlass_test()); + run_unit_test(TestBitMap_test()); + run_unit_test(TestAsUtf8()); + run_unit_test(TestResourcehash_test()); + run_unit_test(ObjectMonitor::sanity_checks()); + run_unit_test(Test_linked_list()); + run_unit_test(TestChunkedList_test()); + run_unit_test(JSONTest::test()); + run_unit_test(Test_log_length()); + run_unit_test(DirectivesParser::test()); + run_unit_test(Test_TempNewSymbol()); +#if INCLUDE_VM_STRUCTS + run_unit_test(VMStructs::test()); +#endif +#if INCLUDE_ALL_GCS + run_unit_test(TestOldFreeSpaceCalculation_test()); + run_unit_test(TestG1BiasedArray_test()); + run_unit_test(TestBufferingOopClosure_test()); + run_unit_test(TestCodeCacheRemSet_test()); + if (UseG1GC) { + run_unit_test(FreeRegionList_test()); + run_unit_test(IHOP_test()); + } + run_unit_test(test_memset_with_concurrent_readers()); + run_unit_test(TestPredictions_test()); + run_unit_test(WorkerDataArray_test()); +#endif + tty->print_cr("All internal VM tests passed"); +} + +#endif diff --git a/hotspot/src/share/vm/utilities/internalVMTests.hpp b/hotspot/src/share/vm/utilities/internalVMTests.hpp new file mode 100644 index 00000000000..93bc3309abe --- /dev/null +++ b/hotspot/src/share/vm/utilities/internalVMTests.hpp @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP +#define SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP + +#ifndef PRODUCT + +#include "memory/allocation.hpp" + +class InternalVMTests : public AllStatic { + public: + static void run(); +}; + +#endif + +#endif // SHARE_VM_UTILITIES_INTERNALVMTESTS_HPP From a52e26777dec544dcde0120fb0d67b0c3218c1a1 Mon Sep 17 00:00:00 2001 From: Bengt Rutisson Date: Mon, 18 Jan 2016 09:14:58 +0100 Subject: [PATCH 089/212] 8147464: Use LogConfiguration::configure_stdout() instead of parse_log_arguments Reviewed-by: mlarsson, sjohanss --- hotspot/src/share/vm/prims/jvmtiEnv.cpp | 4 ++-- hotspot/src/share/vm/runtime/arguments.cpp | 6 +----- hotspot/src/share/vm/services/memoryService.cpp | 4 ++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index bc3dd3ccfc4..a699b79ed95 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -630,9 +630,9 @@ JvmtiEnv::SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value) { break; case JVMTI_VERBOSE_GC: if (value == 0) { - LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); + LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(gc)); } else { - LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); + LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc)); } break; case JVMTI_VERBOSE_JNI: diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 807539a3852..365013e152d 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -2659,11 +2659,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, return JNI_EINVAL; } } else if (!strcmp(tail, ":gc")) { - // LogConfiguration_lock is not set up yet, but this code is executed by a single thread - bool ret = LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); - if (!ret) { - return JNI_EINVAL; - } + LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc)); } else if (!strcmp(tail, ":jni")) { if (FLAG_SET_CMDLINE(bool, PrintJNIResolving, true) != Flag::SUCCESS) { return JNI_EINVAL; diff --git a/hotspot/src/share/vm/services/memoryService.cpp b/hotspot/src/share/vm/services/memoryService.cpp index 11a4d569057..d2666a2f08b 100644 --- a/hotspot/src/share/vm/services/memoryService.cpp +++ b/hotspot/src/share/vm/services/memoryService.cpp @@ -519,9 +519,9 @@ bool MemoryService::set_verbose(bool verbose) { MutexLocker m(Management_lock); // verbose will be set to the previous value if (verbose) { - LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); + LogConfiguration::configure_stdout(LogLevel::Info, true, LOG_TAGS(gc)); } else { - LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); + LogConfiguration::configure_stdout(LogLevel::Off, true, LOG_TAGS(gc)); } ClassLoadingService::reset_trace_class_unloading(); From ed65d938e536e35e31f602bb6d29ac0d9ac81917 Mon Sep 17 00:00:00 2001 From: Erik Helin Date: Mon, 18 Jan 2016 17:12:34 +0100 Subject: [PATCH 090/212] 8146985: Change output directory for hotspot's jtreg tests Reviewed-by: erikj, mikael --- hotspot/test/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/test/Makefile b/hotspot/test/Makefile index 2556fbadfa0..5c703e9d5cc 100644 --- a/hotspot/test/Makefile +++ b/hotspot/test/Makefile @@ -121,11 +121,11 @@ TEST_ROOT := $(shell pwd) # Root of all test results ifdef ALT_OUTPUTDIR - ABS_BUILD_ROOT = $(ALT_OUTPUTDIR)/$(PLATFORM)-$(ARCH) + ABS_BUILD_ROOT = $(ALT_OUTPUTDIR) else ABS_BUILD_ROOT = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH) endif -ABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput +ABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput/$(UNIQUE_DIR) # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test) ifndef PRODUCT_HOME From b6658d2b5fda70227e81d84ca3c7465d0560c72a Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Mon, 18 Jan 2016 21:34:28 +0100 Subject: [PATCH 091/212] 8146999: hotspot/test/compiler/c2/8007294/Test8007294.java test nightly failure Uncast() fails with CheckCastPP Reviewed-by: kvn, thartmann --- hotspot/src/share/vm/opto/cfgnode.cpp | 20 +++++++++++++++---- hotspot/src/share/vm/opto/node.hpp | 2 +- .../test/compiler/c2/8007294/Test8007294.java | 2 ++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp index b784c205701..2adcac07b89 100644 --- a/hotspot/src/share/vm/opto/cfgnode.cpp +++ b/hotspot/src/share/vm/opto/cfgnode.cpp @@ -1171,9 +1171,7 @@ Node* PhiNode::Identity(PhaseGVN* phase) { Node* PhiNode::unique_input(PhaseTransform* phase, bool uncast) { // 1) One unique direct input, // or if uncast is true: - // 2) some of the inputs have an intervening ConstraintCast and - // the type of input is the same or sharper (more specific) - // than the phi's type. + // 2) some of the inputs have an intervening ConstraintCast // 3) an input is a self loop // // 1) input or 2) input or 3) input __ @@ -1193,7 +1191,21 @@ Node* PhiNode::unique_input(PhaseTransform* phase, bool uncast) { Node* n = in(i); if (n == NULL) continue; - Node* un = uncast ? n->uncast() : n; + Node* un = n; + if (uncast) { +#ifdef ASSERT + Node* m = un->uncast(); +#endif + while (un != NULL && un->req() == 2 && un->is_ConstraintCast()) { + Node* next = un->in(1); + if (phase->type(next)->isa_rawptr() && phase->type(un)->isa_oopptr()) { + // risk exposing raw ptr at safepoint + break; + } + un = next; + } + assert(m == un || un->in(1) == m, "Only expected at CheckCastPP from allocation"); + } if (un == NULL || un == this || phase->type(un) == Type::TOP) { continue; // ignore if top, or in(i) and "this" are in a data cycle } diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp index 7f19372a1ec..b7900ad276d 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -655,7 +655,7 @@ public: DEFINE_CLASS_ID(Phi, Type, 0) DEFINE_CLASS_ID(ConstraintCast, Type, 1) DEFINE_CLASS_ID(CastII, ConstraintCast, 0) - DEFINE_CLASS_ID(CheckCastPP, Type, 2) + DEFINE_CLASS_ID(CheckCastPP, ConstraintCast, 1) DEFINE_CLASS_ID(CMove, Type, 3) DEFINE_CLASS_ID(SafePointScalarObject, Type, 4) DEFINE_CLASS_ID(DecodeNarrowPtr, Type, 5) diff --git a/hotspot/test/compiler/c2/8007294/Test8007294.java b/hotspot/test/compiler/c2/8007294/Test8007294.java index 33f0fb8bbab..a335ba7fe96 100644 --- a/hotspot/test/compiler/c2/8007294/Test8007294.java +++ b/hotspot/test/compiler/c2/8007294/Test8007294.java @@ -24,6 +24,7 @@ /* * @test * @bug 8007294 + * @bug 8146999 * @summary ReduceFieldZeroing doesn't check for dependent load and can lead to incorrect execution * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+AlwaysIncrementalInline -XX:-UseOnStackReplacement -XX:-BackgroundCompilation Test8007294 * @@ -82,6 +83,7 @@ public class Test8007294 { } } for (int i = 0; i < 20000; i++) { + test2(0); // pollute profile int res = test2(1); if (res != 2) { System.out.println("FAILED test2 = " + res); From 6b826df140ca9524b751fd9e04ddc68ffc19aaa9 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Tue, 19 Jan 2016 17:52:52 +0000 Subject: [PATCH 092/212] 8146709: AArch64: Incorrect use of ADRP for byte_map_base Reviewed-by: roland --- hotspot/src/cpu/aarch64/vm/aarch64.ad | 6 +- .../cpu/aarch64/vm/c1_Runtime1_aarch64.cpp | 41 +++++++------ .../cpu/aarch64/vm/macroAssembler_aarch64.cpp | 61 +++++++++++++++---- .../cpu/aarch64/vm/macroAssembler_aarch64.hpp | 16 +++++ .../cpu/aarch64/vm/stubGenerator_aarch64.cpp | 2 +- 5 files changed, 87 insertions(+), 39 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index 670591d4cfa..8f88786f422 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -4442,11 +4442,7 @@ encode %{ enc_class aarch64_enc_mov_byte_map_base(iRegP dst, immByteMapBase src) %{ MacroAssembler _masm(&cbuf); - address page = (address)$src$$constant; - Register dst_reg = as_Register($dst$$reg); - unsigned long off; - __ adrp(dst_reg, ExternalAddress(page), off); - assert(off == 0, "assumed offset == 0"); + __ load_byte_map_base($dst$$Register); %} enc_class aarch64_enc_mov_n(iRegN dst, immN src) %{ diff --git a/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp index 0ae7e24e1b0..b1df18ade63 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_Runtime1_aarch64.cpp @@ -1150,9 +1150,6 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { #if INCLUDE_ALL_GCS -// Registers to be saved around calls to g1_wb_pre or g1_wb_post -#define G1_SAVE_REGS (RegSet::range(r0, r18) - RegSet::of(rscratch1, rscratch2)) - case g1_pre_barrier_slow_id: { StubFrame f(sasm, "g1_pre_barrier", dont_gc_arguments); @@ -1194,10 +1191,10 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ b(done); __ bind(runtime); - __ push(G1_SAVE_REGS, sp); + __ push_call_clobbered_registers(); f.load_argument(0, pre_val); __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), pre_val, thread); - __ pop(G1_SAVE_REGS, sp); + __ pop_call_clobbered_registers(); __ bind(done); } break; @@ -1225,45 +1222,49 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { Address buffer(thread, in_bytes(JavaThread::dirty_card_queue_offset() + DirtyCardQueue::byte_offset_of_buf())); - const Register card_addr = rscratch2; - ExternalAddress cardtable((address) ct->byte_map_base); + const Register card_offset = rscratch2; + // LR is free here, so we can use it to hold the byte_map_base. + const Register byte_map_base = lr; - f.load_argument(0, card_addr); - __ lsr(card_addr, card_addr, CardTableModRefBS::card_shift); - unsigned long offset; - __ adrp(rscratch1, cardtable, offset); - __ add(card_addr, card_addr, rscratch1); - __ ldrb(rscratch1, Address(card_addr, offset)); + assert_different_registers(card_offset, byte_map_base, rscratch1); + + f.load_argument(0, card_offset); + __ lsr(card_offset, card_offset, CardTableModRefBS::card_shift); + __ load_byte_map_base(byte_map_base); + __ ldrb(rscratch1, Address(byte_map_base, card_offset)); __ cmpw(rscratch1, (int)G1SATBCardTableModRefBS::g1_young_card_val()); __ br(Assembler::EQ, done); assert((int)CardTableModRefBS::dirty_card_val() == 0, "must be 0"); __ membar(Assembler::StoreLoad); - __ ldrb(rscratch1, Address(card_addr, offset)); + __ ldrb(rscratch1, Address(byte_map_base, card_offset)); __ cbzw(rscratch1, done); // storing region crossing non-NULL, card is clean. // dirty card and log. - __ strb(zr, Address(card_addr, offset)); + __ strb(zr, Address(byte_map_base, card_offset)); + + // Convert card offset into an address in card_addr + Register card_addr = card_offset; + __ add(card_addr, byte_map_base, card_addr); __ ldr(rscratch1, queue_index); __ cbz(rscratch1, runtime); __ sub(rscratch1, rscratch1, wordSize); __ str(rscratch1, queue_index); - const Register buffer_addr = r0; + // Reuse LR to hold buffer_addr + const Register buffer_addr = lr; - __ push(RegSet::of(r0, r1), sp); __ ldr(buffer_addr, buffer); __ str(card_addr, Address(buffer_addr, rscratch1)); - __ pop(RegSet::of(r0, r1), sp); __ b(done); __ bind(runtime); - __ push(G1_SAVE_REGS, sp); + __ push_call_clobbered_registers(); __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), card_addr, thread); - __ pop(G1_SAVE_REGS, sp); + __ pop_call_clobbered_registers(); __ bind(done); } diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp index f1149812ad0..b1b9a55df1b 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp @@ -2301,6 +2301,30 @@ void MacroAssembler::c_stub_prolog(int gp_arg_count, int fp_arg_count, int ret_t } #endif +void MacroAssembler::push_call_clobbered_registers() { + push(RegSet::range(r0, r18) - RegSet::of(rscratch1, rscratch2), sp); + + // Push v0-v7, v16-v31. + for (int i = 30; i >= 0; i -= 2) { + if (i <= v7->encoding() || i >= v16->encoding()) { + stpd(as_FloatRegister(i), as_FloatRegister(i+1), + Address(pre(sp, -2 * wordSize))); + } + } +} + +void MacroAssembler::pop_call_clobbered_registers() { + + for (int i = 0; i < 32; i += 2) { + if (i <= v7->encoding() || i >= v16->encoding()) { + ldpd(as_FloatRegister(i), as_FloatRegister(i+1), + Address(post(sp, 2 * wordSize))); + } + } + + pop(RegSet::range(r0, r18) - RegSet::of(rscratch1, rscratch2), sp); +} + void MacroAssembler::push_CPU_state(bool save_vectors) { push(0x3fffffff, sp); // integer registers except lr & sp @@ -3099,12 +3123,7 @@ void MacroAssembler::store_check(Register obj) { assert(CardTableModRefBS::dirty_card_val() == 0, "must be"); - { - ExternalAddress cardtable((address) ct->byte_map_base); - unsigned long offset; - adrp(rscratch1, cardtable, offset); - assert(offset == 0, "byte_map_base is misaligned"); - } + load_byte_map_base(rscratch1); if (UseCondCardMark) { Label L_already_dirty; @@ -3596,12 +3615,10 @@ void MacroAssembler::g1_write_barrier_post(Register store_addr, lsr(card_addr, store_addr, CardTableModRefBS::card_shift); - unsigned long offset; - adrp(tmp2, cardtable, offset); - // get the address of the card + load_byte_map_base(tmp2); add(card_addr, card_addr, tmp2); - ldrb(tmp2, Address(card_addr, offset)); + ldrb(tmp2, Address(card_addr)); cmpw(tmp2, (int)G1SATBCardTableModRefBS::g1_young_card_val()); br(Assembler::EQ, done); @@ -3609,13 +3626,13 @@ void MacroAssembler::g1_write_barrier_post(Register store_addr, membar(Assembler::StoreLoad); - ldrb(tmp2, Address(card_addr, offset)); + ldrb(tmp2, Address(card_addr)); cbzw(tmp2, done); // storing a region crossing, non-NULL oop, card is clean. // dirty card and log. - strb(zr, Address(card_addr, offset)); + strb(zr, Address(card_addr)); ldr(rscratch1, queue_index); cbz(rscratch1, runtime); @@ -3971,6 +3988,9 @@ void MacroAssembler::adrp(Register reg1, const Address &dest, unsigned long &byt long offset_low = dest_page - low_page; long offset_high = dest_page - high_page; + assert(is_valid_AArch64_address(dest.target()), "bad address"); + assert(dest.getMode() == Address::literal, "ADRP must be applied to a literal address"); + InstructionMark im(this); code_section()->relocate(inst_mark(), dest.rspec()); // 8143067: Ensure that the adrp can reach the dest from anywhere within @@ -3982,11 +4002,26 @@ void MacroAssembler::adrp(Register reg1, const Address &dest, unsigned long &byt long offset = dest_page - pc_page; offset = (offset & ((1<<20)-1)) << 12; _adrp(reg1, pc()+offset); - movk(reg1, ((unsigned long)dest.target() >> 32) & 0xffff, 32); + movk(reg1, (unsigned long)dest.target() >> 32, 32); } byte_offset = (unsigned long)dest.target() & 0xfff; } +void MacroAssembler::load_byte_map_base(Register reg) { + jbyte *byte_map_base = + ((CardTableModRefBS*)(Universe::heap()->barrier_set()))->byte_map_base; + + if (is_valid_AArch64_address((address)byte_map_base)) { + // Strictly speaking the byte_map_base isn't an address at all, + // and it might even be negative. + unsigned long offset; + adrp(reg, ExternalAddress((address)byte_map_base), offset); + assert(offset == 0, "misaligned card table base"); + } else { + mov(reg, (uint64_t)byte_map_base); + } +} + void MacroAssembler::build_frame(int framesize) { assert(framesize > 0, "framesize must be > 0"); if (framesize < ((1 << 9) + 2 * wordSize)) { diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp index 99afc3b5522..4256d3a0989 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp @@ -437,6 +437,13 @@ public: void push(RegSet regs, Register stack) { if (regs.bits()) push(regs.bits(), stack); } void pop(RegSet regs, Register stack) { if (regs.bits()) pop(regs.bits(), stack); } + // Push and pop everything that might be clobbered by a native + // runtime call except rscratch1 and rscratch2. (They are always + // scratch, so we don't have to protect them.) Only save the lower + // 64 bits of each vector register. + void push_call_clobbered_registers(); + void pop_call_clobbered_registers(); + // now mov instructions for loading absolute addresses and 32 or // 64 bit integers @@ -1116,6 +1123,15 @@ public: // of your data. Address form_address(Register Rd, Register base, long byte_offset, int shift); + // Return true iff an address is within the 48-bit AArch64 address + // space. + bool is_valid_AArch64_address(address a) { + return ((uint64_t)a >> 48) == 0; + } + + // Load the base of the cardtable byte map into reg. + void load_byte_map_base(Register reg); + // Prolog generator routines to support switch between x86 code and // generated ARM code diff --git a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp index 32e92a99e7d..6d8042f604a 100644 --- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp @@ -744,7 +744,7 @@ class StubGenerator: public StubCodeGenerator { __ sub(end, end, start); // number of bytes to copy const Register count = end; // 'end' register contains bytes count now - __ mov(scratch, (address)ct->byte_map_base); + __ load_byte_map_base(scratch); __ add(start, start, scratch); if (UseConcMarkSweepGC) { __ membar(__ StoreStore); From fdb6716fd468781c8c3f4b7a6a4abbb19de30b17 Mon Sep 17 00:00:00 2001 From: Roland Schatz Date: Mon, 18 Jan 2016 17:31:14 +0100 Subject: [PATCH 093/212] 8147564: [JVMCI] remove unused method CodeCacheProvider.needsDataPatch Reviewed-by: twisti --- .../src/jdk/vm/ci/code/CodeCacheProvider.java | 7 ------- .../src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java | 4 ---- 2 files changed, 11 deletions(-) diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java index e4f3cae3bee..2beba7907df 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java @@ -27,7 +27,6 @@ import jdk.vm.ci.code.CompilationResult.DataPatch; import jdk.vm.ci.code.CompilationResult.Mark; import jdk.vm.ci.code.DataSection.Data; import jdk.vm.ci.meta.Constant; -import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.SpeculationLog; @@ -121,12 +120,6 @@ public interface CodeCacheProvider { */ int getMinimumOutgoingSize(); - /** - * Determines if a {@link DataPatch} should be created for a given primitive constant that is - * part of a {@link CompilationResult}. A data patch is always created for an object constant. - */ - boolean needsDataPatch(JavaConstant constant); - /** * Create a {@link Data} item for one or more {@link Constant Constants}, that can be used in a * {@link DataPatch}. If more than one {@link Constant} is given, then they are tightly packed diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java index 6f9770a5c2d..ff83c14c31a 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java @@ -173,10 +173,6 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider { runtime.getCompilerToVM().invalidateInstalledCode(installedCode); } - public boolean needsDataPatch(JavaConstant constant) { - return constant instanceof HotSpotMetaspaceConstant; - } - private Data createSingleDataItem(Constant constant) { int size; DataBuilder builder; From 7366cfb6d21e731ec4f40d3e12c4592411ba6248 Mon Sep 17 00:00:00 2001 From: Andreas Eriksson Date: Tue, 19 Jan 2016 10:02:22 +0100 Subject: [PATCH 094/212] 8129419: heapDumper.cpp: assert(length_in_bytes > 0) failed: nothing to copy Reviewed-by: dsamersoff --- hotspot/src/os/solaris/vm/os_solaris.cpp | 2 - hotspot/src/share/vm/services/heapDumper.cpp | 105 +++++++++---------- 2 files changed, 52 insertions(+), 55 deletions(-) diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 12784f90785..2e62bb48af9 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -5667,8 +5667,6 @@ bool os::is_headless_jre() { size_t os::write(int fd, const void *buf, unsigned int nBytes) { size_t res; - assert(((JavaThread*)Thread::current())->thread_state() == _thread_in_native, - "Assumed _thread_in_native"); RESTARTABLE((size_t) ::write(fd, buf, (size_t) nBytes), res); return res; } diff --git a/hotspot/src/share/vm/services/heapDumper.cpp b/hotspot/src/share/vm/services/heapDumper.cpp index a956ee870b1..2f01fab4cc9 100644 --- a/hotspot/src/share/vm/services/heapDumper.cpp +++ b/hotspot/src/share/vm/services/heapDumper.cpp @@ -379,11 +379,11 @@ class DumpWriter : public StackObj { }; int _fd; // file descriptor (-1 if dump file not open) - jlong _bytes_written; // number of byte written to dump file + julong _bytes_written; // number of byte written to dump file char* _buffer; // internal buffer - int _size; - int _pos; + size_t _size; + size_t _pos; char* _error; // error message when I/O fails @@ -391,14 +391,14 @@ class DumpWriter : public StackObj { int file_descriptor() const { return _fd; } char* buffer() const { return _buffer; } - int buffer_size() const { return _size; } - int position() const { return _pos; } - void set_position(int pos) { _pos = pos; } + size_t buffer_size() const { return _size; } + size_t position() const { return _pos; } + void set_position(size_t pos) { _pos = pos; } void set_error(const char* error) { _error = (char*)os::strdup(error); } // all I/O go through this function - void write_internal(void* s, int len); + void write_internal(void* s, size_t len); public: DumpWriter(const char* path); @@ -409,14 +409,14 @@ class DumpWriter : public StackObj { void flush(); // total number of bytes written to the disk - jlong bytes_written() const { return _bytes_written; } + julong bytes_written() const { return _bytes_written; } // adjust the number of bytes written to disk (used to keep the count // of the number of bytes written in case of rewrites) - void adjust_bytes_written(jlong n) { _bytes_written += n; } + void adjust_bytes_written(jlong n) { _bytes_written += n; } // number of (buffered) bytes as yet unwritten to the dump file - jlong bytes_unwritten() const { return (jlong)position(); } + size_t bytes_unwritten() const { return position(); } char* error() const { return _error; } @@ -424,7 +424,7 @@ class DumpWriter : public StackObj { void seek_to_offset(jlong pos); // writer functions - void write_raw(void* s, int len); + void write_raw(void* s, size_t len); void write_u1(u1 x) { write_raw((void*)&x, 1); } void write_u2(u2 x); void write_u4(u4 x); @@ -471,35 +471,40 @@ void DumpWriter::close() { // flush and close dump file if (is_open()) { flush(); - ::close(file_descriptor()); + os::close(file_descriptor()); set_file_descriptor(-1); } } // write directly to the file -void DumpWriter::write_internal(void* s, int len) { +void DumpWriter::write_internal(void* s, size_t len) { if (is_open()) { - int n = ::write(file_descriptor(), s, len); - if (n > 0) { - _bytes_written += n; - } - if (n != len) { + const char* pos = (char*)s; + ssize_t n = 0; + while (len > 0) { + uint tmp = (uint)MIN2(len, (size_t)UINT_MAX); + n = os::write(file_descriptor(), pos, tmp); + if (n < 0) { + // EINTR cannot happen here, os::write will take care of that set_error(strerror(errno)); - } else { - set_error("file size limit"); + os::close(file_descriptor()); + set_file_descriptor(-1); + return; } - ::close(file_descriptor()); - set_file_descriptor(-1); + + _bytes_written += n; + pos += n; + len -= n; } } } // write raw bytes -void DumpWriter::write_raw(void* s, int len) { +void DumpWriter::write_raw(void* s, size_t len) { if (is_open()) { - // flush buffer to make toom - if ((position()+ len) >= buffer_size()) { + // flush buffer to make room + if ((position() + len) >= buffer_size()) { flush(); } @@ -522,13 +527,12 @@ void DumpWriter::flush() { } } - jlong DumpWriter::current_offset() { if (is_open()) { // the offset is the file offset plus whatever we have buffered jlong offset = os::current_file_offset(file_descriptor()); assert(offset >= 0, "lseek failed"); - return offset + (jlong)position(); + return offset + position(); } else { return (jlong)-1; } @@ -777,7 +781,7 @@ u4 DumperSupport::instance_size(Klass* k) { HandleMark hm; instanceKlassHandle ikh = instanceKlassHandle(Thread::current(), k); - int size = 0; + u4 size = 0; for (FieldStream fld(ikh, false, false); !fld.eos(); fld.next()) { if (!fld.access_flags().is_static()) { @@ -802,7 +806,7 @@ u4 DumperSupport::instance_size(Klass* k) { } } } - return (u4)size; + return size; } // dumps static fields of the given class @@ -1039,8 +1043,7 @@ void DumperSupport::dump_prim_array(DumpWriter* writer, typeArrayOop array) { } // If the byte ordering is big endian then we can copy most types directly - int length_in_bytes = array->length() * type2aelembytes(type); - assert(length_in_bytes > 0, "nothing to copy"); + u4 length_in_bytes = (u4)array->length() * type2aelembytes(type); switch (type) { case T_INT : { @@ -1293,22 +1296,18 @@ void HeapObjectDumper::do_object(oop o) { } } - // create a HPROF_GC_INSTANCE record for each object if (o->is_instance()) { + // create a HPROF_GC_INSTANCE record for each object DumperSupport::dump_instance(writer(), o); mark_end_of_record(); - } else { + } else if (o->is_objArray()) { // create a HPROF_GC_OBJ_ARRAY_DUMP record for each object array - if (o->is_objArray()) { - DumperSupport::dump_object_array(writer(), objArrayOop(o)); - mark_end_of_record(); - } else { - // create a HPROF_GC_PRIM_ARRAY_DUMP record for each type array - if (o->is_typeArray()) { - DumperSupport::dump_prim_array(writer(), typeArrayOop(o)); - mark_end_of_record(); - } - } + DumperSupport::dump_object_array(writer(), objArrayOop(o)); + mark_end_of_record(); + } else if (o->is_typeArray()) { + // create a HPROF_GC_PRIM_ARRAY_DUMP record for each type array + DumperSupport::dump_prim_array(writer(), typeArrayOop(o)); + mark_end_of_record(); } } @@ -1456,11 +1455,11 @@ void VM_HeapDumper::write_current_dump_record_length() { assert(dump_start() >= 0, "no dump start recorded"); // calculate the size of the dump record - jlong dump_end = writer()->current_offset(); - jlong dump_len = (dump_end - dump_start() - 4); + julong dump_end = writer()->current_offset(); + julong dump_len = (dump_end - dump_start() - 4); // record length must fit in a u4 - if (dump_len > (jlong)(4L*(jlong)G)) { + if (dump_len > max_juint) { warning("record is too large"); } @@ -1469,7 +1468,7 @@ void VM_HeapDumper::write_current_dump_record_length() { writer()->write_u4((u4)dump_len); // adjust the total size written to keep the bytes written correct. - writer()->adjust_bytes_written(-((long) sizeof(u4))); + writer()->adjust_bytes_written(-((jlong) sizeof(u4))); // seek to dump end so we can continue writer()->seek_to_offset(dump_end); @@ -1485,12 +1484,12 @@ void VM_HeapDumper::check_segment_length() { if (writer()->is_open()) { if (is_segmented_dump()) { // don't use current_offset that would be too expensive on a per record basis - jlong dump_end = writer()->bytes_written() + writer()->bytes_unwritten(); - assert(dump_end == writer()->current_offset(), "checking"); - jlong dump_len = (dump_end - dump_start() - 4); - assert(dump_len >= 0 && dump_len <= max_juint, "bad dump length"); + julong dump_end = writer()->bytes_written() + writer()->bytes_unwritten(); + assert(dump_end == (julong)writer()->current_offset(), "checking"); + julong dump_len = (dump_end - dump_start() - 4); + assert(dump_len <= max_juint, "bad dump length"); - if (dump_len > (jlong)HeapDumpSegmentSize) { + if (dump_len > HeapDumpSegmentSize) { write_current_dump_record_length(); write_dump_header(); } @@ -1887,7 +1886,7 @@ int HeapDumper::dump(const char* path) { if (print_to_tty()) { timer()->stop(); if (error() == NULL) { - tty->print_cr("Heap dump file created [" JLONG_FORMAT " bytes in %3.3f secs]", + tty->print_cr("Heap dump file created [" JULONG_FORMAT " bytes in %3.3f secs]", writer.bytes_written(), timer()->seconds()); } else { tty->print_cr("Dump file is incomplete: %s", writer.error()); From f646b9fac7b35d609d38b0b97ddddc8ba53f761f Mon Sep 17 00:00:00 2001 From: Erik Helin Date: Tue, 19 Jan 2016 11:00:29 +0100 Subject: [PATCH 095/212] 8147012: Fix includes in internalVMTests.cpp Reviewed-by: stefank, mgerdin --- hotspot/src/share/vm/classfile/altHashing.cpp | 4 ++ .../share/vm/compiler/directivesParser.cpp | 6 ++- .../share/vm/compiler/directivesParser.hpp | 2 +- .../src/share/vm/gc/shared/collectedHeap.cpp | 4 ++ hotspot/src/share/vm/gc/shared/gcTimer.cpp | 2 +- hotspot/src/share/vm/gc/shared/gcTimer.hpp | 12 ----- hotspot/src/share/vm/memory/guardedMemory.cpp | 4 ++ hotspot/src/share/vm/oops/arrayOop.cpp | 27 +++++----- hotspot/src/share/vm/oops/arrayOop.hpp | 2 - .../src/share/vm/runtime/objectMonitor.cpp | 4 ++ hotspot/src/share/vm/runtime/vmStructs.cpp | 4 ++ .../share/vm/utilities/globalDefinitions.cpp | 9 ++++ .../share/vm/utilities/globalDefinitions.hpp | 10 ---- .../share/vm/utilities/internalVMTests.cpp | 52 ++++++++++--------- hotspot/src/share/vm/utilities/json.cpp | 22 ++++++-- hotspot/src/share/vm/utilities/json.hpp | 16 ------ hotspot/src/share/vm/utilities/quickSort.cpp | 17 +++--- hotspot/src/share/vm/utilities/quickSort.hpp | 8 --- 18 files changed, 104 insertions(+), 101 deletions(-) diff --git a/hotspot/src/share/vm/classfile/altHashing.cpp b/hotspot/src/share/vm/classfile/altHashing.cpp index efa3edb2ca9..326351a6637 100644 --- a/hotspot/src/share/vm/classfile/altHashing.cpp +++ b/hotspot/src/share/vm/classfile/altHashing.cpp @@ -300,4 +300,8 @@ void AltHashing::test_alt_hash() { testMurmur3_32_ByteArray(); testEquivalentHashes(); } + +void AltHashing_test() { + AltHashing::test_alt_hash(); +} #endif // PRODUCT diff --git a/hotspot/src/share/vm/compiler/directivesParser.cpp b/hotspot/src/share/vm/compiler/directivesParser.cpp index 16720ceb4db..4847e228160 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.cpp +++ b/hotspot/src/share/vm/compiler/directivesParser.cpp @@ -608,7 +608,7 @@ void DirectivesParser::test(const char* text, bool should_pass) { cd.clean_tmp(); } -bool DirectivesParser::test() { +void DirectivesParser::test() { DirectivesParser::test("{}", false); DirectivesParser::test("[]", true); DirectivesParser::test("[{}]", false); @@ -742,8 +742,10 @@ bool DirectivesParser::test() { " }" "\n" " }" "\n" "]" "\n", false); +} - return true; +void DirectivesParser_test() { + DirectivesParser::test(); } #endif diff --git a/hotspot/src/share/vm/compiler/directivesParser.hpp b/hotspot/src/share/vm/compiler/directivesParser.hpp index d0d7eb31388..f62630f7d56 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.hpp +++ b/hotspot/src/share/vm/compiler/directivesParser.hpp @@ -136,7 +136,7 @@ private: #ifndef PRODUCT static void test(const char* json, bool valid); public: - static bool test(); + static void test(); #endif }; diff --git a/hotspot/src/share/vm/gc/shared/collectedHeap.cpp b/hotspot/src/share/vm/gc/shared/collectedHeap.cpp index d0fb006d2ed..b4055f67e57 100644 --- a/hotspot/src/share/vm/gc/shared/collectedHeap.cpp +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.cpp @@ -630,4 +630,8 @@ void CollectedHeap::test_is_in() { assert(!heap->is_in(after_heap), "after_heap: " PTR_FORMAT " is unexpectedly in the heap", p2i(after_heap)); } + +void CollectedHeap_test() { + CollectedHeap::test_is_in(); +} #endif diff --git a/hotspot/src/share/vm/gc/shared/gcTimer.cpp b/hotspot/src/share/vm/gc/shared/gcTimer.cpp index 29b19e4679a..a13e7a8c5dd 100644 --- a/hotspot/src/share/vm/gc/shared/gcTimer.cpp +++ b/hotspot/src/share/vm/gc/shared/gcTimer.cpp @@ -388,7 +388,7 @@ public: } }; -void GCTimerAllTest::all() { +void GCTimer_test() { GCTimerTest::all(); TimePartitionPhasesIteratorTest::all(); } diff --git a/hotspot/src/share/vm/gc/shared/gcTimer.hpp b/hotspot/src/share/vm/gc/shared/gcTimer.hpp index d520dab8714..0ed30b010d2 100644 --- a/hotspot/src/share/vm/gc/shared/gcTimer.hpp +++ b/hotspot/src/share/vm/gc/shared/gcTimer.hpp @@ -185,16 +185,4 @@ class TimePartitionPhasesIterator { virtual GCPhase* next(); }; - -/////////////// Unit tests /////////////// - -#ifndef PRODUCT - -class GCTimerAllTest { - public: - static void all(); -}; - -#endif - #endif // SHARE_VM_GC_SHARED_GCTIMER_HPP diff --git a/hotspot/src/share/vm/memory/guardedMemory.cpp b/hotspot/src/share/vm/memory/guardedMemory.cpp index 763548fd35d..d40f3b84319 100644 --- a/hotspot/src/share/vm/memory/guardedMemory.cpp +++ b/hotspot/src/share/vm/memory/guardedMemory.cpp @@ -157,5 +157,9 @@ void GuardedMemory::test_guarded_memory() { assert(GuardedMemory::free_copy(no_data_copy), "Expected valid guards even for no data copy"); } +void GuardedMemory_test() { + GuardedMemory::test_guarded_memory(); +} + #endif // !PRODUCT diff --git a/hotspot/src/share/vm/oops/arrayOop.cpp b/hotspot/src/share/vm/oops/arrayOop.cpp index ee94c91f24a..cd9ffcd8529 100644 --- a/hotspot/src/share/vm/oops/arrayOop.cpp +++ b/hotspot/src/share/vm/oops/arrayOop.cpp @@ -39,21 +39,24 @@ bool arrayOopDesc::check_max_length_overflow(BasicType type) { return (julong)(size_t)bytes == bytes; } -void arrayOopDesc::test_max_array_length() { - assert(check_max_length_overflow(T_BOOLEAN), "size_t overflow for boolean array"); - assert(check_max_length_overflow(T_CHAR), "size_t overflow for char array"); - assert(check_max_length_overflow(T_FLOAT), "size_t overflow for float array"); - assert(check_max_length_overflow(T_DOUBLE), "size_t overflow for double array"); - assert(check_max_length_overflow(T_BYTE), "size_t overflow for byte array"); - assert(check_max_length_overflow(T_SHORT), "size_t overflow for short array"); - assert(check_max_length_overflow(T_INT), "size_t overflow for int array"); - assert(check_max_length_overflow(T_LONG), "size_t overflow for long array"); - assert(check_max_length_overflow(T_OBJECT), "size_t overflow for object array"); - assert(check_max_length_overflow(T_ARRAY), "size_t overflow for array array"); - assert(check_max_length_overflow(T_NARROWOOP), "size_t overflow for narrowOop array"); +static void test_max_array_length() { + assert(arrayOopDesc::check_max_length_overflow(T_BOOLEAN), "size_t overflow for boolean array"); + assert(arrayOopDesc::check_max_length_overflow(T_CHAR), "size_t overflow for char array"); + assert(arrayOopDesc::check_max_length_overflow(T_FLOAT), "size_t overflow for float array"); + assert(arrayOopDesc::check_max_length_overflow(T_DOUBLE), "size_t overflow for double array"); + assert(arrayOopDesc::check_max_length_overflow(T_BYTE), "size_t overflow for byte array"); + assert(arrayOopDesc::check_max_length_overflow(T_SHORT), "size_t overflow for short array"); + assert(arrayOopDesc::check_max_length_overflow(T_INT), "size_t overflow for int array"); + assert(arrayOopDesc::check_max_length_overflow(T_LONG), "size_t overflow for long array"); + assert(arrayOopDesc::check_max_length_overflow(T_OBJECT), "size_t overflow for object array"); + assert(arrayOopDesc::check_max_length_overflow(T_ARRAY), "size_t overflow for array array"); + assert(arrayOopDesc::check_max_length_overflow(T_NARROWOOP), "size_t overflow for narrowOop array"); // T_VOID and T_ADDRESS are not supported by max_array_length() } +void arrayOopDesc_test() { + test_max_array_length(); +} #endif //PRODUCT diff --git a/hotspot/src/share/vm/oops/arrayOop.hpp b/hotspot/src/share/vm/oops/arrayOop.hpp index 0cc8f2e448d..8e9c2af6c8a 100644 --- a/hotspot/src/share/vm/oops/arrayOop.hpp +++ b/hotspot/src/share/vm/oops/arrayOop.hpp @@ -127,8 +127,6 @@ class arrayOopDesc : public oopDesc { // for unit testing #ifndef PRODUCT static bool check_max_length_overflow(BasicType type); - static int32_t old_max_array_length(BasicType type); - static void test_max_array_length(); #endif }; diff --git a/hotspot/src/share/vm/runtime/objectMonitor.cpp b/hotspot/src/share/vm/runtime/objectMonitor.cpp index 93b051b4e58..2f7937d4f3e 100644 --- a/hotspot/src/share/vm/runtime/objectMonitor.cpp +++ b/hotspot/src/share/vm/runtime/objectMonitor.cpp @@ -2470,4 +2470,8 @@ void ObjectMonitor::verify() { void ObjectMonitor::print() { } + +void ObjectMonitor_test() { + ObjectMonitor::sanity_checks(); +} #endif diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index ede188dcc1e..887b2b906f5 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -3496,4 +3496,8 @@ void VMStructs::test() { } } } + +void VMStructs_test() { + VMStructs::test(); +} #endif diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.cpp b/hotspot/src/share/vm/utilities/globalDefinitions.cpp index 8f8f3865c5a..1491be7091e 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.cpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.cpp @@ -357,6 +357,11 @@ size_t lcm(size_t a, size_t b) { } #ifndef PRODUCT +// For unit testing only +class GlobalDefinitions { +public: + static void test_globals(); +}; void GlobalDefinitions::test_globals() { intptr_t page_sizes[] = { os::vm_page_size(), 4096, 8192, 65536, 2*1024*1024 }; @@ -384,4 +389,8 @@ void GlobalDefinitions::test_globals() { } } +void GlobalDefinitions_test() { + GlobalDefinitions::test_globals(); +} + #endif // PRODUCT diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index 53431e8a6b3..d5c2f20cfad 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -1452,14 +1452,4 @@ static inline void* dereference_vptr(const void* addr) { return *(void**)addr; } -#ifndef PRODUCT - -// For unit testing only -class GlobalDefinitions { -public: - static void test_globals(); -}; - -#endif // PRODUCT - #endif // SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP diff --git a/hotspot/src/share/vm/utilities/internalVMTests.cpp b/hotspot/src/share/vm/utilities/internalVMTests.cpp index 0b34edcb6d3..9b7395e3514 100644 --- a/hotspot/src/share/vm/utilities/internalVMTests.cpp +++ b/hotspot/src/share/vm/utilities/internalVMTests.cpp @@ -26,22 +26,9 @@ #ifndef PRODUCT -#include "classfile/altHashing.hpp" -#include "compiler/directivesParser.hpp" -#include "gc/shared/collectedHeap.hpp" -#include "gc/shared/gcTimer.hpp" -#include "memory/guardedMemory.hpp" #include "utilities/internalVMTests.hpp" -#include "utilities/json.hpp" #include "utilities/macros.hpp" #include "utilities/ostream.hpp" -#include "utilities/quickSort.hpp" -#if INCLUDE_ALL_GCS -#include "gc/g1/heapRegionRemSet.hpp" -#endif -#if INCLUDE_VM_STRUCTS -#include "runtime/vmStructs.hpp" -#endif #define run_unit_test(unit_test_function_call) \ tty->print_cr("Running test: " #unit_test_function_call); \ @@ -67,6 +54,21 @@ void TestResourcehash_test(); void TestChunkedList_test(); void Test_log_length(); void Test_TempNewSymbol(); +void GlobalDefinitions_test(); +void GCTimer_test(); +void arrayOopDesc_test(); +void CollectedHeap_test(); +void QuickSort_test(); +void GuardedMemory_test(); +void AltHashing_test(); +void ObjectMonitor_test(); +void JSON_test(); +void DirectivesParser_test(); + +#if INCLUDE_VM_STRUCTS +void VMStructs_test(); +#endif + #if INCLUDE_ALL_GCS void TestOldFreeSpaceCalculation_test(); void TestG1BiasedArray_test(); @@ -74,7 +76,7 @@ void TestBufferingOopClosure_test(); void TestCodeCacheRemSet_test(); void FreeRegionList_test(); void IHOP_test(); -void test_memset_with_concurrent_readers() NOT_DEBUG_RETURN; +void test_memset_with_concurrent_readers(); void TestPredictions_test(); void WorkerDataArray_test(); #endif @@ -90,28 +92,28 @@ void InternalVMTests::run() { run_unit_test(TestMetaspaceAux_test()); run_unit_test(TestMetachunk_test()); run_unit_test(TestVirtualSpaceNode_test()); - run_unit_test(GlobalDefinitions::test_globals()); - run_unit_test(GCTimerAllTest::all()); - run_unit_test(arrayOopDesc::test_max_array_length()); - run_unit_test(CollectedHeap::test_is_in()); - run_unit_test(QuickSort::test_quick_sort()); - run_unit_test(GuardedMemory::test_guarded_memory()); - run_unit_test(AltHashing::test_alt_hash()); + run_unit_test(GlobalDefinitions_test()); + run_unit_test(GCTimer_test()); + run_unit_test(arrayOopDesc_test()); + run_unit_test(CollectedHeap_test()); + run_unit_test(QuickSort_test()); + run_unit_test(GuardedMemory_test()); + run_unit_test(AltHashing_test()); run_unit_test(TestNewSize_test()); run_unit_test(TestOldSize_test()); run_unit_test(TestKlass_test()); run_unit_test(TestBitMap_test()); run_unit_test(TestAsUtf8()); run_unit_test(TestResourcehash_test()); - run_unit_test(ObjectMonitor::sanity_checks()); + run_unit_test(ObjectMonitor_test()); run_unit_test(Test_linked_list()); run_unit_test(TestChunkedList_test()); - run_unit_test(JSONTest::test()); + run_unit_test(JSON_test()); run_unit_test(Test_log_length()); - run_unit_test(DirectivesParser::test()); + run_unit_test(DirectivesParser_test()); run_unit_test(Test_TempNewSymbol()); #if INCLUDE_VM_STRUCTS - run_unit_test(VMStructs::test()); + run_unit_test(VMStructs_test()); #endif #if INCLUDE_ALL_GCS run_unit_test(TestOldFreeSpaceCalculation_test()); diff --git a/hotspot/src/share/vm/utilities/json.cpp b/hotspot/src/share/vm/utilities/json.cpp index 2064bb81e7a..cb3bf391006 100644 --- a/hotspot/src/share/vm/utilities/json.cpp +++ b/hotspot/src/share/vm/utilities/json.cpp @@ -687,6 +687,24 @@ void JSON::error(JSON_ERROR e, const char* format, ...) { } #ifndef PRODUCT +class JSONTest : public JSON { + public: + static void test(); + + private: + JSONTest(const char* text); + static void test(const char* json, bool valid); + + void log(uint level, const char* format, ...) ATTRIBUTE_PRINTF(3, 4); + + bool callback(JSON_TYPE t, JSON_VAL* v, uint level); + JSON_TYPE prev; +}; + +void JSON_test() { + JSONTest::test(); +} + void JSONTest::test(const char* text, bool should_pass) { JSONTest json(text); if (should_pass) { @@ -707,7 +725,7 @@ JSONTest::JSONTest(const char* text) : JSON(text, !VerboseInternalVMTests, tty) parse(); } -bool JSONTest::test() { +void JSONTest::test() { JSONTest::test("{}", true); JSONTest::test("[]", true); JSONTest::test(" { } ", true); @@ -842,8 +860,6 @@ bool JSONTest::test() { " blocking_compile: true" "\n" " }," "\n" "]" "\n", true); - - return true; } void JSONTest::log(uint indent, const char* format, ...) { diff --git a/hotspot/src/share/vm/utilities/json.hpp b/hotspot/src/share/vm/utilities/json.hpp index b22eb427557..7106990ce34 100644 --- a/hotspot/src/share/vm/utilities/json.hpp +++ b/hotspot/src/share/vm/utilities/json.hpp @@ -108,20 +108,4 @@ class JSON : public ResourceObj { const char* strerror(JSON_ERROR e); }; -#ifndef PRODUCT -class JSONTest : public JSON { - public: - static bool test(); - - private: - JSONTest(const char* text); - static void test(const char* json, bool valid); - - void log(uint level, const char* format, ...) ATTRIBUTE_PRINTF(3, 4); - - bool callback(JSON_TYPE t, JSON_VAL* v, uint level); - JSON_TYPE prev; -}; -#endif - #endif // SHARE_VM_UTILITIES_JSON_HPP diff --git a/hotspot/src/share/vm/utilities/quickSort.cpp b/hotspot/src/share/vm/utilities/quickSort.cpp index 523b169b3c3..ebe399ee1b3 100644 --- a/hotspot/src/share/vm/utilities/quickSort.cpp +++ b/hotspot/src/share/vm/utilities/quickSort.cpp @@ -72,7 +72,7 @@ extern "C" { } } -void QuickSort::print_array(const char* prefix, int* array, int length) { +static void print_array(const char* prefix, int* array, int length) { tty->print("%s:", prefix); for (int i = 0; i < length; i++) { tty->print(" %d", array[i]); @@ -80,7 +80,7 @@ void QuickSort::print_array(const char* prefix, int* array, int length) { tty->cr(); } -bool QuickSort::compare_arrays(int* actual, int* expected, int length) { +static bool compare_arrays(int* actual, int* expected, int length) { for (int i = 0; i < length; i++) { if (actual[i] != expected[i]) { print_array("Sorted array ", actual, length); @@ -92,12 +92,12 @@ bool QuickSort::compare_arrays(int* actual, int* expected, int length) { } template -bool QuickSort::sort_and_compare(int* arrayToSort, int* expectedResult, int length, C comparator, bool idempotent) { - sort(arrayToSort, length, comparator, idempotent); +static bool sort_and_compare(int* arrayToSort, int* expectedResult, int length, C comparator, bool idempotent = false) { + QuickSort::sort(arrayToSort, length, comparator, idempotent); return compare_arrays(arrayToSort, expectedResult, length); } -void QuickSort::test_quick_sort() { +void QuickSort_test() { { int* test_array = NULL; int* expected_array = NULL; @@ -208,15 +208,14 @@ void QuickSort::test_quick_sort() { // Now sort them once with the test_even_odd_comparator. Then sort the // test_array one more time with test_even_odd_comparator and verify that // it is idempotent. - sort(expected_array, length, test_even_odd_comparator, true); - sort(test_array, length, test_even_odd_comparator, true); + QuickSort::sort(expected_array, length, test_even_odd_comparator, true); + QuickSort::sort(test_array, length, test_even_odd_comparator, true); assert(compare_arrays(test_array, expected_array, length), "Sorting identical arrays rendered different results"); - sort(test_array, length, test_even_odd_comparator, true); + QuickSort::sort(test_array, length, test_even_odd_comparator, true); assert(compare_arrays(test_array, expected_array, length), "Sorting already sorted array changed order of elements - not idempotent"); FREE_C_HEAP_ARRAY(int, test_array); FREE_C_HEAP_ARRAY(int, expected_array); } } - #endif diff --git a/hotspot/src/share/vm/utilities/quickSort.hpp b/hotspot/src/share/vm/utilities/quickSort.hpp index ba131aad652..0f2084ac68a 100644 --- a/hotspot/src/share/vm/utilities/quickSort.hpp +++ b/hotspot/src/share/vm/utilities/quickSort.hpp @@ -124,14 +124,6 @@ class QuickSort : AllStatic { inner_sort(array, length, comparator); } } - - // for unit testing -#ifndef PRODUCT - static void print_array(const char* prefix, int* array, int length); - static bool compare_arrays(int* actual, int* expected, int length); - template static bool sort_and_compare(int* arrayToSort, int* expectedResult, int length, C comparator, bool idempotent = false); - static void test_quick_sort(); -#endif }; From ae7f8632ce54fb5f15c199e66a6e806c504c7a6d Mon Sep 17 00:00:00 2001 From: Frederic Parain Date: Tue, 19 Jan 2016 05:28:34 -0800 Subject: [PATCH 096/212] 8146751: jdk/test/tools/launcher/TooSmallStackSize.java failed on Mac OS Reviewed-by: dholmes, gtriantafill --- hotspot/src/os/bsd/vm/os_bsd.cpp | 2 +- hotspot/src/os/solaris/vm/os_solaris.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index 664bd02b904..ca2ec1b1d02 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -3481,7 +3481,7 @@ jint os::init_2(void) { os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed, JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size() + - 2*BytesPerWord COMPILER2_PRESENT(+1) * Bsd::page_size()); + (2*BytesPerWord COMPILER2_PRESENT(+1)) * Bsd::page_size()); size_t threadStackSizeInBytes = ThreadStackSize * K; if (threadStackSizeInBytes != 0 && diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 2e62bb48af9..ae008b6dbe9 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -4415,7 +4415,7 @@ jint os::init_2(void) { os::Solaris::min_stack_allowed = MAX2(os::Solaris::min_stack_allowed, JavaThread::stack_guard_zone_size() + JavaThread::stack_shadow_zone_size() + - 2*BytesPerWord COMPILER2_PRESENT(+1) * page_size); + (2*BytesPerWord COMPILER2_PRESENT(+1)) * page_size); size_t threadStackSizeInBytes = ThreadStackSize * K; if (threadStackSizeInBytes != 0 && From 84ae91a490a7981ce6dbae003d7d3249b5c90a27 Mon Sep 17 00:00:00 2001 From: Axel Siebenborn Date: Tue, 19 Jan 2016 09:39:28 +0100 Subject: [PATCH 097/212] 8147611: G1 - Missing memory barrier in start_cset_region_for_worker Reviewed-by: mgerdin, tschatzl --- hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index 51888ca0b2f..e2ecfaa24f5 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -2551,6 +2551,7 @@ HeapRegion* G1CollectedHeap::start_cset_region_for_worker(uint worker_i) { // Previous workers starting region is valid // so let's iterate from there start_ind = (cs_size * (worker_i - 1)) / active_workers; + OrderAccess::loadload(); result = _worker_cset_start_region[worker_i - 1]; } From 477c40e4ebcf8388bec0f3984a50cd5b6c065f7d Mon Sep 17 00:00:00 2001 From: Zoltan Majo Date: Thu, 28 Jan 2016 08:33:45 +0100 Subject: [PATCH 098/212] 8146478: Node limit exceeded with -XX:AllocateInstancePrefetchLines=1073741823 Constrain the set of accepted values for the Allocate{PrefetchLines, InstancePrefetchLines, PrefetchStepSize, PrefetchDistance} flags. Increase macro node expansion budget. Reviewed-by: kvn --- hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp | 7 --- hotspot/src/cpu/x86/vm/vm_version_x86.cpp | 11 ++--- hotspot/src/share/vm/opto/macro.cpp | 4 +- .../commandLineFlagConstraintsCompiler.cpp | 43 +++++++++++++------ hotspot/src/share/vm/runtime/globals.hpp | 6 +-- 5 files changed, 39 insertions(+), 32 deletions(-) diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index fe7ce4f315e..9a6679d17ab 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -45,13 +45,6 @@ void VM_Version::initialize() { if( cache_line_size > AllocatePrefetchStepSize ) AllocatePrefetchStepSize = cache_line_size; - assert(AllocatePrefetchLines > 0, "invalid value"); - if( AllocatePrefetchLines < 1 ) // set valid value in product VM - AllocatePrefetchLines = 3; - assert(AllocateInstancePrefetchLines > 0, "invalid value"); - if( AllocateInstancePrefetchLines < 1 ) // set valid value in product VM - AllocateInstancePrefetchLines = 1; - AllocatePrefetchDistance = allocate_prefetch_distance(); AllocatePrefetchStyle = allocate_prefetch_style(); diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index 8756b51e899..0bfd8e8f3e0 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -1163,13 +1163,6 @@ void VM_Version::get_processor_features() { if( cache_line_size > AllocatePrefetchStepSize ) AllocatePrefetchStepSize = cache_line_size; - assert(AllocatePrefetchLines > 0, "invalid value"); - if( AllocatePrefetchLines < 1 ) // set valid value in product VM - AllocatePrefetchLines = 3; - assert(AllocateInstancePrefetchLines > 0, "invalid value"); - if( AllocateInstancePrefetchLines < 1 ) // set valid value in product VM - AllocateInstancePrefetchLines = 1; - AllocatePrefetchDistance = allocate_prefetch_distance(); AllocatePrefetchStyle = allocate_prefetch_style(); @@ -1183,7 +1176,9 @@ void VM_Version::get_processor_features() { } if (supports_sse4_2() && supports_ht()) { // Nehalem based cpus AllocatePrefetchDistance = 192; - AllocatePrefetchLines = 4; + if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) { + FLAG_SET_DEFAULT(AllocatePrefetchLines, 4); + } } #ifdef COMPILER2 if (supports_sse4_2()) { diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp index 80584956ffb..06f443b3fe7 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -2654,9 +2654,9 @@ bool PhaseMacroExpand::expand_macro_nodes() { eliminate_macro_nodes(); // Make sure expansion will not cause node limit to be exceeded. - // Worst case is a macro node gets expanded into about 50 nodes. + // Worst case is a macro node gets expanded into about 200 nodes. // Allow 50% more for optimization. - if (C->check_node_count(C->macro_count() * 75, "out of nodes before macro expansion" ) ) + if (C->check_node_count(C->macro_count() * 300, "out of nodes before macro expansion" ) ) return true; // Eliminate Opaque and LoopLimit nodes. Do it after all loop optimizations. diff --git a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp index 575531754b2..1484cba01c8 100644 --- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp +++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp @@ -118,27 +118,46 @@ Flag::Error AllocatePrefetchInstrConstraintFunc(intx value, bool verbose) { } Flag::Error AllocatePrefetchStepSizeConstraintFunc(intx value, bool verbose) { - if (value < 1 || value > max_jint) { + intx max_value = 512; + if (value < 1 || value > max_value) { CommandLineError::print(verbose, "AllocatePrefetchStepSize (" INTX_FORMAT ") " "must be between 1 and %d\n", AllocatePrefetchStepSize, - max_jint); + max_value); return Flag::VIOLATES_CONSTRAINT; } if (AllocatePrefetchDistance % AllocatePrefetchStepSize != 0) { - CommandLineError::print(verbose, - "AllocatePrefetchDistance (" INTX_FORMAT ") " - "%% AllocatePrefetchStepSize (" INTX_FORMAT ") " - "= " INTX_FORMAT " " - "must be 0\n", - AllocatePrefetchDistance, AllocatePrefetchStepSize, - AllocatePrefetchDistance % AllocatePrefetchStepSize); - return Flag::VIOLATES_CONSTRAINT; - } + CommandLineError::print(verbose, + "AllocatePrefetchDistance (" INTX_FORMAT ") " + "%% AllocatePrefetchStepSize (" INTX_FORMAT ") " + "= " INTX_FORMAT " " + "must be 0\n", + AllocatePrefetchDistance, AllocatePrefetchStepSize, + AllocatePrefetchDistance % AllocatePrefetchStepSize); + return Flag::VIOLATES_CONSTRAINT; + } - return Flag::SUCCESS; + /* The limit of 64 for the quotient of AllocatePrefetchDistance and AllocatePrefetchSize + * originates from the limit of 64 for AllocatePrefetchLines/AllocateInstancePrefetchLines. + * If AllocatePrefetchStyle == 2, the quotient from above is used in PhaseMacroExpand::prefetch_allocation() + * to determine the number of lines to prefetch. For other values of AllocatePrefetchStyle, + * AllocatePrefetchDistance and AllocatePrefetchSize is used. For consistency, all these + * quantities must have the same limit (64 in this case). + */ + if (AllocatePrefetchDistance / AllocatePrefetchStepSize > 64) { + CommandLineError::print(verbose, + "AllocatePrefetchDistance (" INTX_FORMAT ") too large or " + "AllocatePrefetchStepSize (" INTX_FORMAT ") too small; " + "try decreasing/increasing values so that " + "AllocatePrefetchDistance / AllocatePrefetchStepSize <= 64\n", + AllocatePrefetchDistance, AllocatePrefetchStepSize, + AllocatePrefetchDistance % AllocatePrefetchStepSize); + return Flag::VIOLATES_CONSTRAINT; + } + + return Flag::SUCCESS; } Flag::Error CompileThresholdConstraintFunc(intx value, bool verbose) { diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 419d1e1a3f7..087ad78e717 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -2964,16 +2964,16 @@ public: \ product(intx, AllocatePrefetchLines, 3, \ "Number of lines to prefetch ahead of array allocation pointer") \ - range(1, max_jint / 2) \ + range(1, 64) \ \ product(intx, AllocateInstancePrefetchLines, 1, \ "Number of lines to prefetch ahead of instance allocation " \ "pointer") \ - range(1, max_jint / 2) \ + range(1, 64) \ \ product(intx, AllocatePrefetchStepSize, 16, \ "Step size in bytes of sequential prefetch instructions") \ - range(1, max_jint) \ + range(1, 512) \ constraint(AllocatePrefetchStepSizeConstraintFunc,AfterMemoryInit)\ \ product(intx, AllocatePrefetchInstr, 0, \ From c675914f1cd5ebaf52b9f7230f4e0ab6cce194d3 Mon Sep 17 00:00:00 2001 From: Felix Yang Date: Wed, 27 Jan 2016 12:20:53 +0800 Subject: [PATCH 099/212] 8148328: aarch64: redundant lsr instructions in stub code Avoid redundant lsr instructions in jbyte_arraycopy and jbyte_disjoint_arraycopy. Reviewed-by: aph --- hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp index 6d8042f604a..65abe139076 100644 --- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp @@ -962,7 +962,7 @@ class StubGenerator: public StubCodeGenerator { __ lea(d, Address(d, count, Address::lsl(exact_log2(-step)))); } - Label done, tail; + Label tail; __ cmp(count, 16/granularity); __ br(Assembler::LO, tail); @@ -987,7 +987,8 @@ class StubGenerator: public StubCodeGenerator { } // rscratch2 is the byte adjustment needed to align s. __ cbz(rscratch2, aligned); - __ lsr(rscratch2, rscratch2, exact_log2(granularity)); + int shift = exact_log2(granularity); + if (shift) __ lsr(rscratch2, rscratch2, shift); __ sub(count, count, rscratch2); #if 0 From ffbb39518cb3dd96bb1703b34c992c3eb7792743 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Fri, 29 Jan 2016 03:11:16 +0300 Subject: [PATCH 100/212] 8148012: get rid of slash-dot-dot in @library directives Reviewed-by: dholmes, dfazunen, cjplummer --- .../TestCompilerDirectivesCompatibilityBase.java | 2 +- .../TestCompilerDirectivesCompatibilityCommandOff.java | 2 +- .../TestCompilerDirectivesCompatibilityCommandOn.java | 2 +- .../TestCompilerDirectivesCompatibilityFlag.java | 2 +- .../compiler/compilercontrol/commandfile/CompileOnlyTest.java | 2 +- .../test/compiler/compilercontrol/commandfile/ExcludeTest.java | 2 +- hotspot/test/compiler/compilercontrol/commandfile/LogTest.java | 2 +- .../test/compiler/compilercontrol/commandfile/PrintTest.java | 2 +- .../test/compiler/compilercontrol/commands/CompileOnlyTest.java | 2 +- hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java | 2 +- hotspot/test/compiler/compilercontrol/commands/LogTest.java | 2 +- hotspot/test/compiler/compilercontrol/commands/PrintTest.java | 2 +- .../compiler/compilercontrol/directives/CompileOnlyTest.java | 2 +- .../test/compiler/compilercontrol/directives/ExcludeTest.java | 2 +- hotspot/test/compiler/compilercontrol/directives/LogTest.java | 2 +- hotspot/test/compiler/compilercontrol/directives/PrintTest.java | 2 +- .../test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java | 2 +- .../test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java | 2 +- hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java | 2 +- hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java | 2 +- .../compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java | 2 +- .../test/compiler/compilercontrol/mixed/RandomCommandsTest.java | 2 +- .../compiler/compilercontrol/mixed/RandomValidCommandsTest.java | 2 +- .../compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java | 2 +- .../compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java | 2 +- hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java | 2 +- .../intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java | 2 +- .../test/compiler/intrinsics/string/TestStringIntrinsics2.java | 2 +- hotspot/test/compiler/stable/TestStableMemoryBarrier.java | 2 +- .../compiler/types/TestMeetIncompatibleInterfaceArrays.java | 2 +- hotspot/test/gc/g1/TestPLABOutput.java | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) diff --git a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java index 9d01dac3243..283003afde6 100644 --- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java +++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityBase.java @@ -24,7 +24,7 @@ /* * @test TestCompilerDirectivesCompatibilityBase * @bug 8137167 - * @library /testlibrary /../../test/lib + * @library /testlibrary /test/lib * @modules java.base/sun.misc * java.compiler * java.management diff --git a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java index 948b3249356..a2922c8a2d9 100644 --- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java +++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOff.java @@ -24,7 +24,7 @@ /* * @test TestCompilerDirectivesCompatibilityCommandOff * @bug 8137167 - * @library /testlibrary /../../test/lib + * @library /testlibrary /test/lib * @modules java.base/sun.misc * java.compiler * java.management diff --git a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java index c2f10c8e8ef..0123c282b11 100644 --- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java +++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityCommandOn.java @@ -24,7 +24,7 @@ /* * @test TestCompilerDirectivesCompatibilityCommandOn * @bug 8137167 - * @library /testlibrary /../../test/lib + * @library /testlibrary /test/lib * @modules java.base/sun.misc * java.compiler * java.management diff --git a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java index 2d6da4ad794..37c8d2b0181 100644 --- a/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java +++ b/hotspot/test/compiler/compilercontrol/TestCompilerDirectivesCompatibilityFlag.java @@ -24,7 +24,7 @@ /* * @test TestCompilerDirectivesCompatibilityFlag * @bug 8137167 - * @library /testlibrary /../../test/lib + * @library /testlibrary /test/lib * @modules java.base/sun.misc * java.compiler * java.management diff --git a/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java index 7fccb4577ac..e128f500901 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests CompileCommand=compileonly - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.commandfile.CompileOnlyTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java index afe38547431..2b40af6182e 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests CompileCommand=exclude - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.commandfile.ExcludeTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java b/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java index a3b7c8f26b4..a35474235e8 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests CompileCommand=log - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.commandfile.LogTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java b/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java index a5f3ed978f8..c3fab210fac 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests CompileCommand=print - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.commandfile.PrintTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java index 1509473fc40..f08fb34e318 100644 --- a/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests CompileCommand=compileonly - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.commands.CompileOnlyTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java index 86f18c60180..0af19c1a35e 100644 --- a/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests CompileCommand=exclude - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.commands.ExcludeTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/commands/LogTest.java b/hotspot/test/compiler/compilercontrol/commands/LogTest.java index 4a000fe0a29..07a437853cc 100644 --- a/hotspot/test/compiler/compilercontrol/commands/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/LogTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests CompileCommand=log - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.commands.LogTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/commands/PrintTest.java b/hotspot/test/compiler/compilercontrol/commands/PrintTest.java index 27313abe197..758b733e06a 100644 --- a/hotspot/test/compiler/compilercontrol/commands/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/PrintTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests CompileCommand=print - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.commands.PrintTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java index 45034afa1ff..bdc3a39f32f 100644 --- a/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests directives to be able to compile only specified methods - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.directives.CompileOnlyTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java index 72b30bf8720..44b33dd43c1 100644 --- a/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests directives to be able to exclude methods from compilation - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.directives.ExcludeTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/directives/LogTest.java b/hotspot/test/compiler/compilercontrol/directives/LogTest.java index f3147caa73e..634aee5cb01 100644 --- a/hotspot/test/compiler/compilercontrol/directives/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/LogTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests directives to be able to turn on LogCompilation - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.directives.LogTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/directives/PrintTest.java b/hotspot/test/compiler/compilercontrol/directives/PrintTest.java index 204e42bd130..a0e8dc071f8 100644 --- a/hotspot/test/compiler/compilercontrol/directives/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/PrintTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests directives to be able to turn on print_assembly - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.directives.PrintTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java index 474e2bfe36b..21d7af2efb7 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests directives to be able to add and remove directives - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.jcmd.AddAndRemoveTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java index ef0df375170..5f17ad0cc27 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests jcmd to be able to add a directive to compile only specified methods - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.jcmd.AddCompileOnlyTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java index 20282fbd41c..c72b6c06e4e 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests jcmd to be able to add a directive to exclude only specified methods - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.jcmd.AddExcludeTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java index aaf6abb78f2..900c57978ab 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Tests jcmd to be able to add a directive to log only specified methods - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.jcmd.AddLogTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java index 054f44d308b..8f9c0250138 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java @@ -26,7 +26,7 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to print assembly * only for specified methods - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.jcmd.AddPrintAssemblyTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java b/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java index c175bb04ce3..13df53afdfe 100644 --- a/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java +++ b/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Randomly generates commands with random types - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.mixed.RandomCommandsTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java index 3c67043621f..4d93e7dd3e1 100644 --- a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java +++ b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java @@ -25,7 +25,7 @@ * @test * @bug 8137167 * @summary Randomly generates valid commands with random types - * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / + * @library /testlibrary /test/lib /compiler/testlibrary ../share / * @build compiler.compilercontrol.mixed.RandomValidCommandsTest * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* diff --git a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java index 638321ae9d4..15e265663de 100644 --- a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java +++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java @@ -27,7 +27,7 @@ import jdk.test.lib.ProcessTools; /* * @test - * @library /testlibrary /../../test/lib /compiler/whitebox + * @library /testlibrary /test/lib /compiler/whitebox * /compiler/testlibrary /compiler/codegen/7184394 * @modules java.base/sun.misc * java.management diff --git a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java index fa5e3aaf46e..7b2c42eda00 100644 --- a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java +++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java @@ -28,7 +28,7 @@ import jdk.test.lib.ProcessTools; /* * @test - * @library /testlibrary /../../test/lib /compiler/whitebox + * @library /testlibrary /test/lib /compiler/whitebox * /compiler/testlibrary /compiler/codegen/7184394 * @modules java.base/sun.misc * java.management diff --git a/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java b/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java index e47c693ebe9..d96de812faa 100644 --- a/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java +++ b/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8138651 - * @library /testlibrary /../../test/lib + * @library /testlibrary /test/lib * @build IntrinsicDisabledTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java b/hotspot/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java index e5210b6a070..5a6f91c0636 100644 --- a/hotspot/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java +++ b/hotspot/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java @@ -42,7 +42,7 @@ import jdk.test.lib.Platform; * @test * @bug 8130150 8131779 8139907 * @summary Verify that the Montgomery multiply and square intrinsic works and correctly checks their arguments. - * @library /testlibrary /../../test/lib + * @library /testlibrary /test/lib * @library /testlibrary * @build MontgomeryMultiplyTest * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java index 21c64179531..9d78d8b7170 100644 --- a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java +++ b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java @@ -26,7 +26,7 @@ * @test * @bug 8145336 * @summary PPC64: fix string intrinsics after CompactStrings change - * @library /testlibrary /../../test/lib + * @library /testlibrary /test/lib * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/stable/TestStableMemoryBarrier.java b/hotspot/test/compiler/stable/TestStableMemoryBarrier.java index 4d3a223463c..f49b2ad811a 100644 --- a/hotspot/test/compiler/stable/TestStableMemoryBarrier.java +++ b/hotspot/test/compiler/stable/TestStableMemoryBarrier.java @@ -27,7 +27,7 @@ * @test TestStableMemoryBarrier * @bug 8139758 * @summary tests memory barrier correctly inserted for stable fields - * @library /testlibrary /../../test/lib + * @library /testlibrary /test/lib * * @run main/bootclasspath -Xcomp -XX:CompileOnly=::testCompile * java.lang.invoke.TestStableMemoryBarrier diff --git a/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java b/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java index f4e0f776f7e..dbd4fef01df 100644 --- a/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java +++ b/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java @@ -27,7 +27,7 @@ * @summary C2 can not handle returns with inccompatible interface arrays * @modules java.base/jdk.internal.org.objectweb.asm * java.base/sun.misc - * @library /testlibrary /../../test/lib + * @library /testlibrary /test/lib * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/gc/g1/TestPLABOutput.java b/hotspot/test/gc/g1/TestPLABOutput.java index 44c99b928c2..a8265ac00c1 100644 --- a/hotspot/test/gc/g1/TestPLABOutput.java +++ b/hotspot/test/gc/g1/TestPLABOutput.java @@ -27,7 +27,7 @@ * @summary Check that G1 does not report empty PLAB statistics in the first evacuation. * @requires vm.gc=="G1" | vm.gc=="null" * @key gc - * @library /testlibrary /../../test/lib + * @library /testlibrary /test/lib * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * @run driver TestPLABOutput From d26d6fa3efcfd835f7834f6c65432651f27384d3 Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Mon, 1 Feb 2016 19:45:26 +0300 Subject: [PATCH 101/212] 8144239: [TESTBUG] InlineCommandTest.java: unknown compiler level 0 for commpile ID: 651 Add Xbatch to make compilation block test thread. Reviewed-by: kvn --- .../test/compiler/compilercontrol/share/scenario/Command.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/Command.java b/hotspot/test/compiler/compilercontrol/share/scenario/Command.java index d044fa92a2f..c4b2193512c 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/Command.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/Command.java @@ -32,8 +32,8 @@ import java.util.Arrays; public enum Command { COMPILEONLY("compileonly", ".*", "-Xbatch"), EXCLUDE("exclude", "", "-Xbatch"), - INLINE("inline", ".*"), - DONTINLINE("dontinline", ""), + INLINE("inline", ".*", "-Xbatch"), + DONTINLINE("dontinline", "", "-Xbatch"), LOG("log", "", "-XX:+UnlockDiagnosticVMOptions", "-XX:+LogCompilation", "-XX:LogFile=" + LogProcessor.LOG_FILE), PRINT("print", ""), From 415eda1274fce4ddc78dd2221abe2ce61f7ab7f2 Mon Sep 17 00:00:00 2001 From: Krystal Mo Date: Tue, 19 Jan 2016 14:52:33 +0100 Subject: [PATCH 102/212] 8003585: strength reduce or eliminate range checks for power-of-two sized arrays Change ((x & m) u<= m) to always true and ((x & (m - 1)) u< m) into (m > 0) Reviewed-by: kvn, roland --- hotspot/src/share/vm/opto/addnode.cpp | 6 +- hotspot/src/share/vm/opto/subnode.cpp | 60 ++++++- .../PowerOf2SizedArraysChecks.java | 161 ++++++++++++++++++ 3 files changed, 223 insertions(+), 4 deletions(-) create mode 100644 hotspot/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java diff --git a/hotspot/src/share/vm/opto/addnode.cpp b/hotspot/src/share/vm/opto/addnode.cpp index 416b9c35ff9..0983bcd8263 100644 --- a/hotspot/src/share/vm/opto/addnode.cpp +++ b/hotspot/src/share/vm/opto/addnode.cpp @@ -61,7 +61,7 @@ Node* AddNode::Identity(PhaseGVN* phase) { //------------------------------commute---------------------------------------- // Commute operands to move loads and constants to the right. -static bool commute( Node *add, int con_left, int con_right ) { +static bool commute(Node *add, bool con_left, bool con_right) { Node *in1 = add->in(1); Node *in2 = add->in(2); @@ -110,8 +110,8 @@ static bool commute( Node *add, int con_left, int con_right ) { Node *AddNode::Ideal(PhaseGVN *phase, bool can_reshape) { const Type *t1 = phase->type( in(1) ); const Type *t2 = phase->type( in(2) ); - int con_left = t1->singleton(); - int con_right = t2->singleton(); + bool con_left = t1->singleton(); + bool con_right = t2->singleton(); // Check for commutative operation desired if( commute(this,con_left,con_right) ) return this; diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 4250c6b8a20..0d06c083183 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -1334,6 +1334,65 @@ Node *BoolNode::Ideal(PhaseGVN *phase, bool can_reshape) { return new BoolNode( ncmp, _test.negate() ); } + // Change ((x & m) u<= m) or ((m & x) u<= m) to always true + // Same with ((x & m) u< m+1) and ((m & x) u< m+1) + if (cop == Op_CmpU && + cmp1->Opcode() == Op_AndI) { + Node* bound = NULL; + if (_test._test == BoolTest::le) { + bound = cmp2; + } else if (_test._test == BoolTest::lt && + cmp2->Opcode() == Op_AddI && + cmp2->in(2)->find_int_con(0) == 1) { + bound = cmp2->in(1); + } + if (cmp1->in(2) == bound || cmp1->in(1) == bound) { + return ConINode::make(1); + } + } + + // Change ((x & (m - 1)) u< m) into (m > 0) + // This is the off-by-one variant of the above + if (cop == Op_CmpU && + _test._test == BoolTest::lt && + cmp1->Opcode() == Op_AndI) { + Node* l = cmp1->in(1); + Node* r = cmp1->in(2); + for (int repeat = 0; repeat < 2; repeat++) { + bool match = r->Opcode() == Op_AddI && r->in(2)->find_int_con(0) == -1 && + r->in(1) == cmp2; + if (match) { + // arraylength known to be non-negative, so a (arraylength != 0) is sufficient, + // but to be compatible with the array range check pattern, use (arraylength u> 0) + Node* ncmp = cmp2->Opcode() == Op_LoadRange + ? phase->transform(new CmpUNode(cmp2, phase->intcon(0))) + : phase->transform(new CmpINode(cmp2, phase->intcon(0))); + return new BoolNode(ncmp, BoolTest::gt); + } else { + // commute and try again + l = cmp1->in(2); + r = cmp1->in(1); + } + } + } + + // Change (arraylength <= 0) or (arraylength == 0) + // into (arraylength u<= 0) + // Also change (arraylength != 0) into (arraylength u> 0) + // The latter version matches the code pattern generated for + // array range checks, which will more likely be optimized later. + if (cop == Op_CmpI && + cmp1->Opcode() == Op_LoadRange && + cmp2->find_int_con(-1) == 0) { + if (_test._test == BoolTest::le || _test._test == BoolTest::eq) { + Node* ncmp = phase->transform(new CmpUNode(cmp1, cmp2)); + return new BoolNode(ncmp, BoolTest::le); + } else if (_test._test == BoolTest::ne) { + Node* ncmp = phase->transform(new CmpUNode(cmp1, cmp2)); + return new BoolNode(ncmp, BoolTest::gt); + } + } + // Change "bool eq/ne (cmp (Conv2B X) 0)" into "bool eq/ne (cmp X 0)". // This is a standard idiom for branching on a boolean value. Node *c2b = cmp1; @@ -1496,4 +1555,3 @@ const Type* Log10DNode::Value(PhaseGVN* phase) const { double d = t1->getd(); return TypeD::make( StubRoutines::intrinsic_log10( d ) ); } - diff --git a/hotspot/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java b/hotspot/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java new file mode 100644 index 00000000000..dad068d0ad3 --- /dev/null +++ b/hotspot/test/compiler/rangechecks/PowerOf2SizedArraysChecks.java @@ -0,0 +1,161 @@ +/* + * Copyright (c) 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. + * + */ + +/** + * @test + * @bug 8003585 + * @summary strength reduce or eliminate range checks for power-of-two sized arrays + * @run main/othervm -XX:CompileCommand=compileonly,PowerOf2SizedArraysChecks::test* -XX:-BackgroundCompilation PowerOf2SizedArraysChecks + * + */ + +import java.util.function.*; + +public class PowerOf2SizedArraysChecks { + + static void check_result(String name, int x, int m, boolean expected, boolean res) { + if (expected != res) { + throw new RuntimeException("Bad result in " + name + " for x = " + x + " m = " + m + " expected " + expected + " got " + res); + } + } + + static void helper(String name, BiFunction test, int[] x_values, int[] m_values, boolean[][] expected) { + for (int i = 0; i < x_values.length; i++) { + int x = x_values[i]; + for (int j = 0; j < m_values.length; j++) { + int m = m_values[j]; + int[] array = new int[m]; + boolean res = test.apply(x, array); + check_result(name, x, m, expected[i][j], res); + } + } + } + + static void check_result(String name, int m, boolean expected, boolean res) { + if (expected != res) { + throw new RuntimeException("Bad result in " + name + " for m = " + m + " expected " + expected + " got " + res); + } + } + + static void helper2(String name, Function test, int[] m_values, boolean[] expected) { + for (int j = 0; j < m_values.length; j++) { + int m = m_values[j]; + int[] array = new int[m]; + boolean res = test.apply(array); + check_result(name, m, expected[j], res); + } + } + + // ((x & m) u<= m) is always true + static boolean test1(int x, int[] array) { + int m = array.length; + if ((x & m) < 0 || (x & m) > m) { + return false; + } + return true; + } + + // ((x & (m - 1)) u< m) iff (m > 0) + static boolean test2(int x, int[] array) { + int m = array.length; + if ((x & (m-1)) < 0 || (x & (m-1)) >= m) { + return false; + } + return true; + } + + static boolean test3(int x, int[] array) { + try { + int v = array[x & (array.length-1)]; + } catch(ArrayIndexOutOfBoundsException aioobe) { + return false; + } + return true; + } + + // arraylength <= 0 to arraylength u<= 0 + static boolean test4(int[] array) { + if (array.length <= 0) { + return false; + } + return true; + } + + // arraylength == 0 to arraylength u<= 0 + static boolean test5(int[] array) { + if (array.length == 0) { + return false; + } + return true; + } + + // arraylength != 0 to arraylength u> 0 + static boolean test6(int[] array) { + if (array.length != 0) { + return false; + } + return true; + } + + static public void main(String[] args) { + int[] x_values = {-10, -5, 0, 5, 8, 16, 100}; + int[] m_values = { 16, 10, 0 }; + + boolean[][] test1_expected = new boolean[x_values.length][m_values.length]; + for (int i = 0; i < x_values.length; i++) { + for (int j = 0; j < m_values.length; j++) { + test1_expected[i][j] = true; + } + } + + boolean[][] test2_expected = new boolean[x_values.length][m_values.length]; + for (int i = 0; i < x_values.length; i++) { + for (int j = 0; j < m_values.length; j++) { + test2_expected[i][j] = (m_values[j] > 0); + } + } + + boolean[] test4_expected = new boolean[m_values.length]; + for (int i = 0; i < m_values.length; i++) { + test4_expected[i] = (m_values[i] > 0); + } + boolean[] test5_expected = new boolean[m_values.length]; + for (int i = 0; i < m_values.length; i++) { + test5_expected[i] = (m_values[i] != 0); + } + boolean[] test6_expected = new boolean[m_values.length]; + for (int i = 0; i < m_values.length; i++) { + test6_expected[i] = (m_values[i] == 0); + } + + for (int i = 0; i < 20000; i++) { + helper("test1", PowerOf2SizedArraysChecks::test1, x_values, m_values, test1_expected); + helper("test2", PowerOf2SizedArraysChecks::test2, x_values, m_values, test2_expected); + helper("test3", PowerOf2SizedArraysChecks::test3, x_values, m_values, test2_expected); + helper2("test4", PowerOf2SizedArraysChecks::test4, m_values, test4_expected); + helper2("test5", PowerOf2SizedArraysChecks::test5, m_values, test5_expected); + helper2("test6", PowerOf2SizedArraysChecks::test6, m_values, test6_expected); + } + } +} From bf99c27274e8ddaccd1a462d64c13d3f5548bc1f Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Tue, 19 Jan 2016 17:58:02 +0100 Subject: [PATCH 103/212] 8147386: assert(size == calc_size) failed: incorrect size calculattion x86_32.ad Incorrect offset used in spill code for vectors Reviewed-by: vlivanov, kvn, mcberg --- hotspot/src/cpu/x86/vm/x86_32.ad | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index 42fdc0ee693..f684cd5b5cd 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -968,14 +968,15 @@ static int vec_stack_to_stack_helper(CodeBuffer *cbuf, bool do_size, int src_off case Op_VecS: calc_size = 3+src_offset_size + 3+dst_offset_size; break; - case Op_VecD: + case Op_VecD: { calc_size = 3+src_offset_size + 3+dst_offset_size; - src_offset += 4; - dst_offset += 4; - src_offset_size = (src_offset == 0) ? 0 : ((src_offset < 0x80) ? 1 : 4); - dst_offset_size = (dst_offset == 0) ? 0 : ((dst_offset < 0x80) ? 1 : 4); + int tmp_src_offset = src_offset + 4; + int tmp_dst_offset = dst_offset + 4; + src_offset_size = (tmp_src_offset == 0) ? 0 : ((tmp_src_offset < 0x80) ? 1 : 4); + dst_offset_size = (tmp_dst_offset == 0) ? 0 : ((tmp_dst_offset < 0x80) ? 1 : 4); calc_size += 3+src_offset_size + 3+dst_offset_size; break; + } case Op_VecX: case Op_VecY: case Op_VecZ: @@ -1020,7 +1021,7 @@ static int vec_stack_to_stack_helper(CodeBuffer *cbuf, bool do_size, int src_off ShouldNotReachHere(); } int size = __ offset() - offset; - assert(size == calc_size, "incorrect size calculattion"); + assert(size == calc_size, "incorrect size calculation"); return size; #ifndef PRODUCT } else if (!do_size) { From 7300cb856d61bab30997beba304d9a95cf6fd4bf Mon Sep 17 00:00:00 2001 From: Alejandro Murillo Date: Tue, 19 Jan 2016 18:39:23 -0800 Subject: [PATCH 104/212] 8146653: Debug version missing in hs_err files and on internal version after Verona Reviewed-by: dcubed, dholmes --- hotspot/src/share/vm/runtime/vm_version.cpp | 16 +++++++++++++--- hotspot/src/share/vm/runtime/vm_version.hpp | 3 ++- hotspot/src/share/vm/utilities/vmError.cpp | 14 ++++++++++---- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index e36fce25870..5538241cb9f 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -238,9 +238,14 @@ const char* Abstract_VM_Version::internal_vm_info_string() { #define FLOAT_ARCH_STR XSTR(FLOAT_ARCH) #endif - return VMNAME " (" VM_RELEASE ") for " OS "-" CPU FLOAT_ARCH_STR - " JRE (" VERSION_STRING "), built on " __DATE__ " " __TIME__ - " by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER; + #define INTERNAL_VERSION_SUFFIX VM_RELEASE ")" \ + " for " OS "-" CPU FLOAT_ARCH_STR \ + " JRE (" VERSION_STRING "), built on " __DATE__ " " __TIME__ \ + " by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER + + return strcmp(DEBUG_LEVEL, "release") == 0 + ? VMNAME " (" INTERNAL_VERSION_SUFFIX + : VMNAME " (" DEBUG_LEVEL " " INTERNAL_VERSION_SUFFIX; } const char *Abstract_VM_Version::vm_build_user() { @@ -251,6 +256,11 @@ const char *Abstract_VM_Version::jdk_debug_level() { return DEBUG_LEVEL; } +const char *Abstract_VM_Version::printable_jdk_debug_level() { + // Debug level is not printed for "release" builds + return strcmp(DEBUG_LEVEL, "release") == 0 ? "" : DEBUG_LEVEL " "; +} + unsigned int Abstract_VM_Version::jvm_version() { return ((Abstract_VM_Version::vm_major_version() & 0xFF) << 24) | ((Abstract_VM_Version::vm_minor_version() & 0xFF) << 16) | diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp index ee4b4ec0d64..5d07fc703b7 100644 --- a/hotspot/src/share/vm/runtime/vm_version.hpp +++ b/hotspot/src/share/vm/runtime/vm_version.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -106,6 +106,7 @@ class Abstract_VM_Version: AllStatic { static const char* internal_vm_info_string(); static const char* jre_release_version(); static const char* jdk_debug_level(); + static const char* printable_jdk_debug_level(); static uint64_t features() { return _features; diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index 23c3195db4d..a1bf6ef195d 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -232,11 +232,17 @@ static void report_vm_version(outputStream* st, char* buf, int buflen) { const char* runtime_name = JDK_Version::runtime_name() != NULL ? JDK_Version::runtime_name() : ""; const char* runtime_version = JDK_Version::runtime_version() != NULL ? - JDK_Version::runtime_version() : ""; - st->print_cr("# JRE version: %s (%s) (build %s)", runtime_name, buf, runtime_version); + JDK_Version::runtime_version() : ""; + const char* jdk_debug_level = Abstract_VM_Version::printable_jdk_debug_level() != NULL ? + Abstract_VM_Version::printable_jdk_debug_level() : ""; + + st->print_cr("# JRE version: %s (%s) (%sbuild %s)", runtime_name, buf, + jdk_debug_level, runtime_version); + // This is the long version with some default settings added - st->print_cr("# Java VM: %s (%s, %s%s%s%s%s, %s, %s)", + st->print_cr("# Java VM: %s (%s%s, %s%s%s%s%s, %s, %s)", Abstract_VM_Version::vm_name(), + jdk_debug_level, Abstract_VM_Version::vm_release(), Abstract_VM_Version::vm_info_string(), TieredCompilation ? ", tiered" : "", From 3927e409fb5c54dc32cdd016dbfc7a666ff78066 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 20 Jan 2016 09:18:36 +0100 Subject: [PATCH 105/212] 8147509: [aix] Newlines missing in register info printout Reviewed-by: simonis --- hotspot/src/os/aix/vm/os_aix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index 9f6ad76875a..a3f52f36ea9 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -3742,7 +3742,7 @@ bool os::find(address addr, outputStream* st) { loaded_module_t lm; if (LoadedLibraries::find_for_text_address(addr, &lm) != NULL || LoadedLibraries::find_for_data_address(addr, &lm) != NULL) { - st->print("%s", lm.path); + st->print_cr("%s", lm.path); return true; } From f3dca540d8740da79786accf405c0038be9673f1 Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Wed, 20 Jan 2016 16:33:51 +0100 Subject: [PATCH 106/212] 8145336: PPC64: fix string intrinsics after CompactStrings change Reviewed-by: mdoerr, aph, kvn --- hotspot/src/cpu/aarch64/vm/aarch64.ad | 2 +- .../src/cpu/aarch64/vm/vm_version_aarch64.cpp | 1 - hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp | 45 +- hotspot/src/cpu/ppc/vm/ppc.ad | 117 ++- hotspot/src/cpu/x86/vm/globals_x86.hpp | 5 +- hotspot/src/cpu/x86/vm/x86.ad | 10 +- hotspot/src/share/vm/opto/library_call.cpp | 12 +- hotspot/src/share/vm/runtime/globals.hpp | 5 +- .../string/TestStringIntrinsics2.java | 674 ++++++++++++++++++ 9 files changed, 815 insertions(+), 56 deletions(-) create mode 100644 hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index 8f88786f422..0dd35270b1d 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. // Copyright (c) 2014, Red Hat Inc. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp index d48f4ee3a25..6de94bee33d 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp @@ -121,7 +121,6 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(PrefetchScanIntervalInBytes, 256); FLAG_SET_DEFAULT(PrefetchFieldsAhead, 256); FLAG_SET_DEFAULT(PrefetchCopyIntervalInBytes, 256); - FLAG_SET_DEFAULT(UseSSE42Intrinsics, true); unsigned long auxv = getauxval(AT_HWCAP); diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index e8236bfff6c..2b19742bb71 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -3172,11 +3172,12 @@ void MacroAssembler::clear_memory_doubleword(Register base_ptr, Register cnt_dwo // // Assumes that result differs from all other registers. // -// Haystack, needle are the addresses of jchar-arrays. -// NeedleChar is needle[0] if it is known at compile time. -// Haycnt is the length of the haystack. We assume haycnt >=1. +// 'haystack' is the addresses of a jchar-array. +// 'needle' is either the character to search for or R0. +// 'needleChar' is the character to search for if 'needle' == R0.. +// 'haycnt' is the length of the haystack. We assume 'haycnt' >=1. // -// Preserves haystack, haycnt, kills all other registers. +// Preserves haystack, haycnt, needle and kills all other registers. // // If needle == R0, we search for the constant needleChar. void MacroAssembler::string_indexof_1(Register result, Register haystack, Register haycnt, @@ -3186,13 +3187,11 @@ void MacroAssembler::string_indexof_1(Register result, Register haystack, Regist assert_different_registers(result, haystack, haycnt, needle, tmp1, tmp2); Label L_InnerLoop, L_FinalCheck, L_Found1, L_Found2, L_Found3, L_NotFound, L_End; - Register needle0 = needle, // Contains needle[0]. - addr = tmp1, + Register addr = tmp1, ch1 = tmp2, ch2 = R0; -//2 (variable) or 3 (const): - if (needle != R0) lhz(needle0, 0, needle); // Preload needle character, needle has len==1. +//3: dcbtct(haystack, 0x00); // Indicate R/O access to haystack. srwi_(tmp2, haycnt, 1); // Shift right by exact_log2(UNROLL_FACTOR). @@ -3203,8 +3202,8 @@ void MacroAssembler::string_indexof_1(Register result, Register haystack, Regist bind(L_InnerLoop); // Main work horse (2x unrolled search loop). lhz(ch1, 0, addr); // Load characters from haystack. lhz(ch2, 2, addr); - (needle != R0) ? cmpw(CCR0, ch1, needle0) : cmplwi(CCR0, ch1, needleChar); - (needle != R0) ? cmpw(CCR1, ch2, needle0) : cmplwi(CCR1, ch2, needleChar); + (needle != R0) ? cmpw(CCR0, ch1, needle) : cmplwi(CCR0, ch1, needleChar); + (needle != R0) ? cmpw(CCR1, ch2, needle) : cmplwi(CCR1, ch2, needleChar); beq(CCR0, L_Found1); // Did we find the needle? beq(CCR1, L_Found2); addi(addr, addr, 4); @@ -3214,7 +3213,7 @@ void MacroAssembler::string_indexof_1(Register result, Register haystack, Regist andi_(R0, haycnt, 1); beq(CCR0, L_NotFound); lhz(ch1, 0, addr); // One position left at which we have to compare. - (needle != R0) ? cmpw(CCR1, ch1, needle0) : cmplwi(CCR1, ch1, needleChar); + (needle != R0) ? cmpw(CCR1, ch1, needle) : cmplwi(CCR1, ch1, needleChar); beq(CCR1, L_Found3); //21: bind(L_NotFound); @@ -3399,7 +3398,15 @@ void MacroAssembler::string_compare(Register str1_reg, Register str2_reg, Regist chr2_reg = cnt2_reg, addr_diff = str2_reg; + // 'cnt_reg' contains the number of characters in the string's character array for the + // pre-CompactStrings strings implementation and the number of bytes in the string's + // byte array for the CompactStrings strings implementation. + const int HAS_COMPACT_STRING = java_lang_String::has_coder_field() ? 1 : 0; // '1' = byte array, '0' = char array + // Offset 0 should be 32 byte aligned. +//-6: + srawi(cnt1_reg, cnt1_reg, HAS_COMPACT_STRING); + srawi(cnt2_reg, cnt2_reg, HAS_COMPACT_STRING); //-4: dcbtct(str1_reg, 0x00); // Indicate R/O access to str1. dcbtct(str2_reg, 0x00); // Indicate R/O access to str2. @@ -3478,14 +3485,21 @@ void MacroAssembler::char_arrays_equals(Register str1_reg, Register str2_reg, Re Register index_reg = tmp5_reg; Register cbc_iter = tmp4_reg; + // 'cnt_reg' contains the number of characters in the string's character array for the + // pre-CompactStrings strings implementation and the number of bytes in the string's + // byte array for the CompactStrings strings implementation. + const int HAS_COMPACT_STRING = java_lang_String::has_coder_field() ? 1 : 0; // '1' = byte array, '0' = char array + //-1: dcbtct(str1_reg, 0x00); // Indicate R/O access to str1. dcbtct(str2_reg, 0x00); // Indicate R/O access to str2. //1: - andi(cbc_iter, cnt_reg, 4-1); // Remaining iterations after 4 java characters per iteration loop. + // cbc_iter: remaining characters after the '4 java characters per iteration' loop. + rlwinm(cbc_iter, cnt_reg, 32 - HAS_COMPACT_STRING, 30, 31); // (cnt_reg % (HAS_COMPACT_STRING ? 8 : 4)) >> HAS_COMPACT_STRING li(index_reg, 0); // init li(result_reg, 0); // assume false - srwi_(tmp2_reg, cnt_reg, exact_log2(4)); // Div: 4 java characters per iteration (main loop). + // tmp2_reg: units of 4 java characters (i.e. 8 bytes) per iteration (main loop). + srwi_(tmp2_reg, cnt_reg, exact_log2(4 << HAS_COMPACT_STRING)); // cnt_reg / (HAS_COMPACT_STRING ? 8 : 4) cmpwi(CCR1, cbc_iter, 0); // CCR1 = (cbc_iter==0) beq(CCR0, Linit_cbc); // too short @@ -3526,6 +3540,11 @@ void MacroAssembler::char_arrays_equalsImm(Register str1_reg, Register str2_reg, assert(sizeof(jchar) == 2, "must be"); assert(cntval >= 0 && ((cntval & 0x7fff) == cntval), "wrong immediate"); + // 'cntval' contains the number of characters in the string's character array for the + // pre-CompactStrings strings implementation and the number of bytes in the string's + // byte array for the CompactStrings strings implementation. + cntval >>= (java_lang_String::has_coder_field() ? 1 : 0); // '1' = byte array strings, '0' = char array strings + Label Ldone_false; if (cntval < 16) { // short case diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 001b539399f..dd95d23be09 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. // Copyright 2012, 2015 SAP AG. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // @@ -956,36 +956,40 @@ static int cc_to_biint(int cc, int flags_reg) { // the instruction. The padding must match the size of a NOP instruction. int string_indexOf_imm1_charNode::compute_padding(int current_offset) const { - return (3*4-current_offset)&31; + return (3*4-current_offset)&31; // see MacroAssembler::string_indexof_1 } int string_indexOf_imm1Node::compute_padding(int current_offset) const { - return (2*4-current_offset)&31; + return (3*4-current_offset)&31; // see MacroAssembler::string_indexof_1 +} + +int string_indexOfCharNode::compute_padding(int current_offset) const { + return (3*4-current_offset)&31; // see MacroAssembler::string_indexof_1 } int string_indexOf_immNode::compute_padding(int current_offset) const { - return (3*4-current_offset)&31; + return (3*4-current_offset)&31; // see MacroAssembler::string_indexof(constant needlecount) } int string_indexOfNode::compute_padding(int current_offset) const { - return (1*4-current_offset)&31; + return (1*4-current_offset)&31; // see MacroAssembler::string_indexof(variable needlecount) } int string_compareNode::compute_padding(int current_offset) const { - return (4*4-current_offset)&31; + return (2*4-current_offset)&31; // see MacroAssembler::string_compare } int string_equals_immNode::compute_padding(int current_offset) const { - if (opnd_array(3)->constant() < 16) return 0; // Don't insert nops for short version (loop completely unrolled). - return (2*4-current_offset)&31; + if (opnd_array(3)->constant() < 16) return 0; // For strlen < 16 no nops because loop completely unrolled + return (2*4-current_offset)&31; // Genral case - see MacroAssembler::char_arrays_equalsImm } int string_equalsNode::compute_padding(int current_offset) const { - return (7*4-current_offset)&31; + return (7*4-current_offset)&31; // see MacroAssembler::char_arrays_equals } int inlineCallClearArrayNode::compute_padding(int current_offset) const { - return (2*4-current_offset)&31; + return (2*4-current_offset)&31; // see MacroAssembler::clear_memory_doubleword } //============================================================================= @@ -2025,6 +2029,8 @@ const bool Matcher::match_rule_supported(int opcode) { return SpecialStringEquals && !CompactStrings; case Op_StrIndexOf: return SpecialStringIndexOf && !CompactStrings; + case Op_StrIndexOfChar: + return SpecialStringIndexOf && !CompactStrings; } return true; // Per default match rules are supported. @@ -11034,11 +11040,11 @@ instruct inlineCallClearArray(rarg1RegL cnt, rarg2RegP base, Universe dummy, reg instruct string_indexOf_imm1_char(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt, immP needleImm, immL offsetImm, immI_1 needlecntImm, iRegIdst tmp1, iRegIdst tmp2, - flagsRegCR0 cr0, flagsRegCR1 cr1) %{ + flagsRegCR0 cr0, flagsRegCR1 cr1, regCTR ctr) %{ predicate(SpecialStringIndexOf && !CompactStrings); // type check implicit by parameter type, See Matcher::match_rule_supported match(Set result (StrIndexOf (Binary haystack haycnt) (Binary (AddP needleImm offsetImm) needlecntImm))); - effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1); + effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1, KILL ctr); ins_cost(150); format %{ "String IndexOf CSCL1 $haystack[0..$haycnt], $needleImm+$offsetImm[0..$needlecntImm]" @@ -11050,10 +11056,23 @@ instruct string_indexOf_imm1_char(iRegIdst result, iRegPsrc haystack, iRegIsrc h immPOper *needleOper = (immPOper *)$needleImm; const TypeOopPtr *t = needleOper->type()->isa_oopptr(); ciTypeArray* needle_values = t->const_oop()->as_type_array(); // Pointer to live char * - + jchar chr; + if (java_lang_String::has_coder_field()) { + // New compact strings byte array strings +#ifdef VM_LITTLE_ENDIAN + chr = (((jchar)needle_values->element_value(1).as_byte()) << 8) | + (jchar)needle_values->element_value(0).as_byte(); +#else + chr = (((jchar)needle_values->element_value(0).as_byte()) << 8) | + (jchar)needle_values->element_value(1).as_byte(); +#endif + } else { + // Old char array strings + chr = needle_values->char_at(0); + } __ string_indexof_1($result$$Register, $haystack$$Register, $haycnt$$Register, - R0, needle_values->char_at(0), + R0, chr, $tmp1$$Register, $tmp2$$Register); %} ins_pipe(pipe_class_compare); @@ -11073,12 +11092,13 @@ instruct string_indexOf_imm1_char(iRegIdst result, iRegPsrc haystack, iRegIsrc h instruct string_indexOf_imm1(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt, rscratch2RegP needle, immI_1 needlecntImm, iRegIdst tmp1, iRegIdst tmp2, - flagsRegCR0 cr0, flagsRegCR1 cr1) %{ + flagsRegCR0 cr0, flagsRegCR1 cr1, regCTR ctr) %{ match(Set result (StrIndexOf (Binary haystack haycnt) (Binary needle needlecntImm))); effect(USE_KILL needle, /* TDEF needle, */ TEMP_DEF result, - TEMP tmp1, TEMP tmp2); + TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1, KILL ctr); // Required for EA: check if it is still a type_array. - predicate(SpecialStringIndexOf && !CompactStrings && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() && + predicate(SpecialStringIndexOf && !CompactStrings && + n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array()); ins_cost(180); @@ -11091,17 +11111,54 @@ instruct string_indexOf_imm1(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt Node *ndl = in(operand_index($needle)); // The node that defines needle. ciTypeArray* needle_values = ndl->bottom_type()->is_aryptr()->const_oop()->as_type_array(); guarantee(needle_values, "sanity"); - if (needle_values != NULL) { - __ string_indexof_1($result$$Register, - $haystack$$Register, $haycnt$$Register, - R0, needle_values->char_at(0), - $tmp1$$Register, $tmp2$$Register); + jchar chr; + if (java_lang_String::has_coder_field()) { + // New compact strings byte array strings +#ifdef VM_LITTLE_ENDIAN + chr = (((jchar)needle_values->element_value(1).as_byte()) << 8) | + (jchar)needle_values->element_value(0).as_byte(); +#else + chr = (((jchar)needle_values->element_value(0).as_byte()) << 8) | + (jchar)needle_values->element_value(1).as_byte(); +#endif } else { - __ string_indexof_1($result$$Register, - $haystack$$Register, $haycnt$$Register, - $needle$$Register, 0, - $tmp1$$Register, $tmp2$$Register); + // Old char array strings + chr = needle_values->char_at(0); } + __ string_indexof_1($result$$Register, + $haystack$$Register, $haycnt$$Register, + R0, chr, + $tmp1$$Register, $tmp2$$Register); + %} + ins_pipe(pipe_class_compare); +%} + +// String_IndexOfChar +// +// Assumes register result differs from all input registers. +// +// Preserves registers haystack, haycnt +// Kills registers tmp1, tmp2 +// Defines registers result +// +// Use dst register classes if register gets killed, as it is the case for tmp registers! +instruct string_indexOfChar(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt, + iRegIsrc ch, iRegIdst tmp1, iRegIdst tmp2, + flagsRegCR0 cr0, flagsRegCR1 cr1, regCTR ctr) %{ + match(Set result (StrIndexOfChar (Binary haystack haycnt) ch)); + effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1, KILL ctr); + predicate(SpecialStringIndexOf && !CompactStrings); + ins_cost(180); + + ins_alignment(8); // 'compute_padding()' gets called, up to this number-1 nops will get inserted. + + format %{ "String IndexOfChar $haystack[0..$haycnt], $ch" + " -> $result \t// KILL $haycnt, $tmp1, $tmp2, $cr0, $cr1" %} + ins_encode %{ + __ string_indexof_1($result$$Register, + $haystack$$Register, $haycnt$$Register, + $ch$$Register, 0 /* this is not used if the character is already in a register */, + $tmp1$$Register, $tmp2$$Register); %} ins_pipe(pipe_class_compare); %} @@ -11120,10 +11177,10 @@ instruct string_indexOf_imm1(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt instruct string_indexOf_imm(iRegIdst result, iRegPsrc haystack, rscratch1RegI haycnt, iRegPsrc needle, uimmI15 needlecntImm, iRegIdst tmp1, iRegIdst tmp2, iRegIdst tmp3, iRegIdst tmp4, iRegIdst tmp5, - flagsRegCR0 cr0, flagsRegCR1 cr1, flagsRegCR6 cr6) %{ + flagsRegCR0 cr0, flagsRegCR1 cr1, flagsRegCR6 cr6, regCTR ctr) %{ match(Set result (StrIndexOf (Binary haystack haycnt) (Binary needle needlecntImm))); effect(USE_KILL haycnt, /* better: TDEF haycnt, */ TEMP_DEF result, - TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, KILL cr0, KILL cr1, KILL cr6); + TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, KILL cr0, KILL cr1, KILL cr6, KILL ctr); // Required for EA: check if it is still a type_array. predicate(SpecialStringIndexOf && !CompactStrings && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array()); @@ -11153,11 +11210,11 @@ instruct string_indexOf_imm(iRegIdst result, iRegPsrc haystack, rscratch1RegI ha // Use dst register classes if register gets killed, as it is the case for tmp registers! instruct string_indexOf(iRegIdst result, iRegPsrc haystack, rscratch1RegI haycnt, iRegPsrc needle, rscratch2RegI needlecnt, iRegLdst tmp1, iRegLdst tmp2, iRegLdst tmp3, iRegLdst tmp4, - flagsRegCR0 cr0, flagsRegCR1 cr1, flagsRegCR6 cr6) %{ + flagsRegCR0 cr0, flagsRegCR1 cr1, flagsRegCR6 cr6, regCTR ctr) %{ match(Set result (StrIndexOf (Binary haystack haycnt) (Binary needle needlecnt))); effect(USE_KILL haycnt, USE_KILL needlecnt, /*better: TDEF haycnt, TDEF needlecnt,*/ TEMP_DEF result, - TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr0, KILL cr1, KILL cr6); + TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr0, KILL cr1, KILL cr6, KILL ctr); predicate(SpecialStringIndexOf && !CompactStrings); // See Matcher::match_rule_supported. ins_cost(300); diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index 2c5b1712430..1596645f00c 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -184,6 +184,9 @@ define_pd_global(bool, PreserveFramePointer, false); product(bool, UseCountTrailingZerosInstruction, false, \ "Use count trailing zeros instruction") \ \ + product(bool, UseSSE42Intrinsics, false, \ + "SSE4.2 versions of intrinsics") \ + \ product(bool, UseBMI1Instructions, false, \ "Use BMI1 instructions") \ \ diff --git a/hotspot/src/cpu/x86/vm/x86.ad b/hotspot/src/cpu/x86/vm/x86.ad index 28d25cca76b..a316b914a52 100644 --- a/hotspot/src/cpu/x86/vm/x86.ad +++ b/hotspot/src/cpu/x86/vm/x86.ad @@ -1,5 +1,5 @@ // -// Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it @@ -1711,6 +1711,14 @@ const bool Matcher::match_rule_supported(int opcode) { if (UseAVX < 1 || UseAVX > 2) ret_value = false; break; + case Op_StrIndexOf: + if (!UseSSE42Intrinsics) + ret_value = false; + break; + case Op_StrIndexOfChar: + if (!(UseSSE > 4)) + ret_value = false; + break; } return ret_value; // Per default match rules are supported. diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 867cb00ec9b..0ab8dbb540f 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -971,8 +971,10 @@ Node* LibraryCallKit::make_string_method_node(int opcode, Node* str1_start, Node str1_start, cnt1, str2_start, cnt2, ae); break; case Op_StrEquals: + // We already know that cnt1 == cnt2 here (checked in 'inline_string_equals'). + // Use the constant length if there is one because optimized match rule may exist. result = new StrEqualsNode(control(), memory(TypeAryPtr::BYTES), - str1_start, str2_start, cnt1, ae); + str1_start, str2_start, cnt2->is_Con() ? cnt2 : cnt1, ae); break; default: ShouldNotReachHere(); @@ -1131,7 +1133,7 @@ bool LibraryCallKit::inline_objects_checkIndex() { //------------------------------inline_string_indexOf------------------------ bool LibraryCallKit::inline_string_indexOf(StrIntrinsicNode::ArgEnc ae) { - if (!Matcher::has_match_rule(Op_StrIndexOf) || !UseSSE42Intrinsics) { + if (!Matcher::match_rule_supported(Op_StrIndexOf)) { return false; } Node* src = argument(0); @@ -1175,7 +1177,7 @@ bool LibraryCallKit::inline_string_indexOfI(StrIntrinsicNode::ArgEnc ae) { if (too_many_traps(Deoptimization::Reason_intrinsic)) { return false; } - if (!Matcher::has_match_rule(Op_StrIndexOf) || !UseSSE42Intrinsics) { + if (!Matcher::match_rule_supported(Op_StrIndexOf)) { return false; } assert(callee()->signature()->size() == 5, "String.indexOf() has 5 arguments"); @@ -1260,7 +1262,7 @@ bool LibraryCallKit::inline_string_indexOfChar() { if (too_many_traps(Deoptimization::Reason_intrinsic)) { return false; } - if (!Matcher::has_match_rule(Op_StrIndexOfChar) || !(UseSSE > 4)) { + if (!Matcher::match_rule_supported(Op_StrIndexOfChar)) { return false; } assert(callee()->signature()->size() == 4, "String.indexOfChar() has 4 arguments"); diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 093578b168c..419d1e1a3f7 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -829,9 +829,6 @@ public: notproduct(bool, StressCriticalJNINatives, false, \ "Exercise register saving code in critical natives") \ \ - product(bool, UseSSE42Intrinsics, false, \ - "SSE4.2 versions of intrinsics") \ - \ product(bool, UseAESIntrinsics, false, \ "Use intrinsics for AES versions of crypto") \ \ diff --git a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java new file mode 100644 index 00000000000..fe9d85f9f7e --- /dev/null +++ b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java @@ -0,0 +1,674 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright 2016 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8145336 + * @summary PPC64: fix string intrinsics after CompactStrings change + * @library /testlibrary /../../test/lib + * @build sun.hotspot.WhiteBox + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * + * @run main/othervm + * -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:MaxInlineSize=100 + * -XX:MinInliningThreshold=0 + * TestStringIntrinsics2 + */ + +import java.lang.annotation.ElementType; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.function.Consumer; +import java.util.function.Function; + +import static jdk.test.lib.Asserts.*; +import sun.hotspot.WhiteBox; + +public class TestStringIntrinsics2 { + // ------------------------------------------------------------------------ + // + // We test the following cases: + // - no match in string. Do we miss the end condition? Will crash if we read + // past the string. + // - no match in string, but after the string there is a match. + // Do we incorrectly report this match? We had a case where we stepped + // a few chars past the string, this test would report that error. The + // one above would not. + // - The needle is exactly at the end of the string. + // - The needle spans the end of the string + // + // A special case are needles of length 1. For these we test: + // - needle is first char + // - needle is last char + // - no match + // - match behind string. + // + // We test all these for an unknown needle, and needles known to the compiler + // of lengths 5, 2 and 1. + + + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + + public enum Role { + TEST_ENTRY, + TEST_HELPER + } + + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + @interface Test { + Role role(); + int compileAt() default 0; + int warmup() default 0; + String[] warmupArgs() default {}; + } + + // All this mess is needed to avoid try/catch inside the lambdas below. + // See: http://stackoverflow.com/questions/27644361/how-can-i-throw-checked-exceptions-from-inside-java-8-streams + @SuppressWarnings ("unchecked") + private static void throwAsUnchecked(Exception exception) throws E { + throw (E)exception; + } + @FunctionalInterface + public interface Consumer_WithExceptions { + void accept(T t) throws E; + } + public static Consumer rethrowConsumer(Consumer_WithExceptions consumer) { + return t -> { + try { consumer.accept(t); } + catch (Exception exception) { throwAsUnchecked(exception); } + }; + } + + public static void main(String[] args) throws Exception { + + // Warmup helper methods + Arrays.stream(TestStringIntrinsics2.class.getDeclaredMethods()) + .filter(m -> m.isAnnotationPresent(Test.class)) + .filter(m -> m.getAnnotation(Test.class).warmup() > 0) + .forEach(rethrowConsumer(m -> { + Test a = m.getAnnotation(Test.class); + System.out.println("Warming up " + m + " " + a.warmup() + " time(s) "); + for (int i=0; i < a.warmup(); i++) { + m.invoke(null, (Object[])a.warmupArgs()); + } + })); + + // Compile helper methods + Arrays.stream(TestStringIntrinsics2.class.getDeclaredMethods()) + .filter(m -> m.isAnnotationPresent(Test.class)) + .filter(m -> m.getAnnotation(Test.class).compileAt() > 0) + .forEach(rethrowConsumer(m -> { + Test a = m.getAnnotation(Test.class); + if (WB.isMethodCompilable(m, a.compileAt())) { + WB.enqueueMethodForCompilation(m, a.compileAt()); + while (WB.isMethodQueuedForCompilation(m)) Thread.sleep(10); + System.out.println(m + " compiled at " + WB.getMethodCompilationLevel(m)); + } else { + System.out.println("Can't compile " + m + " at level " + a.compileAt()); + } + })); + + // Run test methods + Arrays.stream(TestStringIntrinsics2.class.getDeclaredMethods()) + .filter(m -> m.isAnnotationPresent(Test.class)) + .filter(m -> m.getAnnotation(Test.class).role() == Role.TEST_ENTRY) + .forEach(rethrowConsumer(m -> { + System.out.print("Executing " + m); + m.invoke(null, (Object[])null); + System.out.println(" - OK"); + })); + } + + static String text = "\n" + ""; + static String text2 = "\n" + ""; + static String[] ss = text.split("\n"); + static String[] ss2 = null; + static String needle = ""; + + @Test(role = Role.TEST_ENTRY) + public static void test_indexOf_no_match() { + int res = indexOf_no_match_unknown_needle(ss[0], ""); + assertEquals(res, -1, "test_indexOf_no_match_unknown_needle matched at: " + res); + res = indexOf_no_match_imm_needle(ss[0]); + assertEquals(res, -1, "test_indexOf_no_match_imm_needle matched at: " + res); + res = indexOf_no_match_imm2_needle(ss[0]); + assertEquals(res, -1, "test_indexOf_no_match_imm2_needle matched at: " + res); + + if (ss2 == null) ss2 = text.split("\n"); + res = indexOf_no_match_unknown_needle(ss2[0], ""); + assertEquals(res, -1, "test_indexOf_no_match_unknown_needle matched at: " + res); + res = indexOf_no_match_imm_needle(ss2[0]); + assertEquals(res, -1, "test_indexOf_no_match_imm_needle matched at: " + res); + res = indexOf_no_match_imm2_needle(ss2[0]); + assertEquals(res, -1, "test_indexOf_no_match_imm2_needle matched at: " + res); + res = indexOf_no_match_imm1_needle(ss2[0]); + assertEquals(res, -1, "test_indexOf_no_match_imm1_needle matched at: " + res); + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "", "" }) + static int indexOf_no_match_unknown_needle(String s, String needle) { + int index = s.indexOf(needle); + return index; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static int indexOf_no_match_imm_needle(String s) { + int index = s.indexOf(""); + return index; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static int indexOf_no_match_imm2_needle(String s) { + int index = s.indexOf("" }) + static int indexOf_no_match_imm1_needle(String s) { + int index = s.indexOf("m"); + return index; + } + + @Test(role = Role.TEST_ENTRY) + public static void test_indexOf_reads_past_string() { + if (ss == null) ss = text.split("\n"); + String res = indexOf_reads_past_string_unknown_needle(ss[0], ""); + assertEquals(res, null, "test_indexOf_reads_past_string_unknown_needle " + res); + res = indexOf_reads_past_string_imm_needle(ss[0]); + assertEquals(res, null, "test_indexOf_reads_past_string_imm_needle " + res); + res = indexOf_reads_past_string_imm2_needle(ss[0]); + assertEquals(res, null, "test_indexOf_reads_past_string_imm2_needle " + res); + res = indexOf_reads_past_string_imm1_needle(ss[0]); + assertEquals(res, null, "test_indexOf_reads_past_string_imm1_needle " + res); + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "", "" }) + static String indexOf_reads_past_string_unknown_needle(String s, String needle) { + int index = s.indexOf(needle); + if (index > s.length()) { + return "Found needle \"" + needle + "\" behind string of length " + s.length() + + " at position " + index + "."; + } + return null; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static String indexOf_reads_past_string_imm_needle(String s) { + int index = s.indexOf(""); + if (index > s.length()) { + return "Found needle \"\" behind string of length " + s.length() + " at position " + index + "."; + } + return null; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static String indexOf_reads_past_string_imm2_needle(String s) { + int index = s.indexOf(" s.length()) { + return "Found needle \"" }) + static String indexOf_reads_past_string_imm1_needle(String s) { + int index = s.indexOf("h"); + if (index > s.length()) { + return "Found needle \""); + assertEquals(len3, res + 5, testname); + res = indexOf_match_at_end_of_string_unknown_needle(text4, ""); + assertEquals(len4, res + 5, testname); + res = indexOf_match_at_end_of_string_unknown_needle(text5, ""); + assertEquals(len5, res + 5, testname); + res = indexOf_match_at_end_of_string_unknown_needle(text6, ""); + assertEquals(len6, res + 5, testname); + + res = indexOf_match_at_end_of_string_imm_needle(text3); + assertEquals(len3, res + 5, testname); + res = indexOf_match_at_end_of_string_imm_needle(text4); + assertEquals(len4, res + 5, testname); + res = indexOf_match_at_end_of_string_imm_needle(text5); + assertEquals(len5, res + 5, testname); + res = indexOf_match_at_end_of_string_imm_needle(text6); + assertEquals(len6, res + 5, testname); + + res = indexOf_match_at_end_of_string_imm2_needle(text7); + assertEquals(text7.length(), res + 2, testname); + res = indexOf_match_at_end_of_string_imm2_needle(text8); + assertEquals(text8.length(), res + 2, testname); + res = indexOf_match_at_end_of_string_imm2_needle(text9); + assertEquals(text9.length(), res + 2, testname); + res = indexOf_match_at_end_of_string_imm2_needle(text10); + assertEquals(text10.length(), res + 2, testname); + + res = indexOf_match_at_end_of_string_imm1_needle(text7); + assertEquals(text7.length(), res + 1, testname); + res = indexOf_match_at_end_of_string_imm1_needle(text8); + assertEquals(text8.length(), res + 1, testname); + res = indexOf_match_at_end_of_string_imm1_needle(text9); + assertEquals(text9.length(), res + 1, testname); + res = indexOf_match_at_end_of_string_imm1_needle(text10); + assertEquals(text10.length(), res + 1, testname); + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "", "" }) + static int indexOf_match_at_end_of_string_unknown_needle(String s, String needle) { + int index = s.indexOf(needle); + return index; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static int indexOf_match_at_end_of_string_imm_needle(String s) { + int index = s.indexOf(""); + return index; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static int indexOf_match_at_end_of_string_imm2_needle(String s) { + int index = s.indexOf("" }) + static int indexOf_match_at_end_of_string_imm1_needle(String s) { + int index = s.indexOf("h"); + return index; + } + + static String s0_1 = text3.substring(0, len3-1); + static String s0_2 = text3.substring(0, len3-2); + static String s0_3 = text3.substring(0, len3-3); + static String s0_4 = text3.substring(0, len3-4); + static String s1_1 = text4.substring(0, len4-1); + static String s1_2 = text4.substring(0, len4-2); + static String s1_3 = text4.substring(0, len4-3); + static String s1_4 = text4.substring(0, len4-4); + static String s2_1 = text5.substring(0, len5-1); + static String s2_2 = text5.substring(0, len5-2); + static String s2_3 = text5.substring(0, len5-3); + static String s2_4 = text5.substring(0, len5-4); + static String s3_1 = text6.substring(0, len6-1); + static String s3_2 = text6.substring(0, len6-2); + static String s3_3 = text6.substring(0, len6-3); + static String s3_4 = text6.substring(0, len6-4); + + static String s0_1x = text7 .substring(0, text7 .length()-1); + static String s1_1x = text8 .substring(0, text8 .length()-1); + static String s2_1x = text9 .substring(0, text9 .length()-1); + static String s3_1x = text10.substring(0, text10.length()-1); + + @Test(role = Role.TEST_ENTRY) + public static void test_indexOf_match_spans_end_of_string() { + String res = null; + res = indexOf_match_spans_end_of_string_unknown_needle(s0_1, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s0_1 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s0_2, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s0_2 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s0_3, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s0_3 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s0_4, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s0_4 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s1_1, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s1_1 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s1_2, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s1_2 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s1_3, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s1_3 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s1_4, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s1_4 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s2_1, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s2_1 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s2_2, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s2_2 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s2_3, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s2_3 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s2_4, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s2_4 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s3_1, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s3_1 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s3_2, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s3_2 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s3_3, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s3_3 " + res); + res = indexOf_match_spans_end_of_string_unknown_needle(s3_4, ""); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_unknown_needle s3_4 " + res); + + res = indexOf_match_spans_end_of_string_imm_needle(s0_1); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s0_1 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s0_2); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s0_2 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s0_3); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s0_3 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s0_4); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s0_4 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s1_1); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s1_1 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s1_2); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s1_2 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s1_3); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s1_3 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s1_4); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s1_4 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s2_1); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s2_1 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s2_2); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s2_2 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s2_3); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s2_3 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s2_4); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s2_4 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s3_1); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s3_1 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s3_2); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s3_2 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s3_3); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s3_3 " + res); + res = indexOf_match_spans_end_of_string_imm_needle(s3_4); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm_needle s3_4 " + res); + + res = indexOf_match_spans_end_of_string_imm2_needle(s0_1x); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm2_needle s0_1x " + res); + res = indexOf_match_spans_end_of_string_imm2_needle(s1_1x); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm2_needle s1_1x " + res); + res = indexOf_match_spans_end_of_string_imm2_needle(s2_1x); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm2_needle s2_1x " + res); + res = indexOf_match_spans_end_of_string_imm2_needle(s3_1x); + assertEquals(res, null, "test_indexOf_match_spans_end_of_string_imm2_needle s3_1x " + res); + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "" }) + static String indexOf_match_spans_end_of_string_unknown_needle(String s, String needle) { + int index = s.indexOf(needle); + if (index > -1) { + return "Found needle \"" + needle + "\" that is spanning the end of the string: " + s + "."; + } + return null; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { ""); + if (index > -1) { + return "Found needle \"\" that is spanning the end of the string: " + s + "."; + } + return null; + } + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "<" }) + static String indexOf_match_spans_end_of_string_imm2_needle(String s) { + int index = s.indexOf(" -1) { + return "Found needle \"0 + { + // check first character optimization + assertEquals(1, asmStringCompareTo("5", "4"), + "TestOther.asmStringCompareTo(\"5\", \"4\")"); + + // check real comparisons + assertEquals(1, asmStringCompareTo("diff5", "diff4"), + "TestOther.asmStringCompareTo(\"diff5\", \"diff4\")"); + assertEquals(10, asmStringCompareTo("123456789A", ""), + "TestOther.asmStringCompareTo(\"123456789A\", \"\")"); + assertEquals(10, asmStringCompareTo("ZYX123456789A", "ZYX"), + "TestOther.asmStringCompareTo(\"ZYX123456789A\", \"ZYX\")"); + } + + // very long strings (100k) + { + char[] ac = new char[(100 * 1024)]; + for (int i = 0; i < (100 * 1024); i += 315) + ac[i] = (char) ((i % 12) + 'a'); + char[] bc = new char[(100 * 1024)]; + for (int i = 0; i < (100 * 1024); i += 315) + bc[i] = (char) ((i % 12) + 'a'); + + ac[(100 * 1024) - 1] = '2'; + bc[(100 * 1024) - 1] = '2'; + String a1 = new String(ac); + String b1 = new String(bc); + assertEquals(0, asmStringCompareTo(a1, b1), + "TestOther.asmStringCompareTo(very_long_strings_1)"); + + ac[(100 * 1024) - 1] = 'X'; + bc[(100 * 1024) - 1] = 'Z'; + String a2 = new String(ac); + String b2 = new String(bc); + assertEquals(-2, asmStringCompareTo(a2, b2), + "TestOther.asmStringCompareTo(very_long_strings_2)"); + } + + // very very long strings (2M) + { + char[] ac = new char[(2 * 1024 * 1024)]; + for (int i = 0; i < (2 * 1024 * 1024); i += 315) + ac[i] = (char) ((i % 12) + 'a'); + char[] bc = new char[(2 * 1024 * 1024)]; + for (int i = 0; i < (2 * 1024 * 1024); i += 315) + bc[i] = (char) ((i % 12) + 'a'); + + ac[(2 * 1024 * 1024) - 1] = '3'; + bc[(2 * 1024 * 1024) - 1] = '3'; + String a1 = new String(ac); + String b1 = new String(bc); + assertEquals(0, asmStringCompareTo(a1, b1), + "TestOther.asmStringCompareTo(very_very_long_strings_1)"); + + ac[(2 * 1024 * 1024) - 1] = 'W'; + bc[(2 * 1024 * 1024) - 1] = 'Z'; + String a2 = new String(ac); + String b2 = new String(bc); + assertEquals(-3, asmStringCompareTo(a2, b2), + "TestOther.asmStringCompareTo(very_very_long_strings_2)"); + } + } + + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1, warmupArgs = { "abc", "abcd" }) + public static boolean asmStringEquals(String a, String b) { + return a.equals(b); + } + + static String a1 = "abcd"; + static String b1 = "abcd"; + static final String a2 = "1234"; + static final String b2 = "1234"; + + @Test(role = Role.TEST_HELPER, compileAt = 4, warmup = 1) + public static boolean asmStringEqualsConst() { + boolean ret = a1.equals(b1); + ret &= a2.equals(b2); + ret &= !a2.equals(b1); + ret &= "ABCD".equals("ABCD"); + return ret; + } + + + @Test(role = Role.TEST_ENTRY) + public static void test_asmStringEquals() { + // null + { + assertFalse(asmStringEquals("not null", null), + "TestOther.asmStringEquals(\"not null\", null)"); + } + + // true + { + // check constant optimization + assertTrue(asmStringEqualsConst(), + "TestOther.asmStringEqualsConst(\"\", \"\")"); + + // check length 0 optimization + assertTrue(asmStringEquals("", ""), + "TestOther.asmStringEquals(\"\", \"\")"); + + // check first character optimization + assertTrue(asmStringEquals("A", "A"), + "TestOther.asmStringEquals(\"A\", \"A\")"); + + // check real comparisons + assertTrue(asmStringEquals(new String("eq") + new String("ual"), "equal"), + "TestOther.asmStringEquals(\"equal\", \"equal\")"); + assertTrue(asmStringEquals("textABC", "textABC"), + "TestOther.asmStringEquals(\"textABC\", \"textABC\")"); + assertTrue(asmStringEquals(new String("abcdefgh01234") + + new String("56abcdefgh0123456abcdefgh0123456"), + "abcdefgh0123456abcdefgh0123456abcdefgh0123456"), + "TestOther.asmStringEquals(\"abcdefgh0123456abcdefgh0123456abcdefgh0123456\", " + + "\"abcdefgh0123456abcdefgh0123456abcdefgh0123456\")"); + } + } + +} From 5456fcf370c1b17522f15a52e9d165380ce243a2 Mon Sep 17 00:00:00 2001 From: Roland Schatz Date: Wed, 20 Jan 2016 14:22:46 +0100 Subject: [PATCH 107/212] 8147599: [JVMCI] simplify code installation interface Reviewed-by: twisti --- .../src/jdk/vm/ci/code/CodeCacheProvider.java | 35 +- .../src/jdk/vm/ci/code/CompilationResult.java | 1078 ----------------- .../src/jdk/vm/ci/code/CompiledCode.java | 29 + .../src/jdk/vm/ci/code/DataSection.java | 331 ----- .../src/jdk/vm/ci/code/package-info.java | 29 +- .../src/jdk/vm/ci/code/site/Call.java | 87 ++ .../vm/ci/code/site/ConstantReference.java | 62 + .../src/jdk/vm/ci/code/site/DataPatch.java | 73 ++ .../vm/ci/code/site/DataSectionReference.java | 73 ++ .../jdk/vm/ci/code/site/ExceptionHandler.java | 56 + .../src/jdk/vm/ci/code/site/Infopoint.java | 112 ++ .../ci/code/{ => site}/InfopointReason.java | 4 +- .../src/jdk/vm/ci/code/site/Mark.java | 64 + .../src/jdk/vm/ci/code/site/Reference.java | 35 + .../src/jdk/vm/ci/code/site/Site.java | 53 + .../ci/hotspot/HotSpotCodeCacheProvider.java | 121 +- .../vm/ci/hotspot/HotSpotCompiledCode.java | 292 ++--- .../vm/ci/hotspot/HotSpotCompiledNmethod.java | 27 +- .../vm/ci/hotspot/HotSpotJVMCIRuntime.java | 10 +- .../vm/ci/hotspot/HotSpotVMEventListener.java | 8 +- .../src/share/vm/jvmci/jvmciCodeInstaller.cpp | 73 +- .../src/share/vm/jvmci/jvmciCodeInstaller.hpp | 8 +- .../src/share/vm/jvmci/jvmciJavaClasses.hpp | 57 +- .../share/vm/jvmci/systemDictionary_jvmci.hpp | 20 +- .../src/share/vm/jvmci/vmSymbols_jvmci.hpp | 24 +- .../jvmci/code/CodeInstallationTest.java | 23 +- .../compiler/jvmci/code/DataPatchTest.java | 18 +- .../compiler/jvmci/code/TestAssembler.java | 159 ++- .../jvmci/code/amd64/AMD64TestAssembler.java | 139 ++- .../jvmci/code/sparc/SPARCTestAssembler.java | 75 +- .../jvmci/errors/CodeInstallerTest.java | 26 +- .../errors/TestInvalidCompilationResult.java | 131 +- .../jvmci/errors/TestInvalidDebugInfo.java | 19 +- .../jvmci/errors/TestInvalidOopMap.java | 20 +- .../events/JvmciNotifyInstallEventTest.java | 23 +- 35 files changed, 1229 insertions(+), 2165 deletions(-) delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationResult.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DataSection.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java rename hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/{ => site}/InfopointReason.java (91%) create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java index 2beba7907df..7e836d22f21 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java @@ -22,11 +22,8 @@ */ package jdk.vm.ci.code; -import jdk.vm.ci.code.CompilationResult.Call; -import jdk.vm.ci.code.CompilationResult.DataPatch; -import jdk.vm.ci.code.CompilationResult.Mark; -import jdk.vm.ci.code.DataSection.Data; -import jdk.vm.ci.meta.Constant; +import jdk.vm.ci.code.site.Call; +import jdk.vm.ci.code.site.Mark; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.SpeculationLog; @@ -40,7 +37,7 @@ public interface CodeCacheProvider { * default implementation of the method. * * @param method a method implemented by the installed code - * @param compResult the compilation result to be added + * @param compiledCode the compiled code to be added * @param log the speculation log to be used * @param installedCode a predefined {@link InstalledCode} object to use as a reference to the * installed code. If {@code null}, a new {@link InstalledCode} object will be @@ -48,8 +45,8 @@ public interface CodeCacheProvider { * @return a reference to the ready-to-run code * @throws BailoutException if the code installation failed */ - default InstalledCode addCode(ResolvedJavaMethod method, CompilationResult compResult, SpeculationLog log, InstalledCode installedCode) { - return installCode(new CompilationRequest(method), compResult, installedCode, log, false); + default InstalledCode addCode(ResolvedJavaMethod method, CompiledCode compiledCode, SpeculationLog log, InstalledCode installedCode) { + return installCode(method, compiledCode, installedCode, log, false); } /** @@ -58,21 +55,20 @@ public interface CodeCacheProvider { * * @param method a method implemented by the installed code and for which the installed code * becomes the default implementation - * @param compResult the compilation result to be added + * @param compiledCode the compiled code to be added * @return a reference to the ready-to-run code * @throws BailoutException if the code installation failed */ - default InstalledCode setDefaultCode(ResolvedJavaMethod method, CompilationResult compResult) { - return installCode(new CompilationRequest(method), compResult, null, null, true); + default InstalledCode setDefaultCode(ResolvedJavaMethod method, CompiledCode compiledCode) { + return installCode(method, compiledCode, null, null, true); } /** * Installs code based on a given compilation result. * - * @param compRequest details of the method compiled to produce {@code compResult} or - * {@code null} if the input to {@code compResult} was not a - * {@link ResolvedJavaMethod} - * @param compResult the compilation result to be added + * @param method the method compiled to produce {@code compiledCode} or {@code null} if the + * input to {@code compResult} was not a {@link ResolvedJavaMethod} + * @param compiledCode the compiled code to be added * @param installedCode a pre-allocated {@link InstalledCode} object to use as a reference to * the installed code. If {@code null}, a new {@link InstalledCode} object will be * created. @@ -84,7 +80,7 @@ public interface CodeCacheProvider { * @return a reference to the compiled and ready-to-run installed code * @throws BailoutException if the code installation failed */ - InstalledCode installCode(CompilationRequest compRequest, CompilationResult compResult, InstalledCode installedCode, SpeculationLog log, boolean isDefault); + InstalledCode installCode(ResolvedJavaMethod method, CompiledCode compiledCode, InstalledCode installedCode, SpeculationLog log, boolean isDefault); /** * Invalidates {@code installedCode} such that {@link InvalidInstalledCodeException} will be @@ -120,13 +116,6 @@ public interface CodeCacheProvider { */ int getMinimumOutgoingSize(); - /** - * Create a {@link Data} item for one or more {@link Constant Constants}, that can be used in a - * {@link DataPatch}. If more than one {@link Constant} is given, then they are tightly packed - * into a single {@link Data} item. - */ - Data createDataItem(Constant... constants); - /** * Gets a description of the target architecture. */ diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationResult.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationResult.java deleted file mode 100644 index b8c5ff4843a..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationResult.java +++ /dev/null @@ -1,1078 +0,0 @@ -/* - * Copyright (c) 2009, 2014, 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. - */ -package jdk.vm.ci.code; - -import static java.util.Collections.emptyList; -import static java.util.Collections.unmodifiableList; -import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -import jdk.vm.ci.meta.Assumptions.Assumption; -import jdk.vm.ci.meta.InvokeTarget; -import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.MetaUtil; -import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.vm.ci.meta.VMConstant; - -/** - * Represents the output from compiling a method, including the compiled machine code, associated - * data and references, relocation information, deoptimization information, etc. - */ -public class CompilationResult { - - /** - * Represents a code position with associated additional information. - */ - public abstract static class Site { - - /** - * The position (or offset) of this site with respect to the start of the target method. - */ - public final int pcOffset; - - public Site(int pos) { - this.pcOffset = pos; - } - - @Override - public final int hashCode() { - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public abstract boolean equals(Object obj); - } - - /** - * Represents an infopoint with associated debug info. Note that safepoints are also infopoints. - */ - public static class Infopoint extends Site implements Comparable { - - public final DebugInfo debugInfo; - - public final InfopointReason reason; - - public Infopoint(int pcOffset, DebugInfo debugInfo, InfopointReason reason) { - super(pcOffset); - this.debugInfo = debugInfo; - this.reason = reason; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(pcOffset); - sb.append("[]"); - appendDebugInfo(sb, debugInfo); - return sb.toString(); - } - - @Override - public int compareTo(Infopoint o) { - if (pcOffset < o.pcOffset) { - return -1; - } else if (pcOffset > o.pcOffset) { - return 1; - } - return this.reason.compareTo(o.reason); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj != null && obj.getClass() == getClass()) { - Infopoint that = (Infopoint) obj; - if (this.pcOffset == that.pcOffset && Objects.equals(this.debugInfo, that.debugInfo) && Objects.equals(this.reason, that.reason)) { - return true; - } - } - return false; - } - } - - public enum MetaSpaceAccessType { - Move, - Store, // store only works for compressed oops (memory <- 32bit value). Compressed oops is - // not supported using AOT. TODO: Look at HotSpotStoreConstantOp - Compare; // HotSpotCompareMemoryConstantOp, HotSpotCompareConstantOp - - private MetaSpaceAccessType() { - } - } - - /** - * Represents a meta space pointer access in the code. - */ - public static final class MetaSpaceAccess extends Infopoint { - - /** - * Metaspace reference. - */ - public final Object reference; // Object here is a HotSpotResolvedObjectType or a - // HotSpotMetaSpaceConstant - - public final MetaSpaceAccessType type; - - /** - * Instruction size. - */ - public final int instructionSize; - - public MetaSpaceAccess(Object reference, int instructionSize, MetaSpaceAccessType type, int pcOffset, DebugInfo debugInfo) { - super(pcOffset, debugInfo, InfopointReason.METASPACE_ACCESS); - this.type = type; - this.reference = reference; - this.instructionSize = instructionSize; - } - } - - /** - * Represents a call in the code. - */ - public static final class Call extends Infopoint { - - /** - * The target of the call. - */ - public final InvokeTarget target; - - /** - * The size of the call instruction. - */ - public final int size; - - /** - * Specifies if this call is direct or indirect. A direct call has an immediate operand - * encoding the absolute or relative (to the call itself) address of the target. An indirect - * call has a register or memory operand specifying the target address of the call. - */ - public final boolean direct; - - public Call(InvokeTarget target, int pcOffset, int size, boolean direct, DebugInfo debugInfo) { - super(pcOffset, debugInfo, InfopointReason.CALL); - this.size = size; - this.target = target; - this.direct = direct; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof Call && super.equals(obj)) { - Call that = (Call) obj; - if (this.size == that.size && this.direct == that.direct && Objects.equals(this.target, that.target)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(pcOffset); - sb.append('['); - sb.append(target); - sb.append(']'); - - if (debugInfo != null) { - appendDebugInfo(sb, debugInfo); - } - - return sb.toString(); - } - } - - /** - * Represents some external data that is referenced by the code. - */ - public abstract static class Reference { - - @Override - public abstract int hashCode(); - - @Override - public abstract boolean equals(Object obj); - } - - public static final class ConstantReference extends Reference { - - private final VMConstant constant; - - public ConstantReference(VMConstant constant) { - this.constant = constant; - } - - public VMConstant getConstant() { - return constant; - } - - @Override - public String toString() { - return constant.toString(); - } - - @Override - public int hashCode() { - return constant.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof ConstantReference) { - ConstantReference that = (ConstantReference) obj; - return Objects.equals(this.constant, that.constant); - } - return false; - } - } - - public static final class DataSectionReference extends Reference { - - private boolean initialized; - private int offset; - - public DataSectionReference() { - // will be set after the data section layout is fixed - offset = 0xDEADDEAD; - } - - public int getOffset() { - assert initialized; - - return offset; - } - - public void setOffset(int offset) { - assert !initialized; - initialized = true; - - this.offset = offset; - } - - @Override - public int hashCode() { - return offset; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof DataSectionReference) { - DataSectionReference that = (DataSectionReference) obj; - return this.offset == that.offset; - } - return false; - } - - @Override - public String toString() { - if (initialized) { - return String.format("DataSection[0x%x]", offset); - } else { - return "DataSection[?]"; - } - } - } - - /** - * Represents a code site that references some data. The associated data can be either a - * {@link DataSectionReference reference} to the data section, or it may be an inlined - * {@link JavaConstant} that needs to be patched. - */ - public static final class DataPatch extends Site { - - public Reference reference; - public Object note; - - public DataPatch(int pcOffset, Reference reference) { - super(pcOffset); - this.reference = reference; - this.note = null; - } - - public DataPatch(int pcOffset, Reference reference, Object note) { - super(pcOffset); - this.reference = reference; - this.note = note; - } - - @Override - public String toString() { - if (note != null) { - return String.format("%d[, note: %s]", pcOffset, reference.toString(), note.toString()); - } else { - return String.format("%d[]", pcOffset, reference.toString()); - } - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof DataPatch) { - DataPatch that = (DataPatch) obj; - if (this.pcOffset == that.pcOffset && Objects.equals(this.reference, that.reference) && Objects.equals(this.note, that.note)) { - return true; - } - } - return false; - } - } - - /** - * Provides extra information about instructions or data at specific positions in - * {@link CompilationResult#getTargetCode()}. This is optional information that can be used to - * enhance a disassembly of the code. - */ - public abstract static class CodeAnnotation { - - public final int position; - - public CodeAnnotation(int position) { - this.position = position; - } - - @Override - public final int hashCode() { - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public abstract boolean equals(Object obj); - } - - /** - * A string comment about one or more instructions at a specific position in the code. - */ - public static final class CodeComment extends CodeAnnotation { - - public final String value; - - public CodeComment(int position, String comment) { - super(position); - this.value = comment; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof CodeComment) { - CodeComment that = (CodeComment) obj; - if (this.position == that.position && this.value.equals(that.value)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return getClass().getSimpleName() + "@" + position + ": " + value; - } - } - - /** - * Describes a table of signed offsets embedded in the code. The offsets are relative to the - * starting address of the table. This type of table maybe generated when translating a - * multi-way branch based on a key value from a dense value set (e.g. the {@code tableswitch} - * JVM instruction). - * - * The table is indexed by the contiguous range of integers from {@link #low} to {@link #high} - * inclusive. - */ - public static final class JumpTable extends CodeAnnotation { - - /** - * The low value in the key range (inclusive). - */ - public final int low; - - /** - * The high value in the key range (inclusive). - */ - public final int high; - - /** - * The size (in bytes) of each table entry. - */ - public final int entrySize; - - public JumpTable(int position, int low, int high, int entrySize) { - super(position); - this.low = low; - this.high = high; - this.entrySize = entrySize; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof JumpTable) { - JumpTable that = (JumpTable) obj; - if (this.position == that.position && this.entrySize == that.entrySize && this.low == that.low && this.high == that.high) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return getClass().getSimpleName() + "@" + position + ": [" + low + " .. " + high + "]"; - } - } - - /** - * Represents exception handler information for a specific code position. It includes the catch - * code position as well as the caught exception type. - */ - public static final class ExceptionHandler extends Site { - - public final int handlerPos; - - ExceptionHandler(int pcOffset, int handlerPos) { - super(pcOffset); - this.handlerPos = handlerPos; - } - - @Override - public String toString() { - return String.format("%d[]", pcOffset, handlerPos); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof ExceptionHandler) { - ExceptionHandler that = (ExceptionHandler) obj; - if (this.pcOffset == that.pcOffset && this.handlerPos == that.handlerPos) { - return true; - } - } - return false; - } - } - - /** - * Represents a mark in the machine code that can be used by the runtime for its own purposes. A - * mark can reference other marks. - */ - public static final class Mark extends Site { - - public final Object id; - - public Mark(int pcOffset, Object id) { - super(pcOffset); - this.id = id; - } - - @Override - public String toString() { - if (id == null) { - return String.format("%d[]", pcOffset); - } else if (id instanceof Integer) { - return String.format("%d[]", pcOffset, Integer.toHexString((Integer) id)); - } else { - return String.format("%d[]", pcOffset, id.toString()); - } - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof Mark) { - Mark that = (Mark) obj; - if (this.pcOffset == that.pcOffset && Objects.equals(this.id, that.id)) { - return true; - } - } - return false; - } - } - - /** - * Specifies whether this compilation is a {@code +ImmutableCode} {@code +GeneratePIC} - * compilation. - */ - private final boolean isImmutablePIC; - - private boolean closed; - - private int entryBCI = -1; - - private final DataSection dataSection = new DataSection(); - - private final List infopoints = new ArrayList<>(); - private final List dataPatches = new ArrayList<>(); - private final List exceptionHandlers = new ArrayList<>(); - private final List marks = new ArrayList<>(); - - private int totalFrameSize = -1; - private int customStackAreaOffset = -1; - - private final String name; - - /** - * The buffer containing the emitted machine code. - */ - private byte[] targetCode; - - /** - * The leading number of bytes in {@link #targetCode} containing the emitted machine code. - */ - private int targetCodeSize; - - private ArrayList annotations; - - private Assumption[] assumptions; - - /** - * The list of the methods whose bytecodes were used as input to the compilation. If - * {@code null}, then the compilation did not record method dependencies. Otherwise, the first - * element of this array is the root method of the compilation. - */ - private ResolvedJavaMethod[] methods; - - private int bytecodeSize; - - private boolean hasUnsafeAccess; - - public CompilationResult() { - this(null); - } - - public CompilationResult(String name) { - this.name = name; - this.isImmutablePIC = false; - } - - public CompilationResult(boolean isImmutablePIC) { - this.name = null; - this.isImmutablePIC = isImmutablePIC; - } - - @Override - public int hashCode() { - // CompilationResult instances should not be used as hash map keys - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - if (methods != null) { - return getClass().getName() + "[" + methods[0].format("%H.%n(%p)%r") + "]"; - } - return identityHashCodeString(this); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj != null && obj.getClass() == getClass()) { - CompilationResult that = (CompilationResult) obj; - // @formatter:off - if (this.entryBCI == that.entryBCI && - this.customStackAreaOffset == that.customStackAreaOffset && - this.totalFrameSize == that.totalFrameSize && - this.targetCodeSize == that.targetCodeSize && - Objects.equals(this.name, that.name) && - Objects.equals(this.annotations, that.annotations) && - Objects.equals(this.dataSection, that.dataSection) && - Objects.equals(this.exceptionHandlers, that.exceptionHandlers) && - Objects.equals(this.dataPatches, that.dataPatches) && - Objects.equals(this.infopoints, that.infopoints) && - Objects.equals(this.marks, that.marks) && - Arrays.equals(this.assumptions, that.assumptions) && - Arrays.equals(targetCode, that.targetCode)) { - return true; - } - // @formatter:on - } - return false; - } - - /** - * @return true is this is a {@code +ImmutableCode} {@code +GeneratePIC} compilation, false - * otherwise. - */ - public boolean isImmutablePIC() { - return isImmutablePIC; - } - - /** - * @return the entryBCI - */ - public int getEntryBCI() { - return entryBCI; - } - - /** - * @param entryBCI the entryBCI to set - */ - public void setEntryBCI(int entryBCI) { - checkOpen(); - this.entryBCI = entryBCI; - } - - /** - * Sets the assumptions made during compilation. - */ - public void setAssumptions(Assumption[] assumptions) { - checkOpen(); - this.assumptions = assumptions; - } - - /** - * Gets the assumptions made during compilation. - * - * The caller must not modify the contents of the returned array. - */ - public Assumption[] getAssumptions() { - return assumptions; - } - - /** - * Sets the methods whose bytecodes were used as input to the compilation. - * - * @param rootMethod the root method of the compilation - * @param inlinedMethods the methods inlined during compilation - */ - public void setMethods(ResolvedJavaMethod rootMethod, Collection inlinedMethods) { - checkOpen(); - assert rootMethod != null; - assert inlinedMethods != null; - if (inlinedMethods.contains(rootMethod)) { - methods = inlinedMethods.toArray(new ResolvedJavaMethod[inlinedMethods.size()]); - for (int i = 0; i < methods.length; i++) { - if (methods[i].equals(rootMethod)) { - if (i != 0) { - ResolvedJavaMethod tmp = methods[0]; - methods[0] = methods[i]; - methods[i] = tmp; - } - break; - } - } - } else { - methods = new ResolvedJavaMethod[1 + inlinedMethods.size()]; - methods[0] = rootMethod; - int i = 1; - for (ResolvedJavaMethod m : inlinedMethods) { - methods[i++] = m; - } - } - } - - /** - * Gets the methods whose bytecodes were used as input to the compilation. - * - * The caller must not modify the contents of the returned array. - * - * @return {@code null} if the compilation did not record method dependencies otherwise the - * methods whose bytecodes were used as input to the compilation with the first element - * being the root method of the compilation - */ - public ResolvedJavaMethod[] getMethods() { - return methods; - } - - public void setBytecodeSize(int bytecodeSize) { - checkOpen(); - this.bytecodeSize = bytecodeSize; - } - - public int getBytecodeSize() { - return bytecodeSize; - } - - public DataSection getDataSection() { - return dataSection; - } - - /** - * The total frame size of the method in bytes. This includes the return address pushed onto the - * stack, if any. - * - * @return the frame size - */ - public int getTotalFrameSize() { - assert totalFrameSize != -1 : "frame size not yet initialized!"; - return totalFrameSize; - } - - /** - * Sets the total frame size in bytes. This includes the return address pushed onto the stack, - * if any. - * - * @param size the size of the frame in bytes - */ - public void setTotalFrameSize(int size) { - checkOpen(); - totalFrameSize = size; - } - - /** - * Sets the machine that has been generated by the compiler. - * - * @param code the machine code generated - * @param size the size of the machine code - */ - public void setTargetCode(byte[] code, int size) { - checkOpen(); - targetCode = code; - targetCodeSize = size; - } - - /** - * Records a data patch in the code section. The data patch can refer to something in the - * {@link DataSectionReference data section} or directly to an {@link ConstantReference inlined - * constant}. - * - * @param codePos The position in the code that needs to be patched. - * @param ref The reference that should be inserted in the code. - */ - public void recordDataPatch(int codePos, Reference ref) { - checkOpen(); - assert codePos >= 0 && ref != null; - dataPatches.add(new DataPatch(codePos, ref)); - } - - /** - * Records a data patch in the code section. The data patch can refer to something in the - * {@link DataSectionReference data section} or directly to an {@link ConstantReference inlined - * constant}. - * - * @param codePos The position in the code that needs to be patched. - * @param ref The reference that should be inserted in the code. - * @param note The note attached to data patch for use by post-processing tools - */ - public void recordDataPatchWithNote(int codePos, Reference ref, Object note) { - assert codePos >= 0 && ref != null; - dataPatches.add(new DataPatch(codePos, ref, note)); - } - - /** - * Records metaspace access. - */ - public void recordMetaspaceAccess(Object reference, int instructionSize, MetaSpaceAccessType type, int codePos, DebugInfo debugInfo) { - final MetaSpaceAccess metaspace = new MetaSpaceAccess(reference, instructionSize, type, codePos, debugInfo); - addInfopoint(metaspace); - } - - /** - * Records a call in the code array. - * - * @param codePos the position of the call in the code array - * @param size the size of the call instruction - * @param target the being called - * @param debugInfo the debug info for the call - * @param direct specifies if this is a {@linkplain Call#direct direct} call - */ - public void recordCall(int codePos, int size, InvokeTarget target, DebugInfo debugInfo, boolean direct) { - checkOpen(); - final Call call = new Call(target, codePos, size, direct, debugInfo); - addInfopoint(call); - } - - /** - * Records an exception handler for this method. - * - * @param codePos the position in the code that is covered by the handler - * @param handlerPos the position of the handler - */ - public void recordExceptionHandler(int codePos, int handlerPos) { - checkOpen(); - assert validateExceptionHandlerAdd(codePos, handlerPos) : String.format("Duplicate exception handler for pc 0x%x handlerPos 0x%x", codePos, handlerPos); - exceptionHandlers.add(new ExceptionHandler(codePos, handlerPos)); - } - - /** - * Validate if the exception handler for codePos already exists and handlerPos is different. - * - * @param codePos - * @param handlerPos - * @return true if the validation is successful - */ - private boolean validateExceptionHandlerAdd(int codePos, int handlerPos) { - ExceptionHandler exHandler = getExceptionHandlerForCodePos(codePos); - return exHandler == null || exHandler.handlerPos == handlerPos; - } - - /** - * Returns the first ExceptionHandler which matches codePos. - * - * @param codePos position to search for - * @return first matching ExceptionHandler - */ - private ExceptionHandler getExceptionHandlerForCodePos(int codePos) { - for (ExceptionHandler h : exceptionHandlers) { - if (h.pcOffset == codePos) { - return h; - } - } - return null; - } - - /** - * Records an infopoint in the code array. - * - * @param codePos the position of the infopoint in the code array - * @param debugInfo the debug info for the infopoint - */ - public void recordInfopoint(int codePos, DebugInfo debugInfo, InfopointReason reason) { - addInfopoint(new Infopoint(codePos, debugInfo, reason)); - } - - /** - * Records a custom infopoint in the code section. - * - * Compiler implementations can use this method to record non-standard infopoints, which are not - * handled by dedicated methods like {@link #recordCall}. - * - * @param infopoint the infopoint to record, usually a derived class from {@link Infopoint} - */ - public void addInfopoint(Infopoint infopoint) { - checkOpen(); - infopoints.add(infopoint); - } - - /** - * Records an instruction mark within this method. - * - * @param codePos the position in the code that is covered by the handler - * @param markId the identifier for this mark - */ - public Mark recordMark(int codePos, Object markId) { - checkOpen(); - Mark mark = new Mark(codePos, markId); - marks.add(mark); - return mark; - } - - /** - * Offset in bytes for the custom stack area (relative to sp). - * - * @return the offset in bytes - */ - public int getCustomStackAreaOffset() { - return customStackAreaOffset; - } - - /** - * @see #getCustomStackAreaOffset() - * @param offset - */ - public void setCustomStackAreaOffset(int offset) { - checkOpen(); - customStackAreaOffset = offset; - } - - /** - * @return the machine code generated for this method - */ - public byte[] getTargetCode() { - return targetCode; - } - - /** - * @return the size of the machine code generated for this method - */ - public int getTargetCodeSize() { - return targetCodeSize; - } - - /** - * @return the code annotations or {@code null} if there are none - */ - public List getAnnotations() { - if (annotations == null) { - return Collections.emptyList(); - } - return annotations; - } - - public void addAnnotation(CodeAnnotation annotation) { - checkOpen(); - assert annotation != null; - if (annotations == null) { - annotations = new ArrayList<>(); - } - annotations.add(annotation); - } - - private static void appendDebugInfo(StringBuilder sb, DebugInfo info) { - if (info != null) { - ReferenceMap refMap = info.getReferenceMap(); - if (refMap != null) { - sb.append(refMap.toString()); - sb.append(']'); - } - RegisterSaveLayout calleeSaveInfo = info.getCalleeSaveInfo(); - if (calleeSaveInfo != null) { - sb.append(" callee-save-info["); - String sep = ""; - for (Map.Entry e : calleeSaveInfo.registersToSlots(true).entrySet()) { - sb.append(sep).append(e.getKey()).append("->").append(e.getValue()); - sep = ", "; - } - sb.append(']'); - } - BytecodePosition codePos = info.getBytecodePosition(); - if (codePos != null) { - MetaUtil.appendLocation(sb.append(" "), codePos.getMethod(), codePos.getBCI()); - if (info.hasFrame()) { - sb.append(" #locals=").append(info.frame().numLocals).append(" #expr=").append(info.frame().numStack); - if (info.frame().numLocks > 0) { - sb.append(" #locks=").append(info.frame().numLocks); - } - } - } - } - } - - /** - * @return the list of infopoints, sorted by {@link Site#pcOffset} - */ - public List getInfopoints() { - if (infopoints.isEmpty()) { - return emptyList(); - } - return unmodifiableList(infopoints); - } - - /** - * @return the list of data references - */ - public List getDataPatches() { - if (dataPatches.isEmpty()) { - return emptyList(); - } - return unmodifiableList(dataPatches); - } - - /** - * @return the list of exception handlers - */ - public List getExceptionHandlers() { - if (exceptionHandlers.isEmpty()) { - return emptyList(); - } - return unmodifiableList(exceptionHandlers); - } - - /** - * @return the list of marks - */ - public List getMarks() { - if (marks.isEmpty()) { - return emptyList(); - } - return unmodifiableList(marks); - } - - public String getName() { - return name; - } - - public void setHasUnsafeAccess(boolean hasUnsafeAccess) { - checkOpen(); - this.hasUnsafeAccess = hasUnsafeAccess; - } - - public boolean hasUnsafeAccess() { - return hasUnsafeAccess; - } - - /** - * Clears the information in this object pertaining to generating code. That is, the - * {@linkplain #getMarks() marks}, {@linkplain #getInfopoints() infopoints}, - * {@linkplain #getExceptionHandlers() exception handlers}, {@linkplain #getDataPatches() data - * patches} and {@linkplain #getAnnotations() annotations} recorded in this object are cleared. - */ - public void resetForEmittingCode() { - checkOpen(); - infopoints.clear(); - dataPatches.clear(); - exceptionHandlers.clear(); - marks.clear(); - dataSection.clear(); - if (annotations != null) { - annotations.clear(); - } - } - - private void checkOpen() { - if (closed) { - throw new IllegalStateException(); - } - } - - /** - * Closes this compilation result to future updates. - */ - public void close() { - if (closed) { - throw new IllegalStateException("Cannot re-close compilation result " + this); - } - dataSection.close(); - closed = true; - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java new file mode 100644 index 00000000000..214bcbfaafe --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ +package jdk.vm.ci.code; + +/** + * The output from compiling a method. + */ +public interface CompiledCode { +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DataSection.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DataSection.java deleted file mode 100644 index c397cd1c0fb..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DataSection.java +++ /dev/null @@ -1,331 +0,0 @@ -/* - * Copyright (c) 2014, 2014, 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. - */ -package jdk.vm.ci.code; - -import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString; - -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Objects; -import java.util.function.Consumer; - -import jdk.vm.ci.code.CompilationResult.DataPatch; -import jdk.vm.ci.code.CompilationResult.DataSectionReference; -import jdk.vm.ci.code.DataSection.Data; -import jdk.vm.ci.meta.SerializableConstant; - -public final class DataSection implements Iterable { - - @FunctionalInterface - public interface DataBuilder { - - void emit(ByteBuffer buffer, Consumer patch); - - static DataBuilder raw(byte[] data) { - return (buffer, patch) -> buffer.put(data); - } - - static DataBuilder serializable(SerializableConstant c) { - return (buffer, patch) -> c.serialize(buffer); - } - - static DataBuilder zero(int size) { - switch (size) { - case 1: - return (buffer, patch) -> buffer.put((byte) 0); - case 2: - return (buffer, patch) -> buffer.putShort((short) 0); - case 4: - return (buffer, patch) -> buffer.putInt(0); - case 8: - return (buffer, patch) -> buffer.putLong(0L); - default: - return (buffer, patch) -> { - int rest = size; - while (rest > 8) { - buffer.putLong(0L); - rest -= 8; - } - while (rest > 0) { - buffer.put((byte) 0); - rest--; - } - }; - } - } - } - - public static final class Data { - - private int alignment; - private final int size; - private final DataBuilder builder; - - private DataSectionReference ref; - - public Data(int alignment, int size, DataBuilder builder) { - this.alignment = alignment; - this.size = size; - this.builder = builder; - - // initialized in DataSection.insertData(Data) - ref = null; - } - - public void updateAlignment(int newAlignment) { - if (newAlignment == alignment) { - return; - } - alignment = lcm(alignment, newAlignment); - } - - public int getAlignment() { - return alignment; - } - - public int getSize() { - return size; - } - - public DataBuilder getBuilder() { - return builder; - } - - @Override - public int hashCode() { - // Data instances should not be used as hash map keys - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public boolean equals(Object obj) { - assert ref != null; - if (obj == this) { - return true; - } - if (obj instanceof Data) { - Data that = (Data) obj; - if (this.alignment == that.alignment && this.size == that.size && this.ref.equals(that.ref)) { - return true; - } - } - return false; - } - } - - private final ArrayList dataItems = new ArrayList<>(); - - private boolean closed; - private int sectionAlignment; - private int sectionSize; - - @Override - public int hashCode() { - // DataSection instances should not be used as hash map keys - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof DataSection) { - DataSection that = (DataSection) obj; - if (this.closed == that.closed && this.sectionAlignment == that.sectionAlignment && this.sectionSize == that.sectionSize && Objects.equals(this.dataItems, that.dataItems)) { - return true; - } - } - return false; - } - - /** - * Inserts a {@link Data} item into the data section. If the item is already in the data - * section, the same {@link DataSectionReference} is returned. - * - * @param data the {@link Data} item to be inserted - * @return a unique {@link DataSectionReference} identifying the {@link Data} item - */ - public DataSectionReference insertData(Data data) { - checkOpen(); - synchronized (data) { - if (data.ref == null) { - data.ref = new DataSectionReference(); - dataItems.add(data); - } - return data.ref; - } - } - - /** - * Transfers all {@link Data} from the provided other {@link DataSection} to this - * {@link DataSection}, and empties the other section. - */ - public void addAll(DataSection other) { - checkOpen(); - other.checkOpen(); - - for (Data data : other.dataItems) { - assert data.ref != null; - dataItems.add(data); - } - other.dataItems.clear(); - } - - /** - * Determines if this object has been {@link #close() closed}. - */ - public boolean closed() { - return closed; - } - - /** - * Computes the layout of the data section and closes this object to further updates. - * - * This must be called exactly once. - */ - void close() { - checkOpen(); - closed = true; - - // simple heuristic: put items with larger alignment requirement first - dataItems.sort((a, b) -> a.alignment - b.alignment); - - int position = 0; - int alignment = 1; - for (Data d : dataItems) { - alignment = lcm(alignment, d.alignment); - position = align(position, d.alignment); - - d.ref.setOffset(position); - position += d.size; - } - - sectionAlignment = alignment; - sectionSize = position; - } - - /** - * Gets the size of the data section. - * - * This must only be called once this object has been {@linkplain #closed() closed}. - */ - public int getSectionSize() { - checkClosed(); - return sectionSize; - } - - /** - * Gets the minimum alignment requirement of the data section. - * - * This must only be called once this object has been {@linkplain #closed() closed}. - */ - public int getSectionAlignment() { - checkClosed(); - return sectionAlignment; - } - - /** - * Builds the data section into a given buffer. - * - * This must only be called once this object has been {@linkplain #closed() closed}. - * - * @param buffer the {@link ByteBuffer} where the data section should be built. The buffer must - * hold at least {@link #getSectionSize()} bytes. - * @param patch a {@link Consumer} to receive {@link DataPatch data patches} for relocations in - * the data section - */ - public void buildDataSection(ByteBuffer buffer, Consumer patch) { - checkClosed(); - for (Data d : dataItems) { - buffer.position(d.ref.getOffset()); - d.builder.emit(buffer, patch); - } - } - - public Data findData(DataSectionReference ref) { - for (Data d : dataItems) { - if (d.ref == ref) { - return d; - } - } - return null; - } - - public Iterator iterator() { - return dataItems.iterator(); - } - - public static int lcm(int x, int y) { - if (x == 0) { - return y; - } else if (y == 0) { - return x; - } - - int a = Math.max(x, y); - int b = Math.min(x, y); - while (b > 0) { - int tmp = a % b; - a = b; - b = tmp; - } - - int gcd = a; - return x * y / gcd; - } - - private static int align(int position, int alignment) { - return ((position + alignment - 1) / alignment) * alignment; - } - - private void checkClosed() { - if (!closed) { - throw new IllegalStateException(); - } - } - - private void checkOpen() { - if (closed) { - throw new IllegalStateException(); - } - } - - public void clear() { - checkOpen(); - this.dataItems.clear(); - this.sectionAlignment = 0; - this.sectionSize = 0; - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java index 63f1ea5df74..8183f89b22d 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java @@ -1,26 +1,29 @@ /* - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. DO NOT ALTER OR - * REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * This code is free software; you can redistribute it and/or modify it under the terms of the GNU - * General Public License version 2 only, as published by the Free Software Foundation. + * 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 + * 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. + * 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. + * 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. */ /** * Package that defines the interface between a Java application that wants to install code and the runtime. * The runtime provides in implementation of the {@link jdk.vm.ci.code.CodeCacheProvider} interface. - * The method {@link jdk.vm.ci.code.CodeCacheProvider#addCode(jdk.vm.ci.meta.ResolvedJavaMethod, CompilationResult, jdk.vm.ci.meta.SpeculationLog, InstalledCode)} + * The method {@link jdk.vm.ci.code.CodeCacheProvider#addCode(jdk.vm.ci.meta.ResolvedJavaMethod, CompiledCode, jdk.vm.ci.meta.SpeculationLog, InstalledCode)} * can be used to install code. */ package jdk.vm.ci.code; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java new file mode 100644 index 00000000000..c323b055a35 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ +package jdk.vm.ci.code.site; + +import java.util.Objects; + +import jdk.vm.ci.code.DebugInfo; +import jdk.vm.ci.meta.InvokeTarget; + +/** + * Represents a call in the code. + */ +public final class Call extends Infopoint { + + /** + * The target of the call. + */ + public final InvokeTarget target; + + /** + * The size of the call instruction. + */ + public final int size; + + /** + * Specifies if this call is direct or indirect. A direct call has an immediate operand encoding + * the absolute or relative (to the call itself) address of the target. An indirect call has a + * register or memory operand specifying the target address of the call. + */ + public final boolean direct; + + public Call(InvokeTarget target, int pcOffset, int size, boolean direct, DebugInfo debugInfo) { + super(pcOffset, debugInfo, InfopointReason.CALL); + this.size = size; + this.target = target; + this.direct = direct; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof Call && super.equals(obj)) { + Call that = (Call) obj; + if (this.size == that.size && this.direct == that.direct && Objects.equals(this.target, that.target)) { + return true; + } + } + return false; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(pcOffset); + sb.append('['); + sb.append(target); + sb.append(']'); + + if (debugInfo != null) { + appendDebugInfo(sb, debugInfo); + } + + return sb.toString(); + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java new file mode 100644 index 00000000000..59f0a1e6a55 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ +package jdk.vm.ci.code.site; + +import java.util.Objects; + +import jdk.vm.ci.meta.VMConstant; + +public final class ConstantReference extends Reference { + + private final VMConstant constant; + + public ConstantReference(VMConstant constant) { + this.constant = constant; + } + + public VMConstant getConstant() { + return constant; + } + + @Override + public String toString() { + return constant.toString(); + } + + @Override + public int hashCode() { + return constant.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof ConstantReference) { + ConstantReference that = (ConstantReference) obj; + return Objects.equals(this.constant, that.constant); + } + return false; + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java new file mode 100644 index 00000000000..45941aac9a0 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ +package jdk.vm.ci.code.site; + +import java.util.Objects; + +import jdk.vm.ci.meta.JavaConstant; + +/** + * Represents a code site that references some data. The associated data can be either a + * {@link DataSectionReference reference} to the data section, or it may be an inlined + * {@link JavaConstant} that needs to be patched. + */ +public final class DataPatch extends Site { + + public Reference reference; + public Object note; + + public DataPatch(int pcOffset, Reference reference) { + super(pcOffset); + this.reference = reference; + this.note = null; + } + + public DataPatch(int pcOffset, Reference reference, Object note) { + super(pcOffset); + this.reference = reference; + this.note = note; + } + + @Override + public String toString() { + if (note != null) { + return String.format("%d[, note: %s]", pcOffset, reference.toString(), note.toString()); + } else { + return String.format("%d[]", pcOffset, reference.toString()); + } + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof DataPatch) { + DataPatch that = (DataPatch) obj; + if (this.pcOffset == that.pcOffset && Objects.equals(this.reference, that.reference) && Objects.equals(this.note, that.note)) { + return true; + } + } + return false; + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java new file mode 100644 index 00000000000..5602c99d4cb --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ +package jdk.vm.ci.code.site; + +public final class DataSectionReference extends Reference { + + private boolean initialized; + private int offset; + + public DataSectionReference() { + // will be set after the data section layout is fixed + offset = 0xDEADDEAD; + } + + public int getOffset() { + assert initialized; + + return offset; + } + + public void setOffset(int offset) { + assert !initialized; + initialized = true; + + this.offset = offset; + } + + @Override + public int hashCode() { + return offset; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof DataSectionReference) { + DataSectionReference that = (DataSectionReference) obj; + return this.offset == that.offset; + } + return false; + } + + @Override + public String toString() { + if (initialized) { + return String.format("DataSection[0x%x]", offset); + } else { + return "DataSection[?]"; + } + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java new file mode 100644 index 00000000000..3f9f73f3867 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ +package jdk.vm.ci.code.site; + +/** + * Represents exception handler information for a specific code position. It includes the catch code + * position as well as the caught exception type. + */ +public final class ExceptionHandler extends Site { + + public final int handlerPos; + + public ExceptionHandler(int pcOffset, int handlerPos) { + super(pcOffset); + this.handlerPos = handlerPos; + } + + @Override + public String toString() { + return String.format("%d[]", pcOffset, handlerPos); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof ExceptionHandler) { + ExceptionHandler that = (ExceptionHandler) obj; + if (this.pcOffset == that.pcOffset && this.handlerPos == that.handlerPos) { + return true; + } + } + return false; + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java new file mode 100644 index 00000000000..c59c006a680 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ +package jdk.vm.ci.code.site; + +import java.util.Map; +import java.util.Objects; + +import jdk.vm.ci.code.BytecodePosition; +import jdk.vm.ci.code.DebugInfo; +import jdk.vm.ci.code.ReferenceMap; +import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterSaveLayout; +import jdk.vm.ci.meta.MetaUtil; + +/** + * Represents an infopoint with associated debug info. Note that safepoints are also infopoints. + */ +public class Infopoint extends Site implements Comparable { + + public final DebugInfo debugInfo; + + public final InfopointReason reason; + + public Infopoint(int pcOffset, DebugInfo debugInfo, InfopointReason reason) { + super(pcOffset); + this.debugInfo = debugInfo; + this.reason = reason; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(pcOffset); + sb.append("[]"); + appendDebugInfo(sb, debugInfo); + return sb.toString(); + } + + @Override + public int compareTo(Infopoint o) { + if (pcOffset < o.pcOffset) { + return -1; + } else if (pcOffset > o.pcOffset) { + return 1; + } + return this.reason.compareTo(o.reason); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj != null && obj.getClass() == getClass()) { + Infopoint that = (Infopoint) obj; + if (this.pcOffset == that.pcOffset && Objects.equals(this.debugInfo, that.debugInfo) && Objects.equals(this.reason, that.reason)) { + return true; + } + } + return false; + } + + protected static void appendDebugInfo(StringBuilder sb, DebugInfo info) { + if (info != null) { + ReferenceMap refMap = info.getReferenceMap(); + if (refMap != null) { + sb.append(refMap.toString()); + sb.append(']'); + } + RegisterSaveLayout calleeSaveInfo = info.getCalleeSaveInfo(); + if (calleeSaveInfo != null) { + sb.append(" callee-save-info["); + String sep = ""; + for (Map.Entry e : calleeSaveInfo.registersToSlots(true).entrySet()) { + sb.append(sep).append(e.getKey()).append("->").append(e.getValue()); + sep = ", "; + } + sb.append(']'); + } + BytecodePosition codePos = info.getBytecodePosition(); + if (codePos != null) { + MetaUtil.appendLocation(sb.append(" "), codePos.getMethod(), codePos.getBCI()); + if (info.hasFrame()) { + sb.append(" #locals=").append(info.frame().numLocals).append(" #expr=").append(info.frame().numStack); + if (info.frame().numLocks > 0) { + sb.append(" #locks=").append(info.frame().numLocks); + } + } + } + } + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InfopointReason.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java similarity index 91% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InfopointReason.java rename to hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java index 317ed96ce7e..6509dbdf69d 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InfopointReason.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,7 +20,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package jdk.vm.ci.code; +package jdk.vm.ci.code.site; /** * A reason for infopoint insertion. diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java new file mode 100644 index 00000000000..29de0c01334 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ +package jdk.vm.ci.code.site; + +import java.util.Objects; + +/** + * Represents a mark in the machine code that can be used by the runtime for its own purposes. A + * mark can reference other marks. + */ +public final class Mark extends Site { + + public final Object id; + + public Mark(int pcOffset, Object id) { + super(pcOffset); + this.id = id; + } + + @Override + public String toString() { + if (id == null) { + return String.format("%d[]", pcOffset); + } else if (id instanceof Integer) { + return String.format("%d[]", pcOffset, Integer.toHexString((Integer) id)); + } else { + return String.format("%d[]", pcOffset, id.toString()); + } + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof Mark) { + Mark that = (Mark) obj; + if (this.pcOffset == that.pcOffset && Objects.equals(this.id, that.id)) { + return true; + } + } + return false; + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java new file mode 100644 index 00000000000..601d4158a63 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ +package jdk.vm.ci.code.site; + +/** + * Represents some external data that is referenced by the code. + */ +public abstract class Reference { + + @Override + public abstract int hashCode(); + + @Override + public abstract boolean equals(Object obj); +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java new file mode 100644 index 00000000000..dbf76c58be0 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ +package jdk.vm.ci.code.site; + +import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString; + +/** + * Represents a code position with associated additional information. + */ +public abstract class Site { + + /** + * The position (or offset) of this site with respect to the start of the target method. + */ + public final int pcOffset; + + public Site(int pos) { + this.pcOffset = pos; + } + + @Override + public final int hashCode() { + throw new UnsupportedOperationException("hashCode"); + } + + @Override + public String toString() { + return identityHashCodeString(this); + } + + @Override + public abstract boolean equals(Object obj); +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java index ff83c14c31a..24d762450e0 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java @@ -22,30 +22,18 @@ */ package jdk.vm.ci.hotspot; -import static jdk.vm.ci.hotspot.HotSpotCompressedNullConstant.COMPRESSED_NULL; - import java.lang.reflect.Field; import jdk.vm.ci.code.BailoutException; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationRequest; -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.CompilationResult.Call; -import jdk.vm.ci.code.CompilationResult.ConstantReference; -import jdk.vm.ci.code.CompilationResult.DataPatch; -import jdk.vm.ci.code.CompilationResult.Mark; -import jdk.vm.ci.code.DataSection; -import jdk.vm.ci.code.DataSection.Data; -import jdk.vm.ci.code.DataSection.DataBuilder; +import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.RegisterConfig; import jdk.vm.ci.code.TargetDescription; -import jdk.vm.ci.common.JVMCIError; -import jdk.vm.ci.meta.Constant; -import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.SerializableConstant; +import jdk.vm.ci.code.site.Call; +import jdk.vm.ci.code.site.Mark; +import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.SpeculationLog; -import jdk.vm.ci.meta.VMConstant; /** * HotSpot implementation of {@link CodeCacheProvider}. @@ -113,41 +101,25 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider { return runtime.getConfig().runtimeCallStackSize; } - private InstalledCode logOrDump(InstalledCode installedCode, CompilationResult compResult) { - ((HotSpotJVMCIRuntime) runtime).notifyInstall(this, installedCode, compResult); + private InstalledCode logOrDump(InstalledCode installedCode, CompiledCode compiledCode) { + ((HotSpotJVMCIRuntime) runtime).notifyInstall(this, installedCode, compiledCode); return installedCode; } - public InstalledCode installCode(CompilationRequest compRequest, CompilationResult compResult, InstalledCode installedCode, SpeculationLog log, boolean isDefault) { - HotSpotResolvedJavaMethod method = compRequest != null ? (HotSpotResolvedJavaMethod) compRequest.getMethod() : null; + public InstalledCode installCode(ResolvedJavaMethod method, CompiledCode compiledCode, InstalledCode installedCode, SpeculationLog log, boolean isDefault) { InstalledCode resultInstalledCode; if (installedCode == null) { if (method == null) { // Must be a stub - resultInstalledCode = new HotSpotRuntimeStub(compResult.getName()); + resultInstalledCode = new HotSpotRuntimeStub(((HotSpotCompiledCode) compiledCode).getName()); } else { - resultInstalledCode = new HotSpotNmethod(method, compResult.getName(), isDefault); + resultInstalledCode = new HotSpotNmethod((HotSpotResolvedJavaMethod) method, ((HotSpotCompiledCode) compiledCode).getName(), isDefault); } } else { resultInstalledCode = installedCode; } - HotSpotCompiledCode compiledCode; - if (method != null) { - final int id; - final long jvmciEnv; - if (compRequest instanceof HotSpotCompilationRequest) { - HotSpotCompilationRequest hsCompRequest = (HotSpotCompilationRequest) compRequest; - id = hsCompRequest.getId(); - jvmciEnv = hsCompRequest.getJvmciEnv(); - } else { - id = method.allocateCompileId(compRequest.getEntryBCI()); - jvmciEnv = 0L; - } - compiledCode = new HotSpotCompiledNmethod(method, compResult, id, jvmciEnv); - } else { - compiledCode = new HotSpotCompiledCode(compResult); - } - int result = runtime.getCompilerToVM().installCode(target, compiledCode, resultInstalledCode, (HotSpotSpeculationLog) log); + + int result = runtime.getCompilerToVM().installCode(target, (HotSpotCompiledCode) compiledCode, resultInstalledCode, (HotSpotSpeculationLog) log); if (result != config.codeInstallResultOk) { String resultDesc = config.getCodeInstallResultDescription(result); if (compiledCode instanceof HotSpotCompiledNmethod) { @@ -163,83 +135,16 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider { } throw new BailoutException(result != config.codeInstallResultDependenciesFailed, msg); } else { - throw new BailoutException("Error installing %s: %s", compResult.getName(), resultDesc); + throw new BailoutException("Error installing %s: %s", ((HotSpotCompiledCode) compiledCode).getName(), resultDesc); } } - return logOrDump(resultInstalledCode, compResult); + return logOrDump(resultInstalledCode, compiledCode); } public void invalidateInstalledCode(InstalledCode installedCode) { runtime.getCompilerToVM().invalidateInstalledCode(installedCode); } - private Data createSingleDataItem(Constant constant) { - int size; - DataBuilder builder; - if (constant instanceof VMConstant) { - VMConstant vmConstant = (VMConstant) constant; - boolean compressed; - if (constant instanceof HotSpotConstant) { - HotSpotConstant c = (HotSpotConstant) vmConstant; - compressed = c.isCompressed(); - } else { - throw new JVMCIError(String.valueOf(constant)); - } - - size = compressed ? 4 : target.wordSize; - if (size == 4) { - builder = (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), new ConstantReference(vmConstant))); - buffer.putInt(0xDEADDEAD); - }; - } else { - assert size == 8; - builder = (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), new ConstantReference(vmConstant))); - buffer.putLong(0xDEADDEADDEADDEADL); - }; - } - } else if (JavaConstant.isNull(constant)) { - boolean compressed = COMPRESSED_NULL.equals(constant); - size = compressed ? 4 : target.wordSize; - builder = DataBuilder.zero(size); - } else if (constant instanceof SerializableConstant) { - SerializableConstant s = (SerializableConstant) constant; - size = s.getSerializedSize(); - builder = DataBuilder.serializable(s); - } else { - throw new JVMCIError(String.valueOf(constant)); - } - - return new Data(size, size, builder); - } - - public Data createDataItem(Constant... constants) { - assert constants.length > 0; - if (constants.length == 1) { - return createSingleDataItem(constants[0]); - } else { - DataBuilder[] builders = new DataBuilder[constants.length]; - int size = 0; - int alignment = 1; - for (int i = 0; i < constants.length; i++) { - Data data = createSingleDataItem(constants[i]); - - assert size % data.getAlignment() == 0 : "invalid alignment in packed constants"; - alignment = DataSection.lcm(alignment, data.getAlignment()); - - builders[i] = data.getBuilder(); - size += data.getSize(); - } - DataBuilder ret = (buffer, patches) -> { - for (DataBuilder b : builders) { - b.emit(buffer, patches); - } - }; - return new Data(alignment, size, ret); - } - } - @Override public TargetDescription getTarget() { return target; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java index 27236ad771d..5605cdb429d 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,62 +22,86 @@ */ package jdk.vm.ci.hotspot; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.EnumMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; -import java.util.stream.Stream.Builder; - import jdk.vm.ci.code.BytecodeFrame; -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.CompilationResult.CodeAnnotation; -import jdk.vm.ci.code.CompilationResult.CodeComment; -import jdk.vm.ci.code.CompilationResult.DataPatch; -import jdk.vm.ci.code.CompilationResult.ExceptionHandler; -import jdk.vm.ci.code.CompilationResult.Infopoint; -import jdk.vm.ci.code.CompilationResult.JumpTable; -import jdk.vm.ci.code.CompilationResult.Mark; -import jdk.vm.ci.code.CompilationResult.Site; -import jdk.vm.ci.code.DataSection; -import jdk.vm.ci.code.InfopointReason; -import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.code.CompiledCode; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Infopoint; +import jdk.vm.ci.code.site.Site; import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.ResolvedJavaMethod; /** - * A {@link CompilationResult} with additional HotSpot-specific information required for installing - * the code in HotSpot's code cache. + * A {@link CompiledCode} with additional HotSpot-specific information required for installing the + * code in HotSpot's code cache. */ -public class HotSpotCompiledCode { +public class HotSpotCompiledCode implements CompiledCode { - public final String name; - public final Site[] sites; - public final ExceptionHandler[] exceptionHandlers; - public final Comment[] comments; - public final Assumption[] assumptions; + /** + * The name of this compilation unit. + */ + protected final String name; - public final byte[] targetCode; - public final int targetCodeSize; + /** + * The buffer containing the emitted machine code. + */ + protected final byte[] targetCode; - public final byte[] dataSection; - public final int dataSectionAlignment; - public final DataPatch[] dataSectionPatches; - public final boolean isImmutablePIC; + /** + * The leading number of bytes in {@link #targetCode} containing the emitted machine code. + */ + protected final int targetCodeSize; - public final int totalFrameSize; - public final int customStackAreaOffset; + /** + * A list of code annotations describing special sites in {@link #targetCode}. + */ + protected final Site[] sites; + + /** + * A list of {@link Assumption} this code relies on. + */ + protected final Assumption[] assumptions; /** * The list of the methods whose bytecodes were used as input to the compilation. If * {@code null}, then the compilation did not record method dependencies. Otherwise, the first * element of this array is the root method of the compilation. */ - public final ResolvedJavaMethod[] methods; + protected final ResolvedJavaMethod[] methods; + + /** + * A list of comments that will be included in code dumps. + */ + protected final Comment[] comments; + + /** + * The data section containing serialized constants for the emitted machine code. + */ + protected final byte[] dataSection; + + /** + * The minimum alignment of the data section. + */ + protected final int dataSectionAlignment; + + /** + * A list of relocations in the {@link #dataSection}. + */ + protected final DataPatch[] dataSectionPatches; + + /** + * A flag determining whether this code is immutable and position independent. + */ + protected final boolean isImmutablePIC; + + /** + * The total size of the stack frame of this compiled method. + */ + protected final int totalFrameSize; + + /** + * Offset in bytes for the custom stack area (relative to sp). + */ + protected final int customStackAreaOffset; public static class Comment { @@ -90,59 +114,38 @@ public class HotSpotCompiledCode { } } - public HotSpotCompiledCode(CompilationResult compResult) { - name = compResult.getName(); - sites = getSortedSites(compResult); - if (compResult.getExceptionHandlers().isEmpty()) { - exceptionHandlers = null; - } else { - exceptionHandlers = compResult.getExceptionHandlers().toArray(new ExceptionHandler[compResult.getExceptionHandlers().size()]); - } - List annotations = compResult.getAnnotations(); - comments = new Comment[annotations.size()]; - if (!annotations.isEmpty()) { - for (int i = 0; i < comments.length; i++) { - CodeAnnotation annotation = annotations.get(i); - String text; - if (annotation instanceof CodeComment) { - CodeComment codeComment = (CodeComment) annotation; - text = codeComment.value; - } else if (annotation instanceof JumpTable) { - JumpTable jumpTable = (JumpTable) annotation; - text = "JumpTable [" + jumpTable.low + " .. " + jumpTable.high + "]"; - } else { - text = annotation.toString(); - } - comments[i] = new Comment(annotation.position, text); - } - } - assumptions = compResult.getAssumptions(); + public HotSpotCompiledCode(String name, byte[] targetCode, int targetCodeSize, Site[] sites, Assumption[] assumptions, ResolvedJavaMethod[] methods, Comment[] comments, byte[] dataSection, + int dataSectionAlignment, DataPatch[] dataSectionPatches, boolean isImmutablePIC, int totalFrameSize, int customStackAreaOffset) { + this.name = name; + this.targetCode = targetCode; + this.targetCodeSize = targetCodeSize; + this.sites = sites; + this.assumptions = assumptions; + this.methods = methods; + + this.comments = comments; + this.dataSection = dataSection; + this.dataSectionAlignment = dataSectionAlignment; + this.dataSectionPatches = dataSectionPatches; + this.isImmutablePIC = isImmutablePIC; + this.totalFrameSize = totalFrameSize; + this.customStackAreaOffset = customStackAreaOffset; + assert validateFrames(); + } - targetCode = compResult.getTargetCode(); - targetCodeSize = compResult.getTargetCodeSize(); + public String getName() { + return name; + } - DataSection data = compResult.getDataSection(); - dataSection = new byte[data.getSectionSize()]; - - ByteBuffer buffer = ByteBuffer.wrap(dataSection).order(ByteOrder.nativeOrder()); - Builder patchBuilder = Stream.builder(); - data.buildDataSection(buffer, patchBuilder); - - dataSectionAlignment = data.getSectionAlignment(); - dataSectionPatches = patchBuilder.build().toArray(len -> new DataPatch[len]); - - isImmutablePIC = compResult.isImmutablePIC(); - - totalFrameSize = compResult.getTotalFrameSize(); - customStackAreaOffset = compResult.getCustomStackAreaOffset(); - - methods = compResult.getMethods(); + @Override + public String toString() { + return name; } /** - * Ensure that all the frames passed into HotSpot are properly formatted with an empty or - * illegal slot following double word slots. + * Ensure that all the frames passed into the VM are properly formatted with an empty or illegal + * slot following double word slots. */ private boolean validateFrames() { for (Site site : sites) { @@ -156,117 +159,4 @@ public class HotSpotCompiledCode { } return true; } - - static class SiteComparator implements Comparator { - - /** - * Defines an order for sorting {@link Infopoint}s based on their - * {@linkplain Infopoint#reason reasons}. This is used to choose which infopoint to preserve - * when multiple infopoints collide on the same PC offset. A negative order value implies a - * non-optional infopoint (i.e., must be preserved). Non-optional infopoints must not - * collide. - */ - static final Map HOTSPOT_INFOPOINT_SORT_ORDER = new EnumMap<>(InfopointReason.class); - static { - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.SAFEPOINT, -4); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.CALL, -3); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.IMPLICIT_EXCEPTION, -2); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.METASPACE_ACCESS, 1); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.METHOD_START, 2); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.METHOD_END, 3); - HOTSPOT_INFOPOINT_SORT_ORDER.put(InfopointReason.BYTECODE_POSITION, 4); - } - - static int ord(Infopoint info) { - return HOTSPOT_INFOPOINT_SORT_ORDER.get(info.reason); - } - - static int checkCollision(Infopoint i1, Infopoint i2) { - int o1 = ord(i1); - int o2 = ord(i2); - if (o1 < 0 && o2 < 0) { - throw new JVMCIError("Non-optional infopoints cannot collide: %s and %s", i1, i2); - } - return o1 - o2; - } - - /** - * Records whether any two {@link Infopoint}s had the same {@link Infopoint#pcOffset}. - */ - boolean sawCollidingInfopoints; - - public int compare(Site s1, Site s2) { - if (s1.pcOffset == s2.pcOffset) { - // Marks must come first since patching a call site - // may need to know the mark denoting the call type - // (see uses of CodeInstaller::_next_call_type). - boolean s1IsMark = s1 instanceof Mark; - boolean s2IsMark = s2 instanceof Mark; - if (s1IsMark != s2IsMark) { - return s1IsMark ? -1 : 1; - } - - // Infopoints must group together so put them after - // other Site types. - boolean s1IsInfopoint = s1 instanceof Infopoint; - boolean s2IsInfopoint = s2 instanceof Infopoint; - if (s1IsInfopoint != s2IsInfopoint) { - return s1IsInfopoint ? 1 : -1; - } - - if (s1IsInfopoint) { - sawCollidingInfopoints = true; - return checkCollision((Infopoint) s1, (Infopoint) s2); - } - } - return s1.pcOffset - s2.pcOffset; - } - } - - /** - * HotSpot expects sites to be presented in ascending order of PC (see - * {@code DebugInformationRecorder::add_new_pc_offset}). In addition, it expects - * {@link Infopoint} PCs to be unique. - */ - private static Site[] getSortedSites(CompilationResult target) { - List[] lists = new List[]{target.getInfopoints(), target.getDataPatches(), target.getMarks()}; - int count = 0; - for (List list : lists) { - count += list.size(); - } - Site[] result = new Site[count]; - int pos = 0; - for (List list : lists) { - for (Object elem : list) { - result[pos++] = (Site) elem; - } - } - SiteComparator c = new SiteComparator(); - Arrays.sort(result, c); - if (c.sawCollidingInfopoints) { - Infopoint lastInfopoint = null; - List copy = new ArrayList<>(count); - for (int i = 0; i < count; i++) { - if (result[i] instanceof Infopoint) { - Infopoint info = (Infopoint) result[i]; - if (lastInfopoint == null || lastInfopoint.pcOffset != info.pcOffset) { - lastInfopoint = info; - copy.add(info); - } else { - // Omit this colliding infopoint - assert lastInfopoint.reason.compareTo(info.reason) <= 0; - } - } else { - copy.add(result[i]); - } - } - result = copy.toArray(new Site[copy.size()]); - } - return result; - } - - @Override - public String toString() { - return name; - } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java index e81f35b5e43..a2038a57341 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,28 +22,31 @@ */ package jdk.vm.ci.hotspot; -import jdk.vm.ci.code.CompilationResult; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Site; import jdk.vm.ci.inittimer.SuppressFBWarnings; +import jdk.vm.ci.meta.Assumptions.Assumption; +import jdk.vm.ci.meta.ResolvedJavaMethod; /** * {@link HotSpotCompiledCode} destined for installation as an nmethod. */ public final class HotSpotCompiledNmethod extends HotSpotCompiledCode { - public final HotSpotResolvedJavaMethod method; - public final int entryBCI; + protected final HotSpotResolvedJavaMethod method; + protected final int entryBCI; /** * Compilation identifier. */ - public final int id; + protected final int id; /** * Address of a native {@code JVMCIEnv} object or 0L if no such object exists. */ - public final long jvmciEnv; + protected final long jvmciEnv; - public final boolean hasUnsafeAccess; + protected final boolean hasUnsafeAccess; /** * May be set by VM if code installation fails. It will describe in more detail why installation @@ -51,13 +54,15 @@ public final class HotSpotCompiledNmethod extends HotSpotCompiledCode { */ @SuppressFBWarnings(value = "UWF_UNWRITTEN_FIELD", justification = "set by the VM") private String installationFailureMessage; - public HotSpotCompiledNmethod(HotSpotResolvedJavaMethod method, CompilationResult compResult, int id, long jvmciEnv) { - super(compResult); + public HotSpotCompiledNmethod(String name, byte[] targetCode, int targetCodeSize, Site[] sites, Assumption[] assumptions, ResolvedJavaMethod[] methods, Comment[] comments, byte[] dataSection, + int dataSectionAlignment, DataPatch[] dataSectionPatches, boolean isImmutablePIC, int totalFrameSize, int customStackAreaOffset, HotSpotResolvedJavaMethod method, int entryBCI, + int id, long jvmciEnv, boolean hasUnsafeAccess) { + super(name, targetCode, targetCodeSize, sites, assumptions, methods, comments, dataSection, dataSectionAlignment, dataSectionPatches, isImmutablePIC, totalFrameSize, customStackAreaOffset); this.method = method; - this.entryBCI = compResult.getEntryBCI(); + this.entryBCI = entryBCI; this.id = id; this.jvmciEnv = jvmciEnv; - this.hasUnsafeAccess = compResult.hasUnsafeAccess(); + this.hasUnsafeAccess = hasUnsafeAccess; } @Override diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index 440d901cab6..53bf67d9b50 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ import java.util.Objects; import java.util.TreeMap; import jdk.vm.ci.code.Architecture; -import jdk.vm.ci.code.CompilationResult; +import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.inittimer.InitTimer; @@ -348,11 +348,11 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H * * @param hotSpotCodeCacheProvider * @param installedCode - * @param compResult + * @param compiledCode */ - void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompilationResult compResult) { + void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompiledCode compiledCode) { for (HotSpotVMEventListener vmEventListener : vmEventListeners) { - vmEventListener.notifyInstall(hotSpotCodeCacheProvider, installedCode, compResult); + vmEventListener.notifyInstall(hotSpotCodeCacheProvider, installedCode, compiledCode); } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java index c9d3db7ef09..c14a32dbffc 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ */ package jdk.vm.ci.hotspot; -import jdk.vm.ci.code.CompilationResult; +import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.meta.JVMCIMetaAccessContext; import jdk.vm.ci.meta.ResolvedJavaType; @@ -40,9 +40,9 @@ public interface HotSpotVMEventListener { * * @param hotSpotCodeCacheProvider * @param installedCode - * @param compResult + * @param compiledCode */ - default void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompilationResult compResult) { + default void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompiledCode compiledCode) { } /** diff --git a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp index 7adb8e3fdfb..bd56e38c08e 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -489,7 +489,6 @@ JVMCIEnv::CodeInstallResult CodeInstaller::gather_metadata(Handle target, Handle if (result != JVMCIEnv::ok) { return result; } - process_exception_handlers(); _debug_recorder->pcs_size(); // ehm, create the sentinel record @@ -523,7 +522,6 @@ JVMCIEnv::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler, Hand if (result != JVMCIEnv::ok) { return result; } - process_exception_handlers(); int stack_slots = _total_frame_size / HeapWordSize; // conversion to words @@ -574,7 +572,6 @@ void CodeInstaller::initialize_fields(oop target, oop compiled_code, TRAPS) { _parameter_count = 0; } _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code)); - _exception_handlers_handle = JNIHandles::make_local(HotSpotCompiledCode::exceptionHandlers(compiled_code)); _code_handle = JNIHandles::make_local(HotSpotCompiledCode::targetCode(compiled_code)); _code_size = HotSpotCompiledCode::targetCodeSize(compiled_code); @@ -608,8 +605,8 @@ int CodeInstaller::estimate_stubs_size(TRAPS) { objArrayOop sites = this->sites(); for (int i = 0; i < sites->length(); i++) { oop site = sites->obj_at(i); - if (site != NULL && site->is_a(CompilationResult_Mark::klass())) { - oop id_obj = CompilationResult_Mark::id(site); + if (site != NULL && site->is_a(site_Mark::klass())) { + oop id_obj = site_Mark::id(site); if (id_obj != NULL) { if (!java_lang_boxing_object::is_instance(id_obj, T_INT)) { JVMCI_ERROR_0("expected Integer id, got %s", id_obj->klass()->signature_name()); @@ -669,18 +666,18 @@ JVMCIEnv::CodeInstallResult CodeInstaller::initialize_buffer(CodeBuffer& buffer, if (patch.is_null()) { THROW_(vmSymbols::java_lang_NullPointerException(), JVMCIEnv::ok); } - Handle reference = CompilationResult_DataPatch::reference(patch); + Handle reference = site_DataPatch::reference(patch); if (reference.is_null()) { THROW_(vmSymbols::java_lang_NullPointerException(), JVMCIEnv::ok); } - if (!reference->is_a(CompilationResult_ConstantReference::klass())) { + if (!reference->is_a(site_ConstantReference::klass())) { JVMCI_ERROR_OK("invalid patch in data section: %s", reference->klass()->signature_name()); } - Handle constant = CompilationResult_ConstantReference::constant(reference); + Handle constant = site_ConstantReference::constant(reference); if (constant.is_null()) { THROW_(vmSymbols::java_lang_NullPointerException(), JVMCIEnv::ok); } - address dest = _constants->start() + CompilationResult_Site::pcOffset(patch); + address dest = _constants->start() + site_Site::pcOffset(patch); if (constant->is_a(HotSpotMetaspaceConstantImpl::klass())) { if (HotSpotMetaspaceConstantImpl::compressed(constant)) { #ifdef _LP64 @@ -716,27 +713,30 @@ JVMCIEnv::CodeInstallResult CodeInstaller::initialize_buffer(CodeBuffer& buffer, THROW_(vmSymbols::java_lang_NullPointerException(), JVMCIEnv::ok); } - jint pc_offset = CompilationResult_Site::pcOffset(site); + jint pc_offset = site_Site::pcOffset(site); - if (site->is_a(CompilationResult_Call::klass())) { + if (site->is_a(site_Call::klass())) { TRACE_jvmci_4("call at %i", pc_offset); site_Call(buffer, pc_offset, site, CHECK_OK); - } else if (site->is_a(CompilationResult_Infopoint::klass())) { + } else if (site->is_a(site_Infopoint::klass())) { // three reasons for infopoints denote actual safepoints - oop reason = CompilationResult_Infopoint::reason(site); - if (InfopointReason::SAFEPOINT() == reason || InfopointReason::CALL() == reason || InfopointReason::IMPLICIT_EXCEPTION() == reason) { + oop reason = site_Infopoint::reason(site); + if (site_InfopointReason::SAFEPOINT() == reason || site_InfopointReason::CALL() == reason || site_InfopointReason::IMPLICIT_EXCEPTION() == reason) { TRACE_jvmci_4("safepoint at %i", pc_offset); site_Safepoint(buffer, pc_offset, site, CHECK_OK); } else { TRACE_jvmci_4("infopoint at %i", pc_offset); site_Infopoint(buffer, pc_offset, site, CHECK_OK); } - } else if (site->is_a(CompilationResult_DataPatch::klass())) { + } else if (site->is_a(site_DataPatch::klass())) { TRACE_jvmci_4("datapatch at %i", pc_offset); site_DataPatch(buffer, pc_offset, site, CHECK_OK); - } else if (site->is_a(CompilationResult_Mark::klass())) { + } else if (site->is_a(site_Mark::klass())) { TRACE_jvmci_4("mark at %i", pc_offset); site_Mark(buffer, pc_offset, site, CHECK_OK); + } else if (site->is_a(site_ExceptionHandler::klass())) { + TRACE_jvmci_4("exceptionhandler at %i", pc_offset); + site_ExceptionHandler(pc_offset, site); } else { JVMCI_ERROR_OK("unexpected site subclass: %s", site->klass()->signature_name()); } @@ -802,21 +802,14 @@ void CodeInstaller::assumption_CallSiteTargetValue(Handle assumption) { _dependencies->assert_call_site_target_value(callSite(), methodHandle()); } -void CodeInstaller::process_exception_handlers() { - if (exception_handlers() != NULL) { - objArrayOop handlers = exception_handlers(); - for (int i = 0; i < handlers->length(); i++) { - oop exc = handlers->obj_at(i); - jint pc_offset = CompilationResult_Site::pcOffset(exc); - jint handler_offset = CompilationResult_ExceptionHandler::handlerPos(exc); +void CodeInstaller::site_ExceptionHandler(jint pc_offset, Handle exc) { + jint handler_offset = site_ExceptionHandler::handlerPos(exc); - // Subtable header - _exception_handler_table.add_entry(HandlerTableEntry(1, pc_offset, 0)); + // Subtable header + _exception_handler_table.add_entry(HandlerTableEntry(1, pc_offset, 0)); - // Subtable entry - _exception_handler_table.add_entry(HandlerTableEntry(-1, handler_offset, 0)); - } - } + // Subtable entry + _exception_handler_table.add_entry(HandlerTableEntry(-1, handler_offset, 0)); } // If deoptimization happens, the interpreter should reexecute these bytecodes. @@ -988,7 +981,7 @@ void CodeInstaller::record_scope(jint pc_offset, Handle position, ScopeMode scop } void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) { - Handle debug_info = CompilationResult_Infopoint::debugInfo(site); + Handle debug_info = site_Infopoint::debugInfo(site); if (debug_info.is_null()) { JVMCI_ERROR("debug info expected at safepoint at %i", pc_offset); } @@ -1002,7 +995,7 @@ void CodeInstaller::site_Safepoint(CodeBuffer& buffer, jint pc_offset, Handle si } void CodeInstaller::site_Infopoint(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) { - Handle debug_info = CompilationResult_Infopoint::debugInfo(site); + Handle debug_info = site_Infopoint::debugInfo(site); if (debug_info.is_null()) { JVMCI_ERROR("debug info expected at infopoint at %i", pc_offset); } @@ -1017,7 +1010,7 @@ void CodeInstaller::site_Infopoint(CodeBuffer& buffer, jint pc_offset, Handle si } void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) { - Handle target = CompilationResult_Call::target(site); + Handle target = site_Call::target(site); InstanceKlass* target_klass = InstanceKlass::cast(target->klass()); Handle hotspot_method; // JavaMethod @@ -1029,7 +1022,7 @@ void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, Handle site, T hotspot_method = target; } - Handle debug_info = CompilationResult_Call::debugInfo(site); + Handle debug_info = site_Call::debugInfo(site); assert(hotspot_method.not_null() ^ foreign_call.not_null(), "Call site needs exactly one type"); @@ -1066,11 +1059,11 @@ void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, Handle site, T } void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) { - Handle reference = CompilationResult_DataPatch::reference(site); + Handle reference = site_DataPatch::reference(site); if (reference.is_null()) { THROW(vmSymbols::java_lang_NullPointerException()); - } else if (reference->is_a(CompilationResult_ConstantReference::klass())) { - Handle constant = CompilationResult_ConstantReference::constant(reference); + } else if (reference->is_a(site_ConstantReference::klass())) { + Handle constant = site_ConstantReference::constant(reference); if (constant.is_null()) { THROW(vmSymbols::java_lang_NullPointerException()); } else if (constant->is_a(HotSpotObjectConstantImpl::klass())) { @@ -1080,8 +1073,8 @@ void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, Handle si } else { JVMCI_ERROR("unknown constant type in data patch: %s", constant->klass()->signature_name()); } - } else if (reference->is_a(CompilationResult_DataSectionReference::klass())) { - int data_offset = CompilationResult_DataSectionReference::offset(reference); + } else if (reference->is_a(site_DataSectionReference::klass())) { + int data_offset = site_DataSectionReference::offset(reference); if (0 <= data_offset && data_offset < _constants_size) { pd_patch_DataSectionReference(pc_offset, data_offset); } else { @@ -1093,7 +1086,7 @@ void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, Handle si } void CodeInstaller::site_Mark(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS) { - Handle id_obj = CompilationResult_Mark::id(site); + Handle id_obj = site_Mark::id(site); if (id_obj.not_null()) { if (!java_lang_boxing_object::is_instance(id_obj(), T_INT)) { diff --git a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp index 1157759d0ed..ccf6a6d836f 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -120,7 +120,6 @@ private: jobject _data_section_handle; jobject _data_section_patches_handle; jobject _sites_handle; - jobject _exception_handlers_handle; CodeOffsets _offsets; jobject _code_handle; @@ -166,7 +165,6 @@ private: arrayOop code() { return (arrayOop) JNIHandles::resolve(_code_handle); } arrayOop data_section() { return (arrayOop) JNIHandles::resolve(_data_section_handle); } objArrayOop data_section_patches() { return (objArrayOop) JNIHandles::resolve(_data_section_patches_handle); } - objArrayOop exception_handlers() { return (objArrayOop) JNIHandles::resolve(_exception_handlers_handle); } #ifndef PRODUCT objArrayOop comments() { return (objArrayOop) JNIHandles::resolve(_comments_handle); } #endif @@ -196,7 +194,7 @@ protected: narrowKlass record_narrow_metadata_reference(Handle constant, TRAPS); #endif - // extract the fields of the CompilationResult + // extract the fields of the HotSpotCompiledCode void initialize_fields(oop target, oop target_method, TRAPS); void initialize_dependencies(oop target_method, OopRecorder* oop_recorder, TRAPS); @@ -216,6 +214,7 @@ protected: void site_Call(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS); void site_DataPatch(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS); void site_Mark(CodeBuffer& buffer, jint pc_offset, Handle site, TRAPS); + void site_ExceptionHandler(jint pc_offset, Handle site); OopMap* create_oop_map(Handle debug_info, TRAPS); @@ -235,7 +234,6 @@ protected: GrowableArray* record_virtual_objects(Handle debug_info, TRAPS); - void process_exception_handlers(); int estimateStubSpace(int static_call_stubs); }; diff --git a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp index a49eda73d4d..b12a2a4b489 100644 --- a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,19 +79,18 @@ class JVMCIJavaClasses : AllStatic { end_class \ start_class(HotSpotCompiledCode) \ oop_field(HotSpotCompiledCode, name, "Ljava/lang/String;") \ - objArrayOop_field(HotSpotCompiledCode, sites, "[Ljdk/vm/ci/code/CompilationResult$Site;") \ - objArrayOop_field(HotSpotCompiledCode, exceptionHandlers, "[Ljdk/vm/ci/code/CompilationResult$ExceptionHandler;") \ - objArrayOop_field(HotSpotCompiledCode, comments, "[Ljdk/vm/ci/hotspot/HotSpotCompiledCode$Comment;") \ - objArrayOop_field(HotSpotCompiledCode, assumptions, "[Ljdk/vm/ci/meta/Assumptions$Assumption;") \ typeArrayOop_field(HotSpotCompiledCode, targetCode, "[B") \ int_field(HotSpotCompiledCode, targetCodeSize) \ + objArrayOop_field(HotSpotCompiledCode, sites, "[Ljdk/vm/ci/code/site/Site;") \ + objArrayOop_field(HotSpotCompiledCode, assumptions, "[Ljdk/vm/ci/meta/Assumptions$Assumption;") \ + objArrayOop_field(HotSpotCompiledCode, methods, "[Ljdk/vm/ci/meta/ResolvedJavaMethod;") \ + objArrayOop_field(HotSpotCompiledCode, comments, "[Ljdk/vm/ci/hotspot/HotSpotCompiledCode$Comment;") \ typeArrayOop_field(HotSpotCompiledCode, dataSection, "[B") \ int_field(HotSpotCompiledCode, dataSectionAlignment) \ - objArrayOop_field(HotSpotCompiledCode, dataSectionPatches, "[Ljdk/vm/ci/code/CompilationResult$DataPatch;") \ + objArrayOop_field(HotSpotCompiledCode, dataSectionPatches, "[Ljdk/vm/ci/code/site/DataPatch;") \ boolean_field(HotSpotCompiledCode, isImmutablePIC) \ int_field(HotSpotCompiledCode, totalFrameSize) \ int_field(HotSpotCompiledCode, customStackAreaOffset) \ - objArrayOop_field(HotSpotCompiledCode, methods, "[Ljdk/vm/ci/meta/ResolvedJavaMethod;") \ end_class \ start_class(HotSpotCompiledCode_Comment) \ oop_field(HotSpotCompiledCode_Comment, text, "Ljava/lang/String;") \ @@ -131,36 +130,36 @@ class JVMCIJavaClasses : AllStatic { oop_field(Assumptions_CallSiteTargetValue, callSite, "Ljava/lang/invoke/CallSite;") \ oop_field(Assumptions_CallSiteTargetValue, methodHandle, "Ljava/lang/invoke/MethodHandle;") \ end_class \ - start_class(CompilationResult_Site) \ - int_field(CompilationResult_Site, pcOffset) \ + start_class(site_Site) \ + int_field(site_Site, pcOffset) \ end_class \ - start_class(CompilationResult_Call) \ - oop_field(CompilationResult_Call, target, "Ljdk/vm/ci/meta/InvokeTarget;") \ - oop_field(CompilationResult_Call, debugInfo, "Ljdk/vm/ci/code/DebugInfo;") \ + start_class(site_Call) \ + oop_field(site_Call, target, "Ljdk/vm/ci/meta/InvokeTarget;") \ + oop_field(site_Call, debugInfo, "Ljdk/vm/ci/code/DebugInfo;") \ end_class \ - start_class(CompilationResult_DataPatch) \ - oop_field(CompilationResult_DataPatch, reference, "Ljdk/vm/ci/code/CompilationResult$Reference;") \ + start_class(site_DataPatch) \ + oop_field(site_DataPatch, reference, "Ljdk/vm/ci/code/site/Reference;") \ end_class \ - start_class(CompilationResult_ConstantReference) \ - oop_field(CompilationResult_ConstantReference, constant, "Ljdk/vm/ci/meta/VMConstant;") \ + start_class(site_ConstantReference) \ + oop_field(site_ConstantReference, constant, "Ljdk/vm/ci/meta/VMConstant;") \ end_class \ - start_class(CompilationResult_DataSectionReference) \ - int_field(CompilationResult_DataSectionReference, offset) \ + start_class(site_DataSectionReference) \ + int_field(site_DataSectionReference, offset) \ end_class \ - start_class(InfopointReason) \ - static_oop_field(InfopointReason, SAFEPOINT, "Ljdk/vm/ci/code/InfopointReason;") \ - static_oop_field(InfopointReason, CALL, "Ljdk/vm/ci/code/InfopointReason;") \ - static_oop_field(InfopointReason, IMPLICIT_EXCEPTION, "Ljdk/vm/ci/code/InfopointReason;") \ + start_class(site_InfopointReason) \ + static_oop_field(site_InfopointReason, SAFEPOINT, "Ljdk/vm/ci/code/site/InfopointReason;") \ + static_oop_field(site_InfopointReason, CALL, "Ljdk/vm/ci/code/site/InfopointReason;") \ + static_oop_field(site_InfopointReason, IMPLICIT_EXCEPTION, "Ljdk/vm/ci/code/site/InfopointReason;") \ end_class \ - start_class(CompilationResult_Infopoint) \ - oop_field(CompilationResult_Infopoint, debugInfo, "Ljdk/vm/ci/code/DebugInfo;") \ - oop_field(CompilationResult_Infopoint, reason, "Ljdk/vm/ci/code/InfopointReason;") \ + start_class(site_Infopoint) \ + oop_field(site_Infopoint, debugInfo, "Ljdk/vm/ci/code/DebugInfo;") \ + oop_field(site_Infopoint, reason, "Ljdk/vm/ci/code/site/InfopointReason;") \ end_class \ - start_class(CompilationResult_ExceptionHandler) \ - int_field(CompilationResult_ExceptionHandler, handlerPos) \ + start_class(site_ExceptionHandler) \ + int_field(site_ExceptionHandler, handlerPos) \ end_class \ - start_class(CompilationResult_Mark) \ - oop_field(CompilationResult_Mark, id, "Ljava/lang/Object;") \ + start_class(site_Mark) \ + oop_field(site_Mark, id, "Ljava/lang/Object;") \ end_class \ start_class(DebugInfo) \ oop_field(DebugInfo, bytecodePosition, "Ljdk/vm/ci/code/BytecodePosition;") \ diff --git a/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp b/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp index 58701527f0f..a506ebcd4b9 100644 --- a/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp +++ b/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,15 +60,6 @@ do_klass(DebugInfo_klass, jdk_vm_ci_code_DebugInfo, Jvmci) \ do_klass(RegisterSaveLayout_klass, jdk_vm_ci_code_RegisterSaveLayout, Jvmci) \ do_klass(BytecodeFrame_klass, jdk_vm_ci_code_BytecodeFrame, Jvmci) \ - do_klass(CompilationResult_Call_klass, jdk_vm_ci_code_CompilationResult_Call, Jvmci) \ - do_klass(CompilationResult_ConstantReference_klass, jdk_vm_ci_code_CompilationResult_ConstantReference, Jvmci) \ - do_klass(CompilationResult_DataPatch_klass, jdk_vm_ci_code_CompilationResult_DataPatch, Jvmci) \ - do_klass(CompilationResult_DataSectionReference_klass, jdk_vm_ci_code_CompilationResult_DataSectionReference, Jvmci) \ - do_klass(CompilationResult_ExceptionHandler_klass, jdk_vm_ci_code_CompilationResult_ExceptionHandler, Jvmci) \ - do_klass(CompilationResult_Mark_klass, jdk_vm_ci_code_CompilationResult_Mark, Jvmci) \ - do_klass(CompilationResult_Infopoint_klass, jdk_vm_ci_code_CompilationResult_Infopoint, Jvmci) \ - do_klass(CompilationResult_Site_klass, jdk_vm_ci_code_CompilationResult_Site, Jvmci) \ - do_klass(InfopointReason_klass, jdk_vm_ci_code_InfopointReason, Jvmci) \ do_klass(InstalledCode_klass, jdk_vm_ci_code_InstalledCode, Jvmci) \ do_klass(code_Location_klass, jdk_vm_ci_code_Location, Jvmci) \ do_klass(code_Register_klass, jdk_vm_ci_code_Register, Jvmci) \ @@ -76,6 +67,15 @@ do_klass(StackSlot_klass, jdk_vm_ci_code_StackSlot, Jvmci) \ do_klass(StackLockValue_klass, jdk_vm_ci_code_StackLockValue, Jvmci) \ do_klass(VirtualObject_klass, jdk_vm_ci_code_VirtualObject, Jvmci) \ + do_klass(site_Call_klass, jdk_vm_ci_code_site_Call, Jvmci) \ + do_klass(site_ConstantReference_klass, jdk_vm_ci_code_site_ConstantReference, Jvmci) \ + do_klass(site_DataPatch_klass, jdk_vm_ci_code_site_DataPatch, Jvmci) \ + do_klass(site_DataSectionReference_klass, jdk_vm_ci_code_site_DataSectionReference, Jvmci) \ + do_klass(site_ExceptionHandler_klass, jdk_vm_ci_code_site_ExceptionHandler, Jvmci) \ + do_klass(site_Mark_klass, jdk_vm_ci_code_site_Mark, Jvmci) \ + do_klass(site_Infopoint_klass, jdk_vm_ci_code_site_Infopoint, Jvmci) \ + do_klass(site_Site_klass, jdk_vm_ci_code_site_Site, Jvmci) \ + do_klass(site_InfopointReason_klass, jdk_vm_ci_code_site_InfopointReason, Jvmci) \ do_klass(JavaConstant_klass, jdk_vm_ci_meta_JavaConstant, Jvmci) \ do_klass(PrimitiveConstant_klass, jdk_vm_ci_meta_PrimitiveConstant, Jvmci) \ do_klass(RawConstant_klass, jdk_vm_ci_meta_RawConstant, Jvmci) \ diff --git a/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp b/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp index 8d8af6bd79a..b0070aad72f 100644 --- a/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp +++ b/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,28 +64,28 @@ template(jdk_vm_ci_meta_Assumptions_ConcreteMethod, "jdk/vm/ci/meta/Assumptions$ConcreteMethod") \ template(jdk_vm_ci_meta_Assumptions_CallSiteTargetValue, "jdk/vm/ci/meta/Assumptions$CallSiteTargetValue") \ template(jdk_vm_ci_code_Architecture, "jdk/vm/ci/code/Architecture") \ - template(jdk_vm_ci_code_TargetDescription, "jdk/vm/ci/code/TargetDescription") \ - template(jdk_vm_ci_code_CompilationResult_Call, "jdk/vm/ci/code/CompilationResult$Call") \ - template(jdk_vm_ci_code_CompilationResult_ConstantReference, "jdk/vm/ci/code/CompilationResult$ConstantReference") \ - template(jdk_vm_ci_code_CompilationResult_DataPatch, "jdk/vm/ci/code/CompilationResult$DataPatch") \ - template(jdk_vm_ci_code_CompilationResult_DataSectionReference, "jdk/vm/ci/code/CompilationResult$DataSectionReference") \ - template(jdk_vm_ci_code_CompilationResult_ExceptionHandler, "jdk/vm/ci/code/CompilationResult$ExceptionHandler") \ - template(jdk_vm_ci_code_CompilationResult_Mark, "jdk/vm/ci/code/CompilationResult$Mark") \ - template(jdk_vm_ci_code_CompilationResult_Infopoint, "jdk/vm/ci/code/CompilationResult$Infopoint") \ - template(jdk_vm_ci_code_CompilationResult_Site, "jdk/vm/ci/code/CompilationResult$Site") \ - template(jdk_vm_ci_code_InfopointReason, "jdk/vm/ci/code/InfopointReason") \ - template(jdk_vm_ci_code_InstalledCode, "jdk/vm/ci/code/InstalledCode") \ template(jdk_vm_ci_code_BytecodeFrame, "jdk/vm/ci/code/BytecodeFrame") \ template(jdk_vm_ci_code_BytecodePosition, "jdk/vm/ci/code/BytecodePosition") \ template(jdk_vm_ci_code_DebugInfo, "jdk/vm/ci/code/DebugInfo") \ + template(jdk_vm_ci_code_InstalledCode, "jdk/vm/ci/code/InstalledCode") \ template(jdk_vm_ci_code_Location, "jdk/vm/ci/code/Location") \ template(jdk_vm_ci_code_Register, "jdk/vm/ci/code/Register") \ template(jdk_vm_ci_code_RegisterValue, "jdk/vm/ci/code/RegisterValue") \ template(jdk_vm_ci_code_StackSlot, "jdk/vm/ci/code/StackSlot") \ template(jdk_vm_ci_code_StackLockValue, "jdk/vm/ci/code/StackLockValue") \ + template(jdk_vm_ci_code_TargetDescription, "jdk/vm/ci/code/TargetDescription") \ template(jdk_vm_ci_code_VirtualObject, "jdk/vm/ci/code/VirtualObject") \ template(jdk_vm_ci_code_RegisterSaveLayout, "jdk/vm/ci/code/RegisterSaveLayout") \ template(jdk_vm_ci_code_InvalidInstalledCodeException, "jdk/vm/ci/code/InvalidInstalledCodeException") \ + template(jdk_vm_ci_code_site_Call, "jdk/vm/ci/code/site/Call") \ + template(jdk_vm_ci_code_site_ConstantReference, "jdk/vm/ci/code/site/ConstantReference") \ + template(jdk_vm_ci_code_site_DataPatch, "jdk/vm/ci/code/site/DataPatch") \ + template(jdk_vm_ci_code_site_DataSectionReference, "jdk/vm/ci/code/site/DataSectionReference") \ + template(jdk_vm_ci_code_site_ExceptionHandler, "jdk/vm/ci/code/site/ExceptionHandler") \ + template(jdk_vm_ci_code_site_Mark, "jdk/vm/ci/code/site/Mark") \ + template(jdk_vm_ci_code_site_Infopoint, "jdk/vm/ci/code/site/Infopoint") \ + template(jdk_vm_ci_code_site_Site, "jdk/vm/ci/code/site/Site") \ + template(jdk_vm_ci_code_site_InfopointReason, "jdk/vm/ci/code/site/InfopointReason") \ template(jdk_vm_ci_common_JVMCIError, "jdk/vm/ci/common/JVMCIError") \ template(compileMethod_name, "compileMethod") \ template(compileMethod_signature, "(Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethod;IJI)V") \ diff --git a/hotspot/test/compiler/jvmci/code/CodeInstallationTest.java b/hotspot/test/compiler/jvmci/code/CodeInstallationTest.java index 7ef8ab6c01a..aa0899ed256 100644 --- a/hotspot/test/compiler/jvmci/code/CodeInstallationTest.java +++ b/hotspot/test/compiler/jvmci/code/CodeInstallationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,12 +27,12 @@ import java.lang.reflect.Method; import jdk.vm.ci.amd64.AMD64; import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationResult; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.TargetDescription; +import jdk.vm.ci.hotspot.HotSpotCompiledCode; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.MetaAccessProvider; -import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.sparc.SPARC; @@ -65,12 +65,12 @@ public class CodeInstallationTest { void compile(TestAssembler asm); } - private TestAssembler createAssembler(CompilationResult result) { + private TestAssembler createAssembler() { Architecture arch = codeCache.getTarget().arch; if (arch instanceof AMD64) { - return new AMD64TestAssembler(result, codeCache); + return new AMD64TestAssembler(codeCache); } else if (arch instanceof SPARC) { - return new SPARCTestAssembler(result, codeCache); + return new SPARCTestAssembler(codeCache); } else { Assert.fail("unsupported architecture"); return null; @@ -87,17 +87,14 @@ public class CodeInstallationTest { } protected void test(TestCompiler compiler, Method method, Object... args) { - CompilationResult result = new CompilationResult(method.getName()); - TestAssembler asm = createAssembler(result); + HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) metaAccess.lookupJavaMethod(method); + TestAssembler asm = createAssembler(); asm.emitPrologue(); compiler.compile(asm); - asm.finish(); - result.close(); - - ResolvedJavaMethod resolvedMethod = metaAccess.lookupJavaMethod(method); - InstalledCode installed = codeCache.addCode(resolvedMethod, result, null, null); + HotSpotCompiledCode code = asm.finish(resolvedMethod); + InstalledCode installed = codeCache.addCode(resolvedMethod, code, null, null); try { Object expected = method.invoke(null, args); diff --git a/hotspot/test/compiler/jvmci/code/DataPatchTest.java b/hotspot/test/compiler/jvmci/code/DataPatchTest.java index 42bf40c1af4..b427a783512 100644 --- a/hotspot/test/compiler/jvmci/code/DataPatchTest.java +++ b/hotspot/test/compiler/jvmci/code/DataPatchTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,9 +30,8 @@ package compiler.jvmci.code; -import jdk.vm.ci.code.CompilationResult.DataSectionReference; -import jdk.vm.ci.code.DataSection.Data; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.site.DataSectionReference; import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.meta.ResolvedJavaType; @@ -53,7 +52,6 @@ public class DataPatchTest extends CodeInstallationTest { test(compiler, getMethod("getConstClass")); } - @Test public void testInlineObject() { test(asm -> { @@ -81,8 +79,7 @@ public class DataPatchTest extends CodeInstallationTest { test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); HotSpotConstant c = (HotSpotConstant) type.getJavaClass(); - Data data = codeCache.createDataItem(c); - DataSectionReference ref = asm.result.getDataSection().insertData(data); + DataSectionReference ref = asm.emitDataItem(c); Register ret = asm.emitLoadPointer(ref); asm.emitPointerRet(ret); }); @@ -95,8 +92,7 @@ public class DataPatchTest extends CodeInstallationTest { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); HotSpotConstant c = (HotSpotConstant) type.getJavaClass(); HotSpotConstant cCompressed = (HotSpotConstant) c.compress(); - Data data = codeCache.createDataItem(cCompressed); - DataSectionReference ref = asm.result.getDataSection().insertData(data); + DataSectionReference ref = asm.emitDataItem(cCompressed); Register compressed = asm.emitLoadNarrowPointer(ref); Register ret = asm.emitUncompressPointer(compressed, HotSpotVMConfig.config().narrowOopBase, HotSpotVMConfig.config().narrowOopShift); asm.emitPointerRet(ret); @@ -131,8 +127,7 @@ public class DataPatchTest extends CodeInstallationTest { test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); HotSpotConstant hub = (HotSpotConstant) type.getObjectHub(); - Data data = codeCache.createDataItem(hub); - DataSectionReference ref = asm.result.getDataSection().insertData(data); + DataSectionReference ref = asm.emitDataItem(hub); Register klass = asm.emitLoadPointer(ref); Register ret = asm.emitLoadPointer(klass, HotSpotVMConfig.config().classMirrorOffset); asm.emitPointerRet(ret); @@ -146,8 +141,7 @@ public class DataPatchTest extends CodeInstallationTest { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); HotSpotConstant hub = (HotSpotConstant) type.getObjectHub(); HotSpotConstant narrowHub = (HotSpotConstant) hub.compress(); - Data data = codeCache.createDataItem(narrowHub); - DataSectionReference ref = asm.result.getDataSection().insertData(data); + DataSectionReference ref = asm.emitDataItem(narrowHub); Register narrowKlass = asm.emitLoadNarrowPointer(ref); Register klass = asm.emitUncompressPointer(narrowKlass, HotSpotVMConfig.config().narrowKlassBase, HotSpotVMConfig.config().narrowKlassShift); Register ret = asm.emitLoadPointer(klass, HotSpotVMConfig.config().classMirrorOffset); diff --git a/hotspot/test/compiler/jvmci/code/TestAssembler.java b/hotspot/test/compiler/jvmci/code/TestAssembler.java index 520e19b0e32..1eeb1bd3408 100644 --- a/hotspot/test/compiler/jvmci/code/TestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/TestAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,17 +25,30 @@ package compiler.jvmci.code; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.util.ArrayList; import java.util.Arrays; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.CompilationResult.DataSectionReference; import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; +import jdk.vm.ci.code.site.ConstantReference; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.DataSectionReference; +import jdk.vm.ci.code.site.Infopoint; +import jdk.vm.ci.code.site.InfopointReason; +import jdk.vm.ci.code.site.Reference; +import jdk.vm.ci.code.site.Site; +import jdk.vm.ci.hotspot.HotSpotCompiledCode; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; +import jdk.vm.ci.hotspot.HotSpotCompiledNmethod; import jdk.vm.ci.hotspot.HotSpotConstant; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.PlatformKind; +import jdk.vm.ci.meta.ResolvedJavaMethod; +import jdk.vm.ci.meta.VMConstant; /** * Simple assembler used by the code installation tests. @@ -49,6 +62,7 @@ public abstract class TestAssembler { /** * Emit code to grow the stack frame. + * * @param size the size in bytes that the stack should grow */ public abstract void emitGrowStack(int size); @@ -84,18 +98,20 @@ public abstract class TestAssembler { public abstract Register emitLoadFloat(float value); /** - * Emit code to load a constant oop or metaspace pointer to a register. - * The pointer may be wide or narrow, depending on {@link HotSpotConstant#isCompressed() c.isCompressed()}. + * Emit code to load a constant oop or metaspace pointer to a register. The pointer may be wide + * or narrow, depending on {@link HotSpotConstant#isCompressed() c.isCompressed()}. */ public abstract Register emitLoadPointer(HotSpotConstant c); /** - * Emit code to load a wide pointer from the {@link DataSection} to a register. + * Emit code to load a wide pointer from the {@link HotSpotCompiledCode#dataSection} to a + * register. */ public abstract Register emitLoadPointer(DataSectionReference ref); /** - * Emit code to load a narrow pointer from the {@link DataSection} to a register. + * Emit code to load a narrow pointer from the {@link HotSpotCompiledCode#dataSection} to a + * register. */ public abstract Register emitLoadNarrowPointer(DataSectionReference ref); @@ -149,14 +165,13 @@ public abstract class TestAssembler { */ public abstract void emitTrap(DebugInfo info); - protected int position() { - return data.position(); - } - - public final CompilationResult result; public final LIRKind narrowOopKind; - private ByteBuffer data; + protected final Buffer code; + protected final Buffer data; + private final ArrayList sites; + private final ArrayList dataPatches; + protected final CodeCacheProvider codeCache; private final Register[] registers; @@ -166,11 +181,14 @@ public abstract class TestAssembler { private int stackAlignment; private int curStackSlot; - protected TestAssembler(CompilationResult result, CodeCacheProvider codeCache, int initialFrameSize, int stackAlignment, PlatformKind narrowOopKind, Register... registers) { - this.result = result; + protected TestAssembler(CodeCacheProvider codeCache, int initialFrameSize, int stackAlignment, PlatformKind narrowOopKind, Register... registers) { this.narrowOopKind = LIRKind.reference(narrowOopKind); - this.data = ByteBuffer.allocate(32).order(ByteOrder.nativeOrder()); + this.code = new Buffer(); + this.data = new Buffer(); + this.sites = new ArrayList<>(); + this.dataPatches = new ArrayList<>(); + this.codeCache = codeCache; this.registers = registers; @@ -198,38 +216,87 @@ public abstract class TestAssembler { return StackSlot.get(kind, -curStackSlot, true); } - public void finish() { - result.setTotalFrameSize(frameSize); - result.setTargetCode(data.array(), data.position()); + protected void recordImplicitException(DebugInfo info) { + sites.add(new Infopoint(code.position(), info, InfopointReason.IMPLICIT_EXCEPTION)); } - private void ensureSize(int length) { - if (length >= data.limit()) { - byte[] newBuf = Arrays.copyOf(data.array(), length * 4); - ByteBuffer newData = ByteBuffer.wrap(newBuf); - newData.order(data.order()); - newData.position(data.position()); - data = newData; + protected void recordDataPatchInCode(Reference ref) { + sites.add(new DataPatch(code.position(), ref)); + } + + protected void recordDataPatchInData(Reference ref) { + dataPatches.add(new DataPatch(data.position(), ref)); + } + + public DataSectionReference emitDataItem(HotSpotConstant c) { + DataSectionReference ref = new DataSectionReference(); + ref.setOffset(data.position()); + + recordDataPatchInData(new ConstantReference((VMConstant) c)); + if (c.isCompressed()) { + data.emitInt(0xDEADDEAD); + } else { + data.emitLong(0xDEADDEADDEADDEADL); + } + + return ref; + } + + public HotSpotCompiledCode finish(HotSpotResolvedJavaMethod method) { + int id = method.allocateCompileId(0); + byte[] finishedCode = code.finish(); + Site[] finishedSites = sites.toArray(new Site[0]); + byte[] finishedData = data.finish(); + DataPatch[] finishedDataPatches = dataPatches.toArray(new DataPatch[0]); + return new HotSpotCompiledNmethod(method.getName(), finishedCode, finishedCode.length, finishedSites, new Assumption[0], new ResolvedJavaMethod[]{method}, new Comment[0], finishedData, 16, + finishedDataPatches, false, frameSize, 0, method, 0, id, 0L, false); + } + + protected static class Buffer { + + private ByteBuffer data = ByteBuffer.allocate(32).order(ByteOrder.nativeOrder()); + + private void ensureSize(int length) { + if (length >= data.limit()) { + byte[] newBuf = Arrays.copyOf(data.array(), length * 4); + ByteBuffer newData = ByteBuffer.wrap(newBuf); + newData.order(data.order()); + newData.position(data.position()); + data = newData; + } + } + + public int position() { + return data.position(); + } + + public void emitByte(int b) { + ensureSize(data.position() + 1); + data.put((byte) (b & 0xFF)); + } + + public void emitShort(int b) { + ensureSize(data.position() + 2); + data.putShort((short) b); + } + + public void emitInt(int b) { + ensureSize(data.position() + 4); + data.putInt(b); + } + + public void emitLong(long b) { + ensureSize(data.position() + 8); + data.putLong(b); + } + + public void emitFloat(float f) { + ensureSize(data.position() + 4); + data.putFloat(f); + } + + private byte[] finish() { + return Arrays.copyOf(data.array(), data.position()); } } - - protected void emitByte(int b) { - ensureSize(data.position() + 1); - data.put((byte) (b & 0xFF)); - } - - protected void emitShort(int b) { - ensureSize(data.position() + 2); - data.putShort((short) b); - } - - protected void emitInt(int b) { - ensureSize(data.position() + 4); - data.putInt(b); - } - - protected void emitLong(long b) { - ensureSize(data.position() + 8); - data.putLong(b); - } } diff --git a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java index efd001c18d4..219b668d63d 100644 --- a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,18 +25,14 @@ package compiler.jvmci.code.amd64; import jdk.vm.ci.amd64.AMD64; import jdk.vm.ci.amd64.AMD64Kind; +import jdk.vm.ci.code.CallingConvention.Type; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.CompilationResult.ConstantReference; -import jdk.vm.ci.code.CompilationResult.DataSectionReference; -import jdk.vm.ci.code.DataSection.Data; import jdk.vm.ci.code.DebugInfo; -import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; -import jdk.vm.ci.code.CallingConvention.Type; +import jdk.vm.ci.code.site.ConstantReference; +import jdk.vm.ci.code.site.DataSectionReference; import jdk.vm.ci.hotspot.HotSpotConstant; -import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.VMConstant; @@ -45,27 +41,31 @@ import compiler.jvmci.code.TestAssembler; public class AMD64TestAssembler extends TestAssembler { - public AMD64TestAssembler(CompilationResult result, CodeCacheProvider codeCache) { - super(result, codeCache, 16, 16, AMD64Kind.DWORD, AMD64.rax, AMD64.rcx, AMD64.rdi, AMD64.r8, AMD64.r9, AMD64.r10); + public AMD64TestAssembler(CodeCacheProvider codeCache) { + super(codeCache, 16, 16, AMD64Kind.DWORD, AMD64.rax, AMD64.rcx, AMD64.rdi, AMD64.r8, AMD64.r9, AMD64.r10); } + @Override public void emitPrologue() { - emitByte(0x50 | AMD64.rbp.encoding); // PUSH rbp - emitMove(true, AMD64.rbp, AMD64.rsp); // MOV rbp, rsp + code.emitByte(0x50 | AMD64.rbp.encoding); // PUSH rbp + emitMove(true, AMD64.rbp, AMD64.rsp); // MOV rbp, rsp } + @Override public void emitGrowStack(int size) { // SUB rsp, size - emitByte(0x48); - emitByte(0x81); - emitByte(0xEC); - emitInt(size); + code.emitByte(0x48); + code.emitByte(0x81); + code.emitByte(0xEC); + code.emitInt(size); } + @Override public Register emitIntArg0() { return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCall, JavaKind.Int)[0]; } + @Override public Register emitIntArg1() { return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCall, JavaKind.Int)[1]; } @@ -73,60 +73,66 @@ public class AMD64TestAssembler extends TestAssembler { private void emitREX(boolean w, int r, int x, int b) { int wrxb = (w ? 0x08 : 0) | ((r >> 3) << 2) | ((x >> 3) << 1) | (b >> 3); if (wrxb != 0) { - emitByte(0x40 | wrxb); + code.emitByte(0x40 | wrxb); } } private void emitModRMReg(boolean w, int opcode, int r, int m) { emitREX(w, r, 0, m); - emitByte((byte) opcode); - emitByte((byte) 0xC0 | ((r & 0x7) << 3) | (m & 0x7)); + code.emitByte((byte) opcode); + code.emitByte((byte) 0xC0 | ((r & 0x7) << 3) | (m & 0x7)); } private void emitModRMMemory(boolean w, int opcode, int r, int b, int offset) { emitREX(w, r, 0, b); - emitByte((byte) opcode); - emitByte((byte) 0x80 | ((r & 0x7) << 3) | (b & 0x7)); - emitInt(offset); + code.emitByte((byte) opcode); + code.emitByte((byte) 0x80 | ((r & 0x7) << 3) | (b & 0x7)); + code.emitInt(offset); } + @Override public Register emitLoadInt(int c) { Register ret = newRegister(); emitREX(false, 0, 0, ret.encoding); - emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r32, imm32 - emitInt(c); + code.emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r32, imm32 + code.emitInt(c); return ret; } + @Override public Register emitLoadLong(long c) { Register ret = newRegister(); emitREX(true, 0, 0, ret.encoding); - emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r64, imm64 - emitLong(c); + code.emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r64, imm64 + code.emitLong(c); return ret; } + @Override public Register emitLoadFloat(float c) { - Data data = codeCache.createDataItem(JavaConstant.forFloat(c)); - DataSectionReference ref = result.getDataSection().insertData(data); - result.recordDataPatch(position(), ref); + DataSectionReference ref = new DataSectionReference(); + ref.setOffset(data.position()); + data.emitFloat(c); + + recordDataPatchInCode(ref); Register ret = AMD64.xmm0; emitREX(false, ret.encoding, 0, 0); - emitByte(0xF3); - emitByte(0x0F); - emitByte(0x10); // MOVSS xmm1, xmm2/m32 - emitByte(0x05 | ((ret.encoding & 0x7) << 3)); // xmm, [rip+offset] - emitInt(0xDEADDEAD); + code.emitByte(0xF3); + code.emitByte(0x0F); + code.emitByte(0x10); // MOVSS xmm1, xmm2/m32 + code.emitByte(0x05 | ((ret.encoding & 0x7) << 3)); // xmm, [rip+offset] + code.emitInt(0xDEADDEAD); return ret; } + @Override public Register emitLoadPointer(HotSpotConstant c) { - result.recordDataPatch(position(), new ConstantReference((VMConstant) c)); + recordDataPatchInCode(new ConstantReference((VMConstant) c)); if (c.isCompressed()) { Register ret = newRegister(); emitREX(false, 0, 0, ret.encoding); - emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r32, imm32 - emitInt(0xDEADDEAD); + code.emitByte(0xB8 | (ret.encoding & 0x7)); // MOV r32, imm32 + code.emitInt(0xDEADDEAD); return ret; } else { return emitLoadLong(0xDEADDEADDEADDEADl); @@ -134,68 +140,77 @@ public class AMD64TestAssembler extends TestAssembler { } private Register emitLoadPointer(DataSectionReference ref, boolean narrow) { - result.recordDataPatch(position(), ref); + recordDataPatchInCode(ref); Register ret = newRegister(); emitREX(!narrow, ret.encoding, 0, 0); - emitByte(0x8B); // MOV r64,r/m64 - emitByte(0x05 | ((ret.encoding & 0x7) << 3)); // r64, [rip+offset] - emitInt(0xDEADDEAD); + code.emitByte(0x8B); // MOV r64,r/m64 + code.emitByte(0x05 | ((ret.encoding & 0x7) << 3)); // r64, [rip+offset] + code.emitInt(0xDEADDEAD); return ret; } + @Override public Register emitLoadPointer(DataSectionReference ref) { return emitLoadPointer(ref, false); } + @Override public Register emitLoadNarrowPointer(DataSectionReference ref) { return emitLoadPointer(ref, true); } + @Override public Register emitLoadPointer(Register b, int offset) { Register ret = newRegister(); emitModRMMemory(true, 0x8B, ret.encoding, b.encoding, offset); // MOV r64,r/m64 return ret; } + @Override public StackSlot emitIntToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(AMD64Kind.DWORD)); emitModRMMemory(false, 0x89, a.encoding, AMD64.rbp.encoding, ret.getRawOffset() + 16); // MOV r/m32,r32 return ret; } + @Override public StackSlot emitLongToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(AMD64Kind.QWORD)); emitModRMMemory(true, 0x89, a.encoding, AMD64.rbp.encoding, ret.getRawOffset() + 16); // MOV r/m64,r64 return ret; } + @Override public StackSlot emitFloatToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(AMD64Kind.SINGLE)); emitREX(false, a.encoding, 0, 0); - emitByte(0xF3); - emitByte(0x0F); - emitByte(0x11); // MOVSS xmm2/m32, xmm1 - emitByte(0x85 | ((a.encoding & 0x7) << 3)); // [rbp+offset] - emitInt(ret.getRawOffset() + 16); + code.emitByte(0xF3); + code.emitByte(0x0F); + code.emitByte(0x11); // MOVSS xmm2/m32, xmm1 + code.emitByte(0x85 | ((a.encoding & 0x7) << 3)); // [rbp+offset] + code.emitInt(ret.getRawOffset() + 16); return ret; } + @Override public StackSlot emitPointerToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.reference(AMD64Kind.QWORD)); emitModRMMemory(true, 0x89, a.encoding, AMD64.rbp.encoding, ret.getRawOffset() + 16); // MOV r/m64,r64 return ret; } + @Override public StackSlot emitNarrowPointerToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.reference(AMD64Kind.DWORD)); emitModRMMemory(false, 0x89, a.encoding, AMD64.rbp.encoding, ret.getRawOffset() + 16); // MOV r/m32,r32 return ret; } + @Override public Register emitUncompressPointer(Register compressed, long base, int shift) { if (shift > 0) { emitModRMReg(true, 0xC1, 4, compressed.encoding); - emitByte(shift); + code.emitByte(shift); } if (base == 0) { return compressed; @@ -206,6 +221,7 @@ public class AMD64TestAssembler extends TestAssembler { } } + @Override public Register emitIntAdd(Register a, Register b) { emitModRMReg(false, 0x03, a.encoding, b.encoding); return a; @@ -217,26 +233,29 @@ public class AMD64TestAssembler extends TestAssembler { } } + @Override public void emitIntRet(Register a) { - emitMove(false, AMD64.rax, a); // MOV eax, ... - emitMove(true, AMD64.rsp, AMD64.rbp); // MOV rsp, rbp - emitByte(0x58 | AMD64.rbp.encoding); // POP rbp - emitByte(0xC3); // RET + emitMove(false, AMD64.rax, a); // MOV eax, ... + emitMove(true, AMD64.rsp, AMD64.rbp); // MOV rsp, rbp + code.emitByte(0x58 | AMD64.rbp.encoding); // POP rbp + code.emitByte(0xC3); // RET } + @Override public void emitPointerRet(Register a) { - emitMove(true, AMD64.rax, a); // MOV rax, ... - emitMove(true, AMD64.rsp, AMD64.rbp); // MOV rsp, rbp - emitByte(0x58 | AMD64.rbp.encoding); // POP rbp - emitByte(0xC3); // RET + emitMove(true, AMD64.rax, a); // MOV rax, ... + emitMove(true, AMD64.rsp, AMD64.rbp); // MOV rsp, rbp + code.emitByte(0x58 | AMD64.rbp.encoding); // POP rbp + code.emitByte(0xC3); // RET } + @Override public void emitTrap(DebugInfo info) { - result.recordInfopoint(position(), info, InfopointReason.IMPLICIT_EXCEPTION); + recordImplicitException(info); // MOV rax, [0] - emitByte(0x8B); - emitByte(0x04); - emitByte(0x25); - emitInt(0); + code.emitByte(0x8B); + code.emitByte(0x04); + code.emitByte(0x25); + code.emitInt(0); } } diff --git a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java index b37ed57c77a..a39e861df5c 100644 --- a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,18 +23,16 @@ package compiler.jvmci.code.sparc; +import jdk.vm.ci.code.CallingConvention.Type; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.CompilationResult.ConstantReference; -import jdk.vm.ci.code.CompilationResult.DataSectionReference; -import jdk.vm.ci.code.DataSection.Data; import jdk.vm.ci.code.DebugInfo; -import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; -import jdk.vm.ci.code.CallingConvention.Type; +import jdk.vm.ci.code.site.ConstantReference; +import jdk.vm.ci.code.site.DataSectionReference; +import jdk.vm.ci.hotspot.HotSpotCompiledCode; import jdk.vm.ci.hotspot.HotSpotConstant; -import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.VMConstant; @@ -47,48 +45,53 @@ public class SPARCTestAssembler extends TestAssembler { private static final int MASK13 = (1 << 13) - 1; - public SPARCTestAssembler(CompilationResult result, CodeCacheProvider codeCache) { - super(result, codeCache, 0, 16, SPARCKind.WORD, SPARC.l0, SPARC.l1, SPARC.l2, SPARC.l3, SPARC.l4, SPARC.l5, SPARC.l6, SPARC.l7); + public SPARCTestAssembler(CodeCacheProvider codeCache) { + super(codeCache, 0, 16, SPARCKind.WORD, SPARC.l0, SPARC.l1, SPARC.l2, SPARC.l3, SPARC.l4, SPARC.l5, SPARC.l6, SPARC.l7); } private void emitOp2(Register rd, int op2, int imm22) { - emitInt((0b00 << 30) | (rd.encoding << 25) | (op2 << 22) | imm22); + code.emitInt((0b00 << 30) | (rd.encoding << 25) | (op2 << 22) | imm22); } private void emitOp3(int op, Register rd, int op3, Register rs1, Register rs2) { - emitInt((op << 30) | (rd.encoding << 25) | (op3 << 19) | (rs1.encoding << 14) | rs2.encoding); + code.emitInt((op << 30) | (rd.encoding << 25) | (op3 << 19) | (rs1.encoding << 14) | rs2.encoding); } private void emitOp3(int op, Register rd, int op3, Register rs1, int simm13) { - emitInt((op << 30) | (rd.encoding << 25) | (op3 << 19) | (rs1.encoding << 14) | (1 << 13) | (simm13 & MASK13)); + code.emitInt((op << 30) | (rd.encoding << 25) | (op3 << 19) | (rs1.encoding << 14) | (1 << 13) | (simm13 & MASK13)); } private void emitNop() { - emitInt(1 << 24); + code.emitInt(1 << 24); } + @Override public void emitPrologue() { emitOp3(0b10, SPARC.sp, 0b111100, SPARC.sp, -SPARC.REGISTER_SAFE_AREA_SIZE); // SAVE sp, -128, sp } @Override - public void finish() { + public HotSpotCompiledCode finish(HotSpotResolvedJavaMethod method) { frameSize += SPARC.REGISTER_SAFE_AREA_SIZE; - super.finish(); + return super.finish(method); } + @Override public void emitGrowStack(int size) { emitOp3(0b10, SPARC.sp, 0b000100, SPARC.sp, size); // SUB sp, size, sp } + @Override public Register emitIntArg0() { return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCallee, JavaKind.Int)[0]; } + @Override public Register emitIntArg1() { return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCallee, JavaKind.Int)[1]; } + @Override public Register emitLoadInt(int c) { Register ret = newRegister(); int hi = c >>> 10; @@ -104,41 +107,46 @@ public class SPARCTestAssembler extends TestAssembler { return ret; } + @Override public Register emitLoadLong(long c) { if ((c & 0xFFFFFFFF) == c) { return emitLoadInt((int) c); } else { - Data data = codeCache.createDataItem(JavaConstant.forLong(c)); - DataSectionReference ref = result.getDataSection().insertData(data); + DataSectionReference ref = new DataSectionReference(); + ref.setOffset(data.position()); + data.emitLong(c); return emitLoadPointer(ref); } } private void emitPatchableSethi(Register ret, boolean wide) { - int startPos = position(); + int startPos = code.position(); emitOp2(ret, 0b100, 0); // SETHI 0, ret if (wide) { // pad for later patching - while (position() < (startPos + 28)) { + while (code.position() < (startPos + 28)) { emitNop(); } } } + @Override public Register emitLoadFloat(float c) { - Data data = codeCache.createDataItem(JavaConstant.forFloat(c)); - DataSectionReference ref = result.getDataSection().insertData(data); + DataSectionReference ref = new DataSectionReference(); + ref.setOffset(data.position()); + data.emitFloat(c); Register ptr = newRegister(); - result.recordDataPatch(position(), ref); + recordDataPatchInCode(ref); emitPatchableSethi(ptr, true); emitOp3(0b11, SPARC.f0, 0b100000, ptr, 0); // LDF [ptr+0], f0 return SPARC.f0; } + @Override public Register emitLoadPointer(HotSpotConstant c) { Register ret = newRegister(); - result.recordDataPatch(position(), new ConstantReference((VMConstant) c)); + recordDataPatchInCode(new ConstantReference((VMConstant) c)); emitPatchableSethi(ret, !c.isCompressed()); emitOp3(0b10, ret, 0b000010, ret, 0); // OR ret, 0, ret @@ -146,58 +154,67 @@ public class SPARCTestAssembler extends TestAssembler { return ret; } + @Override public Register emitLoadPointer(DataSectionReference ref) { Register ret = newRegister(); - result.recordDataPatch(position(), ref); + recordDataPatchInCode(ref); emitPatchableSethi(ret, true); emitOp3(0b11, ret, 0b001011, ret, 0); // LDX [ret+0], ret return ret; } + @Override public Register emitLoadNarrowPointer(DataSectionReference ref) { Register ret = newRegister(); - result.recordDataPatch(position(), ref); + recordDataPatchInCode(ref); emitPatchableSethi(ret, true); emitOp3(0b11, ret, 0b000000, ret, 0); // LDUW [ret+0], ret return ret; } + @Override public Register emitLoadPointer(Register b, int offset) { Register ret = newRegister(); emitOp3(0b11, ret, 0b001011, b, offset); // LDX [b+offset], ret return ret; } + @Override public StackSlot emitIntToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(SPARCKind.WORD)); emitOp3(0b11, a, 0b000100, SPARC.fp, ret.getRawOffset() + SPARC.STACK_BIAS); // STW a, [fp+offset] return ret; } + @Override public StackSlot emitLongToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(SPARCKind.XWORD)); emitOp3(0b11, a, 0b001110, SPARC.fp, ret.getRawOffset() + SPARC.STACK_BIAS); // STX a, [fp+offset] return ret; } + @Override public StackSlot emitFloatToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.value(SPARCKind.SINGLE)); emitOp3(0b11, a, 0b100100, SPARC.fp, ret.getRawOffset() + SPARC.STACK_BIAS); // STF a, [fp+offset] return ret; } + @Override public StackSlot emitPointerToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.reference(SPARCKind.XWORD)); emitOp3(0b11, a, 0b001110, SPARC.fp, ret.getRawOffset() + SPARC.STACK_BIAS); // STX a, [fp+offset] return ret; } + @Override public StackSlot emitNarrowPointerToStack(Register a) { StackSlot ret = newStackSlot(LIRKind.reference(SPARCKind.WORD)); emitOp3(0b11, a, 0b000100, SPARC.fp, ret.getRawOffset() + SPARC.STACK_BIAS); // STW a, [fp+offset] return ret; } + @Override public Register emitUncompressPointer(Register compressed, long base, int shift) { Register ret; if (shift > 0) { @@ -215,6 +232,7 @@ public class SPARCTestAssembler extends TestAssembler { } } + @Override public Register emitIntAdd(Register a, Register b) { Register ret = newRegister(); emitOp3(0b10, ret, 0b00000, a, b); // ADD a, b, ret @@ -227,18 +245,21 @@ public class SPARCTestAssembler extends TestAssembler { } } + @Override public void emitIntRet(Register a) { emitPointerRet(a); } + @Override public void emitPointerRet(Register a) { emitMove(SPARC.i0, a); emitOp3(0b10, SPARC.g0, 0b111000, SPARC.i7, 8); // JMPL [i7+8], g0 emitOp3(0b10, SPARC.g0, 0b111101, SPARC.g0, SPARC.g0); // RESTORE g0, g0, g0 } + @Override public void emitTrap(DebugInfo info) { - result.recordInfopoint(position(), info, InfopointReason.IMPLICIT_EXCEPTION); + recordImplicitException(info); emitOp3(0b11, SPARC.g0, 0b001011, SPARC.g0, 0); // LDX [g0+0], g0 } } diff --git a/hotspot/test/compiler/jvmci/errors/CodeInstallerTest.java b/hotspot/test/compiler/jvmci/errors/CodeInstallerTest.java index 195b7d52cd7..b06697634b2 100644 --- a/hotspot/test/compiler/jvmci/errors/CodeInstallerTest.java +++ b/hotspot/test/compiler/jvmci/errors/CodeInstallerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,12 +27,16 @@ import java.lang.reflect.Method; import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.code.CompilationResult; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Site; +import jdk.vm.ci.hotspot.HotSpotCompiledCode; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; +import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; +import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.ResolvedJavaMethod; -import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; @@ -67,22 +71,18 @@ public class CodeInstallerTest { dummyMethod = metaAccess.lookupJavaMethod(method); } - protected void installCode(CompilationResult result) { - result.close(); - codeCache.addCode(dummyMethod, result, null, null); - } - - protected CompilationResult createEmptyCompilationResult() { - CompilationResult ret = new CompilationResult(); - ret.setTotalFrameSize(0); - return ret; + protected void installEmptyCode(Site[] sites, Assumption[] assumptions, Comment[] comments, int dataSectionAlignment, DataPatch[] dataSectionPatches) { + HotSpotCompiledCode code = new HotSpotCompiledCode("dummyMethod", new byte[0], 0, sites, assumptions, new ResolvedJavaMethod[]{dummyMethod}, comments, new byte[8], dataSectionAlignment, + dataSectionPatches, false, 0, 0); + codeCache.addCode(dummyMethod, code, null, null); } protected Register getRegister(PlatformKind kind, int index) { + int idx = index; Register[] allRegs = arch.getAvailableValueRegisters(); for (int i = 0; i < allRegs.length; i++) { if (arch.canStoreValue(allRegs[i].getRegisterCategory(), kind)) { - if (index-- == 0) { + if (idx-- == 0) { return allRegs[i]; } } diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java index f40dea820eb..928bd74522e 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,20 +30,18 @@ package compiler.jvmci.errors; -import static jdk.vm.ci.code.CompilationResult.ConstantReference; -import static jdk.vm.ci.code.CompilationResult.DataPatch; -import static jdk.vm.ci.code.CompilationResult.DataSectionReference; -import static jdk.vm.ci.code.CompilationResult.Infopoint; -import static jdk.vm.ci.code.CompilationResult.Reference; -import static jdk.vm.ci.code.DataSection.Data; -import static jdk.vm.ci.code.DataSection.DataBuilder; -import static jdk.vm.ci.meta.Assumptions.Assumption; - -import jdk.vm.ci.code.CompilationResult; -import jdk.vm.ci.code.InfopointReason; +import jdk.vm.ci.code.site.ConstantReference; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.DataSectionReference; +import jdk.vm.ci.code.site.Infopoint; +import jdk.vm.ci.code.site.InfopointReason; +import jdk.vm.ci.code.site.Mark; +import jdk.vm.ci.code.site.Reference; +import jdk.vm.ci.code.site.Site; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; import jdk.vm.ci.hotspot.HotSpotConstant; -import jdk.vm.ci.meta.ResolvedJavaType; +import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.VMConstant; import org.junit.Test; @@ -82,153 +80,104 @@ public class TestInvalidCompilationResult extends CodeInstallerTest { @Test(expected = JVMCIError.class) public void testInvalidAssumption() { - CompilationResult result = createEmptyCompilationResult(); - result.setAssumptions(new Assumption[]{new InvalidAssumption()}); - installCode(result); + installEmptyCode(new Site[0], new Assumption[]{new InvalidAssumption()}, new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInvalidAlignment() { - CompilationResult result = createEmptyCompilationResult(); - result.getDataSection().insertData(new Data(7, 1, DataBuilder.zero(1))); - installCode(result); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 7, new DataPatch[0]); } @Test(expected = NullPointerException.class) public void testNullDataPatchInDataSection() { - CompilationResult result = createEmptyCompilationResult(); - Data data = new Data(1, 1, (buffer, patch) -> { - patch.accept(null); - buffer.put((byte) 0); - }); - result.getDataSection().insertData(data); - installCode(result); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{null}); } @Test(expected = NullPointerException.class) public void testNullReferenceInDataSection() { - CompilationResult result = createEmptyCompilationResult(); - Data data = new Data(1, 1, (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), null)); - buffer.put((byte) 0); - }); - result.getDataSection().insertData(data); - installCode(result); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, null)}); } @Test(expected = JVMCIError.class) public void testInvalidDataSectionReference() { - CompilationResult result = createEmptyCompilationResult(); - DataSectionReference ref = result.getDataSection().insertData(new Data(1, 1, DataBuilder.zero(1))); - Data data = new Data(1, 1, (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), ref)); - buffer.put((byte) 0); - }); - result.getDataSection().insertData(data); - installCode(result); + DataSectionReference ref = new DataSectionReference(); + ref.setOffset(0); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}); } @Test(expected = JVMCIError.class) public void testInvalidNarrowMethodInDataSection() { - CompilationResult result = createEmptyCompilationResult(); HotSpotConstant c = (HotSpotConstant) dummyMethod.getEncoding(); - Data data = new Data(4, 4, (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), new ConstantReference((VMConstant) c.compress()))); - buffer.putInt(0); - }); - result.getDataSection().insertData(data); - installCode(result); + ConstantReference ref = new ConstantReference((VMConstant) c.compress()); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}); } @Test(expected = NullPointerException.class) public void testNullConstantInDataSection() { - CompilationResult result = createEmptyCompilationResult(); - Data data = new Data(1, 1, (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), new ConstantReference(null))); - }); - result.getDataSection().insertData(data); - installCode(result); + ConstantReference ref = new ConstantReference(null); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}); } @Test(expected = JVMCIError.class) public void testInvalidConstantInDataSection() { - CompilationResult result = createEmptyCompilationResult(); - Data data = new Data(1, 1, (buffer, patch) -> { - patch.accept(new DataPatch(buffer.position(), new ConstantReference(new InvalidVMConstant()))); - }); - result.getDataSection().insertData(data); - installCode(result); + ConstantReference ref = new ConstantReference(new InvalidVMConstant()); + installEmptyCode(new Site[0], new Assumption[0], new Comment[0], 16, new DataPatch[]{new DataPatch(0, ref)}); } @Test(expected = NullPointerException.class) public void testNullReferenceInCode() { - CompilationResult result = createEmptyCompilationResult(); - result.recordDataPatch(0, null); - installCode(result); + installEmptyCode(new Site[]{new DataPatch(0, null)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = NullPointerException.class) public void testNullConstantInCode() { - CompilationResult result = createEmptyCompilationResult(); - result.recordDataPatch(0, new ConstantReference(null)); - installCode(result); + ConstantReference ref = new ConstantReference(null); + installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInvalidConstantInCode() { - CompilationResult result = createEmptyCompilationResult(); - result.recordDataPatch(0, new ConstantReference(new InvalidVMConstant())); - installCode(result); + ConstantReference ref = new ConstantReference(new InvalidVMConstant()); + installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInvalidReference() { - CompilationResult result = createEmptyCompilationResult(); - result.recordDataPatch(0, new InvalidReference()); - installCode(result); + InvalidReference ref = new InvalidReference(); + installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testOutOfBoundsDataSectionReference() { - CompilationResult result = createEmptyCompilationResult(); DataSectionReference ref = new DataSectionReference(); ref.setOffset(0x1000); - result.recordDataPatch(0, ref); - installCode(result); + installEmptyCode(new Site[]{new DataPatch(0, ref)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInvalidMark() { - CompilationResult result = createEmptyCompilationResult(); - result.recordMark(0, new Object()); - installCode(result); + installEmptyCode(new Site[]{new Mark(0, new Object())}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInvalidMarkInt() { - CompilationResult result = createEmptyCompilationResult(); - result.recordMark(0, -1); - installCode(result); + installEmptyCode(new Site[]{new Mark(0, -1)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = NullPointerException.class) - public void testNullInfopoint() { - CompilationResult result = createEmptyCompilationResult(); - result.addInfopoint(null); - installCode(result); + public void testNullSite() { + installEmptyCode(new Site[]{null}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testInfopointMissingDebugInfo() { - CompilationResult result = createEmptyCompilationResult(); - result.addInfopoint(new Infopoint(0, null, InfopointReason.METHOD_START)); - installCode(result); + Infopoint info = new Infopoint(0, null, InfopointReason.METHOD_START); + installEmptyCode(new Site[]{info}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = JVMCIError.class) public void testSafepointMissingDebugInfo() { - CompilationResult result = createEmptyCompilationResult(); - result.addInfopoint(new Infopoint(0, null, InfopointReason.SAFEPOINT)); - installCode(result); + Infopoint info = new Infopoint(0, null, InfopointReason.SAFEPOINT); + installEmptyCode(new Site[]{info}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } } diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java index ede956c1b82..e95d5cea6dc 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,24 +30,26 @@ package compiler.jvmci.errors; -import static jdk.vm.ci.code.CompilationResult.Infopoint; - import jdk.vm.ci.code.BytecodeFrame; -import jdk.vm.ci.code.CompilationResult; import jdk.vm.ci.code.DebugInfo; -import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Location; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.code.VirtualObject; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Infopoint; +import jdk.vm.ci.code.site.InfopointReason; +import jdk.vm.ci.code.site.Site; +import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; import jdk.vm.ci.hotspot.HotSpotReferenceMap; +import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaValue; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Value; -import jdk.vm.ci.common.JVMCIError; import org.junit.Test; @@ -67,10 +69,7 @@ public class TestInvalidDebugInfo extends CodeInstallerTest { BytecodeFrame frame = new BytecodeFrame(null, dummyMethod, 0, false, false, values, slotKinds, locals, stack, locks); DebugInfo info = new DebugInfo(frame, vobj); info.setReferenceMap(new HotSpotReferenceMap(new Location[0], new Location[0], new int[0], 8)); - - CompilationResult result = createEmptyCompilationResult(); - result.addInfopoint(new Infopoint(0, info, InfopointReason.SAFEPOINT)); - installCode(result); + installEmptyCode(new Site[]{new Infopoint(0, info, InfopointReason.SAFEPOINT)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = NullPointerException.class) diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java index df0b60adb0f..f5efaf91375 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,21 +30,22 @@ package compiler.jvmci.errors; -import static jdk.vm.ci.code.CompilationResult.Infopoint; - import jdk.vm.ci.code.BytecodePosition; -import jdk.vm.ci.code.CompilationResult; import jdk.vm.ci.code.DebugInfo; -import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Location; import jdk.vm.ci.code.ReferenceMap; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Infopoint; +import jdk.vm.ci.code.site.InfopointReason; +import jdk.vm.ci.code.site.Site; +import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; import jdk.vm.ci.hotspot.HotSpotReferenceMap; import jdk.vm.ci.hotspot.HotSpotVMConfig; +import jdk.vm.ci.meta.Assumptions.Assumption; import jdk.vm.ci.meta.JavaKind; -import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.PlatformKind; -import jdk.vm.ci.common.JVMCIError; import org.junit.Test; @@ -60,10 +61,7 @@ public class TestInvalidOopMap extends CodeInstallerTest { BytecodePosition pos = new BytecodePosition(null, dummyMethod, 0); DebugInfo info = new DebugInfo(pos); info.setReferenceMap(refMap); - - CompilationResult result = createEmptyCompilationResult(); - result.addInfopoint(new Infopoint(0, info, InfopointReason.SAFEPOINT)); - installCode(result); + installEmptyCode(new Site[]{new Infopoint(0, info, InfopointReason.SAFEPOINT)}, new Assumption[0], new Comment[0], 16, new DataPatch[0]); } @Test(expected = NullPointerException.class) diff --git a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java index a1dfa84924c..2b9d8c9332e 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java @@ -58,10 +58,15 @@ import compiler.jvmci.common.testcases.SimpleClass; import jdk.test.lib.Asserts; import java.lang.reflect.Method; import jdk.vm.ci.hotspot.HotSpotVMEventListener; -import jdk.vm.ci.code.CompilationResult; +import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; +import jdk.vm.ci.code.site.DataPatch; +import jdk.vm.ci.code.site.Site; +import jdk.vm.ci.meta.Assumptions.Assumption; +import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; -import jdk.vm.ci.hotspot.HotSpotCompilationRequest; +import jdk.vm.ci.hotspot.HotSpotCompiledCode; +import jdk.vm.ci.hotspot.HotSpotCompiledCode.Comment; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; @@ -102,17 +107,15 @@ public class JvmciNotifyInstallEventTest implements HotSpotVMEventListener { } HotSpotResolvedJavaMethod method = CTVMUtilities .getResolvedMethod(SimpleClass.class, testMethod); - CompilationResult compResult = new CompilationResult(METHOD_NAME); - HotSpotCompilationRequest compRequest = new HotSpotCompilationRequest(method, -1, 0L); - // to pass sanity check of default -1 - compResult.setTotalFrameSize(0); - compResult.close(); - codeCache.installCode(compRequest, compResult, /* installedCode = */ null, /* speculationLog = */ null, + HotSpotCompiledCode compiledCode = new HotSpotCompiledCode(METHOD_NAME, new byte[0], 0, new Site[0], + new Assumption[0], new ResolvedJavaMethod[]{method}, new Comment[0], new byte[0], 16, + new DataPatch[0], false, 0, 0); + codeCache.installCode(method, compiledCode, /* installedCode = */ null, /* speculationLog = */ null, /* isDefault = */ false); Asserts.assertEQ(gotInstallNotification, 1, "Got unexpected event count after 1st install attempt"); // since "empty" compilation result is ok, a second attempt should be ok - codeCache.installCode(compRequest, compResult, /* installedCode = */ null, /* speculationLog = */ null, + codeCache.installCode(method, compiledCode, /* installedCode = */ null, /* speculationLog = */ null, /* isDefault = */ false); Asserts.assertEQ(gotInstallNotification, 2, "Got unexpected event count after 2nd install attempt"); @@ -120,7 +123,7 @@ public class JvmciNotifyInstallEventTest implements HotSpotVMEventListener { @Override public void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, - InstalledCode installedCode, CompilationResult compResult) { + InstalledCode installedCode, CompiledCode compiledCode) { gotInstallNotification++; } } From 66b4fd463a29d2ae81244e034a230f4ec504fb72 Mon Sep 17 00:00:00 2001 From: Roland Schatz Date: Wed, 20 Jan 2016 17:00:17 -1000 Subject: [PATCH 108/212] 8147475: compiler/jvmci/code/SimpleDebugInfoTest.java fails in Assembler::locate_operand: ShouldNotReachHere() Reviewed-by: kvn, twisti --- .../jvmci/code/amd64/AMD64TestAssembler.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java index 219b668d63d..dd131016a0d 100644 --- a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java @@ -45,8 +45,22 @@ public class AMD64TestAssembler extends TestAssembler { super(codeCache, 16, 16, AMD64Kind.DWORD, AMD64.rax, AMD64.rcx, AMD64.rdi, AMD64.r8, AMD64.r9, AMD64.r10); } + private void emitFatNop() { + // 5 byte NOP: + // NOP DWORD ptr [EAX + EAX*1 + 00H] + code.emitByte(0x0F); + code.emitByte(0x1F); + code.emitByte(0x44); + code.emitByte(0x00); + code.emitByte(0x00); + } + @Override public void emitPrologue() { + // WARNING: Initial instruction MUST be 5 bytes or longer so that + // NativeJump::patch_verified_entry will be able to patch out the entry + // code safely. + emitFatNop(); code.emitByte(0x50 | AMD64.rbp.encoding); // PUSH rbp emitMove(true, AMD64.rbp, AMD64.rsp); // MOV rbp, rsp } From 79dd998f3e56bda28fb649337087869333224821 Mon Sep 17 00:00:00 2001 From: Hui Shi Date: Wed, 20 Jan 2016 04:56:51 -0800 Subject: [PATCH 109/212] 8147805: aarch64: C1 segmentation fault due to inline Unsafe.getAndSetObject In Aarch64 LIR_Assembler.atomic_op, keep stored data reference register in decompressed forms as it may be used later Co-authored-by: Felix Yang Reviewed-by: aph --- hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp index 210b29e1e75..e32a3c76b79 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp @@ -3169,7 +3169,8 @@ void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr Register obj = as_reg(data); Register dst = as_reg(dest); if (is_oop && UseCompressedOops) { - __ encode_heap_oop(obj); + __ encode_heap_oop(rscratch1, obj); + obj = rscratch1; } assert_different_registers(obj, addr.base(), tmp, rscratch2, dst); Label again; From b5e16518f41d1125ed1eb3ef3afc990244825466 Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Wed, 20 Jan 2016 20:26:33 +0300 Subject: [PATCH 110/212] 8145800: [Testbug] CompilerControl: inline message differs for not inlined methods Create callables outside the Internal subclasses Reviewed-by: kvn --- .../share/pool/SubMethodHolder.java | 49 +++++++++++++++++++ .../compilercontrol/share/pool/sub/Klass.java | 31 +----------- .../share/pool/subpack/KlassDup.java | 31 +----------- 3 files changed, 53 insertions(+), 58 deletions(-) create mode 100644 hotspot/test/compiler/compilercontrol/share/pool/SubMethodHolder.java diff --git a/hotspot/test/compiler/compilercontrol/share/pool/SubMethodHolder.java b/hotspot/test/compiler/compilercontrol/share/pool/SubMethodHolder.java new file mode 100644 index 00000000000..7ccc7393fbb --- /dev/null +++ b/hotspot/test/compiler/compilercontrol/share/pool/SubMethodHolder.java @@ -0,0 +1,49 @@ +package pool; + +import jdk.test.lib.Pair; + +import java.lang.reflect.Constructor; +import java.lang.reflect.Executable; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Callable; + +/** + * A helper class that creates executables and callables for internal classes + * It's necessary to have this class to make all helper lambdas not contain + * any of class names that could be used as a pattern (Internal*, *Klass*) + */ +public abstract class SubMethodHolder extends MethodHolder { + @Override + public List>> getAllMethods() { + List>> pairs = new ArrayList<>(); + { + Method method = getMethod(this, "method", Float.class); + Pair> pair = new Pair<>(method, + () -> method.invoke(this, 3.141592f)); + pairs.add(pair); + } + { + Method method = getMethod(this, "methodDup"); + Pair> pair = new Pair<>(method, + () -> method.invoke(this)); + pairs.add(pair); + } + { + Method method = getMethod(this, "smethod", Integer.class); + Pair> pair = new Pair<>(method, + () -> method.invoke(this, 1024)); + pairs.add(pair); + } + try { + Constructor constructor = this.getClass().getConstructor(); + Pair> pair = new Pair<>(constructor, + constructor::newInstance); + pairs.add(pair); + } catch (NoSuchMethodException e) { + throw new Error("TESTBUG: unable to get constructor"); + } + return pairs; + } +} diff --git a/hotspot/test/compiler/compilercontrol/share/pool/sub/Klass.java b/hotspot/test/compiler/compilercontrol/share/pool/sub/Klass.java index 9d677544e74..f1a3b3ecb53 100644 --- a/hotspot/test/compiler/compilercontrol/share/pool/sub/Klass.java +++ b/hotspot/test/compiler/compilercontrol/share/pool/sub/Klass.java @@ -23,13 +23,8 @@ package pool.sub; -import jdk.test.lib.Pair; import pool.MethodHolder; - -import java.lang.reflect.Executable; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; +import pool.SubMethodHolder; /** * Simple class with methods to test signatures @@ -53,7 +48,7 @@ public class Klass extends MethodHolder { } // Internal class and constructor - public static class Internal extends MethodHolder { + public static class Internal extends SubMethodHolder { public Internal() { } public Double method(Float fl) { return Double.valueOf(fl); } @@ -66,27 +61,5 @@ public class Klass extends MethodHolder { Integer var = 1024; return arg + var; } - - @Override - public List>> getAllMethods() { - List>> pairs = new ArrayList<>(); - Pair> pair = new Pair<> - (getMethod(this, "method", Float.class), - () -> this.method(3.141592f)); - pairs.add(pair); - pair = new Pair<>(getMethod(this, "methodDup"), this::methodDup); - pairs.add(pair); - pair = new Pair<>(getMethod(this, "smethod", Integer.class), - () -> smethod(1024)); - pairs.add(pair); - try { - pair = new Pair<>(this.getClass().getConstructor(), - Internal::new); - pairs.add(pair); - } catch (NoSuchMethodException e) { - throw new Error("TESTBUG: unable to get constructor"); - } - return pairs; - } } } diff --git a/hotspot/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java b/hotspot/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java index 6349abdc167..f5e930ba96a 100644 --- a/hotspot/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java +++ b/hotspot/test/compiler/compilercontrol/share/pool/subpack/KlassDup.java @@ -23,13 +23,8 @@ package pool.subpack; -import jdk.test.lib.Pair; import pool.MethodHolder; - -import java.lang.reflect.Executable; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.Callable; +import pool.SubMethodHolder; /** * This is a clone of the pool.sub.Klass used to test pattern matching @@ -54,7 +49,7 @@ public class KlassDup extends MethodHolder { } // Internal class and constructor - public static class Internal extends MethodHolder { + public static class Internal extends SubMethodHolder { public Internal() { } public Double method(Float fl) { return Double.valueOf(fl); } @@ -67,27 +62,5 @@ public class KlassDup extends MethodHolder { Integer var = 1024; return arg + var; } - - @Override - public List>> getAllMethods() { - List>> pairs = new ArrayList<>(); - Pair> pair = new Pair<> - (getMethod(this, "method", Float.class), - () -> this.method(3.141592f)); - pairs.add(pair); - pair = new Pair<>(getMethod(this, "methodDup"), this::methodDup); - pairs.add(pair); - pair = new Pair<>(getMethod(this, "smethod", Integer.class), - () -> smethod(1024)); - pairs.add(pair); - try { - pair = new Pair<>(this.getClass().getConstructor(), - Internal::new); - pairs.add(pair); - } catch (NoSuchMethodException e) { - throw new Error("TESTBUG: unable to get constructor"); - } - return pairs; - } } } From e8d7644b13d86a1e0aa2fe05e7601d78f6380a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Bourg=C3=A8s?= Date: Wed, 20 Jan 2016 22:53:45 +0100 Subject: [PATCH 111/212] 8147443: Use the Common Cleaner in Marlin OffHeapArray OffHeapArray clean-up to use the jdk.internal.ref.Cleaner to free unsafe arrays (PhantomReference) Reviewed-by: prr, rriggs, mchung --- modules.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules.xml b/modules.xml index d7db4ed42d8..0f9782ed3d6 100644 --- a/modules.xml +++ b/modules.xml @@ -266,6 +266,10 @@ jdk.jfr jdk.scripting.nashorn + + jdk.internal.ref + java.desktop + jdk.internal jdk.jfr From a58cdadbf276a957cf56bfee2699788ba39d69bf Mon Sep 17 00:00:00 2001 From: Alexander Kulyakhtin Date: Thu, 21 Jan 2016 14:17:49 +0300 Subject: [PATCH 112/212] 8147848: [TESTBUG] tmtools tests ported to JTREG need to be quarantined Quarantined some tests with false failures Reviewed-by: sla --- hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java | 1 + hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java | 1 + hotspot/test/serviceability/tmtools/jstat/GcTest01.java | 1 + 3 files changed, 3 insertions(+) diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java index 791a6841042..e695ca3d9bb 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java @@ -29,6 +29,7 @@ import utils.*; * displayed with jstat -gccapacity. * @library /test/lib/share/classes * @library ../share + * @ignore 8147848 * @build common.* * @build utils.* * @run main/othervm -XX:+UsePerfData GcCapacityTest diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java index 4507683136b..b233f770d61 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java @@ -30,6 +30,7 @@ * collection time increase. * @library /test/lib/share/classes * @library ../share + * @ignore 8147848 * @build common.* * @build utils.* * diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java index f0fc30fbb18..6b1c92bda8e 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java @@ -33,6 +33,7 @@ * collection time increase. * @library /test/lib/share/classes * @library ../share + * @ignore 8147848 * @build common.* * @build utils.* * From 025890379a8a4682ff35761f4345a3dc837fe129 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Thu, 21 Jan 2016 22:23:22 +0300 Subject: [PATCH 113/212] 8141557: TestResolvedJavaMethod.java times out after 1000 ms Reviewed-by: twisti --- .../runtime/test/TestResolvedJavaMethod.java | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java index bb3da636e2c..13dd0999fee 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java @@ -264,21 +264,37 @@ public class TestResolvedJavaMethod extends MethodUniverse { } } - @Test(timeout = 1000L) - public void getAnnotationTest() throws NoSuchMethodException { - ResolvedJavaMethod method = metaAccess.lookupJavaMethod(getClass().getDeclaredMethod("getAnnotationTest")); - Test annotation = method.getAnnotation(Test.class); - assertNotNull(annotation); - assertEquals(1000L, annotation.timeout()); + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.METHOD) + @interface TestAnnotation { + long value(); } - @Test(timeout = 1000L) + @Test + @TestAnnotation(value = 1000L) + public void getAnnotationTest() throws NoSuchMethodException { + ResolvedJavaMethod method = metaAccess.lookupJavaMethod(getClass().getDeclaredMethod("getAnnotationTest")); + TestAnnotation annotation = method.getAnnotation(TestAnnotation.class); + assertNotNull(annotation); + assertEquals(1000L, annotation.value()); + } + + @Test + @TestAnnotation(value = 1000L) public void getAnnotationsTest() throws NoSuchMethodException { ResolvedJavaMethod method = metaAccess.lookupJavaMethod(getClass().getDeclaredMethod("getAnnotationsTest")); Annotation[] annotations = method.getAnnotations(); assertNotNull(annotations); - assertEquals(1, annotations.length); - assertEquals(1000L, ((Test) annotations[0]).timeout()); + assertEquals(2, annotations.length); + TestAnnotation annotation = null; + for (Annotation a : annotations) { + if (a instanceof TestAnnotation) { + annotation = (TestAnnotation) a; + break; + } + } + assertNotNull(annotation); + assertEquals(1000L, annotation.value()); } @Retention(RetentionPolicy.RUNTIME) From a5d7b2b4501380ae4cac5f2ebd56a24bb5422a6c Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Fri, 22 Jan 2016 12:37:32 +0100 Subject: [PATCH 114/212] 8065334: CodeHeap expansion fails although there is uncommitted memory CodeHeap::expand_by() should commit remaining space if requested expansion size is too large. Reviewed-by: kvn --- hotspot/src/share/vm/memory/heap.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hotspot/src/share/vm/memory/heap.cpp b/hotspot/src/share/vm/memory/heap.cpp index 1910ed49e18..7afab964a7f 100644 --- a/hotspot/src/share/vm/memory/heap.cpp +++ b/hotspot/src/share/vm/memory/heap.cpp @@ -149,6 +149,10 @@ bool CodeHeap::expand_by(size_t size) { // expand _memory space size_t dm = align_to_page_size(_memory.committed_size() + size) - _memory.committed_size(); if (dm > 0) { + // Use at least the available uncommitted space if 'size' is larger + if (_memory.uncommitted_size() != 0 && dm > _memory.uncommitted_size()) { + dm = _memory.uncommitted_size(); + } char* base = _memory.low() + _memory.committed_size(); if (!_memory.expand_by(dm)) return false; on_code_mapping(base, dm); From 0691fac50b358737f5f99049ac50c9a7adc96888 Mon Sep 17 00:00:00 2001 From: Roland Schatz Date: Thu, 21 Jan 2016 16:22:01 +0100 Subject: [PATCH 115/212] 8146244: compiler/jvmci/code/DataPatchTest.java crashes: SIGSEGV in (getConstClass)getConstClass Reviewed-by: twisti --- .../test/compiler/jvmci/code/TestAssembler.java | 9 +++++++++ .../jvmci/code/sparc/SPARCTestAssembler.java | 14 +++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/hotspot/test/compiler/jvmci/code/TestAssembler.java b/hotspot/test/compiler/jvmci/code/TestAssembler.java index 1eeb1bd3408..4ed5b938dcd 100644 --- a/hotspot/test/compiler/jvmci/code/TestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/TestAssembler.java @@ -295,6 +295,15 @@ public abstract class TestAssembler { data.putFloat(f); } + public void align(int alignment) { + int pos = data.position(); + int misaligned = pos % alignment; + if (misaligned != 0) { + pos += alignment - misaligned; + data.position(pos); + } + } + private byte[] finish() { return Arrays.copyOf(data.array(), data.position()); } diff --git a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java index a39e861df5c..828852de144 100644 --- a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java @@ -109,10 +109,11 @@ public class SPARCTestAssembler extends TestAssembler { @Override public Register emitLoadLong(long c) { - if ((c & 0xFFFFFFFF) == c) { + if ((c & 0xFFFF_FFFFL) == c) { return emitLoadInt((int) c); } else { DataSectionReference ref = new DataSectionReference(); + data.align(8); ref.setOffset(data.position()); data.emitLong(c); return emitLoadPointer(ref); @@ -133,6 +134,7 @@ public class SPARCTestAssembler extends TestAssembler { @Override public Register emitLoadFloat(float c) { DataSectionReference ref = new DataSectionReference(); + data.align(4); ref.setOffset(data.position()); data.emitFloat(c); @@ -262,4 +264,14 @@ public class SPARCTestAssembler extends TestAssembler { recordImplicitException(info); emitOp3(0b11, SPARC.g0, 0b001011, SPARC.g0, 0); // LDX [g0+0], g0 } + + @Override + public DataSectionReference emitDataItem(HotSpotConstant c) { + if (c.isCompressed()) { + data.align(4); + } else { + data.align(8); + } + return super.emitDataItem(c); + } } From 87d68c21c4fc698c3afcd08b5b0cbc9ef9861dcb Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Fri, 22 Jan 2016 11:08:07 -0800 Subject: [PATCH 116/212] 8147432: JVMCI should report bailouts in PrintCompilation output Reviewed-by: kvn, twisti --- .../vm/ci/code/CompilationRequestResult.java | 71 +++++++++++++++++++ .../src/jdk/vm/ci/hotspot/CompilerToVM.java | 15 ---- .../ci/hotspot/HotSpotCodeCacheProvider.java | 18 +---- .../hotspot/HotSpotJVMCICompilerConfig.java | 3 +- .../vm/ci/hotspot/HotSpotJVMCIRuntime.java | 7 +- .../src/jdk/vm/ci/runtime/JVMCICompiler.java | 3 +- .../src/share/vm/compiler/compileBroker.cpp | 40 +++++++---- hotspot/src/share/vm/jvmci/jvmciCompiler.cpp | 24 +++++-- .../src/share/vm/jvmci/jvmciCompilerToVM.cpp | 25 ------- hotspot/src/share/vm/jvmci/jvmciEnv.cpp | 25 ++++--- hotspot/src/share/vm/jvmci/jvmciEnv.hpp | 12 ++++ .../src/share/vm/jvmci/jvmciJavaClasses.hpp | 7 +- .../share/vm/jvmci/systemDictionary_jvmci.hpp | 1 + .../src/share/vm/jvmci/vmSymbols_jvmci.hpp | 3 +- .../jvmci/common/CompilerToVMHelper.java | 8 --- .../compiler/jvmci/common/JVMCIHelpers.java | 4 +- 16 files changed, 165 insertions(+), 101 deletions(-) create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java new file mode 100644 index 00000000000..fcde020b7d9 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 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. + */ +package jdk.vm.ci.code; + +/** + * Simple class to provide information about the result of a compile request. + */ +public final class CompilationRequestResult { + + /** + * A user readable description of the failure. + */ + private final String failureMessage; + + /** + * Whether this is a transient failure where retrying would help. + */ + private final boolean retry; + + /** + * Number of bytecodes inlined into the compilation, exclusive of the bytecodes in the root + * method. + */ + private final int inlinedBytecodes; + + private CompilationRequestResult(String failureMessage, boolean retry, int inlinedBytecodes) { + this.failureMessage = failureMessage; + this.retry = retry; + this.inlinedBytecodes = inlinedBytecodes; + } + + public static CompilationRequestResult success(int inlinedBytecodes) { + return new CompilationRequestResult(null, true, inlinedBytecodes); + } + + public static CompilationRequestResult failure(String failureMessage, boolean retry) { + return new CompilationRequestResult(failureMessage, retry, 0); + } + + public String getFailureMessage() { + return failureMessage; + } + + public boolean getRetry() { + return retry; + } + + public int getInlinedBytecodes() { + return inlinedBytecodes; + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java index 4f4e7e4e9b9..0a903f26274 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java @@ -316,21 +316,6 @@ final class CompilerToVM { public native int getMetadata(TargetDescription target, HotSpotCompiledCode compiledCode, HotSpotMetaData metaData); - /** - * Notifies the VM of statistics for a completed compilation. - * - * @param id the identifier of the compilation - * @param method the method compiled - * @param osr specifies if the compilation was for on-stack-replacement - * @param processedBytecodes the number of bytecodes processed during the compilation, including - * the bytecodes of all inlined methods - * @param time the amount time spent compiling {@code method} - * @param timeUnitsPerSecond the granularity of the units for the {@code time} value - * @param installedCode the nmethod installed as a result of the compilation - */ - synchronized native void notifyCompilationStatistics(int id, HotSpotResolvedJavaMethodImpl method, boolean osr, int processedBytecodes, long time, long timeUnitsPerSecond, - InstalledCode installedCode); - /** * Resets all compilation statistics. */ diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java index 24d762450e0..6c2bef68971 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -169,22 +169,6 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider { return runtime.getCompilerToVM().shouldDebugNonSafepoints(); } - /** - * Notifies the VM of statistics for a completed compilation. - * - * @param id the identifier of the compilation - * @param method the method compiled - * @param osr specifies if the compilation was for on-stack-replacement - * @param processedBytecodes the number of bytecodes processed during the compilation, including - * the bytecodes of all inlined methods - * @param time the amount time spent compiling {@code method} - * @param timeUnitsPerSecond the granularity of the units for the {@code time} value - * @param installedCode the nmethod installed as a result of the compilation - */ - public void notifyCompilationStatistics(int id, HotSpotResolvedJavaMethod method, boolean osr, int processedBytecodes, long time, long timeUnitsPerSecond, InstalledCode installedCode) { - runtime.getCompilerToVM().notifyCompilationStatistics(id, (HotSpotResolvedJavaMethodImpl) method, osr, processedBytecodes, time, timeUnitsPerSecond, installedCode); - } - /** * Resets all compilation statistics. */ diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java index c43e1dd5667..b1b486721e8 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java @@ -23,6 +23,7 @@ package jdk.vm.ci.hotspot; import jdk.vm.ci.code.CompilationRequest; +import jdk.vm.ci.code.CompilationRequestResult; import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.runtime.JVMCICompilerFactory; @@ -33,7 +34,7 @@ final class HotSpotJVMCICompilerConfig { private static class DummyCompilerFactory implements JVMCICompilerFactory, JVMCICompiler { - public void compileMethod(CompilationRequest request) { + public CompilationRequestResult compileMethod(CompilationRequest request) { throw new JVMCIError("no JVMCI compiler selected"); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index 53bf67d9b50..88711cc3cb8 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -38,6 +38,7 @@ import java.util.Objects; import java.util.TreeMap; import jdk.vm.ci.code.Architecture; +import jdk.vm.ci.code.CompilationRequestResult; import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.common.JVMCIError; @@ -327,8 +328,10 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H * Called from the VM. */ @SuppressWarnings({"unused"}) - private void compileMethod(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) { - getCompiler().compileMethod(new HotSpotCompilationRequest(method, entryBCI, jvmciEnv, id)); + private CompilationRequestResult compileMethod(HotSpotResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id) { + CompilationRequestResult result = getCompiler().compileMethod(new HotSpotCompilationRequest(method, entryBCI, jvmciEnv, id)); + assert result != null : "compileMethod must always return something"; + return result; } /** diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java index 72a1b53b8f9..8aa5df1bf8c 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java @@ -23,6 +23,7 @@ package jdk.vm.ci.runtime; import jdk.vm.ci.code.CompilationRequest; +import jdk.vm.ci.code.CompilationRequestResult; public interface JVMCICompiler { int INVOCATION_ENTRY_BCI = -1; @@ -31,5 +32,5 @@ public interface JVMCICompiler { * Services a compilation request. This object should compile the method to machine code and * install it in the code cache if the compilation is successful. */ - void compileMethod(CompilationRequest request); + CompilationRequestResult compileMethod(CompilationRequest request); } diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 6583a69b5dd..64f2f2e51d1 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -1798,6 +1798,8 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { push_jni_handle_block(); Method* target_handle = task->method(); int compilable = ciEnv::MethodCompilable; + const char* failure_reason = NULL; + const char* retry_message = NULL; AbstractCompiler *comp = compiler(task_level); int system_dictionary_modification_counter; @@ -1817,10 +1819,16 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { jvmci->compile_method(method, osr_bci, &env); post_compile(thread, task, event, task->code() != NULL, NULL); + + failure_reason = env.failure_reason(); + if (!env.retryable()) { + retry_message = "not retryable"; + compilable = ciEnv::MethodCompilable_not_at_tier; + } + } else #endif // INCLUDE_JVMCI { - NoHandleMark nhm; ThreadToNativeFromVM ttn(thread); @@ -1868,24 +1876,30 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) { compilable = ci_env.compilable(); if (ci_env.failing()) { - task->set_failure_reason(ci_env.failure_reason()); - ci_env.report_failure(ci_env.failure_reason()); - const char* retry_message = ci_env.retry_message(); - if (_compilation_log != NULL) { - _compilation_log->log_failure(thread, task, ci_env.failure_reason(), retry_message); - } - if (PrintCompilation) { - FormatBufferResource msg = retry_message != NULL ? - FormatBufferResource("COMPILE SKIPPED: %s (%s)", ci_env.failure_reason(), retry_message) : - FormatBufferResource("COMPILE SKIPPED: %s", ci_env.failure_reason()); - task->print(tty, msg); - } + failure_reason = ci_env.failure_reason(); + retry_message = ci_env.retry_message(); + ci_env.report_failure(failure_reason); } post_compile(thread, task, event, !ci_env.failing(), &ci_env); } + // Remove the JNI handle block after the ciEnv destructor has run in + // the previous block. pop_jni_handle_block(); + if (failure_reason != NULL) { + task->set_failure_reason(failure_reason); + if (_compilation_log != NULL) { + _compilation_log->log_failure(thread, task, failure_reason, retry_message); + } + if (PrintCompilation) { + FormatBufferResource msg = retry_message != NULL ? + FormatBufferResource("COMPILE SKIPPED: %s (%s)", failure_reason, retry_message) : + FormatBufferResource("COMPILE SKIPPED: %s", failure_reason); + task->print(tty, msg); + } + } + methodHandle method(thread, task->method()); DTRACE_METHOD_COMPILE_END_PROBE(method, compiler_name(task_level), task->is_success()); diff --git a/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp b/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp index ceaf1ecc04f..b9da75cde0d 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp @@ -134,7 +134,6 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV JVMCIRuntime::initialize_well_known_classes(CHECK_ABORT); HandleMark hm; - ResourceMark rm; Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK_ABORT); JavaValue method_result(T_OBJECT); @@ -143,8 +142,8 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV JavaCalls::call_static(&method_result, SystemDictionary::HotSpotResolvedJavaMethodImpl_klass(), vmSymbols::fromMetaspace_name(), vmSymbols::method_fromMetaspace_signature(), &args, THREAD); + JavaValue result(T_OBJECT); if (!HAS_PENDING_EXCEPTION) { - JavaValue result(T_VOID); JavaCallArguments args; args.push_oop(receiver); args.push_oop((oop)method_result.get_jobject()); @@ -164,10 +163,25 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV java_lang_Throwable::java_printStackTrace(exception, THREAD); - // Something went wrong so disable compilation at this level - method->set_not_compilable(CompLevel_full_optimization); + env->set_failure("exception throw", false); } else { - _methodsCompiled++; + oop result_object = (oop) result.get_jobject(); + if (result_object != NULL) { + oop failure_message = CompilationRequestResult::failureMessage(result_object); + if (failure_message != NULL) { + const char* failure_reason = java_lang_String::as_utf8_string(failure_message); + env->set_failure(failure_reason, CompilationRequestResult::retry(result_object) != 0); + } else { + if (env->task()->code() == NULL) { + env->set_failure("no nmethod produced", true); + } else { + env->task()->set_num_inlined_bytecodes(CompilationRequestResult::inlinedBytecodes(result_object)); + _methodsCompiled++; + } + } + } else { + assert(false, "JVMCICompiler.compileMethod should always return non-null"); + } } } diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp index 2299b174d5f..56f54181cb0 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp @@ -834,30 +834,6 @@ C2V_VMENTRY(jint, getMetadata, (JNIEnv *jniEnv, jobject, jobject target, jobject return result; C2V_END -C2V_VMENTRY(void, notifyCompilationStatistics, (JNIEnv *jniEnv, jobject, jint id, jobject hotspot_method, jboolean osr, jint processedBytecodes, jlong time, jlong timeUnitsPerSecond, jobject installed_code)) - JVMCICompiler* compiler = JVMCICompiler::instance(CHECK); - CompilerStatistics* stats = compiler->stats(); - - elapsedTimer timer = elapsedTimer(time, timeUnitsPerSecond); - if (osr) { - stats->_osr.update(timer, processedBytecodes); - } else { - stats->_standard.update(timer, processedBytecodes); - } - Handle installed_code_handle = JNIHandles::resolve(installed_code); - if (installed_code_handle->is_a(HotSpotInstalledCode::klass())) { - stats->_nmethods_size += HotSpotInstalledCode::size(installed_code_handle); - stats->_nmethods_code_size += HotSpotInstalledCode::codeSize(installed_code_handle); - } - - if (CITimeEach) { - methodHandle method = CompilerToVM::asMethod(hotspot_method); - float bytes_per_sec = 1.0 * processedBytecodes / timer.seconds(); - tty->print_cr("%3d seconds: %f bytes/sec: %f (bytes %d)", - id, timer.seconds(), bytes_per_sec, processedBytecodes); - } -C2V_END - C2V_VMENTRY(void, resetCompilationStatistics, (JNIEnv *jniEnv, jobject)) JVMCICompiler* compiler = JVMCICompiler::instance(CHECK); CompilerStatistics* stats = compiler->stats(); @@ -1447,7 +1423,6 @@ JNINativeMethod CompilerToVM::methods[] = { {CC"initializeConfiguration", CC"("HS_CONFIG")J", FN_PTR(initializeConfiguration)}, {CC"installCode", CC"("TARGET_DESCRIPTION HS_COMPILED_CODE INSTALLED_CODE HS_SPECULATION_LOG")I", FN_PTR(installCode)}, {CC"getMetadata", CC"("TARGET_DESCRIPTION HS_COMPILED_CODE HS_METADATA")I", FN_PTR(getMetadata)}, - {CC"notifyCompilationStatistics", CC"(I"HS_RESOLVED_METHOD"ZIJJ"INSTALLED_CODE")V", FN_PTR(notifyCompilationStatistics)}, {CC"resetCompilationStatistics", CC"()V", FN_PTR(resetCompilationStatistics)}, {CC"disassembleCodeBlob", CC"("INSTALLED_CODE")"STRING, FN_PTR(disassembleCodeBlob)}, {CC"executeInstalledCode", CC"(["OBJECT INSTALLED_CODE")"OBJECT, FN_PTR(executeInstalledCode)}, diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp index 4142f790c6c..edf2d21fdd0 100644 --- a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp @@ -48,16 +48,17 @@ #include "jvmci/jvmciRuntime.hpp" #include "jvmci/jvmciJavaClasses.hpp" -JVMCIEnv::JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter) { - _task = task; - _system_dictionary_modification_counter = system_dictionary_modification_counter; - { - // Get Jvmti capabilities under lock to get consistent values. - MutexLocker mu(JvmtiThreadState_lock); - _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint(); - _jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables(); - _jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions(); - } +JVMCIEnv::JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter): + _task(task), + _system_dictionary_modification_counter(system_dictionary_modification_counter), + _failure_reason(NULL), + _retryable(true) +{ + // Get Jvmti capabilities under lock to get consistent values. + MutexLocker mu(JvmtiThreadState_lock); + _jvmti_can_hotswap_or_post_breakpoint = JvmtiExport::can_hotswap_or_post_breakpoint(); + _jvmti_can_access_local_variables = JvmtiExport::can_access_local_variables(); + _jvmti_can_post_on_exceptions = JvmtiExport::can_post_on_exceptions(); } // ------------------------------------------------------------------ @@ -534,7 +535,9 @@ JVMCIEnv::CodeInstallResult JVMCIEnv::register_method( // Record successful registration. // (Put nm into the task handle *before* publishing to the Java heap.) CompileTask* task = env == NULL ? NULL : env->task(); - if (task != NULL) task->set_code(nm); + if (task != NULL) { + task->set_code(nm); + } if (installed_code->is_a(HotSpotNmethod::klass()) && HotSpotNmethod::isDefault(installed_code())) { if (entry_bci == InvocationEntryBci) { diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp index 2bc95d3308c..833074326bf 100644 --- a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp @@ -100,6 +100,10 @@ private: CompileTask* _task; int _system_dictionary_modification_counter; + // Compilation result values + const char* _failure_reason; + bool _retryable; + // Cache JVMTI state bool _jvmti_can_hotswap_or_post_breakpoint; bool _jvmti_can_access_local_variables; @@ -141,6 +145,14 @@ private: public: CompileTask* task() { return _task; } + const char* failure_reason() { return _failure_reason; } + bool retryable() { return _retryable; } + + void set_failure(const char* reason, bool retryable) { + _failure_reason = reason; + _retryable = retryable; + } + // Register the result of a compilation. static JVMCIEnv::CodeInstallResult register_method( const methodHandle& target, diff --git a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp index b12a2a4b489..61d61a252e2 100644 --- a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp @@ -161,6 +161,11 @@ class JVMCIJavaClasses : AllStatic { start_class(site_Mark) \ oop_field(site_Mark, id, "Ljava/lang/Object;") \ end_class \ + start_class(CompilationRequestResult) \ + oop_field(CompilationRequestResult, failureMessage, "Ljava/lang/String;") \ + boolean_field(CompilationRequestResult, retry) \ + int_field(CompilationRequestResult, inlinedBytecodes) \ + end_class \ start_class(DebugInfo) \ oop_field(DebugInfo, bytecodePosition, "Ljdk/vm/ci/code/BytecodePosition;") \ oop_field(DebugInfo, referenceMap, "Ljdk/vm/ci/code/ReferenceMap;") \ @@ -287,7 +292,7 @@ class JVMCIJavaClasses : AllStatic { long_field(HotSpotConstantPool, metaspaceConstantPool) \ end_class \ start_class(HotSpotJVMCIRuntime) \ - objArrayOop_field(HotSpotJVMCIRuntime, trivialPrefixes, "[Ljava/lang/String;") \ + objArrayOop_field(HotSpotJVMCIRuntime, trivialPrefixes, "[Ljava/lang/String;") \ end_class \ /* end*/ diff --git a/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp b/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp index a506ebcd4b9..864539f6654 100644 --- a/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp +++ b/hotspot/src/share/vm/jvmci/systemDictionary_jvmci.hpp @@ -60,6 +60,7 @@ do_klass(DebugInfo_klass, jdk_vm_ci_code_DebugInfo, Jvmci) \ do_klass(RegisterSaveLayout_klass, jdk_vm_ci_code_RegisterSaveLayout, Jvmci) \ do_klass(BytecodeFrame_klass, jdk_vm_ci_code_BytecodeFrame, Jvmci) \ + do_klass(CompilationRequestResult_klass, jdk_vm_ci_code_CompilationRequestResult, Jvmci) \ do_klass(InstalledCode_klass, jdk_vm_ci_code_InstalledCode, Jvmci) \ do_klass(code_Location_klass, jdk_vm_ci_code_Location, Jvmci) \ do_klass(code_Register_klass, jdk_vm_ci_code_Register, Jvmci) \ diff --git a/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp b/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp index b0070aad72f..f7aada3b81b 100644 --- a/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp +++ b/hotspot/src/share/vm/jvmci/vmSymbols_jvmci.hpp @@ -66,6 +66,7 @@ template(jdk_vm_ci_code_Architecture, "jdk/vm/ci/code/Architecture") \ template(jdk_vm_ci_code_BytecodeFrame, "jdk/vm/ci/code/BytecodeFrame") \ template(jdk_vm_ci_code_BytecodePosition, "jdk/vm/ci/code/BytecodePosition") \ + template(jdk_vm_ci_code_CompilationRequestResult, "jdk/vm/ci/code/CompilationRequestResult") \ template(jdk_vm_ci_code_DebugInfo, "jdk/vm/ci/code/DebugInfo") \ template(jdk_vm_ci_code_InstalledCode, "jdk/vm/ci/code/InstalledCode") \ template(jdk_vm_ci_code_Location, "jdk/vm/ci/code/Location") \ @@ -88,7 +89,7 @@ template(jdk_vm_ci_code_site_InfopointReason, "jdk/vm/ci/code/site/InfopointReason") \ template(jdk_vm_ci_common_JVMCIError, "jdk/vm/ci/common/JVMCIError") \ template(compileMethod_name, "compileMethod") \ - template(compileMethod_signature, "(Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethod;IJI)V") \ + template(compileMethod_signature, "(Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethod;IJI)Ljdk/vm/ci/code/CompilationRequestResult;") \ template(fromMetaspace_name, "fromMetaspace") \ template(method_fromMetaspace_signature, "(J)Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethod;") \ template(constantPool_fromMetaspace_signature, "(J)Ljdk/vm/ci/hotspot/HotSpotConstantPool;") \ diff --git a/hotspot/test/compiler/jvmci/common/CompilerToVMHelper.java b/hotspot/test/compiler/jvmci/common/CompilerToVMHelper.java index b5f4574b3a0..f9602f33064 100644 --- a/hotspot/test/compiler/jvmci/common/CompilerToVMHelper.java +++ b/hotspot/test/compiler/jvmci/common/CompilerToVMHelper.java @@ -148,14 +148,6 @@ public class CompilerToVMHelper { return CTVM.getMetadata(target, compiledCode, metaData); } - public static void notifyCompilationStatistics(int id, - HotSpotResolvedJavaMethod method, boolean osr, - int processedBytecodes, long time, long timeUnitsPerSecond, - InstalledCode installedCode) { - CTVM.notifyCompilationStatistics(id, (HotSpotResolvedJavaMethodImpl) method, osr, processedBytecodes, - time, timeUnitsPerSecond, installedCode); - } - public static void resetCompilationStatistics() { CTVM.resetCompilationStatistics(); } diff --git a/hotspot/test/compiler/jvmci/common/JVMCIHelpers.java b/hotspot/test/compiler/jvmci/common/JVMCIHelpers.java index 35cece6db07..a99c0908fc5 100644 --- a/hotspot/test/compiler/jvmci/common/JVMCIHelpers.java +++ b/hotspot/test/compiler/jvmci/common/JVMCIHelpers.java @@ -25,6 +25,7 @@ package compiler.jvmci.common; import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.CompilationRequest; +import jdk.vm.ci.code.CompilationRequestResult; import jdk.vm.ci.hotspot.HotSpotVMEventListener; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.runtime.JVMCICompiler; @@ -43,8 +44,9 @@ public class JVMCIHelpers { public static class EmptyHotspotCompiler implements JVMCICompiler { @Override - public void compileMethod(CompilationRequest request) { + public CompilationRequestResult compileMethod(CompilationRequest request) { // do nothing + return CompilationRequestResult.failure("no compiler configured", true); } } From 4205407d836d90831651175f902ea438c24c6360 Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Fri, 22 Jan 2016 11:11:06 -0800 Subject: [PATCH 117/212] 8146424: runtime/ReservedStack/ReservedStackTest.java triggers: assert(thread->deopt_mark() == __null) failed: no stack overflow from deopt blob/uncommon trap Reviewed-by: twisti --- .../src/jdk/vm/ci/hotspot/CompilerToVM.java | 11 +++ .../ci/hotspot/HotSpotCodeCacheProvider.java | 5 ++ .../jdk/vm/ci/hotspot/HotSpotVMConfig.java | 3 +- .../src/share/vm/jvmci/jvmciCompilerToVM.cpp | 42 ++++++++++ .../src/share/vm/jvmci/jvmciCompilerToVM.hpp | 2 + .../src/share/vm/jvmci/vmStructs_jvmci.cpp | 2 + .../jvmci/code/InterpreterFrameSizeTest.java | 78 +++++++++++++++++++ 7 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 hotspot/test/compiler/jvmci/code/InterpreterFrameSizeTest.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java index 0a903f26274..ef3fd7cf1c5 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java @@ -29,6 +29,7 @@ import static jdk.vm.ci.inittimer.InitTimer.timer; import java.lang.reflect.Constructor; import java.lang.reflect.Method; +import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.code.InvalidInstalledCodeException; import jdk.vm.ci.code.TargetDescription; @@ -589,4 +590,14 @@ final class CompilerToVM { * @throws IllegalArgumentException if an out of range position is given */ native int methodDataProfileDataSize(long metaspaceMethodData, int position); + + /** + * Return the amount of native stack required for the interpreter frames represented by + * {@code frame}. This is used when emitting the stack banging code to ensure that there is + * enough space for the frames during deoptimization. + * + * @param frame + * @return the number of bytes required for deoptimization of this frame state + */ + native int interpreterFrameSize(BytecodeFrame frame); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java index 6c2bef68971..a01a304d2a8 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java @@ -25,6 +25,7 @@ package jdk.vm.ci.hotspot; import java.lang.reflect.Field; import jdk.vm.ci.code.BailoutException; +import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.CompiledCode; import jdk.vm.ci.code.InstalledCode; @@ -169,6 +170,10 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider { return runtime.getCompilerToVM().shouldDebugNonSafepoints(); } + public int interpreterFrameSize(BytecodeFrame pos) { + return runtime.getCompilerToVM().interpreterFrameSize(pos); + } + /** * Resets all compilation statistics. */ diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index d237006dfcb..ae0302b87fb 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -973,11 +973,12 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "UseBlockZeroing", archs = {"sparc"}) @Stable public boolean useBlockZeroing; @HotSpotVMFlag(name = "BlockZeroingLowLimit", archs = {"sparc"}) @Stable public int blockZeroingLowLimit; - // offsets, ... @HotSpotVMFlag(name = "StackShadowPages") @Stable public int stackShadowPages; @HotSpotVMFlag(name = "UseStackBanging") @Stable public boolean useStackBanging; @HotSpotVMConstant(name = "STACK_BIAS") @Stable public int stackBias; + @HotSpotVMField(name = "CompilerToVM::Data::vm_page_size", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int vmPageSize; + // offsets, ... @HotSpotVMField(name = "oopDesc::_mark", type = "markOop", get = HotSpotVMField.Type.OFFSET) @Stable public int markOffset; @HotSpotVMField(name = "oopDesc::_metadata._klass", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int hubOffset; diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp index 56f54181cb0..326525ebf0e 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp @@ -149,6 +149,8 @@ HeapWord** CompilerToVM::Data::_heap_top_addr; jbyte* CompilerToVM::Data::cardtable_start_address; int CompilerToVM::Data::cardtable_shift; +int CompilerToVM::Data::vm_page_size; + void CompilerToVM::Data::initialize() { InstanceKlass_vtable_start_offset = InstanceKlass::vtable_start_offset(); InstanceKlass_vtable_length_offset = InstanceKlass::vtable_length_offset() * HeapWordSize; @@ -198,6 +200,8 @@ void CompilerToVM::Data::initialize() { ShouldNotReachHere(); break; } + + vm_page_size = os::vm_page_size(); } /** @@ -1364,6 +1368,42 @@ C2V_VMENTRY(int, methodDataProfileDataSize, (JNIEnv*, jobject, jlong metaspace_m THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), err_msg("Invalid profile data position %d", position)); C2V_END +C2V_VMENTRY(int, interpreterFrameSize, (JNIEnv*, jobject, jobject bytecode_frame_handle)) + if (bytecode_frame_handle == NULL) { + THROW_0(vmSymbols::java_lang_NullPointerException()); + } + + oop top_bytecode_frame = JNIHandles::resolve_non_null(bytecode_frame_handle); + oop bytecode_frame = top_bytecode_frame; + int size = 0; + int callee_parameters = 0; + int callee_locals = 0; + Method* method = getMethodFromHotSpotMethod(BytecodePosition::method(bytecode_frame)); + int extra_args = method->max_stack() - BytecodeFrame::numStack(bytecode_frame); + + while (bytecode_frame != NULL) { + int locks = BytecodeFrame::numLocks(bytecode_frame); + int temps = BytecodeFrame::numStack(bytecode_frame); + bool is_top_frame = (bytecode_frame == top_bytecode_frame); + Method* method = getMethodFromHotSpotMethod(BytecodePosition::method(bytecode_frame)); + + int frame_size = BytesPerWord * Interpreter::size_activation(method->max_stack(), + temps + callee_parameters, + extra_args, + locks, + callee_parameters, + callee_locals, + is_top_frame); + size += frame_size; + + callee_parameters = method->size_of_parameters(); + callee_locals = method->max_locals(); + extra_args = 0; + bytecode_frame = BytecodePosition::caller(bytecode_frame); + } + return size + Deoptimization::last_frame_adjust(0, callee_locals) * BytesPerWord; +C2V_END + #define CC (char*) /*cast a literal from (const char*)*/ #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f)) @@ -1374,6 +1414,7 @@ C2V_END #define STACK_TRACE_ELEMENT "Ljava/lang/StackTraceElement;" #define INSTALLED_CODE "Ljdk/vm/ci/code/InstalledCode;" #define TARGET_DESCRIPTION "Ljdk/vm/ci/code/TargetDescription;" +#define BYTECODE_FRAME "Ljdk/vm/ci/code/BytecodeFrame;" #define RESOLVED_METHOD "Ljdk/vm/ci/meta/ResolvedJavaMethod;" #define HS_RESOLVED_METHOD "Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl;" #define HS_RESOLVED_KLASS "Ljdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl;" @@ -1443,6 +1484,7 @@ JNINativeMethod CompilerToVM::methods[] = { {CC"writeDebugOutput", CC"([BII)V", FN_PTR(writeDebugOutput)}, {CC"flushDebugOutput", CC"()V", FN_PTR(flushDebugOutput)}, {CC"methodDataProfileDataSize", CC"(JI)I", FN_PTR(methodDataProfileDataSize)}, + {CC"interpreterFrameSize", CC"("BYTECODE_FRAME")I", FN_PTR(interpreterFrameSize)}, }; int CompilerToVM::methods_count() { diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp index 1947324556b..9a6667a82ef 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp @@ -63,6 +63,8 @@ class CompilerToVM { static jbyte* cardtable_start_address; static int cardtable_shift; + static int vm_page_size; + public: static void initialize(); }; diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp index 84f7dca06ef..2b58b4a35ba 100644 --- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp +++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp @@ -74,6 +74,8 @@ static_field(CompilerToVM::Data, cardtable_start_address, jbyte*) \ static_field(CompilerToVM::Data, cardtable_shift, int) \ \ + static_field(CompilerToVM::Data, vm_page_size, int) \ + \ static_field(Abstract_VM_Version, _features, uint64_t) \ \ nonstatic_field(Array, _length, int) \ diff --git a/hotspot/test/compiler/jvmci/code/InterpreterFrameSizeTest.java b/hotspot/test/compiler/jvmci/code/InterpreterFrameSizeTest.java new file mode 100644 index 00000000000..9f5e9cfe106 --- /dev/null +++ b/hotspot/test/compiler/jvmci/code/InterpreterFrameSizeTest.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.code.InterpreterFrameSizeTest + */ + +package compiler.jvmci.code; + +import java.lang.reflect.Method; + +import jdk.vm.ci.code.BytecodeFrame; +import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.JavaValue; +import jdk.vm.ci.meta.ResolvedJavaMethod; + +import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; + +import org.junit.Assert; +import org.junit.Test; + +public class InterpreterFrameSizeTest extends CodeInstallationTest { + + HotSpotCodeCacheProvider hotspotCodeCache() { + return (HotSpotCodeCacheProvider) codeCache; + } + + @Test + public void testNull() { + try { + hotspotCodeCache().interpreterFrameSize(null); + } catch (NullPointerException npe) { + System.out.println("threw NPE as expected"); + return; + } + Assert.fail("expected NullPointerException"); + } + + @Test + public void test() { + ResolvedJavaMethod resolvedMethod = metaAccess.lookupJavaMethod(getMethod("testNull")); + + int bci = 0; + int numLocals = resolvedMethod.getMaxLocals(); + int numStack = 0; + JavaValue[] values = new JavaValue[numLocals]; + JavaKind[] slotKinds = new JavaKind[numLocals]; + BytecodeFrame frame = new BytecodeFrame(null, resolvedMethod, bci, false, false, values, slotKinds, numLocals, numStack, 0); + int size = hotspotCodeCache().interpreterFrameSize(frame); + System.out.println("Frame size is " + size + " bytes"); + if (size <= 0) { + Assert.fail("expected non-zero result"); + } + } +} From 4e99638d699ecc8142cc4581c387a24724eace86 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 21 Jan 2016 12:37:47 +0100 Subject: [PATCH 118/212] 8147937: Adapt SAP copyrights to new company name Reviewed-by: simonis, stuefe --- hotspot/make/aix/Makefile | 2 +- hotspot/make/aix/makefiles/buildtree.make | 2 +- hotspot/make/aix/makefiles/compiler2.make | 2 +- hotspot/make/aix/makefiles/debug.make | 2 +- hotspot/make/aix/makefiles/defs.make | 2 +- hotspot/make/aix/makefiles/fastdebug.make | 2 +- hotspot/make/aix/makefiles/jsig.make | 2 +- hotspot/make/aix/makefiles/jvmti.make | 2 +- hotspot/make/aix/makefiles/ppc64.make | 2 +- hotspot/make/aix/makefiles/product.make | 2 +- hotspot/make/aix/makefiles/tiered.make | 2 +- hotspot/make/aix/makefiles/vm.make | 2 +- hotspot/make/aix/makefiles/xlc.make | 2 +- hotspot/make/linux/makefiles/ppc64.make | 2 +- hotspot/src/cpu/ppc/vm/assembler_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/assembler_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp | 2 +- hotspot/src/cpu/ppc/vm/bytes_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/codeBuffer_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/copy_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/debug_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/depChecker_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/disassembler_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/frame_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/frame_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp | 2 +- hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/globals_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/icache_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/icache_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp | 2 +- hotspot/src/cpu/ppc/vm/interpreterRT_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/javaFrameAnchor_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/jniFastGetField_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/jniTypes_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/jni_ppc.h | 2 +- hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp | 2 +- hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/ppc.ad | 2 +- hotspot/src/cpu/ppc/vm/ppc_64.ad | 2 +- hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/register_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/register_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/relocInfo_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/runtime_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp | 2 +- hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp | 2 +- hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp | 2 +- hotspot/src/cpu/ppc/vm/templateTable_ppc_64.hpp | 2 +- hotspot/src/cpu/ppc/vm/vmStructs_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/vmreg_ppc.cpp | 2 +- hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp | 2 +- hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp | 2 +- hotspot/src/os/aix/vm/attachListener_aix.cpp | 2 +- hotspot/src/os/aix/vm/c1_globals_aix.hpp | 2 +- hotspot/src/os/aix/vm/c2_globals_aix.hpp | 2 +- hotspot/src/os/aix/vm/decoder_aix.hpp | 2 +- hotspot/src/os/aix/vm/globals_aix.hpp | 2 +- hotspot/src/os/aix/vm/interfaceSupport_aix.hpp | 2 +- hotspot/src/os/aix/vm/jsig.c | 2 +- hotspot/src/os/aix/vm/jvm_aix.cpp | 2 +- hotspot/src/os/aix/vm/jvm_aix.h | 2 +- hotspot/src/os/aix/vm/libo4.cpp | 2 +- hotspot/src/os/aix/vm/libo4.hpp | 2 +- hotspot/src/os/aix/vm/libodm_aix.cpp | 2 +- hotspot/src/os/aix/vm/libodm_aix.hpp | 2 +- hotspot/src/os/aix/vm/libperfstat_aix.cpp | 2 +- hotspot/src/os/aix/vm/libperfstat_aix.hpp | 2 +- hotspot/src/os/aix/vm/loadlib_aix.cpp | 2 +- hotspot/src/os/aix/vm/loadlib_aix.hpp | 2 +- hotspot/src/os/aix/vm/misc_aix.cpp | 2 +- hotspot/src/os/aix/vm/misc_aix.hpp | 2 +- hotspot/src/os/aix/vm/mutex_aix.inline.hpp | 2 +- hotspot/src/os/aix/vm/osThread_aix.cpp | 2 +- hotspot/src/os/aix/vm/osThread_aix.hpp | 2 +- hotspot/src/os/aix/vm/os_aix.cpp | 2 +- hotspot/src/os/aix/vm/os_aix.hpp | 2 +- hotspot/src/os/aix/vm/os_aix.inline.hpp | 2 +- hotspot/src/os/aix/vm/perfMemory_aix.cpp | 2 +- hotspot/src/os/aix/vm/porting_aix.cpp | 2 +- hotspot/src/os/aix/vm/porting_aix.hpp | 2 +- hotspot/src/os/aix/vm/threadCritical_aix.cpp | 2 +- hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp | 2 +- hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp | 2 +- hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp | 2 +- hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp | 2 +- hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp | 2 +- hotspot/src/os_cpu/aix_ppc/vm/prefetch_aix_ppc.inline.hpp | 2 +- hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.cpp | 2 +- hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.hpp | 2 +- hotspot/src/os_cpu/aix_ppc/vm/vmStructs_aix_ppc.hpp | 2 +- hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp | 2 +- hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp | 2 +- .../src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp | 2 +- hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp | 2 +- hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.hpp | 2 +- hotspot/src/os_cpu/linux_ppc/vm/prefetch_linux_ppc.inline.hpp | 2 +- hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp | 2 +- hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.hpp | 2 +- hotspot/src/os_cpu/linux_ppc/vm/vmStructs_linux_ppc.hpp | 2 +- .../src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp | 2 +- hotspot/src/share/vm/runtime/orderAccess.inline.hpp | 2 +- hotspot/src/share/vm/utilities/elfFuncDescTable.cpp | 2 +- hotspot/src/share/vm/utilities/elfFuncDescTable.hpp | 2 +- hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp | 2 +- hotspot/test/compiler/c2/6880034/Test6880034.java | 2 +- hotspot/test/compiler/c2/6910484/Test.java | 2 +- hotspot/test/compiler/codegen/8005033/Test8005033.java | 2 +- hotspot/test/compiler/codegen/IntRotateWithImmediate.java | 2 +- .../TestUnsafePutAddressNullObjMustNotEscape.java | 2 +- .../compiler/intrinsics/string/TestStringIntrinsics2.java | 2 +- hotspot/test/compiler/loopopts/superword/TestBestAlign.java | 2 +- hotspot/test/compiler/membars/DekkerTest.java | 2 +- hotspot/test/compiler/runtime/7141637/SpreadNullArg.java | 2 +- .../test/compiler/stringopts/TestOptimizeStringConcat.java | 2 +- .../compiler/types/TestMeetIncompatibleInterfaceArrays.java | 2 +- hotspot/test/runtime/7100935/TestConjointAtomicArraycopy.java | 2 +- hotspot/test/runtime/7100935/TestShortArraycopy.java | 2 +- hotspot/test/runtime/7107135/Test.java | 4 ++-- hotspot/test/runtime/7107135/Test7107135.sh | 2 +- hotspot/test/runtime/7107135/TestMT.java | 4 ++-- hotspot/test/runtime/7107135/test.c | 4 ++-- hotspot/test/runtime/7158988/FieldMonitor.java | 2 +- hotspot/test/runtime/7158988/TestPostFieldModification.java | 2 +- .../test/serviceability/jvmti/8036666/GetObjectLockCount.java | 2 +- .../serviceability/jvmti/8036666/RecursiveObjectLock.java | 2 +- 161 files changed, 164 insertions(+), 164 deletions(-) diff --git a/hotspot/make/aix/Makefile b/hotspot/make/aix/Makefile index 77e54d08dc0..951a98502fa 100644 --- a/hotspot/make/aix/Makefile +++ b/hotspot/make/aix/Makefile @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2015 SAP AG. All rights reserved. +# Copyright (c) 2012, 2015 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 diff --git a/hotspot/make/aix/makefiles/buildtree.make b/hotspot/make/aix/makefiles/buildtree.make index 1f2b556a4fe..94b71eb760f 100644 --- a/hotspot/make/aix/makefiles/buildtree.make +++ b/hotspot/make/aix/makefiles/buildtree.make @@ -1,6 +1,6 @@ # # Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/make/aix/makefiles/compiler2.make b/hotspot/make/aix/makefiles/compiler2.make index 73f544f118d..13986308edf 100644 --- a/hotspot/make/aix/makefiles/compiler2.make +++ b/hotspot/make/aix/makefiles/compiler2.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/make/aix/makefiles/debug.make b/hotspot/make/aix/makefiles/debug.make index 5e2cacd365d..1a1c4ebbd7d 100644 --- a/hotspot/make/aix/makefiles/debug.make +++ b/hotspot/make/aix/makefiles/debug.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/make/aix/makefiles/defs.make b/hotspot/make/aix/makefiles/defs.make index cca6803c9d5..b9c54e36149 100644 --- a/hotspot/make/aix/makefiles/defs.make +++ b/hotspot/make/aix/makefiles/defs.make @@ -1,6 +1,6 @@ # # Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/make/aix/makefiles/fastdebug.make b/hotspot/make/aix/makefiles/fastdebug.make index d7feb025617..c0d50079d16 100644 --- a/hotspot/make/aix/makefiles/fastdebug.make +++ b/hotspot/make/aix/makefiles/fastdebug.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/make/aix/makefiles/jsig.make b/hotspot/make/aix/makefiles/jsig.make index 1d8a62184bd..86c4bea5ae1 100644 --- a/hotspot/make/aix/makefiles/jsig.make +++ b/hotspot/make/aix/makefiles/jsig.make @@ -1,6 +1,6 @@ # # Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/make/aix/makefiles/jvmti.make b/hotspot/make/aix/makefiles/jvmti.make index 105fd8e109d..cff6a741da6 100644 --- a/hotspot/make/aix/makefiles/jvmti.make +++ b/hotspot/make/aix/makefiles/jvmti.make @@ -1,6 +1,6 @@ # # Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/make/aix/makefiles/ppc64.make b/hotspot/make/aix/makefiles/ppc64.make index 2634d8adcc3..d7ad9510e11 100644 --- a/hotspot/make/aix/makefiles/ppc64.make +++ b/hotspot/make/aix/makefiles/ppc64.make @@ -1,6 +1,6 @@ # # Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2015 SAP AG. All rights reserved. +# Copyright (c) 2012, 2015 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 diff --git a/hotspot/make/aix/makefiles/product.make b/hotspot/make/aix/makefiles/product.make index f1ef85a8192..f36ef69b32e 100644 --- a/hotspot/make/aix/makefiles/product.make +++ b/hotspot/make/aix/makefiles/product.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/make/aix/makefiles/tiered.make b/hotspot/make/aix/makefiles/tiered.make index 992d59d5241..f04496bdb60 100644 --- a/hotspot/make/aix/makefiles/tiered.make +++ b/hotspot/make/aix/makefiles/tiered.make @@ -1,6 +1,6 @@ # # Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2015 SAP AG. All rights reserved. +# Copyright (c) 2012, 2015 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 diff --git a/hotspot/make/aix/makefiles/vm.make b/hotspot/make/aix/makefiles/vm.make index 5de8a2dc997..808bb124892 100644 --- a/hotspot/make/aix/makefiles/vm.make +++ b/hotspot/make/aix/makefiles/vm.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/make/aix/makefiles/xlc.make b/hotspot/make/aix/makefiles/xlc.make index 676ba5c6a6d..c44d306359e 100644 --- a/hotspot/make/aix/makefiles/xlc.make +++ b/hotspot/make/aix/makefiles/xlc.make @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2012, 2015 SAP. All rights reserved. +# Copyright (c) 2012, 2015 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 diff --git a/hotspot/make/linux/makefiles/ppc64.make b/hotspot/make/linux/makefiles/ppc64.make index f3392de49a6..acb51ab2b7a 100644 --- a/hotspot/make/linux/makefiles/ppc64.make +++ b/hotspot/make/linux/makefiles/ppc64.make @@ -1,6 +1,6 @@ # # Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp index 66e4f08c3d4..c09703ff916 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp index 035bd4abf26..3cae863f41c 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp index 9248ae5cb6f..8393a579151 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/bytes_ppc.hpp b/hotspot/src/cpu/ppc/vm/bytes_ppc.hpp index 2a8fc59c892..be005cbbfba 100644 --- a/hotspot/src/cpu/ppc/vm/bytes_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/bytes_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp index a19c7b7de11..eca7d87a22e 100644 --- a/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp index 73edcaba207..4f7075c17fa 100644 --- a/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp index 19f85034ba9..6f2f90ba0da 100644 --- a/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp index 90afc7873ce..5a50b965371 100644 --- a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp index 5eee5ffca1f..8ce25e97b87 100644 --- a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp index 8a64bab4be4..b7bc0cbf50d 100644 --- a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp index 03d1faedbf9..543156c0951 100644 --- a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp index 909d0136011..cba04106f8c 100644 --- a/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp index 7c73b1c70a8..026540f25b2 100644 --- a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp index d0f6002929e..261db8d77ef 100644 --- a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp index f41a83b1c71..851b0b644ce 100644 --- a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp index 9989baa8700..4f40b20b551 100644 --- a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp index 5fbaa4beb4e..1aa158b4a8f 100644 --- a/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp index 234248e387e..b641852e8a3 100644 --- a/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp index 9934d1f0143..2a5ae0f248f 100644 --- a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp index a9fe522671c..4df27d43d1b 100644 --- a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/codeBuffer_ppc.hpp b/hotspot/src/cpu/ppc/vm/codeBuffer_ppc.hpp index 1855aea1f29..ae618ceffd0 100644 --- a/hotspot/src/cpu/ppc/vm/codeBuffer_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/codeBuffer_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp index 197d3069817..68dabc4b031 100644 --- a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/copy_ppc.hpp b/hotspot/src/cpu/ppc/vm/copy_ppc.hpp index 0094c0c6d30..06a5a010033 100644 --- a/hotspot/src/cpu/ppc/vm/copy_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/copy_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/debug_ppc.cpp b/hotspot/src/cpu/ppc/vm/debug_ppc.cpp index dc91efc78bb..5427a1e4644 100644 --- a/hotspot/src/cpu/ppc/vm/debug_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/debug_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/depChecker_ppc.hpp b/hotspot/src/cpu/ppc/vm/depChecker_ppc.hpp index 33f04c06050..07ed6267640 100644 --- a/hotspot/src/cpu/ppc/vm/depChecker_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/depChecker_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/disassembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/disassembler_ppc.hpp index eb2a81d390e..dc98a8bb06a 100644 --- a/hotspot/src/cpu/ppc/vm/disassembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/disassembler_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp index 29921834ac1..08463758370 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp index 3b90da157a5..8115a20640e 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp index 2c90cd2a6a1..7fce0585f10 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp index f7aa82d6cde..ba981816f4a 100644 --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp index b3a1ef5d729..695014fd836 100644 --- a/hotspot/src/cpu/ppc/vm/globals_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globals_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp b/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp index 8e16078b3d7..6e2c34341a5 100644 --- a/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/icache_ppc.cpp b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp index 641841b9463..916d3d72590 100644 --- a/hotspot/src/cpu/ppc/vm/icache_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/icache_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/icache_ppc.hpp b/hotspot/src/cpu/ppc/vm/icache_ppc.hpp index 4941f5586f8..fc9790f2133 100644 --- a/hotspot/src/cpu/ppc/vm/icache_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/icache_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp index 6c88cede5b8..8a75af011bd 100644 --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.cpp index 98ab1041dde..7869ef1238c 100644 --- a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp index da98715a102..d71781cbc83 100644 --- a/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/interpreterRT_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp index bd3488f9873..a437727b8e2 100644 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/javaFrameAnchor_ppc.hpp b/hotspot/src/cpu/ppc/vm/javaFrameAnchor_ppc.hpp index 26ca0dbf181..2b66bbce292 100644 --- a/hotspot/src/cpu/ppc/vm/javaFrameAnchor_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/javaFrameAnchor_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/cpu/ppc/vm/jniFastGetField_ppc.cpp b/hotspot/src/cpu/ppc/vm/jniFastGetField_ppc.cpp index b16be25c5c0..8447e1c37d9 100644 --- a/hotspot/src/cpu/ppc/vm/jniFastGetField_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/jniFastGetField_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/jniTypes_ppc.hpp b/hotspot/src/cpu/ppc/vm/jniTypes_ppc.hpp index 9178bd442ad..7179e998931 100644 --- a/hotspot/src/cpu/ppc/vm/jniTypes_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/jniTypes_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/jni_ppc.h b/hotspot/src/cpu/ppc/vm/jni_ppc.h index da8cc361c14..64e4b9bf061 100644 --- a/hotspot/src/cpu/ppc/vm/jni_ppc.h +++ b/hotspot/src/cpu/ppc/vm/jni_ppc.h @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index 2b19742bb71..c51555e0b23 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2016 SAP AG. All rights reserved. + * Copyright (c) 2012, 2016 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 diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp index df58832b160..925e73a82d1 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp index 62843482074..a15f07528b6 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp b/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp index 9aa479a0e09..6fd569a1122 100644 --- a/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp index 12e10dbc573..dea4bfca545 100644 --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp index 63fd6070272..144e1f0f369 100644 --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp index 37956925d0d..08704344050 100644 --- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp index f0f6b6a87d9..586dcaa9380 100644 --- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index dd95d23be09..50c96d03bb4 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -1,6 +1,6 @@ // // Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. -// Copyright 2012, 2015 SAP AG. All rights reserved. +// Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/ppc_64.ad b/hotspot/src/cpu/ppc/vm/ppc_64.ad index 4c1be69601a..712f18fe969 100644 --- a/hotspot/src/cpu/ppc/vm/ppc_64.ad +++ b/hotspot/src/cpu/ppc/vm/ppc_64.ad @@ -1,6 +1,6 @@ // // Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. -// Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp b/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp index b3d89c2ba09..06fdff2e891 100644 --- a/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/registerMap_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp b/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp index 6b002d2efd2..2a2d968e44d 100644 --- a/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/register_definitions_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.cpp b/hotspot/src/cpu/ppc/vm/register_ppc.cpp index edff7485a97..e0b07c98168 100644 --- a/hotspot/src/cpu/ppc/vm/register_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/register_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.hpp b/hotspot/src/cpu/ppc/vm/register_ppc.hpp index 9f1dc28a2a3..8f6dda40eea 100644 --- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp index 9c5065d0dd4..44b2d79e515 100644 --- a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.hpp b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.hpp index 3cd7da47ec8..3778e0c674d 100644 --- a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp index e887877d14e..77353f891e7 100644 --- a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index bc7f240eb90..c3f6922fe2d 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2016 SAP AG. All rights reserved. + * Copyright (c) 2012, 2016 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 diff --git a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp index 1f49fe1de26..bed7f40a501 100644 --- a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp index cd3a8bfb9d4..a005677ffa0 100644 --- a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp +++ b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp index eb00b5742c1..238fb6649a1 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2015 SAP AG. All rights reserved. + * Copyright (c) 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp index cf0af66de9b..d0668980735 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2015 SAP AG. All rights reserved. + * Copyright (c) 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp index 285b6f2306a..cb1ce6312f6 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2015 SAP AG. All rights reserved. + * Copyright (c) 2013, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp index ec92898e890..d537f73dac4 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, 2015 SAP AG. All rights reserved. + * Copyright (c) 2013, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.hpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.hpp index 1dfa8841c64..943f12abb0f 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.hpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, 2014 SAP AG. All rights reserved. + * Copyright (c) 2013, 2014 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 diff --git a/hotspot/src/cpu/ppc/vm/vmStructs_ppc.hpp b/hotspot/src/cpu/ppc/vm/vmStructs_ppc.hpp index bb4db41095d..c5297f395e1 100644 --- a/hotspot/src/cpu/ppc/vm/vmStructs_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vmStructs_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index fec10b9268e..51bc85d869d 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp index 63b9ba09793..46fdd6b6470 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.cpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.cpp index a2a83f2f361..5931bdf7b76 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp index 4fe7bdb62e1..29f99765e88 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp index 16e5e5d8fd7..6113d458ebf 100644 --- a/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/vmreg_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp index d19c211300f..0c30519a518 100644 --- a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/attachListener_aix.cpp b/hotspot/src/os/aix/vm/attachListener_aix.cpp index 95f5c871028..cb56efc26f7 100644 --- a/hotspot/src/os/aix/vm/attachListener_aix.cpp +++ b/hotspot/src/os/aix/vm/attachListener_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/c1_globals_aix.hpp b/hotspot/src/os/aix/vm/c1_globals_aix.hpp index 45b57f71954..0d4affd2bab 100644 --- a/hotspot/src/os/aix/vm/c1_globals_aix.hpp +++ b/hotspot/src/os/aix/vm/c1_globals_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/c2_globals_aix.hpp b/hotspot/src/os/aix/vm/c2_globals_aix.hpp index ea63015a513..b42a7051fea 100644 --- a/hotspot/src/os/aix/vm/c2_globals_aix.hpp +++ b/hotspot/src/os/aix/vm/c2_globals_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os/aix/vm/decoder_aix.hpp b/hotspot/src/os/aix/vm/decoder_aix.hpp index c415e4b3296..e00c90e8d84 100644 --- a/hotspot/src/os/aix/vm/decoder_aix.hpp +++ b/hotspot/src/os/aix/vm/decoder_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013 SAP AG. All rights reserved. + * Copyright (c) 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 diff --git a/hotspot/src/os/aix/vm/globals_aix.hpp b/hotspot/src/os/aix/vm/globals_aix.hpp index 51612fae7a6..bfd244eb6fc 100644 --- a/hotspot/src/os/aix/vm/globals_aix.hpp +++ b/hotspot/src/os/aix/vm/globals_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/interfaceSupport_aix.hpp b/hotspot/src/os/aix/vm/interfaceSupport_aix.hpp index 8f32db7b810..a8bb618e287 100644 --- a/hotspot/src/os/aix/vm/interfaceSupport_aix.hpp +++ b/hotspot/src/os/aix/vm/interfaceSupport_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/jsig.c b/hotspot/src/os/aix/vm/jsig.c index d39fbe311eb..001255ab365 100644 --- a/hotspot/src/os/aix/vm/jsig.c +++ b/hotspot/src/os/aix/vm/jsig.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/jvm_aix.cpp b/hotspot/src/os/aix/vm/jvm_aix.cpp index 7a9fb8969b8..d6e9038c4c7 100644 --- a/hotspot/src/os/aix/vm/jvm_aix.cpp +++ b/hotspot/src/os/aix/vm/jvm_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os/aix/vm/jvm_aix.h b/hotspot/src/os/aix/vm/jvm_aix.h index 75feef49dc1..e79d2e638fd 100644 --- a/hotspot/src/os/aix/vm/jvm_aix.h +++ b/hotspot/src/os/aix/vm/jvm_aix.h @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os/aix/vm/libo4.cpp b/hotspot/src/os/aix/vm/libo4.cpp index d47f70eb8b8..c0c8299aedd 100644 --- a/hotspot/src/os/aix/vm/libo4.cpp +++ b/hotspot/src/os/aix/vm/libo4.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/libo4.hpp b/hotspot/src/os/aix/vm/libo4.hpp index 13bc1856adb..fb920071dfc 100644 --- a/hotspot/src/os/aix/vm/libo4.hpp +++ b/hotspot/src/os/aix/vm/libo4.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/libodm_aix.cpp b/hotspot/src/os/aix/vm/libodm_aix.cpp index e39a97d9f77..af998b84086 100644 --- a/hotspot/src/os/aix/vm/libodm_aix.cpp +++ b/hotspot/src/os/aix/vm/libodm_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2015, 2015 SAP AG. All rights reserved. + * Copyright (c) 2015, 2015 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 diff --git a/hotspot/src/os/aix/vm/libodm_aix.hpp b/hotspot/src/os/aix/vm/libodm_aix.hpp index 908bb2686a4..920b58f746f 100644 --- a/hotspot/src/os/aix/vm/libodm_aix.hpp +++ b/hotspot/src/os/aix/vm/libodm_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2015, 2015 SAP AG. All rights reserved. + * Copyright (c) 2015, 2015 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 diff --git a/hotspot/src/os/aix/vm/libperfstat_aix.cpp b/hotspot/src/os/aix/vm/libperfstat_aix.cpp index afd577ffcbc..388b4052c9e 100644 --- a/hotspot/src/os/aix/vm/libperfstat_aix.cpp +++ b/hotspot/src/os/aix/vm/libperfstat_aix.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/libperfstat_aix.hpp b/hotspot/src/os/aix/vm/libperfstat_aix.hpp index c0da6709061..164f486a2dc 100644 --- a/hotspot/src/os/aix/vm/libperfstat_aix.hpp +++ b/hotspot/src/os/aix/vm/libperfstat_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os/aix/vm/loadlib_aix.cpp b/hotspot/src/os/aix/vm/loadlib_aix.cpp index 53e4891442b..8373cc2162e 100644 --- a/hotspot/src/os/aix/vm/loadlib_aix.cpp +++ b/hotspot/src/os/aix/vm/loadlib_aix.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/loadlib_aix.hpp b/hotspot/src/os/aix/vm/loadlib_aix.hpp index b619141cd54..0f5b1489719 100644 --- a/hotspot/src/os/aix/vm/loadlib_aix.hpp +++ b/hotspot/src/os/aix/vm/loadlib_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os/aix/vm/misc_aix.cpp b/hotspot/src/os/aix/vm/misc_aix.cpp index 52a26c0f592..f0ccdfbcbab 100644 --- a/hotspot/src/os/aix/vm/misc_aix.cpp +++ b/hotspot/src/os/aix/vm/misc_aix.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP AG. All rights reserved. + * Copyright (c) 2015 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 diff --git a/hotspot/src/os/aix/vm/misc_aix.hpp b/hotspot/src/os/aix/vm/misc_aix.hpp index ba38bda137b..c56a89633d0 100644 --- a/hotspot/src/os/aix/vm/misc_aix.hpp +++ b/hotspot/src/os/aix/vm/misc_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/mutex_aix.inline.hpp b/hotspot/src/os/aix/vm/mutex_aix.inline.hpp index 82ae899e14d..ee59295dcba 100644 --- a/hotspot/src/os/aix/vm/mutex_aix.inline.hpp +++ b/hotspot/src/os/aix/vm/mutex_aix.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/os/aix/vm/osThread_aix.cpp b/hotspot/src/os/aix/vm/osThread_aix.cpp index c2b1f69b291..0b13454ffef 100644 --- a/hotspot/src/os/aix/vm/osThread_aix.cpp +++ b/hotspot/src/os/aix/vm/osThread_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/osThread_aix.hpp b/hotspot/src/os/aix/vm/osThread_aix.hpp index 73d2a336e25..405b2a4b103 100644 --- a/hotspot/src/os/aix/vm/osThread_aix.hpp +++ b/hotspot/src/os/aix/vm/osThread_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index 43314d7dfac..35f6adb3ec5 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/os_aix.hpp b/hotspot/src/os/aix/vm/os_aix.hpp index b718d04c52e..cc4337070c8 100644 --- a/hotspot/src/os/aix/vm/os_aix.hpp +++ b/hotspot/src/os/aix/vm/os_aix.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, 2015 SAP AG. All rights reserved. + * Copyright (c) 2013, 2015 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 diff --git a/hotspot/src/os/aix/vm/os_aix.inline.hpp b/hotspot/src/os/aix/vm/os_aix.inline.hpp index 5d0deea22f7..1290a53ba3f 100644 --- a/hotspot/src/os/aix/vm/os_aix.inline.hpp +++ b/hotspot/src/os/aix/vm/os_aix.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/perfMemory_aix.cpp b/hotspot/src/os/aix/vm/perfMemory_aix.cpp index 8b8431daf9e..2604a03dae8 100644 --- a/hotspot/src/os/aix/vm/perfMemory_aix.cpp +++ b/hotspot/src/os/aix/vm/perfMemory_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os/aix/vm/porting_aix.cpp b/hotspot/src/os/aix/vm/porting_aix.cpp index d5e8e881872..ba74b35a38c 100644 --- a/hotspot/src/os/aix/vm/porting_aix.cpp +++ b/hotspot/src/os/aix/vm/porting_aix.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os/aix/vm/porting_aix.hpp b/hotspot/src/os/aix/vm/porting_aix.hpp index 6a004df5b8b..905fdcce913 100644 --- a/hotspot/src/os/aix/vm/porting_aix.hpp +++ b/hotspot/src/os/aix/vm/porting_aix.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os/aix/vm/threadCritical_aix.cpp b/hotspot/src/os/aix/vm/threadCritical_aix.cpp index f2d651ff7e8..a5d893ba9f1 100644 --- a/hotspot/src/os/aix/vm/threadCritical_aix.cpp +++ b/hotspot/src/os/aix/vm/threadCritical_aix.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp index d3afeeb399d..5cbb383f4b8 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014, SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp b/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp index d705c869a16..c730ed269f8 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/globals_aix_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp index 71eb6ac9536..0c791f15772 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/orderAccess_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014, SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp index d89c28fa85b..ed45130446a 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp index 44fa7db3838..fb9cb687c3f 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/os_aix_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/prefetch_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/prefetch_aix_ppc.inline.hpp index 85c62b6640f..bcbb30d7b92 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/prefetch_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/prefetch_aix_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.cpp b/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.cpp index 96a09b2787f..1ac366126db 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.cpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.hpp b/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.hpp index 2ca7c861cc9..ca649130a7d 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/thread_aix_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os_cpu/aix_ppc/vm/vmStructs_aix_ppc.hpp b/hotspot/src/os_cpu/aix_ppc/vm/vmStructs_aix_ppc.hpp index 7a29d8351b0..1dbcb8a7c93 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/vmStructs_aix_ppc.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/vmStructs_aix_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp index d9e1f5d84e0..c40ce1fbe4e 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014, SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp b/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp index 50174b66d1c..1d995a9ee4c 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/globals_linux_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp index 9e414dcd805..3def90fefe2 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/orderAccess_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014, SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp index f9401d13c9b..b7318c22c08 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.hpp b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.hpp index 26bfc14273e..73937ddac4d 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/os_linux_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/prefetch_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/prefetch_linux_ppc.inline.hpp index c3b880f87ac..41d8445382c 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/prefetch_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/prefetch_linux_ppc.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp b/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp index 92661222b07..895fb25d3fa 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.hpp b/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.hpp index 237070ec1fe..5caf4f33c16 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/thread_linux_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/os_cpu/linux_ppc/vm/vmStructs_linux_ppc.hpp b/hotspot/src/os_cpu/linux_ppc/vm/vmStructs_linux_ppc.hpp index d947186ec86..a0adde047d2 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/vmStructs_linux_ppc.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/vmStructs_linux_ppc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp index 86b6c22822f..b6d780963dc 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreterProfiling.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2014 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 diff --git a/hotspot/src/share/vm/runtime/orderAccess.inline.hpp b/hotspot/src/share/vm/runtime/orderAccess.inline.hpp index eae1b965c00..bc3237351ea 100644 --- a/hotspot/src/share/vm/runtime/orderAccess.inline.hpp +++ b/hotspot/src/share/vm/runtime/orderAccess.inline.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2014 SAP AG. All rights reserved. + * Copyright (c) 2014 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 diff --git a/hotspot/src/share/vm/utilities/elfFuncDescTable.cpp b/hotspot/src/share/vm/utilities/elfFuncDescTable.cpp index c5a00606d55..abd80bed137 100644 --- a/hotspot/src/share/vm/utilities/elfFuncDescTable.cpp +++ b/hotspot/src/share/vm/utilities/elfFuncDescTable.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/share/vm/utilities/elfFuncDescTable.hpp b/hotspot/src/share/vm/utilities/elfFuncDescTable.hpp index 0b767a2c7b4..4ba4b0b0cb5 100644 --- a/hotspot/src/share/vm/utilities/elfFuncDescTable.hpp +++ b/hotspot/src/share/vm/utilities/elfFuncDescTable.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp index 93f2eaaac98..1892e1a5cb3 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. 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 diff --git a/hotspot/test/compiler/c2/6880034/Test6880034.java b/hotspot/test/compiler/c2/6880034/Test6880034.java index e834f23e549..72af0958b7e 100644 --- a/hotspot/test/compiler/c2/6880034/Test6880034.java +++ b/hotspot/test/compiler/c2/6880034/Test6880034.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 SAP AG. All Rights Reserved. + * Copyright (c) 2009 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 diff --git a/hotspot/test/compiler/c2/6910484/Test.java b/hotspot/test/compiler/c2/6910484/Test.java index 9835b34c6bb..3907c98fd2a 100644 --- a/hotspot/test/compiler/c2/6910484/Test.java +++ b/hotspot/test/compiler/c2/6910484/Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2009 SAP. All Rights Reserved. + * Copyright (c) 2009 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 diff --git a/hotspot/test/compiler/codegen/8005033/Test8005033.java b/hotspot/test/compiler/codegen/8005033/Test8005033.java index e6706390841..1918136d67e 100644 --- a/hotspot/test/compiler/codegen/8005033/Test8005033.java +++ b/hotspot/test/compiler/codegen/8005033/Test8005033.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 SAP AG. All Rights Reserved. + * Copyright (c) 2012 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 diff --git a/hotspot/test/compiler/codegen/IntRotateWithImmediate.java b/hotspot/test/compiler/codegen/IntRotateWithImmediate.java index 1d617a41526..e174de699e8 100644 --- a/hotspot/test/compiler/codegen/IntRotateWithImmediate.java +++ b/hotspot/test/compiler/codegen/IntRotateWithImmediate.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP AG. All Rights Reserved. + * Copyright (c) 2015 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 diff --git a/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java b/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java index d70ec5cb268..ce7be99f7a1 100644 --- a/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java +++ b/hotspot/test/compiler/escapeAnalysis/TestUnsafePutAddressNullObjMustNotEscape.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 SAP AG. All Rights Reserved. + * Copyright (c) 2014 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 diff --git a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java index fe9d85f9f7e..21c64179531 100644 --- a/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java +++ b/hotspot/test/compiler/intrinsics/string/TestStringIntrinsics2.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * Copyright 2016 SAP AG. All rights reserved. + * Copyright (c) 2016 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 diff --git a/hotspot/test/compiler/loopopts/superword/TestBestAlign.java b/hotspot/test/compiler/loopopts/superword/TestBestAlign.java index 9063798e63a..9609859701d 100644 --- a/hotspot/test/compiler/loopopts/superword/TestBestAlign.java +++ b/hotspot/test/compiler/loopopts/superword/TestBestAlign.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP AG. All Rights Reserved. + * Copyright (c) 2015 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 diff --git a/hotspot/test/compiler/membars/DekkerTest.java b/hotspot/test/compiler/membars/DekkerTest.java index bef045701ec..83eb923c6f2 100644 --- a/hotspot/test/compiler/membars/DekkerTest.java +++ b/hotspot/test/compiler/membars/DekkerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 SAP AG. All Rights Reserved. + * Copyright (c) 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 diff --git a/hotspot/test/compiler/runtime/7141637/SpreadNullArg.java b/hotspot/test/compiler/runtime/7141637/SpreadNullArg.java index 195e106d542..fac5d4723a0 100644 --- a/hotspot/test/compiler/runtime/7141637/SpreadNullArg.java +++ b/hotspot/test/compiler/runtime/7141637/SpreadNullArg.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2011 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 diff --git a/hotspot/test/compiler/stringopts/TestOptimizeStringConcat.java b/hotspot/test/compiler/stringopts/TestOptimizeStringConcat.java index 771ffb0bd68..2f0ec3c0353 100644 --- a/hotspot/test/compiler/stringopts/TestOptimizeStringConcat.java +++ b/hotspot/test/compiler/stringopts/TestOptimizeStringConcat.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP AG. All Rights Reserved. + * Copyright (c) 2015 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 diff --git a/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java b/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java index f12972c5cd2..f4e0f776f7e 100644 --- a/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java +++ b/hotspot/test/compiler/types/TestMeetIncompatibleInterfaceArrays.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP AG. All Rights Reserved. + * Copyright (c) 2015 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 diff --git a/hotspot/test/runtime/7100935/TestConjointAtomicArraycopy.java b/hotspot/test/runtime/7100935/TestConjointAtomicArraycopy.java index 3e1711888ab..6f82740cd72 100644 --- a/hotspot/test/runtime/7100935/TestConjointAtomicArraycopy.java +++ b/hotspot/test/runtime/7100935/TestConjointAtomicArraycopy.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2011 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 diff --git a/hotspot/test/runtime/7100935/TestShortArraycopy.java b/hotspot/test/runtime/7100935/TestShortArraycopy.java index 81b048912e3..edcbcbbf51e 100644 --- a/hotspot/test/runtime/7100935/TestShortArraycopy.java +++ b/hotspot/test/runtime/7100935/TestShortArraycopy.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2011 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 diff --git a/hotspot/test/runtime/7107135/Test.java b/hotspot/test/runtime/7107135/Test.java index 84f3ab3393f..9b489347bd4 100644 --- a/hotspot/test/runtime/7107135/Test.java +++ b/hotspot/test/runtime/7107135/Test.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002-2013, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 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 diff --git a/hotspot/test/runtime/7107135/Test7107135.sh b/hotspot/test/runtime/7107135/Test7107135.sh index 30604ff6313..5371b3a2d95 100644 --- a/hotspot/test/runtime/7107135/Test7107135.sh +++ b/hotspot/test/runtime/7107135/Test7107135.sh @@ -2,7 +2,7 @@ # # Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2011 SAP AG. All Rights Reserved. +# Copyright (c) 2011 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 diff --git a/hotspot/test/runtime/7107135/TestMT.java b/hotspot/test/runtime/7107135/TestMT.java index edea698ac8c..4fc297dcd03 100644 --- a/hotspot/test/runtime/7107135/TestMT.java +++ b/hotspot/test/runtime/7107135/TestMT.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002-2013, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 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 diff --git a/hotspot/test/runtime/7107135/test.c b/hotspot/test/runtime/7107135/test.c index 602063f640e..3e39eaeb7f2 100644 --- a/hotspot/test/runtime/7107135/test.c +++ b/hotspot/test/runtime/7107135/test.c @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002-2013, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 SAP AG. All Rights Reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 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 diff --git a/hotspot/test/runtime/7158988/FieldMonitor.java b/hotspot/test/runtime/7158988/FieldMonitor.java index 42b82768530..cfe210ce69d 100644 --- a/hotspot/test/runtime/7158988/FieldMonitor.java +++ b/hotspot/test/runtime/7158988/FieldMonitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 SAP AG. All Rights Reserved. + * Copyright (c) 2012 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 diff --git a/hotspot/test/runtime/7158988/TestPostFieldModification.java b/hotspot/test/runtime/7158988/TestPostFieldModification.java index d730003b267..8f51d4d32c4 100644 --- a/hotspot/test/runtime/7158988/TestPostFieldModification.java +++ b/hotspot/test/runtime/7158988/TestPostFieldModification.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 SAP AG. All Rights Reserved. + * Copyright (c) 2012 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 diff --git a/hotspot/test/serviceability/jvmti/8036666/GetObjectLockCount.java b/hotspot/test/serviceability/jvmti/8036666/GetObjectLockCount.java index 47e4104bd3d..404f4dd0468 100644 --- a/hotspot/test/serviceability/jvmti/8036666/GetObjectLockCount.java +++ b/hotspot/test/serviceability/jvmti/8036666/GetObjectLockCount.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 SAP AG. All Rights Reserved. + * Copyright (c) 2014 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 diff --git a/hotspot/test/serviceability/jvmti/8036666/RecursiveObjectLock.java b/hotspot/test/serviceability/jvmti/8036666/RecursiveObjectLock.java index d1a35edd6c3..55107e9b0ee 100644 --- a/hotspot/test/serviceability/jvmti/8036666/RecursiveObjectLock.java +++ b/hotspot/test/serviceability/jvmti/8036666/RecursiveObjectLock.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 SAP AG. All Rights Reserved. + * Copyright (c) 2014 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 From dc88c70fbb55514bd3103cd3ed8cc63399aacd53 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Thu, 21 Jan 2016 18:04:14 +0100 Subject: [PATCH 119/212] 8147853: "assert(t->meet(t0) == t) failed: Not monotonic" with sun/util/calendar/zi/TestZoneInfo310.java Type of counted loop Phi may be saturated before special code to handle counted loops kicks in Reviewed-by: kvn --- hotspot/src/share/vm/opto/cfgnode.cpp | 41 ++++++++++++++++----------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp index 2adcac07b89..12aa7c7d6b4 100644 --- a/hotspot/src/share/vm/opto/cfgnode.cpp +++ b/hotspot/src/share/vm/opto/cfgnode.cpp @@ -904,25 +904,34 @@ const Type* PhiNode::Value(PhaseGVN* phase) const { // Check for trip-counted loop. If so, be smarter. CountedLoopNode* l = r->is_CountedLoop() ? r->as_CountedLoop() : NULL; - if (l && l->can_be_counted_loop(phase) && - ((const Node*)l->phi() == this)) { // Trip counted loop! + if (l && ((const Node*)l->phi() == this)) { // Trip counted loop! // protect against init_trip() or limit() returning NULL - const Node *init = l->init_trip(); - const Node *limit = l->limit(); - const Node* stride = l->stride(); - if (init != NULL && limit != NULL && stride != NULL) { - const TypeInt* lo = phase->type(init)->isa_int(); - const TypeInt* hi = phase->type(limit)->isa_int(); - const TypeInt* stride_t = phase->type(stride)->isa_int(); - if (lo != NULL && hi != NULL && stride_t != NULL) { // Dying loops might have TOP here - assert(stride_t->_hi >= stride_t->_lo, "bad stride type"); - if (stride_t->_hi < 0) { // Down-counter loop - swap(lo, hi); - return TypeInt::make(MIN2(lo->_lo, hi->_lo) , hi->_hi, 3); - } else if (stride_t->_lo >= 0) { - return TypeInt::make(lo->_lo, MAX2(lo->_hi, hi->_hi), 3); + if (l->can_be_counted_loop(phase)) { + const Node *init = l->init_trip(); + const Node *limit = l->limit(); + const Node* stride = l->stride(); + if (init != NULL && limit != NULL && stride != NULL) { + const TypeInt* lo = phase->type(init)->isa_int(); + const TypeInt* hi = phase->type(limit)->isa_int(); + const TypeInt* stride_t = phase->type(stride)->isa_int(); + if (lo != NULL && hi != NULL && stride_t != NULL) { // Dying loops might have TOP here + assert(stride_t->_hi >= stride_t->_lo, "bad stride type"); + if (stride_t->_hi < 0) { // Down-counter loop + swap(lo, hi); + return TypeInt::make(MIN2(lo->_lo, hi->_lo) , hi->_hi, 3); + } else if (stride_t->_lo >= 0) { + return TypeInt::make(lo->_lo, MAX2(lo->_hi, hi->_hi), 3); + } } } + } else if (l->in(LoopNode::LoopBackControl) != NULL && + in(LoopNode::EntryControl) != NULL && + phase->type(l->in(LoopNode::LoopBackControl)) == Type::TOP) { + // During CCP, if we saturate the type of a counted loop's Phi + // before the special code for counted loop above has a chance + // to run (that is as long as the type of the backedge's control + // is top), we might end up with non monotonic types + return phase->type(in(LoopNode::EntryControl)); } } From a3351a8233e1e0e2e46c21d487225b90b1ac2c9c Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Mon, 25 Jan 2016 09:12:58 -0800 Subject: [PATCH 120/212] 8148101: [JVMCI] Make CallingConvention.Type extensible Reviewed-by: twisti --- .../src/jdk/vm/ci/code/CallingConvention.java | 30 +--------- .../src/jdk/vm/ci/code/CodeUtil.java | 4 +- .../src/jdk/vm/ci/code/RegisterConfig.java | 3 +- .../aarch64/AArch64HotSpotRegisterConfig.java | 21 ++++--- .../amd64/AMD64HotSpotRegisterConfig.java | 24 +++++--- .../sparc/SPARCHotSpotRegisterConfig.java | 36 ++++++------ .../hotspot/HotSpotCallingConventionType.java | 55 +++++++++++++++++++ .../jvmci/code/amd64/AMD64TestAssembler.java | 6 +- .../jvmci/code/sparc/SPARCTestAssembler.java | 6 +- 9 files changed, 113 insertions(+), 72 deletions(-) create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java index 6161619548b..240b4be1423 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java @@ -34,35 +34,9 @@ import jdk.vm.ci.meta.Value; public class CallingConvention { /** - * Constants denoting the type of a call for which a calling convention is requested. + * Marker interface denoting the type of a call for which a calling convention is requested. */ - public enum Type { - /** - * A request for the outgoing argument locations at a call site to Java code. - */ - JavaCall(true), - - /** - * A request for the incoming argument locations. - */ - JavaCallee(false), - - /** - * A request for the outgoing argument locations at a call site to external native code that - * complies with the platform ABI. - */ - NativeCall(true); - - /** - * Determines if this is a request for the outgoing argument locations at a call site. - */ - public final boolean out; - - public static final Type[] VALUES = values(); - - private Type(boolean out) { - this.out = out; - } + public interface Type { } /** diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java index a138a30dca2..9cde2e53bee 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java @@ -417,7 +417,7 @@ public class CodeUtil { /** * Create a calling convention from a {@link ResolvedJavaMethod}. */ - public static CallingConvention getCallingConvention(CodeCacheProvider codeCache, CallingConvention.Type type, ResolvedJavaMethod method, boolean stackOnly) { + public static CallingConvention getCallingConvention(CodeCacheProvider codeCache, CallingConvention.Type type, ResolvedJavaMethod method) { Signature sig = method.getSignature(); JavaType retType = sig.getReturnType(null); int sigCount = sig.getParameterCount(false); @@ -434,6 +434,6 @@ public class CodeUtil { } RegisterConfig registerConfig = codeCache.getRegisterConfig(); - return registerConfig.getCallingConvention(type, retType, argTypes, codeCache.getTarget(), stackOnly); + return registerConfig.getCallingConvention(type, retType, argTypes, codeCache.getTarget()); } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java index f942b723dbc..4a6d44c4e51 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java @@ -57,9 +57,8 @@ public interface RegisterConfig { * @param returnType the return type (can be null for methods returning {@code void}) * @param parameterTypes the types of the arguments of the call * @param target the target platform - * @param stackOnly ignore registers */ - CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly); + CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target); /** * Gets the ordered set of registers that are can be used to pass parameters according to a diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java index 9590d2fcda4..aafee14a145 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java @@ -62,6 +62,7 @@ import jdk.vm.ci.code.RegisterConfig; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCallingConventionType; import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaKind; @@ -96,6 +97,7 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig { return allocatable.clone(); } + @Override public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { ArrayList list = new ArrayList<>(); for (Register reg : registers) { @@ -191,16 +193,19 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig { } @Override - public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { - if (type == Type.NativeCall) { - return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; + if (type == HotSpotCallingConventionType.NativeCall) { + return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, hotspotType, target); } // On x64, parameter locations are the same whether viewed // from the caller or callee perspective - return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, hotspotType, target); } + @Override public Register[] getCallingConventionRegisters(Type type, JavaKind kind) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; switch (kind) { case Boolean: case Byte: @@ -209,7 +214,7 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; + return hotspotType == HotSpotCallingConventionType.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; case Float: case Double: return simdParameterRegisters; @@ -218,7 +223,7 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig { } } - private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { + private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, HotSpotCallingConventionType type, TargetDescription target) { AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; int currentGeneral = 0; @@ -236,14 +241,14 @@ public class AArch64HotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - if (!stackOnly && currentGeneral < generalParameterRegisters.length) { + if (currentGeneral < generalParameterRegisters.length) { Register register = generalParameterRegisters[currentGeneral++]; locations[i] = register.asValue(target.getLIRKind(kind)); } break; case Float: case Double: - if (!stackOnly && currentSIMD < simdParameterRegisters.length) { + if (currentSIMD < simdParameterRegisters.length) { Register register = simdParameterRegisters[currentSIMD++]; locations[i] = register.asValue(target.getLIRKind(kind)); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java index 876263c75ef..1baf7368a96 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java @@ -56,6 +56,7 @@ import jdk.vm.ci.code.RegisterConfig; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCallingConventionType; import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaKind; @@ -90,6 +91,7 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { return allocatable.clone(); } + @Override public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { ArrayList list = new ArrayList<>(); for (Register reg : registers) { @@ -175,6 +177,7 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { return callerSaved; } + @Override public Register[] getCalleeSaveRegisters() { return null; } @@ -190,16 +193,19 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { } @Override - public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { - if (type == Type.NativeCall) { - return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; + if (type == HotSpotCallingConventionType.NativeCall) { + return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, hotspotType, target); } // On x64, parameter locations are the same whether viewed // from the caller or callee perspective - return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, hotspotType, target); } + @Override public Register[] getCallingConventionRegisters(Type type, JavaKind kind) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; switch (kind) { case Boolean: case Byte: @@ -208,7 +214,7 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; + return hotspotType == HotSpotCallingConventionType.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; case Float: case Double: return xmmParameterRegisters; @@ -217,12 +223,12 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { } } - private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { + private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, HotSpotCallingConventionType type, TargetDescription target) { AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; int currentGeneral = 0; int currentXMM = 0; - int currentStackOffset = type == Type.NativeCall && needsNativeStackHomeSpace ? generalParameterRegisters.length * target.wordSize : 0; + int currentStackOffset = type == HotSpotCallingConventionType.NativeCall && needsNativeStackHomeSpace ? generalParameterRegisters.length * target.wordSize : 0; for (int i = 0; i < parameterTypes.length; i++) { final JavaKind kind = parameterTypes[i].getJavaKind().getStackKind(); @@ -235,14 +241,14 @@ public class AMD64HotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - if (!stackOnly && currentGeneral < generalParameterRegisters.length) { + if (currentGeneral < generalParameterRegisters.length) { Register register = generalParameterRegisters[currentGeneral++]; locations[i] = register.asValue(target.getLIRKind(kind)); } break; case Float: case Double: - if (!stackOnly && currentXMM < xmmParameterRegisters.length) { + if (currentXMM < xmmParameterRegisters.length) { Register register = xmmParameterRegisters[currentXMM++]; locations[i] = register.asValue(target.getLIRKind(kind)); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java index 58dfcdc3e55..c2c198e8348 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java @@ -22,9 +22,6 @@ */ package jdk.vm.ci.hotspot.sparc; -import static jdk.vm.ci.code.CallingConvention.Type.JavaCall; -import static jdk.vm.ci.code.CallingConvention.Type.JavaCallee; -import static jdk.vm.ci.code.CallingConvention.Type.NativeCall; import static jdk.vm.ci.meta.JavaKind.Void; import static jdk.vm.ci.meta.Value.ILLEGAL; import static jdk.vm.ci.sparc.SPARC.REGISTER_SAFE_AREA_SIZE; @@ -81,6 +78,7 @@ import jdk.vm.ci.code.RegisterConfig; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotCallingConventionType; import jdk.vm.ci.hotspot.HotSpotVMConfig; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.JavaKind; @@ -107,6 +105,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { return allocatable.clone(); } + @Override public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { ArrayList list = new ArrayList<>(); for (Register reg : registers) { @@ -200,17 +199,20 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { } @Override - public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { - if (type == JavaCall || type == NativeCall) { - return callingConvention(cpuCallerParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; + if (type == HotSpotCallingConventionType.JavaCall || type == HotSpotCallingConventionType.NativeCall) { + return callingConvention(cpuCallerParameterRegisters, returnType, parameterTypes, hotspotType, target); } - if (type == JavaCallee) { - return callingConvention(cpuCalleeParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + if (type == HotSpotCallingConventionType.JavaCallee) { + return callingConvention(cpuCalleeParameterRegisters, returnType, parameterTypes, hotspotType, target); } throw JVMCIError.shouldNotReachHere(); } + @Override public Register[] getCallingConventionRegisters(Type type, JavaKind kind) { + HotSpotCallingConventionType hotspotType = (HotSpotCallingConventionType) type; switch (kind) { case Boolean: case Byte: @@ -219,7 +221,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - return type == Type.JavaCallee ? cpuCalleeParameterRegisters : cpuCallerParameterRegisters; + return hotspotType == HotSpotCallingConventionType.JavaCallee ? cpuCalleeParameterRegisters : cpuCallerParameterRegisters; case Double: case Float: return fpuFloatParameterRegisters; @@ -228,7 +230,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { } } - private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { + private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, HotSpotCallingConventionType type, TargetDescription target) { AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; int currentGeneral = 0; @@ -246,13 +248,13 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - if (!stackOnly && currentGeneral < generalParameterRegisters.length) { + if (currentGeneral < generalParameterRegisters.length) { Register register = generalParameterRegisters[currentGeneral++]; locations[i] = register.asValue(target.getLIRKind(kind)); } break; case Double: - if (!stackOnly && currentFloating < fpuFloatParameterRegisters.length) { + if (currentFloating < fpuFloatParameterRegisters.length) { if (currentFloating % 2 != 0) { // Make register number even to be a double reg currentFloating++; @@ -263,7 +265,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { } break; case Float: - if (!stackOnly && currentFloating < fpuFloatParameterRegisters.length) { + if (currentFloating < fpuFloatParameterRegisters.length) { Register register = fpuFloatParameterRegisters[currentFloating++]; locations[i] = register.asValue(target.getLIRKind(kind)); } @@ -287,7 +289,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { AllocatableValue returnLocation = returnKind == Void ? ILLEGAL : getReturnRegister(returnKind, type).asValue(target.getLIRKind(returnKind.getStackKind())); int outArgSpillArea; - if (type == NativeCall && addNativeRegisterArgumentSlots) { + if (type == HotSpotCallingConventionType.NativeCall && addNativeRegisterArgumentSlots) { // Space for native callee which may spill our outgoing arguments outArgSpillArea = Math.min(locations.length, generalParameterRegisters.length) * target.wordSize; } else { @@ -302,10 +304,10 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { @Override public Register getReturnRegister(JavaKind kind) { - return getReturnRegister(kind, JavaCallee); + return getReturnRegister(kind, HotSpotCallingConventionType.JavaCallee); } - private static Register getReturnRegister(JavaKind kind, Type type) { + private static Register getReturnRegister(JavaKind kind, HotSpotCallingConventionType type) { switch (kind) { case Boolean: case Byte: @@ -314,7 +316,7 @@ public class SPARCHotSpotRegisterConfig implements RegisterConfig { case Int: case Long: case Object: - return type == JavaCallee ? i0 : o0; + return type == HotSpotCallingConventionType.JavaCallee ? i0 : o0; case Float: return f0; case Double: diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java new file mode 100644 index 00000000000..357a4a23050 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2016, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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. + */ +package jdk.vm.ci.hotspot; + +import jdk.vm.ci.code.CallingConvention; +import jdk.vm.ci.code.CallingConvention.Type; + +public enum HotSpotCallingConventionType implements CallingConvention.Type { + /** + * A request for the outgoing argument locations at a call site to Java code. + */ + JavaCall(true), + + /** + * A request for the incoming argument locations. + */ + JavaCallee(false), + + /** + * A request for the outgoing argument locations at a call site to external native code that + * complies with the platform ABI. + */ + NativeCall(true); + + /** + * Determines if this is a request for the outgoing argument locations at a call site. + */ + public final boolean out; + + public static final Type[] VALUES = values(); + + private HotSpotCallingConventionType(boolean out) { + this.out = out; + } +} diff --git a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java index dd131016a0d..c67192674a2 100644 --- a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java @@ -25,13 +25,13 @@ package compiler.jvmci.code.amd64; import jdk.vm.ci.amd64.AMD64; import jdk.vm.ci.amd64.AMD64Kind; -import jdk.vm.ci.code.CallingConvention.Type; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.code.site.ConstantReference; import jdk.vm.ci.code.site.DataSectionReference; +import jdk.vm.ci.hotspot.HotSpotCallingConventionType; import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.LIRKind; @@ -76,12 +76,12 @@ public class AMD64TestAssembler extends TestAssembler { @Override public Register emitIntArg0() { - return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCall, JavaKind.Int)[0]; + return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCall, JavaKind.Int)[0]; } @Override public Register emitIntArg1() { - return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCall, JavaKind.Int)[1]; + return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCall, JavaKind.Int)[1]; } private void emitREX(boolean w, int r, int x, int b) { diff --git a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java index 828852de144..7b423641e18 100644 --- a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java @@ -23,13 +23,13 @@ package compiler.jvmci.code.sparc; -import jdk.vm.ci.code.CallingConvention.Type; import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.code.site.ConstantReference; import jdk.vm.ci.code.site.DataSectionReference; +import jdk.vm.ci.hotspot.HotSpotCallingConventionType; import jdk.vm.ci.hotspot.HotSpotCompiledCode; import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; @@ -83,12 +83,12 @@ public class SPARCTestAssembler extends TestAssembler { @Override public Register emitIntArg0() { - return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCallee, JavaKind.Int)[0]; + return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCallee, JavaKind.Int)[0]; } @Override public Register emitIntArg1() { - return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCallee, JavaKind.Int)[1]; + return codeCache.getRegisterConfig().getCallingConventionRegisters(HotSpotCallingConventionType.JavaCallee, JavaKind.Int)[1]; } @Override From 972bf92ef728950bc6379e1b84ed766b4c902e35 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Tue, 26 Jan 2016 00:25:20 +0300 Subject: [PATCH 121/212] 8148161: quarantine compiler/loopopts/UseCountedLoopSafepoints.java Reviewed-by: kvn --- hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java b/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java index c769b5b5aba..689b7f40be7 100644 --- a/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java +++ b/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java @@ -28,6 +28,7 @@ * @summary Test that C2 flag UseCountedLoopSafepoints ensures a safepoint is kept in a CountedLoop * @library /testlibrary * @modules java.base + * @ignore 8146096 * @run main UseCountedLoopSafepoints */ From 3bebe35b7beda1344b99ee47239ee98cfab78f10 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Tue, 26 Jan 2016 00:25:20 +0300 Subject: [PATCH 122/212] 8148136: compile control tests have incorrect @build directives Reviewed-by: kvn --- .../compilercontrol/commandfile/CompileOnlyTest.java | 3 ++- .../compiler/compilercontrol/commandfile/ExcludeTest.java | 3 ++- .../test/compiler/compilercontrol/commandfile/LogTest.java | 3 ++- .../test/compiler/compilercontrol/commandfile/PrintTest.java | 3 ++- .../compiler/compilercontrol/commands/CompileOnlyTest.java | 3 ++- .../test/compiler/compilercontrol/commands/ExcludeTest.java | 3 ++- hotspot/test/compiler/compilercontrol/commands/LogTest.java | 3 ++- .../test/compiler/compilercontrol/commands/PrintTest.java | 3 ++- .../compiler/compilercontrol/directives/CompileOnlyTest.java | 3 ++- .../compiler/compilercontrol/directives/ExcludeTest.java | 3 ++- .../test/compiler/compilercontrol/directives/LogTest.java | 3 ++- .../test/compiler/compilercontrol/directives/PrintTest.java | 3 ++- .../test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java | 3 ++- .../compiler/compilercontrol/jcmd/AddCompileOnlyTest.java | 3 ++- .../test/compiler/compilercontrol/jcmd/AddExcludeTest.java | 3 ++- hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java | 3 ++- .../compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java | 3 ++- .../compilercontrol/jcmd/ClearDirectivesFileStackTest.java | 3 ++- .../compilercontrol/jcmd/ClearDirectivesStackTest.java | 3 ++- .../compiler/compilercontrol/jcmd/PrintDirectivesTest.java | 5 +++-- .../compilercontrol/jcmd/StressAddMultiThreadedTest.java | 3 ++- .../compilercontrol/jcmd/StressAddSequentiallyTest.java | 3 ++- .../compiler/compilercontrol/matcher/MethodMatcherTest.java | 2 +- .../compiler/compilercontrol/mixed/RandomCommandsTest.java | 3 ++- .../compilercontrol/mixed/RandomValidCommandsTest.java | 3 ++- 25 files changed, 50 insertions(+), 26 deletions(-) diff --git a/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java index 87a5efd732e..7fccb4577ac 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/CompileOnlyTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=compileonly * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build CompileOnlyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commandfile.CompileOnlyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java index 0e5dc7948e0..afe38547431 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=exclude * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build ExcludeTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commandfile.ExcludeTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java b/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java index 60463073253..a3b7c8f26b4 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/LogTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=log * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build LogTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commandfile.LogTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java b/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java index 2040b4aaac8..a5f3ed978f8 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/PrintTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=print * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build PrintTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commandfile.PrintTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java index ad4328fc018..1509473fc40 100644 --- a/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/CompileOnlyTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=compileonly * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build CompileOnlyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commands.CompileOnlyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java index 4be5f37998f..86f18c60180 100644 --- a/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/ExcludeTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=exclude * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build ExcludeTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commands.ExcludeTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commands/LogTest.java b/hotspot/test/compiler/compilercontrol/commands/LogTest.java index 2b28436ed1a..4a000fe0a29 100644 --- a/hotspot/test/compiler/compilercontrol/commands/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/LogTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=log * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build LogTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commands.LogTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/commands/PrintTest.java b/hotspot/test/compiler/compilercontrol/commands/PrintTest.java index 62af5e0552b..27313abe197 100644 --- a/hotspot/test/compiler/compilercontrol/commands/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/commands/PrintTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests CompileCommand=print * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build PrintTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.commands.PrintTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java index 12a522d777b..45034afa1ff 100644 --- a/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/CompileOnlyTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests directives to be able to compile only specified methods * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build CompileOnlyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.directives.CompileOnlyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java index cd6d01c65a1..72b30bf8720 100644 --- a/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/ExcludeTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests directives to be able to exclude methods from compilation * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build ExcludeTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.directives.ExcludeTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/directives/LogTest.java b/hotspot/test/compiler/compilercontrol/directives/LogTest.java index cca0b7e6754..f3147caa73e 100644 --- a/hotspot/test/compiler/compilercontrol/directives/LogTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/LogTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests directives to be able to turn on LogCompilation * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build LogTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.directives.LogTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/directives/PrintTest.java b/hotspot/test/compiler/compilercontrol/directives/PrintTest.java index 466f452f48c..204e42bd130 100644 --- a/hotspot/test/compiler/compilercontrol/directives/PrintTest.java +++ b/hotspot/test/compiler/compilercontrol/directives/PrintTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests directives to be able to turn on print_assembly * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build PrintTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.directives.PrintTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java index 937500b996f..474e2bfe36b 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddAndRemoveTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests directives to be able to add and remove directives * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build AddAndRemoveTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.AddAndRemoveTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java index 010cc16661f..ef0df375170 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddCompileOnlyTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to compile only specified methods * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build AddCompileOnlyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.AddCompileOnlyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java index e17d104879c..20282fbd41c 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddExcludeTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to exclude only specified methods * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build AddExcludeTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.AddExcludeTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java index 12610af9777..aaf6abb78f2 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddLogTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to log only specified methods * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build AddLogTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.AddLogTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java b/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java index b3a0379e9ee..054f44d308b 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/AddPrintAssemblyTest.java @@ -27,7 +27,8 @@ * @summary Tests jcmd to be able to add a directive to print assembly * only for specified methods * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build AddPrintAssemblyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.AddPrintAssemblyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java index aaccbc3b58e..25966f9f726 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java @@ -27,7 +27,8 @@ * @ignore 8140405 * @summary Tests jcmd to be able to clear directives added via options * @library /testlibrary /test/lib /compiler/testlibrary ../share / - * @build ClearDirectivesFileStackTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.ClearDirectivesFileStackTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java index 0731e0ba8c2..f9f382da110 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/ClearDirectivesStackTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests clear JCMD command * @library /testlibrary /test/lib /compiler/testlibrary ../share / - * @build ClearDirectivesStackTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.ClearDirectivesStackTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java b/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java index 7e3225f6587..632e79e6c22 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/PrintDirectivesTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a directive to compile only specified methods * @library /testlibrary /test/lib /compiler/testlibrary ../share / - * @build pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.PrintDirectivesTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -80,4 +81,4 @@ public class PrintDirectivesTest extends AbstractTestBase { Scenario scenario = builder.build(); scenario.execute(); } -} \ No newline at end of file +} diff --git a/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java b/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java index a955b47f4fa..326a8a0b4b6 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/StressAddMultiThreadedTest.java @@ -27,7 +27,8 @@ * @summary Tests jcmd to be able to add a lot of huge directive files with * parallel executed jcmds until timeout has reached * @library /testlibrary /test/lib /compiler/testlibrary ../share / - * @build StressAddMultiThreadedTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.StressAddMultiThreadedTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils * compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/compilercontrol/jcmd/StressAddSequentiallyTest.java b/hotspot/test/compiler/compilercontrol/jcmd/StressAddSequentiallyTest.java index 071ecd3ddf4..f8509128321 100644 --- a/hotspot/test/compiler/compilercontrol/jcmd/StressAddSequentiallyTest.java +++ b/hotspot/test/compiler/compilercontrol/jcmd/StressAddSequentiallyTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Tests jcmd to be able to add a lot of huge directives * @library /testlibrary /test/lib /compiler/testlibrary ../share / - * @build StressAddSequentiallyTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.jcmd.StressAddSequentiallyTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils * compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java b/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java index e38ec6e8b83..00ca74d108d 100644 --- a/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java +++ b/hotspot/test/compiler/compilercontrol/matcher/MethodMatcherTest.java @@ -41,7 +41,7 @@ import java.util.regex.Pattern; * @bug 8135068 * @summary Tests CompilerCommand's method matcher * @library /testlibrary /test/lib /compiler/whitebox ../share / - * @build MethodMatcherTest + * @build compiler.compilercontrol.matcher.MethodMatcherTest * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions diff --git a/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java b/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java index 7837b16d480..c175bb04ce3 100644 --- a/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java +++ b/hotspot/test/compiler/compilercontrol/mixed/RandomCommandsTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Randomly generates commands with random types * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build RandomCommandsTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.mixed.RandomCommandsTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java index 951789991f7..3c67043621f 100644 --- a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java +++ b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java @@ -26,7 +26,8 @@ * @bug 8137167 * @summary Randomly generates valid commands with random types * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / - * @build RandomValidCommandsTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox + * @build compiler.compilercontrol.mixed.RandomValidCommandsTest + * pool.sub.* pool.subpack.* sun.hotspot.WhiteBox * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission From ed1d72e964e38efa797a48c7be30a94d60666b74 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Mon, 25 Jan 2016 14:09:28 -1000 Subject: [PATCH 123/212] 8147470: update JVMCI mx extensions Reviewed-by: twisti --- hotspot/.mx.jvmci/mx_jvmci.py | 74 +++++++++++++++++++++++++++++------ hotspot/.mx.jvmci/suite.py | 15 +++++-- 2 files changed, 72 insertions(+), 17 deletions(-) diff --git a/hotspot/.mx.jvmci/mx_jvmci.py b/hotspot/.mx.jvmci/mx_jvmci.py index 097fca7423b..1db4fbb5dcd 100644 --- a/hotspot/.mx.jvmci/mx_jvmci.py +++ b/hotspot/.mx.jvmci/mx_jvmci.py @@ -40,6 +40,8 @@ from mx_unittest import unittest _suite = mx.suite('jvmci') +JVMCI_VERSION = 9 + """ Top level directory of the JDK source workspace. """ @@ -164,7 +166,6 @@ class ExtJDKDeployedDist(JvmciJDKDeployedDist): def __init__(self, name): JvmciJDKDeployedDist.__init__(self, name) - """ The monolithic JVMCI distribution is deployed through use of -Xbootclasspath/p so that it's not necessary to run JDK make after editing JVMCI sources. @@ -193,7 +194,7 @@ To build hotspot and import it into the JDK: "mx make hotspot import-hotspot" # JDK9 must be bootstrapped with a JDK8 compliance = mx.JavaCompliance('8') jdk8 = mx.get_jdk(compliance.exactMatch, versionDescription=compliance.value) - cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--disable-debug-symbols', '--disable-precompiled-headers', + cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--with-native-debug-symbols=none', '--disable-precompiled-headers', '--with-jvm-variants=' + _vm.jvmVariant, '--disable-warnings-as-errors', '--with-boot-jdk=' + jdk8.home] mx.run(cmd, cwd=_jdkSourceRoot) cmd = [mx.gmake_cmd(), 'CONF=' + _vm.debugLevel] @@ -212,7 +213,15 @@ To build hotspot and import it into the JDK: "mx make hotspot import-hotspot" mx.run(cmd, cwd=_jdkSourceRoot) if 'images' in cmd: - _create_jdk_bundle(jdkBuildDir) + jdkImageDir = join(jdkBuildDir, 'images', 'jdk') + + # The OpenJDK build creates an empty cacerts file so copy one from + # the default JDK (which is assumed to be an OracleJDK) + srcCerts = join(mx.get_jdk(tag='default').home, 'jre', 'lib', 'security', 'cacerts') + dstCerts = join(jdkImageDir, 'lib', 'security', 'cacerts') + shutil.copyfile(srcCerts, dstCerts) + + _create_jdk_bundle(jdkBuildDir, _vm.debugLevel, jdkImageDir) def _get_jdk_bundle_arches(): """ @@ -227,15 +236,14 @@ def _get_jdk_bundle_arches(): return ['sparcv9'] mx.abort('Unsupported JDK bundle arch: ' + cpu) -def _create_jdk_bundle(jdkBuildDir): +def _create_jdk_bundle(jdkBuildDir, debugLevel, jdkImageDir): """ Creates a tar.gz JDK archive, an accompanying tar.gz.sha1 file with its SHA1 signature plus symlinks to the archive for non-canonical architecture names. """ - jdkImageDir = join(jdkBuildDir, 'images', 'jdk') arches = _get_jdk_bundle_arches() - jdkTgzPath = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}.tar.gz'.format(_get_openjdk_os(), arches[0])) + jdkTgzPath = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}-{}.tar.gz'.format(debugLevel, _get_openjdk_os(), arches[0])) with mx.Archiver(jdkTgzPath, kind='tgz') as arc: mx.log('Creating ' + jdkTgzPath) for root, _, filenames in os.walk(jdkImageDir): @@ -243,10 +251,6 @@ def _create_jdk_bundle(jdkBuildDir): f = join(root, name) arcname = 'jdk1.9.0/' + os.path.relpath(f, jdkImageDir) arc.zf.add(name=f, arcname=arcname, recursive=False) - # The OpenJDK build creates an empty cacerts file so grab one from - # the default JDK which is assumed to be an OracleJDK - cacerts = join(mx.get_jdk(tag='default').home, 'jre', 'lib', 'security', 'cacerts') - arc.zf.add(name=cacerts, arcname='jdk1.9.0/lib/security/cacerts') with open(jdkTgzPath + '.sha1', 'w') as fp: mx.log('Creating ' + jdkTgzPath + '.sha1') @@ -259,7 +263,7 @@ def _create_jdk_bundle(jdkBuildDir): os.symlink(source, link_name) for arch in arches[1:]: - link_name = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}.tar.gz'.format(_get_openjdk_os(), arch)) + link_name = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}-{}.tar.gz'.format(debugLevel, _get_openjdk_os(), arch)) jdkTgzName = os.path.basename(jdkTgzPath) _create_link(jdkTgzName, link_name) _create_link(jdkTgzName + '.sha1', link_name + '.sha1') @@ -759,6 +763,14 @@ class JVMCI9JDKConfig(mx.JDKConfig): args = ['-Xbootclasspath/p:' + dep.classpath_repr() for dep in _jvmci_bootclasspath_prepends] + args + # Remove JVMCI jars from class path. They are only necessary when + # compiling with a javac from JDK8 or earlier. + cpIndex, cp = mx.find_classpath_arg(args) + if cp: + excluded = frozenset([dist.path for dist in _suite.dists]) + cp = os.pathsep.join([e for e in cp.split(os.pathsep) if e not in excluded]) + args[cpIndex] = cp + jvmciModeArgs = _jvmciModes[_vm.jvmciMode] if jvmciModeArgs: bcpDeps = [jdkDist.dist() for jdkDist in jdkDeployedDists] @@ -814,7 +826,7 @@ def get_jvmci_jdk(debugLevel=None): _jvmci_jdks[debugLevel] = jdk return jdk -class JVMCIJDKFactory(mx.JDKFactory): +class JVMCI9JDKFactory(mx.JDKFactory): def getJDKConfig(self): jdk = get_jvmci_jdk(_vm.debugLevel) return jdk @@ -838,8 +850,9 @@ mx.add_argument('--jdk-jvm-variant', '--vm', action='store', choices=_jdkJvmVari mx.add_argument('--jdk-debug-level', '--vmbuild', action='store', choices=_jdkDebugLevels + sorted(_legacyVmbuilds.viewkeys()), help='the JDK debug level to build/run (default: ' + _vm.debugLevel + ')') mx.add_argument('-I', '--use-jdk-image', action='store_true', help='build/run JDK image instead of exploded JDK') +mx.addJDKFactory(_JVMCI_JDK_TAG, mx.JavaCompliance('9'), JVMCI9JDKFactory()) + def mx_post_parse_cmd_line(opts): - mx.addJDKFactory(_JVMCI_JDK_TAG, mx.JavaCompliance('9'), JVMCIJDKFactory()) mx.set_java_command_default_jdk_tag(_JVMCI_JDK_TAG) jdkTag = mx.get_jdk_option().tag @@ -867,3 +880,38 @@ def mx_post_parse_cmd_line(opts): for jdkDist in jdkDeployedDists: jdkDist.post_parse_cmd_line() + +def _update_JDK9_STUBS_library(): + """ + Sets the "path" and "sha1" attributes of the "JDK9_STUBS" library. + """ + jdk9InternalLib = _suite.suiteDict['libraries']['JDK9_STUBS'] + jarInputDir = join(_suite.get_output_root(), 'jdk9-stubs') + jarPath = join(_suite.get_output_root(), 'jdk9-stubs.jar') + + stubs = [ + ('jdk.internal.misc', 'VM', """package jdk.internal.misc; +public class VM { + public static String getSavedProperty(String key) { + throw new InternalError("should not reach here"); + } +} +""") + ] + + if not exists(jarPath): + sourceFiles = [] + for (package, className, source) in stubs: + sourceFile = join(jarInputDir, package.replace('.', os.sep), className + '.java') + mx.ensure_dir_exists(os.path.dirname(sourceFile)) + with open(sourceFile, 'w') as fp: + fp.write(source) + sourceFiles.append(sourceFile) + jdk = mx.get_jdk(tag='default') + mx.run([jdk.javac, '-d', jarInputDir] + sourceFiles) + mx.run([jdk.jar, 'cf', jarPath, '.'], cwd=jarInputDir) + + jdk9InternalLib['path'] = jarPath + jdk9InternalLib['sha1'] = mx.sha1OfFile(jarPath) + +_update_JDK9_STUBS_library() diff --git a/hotspot/.mx.jvmci/suite.py b/hotspot/.mx.jvmci/suite.py index 3f79b9998c1..28c00818dd7 100644 --- a/hotspot/.mx.jvmci/suite.py +++ b/hotspot/.mx.jvmci/suite.py @@ -1,5 +1,5 @@ suite = { - "mxversion" : "5.5.12", + "mxversion" : "5.6.11", "name" : "jvmci", "url" : "http://openjdk.java.net/projects/graal", "developer" : { @@ -24,7 +24,7 @@ suite = { "defaultLicense" : "GPLv2-CPE", - # This puts mx/ as a sibiling of the JDK build configuration directories + # This puts mx/ as a sibling of the JDK build configuration directories # (e.g., macosx-x86_64-normal-server-release). "outputRoot" : "../build/mx/hotspot", @@ -32,8 +32,6 @@ suite = { "libraries" : { - # ------------- Libraries ------------- - "HCFDIS" : { "urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/hcfdis-3.jar"], "sha1" : "a71247c6ddb90aad4abf7c77e501acc60674ef57", @@ -53,6 +51,13 @@ suite = { "sha1" : "122b87ca88e41a415cf8b523fd3d03b4325134a3", "urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/batik-all-1.7.jar"], }, + + # Stubs for classes introduced in JDK9 that allow compilation with a JDK8 javac and Eclipse. + # The "path" and "sha1" attributes are added when mx_jvmci is loaded + # (see mx_jvmci._update_JDK9_STUBS_library()). + "JDK9_STUBS" : { + "license" : "GPLv2-CPE", + }, }, "projects" : { @@ -163,6 +168,7 @@ suite = { "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", "jdk.vm.ci.services", + "JDK9_STUBS", ], "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "1.8", @@ -298,6 +304,7 @@ suite = { "jdk.vm.ci.hotspot.amd64", "jdk.vm.ci.hotspot.sparc", ], + "exclude" : ["JDK9_STUBS"] }, }, } From d569a595227c6ec79c970bf2d0ce87ec928f023a Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Tue, 26 Jan 2016 10:46:15 +0100 Subject: [PATCH 124/212] 8147876: ciTypeFlow::is_dominated_by() writes outside dominated array CiTypeFlow::is_dominated_by() should use block_count() instead of _methodBlocks->num_blocks(). Reviewed-by: neliasso, vlivanov, kvn --- hotspot/src/share/vm/ci/ciTypeFlow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/ci/ciTypeFlow.cpp b/hotspot/src/share/vm/ci/ciTypeFlow.cpp index a1675d17a14..2edfa7d4abe 100644 --- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp +++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp @@ -2930,7 +2930,7 @@ bool ciTypeFlow::is_dominated_by(int bci, int dom_bci) { } // Dominated[i] is true if block i is dominated by dom_block - int num_blocks = _methodBlocks->num_blocks(); + int num_blocks = block_count(); bool* dominated = NEW_RESOURCE_ARRAY(bool, num_blocks); for (int i = 0; i < num_blocks; ++i) { dominated[i] = true; From b220252b74d8bff91044ddcafd9d88ab6b566629 Mon Sep 17 00:00:00 2001 From: Christian Wimmer Date: Tue, 26 Jan 2016 11:28:54 -1000 Subject: [PATCH 125/212] 8148202: move lookup of Java class and hub from ResolvedJavaType to ConstantReflectionProvider Reviewed-by: twisti --- .../HotSpotConstantReflectionProvider.java | 15 +++++++++++++++ .../hotspot/HotSpotResolvedObjectTypeImpl.java | 10 ---------- .../ci/hotspot/HotSpotResolvedPrimitiveType.java | 10 ---------- .../vm/ci/meta/ConstantReflectionProvider.java | 11 +++++++++++ .../src/jdk/vm/ci/meta/ResolvedJavaType.java | 11 ----------- .../test/compiler/jvmci/code/DataPatchTest.java | 16 ++++++++-------- .../compiler/jvmci/code/SimpleDebugInfoTest.java | 10 +++++----- 7 files changed, 39 insertions(+), 44 deletions(-) diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java index 285994a4994..3b720feb38c 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java @@ -27,6 +27,7 @@ import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import java.lang.reflect.Array; +import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.ConstantReflectionProvider; @@ -355,4 +356,18 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv } return dimensions; } + + @Override + public JavaConstant asJavaClass(ResolvedJavaType type) { + return HotSpotObjectConstantImpl.forObject(((HotSpotResolvedJavaType) type).mirror()); + } + + @Override + public Constant asObjectHub(ResolvedJavaType type) { + if (type instanceof HotSpotResolvedObjectType) { + return ((HotSpotResolvedObjectType) type).klass(); + } else { + throw JVMCIError.unimplemented(); + } + } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java index 65d92b1d8fd..a87e540f7a1 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java @@ -303,16 +303,6 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem return isLeaf() ? this : null; } - @Override - public JavaConstant getJavaClass() { - return HotSpotObjectConstantImpl.forObject(mirror()); - } - - @Override - public Constant getObjectHub() { - return klass(); - } - @Override public AssumptionResult hasFinalizableSubclass() { assert !isArray(); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java index 7a8f3e8a633..b8039190175 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java @@ -109,16 +109,6 @@ public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType return null; } - @Override - public JavaConstant getObjectHub() { - throw JVMCIError.unimplemented(); - } - - @Override - public JavaConstant getJavaClass() { - throw JVMCIError.unimplemented(); - } - @Override public AssumptionResult hasFinalizableSubclass() { return new AssumptionResult<>(false); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java index 33cc2a27ebc..f6e2cbb6a7e 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java @@ -160,4 +160,15 @@ public interface ConstantReflectionProvider { * Gets raw memory access. */ MemoryAccessProvider getMemoryAccessProvider(); + + /** + * Gets the runtime representation of the {@link Class} object of this type. + */ + JavaConstant asJavaClass(ResolvedJavaType type); + + /** + * Gets the runtime representation of the "hub" of this type--that is, the closest part of the + * type representation which is typically stored in the object header. + */ + Constant asObjectHub(ResolvedJavaType type); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java index d46a0fc3dce..3649c267f6b 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java @@ -33,17 +33,6 @@ import jdk.vm.ci.meta.Assumptions.AssumptionResult; * . */ public interface ResolvedJavaType extends JavaType, ModifiersProvider { - /** - * Gets the runtime representation of the Java class object of this type. - */ - JavaConstant getJavaClass(); - - /** - * Gets the runtime representation of the "hub" of this type--that is, the closest part of the - * type representation which is typically stored in the object header. - */ - Constant getObjectHub(); - /** * Checks whether this type has a finalizer method. * diff --git a/hotspot/test/compiler/jvmci/code/DataPatchTest.java b/hotspot/test/compiler/jvmci/code/DataPatchTest.java index b427a783512..af438a306bf 100644 --- a/hotspot/test/compiler/jvmci/code/DataPatchTest.java +++ b/hotspot/test/compiler/jvmci/code/DataPatchTest.java @@ -56,7 +56,7 @@ public class DataPatchTest extends CodeInstallationTest { public void testInlineObject() { test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant c = (HotSpotConstant) type.getJavaClass(); + HotSpotConstant c = (HotSpotConstant) constantReflection.asJavaClass(type); Register ret = asm.emitLoadPointer(c); asm.emitPointerRet(ret); }); @@ -67,7 +67,7 @@ public class DataPatchTest extends CodeInstallationTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedOops); test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant c = (HotSpotConstant) type.getJavaClass(); + HotSpotConstant c = (HotSpotConstant) constantReflection.asJavaClass(type); Register compressed = asm.emitLoadPointer((HotSpotConstant) c.compress()); Register ret = asm.emitUncompressPointer(compressed, HotSpotVMConfig.config().narrowOopBase, HotSpotVMConfig.config().narrowOopShift); asm.emitPointerRet(ret); @@ -78,7 +78,7 @@ public class DataPatchTest extends CodeInstallationTest { public void testDataSectionReference() { test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant c = (HotSpotConstant) type.getJavaClass(); + HotSpotConstant c = (HotSpotConstant) constantReflection.asJavaClass(type); DataSectionReference ref = asm.emitDataItem(c); Register ret = asm.emitLoadPointer(ref); asm.emitPointerRet(ret); @@ -90,7 +90,7 @@ public class DataPatchTest extends CodeInstallationTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedOops); test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant c = (HotSpotConstant) type.getJavaClass(); + HotSpotConstant c = (HotSpotConstant) constantReflection.asJavaClass(type); HotSpotConstant cCompressed = (HotSpotConstant) c.compress(); DataSectionReference ref = asm.emitDataItem(cCompressed); Register compressed = asm.emitLoadNarrowPointer(ref); @@ -103,7 +103,7 @@ public class DataPatchTest extends CodeInstallationTest { public void testInlineMetadata() { test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - Register klass = asm.emitLoadPointer((HotSpotConstant) type.getObjectHub()); + Register klass = asm.emitLoadPointer((HotSpotConstant) constantReflection.asObjectHub(type)); Register ret = asm.emitLoadPointer(klass, HotSpotVMConfig.config().classMirrorOffset); asm.emitPointerRet(ret); }); @@ -114,7 +114,7 @@ public class DataPatchTest extends CodeInstallationTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedClassPointers); test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant hub = (HotSpotConstant) type.getObjectHub(); + HotSpotConstant hub = (HotSpotConstant) constantReflection.asObjectHub(type); Register narrowKlass = asm.emitLoadPointer((HotSpotConstant) hub.compress()); Register klass = asm.emitUncompressPointer(narrowKlass, HotSpotVMConfig.config().narrowKlassBase, HotSpotVMConfig.config().narrowKlassShift); Register ret = asm.emitLoadPointer(klass, HotSpotVMConfig.config().classMirrorOffset); @@ -126,7 +126,7 @@ public class DataPatchTest extends CodeInstallationTest { public void testMetadataInDataSection() { test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant hub = (HotSpotConstant) type.getObjectHub(); + HotSpotConstant hub = (HotSpotConstant) constantReflection.asObjectHub(type); DataSectionReference ref = asm.emitDataItem(hub); Register klass = asm.emitLoadPointer(ref); Register ret = asm.emitLoadPointer(klass, HotSpotVMConfig.config().classMirrorOffset); @@ -139,7 +139,7 @@ public class DataPatchTest extends CodeInstallationTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedClassPointers); test(asm -> { ResolvedJavaType type = metaAccess.lookupJavaType(getConstClass()); - HotSpotConstant hub = (HotSpotConstant) type.getObjectHub(); + HotSpotConstant hub = (HotSpotConstant) constantReflection.asObjectHub(type); HotSpotConstant narrowHub = (HotSpotConstant) hub.compress(); DataSectionReference ref = asm.emitDataItem(narrowHub); Register narrowKlass = asm.emitLoadNarrowPointer(ref); diff --git a/hotspot/test/compiler/jvmci/code/SimpleDebugInfoTest.java b/hotspot/test/compiler/jvmci/code/SimpleDebugInfoTest.java index dffd336d2a8..041a184bc16 100644 --- a/hotspot/test/compiler/jvmci/code/SimpleDebugInfoTest.java +++ b/hotspot/test/compiler/jvmci/code/SimpleDebugInfoTest.java @@ -217,7 +217,7 @@ public class SimpleDebugInfoTest extends DebugInfoTest { public void testConstObject() { ResolvedJavaType type = metaAccess.lookupJavaType(objectOnStack()); DebugInfoCompiler compiler = (asm, values) -> { - values[0] = type.getJavaClass(); + values[0] = constantReflection.asJavaClass(type); return null; }; testObjectOnStack(compiler); @@ -228,7 +228,7 @@ public class SimpleDebugInfoTest extends DebugInfoTest { public void testRegObject() { ResolvedJavaType type = metaAccess.lookupJavaType(objectOnStack()); DebugInfoCompiler compiler = (asm, values) -> { - Register reg = asm.emitLoadPointer((HotSpotConstant) type.getJavaClass()); + Register reg = asm.emitLoadPointer((HotSpotConstant) constantReflection.asJavaClass(type)); values[0] = reg.asValue(target.getLIRKind(JavaKind.Object)); return null; }; @@ -240,7 +240,7 @@ public class SimpleDebugInfoTest extends DebugInfoTest { public void testStackObject() { ResolvedJavaType type = metaAccess.lookupJavaType(objectOnStack()); DebugInfoCompiler compiler = (asm, values) -> { - Register reg = asm.emitLoadPointer((HotSpotConstant) type.getJavaClass()); + Register reg = asm.emitLoadPointer((HotSpotConstant) constantReflection.asJavaClass(type)); values[0] = asm.emitPointerToStack(reg); return null; }; @@ -253,7 +253,7 @@ public class SimpleDebugInfoTest extends DebugInfoTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedOops); ResolvedJavaType type = metaAccess.lookupJavaType(objectOnStack()); DebugInfoCompiler compiler = (asm, values) -> { - HotSpotConstant wide = (HotSpotConstant) type.getJavaClass(); + HotSpotConstant wide = (HotSpotConstant) constantReflection.asJavaClass(type); Register reg = asm.emitLoadPointer((HotSpotConstant) wide.compress()); values[0] = reg.asValue(asm.narrowOopKind); return null; @@ -267,7 +267,7 @@ public class SimpleDebugInfoTest extends DebugInfoTest { Assume.assumeTrue(HotSpotVMConfig.config().useCompressedOops); ResolvedJavaType type = metaAccess.lookupJavaType(objectOnStack()); DebugInfoCompiler compiler = (asm, values) -> { - HotSpotConstant wide = (HotSpotConstant) type.getJavaClass(); + HotSpotConstant wide = (HotSpotConstant) constantReflection.asJavaClass(type); Register reg = asm.emitLoadPointer((HotSpotConstant) wide.compress()); values[0] = asm.emitNarrowPointerToStack(reg); return null; From 272ee0ade83e2e0c1bcbb76ee25daa0cf247897b Mon Sep 17 00:00:00 2001 From: Ed Nevill Date: Tue, 26 Jan 2016 14:04:01 +0000 Subject: [PATCH 126/212] 8148240: aarch64: random infrequent null pointer exceptions in javac Disable fp as an allocatable register Reviewed-by: aph --- hotspot/src/cpu/aarch64/vm/aarch64.ad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index 0dd35270b1d..2b5d3d8838d 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -577,7 +577,7 @@ reg_class no_special_reg32_with_fp( R26 /* R27, */ // heapbase /* R28, */ // thread - R29, // fp + /* R29, */ // fp /* R30, */ // lr /* R31 */ // sp ); @@ -646,7 +646,7 @@ reg_class no_special_reg_with_fp( R26, R26_H, /* R27, R27_H, */ // heapbase /* R28, R28_H, */ // thread - R29, R29_H, // fp + /* R29, R29_H, */ // fp /* R30, R30_H, */ // lr /* R31, R31_H */ // sp ); From 451a576a425eb5e058325c272612714266e23082 Mon Sep 17 00:00:00 2001 From: Alexandre Iline Date: Mon, 8 Feb 2016 18:14:48 -0800 Subject: [PATCH 127/212] 8149391: Fix module dependences in java/util tests Reviewed-by: mchung --- jdk/test/java/util/Arrays/TimSortStackSize2.java | 4 +++- jdk/test/java/util/Calendar/Bug6902861.java | 3 ++- jdk/test/java/util/Calendar/CldrFormatNamesTest.java | 3 ++- jdk/test/java/util/Locale/Bug8001562.java | 3 ++- jdk/test/java/util/Locale/HashCodeTest.java | 3 ++- jdk/test/java/util/Locale/InternationalBAT.java | 4 +++- jdk/test/java/util/Locale/LocaleEnhanceTest.java | 3 ++- jdk/test/java/util/Locale/LocaleTest.java | 3 ++- jdk/test/java/util/Locale/ThaiGov.java | 4 ++-- jdk/test/java/util/ResourceBundle/Bug6359330.java | 3 ++- jdk/test/java/util/ResourceBundle/Control/Bug6530694.java | 3 ++- jdk/test/java/util/Scanner/ScanTest.java | 3 ++- jdk/test/java/util/TimeZone/CLDRDisplayNamesTest.java | 3 ++- .../ConcurrentHashMap/ConcurrentAssociateTest.java | 3 ++- jdk/test/java/util/concurrent/Phaser/Basic.java | 1 + .../java/util/concurrent/locks/LockSupport/ParkLoops.java | 1 + jdk/test/java/util/concurrent/tck/JSR166TestCase.java | 1 + jdk/test/java/util/logging/CustomLogManagerTest.java | 3 ++- jdk/test/java/util/logging/DrainFindDeadlockTest.java | 4 +++- .../LogManager/Configuration/TestConfigurationLock.java | 4 +++- .../LogManager/RootLogger/setLevel/TestRootLoggerLevel.java | 3 ++- jdk/test/java/util/logging/LogManagerAppContextDeadlock.java | 4 +++- jdk/test/java/util/logging/LoggingDeadlock4.java | 3 ++- jdk/test/java/util/logging/LoggingMXBeanTest.java | 5 +++-- .../java/util/logging/RootLogger/RootLevelInConfigFile.java | 3 ++- jdk/test/java/util/logging/SimpleLogManager.java | 3 ++- jdk/test/java/util/logging/TEST.properties | 1 + jdk/test/java/util/logging/TestAppletLoggerContext.java | 3 ++- jdk/test/java/util/logging/TestGetLoggerNPE.java | 3 ++- jdk/test/java/util/logging/TestLogConfigurationDeadLock.java | 4 +++- .../util/logging/TestLogConfigurationDeadLockWithConf.java | 4 +++- jdk/test/java/util/logging/TestLoggerBundleSync.java | 4 +++- jdk/test/java/util/logging/TestLoggerWeakRefLeak.java | 3 ++- .../java/util/logging/TestLoggingWithMainAppContext.java | 4 +++- jdk/test/java/util/logging/TestMainAppContext.java | 3 ++- jdk/test/java/util/prefs/TEST.properties | 1 + jdk/test/java/util/zip/ZipCoding.java | 3 ++- jdk/test/java/util/zip/ZipFile/DeleteTempJar.java | 3 ++- 38 files changed, 81 insertions(+), 35 deletions(-) create mode 100644 jdk/test/java/util/logging/TEST.properties create mode 100644 jdk/test/java/util/prefs/TEST.properties diff --git a/jdk/test/java/util/Arrays/TimSortStackSize2.java b/jdk/test/java/util/Arrays/TimSortStackSize2.java index 420d6bda9b8..c9f1d6d91bb 100644 --- a/jdk/test/java/util/Arrays/TimSortStackSize2.java +++ b/jdk/test/java/util/Arrays/TimSortStackSize2.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,8 @@ * @test * @bug 8072909 * @library /lib/testlibrary /test/lib + * @modules java.management + * java.base/jdk.internal * @build jdk.testlibrary.* * @build TimSortStackSize2 * @run main ClassFileInstaller sun.hotspot.WhiteBox diff --git a/jdk/test/java/util/Calendar/Bug6902861.java b/jdk/test/java/util/Calendar/Bug6902861.java index e8633f3449d..b1aa86fdbd2 100644 --- a/jdk/test/java/util/Calendar/Bug6902861.java +++ b/jdk/test/java/util/Calendar/Bug6902861.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test * @bug 6902861 * @summary Test for a workaround when WEEK_OF_YEAR and YEAR are out of sync. + * @modules jdk.localedata */ import java.util.*; diff --git a/jdk/test/java/util/Calendar/CldrFormatNamesTest.java b/jdk/test/java/util/Calendar/CldrFormatNamesTest.java index bc7ec874e86..4b1588653ef 100644 --- a/jdk/test/java/util/Calendar/CldrFormatNamesTest.java +++ b/jdk/test/java/util/Calendar/CldrFormatNamesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @bug 8004489 8006509 8008577 * @summary Unit test for CLDR FormatData resources * @modules java.base/sun.util.locale.provider + * jdk.localedata * @compile -XDignore.symbol.file CldrFormatNamesTest.java * @run main/othervm -Djava.locale.providers=CLDR CldrFormatNamesTest */ diff --git a/jdk/test/java/util/Locale/Bug8001562.java b/jdk/test/java/util/Locale/Bug8001562.java index 1ff1b50c6a2..1a18ac58a97 100644 --- a/jdk/test/java/util/Locale/Bug8001562.java +++ b/jdk/test/java/util/Locale/Bug8001562.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @bug 8001562 * @summary Verify that getAvailableLocales() in locale sensitive services * classes return compatible set of locales as in JDK7. + * @modules jdk.localedata * @run main Bug8001562 */ diff --git a/jdk/test/java/util/Locale/HashCodeTest.java b/jdk/test/java/util/Locale/HashCodeTest.java index 41a19c30037..8163ca03dc3 100644 --- a/jdk/test/java/util/Locale/HashCodeTest.java +++ b/jdk/test/java/util/Locale/HashCodeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ * @test * @bug 4944561 * @summary Test hashCode() to have less than 10% of hash code conflicts. + * @modules jdk.localedata */ import java.util.*; diff --git a/jdk/test/java/util/Locale/InternationalBAT.java b/jdk/test/java/util/Locale/InternationalBAT.java index b3b576c3964..01789e93c2c 100644 --- a/jdk/test/java/util/Locale/InternationalBAT.java +++ b/jdk/test/java/util/Locale/InternationalBAT.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,8 @@ * @summary Basic acceptance test for international J2RE. Verifies that the * most important locale data and character converters exist and are * minimally functional. + * @modules jdk.localedata + * jdk.charsets * @run main/othervm -Djava.locale.providers=JRE,SPI InternationalBAT */ diff --git a/jdk/test/java/util/Locale/LocaleEnhanceTest.java b/jdk/test/java/util/Locale/LocaleEnhanceTest.java index 7c7779bfcbe..a4a2f1106fc 100644 --- a/jdk/test/java/util/Locale/LocaleEnhanceTest.java +++ b/jdk/test/java/util/Locale/LocaleEnhanceTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,7 @@ import java.util.Set; * @bug 6875847 6992272 7002320 7015500 7023613 7032820 7033504 7004603 * 7044019 8008577 * @summary test API changes to Locale + * @modules jdk.localedata * @compile LocaleEnhanceTest.java * @run main/othervm -Djava.locale.providers=JRE,SPI -esa LocaleEnhanceTest */ diff --git a/jdk/test/java/util/Locale/LocaleTest.java b/jdk/test/java/util/Locale/LocaleTest.java index fad41015c27..90510ce2fda 100644 --- a/jdk/test/java/util/Locale/LocaleTest.java +++ b/jdk/test/java/util/Locale/LocaleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * 4147315 4147317 4147552 4335196 4778440 4940539 5010672 6475525 6544471 6627549 * 6786276 7066203 7085757 8008577 8030696 * @summary test Locales + * @modules jdk.localedata * @run main/othervm -Djava.locale.providers=JRE,SPI LocaleTest */ /* diff --git a/jdk/test/java/util/Locale/ThaiGov.java b/jdk/test/java/util/Locale/ThaiGov.java index 55bdee2e808..5dfe8d15c65 100644 --- a/jdk/test/java/util/Locale/ThaiGov.java +++ b/jdk/test/java/util/Locale/ThaiGov.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,7 +24,7 @@ * @test * @bug 4474409 * @author John O'Conner - * + * @modules jdk.localedata */ import java.util.*; diff --git a/jdk/test/java/util/ResourceBundle/Bug6359330.java b/jdk/test/java/util/ResourceBundle/Bug6359330.java index 7163e843d21..8dd31ad0cb5 100644 --- a/jdk/test/java/util/ResourceBundle/Bug6359330.java +++ b/jdk/test/java/util/ResourceBundle/Bug6359330.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @summary Make sure that getBundle doesn't cause a security error * with a security manager when instantialing RBClassLoader (internal * classloader). + * @modules java.xml * @run main/othervm Bug6359330 */ diff --git a/jdk/test/java/util/ResourceBundle/Control/Bug6530694.java b/jdk/test/java/util/ResourceBundle/Control/Bug6530694.java index 97bb919d6bd..f9e6495fcf3 100644 --- a/jdk/test/java/util/ResourceBundle/Control/Bug6530694.java +++ b/jdk/test/java/util/ResourceBundle/Control/Bug6530694.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ * @bug 6530694 * @summary Checks that sun.util.CoreResourceBundleControl does not apply * to the application provided Swing resources. + * @modules java.desktop * @run main/othervm -Djava.awt.headless=true Bug6530694 */ diff --git a/jdk/test/java/util/Scanner/ScanTest.java b/jdk/test/java/util/Scanner/ScanTest.java index 9f9103d382e..45383f0674a 100644 --- a/jdk/test/java/util/Scanner/ScanTest.java +++ b/jdk/test/java/util/Scanner/ScanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * 8072722 * @summary Basic tests of java.util.Scanner methods * @key randomness + * @modules jdk.localedata * @run main/othervm ScanTest */ diff --git a/jdk/test/java/util/TimeZone/CLDRDisplayNamesTest.java b/jdk/test/java/util/TimeZone/CLDRDisplayNamesTest.java index c5dc4b6fedb..4e092b41a50 100644 --- a/jdk/test/java/util/TimeZone/CLDRDisplayNamesTest.java +++ b/jdk/test/java/util/TimeZone/CLDRDisplayNamesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ /* * @test * @bug 8005471 8008577 8129881 8130845 8136518 + * @modules jdk.localedata * @run main/othervm -Djava.locale.providers=CLDR CLDRDisplayNamesTest * @summary Make sure that localized time zone names of CLDR are used * if specified. diff --git a/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java b/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java index 320cfbe8f9d..35b836f2568 100644 --- a/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java +++ b/jdk/test/java/util/concurrent/ConcurrentHashMap/ConcurrentAssociateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,7 @@ import java.util.stream.Stream; * @run testng/timeout=1200 ConcurrentAssociateTest * @summary Test that association operations, such as put and compute, * place entries in the map + * @modules java.management */ @Test public class ConcurrentAssociateTest { diff --git a/jdk/test/java/util/concurrent/Phaser/Basic.java b/jdk/test/java/util/concurrent/Phaser/Basic.java index 951e22fc0ac..dd6a9e90081 100644 --- a/jdk/test/java/util/concurrent/Phaser/Basic.java +++ b/jdk/test/java/util/concurrent/Phaser/Basic.java @@ -37,6 +37,7 @@ * @key intermittent * @summary Basic tests for Phaser * @author Chris Hegarty + * @modules java.management */ import static java.util.concurrent.TimeUnit.MILLISECONDS; diff --git a/jdk/test/java/util/concurrent/locks/LockSupport/ParkLoops.java b/jdk/test/java/util/concurrent/locks/LockSupport/ParkLoops.java index 1e44e4a5d13..1b098ea953e 100644 --- a/jdk/test/java/util/concurrent/locks/LockSupport/ParkLoops.java +++ b/jdk/test/java/util/concurrent/locks/LockSupport/ParkLoops.java @@ -35,6 +35,7 @@ * @test * @bug 8074773 * @summary Stress test looks for lost unparks + * @modules java.management * @run main/timeout=1200 ParkLoops */ diff --git a/jdk/test/java/util/concurrent/tck/JSR166TestCase.java b/jdk/test/java/util/concurrent/tck/JSR166TestCase.java index 8063047f8b4..69b2c93d0af 100644 --- a/jdk/test/java/util/concurrent/tck/JSR166TestCase.java +++ b/jdk/test/java/util/concurrent/tck/JSR166TestCase.java @@ -36,6 +36,7 @@ /* * @test * @summary JSR-166 tck tests + * @modules java.management * @build * * @run junit/othervm/timeout=1000 -Djsr166.testImplementationDetails=true JSR166TestCase */ diff --git a/jdk/test/java/util/logging/CustomLogManagerTest.java b/jdk/test/java/util/logging/CustomLogManagerTest.java index 8cf5d0115ee..c21cda5b8a8 100644 --- a/jdk/test/java/util/logging/CustomLogManagerTest.java +++ b/jdk/test/java/util/logging/CustomLogManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import sun.util.logging.PlatformLogger; * @summary Add loggers to custom log manager * * @modules java.base/sun.util.logging + * java.logging * @compile -XDignore.symbol.file CustomLogManagerTest.java CustomLogManager.java * @run main/othervm -Djava.util.logging.manager=CustomLogManager CustomLogManagerTest */ diff --git a/jdk/test/java/util/logging/DrainFindDeadlockTest.java b/jdk/test/java/util/logging/DrainFindDeadlockTest.java index 56fd18895be..7bd7b81bd90 100644 --- a/jdk/test/java/util/logging/DrainFindDeadlockTest.java +++ b/jdk/test/java/util/logging/DrainFindDeadlockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,8 @@ import java.util.Map; * @bug 8010939 * @summary check for deadlock between findLogger() and drainLoggerRefQueueBounded() * @author jim.gish@oracle.com + * @modules java.logging + * java.management * @build DrainFindDeadlockTest * @run main/othervm DrainFindDeadlockTest * @key randomness diff --git a/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.java b/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.java index 7799b631f51..04ef1f2788d 100644 --- a/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.java +++ b/jdk/test/java/util/logging/LogManager/Configuration/TestConfigurationLock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,8 @@ import java.util.logging.Logger; * focuses more particularly on potential deadlock in * drainLoggerRefQueueBounded / readConfiguration / reset * todo: add at randomness + * @modules java.logging + * java.management * @run main/othervm TestConfigurationLock * @author danielfuchs */ diff --git a/jdk/test/java/util/logging/LogManager/RootLogger/setLevel/TestRootLoggerLevel.java b/jdk/test/java/util/logging/LogManager/RootLogger/setLevel/TestRootLoggerLevel.java index 1d34511c84d..c3a98fe9630 100644 --- a/jdk/test/java/util/logging/LogManager/RootLogger/setLevel/TestRootLoggerLevel.java +++ b/jdk/test/java/util/logging/LogManager/RootLogger/setLevel/TestRootLoggerLevel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ import java.util.logging.LoggingPermission; * @bug 8026499 * @summary checks that Logger.getLogger("").setLevel() is working correctly. * @modules java.base/sun.util.logging + * java.logging * @build TestRootLoggerLevel * @run main/othervm -Dtest.security=on TestRootLoggerLevel * @run main/othervm -Dtest.security=off TestRootLoggerLevel diff --git a/jdk/test/java/util/logging/LogManagerAppContextDeadlock.java b/jdk/test/java/util/logging/LogManagerAppContextDeadlock.java index 36e0301e3f7..2f1641f49e3 100644 --- a/jdk/test/java/util/logging/LogManagerAppContextDeadlock.java +++ b/jdk/test/java/util/logging/LogManagerAppContextDeadlock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,6 +44,8 @@ import jdk.internal.misc.SharedSecrets; * @summary check that when LogManager is initialized, a deadlock similar * to that described in 8065709 will not occur. * @modules java.base/jdk.internal.misc + * java.logging + * java.management * @run main/othervm LogManagerAppContextDeadlock UNSECURE * @run main/othervm LogManagerAppContextDeadlock SECURE * diff --git a/jdk/test/java/util/logging/LoggingDeadlock4.java b/jdk/test/java/util/logging/LoggingDeadlock4.java index 1fa50d356a2..06769e31338 100644 --- a/jdk/test/java/util/logging/LoggingDeadlock4.java +++ b/jdk/test/java/util/logging/LoggingDeadlock4.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ * @summary Deadlock between LogManager. and Logger.getLogger() * @author Daniel D. Daugherty * @modules java.base/sun.util.logging + * java.logging * @compile -XDignore.symbol.file LoggingDeadlock4.java * @run main/othervm/timeout=15 LoggingDeadlock4 */ diff --git a/jdk/test/java/util/logging/LoggingMXBeanTest.java b/jdk/test/java/util/logging/LoggingMXBeanTest.java index a023aeeb0e7..ec1396e6c11 100644 --- a/jdk/test/java/util/logging/LoggingMXBeanTest.java +++ b/jdk/test/java/util/logging/LoggingMXBeanTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,7 +27,8 @@ * * @summary Basic Test for LoggingMXBean via MBeanServer * @author Ron Mann - * + * @modules java.logging + * java.management * @build LoggingMXBeanTest * @run main LoggingMXBeanTest */ diff --git a/jdk/test/java/util/logging/RootLogger/RootLevelInConfigFile.java b/jdk/test/java/util/logging/RootLogger/RootLevelInConfigFile.java index 9fe785b3ae0..04590871544 100644 --- a/jdk/test/java/util/logging/RootLogger/RootLevelInConfigFile.java +++ b/jdk/test/java/util/logging/RootLogger/RootLevelInConfigFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,6 +43,7 @@ import jdk.internal.misc.SharedSecrets; * @summary Tests that setting .level=FINEST for the root logger in logging * configuration file does work. * @modules java.base/jdk.internal.misc + * java.logging * @run main/othervm RootLevelInConfigFile * * @author danielfuchs diff --git a/jdk/test/java/util/logging/SimpleLogManager.java b/jdk/test/java/util/logging/SimpleLogManager.java index c6e0b48e237..4e3f9d869e9 100644 --- a/jdk/test/java/util/logging/SimpleLogManager.java +++ b/jdk/test/java/util/logging/SimpleLogManager.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import sun.util.logging.PlatformLogger; * logger (see the subclassing information in the Logger class specification) * * @modules java.base/sun.util.logging + * java.logging * @compile -XDignore.symbol.file CustomLogManager.java SimpleLogManager.java * @run main/othervm -Djava.util.logging.manager=SimpleLogManager SimpleLogManager */ diff --git a/jdk/test/java/util/logging/TEST.properties b/jdk/test/java/util/logging/TEST.properties new file mode 100644 index 00000000000..3690ef2a1b5 --- /dev/null +++ b/jdk/test/java/util/logging/TEST.properties @@ -0,0 +1 @@ +modules = java.logging diff --git a/jdk/test/java/util/logging/TestAppletLoggerContext.java b/jdk/test/java/util/logging/TestAppletLoggerContext.java index aa6ee76f5a5..23e38bf2817 100644 --- a/jdk/test/java/util/logging/TestAppletLoggerContext.java +++ b/jdk/test/java/util/logging/TestAppletLoggerContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,6 +43,7 @@ import jdk.internal.misc.SharedSecrets; * LogManager.getLogManager().getLogger * * @modules java.base/jdk.internal.misc + * java.logging * @run main/othervm -Dtest.security=off TestAppletLoggerContext LoadingApplet * @run main/othervm -Dtest.security=on TestAppletLoggerContext LoadingApplet * @run main/othervm -Dtest.security=off TestAppletLoggerContext LoadingMain diff --git a/jdk/test/java/util/logging/TestGetLoggerNPE.java b/jdk/test/java/util/logging/TestGetLoggerNPE.java index c1cbf06834b..6b84d1c3122 100644 --- a/jdk/test/java/util/logging/TestGetLoggerNPE.java +++ b/jdk/test/java/util/logging/TestGetLoggerNPE.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ import jdk.internal.misc.SharedSecrets; * @summary NPE with logging while launching webstart * * @modules java.base/jdk.internal.misc + * java.logging * @build TestGetLoggerNPE * @run main/othervm TestGetLoggerNPE getLogger * @run main/othervm TestGetLoggerNPE getLogManager diff --git a/jdk/test/java/util/logging/TestLogConfigurationDeadLock.java b/jdk/test/java/util/logging/TestLogConfigurationDeadLock.java index 880fa1a9eb4..9679e03f6f5 100644 --- a/jdk/test/java/util/logging/TestLogConfigurationDeadLock.java +++ b/jdk/test/java/util/logging/TestLogConfigurationDeadLock.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,8 @@ import java.util.logging.Logger; * @summary Synchronization issues in Logger and LogManager. This test * focusses more particularly on potential deadlock in * drainLoggerRefQueueBounded / readConfiguration + * @modules java.logging + * java.management * @run main/othervm TestLogConfigurationDeadLock * @author danielfuchs */ diff --git a/jdk/test/java/util/logging/TestLogConfigurationDeadLockWithConf.java b/jdk/test/java/util/logging/TestLogConfigurationDeadLockWithConf.java index 2aa89bc4401..5ec160ae807 100644 --- a/jdk/test/java/util/logging/TestLogConfigurationDeadLockWithConf.java +++ b/jdk/test/java/util/logging/TestLogConfigurationDeadLockWithConf.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,6 +44,8 @@ import java.util.logging.Logger; * @bug 8027670 8029281 * @summary Deadlock in drainLoggerRefQueueBounded / readConfiguration * caused by synchronization issues in Logger and LogManager. + * @modules java.logging + * java.management * @run main/othervm TestLogConfigurationDeadLockWithConf * @author danielfuchs * @key randomness diff --git a/jdk/test/java/util/logging/TestLoggerBundleSync.java b/jdk/test/java/util/logging/TestLoggerBundleSync.java index a4f73c1f5a3..757e4f66a8b 100644 --- a/jdk/test/java/util/logging/TestLoggerBundleSync.java +++ b/jdk/test/java/util/logging/TestLoggerBundleSync.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,6 +53,8 @@ import java.util.logging.Logger; * java/util/logging/Logger/setResourceBundle/TestSetResourceBundle.java. * Note that this is a best effort test. Running it in a loop to * reproduce intermittent issues can be a good idea. + * @modules java.logging + * java.management * @run main/othervm TestLoggerBundleSync * @author danielfuchs */ diff --git a/jdk/test/java/util/logging/TestLoggerWeakRefLeak.java b/jdk/test/java/util/logging/TestLoggerWeakRefLeak.java index 3a14e74074c..b18f5224942 100644 --- a/jdk/test/java/util/logging/TestLoggerWeakRefLeak.java +++ b/jdk/test/java/util/logging/TestLoggerWeakRefLeak.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ import sun.tools.attach.HotSpotVirtualMachine; * @summary Check for WeakReference leak in Logger and anonymous Logger objects * @library /lib/testlibrary * @modules jdk.attach/sun.tools.attach + * java.logging * @build jdk.testlibrary.ProcessTools * @run main/othervm TestLoggerWeakRefLeak Logger * @run main/othervm TestLoggerWeakRefLeak AnonymousLogger diff --git a/jdk/test/java/util/logging/TestLoggingWithMainAppContext.java b/jdk/test/java/util/logging/TestLoggingWithMainAppContext.java index 5489acee22a..fe42bd4b41e 100644 --- a/jdk/test/java/util/logging/TestLoggingWithMainAppContext.java +++ b/jdk/test/java/util/logging/TestLoggingWithMainAppContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,8 @@ import javax.imageio.ImageIO; * @summary Test that the default user context is used when in the main * application context. This test must not be run in same VM or agent * VM mode: it would not test the intended behavior. + * @modules java.desktop + * java.logging * @run main/othervm TestLoggingWithMainAppContext */ public class TestLoggingWithMainAppContext { diff --git a/jdk/test/java/util/logging/TestMainAppContext.java b/jdk/test/java/util/logging/TestMainAppContext.java index 622600c76cb..bde3ef26430 100644 --- a/jdk/test/java/util/logging/TestMainAppContext.java +++ b/jdk/test/java/util/logging/TestMainAppContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ import sun.awt.SunToolkit; * @summary checks that calling getLogger() from a Thread whose ThreadGroup is * a child of the main root group doesn't throw an exception. * @modules java.desktop/sun.awt + * java.logging * @build TestMainAppContext * @run main/othervm TestMainAppContext * @author danielfuchs diff --git a/jdk/test/java/util/prefs/TEST.properties b/jdk/test/java/util/prefs/TEST.properties new file mode 100644 index 00000000000..79510a0349f --- /dev/null +++ b/jdk/test/java/util/prefs/TEST.properties @@ -0,0 +1 @@ +modules = java.prefs diff --git a/jdk/test/java/util/zip/ZipCoding.java b/jdk/test/java/util/zip/ZipCoding.java index 281df21a204..ae5d78ab4ad 100644 --- a/jdk/test/java/util/zip/ZipCoding.java +++ b/jdk/test/java/util/zip/ZipCoding.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,6 +25,7 @@ * @test * @bug 4244499 4532049 4700978 4820807 4980042 * @summary Test ZipInputStream, ZipOutputStream and ZipFile with non-UTF8 encoding + * @modules jdk.charsets */ import java.io.*; diff --git a/jdk/test/java/util/zip/ZipFile/DeleteTempJar.java b/jdk/test/java/util/zip/ZipFile/DeleteTempJar.java index ae071d82804..8881b04008d 100644 --- a/jdk/test/java/util/zip/ZipFile/DeleteTempJar.java +++ b/jdk/test/java/util/zip/ZipFile/DeleteTempJar.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ @summary Make sure URL-downloaded jar files (jar_cache files) will be deleted when VM exits. + @modules jdk.httpserver @build DeleteTempJar @run shell deletetempjar.sh */ From 1377939c5dc801b3311b69f021bdaa86b249cf23 Mon Sep 17 00:00:00 2001 From: Ramanand Patil Date: Tue, 9 Feb 2016 11:17:28 +0530 Subject: [PATCH 128/212] 8148570: TzdbZoneRulesCompiler.java throws Null Pointer Exception While Compiling and building TZDB data file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While getting value from DayOfWeek, -1 is returned if the DayOfWeek is null. The reason to return “-1” being, the same value is checked later while getting day-of-week byte (dowbyte) at line no. 251, ZoneRules.java. Reviewed-by: rriggs, aefimov --- jdk/make/src/classes/build/tools/tzdb/ZoneRules.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/make/src/classes/build/tools/tzdb/ZoneRules.java b/jdk/make/src/classes/build/tools/tzdb/ZoneRules.java index 4d01d3ac5b6..25d7cb7ac09 100644 --- a/jdk/make/src/classes/build/tools/tzdb/ZoneRules.java +++ b/jdk/make/src/classes/build/tools/tzdb/ZoneRules.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -232,7 +232,7 @@ final class ZoneRules { static void writeRule(ZoneOffsetTransitionRule rule, DataOutput out) throws IOException { int month = rule.getMonth().getValue(); byte dom = (byte)rule.getDayOfMonthIndicator(); - int dow = rule.getDayOfWeek().getValue(); + int dow = (rule.getDayOfWeek() == null ? -1 : rule.getDayOfWeek().getValue()); LocalTime time = rule.getLocalTime(); boolean timeEndOfDay = rule.isMidnightEndOfDay(); TimeDefinition timeDefinition = rule.getTimeDefinition(); From 2d836a55954b9d5a71cae05cc33cf48ad0adc93d Mon Sep 17 00:00:00 2001 From: Ramanand Patil Date: Tue, 9 Feb 2016 11:57:57 +0530 Subject: [PATCH 129/212] 8148446: (tz) Support tzdata2016a Reviewed-by: okutsu, aefimov --- jdk/make/data/tzdata/VERSION | 2 +- jdk/make/data/tzdata/asia | 24 ++++++-- jdk/make/data/tzdata/backward | 1 + jdk/make/data/tzdata/europe | 15 ++++- jdk/make/data/tzdata/northamerica | 58 +++++++++---------- jdk/make/data/tzdata/zone.tab | 5 +- .../sun/util/resources/TimeZoneNames.java | 18 +++--- .../util/resources/de/TimeZoneNames_de.java | 17 +++--- .../util/resources/es/TimeZoneNames_es.java | 17 +++--- .../util/resources/fr/TimeZoneNames_fr.java | 17 +++--- .../util/resources/it/TimeZoneNames_it.java | 17 +++--- .../util/resources/ja/TimeZoneNames_ja.java | 17 +++--- .../util/resources/ko/TimeZoneNames_ko.java | 17 +++--- .../resources/pt/BR/TimeZoneNames_pt_BR.java | 17 +++--- .../util/resources/sv/TimeZoneNames_sv.java | 17 +++--- .../resources/zh/CN/TimeZoneNames_zh_CN.java | 17 +++--- .../resources/zh/TW/TimeZoneNames_zh_TW.java | 17 +++--- jdk/test/sun/util/calendar/zi/tzdata/VERSION | 2 +- jdk/test/sun/util/calendar/zi/tzdata/asia | 24 ++++++-- jdk/test/sun/util/calendar/zi/tzdata/backward | 1 + jdk/test/sun/util/calendar/zi/tzdata/europe | 15 ++++- .../sun/util/calendar/zi/tzdata/northamerica | 58 +++++++++---------- jdk/test/sun/util/calendar/zi/tzdata/zone.tab | 5 +- 23 files changed, 218 insertions(+), 180 deletions(-) diff --git a/jdk/make/data/tzdata/VERSION b/jdk/make/data/tzdata/VERSION index 63a2e5d56d5..55966f28162 100644 --- a/jdk/make/data/tzdata/VERSION +++ b/jdk/make/data/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2015g +tzdata2016a diff --git a/jdk/make/data/tzdata/asia b/jdk/make/data/tzdata/asia index b3adb9616ee..056a5f9c552 100644 --- a/jdk/make/data/tzdata/asia +++ b/jdk/make/data/tzdata/asia @@ -897,6 +897,15 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 9:00 - TLT # India + +# From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic +# http://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/ +# (2015-12-22): +# In January 1906, several thousand cotton-mill workers rioted on the +# outskirts of Bombay.... They were protesting the proposed abolition of +# local time in favor of Indian Standard Time.... Journalists called this +# dispute the "Battle of the Clocks." It lasted nearly half a century. + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata 5:53:20 - HMT 1941 Oct # Howrah Mean Time? @@ -1107,8 +1116,15 @@ Rule Iran 2032 2033 - Mar 21 0:00 1:00 D Rule Iran 2032 2033 - Sep 21 0:00 0 S Rule Iran 2034 2035 - Mar 22 0:00 1:00 D Rule Iran 2034 2035 - Sep 22 0:00 0 S -Rule Iran 2036 2037 - Mar 21 0:00 1:00 D -Rule Iran 2036 2037 - Sep 21 0:00 0 S +# +# The following rules are approximations starting in the year 2038. +# These are the best post-2037 approximations available, given the +# restrictions of a single rule using a Gregorian-based data format. +# At some point this table will need to be extended, though quite +# possibly Iran will change the rules first. +Rule Iran 2036 max - Mar 21 0:00 1:00 D +Rule Iran 2036 max - Sep 21 0:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 3:25:44 - TMT 1946 # Tehran Mean Time @@ -2134,8 +2150,8 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 # http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Pakistan 2002 only - Apr Sun>=2 0:01 1:00 S -Rule Pakistan 2002 only - Oct Sun>=2 0:01 0 - +Rule Pakistan 2002 only - Apr Sun>=2 0:00 1:00 S +Rule Pakistan 2002 only - Oct Sun>=2 0:00 0 - Rule Pakistan 2008 only - Jun 1 0:00 1:00 S Rule Pakistan 2008 2009 - Nov 1 0:00 0 - Rule Pakistan 2009 only - Apr 15 0:00 1:00 S diff --git a/jdk/make/data/tzdata/backward b/jdk/make/data/tzdata/backward index 3c845cfc01c..83527051395 100644 --- a/jdk/make/data/tzdata/backward +++ b/jdk/make/data/tzdata/backward @@ -46,6 +46,7 @@ Link America/Argentina/Mendoza America/Mendoza Link America/Toronto America/Montreal Link America/Rio_Branco America/Porto_Acre Link America/Argentina/Cordoba America/Rosario +Link America/Tijuana America/Santa_Isabel Link America/Denver America/Shiprock Link America/Port_of_Spain America/Virgin Link Pacific/Auckland Antarctica/South_Pole diff --git a/jdk/make/data/tzdata/europe b/jdk/make/data/tzdata/europe index 41987bd1e66..267992150ce 100644 --- a/jdk/make/data/tzdata/europe +++ b/jdk/make/data/tzdata/europe @@ -2616,13 +2616,20 @@ Zone Asia/Irkutsk 6:57:05 - LMT 1880 # Note: Effective 2008-03-01, (75) Chita Oblast and (80) Agin-Buryat # Autonomous Okrug merged to form (92, RU-ZAB) Zabaykalsky Krai. +# From Alexander Krivenyshev (2016-01-02): +# [The] time zone in the Trans-Baikal Territory (Zabaykalsky Krai) - +# Asia/Chita [is changing] from UTC+8 to UTC+9. Effective date will +# be March 27, 2016 at 2:00am.... +# http://publication.pravo.gov.ru/Document/View/000120151230010 + Zone Asia/Chita 7:33:52 - LMT 1919 Dec 15 8:00 - YAKT 1930 Jun 21 # Yakutsk Time 9:00 Russia YAK%sT 1991 Mar 31 2:00s 8:00 Russia YAK%sT 1992 Jan 19 2:00s 9:00 Russia YAK%sT 2011 Mar 27 2:00s 10:00 - YAKT 2014 Oct 26 2:00s - 8:00 - IRKT + 8:00 - IRKT 2016 Mar 27 2:00 + 9:00 - YAKT # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29): @@ -3177,6 +3184,12 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment. # It's officially announced now by the Ministry of Energy. # Turkey delays winter time to 8th of November 04:00 # http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 +# +# From BBC News (2015-10-25): +# Confused Turks are asking "what's the time?" after automatic clocks defied a +# government decision ... "For the next two weeks #Turkey is on EEST... Erdogan +# Engineered Standard Time," said Twitter user @aysekarahasan. +# http://www.bbc.com/news/world-europe-34631326 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S diff --git a/jdk/make/data/tzdata/northamerica b/jdk/make/data/tzdata/northamerica index 0e8b4fa975a..e56fd895d10 100644 --- a/jdk/make/data/tzdata/northamerica +++ b/jdk/make/data/tzdata/northamerica @@ -348,6 +348,16 @@ Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03:58 # Statue 175 closer in synch with the US Congress' intent.... # http://www.legis.state.wi.us/2007/data/acts/07Act3.pdf +# From an email administrator of the City of Fort Pierre, SD (2015-12-21): +# Fort Pierre is technically located in the Mountain time zone as is +# the rest of Stanley County. Most of Stanley County and Fort Pierre +# uses the Central time zone due to doing most of their business in +# Pierre so it simplifies schedules. I have lived in Stanley County +# all my life and it has been that way since I can remember. (43 years!) +# +# From Paul Eggert (2015-12-25): +# Assume this practice predates 1970, so Fort Pierre can use America/Chicago. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER Rule Chicago 1920 only - Jun 13 2:00 1:00 D Rule Chicago 1920 1921 - Oct lastSun 2:00 0 S @@ -504,6 +514,12 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02 # For lack of better information, assume that Metlakatla's # abandonment of use of daylight saving resulted from the 1983 vote. +# From Steffen Thorsen (2015-11-09): +# It seems Metlakatla did go off PST on Sunday, November 1, changing +# their time to AKST and are going to follow Alaska's DST, switching +# between AKST and AKDT from now on.... +# http://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/ + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Juneau 15:02:19 - LMT 1867 Oct 18 -8:57:41 - LMT 1900 Aug 20 12:00 @@ -529,7 +545,8 @@ Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18 -8:00 US P%sT 1946 -8:00 - PST 1969 -8:00 US P%sT 1983 Oct 30 2:00 - -8:00 - PST + -8:00 - PST 2015 Nov 1 2:00 + -9:00 US AK%sT Zone America/Yakutat 14:41:05 - LMT 1867 Oct 18 -9:18:55 - LMT 1900 Aug 20 12:00 -9:00 - YST 1942 @@ -2610,25 +2627,6 @@ Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 0:11:56 -8:00 US P%sT 2002 Feb 20 -8:00 Mexico P%sT 2010 -8:00 US P%sT -# Baja California (away from US border) -Zone America/Santa_Isabel -7:39:28 - LMT 1922 Jan 1 0:20:32 - -7:00 - MST 1924 - -8:00 - PST 1927 Jun 10 23:00 - -7:00 - MST 1930 Nov 15 - -8:00 - PST 1931 Apr 1 - -8:00 1:00 PDT 1931 Sep 30 - -8:00 - PST 1942 Apr 24 - -8:00 1:00 PWT 1945 Aug 14 23:00u - -8:00 1:00 PPT 1945 Nov 12 # Peace - -8:00 - PST 1948 Apr 5 - -8:00 1:00 PDT 1949 Jan 14 - -8:00 - PST 1954 - -8:00 CA P%sT 1961 - -8:00 - PST 1976 - -8:00 US P%sT 1996 - -8:00 Mexico P%sT 2001 - -8:00 US P%sT 2002 Feb 20 - -8:00 Mexico P%sT # From Paul Eggert (2006-03-22): # Formerly there was an America/Ensenada zone, which differed from # America/Tijuana only in that it did not observe DST from 1976 @@ -2641,6 +2639,13 @@ Zone America/Santa_Isabel -7:39:28 - LMT 1922 Jan 1 0:20:32 # other than America/Tijuana for Baja, but it's not clear yet what its # name or contents should be. # +# From Paul Eggert (2015-10-08): +# Formerly there was an America/Santa_Isabel zone, but this appears to +# have come from a misreading of +# http://dof.gob.mx/nota_detalle.php?codigo=5127480&fecha=06/01/2010 +# It has been moved to the 'backward' file. +# +# # Revillagigedo Is # no information @@ -2715,17 +2720,7 @@ Zone Atlantic/Bermuda -4:19:18 - LMT 1930 Jan 1 2:00 # Hamilton -4:00 US A%sT # Cayman Is - -# From Paul Eggert (2015-05-15): -# The Cayman government has decided to introduce DST in 2016, the idea being -# to keep in sync with New York. The legislation hasn't passed but the change -# seems quite likely. See: Meade B. Cayman 27. -# http://www.cayman27.com.ky/2015/05/15/clock-ticks-toward-daylight-saving-time-in-cayman - -Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown - -5:07:11 - KMT 1912 Feb # Kingston Mean Time - -5:00 - EST 2016 - -5:00 US E%sT +# See America/Panama. # Costa Rica @@ -3248,6 +3243,7 @@ Zone America/Managua -5:45:08 - LMT 1890 Zone America/Panama -5:18:08 - LMT 1890 -5:19:36 - CMT 1908 Apr 22 # Colón Mean Time -5:00 - EST +Link America/Panama America/Cayman # Puerto Rico # There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'. diff --git a/jdk/make/data/tzdata/zone.tab b/jdk/make/data/tzdata/zone.tab index 63d1fddf6b9..51aaf775dee 100644 --- a/jdk/make/data/tzdata/zone.tab +++ b/jdk/make/data/tzdata/zone.tab @@ -306,8 +306,7 @@ MX +2313-10625 America/Mazatlan Mountain Time - S Baja, Nayarit, Sinaloa MX +2838-10605 America/Chihuahua Mexican Mountain Time - Chihuahua away from US border MX +2934-10425 America/Ojinaga US Mountain Time - Chihuahua near US border MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora -MX +3232-11701 America/Tijuana US Pacific Time - Baja California near US border -MX +3018-11452 America/Santa_Isabel Mexican Pacific Time - Baja California away from US border +MX +3232-11701 America/Tijuana US Pacific Time - Baja California state MX +2048-10515 America/Bahia_Banderas Mexican Central Time - Bahia de Banderas MY +0310+10142 Asia/Kuala_Lumpur peninsular Malaysia MY +0133+11020 Asia/Kuching Sabah & Sarawak @@ -437,10 +436,10 @@ US +394421-1045903 America/Denver Mountain Time US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona (except Navajo) US +340308-1181434 America/Los_Angeles Pacific Time -US +550737-1313435 America/Metlakatla Pacific Standard Time - Annette Island, Alaska US +611305-1495401 America/Anchorage Alaska Time US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle US +571035-1351807 America/Sitka Alaska Time - southeast Alaska panhandle +US +550737-1313435 America/Metlakatla Alaska Time - Annette Island US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck US +643004-1652423 America/Nome Alaska Time - west Alaska US +515248-1763929 America/Adak Aleutian Islands diff --git a/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java b/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java index d0b8197fb9e..5722da9d9ed 100644 --- a/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java +++ b/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -275,6 +275,9 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { String XJT[] = new String[] {"Xinjiang Standard Time", "XJT", "Xinjiang Daylight Time", "XJDT", "Xinjiang Time", "XJT"}; + String YAKT[] = new String[] {"Yakutsk Time", "YAKT", + "Yakutsk Summer Time", "YAKST", + "Yakutsk Time", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -486,7 +489,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Pierre & Miquelon Standard Time", "PMST", "Pierre & Miquelon Daylight Time", "PMDT", @@ -607,7 +610,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { "Brunei Summer Time", "BNST", "Brunei Time", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Choibalsan Time", "CHOT", "Choibalsan Summer Time", "CHOST", "Choibalsan Time", "CHOT"}}, @@ -648,10 +651,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Khandyga Time", "YAKT", - "Khandyga Summer Time", "YAKST", - "Khandyga Time", "YAKT"}}, - + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -717,9 +717,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle { {"Asia/Vladivostok", new String[] {"Vladivostok Time", "VLAT", "Vladivostok Summer Time", "VLAST", "Vladivostok Time", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Yakutsk Time", "YAKT", - "Yakutsk Summer Time", "YAKST", - "Yakutsk Time", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Yekaterinburg Time", "YEKT", "Yekaterinburg Summer Time", "YEKST", "Yekaterinburg Time", "YEKT"}}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/de/TimeZoneNames_de.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/de/TimeZoneNames_de.java index 6a594cf0199..8fa22f926f5 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/de/TimeZoneNames_de.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/de/TimeZoneNames_de.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -276,6 +276,9 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { String XJT[] = new String[] {"Chinesische Normalzeit", "XJT", "Chinesische Sommerzeit", "XJDT", "Zeitzone f\u00FCr China", "XJT"}; + String YAKT[] = new String[] {"Jakutsk Zeit", "YAKT", + "Jakutsk Sommerzeit", "YAKST", + "Jakutsk Zeit", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -487,7 +490,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Pierre & Miquelon Normalzeit", "PMST", "Pierre & Miquelon Sommerzeit", "PMDT", @@ -608,7 +611,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { "Brunei Sommerzeit", "BNST", "Brunei Zeit", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Choibalsan Zeit", "CHOT", "Choibalsan Sommerzeit", "CHOST", "Choibalsan Zeit", "CHOT"}}, @@ -649,9 +652,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Chandyga Zeit", "YAKT", - "Chandyga Sommerzeit", "YAKST", - "Chandyga Zeit", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -717,9 +718,7 @@ public final class TimeZoneNames_de extends TimeZoneNamesBundle { {"Asia/Vladivostok", new String[] {"Wladiwostok Zeit", "VLAT", "Wladiwostok Sommerzeit", "VLAST", "Wladiwostok Zeit", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Jakutsk Zeit", "YAKT", - "Jakutsk Sommerzeit", "YAKST", - "Jakutsk Zeit", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Jekaterinburger Zeit", "YEKT", "Jekaterinburger Sommerzeit", "YEKST", "Jekaterinburger Zeit", "YEKT"}}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/es/TimeZoneNames_es.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/es/TimeZoneNames_es.java index ef20bd1a320..c20c02e055a 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/es/TimeZoneNames_es.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/es/TimeZoneNames_es.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -276,6 +276,9 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { String XJT[] = new String[] {"Hora est\u00e1ndar de China", "XJT", "Hora de verano de China", "XJDT", "Hora de China", "XJT"}; + String YAKT[] = new String[] {"Hora de Yakutsk", "YAKT", + "Hora de verano de Yakutsk", "YAKST", + "Hora de Yakutsk", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -487,7 +490,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Hora est\u00e1ndar de Pierre & Miquelon", "PMST", "Hora de verano de Pierre & Miquelon", "PMDT", @@ -608,7 +611,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { "Hora de verano de Brunei", "BNST", "Hora de Brunei", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Hora de Choibalsan", "CHOT", "Hora de verano de Choibalsan", "CHOST", "Hora de Choibalsan", "CHOT"}}, @@ -649,9 +652,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Hora de Khandyga", "YAKT", - "Hora de verano de Khandyga", "YAKST", - "Hora de Khandyga", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -717,9 +718,7 @@ public final class TimeZoneNames_es extends TimeZoneNamesBundle { {"Asia/Vladivostok", new String[] {"Hora de Vladivostok", "VLAT", "Hora de verano de Vladivostok", "VLAST", "Hora de Vladivostok", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Hora de Yakutsk", "YAKT", - "Hora de verano de Yakutsk", "YAKST", - "Hora de Yakutsk", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Hora de Ekaterinburgo", "YEKT", "Hora de verano de Ekaterinburgo", "YEKST", "Hora de Ekaterinburgo", "YEKT"}}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java index f22b27afcbc..3d812007a75 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/fr/TimeZoneNames_fr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -276,6 +276,9 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { String XJT[] = new String[] {"Heure normale de Chine", "XJT", "Heure avanc\u00e9e de Chine", "XJDT", "Chine", "XJT"}; + String YAKT[] = new String[] {"Heure du Iakoutsk", "YAKT", + "Heure d'\u00e9t\u00e9 du Iakoutsk", "YAKST", + "Heure du Iakoutsk", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -487,7 +490,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Heure normale de Saint-Pierre et Miquelon", "PMST", "Heure avanc\u00e9e de Saint-Pierre et Miquelon", "PMDT", @@ -608,7 +611,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { "Heure d'\u00e9t\u00e9 du Brunei", "BNST", "Heure du Brunei", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Heure de Choibalsan", "CHOT", "Heure d'\u00e9t\u00e9 de Choibalsan", "CHOST", "Heure de Choibalsan", "CHOT"}}, @@ -649,9 +652,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Heure de Khandyga", "YAKT", - "Heure d'\u00E9t\u00E9 de Khandyga", "YAKST", - "Heure de Khandyga", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -717,9 +718,7 @@ public final class TimeZoneNames_fr extends TimeZoneNamesBundle { {"Asia/Vladivostok", new String[] {"Heure de Vladivostok", "VLAT", "Heure d'\u00e9t\u00e9 de Vladivostok", "VLAST", "Heure de Vladivostok", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Heure du Iakoutsk", "YAKT", - "Heure d'\u00e9t\u00e9 du Iakoutsk", "YAKST", - "Heure du Iakoutsk", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Heure de Yekaterinburg", "YEKT", "Heure d'\u00e9t\u00e9 de Yekaterinburg", "YEKST", "Heure de Yekaterinburg", "YEKT"}}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/it/TimeZoneNames_it.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/it/TimeZoneNames_it.java index 311ceea07cf..33350c43bfa 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/it/TimeZoneNames_it.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/it/TimeZoneNames_it.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -276,6 +276,9 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { String XJT[] = new String[] {"Ora solare della Cina", "XJT", "Ora legale della Cina", "XJDT", "Ora Cina", "XJT"}; + String YAKT[] = new String[] {"Ora di Jakutsk", "YAKT", + "Ora estiva di Jakutsk", "YAKST", + "Ora di Yakutsk", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -487,7 +490,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Ora solare di Saint-Pierre e Miquelon", "PMST", "Ora legale di Saint-Pierre e Miquelon", "PMDT", @@ -608,7 +611,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { "Ora estiva del Brunei", "BNST", "Ora del Brunei", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Ora di Choibalsan", "CHOT", "Ora estiva di Choibalsan", "CHOST", "Ora di Choibalsan", "CHOT"}}, @@ -650,9 +653,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, {"Asia/Kolkata", IST}, - {"Asia/Khandyga", new String[] {"Ora di Khandyga", "YAKT", - "Ora estiva di Khandyga", "YAKST", - "Ora di Khandyga", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, {"Asia/Kuching", MYT}, @@ -717,9 +718,7 @@ public final class TimeZoneNames_it extends TimeZoneNamesBundle { {"Asia/Vladivostok", new String[] {"Ora di Vladivostok", "VLAT", "Ora estiva di Vladivostok", "VLAST", "Ora di Vladivostok", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Ora di Jakutsk", "YAKT", - "Ora estiva di Jakutsk", "YAKST", - "Ora di Yakutsk", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Ora di Ekaterinburg", "YEKT", "Ora estiva di Ekaterinburg", "YEKST", "Ora di Ekaterinburg", "YEKT"}}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java index 9f6dd7e8aa8..57a3fb7bddf 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/ja/TimeZoneNames_ja.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -276,6 +276,9 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { String XJT[] = new String[] {"\u4e2d\u56fd\u6a19\u6e96\u6642", "XJT", "\u4e2d\u56fd\u590f\u6642\u9593", "XJDT", "\u4E2D\u56FD\u6642\u9593", "XJT"}; + String YAKT[] = new String[] {"\u30e4\u30af\u30fc\u30c4\u30af\u6642\u9593", "YAKT", + "\u30e4\u30af\u30fc\u30c4\u30af\u590f\u6642\u9593", "YAKST", + "\u30E4\u30AF\u30FC\u30C4\u30AF\u6642\u9593", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -487,7 +490,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"\u30b5\u30f3\u30d4\u30a8\u30fc\u30eb\u30fb\u30df\u30af\u30ed\u30f3\u8af8\u5cf6\u6a19\u6e96\u6642", "PMST", "\u30b5\u30f3\u30d4\u30a8\u30fc\u30eb\u30fb\u30df\u30af\u30ed\u30f3\u8af8\u5cf6\u590f\u6642\u9593", "PMDT", @@ -608,7 +611,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { "\u30d6\u30eb\u30cd\u30a4\u590f\u6642\u9593", "BNST", "\u30D6\u30EB\u30CD\u30A4\u6642\u9593", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"\u30c1\u30e7\u30a4\u30d0\u30eb\u30b5\u30f3\u6642\u9593", "CHOT", "\u30c1\u30e7\u30a4\u30d0\u30eb\u30b5\u30f3\u590f\u6642\u9593", "CHOST", "\u30C1\u30E7\u30A4\u30D0\u30EB\u30B5\u30F3\u6642\u9593", "CHOT"}}, @@ -649,9 +652,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"\u30CF\u30F3\u30C9\u30A5\u30A4\u30AC\u6642\u9593", "YAKT", - "\u30CF\u30F3\u30C9\u30A5\u30A4\u30AC\u590F\u6642\u9593", "YAKST", - "\u30CF\u30F3\u30C9\u30A5\u30A4\u30AC\u6642\u9593", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -717,9 +718,7 @@ public final class TimeZoneNames_ja extends TimeZoneNamesBundle { {"Asia/Vladivostok", new String[] {"\u30a6\u30e9\u30b8\u30aa\u30b9\u30c8\u30af\u6642\u9593", "VLAT", "\u30a6\u30e9\u30b8\u30aa\u30b9\u30c8\u30af\u590f\u6642\u9593", "VLAST", "\u30A6\u30E9\u30B8\u30AA\u30B9\u30C8\u30AF\u6642\u9593", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"\u30e4\u30af\u30fc\u30c4\u30af\u6642\u9593", "YAKT", - "\u30e4\u30af\u30fc\u30c4\u30af\u590f\u6642\u9593", "YAKST", - "\u30E4\u30AF\u30FC\u30C4\u30AF\u6642\u9593", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"\u30a8\u30ab\u30c6\u30ea\u30f3\u30d6\u30eb\u30b0\u6642\u9593", "YEKT", "\u30a8\u30ab\u30c6\u30ea\u30f3\u30d6\u30eb\u30b0\u590f\u6642\u9593", "YEKST", "\u30A8\u30AB\u30C6\u30EA\u30F3\u30D6\u30EB\u30AF\u6642\u9593", "YEKT"}}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java index 7432190e7a9..d17154b3498 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/ko/TimeZoneNames_ko.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -276,6 +276,9 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { String XJT[] = new String[] {"\uc911\uad6d \ud45c\uc900\uc2dc", "XJT", "\uc911\uad6d \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "XJDT", "\uC911\uAD6D \uD45C\uC900\uC2DC", "XJT"}; + String YAKT[] = new String[] {"\uc57c\uce20\ud06c \uc2dc\uac04", "YAKT", + "\uc57c\uce20\ud06c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "YAKST", + "\uC57C\uCFE0\uCE20\uD06C \uD45C\uC900\uC2DC", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -487,7 +490,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"\ud53c\uc5d0\ub974 \ubbf8\ud06c\ub860 \ud45c\uc900\uc2dc", "PMST", "\ud53c\uc5d0\ub974 \ubbf8\ud06c\ub860 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "PMDT", @@ -608,7 +611,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { "\ube0c\ub8e8\ub098\uc774 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "BNST", "\uBE0C\uB8E8\uB098\uC774 \uD45C\uC900\uC2DC", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Choibalsan \uc2dc\uac04", "CHOT", "Choibalsan \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "CHOST", "\uCD08\uC774\uBC1C\uC0B0 \uD45C\uC900\uC2DC", "CHOT"}}, @@ -649,9 +652,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"\uD55C\uB514\uAC00 \uD45C\uC900\uC2DC", "YAKT", - "\uD55C\uB514\uAC00 \uC77C\uAD11 \uC808\uC57D \uC2DC\uAC04", "YAKST", - "\uD55C\uB514\uAC00 \uD45C\uC900\uC2DC", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -717,9 +718,7 @@ public final class TimeZoneNames_ko extends TimeZoneNamesBundle { {"Asia/Vladivostok", new String[] {"\ube14\ub77c\ub514\ubcf4\uc2a4\ud1a1 \uc2dc\uac04", "VLAT", "\ube14\ub77c\ub514\ubcf4\uc2a4\ud1a1 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "VLAST", "\uBE14\uB77C\uB514\uBCF4\uC2A4\uD1A1 \uD45C\uC900\uC2DC", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"\uc57c\uce20\ud06c \uc2dc\uac04", "YAKT", - "\uc57c\uce20\ud06c \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "YAKST", - "\uC57C\uCFE0\uCE20\uD06C \uD45C\uC900\uC2DC", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"\uc608\uce74\ud14c\ub9b0\ubc84\uadf8 \uc2dc\uac04", "YEKT", "\uc608\uce74\ud14c\ub9b0\ubc84\uadf8 \uc77c\uad11\uc808\uc57d\uc2dc\uac04", "YEKST", "\uC608\uCE74\uD14C\uB9B0\uBD80\uB974\uD06C \uD45C\uC900\uC2DC", "YEKT"}}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/pt/BR/TimeZoneNames_pt_BR.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/pt/BR/TimeZoneNames_pt_BR.java index 44bed26f776..04d56b9c2a9 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/pt/BR/TimeZoneNames_pt_BR.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/pt/BR/TimeZoneNames_pt_BR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -276,6 +276,9 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { String XJT[] = new String[] {"Fuso hor\u00e1rio padr\u00e3o da China", "XJT", "Hor\u00e1rio de luz natural da China", "XJDT", "Hor\u00E1rio da China", "XJT"}; + String YAKT[] = new String[] {"Fuso hor\u00e1rio de Yakutsk", "YAKT", + "Fuso hor\u00e1rio de ver\u00e3o de Yakutsk", "YAKST", + "Hor\u00E1rio de Yakutsk", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -487,7 +490,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Fuso hor\u00e1rio padr\u00e3o de S\u00e3o Pedro e Miquelon", "PMST", "Hor\u00e1rio de luz natural de S\u00e3o Pedro e Miquelon", "PMDT", @@ -608,7 +611,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { "Fuso hor\u00e1rio de ver\u00e3o de Brunei", "BNST", "Hor\u00E1rio de Brunei", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Fuso hor\u00e1rio de Choibalsan", "CHOT", "Fuso hor\u00e1rio de ver\u00e3o de Choibalsan", "CHOST", "Hor\u00E1rio de Choibalsan", "CHOT"}}, @@ -649,9 +652,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Hor\u00E1rio de Khandyga", "YAKT", - "Hor\u00E1rio de Ver\u00E3o de Khandyga", "YAKST", - "Hor\u00E1rio de Khandyga", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -717,9 +718,7 @@ public final class TimeZoneNames_pt_BR extends TimeZoneNamesBundle { {"Asia/Vladivostok", new String[] {"Fuso hor\u00e1rio de Vladivostok", "VLAT", "Fuso hor\u00e1rio de ver\u00e3o de Vladivostok", "VLAST", "Hor\u00E1rio de Vladivostok", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Fuso hor\u00e1rio de Yakutsk", "YAKT", - "Fuso hor\u00e1rio de ver\u00e3o de Yakutsk", "YAKST", - "Hor\u00E1rio de Yakutsk", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Fuso hor\u00e1rio de Yekaterinburgo", "YEKT", "Fuso hor\u00e1rio de ver\u00e3o de Yekaterinburgo", "YEKST", "Hor\u00E1rio de Yekaterinburg", "YEKT"}}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java index 86285b8c9fa..8705bfe881b 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/sv/TimeZoneNames_sv.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -276,6 +276,9 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { String XJT[] = new String[] {"Kina, normaltid", "XJT", "Kina, sommartid", "XJDT", "Kinesisk tid", "XJT"}; + String YAKT[] = new String[] {"Jakutsk, normaltid", "YAKT", + "Jakutsk, sommartid", "YAKST", + "Jakutsk-tid", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -487,7 +490,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"Saint-Pierre-et-Miquelon, normaltid", "PMST", "Saint-Pierre-et-Miquelon, sommartid", "PMDT", @@ -613,7 +616,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { "Choibalsan-tid", "CHOT"}}, {"Asia/Chongqing", CTT}, {"Asia/Chungking", CTT}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Colombo", IST}, {"Asia/Dacca", BDT}, {"Asia/Dhaka", BDT}, @@ -649,9 +652,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"Khandyga, normaltid", "YAKT", - "Khandyga, sommartid", "YAKST", - "Khandyga, normaltid", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -717,9 +718,7 @@ public final class TimeZoneNames_sv extends TimeZoneNamesBundle { {"Asia/Vladivostok", new String[] {"Vladivostok, normaltid", "VLAT", "Vladivostok, sommartid", "VLAST", "Vladivostok-tid", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"Jakutsk, normaltid", "YAKT", - "Jakutsk, sommartid", "YAKST", - "Jakutsk-tid", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Jekaterinburg, normaltid", "YEKT", "Jekaterinburg, sommartid", "YEKST", "Jekaterinburg-tid", "YEKT"}}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/CN/TimeZoneNames_zh_CN.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/CN/TimeZoneNames_zh_CN.java index f3e82346cd8..be0019b1573 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/CN/TimeZoneNames_zh_CN.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/CN/TimeZoneNames_zh_CN.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -276,6 +276,9 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { String XJT[] = new String[] {"\u4e2d\u56fd\u6807\u51c6\u65f6\u95f4", "XJT", "\u4e2d\u56fd\u590f\u4ee4\u65f6", "XJDT", "\u4E2D\u56FD\u65F6\u95F4", "XJT"}; + String YAKT[] = new String[] {"\u4e9a\u5e93\u6b21\u514b\u65f6\u95f4", "YAKT", + "\u4e9a\u5e93\u6b21\u514b\u590f\u4ee4\u65f6", "YAKST", + "\u4E9A\u5E93\u6B21\u514B\u65F6\u95F4", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -487,7 +490,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"\u76ae\u57c3\u5c14\u5c9b\u53ca\u5bc6\u514b\u9686\u5c9b\u6807\u51c6\u65f6\u95f4", "PMST", "\u76ae\u57c3\u5c14\u5c9b\u53ca\u5bc6\u514b\u9686\u5c9b\u590f\u4ee4\u65f6", "PMDT", @@ -608,7 +611,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { "\u6587\u83b1\u590f\u4ee4\u65f6", "BNST", "\u6587\u83B1\u65F6\u95F4", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"Choibalsan \u65f6\u95f4", "CHOT", "Choibalsan \u590f\u4ee4\u65f6", "CHOST", "Choibalsan \u65F6\u95F4", "CHOT"}}, @@ -649,9 +652,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"\u6C49\u5FB7\u52A0\u65F6\u95F4", "YAKT", - "\u6C49\u5FB7\u52A0\u590F\u4EE4\u65F6", "YAKST", - "\u6C49\u5FB7\u52A0\u65F6\u95F4", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -717,9 +718,7 @@ public final class TimeZoneNames_zh_CN extends TimeZoneNamesBundle { {"Asia/Vladivostok", new String[] {"\u6d77\u53c2\u5d34\u65f6\u95f4", "VLAT", "\u6d77\u53c2\u5d34\u590f\u4ee4\u65f6", "VLAST", "\u6D77\u53C2\u5D34\u65F6\u95F4", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"\u4e9a\u5e93\u6b21\u514b\u65f6\u95f4", "YAKT", - "\u4e9a\u5e93\u6b21\u514b\u590f\u4ee4\u65f6", "YAKST", - "\u4E9A\u5E93\u6B21\u514B\u65F6\u95F4", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Yekaterinburg \u65f6\u95f4", "YEKT", "Yekaterinburg \u590f\u4ee4\u65f6", "YEKST", "Yekaterinburg \u65F6\u95F4", "YEKT"}}, diff --git a/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TW/TimeZoneNames_zh_TW.java b/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TW/TimeZoneNames_zh_TW.java index b5bce8bbb37..be1de6c6fe7 100644 --- a/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TW/TimeZoneNames_zh_TW.java +++ b/jdk/src/jdk.localedata/share/classes/sun/util/resources/zh/TW/TimeZoneNames_zh_TW.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -276,6 +276,9 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { String XJT[] = new String[] {"\u4e2d\u570b\u6a19\u6e96\u6642\u9593", "XJT", "\u4e2d\u570b\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "XJDT", "\u4E2D\u570B\u6642\u9593", "XJT"}; + String YAKT[] = new String[] {"\u4e9e\u5eab\u6b21\u514b\u6642\u9593", "YAKT", + "\u4e9e\u5eab\u6b21\u514b\u590f\u4ee4\u6642\u9593", "YAKST", + "\u4E9E\u5EAB\u6B21\u514B\u6642\u9593", "YAKT"}; return new Object[][] { {"America/Los_Angeles", PST}, @@ -487,7 +490,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"America/Mendoza", AGT}, {"America/Menominee", CST}, {"America/Merida", CST}, - {"America/Metlakatla", PST}, + {"America/Metlakatla", AKST}, {"America/Mexico_City", CST}, {"America/Miquelon", new String[] {"\u76ae\u57c3\u723e\u5cf6\u53ca\u5bc6\u514b\u9686\u5cf6\u6a19\u6e96\u6642\u9593", "PMST", "\u76ae\u57c3\u723e\u5cf6\u53ca\u5bc6\u514b\u9686\u5cf6\u65e5\u5149\u7bc0\u7d04\u6642\u9593", "PMDT", @@ -608,7 +611,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { "\u6c76\u840a\u590f\u4ee4\u6642\u9593", "BNST", "\u6C76\u840A\u6642\u9593", "BNT"}}, {"Asia/Calcutta", IST}, - {"Asia/Chita", IRKT}, + {"Asia/Chita", YAKT}, {"Asia/Choibalsan", new String[] {"\u5de7\u5df4\u5c71 (Choibalsan) \u6642\u9593", "CHOT", "\u5de7\u5df4\u5c71 (Choibalsan) \u590f\u4ee4\u6642\u9593", "CHOST", "\u5DE7\u5DF4\u5C71 (Choibalsan) \u6642\u9593", "CHOT"}}, @@ -649,9 +652,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"Asia/Kashgar", XJT}, {"Asia/Kathmandu", NPT}, {"Asia/Katmandu", NPT}, - {"Asia/Khandyga", new String[] {"\u6F22\u5730\u52A0 (Khandyga) \u6642\u9593", "YAKT", - "\u6F22\u5730\u52A0 (Khandyga) \u590F\u4EE4\u6642\u9593", "YAKST", - "\u6F22\u5730\u52A0 (Khandyga) \u6642\u9593", "YAKT"}}, + {"Asia/Khandyga", YAKT}, {"Asia/Kolkata", IST}, {"Asia/Krasnoyarsk", KRAT}, {"Asia/Kuala_Lumpur", MYT}, @@ -719,9 +720,7 @@ public final class TimeZoneNames_zh_TW extends TimeZoneNamesBundle { {"Asia/Vladivostok", new String[] {"\u6d77\u53c3\u5d34\u6642\u9593", "VLAT", "\u6d77\u53c3\u5d34\u590f\u4ee4\u6642\u9593", "VLAST", "\u6D77\u53C3\u5D34\u6642\u9593", "VLAT"}}, - {"Asia/Yakutsk", new String[] {"\u4e9e\u5eab\u6b21\u514b\u6642\u9593", "YAKT", - "\u4e9e\u5eab\u6b21\u514b\u590f\u4ee4\u6642\u9593", "YAKST", - "\u4E9E\u5EAB\u6B21\u514B\u6642\u9593", "YAKT"}}, + {"Asia/Yakutsk", YAKT}, {"Asia/Yekaterinburg", new String[] {"Yekaterinburg \u6642\u9593", "YEKT", "Yekaterinburg \u590f\u4ee4\u6642\u9593", "YEKST", "\u8449\u5361\u6377\u7433\u5821\u6642\u9593", "YEKT"}}, diff --git a/jdk/test/sun/util/calendar/zi/tzdata/VERSION b/jdk/test/sun/util/calendar/zi/tzdata/VERSION index 63a2e5d56d5..55966f28162 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/VERSION +++ b/jdk/test/sun/util/calendar/zi/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2015g +tzdata2016a diff --git a/jdk/test/sun/util/calendar/zi/tzdata/asia b/jdk/test/sun/util/calendar/zi/tzdata/asia index b3adb9616ee..056a5f9c552 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/asia +++ b/jdk/test/sun/util/calendar/zi/tzdata/asia @@ -897,6 +897,15 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 9:00 - TLT # India + +# From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic +# http://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/ +# (2015-12-22): +# In January 1906, several thousand cotton-mill workers rioted on the +# outskirts of Bombay.... They were protesting the proposed abolition of +# local time in favor of Indian Standard Time.... Journalists called this +# dispute the "Battle of the Clocks." It lasted nearly half a century. + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata 5:53:20 - HMT 1941 Oct # Howrah Mean Time? @@ -1107,8 +1116,15 @@ Rule Iran 2032 2033 - Mar 21 0:00 1:00 D Rule Iran 2032 2033 - Sep 21 0:00 0 S Rule Iran 2034 2035 - Mar 22 0:00 1:00 D Rule Iran 2034 2035 - Sep 22 0:00 0 S -Rule Iran 2036 2037 - Mar 21 0:00 1:00 D -Rule Iran 2036 2037 - Sep 21 0:00 0 S +# +# The following rules are approximations starting in the year 2038. +# These are the best post-2037 approximations available, given the +# restrictions of a single rule using a Gregorian-based data format. +# At some point this table will need to be extended, though quite +# possibly Iran will change the rules first. +Rule Iran 2036 max - Mar 21 0:00 1:00 D +Rule Iran 2036 max - Sep 21 0:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 3:25:44 - TMT 1946 # Tehran Mean Time @@ -2134,8 +2150,8 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920 # http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Pakistan 2002 only - Apr Sun>=2 0:01 1:00 S -Rule Pakistan 2002 only - Oct Sun>=2 0:01 0 - +Rule Pakistan 2002 only - Apr Sun>=2 0:00 1:00 S +Rule Pakistan 2002 only - Oct Sun>=2 0:00 0 - Rule Pakistan 2008 only - Jun 1 0:00 1:00 S Rule Pakistan 2008 2009 - Nov 1 0:00 0 - Rule Pakistan 2009 only - Apr 15 0:00 1:00 S diff --git a/jdk/test/sun/util/calendar/zi/tzdata/backward b/jdk/test/sun/util/calendar/zi/tzdata/backward index 3c845cfc01c..83527051395 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/backward +++ b/jdk/test/sun/util/calendar/zi/tzdata/backward @@ -46,6 +46,7 @@ Link America/Argentina/Mendoza America/Mendoza Link America/Toronto America/Montreal Link America/Rio_Branco America/Porto_Acre Link America/Argentina/Cordoba America/Rosario +Link America/Tijuana America/Santa_Isabel Link America/Denver America/Shiprock Link America/Port_of_Spain America/Virgin Link Pacific/Auckland Antarctica/South_Pole diff --git a/jdk/test/sun/util/calendar/zi/tzdata/europe b/jdk/test/sun/util/calendar/zi/tzdata/europe index 41987bd1e66..267992150ce 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/europe +++ b/jdk/test/sun/util/calendar/zi/tzdata/europe @@ -2616,13 +2616,20 @@ Zone Asia/Irkutsk 6:57:05 - LMT 1880 # Note: Effective 2008-03-01, (75) Chita Oblast and (80) Agin-Buryat # Autonomous Okrug merged to form (92, RU-ZAB) Zabaykalsky Krai. +# From Alexander Krivenyshev (2016-01-02): +# [The] time zone in the Trans-Baikal Territory (Zabaykalsky Krai) - +# Asia/Chita [is changing] from UTC+8 to UTC+9. Effective date will +# be March 27, 2016 at 2:00am.... +# http://publication.pravo.gov.ru/Document/View/000120151230010 + Zone Asia/Chita 7:33:52 - LMT 1919 Dec 15 8:00 - YAKT 1930 Jun 21 # Yakutsk Time 9:00 Russia YAK%sT 1991 Mar 31 2:00s 8:00 Russia YAK%sT 1992 Jan 19 2:00s 9:00 Russia YAK%sT 2011 Mar 27 2:00s 10:00 - YAKT 2014 Oct 26 2:00s - 8:00 - IRKT + 8:00 - IRKT 2016 Mar 27 2:00 + 9:00 - YAKT # From Tim Parenti (2014-07-03), per Oscar van Vlijmen (2009-11-29): @@ -3177,6 +3184,12 @@ Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment. # It's officially announced now by the Ministry of Energy. # Turkey delays winter time to 8th of November 04:00 # http://www.aa.com.tr/tr/turkiye/yaz-saati-uygulamasi-8-kasimda-sona-erecek/362217 +# +# From BBC News (2015-10-25): +# Confused Turks are asking "what's the time?" after automatic clocks defied a +# government decision ... "For the next two weeks #Turkey is on EEST... Erdogan +# Engineered Standard Time," said Twitter user @aysekarahasan. +# http://www.bbc.com/news/world-europe-34631326 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Turkey 1916 only - May 1 0:00 1:00 S diff --git a/jdk/test/sun/util/calendar/zi/tzdata/northamerica b/jdk/test/sun/util/calendar/zi/tzdata/northamerica index 0e8b4fa975a..e56fd895d10 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/northamerica +++ b/jdk/test/sun/util/calendar/zi/tzdata/northamerica @@ -348,6 +348,16 @@ Zone America/New_York -4:56:02 - LMT 1883 Nov 18 12:03:58 # Statue 175 closer in synch with the US Congress' intent.... # http://www.legis.state.wi.us/2007/data/acts/07Act3.pdf +# From an email administrator of the City of Fort Pierre, SD (2015-12-21): +# Fort Pierre is technically located in the Mountain time zone as is +# the rest of Stanley County. Most of Stanley County and Fort Pierre +# uses the Central time zone due to doing most of their business in +# Pierre so it simplifies schedules. I have lived in Stanley County +# all my life and it has been that way since I can remember. (43 years!) +# +# From Paul Eggert (2015-12-25): +# Assume this practice predates 1970, so Fort Pierre can use America/Chicago. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER Rule Chicago 1920 only - Jun 13 2:00 1:00 D Rule Chicago 1920 1921 - Oct lastSun 2:00 0 S @@ -504,6 +514,12 @@ Zone America/Los_Angeles -7:52:58 - LMT 1883 Nov 18 12:07:02 # For lack of better information, assume that Metlakatla's # abandonment of use of daylight saving resulted from the 1983 vote. +# From Steffen Thorsen (2015-11-09): +# It seems Metlakatla did go off PST on Sunday, November 1, changing +# their time to AKST and are going to follow Alaska's DST, switching +# between AKST and AKDT from now on.... +# http://www.krbd.org/2015/10/30/annette-island-times-they-are-a-changing/ + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Juneau 15:02:19 - LMT 1867 Oct 18 -8:57:41 - LMT 1900 Aug 20 12:00 @@ -529,7 +545,8 @@ Zone America/Metlakatla 15:13:42 - LMT 1867 Oct 18 -8:00 US P%sT 1946 -8:00 - PST 1969 -8:00 US P%sT 1983 Oct 30 2:00 - -8:00 - PST + -8:00 - PST 2015 Nov 1 2:00 + -9:00 US AK%sT Zone America/Yakutat 14:41:05 - LMT 1867 Oct 18 -9:18:55 - LMT 1900 Aug 20 12:00 -9:00 - YST 1942 @@ -2610,25 +2627,6 @@ Zone America/Tijuana -7:48:04 - LMT 1922 Jan 1 0:11:56 -8:00 US P%sT 2002 Feb 20 -8:00 Mexico P%sT 2010 -8:00 US P%sT -# Baja California (away from US border) -Zone America/Santa_Isabel -7:39:28 - LMT 1922 Jan 1 0:20:32 - -7:00 - MST 1924 - -8:00 - PST 1927 Jun 10 23:00 - -7:00 - MST 1930 Nov 15 - -8:00 - PST 1931 Apr 1 - -8:00 1:00 PDT 1931 Sep 30 - -8:00 - PST 1942 Apr 24 - -8:00 1:00 PWT 1945 Aug 14 23:00u - -8:00 1:00 PPT 1945 Nov 12 # Peace - -8:00 - PST 1948 Apr 5 - -8:00 1:00 PDT 1949 Jan 14 - -8:00 - PST 1954 - -8:00 CA P%sT 1961 - -8:00 - PST 1976 - -8:00 US P%sT 1996 - -8:00 Mexico P%sT 2001 - -8:00 US P%sT 2002 Feb 20 - -8:00 Mexico P%sT # From Paul Eggert (2006-03-22): # Formerly there was an America/Ensenada zone, which differed from # America/Tijuana only in that it did not observe DST from 1976 @@ -2641,6 +2639,13 @@ Zone America/Santa_Isabel -7:39:28 - LMT 1922 Jan 1 0:20:32 # other than America/Tijuana for Baja, but it's not clear yet what its # name or contents should be. # +# From Paul Eggert (2015-10-08): +# Formerly there was an America/Santa_Isabel zone, but this appears to +# have come from a misreading of +# http://dof.gob.mx/nota_detalle.php?codigo=5127480&fecha=06/01/2010 +# It has been moved to the 'backward' file. +# +# # Revillagigedo Is # no information @@ -2715,17 +2720,7 @@ Zone Atlantic/Bermuda -4:19:18 - LMT 1930 Jan 1 2:00 # Hamilton -4:00 US A%sT # Cayman Is - -# From Paul Eggert (2015-05-15): -# The Cayman government has decided to introduce DST in 2016, the idea being -# to keep in sync with New York. The legislation hasn't passed but the change -# seems quite likely. See: Meade B. Cayman 27. -# http://www.cayman27.com.ky/2015/05/15/clock-ticks-toward-daylight-saving-time-in-cayman - -Zone America/Cayman -5:25:32 - LMT 1890 # Georgetown - -5:07:11 - KMT 1912 Feb # Kingston Mean Time - -5:00 - EST 2016 - -5:00 US E%sT +# See America/Panama. # Costa Rica @@ -3248,6 +3243,7 @@ Zone America/Managua -5:45:08 - LMT 1890 Zone America/Panama -5:18:08 - LMT 1890 -5:19:36 - CMT 1908 Apr 22 # Colón Mean Time -5:00 - EST +Link America/Panama America/Cayman # Puerto Rico # There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'. diff --git a/jdk/test/sun/util/calendar/zi/tzdata/zone.tab b/jdk/test/sun/util/calendar/zi/tzdata/zone.tab index 63d1fddf6b9..51aaf775dee 100644 --- a/jdk/test/sun/util/calendar/zi/tzdata/zone.tab +++ b/jdk/test/sun/util/calendar/zi/tzdata/zone.tab @@ -306,8 +306,7 @@ MX +2313-10625 America/Mazatlan Mountain Time - S Baja, Nayarit, Sinaloa MX +2838-10605 America/Chihuahua Mexican Mountain Time - Chihuahua away from US border MX +2934-10425 America/Ojinaga US Mountain Time - Chihuahua near US border MX +2904-11058 America/Hermosillo Mountain Standard Time - Sonora -MX +3232-11701 America/Tijuana US Pacific Time - Baja California near US border -MX +3018-11452 America/Santa_Isabel Mexican Pacific Time - Baja California away from US border +MX +3232-11701 America/Tijuana US Pacific Time - Baja California state MX +2048-10515 America/Bahia_Banderas Mexican Central Time - Bahia de Banderas MY +0310+10142 Asia/Kuala_Lumpur peninsular Malaysia MY +0133+11020 Asia/Kuching Sabah & Sarawak @@ -437,10 +436,10 @@ US +394421-1045903 America/Denver Mountain Time US +433649-1161209 America/Boise Mountain Time - south Idaho & east Oregon US +332654-1120424 America/Phoenix Mountain Standard Time - Arizona (except Navajo) US +340308-1181434 America/Los_Angeles Pacific Time -US +550737-1313435 America/Metlakatla Pacific Standard Time - Annette Island, Alaska US +611305-1495401 America/Anchorage Alaska Time US +581807-1342511 America/Juneau Alaska Time - Alaska panhandle US +571035-1351807 America/Sitka Alaska Time - southeast Alaska panhandle +US +550737-1313435 America/Metlakatla Alaska Time - Annette Island US +593249-1394338 America/Yakutat Alaska Time - Alaska panhandle neck US +643004-1652423 America/Nome Alaska Time - west Alaska US +515248-1763929 America/Adak Aleutian Islands From 2d065eb25b760f7d031f8131321c638a7fdde68a Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Tue, 9 Feb 2016 11:58:36 -0800 Subject: [PATCH 130/212] 8149492: Problem list CheckEncodings.sh Reviewed-by: rriggs --- jdk/test/ProblemList.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jdk/test/ProblemList.txt b/jdk/test/ProblemList.txt index 1b7cc2da8b5..5dbb36d7d98 100644 --- a/jdk/test/ProblemList.txt +++ b/jdk/test/ProblemList.txt @@ -133,6 +133,9 @@ java/beans/Introspector/8132566/OverrideUserDefPropertyInfoTest.java generic-all # 8029891 java/lang/ClassLoader/deadlock/GetResource.java generic-all +# 7008363 +java/lang/StringCoding/CheckEncodings.sh generic-all + ############################################################################ # jdk_instrument From 3e45966cd3f8454720942f3a44754c2db52c137c Mon Sep 17 00:00:00 2001 From: Shilpi Rastogi Date: Wed, 10 Feb 2016 10:44:58 +0100 Subject: [PATCH 131/212] 8138884: MethodHandles.Lookup.findVirtual() Javadoc fails to consider private interface methods Reviewed-by: psandoz, mhaupt --- .../share/classes/java/lang/invoke/MethodHandles.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index 45908f1ea23..fc9ac8e1518 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -856,7 +856,8 @@ assertEquals("", (String) MH_newString.invokeExact()); * @return the desired method handle * @throws NoSuchMethodException if the method does not exist * @throws IllegalAccessException if access checking fails, - * or if the method is {@code static} + * or if the method is {@code static}, + * or if the method is {@code private} method of interface, * or if the method's variable arity modifier bit * is set and {@code asVarargsCollector} fails * @exception SecurityException if a security manager is present and it From ff97659a79401041136ddc3da3de3c13a8dd2f82 Mon Sep 17 00:00:00 2001 From: Shilpi Rastogi Date: Wed, 10 Feb 2016 11:04:13 +0100 Subject: [PATCH 132/212] 8071368: Use more concrete types for NamedFunction constants in the code Reviewed-by: psandoz, vlivanov, mhaupt --- .../classes/java/lang/invoke/Invokers.java | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java index 32a96ebea7e..277cac28a44 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -305,9 +305,7 @@ class Invokers { /** Static definition of MethodHandle.invokeExact checking code. */ /*non-public*/ static @ForceInline - void checkExactType(Object mhObj, Object expectedObj) { - MethodHandle mh = (MethodHandle) mhObj; - MethodType expected = (MethodType) expectedObj; + void checkExactType(MethodHandle mh, MethodType expected) { MethodType actual = mh.type(); if (actual != expected) throw newWrongMethodTypeException(expected, actual); @@ -319,9 +317,7 @@ class Invokers { */ /*non-public*/ static @ForceInline - Object checkGenericType(Object mhObj, Object expectedObj) { - MethodHandle mh = (MethodHandle) mhObj; - MethodType expected = (MethodType) expectedObj; + MethodHandle checkGenericType(MethodHandle mh, MethodType expected) { return mh.asType(expected); /* Maybe add more paths here. Possible optimizations: * for (R)MH.invoke(a*), @@ -390,14 +386,13 @@ class Invokers { /** Static definition of MethodHandle.invokeGeneric checking code. */ /*non-public*/ static @ForceInline - Object getCallSiteTarget(Object site) { - return ((CallSite)site).getTarget(); + MethodHandle getCallSiteTarget(CallSite site) { + return site.getTarget(); } /*non-public*/ static @ForceInline - void checkCustomized(Object o) { - MethodHandle mh = (MethodHandle)o; + void checkCustomized(MethodHandle mh) { if (MethodHandleImpl.isCompileConstant(mh)) return; if (mh.form.customized == null) { maybeCustomize(mh); @@ -425,13 +420,13 @@ class Invokers { try { NamedFunction nfs[] = { NF_checkExactType = new NamedFunction(Invokers.class - .getDeclaredMethod("checkExactType", Object.class, Object.class)), + .getDeclaredMethod("checkExactType", MethodHandle.class, MethodType.class)), NF_checkGenericType = new NamedFunction(Invokers.class - .getDeclaredMethod("checkGenericType", Object.class, Object.class)), + .getDeclaredMethod("checkGenericType", MethodHandle.class, MethodType.class)), NF_getCallSiteTarget = new NamedFunction(Invokers.class - .getDeclaredMethod("getCallSiteTarget", Object.class)), + .getDeclaredMethod("getCallSiteTarget", CallSite.class)), NF_checkCustomized = new NamedFunction(Invokers.class - .getDeclaredMethod("checkCustomized", Object.class)) + .getDeclaredMethod("checkCustomized", MethodHandle.class)) }; // Each nf must be statically invocable or we get tied up in our bootstraps. assert(InvokerBytecodeGenerator.isStaticallyInvocable(nfs)); From 6c46017af1ebbf2cf36cf609e5d800bf20289453 Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Wed, 10 Feb 2016 16:16:48 +0300 Subject: [PATCH 133/212] 8046339: sun.rmi.transport.DGCAckHandler leaks memory Reviewed-by: smarks --- .../sun/rmi/transport/DGCAckHandler.java | 5 ++- .../rmi/dgc/dgcAckFailure/DGCAckFailure.java | 37 ++++++++++++++++--- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/jdk/src/java.rmi/share/classes/sun/rmi/transport/DGCAckHandler.java b/jdk/src/java.rmi/share/classes/sun/rmi/transport/DGCAckHandler.java index 26e9f7b45d5..3bfa2d3292c 100644 --- a/jdk/src/java.rmi/share/classes/sun/rmi/transport/DGCAckHandler.java +++ b/jdk/src/java.rmi/share/classes/sun/rmi/transport/DGCAckHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -118,6 +118,9 @@ public class DGCAckHandler { if (objList != null && task == null) { task = scheduler.schedule(new Runnable() { public void run() { + if (id != null) { + idTable.remove(id); + } release(); } }, dgcAckTimeout, TimeUnit.MILLISECONDS); diff --git a/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java b/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java index 82eeab00b16..bc1c2dc50ba 100644 --- a/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java +++ b/jdk/test/java/rmi/dgc/dgcAckFailure/DGCAckFailure.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ */ /* @test - * @bug 4017232 + * @bug 4017232 8046339 * @summary If, after returning a reference to a remote object in the current * VM (which gets implicitly converted to a remote stub), the client fails to * both send a DGC dirty call and to send a "DGC acknowledgment", the RMI @@ -36,10 +36,14 @@ import java.io.*; import java.net.*; +import java.lang.reflect.Field; import java.lang.ref.*; import java.rmi.*; import java.rmi.server.*; +import java.util.Map; + +import sun.rmi.transport.DGCAckHandler; interface ReturnRemote extends Remote { Object returnRemote() throws RemoteException; @@ -48,6 +52,7 @@ interface ReturnRemote extends Remote { public class DGCAckFailure implements ReturnRemote { private static final long TIMEOUT = 20000; + private static final long ACK_TIMEOUT = TIMEOUT / 2; public Object returnRemote() { return new Wrapper(this); @@ -55,7 +60,8 @@ public class DGCAckFailure implements ReturnRemote { public static void main(String[] args) throws Exception { - System.setProperty("sun.rmi.dgc.ackTimeout", "10000"); + System.setProperty("sun.rmi.dgc.ackTimeout", + Long.toString(ACK_TIMEOUT)); /* * Set a socket factory that has a hook for shutting down all client @@ -93,12 +99,31 @@ public class DGCAckFailure implements ReturnRemote { break; } } - if (ref == weakRef) { - System.err.println("TEST PASSED"); - } else { + if (ref != weakRef) { throw new RuntimeException("TEST FAILED: " + "timed out, remote object not garbage collected"); } + + // 8046339 + // All DGCAckHandlers must be properly released after timeout + Thread.sleep(ACK_TIMEOUT + 100); + try { + Field field = + DGCAckHandler.class.getDeclaredField("idTable"); + field.setAccessible(true); + Object obj = field.get(null); + Map idTable = (Map)obj; + + if (!idTable.isEmpty()) { + throw new RuntimeException("TEST FAILED: " + + "DGCAckHandler.idTable isn't empty"); + } + } catch (ReflectiveOperationException roe) { + throw new RuntimeException(roe); + } + + System.err.println("TEST PASSED"); + } finally { try { UnicastRemoteObject.unexportObject((Remote) weakRef.get(), From 32687876fa06a173447ddbfe3654de4ab224d4e5 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 27 Jan 2016 10:35:49 +0100 Subject: [PATCH 134/212] 8149529: Adapt SAP copyrights to new company name in jdk repository Reviewed-by: simonis, chegar --- jdk/make/data/fontconfig/aix.fontconfig.properties | 2 +- .../aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java | 2 +- jdk/src/java.base/aix/classes/sun/nio/ch/AixPollPort.java | 2 +- jdk/src/java.base/aix/classes/sun/nio/fs/AixFileStore.java | 2 +- jdk/src/java.base/aix/classes/sun/nio/fs/AixFileSystem.java | 2 +- .../java.base/aix/classes/sun/nio/fs/AixFileSystemProvider.java | 2 +- .../java.base/aix/classes/sun/nio/fs/AixNativeDispatcher.java | 2 +- jdk/src/java.base/aix/native/libnio/ch/AixPollPort.c | 2 +- jdk/src/java.base/aix/native/libnio/fs/AixNativeDispatcher.c | 2 +- jdk/src/java.desktop/aix/native/libawt/porting_aix.c | 2 +- jdk/src/java.desktop/aix/native/libawt/porting_aix.h | 2 +- .../aix/classes/sun/tools/attach/AttachProviderImpl.java | 2 +- .../aix/classes/sun/tools/attach/VirtualMachineImpl.java | 2 +- jdk/src/jdk.attach/aix/native/libattach/VirtualMachineImpl.c | 2 +- .../aix/native/libmanagement_ext/UnixOperatingSystem.c | 2 +- jdk/test/java/lang/ProcessBuilder/RedirectWithLongFilename.java | 2 +- jdk/test/java/lang/System/OsVersionTest.java | 2 +- .../jaxp/parsers/8027359/FragmentScannerBufferLimitTest.java | 2 +- jdk/test/jdk/internal/jimage/ExecutableTest.java | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/jdk/make/data/fontconfig/aix.fontconfig.properties b/jdk/make/data/fontconfig/aix.fontconfig.properties index f203f759894..f21f10a3bc8 100644 --- a/jdk/make/data/fontconfig/aix.fontconfig.properties +++ b/jdk/make/data/fontconfig/aix.fontconfig.properties @@ -1,6 +1,6 @@ # # -# Copyright 2013 SAP AG. All rights reserved. +# Copyright (c) 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 diff --git a/jdk/src/java.base/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java b/jdk/src/java.base/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java index 4c2c3d317bf..681883247bd 100644 --- a/jdk/src/java.base/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java +++ b/jdk/src/java.base/aix/classes/sun/nio/ch/AixAsynchronousChannelProvider.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 SAP AG. All rights reserved. + * Copyright (c) 2012 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 diff --git a/jdk/src/java.base/aix/classes/sun/nio/ch/AixPollPort.java b/jdk/src/java.base/aix/classes/sun/nio/ch/AixPollPort.java index 9cb294f67f0..735993c3d36 100644 --- a/jdk/src/java.base/aix/classes/sun/nio/ch/AixPollPort.java +++ b/jdk/src/java.base/aix/classes/sun/nio/ch/AixPollPort.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 SAP AG. All rights reserved. + * Copyright (c) 2012 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 diff --git a/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileStore.java b/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileStore.java index c38cb46a760..b13f333eacd 100644 --- a/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileStore.java +++ b/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileStore.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013 SAP AG. All rights reserved. + * Copyright (c) 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 diff --git a/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileSystem.java b/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileSystem.java index 1169dd31606..f1763ce3cae 100644 --- a/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileSystem.java +++ b/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileSystem.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013 SAP AG. All rights reserved. + * Copyright (c) 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 diff --git a/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileSystemProvider.java b/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileSystemProvider.java index 5718d87b387..7d14fa84229 100644 --- a/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileSystemProvider.java +++ b/jdk/src/java.base/aix/classes/sun/nio/fs/AixFileSystemProvider.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013 SAP AG. All rights reserved. + * Copyright (c) 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 diff --git a/jdk/src/java.base/aix/classes/sun/nio/fs/AixNativeDispatcher.java b/jdk/src/java.base/aix/classes/sun/nio/fs/AixNativeDispatcher.java index 76e833ae19a..151a679cfad 100644 --- a/jdk/src/java.base/aix/classes/sun/nio/fs/AixNativeDispatcher.java +++ b/jdk/src/java.base/aix/classes/sun/nio/fs/AixNativeDispatcher.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013 SAP AG. All rights reserved. + * Copyright (c) 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 diff --git a/jdk/src/java.base/aix/native/libnio/ch/AixPollPort.c b/jdk/src/java.base/aix/native/libnio/ch/AixPollPort.c index 70064b890ef..b11d286dd68 100644 --- a/jdk/src/java.base/aix/native/libnio/ch/AixPollPort.c +++ b/jdk/src/java.base/aix/native/libnio/ch/AixPollPort.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 SAP AG. All rights reserved. + * Copyright (c) 2012 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 diff --git a/jdk/src/java.base/aix/native/libnio/fs/AixNativeDispatcher.c b/jdk/src/java.base/aix/native/libnio/fs/AixNativeDispatcher.c index e7afb205280..2f3d463bc26 100644 --- a/jdk/src/java.base/aix/native/libnio/fs/AixNativeDispatcher.c +++ b/jdk/src/java.base/aix/native/libnio/fs/AixNativeDispatcher.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013 SAP AG. All rights reserved. + * Copyright (c) 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 diff --git a/jdk/src/java.desktop/aix/native/libawt/porting_aix.c b/jdk/src/java.desktop/aix/native/libawt/porting_aix.c index 659d9c4c06b..0ec0ce2198b 100644 --- a/jdk/src/java.desktop/aix/native/libawt/porting_aix.c +++ b/jdk/src/java.desktop/aix/native/libawt/porting_aix.c @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2013 SAP AG. 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 diff --git a/jdk/src/java.desktop/aix/native/libawt/porting_aix.h b/jdk/src/java.desktop/aix/native/libawt/porting_aix.h index 79d1062dd67..65c4ff35639 100644 --- a/jdk/src/java.desktop/aix/native/libawt/porting_aix.h +++ b/jdk/src/java.desktop/aix/native/libawt/porting_aix.h @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2013 SAP AG. 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 diff --git a/jdk/src/jdk.attach/aix/classes/sun/tools/attach/AttachProviderImpl.java b/jdk/src/jdk.attach/aix/classes/sun/tools/attach/AttachProviderImpl.java index 56d76734da5..2f6fc4d4df2 100644 --- a/jdk/src/jdk.attach/aix/classes/sun/tools/attach/AttachProviderImpl.java +++ b/jdk/src/jdk.attach/aix/classes/sun/tools/attach/AttachProviderImpl.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013 SAP AG. All rights reserved. + * Copyright (c) 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 diff --git a/jdk/src/jdk.attach/aix/classes/sun/tools/attach/VirtualMachineImpl.java b/jdk/src/jdk.attach/aix/classes/sun/tools/attach/VirtualMachineImpl.java index afde9169993..0981b9cfaf5 100644 --- a/jdk/src/jdk.attach/aix/classes/sun/tools/attach/VirtualMachineImpl.java +++ b/jdk/src/jdk.attach/aix/classes/sun/tools/attach/VirtualMachineImpl.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2015 SAP AG. All rights reserved. + * Copyright (c) 2015 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 diff --git a/jdk/src/jdk.attach/aix/native/libattach/VirtualMachineImpl.c b/jdk/src/jdk.attach/aix/native/libattach/VirtualMachineImpl.c index db4d29b882d..6acecf96e9b 100644 --- a/jdk/src/jdk.attach/aix/native/libattach/VirtualMachineImpl.c +++ b/jdk/src/jdk.attach/aix/native/libattach/VirtualMachineImpl.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2015 SAP AG. All rights reserved. + * Copyright (c) 2015 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 diff --git a/jdk/src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c b/jdk/src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c index bee3753b3c1..86c4c692f67 100644 --- a/jdk/src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c +++ b/jdk/src/jdk.management/aix/native/libmanagement_ext/UnixOperatingSystem.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2015 SAP AG. All rights reserved. + * Copyright (c) 2015 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 diff --git a/jdk/test/java/lang/ProcessBuilder/RedirectWithLongFilename.java b/jdk/test/java/lang/ProcessBuilder/RedirectWithLongFilename.java index ed5551af5b9..9f4c9fef0cb 100644 --- a/jdk/test/java/lang/ProcessBuilder/RedirectWithLongFilename.java +++ b/jdk/test/java/lang/ProcessBuilder/RedirectWithLongFilename.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP SE. All Rights Reserved. + * Copyright (c) 2015 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 diff --git a/jdk/test/java/lang/System/OsVersionTest.java b/jdk/test/java/lang/System/OsVersionTest.java index f5397cf533d..2fbadf0bc39 100644 --- a/jdk/test/java/lang/System/OsVersionTest.java +++ b/jdk/test/java/lang/System/OsVersionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP SE. All Rights Reserved. + * Copyright (c) 2015 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 diff --git a/jdk/test/javax/xml/jaxp/parsers/8027359/FragmentScannerBufferLimitTest.java b/jdk/test/javax/xml/jaxp/parsers/8027359/FragmentScannerBufferLimitTest.java index 7f408212ff3..a337a741aff 100644 --- a/jdk/test/javax/xml/jaxp/parsers/8027359/FragmentScannerBufferLimitTest.java +++ b/jdk/test/javax/xml/jaxp/parsers/8027359/FragmentScannerBufferLimitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014, SAP AG. All rights reserved. + * Copyright (c) 2014 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 diff --git a/jdk/test/jdk/internal/jimage/ExecutableTest.java b/jdk/test/jdk/internal/jimage/ExecutableTest.java index be24539eff5..b65230bb092 100644 --- a/jdk/test/jdk/internal/jimage/ExecutableTest.java +++ b/jdk/test/jdk/internal/jimage/ExecutableTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 SAP SE. All Rights Reserved. + * Copyright (c) 2015 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 From a7c8b9448e32b3040f3190a03b09c331d7daac1e Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Tue, 2 Feb 2016 12:56:35 +0000 Subject: [PATCH 135/212] 8147949: NetBeans cannot open langtools repository because of the reserved word \"aux\" Dropping unnecessary references to artificial "aux" source roots. Reviewed-by: mcimadamore --- langtools/make/netbeans/langtools/nbproject/project.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/langtools/make/netbeans/langtools/nbproject/project.xml b/langtools/make/netbeans/langtools/nbproject/project.xml index e6d79d9d3f4..2a1fe355a7c 100644 --- a/langtools/make/netbeans/langtools/nbproject/project.xml +++ b/langtools/make/netbeans/langtools/nbproject/project.xml @@ -520,7 +520,7 @@ ${root}/build/bootstrap/jdk.jshell/gensrc ${root}/../jdk/src/jdk.internal.le/share/classes ${root}/../jdk/src/jdk.jdi/share/classes - ${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes:${root}/build/jdk.internal.le/aux:${root}/build/jdk.jdi/aux:${root}/build/jdk.internal.le/classes:${root}/build/jdk.jdi/classes + ${root}/build/java.compiler/classes:${root}/build/jdk.compiler/classes:${root}/build/jdk.internal.le/classes:${root}/build/jdk.jdi/classes ${root}/build/jdk.jshell/classes 1.8 From 7553186482212a87c62d1261e1e0636bdafed9bf Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Tue, 2 Feb 2016 15:02:55 +0100 Subject: [PATCH 136/212] 8148655: LOG=cmdlines and other build-infra fixes Reviewed-by: erikj --- common/autoconf/basics.m4 | 5 + common/autoconf/flags.m4 | 32 +++---- common/autoconf/generated-configure.sh | 43 +++++---- common/autoconf/jdk-version.m4 | 3 +- common/autoconf/spec.gmk.in | 1 + make/Init.gmk | 2 +- make/InitSupport.gmk | 38 +++++--- make/common/JavaCompilation.gmk | 12 +-- make/common/MakeBase.gmk | 43 +++++---- make/common/NativeCompilation.gmk | 121 +++++++++++++------------ 10 files changed, 169 insertions(+), 131 deletions(-) diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index be85de751eb..3ffc8499c5c 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -573,6 +573,11 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS], # Locate the directory of this script. AUTOCONF_DIR=$TOPDIR/common/autoconf + + # Setup username (for use in adhoc version strings etc) + # Outer [ ] to quote m4. + [ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ] + AC_SUBST(USERNAME) ]) # Evaluates platform specific overrides for devkit variables. diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index e6b8417241f..baf5a96b2f8 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -601,22 +601,22 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], esac elif test "x$TOOLCHAIN_TYPE" = xclang; then if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test "x$OPENJDK_TARGET_CPU" = xx86; then - # Force compatibility with i586 on 32 bit intel platforms. - COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" - fi - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ - -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_TARGET_CPU_ARCH in - ppc ) - # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - * ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac + if test "x$OPENJDK_TARGET_CPU" = xx86; then + # Force compatibility with i586 on 32 bit intel platforms. + COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" + fi + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ + -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" + case $OPENJDK_TARGET_CPU_ARCH in + ppc ) + # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + * ) + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + esac fi elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 0fdc4605014..1542156b367 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -917,6 +917,7 @@ JVM_VARIANTS JVM_INTERPRETER JDK_VARIANT SET_OPENJDK +USERNAME CANONICAL_TOPDIR ORIGINAL_TOPDIR TOPDIR @@ -4835,7 +4836,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1454146111 +DATE_WHEN_GENERATED=1454421750 ############################################################################### # @@ -15652,6 +15653,11 @@ $as_echo "$as_me: The path of TOPDIR, which resolves as \"$path\", is invalid." # Locate the directory of this script. AUTOCONF_DIR=$TOPDIR/common/autoconf + # Setup username (for use in adhoc version strings etc) + # Outer [ ] to quote m4. + USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` + + # Check if it's a pure open build or if custom sources are to be used. @@ -23429,9 +23435,8 @@ $as_echo "$as_me: WARNING: --with-version-opt value has been sanitized from '$wi # Default is to calculate a string like this .. timestamp=`$DATE '+%Y-%m-%d-%H%M%S'` # Outer [ ] to quote m4. - username=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'` - VERSION_OPT="$timestamp.$username.$basedirname" + VERSION_OPT="$timestamp.$USERNAME.$basedirname" fi fi @@ -46441,22 +46446,22 @@ $as_echo "$supports" >&6; } esac elif test "x$TOOLCHAIN_TYPE" = xclang; then if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test "x$OPENJDK_TARGET_CPU" = xx86; then - # Force compatibility with i586 on 32 bit intel platforms. - COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" - fi - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ - -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - case $OPENJDK_TARGET_CPU_ARCH in - ppc ) - # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - * ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac + if test "x$OPENJDK_TARGET_CPU" = xx86; then + # Force compatibility with i586 on 32 bit intel platforms. + COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586" + fi + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ + -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" + case $OPENJDK_TARGET_CPU_ARCH in + ppc ) + # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + * ) + COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + esac fi elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" diff --git a/common/autoconf/jdk-version.m4 b/common/autoconf/jdk-version.m4 index 32bf2e42bb2..2dc63865c49 100644 --- a/common/autoconf/jdk-version.m4 +++ b/common/autoconf/jdk-version.m4 @@ -162,9 +162,8 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS], # Default is to calculate a string like this .. timestamp=`$DATE '+%Y-%m-%d-%H%M%S'` # Outer [ ] to quote m4. - [ username=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ] [ basedirname=`$BASENAME "$TOPDIR" | $TR -d -c '[a-z][A-Z][0-9].-'` ] - VERSION_OPT="$timestamp.$username.$basedirname" + VERSION_OPT="$timestamp.$USERNAME.$basedirname" fi fi diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index a78b30ba5ad..2bb4bdbbcd7 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -184,6 +184,7 @@ JDK_RC_PLATFORM_NAME:=@JDK_RC_PLATFORM_NAME@ COMPANY_NAME:=@COMPANY_NAME@ MACOSX_BUNDLE_NAME_BASE=@MACOSX_BUNDLE_NAME_BASE@ MACOSX_BUNDLE_ID_BASE=@MACOSX_BUNDLE_ID_BASE@ +USERNAME:=@USERNAME@ # Different naming strings generated from the above information. RUNTIME_NAME=$(PRODUCT_NAME) $(PRODUCT_SUFFIX) diff --git a/make/Init.gmk b/make/Init.gmk index b0c2d881bf4..3c7a664e6e4 100644 --- a/make/Init.gmk +++ b/make/Init.gmk @@ -168,7 +168,7 @@ ifeq ($(HAS_SPEC),) MAKE_INIT_WITH_SPEC_ARGUMENTS := ACTUAL_TOPDIR=$(topdir) \ USER_MAKE_VARS="$(USER_MAKE_VARS)" MAKE_LOG_FLAGS=$(MAKE_LOG_FLAGS) \ - LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) \ + LOG_LEVEL=$(LOG_LEVEL) LOG_NOFILE=$(LOG_NOFILE) LOG_CMDLINES=$(LOG_CMDLINES) \ INIT_TARGETS="$(INIT_TARGETS)" \ SEQUENTIAL_TARGETS="$(SEQUENTIAL_TARGETS)" \ PARALLEL_TARGETS="$(PARALLEL_TARGETS)" diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk index 2bf05d1eb29..6632a5c888b 100644 --- a/make/InitSupport.gmk +++ b/make/InitSupport.gmk @@ -121,6 +121,23 @@ ifeq ($(HAS_SPEC),) endif endef + # Look for a given option in the LOG variable, and if found, set a variable + # and remove the option from the LOG variable + # $1: The option to look for + # $2: The option to set to "true" if the option is found + define ParseLogOption + ifneq ($$(findstring $1, $$(LOG)),) + $2 := true + # COMMA is defined in spec.gmk, but that is not included yet + COMMA := , + # First try to remove ",