From bb0b55b7bbd1ef3b8ed8dc76e670422c5c521889 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Thu, 13 Nov 2014 15:45:45 -0800 Subject: [PATCH 01/89] 8064594: AARCH64: JDK changes Reviewed-by: dholmes, twisti, kvn --- jdk/make/lib/SoundLibraries.gmk | 4 +++ jdk/src/java.base/unix/conf/aarch64/jvm.cfg | 35 +++++++++++++++++++ .../unix/native/libjli/aarch64/jvm.cfg | 35 +++++++++++++++++++ .../share/native/libjsound/SoundDefs.h | 1 + 4 files changed, 75 insertions(+) create mode 100644 jdk/src/java.base/unix/conf/aarch64/jvm.cfg create mode 100644 jdk/src/java.base/unix/native/libjli/aarch64/jvm.cfg diff --git a/jdk/make/lib/SoundLibraries.gmk b/jdk/make/lib/SoundLibraries.gmk index 6348f7a7d7b..74c1f6f22c2 100644 --- a/jdk/make/lib/SoundLibraries.gmk +++ b/jdk/make/lib/SoundLibraries.gmk @@ -144,6 +144,10 @@ else ifeq ($(OPENJDK_TARGET_CPU), ppc64) LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64 endif + + ifeq ($(OPENJDK_TARGET_CPU), aarch64) + LIBJSOUND_CFLAGS += -DX_ARCH=X_AARCH64 + endif endif LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"' diff --git a/jdk/src/java.base/unix/conf/aarch64/jvm.cfg b/jdk/src/java.base/unix/conf/aarch64/jvm.cfg new file mode 100644 index 00000000000..be6bb934250 --- /dev/null +++ b/jdk/src/java.base/unix/conf/aarch64/jvm.cfg @@ -0,0 +1,35 @@ +# Copyright (c) 2003, 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. 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. +# +# +# List of JVMs that can be used as an option to java, javac, etc. +# Order is important -- first in this list is the default JVM. +# NOTE that this both this file and its format are UNSUPPORTED and +# WILL GO AWAY in a future release. +# +# You may also select a JVM in an arbitrary location with the +# "-XXaltjvm=" option, but that too is unsupported +# and may not be available in a future release. +# +-server KNOWN +-client IGNORE diff --git a/jdk/src/java.base/unix/native/libjli/aarch64/jvm.cfg b/jdk/src/java.base/unix/native/libjli/aarch64/jvm.cfg new file mode 100644 index 00000000000..be6bb934250 --- /dev/null +++ b/jdk/src/java.base/unix/native/libjli/aarch64/jvm.cfg @@ -0,0 +1,35 @@ +# Copyright (c) 2003, 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. 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. +# +# +# List of JVMs that can be used as an option to java, javac, etc. +# Order is important -- first in this list is the default JVM. +# NOTE that this both this file and its format are UNSUPPORTED and +# WILL GO AWAY in a future release. +# +# You may also select a JVM in an arbitrary location with the +# "-XXaltjvm=" option, but that too is unsupported +# and may not be available in a future release. +# +-server KNOWN +-client IGNORE diff --git a/jdk/src/java.desktop/share/native/libjsound/SoundDefs.h b/jdk/src/java.desktop/share/native/libjsound/SoundDefs.h index 90334cf9ff5..744ca77b371 100644 --- a/jdk/src/java.desktop/share/native/libjsound/SoundDefs.h +++ b/jdk/src/java.desktop/share/native/libjsound/SoundDefs.h @@ -43,6 +43,7 @@ #define X_ZERO 6 #define X_ARM 7 #define X_PPC 8 +#define X_AARCH64 9 // ********************************** // Make sure you set X_PLATFORM and X_ARCH defines correctly. From f97da658859e224dd9805b414e5e2df3f8355788 Mon Sep 17 00:00:00 2001 From: Xueming Shen Date: Fri, 16 Jan 2015 13:46:39 -0800 Subject: [PATCH 02/89] 8042262: Javadoc typo in java.util.Formatter To fix the simple typo in java doc Reviewed-by: rriggs, lancea --- jdk/src/java.base/share/classes/java/util/Formatter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/java.base/share/classes/java/util/Formatter.java b/jdk/src/java.base/share/classes/java/util/Formatter.java index a973ee6889e..ef07fcaef34 100644 --- a/jdk/src/java.base/share/classes/java/util/Formatter.java +++ b/jdk/src/java.base/share/classes/java/util/Formatter.java @@ -1835,7 +1835,7 @@ import sun.misc.FormattedFloatingDecimal; *

The maximum number of arguments is limited by the maximum dimension of a * Java array as defined by * The Java™ Virtual Machine Specification. - * If the argument index is does not correspond to an + * If the argument index does not correspond to an * available argument, then a {@link MissingFormatArgumentException} is thrown. * *

If there are more arguments than format specifiers, the extra arguments From 9800aaa84aa65ca3bb6c738c6f4fc8b5526e585c Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Fri, 16 Jan 2015 14:04:27 -0800 Subject: [PATCH 03/89] 8060077: Class.toGenericString specification doesn't mention array types Reviewed-by: psandoz, jfranck --- .../share/classes/java/lang/Class.java | 62 ++++++++++++------- .../java/lang/Class/GenericStringTest.java | 23 ++++++- 2 files changed, 62 insertions(+), 23 deletions(-) diff --git a/jdk/src/java.base/share/classes/java/lang/Class.java b/jdk/src/java.base/share/classes/java/lang/Class.java index 0fb2ef19a05..3a0c3fdf3e6 100644 --- a/jdk/src/java.base/share/classes/java/lang/Class.java +++ b/jdk/src/java.base/share/classes/java/lang/Class.java @@ -149,7 +149,8 @@ public final class Class implements java.io.Serializable, * {@code getName}. If this {@code Class} object represents a * primitive type, this method returns the name of the primitive type. If * this {@code Class} object represents void this method returns - * "void". + * "void". If this {@code Class} object represents an array type, + * this method returns "class " followed by {@code getName}. * * @return a string representation of this class object. */ @@ -174,6 +175,12 @@ public final class Class implements java.io.Serializable, * occur in canonical order. If there are no type parameters, the * type parameter list is elided. * + * For an array type, the string starts with the type name, + * followed by an angle-bracketed comma-separated list of the + * type's type parameters, if any, followed by a sequence of + * {@code []} characters, one set of brackets per dimension of + * the array. + * *

Note that since information about the runtime representation * of a type is being generated, modifiers not present on the * originating source code or illegal on the originating source @@ -189,29 +196,39 @@ public final class Class implements java.io.Serializable, return toString(); } else { StringBuilder sb = new StringBuilder(); + Class component = this; + int arrayDepth = 0; - // Class modifiers are a superset of interface modifiers - int modifiers = getModifiers() & Modifier.classModifiers(); - if (modifiers != 0) { - sb.append(Modifier.toString(modifiers)); - sb.append(' '); - } - - if (isAnnotation()) { - sb.append('@'); - } - if (isInterface()) { // Note: all annotation types are interfaces - sb.append("interface"); + if (isArray()) { + do { + arrayDepth++; + component = component.getComponentType(); + } while (component.isArray()); + sb.append(component.getName()); } else { - if (isEnum()) - sb.append("enum"); - else - sb.append("class"); - } - sb.append(' '); - sb.append(getName()); + // Class modifiers are a superset of interface modifiers + int modifiers = getModifiers() & Modifier.classModifiers(); + if (modifiers != 0) { + sb.append(Modifier.toString(modifiers)); + sb.append(' '); + } - TypeVariable[] typeparms = getTypeParameters(); + if (isAnnotation()) { + sb.append('@'); + } + if (isInterface()) { // Note: all annotation types are interfaces + sb.append("interface"); + } else { + if (isEnum()) + sb.append("enum"); + else + sb.append("class"); + } + sb.append(' '); + sb.append(getName()); + } + + TypeVariable[] typeparms = component.getTypeParameters(); if (typeparms.length > 0) { boolean first = true; sb.append('<'); @@ -224,6 +241,9 @@ public final class Class implements java.io.Serializable, sb.append('>'); } + for (int i = 0; i < arrayDepth; i++) + sb.append("[]"); + return sb.toString(); } } diff --git a/jdk/test/java/lang/Class/GenericStringTest.java b/jdk/test/java/lang/Class/GenericStringTest.java index cdd8c1ab4f6..176fcab043a 100644 --- a/jdk/test/java/lang/Class/GenericStringTest.java +++ b/jdk/test/java/lang/Class/GenericStringTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -34,10 +34,29 @@ import java.util.*; @ExpectedGenericString("public class GenericStringTest") public class GenericStringTest { - public static void main(String... args){ + public Map[] mixed = null; + public Map[][] mixed2 = null; + + public static void main(String... args) throws ReflectiveOperationException { int failures = 0; + String[][] nested = {{""}}; + int[][] intArray = {{1}}; + failures += checkToGenericString(int.class, "int"); + failures += checkToGenericString(void.class, "void"); + failures += checkToGenericString(args.getClass(), "java.lang.String[]"); + failures += checkToGenericString(nested.getClass(), "java.lang.String[][]"); + failures += checkToGenericString(intArray.getClass(), "int[][]"); + failures += checkToGenericString(java.util.Map.class, "public abstract interface java.util.Map"); + + Field f = GenericStringTest.class.getDeclaredField("mixed"); + // The expected value includes "" rather than + // "<...String,...Integer>" since the Class object rather than + // Type objects is being queried. + failures += checkToGenericString(f.getType(), "java.util.Map[]"); + f = GenericStringTest.class.getDeclaredField("mixed2"); + failures += checkToGenericString(f.getType(), "java.util.Map[][]"); Class[] types = { GenericStringTest.class, From bba288a91afe0c37fc80de8d9a54bc5ee9b29f6a Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Mon, 19 Jan 2015 09:05:50 +0100 Subject: [PATCH 04/89] 8068748: missing US_export_policy.jar in jdk9-b44 is causing compilation errors building jdk9 source code Reviewed-by: ihse, wetmore --- jdk/make/gendata/GendataPolicyJars.gmk | 184 ++++++++++++------------- 1 file changed, 89 insertions(+), 95 deletions(-) diff --git a/jdk/make/gendata/GendataPolicyJars.gmk b/jdk/make/gendata/GendataPolicyJars.gmk index 0ef6ddcc9e5..9364159f129 100644 --- a/jdk/make/gendata/GendataPolicyJars.gmk +++ b/jdk/make/gendata/GendataPolicyJars.gmk @@ -35,65 +35,62 @@ include JavaCompilation.gmk US_EXPORT_POLICY_JAR_DST := \ $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/US_export_policy.jar -ifneq ($(BUILD_CRYPTO), no) - - US_EXPORT_POLICY_JAR_LIMITED := \ - $(SUPPORT_OUTPUTDIR)/jce/policy/limited/US_export_policy.jar - US_EXPORT_POLICY_JAR_UNLIMITED := \ - $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy.jar - - ifndef OPENJDK - # - # In past releases, Oracle JDK has had a separately downloadable set of - # policy files which has been a nightmare for deployment. - # - # Now if we're closed and limited (default for Oracle JDK), create - # an "unlimited_policy" directory that contains the unlimited policy - # files. It will be up to the user/deployer to make an informed choice - # as to whether they are legally entitled to use the unlimited policy - # file in their environment. Users/deployers simply need to overwrite - # the files. Consult README.txt (below) for more info. - # - UNLIMITED_POLICY_DIR := \ - $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/unlimited_policy - endif +US_EXPORT_POLICY_JAR_LIMITED := \ + $(SUPPORT_OUTPUTDIR)/jce/policy/limited/US_export_policy.jar +US_EXPORT_POLICY_JAR_UNLIMITED := \ + $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy.jar +ifndef OPENJDK # - # TODO fix so that SetupArchive does not write files into SRCS - # then we don't need this extra copying + # In past releases, Oracle JDK has had a separately downloadable set of + # policy files which has been a nightmare for deployment. # - # NOTE: We currently do not place restrictions on our limited export - # policy. This was not a typo. This means we are shipping the same file - # for both limited and unlimited US_export_policy.jar. Only the local - # policy file currently has restrictions. + # Now if we're closed and limited (default for Oracle JDK), create + # an "unlimited_policy" directory that contains the unlimited policy + # files. It will be up to the user/deployer to make an informed choice + # as to whether they are legally entitled to use the unlimited policy + # file in their environment. Users/deployers simply need to overwrite + # the files. Consult README.txt (below) for more info. # - US_EXPORT_POLICY_JAR_SRC_DIR := \ - $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited - US_EXPORT_POLICY_JAR_TMP := \ - $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy_jar.tmp + UNLIMITED_POLICY_DIR := \ + $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/unlimited_policy +endif - $(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/% +# +# TODO fix so that SetupArchive does not write files into SRCS +# then we don't need this extra copying +# +# NOTE: We currently do not place restrictions on our limited export +# policy. This was not a typo. This means we are shipping the same file +# for both limited and unlimited US_export_policy.jar. Only the local +# policy file currently has restrictions. +# +US_EXPORT_POLICY_JAR_SRC_DIR := \ + $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited +US_EXPORT_POLICY_JAR_TMP := \ + $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/US_export_policy_jar.tmp + +$(US_EXPORT_POLICY_JAR_TMP)/%: $(US_EXPORT_POLICY_JAR_SRC_DIR)/% $(install-file) - US_EXPORT_POLICY_JAR_DEPS := \ - $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy +US_EXPORT_POLICY_JAR_DEPS := \ + $(US_EXPORT_POLICY_JAR_TMP)/default_US_export.policy - $(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, \ - $(US_EXPORT_POLICY_JAR_DEPS), \ - SRCS := $(US_EXPORT_POLICY_JAR_TMP), \ - SUFFIXES := .policy, \ - JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED), \ - EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \ - SKIP_METAINF := true)) +$(eval $(call SetupArchive,BUILD_US_EXPORT_POLICY_JAR, \ + $(US_EXPORT_POLICY_JAR_DEPS), \ + SRCS := $(US_EXPORT_POLICY_JAR_TMP), \ + SUFFIXES := .policy, \ + JAR := $(US_EXPORT_POLICY_JAR_UNLIMITED), \ + EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \ + SKIP_METAINF := true)) - $(US_EXPORT_POLICY_JAR_LIMITED): \ - $(US_EXPORT_POLICY_JAR_UNLIMITED) - $(ECHO) $(LOG_INFO) \ - Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@) - $(install-file) +$(US_EXPORT_POLICY_JAR_LIMITED): \ + $(US_EXPORT_POLICY_JAR_UNLIMITED) + $(ECHO) $(LOG_INFO) \ + Copying unlimited $(patsubst $(OUTPUT_ROOT)/%,%,$@) + $(install-file) - TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED) $(US_EXPORT_POLICY_JAR_UNLIMITED) -endif +TARGETS += $(US_EXPORT_POLICY_JAR_LIMITED) $(US_EXPORT_POLICY_JAR_UNLIMITED) ifeq ($(UNLIMITED_CRYPTO), true) $(US_EXPORT_POLICY_JAR_DST): $(US_EXPORT_POLICY_JAR_UNLIMITED) @@ -119,57 +116,54 @@ POLICY_JARS += $(US_EXPORT_POLICY_JAR_DST) LOCAL_POLICY_JAR_DST := \ $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/security/local_policy.jar -ifneq ($(BUILD_CRYPTO), no) +LOCAL_POLICY_JAR_LIMITED := \ + $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy.jar +LOCAL_POLICY_JAR_UNLIMITED := \ + $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy.jar - LOCAL_POLICY_JAR_LIMITED := \ - $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy.jar - LOCAL_POLICY_JAR_UNLIMITED := \ - $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy.jar +# +# TODO fix so that SetupArchive does not write files into SRCS +# then we don't need this extra copying +# +LOCAL_POLICY_JAR_LIMITED_TMP := \ + $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy_jar.tmp +LOCAL_POLICY_JAR_UNLIMITED_TMP := \ + $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy_jar.tmp - # - # TODO fix so that SetupArchive does not write files into SRCS - # then we don't need this extra copying - # - LOCAL_POLICY_JAR_LIMITED_TMP := \ - $(SUPPORT_OUTPUTDIR)/jce/policy/limited/local_policy_jar.tmp - LOCAL_POLICY_JAR_UNLIMITED_TMP := \ - $(SUPPORT_OUTPUTDIR)/jce/policy/unlimited/local_policy_jar.tmp +$(LOCAL_POLICY_JAR_LIMITED_TMP)/%: \ + $(JDK_TOPDIR)/make/data/cryptopolicy/limited/% + $(install-file) - $(LOCAL_POLICY_JAR_LIMITED_TMP)/%: \ - $(JDK_TOPDIR)/make/data/cryptopolicy/limited/% +$(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: \ + $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/% + $(install-file) + +$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \ + $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \ + $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \ + SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \ + SUFFIXES := .policy, \ + JAR := $(LOCAL_POLICY_JAR_LIMITED), \ + EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \ + SKIP_METAINF := true)) + +$(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \ + $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \ + SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \ + SUFFIXES := .policy, \ + JAR := $(LOCAL_POLICY_JAR_UNLIMITED), \ + EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \ + SKIP_METAINF := true)) + +TARGETS += $(LOCAL_POLICY_JAR_LIMITED) $(LOCAL_POLICY_JAR_UNLIMITED) + +ifndef OPENJDK + ifneq ($(UNLIMITED_CRYPTO), true) + $(UNLIMITED_POLICY_DIR)/README.txt: \ + $(JDK_TOPDIR)/make/closed/data/cryptopolicy/README.txt $(install-file) - $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/%: \ - $(JDK_TOPDIR)/make/data/cryptopolicy/unlimited/% - $(install-file) - - $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_LIMITED, \ - $(LOCAL_POLICY_JAR_LIMITED_TMP)/exempt_local.policy \ - $(LOCAL_POLICY_JAR_LIMITED_TMP)/default_local.policy, \ - SRCS := $(LOCAL_POLICY_JAR_LIMITED_TMP), \ - SUFFIXES := .policy, \ - JAR := $(LOCAL_POLICY_JAR_LIMITED), \ - EXTRA_MANIFEST_ATTR := Crypto-Strength: limited, \ - SKIP_METAINF := true)) - - $(eval $(call SetupArchive,BUILD_LOCAL_POLICY_JAR_UNLIMITED, \ - $(LOCAL_POLICY_JAR_UNLIMITED_TMP)/default_local.policy, \ - SRCS := $(LOCAL_POLICY_JAR_UNLIMITED_TMP), \ - SUFFIXES := .policy, \ - JAR := $(LOCAL_POLICY_JAR_UNLIMITED), \ - EXTRA_MANIFEST_ATTR := Crypto-Strength: unlimited, \ - SKIP_METAINF := true)) - - TARGETS += $(LOCAL_POLICY_JAR_LIMITED) $(LOCAL_POLICY_JAR_UNLIMITED) - - ifndef OPENJDK - ifneq ($(UNLIMITED_CRYPTO), true) - $(UNLIMITED_POLICY_DIR)/README.txt: \ - $(JDK_TOPDIR)/make/closed/data/cryptopolicy/README.txt - $(install-file) - - TARGETS += $(UNLIMITED_POLICY_DIR)/README.txt - endif + TARGETS += $(UNLIMITED_POLICY_DIR)/README.txt endif endif From a7cd12f10ac36e8708faa9702ee7d05899a14ccc Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Mon, 19 Jan 2015 19:12:11 +0300 Subject: [PATCH 05/89] 8067951: System.loadLibrary cannot find library when path contains quoted entry Reviewed-by: sherman, rriggs, alanb --- .../classes/java/lang/ClassLoaderHelper.java | 7 +- .../share/classes/java/lang/ClassLoader.java | 73 ++++++++++------ .../classes/java/lang/ClassLoaderHelper.java | 7 +- .../classes/java/lang/ClassLoaderHelper.java | 7 +- .../lang/ClassLoader/LibraryPathProperty.java | 84 +++++++++++++++++++ 5 files changed, 148 insertions(+), 30 deletions(-) create mode 100644 jdk/test/java/lang/ClassLoader/LibraryPathProperty.java diff --git a/jdk/src/java.base/macosx/classes/java/lang/ClassLoaderHelper.java b/jdk/src/java.base/macosx/classes/java/lang/ClassLoaderHelper.java index 22f500f52af..6c2466c1f1e 100644 --- a/jdk/src/java.base/macosx/classes/java/lang/ClassLoaderHelper.java +++ b/jdk/src/java.base/macosx/classes/java/lang/ClassLoaderHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -30,6 +30,11 @@ class ClassLoaderHelper { private ClassLoaderHelper() {} + /** + * Indicates, whether PATH env variable is allowed to contain quoted entries. + */ + static final boolean allowsQuotedPathElements = false; + /** * Returns an alternate path name for the given file * such that if the original pathname did not exist, then the diff --git a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java index a033a76964e..82e6960fe52 100644 --- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -1747,35 +1747,54 @@ public abstract class ClassLoader { private static String usr_paths[]; private static String sys_paths[]; - private static String[] initializePath(String propname) { - String ldpath = System.getProperty(propname, ""); - String ps = File.pathSeparator; - int ldlen = ldpath.length(); - int i, j, n; - // Count the separators in the path - i = ldpath.indexOf(ps); - n = 0; - while (i >= 0) { - n++; - i = ldpath.indexOf(ps, i + 1); - } + private static String[] initializePath(String propName) { + String ldPath = System.getProperty(propName, ""); + int ldLen = ldPath.length(); + char ps = File.pathSeparatorChar; + int psCount = 0; - // allocate the array of paths - n :'s = n + 1 path elements - String[] paths = new String[n + 1]; - - // Fill the array with paths from the ldpath - n = i = 0; - j = ldpath.indexOf(ps); - while (j >= 0) { - if (j - i > 0) { - paths[n++] = ldpath.substring(i, j); - } else if (j - i == 0) { - paths[n++] = "."; + if (ClassLoaderHelper.allowsQuotedPathElements && + ldPath.indexOf('\"') >= 0) { + // First, remove quotes put around quoted parts of paths. + // Second, use a quotation mark as a new path separator. + // This will preserve any quoted old path separators. + char[] buf = new char[ldLen]; + int bufLen = 0; + for (int i = 0; i < ldLen; ++i) { + char ch = ldPath.charAt(i); + if (ch == '\"') { + while (++i < ldLen && + (ch = ldPath.charAt(i)) != '\"') { + buf[bufLen++] = ch; + } + } else { + if (ch == ps) { + psCount++; + ch = '\"'; + } + buf[bufLen++] = ch; + } + } + ldPath = new String(buf, 0, bufLen); + ldLen = bufLen; + ps = '\"'; + } else { + for (int i = ldPath.indexOf(ps); i >= 0; + i = ldPath.indexOf(ps, i + 1)) { + psCount++; } - i = j + 1; - j = ldpath.indexOf(ps, i); } - paths[n] = ldpath.substring(i, ldlen); + + String[] paths = new String[psCount + 1]; + int pathStart = 0; + for (int j = 0; j < psCount; ++j) { + int pathEnd = ldPath.indexOf(ps, pathStart); + paths[j] = (pathStart < pathEnd) ? + ldPath.substring(pathStart, pathEnd) : "."; + pathStart = pathEnd + 1; + } + paths[psCount] = (pathStart < ldLen) ? + ldPath.substring(pathStart, ldLen) : "."; return paths; } diff --git a/jdk/src/java.base/unix/classes/java/lang/ClassLoaderHelper.java b/jdk/src/java.base/unix/classes/java/lang/ClassLoaderHelper.java index f9baf8ac6c7..8edd60ef360 100644 --- a/jdk/src/java.base/unix/classes/java/lang/ClassLoaderHelper.java +++ b/jdk/src/java.base/unix/classes/java/lang/ClassLoaderHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -30,6 +30,11 @@ class ClassLoaderHelper { private ClassLoaderHelper() {} + /** + * Indicates, whether PATH env variable is allowed to contain quoted entries. + */ + static final boolean allowsQuotedPathElements = false; + /** * Returns an alternate path name for the given file * such that if the original pathname did not exist, then the diff --git a/jdk/src/java.base/windows/classes/java/lang/ClassLoaderHelper.java b/jdk/src/java.base/windows/classes/java/lang/ClassLoaderHelper.java index f9baf8ac6c7..d99f5fff14c 100644 --- a/jdk/src/java.base/windows/classes/java/lang/ClassLoaderHelper.java +++ b/jdk/src/java.base/windows/classes/java/lang/ClassLoaderHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -30,6 +30,11 @@ class ClassLoaderHelper { private ClassLoaderHelper() {} + /** + * Indicates, whether PATH env variable is allowed to contain quoted entries. + */ + static final boolean allowsQuotedPathElements = true; + /** * Returns an alternate path name for the given file * such that if the original pathname did not exist, then the diff --git a/jdk/test/java/lang/ClassLoader/LibraryPathProperty.java b/jdk/test/java/lang/ClassLoader/LibraryPathProperty.java new file mode 100644 index 00000000000..684ccb22687 --- /dev/null +++ b/jdk/test/java/lang/ClassLoader/LibraryPathProperty.java @@ -0,0 +1,84 @@ +/* + * 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 8067951 + * @summary Unit test for internal ClassLoader#initializePath(). + * Quoted entries should get unquoted on Windows. + * Empty entries should be replaced with dot. + * @library /lib/testlibrary + * @build jdk.testlibrary.Platform + * @run main LibraryPathProperty + */ + +import java.lang.reflect.Method; +import java.io.File; +import java.util.Arrays; +import jdk.testlibrary.Platform; + +public class LibraryPathProperty { + + static final String propName = "test.property.name"; + static final String SP = File.pathSeparator; + static Method method; + + public static void main(String[] args) throws Throwable { + method = ClassLoader.class + .getDeclaredMethod("initializePath", + String.class); + method.setAccessible(true); + + test("", "."); + test(SP, ".", "."); + test("a" + SP, "a", "."); + test(SP + "b", ".", "b"); + test("a" + SP + SP + "b", "a", ".", "b"); + + if (Platform.isWindows()) { + // on Windows parts of paths may be quoted + test("\"\"", "."); + test("\"\"" + SP, ".", "."); + test(SP + "\"\"", ".", "."); + test("a" + SP + "\"b\"" + SP, "a", "b", "."); + test(SP + "\"a\"" + SP + SP + "b", ".", "a", ".", "b"); + test("\"a\"" + SP + "\"b\"", "a", "b"); + test("\"/a/\"b" + SP + "c", "/a/b", "c"); + test("\"/a;b\"" + SP + "c", "/a;b", "c"); + test("\"/a:b\"" + SP + "c", "/a:b", "c"); + test("\"/a" + SP + "b\"" + SP + "c", "/a" + SP + "b", "c"); + test("/\"a\"\";\"\"b\"" + SP + "\"c\"", "/a;b", "c"); + test("/\"a:\"b" + SP + "c", "/a:b", "c"); + } + } + + static void test(String s, String... expected) throws Throwable { + System.setProperty(propName, s); + String[] res = (String[])method.invoke(null, propName); + if (!Arrays.asList(res).equals(Arrays.asList(expected))) { + throw new RuntimeException("Parsing [" + s + "] " + + " result " + Arrays.asList(res) + + " doesn't match " + Arrays.asList(expected)); + } + } +} From c06b7a8915188ee77ad67abf0375658e22509957 Mon Sep 17 00:00:00 2001 From: Felix Yang Date: Tue, 20 Jan 2015 13:49:28 +0000 Subject: [PATCH 06/89] 8061448: Cleanup sun/misc/JarIndex tests to remove the check for the jre directory Reviewed-by: chegar --- .../misc/JarIndex/JarIndexMergeForClassLoaderTest.java | 9 +-------- jdk/test/sun/misc/JarIndex/metaInfFilenames/Basic.java | 10 +--------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/jdk/test/sun/misc/JarIndex/JarIndexMergeForClassLoaderTest.java b/jdk/test/sun/misc/JarIndex/JarIndexMergeForClassLoaderTest.java index 2084c3c11a7..b00795e3eef 100644 --- a/jdk/test/sun/misc/JarIndex/JarIndexMergeForClassLoaderTest.java +++ b/jdk/test/sun/misc/JarIndex/JarIndexMergeForClassLoaderTest.java @@ -48,14 +48,7 @@ public class JarIndexMergeForClassLoaderTest { static final File tmpFolder = new File(testClassesDir); static { - String javaHome = System.getProperty("java.home"); - if (javaHome.endsWith("jre")) { - int index = javaHome.lastIndexOf(slash); - if (index != -1) - javaHome = javaHome.substring(0, index); - } - - jar = javaHome + slash + "bin" + slash + "jar"; + jar = System.getProperty("java.home") + slash + "bin" + slash + "jar"; } public static void main(String[] args) throws Exception { diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/Basic.java b/jdk/test/sun/misc/JarIndex/metaInfFilenames/Basic.java index dffc5a0639d..8b0e3ec9a62 100644 --- a/jdk/test/sun/misc/JarIndex/metaInfFilenames/Basic.java +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/Basic.java @@ -78,7 +78,6 @@ import com.sun.net.httpserver.HttpServer; * URLClassLoader. Each request to the HTTP server is recorded to ensure * only the correct amount of requests are being made. * - * Note: Needs jdk/lib/tools.jar in the classpath to compile and run. */ public class Basic { @@ -160,14 +159,7 @@ public class Basic { static String jar; static { - String javaHome = System.getProperty("java.home"); - if (javaHome.endsWith("jre")) { - int index = javaHome.lastIndexOf(slash); - if (index != -1) - javaHome = javaHome.substring(0, index); - } - - jar = javaHome + slash+ "bin" + slash + "jar"; + jar = System.getProperty("java.home") + slash+ "bin" + slash + "jar"; } /* create the index */ From a84794e3d6796f1772dd57138b41083f0e18d224 Mon Sep 17 00:00:00 2001 From: Lev Priima Date: Tue, 20 Jan 2015 13:56:01 +0000 Subject: [PATCH 07/89] 8068795: HttpServer missing tailing space for some response codes Reviewed-by: chegar --- .../classes/sun/net/httpserver/Code.java | 2 +- .../net/httpserver/MissingTrailingSpace.java | 143 ++++++++++++++++++ 2 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 jdk/test/com/sun/net/httpserver/MissingTrailingSpace.java diff --git a/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/Code.java b/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/Code.java index 032dbb79da5..6b86b8fa5bd 100644 --- a/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/Code.java +++ b/jdk/src/jdk.httpserver/share/classes/sun/net/httpserver/Code.java @@ -103,7 +103,7 @@ class Code { case HTTP_UNAVAILABLE: return " Service Unavailable"; case HTTP_GATEWAY_TIMEOUT: return " Gateway Timeout"; case HTTP_VERSION: return " HTTP Version Not Supported"; - default: return ""; + default: return " "; } } } diff --git a/jdk/test/com/sun/net/httpserver/MissingTrailingSpace.java b/jdk/test/com/sun/net/httpserver/MissingTrailingSpace.java new file mode 100644 index 00000000000..5ecb0745f01 --- /dev/null +++ b/jdk/test/com/sun/net/httpserver/MissingTrailingSpace.java @@ -0,0 +1,143 @@ +/* + * 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 8068795 + * @summary HttpServer missing tailing space for some response codes + * @author lev.priima@oracle.com + */ + +import java.net.InetSocketAddress; +import java.io.InputStreamReader; +import java.io.IOException; +import java.io.BufferedReader; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.net.Socket; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; + +public class MissingTrailingSpace { + + private static final int noMsgCode = 207; + private static final String someContext = "/context"; + + public static void main(String[] args) throws Exception { + HttpServer server = HttpServer.create(new InetSocketAddress(0), 0); + try { + server.setExecutor(Executors.newFixedThreadPool(1)); + server.createContext(someContext, new HttpHandler() { + @Override + public void handle(HttpExchange msg) { + try { + try { + msg.sendResponseHeaders(noMsgCode, -1); + } catch(IOException ioe) { + ioe.printStackTrace(); + } + } finally { + msg.close(); + } + } + }); + server.start(); + System.out.println("Server started at port " + + server.getAddress().getPort()); + + runRawSocketHttpClient("localhost", server.getAddress().getPort()); + } finally { + ((ExecutorService)server.getExecutor()).shutdown(); + server.stop(0); + } + System.out.println("Server finished."); + } + + static void runRawSocketHttpClient(String hostname, int port) + throws Exception + { + Socket socket = null; + PrintWriter writer = null; + BufferedReader reader = null; + final String CRLF = "\r\n"; + try { + socket = new Socket(hostname, port); + writer = new PrintWriter(new OutputStreamWriter( + socket.getOutputStream())); + System.out.println("Client connected by socket: " + socket); + + writer.print("GET " + someContext + "/ HTTP/1.1" + CRLF); + writer.print("User-Agent: Java/" + + System.getProperty("java.version") + + CRLF); + writer.print("Host: " + hostname + CRLF); + writer.print("Accept: */*" + CRLF); + writer.print("Connection: keep-alive" + CRLF); + writer.print(CRLF); // Important, else the server will expect that + // there's more into the request. + writer.flush(); + System.out.println("Client wrote rquest to socket: " + socket); + + reader = new BufferedReader(new InputStreamReader( + socket.getInputStream())); + System.out.println("Client start reading from server:" ); + String line = reader.readLine(); + if ( !line.endsWith(" ") ) { + throw new RuntimeException("respond to unknown code " + + noMsgCode + + " doesn't return space at the end of the first header.\n" + + "Should be: " + "\"" + line + " \"" + + ", but returns: " + "\"" + line + "\"."); + } + for (; line != null; line = reader.readLine()) { + if (line.isEmpty()) { + break; + } + System.out.println("\"" + line + "\""); + } + System.out.println("Client finished reading from server" ); + } finally { + if (reader != null) + try { + reader.close(); + } catch (IOException logOrIgnore) { + logOrIgnore.printStackTrace(); + } + if (writer != null) { + writer.close(); + } + if (socket != null) { + try { + socket.close(); + } catch (IOException logOrIgnore) { + logOrIgnore.printStackTrace(); + } + } + } + System.out.println("Client finished." ); + } +} + From f60dba6c5f4a2d88a82e4cbacb1ea938213f98dd Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Fri, 6 Feb 2015 10:14:59 -0800 Subject: [PATCH 08/89] 8072053: AARCH64: remove src/java.base/unix/native/libjli/aarch64/jvm.cfg Reviewed-by: kvn --- .../unix/native/libjli/aarch64/jvm.cfg | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 jdk/src/java.base/unix/native/libjli/aarch64/jvm.cfg diff --git a/jdk/src/java.base/unix/native/libjli/aarch64/jvm.cfg b/jdk/src/java.base/unix/native/libjli/aarch64/jvm.cfg deleted file mode 100644 index be6bb934250..00000000000 --- a/jdk/src/java.base/unix/native/libjli/aarch64/jvm.cfg +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2003, 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. 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. -# -# -# List of JVMs that can be used as an option to java, javac, etc. -# Order is important -- first in this list is the default JVM. -# NOTE that this both this file and its format are UNSUPPORTED and -# WILL GO AWAY in a future release. -# -# You may also select a JVM in an arbitrary location with the -# "-XXaltjvm=" option, but that too is unsupported -# and may not be available in a future release. -# --server KNOWN --client IGNORE From 7727fe00442b6345991bf9c31ec450b4bafd0414 Mon Sep 17 00:00:00 2001 From: Marcus Larsson Date: Fri, 13 Feb 2015 09:48:49 +0100 Subject: [PATCH 09/89] 8072621: Clean up around VM_GC_Operations Reviewed-by: brutisso, jmasa --- .../concurrentMarkSweep/vmCMSOperations.hpp | 6 +-- .../gc_implementation/g1/g1CollectedHeap.cpp | 38 +++++++++---------- .../gc_implementation/g1/g1CollectedHeap.hpp | 24 ++++++------ .../g1/g1CollectedHeap.inline.hpp | 6 +-- .../gc_implementation/g1/vm_operations_g1.cpp | 18 ++++----- .../gc_implementation/g1/vm_operations_g1.hpp | 16 ++++---- .../parallelScavenge/parallelScavengeHeap.cpp | 8 ++-- .../parallelScavenge/vmPSOperations.cpp | 8 ++-- .../parallelScavenge/vmPSOperations.hpp | 7 ++-- .../shared/vmGCOperations.hpp | 33 ++++++++-------- .../src/share/vm/memory/collectorPolicy.cpp | 6 +-- hotspot/src/share/vm/runtime/globals.hpp | 2 +- 12 files changed, 84 insertions(+), 88 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp index 35c846a1921..70de0e5f9c8 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -129,8 +129,8 @@ class VM_CMS_Final_Remark: public VM_CMS_Operation { // GenCollectedHeap heap. class VM_GenCollectFullConcurrent: public VM_GC_Operation { public: - VM_GenCollectFullConcurrent(unsigned int gc_count_before, - unsigned int full_gc_count_before, + VM_GenCollectFullConcurrent(uint gc_count_before, + uint full_gc_count_before, GCCause::Cause gc_cause) : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */) { diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 6759dd96761..f694d18a7f2 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -333,7 +333,7 @@ void YoungList::print() { HeapRegion* lists[] = {_head, _survivor_head}; const char* names[] = {"YOUNG", "SURVIVOR"}; - for (unsigned int list = 0; list < ARRAY_SIZE(lists); ++list) { + for (uint list = 0; list < ARRAY_SIZE(lists); ++list) { gclog_or_tty->print_cr("%s LIST CONTENTS", names[list]); HeapRegion *curr = lists[list]; if (curr == NULL) @@ -765,8 +765,8 @@ HeapWord* G1CollectedHeap::allocate_new_tlab(size_t word_size) { assert_heap_not_locked_and_not_at_safepoint(); assert(!is_humongous(word_size), "we do not allow humongous TLABs"); - unsigned int dummy_gc_count_before; - int dummy_gclocker_retry_count = 0; + uint dummy_gc_count_before; + uint dummy_gclocker_retry_count = 0; return attempt_allocation(word_size, &dummy_gc_count_before, &dummy_gclocker_retry_count); } @@ -776,8 +776,8 @@ G1CollectedHeap::mem_allocate(size_t word_size, assert_heap_not_locked_and_not_at_safepoint(); // Loop until the allocation is satisfied, or unsatisfied after GC. - for (int try_count = 1, gclocker_retry_count = 0; /* we'll return */; try_count += 1) { - unsigned int gc_count_before; + for (uint try_count = 1, gclocker_retry_count = 0; /* we'll return */; try_count += 1) { + uint gc_count_before; HeapWord* result = NULL; if (!is_humongous(word_size)) { @@ -829,8 +829,8 @@ G1CollectedHeap::mem_allocate(size_t word_size, HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, AllocationContext_t context, - unsigned int *gc_count_before_ret, - int* gclocker_retry_count_ret) { + uint* gc_count_before_ret, + uint* gclocker_retry_count_ret) { // Make sure you read the note in attempt_allocation_humongous(). assert_heap_not_locked_and_not_at_safepoint(); @@ -847,7 +847,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, HeapWord* result = NULL; for (int try_count = 1; /* we'll return */; try_count += 1) { bool should_try_gc; - unsigned int gc_count_before; + uint gc_count_before; { MutexLockerEx x(Heap_lock); @@ -891,7 +891,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, if (should_try_gc) { bool succeeded; result = do_collection_pause(word_size, gc_count_before, &succeeded, - GCCause::_g1_inc_collection_pause); + GCCause::_g1_inc_collection_pause); if (result != NULL) { assert(succeeded, "only way to get back a non-NULL result"); return result; @@ -945,8 +945,8 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, } HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, - unsigned int * gc_count_before_ret, - int* gclocker_retry_count_ret) { + uint* gc_count_before_ret, + uint* gclocker_retry_count_ret) { // The structure of this method has a lot of similarities to // attempt_allocation_slow(). The reason these two were not merged // into a single one is that such a method would require several "if @@ -979,7 +979,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, HeapWord* result = NULL; for (int try_count = 1; /* we'll return */; try_count += 1) { bool should_try_gc; - unsigned int gc_count_before; + uint gc_count_before; { MutexLockerEx x(Heap_lock); @@ -1017,7 +1017,7 @@ HeapWord* G1CollectedHeap::attempt_allocation_humongous(size_t word_size, bool succeeded; result = do_collection_pause(word_size, gc_count_before, &succeeded, - GCCause::_g1_humongous_allocation); + GCCause::_g1_humongous_allocation); if (result != NULL) { assert(succeeded, "only way to get back a non-NULL result"); return result; @@ -1815,7 +1815,7 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : assert(n_rem_sets > 0, "Invariant."); _worker_cset_start_region = NEW_C_HEAP_ARRAY(HeapRegion*, n_queues, mtGC); - _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(unsigned int, n_queues, mtGC); + _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC); _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC); for (int i = 0; i < n_queues; i++) { @@ -2396,9 +2396,9 @@ G1YCType G1CollectedHeap::yc_type() { void G1CollectedHeap::collect(GCCause::Cause cause) { assert_heap_not_locked(); - unsigned int gc_count_before; - unsigned int old_marking_count_before; - unsigned int full_gc_count_before; + uint gc_count_before; + uint old_marking_count_before; + uint full_gc_count_before; bool retry_gc; do { @@ -3418,7 +3418,7 @@ void G1CollectedHeap::gc_epilogue(bool full) { } HeapWord* G1CollectedHeap::do_collection_pause(size_t word_size, - unsigned int gc_count_before, + uint gc_count_before, bool* succeeded, GCCause::Cause gc_cause) { assert_heap_not_locked_and_not_at_safepoint(); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index 3286453095c..fa51a4b29c5 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -325,11 +325,11 @@ private: // Keeps track of how many "old marking cycles" (i.e., Full GCs or // concurrent cycles) we have started. - volatile unsigned int _old_marking_cycles_started; + volatile uint _old_marking_cycles_started; // Keeps track of how many "old marking cycles" (i.e., Full GCs or // concurrent cycles) we have completed. - volatile unsigned int _old_marking_cycles_completed; + volatile uint _old_marking_cycles_completed; bool _concurrent_cycle_started; bool _heap_summary_sent; @@ -497,22 +497,22 @@ protected: // the mutator alloc region without taking the Heap_lock. This // should only be used for non-humongous allocations. inline HeapWord* attempt_allocation(size_t word_size, - unsigned int* gc_count_before_ret, - int* gclocker_retry_count_ret); + uint* gc_count_before_ret, + uint* gclocker_retry_count_ret); // Second-level mutator allocation attempt: take the Heap_lock and // retry the allocation attempt, potentially scheduling a GC // pause. This should only be used for non-humongous allocations. HeapWord* attempt_allocation_slow(size_t word_size, AllocationContext_t context, - unsigned int* gc_count_before_ret, - int* gclocker_retry_count_ret); + uint* gc_count_before_ret, + uint* gclocker_retry_count_ret); // Takes the Heap_lock and attempts a humongous allocation. It can // potentially schedule a GC pause. HeapWord* attempt_allocation_humongous(size_t word_size, - unsigned int* gc_count_before_ret, - int* gclocker_retry_count_ret); + uint* gc_count_before_ret, + uint* gclocker_retry_count_ret); // Allocation attempt that should be called during safepoints (e.g., // at the end of a successful GC). expect_null_mutator_alloc_region @@ -686,7 +686,7 @@ public: // +ExplicitGCInvokesConcurrent). void increment_old_marking_cycles_completed(bool concurrent); - unsigned int old_marking_cycles_completed() { + uint old_marking_cycles_completed() { return _old_marking_cycles_completed; } @@ -745,7 +745,7 @@ protected: // methods that call do_collection_pause() release the Heap_lock // before the call, so it's easy to read gc_count_before just before. HeapWord* do_collection_pause(size_t word_size, - unsigned int gc_count_before, + uint gc_count_before, bool* succeeded, GCCause::Cause gc_cause); @@ -981,7 +981,7 @@ protected: // The heap region entry for a given worker is valid iff // the associated time stamp value matches the current value // of G1CollectedHeap::_gc_time_stamp. - unsigned int* _worker_cset_start_region_time_stamp; + uint* _worker_cset_start_region_time_stamp; enum G1H_process_roots_tasks { G1H_PS_filter_satb_buffers, diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp index ba1bf5f6bd9..1ca08b98851 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -131,8 +131,8 @@ inline bool G1CollectedHeap::obj_in_cs(oop obj) { } inline HeapWord* G1CollectedHeap::attempt_allocation(size_t word_size, - unsigned int* gc_count_before_ret, - int* gclocker_retry_count_ret) { + uint* gc_count_before_ret, + uint* gclocker_retry_count_ret) { assert_heap_not_locked_and_not_at_safepoint(); assert(!is_humongous(word_size), "attempt_allocation() should not " "be called for humongous allocation requests"); diff --git a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp index 6196ca9ccbf..85221b24b20 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,9 +34,8 @@ #include "gc_implementation/g1/vm_operations_g1.hpp" #include "runtime/interfaceSupport.hpp" -VM_G1CollectForAllocation::VM_G1CollectForAllocation( - unsigned int gc_count_before, - size_t word_size) +VM_G1CollectForAllocation::VM_G1CollectForAllocation(uint gc_count_before, + size_t word_size) : VM_G1OperationWithAllocRequest(gc_count_before, word_size, GCCause::_allocation_failure) { guarantee(word_size > 0, "an allocation should always be requested"); @@ -57,12 +56,11 @@ void VM_G1CollectFull::doit() { g1h->do_full_collection(false /* clear_all_soft_refs */); } -VM_G1IncCollectionPause::VM_G1IncCollectionPause( - unsigned int gc_count_before, - size_t word_size, - bool should_initiate_conc_mark, - double target_pause_time_ms, - GCCause::Cause gc_cause) +VM_G1IncCollectionPause::VM_G1IncCollectionPause(uint gc_count_before, + size_t word_size, + bool should_initiate_conc_mark, + double target_pause_time_ms, + GCCause::Cause gc_cause) : VM_G1OperationWithAllocRequest(gc_count_before, word_size, gc_cause), _should_initiate_conc_mark(should_initiate_conc_mark), _target_pause_time_ms(target_pause_time_ms), diff --git a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp index c8014d41577..9a22fe49acc 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,8 +44,8 @@ protected: AllocationContext_t _allocation_context; public: - VM_G1OperationWithAllocRequest(unsigned int gc_count_before, - size_t word_size, + VM_G1OperationWithAllocRequest(uint gc_count_before, + size_t word_size, GCCause::Cause gc_cause) : VM_GC_Operation(gc_count_before, gc_cause), _word_size(word_size), _result(NULL), _pause_succeeded(false) { } @@ -57,8 +57,8 @@ public: class VM_G1CollectFull: public VM_GC_Operation { public: - VM_G1CollectFull(unsigned int gc_count_before, - unsigned int full_gc_count_before, + VM_G1CollectFull(uint gc_count_before, + uint full_gc_count_before, GCCause::Cause cause) : VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { } virtual VMOp_Type type() const { return VMOp_G1CollectFull; } @@ -70,7 +70,7 @@ public: class VM_G1CollectForAllocation: public VM_G1OperationWithAllocRequest { public: - VM_G1CollectForAllocation(unsigned int gc_count_before, + VM_G1CollectForAllocation(uint gc_count_before, size_t word_size); virtual VMOp_Type type() const { return VMOp_G1CollectForAllocation; } virtual void doit(); @@ -84,9 +84,9 @@ private: bool _should_initiate_conc_mark; bool _should_retry_gc; double _target_pause_time_ms; - unsigned int _old_marking_cycles_completed_before; + uint _old_marking_cycles_completed_before; public: - VM_G1IncCollectionPause(unsigned int gc_count_before, + VM_G1IncCollectionPause(uint gc_count_before, size_t word_size, bool should_initiate_conc_mark, double target_pause_time_ms, diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp index d9515ada2de..39ee16a48f6 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -260,7 +260,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate( uint loop_count = 0; uint gc_count = 0; - int gclocker_stalled_count = 0; + uint gclocker_stalled_count = 0; while (result == NULL) { // We don't want to have multiple collections for a single filled generation. @@ -520,8 +520,8 @@ void ParallelScavengeHeap::collect(GCCause::Cause cause) { assert(!Heap_lock->owned_by_self(), "this thread should not own the Heap_lock"); - unsigned int gc_count = 0; - unsigned int full_gc_count = 0; + uint gc_count = 0; + uint full_gc_count = 0; { MutexLocker ml(Heap_lock); // This value is guarded by the Heap_lock diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp index 3a8f347bc8d..10f8dceb57d 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -33,7 +33,7 @@ // The following methods are used by the parallel scavenge collector VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size, - unsigned int gc_count) : + uint gc_count) : VM_GC_Operation(gc_count, GCCause::_allocation_failure), _size(size), _result(NULL) @@ -55,8 +55,8 @@ void VM_ParallelGCFailedAllocation::doit() { } // Only used for System.gc() calls -VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count, - unsigned int full_gc_count, +VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(uint gc_count, + uint full_gc_count, GCCause::Cause gc_cause) : VM_GC_Operation(gc_count, gc_cause, full_gc_count, true /* full */) { diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp index 53ac77dc42d..20111e481ce 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -35,7 +35,7 @@ class VM_ParallelGCFailedAllocation: public VM_GC_Operation { HeapWord* _result; public: - VM_ParallelGCFailedAllocation(size_t size, unsigned int gc_count); + VM_ParallelGCFailedAllocation(size_t size, uint gc_count); virtual VMOp_Type type() const { return VMOp_ParallelGCFailedAllocation; @@ -47,8 +47,7 @@ class VM_ParallelGCFailedAllocation: public VM_GC_Operation { class VM_ParallelGCSystemGC: public VM_GC_Operation { public: - VM_ParallelGCSystemGC(unsigned int gc_count, unsigned int full_gc_count, - GCCause::Cause gc_cause); + VM_ParallelGCSystemGC(uint gc_count, uint full_gc_count, GCCause::Cause gc_cause); virtual VMOp_Type type() const { return VMOp_ParallelGCSystemGC; } virtual void doit(); }; diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp index 8f60dcbdb2a..06b109ac478 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -66,13 +66,13 @@ class VM_GC_Operation: public VM_Operation { protected: - BasicLock _pending_list_basic_lock; // for refs pending list notification (PLL) - unsigned int _gc_count_before; // gc count before acquiring PLL - unsigned int _full_gc_count_before; // full gc count before acquiring PLL - bool _full; // whether a "full" collection - bool _prologue_succeeded; // whether doit_prologue succeeded + BasicLock _pending_list_basic_lock; // for refs pending list notification (PLL) + uint _gc_count_before; // gc count before acquiring PLL + uint _full_gc_count_before; // full gc count before acquiring PLL + bool _full; // whether a "full" collection + bool _prologue_succeeded; // whether doit_prologue succeeded GCCause::Cause _gc_cause; // the putative cause for this gc op - bool _gc_locked; // will be set if gc was locked + bool _gc_locked; // will be set if gc was locked virtual bool skip_operation() const; @@ -81,9 +81,9 @@ class VM_GC_Operation: public VM_Operation { void release_and_notify_pending_list_lock(); public: - VM_GC_Operation(unsigned int gc_count_before, + VM_GC_Operation(uint gc_count_before, GCCause::Cause _cause, - unsigned int full_gc_count_before = 0, + uint full_gc_count_before = 0, bool full = false) { _full = full; _prologue_succeeded = false; @@ -169,7 +169,7 @@ class VM_GenCollectForAllocation: public VM_GC_Operation { public: VM_GenCollectForAllocation(size_t size, bool tlab, - unsigned int gc_count_before) + uint gc_count_before) : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure), _size(size), _tlab(tlab) { @@ -181,17 +181,16 @@ class VM_GenCollectForAllocation: public VM_GC_Operation { HeapWord* result() const { return _res; } }; - // VM operation to invoke a collection of the heap as a // GenCollectedHeap heap. class VM_GenCollectFull: public VM_GC_Operation { private: int _max_level; public: - VM_GenCollectFull(unsigned int gc_count_before, - unsigned int full_gc_count_before, + VM_GenCollectFull(uint gc_count_before, + uint full_gc_count_before, GCCause::Cause gc_cause, - int max_level) + int max_level) : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true /* full */), _max_level(max_level) { } ~VM_GenCollectFull() {} @@ -208,9 +207,9 @@ class VM_CollectForMetadataAllocation: public VM_GC_Operation { public: VM_CollectForMetadataAllocation(ClassLoaderData* loader_data, size_t size, Metaspace::MetadataType mdtype, - unsigned int gc_count_before, - unsigned int full_gc_count_before, - GCCause::Cause gc_cause) + uint gc_count_before, + uint full_gc_count_before, + GCCause::Cause gc_cause) : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true), _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) { } diff --git a/hotspot/src/share/vm/memory/collectorPolicy.cpp b/hotspot/src/share/vm/memory/collectorPolicy.cpp index 917c8ffb899..90b8011c9cc 100644 --- a/hotspot/src/share/vm/memory/collectorPolicy.cpp +++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -597,7 +597,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size, HeapWord* result = NULL; // Loop until the allocation is satisfied, or unsatisfied after GC. - for (int try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) { + for (uint try_count = 1, gclocker_stalled_count = 0; /* return or throw */; try_count += 1) { HandleMark hm; // Discard any handles allocated in each iteration. // First allocation attempt is lock-free. @@ -611,7 +611,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size, return result; } } - unsigned int gc_count_before; // Read inside the Heap_lock locked region. + uint gc_count_before; // Read inside the Heap_lock locked region. { MutexLocker ml(Heap_lock); if (PrintGC && Verbose) { diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index b161162729a..606056ef521 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1516,7 +1516,7 @@ class CommandLineFlags { "How much the GC can expand the eden by while the GC locker " \ "is active (as a percentage)") \ \ - diagnostic(intx, GCLockerRetryAllocationCount, 2, \ + diagnostic(uintx, GCLockerRetryAllocationCount, 2, \ "Number of times to retry allocations when " \ "blocked by the GC locker") \ \ From 71cfff7df1a408dd5981060babe5c0e7934fb7f7 Mon Sep 17 00:00:00 2001 From: Marcus Larsson Date: Fri, 13 Feb 2015 10:31:52 +0100 Subject: [PATCH 10/89] 8066771: Refactor VM GC operations caused by allocation failure Reviewed-by: brutisso, jmasa --- .../gc_implementation/g1/vm_operations_g1.cpp | 6 ++-- .../gc_implementation/g1/vm_operations_g1.hpp | 9 ++---- .../parallelScavenge/vmPSOperations.cpp | 10 +++--- .../parallelScavenge/vmPSOperations.hpp | 10 ++---- .../shared/vmGCOperations.cpp | 6 ++-- .../shared/vmGCOperations.hpp | 31 +++++++++++++------ 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp index 85221b24b20..47267f21d53 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp @@ -38,7 +38,7 @@ VM_G1CollectForAllocation::VM_G1CollectForAllocation(uint gc_count_before, size_t word_size) : VM_G1OperationWithAllocRequest(gc_count_before, word_size, GCCause::_allocation_failure) { - guarantee(word_size > 0, "an allocation should always be requested"); + guarantee(word_size != 0, "An allocation should always be requested with this operation."); } void VM_G1CollectForAllocation::doit() { @@ -73,7 +73,7 @@ VM_G1IncCollectionPause::VM_G1IncCollectionPause(uint gc_count_before, } bool VM_G1IncCollectionPause::doit_prologue() { - bool res = VM_GC_Operation::doit_prologue(); + bool res = VM_G1OperationWithAllocRequest::doit_prologue(); if (!res) { if (_should_initiate_conc_mark) { // The prologue can fail for a couple of reasons. The first is that another GC @@ -163,7 +163,7 @@ void VM_G1IncCollectionPause::doit() { } void VM_G1IncCollectionPause::doit_epilogue() { - VM_GC_Operation::doit_epilogue(); + VM_G1OperationWithAllocRequest::doit_epilogue(); // If the pause was initiated by a System.gc() and // +ExplicitGCInvokesConcurrent, we have to wait here for the cycle diff --git a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp index 9a22fe49acc..265eb37d36f 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.hpp @@ -36,10 +36,8 @@ // - VM_G1CollectForAllocation // - VM_G1IncCollectionPause -class VM_G1OperationWithAllocRequest: public VM_GC_Operation { +class VM_G1OperationWithAllocRequest : public VM_CollectForAllocation { protected: - size_t _word_size; - HeapWord* _result; bool _pause_succeeded; AllocationContext_t _allocation_context; @@ -47,9 +45,8 @@ public: VM_G1OperationWithAllocRequest(uint gc_count_before, size_t word_size, GCCause::Cause gc_cause) - : VM_GC_Operation(gc_count_before, gc_cause), - _word_size(word_size), _result(NULL), _pause_succeeded(false) { } - HeapWord* result() { return _result; } + : VM_CollectForAllocation(word_size, gc_count_before, gc_cause), + _pause_succeeded(false) {} bool pause_succeeded() { return _pause_succeeded; } void set_allocation_context(AllocationContext_t context) { _allocation_context = context; } AllocationContext_t allocation_context() { return _allocation_context; } diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp index 10f8dceb57d..9148bb4ffc0 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp @@ -32,12 +32,10 @@ #include "utilities/dtrace.hpp" // The following methods are used by the parallel scavenge collector -VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t size, +VM_ParallelGCFailedAllocation::VM_ParallelGCFailedAllocation(size_t word_size, uint gc_count) : - VM_GC_Operation(gc_count, GCCause::_allocation_failure), - _size(size), - _result(NULL) -{ + VM_CollectForAllocation(word_size, gc_count, GCCause::_allocation_failure) { + assert(word_size != 0, "An allocation should always be requested with this operation."); } void VM_ParallelGCFailedAllocation::doit() { @@ -47,7 +45,7 @@ void VM_ParallelGCFailedAllocation::doit() { assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "must be a ParallelScavengeHeap"); GCCauseSetter gccs(heap, _gc_cause); - _result = heap->failed_mem_allocate(_size); + _result = heap->failed_mem_allocate(_word_size); if (_result == NULL && GC_locker::is_active_and_needs_gc()) { set_gc_locked(); diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp index 20111e481ce..7ffe251618a 100644 --- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.hpp @@ -29,20 +29,14 @@ #include "gc_implementation/shared/vmGCOperations.hpp" #include "gc_interface/gcCause.hpp" -class VM_ParallelGCFailedAllocation: public VM_GC_Operation { - private: - size_t _size; - HeapWord* _result; - +class VM_ParallelGCFailedAllocation : public VM_CollectForAllocation { public: - VM_ParallelGCFailedAllocation(size_t size, uint gc_count); + VM_ParallelGCFailedAllocation(size_t word_size, uint gc_count); virtual VMOp_Type type() const { return VMOp_ParallelGCFailedAllocation; } virtual void doit(); - - HeapWord* result() const { return _result; } }; class VM_ParallelGCSystemGC: public VM_GC_Operation { diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp index b80332b2ab1..425ec595ff8 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp @@ -179,10 +179,10 @@ void VM_GenCollectForAllocation::doit() { GenCollectedHeap* gch = GenCollectedHeap::heap(); GCCauseSetter gccs(gch, _gc_cause); - _res = gch->satisfy_failed_allocation(_size, _tlab); - assert(gch->is_in_reserved_or_null(_res), "result not in heap"); + _result = gch->satisfy_failed_allocation(_word_size, _tlab); + assert(gch->is_in_reserved_or_null(_result), "result not in heap"); - if (_res == NULL && GC_locker::is_active_and_needs_gc()) { + if (_result == NULL && GC_locker::is_active_and_needs_gc()) { set_gc_locked(); } } diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp index 06b109ac478..0c2ca8018a8 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp @@ -38,11 +38,12 @@ // VM_Operation // VM_GC_Operation // VM_GC_HeapInspection -// VM_GenCollectForAllocation // VM_GenCollectFull // VM_GenCollectFullConcurrent -// VM_ParallelGCFailedAllocation // VM_ParallelGCSystemGC +// VM_CollectForAllocation +// VM_GenCollectForAllocation +// VM_ParallelGCFailedAllocation // VM_GC_Operation // - implements methods common to all classes in the hierarchy: // prevents multiple gc requests and manages lock on heap; @@ -51,6 +52,7 @@ // - prints class histogram on SIGBREAK if PrintClassHistogram // is specified; and also the attach "inspectheap" operation // +// VM_CollectForAllocation // VM_GenCollectForAllocation // VM_ParallelGCFailedAllocation // - this operation is invoked when allocation is failed; @@ -160,25 +162,34 @@ class VM_GC_HeapInspection: public VM_GC_Operation { bool collect(); }; +class VM_CollectForAllocation : public VM_GC_Operation { + protected: + size_t _word_size; // Size of object to be allocated (in number of words) + HeapWord* _result; // Allocation result (NULL if allocation failed) -class VM_GenCollectForAllocation: public VM_GC_Operation { + public: + VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause) + : VM_GC_Operation(gc_count_before, cause), _result(NULL), _word_size(word_size) {} + + HeapWord* result() const { + return _result; + } +}; + +class VM_GenCollectForAllocation : public VM_CollectForAllocation { private: - HeapWord* _res; - size_t _size; // size of object to be allocated. bool _tlab; // alloc is of a tlab. public: - VM_GenCollectForAllocation(size_t size, + VM_GenCollectForAllocation(size_t word_size, bool tlab, uint gc_count_before) - : VM_GC_Operation(gc_count_before, GCCause::_allocation_failure), - _size(size), + : VM_CollectForAllocation(word_size, gc_count_before, GCCause::_allocation_failure), _tlab(tlab) { - _res = NULL; + assert(word_size != 0, "An allocation should always be requested with this operation."); } ~VM_GenCollectForAllocation() {} virtual VMOp_Type type() const { return VMOp_GenCollectForAllocation; } virtual void doit(); - HeapWord* result() const { return _res; } }; // VM operation to invoke a collection of the heap as a From c132a5a0a58dae6984d9059c45e95721bbe09b76 Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Tue, 10 Feb 2015 17:16:17 +0100 Subject: [PATCH 11/89] 8072910: Move the g1EvacFailure.hpp implementation to g1EvacFailure.cpp Reviewed-by: jwilhelm, tschatzl --- hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp | 1 + .../vm/gc_implementation/g1/g1EvacFailure.cpp | 239 ++++++++++++++++++ .../vm/gc_implementation/g1/g1EvacFailure.hpp | 223 +--------------- 3 files changed, 249 insertions(+), 214 deletions(-) create mode 100644 hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.cpp diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp index 9cb22c11433..b79b1582bb7 100644 --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp @@ -29,6 +29,7 @@ #include "interp_masm_ppc_64.hpp" #include "interpreter/interpreterRuntime.hpp" #include "prims/jvmtiThreadState.hpp" +#include "runtime/sharedRuntime.hpp" #ifdef PRODUCT #define BLOCK_COMMENT(str) // nothing diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.cpp new file mode 100644 index 00000000000..a369a5b7ae1 --- /dev/null +++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.cpp @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2012, 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 "gc_implementation/g1/concurrentMark.inline.hpp" +#include "gc_implementation/g1/dirtyCardQueue.hpp" +#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" +#include "gc_implementation/g1/g1EvacFailure.hpp" +#include "gc_implementation/g1/g1_globals.hpp" +#include "gc_implementation/g1/g1OopClosures.inline.hpp" +#include "gc_implementation/g1/heapRegion.hpp" +#include "gc_implementation/g1/heapRegionRemSet.hpp" + +class UpdateRSetDeferred : public OopsInHeapRegionClosure { +private: + G1CollectedHeap* _g1; + DirtyCardQueue *_dcq; + G1SATBCardTableModRefBS* _ct_bs; + +public: + UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) : + _g1(g1), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {} + + 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(_from->is_in_reserved(p), "paranoia"); + if (!_from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) && + !_from->is_survivor()) { + size_t card_index = _ct_bs->index_for(p); + if (_ct_bs->mark_card_deferred(card_index)) { + _dcq->enqueue((jbyte*)_ct_bs->byte_for_index(card_index)); + } + } + } +}; + +class RemoveSelfForwardPtrObjClosure: public ObjectClosure { +private: + G1CollectedHeap* _g1; + ConcurrentMark* _cm; + HeapRegion* _hr; + size_t _marked_bytes; + OopsInHeapRegionClosure *_update_rset_cl; + bool _during_initial_mark; + bool _during_conc_mark; + uint _worker_id; + HeapWord* _end_of_last_gap; + HeapWord* _last_gap_threshold; + HeapWord* _last_obj_threshold; + +public: + RemoveSelfForwardPtrObjClosure(G1CollectedHeap* g1, ConcurrentMark* cm, + HeapRegion* hr, + OopsInHeapRegionClosure* update_rset_cl, + bool during_initial_mark, + bool during_conc_mark, + uint worker_id) : + _g1(g1), _cm(cm), _hr(hr), _marked_bytes(0), + _update_rset_cl(update_rset_cl), + _during_initial_mark(during_initial_mark), + _during_conc_mark(during_conc_mark), + _worker_id(worker_id), + _end_of_last_gap(hr->bottom()), + _last_gap_threshold(hr->bottom()), + _last_obj_threshold(hr->bottom()) { } + + size_t marked_bytes() { return _marked_bytes; } + + // + // The original idea here was to coalesce evacuated and dead objects. + // However that caused complications with the block offset table (BOT). + // In particular if there were two TLABs, one of them partially refined. + // |----- TLAB_1--------|----TLAB_2-~~~(partially refined part)~~~| + // The BOT entries of the unrefined part of TLAB_2 point to the start + // of TLAB_2. If the last object of the TLAB_1 and the first object + // of TLAB_2 are coalesced, then the cards of the unrefined part + // would point into middle of the filler object. + // The current approach is to not coalesce and leave the BOT contents intact. + // + // + // We now reset the BOT when we start the object iteration over the + // region and refine its entries for every object we come across. So + // the above comment is not really relevant and we should be able + // to coalesce dead objects if we want to. + void do_object(oop obj) { + HeapWord* obj_addr = (HeapWord*) obj; + assert(_hr->is_in(obj_addr), "sanity"); + size_t obj_size = obj->size(); + HeapWord* obj_end = obj_addr + obj_size; + + if (_end_of_last_gap != obj_addr) { + // there was a gap before obj_addr + _last_gap_threshold = _hr->cross_threshold(_end_of_last_gap, obj_addr); + } + + if (obj->is_forwarded() && obj->forwardee() == obj) { + // The object failed to move. + + // We consider all objects that we find self-forwarded to be + // live. What we'll do is that we'll update the prev marking + // info so that they are all under PTAMS and explicitly marked. + if (!_cm->isPrevMarked(obj)) { + _cm->markPrev(obj); + } + if (_during_initial_mark) { + // For the next marking info we'll only mark the + // self-forwarded objects explicitly if we are during + // initial-mark (since, normally, we only mark objects pointed + // to by roots if we succeed in copying them). By marking all + // self-forwarded objects we ensure that we mark any that are + // still pointed to be roots. During concurrent marking, and + // after initial-mark, we don't need to mark any objects + // explicitly and all objects in the CSet are considered + // (implicitly) live. So, we won't mark them explicitly and + // we'll leave them over NTAMS. + _cm->grayRoot(obj, obj_size, _worker_id, _hr); + } + _marked_bytes += (obj_size * HeapWordSize); + obj->set_mark(markOopDesc::prototype()); + + // While we were processing RSet buffers during the collection, + // we actually didn't scan any cards on the collection set, + // since we didn't want to update remembered sets with entries + // that point into the collection set, given that live objects + // from the collection set are about to move and such entries + // will be stale very soon. + // This change also dealt with a reliability issue which + // involved scanning a card in the collection set and coming + // across an array that was being chunked and looking malformed. + // The problem is that, if evacuation fails, we might have + // remembered set entries missing given that we skipped cards on + // the collection set. So, we'll recreate such entries now. + obj->oop_iterate(_update_rset_cl); + } else { + + // The object has been either evacuated or is dead. Fill it with a + // dummy object. + MemRegion mr(obj_addr, obj_size); + CollectedHeap::fill_with_object(mr); + + // must nuke all dead objects which we skipped when iterating over the region + _cm->clearRangePrevBitmap(MemRegion(_end_of_last_gap, obj_end)); + } + _end_of_last_gap = obj_end; + _last_obj_threshold = _hr->cross_threshold(obj_addr, obj_end); + } +}; + +class RemoveSelfForwardPtrHRClosure: public HeapRegionClosure { + G1CollectedHeap* _g1h; + ConcurrentMark* _cm; + uint _worker_id; + HeapRegionClaimer* _hrclaimer; + + DirtyCardQueue _dcq; + UpdateRSetDeferred _update_rset_cl; + +public: + RemoveSelfForwardPtrHRClosure(G1CollectedHeap* g1h, + uint worker_id, + HeapRegionClaimer* hrclaimer) : + _g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq), + _worker_id(worker_id), _cm(_g1h->concurrent_mark()), _hrclaimer(hrclaimer) { + } + + bool doHeapRegion(HeapRegion *hr) { + bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause(); + bool during_conc_mark = _g1h->mark_in_progress(); + + assert(!hr->is_humongous(), "sanity"); + assert(hr->in_collection_set(), "bad CS"); + + if (_hrclaimer->claim_region(hr->hrm_index())) { + if (hr->evacuation_failed()) { + RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, &_update_rset_cl, + during_initial_mark, + during_conc_mark, + _worker_id); + + hr->note_self_forwarding_removal_start(during_initial_mark, + during_conc_mark); + _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr); + + // In the common case (i.e. when there is no evacuation + // failure) we make sure that the following is done when + // the region is freed so that it is "ready-to-go" when it's + // re-allocated. However, when evacuation failure happens, a + // region will remain in the heap and might ultimately be added + // to a CSet in the future. So we have to be careful here and + // make sure the region's RSet is ready for parallel iteration + // whenever this might be required in the future. + hr->rem_set()->reset_for_par_iteration(); + hr->reset_bot(); + _update_rset_cl.set_region(hr); + hr->object_iterate(&rspc); + + hr->rem_set()->clean_strong_code_roots(hr); + + hr->note_self_forwarding_removal_end(during_initial_mark, + during_conc_mark, + rspc.marked_bytes()); + } + } + return false; + } +}; + +G1ParRemoveSelfForwardPtrsTask::G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h) : + AbstractGangTask("G1 Remove Self-forwarding Pointers"), _g1h(g1h), + _hrclaimer(g1h->workers()->active_workers()) {} + +void G1ParRemoveSelfForwardPtrsTask::work(uint worker_id) { + RemoveSelfForwardPtrHRClosure rsfp_cl(_g1h, worker_id, &_hrclaimer); + + HeapRegion* hr = _g1h->start_cset_region_for_worker(worker_id); + _g1h->collection_set_iterate_from(hr, &rsfp_cl); +} diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp index 96c675f42ec..709bd03a7d7 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1EvacFailure.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -25,229 +25,24 @@ #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP #define SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP -#include "gc_implementation/g1/concurrentMark.inline.hpp" -#include "gc_implementation/g1/dirtyCardQueue.hpp" -#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" -#include "gc_implementation/g1/g1_globals.hpp" -#include "gc_implementation/g1/g1OopClosures.inline.hpp" -#include "gc_implementation/g1/heapRegion.hpp" -#include "gc_implementation/g1/heapRegionRemSet.hpp" +#include "gc_implementation/g1/g1OopClosures.hpp" +#include "gc_implementation/g1/heapRegionManager.hpp" +#include "utilities/globalDefinitions.hpp" #include "utilities/workgroup.hpp" -// Closures and tasks associated with any self-forwarding pointers +class G1CollectedHeap; + +// Task to fixup self-forwarding pointers // installed as a result of an evacuation failure. - -class UpdateRSetDeferred : public OopsInHeapRegionClosure { -private: - G1CollectedHeap* _g1; - DirtyCardQueue *_dcq; - G1SATBCardTableModRefBS* _ct_bs; - -public: - UpdateRSetDeferred(G1CollectedHeap* g1, DirtyCardQueue* dcq) : - _g1(g1), _ct_bs(_g1->g1_barrier_set()), _dcq(dcq) {} - - 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(_from->is_in_reserved(p), "paranoia"); - if (!_from->is_in_reserved(oopDesc::load_decode_heap_oop(p)) && - !_from->is_survivor()) { - size_t card_index = _ct_bs->index_for(p); - if (_ct_bs->mark_card_deferred(card_index)) { - _dcq->enqueue((jbyte*)_ct_bs->byte_for_index(card_index)); - } - } - } -}; - -class RemoveSelfForwardPtrObjClosure: public ObjectClosure { -private: - G1CollectedHeap* _g1; - ConcurrentMark* _cm; - HeapRegion* _hr; - size_t _marked_bytes; - OopsInHeapRegionClosure *_update_rset_cl; - bool _during_initial_mark; - bool _during_conc_mark; - uint _worker_id; - HeapWord* _end_of_last_gap; - HeapWord* _last_gap_threshold; - HeapWord* _last_obj_threshold; - -public: - RemoveSelfForwardPtrObjClosure(G1CollectedHeap* g1, ConcurrentMark* cm, - HeapRegion* hr, - OopsInHeapRegionClosure* update_rset_cl, - bool during_initial_mark, - bool during_conc_mark, - uint worker_id) : - _g1(g1), _cm(cm), _hr(hr), _marked_bytes(0), - _update_rset_cl(update_rset_cl), - _during_initial_mark(during_initial_mark), - _during_conc_mark(during_conc_mark), - _worker_id(worker_id), - _end_of_last_gap(hr->bottom()), - _last_gap_threshold(hr->bottom()), - _last_obj_threshold(hr->bottom()) { } - - size_t marked_bytes() { return _marked_bytes; } - - // - // The original idea here was to coalesce evacuated and dead objects. - // However that caused complications with the block offset table (BOT). - // In particular if there were two TLABs, one of them partially refined. - // |----- TLAB_1--------|----TLAB_2-~~~(partially refined part)~~~| - // The BOT entries of the unrefined part of TLAB_2 point to the start - // of TLAB_2. If the last object of the TLAB_1 and the first object - // of TLAB_2 are coalesced, then the cards of the unrefined part - // would point into middle of the filler object. - // The current approach is to not coalesce and leave the BOT contents intact. - // - // - // We now reset the BOT when we start the object iteration over the - // region and refine its entries for every object we come across. So - // the above comment is not really relevant and we should be able - // to coalesce dead objects if we want to. - void do_object(oop obj) { - HeapWord* obj_addr = (HeapWord*) obj; - assert(_hr->is_in(obj_addr), "sanity"); - size_t obj_size = obj->size(); - HeapWord* obj_end = obj_addr + obj_size; - - if (_end_of_last_gap != obj_addr) { - // there was a gap before obj_addr - _last_gap_threshold = _hr->cross_threshold(_end_of_last_gap, obj_addr); - } - - if (obj->is_forwarded() && obj->forwardee() == obj) { - // The object failed to move. - - // We consider all objects that we find self-forwarded to be - // live. What we'll do is that we'll update the prev marking - // info so that they are all under PTAMS and explicitly marked. - if (!_cm->isPrevMarked(obj)) { - _cm->markPrev(obj); - } - if (_during_initial_mark) { - // For the next marking info we'll only mark the - // self-forwarded objects explicitly if we are during - // initial-mark (since, normally, we only mark objects pointed - // to by roots if we succeed in copying them). By marking all - // self-forwarded objects we ensure that we mark any that are - // still pointed to be roots. During concurrent marking, and - // after initial-mark, we don't need to mark any objects - // explicitly and all objects in the CSet are considered - // (implicitly) live. So, we won't mark them explicitly and - // we'll leave them over NTAMS. - _cm->grayRoot(obj, obj_size, _worker_id, _hr); - } - _marked_bytes += (obj_size * HeapWordSize); - obj->set_mark(markOopDesc::prototype()); - - // While we were processing RSet buffers during the collection, - // we actually didn't scan any cards on the collection set, - // since we didn't want to update remembered sets with entries - // that point into the collection set, given that live objects - // from the collection set are about to move and such entries - // will be stale very soon. - // This change also dealt with a reliability issue which - // involved scanning a card in the collection set and coming - // across an array that was being chunked and looking malformed. - // The problem is that, if evacuation fails, we might have - // remembered set entries missing given that we skipped cards on - // the collection set. So, we'll recreate such entries now. - obj->oop_iterate(_update_rset_cl); - } else { - - // The object has been either evacuated or is dead. Fill it with a - // dummy object. - MemRegion mr(obj_addr, obj_size); - CollectedHeap::fill_with_object(mr); - - // must nuke all dead objects which we skipped when iterating over the region - _cm->clearRangePrevBitmap(MemRegion(_end_of_last_gap, obj_end)); - } - _end_of_last_gap = obj_end; - _last_obj_threshold = _hr->cross_threshold(obj_addr, obj_end); - } -}; - -class RemoveSelfForwardPtrHRClosure: public HeapRegionClosure { - G1CollectedHeap* _g1h; - ConcurrentMark* _cm; - uint _worker_id; - HeapRegionClaimer* _hrclaimer; - - DirtyCardQueue _dcq; - UpdateRSetDeferred _update_rset_cl; - -public: - RemoveSelfForwardPtrHRClosure(G1CollectedHeap* g1h, - uint worker_id, - HeapRegionClaimer* hrclaimer) : - _g1h(g1h), _dcq(&g1h->dirty_card_queue_set()), _update_rset_cl(g1h, &_dcq), - _worker_id(worker_id), _cm(_g1h->concurrent_mark()), _hrclaimer(hrclaimer) { - } - - bool doHeapRegion(HeapRegion *hr) { - bool during_initial_mark = _g1h->g1_policy()->during_initial_mark_pause(); - bool during_conc_mark = _g1h->mark_in_progress(); - - assert(!hr->is_humongous(), "sanity"); - assert(hr->in_collection_set(), "bad CS"); - - if (_hrclaimer->claim_region(hr->hrm_index())) { - if (hr->evacuation_failed()) { - RemoveSelfForwardPtrObjClosure rspc(_g1h, _cm, hr, &_update_rset_cl, - during_initial_mark, - during_conc_mark, - _worker_id); - - hr->note_self_forwarding_removal_start(during_initial_mark, - during_conc_mark); - _g1h->check_bitmaps("Self-Forwarding Ptr Removal", hr); - - // In the common case (i.e. when there is no evacuation - // failure) we make sure that the following is done when - // the region is freed so that it is "ready-to-go" when it's - // re-allocated. However, when evacuation failure happens, a - // region will remain in the heap and might ultimately be added - // to a CSet in the future. So we have to be careful here and - // make sure the region's RSet is ready for parallel iteration - // whenever this might be required in the future. - hr->rem_set()->reset_for_par_iteration(); - hr->reset_bot(); - _update_rset_cl.set_region(hr); - hr->object_iterate(&rspc); - - hr->rem_set()->clean_strong_code_roots(hr); - - hr->note_self_forwarding_removal_end(during_initial_mark, - during_conc_mark, - rspc.marked_bytes()); - } - } - return false; - } -}; - class G1ParRemoveSelfForwardPtrsTask: public AbstractGangTask { protected: G1CollectedHeap* _g1h; HeapRegionClaimer _hrclaimer; public: - G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h) : - AbstractGangTask("G1 Remove Self-forwarding Pointers"), _g1h(g1h), - _hrclaimer(g1h->workers()->active_workers()) {} + G1ParRemoveSelfForwardPtrsTask(G1CollectedHeap* g1h); - void work(uint worker_id) { - RemoveSelfForwardPtrHRClosure rsfp_cl(_g1h, worker_id, &_hrclaimer); - - HeapRegion* hr = _g1h->start_cset_region_for_worker(worker_id); - _g1h->collection_set_iterate_from(hr, &rsfp_cl); - } + void work(uint worker_id); }; #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP From 0b5dffb33755ad9b54c341c559d627a20382f86f Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Wed, 11 Feb 2015 15:22:43 -0800 Subject: [PATCH 12/89] 8054888: Runtime: Add Diagnostic Command that prints the class hierarchy Added the VM.class_hierarhcy DCMD Reviewed-by: stefank, miauno --- .../src/share/vm/memory/heapInspection.cpp | 216 +++++++++++++++++- .../src/share/vm/memory/heapInspection.hpp | 26 ++- .../src/share/vm/runtime/vm_operations.cpp | 9 +- .../src/share/vm/runtime/vm_operations.hpp | 19 +- .../share/vm/services/diagnosticCommand.cpp | 35 ++- .../share/vm/services/diagnosticCommand.hpp | 30 ++- hotspot/test/Makefile | 2 +- .../dcmd/vm/ClassHierarchyTest.java | 199 ++++++++++++++++ 8 files changed, 524 insertions(+), 12 deletions(-) create mode 100644 hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java diff --git a/hotspot/src/share/vm/memory/heapInspection.cpp b/hotspot/src/share/vm/memory/heapInspection.cpp index 415ae6732cc..3bf8f0018db 100644 --- a/hotspot/src/share/vm/memory/heapInspection.cpp +++ b/hotspot/src/share/vm/memory/heapInspection.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/classLoaderData.hpp" +#include "classfile/systemDictionary.hpp" #include "gc_interface/collectedHeap.hpp" #include "memory/genCollectedHeap.hpp" #include "memory/heapInspection.hpp" @@ -39,6 +40,19 @@ PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC // HeapInspection +inline KlassInfoEntry::~KlassInfoEntry() { + if (_subclasses != NULL) { + delete _subclasses; + } +} + +inline void KlassInfoEntry::add_subclass(KlassInfoEntry* cie) { + if (_subclasses == NULL) { + _subclasses = new (ResourceObj::C_HEAP, mtInternal) GrowableArray(4, true); + } + _subclasses->append(cie); +} + int KlassInfoEntry::compare(KlassInfoEntry* e1, KlassInfoEntry* e2) { if(e1->_instance_words > e2->_instance_words) { return -1; @@ -129,7 +143,7 @@ void KlassInfoTable::AllClassesFinder::do_klass(Klass* k) { _table->lookup(k); } -KlassInfoTable::KlassInfoTable(bool need_class_stats) { +KlassInfoTable::KlassInfoTable(bool add_all_classes) { _size_of_instances_in_words = 0; _size = 0; _ref = (HeapWord*) Universe::boolArrayKlassObj(); @@ -141,7 +155,7 @@ KlassInfoTable::KlassInfoTable(bool need_class_stats) { for (int index = 0; index < _size; index++) { _buckets[index].initialize(); } - if (need_class_stats) { + if (add_all_classes) { AllClassesFinder finder(this); ClassLoaderDataGraph::classes_do(&finder); } @@ -299,6 +313,191 @@ PRAGMA_DIAG_POP st->cr(); } +class HierarchyClosure : public KlassInfoClosure { +private: + GrowableArray *_elements; +public: + HierarchyClosure(GrowableArray *_elements) : _elements(_elements) {} + + void do_cinfo(KlassInfoEntry* cie) { + // ignore array classes + if (cie->klass()->oop_is_instance()) { + _elements->append(cie); + } + } +}; + +void KlassHierarchy::print_class_hierarchy(outputStream* st, bool print_interfaces, + bool print_subclasses, char* classname) { + ResourceMark rm; + Stack class_stack; + GrowableArray elements; + + // Add all classes to the KlassInfoTable, which allows for quick lookup. + // A KlassInfoEntry will be created for each class. + KlassInfoTable cit(true); + if (cit.allocation_failed()) { + st->print_cr("ERROR: Ran out of C-heap; hierarchy not generated"); + return; + } + + // Add all created KlassInfoEntry instances to the elements array for easy + // iteration, and to allow each KlassInfoEntry instance to have a unique index. + HierarchyClosure hc(&elements); + cit.iterate(&hc); + + for(int i = 0; i < elements.length(); i++) { + KlassInfoEntry* cie = elements.at(i); + const InstanceKlass* k = (InstanceKlass*)cie->klass(); + Klass* super = ((InstanceKlass*)k)->java_super(); + + // Set the index for the class. + cie->set_index(i + 1); + + // Add the class to the subclass array of its superclass. + if (super != NULL) { + KlassInfoEntry* super_cie = cit.lookup(super); + assert(super_cie != NULL, "could not lookup superclass"); + super_cie->add_subclass(cie); + } + } + + // Set the do_print flag for each class that should be printed. + for(int i = 0; i < elements.length(); i++) { + KlassInfoEntry* cie = elements.at(i); + if (classname == NULL) { + // We are printing all classes. + cie->set_do_print(true); + } else { + // We are only printing the hierarchy of a specific class. + if (strcmp(classname, cie->klass()->external_name()) == 0) { + KlassHierarchy::set_do_print_for_class_hierarchy(cie, &cit, print_subclasses); + } + } + } + + // Now we do a depth first traversal of the class hierachry. The class_stack will + // maintain the list of classes we still need to process. Start things off + // by priming it with java.lang.Object. + KlassInfoEntry* jlo_cie = cit.lookup(SystemDictionary::Object_klass()); + assert(jlo_cie != NULL, "could not lookup java.lang.Object"); + class_stack.push(jlo_cie); + + // Repeatedly pop the top item off the stack, print its class info, + // and push all of its subclasses on to the stack. Do this until there + // are no classes left on the stack. + while (!class_stack.is_empty()) { + KlassInfoEntry* curr_cie = class_stack.pop(); + if (curr_cie->do_print()) { + print_class(st, curr_cie, print_interfaces); + if (curr_cie->subclasses() != NULL) { + // Current class has subclasses, so push all of them onto the stack. + for (int i = 0; i < curr_cie->subclasses()->length(); i++) { + KlassInfoEntry* cie = curr_cie->subclasses()->at(i); + if (cie->do_print()) { + class_stack.push(cie); + } + } + } + } + } + + st->flush(); +} + +// Sets the do_print flag for every superclass and subclass of the specified class. +void KlassHierarchy::set_do_print_for_class_hierarchy(KlassInfoEntry* cie, KlassInfoTable* cit, + bool print_subclasses) { + // Set do_print for all superclasses of this class. + Klass* super = ((InstanceKlass*)cie->klass())->java_super(); + while (super != NULL) { + KlassInfoEntry* super_cie = cit->lookup(super); + super_cie->set_do_print(true); + super = super->super(); + } + + // Set do_print for this class and all of its subclasses. + Stack class_stack; + class_stack.push(cie); + while (!class_stack.is_empty()) { + KlassInfoEntry* curr_cie = class_stack.pop(); + curr_cie->set_do_print(true); + if (print_subclasses && curr_cie->subclasses() != NULL) { + // Current class has subclasses, so push all of them onto the stack. + for (int i = 0; i < curr_cie->subclasses()->length(); i++) { + KlassInfoEntry* cie = curr_cie->subclasses()->at(i); + class_stack.push(cie); + } + } + } +} + +static void print_indent(outputStream* st, int indent) { + while (indent != 0) { + st->print("|"); + indent--; + if (indent != 0) { + st->print(" "); + } + } +} + +// Print the class name and its unique ClassLoader identifer. +static void print_classname(outputStream* st, Klass* klass) { + oop loader_oop = klass->class_loader_data()->class_loader(); + st->print("%s/", klass->external_name()); + if (loader_oop == NULL) { + st->print("null"); + } else { + st->print(INTPTR_FORMAT, klass->class_loader_data()); + } +} + +static void print_interface(outputStream* st, Klass* intf_klass, const char* intf_type, int indent) { + print_indent(st, indent); + st->print(" implements "); + print_classname(st, intf_klass); + st->print(" (%s intf)\n", intf_type); +} + +void KlassHierarchy::print_class(outputStream* st, KlassInfoEntry* cie, bool print_interfaces) { + ResourceMark rm; + InstanceKlass* klass = (InstanceKlass*)cie->klass(); + int indent = 0; + + // Print indentation with proper indicators of superclass. + Klass* super = klass->super(); + while (super != NULL) { + super = super->super(); + indent++; + } + print_indent(st, indent); + if (indent != 0) st->print("--"); + + // Print the class name, its unique ClassLoader identifer, and if it is an interface. + print_classname(st, klass); + if (klass->is_interface()) { + st->print(" (intf)"); + } + st->print("\n"); + + // Print any interfaces the class has. + if (print_interfaces) { + Array* local_intfs = klass->local_interfaces(); + Array* trans_intfs = klass->transitive_interfaces(); + for (int i = 0; i < local_intfs->length(); i++) { + print_interface(st, local_intfs->at(i), "declared", indent); + } + for (int i = 0; i < trans_intfs->length(); i++) { + Klass* trans_interface = trans_intfs->at(i); + // Only print transitive interfaces if they are not also declared. + if (!local_intfs->contains(trans_interface)) { + print_interface(st, trans_interface, "inherited", indent); + } + } + } +} + void KlassInfoHisto::print_class_stats(outputStream* st, bool csv_format, const char *columns) { ResourceMark rm; @@ -320,6 +519,8 @@ void KlassInfoHisto::print_class_stats(outputStream* st, elements()->at(i)->set_index(i+1); } + // First iteration is for accumulating stats totals in colsum_table[]. + // Second iteration is for printing stats for each class. for (int pass=1; pass<=2; pass++) { if (pass == 2) { print_title(st, csv_format, selected, width_table, name_table); @@ -328,6 +529,7 @@ void KlassInfoHisto::print_class_stats(outputStream* st, KlassInfoEntry* e = (KlassInfoEntry*)elements()->at(i); const Klass* k = e->klass(); + // Get the stats for this class. memset(&sz, 0, sizeof(sz)); sz._inst_count = e->count(); sz._inst_bytes = HeapWordSize * e->words(); @@ -335,11 +537,13 @@ void KlassInfoHisto::print_class_stats(outputStream* st, sz._total_bytes = sz._ro_bytes + sz._rw_bytes; if (pass == 1) { + // Add the stats for this class to the overall totals. for (int c=0; coop_is_instance()) { Klass* super = ((InstanceKlass*)k)->java_super(); if (super) { @@ -373,6 +577,8 @@ void KlassInfoHisto::print_class_stats(outputStream* st, } if (pass == 1) { + // Calculate the minimum width needed for the column by accounting for the + // column header width and the width of the largest value in the column. for (int c=0; cprint(","); for (int c=0; cprint_cr("WARNING: Ran out of C-heap; undercounted " SIZE_FORMAT @@ -533,7 +741,7 @@ void HeapInspection::heap_inspection(outputStream* st) { histo.sort(); histo.print_histo_on(st, _print_class_stats, _csv_format, _columns); } else { - st->print_cr("WARNING: Ran out of C-heap; histogram not generated"); + st->print_cr("ERROR: Ran out of C-heap; histogram not generated"); } st->flush(); } diff --git a/hotspot/src/share/vm/memory/heapInspection.hpp b/hotspot/src/share/vm/memory/heapInspection.hpp index db782c42505..52aad643dc5 100644 --- a/hotspot/src/share/vm/memory/heapInspection.hpp +++ b/hotspot/src/share/vm/memory/heapInspection.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -188,11 +188,15 @@ class KlassInfoEntry: public CHeapObj { long _instance_count; size_t _instance_words; long _index; + bool _do_print; // True if we should print this class when printing the class hierarchy. + GrowableArray* _subclasses; public: KlassInfoEntry(Klass* k, KlassInfoEntry* next) : - _klass(k), _instance_count(0), _instance_words(0), _next(next), _index(-1) + _klass(k), _instance_count(0), _instance_words(0), _next(next), _index(-1), + _do_print(false), _subclasses(NULL) {} + ~KlassInfoEntry(); KlassInfoEntry* next() const { return _next; } bool is_equal(const Klass* k) { return k == _klass; } Klass* klass() const { return _klass; } @@ -202,6 +206,10 @@ class KlassInfoEntry: public CHeapObj { void set_words(size_t wds) { _instance_words = wds; } void set_index(long index) { _index = index; } long index() const { return _index; } + GrowableArray* subclasses() const { return _subclasses; } + void add_subclass(KlassInfoEntry* cie); + void set_do_print(bool do_print) { _do_print = do_print; } + bool do_print() const { return _do_print; } int compare(KlassInfoEntry* e1, KlassInfoEntry* e2); void print_on(outputStream* st) const; const char* name() const; @@ -248,7 +256,7 @@ class KlassInfoTable: public StackObj { }; public: - KlassInfoTable(bool need_class_stats); + KlassInfoTable(bool add_all_classes); ~KlassInfoTable(); bool record_instance(const oop obj); void iterate(KlassInfoClosure* cic); @@ -256,6 +264,18 @@ class KlassInfoTable: public StackObj { size_t size_of_instances_in_words() const; friend class KlassInfoHisto; + friend class KlassHierarchy; +}; + +class KlassHierarchy : AllStatic { + public: + static void print_class_hierarchy(outputStream* st, bool print_interfaces, bool print_subclasses, + char* classname); + + private: + static void set_do_print_for_class_hierarchy(KlassInfoEntry* cie, KlassInfoTable* cit, + bool print_subclasse); + static void print_class(outputStream* st, KlassInfoEntry* cie, bool print_subclasses); }; class KlassInfoHisto : public StackObj { diff --git a/hotspot/src/share/vm/runtime/vm_operations.cpp b/hotspot/src/share/vm/runtime/vm_operations.cpp index 208d518690e..5685589813f 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.cpp +++ b/hotspot/src/share/vm/runtime/vm_operations.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,6 +29,7 @@ #include "compiler/compileBroker.hpp" #include "compiler/compilerOracle.hpp" #include "gc_implementation/shared/isGCActiveMark.hpp" +#include "memory/heapInspection.hpp" #include "memory/resourceArea.hpp" #include "oops/symbol.hpp" #include "runtime/arguments.hpp" @@ -486,3 +487,9 @@ void VM_PrintCodeList::doit() { void VM_PrintCodeCache::doit() { CodeCache::print_layout(_out); } + +#if INCLUDE_SERVICES +void VM_PrintClassHierarchy::doit() { + KlassHierarchy::print_class_hierarchy(_out, _print_interfaces, _print_subclasses, _classname); +} +#endif diff --git a/hotspot/src/share/vm/runtime/vm_operations.hpp b/hotspot/src/share/vm/runtime/vm_operations.hpp index 36353521525..acc1ddd8abb 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.hpp +++ b/hotspot/src/share/vm/runtime/vm_operations.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -105,6 +105,7 @@ template(PrintCompileQueue) \ template(PrintCodeList) \ template(PrintCodeCache) \ + template(PrintClassHierarchy) \ class VM_Operation: public CHeapObj { public: @@ -457,5 +458,21 @@ class VM_PrintCodeCache: public VM_Operation { void doit(); }; +#if INCLUDE_SERVICES +class VM_PrintClassHierarchy: public VM_Operation { + private: + outputStream* _out; + bool _print_interfaces; + bool _print_subclasses; + char* _classname; + + public: + VM_PrintClassHierarchy(outputStream* st, bool print_interfaces, bool print_subclasses, char* classname) : + _out(st), _print_interfaces(print_interfaces), _print_subclasses(print_subclasses), + _classname(classname) {} + VMOp_Type type() const { return VMOp_PrintClassHierarchy; } + void doit(); +}; +#endif // INCLUDE_SERVICES #endif // SHARE_VM_RUNTIME_VM_OPERATIONS_HPP diff --git a/hotspot/src/share/vm/services/diagnosticCommand.cpp b/hotspot/src/share/vm/services/diagnosticCommand.cpp index d5abd05afa6..e2b847d31e5 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.cpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -57,6 +57,7 @@ void DCmdRegistrant::register_dcmds(){ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); #endif // INCLUDE_SERVICES @@ -695,3 +696,35 @@ void CodeCacheDCmd::execute(DCmdSource source, TRAPS) { VMThread::execute(&printCodeCacheOp); } +#if INCLUDE_SERVICES +ClassHierarchyDCmd::ClassHierarchyDCmd(outputStream* output, bool heap) : + DCmdWithParser(output, heap), + _print_interfaces("-i", "Inherited interfaces should be printed.", "BOOLEAN", false, "false"), + _print_subclasses("-s", "If a classname is specified, print its subclasses. " + "Otherwise only its superclasses are printed.", "BOOLEAN", false, "false"), + _classname("classname", "Name of class whose hierarchy should be printed. " + "If not specified, all class hierarchies are printed.", + "STRING", false) { + _dcmdparser.add_dcmd_option(&_print_interfaces); + _dcmdparser.add_dcmd_option(&_print_subclasses); + _dcmdparser.add_dcmd_argument(&_classname); +} + +void ClassHierarchyDCmd::execute(DCmdSource source, TRAPS) { + VM_PrintClassHierarchy printClassHierarchyOp(output(), _print_interfaces.value(), + _print_subclasses.value(), _classname.value()); + VMThread::execute(&printClassHierarchyOp); +} + +int ClassHierarchyDCmd::num_arguments() { + ResourceMark rm; + ClassHierarchyDCmd* dcmd = new ClassHierarchyDCmd(NULL, false); + if (dcmd != NULL) { + DCmdMark mark(dcmd); + return dcmd->_dcmdparser.num_arguments(); + } else { + return 0; + } +} + +#endif diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp index 292cfbafba0..b51641bc684 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.hpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -271,6 +271,34 @@ public: virtual void execute(DCmdSource source, TRAPS); }; + +class ClassHierarchyDCmd : public DCmdWithParser { +protected: + DCmdArgument _print_interfaces; // true if inherited interfaces should be printed. + DCmdArgument _print_subclasses; // true if subclasses of the specified classname should be printed. + DCmdArgument _classname; // Optional single class name whose hierarchy should be printed. +public: + ClassHierarchyDCmd(outputStream* output, bool heap); + static const char* name() { + return "VM.class_hierarchy"; + } + static const char* description() { + return "Print a list of all loaded classes, indented to show the class hiearchy. " + "The name of each class is followed by the ClassLoaderData* of its ClassLoader, " + "or \"null\" if loaded by the bootstrap class loader."; + } + static const char* impact() { + return "Medium: Depends on number of loaded classes."; + } + static const JavaPermission permission() { + JavaPermission p = {"java.lang.management.ManagementPermission", + "monitor", NULL}; + return p; + } + static int num_arguments(); + virtual void execute(DCmdSource source, TRAPS); +}; + // See also: thread_dump in attachListener.cpp class ThreadDumpDCmd : public DCmdWithParser { protected: diff --git a/hotspot/test/Makefile b/hotspot/test/Makefile index 657501a7622..14d639c8506 100644 --- a/hotspot/test/Makefile +++ b/hotspot/test/Makefile @@ -271,7 +271,7 @@ JTREG_BASIC_OPTIONS += -a # Report details on all failed or error tests, times too JTREG_BASIC_OPTIONS += -v:fail,error,time # Retain all files for failing tests -JTREG_BASIC_OPTIONS += -retain:fail,error +JTREG_BASIC_OPTIONS += -retain:all # Ignore tests are not run and completely silent about it JTREG_IGNORE_OPTION = -ignore:quiet JTREG_BASIC_OPTIONS += $(JTREG_IGNORE_OPTION) diff --git a/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java b/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java new file mode 100644 index 00000000000..e0c9c8875ef --- /dev/null +++ b/hotspot/test/serviceability/dcmd/vm/ClassHierarchyTest.java @@ -0,0 +1,199 @@ +/* + * 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 of diagnostic command VM.class_hierarchy + * @library /testlibrary + * @build com.oracle.java.testlibrary.* + * @build com.oracle.java.testlibrary.dcmd.* + * @run testng ClassHierarchyTest + */ + +import org.testng.annotations.Test; +import org.testng.Assert; + +import com.oracle.java.testlibrary.OutputAnalyzer; +import com.oracle.java.testlibrary.dcmd.CommandExecutor; +import com.oracle.java.testlibrary.dcmd.JMXExecutor; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.FileChannel; +import java.util.Iterator; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ClassHierarchyTest { + + // $> jcmd DcmdTestClass VM.class_hierarchy DcmdTestClass | grep DcmdTestClass\$\$Lambda + // |--DcmdTestClass$$Lambda$1/4081552/0xa529fbb0 + + // > VM.class_hierarchy DcmdBaseClass + // java.lang.Object/null + // |--DcmdBaseClass/0xa4abcd48 + + // > VM.class_hierarchy DcmdBaseClass -s + // java.lang.Object/null + // |--DcmdBaseClass/0xa4abcd48 + // | |--DcmdTestClass/0xa4abcd48 + + // > VM.class_hierarchy DcmdBaseClass -i -s + // java.lang.Object/null + // |--DcmdBaseClass/0xa4abcd48 + // | implements Intf2/0xa4abcd48 (declared intf) + // | implements Intf1/0xa4abcd48 (inherited intf) + // | |--DcmdTestClass/0xa4abcd48 + // | | implements Intf1/0xa4abcd48 (inherited intf) + // | | implements Intf2/0xa4abcd48 (inherited intf) + + static Pattern expected_lambda_line = + Pattern.compile("\\|--DcmdTestClass\\$\\$Lambda.*"); + + static Pattern expected_lines[] = { + Pattern.compile("java.lang.Object/null"), + Pattern.compile("\\|--DcmdBaseClass/0x(\\p{XDigit}*)"), + Pattern.compile("\\| implements Intf2/0x(\\p{XDigit}*) \\(declared intf\\)"), + Pattern.compile("\\| implements Intf1/0x(\\p{XDigit}*) \\(inherited intf\\)"), + Pattern.compile("\\| \\|--DcmdTestClass/0x(\\p{XDigit}*)"), + Pattern.compile("\\| \\| implements Intf1/0x(\\p{XDigit}*) \\(inherited intf\\)"), + Pattern.compile("\\| \\| implements Intf2/0x(\\p{XDigit}*) \\(inherited intf\\)") + }; + + public void run(CommandExecutor executor) throws ClassNotFoundException { + OutputAnalyzer output; + Iterator lines; + int i; + + // Load our test class whose hierarchy we will print. + Class c = Class.forName("DcmdTestClass"); + + // Verify the presence of the lamba anonymous class + output = executor.execute("VM.class_hierarchy"); + lines = output.asLines().iterator(); + Boolean foundMatch = false; + while (lines.hasNext()) { + String line = lines.next(); + Matcher m = expected_lambda_line.matcher(line); + if (m.matches()) { + foundMatch = true; + break; + } + } + if (!foundMatch) { + Assert.fail("Failed to find lamda class"); + } + + // Verify the output for the simple hierachry of just DcmdBaseClass. + output = executor.execute("VM.class_hierarchy DcmdBaseClass"); + lines = output.asLines().iterator(); + i = 0; + while (lines.hasNext()) { + String line = lines.next(); + Matcher m = expected_lines[i].matcher(line); + i++; + if (!m.matches()) { + Assert.fail("Failed to match line #" + i + ": " + line); + } + // Should only be two lines of output in this form. + if (i == 2) break; + } + if (lines.hasNext()) { + String line = lines.next(); + Assert.fail("Unexpected dcmd output: " + line); + } + + // Verify the output for the full hierarchy of DcmdBaseClass, but without interfaces. + output = executor.execute("VM.class_hierarchy DcmdBaseClass -s"); + lines = output.asLines().iterator(); + i = 0; + while (lines.hasNext()) { + String line = lines.next(); + Matcher m = expected_lines[i].matcher(line); + i++; + if (!m.matches()) { + Assert.fail("Failed to match line #" + i + ": " + line); + } + // "implements" lines should not be in this output. + if (i == 2 || i == 4) i += 2; + } + if (lines.hasNext()) { + String line = lines.next(); + Assert.fail("Unexpected dcmd output: " + line); + } + + // Verify the output for the full hierarchy of DcmdBaseClass, including interfaces. + output = executor.execute("VM.class_hierarchy DcmdBaseClass -i -s"); + lines = output.asLines().iterator(); + i = 0; + String classLoaderAddr = null; + while (lines.hasNext()) { + String line = lines.next(); + Matcher m = expected_lines[i].matcher(line); + i++; + if (!m.matches()) { + Assert.fail("Failed to match line #" + i + ": " + line); + } + if (i == 2) { + // Fetch the ClassLoader address, which should be the same in + // subsequent lines. + classLoaderAddr = m.group(1); + System.out.println(classLoaderAddr); + } else if (i > 2) { + if (!classLoaderAddr.equals(m.group(1))) { + Assert.fail("Classloader address didn't match on line #" + + i + ": " + line); + } + } + if (i == expected_lines.length) break; + } + if (lines.hasNext()) { + String line = lines.next(); + Assert.fail("Unexpected dcmd output: " + line); + } + } + + @Test + public void jmx() throws ClassNotFoundException { + run(new JMXExecutor()); + } +} + +interface Intf1 { +} + +interface Intf2 extends Intf1 { +} + +class DcmdBaseClass implements Intf2 { +} + +class DcmdTestClass extends DcmdBaseClass { + static { + // Force creation of anonymous class (for the lambdaform). + Runnable r = () -> System.out.println("Hello"); + r.run(); + } +} From 0d2c28e3b88624627031db9f21f81d8e47597309 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Fri, 13 Feb 2015 06:23:48 -0500 Subject: [PATCH 13/89] 8072935: Fix missing newline at end of file after 8067447 Reviewed-by: dholmes, dlong --- hotspot/src/share/vm/services/writeableFlags.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/services/writeableFlags.cpp b/hotspot/src/share/vm/services/writeableFlags.cpp index d674a0081b3..8dc3151569a 100644 --- a/hotspot/src/share/vm/services/writeableFlags.cpp +++ b/hotspot/src/share/vm/services/writeableFlags.cpp @@ -223,4 +223,5 @@ int WriteableFlags::set_flag_from_jvalue(Flag* f, const void* value, Flag::Flags ShouldNotReachHere(); } return ERR_OTHER; -} \ No newline at end of file +} + From 3d3f6553c0cab0047d30fa5a7b07f24e7a827d14 Mon Sep 17 00:00:00 2001 From: Katja Kantserova Date: Fri, 13 Feb 2015 13:17:13 +0100 Subject: [PATCH 14/89] 8073132: Eliminate ProcessTools.getProcessId dependency on sun.management.VMManagement Reviewed-by: jbachorik, dfuchs, mchung --- .../com/oracle/java/testlibrary/ProcessTools.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java index 167d6d134b1..874eedcf015 100644 --- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java +++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java @@ -33,8 +33,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import sun.management.VMManagement; - public final class ProcessTools { private ProcessTools() { @@ -90,19 +88,8 @@ public final class ProcessTools { * @return Process id */ public static int getProcessId() throws Exception { - - // Get the current process id using a reflection hack RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); - Field jvm = runtime.getClass().getDeclaredField("jvm"); - - jvm.setAccessible(true); - VMManagement mgmt = (sun.management.VMManagement) jvm.get(runtime); - - Method pid_method = mgmt.getClass().getDeclaredMethod("getProcessId"); - - pid_method.setAccessible(true); - - int pid = (Integer) pid_method.invoke(mgmt); + int pid = Integer.parseInt(runtime.getName().split("@")[0]); return pid; } From 4913ad5d7dcc8ae4e034aa110a97ea8313b2b3ee Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Fri, 13 Feb 2015 14:37:35 +0100 Subject: [PATCH 15/89] 8072911: Remove includes of oop.inline.hpp from .hpp files Reviewed-by: brutisso, coleenp, jwilhelm, simonis, dholmes --- hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp | 3 +- hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp | 3 +- .../cpu/sparc/vm/c1_MacroAssembler_sparc.cpp | 3 +- hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp | 3 +- .../src/cpu/sparc/vm/methodHandles_sparc.cpp | 3 +- .../src/cpu/x86/vm/c1_MacroAssembler_x86.cpp | 3 +- hotspot/src/cpu/x86/vm/icBuffer_x86.cpp | 3 +- hotspot/src/cpu/x86/vm/methodHandles_x86.cpp | 3 +- hotspot/src/cpu/zero/vm/icBuffer_zero.cpp | 3 +- hotspot/src/share/vm/adlc/main.cpp | 3 +- hotspot/src/share/vm/c1/c1_Compilation.cpp | 6 +- hotspot/src/share/vm/c1/c1_GraphBuilder.cpp | 3 +- hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 3 +- hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp | 3 +- hotspot/src/share/vm/ci/ciArray.cpp | 5 +- hotspot/src/share/vm/ci/ciBaseObject.cpp | 3 +- hotspot/src/share/vm/ci/ciCallSite.cpp | 3 +- hotspot/src/share/vm/ci/ciEnv.cpp | 4 +- hotspot/src/share/vm/ci/ciField.cpp | 3 +- hotspot/src/share/vm/ci/ciInstance.hpp | 3 +- hotspot/src/share/vm/ci/ciMetadata.cpp | 3 +- hotspot/src/share/vm/ci/ciMethodData.hpp | 4 +- hotspot/src/share/vm/ci/ciObjArray.cpp | 4 +- hotspot/src/share/vm/ci/ciObject.cpp | 4 +- hotspot/src/share/vm/ci/ciObjectFactory.cpp | 4 +- hotspot/src/share/vm/ci/ciReplay.cpp | 3 +- hotspot/src/share/vm/ci/ciTypeFlow.cpp | 3 +- .../share/vm/classfile/classFileParser.cpp | 3 +- .../share/vm/classfile/classFileParser.hpp | 4 +- .../share/vm/classfile/classLoaderData.cpp | 4 +- .../share/vm/classfile/classLoaderStats.cpp | 3 +- hotspot/src/share/vm/classfile/dictionary.hpp | 4 +- .../src/share/vm/classfile/javaClasses.cpp | 19 ++++- .../src/share/vm/classfile/javaClasses.hpp | 48 ++++-------- .../share/vm/classfile/javaClasses.inline.hpp | 76 +++++++++++++++++++ .../src/share/vm/classfile/stringTable.cpp | 3 +- .../src/share/vm/classfile/symbolTable.cpp | 1 - .../share/vm/classfile/systemDictionary.cpp | 4 +- .../share/vm/classfile/verificationType.hpp | 4 +- hotspot/src/share/vm/code/dependencies.cpp | 3 +- hotspot/src/share/vm/code/icBuffer.cpp | 3 +- hotspot/src/share/vm/code/nmethod.cpp | 3 +- .../src/share/vm/compiler/disassembler.cpp | 3 +- .../g1/g1SATBCardTableModRefBS.cpp | 1 + .../g1/g1SATBCardTableModRefBS.hpp | 2 +- .../vm/gc_implementation/g1/g1StringDedup.cpp | 8 +- .../g1/g1StringDedupQueue.cpp | 6 +- .../g1/g1StringDedupTable.cpp | 5 +- .../g1/heapRegion.inline.hpp | 3 +- .../vm/gc_implementation/shared/gcTrace.cpp | 3 +- .../shared/vmGCOperations.cpp | 7 +- .../shared/vmGCOperations.hpp | 6 +- .../share/vm/gc_interface/collectedHeap.cpp | 11 ++- .../share/vm/gc_interface/collectedHeap.hpp | 11 +-- .../share/vm/interpreter/bytecodeTracer.cpp | 3 +- .../vm/interpreter/interpreterRuntime.cpp | 4 +- .../src/share/vm/interpreter/linkResolver.cpp | 1 + hotspot/src/share/vm/memory/barrierSet.hpp | 2 +- .../src/share/vm/memory/barrierSet.inline.hpp | 6 +- .../src/share/vm/memory/cardTableModRefBS.cpp | 2 +- .../src/share/vm/memory/cardTableModRefBS.hpp | 12 +-- .../cardTableModRefBS.inline.hpp} | 29 +++---- .../src/share/vm/memory/genCollectedHeap.cpp | 1 - .../src/share/vm/memory/heapInspection.cpp | 3 +- .../src/share/vm/memory/heapInspection.hpp | 7 +- hotspot/src/share/vm/memory/space.cpp | 3 +- hotspot/src/share/vm/memory/space.inline.hpp | 3 +- hotspot/src/share/vm/memory/universe.cpp | 1 + .../src/share/vm/oops/compiledICHolder.cpp | 3 +- hotspot/src/share/vm/oops/constantPool.cpp | 5 +- hotspot/src/share/vm/oops/cpCache.cpp | 4 +- hotspot/src/share/vm/oops/klass.cpp | 2 +- hotspot/src/share/vm/oops/methodData.cpp | 3 +- hotspot/src/share/vm/oops/objArrayKlass.cpp | 6 +- hotspot/src/share/vm/oops/objArrayOop.hpp | 12 +-- .../src/share/vm/oops/objArrayOop.inline.hpp | 42 ++++++++++ hotspot/src/share/vm/oops/oop.cpp | 18 ++++- hotspot/src/share/vm/oops/oop.hpp | 24 ++++-- hotspot/src/share/vm/oops/oop.inline.hpp | 12 ++- hotspot/src/share/vm/opto/callGenerator.cpp | 4 +- hotspot/src/share/vm/opto/compile.cpp | 3 +- hotspot/src/share/vm/opto/convertnode.cpp | 3 +- hotspot/src/share/vm/opto/graphKit.cpp | 13 +++- hotspot/src/share/vm/opto/graphKit.hpp | 13 +--- hotspot/src/share/vm/opto/lcm.cpp | 3 +- hotspot/src/share/vm/opto/matcher.cpp | 3 +- hotspot/src/share/vm/opto/memnode.cpp | 3 +- hotspot/src/share/vm/opto/parse2.cpp | 3 +- hotspot/src/share/vm/opto/stringopts.cpp | 3 +- .../src/share/vm/precompiled/precompiled.hpp | 4 +- hotspot/src/share/vm/prims/forte.cpp | 3 +- hotspot/src/share/vm/prims/jni.cpp | 4 +- hotspot/src/share/vm/prims/jniCheck.cpp | 3 +- hotspot/src/share/vm/prims/jvm.cpp | 5 +- hotspot/src/share/vm/prims/jvmtiEnter.xsl | 3 +- hotspot/src/share/vm/prims/jvmtiEnv.cpp | 4 +- hotspot/src/share/vm/prims/jvmtiEnvBase.cpp | 3 +- hotspot/src/share/vm/prims/jvmtiExport.cpp | 3 +- .../share/vm/prims/jvmtiGetLoadedClasses.cpp | 4 +- hotspot/src/share/vm/prims/jvmtiImpl.cpp | 3 +- .../share/vm/prims/jvmtiRedefineClasses.cpp | 1 + hotspot/src/share/vm/prims/jvmtiTagMap.cpp | 5 +- hotspot/src/share/vm/prims/methodHandles.cpp | 6 +- hotspot/src/share/vm/prims/unsafe.cpp | 2 + .../vm/prims/wbtestmethods/parserTests.cpp | 10 +-- .../src/share/vm/runtime/biasedLocking.cpp | 3 +- hotspot/src/share/vm/runtime/dtraceJSDT.cpp | 3 +- .../src/share/vm/runtime/fieldDescriptor.cpp | 3 +- hotspot/src/share/vm/runtime/fprofiler.cpp | 3 +- hotspot/src/share/vm/runtime/frame.cpp | 3 +- hotspot/src/share/vm/runtime/handles.hpp | 10 +-- hotspot/src/share/vm/runtime/reflection.cpp | 5 +- .../src/share/vm/runtime/serviceThread.cpp | 5 +- hotspot/src/share/vm/runtime/vframe_hp.cpp | 3 +- .../src/share/vm/services/attachListener.cpp | 3 +- .../share/vm/services/diagnosticCommand.cpp | 3 +- .../share/vm/services/diagnosticFramework.cpp | 3 +- hotspot/src/share/vm/services/heapDumper.cpp | 4 +- hotspot/src/share/vm/services/management.cpp | 3 +- 119 files changed, 451 insertions(+), 264 deletions(-) create mode 100644 hotspot/src/share/vm/classfile/javaClasses.inline.hpp rename hotspot/src/share/vm/{oops/oop.inline2.hpp => memory/cardTableModRefBS.inline.hpp} (60%) create mode 100644 hotspot/src/share/vm/oops/objArrayOop.inline.hpp diff --git a/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp b/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp index e991efb7645..536e5728bc1 100644 --- a/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/icBuffer_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2013 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -32,7 +32,6 @@ #include "memory/resourceArea.hpp" #include "nativeInst_ppc.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #define __ masm. diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp index 88e0dec0709..32b5c5c5a5b 100644 --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2012, 2014 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" +#include "classfile/javaClasses.inline.hpp" #include "interpreter/interpreter.hpp" #include "memory/allocation.inline.hpp" #include "prims/methodHandles.hpp" diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp index 61c866b6d22..ca72c6bdc00 100644 --- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ #include "runtime/basicLock.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/os.hpp" +#include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) { diff --git a/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp b/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp index ee2b0380345..21565fb44f5 100644 --- a/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/icBuffer_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -30,7 +30,6 @@ #include "memory/resourceArea.hpp" #include "nativeInst_sparc.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" int InlineCacheBuffer::ic_stub_code_size() { #ifdef _LP64 diff --git a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp index 4cd5b2a93c3..adde1b6af19 100644 --- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "classfile/javaClasses.inline.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interp_masm.hpp" #include "memory/allocation.inline.hpp" diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp index 9dfb27969e9..0c8d0767ed2 100644 --- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ #include "runtime/basicLock.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/os.hpp" +#include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Register scratch, Label& slow_case) { diff --git a/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp b/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp index 62ecc447a13..6d10865c32f 100644 --- a/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp +++ b/hotspot/src/cpu/x86/vm/icBuffer_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -31,7 +31,6 @@ #include "memory/resourceArea.hpp" #include "nativeInst_x86.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" int InlineCacheBuffer::ic_stub_code_size() { return NativeMovConstReg::instruction_size + diff --git a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp index 42c690f5e07..b3776ed8c3f 100644 --- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp +++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "classfile/javaClasses.inline.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" diff --git a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp index 9a82782ab3a..924e0836067 100644 --- a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp +++ b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2007 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -32,7 +32,6 @@ #include "memory/resourceArea.hpp" #include "nativeInst_zero.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" int InlineCacheBuffer::ic_stub_code_size() { // NB set this once the functions below are implemented diff --git a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp index 6c4553f4b8f..6dfbba3e4d2 100644 --- a/hotspot/src/share/vm/adlc/main.cpp +++ b/hotspot/src/share/vm/adlc/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -220,7 +220,6 @@ int main(int argc, char *argv[]) AD.addInclude(AD._CPP_file, "oops/markOop.hpp"); AD.addInclude(AD._CPP_file, "oops/method.hpp"); AD.addInclude(AD._CPP_file, "oops/oop.inline.hpp"); - AD.addInclude(AD._CPP_file, "oops/oop.inline2.hpp"); AD.addInclude(AD._CPP_file, "opto/cfgnode.hpp"); AD.addInclude(AD._CPP_file, "opto/locknode.hpp"); AD.addInclude(AD._CPP_file, "opto/opcodes.hpp"); diff --git a/hotspot/src/share/vm/c1/c1_Compilation.cpp b/hotspot/src/share/vm/c1/c1_Compilation.cpp index 46eaa2c900e..26b2d601ffc 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.cpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,12 +29,12 @@ #include "c1/c1_LIRAssembler.hpp" #include "c1/c1_LinearScan.hpp" #include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_RangeCheckElimination.hpp" #include "c1/c1_ValueMap.hpp" #include "c1/c1_ValueStack.hpp" #include "code/debugInfoRec.hpp" #include "compiler/compileLog.hpp" -#include "c1/c1_RangeCheckElimination.hpp" - +#include "runtime/sharedRuntime.hpp" typedef enum { _t_compile, diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 351e410aa15..d8151f31b49 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ #include "ci/ciMemberName.hpp" #include "compiler/compileBroker.hpp" #include "interpreter/bytecode.hpp" +#include "oops/oop.inline.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/compilationPolicy.hpp" #include "runtime/vm_version.hpp" diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index 199b840629a..e88a3dfedae 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -32,6 +32,7 @@ #include "ci/ciArrayKlass.hpp" #include "ci/ciInstance.hpp" #include "ci/ciObjArray.hpp" +#include "memory/cardTableModRefBS.hpp" #include "runtime/arguments.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" diff --git a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp index 4c0cd3d8083..634878e62e9 100644 --- a/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp +++ b/hotspot/src/share/vm/ci/bcEscapeAnalyzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -29,6 +29,7 @@ #include "ci/ciMethodBlocks.hpp" #include "ci/ciStreams.hpp" #include "interpreter/bytecode.hpp" +#include "oops/oop.inline.hpp" #include "utilities/bitMap.inline.hpp" diff --git a/hotspot/src/share/vm/ci/ciArray.cpp b/hotspot/src/share/vm/ci/ciArray.cpp index 56f57b360dd..f527d3ed538 100644 --- a/hotspot/src/share/vm/ci/ciArray.cpp +++ b/hotspot/src/share/vm/ci/ciArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,8 @@ #include "ci/ciConstant.hpp" #include "ci/ciKlass.hpp" #include "ci/ciUtilities.hpp" -#include "oops/objArrayOop.hpp" +#include "oops/objArrayOop.inline.hpp" +#include "oops/oop.inline.hpp" #include "oops/typeArrayOop.hpp" // ciArray diff --git a/hotspot/src/share/vm/ci/ciBaseObject.cpp b/hotspot/src/share/vm/ci/ciBaseObject.cpp index 5939a4246e4..2d1fe71e2d8 100644 --- a/hotspot/src/share/vm/ci/ciBaseObject.cpp +++ b/hotspot/src/share/vm/ci/ciBaseObject.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 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 @@ -26,7 +26,6 @@ #include "ci/ciBaseObject.hpp" #include "ci/ciUtilities.hpp" #include "gc_interface/collectedHeap.inline.hpp" -#include "oops/oop.inline2.hpp" // ------------------------------------------------------------------ // ciBaseObject::set_ident diff --git a/hotspot/src/share/vm/ci/ciCallSite.cpp b/hotspot/src/share/vm/ci/ciCallSite.cpp index 794042a7996..fb222fe3f5a 100644 --- a/hotspot/src/share/vm/ci/ciCallSite.cpp +++ b/hotspot/src/share/vm/ci/ciCallSite.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/javaClasses.inline.hpp" #include "ci/ciCallSite.hpp" #include "ci/ciUtilities.hpp" diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp index 5c6e12e5e75..9ba708320b1 100644 --- a/hotspot/src/share/vm/ci/ciEnv.cpp +++ b/hotspot/src/share/vm/ci/ciEnv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,8 +46,8 @@ #include "memory/universe.inline.hpp" #include "oops/methodData.hpp" #include "oops/objArrayKlass.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #include "prims/jvmtiExport.hpp" #include "runtime/init.hpp" #include "runtime/reflection.hpp" diff --git a/hotspot/src/share/vm/ci/ciField.cpp b/hotspot/src/share/vm/ci/ciField.cpp index 7eb2119444e..57da3a5d628 100644 --- a/hotspot/src/share/vm/ci/ciField.cpp +++ b/hotspot/src/share/vm/ci/ciField.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,6 @@ #include "interpreter/linkResolver.hpp" #include "memory/universe.inline.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #include "runtime/fieldDescriptor.hpp" // ciField diff --git a/hotspot/src/share/vm/ci/ciInstance.hpp b/hotspot/src/share/vm/ci/ciInstance.hpp index e7f5bfe0734..acff37f1e71 100644 --- a/hotspot/src/share/vm/ci/ciInstance.hpp +++ b/hotspot/src/share/vm/ci/ciInstance.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ #include "ci/ciObject.hpp" #include "oops/instanceOop.hpp" +#include "oops/oop.hpp" // ciInstance // diff --git a/hotspot/src/share/vm/ci/ciMetadata.cpp b/hotspot/src/share/vm/ci/ciMetadata.cpp index efb4f58aef2..f7354c40869 100644 --- a/hotspot/src/share/vm/ci/ciMetadata.cpp +++ b/hotspot/src/share/vm/ci/ciMetadata.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ #include "ci/ciObject.hpp" #include "ci/ciUtilities.hpp" #include "gc_interface/collectedHeap.inline.hpp" -#include "oops/oop.inline2.hpp" // ------------------------------------------------------------------ // ciMetadata::print diff --git a/hotspot/src/share/vm/ci/ciMethodData.hpp b/hotspot/src/share/vm/ci/ciMethodData.hpp index b96f479682d..5e6ed2b3a59 100644 --- a/hotspot/src/share/vm/ci/ciMethodData.hpp +++ b/hotspot/src/share/vm/ci/ciMethodData.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,7 +30,7 @@ #include "ci/ciObject.hpp" #include "ci/ciUtilities.hpp" #include "oops/methodData.hpp" -#include "oops/oop.inline.hpp" +#include "oops/oop.hpp" #include "runtime/deoptimization.hpp" class ciBitData; diff --git a/hotspot/src/share/vm/ci/ciObjArray.cpp b/hotspot/src/share/vm/ci/ciObjArray.cpp index fc2b31eeb31..626191b7553 100644 --- a/hotspot/src/share/vm/ci/ciObjArray.cpp +++ b/hotspot/src/share/vm/ci/ciObjArray.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ #include "ci/ciNullObject.hpp" #include "ci/ciObjArray.hpp" #include "ci/ciUtilities.hpp" -#include "oops/objArrayOop.hpp" +#include "oops/objArrayOop.inline.hpp" // ciObjArray // diff --git a/hotspot/src/share/vm/ci/ciObject.cpp b/hotspot/src/share/vm/ci/ciObject.cpp index 0fe31d54b13..ae852e68938 100644 --- a/hotspot/src/share/vm/ci/ciObject.cpp +++ b/hotspot/src/share/vm/ci/ciObject.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ #include "ci/ciObject.hpp" #include "ci/ciUtilities.hpp" #include "gc_interface/collectedHeap.inline.hpp" -#include "oops/oop.inline2.hpp" +#include "oops/oop.inline.hpp" // ciObject // diff --git a/hotspot/src/share/vm/ci/ciObjectFactory.cpp b/hotspot/src/share/vm/ci/ciObjectFactory.cpp index 26f3b35259e..1b15be7a101 100644 --- a/hotspot/src/share/vm/ci/ciObjectFactory.cpp +++ b/hotspot/src/share/vm/ci/ciObjectFactory.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,11 +40,11 @@ #include "ci/ciTypeArray.hpp" #include "ci/ciTypeArrayKlass.hpp" #include "ci/ciUtilities.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/systemDictionary.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #include "runtime/fieldType.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS diff --git a/hotspot/src/share/vm/ci/ciReplay.cpp b/hotspot/src/share/vm/ci/ciReplay.cpp index 1830322361f..ffaa0861164 100644 --- a/hotspot/src/share/vm/ci/ciReplay.cpp +++ b/hotspot/src/share/vm/ci/ciReplay.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2013, 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 @@ -31,6 +31,7 @@ #include "memory/allocation.inline.hpp" #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" #include "utilities/copy.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/ci/ciTypeFlow.cpp b/hotspot/src/share/vm/ci/ciTypeFlow.cpp index 4707cc96e14..48f4d9fead0 100644 --- a/hotspot/src/share/vm/ci/ciTypeFlow.cpp +++ b/hotspot/src/share/vm/ci/ciTypeFlow.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -35,6 +35,7 @@ #include "interpreter/bytecode.hpp" #include "interpreter/bytecodes.hpp" #include "memory/allocation.inline.hpp" +#include "oops/oop.inline.hpp" #include "opto/compile.hpp" #include "opto/node.hpp" #include "runtime/deoptimization.hpp" diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 13449eef879..b3dfb9c5aca 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -25,10 +25,9 @@ #include "precompiled.hpp" #include "classfile/classFileParser.hpp" #include "classfile/classLoader.hpp" -#include "classfile/classLoaderData.hpp" #include "classfile/classLoaderData.inline.hpp" #include "classfile/defaultMethods.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/verificationType.hpp" diff --git a/hotspot/src/share/vm/classfile/classFileParser.hpp b/hotspot/src/share/vm/classfile/classFileParser.hpp index c3d23df881c..d9ae2d764c7 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.hpp +++ b/hotspot/src/share/vm/classfile/classFileParser.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,9 +27,7 @@ #include "classfile/classFileStream.hpp" #include "memory/resourceArea.hpp" -#include "oops/oop.inline.hpp" #include "oops/typeArrayOop.hpp" -#include "runtime/handles.inline.hpp" #include "utilities/accessFlags.hpp" #include "classfile/symbolTable.hpp" diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp index 44e152b8384..cc201714142 100644 --- a/hotspot/src/share/vm/classfile/classLoaderData.cpp +++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -57,6 +57,8 @@ #include "memory/metadataFactory.hpp" #include "memory/metaspaceShared.hpp" #include "memory/oopFactory.hpp" +#include "oops/objArrayOop.inline.hpp" +#include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/jniHandles.hpp" #include "runtime/mutex.hpp" diff --git a/hotspot/src/share/vm/classfile/classLoaderStats.cpp b/hotspot/src/share/vm/classfile/classLoaderStats.cpp index 4eb98ed321c..15efa5fdcda 100644 --- a/hotspot/src/share/vm/classfile/classLoaderStats.cpp +++ b/hotspot/src/share/vm/classfile/classLoaderStats.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/classLoaderStats.hpp" +#include "oops/oop.inline.hpp" #include "utilities/globalDefinitions.hpp" diff --git a/hotspot/src/share/vm/classfile/dictionary.hpp b/hotspot/src/share/vm/classfile/dictionary.hpp index 180f07e9e01..4499a997d2f 100644 --- a/hotspot/src/share/vm/classfile/dictionary.hpp +++ b/hotspot/src/share/vm/classfile/dictionary.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -27,7 +27,7 @@ #include "classfile/systemDictionary.hpp" #include "oops/instanceKlass.hpp" -#include "oops/oop.inline.hpp" +#include "oops/oop.hpp" #include "utilities/hashtable.hpp" class DictionaryEntry; diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index 79d01125208..42ea9b8230f 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -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 "classfile/vmSymbols.hpp" #include "code/debugInfo.hpp" @@ -39,6 +39,8 @@ #include "oops/instanceMirrorKlass.hpp" #include "oops/klass.hpp" #include "oops/method.hpp" +#include "oops/objArrayOop.inline.hpp" +#include "oops/oop.inline.hpp" #include "oops/symbol.hpp" #include "oops/typeArrayOop.hpp" #include "prims/jvmtiRedefineClassesTrace.hpp" @@ -149,6 +151,10 @@ int java_lang_String::hash_offset = 0; bool java_lang_String::initialized = false; +bool java_lang_String::is_instance(oop obj) { + return is_instance_inlined(obj); +} + void java_lang_String::compute_offsets() { assert(!initialized, "offsets should be initialized only once"); @@ -2730,6 +2736,11 @@ void java_lang_invoke_LambdaForm::compute_offsets() { } } +bool java_lang_invoke_LambdaForm::is_instance(oop obj) { + return obj != NULL && is_subclass(obj->klass()); +} + + oop java_lang_invoke_MethodHandle::type(oop mh) { return mh->obj_field(_type_offset); } @@ -3076,6 +3087,10 @@ bool java_lang_ClassLoader::isAncestor(oop loader, oop cl) { return false; } +bool java_lang_ClassLoader::is_instance(oop obj) { + return obj != NULL && is_subclass(obj->klass()); +} + // For class loader classes, parallelCapable defined // based on non-null field diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index ee2c807ae12..4c2759466f8 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -204,9 +204,8 @@ class java_lang_String : AllStatic { static Symbol* as_symbol_or_null(oop java_string); // Testers - static bool is_instance(oop obj) { - return obj != NULL && obj->klass() == SystemDictionary::String_klass(); - } + static bool is_instance(oop obj); + static bool is_instance_inlined(oop obj); // Debugging static void print(oop java_string, outputStream* st); @@ -273,9 +272,8 @@ class java_lang_Class : AllStatic { static Symbol* as_signature(oop java_class, bool intern_if_not_found, TRAPS); static void print_signature(oop java_class, outputStream *st); // Testing - static bool is_instance(oop obj) { - return obj != NULL && obj->klass() == SystemDictionary::Class_klass(); - } + static bool is_instance(oop obj); + static bool is_primitive(oop java_class); static BasicType primitive_type(oop java_class); static oop primitive_mirror(BasicType t); @@ -989,9 +987,7 @@ class java_lang_invoke_MethodHandle: AllStatic { static bool is_subclass(Klass* klass) { return klass->is_subclass_of(SystemDictionary::MethodHandle_klass()); } - static bool is_instance(oop obj) { - return obj != NULL && is_subclass(obj->klass()); - } + static bool is_instance(oop obj); // Accessors for code generation: static int type_offset_in_bytes() { return _type_offset; } @@ -1016,9 +1012,7 @@ class java_lang_invoke_DirectMethodHandle: AllStatic { static bool is_subclass(Klass* klass) { return klass->is_subclass_of(SystemDictionary::DirectMethodHandle_klass()); } - static bool is_instance(oop obj) { - return obj != NULL && is_subclass(obj->klass()); - } + static bool is_instance(oop obj); // Accessors for code generation: static int member_offset_in_bytes() { return _member_offset; } @@ -1045,9 +1039,7 @@ class java_lang_invoke_LambdaForm: AllStatic { return SystemDictionary::LambdaForm_klass() != NULL && klass->is_subclass_of(SystemDictionary::LambdaForm_klass()); } - static bool is_instance(oop obj) { - return obj != NULL && is_subclass(obj->klass()); - } + static bool is_instance(oop obj); // Accessors for code generation: static int vmentry_offset_in_bytes() { return _vmentry_offset; } @@ -1111,9 +1103,7 @@ class java_lang_invoke_MemberName: AllStatic { static bool is_subclass(Klass* klass) { return klass->is_subclass_of(SystemDictionary::MemberName_klass()); } - static bool is_instance(oop obj) { - return obj != NULL && is_subclass(obj->klass()); - } + static bool is_instance(oop obj); static bool is_method(oop obj); @@ -1166,9 +1156,7 @@ class java_lang_invoke_MethodType: AllStatic { static Symbol* as_signature(oop mt, bool intern_if_not_found, TRAPS); static void print_signature(oop mt, outputStream* st); - static bool is_instance(oop obj) { - return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass(); - } + static bool is_instance(oop obj); static bool equals(oop mt1, oop mt2); @@ -1190,19 +1178,17 @@ private: public: // Accessors - static oop target( oop site) { return site->obj_field( _target_offset); } - static void set_target( oop site, oop target) { site->obj_field_put( _target_offset, target); } + static oop target( oop site); + static void set_target( oop site, oop target); - static volatile oop target_volatile(oop site) { return oop((oopDesc *)(site->obj_field_volatile(_target_offset))); } - static void set_target_volatile(oop site, oop target) { site->obj_field_put_volatile(_target_offset, target); } + static volatile oop target_volatile(oop site); + static void set_target_volatile(oop site, oop target); // Testers static bool is_subclass(Klass* klass) { return klass->is_subclass_of(SystemDictionary::CallSite_klass()); } - static bool is_instance(oop obj) { - return obj != NULL && is_subclass(obj->klass()); - } + static bool is_instance(oop obj); // Accessors for code generation: static int target_offset_in_bytes() { return _target_offset; } @@ -1268,9 +1254,7 @@ class java_lang_ClassLoader : AllStatic { static bool is_subclass(Klass* klass) { return klass->is_subclass_of(SystemDictionary::ClassLoader_klass()); } - static bool is_instance(oop obj) { - return obj != NULL && is_subclass(obj->klass()); - } + static bool is_instance(oop obj); // Debugging friend class JavaClasses; diff --git a/hotspot/src/share/vm/classfile/javaClasses.inline.hpp b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp new file mode 100644 index 00000000000..961d6efdd83 --- /dev/null +++ b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp @@ -0,0 +1,76 @@ +/* + * 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. + * + */ + +#ifndef SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP +#define SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP + +#include "classfile/javaClasses.hpp" +#include "oops/oop.inline.hpp" +#include "oops/oopsHierarchy.hpp" + +inline volatile oop java_lang_invoke_CallSite::target_volatile(oop site) { + return oop((oopDesc *)(site->obj_field_volatile(_target_offset))); +} + +inline void java_lang_invoke_CallSite::set_target_volatile(oop site, oop target) { + site->obj_field_put_volatile(_target_offset, target); +} + +inline oop java_lang_invoke_CallSite::target(oop site) { + return site->obj_field(_target_offset); +} + +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()); +} + +inline bool java_lang_invoke_MemberName::is_instance(oop obj) { + return obj != NULL && is_subclass(obj->klass()); +} + +inline bool java_lang_invoke_MethodType::is_instance(oop obj) { + return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass(); +} + +inline bool java_lang_invoke_MethodHandle::is_instance(oop obj) { + return obj != NULL && is_subclass(obj->klass()); +} + +inline bool java_lang_Class::is_instance(oop obj) { + return obj != NULL && obj->klass() == SystemDictionary::Class_klass(); +} + +inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) { + return obj != NULL && is_subclass(obj->klass()); +} + +#endif // SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP diff --git a/hotspot/src/share/vm/classfile/stringTable.cpp b/hotspot/src/share/vm/classfile/stringTable.cpp index 7d2a4f93ef3..ac5e1ce1f8f 100644 --- a/hotspot/src/share/vm/classfile/stringTable.cpp +++ b/hotspot/src/share/vm/classfile/stringTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -33,7 +33,6 @@ #include "memory/filemap.hpp" #include "memory/gcLocker.inline.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/mutexLocker.hpp" #include "utilities/hashtable.inline.hpp" diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp index 3d08364be82..ec111a6d4e3 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.cpp +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp @@ -33,7 +33,6 @@ #include "memory/filemap.hpp" #include "memory/gcLocker.inline.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/mutexLocker.hpp" #include "utilities/hashtable.inline.hpp" diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp index ca1b6b477cd..72da0bb7089 100644 --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp @@ -25,7 +25,7 @@ #include "precompiled.hpp" #include "classfile/classLoaderData.inline.hpp" #include "classfile/dictionary.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/loaderConstraints.hpp" #include "classfile/placeholders.hpp" #include "classfile/resolutionErrors.hpp" @@ -44,8 +44,8 @@ #include "oops/klass.inline.hpp" #include "oops/methodData.hpp" #include "oops/objArrayKlass.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #include "oops/typeArrayKlass.hpp" #include "prims/jvmtiEnvBase.hpp" #include "prims/methodHandles.hpp" diff --git a/hotspot/src/share/vm/classfile/verificationType.hpp b/hotspot/src/share/vm/classfile/verificationType.hpp index 9a7836045f6..27328f3ae32 100644 --- a/hotspot/src/share/vm/classfile/verificationType.hpp +++ b/hotspot/src/share/vm/classfile/verificationType.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,7 +28,7 @@ #include "classfile/systemDictionary.hpp" #include "memory/allocation.hpp" #include "oops/instanceKlass.hpp" -#include "oops/oop.inline.hpp" +#include "oops/oop.hpp" #include "oops/symbol.hpp" #include "runtime/handles.hpp" #include "runtime/signature.hpp" diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index eebbf78be6d..c9b0cb63b28 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -27,6 +27,7 @@ #include "ci/ciEnv.hpp" #include "ci/ciKlass.hpp" #include "ci/ciMethod.hpp" +#include "classfile/javaClasses.inline.hpp" #include "code/dependencies.hpp" #include "compiler/compileLog.hpp" #include "oops/oop.inline.hpp" diff --git a/hotspot/src/share/vm/code/icBuffer.cpp b/hotspot/src/share/vm/code/icBuffer.cpp index 0fe6e0d1145..f0cccc9a8d9 100644 --- a/hotspot/src/share/vm/code/icBuffer.cpp +++ b/hotspot/src/share/vm/code/icBuffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -35,7 +35,6 @@ #include "memory/universe.inline.hpp" #include "oops/method.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/stubRoutines.hpp" diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 835b3dc831d..63a415a0511 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -35,6 +35,7 @@ #include "compiler/disassembler.hpp" #include "interpreter/bytecode.hpp" #include "oops/methodData.hpp" +#include "oops/oop.inline.hpp" #include "prims/jvmtiRedefineClassesTrace.hpp" #include "prims/jvmtiImpl.hpp" #include "runtime/atomic.inline.hpp" diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp index e4f6d3f5040..207781c96f1 100644 --- a/hotspot/src/share/vm/compiler/disassembler.cpp +++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -28,6 +28,7 @@ #include "compiler/disassembler.hpp" #include "gc_interface/collectedHeap.hpp" #include "memory/cardTableModRefBS.hpp" +#include "oops/oop.inline.hpp" #include "runtime/fprofiler.hpp" #include "runtime/handles.inline.hpp" #include "runtime/os.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp index 13cc179ac94..b97a3a17828 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp @@ -27,6 +27,7 @@ #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" #include "gc_implementation/g1/heapRegion.hpp" #include "gc_implementation/g1/satbQueue.hpp" +#include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/orderAccess.inline.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp index 50203ce928a..98c8b65f3a3 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp @@ -28,7 +28,7 @@ #include "gc_implementation/g1/g1RegionToSpaceMapper.hpp" #include "memory/cardTableModRefBS.hpp" #include "memory/memRegion.hpp" -#include "oops/oop.inline.hpp" +#include "oops/oop.hpp" #include "utilities/macros.hpp" class DirtyCardQueueSet; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp index 362404fdbea..a929b0faa42 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedup.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -23,7 +23,7 @@ */ #include "precompiled.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" #include "gc_implementation/g1/g1GCPhaseTimes.hpp" #include "gc_implementation/g1/g1StringDedup.hpp" @@ -51,7 +51,7 @@ void G1StringDedup::stop() { } bool G1StringDedup::is_candidate_from_mark(oop obj) { - if (java_lang_String::is_instance(obj)) { + if (java_lang_String::is_instance_inlined(obj)) { bool from_young = G1CollectedHeap::heap()->heap_region_containing_raw(obj)->is_young(); if (from_young && obj->age() < StringDeduplicationAgeThreshold) { // Candidate found. String is being evacuated from young to old but has not @@ -73,7 +73,7 @@ void G1StringDedup::enqueue_from_mark(oop java_string) { } bool G1StringDedup::is_candidate_from_evacuation(bool from_young, bool to_young, oop obj) { - if (from_young && java_lang_String::is_instance(obj)) { + if (from_young && java_lang_String::is_instance_inlined(obj)) { if (to_young && obj->age() == StringDeduplicationAgeThreshold) { // Candidate found. String is being evacuated from young to young and just // reached the deduplication age threshold. diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp index 723abbae095..80ad7983939 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupQueue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -23,9 +23,11 @@ */ #include "precompiled.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" +#include "gc_implementation/g1/g1StringDedup.hpp" #include "gc_implementation/g1/g1StringDedupQueue.hpp" #include "memory/gcLocker.hpp" +#include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/mutexLocker.hpp" #include "utilities/stack.inline.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp index e0fce706491..a9d2d790e32 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1StringDedupTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,13 +24,14 @@ #include "precompiled.hpp" #include "classfile/altHashing.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" #include "gc_implementation/g1/g1StringDedupTable.hpp" #include "memory/gcLocker.hpp" #include "memory/padded.inline.hpp" #include "oops/typeArrayOop.hpp" +#include "oops/oop.inline.hpp" #include "runtime/mutexLocker.hpp" // diff --git a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp index 62ae230f1a3..8dc6a417371 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ #include "gc_implementation/g1/g1CollectedHeap.hpp" #include "gc_implementation/g1/heapRegion.hpp" #include "memory/space.hpp" +#include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" // This version requires locking. diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp index ae89c847c8c..b98f8919ab0 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcTrace.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -31,6 +31,7 @@ #include "gc_implementation/shared/objectCountEventSender.hpp" #include "memory/heapInspection.hpp" #include "memory/referenceProcessorStats.hpp" +#include "memory/resourceArea.hpp" #include "runtime/os.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp index 425ec595ff8..3e610f5513a 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -41,6 +41,11 @@ #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" #endif // INCLUDE_ALL_GCS +VM_GC_Operation::~VM_GC_Operation() { + CollectedHeap* ch = Universe::heap(); + ch->collector_policy()->set_all_soft_refs_clear(false); +} + // The same dtrace probe can't be inserted in two different files, so we // have to call it here, so it's only in one file. Can't create new probes // for the other file anymore. The dtrace probes have to remain stable. diff --git a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp index 0c2ca8018a8..5885638cd43 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/vmGCOperations.hpp @@ -25,6 +25,7 @@ #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP #define SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP +#include "gc_interface/collectedHeap.hpp" #include "memory/heapInspection.hpp" #include "runtime/handles.hpp" #include "runtime/jniHandles.hpp" @@ -106,10 +107,7 @@ class VM_GC_Operation: public VM_Operation { // mutators have run. Soft refs will be cleared again in this // collection. } - ~VM_GC_Operation() { - CollectedHeap* ch = Universe::heap(); - ch->collector_policy()->set_all_soft_refs_clear(false); - } + ~VM_GC_Operation(); // Acquire the reference synchronization lock virtual bool doit_prologue(); diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp index 6927f273848..649bce23c1e 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.cpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ #include "gc_interface/allocTracer.hpp" #include "gc_interface/collectedHeap.hpp" #include "gc_interface/collectedHeap.inline.hpp" +#include "memory/barrierSet.inline.hpp" #include "memory/metaspace.hpp" #include "oops/oop.inline.hpp" #include "oops/instanceMirrorKlass.hpp" @@ -124,6 +125,14 @@ void CollectedHeap::print_heap_after_gc() { } } +void CollectedHeap::print_on_error(outputStream* st) const { + st->print_cr("Heap:"); + print_extended_on(st); + st->cr(); + + _barrier_set->print_on(st); +} + void CollectedHeap::register_nmethod(nmethod* nm) { assert_locked_or_safepoint(CodeCache_lock); } diff --git a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp index 8a4ec92a11b..dba48ae4f92 100644 --- a/hotspot/src/share/vm/gc_interface/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc_interface/collectedHeap.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ #include "gc_interface/gcCause.hpp" #include "gc_implementation/shared/gcWhen.hpp" #include "memory/allocation.hpp" -#include "memory/barrierSet.hpp" #include "runtime/handles.hpp" #include "runtime/perfData.hpp" #include "runtime/safepoint.hpp" @@ -576,13 +575,7 @@ class CollectedHeap : public CHeapObj { print_on(st); } - virtual void print_on_error(outputStream* st) const { - st->print_cr("Heap:"); - print_extended_on(st); - st->cr(); - - _barrier_set->print_on(st); - } + virtual void print_on_error(outputStream* st) const; // Print all GC threads (other than the VM thread) // used by this heap. diff --git a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp index 4600413dc5b..a0d52b0d196 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeTracer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/javaClasses.inline.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/bytecodeTracer.hpp" #include "interpreter/bytecodes.hpp" diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 18488331b39..e59c49ba4e6 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "compiler/compileBroker.hpp" @@ -38,6 +39,7 @@ #include "oops/instanceKlass.hpp" #include "oops/methodData.hpp" #include "oops/objArrayKlass.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/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index 561b3352bd4..9a62cd62807 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -35,6 +35,7 @@ #include "memory/universe.inline.hpp" #include "oops/instanceKlass.hpp" #include "oops/objArrayOop.hpp" +#include "oops/oop.inline.hpp" #include "prims/methodHandles.hpp" #include "prims/nativeLookup.hpp" #include "runtime/compilationPolicy.hpp" diff --git a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp index c27d8f4d6f6..2349a45adb7 100644 --- a/hotspot/src/share/vm/memory/barrierSet.hpp +++ b/hotspot/src/share/vm/memory/barrierSet.hpp @@ -160,7 +160,7 @@ public: // (For efficiency reasons, this operation is specialized for certain // barrier types. Semantically, it should be thought of as a call to the // virtual "_work" function below, which must implement the barrier.) - inline void write_region(MemRegion mr); + void write_region(MemRegion mr); protected: virtual void write_region_work(MemRegion mr) = 0; public: diff --git a/hotspot/src/share/vm/memory/barrierSet.inline.hpp b/hotspot/src/share/vm/memory/barrierSet.inline.hpp index 274614b48e5..ded96f3448d 100644 --- a/hotspot/src/share/vm/memory/barrierSet.inline.hpp +++ b/hotspot/src/share/vm/memory/barrierSet.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ #define SHARE_VM_MEMORY_BARRIERSET_INLINE_HPP #include "memory/barrierSet.hpp" -#include "memory/cardTableModRefBS.hpp" +#include "memory/cardTableModRefBS.inline.hpp" // Inline functions of BarrierSet, which de-virtualize certain // performance-critical calls when the barrier is the most common @@ -76,7 +76,7 @@ void BarrierSet::write_ref_array(HeapWord* start, size_t count) { } -void BarrierSet::write_region(MemRegion mr) { +inline void BarrierSet::write_region(MemRegion mr) { if (kind() == CardTableModRef) { ((CardTableModRefBS*)this)->inline_write_region(mr); } else { diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp index 4539d53c898..fdf264e4e88 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "memory/allocation.inline.hpp" -#include "memory/cardTableModRefBS.hpp" +#include "memory/cardTableModRefBS.inline.hpp" #include "memory/cardTableRS.hpp" #include "memory/sharedHeap.hpp" #include "memory/space.hpp" diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp index e0890ed1f6e..f2d1c12a9ce 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp @@ -27,7 +27,6 @@ #include "memory/modRefBarrierSet.hpp" #include "oops/oop.hpp" -#include "oops/oop.inline2.hpp" // This kind of "BarrierSet" allows a "CollectedHeap" to detect and // enumerate ref fields that have been modified (since the last @@ -45,6 +44,7 @@ class Generation; class OopsInGenClosure; class DirtyCardToOopClosure; class ClearNoncleanCardWrapper; +class CardTableRS; class CardTableModRefBS: public ModRefBarrierSet { // Some classes get to look at some private stuff. @@ -333,15 +333,7 @@ public: template inline void inline_write_ref_field_pre(T* field, oop newVal) {} - template inline void inline_write_ref_field(T* field, oop newVal, bool release) { - jbyte* byte = byte_for((void*)field); - if (release) { - // Perform a releasing store if requested. - OrderAccess::release_store((volatile jbyte*) byte, dirty_card); - } else { - *byte = dirty_card; - } - } + template inline void inline_write_ref_field(T* field, oop newVal, bool release); // These are used by G1, when it uses the card table as a temporary data // structure for card claiming. diff --git a/hotspot/src/share/vm/oops/oop.inline2.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.inline.hpp similarity index 60% rename from hotspot/src/share/vm/oops/oop.inline2.hpp rename to hotspot/src/share/vm/memory/cardTableModRefBS.inline.hpp index e0b1aaefd19..0f758afb7b5 100644 --- a/hotspot/src/share/vm/oops/oop.inline2.hpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -22,18 +22,21 @@ * */ -#ifndef SHARE_VM_OOPS_OOP_INLINE2_HPP -#define SHARE_VM_OOPS_OOP_INLINE2_HPP +#ifndef SHARE_VM_MEMORY_CARDTABLEMODREFBS_INLINE_HPP +#define SHARE_VM_MEMORY_CARDTABLEMODREFBS_INLINE_HPP -#include "gc_interface/collectedHeap.hpp" -#include "memory/generation.hpp" -#include "memory/universe.hpp" -#include "oops/oop.hpp" +#include "memory/cardTableModRefBS.hpp" +#include "oops/oopsHierarchy.hpp" +#include "runtime/orderAccess.inline.hpp" -// Implementation of all inlined member functions defined in oop.hpp -// We need a separate file to avoid circular references - -inline bool oopDesc::is_scavengable() const { - return Universe::heap()->is_scavengable(this); +template inline void CardTableModRefBS::inline_write_ref_field(T* field, oop newVal, bool release) { + jbyte* byte = byte_for((void*)field); + if (release) { + // Perform a releasing store if requested. + OrderAccess::release_store((volatile jbyte*) byte, dirty_card); + } else { + *byte = dirty_card; + } } -#endif // SHARE_VM_OOPS_OOP_INLINE2_HPP + +#endif // SHARE_VM_MEMORY_CARDTABLEMODREFBS_INLINE_HPP diff --git a/hotspot/src/share/vm/memory/genCollectedHeap.cpp b/hotspot/src/share/vm/memory/genCollectedHeap.cpp index 4fa0f84cfa2..6d800d33e9a 100644 --- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp @@ -41,7 +41,6 @@ #include "memory/sharedHeap.hpp" #include "memory/space.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/fprofiler.hpp" #include "runtime/handles.hpp" diff --git a/hotspot/src/share/vm/memory/heapInspection.cpp b/hotspot/src/share/vm/memory/heapInspection.cpp index 415ae6732cc..e5d6432f76f 100644 --- a/hotspot/src/share/vm/memory/heapInspection.cpp +++ b/hotspot/src/share/vm/memory/heapInspection.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -28,6 +28,7 @@ #include "memory/genCollectedHeap.hpp" #include "memory/heapInspection.hpp" #include "memory/resourceArea.hpp" +#include "oops/oop.inline.hpp" #include "runtime/os.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/memory/heapInspection.hpp b/hotspot/src/share/vm/memory/heapInspection.hpp index db782c42505..aa4bae939d1 100644 --- a/hotspot/src/share/vm/memory/heapInspection.hpp +++ b/hotspot/src/share/vm/memory/heapInspection.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -25,8 +25,9 @@ #ifndef SHARE_VM_MEMORY_HEAPINSPECTION_HPP #define SHARE_VM_MEMORY_HEAPINSPECTION_HPP -#include "memory/allocation.inline.hpp" -#include "oops/oop.inline.hpp" +#include "memory/allocation.hpp" +#include "oops/objArrayOop.hpp" +#include "oops/oop.hpp" #include "oops/annotations.hpp" #include "utilities/macros.hpp" diff --git a/hotspot/src/share/vm/memory/space.cpp b/hotspot/src/share/vm/memory/space.cpp index 9ced66021d1..288637750be 100644 --- a/hotspot/src/share/vm/memory/space.cpp +++ b/hotspot/src/share/vm/memory/space.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -36,7 +36,6 @@ #include "memory/space.inline.hpp" #include "memory/universe.inline.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #include "runtime/java.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/prefetch.inline.hpp" diff --git a/hotspot/src/share/vm/memory/space.inline.hpp b/hotspot/src/share/vm/memory/space.inline.hpp index d85ba249e28..6adfc5702a6 100644 --- a/hotspot/src/share/vm/memory/space.inline.hpp +++ b/hotspot/src/share/vm/memory/space.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -29,6 +29,7 @@ #include "gc_implementation/shared/markSweep.inline.hpp" #include "gc_implementation/shared/spaceDecorator.hpp" #include "gc_interface/collectedHeap.hpp" +#include "memory/generation.hpp" #include "memory/space.hpp" #include "memory/universe.hpp" #include "runtime/prefetch.inline.hpp" diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 03ae80e41d8..6c55aed8969 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -50,6 +50,7 @@ #include "oops/instanceKlass.hpp" #include "oops/instanceMirrorKlass.hpp" #include "oops/instanceRefKlass.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayKlass.hpp" #include "prims/jvmtiRedefineClassesTrace.hpp" diff --git a/hotspot/src/share/vm/oops/compiledICHolder.cpp b/hotspot/src/share/vm/oops/compiledICHolder.cpp index c17ca240a85..9e01e4ea705 100644 --- a/hotspot/src/share/vm/oops/compiledICHolder.cpp +++ b/hotspot/src/share/vm/oops/compiledICHolder.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ #include "oops/compiledICHolder.hpp" #include "oops/klass.hpp" #include "oops/method.hpp" -#include "oops/oop.inline2.hpp" #include "runtime/atomic.inline.hpp" volatile int CompiledICHolder::_live_count; diff --git a/hotspot/src/share/vm/oops/constantPool.cpp b/hotspot/src/share/vm/oops/constantPool.cpp index 0feca59f98c..f368bbb4111 100644 --- a/hotspot/src/share/vm/oops/constantPool.cpp +++ b/hotspot/src/share/vm/oops/constantPool.cpp @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "classfile/classLoaderData.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/metadataOnStackMark.hpp" #include "classfile/stringTable.hpp" #include "classfile/systemDictionary.hpp" @@ -36,11 +36,14 @@ #include "oops/constantPool.hpp" #include "oops/instanceKlass.hpp" #include "oops/objArrayKlass.hpp" +#include "oops/objArrayOop.inline.hpp" +#include "oops/oop.inline.hpp" #include "runtime/fieldType.hpp" #include "runtime/init.hpp" #include "runtime/javaCalls.hpp" #include "runtime/signature.hpp" #include "runtime/vframe.hpp" +#include "utilities/copy.hpp" PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/oops/cpCache.cpp b/hotspot/src/share/vm/oops/cpCache.cpp index 02c642f13a4..990d9391d1c 100644 --- a/hotspot/src/share/vm/oops/cpCache.cpp +++ b/hotspot/src/share/vm/oops/cpCache.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ #include "interpreter/rewriter.hpp" #include "memory/universe.inline.hpp" #include "oops/cpCache.hpp" -#include "oops/objArrayOop.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiRedefineClassesTrace.hpp" #include "prims/methodHandles.hpp" diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp index 0ae07185781..295008dd309 100644 --- a/hotspot/src/share/vm/oops/klass.cpp +++ b/hotspot/src/share/vm/oops/klass.cpp @@ -35,7 +35,7 @@ #include "memory/resourceArea.hpp" #include "oops/instanceKlass.hpp" #include "oops/klass.inline.hpp" -#include "oops/oop.inline2.hpp" +#include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.inline.hpp" #include "trace/traceMacros.hpp" diff --git a/hotspot/src/share/vm/oops/methodData.cpp b/hotspot/src/share/vm/oops/methodData.cpp index f9e187f9add..27a1ba4cd04 100644 --- a/hotspot/src/share/vm/oops/methodData.cpp +++ b/hotspot/src/share/vm/oops/methodData.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -36,6 +36,7 @@ #include "runtime/deoptimization.hpp" #include "runtime/handles.inline.hpp" #include "runtime/orderAccess.inline.hpp" +#include "utilities/copy.hpp" PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC diff --git a/hotspot/src/share/vm/oops/objArrayKlass.cpp b/hotspot/src/share/vm/oops/objArrayKlass.cpp index ffbdf026f24..002196fe0b1 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.cpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -35,11 +35,9 @@ #include "memory/universe.inline.hpp" #include "oops/instanceKlass.hpp" #include "oops/klass.inline.hpp" -#include "oops/objArrayKlass.hpp" #include "oops/objArrayKlass.inline.hpp" -#include "oops/objArrayOop.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #include "oops/symbol.hpp" #include "runtime/handles.inline.hpp" #include "runtime/mutexLocker.hpp" diff --git a/hotspot/src/share/vm/oops/objArrayOop.hpp b/hotspot/src/share/vm/oops/objArrayOop.hpp index bfb70564758..3b32e5bafc2 100644 --- a/hotspot/src/share/vm/oops/objArrayOop.hpp +++ b/hotspot/src/share/vm/oops/objArrayOop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -78,15 +78,7 @@ private: HeapWord* base() const { return (HeapWord*) arrayOopDesc::base(T_OBJECT); } // Accessing - oop obj_at(int index) const { - // With UseCompressedOops decode the narrow oop in the objArray to an - // uncompressed oop. Otherwise this is simply a "*" operator. - if (UseCompressedOops) { - return load_decode_heap_oop(obj_at_addr(index)); - } else { - return load_decode_heap_oop(obj_at_addr(index)); - } - } + oop obj_at(int index) const; void obj_at_put(int index, oop value) { if (UseCompressedOops) { diff --git a/hotspot/src/share/vm/oops/objArrayOop.inline.hpp b/hotspot/src/share/vm/oops/objArrayOop.inline.hpp new file mode 100644 index 00000000000..53f402023ff --- /dev/null +++ b/hotspot/src/share/vm/oops/objArrayOop.inline.hpp @@ -0,0 +1,42 @@ +/* + * 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. + * + */ + +#ifndef SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP +#define SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP + +#include "oops/objArrayOop.hpp" +#include "oops/oop.inline.hpp" +#include "runtime/globals.hpp" + +inline oop objArrayOopDesc::obj_at(int index) const { + // With UseCompressedOops decode the narrow oop in the objArray to an + // uncompressed oop. Otherwise this is simply a "*" operator. + if (UseCompressedOops) { + return load_decode_heap_oop(obj_at_addr(index)); + } else { + return load_decode_heap_oop(obj_at_addr(index)); + } +} + +#endif // SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP diff --git a/hotspot/src/share/vm/oops/oop.cpp b/hotspot/src/share/vm/oops/oop.cpp index 1be57811ede..58900848344 100644 --- a/hotspot/src/share/vm/oops/oop.cpp +++ b/hotspot/src/share/vm/oops/oop.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "classfile/altHashing.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/thread.inline.hpp" @@ -122,3 +122,17 @@ VerifyOopClosure VerifyOopClosure::verify_oop; void VerifyOopClosure::do_oop(oop* p) { VerifyOopClosure::do_oop_work(p); } void VerifyOopClosure::do_oop(narrowOop* p) { VerifyOopClosure::do_oop_work(p); } + +// type test operations that doesn't require inclusion of oop.inline.hpp. +bool oopDesc::is_instance_noinline() const { return is_instance(); } +bool oopDesc::is_instanceMirror_noinline() const { return is_instanceMirror(); } +bool oopDesc::is_instanceClassLoader_noline() const { return is_instanceClassLoader(); } +bool oopDesc::is_instanceRef_noline() const { return is_instanceRef(); } +bool oopDesc::is_array_noinline() const { return is_array(); } +bool oopDesc::is_objArray_noinline() const { return is_objArray(); } +bool oopDesc::is_typeArray_noinline() const { return is_typeArray(); } + +bool oopDesc::has_klass_gap() { + // Only has a klass gap when compressed class pointers are used. + return UseCompressedClassPointers; +} diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp index 2ea801d627a..fd6515a3228 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -108,7 +108,7 @@ class oopDesc { // to be able to figure out the size of an object knowing its klass. int size_given_klass(Klass* klass); - // type test operations (inlined in oop.inline.h) + // type test operations (inlined in oop.inline.hpp) bool is_instance() const; bool is_instanceMirror() const; bool is_instanceClassLoader() const; @@ -117,6 +117,15 @@ class oopDesc { bool is_objArray() const; bool is_typeArray() const; + // type test operations that don't require inclusion of oop.inline.hpp. + bool is_instance_noinline() const; + bool is_instanceMirror_noinline() const; + bool is_instanceClassLoader_noline() const; + bool is_instanceRef_noline() const; + bool is_array_noinline() const; + bool is_objArray_noinline() const; + bool is_typeArray_noinline() const; + private: // field addresses in oop void* field_base(int offset) const; @@ -370,10 +379,15 @@ class oopDesc { markOop displaced_mark() const; void set_displaced_mark(markOop m); + static bool has_klass_gap(); + // for code generation - static int mark_offset_in_bytes() { return offset_of(oopDesc, _mark); } - static int klass_offset_in_bytes() { return offset_of(oopDesc, _metadata._klass); } - static int klass_gap_offset_in_bytes(); + static int mark_offset_in_bytes() { return offset_of(oopDesc, _mark); } + static int klass_offset_in_bytes() { return offset_of(oopDesc, _metadata._klass); } + static int klass_gap_offset_in_bytes() { + assert(has_klass_gap(), "only applicable to compressed klass pointers"); + return klass_offset_in_bytes() + sizeof(narrowKlass); + } }; #endif // SHARE_VM_OOPS_OOP_HPP diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index 4b3c901f63d..8c9949d1bd6 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, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -71,11 +71,6 @@ inline Klass* oopDesc::klass_or_null() const volatile { } } -inline int oopDesc::klass_gap_offset_in_bytes() { - assert(UseCompressedClassPointers, "only applicable to compressed klass pointers"); - return oopDesc::klass_offset_in_bytes() + sizeof(narrowKlass); -} - inline Klass** oopDesc::klass_addr() { // Only used internally and with CMS and will not work with // UseCompressedOops @@ -602,8 +597,11 @@ inline void oopDesc::follow_contents(void) { klass()->oop_follow_contents(this); } -// Used by scavengers +inline bool oopDesc::is_scavengable() const { + return Universe::heap()->is_scavengable(this); +} +// Used by scavengers inline 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 diff --git a/hotspot/src/share/vm/opto/callGenerator.cpp b/hotspot/src/share/vm/opto/callGenerator.cpp index 51264dadbaf..296d316b999 100644 --- a/hotspot/src/share/vm/opto/callGenerator.cpp +++ b/hotspot/src/share/vm/opto/callGenerator.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -39,7 +39,7 @@ #include "opto/rootnode.hpp" #include "opto/runtime.hpp" #include "opto/subnode.hpp" - +#include "runtime/sharedRuntime.hpp" // Utility function. const TypeFunc* CallGenerator::tf() const { diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index 23253651dca..1395a411670 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -64,6 +64,7 @@ #include "opto/type.hpp" #include "opto/vectornode.hpp" #include "runtime/arguments.hpp" +#include "runtime/sharedRuntime.hpp" #include "runtime/signature.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/timer.hpp" diff --git a/hotspot/src/share/vm/opto/convertnode.cpp b/hotspot/src/share/vm/opto/convertnode.cpp index 8c42aaed679..63a391abc97 100644 --- a/hotspot/src/share/vm/opto/convertnode.cpp +++ b/hotspot/src/share/vm/opto/convertnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -28,6 +28,7 @@ #include "opto/matcher.hpp" #include "opto/phaseX.hpp" #include "opto/subnode.hpp" +#include "runtime/sharedRuntime.hpp" //============================================================================= //------------------------------Identity--------------------------------------- diff --git a/hotspot/src/share/vm/opto/graphKit.cpp b/hotspot/src/share/vm/opto/graphKit.cpp index e185d85958f..6301cf31e87 100644 --- a/hotspot/src/share/vm/opto/graphKit.cpp +++ b/hotspot/src/share/vm/opto/graphKit.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3747,6 +3747,17 @@ void GraphKit::final_sync(IdealKit& ideal) { sync_kit(ideal); } +Node* GraphKit::byte_map_base_node() { + // Get base of card map + CardTableModRefBS* ct = (CardTableModRefBS*)(Universe::heap()->barrier_set()); + assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust users of this code"); + if (ct->byte_map_base != NULL) { + return makecon(TypeRawPtr::make((address)ct->byte_map_base)); + } else { + return null(); + } +} + // vanilla/CMS post barrier // Insert a write-barrier store. This is to let generational GC work; we have // to flag all oop-stores before the next GC point. diff --git a/hotspot/src/share/vm/opto/graphKit.hpp b/hotspot/src/share/vm/opto/graphKit.hpp index 22699420cbb..71db71720ef 100644 --- a/hotspot/src/share/vm/opto/graphKit.hpp +++ b/hotspot/src/share/vm/opto/graphKit.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -104,16 +104,7 @@ class GraphKit : public Phase { // (See also macro MakeConX in type.hpp, which uses intcon or longcon.) // Helper for byte_map_base - Node* byte_map_base_node() { - // Get base of card map - CardTableModRefBS* ct = (CardTableModRefBS*)(Universe::heap()->barrier_set()); - assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust users of this code"); - if (ct->byte_map_base != NULL) { - return makecon(TypeRawPtr::make((address)ct->byte_map_base)); - } else { - return null(); - } - } + Node* byte_map_base_node(); jint find_int_con(Node* n, jint value_if_unknown) { return _gvn.find_int_con(n, value_if_unknown); diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp index 3aab19fc52e..fc436985b93 100644 --- a/hotspot/src/share/vm/opto/lcm.cpp +++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ #include "opto/cfgnode.hpp" #include "opto/machnode.hpp" #include "opto/runtime.hpp" +#include "runtime/sharedRuntime.hpp" // Optimization - Graph Style diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index 8ecb54b2dc9..9f7d0b0d77d 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -38,6 +38,7 @@ #include "opto/type.hpp" #include "opto/vectornode.hpp" #include "runtime/os.hpp" +#include "runtime/sharedRuntime.hpp" OptoReg::Name OptoReg::c_frame_pointer; diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp index 3afa49c4495..683ae584710 100644 --- a/hotspot/src/share/vm/opto/memnode.cpp +++ b/hotspot/src/share/vm/opto/memnode.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -40,6 +40,7 @@ #include "opto/narrowptrnode.hpp" #include "opto/phaseX.hpp" #include "opto/regmask.hpp" +#include "utilities/copy.hpp" // Portions of code courtesy of Clifford Click diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp index c99ac9659d1..f18f83271ed 100644 --- a/hotspot/src/share/vm/opto/parse2.cpp +++ b/hotspot/src/share/vm/opto/parse2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,7 @@ #include "compiler/compileLog.hpp" #include "interpreter/linkResolver.hpp" #include "memory/universe.inline.hpp" +#include "oops/oop.inline.hpp" #include "opto/addnode.hpp" #include "opto/castnode.hpp" #include "opto/convertnode.hpp" diff --git a/hotspot/src/share/vm/opto/stringopts.cpp b/hotspot/src/share/vm/opto/stringopts.cpp index 5f7da1f8c74..0987323fec2 100644 --- a/hotspot/src/share/vm/opto/stringopts.cpp +++ b/hotspot/src/share/vm/opto/stringopts.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -34,6 +34,7 @@ #include "opto/runtime.hpp" #include "opto/stringopts.hpp" #include "opto/subnode.hpp" +#include "runtime/sharedRuntime.hpp" #define __ kit. diff --git a/hotspot/src/share/vm/precompiled/precompiled.hpp b/hotspot/src/share/vm/precompiled/precompiled.hpp index df15b2f8c32..f4be68c88a6 100644 --- a/hotspot/src/share/vm/precompiled/precompiled.hpp +++ b/hotspot/src/share/vm/precompiled/precompiled.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -160,8 +160,6 @@ # include "oops/objArrayKlass.hpp" # include "oops/objArrayOop.hpp" # include "oops/oop.hpp" -# include "oops/oop.inline.hpp" -# include "oops/oop.inline2.hpp" # include "oops/oopsHierarchy.hpp" # include "oops/symbol.hpp" # include "oops/typeArrayKlass.hpp" diff --git a/hotspot/src/share/vm/prims/forte.cpp b/hotspot/src/share/vm/prims/forte.cpp index eee24dfc999..2ae0e1bba9c 100644 --- a/hotspot/src/share/vm/prims/forte.cpp +++ b/hotspot/src/share/vm/prims/forte.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * 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 @@ -29,7 +29,6 @@ #include "memory/space.hpp" #include "memory/universe.inline.hpp" #include "oops/oop.inline.hpp" -#include "oops/oop.inline2.hpp" #include "prims/forte.hpp" #include "runtime/javaCalls.hpp" #include "runtime/thread.inline.hpp" diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 20b3f6949ff..ca3887bd6f1 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, 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. * @@ -42,7 +42,7 @@ #include "oops/markOop.hpp" #include "oops/method.hpp" #include "oops/objArrayKlass.hpp" -#include "oops/objArrayOop.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/symbol.hpp" #include "oops/typeArrayKlass.hpp" diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp index 412d9352082..b851d0642e0 100644 --- a/hotspot/src/share/vm/prims/jniCheck.cpp +++ b/hotspot/src/share/vm/prims/jniCheck.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "memory/guardedMemory.hpp" diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 8056a37c05e..29fd649694f 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -25,18 +25,21 @@ #include "precompiled.hpp" #include "classfile/classLoader.hpp" #include "classfile/javaAssertions.hpp" -#include "classfile/javaClasses.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/stringTable.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "gc_interface/collectedHeap.inline.hpp" #include "interpreter/bytecode.hpp" +#include "memory/barrierSet.inline.hpp" #include "memory/oopFactory.hpp" #include "memory/universe.inline.hpp" #include "oops/fieldStreams.hpp" #include "oops/instanceKlass.hpp" #include "oops/objArrayKlass.hpp" +#include "oops/objArrayOop.inline.hpp" #include "oops/method.hpp" +#include "oops/oop.inline.hpp" #include "prims/jvm.h" #include "prims/jvm_misc.hpp" #include "prims/jvmtiExport.hpp" diff --git a/hotspot/src/share/vm/prims/jvmtiEnter.xsl b/hotspot/src/share/vm/prims/jvmtiEnter.xsl index e855d21dd81..3d3b38d15a3 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnter.xsl +++ b/hotspot/src/share/vm/prims/jvmtiEnter.xsl @@ -1,6 +1,6 @@