This commit is contained in:
Coleen Phillimore 2015-11-25 16:13:14 +00:00
commit a210245805
155 changed files with 3044 additions and 3007 deletions

View file

@ -44,9 +44,7 @@
# ALT_EXPORT_PATH Directory to export hotspot build to
# ALT_JDK_IMPORT_PATH Current JDK build (only for create_jdk rules)
# ALT_JDK_TARGET_IMPORT_PATH Current JDK build when cross-compiling
# ALT_BUILD_WIN_SA Building SA on Windows is disabled by default.
# Set ALT_BUILD_WIN_SA=1 to enable building SA on
# Windows.
#
# Version strings and numbers:
# JDK_VERSION Current JDK version (e.g. 1.6.0)
# PREVIOUS_JDK_VERSION Previous (bootdir) JDK version (e.g. 1.5.0)

View file

@ -46,15 +46,6 @@
#
# make REMOTE="rsh -l me myotherlinuxbox"
# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
# JDI binding on SA produces two binaries:
# 1. sa-jdi.jar - This is built before building libjvm.so
# Please refer to ./makefiles/sa.make
# 2. libsa.so - Native library for SA - This is built after
# libjsig.so (signal interposition library)
# Please refer to ./makefiles/vm.make
# If $(GAMMADIR)/agent dir is not present, SA components are not built.
# No tests on Aix.
TEST_IN_BUILD=false

View file

@ -50,7 +50,6 @@
# adlc.make -
# trace.make - generate tracing event and type definitions
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
# sa.make - generate SA jar file and natives
#
# The makefiles are split this way so that "make foo" will run faster by not
# having to read the dependency files for the vm.
@ -125,7 +124,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
# For dependencies and recursive makes.
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@ -212,7 +211,6 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "TARGET = $(TARGET)"; \
echo "HS_BUILD_VER = $(HS_BUILD_VER)"; \
echo "JRE_RELEASE_VER = $(JRE_RELEASE_VERSION)"; \
echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
echo "OPENJDK = $(OPENJDK)"; \
@ -351,16 +349,6 @@ trace.make: $(BUILDTREE_MAKE)
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
) > $@
sa.make: $(BUILDTREE_MAKE)
@echo $(LOG_INFO) Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
echo; \
echo include flags.make; \
echo; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
) > $@
FORCE:
.PHONY: all FORCE

View file

@ -219,11 +219,3 @@ ifeq ($(JVM_VARIANT_CLIENT),true)
# endif
# endif
endif
# Serviceability Binaries
# No SA Support for PPC or zero
ADD_SA_BINARIES/ppc =
ADD_SA_BINARIES/ppc64 =
ADD_SA_BINARIES/zero =
EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))

View file

@ -103,8 +103,6 @@ BOOT_JAVA_HOME = $(JAVA_HOME)
else
# take from the PATH, if ALT_BOOTDIR, BOOTDIR and JAVA_HOME are not defined
# note that this is to support hotspot build without SA. To build
# SA along with hotspot, you need to define ALT_BOOTDIR, BOOTDIR or JAVA_HOME
RUN.JAVA = java
RUN.JAVAP = javap

View file

@ -1,112 +0,0 @@
#
# Copyright (c) 2003, 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.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# This makefile (sa.make) is included from the sa.make in the
# build directories.
# This makefile is used to build Serviceability Agent java code
# and generate JNI header file for native methods.
include $(GAMMADIR)/make/aix/makefiles/rules.make
include $(GAMMADIR)/make/defs.make
AGENT_DIR = $(GAMMADIR)/agent
include $(GAMMADIR)/make/sa.files
TOPDIR = $(shell echo `pwd`)
GENERATED = $(TOPDIR)/../generated
# tools.jar is needed by the JDI - SA binding
SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
# TODO: if it's a modules image, check if SA module is installed.
MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules
AGENT_FILES_LIST := $(GENERATED)/agent.classes.list
SA_CLASSDIR = $(GENERATED)/saclasses
SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium, PowerPC, ARM or zero.
all:
if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \
-a "$(SRCARCH)" != "arm" \
-a "$(SRCARCH)" != "ppc" \
-a "$(SRCARCH)" != "zero" ] ; then \
$(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
fi
$(GENERATED)/sa-jdi.jar: $(AGENT_FILES)
$(QUIETLY) echo $(LOG_INFO) "Making $@"
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
exit 1; \
fi
$(QUIETLY) if [ ! -f $(SA_CLASSPATH) -a ! -d $(MODULELIB_PATH) ] ; then \
echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\
echo ""; \
exit 1; \
fi
$(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \
mkdir -p $(SA_CLASSDIR); \
fi
# Note: When indented, make tries to execute the '$(shell' comment.
# In some environments, cmd processors have limited line length.
# To prevent the javac invocation in the next block from using
# a very long cmd line, we use javac's @file-list option. We
# generate the file lists using make's built-in 'foreach' control
# flow which also avoids cmd processor line length issues. Since
# the 'foreach' is done as part of make's macro expansion phase,
# the initialization of the lists is also done in the same phase
# using '$(shell rm ...' instead of using the more traditional
# 'rm ...' rule.
$(shell rm -rf $(AGENT_FILES_LIST))
# gnumake 3.78.1 does not accept the *'s that
# are in AGENT_FILES, so use the shell to expand them.
# Be extra carefull to not produce too long command lines in the shell!
$(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST)))
$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -h $(GENERATED) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
$(QUIETLY) $(REMOTE) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
$(QUIETLY) $(CP) $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql
$(QUIETLY) mkdir -p $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/*
$(QUIETLY) $(CP) $(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/
$(QUIETLY) $(CP) -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)/
$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .
$(QUIETLY) $(REMOTE) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
clean:
rm -rf $(SA_CLASSDIR)
rm -rf $(GENERATED)/sa-jdi.jar
rm -rf $(AGENT_FILES_LIST)

View file

@ -1,117 +0,0 @@
#
# Copyright (c) 2005, 2014, 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.
#
# 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 $(GAMMADIR)/make/defs.make
# Rules to build serviceability agent library, used by vm.make
# libsaproc.so: serviceability agent
SAPROC = saproc
LIBSAPROC = lib$(SAPROC).so
LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo
LIBSAPROC_DIZ = lib$(SAPROC).diz
AGENT_DIR = $(GAMMADIR)/agent
SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)
SASRCFILES = $(SASRCDIR)/salibelf.c \
$(SASRCDIR)/symtab.c \
$(SASRCDIR)/libproc_impl.c \
$(SASRCDIR)/ps_proc.c \
$(SASRCDIR)/ps_core.c \
$(SASRCDIR)/LinuxDebuggerLocal.c \
SAMAPFILE = $(SASRCDIR)/mapfile
DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
DEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ)
# DEBUG_BINARIES overrides everything, use full -g debug information
ifeq ($(DEBUG_BINARIES), true)
SA_DEBUG_CFLAGS = -g
endif
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium, PPC, ARM or zero.
ifneq ($(wildcard $(AGENT_DIR)),)
ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),)
BUILDLIBSAPROC = $(LIBSAPROC)
endif
endif
SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE)
$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
exit 1; \
fi
@echo $(LOG_INFO) Making SA debugger back-end...
$(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \
-D_FILE_OFFSET_BITS=64 \
$(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
$(BIN_UTILS) \
-I$(SASRCDIR) \
-I$(GENERATED) \
-I$(BOOT_JAVA_HOME)/include \
-I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
$(SASRCFILES) \
$(SA_LFLAGS) \
$(SA_DEBUG_CFLAGS) \
-o $@ \
-lthread_db
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
ifeq ($(STRIP_POLICY),all_strip)
$(QUIETLY) $(STRIP) $@
else
ifeq ($(STRIP_POLICY),min_strip)
$(QUIETLY) $(STRIP) -g $@
# implied else here is no stripping at all
endif
endif
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
$(RM) $(LIBSAPROC_DEBUGINFO)
endif
endif
install_saproc: $(BUILDLIBSAPROC)
$(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \
echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
test -f $(LIBSAPROC_DEBUGINFO) && \
$(CP) -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \
test -f $(LIBSAPROC_DIZ) && \
$(CP) -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \
$(CP) -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \
fi
.PHONY: install_saproc

View file

@ -28,7 +28,6 @@
# It also:
# -builds and runs adlc via adlc.make
# -generates JVMTI source and docs via jvmti.make (JSR-163)
# -generate sa-jdi.jar (JDI binding to core files)
# It assumes the following flags are set:
# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Obj_Files
@ -86,7 +85,7 @@ default: vm_build_preliminaries the_vm
@echo All done.
# This is an explicit dependency for the sake of parallel makes.
vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) trace_stuff jvmti_stuff sa_stuff
vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) trace_stuff jvmti_stuff
@# We need a null action here, so implicit rules don't get consulted.
$(Cached_plat): $(Plat_File)
@ -104,10 +103,6 @@ jvmti_stuff: $(Cached_plat) $(adjust-mflags)
trace_stuff: jvmti_stuff $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f trace.make $(MFLAGS-adjusted)
# generate SA jar files and native header
sa_stuff:
@$(MAKE) -f sa.make $(MFLAGS-adjusted)
# and the VM: must use other makefile with dependencies included
# We have to go to great lengths to get control over the -jN argument
@ -146,7 +141,7 @@ realclean:
rm -fr $(GENERATED)
.PHONY: default vm_build_preliminaries
.PHONY: lists ad_stuff jvmti_stuff sa_stuff the_vm clean realclean
.PHONY: lists ad_stuff jvmti_stuff the_vm clean realclean
.PHONY: checks check_os_version install
.NOTPARALLEL:

View file

@ -61,7 +61,7 @@ Src_Dirs_I += $(GENERATED)
# The order is important for the precompiled headers to work.
INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
# SYMFLAG is used by {jsig,saproc}.make
# SYMFLAG is used by jsig.make
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# always build with debug info when we can create .debuginfo files
SYMFLAG = -g
@ -359,13 +359,10 @@ install_jvm: $(LIBJVM)
# Signal interposition library
include $(MAKEFILES_DIR)/jsig.make
# Serviceability agent
include $(MAKEFILES_DIR)/saproc.make
#----------------------------------------------------------------------
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC)
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB)
install: install_jvm install_jsig install_saproc
install: install_jvm install_jsig
.PHONY: default build install install_jvm

View file

@ -45,15 +45,6 @@
#
# make REMOTE="rsh -l me myotherlinuxbox"
# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
# JDI binding on SA produces two binaries:
# 1. sa-jdi.jar - This is built before building libjvm.so
# Please refer to ./makefiles/sa.make
# 2. libsa.so - Native library for SA - This is built after
# libjsig.so (signal interposition library)
# Please refer to ./makefiles/vm.make
# If $(GAMMADIR)/agent dir is not present, SA components are not built.
ifeq ($(GAMMADIR),)
include ../../make/defs.make
else

View file

@ -49,7 +49,6 @@
# adlc.make -
# trace.make - generate tracing event and type definitions
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
# sa.make - generate SA jar file and natives
#
# The makefiles are split this way so that "make foo" will run faster by not
# having to read the dependency files for the vm.
@ -130,7 +129,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
# dtrace.make is used on BSD versions that implement Dtrace (like MacOS X)
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make dtrace.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make dtrace.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@ -218,7 +217,6 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "TARGET = $(TARGET)"; \
echo "HS_BUILD_VER = $(HS_BUILD_VER)"; \
echo "JRE_RELEASE_VER = $(JRE_RELEASE_VERSION)"; \
echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
echo "OPENJDK = $(OPENJDK)"; \
@ -360,16 +358,6 @@ trace.make: $(BUILDTREE_MAKE)
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
) > $@
sa.make: $(BUILDTREE_MAKE)
@echo $(LOG_INFO) Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
echo; \
echo include flags.make; \
echo; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
) > $@
dtrace.make: $(BUILDTREE_MAKE)
@echo $(LOG_INFO) Creating $@ ...
$(QUIETLY) ( \

View file

@ -188,13 +188,13 @@ ifeq ($(JDK6_OR_EARLIER),0)
ifneq ($(BUILD_FLAVOR),)
# FULL_DEBUG_SYMBOLS not created for individual static libraries
ifeq ($(STATIC_BUILD),false)
ifeq ($(BUILD_FLAVOR), product)
FULL_DEBUG_SYMBOLS ?= 1
ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
else
# debug variants always get Full Debug Symbols (if available)
ENABLE_FULL_DEBUG_SYMBOLS = 1
endif
ifeq ($(BUILD_FLAVOR), product)
FULL_DEBUG_SYMBOLS ?= 1
ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
else
# debug variants always get Full Debug Symbols (if available)
ENABLE_FULL_DEBUG_SYMBOLS = 1
endif
endif
$(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
# since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
@ -260,11 +260,11 @@ JDK_INCLUDE_SUBDIR=bsd
# Library suffix
ifneq ($(STATIC_BUILD),true)
ifeq ($(OS_VENDOR),Darwin)
LIBRARY_SUFFIX=dylib
else
LIBRARY_SUFFIX=so
endif
ifeq ($(OS_VENDOR),Darwin)
LIBRARY_SUFFIX=dylib
else
LIBRARY_SUFFIX=so
endif
else
LIBRARY_SUFFIX=a
endif
@ -275,7 +275,7 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
# jsig library not needed for static builds
ifneq ($(STATIC_BUILD),true)
# client and server subdirectories have symbolic links to ../libjsig.so
EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
endif
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
@ -342,47 +342,6 @@ ifeq ($(JVM_VARIANT_MINIMAL1),true)
endif
endif
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero
ADD_SA_BINARIES/x86 = $(EXPORT_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
$(EXPORT_LIB_DIR)/sa-jdi.jar
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
ADD_SA_BINARIES/x86 += $(EXPORT_LIB_ARCH_DIR)/libsaproc.diz
else
ifeq ($(OS_VENDOR), Darwin)
ADD_SA_BINARIES/x86 += $(EXPORT_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM
else
ADD_SA_BINARIES/x86 += $(EXPORT_LIB_ARCH_DIR)/libsaproc.debuginfo
endif
endif
endif
ADD_SA_BINARIES/sparc = $(EXPORT_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
$(EXPORT_LIB_DIR)/sa-jdi.jar
ADD_SA_BINARIES/universal = $(EXPORT_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
$(EXPORT_LIB_DIR)/sa-jdi.jar
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
ADD_SA_BINARIES/universal += $(EXPORT_LIB_ARCH_DIR)/libsaproc.diz
else
ifeq ($(OS_VENDOR), Darwin)
ADD_SA_BINARIES/universal += $(EXPORT_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM
else
ADD_SA_BINARIES/universal += $(EXPORT_LIB_ARCH_DIR)/libsaproc.debuginfo
endif
endif
endif
ADD_SA_BINARIES/ppc =
ADD_SA_BINARIES/ia64 =
ADD_SA_BINARIES/arm =
ADD_SA_BINARIES/zero =
EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))
# Universal build settings
ifeq ($(OS_VENDOR), Darwin)
# Build universal binaries by default on Mac OS X
@ -409,9 +368,8 @@ ifeq ($(OS_VENDOR), Darwin)
# Binaries to 'universalize' if built
ifneq ($(STATIC_BUILD),true)
UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX)
UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX)
endif
UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX)
UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX)
UNIVERSAL_LIPO_LIST += $(EXPORT_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX)
@ -430,12 +388,10 @@ ifeq ($(OS_VENDOR), Darwin)
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/server/libjvm.diz
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/client/libjvm.diz
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/libjsig.diz
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/libsaproc.diz
else
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/server/libjvm.$(LIBRARY_SUFFIX).dSYM
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/client/libjvm.$(LIBRARY_SUFFIX).dSYM
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/libjsig.$(LIBRARY_SUFFIX).dSYM
UNIVERSAL_COPY_LIST += $(EXPORT_LIB_DIR)/libsaproc.$(LIBRARY_SUFFIX).dSYM
endif
endif

View file

@ -107,8 +107,6 @@ BOOT_JAVA_HOME = $(JAVA_HOME)
else
# take from the PATH, if ALT_BOOTDIR, BOOTDIR and JAVA_HOME are not defined
# note that this is to support hotspot build without SA. To build
# SA along with hotspot, you need to define ALT_BOOTDIR, BOOTDIR or JAVA_HOME
RUN.JAVA = java
RUN.JAVAP = javap

View file

@ -1,138 +0,0 @@
#
# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# This makefile (sa.make) is included from the sa.make in the
# build directories.
define print_info
ifneq ($$(LOG_LEVEL), warn)
$$(shell echo >&2 "INFO: $1")
endif
endef
# This makefile is used to build Serviceability Agent java code
# and generate JNI header file for native methods.
include $(GAMMADIR)/make/bsd/makefiles/rules.make
AGENT_DIR = $(GAMMADIR)/agent
include $(GAMMADIR)/make/sa.files
-include $(HS_ALT_MAKE)/bsd/makefiles/sa.make
TOPDIR = $(shell echo `pwd`)
GENERATED = $(TOPDIR)/../generated
# SA-JDI depends on the standard JDI classes.
# Default SA_CLASSPATH location:
DEF_SA_CLASSPATH=$(BOOT_JAVA_HOME)/lib/tools.jar
ifeq ($(ALT_SA_CLASSPATH),)
# no alternate specified; see if default exists
SA_CLASSPATH=$(shell test -f $(DEF_SA_CLASSPATH) && echo $(DEF_SA_CLASSPATH))
ifeq ($(SA_CLASSPATH),)
# the default doesn't exist
ifeq ($(OS_VENDOR), Darwin)
# A JDK from Apple doesn't have tools.jar; the JDI classes are
# are in the regular classes.jar file.
APPLE_JAR=$(BOOT_JAVA_HOME)/bundle/Classes/classes.jar
SA_CLASSPATH=$(shell test -f $(APPLE_JAR) && echo $(APPLE_JAR))
endif
endif
else
$(eval $(call print_info, "ALT_SA_CLASSPATH=$(ALT_SA_CLASSPATH)"))
SA_CLASSPATH=$(shell test -f $(ALT_SA_CLASSPATH) && echo $(ALT_SA_CLASSPATH))
endif
ifneq ($(SA_CLASSPATH),)
SA_CLASSPATH_ARG := -classpath $(SA_CLASSPATH)
endif
# TODO: if it's a modules image, check if SA module is installed.
MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules
AGENT_FILES_LIST := $(GENERATED)/agent.classes.list
SA_CLASSDIR = $(GENERATED)/saclasses
SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium, PowerPC, ARM or zero.
all:
if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \
-a "$(SRCARCH)" != "arm" \
-a "$(SRCARCH)" != "ppc" \
-a "$(SRCARCH)" != "zero" ] ; then \
$(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
fi
$(GENERATED)/sa-jdi.jar: $(AGENT_FILES)
$(QUIETLY) echo $(LOG_INFO) "Making $@"
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
exit 1; \
fi
$(QUIETLY) if [ ! -f "$(SA_CLASSPATH)" -a ! -d $(MODULELIB_PATH) ] ; then \
echo "Cannot find JDI classes. Use 1.6.0 or later version of JDK."; \
echo ""; \
exit 1; \
fi
$(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \
mkdir -p $(SA_CLASSDIR); \
fi
# Note: When indented, make tries to execute the '$(shell' comment.
# In some environments, cmd processors have limited line length.
# To prevent the javac invocation in the next block from using
# a very long cmd line, we use javac's @file-list option. We
# generate the file lists using make's built-in 'foreach' control
# flow which also avoids cmd processor line length issues. Since
# the 'foreach' is done as part of make's macro expansion phase,
# the initialization of the lists is also done in the same phase
# using '$(shell rm ...' instead of using the more traditional
# 'rm ...' rule.
$(shell rm -rf $(AGENT_FILES_LIST))
# gnumake 3.78.1 does not accept the *'s that
# are in AGENT_FILES, so use the shell to expand them.
# Be extra carefull to not produce too long command lines in the shell!
$(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST)))
$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -h $(GENERATED) $(SA_CLASSPATH_ARG) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
$(QUIETLY) $(REMOTE) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
$(QUIETLY) $(CP) $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql
$(QUIETLY) mkdir -p $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/*
$(QUIETLY) $(CP) $(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/
$(QUIETLY) $(CP) -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)/
$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .
$(QUIETLY) $(REMOTE) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
clean:
rm -rf $(SA_CLASSDIR)
rm -rf $(GENERATED)/sa-jdi.jar
rm -rf $(AGENT_FILES_LIST)

View file

@ -28,7 +28,6 @@
# It also:
# -builds and runs adlc via adlc.make
# -generates JVMTI source and docs via jvmti.make (JSR-163)
# -generate sa-jdi.jar (JDI binding to core files)
# It assumes the following flags are set:
# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Obj_Files
@ -86,7 +85,7 @@ default: vm_build_preliminaries the_vm
@echo All done.
# This is an explicit dependency for the sake of parallel makes.
vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff trace_stuff sa_stuff dtrace_stuff
vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff trace_stuff dtrace_stuff
@# We need a null action here, so implicit rules don't get consulted.
$(Cached_plat): $(Plat_File)
@ -113,10 +112,6 @@ dtrace_stuff:
@# We need a null action here, so implicit rules don't get consulted.
endif
# generate SA jar files and native header
sa_stuff:
@$(MAKE) -f sa.make $(MFLAGS-adjusted)
# and the VM: must use other makefile with dependencies included
# We have to go to great lengths to get control over the -jN argument
@ -155,7 +150,7 @@ realclean:
rm -fr $(GENERATED)
.PHONY: default vm_build_preliminaries
.PHONY: lists ad_stuff jvmti_stuff sa_stuff the_vm clean realclean
.PHONY: lists ad_stuff jvmti_stuff the_vm clean realclean
.PHONY: checks check_os_version install
.NOTPARALLEL:

View file

@ -60,7 +60,7 @@ Src_Dirs_I += $(GENERATED)
# The order is important for the precompiled headers to work.
INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
# SYMFLAG is used by {jsig,saproc}.make
# SYMFLAG is used by jsig.make
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# always build with debug info when we can create .dSYM/.debuginfo files
SYMFLAG = -g
@ -299,9 +299,9 @@ else
ifeq ($(OS_VENDOR), Darwin)
ifneq ($(STATIC_BUILD),true)
LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/.
LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/..
LFLAGS_VM += -Xlinker -install_name -Xlinker @rpath/$(@F)
LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/.
LFLAGS_VM += -Xlinker -rpath -Xlinker @loader_path/..
LFLAGS_VM += -Xlinker -install_name -Xlinker @rpath/$(@F)
endif
else
LFLAGS_VM += -Wl,-z,defs
@ -421,19 +421,16 @@ endif
# Signal interposition library
include $(MAKEFILES_DIR)/jsig.make
# Serviceability agent
include $(MAKEFILES_DIR)/saproc.make
#----------------------------------------------------------------------
ifeq ($(OS_VENDOR), Darwin)
# no libjvm_db for macosx
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(BUILDLIBSAPROC) dtraceCheck $(EXPORTED_SYMBOLS)
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) dtraceCheck $(EXPORTED_SYMBOLS)
echo "Doing vm.make build:"
else
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) $(EXPORTED_SYMBOLS)
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(EXPORTED_SYMBOLS)
endif
install: install_jvm install_jsig install_saproc
install: install_jvm install_jsigs
.PHONY: default build install install_jvm

View file

@ -73,8 +73,9 @@ ifeq ($(INCLUDE_CDS), false)
CXXFLAGS += -DINCLUDE_CDS=0
CFLAGS += -DINCLUDE_CDS=0
Src_Files_EXCLUDE += filemap.cpp metaspaceShared*.cpp sharedPathsMiscInfo.cpp \
systemDictionaryShared.cpp classLoaderExt.cpp sharedClassUtil.cpp
Src_Files_EXCLUDE += classListParser.cpp classLoaderExt.cpp \
filemap.cpp metaspaceShared*.cpp sharedClassUtil.cpp sharedPathsMiscInfo.cpp \
systemDictionaryShared.cpp
endif
ifeq ($(INCLUDE_ALL_GCS), false)

View file

@ -0,0 +1,47 @@
#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
default: all
include $(SPEC)
include MakeBase.gmk
################################################################################
SA_PROPERTIES := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent/sa.properties
SA_BUILD_VERSION_PROP_NAME := "sun.jvm.hotspot.runtime.VM.saBuildVersion"
$(SA_PROPERTIES): $(call DependOnVariable, FULL_VERSION)
$(MKDIR) -p $(@D)
$(ECHO) "$(SA_BUILD_VERSION_PROP_NAME)=$(FULL_VERSION)" > $@
TARGETS += $(SA_PROPERTIES)
################################################################################
all: $(TARGETS)
.PHONY: all default

View file

@ -0,0 +1,130 @@
#
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
include NativeCompilation.gmk
$(eval $(call IncludeCustomExtension, hotspot, lib/Lib-jdk.hotspot.agent.gmk))
################################################################################
SA_TOPDIR := $(HOTSPOT_TOPDIR)/agent
# SA has a slightly different OS naming scheme
ifeq ($(OPENJDK_TARGET_OS), windows)
SA_TARGET_OS := win32
else ifeq ($(OPENJDK_TARGET_OS), macosx)
SA_TARGET_OS := bsd
else
SA_TARGET_OS := $(OPENJDK_TARGET_OS)
endif
# Defaults for most platforms
SA_TOOLCHAIN := TOOLCHAIN_DEFAULT
SA_NAME := saproc
SA_SRC += $(SA_TOPDIR)/src/share/native $(SA_TOPDIR)/src/os/$(SA_TARGET_OS)
SA_MAPFILE := $(SA_TOPDIR)/src/os/$(OPENJDK_TARGET_OS)/mapfile
SA_INCLUDES := \
$(addprefix -I, $(SA_SRC)) \
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.hotspot.agent \
-I$(HOTSPOT_TOPDIR)/src/os/$(OPENJDK_TARGET_OS) \
#
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
SA_MACHINE_FLAG_windows := -machine:AMD64
else ifeq ($(OPENJDK_TARGET_CPU), x86)
SA_MACHINE_FLAG_linux := -march=i586
SA_MACHINE_FLAG_windows := -machine:I386
endif
ifeq ($(OPENJDK_TARGET_OS), linux)
SA_CFLAGS := $(CFLAGS_JDKLIB) -D_FILE_OFFSET_BITS=64 \
$(SA_MACHINE_FLAG_linux)
SA_LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_MACHINE_FLAG_linux)
SA_LIBS := -lthread_db $(LIBDL)
else ifeq ($(OPENJDK_TARGET_OS), solaris)
SA_TOOLCHAIN := TOOLCHAIN_LINK_CXX
SA_MAPFILE := $(SA_TOPDIR)/src/os/solaris/proc/mapfile
COMMON_CFLAGS := -I$(SA_TOPDIR)/src/os/$(OPENJDK_TARGET_OS)/proc \
-DSOLARIS_11_B159_OR_LATER
SA_CFLAGS := $(CFLAGS_JDKLIB) $(COMMON_CFLAGS)
SA_CXXFLAGS := $(CXXFLAGS_JDKLIB) $(COMMON_CFLAGS)
SA_LDFLAGS := $(subst -z defs,, $(LDFLAGS_JDKLIB)) \
-mt $(LDFLAGS_CXX_JDK)
SA_LIBS := -ldl -ldemangle -lthread -lc
else ifeq ($(OPENJDK_TARGET_OS), macosx)
SA_EXCLUDE_FILES := BsdDebuggerLocal.c ps_proc.c salibelf.c StubDebuggerLocal.c
SA_CFLAGS := $(CFLAGS_JDKLIB) \
-Damd64 -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
-mstack-alignment=1 -fPIC
SA_LDFLAGS := $(LDFLAGS_JDKLIB)
SA_LIBS := -framework Foundation -framework JavaNativeFoundation \
-framework Security -framework CoreFoundation
else ifeq ($(OPENJDK_TARGET_OS), windows)
SA_NAME := sawindbg
COMMON_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -D_MBCS -EHsc -FD
SA_CFLAGS := $(subst -DWIN32_LEAN_AND_MEAN,, $(CFLAGS_JDKLIB)) \
$(COMMON_CFLAGS)
SA_CXXFLAGS := $(subst -DWIN32_LEAN_AND_MEAN,, $(CXXFLAGS_JDKLIB)) \
$(COMMON_CFLAGS)
SA_LDFLAGS := $(LDFLAGS_JDKLIB) \
$(SA_MACHINE_FLAG_windows) -manifest \
-subsystem:console -map
SA_LIBS := dbgeng.lib
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
SA_CXXFLAGS += -DWIN64
else
SA_CXXFLAGS += -RTC1 -ZI
SA_LDFLAGS += -SAFESEH
endif
endif
################################################################################
$(eval $(call SetupNativeCompilation, BUILD_LIBSA, \
TOOLCHAIN := $(SA_TOOLCHAIN), \
OPTIMIZATION := NONE, \
DISABLED_WARNINGS_microsoft := 4267, \
DISABLED_WARNINGS_gcc := sign-compare, \
DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \
LIBRARY := $(SA_NAME), \
OUTPUT_DIR := $(call FindLibDirForModule, $(MODULE)), \
SRC := $(SA_SRC), \
EXCLUDE_FILES := test.c saproc_audit.cpp $(SA_EXCLUDE_FILES), \
CFLAGS := $(SA_INCLUDES) $(SA_CFLAGS) $(SA_CUSTOM_CFLAGS), \
CXXFLAGS := $(SA_INCLUDES) $(SA_CXXFLAGS) $(SA_CUSTOM_CXXFLAGS), \
LDFLAGS := $(SA_LDFLAGS) $(SA_CUSTOM_LDFLAGS), \
LIBS := $(SA_LIBS), \
MAPFILE := $(SA_MAPFILE), \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libsa, \
DEBUG_SYMBOLS := true, \
STRIP_SYMBOLS := true, \
))
TARGETS += $(BUILD_LIBSA)
################################################################################

View file

@ -45,15 +45,6 @@
#
# make REMOTE="rsh -l me myotherlinuxbox"
# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
# JDI binding on SA produces two binaries:
# 1. sa-jdi.jar - This is built before building libjvm.so
# Please refer to ./makefiles/sa.make
# 2. libsa.so - Native library for SA - This is built after
# libjsig.so (signal interposition library)
# Please refer to ./makefiles/vm.make
# If $(GAMMADIR)/agent dir is not present, SA components are not built.
ifeq ($(GAMMADIR),)
include ../../make/defs.make
else

View file

@ -49,7 +49,6 @@
# adlc.make -
# trace.make - generate tracing event and type definitions
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
# sa.make - generate SA jar file and natives
#
# The makefiles are split this way so that "make foo" will run faster by not
# having to read the dependency files for the vm.
@ -127,7 +126,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
# For dependencies and recursive makes.
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make dtrace.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make dtrace.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@ -219,7 +218,6 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "TARGET = $(TARGET)"; \
echo "HS_BUILD_VER = $(HS_BUILD_VER)"; \
echo "JRE_RELEASE_VER = $(JRE_RELEASE_VERSION)"; \
echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
echo "OPENJDK = $(OPENJDK)"; \
@ -358,16 +356,6 @@ trace.make: $(BUILDTREE_MAKE)
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
) > $@
sa.make: $(BUILDTREE_MAKE)
@echo $(LOG_INFO) Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
echo; \
echo include flags.make; \
echo; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
) > $@
dtrace.make: $(BUILDTREE_MAKE)
@echo $(LOG_INFO) Creating $@ ...
$(QUIETLY) ( \

View file

@ -293,24 +293,4 @@ ifeq ($(JVM_VARIANT_MINIMAL1),true)
endif
endif
# Serviceability Binaries
ADD_SA_BINARIES/DEFAULT = $(EXPORT_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
$(EXPORT_LIB_DIR)/sa-jdi.jar
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
ADD_SA_BINARIES/DEFAULT += $(EXPORT_LIB_ARCH_DIR)/libsaproc.diz
else
ADD_SA_BINARIES/DEFAULT += $(EXPORT_LIB_ARCH_DIR)/libsaproc.debuginfo
endif
endif
ADD_SA_BINARIES/$(HS_ARCH) = $(ADD_SA_BINARIES/DEFAULT)
# No SA Support for zero
ADD_SA_BINARIES/zero =
-include $(HS_ALT_MAKE)/linux/makefiles/defs.make
EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))

View file

@ -103,8 +103,6 @@ BOOT_JAVA_HOME = $(JAVA_HOME)
else
# take from the PATH, if ALT_BOOTDIR, BOOTDIR and JAVA_HOME are not defined
# note that this is to support hotspot build without SA. To build
# SA along with hotspot, you need to define ALT_BOOTDIR, BOOTDIR or JAVA_HOME
RUN.JAVA = java
RUN.JAVAP = javap

View file

@ -1,115 +0,0 @@
#
# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# This makefile (sa.make) is included from the sa.make in the
# build directories.
# This makefile is used to build Serviceability Agent java code
# and generate JNI header file for native methods.
include $(GAMMADIR)/make/linux/makefiles/rules.make
include $(GAMMADIR)/make/defs.make
include $(GAMMADIR)/make/altsrc.make
AGENT_DIR = $(GAMMADIR)/agent
include $(GAMMADIR)/make/sa.files
-include $(HS_ALT_MAKE)/linux/makefiles/sa.make
TOPDIR = $(shell echo `pwd`)
GENERATED = $(TOPDIR)/../generated
# tools.jar is needed by the JDI - SA binding
SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
# TODO: if it's a modules image, check if SA module is installed.
MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules
AGENT_FILES_LIST := $(GENERATED)/agent.classes.list
SA_CLASSDIR = $(GENERATED)/saclasses
SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium or zero.
all:
if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \
-a "$(SRCARCH)" != "zero" ] ; then \
$(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
fi
$(GENERATED)/sa-jdi.jar:: $(AGENT_FILES)
$(QUIETLY) echo $(LOG_INFO) "Making $@"
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
exit 1; \
fi
$(QUIETLY) if [ ! -f $(SA_CLASSPATH) -a ! -d $(MODULELIB_PATH) ] ; then \
echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\
echo ""; \
exit 1; \
fi
$(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \
mkdir -p $(SA_CLASSDIR); \
fi
# Note: When indented, make tries to execute the '$(shell' comment.
# In some environments, cmd processors have limited line length.
# To prevent the javac invocation in the next block from using
# a very long cmd line, we use javac's @file-list option. We
# generate the file lists using make's built-in 'foreach' control
# flow which also avoids cmd processor line length issues. Since
# the 'foreach' is done as part of make's macro expansion phase,
# the initialization of the lists is also done in the same phase
# using '$(shell rm ...' instead of using the more traditional
# 'rm ...' rule.
$(shell rm -rf $(AGENT_FILES_LIST))
# gnumake 3.78.1 does not accept the *'s that
# are in AGENT_FILES, so use the shell to expand them.
# Be extra carefull to not produce too long command lines in the shell!
$(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST)))
$(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -h $(GENERATED) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
$(QUIETLY) $(REMOTE) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
$(QUIETLY) $(CP) $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql
$(QUIETLY) mkdir -p $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/*
$(QUIETLY) $(CP) $(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/
$(QUIETLY) $(CP) -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)/
$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .
$(QUIETLY) $(REMOTE) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
clean:
rm -rf $(SA_CLASSDIR)
rm -rf $(GENERATED)/sa-jdi.jar
rm -rf $(AGENT_FILES_LIST)
-include $(HS_ALT_MAKE)/linux/makefiles/sa-rules.make

View file

@ -1,127 +0,0 @@
#
# 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
# 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 $(GAMMADIR)/make/defs.make
include $(GAMMADIR)/make/altsrc.make
# Rules to build serviceability agent library, used by vm.make
# libsaproc.so: serviceability agent
SAPROC = saproc
LIBSAPROC = lib$(SAPROC).so
LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo
LIBSAPROC_DIZ = lib$(SAPROC).diz
AGENT_DIR = $(GAMMADIR)/agent
SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)
SASRCFILES = $(SASRCDIR)/salibelf.c \
$(SASRCDIR)/symtab.c \
$(SASRCDIR)/libproc_impl.c \
$(SASRCDIR)/ps_proc.c \
$(SASRCDIR)/ps_core.c \
$(SASRCDIR)/LinuxDebuggerLocal.c \
$(AGENT_DIR)/src/share/native/sadis.c
-include $(HS_ALT_MAKE)/linux/makefiles/saproc.make
SAMAPFILE = $(SASRCDIR)/mapfile
DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
DEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ)
# DEBUG_BINARIES overrides everything, use full -g debug information
ifeq ($(DEBUG_BINARIES), true)
SA_DEBUG_CFLAGS = -g
endif
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium or zero.
ifneq ($(wildcard $(AGENT_DIR)),)
ifneq ($(filter-out ia64 zero,$(SRCARCH)),)
BUILDLIBSAPROC = $(LIBSAPROC)
endif
endif
ifneq ($(ALT_SASRCDIR),)
ALT_SAINCDIR=-I$(ALT_SASRCDIR) -DALT_SASRCDIR
else
ALT_SAINCDIR=
endif
SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE)
SAARCH ?= $(BUILDARCH)
$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
exit 1; \
fi
@echo $(LOG_INFO) Making SA debugger back-end...
$(QUIETLY) $(CC) -D$(SAARCH) -D_GNU_SOURCE \
-D_FILE_OFFSET_BITS=64 \
$(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
-I$(SASRCDIR) \
-I$(GENERATED) \
-I$(BOOT_JAVA_HOME)/include \
-I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
$(ALT_SAINCDIR) \
$(SASRCFILES) \
$(SA_LFLAGS) \
$(SA_DEBUG_CFLAGS) \
$(EXTRA_CFLAGS) \
-o $@ \
-lthread_db
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
ifeq ($(STRIP_POLICY),all_strip)
$(QUIETLY) $(STRIP) $@
else
ifeq ($(STRIP_POLICY),min_strip)
$(QUIETLY) $(STRIP) -g $@
# implied else here is no stripping at all
endif
endif
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
$(RM) $(LIBSAPROC_DEBUGINFO)
endif
endif
install_saproc: $(BUILDLIBSAPROC)
$(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \
echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
test ! -f $(LIBSAPROC_DEBUGINFO) || \
$(CP) -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \
test ! -f $(LIBSAPROC_DIZ) || \
$(CP) -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \
$(CP) -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \
fi
.PHONY: install_saproc

View file

@ -28,7 +28,6 @@
# It also:
# -builds and runs adlc via adlc.make
# -generates JVMTI source and docs via jvmti.make (JSR-163)
# -generate sa-jdi.jar (JDI binding to core files)
# It assumes the following flags are set:
# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Obj_Files
@ -86,7 +85,7 @@ default: vm_build_preliminaries the_vm
@echo All done.
# This is an explicit dependency for the sake of parallel makes.
vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) trace_stuff jvmti_stuff sa_stuff dtrace_stuff
vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) trace_stuff jvmti_stuff dtrace_stuff
@# We need a null action here, so implicit rules don't get consulted.
$(Cached_plat): $(Plat_File)
@ -104,10 +103,6 @@ jvmti_stuff: $(Cached_plat) $(adjust-mflags)
trace_stuff: jvmti_stuff $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f trace.make $(MFLAGS-adjusted)
# generate SA jar files and native header
sa_stuff:
@$(MAKE) -f sa.make $(MFLAGS-adjusted)
dtrace_stuff: $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f dtrace.make dtrace_gen_headers $(MFLAGS-adjusted) GENERATED=$(GENERATED)
@ -149,7 +144,7 @@ realclean:
rm -fr $(GENERATED)
.PHONY: default vm_build_preliminaries
.PHONY: lists ad_stuff jvmti_stuff sa_stuff the_vm clean realclean
.PHONY: lists ad_stuff jvmti_stuff the_vm clean realclean
.PHONY: checks check_os_version install
.NOTPARALLEL:

View file

@ -62,7 +62,7 @@ Src_Dirs_I += $(GENERATED)
# The order is important for the precompiled headers to work.
INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
# SYMFLAG is used by {jsig,saproc}.make
# SYMFLAG is used by jsig.make
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# always build with debug info when we can create .debuginfo files
SYMFLAG = -g
@ -396,13 +396,10 @@ install_jvm: $(LIBJVM)
# Signal interposition library
include $(MAKEFILES_DIR)/jsig.make
# Serviceability agent
include $(MAKEFILES_DIR)/saproc.make
#----------------------------------------------------------------------
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) dtraceCheck
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) dtraceCheck
install: install_jvm install_jsig install_saproc
install: install_jvm install_jsig
.PHONY: default build install install_jvm $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/vm.make

View file

@ -1,133 +0,0 @@
#
# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# This filelist macro is included in platform specific sa.make
# included all packages/*.java. package list can be generated by
# $(GAMMADIR)/agent/make/build-pkglist.
# define AGENT_DIR before including this file in sa.make
AGENT_SRC_DIR = $(AGENT_DIR)/src/share/classes
# Splitted the set of files into two sets because on linux plaform
# listing or compiling all the files results in 'Argument list too long' error.
AGENT_FILES = \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/asm/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/asm/sparc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/c1/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/ci/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/classfile/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/code/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/compiler/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/aarch64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/bsd/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/bsd/amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/bsd/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/dummy/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/ia64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/ia64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/ppc64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/aarch64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/sparc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/posix/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/posix/elf/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/ppc64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/ppc64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/aarch64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/sparc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/ppc64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/sparc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/aarch64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/sparc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/win32/coff/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/ia64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windows/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windows/amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/gc/cms/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/gc/g1/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/gc/parallel/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/gc/serial/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/gc/shared/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/interpreter/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/jdi/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/memory/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/oops/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/opto/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/prims/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/aarch64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/bsd/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/bsd_amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/bsd_x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_aarch64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_sparc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_ppc64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/posix/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_sparc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/sparc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/win32_amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/win32_x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/ppc64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/tools/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/tools/jcore/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/tools/soql/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/types/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/types/basic/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/memo/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/action/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/classbrowser/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/table/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/tree/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/treetable/*.java \
$(AGENT_SRC_DIR)/com/sun/java/swing/action/*.java \
$(AGENT_SRC_DIR)/com/sun/java/swing/ui/*.java

View file

@ -7,6 +7,7 @@
JVM_ActiveProcessorCount;
JVM_ArrayCopy;
JVM_AssertionStatusDirectives;
JVM_CallStackWalk;
JVM_ClassDepth;
JVM_ClassLoaderDepth;
JVM_Clone;
@ -31,12 +32,12 @@
JVM_CurrentTimeMillis;
JVM_DefineClass;
JVM_DefineClassWithSource;
JVM_DefineClassWithSourceCond;
JVM_DesiredAssertionStatus;
JVM_DoPrivileged;
JVM_DumpAllStacks;
JVM_DumpThreads;
JVM_FillInStackTrace;
JVM_FillStackFrames;
JVM_FindClassFromCaller;
JVM_FindClassFromClass;
JVM_FindClassFromBootLoader;
@ -134,6 +135,7 @@
JVM_MonitorNotify;
JVM_MonitorNotifyAll;
JVM_MonitorWait;
JVM_MoreStackWalk;
JVM_NanoTime;
JVM_NativePath;
JVM_NewArray;
@ -151,6 +153,7 @@
JVM_SetClassSigners;
JVM_SetNativeThreadName;
JVM_SetPrimitiveArrayElement;
JVM_SetMethodInfo;
JVM_SetThreadPriority;
JVM_Sleep;
JVM_StartThread;

View file

@ -36,15 +36,6 @@
# or BOOTDIR has to be set. We do *not* search javac, javah, rmic etc.
# from the PATH.
# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
# JDI binding on SA produces two binaries:
# 1. sa-jdi.jar - This is built before building libjvm.so
# Please refer to ./makefiles/sa.make
# 2. libsaproc.so - Native library for SA - This is built after
# libjsig.so (signal interposition library)
# Please refer to ./makefiles/vm.make
# If $(GAMMADIR)/agent dir is not present, SA components are not built.
ifeq ($(GAMMADIR),)
include ../../make/defs.make
else

View file

@ -49,7 +49,6 @@
# adlc.make -
# trace.make - generate tracing event and type definitions
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
# sa.make - generate SA jar file and natives
#
# The makefiles are split this way so that "make foo" will run faster by not
# having to read the dependency files for the vm.
@ -117,7 +116,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
# For dependencies and recursive makes.
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make dtrace.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make dtrace.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@ -205,7 +204,6 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "TARGET = $(TARGET)"; \
echo "HS_BUILD_VER = $(HS_BUILD_VER)"; \
echo "JRE_RELEASE_VER = $(JRE_RELEASE_VERSION)"; \
echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
echo "OPENJDK = $(OPENJDK)"; \
@ -344,16 +342,6 @@ trace.make: $(BUILDTREE_MAKE)
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
) > $@
sa.make: $(BUILDTREE_MAKE)
@echo $(LOG_INFO) Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
echo; \
echo include flags.make; \
echo; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
) > $@
dtrace.make: $(BUILDTREE_MAKE)
@echo $(LOG_INFO) Creating $@ ...
$(QUIETLY) ( \

View file

@ -294,13 +294,3 @@ ifeq ($(JVM_VARIANT_CLIENT),true)
endif
endif
endif
EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX)
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libsaproc.diz
else
EXPORT_LIST += $(EXPORT_LIB_ARCH_DIR)/libsaproc.debuginfo
endif
endif
EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar

View file

@ -95,8 +95,6 @@ BOOT_JAVA_HOME = $(JAVA_HOME)
else
# take from the PATH, if ALT_BOOTDIR, BOOTDIR and JAVA_HOME are not defined
# note that this is to support hotspot build without SA. To build
# SA along with hotspot, you need to define ALT_BOOTDIR, BOOTDIR or JAVA_HOME
RUN.JAVA = java
RUN.JAVAP = javap

View file

@ -1,104 +0,0 @@
#
# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# This makefile (sa.make) is included from the sa.make in the
# build directories.
# This makefile is used to build Serviceability Agent java code
# and generate JNI header file for native methods.
include $(GAMMADIR)/make/solaris/makefiles/rules.make
include $(GAMMADIR)/make/defs.make
AGENT_DIR = $(GAMMADIR)/agent
include $(GAMMADIR)/make/sa.files
-include $(HS_ALT_MAKE)/solaris/makefiles/sa.make
GENERATED = ../generated
# tools.jar is needed by the JDI - SA binding
SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
# TODO: if it's a modules image, check if SA module is installed.
MODULELIB_PATH= $(BOOT_JAVA_HOME)/lib/modules
AGENT_FILES_LIST := $(GENERATED)/agent.classes.list
SA_CLASSDIR = $(GENERATED)/saclasses
SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
# if $(AGENT_DIR) does not exist, we don't build SA.
all:
$(QUIETLY) if [ -d $(AGENT_DIR) ] ; then \
$(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
fi
$(GENERATED)/sa-jdi.jar: $(AGENT_FILES)
$(QUIETLY) echo $(LOG_INFO) "Making $@";
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
exit 1; \
fi
$(QUIETLY) if [ ! -f $(SA_CLASSPATH) -a ! -d $(MODULELIB_PATH) ] ; then \
echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\
echo ""; \
exit 1; \
fi
$(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \
mkdir -p $(SA_CLASSDIR); \
fi
# Note: When indented, make tries to execute the '$(shell' comment.
# In some environments, cmd processors have limited line length.
# To prevent the javac invocation in the next block from using
# a very long cmd line, we use javac's @file-list option. We
# generate the file lists using make's built-in 'foreach' control
# flow which also avoids cmd processor line length issues. Since
# the 'foreach' is done as part of make's macro expansion phase,
# the initialization of the lists is also done in the same phase
# using '$(shell rm ...' instead of using the more traditional
# 'rm ...' rule.
$(shell rm -rf $(AGENT_FILES_LIST))
# gnumake 3.78.1 does not accept the *'s that
# are in AGENT_FILES, so use the shell to expand them.
# Be extra carefull to not produce too long command lines in the shell!
$(foreach file,$(AGENT_FILES),$(shell ls -1 $(file) >> $(AGENT_FILES_LIST)))
$(QUIETLY) $(COMPILE.JAVAC) -h $(GENERATED) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) @$(AGENT_FILES_LIST)
$(QUIETLY) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
$(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
$(QUIETLY) $(CP) $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql
$(QUIETLY) mkdir -p $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/*
$(QUIETLY) $(CP) $(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources/
$(QUIETLY) $(CP) -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)/
$(QUIETLY) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .
$(QUIETLY) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
clean:
rm -rf $(SA_CLASSDIR)
rm -rf $(GENERATED)/sa-jdi.jar
rm -rf $(AGENT_FILES_LIST)

View file

@ -1,151 +0,0 @@
#
# Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Rules to build serviceability agent library, used by vm.make
# libsaproc.so: serviceability agent
SAPROC = saproc
SADIS = sadis
LIBSAPROC = lib$(SAPROC).so
SADISOBJ = $(SADIS).o
LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo
LIBSAPROC_DIZ = lib$(SAPROC).diz
AGENT_DIR = $(GAMMADIR)/agent
SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)/proc
SASRCFILES = $(SASRCDIR)/saproc.cpp
SADISSRCFILES = $(AGENT_DIR)/src/share/native/sadis.c
SAMAPFILE = $(SASRCDIR)/mapfile
DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO)
DEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ)
# if $(AGENT_DIR) does not exist, we don't build SA
ifneq ($(wildcard $(AGENT_DIR)),)
BUILDLIBSAPROC = $(LIBSAPROC)
endif
SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
ifdef USE_GCC
SA_LFLAGS += -D_REENTRANT
else
SA_LFLAGS += -mt -xnolib -norunpath
endif
# The libproc Pstack_iter() interface changed in Nevada-B159.
# Use 'uname -r -v' to determine the Solaris version as per
# Solaris Nevada team request. This logic needs to match:
# agent/src/os/solaris/proc/saproc.cpp: set_has_newer_Pstack_iter():
# - skip SunOS 4 or older
# - skip Solaris 10 or older
# - skip two digit internal Nevada builds
# - skip three digit internal Nevada builds thru 149
# - skip internal Nevada builds 150-158
# - if not skipped, print define for Nevada-B159 or later
SOLARIS_11_B159_OR_LATER := \
$(shell uname -r -v \
| sed -n \
-e '/^[0-4]\. /b' \
-e '/^5\.[0-9] /b' \
-e '/^5\.10 /b' \
-e '/ snv_[0-9][0-9]$$/b' \
-e '/ snv_[01][0-4][0-9]$$/b' \
-e '/ snv_15[0-8]$$/b' \
-e 's/.*/-DSOLARIS_11_B159_OR_LATER/' \
-e 'p' \
)
# Uncomment the following to simulate building on Nevada-B159 or later
# when actually building on Nevada-B158 or earlier:
#SOLARIS_11_B159_OR_LATER=-DSOLARIS_11_B159_OR_LATER
$(SADISOBJ): $(SADISSRCFILES)
$(QUIETLY) $(CC) \
$(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
-I$(SASRCDIR) \
-I$(GENERATED) \
-I$(BOOT_JAVA_HOME)/include \
-I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
$(SOLARIS_11_B159_OR_LATER) \
$(EXTRA_CFLAGS) \
$(SADISSRCFILES) \
-c -o $(SADISOBJ)
$(LIBSAPROC): $(SASRCFILES) $(SADISOBJ) $(SAMAPFILE)
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
exit 1; \
fi
@echo $(LOG_INFO) Making SA debugger back-end...
$(QUIETLY) $(CXX) \
$(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
-I$(SASRCDIR) \
-I$(GENERATED) \
-I$(BOOT_JAVA_HOME)/include \
-I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
$(SOLARIS_11_B159_OR_LATER) \
$(EXTRA_CXXFLAGS) $(EXTRA_LDFLAGS) \
$(SADISOBJ) \
$(SASRCFILES) \
$(SA_LFLAGS) \
-o $@ \
-ldl -ldemangle -lthread -lc
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO)
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@
ifeq ($(STRIP_POLICY),all_strip)
$(QUIETLY) $(STRIP) $@
else
ifeq ($(STRIP_POLICY),min_strip)
$(QUIETLY) $(STRIP) -x $@
# implied else here is no stripping at all
endif
endif
ifeq ($(ZIP_DEBUGINFO_FILES),1)
$(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO)
$(RM) $(LIBSAPROC_DEBUGINFO)
endif
endif
install_saproc: $(BULDLIBSAPROC)
$(QUIETLY) if [ -f $(LIBSAPROC) ] ; then \
echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
test ! -f $(LIBSAPROC_DEBUGINFO) || \
$(CP) -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \
test ! -f $(LIBSAPROC_DIZ) || \
$(CP) -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \
$(CP) -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \
fi
.PHONY: install_saproc

View file

@ -28,7 +28,6 @@
# It also:
# -builds and runs adlc via adlc.make
# -generates JVMTI source and docs via jvmti.make (JSR-163)
# -generate sa-jdi.jar (JDI binding to core files)
# It assumes the following flags are set:
# CFLAGS Platform_file, Src_Dirs_I, Src_Dirs_V, SYSDEFS, AOUT, Jvm_Obj_Files
@ -79,7 +78,7 @@ default: vm_build_preliminaries the_vm
@echo All done.
# This is an explicit dependency for the sake of parallel makes.
vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff trace_stuff sa_stuff dtrace_stuff
vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) jvmti_stuff trace_stuff dtrace_stuff
@# We need a null action here, so implicit rules don't get consulted.
$(Cached_plat): $(Plat_File)
@ -97,10 +96,6 @@ jvmti_stuff: $(Cached_plat) $(adjust-mflags)
trace_stuff: jvmti_stuff $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f trace.make $(MFLAGS-adjusted)
# generate SA jar files and native header
sa_stuff:
@$(MAKE) -f sa.make $(MFLAGS-adjusted)
dtrace_stuff: $(Cached_plat) $(adjust-mflags)
@$(MAKE) -f dtrace.make dtrace_gen_headers $(MFLAGS-adjusted) GENERATED=$(GENERATED)
@ -140,7 +135,7 @@ realclean:
rm -fr $(GENERATED)
.PHONY: default vm_build_preliminaries
.PHONY: lists ad_stuff jvmti_stuff trace_stuff sa_stuff the_vm clean realclean
.PHONY: lists ad_stuff jvmti_stuff trace_stuff the_vm clean realclean
.PHONY: checks check_os_version install
.NOTPARALLEL:

View file

@ -55,7 +55,7 @@ VPATH += $(Src_Dirs_V:%=%:)
Src_Dirs_I += $(GENERATED)
INCLUDES += $(Src_Dirs_I:%=-I%)
# SYMFLAG is used by {dtrace,jsig,saproc}.make.
# SYMFLAG is used by {dtrace,jsig}.make.
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# always build with debug info when we can create .debuginfo files
# and disable 'lazy debug info' so the .so has everything.
@ -341,13 +341,10 @@ install_jvm: $(LIBJVM)
# Signal interposition library
include $(MAKEFILES_DIR)/jsig.make
# Serviceability agent
include $(MAKEFILES_DIR)/saproc.make
#----------------------------------------------------------------------
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) $(BUILDLIBSAPROC) dtraceCheck
build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(LIBJVM_DTRACE) dtraceCheck
install: install_jvm install_jsig install_saproc
install: install_jvm install_jsig
.PHONY: default build install install_jvm

View file

@ -51,7 +51,8 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC := \
# Add conditional directories here when needed.
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
BUILD_HOTSPOT_JTREG_NATIVE_SRC += \
$(HOTSPOT_TOPDIR)/test/runtime/libadimalloc.solaris.sparc
$(HOTSPOT_TOPDIR)/test/runtime/libadimalloc.solaris.sparc \
$(HOTSPOT_TOPDIR)/test/runtime/ThreadSignalMask
endif
ifeq ($(TOOLCHAIN_TYPE), solstudio)

View file

@ -30,14 +30,6 @@
# Note: Running nmake or build.bat from the Windows command shell requires
# that "sh" be accessible on the PATH. An MKS install does this.
# SA components are built if BUILD_WIN_SA=1 is specified.
# See notes in README. This produces files:
# 1. sa-jdi.jar - This is built before building jvm.dll
# 2. sawindbg.dll - Native library for SA - This is built after jvm.dll
# - Also, .lib, .map, .pdb.
#
# Please refer to ./makefiles/sa.make
# If we haven't set an ARCH yet use x86
# create.bat and build.bat will set it, if used.
!ifndef ARCH
@ -202,30 +194,6 @@ OPENJDK=true
!endif
!endif
# We don't support SA on ia64, and we can't
# build it if we are using a version of Vis Studio
# older than .Net 2003.
# SA_INCLUDE and SA_LIB are hold-overs from a previous
# implementation in which we could build SA using
# Debugging Tools For Windows, in which the .h/.lib files
# and the .dlls are in different places than
# they are for Vis Studio .Net 2003.
# If that code ever needs to be resurrected, these vars
# can be set here. They are used in makefiles/sa.make.
checkSA::
!if "$(BUILD_WIN_SA)" != "1"
checkSA::
@echo Not building SA: BUILD_WIN_SA != 1
!elseif "$(ARCH)" == "ia64"
BUILD_WIN_SA = 0
checkSA::
@echo Not building SA: ARCH = ia64
!endif # ! "$(BUILD_WIN_SA)" != "1"
#########################################################################
defaultTarget: product
@ -282,10 +250,6 @@ $(variantDir)\local.make: checks
@ echo HS_COPYRIGHT=$(HOTSPOT_VM_COPYRIGHT) >> $@
@ echo HS_NAME=$(PRODUCT_NAME) $(JDK_MKTG_VERSION) >> $@
@ echo HS_BUILD_VER=$(HS_BUILD_VER) >> $@
@ echo BUILD_WIN_SA=$(BUILD_WIN_SA) >> $@
@ echo SA_BUILD_VERSION=$(HS_BUILD_VER) >> $@
@ echo SA_INCLUDE=$(SA_INCLUDE) >> $@
@ echo SA_LIB=$(SA_LIB) >> $@
@ echo JDK_VER=$(JDK_VER) >> $@
@ echo JDK_DOTVER=$(JDK_DOTVER) >> $@
@ echo JRE_RELEASE_VER=$(JRE_RELEASE_VER) >> $@
@ -304,7 +268,7 @@ $(variantDir)\local.make: checks
@ if "$(MV)" NEQ "" echo MV=$(MV) >> $@
@ if "$(ZIPEXE)" NEQ "" echo ZIPEXE=$(ZIPEXE) >> $@
checks: checkVariant checkWorkSpace checkSA
checks: checkVariant checkWorkSpace
checkVariant:
@ if "$(Variant)"=="" echo Need to specify "Variant=[tiered|compiler2|compiler1|core]" && false

View file

@ -54,20 +54,6 @@ RM="$MKS_HOME/rm.exe"
DUMPBIN="link.exe /dump"
export VS_UNICODE_OUTPUT=
if [ "$1" = "-nosa" ]; then
echo EXPORTS > vm.def
echo ""
echo "***"
echo "*** Not building SA: BUILD_WIN_SA != 1"
echo "*** C++ Vtables NOT included in vm.def"
echo "*** This jvm.dll will NOT work properly with SA."
echo "***"
echo "*** When in doubt, set BUILD_WIN_SA=1, clean and rebuild."
echo "***"
echo ""
exit
fi
echo "EXPORTS" > vm1.def
# When called from IDE the first param should contain the link version, otherwise may be nill

View file

@ -19,13 +19,12 @@
# 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.
#
#
#
HS_INTERNAL_NAME=jvm
HS_FNAME=$(HS_INTERNAL_NAME).dll
AOUT=$(HS_FNAME)
SAWINDBG=sawindbg.dll
GENERATED=../generated
# Allow the user to turn off precompiled headers from the command line.
@ -33,7 +32,7 @@ GENERATED=../generated
BUILD_PCH_FILE=_build_pch_file.obj
!endif
default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA
default:: $(BUILD_PCH_FILE) $(AOUT)
!include ../local.make
!include compile.make
@ -67,4 +66,3 @@ $(AOUT): $(Res_Files) $(Obj_Files) vm.def
!endif
!include $(WorkSpace)/make/windows/makefiles/shared.make
!include $(WorkSpace)/make/windows/makefiles/sa.make

View file

@ -236,21 +236,6 @@ else ifeq ($(USING_MINGW), true)
ABS_OS_MAKEFILE := $(subst /,\\,$(shell $(CD) $(HS_MAKE_DIR)/$(OSNAME);$(PWD))/build.make)
endif
# Disable building SA on windows until we are sure
# we want to release it. If we build it here,
# the SDK makefiles will copy it over and put it into
# the created image.
BUILD_WIN_SA = 1
ifneq ($(ALT_BUILD_WIN_SA),)
BUILD_WIN_SA = $(ALT_BUILD_WIN_SA)
endif
ifeq ($(BUILD_WIN_SA), 1)
ifeq ($(ARCH),ia64)
BUILD_WIN_SA = 0
endif
endif
EXPORT_SERVER_DIR = $(EXPORT_BIN_DIR)/server
EXPORT_CLIENT_DIR = $(EXPORT_BIN_DIR)/client
@ -281,21 +266,6 @@ endif
EXPORT_LIST += $(EXPORT_LIB_DIR)/jvm.lib
ifeq ($(BUILD_WIN_SA), 1)
EXPORT_LIST += $(EXPORT_BIN_DIR)/sawindbg.$(LIBRARY_SUFFIX)
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
ifeq ($(ZIP_DEBUGINFO_FILES),1)
EXPORT_LIST += $(EXPORT_BIN_DIR)/sawindbg.diz
else
EXPORT_LIST += $(EXPORT_BIN_DIR)/sawindbg.pdb
EXPORT_LIST += $(EXPORT_BIN_DIR)/sawindbg.map
endif
endif
EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
# Must pass this down to nmake.
MAKE_ARGS += BUILD_WIN_SA=1
endif
# Propagate compiler and tools paths from configure to nmake.
# Need to make sure they contain \\ and not /.
ifneq ($(SPEC),)

View file

@ -19,13 +19,12 @@
# 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.
#
#
#
HS_INTERNAL_NAME=jvm
HS_FNAME=$(HS_INTERNAL_NAME).dll
AOUT=$(HS_FNAME)
SAWINDBG=sawindbg.dll
GENERATED=../generated
# Allow the user to turn off precompiled headers from the command line.
@ -33,7 +32,7 @@ GENERATED=../generated
BUILD_PCH_FILE=_build_pch_file.obj
!endif
default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA
default:: $(BUILD_PCH_FILE) $(AOUT)
!include ../local.make
!include compile.make
@ -66,4 +65,3 @@ $(AOUT): $(Res_Files) $(Obj_Files) vm.def
!endif
!include $(WorkSpace)/make/windows/makefiles/shared.make
!include $(WorkSpace)/make/windows/makefiles/sa.make

View file

@ -19,7 +19,7 @@
# 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 ../local.make
@ -34,9 +34,6 @@ JvmtiOutDir=jvmtifiles
TraceOutDir=tracefiles
!include $(WorkSpace)/make/windows/makefiles/trace.make
# Pick up rules for building SA
!include $(WorkSpace)/make/windows/makefiles/sa.make
AdlcOutDir=adfiles
!if ("$(Variant)" == "compiler2") || ("$(Variant)" == "tiered")

View file

@ -19,7 +19,7 @@
# 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.
#
#
#
HS_INTERNAL_NAME=jvm
@ -32,7 +32,7 @@ GENERATED=../generated
BUILD_PCH_FILE=_build_pch_file.obj
!endif
default:: $(BUILD_PCH_FILE) $(AOUT) checkAndBuildSA
default:: $(BUILD_PCH_FILE) $(AOUT)
!include ../local.make
!include compile.make
@ -69,4 +69,3 @@ $(AOUT): $(Res_Files) $(Obj_Files) vm.def
!endif
!include $(WorkSpace)/make/windows/makefiles/shared.make
!include $(WorkSpace)/make/windows/makefiles/sa.make

View file

@ -90,10 +90,6 @@ ProjectCreatorIDEOptions = \
-disablePch getThread_windows_$(Platform_arch).cpp \
-disablePch_compiler2 opcodes.cpp
!if "$(BUILD_WIN_SA)" != "1"
BUILD_VM_DEF_FLAG=-nosa
!endif
# Common options for the IDE builds for c1, and c2
ProjectCreatorIDEOptions=\
$(ProjectCreatorIDEOptions) \
@ -106,7 +102,7 @@ ProjectCreatorIDEOptions=\
-jdkTargetRoot $(HOTSPOTJDKDIST) \
-define ALIGN_STACK_FRAMES \
-define VM_LITTLE_ENDIAN \
-prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) set JAVA_HOME=$(HOTSPOTJDKDIST) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(BUILD_VM_DEF_FLAG) $(LD_VER)" \
-prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) set JAVA_HOME=$(HOTSPOTJDKDIST) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LD_VER)" \
-ignoreFile jsig.c \
-ignoreFile jvmtiEnvRecommended.cpp \
-ignoreFile jvmtiEnvStub.cpp \

View file

@ -1,165 +0,0 @@
#
# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# This makefile is used to build Serviceability Agent code
# and generate JNI header file for native methods.
AGENT_DIR = $(WorkSpace)/agent
checkAndBuildSA::
!if "$(BUILD_WIN_SA)" != "1"
# Already warned about this in build.make
!else
# This first part is used to build sa-jdi.jar
!include $(WorkSpace)/make/windows/makefiles/rules.make
!include $(WorkSpace)/make/sa.files
GENERATED = ../generated
HS_COMMON_SRC_REL = src
!if "$(OPENJDK)" != "true"
HS_ALT_SRC_REL=src/closed
HS_ALT_SRC = $(WorkSpace)/$(HS_ALT_SRC_REL)
!ifndef HS_ALT_MAKE
HS_ALT_MAKE=$(WorkSpace)/make/closed
!endif
!endif
HS_COMMON_SRC = $(WorkSpace)/$(HS_COMMON_SRC_REL)
!ifdef HS_ALT_MAKE
!include $(HS_ALT_MAKE)/windows/makefiles/sa.make
!endif
# tools.jar is needed by the JDI - SA binding
SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
SA_CLASSDIR = $(GENERATED)/saclasses
SA_BUILD_VERSION_PROP = sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)
SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
default:: $(GENERATED)/sa-jdi.jar
# Remove the space between $(SA_BUILD_VERSION_PROP) and > below as it adds a white space
# at the end of SA version string and causes a version mismatch with the target VM version.
$(GENERATED)/sa-jdi.jar: $(AGENT_FILES)
$(QUIETLY) mkdir -p $(SA_CLASSDIR)
@echo ...Building sa-jdi.jar into $(SA_CLASSDIR)
@echo ...$(COMPILE_JAVAC) -classpath $(SA_CLASSPATH) -d $(SA_CLASSDIR) ....
@$(COMPILE_JAVAC) -h $(GENERATED) -classpath $(SA_CLASSPATH) -sourcepath $(AGENT_SRC_DIR) -d $(SA_CLASSDIR) $(AGENT_FILES)
$(COMPILE_RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
$(QUIETLY) echo $(SA_BUILD_VERSION_PROP)> $(SA_PROPERTIES)
$(QUIETLY) rm -f $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql/sa.js
$(QUIETLY) $(CP) $(AGENT_SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(SA_CLASSDIR)/sun/jvm/hotspot/utilities/soql
$(QUIETLY) rm -rf $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
$(QUIETLY) mkdir $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
$(QUIETLY) $(CP) $(AGENT_SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(SA_CLASSDIR)/sun/jvm/hotspot/ui/resources
$(QUIETLY) $(CP) -r $(AGENT_SRC_DIR)/images/* $(SA_CLASSDIR)
$(RUN_JAR) cf $@ -C $(SA_CLASSDIR) .
$(RUN_JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
# This second part is used to build sawindbg.dll
# We currently build it the same way for product, debug, and fastdebug.
SAWINDBG=sawindbg.dll
# Resource file containing VERSIONINFO
SA_Res_Files=.\version.sares
checkAndBuildSA:: $(SAWINDBG)
# These do not need to be optimized (don't run a lot of code) and it
# will be useful to have the assertion checks in place
!if "$(BUILDARCH)" == "ia64"
SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -c
!elseif "$(BUILDARCH)" == "amd64"
SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "WIN64" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -c
!else
SA_CFLAGS = -nologo $(MS_RUNTIME_OPTION) -W3 $(GX_OPTION) -Od -D "WIN32" -D "_WINDOWS" -D "_DEBUG" -D "_CONSOLE" -D "_MBCS" -FD -RTC1 -c
!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
SA_CFLAGS = $(SA_CFLAGS) -ZI
!endif
!endif
!if "$(MT)" != ""
SA_LD_FLAGS = -manifest $(SA_LD_FLAGS)
!endif
SASRCFILES = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp \
$(AGENT_DIR)/src/share/native/sadis.c
SA_LFLAGS = $(SA_LD_FLAGS) -nologo -subsystem:console -machine:$(MACHINE)
!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
SA_LFLAGS = $(SA_LFLAGS) -map -debug
!endif
!if "$(BUILDARCH)" == "i486"
SA_LFLAGS = /SAFESEH $(SA_LFLAGS)
!endif
SA_CFLAGS = $(SA_CFLAGS) $(MP_FLAG)
# Note that we do not keep sawindbj.obj around as it would then
# get included in the dumpbin command in build_vm_def.sh
# Force resources to be rebuilt every time
$(SA_Res_Files): FORCE
# In VS2005 or VS2008 the link command creates a .manifest file that we want
# to insert into the linked artifact so we do not need to track it separately.
# Use ";#2" for .dll and ";#1" for .exe in the MT command below:
$(SAWINDBG): $(SASRCFILES) $(SA_Res_Files)
set INCLUDE=$(SA_INCLUDE)$(INCLUDE)
$(CXX) @<<
-I"$(BootStrapDir)/include" -I"$(BootStrapDir)/include/win32"
-I"$(GENERATED)" $(SA_CFLAGS)
$(SASRCFILES)
-out:$*.obj
<<
set LIB=$(SA_LIB)$(LIB)
$(LD) -out:$@ -DLL sawindbg.obj sadis.obj dbgeng.lib $(SA_LFLAGS) $(SA_Res_Files)
!if "$(MT)" != ""
$(MT) -manifest $(@F).manifest -outputresource:$(@F);#2
!endif
!if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1"
!if "$(ZIP_DEBUGINFO_FILES)" == "1"
$(ZIPEXE) -q $*.diz $*.map $*.pdb
$(RM) $*.map $*.pdb
!endif
!endif
-@rm -f $*.obj
{$(COMMONSRC)\os\windows\vm}.rc.sares:
@$(RC) $(RC_FLAGS) /D "HS_FNAME=$(SAWINDBG)" /fo"$@" $<
cleanall :
rm -rf $(GENERATED)/saclasses
rm -rf $(GENERATED)/sa-jdi.jar
!endif

View file

@ -408,10 +408,5 @@ _build_pch_file.obj:
@echo #include "precompiled.hpp" > ../generated/_build_pch_file.cpp
$(CXX) $(CXX_FLAGS) /Fp"vm.pch" /Yc"precompiled.hpp" /c ../generated/_build_pch_file.cpp
!if "$(BUILD_WIN_SA)" != "1"
BUILD_VM_DEF_FLAG=-nosa
!endif
vm.def: $(Obj_Files)
sh $(WorkSpace)/make/windows/build_vm_def.sh $(BUILD_VM_DEF_FLAG)
sh $(WorkSpace)/make/windows/build_vm_def.sh

View file

@ -189,10 +189,11 @@ void InterpreterMacroAssembler::get_cache_and_index_and_bytecode_at_bcp(Register
get_cache_and_index_at_bcp(cache, index, bcp_offset, index_size);
// We use a 32-bit load here since the layout of 64-bit words on
// little-endian machines allow us that.
// n.b. unlike x86 cache alreeady includes the index offset
ldrw(bytecode, Address(cache,
// n.b. unlike x86 cache already includes the index offset
lea(bytecode, Address(cache,
ConstantPoolCache::base_offset()
+ ConstantPoolCacheEntry::indices_offset()));
ldarw(bytecode, bytecode);
const int shift_count = (1 + byte_no) * BitsPerByte;
ubfx(bytecode, bytecode, shift_count, BitsPerByte);
}

View file

@ -5254,7 +5254,13 @@ bool os::check_heap(bool force) {
// Note: HeapValidate executes two hardware breakpoints when it finds something
// wrong; at these points, eax contains the address of the offending block (I think).
// To get to the exlicit error message(s) below, just continue twice.
HANDLE heap = GetProcessHeap();
//
// Note: we want to check the CRT heap, which is not necessarily located in the
// process default heap.
HANDLE heap = (HANDLE) _get_heap_handle();
if (!heap) {
return true;
}
// If we fail to lock the heap, then gflags.exe has been used
// or some other special heap flag has been set that prevents
@ -5267,11 +5273,13 @@ bool os::check_heap(bool force) {
!HeapValidate(heap, 0, phe.lpData)) {
tty->print_cr("C heap has been corrupted (time: %d allocations)", mallocDebugCounter);
tty->print_cr("corrupted block near address %#x, length %d", phe.lpData, phe.cbData);
HeapUnlock(heap);
fatal("corrupted C heap");
}
}
DWORD err = GetLastError();
if (err != ERROR_NO_MORE_ITEMS && err != ERROR_CALL_NOT_IMPLEMENTED) {
HeapUnlock(heap);
fatal("heap walk aborted with error %d", err);
}
HeapUnlock(heap);

View file

@ -704,14 +704,13 @@ Method* ciEnv::lookup_method(InstanceKlass* accessor,
InstanceKlass* holder,
Symbol* name,
Symbol* sig,
Bytecodes::Code bc,
constantTag tag) {
Bytecodes::Code bc) {
EXCEPTION_CONTEXT;
KlassHandle h_accessor(THREAD, accessor);
KlassHandle h_holder(THREAD, holder);
LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
methodHandle dest_method;
LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag);
LinkInfo link_info(h_holder, name, sig, h_accessor, /*check_access*/true);
switch (bc) {
case Bytecodes::_invokestatic:
dest_method =
@ -797,9 +796,7 @@ ciMethod* ciEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
if (holder_is_accessible) { // Our declared holder is loaded.
InstanceKlass* lookup = declared_holder->get_instanceKlass();
constantTag tag = cpool->tag_ref_at(index);
assert(accessor->get_instanceKlass() == cpool->pool_holder(), "not the pool holder?");
Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc, tag);
Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc);
if (m != NULL &&
(bc == Bytecodes::_invokestatic
? m->method_holder()->is_not_initialized()

View file

@ -158,8 +158,7 @@ private:
InstanceKlass* holder,
Symbol* name,
Symbol* sig,
Bytecodes::Code bc,
constantTag tag);
Bytecodes::Code bc);
// Get a ciObject from the object factory. Ensures uniqueness
// of ciObjects.

View file

@ -786,8 +786,7 @@ ciMethod* ciMethod::resolve_invoke(ciKlass* caller, ciKlass* exact_receiver, boo
Symbol* h_name = name()->get_symbol();
Symbol* h_signature = signature()->get_symbol();
LinkInfo link_info(h_resolved, h_name, h_signature, caller_klass,
check_access ? LinkInfo::needs_access_check : LinkInfo::skip_access_check);
LinkInfo link_info(h_resolved, h_name, h_signature, caller_klass, check_access);
methodHandle m;
// Only do exact lookup if receiver klass has been linked. Otherwise,
// the vtable has not been setup, and the LinkResolver will fail.

View file

@ -1693,7 +1693,7 @@ void ClassFileParser::parse_annotations(u1* buffer, int limit,
if (id == AnnotationCollector::_unknown) continue;
coll->set_annotation(id);
if (id == AnnotationCollector::_sun_misc_Contended) {
if (id == AnnotationCollector::_jdk_internal_vm_annotation_Contended) {
// @Contended can optionally specify the contention group.
//
// Contended group defines the equivalence class over the fields:
@ -1767,10 +1767,10 @@ ClassFileParser::AnnotationCollector::annotation_index(ClassLoaderData* loader_d
if (_location != _in_field) break; // only allow for fields
if (!privileged) break; // only allow in privileged code
return _field_Stable;
case vmSymbols::VM_SYMBOL_ENUM_NAME(sun_misc_Contended_signature):
case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_Contended_signature):
if (_location != _in_field && _location != _in_class) break; // only allow for fields and classes
if (!EnableContended || (RestrictContended && !privileged)) break; // honor privileges
return _sun_misc_Contended;
return _jdk_internal_vm_annotation_Contended;
default: break;
}
return AnnotationCollector::_unknown;

View file

@ -131,7 +131,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
_method_LambdaForm_Compiled,
_method_LambdaForm_Hidden,
_method_HotSpotIntrinsicCandidate,
_sun_misc_Contended,
_jdk_internal_vm_annotation_Contended,
_field_Stable,
_annotation_LIMIT
};
@ -164,7 +164,7 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
void set_contended_group(u2 group) { _contended_group = group; }
u2 contended_group() const { return _contended_group; }
bool is_contended() const { return has_annotation(_sun_misc_Contended); }
bool is_contended() const { return has_annotation(_jdk_internal_vm_annotation_Contended); }
void set_stable(bool stable) { set_annotation(_field_Stable); }
bool is_stable() const { return has_annotation(_field_Stable); }

View file

@ -0,0 +1,66 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "classfile/classListParser.hpp"
#include "runtime/os.hpp"
#include "runtime/java.hpp"
ClassListParser::ClassListParser(const char* file) {
_classlist_file = file;
_file = fopen(file, "r");
if (_file == NULL) {
char errmsg[JVM_MAXPATHLEN];
os::lasterror(errmsg, JVM_MAXPATHLEN);
vm_exit_during_initialization("Loading classlist failed", errmsg);
}
}
ClassListParser::~ClassListParser() {
if (_file) {
fclose(_file);
}
}
bool ClassListParser::parse_one_line() {
for (;;) {
if (fgets(_line, sizeof(_line), _file) == NULL) {
return false;
}
int line_len = (int)strlen(_line);
if (line_len > _max_allowed_line_len) {
tty->print_cr("input line too long (must be no longer than %d chars)", _max_allowed_line_len);
vm_exit_during_initialization("Loading classlist failed");
}
if (*_line == '#') { // comment
continue;
}
break;
}
// Remove trailing \r\n
_line[strcspn(_line, "\r\n")] = 0;
return true;
}

View file

@ -0,0 +1,56 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_MEMORY_CLASSLISTPARSER_HPP
#define SHARE_VM_MEMORY_CLASSLISTPARSER_HPP
#include "utilities/exceptions.hpp"
#include "utilities/globalDefinitions.hpp"
class ClassListParser : public StackObj {
enum {
// Max number of bytes allowed per line in the classlist.
// Theoretically Java class names could be 65535 bytes in length. In reality,
// 4K bytes is more than enough.
_max_allowed_line_len = 4096,
_line_buf_extra = 10, // for detecting input too long
_line_buf_size = _max_allowed_line_len + _line_buf_extra
};
const char* _classlist_file;
FILE* _file;
char _line[_line_buf_size]; // The buffer that holds the current line.
public:
ClassListParser(const char* file);
~ClassListParser();
bool parse_one_line();
const char* current_class_name() {
return _line;
}
};
#endif // SHARE_VM_MEMORY_CLASSLISTPARSER_HPP

View file

@ -414,30 +414,30 @@ void ClassLoader::exit_with_path_failure(const char* error, const char* message)
}
#endif
void ClassLoader::trace_class_path(const char* msg, const char* name) {
void ClassLoader::trace_class_path(outputStream* out, const char* msg, const char* name) {
if (!TraceClassPaths) {
return;
}
if (msg) {
tty->print("%s", msg);
out->print("%s", msg);
}
if (name) {
if (strlen(name) < 256) {
tty->print("%s", name);
out->print("%s", name);
} else {
// For very long paths, we need to print each character separately,
// as print_cr() has a length limit
while (name[0] != '\0') {
tty->print("%c", name[0]);
out->print("%c", name[0]);
name++;
}
}
}
if (msg && msg[0] == '[') {
tty->print_cr("]");
out->print_cr("]");
} else {
tty->cr();
out->cr();
}
}
@ -466,7 +466,7 @@ void ClassLoader::setup_bootstrap_search_path() {
// Don't print sys_class_path - this is the bootcp of this current VM process, not necessarily
// the same as the bootcp of the shared archive.
} else {
trace_class_path("[Bootstrap loader class path=", sys_class_path);
trace_class_path(tty, "[Bootstrap loader class path=", sys_class_path);
}
#if INCLUDE_CDS
if (DumpSharedSpaces) {

View file

@ -328,7 +328,7 @@ class ClassLoader: AllStatic {
static void exit_with_path_failure(const char* error, const char* message);
#endif
static void trace_class_path(const char* msg, const char* name = NULL);
static void trace_class_path(outputStream* out, const char* msg, const char* name = NULL);
// VM monitoring and management support
static jlong classloader_time_ms();

View file

@ -82,7 +82,7 @@ ClassLoaderData::ClassLoaderData(Handle h_class_loader, bool is_anonymous, Depen
_keep_alive(is_anonymous || h_class_loader.is_null()),
_metaspace(NULL), _unloading(false), _klasses(NULL),
_claimed(0), _jmethod_ids(NULL), _handles(NULL), _deallocate_list(NULL),
_next(NULL), _dependencies(dependencies),
_next(NULL), _dependencies(dependencies), _shared_class_loader_id(-1),
_metaspace_lock(new Mutex(Monitor::leaf+1, "Metaspace allocation lock", true,
Monitor::_safepoint_check_never)) {
// empty

View file

@ -187,6 +187,9 @@ class ClassLoaderData : public CHeapObj<mtClass> {
// Support for walking class loader data objects
ClassLoaderData* _next; /// Next loader_datas created
// CDS
int _shared_class_loader_id;
// ReadOnly and ReadWrite metaspaces (static because only on the null
// class loader for now).
static Metaspace* _ro_metaspace;
@ -308,6 +311,15 @@ class ClassLoaderData : public CHeapObj<mtClass> {
Metaspace* ro_metaspace();
Metaspace* rw_metaspace();
void initialize_shared_metaspaces();
int shared_class_loader_id() {
return _shared_class_loader_id;
}
void set_shared_class_loader_id(int id) {
assert(id >= 0, "sanity");
assert(_shared_class_loader_id <0, "cannot be assigned more than once");
_shared_class_loader_id = id;
}
};
// An iterator that distributes Klasses to parallel worker threads.

View file

@ -0,0 +1,36 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "classfile/classListParser.hpp"
#include "classfile/classLoaderExt.hpp"
#include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp"
Klass* ClassLoaderExt::load_one_class(ClassListParser* parser, TRAPS) {
TempNewSymbol class_name_symbol = SymbolTable::new_symbol(parser->current_class_name(), THREAD);
guarantee(!HAS_PENDING_EXCEPTION, "Exception creating a symbol.");
return SystemDictionary::resolve_or_null(class_name_symbol, THREAD);
}

View file

@ -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
@ -29,6 +29,8 @@
#include "oops/instanceKlass.hpp"
#include "runtime/handles.hpp"
class ClassListParser;
class ClassLoaderExt: public ClassLoader { // AllStatic
public:
@ -69,6 +71,7 @@ public:
ClassLoader::add_to_list(new_entry);
}
static void setup_search_paths() {}
static Klass* load_one_class(ClassListParser* parser, TRAPS);
};
#endif // SHARE_VM_CLASSFILE_CLASSLOADEREXT_HPP

View file

@ -137,7 +137,7 @@ juint* CompactHashtableWriter::dump_buckets(juint* compact_table, juint* p,
if (_type == CompactHashtable<Symbol*, char>::_symbol_table) {
base_address = uintx(MetaspaceShared::shared_rs()->base());
max_delta = uintx(MetaspaceShared::shared_rs()->size());
assert(max_delta <= 0x7fffffff, "range check");
assert(max_delta <= MAX_SHARED_DELTA, "range check");
} else {
assert((_type == CompactHashtable<oop, char>::_string_table), "unknown table");
assert(UseCompressedOops, "UseCompressedOops is required");

View file

@ -23,8 +23,10 @@
*/
#include "precompiled.hpp"
#include "classfile/sharedClassUtil.hpp"
#include "classfile/dictionary.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/systemDictionaryShared.hpp"
#include "memory/iterator.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
@ -34,9 +36,16 @@
DictionaryEntry* Dictionary::_current_class_entry = NULL;
int Dictionary::_current_class_index = 0;
size_t Dictionary::entry_size() {
if (DumpSharedSpaces) {
return SystemDictionaryShared::dictionary_entry_size();
} else {
return sizeof(DictionaryEntry);
}
}
Dictionary::Dictionary(int table_size)
: TwoOopHashtable<Klass*, mtClass>(table_size, sizeof(DictionaryEntry)) {
: TwoOopHashtable<Klass*, mtClass>(table_size, (int)entry_size()) {
_current_class_index = 0;
_current_class_entry = NULL;
_pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize);
@ -45,7 +54,7 @@ Dictionary::Dictionary(int table_size)
Dictionary::Dictionary(int table_size, HashtableBucket<mtClass>* t,
int number_of_entries)
: TwoOopHashtable<Klass*, mtClass>(table_size, sizeof(DictionaryEntry), t, number_of_entries) {
: TwoOopHashtable<Klass*, mtClass>(table_size, (int)entry_size(), t, number_of_entries) {
_current_class_index = 0;
_current_class_entry = NULL;
_pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize);
@ -61,6 +70,9 @@ DictionaryEntry* Dictionary::new_entry(unsigned int hash, Klass* klass,
entry->set_loader_data(loader_data);
entry->set_pd_set(NULL);
assert(klass->is_instance_klass(), "Must be");
if (DumpSharedSpaces) {
SystemDictionaryShared::init_shared_dictionary_entry(klass, entry);
}
return entry;
}

View file

@ -53,6 +53,7 @@ private:
DictionaryEntry* get_entry(int index, unsigned int hash,
Symbol* name, ClassLoaderData* loader_data);
protected:
DictionaryEntry* bucket(int i) {
return (DictionaryEntry*)Hashtable<Klass*, mtClass>::bucket(i);
}
@ -66,6 +67,7 @@ private:
Hashtable<Klass*, mtClass>::add_entry(index, (HashtableEntry<Klass*, mtClass>*)new_entry);
}
static size_t entry_size();
public:
Dictionary(int table_size);
Dictionary(int table_size, HashtableBucket<mtClass>* t, int number_of_entries);

View file

@ -1518,43 +1518,11 @@ void java_lang_Throwable::print(Handle throwable, outputStream* st) {
// After this many redefines, the stack trace is unreliable.
const int MAX_VERSION = USHRT_MAX;
// Helper backtrace functions to store bci|version together.
static inline int merge_bci_and_version(int bci, int version) {
// only store u2 for version, checking for overflow.
if (version > USHRT_MAX || version < 0) version = MAX_VERSION;
assert((jushort)bci == bci, "bci should be short");
return build_int_from_shorts(version, bci);
}
static inline int bci_at(unsigned int merged) {
return extract_high_short_from_int(merged);
}
static inline int version_at(unsigned int merged) {
return extract_low_short_from_int(merged);
}
static inline bool version_matches(Method* method, int version) {
assert(version < MAX_VERSION, "version is too big");
return method != NULL && (method->constants()->version() == version);
}
static inline int get_line_number(Method* method, int bci) {
int line_number = 0;
if (method->is_native()) {
// Negative value different from -1 below, enabling Java code in
// class java.lang.StackTraceElement to distinguish "native" from
// "no LineNumberTable". JDK tests for -2.
line_number = -2;
} else {
// Returns -1 if no LineNumberTable, and otherwise actual line number
line_number = method->line_number_from_bci(bci);
if (line_number == -1 && ShowHiddenFrames) {
line_number = bci + 1000000;
}
}
return line_number;
}
// This class provides a simple wrapper over the internal structure of
// exception backtrace to insulate users of the backtrace from needing
// to know what it looks like.
@ -1676,7 +1644,7 @@ class BacktraceBuilder: public StackObj {
}
_methods->short_at_put(_index, method->orig_method_idnum());
_bcis->int_at_put(_index, merge_bci_and_version(bci, method->constants()->version()));
_bcis->int_at_put(_index, Backtrace::merge_bci_and_version(bci, method->constants()->version()));
_cprefs->short_at_put(_index, method->name_index());
// We need to save the mirrors in the backtrace to keep the class
@ -1688,19 +1656,6 @@ class BacktraceBuilder: public StackObj {
};
Symbol* get_source_file_name(InstanceKlass* holder, int version) {
// Find the specific ik version that contains this source_file_name_index
// via the previous versions list, but use the current version's
// constant pool to look it up. The previous version's index has been
// merged for the current constant pool.
InstanceKlass* ik = holder->get_klass_version(version);
// This version has been cleaned up.
if (ik == NULL) return NULL;
int source_file_name_index = ik->source_file_name_index();
return (source_file_name_index == 0) ?
(Symbol*)NULL : holder->constants()->symbol_at(source_file_name_index);
}
// Print stack trace element to resource allocated buffer
char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror,
int method_id, int version, int bci, int cpref) {
@ -1718,7 +1673,7 @@ char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror,
buf_len += (int)strlen(method_name);
char* source_file_name = NULL;
Symbol* source = get_source_file_name(holder, version);
Symbol* source = Backtrace::get_source_file_name(holder, version);
if (source != NULL) {
source_file_name = source->as_C_string();
buf_len += (int)strlen(source_file_name);
@ -1733,7 +1688,7 @@ char* java_lang_Throwable::print_stack_element_to_buffer(Handle mirror,
if (!version_matches(method, version)) {
strcat(buf, "(Redefined)");
} else {
int line_number = get_line_number(method, bci);
int line_number = Backtrace::get_line_number(method, bci);
if (line_number == -2) {
strcat(buf, "(Native Method)");
} else {
@ -1802,8 +1757,8 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) {
// NULL mirror means end of stack trace
if (mirror.is_null()) goto handle_cause;
int method = methods->short_at(index);
int version = version_at(bcis->int_at(index));
int bci = bci_at(bcis->int_at(index));
int version = Backtrace::version_at(bcis->int_at(index));
int bci = Backtrace::bci_at(bcis->int_at(index));
int cpref = cprefs->short_at(index);
print_stack_element(st, mirror, method, version, bci, cpref);
}
@ -2090,8 +2045,8 @@ oop java_lang_Throwable::get_stack_trace_element(oop throwable, int index, TRAPS
assert(methods != NULL && bcis != NULL && mirrors != NULL, "sanity check");
int method = methods->short_at(chunk_index);
int version = version_at(bcis->int_at(chunk_index));
int bci = bci_at(bcis->int_at(chunk_index));
int version = Backtrace::version_at(bcis->int_at(chunk_index));
int bci = Backtrace::bci_at(bcis->int_at(chunk_index));
int cpref = cprefs->short_at(chunk_index);
Handle mirror(THREAD, mirrors->obj_at(chunk_index));
@ -2114,6 +2069,7 @@ oop java_lang_StackTraceElement::create(Handle mirror, int method_id,
}
Handle element = ik->allocate_instance_handle(CHECK_0);
// Fill in class name
ResourceMark rm(THREAD);
InstanceKlass* holder = InstanceKlass::cast(java_lang_Class::as_Klass(mirror()));
@ -2136,13 +2092,13 @@ oop java_lang_StackTraceElement::create(Handle mirror, int method_id,
java_lang_StackTraceElement::set_lineNumber(element(), -1);
} else {
// Fill in source file name and line number.
Symbol* source = get_source_file_name(holder, version);
Symbol* source = Backtrace::get_source_file_name(holder, version);
if (ShowHiddenFrames && source == NULL)
source = vmSymbols::unknown_class_name();
oop filename = StringTable::intern(source, CHECK_0);
java_lang_StackTraceElement::set_fileName(element(), filename);
int line_number = get_line_number(method, bci);
int line_number = Backtrace::get_line_number(method, bci);
java_lang_StackTraceElement::set_lineNumber(element(), line_number);
}
return element();
@ -2155,6 +2111,108 @@ oop java_lang_StackTraceElement::create(const methodHandle& method, int bci, TRA
return create(mirror, method_id, method->constants()->version(), bci, cpref, THREAD);
}
Method* java_lang_StackFrameInfo::get_method(Handle stackFrame, InstanceKlass* holder, TRAPS) {
if (MemberNameInStackFrame) {
Handle mname(THREAD, stackFrame->obj_field(_memberName_offset));
Method* method = (Method*)java_lang_invoke_MemberName::vmtarget(mname());
// we should expand MemberName::name when Throwable uses StackTrace
// MethodHandles::expand_MemberName(mname, MethodHandles::_suppress_defc|MethodHandles::_suppress_type, CHECK_NULL);
return method;
} else {
short mid = stackFrame->short_field(_mid_offset);
short version = stackFrame->short_field(_version_offset);
return holder->method_with_orig_idnum(mid, version);
}
}
Symbol* java_lang_StackFrameInfo::get_file_name(Handle stackFrame, InstanceKlass* holder) {
if (MemberNameInStackFrame) {
return holder->source_file_name();
} else {
short version = stackFrame->short_field(_version_offset);
return Backtrace::get_source_file_name(holder, version);
}
}
void java_lang_StackFrameInfo::set_method_and_bci(Handle stackFrame, const methodHandle& method, int bci) {
// set Method* or mid/cpref
if (MemberNameInStackFrame) {
oop mname = stackFrame->obj_field(_memberName_offset);
InstanceKlass* ik = method->method_holder();
CallInfo info(method(), ik);
MethodHandles::init_method_MemberName(mname, info);
} else {
int mid = method->orig_method_idnum();
int cpref = method->name_index();
assert((jushort)mid == mid, "mid should be short");
assert((jushort)cpref == cpref, "cpref should be short");
java_lang_StackFrameInfo::set_mid(stackFrame(), (short)mid);
java_lang_StackFrameInfo::set_cpref(stackFrame(), (short)cpref);
}
// set bci
java_lang_StackFrameInfo::set_bci(stackFrame(), bci);
// method may be redefined; store the version
int version = method->constants()->version();
assert((jushort)version == version, "version should be short");
java_lang_StackFrameInfo::set_version(stackFrame(), (short)version);
}
void java_lang_StackFrameInfo::fill_methodInfo(Handle stackFrame, TRAPS) {
ResourceMark rm(THREAD);
oop k = stackFrame->obj_field(_declaringClass_offset);
InstanceKlass* holder = InstanceKlass::cast(java_lang_Class::as_Klass(k));
Method* method = java_lang_StackFrameInfo::get_method(stackFrame, holder, CHECK);
int bci = stackFrame->int_field(_bci_offset);
// The method can be NULL if the requested class version is gone
Symbol* sym = (method != NULL) ? method->name() : NULL;
if (MemberNameInStackFrame) {
assert(sym != NULL, "MemberName must have method name");
} else {
// The method can be NULL if the requested class version is gone
if (sym == NULL) {
short cpref = stackFrame->short_field(_cpref_offset);
sym = holder->constants()->symbol_at(cpref);
}
}
// set method name
oop methodname = StringTable::intern(sym, CHECK);
java_lang_StackFrameInfo::set_methodName(stackFrame(), methodname);
// set file name and line number
Symbol* source = get_file_name(stackFrame, holder);
if (source != NULL) {
oop filename = StringTable::intern(source, CHECK);
java_lang_StackFrameInfo::set_fileName(stackFrame(), filename);
}
// if the method has been redefined, the bci is no longer applicable
short version = stackFrame->short_field(_version_offset);
if (version_matches(method, version)) {
int line_number = Backtrace::get_line_number(method, bci);
java_lang_StackFrameInfo::set_lineNumber(stackFrame(), line_number);
}
}
void java_lang_StackFrameInfo::compute_offsets() {
Klass* k = SystemDictionary::StackFrameInfo_klass();
compute_offset(_declaringClass_offset, k, vmSymbols::declaringClass_name(), vmSymbols::class_signature());
compute_offset(_memberName_offset, k, vmSymbols::memberName_name(), vmSymbols::object_signature());
compute_offset(_bci_offset, k, vmSymbols::bci_name(), vmSymbols::int_signature());
compute_offset(_methodName_offset, k, vmSymbols::methodName_name(), vmSymbols::string_signature());
compute_offset(_fileName_offset, k, vmSymbols::fileName_name(), vmSymbols::string_signature());
compute_offset(_lineNumber_offset, k, vmSymbols::lineNumber_name(), vmSymbols::int_signature());
STACKFRAMEINFO_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET);
}
void java_lang_LiveStackFrameInfo::compute_offsets() {
Klass* k = SystemDictionary::LiveStackFrameInfo_klass();
compute_offset(_monitors_offset, k, vmSymbols::monitors_name(), vmSymbols::object_array_signature());
compute_offset(_locals_offset, k, vmSymbols::locals_name(), vmSymbols::object_array_signature());
compute_offset(_operands_offset, k, vmSymbols::operands_name(), vmSymbols::object_array_signature());
}
void java_lang_reflect_AccessibleObject::compute_offsets() {
Klass* k = SystemDictionary::reflect_AccessibleObject_klass();
compute_offset(override_offset, k, vmSymbols::override_name(), vmSymbols::bool_signature());
@ -3471,6 +3529,18 @@ int java_lang_StackTraceElement::declaringClass_offset;
int java_lang_StackTraceElement::methodName_offset;
int java_lang_StackTraceElement::fileName_offset;
int java_lang_StackTraceElement::lineNumber_offset;
int java_lang_StackFrameInfo::_declaringClass_offset;
int java_lang_StackFrameInfo::_memberName_offset;
int java_lang_StackFrameInfo::_bci_offset;
int java_lang_StackFrameInfo::_methodName_offset;
int java_lang_StackFrameInfo::_fileName_offset;
int java_lang_StackFrameInfo::_lineNumber_offset;
int java_lang_StackFrameInfo::_mid_offset;
int java_lang_StackFrameInfo::_version_offset;
int java_lang_StackFrameInfo::_cpref_offset;
int java_lang_LiveStackFrameInfo::_monitors_offset;
int java_lang_LiveStackFrameInfo::_locals_offset;
int java_lang_LiveStackFrameInfo::_operands_offset;
int java_lang_AssertionStatusDirectives::classes_offset;
int java_lang_AssertionStatusDirectives::classEnabled_offset;
int java_lang_AssertionStatusDirectives::packages_offset;
@ -3500,6 +3570,50 @@ void java_lang_StackTraceElement::set_lineNumber(oop element, int value) {
element->int_field_put(lineNumber_offset, value);
}
// Support for java_lang_StackFrameInfo
void java_lang_StackFrameInfo::set_declaringClass(oop element, oop value) {
element->obj_field_put(_declaringClass_offset, value);
}
void java_lang_StackFrameInfo::set_mid(oop element, short value) {
element->short_field_put(_mid_offset, value);
}
void java_lang_StackFrameInfo::set_version(oop element, short value) {
element->short_field_put(_version_offset, value);
}
void java_lang_StackFrameInfo::set_cpref(oop element, short value) {
element->short_field_put(_cpref_offset, value);
}
void java_lang_StackFrameInfo::set_bci(oop element, int value) {
element->int_field_put(_bci_offset, value);
}
void java_lang_StackFrameInfo::set_fileName(oop element, oop value) {
element->obj_field_put(_fileName_offset, value);
}
void java_lang_StackFrameInfo::set_methodName(oop element, oop value) {
element->obj_field_put(_methodName_offset, value);
}
void java_lang_StackFrameInfo::set_lineNumber(oop element, int value) {
element->int_field_put(_lineNumber_offset, value);
}
void java_lang_LiveStackFrameInfo::set_monitors(oop element, oop value) {
element->obj_field_put(_monitors_offset, value);
}
void java_lang_LiveStackFrameInfo::set_locals(oop element, oop value) {
element->obj_field_put(_locals_offset, value);
}
void java_lang_LiveStackFrameInfo::set_operands(oop element, oop value) {
element->obj_field_put(_operands_offset, value);
}
// Support for java Assertions - java_lang_AssertionStatusDirectives.
@ -3633,6 +3747,8 @@ void JavaClasses::compute_offsets() {
sun_reflect_ConstantPool::compute_offsets();
sun_reflect_UnsafeStaticFieldAccessorImpl::compute_offsets();
java_lang_reflect_Parameter::compute_offsets();
java_lang_StackFrameInfo::compute_offsets();
java_lang_LiveStackFrameInfo::compute_offsets();
// generated interpreter code wants to know about the offsets we just computed:
AbstractAssembler::update_delayed_values();

View file

@ -1359,6 +1359,85 @@ class java_lang_StackTraceElement: AllStatic {
};
class Backtrace: AllStatic {
public:
// Helper backtrace functions to store bci|version together.
static int merge_bci_and_version(int bci, int version);
static int merge_mid_and_cpref(int mid, int cpref);
static int bci_at(unsigned int merged);
static int version_at(unsigned int merged);
static int mid_at(unsigned int merged);
static int cpref_at(unsigned int merged);
static int get_line_number(const methodHandle& method, int bci);
static Symbol* get_source_file_name(InstanceKlass* holder, int version);
// Debugging
friend class JavaClasses;
};
// Interface to java.lang.StackFrameInfo objects
#define STACKFRAMEINFO_INJECTED_FIELDS(macro) \
macro(java_lang_StackFrameInfo, mid, short_signature, false) \
macro(java_lang_StackFrameInfo, version, short_signature, false) \
macro(java_lang_StackFrameInfo, cpref, short_signature, false)
class java_lang_StackFrameInfo: AllStatic {
private:
static int _declaringClass_offset;
static int _memberName_offset;
static int _bci_offset;
static int _methodName_offset;
static int _fileName_offset;
static int _lineNumber_offset;
static int _mid_offset;
static int _version_offset;
static int _cpref_offset;
static Method* get_method(Handle stackFrame, InstanceKlass* holder, TRAPS);
static Symbol* get_file_name(Handle stackFrame, InstanceKlass* holder);
public:
// Setters
static void set_declaringClass(oop info, oop value);
static void set_method_and_bci(Handle stackFrame, const methodHandle& method, int bci);
static void set_bci(oop info, int value);
// set method info in an instance of StackFrameInfo
static void fill_methodInfo(Handle info, TRAPS);
static void set_methodName(oop info, oop value);
static void set_fileName(oop info, oop value);
static void set_lineNumber(oop info, int value);
// these injected fields are only used if -XX:-MemberNameInStackFrame set
static void set_mid(oop info, short value);
static void set_version(oop info, short value);
static void set_cpref(oop info, short value);
static void compute_offsets();
// Debugging
friend class JavaClasses;
};
class java_lang_LiveStackFrameInfo: AllStatic {
private:
static int _monitors_offset;
static int _locals_offset;
static int _operands_offset;
public:
static void set_monitors(oop info, oop value);
static void set_locals(oop info, oop value);
static void set_operands(oop info, oop value);
static void compute_offsets();
// Debugging
friend class JavaClasses;
};
// Interface to java.lang.AssertionStatusDirectives objects
class java_lang_AssertionStatusDirectives: AllStatic {
@ -1442,7 +1521,9 @@ class InjectedField {
CLASS_INJECTED_FIELDS(macro) \
CLASSLOADER_INJECTED_FIELDS(macro) \
MEMBERNAME_INJECTED_FIELDS(macro) \
CALLSITECONTEXT_INJECTED_FIELDS(macro)
CALLSITECONTEXT_INJECTED_FIELDS(macro) \
STACKFRAMEINFO_INJECTED_FIELDS(macro)
// Interface to hard-coded offset checking

View file

@ -73,4 +73,67 @@ inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) {
return obj != NULL && is_subclass(obj->klass());
}
inline int Backtrace::merge_bci_and_version(int bci, int version) {
// only store u2 for version, checking for overflow.
if (version > USHRT_MAX || version < 0) version = USHRT_MAX;
assert((jushort)bci == bci, "bci should be short");
return build_int_from_shorts(version, bci);
}
inline int Backtrace::merge_mid_and_cpref(int mid, int cpref) {
// only store u2 for mid and cpref, checking for overflow.
assert((jushort)mid == mid, "mid should be short");
assert((jushort)cpref == cpref, "cpref should be short");
return build_int_from_shorts(cpref, mid);
}
inline int Backtrace::bci_at(unsigned int merged) {
return extract_high_short_from_int(merged);
}
inline int Backtrace::version_at(unsigned int merged) {
return extract_low_short_from_int(merged);
}
inline int Backtrace::mid_at(unsigned int merged) {
return extract_high_short_from_int(merged);
}
inline int Backtrace::cpref_at(unsigned int merged) {
return extract_low_short_from_int(merged);
}
inline int Backtrace::get_line_number(const methodHandle& method, int bci) {
int line_number = 0;
if (method->is_native()) {
// Negative value different from -1 below, enabling Java code in
// class java.lang.StackTraceElement to distinguish "native" from
// "no LineNumberTable". JDK tests for -2.
line_number = -2;
} else {
// Returns -1 if no LineNumberTable, and otherwise actual line number
line_number = method->line_number_from_bci(bci);
if (line_number == -1 && ShowHiddenFrames) {
line_number = bci + 1000000;
}
}
return line_number;
}
/*
* Returns the source file name of a given InstanceKlass and version
*/
inline Symbol* Backtrace::get_source_file_name(InstanceKlass* holder, int version) {
// Find the specific ik version that contains this source_file_name_index
// via the previous versions list, but use the current version's
// constant pool to look it up. The previous version's index has been
// merged for the current constant pool.
InstanceKlass* ik = holder->get_klass_version(version);
// This version has been cleaned up.
if (ik == NULL) return NULL;
int source_file_name_index = ik->source_file_name_index();
return (source_file_name_index == 0) ?
(Symbol*)NULL : holder->constants()->symbol_at(source_file_name_index);
}
#endif // SHARE_VM_CLASSFILE_JAVACLASSES_INLINE_HPP

View file

@ -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
@ -67,7 +67,7 @@ bool SharedPathsMiscInfo::read(void* ptr, size_t size) {
}
bool SharedPathsMiscInfo::fail(const char* msg, const char* name) {
ClassLoader::trace_class_path(msg, name);
ClassLoader::trace_class_path(tty, msg, name);
MetaspaceShared::set_archive_loading_failed();
return false;
}

View file

@ -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
@ -25,6 +25,7 @@
#ifndef SHARE_VM_CLASSFILE_SHAREDPATHSMISCINFO_HPP
#define SHARE_VM_CLASSFILE_SHAREDPATHSMISCINFO_HPP
#include "classfile/classLoader.hpp"
#include "runtime/os.hpp"
// During dumping time, when processing class paths, we build up the dump-time
@ -64,7 +65,7 @@ protected:
bool read(void* ptr, size_t size);
static void trace_class_path(const char* msg, const char* name = NULL) {
ClassLoader::trace_class_path(msg, name);
ClassLoader::trace_class_path(tty, msg, name);
}
protected:
static bool fail(const char* msg, const char* name = NULL);
@ -106,19 +107,6 @@ public:
add_path(path, NON_EXIST);
}
// The path must exist and have required size and modification time
void add_required_file(const char* path) {
add_path(path, REQUIRED);
struct stat st;
if (os::stat(path, &st) != 0) {
assert(0, "sanity");
ClassLoader::exit_with_path_failure("failed to os::stat(%s)", path); // should not happen
}
write_time(st.st_mtime);
write_long(st.st_size);
}
// The path must exist, and must contain exactly <num_entries> files/dirs
void add_boot_classpath(const char* path) {
add_path(path, BOOT);

View file

@ -97,7 +97,7 @@ int SymbolTable::_symbols_removed = 0;
int SymbolTable::_symbols_counted = 0;
volatile int SymbolTable::_parallel_claimed_idx = 0;
void SymbolTable::buckets_unlink(int start_idx, int end_idx, int* processed, int* removed, size_t* memory_total) {
void SymbolTable::buckets_unlink(int start_idx, int end_idx, int* processed, int* removed) {
for (int i = start_idx; i < end_idx; ++i) {
HashtableEntry<Symbol*, mtSymbol>** p = the_table()->bucket_addr(i);
HashtableEntry<Symbol*, mtSymbol>* entry = the_table()->bucket(i);
@ -110,7 +110,6 @@ void SymbolTable::buckets_unlink(int start_idx, int end_idx, int* processed, int
break;
}
Symbol* s = entry->literal();
(*memory_total) += s->size();
(*processed)++;
assert(s != NULL, "just checking");
// If reference count is zero, remove.
@ -133,15 +132,9 @@ void SymbolTable::buckets_unlink(int start_idx, int end_idx, int* processed, int
// This is done late during GC.
void SymbolTable::unlink(int* processed, int* removed) {
size_t memory_total = 0;
buckets_unlink(0, the_table()->table_size(), processed, removed, &memory_total);
buckets_unlink(0, the_table()->table_size(), processed, removed);
_symbols_removed += *removed;
_symbols_counted += *processed;
// Exclude printing for normal PrintGCDetails because people parse
// this output.
if (PrintGCDetails && Verbose && WizardMode) {
gclog_or_tty->print(" [Symbols=%d size=" SIZE_FORMAT "K] ", *processed,
(memory_total*HeapWordSize)/1024);
}
}
void SymbolTable::possibly_parallel_unlink(int* processed, int* removed) {
@ -158,16 +151,10 @@ void SymbolTable::possibly_parallel_unlink(int* processed, int* removed) {
}
int end_idx = MIN2(limit, start_idx + ClaimChunkSize);
buckets_unlink(start_idx, end_idx, processed, removed, &memory_total);
buckets_unlink(start_idx, end_idx, processed, removed);
}
Atomic::add(*processed, &_symbols_counted);
Atomic::add(*removed, &_symbols_removed);
// Exclude printing for normal PrintGCDetails because people parse
// this output.
if (PrintGCDetails && Verbose && WizardMode) {
gclog_or_tty->print(" [Symbols: scanned=%d removed=%d size=" SIZE_FORMAT "K] ", *processed, *removed,
(memory_total*HeapWordSize)/1024);
}
}
// Create a new table and using alternate hash code, populate the new table

View file

@ -132,7 +132,7 @@ private:
static volatile int _parallel_claimed_idx;
// Release any dead symbols
static void buckets_unlink(int start_idx, int end_idx, int* processed, int* removed, size_t* memory_total);
static void buckets_unlink(int start_idx, int end_idx, int* processed, int* removed);
public:
enum {
symbol_alloc_batch_size = 8,

View file

@ -322,6 +322,17 @@ Klass* SystemDictionary::resolve_super_or_fail(Symbol* child_name,
Handle protection_domain,
bool is_superclass,
TRAPS) {
#if INCLUDE_CDS
if (DumpSharedSpaces) {
// Special processing for CDS dump time.
Klass* k = SystemDictionaryShared::dump_time_resolve_super_or_fail(child_name,
class_name, class_loader, protection_domain, is_superclass, CHECK_NULL);
if (k) {
return k;
}
}
#endif // INCLUDE_CDS
// Double-check, if child class is already loaded, just return super-class,interface
// Don't add a placedholder if already loaded, i.e. already in system dictionary
// Make sure there's a placeholder for the *child* before resolving.
@ -1079,12 +1090,30 @@ Klass* SystemDictionary::resolve_from_stream(Symbol* class_name,
//
// Note: "name" is updated.
instanceKlassHandle k = ClassFileParser(st).parseClassFile(class_name,
loader_data,
protection_domain,
parsed_name,
verify,
THREAD);
instanceKlassHandle k;
#if INCLUDE_CDS
k = SystemDictionaryShared::lookup_from_stream(class_name,
class_loader,
protection_domain,
st,
verify,
CHECK_NULL);
#endif
if (k.not_null()) {
parsed_name = k->name();
} else {
if (st->buffer() == NULL) {
return NULL;
}
k = ClassFileParser(st).parseClassFile(class_name,
loader_data,
protection_domain,
parsed_name,
verify,
THREAD);
}
const char* pkg = "java/";
if (!HAS_PENDING_EXCEPTION &&
@ -1201,8 +1230,13 @@ instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
if (ik->super() != NULL) {
Symbol* cn = ik->super()->name();
resolve_super_or_fail(class_name, cn,
class_loader, protection_domain, true, CHECK_(nh));
Klass *s = resolve_super_or_fail(class_name, cn,
class_loader, protection_domain, true, CHECK_(nh));
if (s != ik->super()) {
// The dynamically resolved super class is not the same as the one we used during dump time,
// so we cannot use ik.
return nh;
}
}
Array<Klass*>* interfaces = ik->local_interfaces();
@ -1215,7 +1249,12 @@ instanceKlassHandle SystemDictionary::load_shared_class(instanceKlassHandle ik,
// reinitialized yet (they will be once the interface classes
// are loaded)
Symbol* name = k->name();
resolve_super_or_fail(class_name, name, class_loader, protection_domain, false, CHECK_(nh));
Klass* i = resolve_super_or_fail(class_name, name, class_loader, protection_domain, false, CHECK_(nh));
if (k != i) {
// The dynamically resolved interface class is not the same as the one we used during dump time,
// so we cannot use ik.
return nh;
}
}
// Adjust methods to recover missing data. They need addresses for

View file

@ -27,6 +27,7 @@
#include "classfile/classFileStream.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/systemDictionary_ext.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/symbol.hpp"
#include "runtime/java.hpp"
@ -179,11 +180,17 @@ class Ticks;
do_klass(sun_misc_Launcher_klass, sun_misc_Launcher, Pre ) \
do_klass(CodeSource_klass, java_security_CodeSource, Pre ) \
\
/* It's NULL in non-1.4 JDKs. */ \
do_klass(StackTraceElement_klass, java_lang_StackTraceElement, Opt ) \
\
/* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \
do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \
\
/* Stack Walking */ \
do_klass(StackWalker_klass, java_lang_StackWalker, Opt ) \
do_klass(AbstractStackWalker_klass, java_lang_StackStreamFactory_AbstractStackWalker, Opt ) \
do_klass(StackFrameInfo_klass, java_lang_StackFrameInfo, Opt ) \
do_klass(LiveStackFrameInfo_klass, java_lang_LiveStackFrameInfo, Opt ) \
\
/* Preload boxing klasses */ \
do_klass(Boolean_klass, java_lang_Boolean, Pre ) \
do_klass(Character_klass, java_lang_Character, Pre ) \
@ -194,15 +201,18 @@ class Ticks;
do_klass(Integer_klass, java_lang_Integer, Pre ) \
do_klass(Long_klass, java_lang_Long, Pre ) \
\
/* Extensions */ \
WK_KLASSES_DO_EXT(do_klass) \
/* JVMCI classes. These are loaded on-demand. */ \
JVMCI_WK_KLASSES_DO(do_klass) \
JVMCI_WK_KLASSES_DO(do_klass) \
\
/*end*/
class SystemDictionary : AllStatic {
friend class VMStructs;
friend class SystemDictionaryHandles;
friend class SharedClassUtil;
public:
enum WKID {
@ -667,11 +677,6 @@ protected:
// Basic find on classes in the midst of being loaded
static Symbol* find_placeholder(Symbol* name, ClassLoaderData* loader_data);
// Updating entry in dictionary
// Add a completely loaded class
static void add_klass(int index, Symbol* class_name,
ClassLoaderData* loader_data, KlassHandle obj);
// Add a placeholder for a class being loaded
static void add_placeholder(int index,
Symbol* class_name,

View file

@ -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
@ -22,11 +22,13 @@
*
*/
#ifndef SHARE_VM_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP
#define SHARE_VM_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP
#include "classfile/systemDictionary.hpp"
#include "classfile/dictionary.hpp"
class ClassFileStream;
class SystemDictionaryShared: public SystemDictionary {
public:
@ -42,6 +44,30 @@ public:
oop class_loader = loader_data->class_loader();
return (class_loader == NULL);
}
static Klass* dump_time_resolve_super_or_fail(Symbol* child_name,
Symbol* class_name,
Handle class_loader,
Handle protection_domain,
bool is_superclass,
TRAPS) {
return NULL;
}
static size_t dictionary_entry_size() {
return sizeof(DictionaryEntry);
}
static void init_shared_dictionary_entry(Klass* k, DictionaryEntry* entry) {}
static InstanceKlass* lookup_from_stream(Symbol* class_name,
Handle class_loader,
Handle protection_domain,
ClassFileStream* st,
bool verify,
TRAPS) {
return NULL;
}
};
#endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARYSHARED_HPP

View file

@ -0,0 +1,30 @@
/*
* 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_SYSTEMDICTIONARY_EXT_HPP
#define SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_EXT_HPP
#define WK_KLASSES_DO_EXT(do_klass)
#endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_EXT_HPP

View file

@ -25,6 +25,7 @@
#ifndef SHARE_VM_CLASSFILE_VMSYMBOLS_HPP
#define SHARE_VM_CLASSFILE_VMSYMBOLS_HPP
#include "classfile/vmSymbols_ext.hpp"
#include "oops/symbol.hpp"
#include "memory/iterator.hpp"
#include "trace/traceMacros.hpp"
@ -209,7 +210,7 @@
template(java_util_concurrent_atomic_AtomicLongFieldUpdater_CASUpdater, "java/util/concurrent/atomic/AtomicLongFieldUpdater$CASUpdater") \
template(java_util_concurrent_atomic_AtomicLongFieldUpdater_LockedUpdater, "java/util/concurrent/atomic/AtomicLongFieldUpdater$LockedUpdater") \
template(java_util_concurrent_atomic_AtomicReferenceFieldUpdater_Impl, "java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl") \
template(sun_misc_Contended_signature, "Lsun/misc/Contended;") \
template(jdk_internal_vm_annotation_Contended_signature, "Ljdk/internal/vm/annotation/Contended;") \
\
/* class symbols needed by intrinsics */ \
VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, template, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \
@ -310,6 +311,22 @@
/* Support for JVMCI */ \
JVMCI_VM_SYMBOLS_DO(template, do_alias) \
\
template(java_lang_StackWalker, "java/lang/StackWalker") \
template(java_lang_StackFrameInfo, "java/lang/StackFrameInfo") \
template(java_lang_LiveStackFrameInfo, "java/lang/LiveStackFrameInfo") \
template(java_lang_StackStreamFactory_AbstractStackWalker, "java/lang/StackStreamFactory$AbstractStackWalker") \
template(doStackWalk_name, "doStackWalk") \
template(doStackWalk_signature, "(JIIII)Ljava/lang/Object;") \
template(asPrimitive_name, "asPrimitive") \
template(asPrimitive_int_signature, "(I)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
template(asPrimitive_long_signature, "(J)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
template(asPrimitive_short_signature, "(S)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
template(asPrimitive_byte_signature, "(B)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
template(asPrimitive_char_signature, "(C)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
template(asPrimitive_float_signature, "(F)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
template(asPrimitive_double_signature, "(D)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
template(asPrimitive_boolean_signature, "(Z)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
\
/* common method and field names */ \
template(object_initializer_name, "<init>") \
template(class_initializer_name, "<clinit>") \
@ -410,6 +427,18 @@
template(append_name, "append") \
template(klass_name, "klass") \
template(array_klass_name, "array_klass") \
template(declaringClass_name, "declaringClass") \
template(memberName_name, "memberName") \
template(mid_name, "mid") \
template(cpref_name, "cpref") \
template(version_name, "version") \
template(bci_name, "bci") \
template(methodName_name, "methodName") \
template(fileName_name, "fileName") \
template(lineNumber_name, "lineNumber") \
template(monitors_name, "monitors") \
template(locals_name, "locals") \
template(operands_name, "operands") \
template(oop_size_name, "oop_size") \
template(static_oop_field_count_name, "static_oop_field_count") \
template(protection_domain_name, "protection_domain") \
@ -514,6 +543,7 @@
template(class_array_signature, "[Ljava/lang/Class;") \
template(classloader_signature, "Ljava/lang/ClassLoader;") \
template(object_signature, "Ljava/lang/Object;") \
template(object_array_signature, "[Ljava/lang/Object;") \
template(class_signature, "Ljava/lang/Class;") \
template(string_signature, "Ljava/lang/String;") \
template(reference_signature, "Ljava/lang/ref/Reference;") \
@ -617,6 +647,9 @@
/* trace signatures */ \
TRACE_TEMPLATES(template) \
\
/* extensions */ \
VM_SYMBOLS_DO_EXT(template, do_alias) \
\
/*end*/
// Here are all the intrinsics known to the runtime and the CI.

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_CLASSFILE_VMSYMBOLS_EXT_HPP
#define SHARE_VM_CLASSFILE_VMSYMBOLS_EXT_HPP
#define VM_SYMBOLS_DO_EXT(template, do_alias)
#endif // SHARE_VM_CLASSFILE_VMSYMBOLS_EXT_HPP

View file

@ -74,9 +74,7 @@ HeapWord* CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr,
addr = (HeapWord*)align_size_up((intptr_t)addr,
HeapWordSize << _shifter);
size_t addrOffset = heapWordToOffset(addr);
if (limit == NULL) {
limit = _bmStartWord + _bmWordSize;
}
assert(limit != NULL, "limit must not be NULL");
size_t limitOffset = heapWordToOffset(limit);
size_t nextOffset = _bm.get_next_one_offset(addrOffset, limitOffset);
HeapWord* nextAddr = offsetToHeapWord(nextOffset);
@ -86,26 +84,6 @@ HeapWord* CMBitMapRO::getNextMarkedWordAddress(const HeapWord* addr,
return nextAddr;
}
HeapWord* CMBitMapRO::getNextUnmarkedWordAddress(const HeapWord* addr,
const HeapWord* limit) const {
size_t addrOffset = heapWordToOffset(addr);
if (limit == NULL) {
limit = _bmStartWord + _bmWordSize;
}
size_t limitOffset = heapWordToOffset(limit);
size_t nextOffset = _bm.get_next_zero_offset(addrOffset, limitOffset);
HeapWord* nextAddr = offsetToHeapWord(nextOffset);
assert(nextAddr >= addr, "get_next_one postcondition");
assert(nextAddr == limit || !isMarked(nextAddr),
"get_next_one postcondition");
return nextAddr;
}
int CMBitMapRO::heapWordDiffToOffsetDiff(size_t diff) const {
assert((diff & ((1 << _shifter) - 1)) == 0, "argument check");
return (int) (diff >> _shifter);
}
#ifndef PRODUCT
bool CMBitMapRO::covers(MemRegion heap_rs) const {
// assert(_bm.map() == _virtual_space.low(), "map inconsistency");
@ -211,17 +189,6 @@ void CMBitMap::clearAll() {
return;
}
void CMBitMap::markRange(MemRegion mr) {
mr.intersection(MemRegion(_bmStartWord, _bmWordSize));
assert(!mr.is_empty(), "unexpected empty region");
assert((offsetToHeapWord(heapWordToOffset(mr.end())) ==
((HeapWord *) mr.end())),
"markRange memory region end is not card aligned");
// convert address range into offset range
_bm.at_put_range(heapWordToOffset(mr.start()),
heapWordToOffset(mr.end()), true);
}
void CMBitMap::clearRange(MemRegion mr) {
mr.intersection(MemRegion(_bmStartWord, _bmWordSize));
assert(!mr.is_empty(), "unexpected empty region");
@ -230,20 +197,6 @@ void CMBitMap::clearRange(MemRegion mr) {
heapWordToOffset(mr.end()), false);
}
MemRegion CMBitMap::getAndClearMarkedRegion(HeapWord* addr,
HeapWord* end_addr) {
HeapWord* start = getNextMarkedWordAddress(addr);
start = MIN2(start, end_addr);
HeapWord* end = getNextUnmarkedWordAddress(start);
end = MIN2(end, end_addr);
assert(start <= end, "Consistency check");
MemRegion mr(start, end);
if (!mr.is_empty()) {
clearRange(mr);
}
return mr;
}
CMMarkStack::CMMarkStack(ConcurrentMark* cm) :
_base(NULL), _cm(cm)
{}
@ -466,8 +419,6 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev
_max_parallel_marking_threads(0),
_sleep_factor(0.0),
_marking_task_overhead(1.0),
_cleanup_sleep_factor(0.0),
_cleanup_task_overhead(1.0),
_cleanup_list("Cleanup List"),
_region_bm((BitMap::idx_t)(g1h->max_regions()), false /* in_resource_area*/),
_card_bm((g1h->reserved_region().byte_size() + CardTableModRefBS::card_size - 1) >>
@ -568,22 +519,6 @@ ConcurrentMark::ConcurrentMark(G1CollectedHeap* g1h, G1RegionToSpaceMapper* prev
_parallel_marking_threads = ConcGCThreads;
_max_parallel_marking_threads = _parallel_marking_threads;
if (parallel_marking_threads() > 1) {
_cleanup_task_overhead = 1.0;
} else {
_cleanup_task_overhead = marking_task_overhead();
}
_cleanup_sleep_factor =
(1.0 - cleanup_task_overhead()) / cleanup_task_overhead();
#if 0
gclog_or_tty->print_cr("Marking Threads %d", parallel_marking_threads());
gclog_or_tty->print_cr("CM Marking Task Overhead %1.4lf", marking_task_overhead());
gclog_or_tty->print_cr("CM Sleep Factor %1.4lf", sleep_factor());
gclog_or_tty->print_cr("CL Marking Task Overhead %1.4lf", cleanup_task_overhead());
gclog_or_tty->print_cr("CL Sleep Factor %1.4lf", cleanup_sleep_factor());
#endif
_parallel_workers = new WorkGang("G1 Marker",
_max_parallel_marking_threads, false, true);
if (_parallel_workers == NULL) {
@ -840,14 +775,6 @@ void ConcurrentMark::checkpointRootsInitialPre() {
void ConcurrentMark::checkpointRootsInitialPost() {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
// If we force an overflow during remark, the remark operation will
// actually abort and we'll restart concurrent marking. If we always
// force an overflow during remark we'll never actually complete the
// marking phase. So, we initialize this here, at the start of the
// cycle, so that at the remaining overflow number will decrease at
// every remark and we'll eventually not need to cause one.
force_overflow_stw()->init();
// Start Concurrent Marking weak-reference discovery.
ReferenceProcessor* rp = g1h->ref_processor_cm();
// enable ("weak") refs discovery
@ -920,7 +847,6 @@ void ConcurrentMark::enter_first_sync_barrier(uint worker_id) {
// we exit this method to abort the pause and restart concurrent
// marking.
reset_marking_state(true /* clear_overflow */);
force_overflow()->update();
if (G1Log::fine()) {
gclog_or_tty->gclog_stamp();
@ -940,32 +866,6 @@ void ConcurrentMark::enter_second_sync_barrier(uint worker_id) {
// at this point everything should be re-initialized and ready to go
}
#ifndef PRODUCT
void ForceOverflowSettings::init() {
_num_remaining = G1ConcMarkForceOverflow;
_force = false;
update();
}
void ForceOverflowSettings::update() {
if (_num_remaining > 0) {
_num_remaining -= 1;
_force = true;
} else {
_force = false;
}
}
bool ForceOverflowSettings::should_force() {
if (_force) {
_force = false;
return true;
} else {
return false;
}
}
#endif // !PRODUCT
class CMConcurrentMarkingTask: public AbstractGangTask {
private:
ConcurrentMark* _cm;
@ -1131,7 +1031,6 @@ void ConcurrentMark::markFromRoots() {
// stop-the-world GC happens even as we mark in this generation.
_restart_for_overflow = false;
force_overflow_conc()->init();
// _g1h has _n_par_threads
_parallel_marking_threads = calc_parallel_marking_threads();
@ -2440,10 +2339,6 @@ void ConcurrentMark::clearRangePrevBitmap(MemRegion mr) {
((CMBitMap*)_prevMarkBitMap)->clearRange(mr);
}
void ConcurrentMark::clearRangeNextBitmap(MemRegion mr) {
_nextMarkBitMap->clearRange(mr);
}
HeapRegion*
ConcurrentMark::claim_region(uint worker_id) {
// "checkpoint" the finger
@ -3535,15 +3430,6 @@ void CMTask::do_marking_step(double time_target_ms,
}
}
// If we are about to wrap up and go into termination, check if we
// should raise the overflow flag.
if (do_termination && !has_aborted()) {
if (_cm->force_overflow()->should_force()) {
_cm->set_has_overflown();
regular_clock_call();
}
}
// We still haven't aborted. Now, let's try to get into the
// termination protocol.
if (do_termination && !has_aborted()) {

View file

@ -65,11 +65,8 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
// constructor
CMBitMapRO(int shifter);
enum { do_yield = true };
// inquiries
HeapWord* startWord() const { return _bmStartWord; }
size_t sizeInWords() const { return _bmWordSize; }
// the following is one past the last word in space
HeapWord* endWord() const { return _bmStartWord + _bmWordSize; }
@ -83,18 +80,12 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
// iteration
inline bool iterate(BitMapClosure* cl, MemRegion mr);
inline bool iterate(BitMapClosure* cl);
// Return the address corresponding to the next marked bit at or after
// "addr", and before "limit", if "limit" is non-NULL. If there is no
// such bit, returns "limit" if that is non-NULL, or else "endWord()".
HeapWord* getNextMarkedWordAddress(const HeapWord* addr,
const HeapWord* limit = NULL) const;
// Return the address corresponding to the next unmarked bit at or after
// "addr", and before "limit", if "limit" is non-NULL. If there is no
// such bit, returns "limit" if that is non-NULL, or else "endWord()".
HeapWord* getNextUnmarkedWordAddress(const HeapWord* addr,
const HeapWord* limit = NULL) const;
// conversion utilities
HeapWord* offsetToHeapWord(size_t offset) const {
@ -103,7 +94,6 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
size_t heapWordToOffset(const HeapWord* addr) const {
return pointer_delta(addr, _bmStartWord) >> _shifter;
}
int heapWordDiffToOffsetDiff(size_t diff) const;
// The argument addr should be the start address of a valid object
HeapWord* nextObject(HeapWord* addr) {
@ -153,20 +143,9 @@ class CMBitMap : public CMBitMapRO {
inline void mark(HeapWord* addr);
inline void clear(HeapWord* addr);
inline bool parMark(HeapWord* addr);
inline bool parClear(HeapWord* addr);
void markRange(MemRegion mr);
void clearRange(MemRegion mr);
// Starting at the bit corresponding to "addr" (inclusive), find the next
// "1" bit, if any. This bit starts some run of consecutive "1"'s; find
// the end of this run (stopping at "end_addr"). Return the MemRegion
// covering from the start of the region corresponding to the first bit
// of the run to the end of the region corresponding to the last bit of
// the run. If there is no "1" bit at or after "addr", return an empty
// MemRegion.
MemRegion getAndClearMarkedRegion(HeapWord* addr, HeapWord* end_addr);
// Clear the whole mark bitmap.
void clearAll();
};
@ -231,19 +210,6 @@ class CMMarkStack VALUE_OBJ_CLASS_SPEC {
template<typename Fn> void iterate(Fn fn);
};
class ForceOverflowSettings VALUE_OBJ_CLASS_SPEC {
private:
#ifndef PRODUCT
uintx _num_remaining;
bool _force;
#endif // !defined(PRODUCT)
public:
void init() PRODUCT_RETURN;
void update() PRODUCT_RETURN;
bool should_force() PRODUCT_RETURN_( return false; );
};
class YoungList;
// Root Regions are regions that are not empty at the beginning of a
@ -326,10 +292,6 @@ protected:
double _marking_task_overhead; // Marking target overhead for
// a single task
// Same as the two above, but for the cleanup task
double _cleanup_sleep_factor;
double _cleanup_task_overhead;
FreeRegionList _cleanup_list;
// Concurrent marking support structures
@ -404,9 +366,6 @@ protected:
WorkGang* _parallel_workers;
ForceOverflowSettings _force_overflow_conc;
ForceOverflowSettings _force_overflow_stw;
void weakRefsWorkParallelPart(BoolObjectClosure* is_alive, bool purged_classes);
void weakRefsWork(bool clear_all_soft_refs);
@ -443,8 +402,6 @@ protected:
uint max_parallel_marking_threads() const { return _max_parallel_marking_threads;}
double sleep_factor() { return _sleep_factor; }
double marking_task_overhead() { return _marking_task_overhead;}
double cleanup_sleep_factor() { return _cleanup_sleep_factor; }
double cleanup_task_overhead() { return _cleanup_task_overhead;}
HeapWord* finger() { return _finger; }
bool concurrent() { return _concurrent; }
@ -502,22 +459,6 @@ protected:
void enter_first_sync_barrier(uint worker_id);
void enter_second_sync_barrier(uint worker_id);
ForceOverflowSettings* force_overflow_conc() {
return &_force_overflow_conc;
}
ForceOverflowSettings* force_overflow_stw() {
return &_force_overflow_stw;
}
ForceOverflowSettings* force_overflow() {
if (concurrent()) {
return force_overflow_conc();
} else {
return force_overflow_stw();
}
}
// Live Data Counting data structures...
// These data structures are initialized at the start of
// marking. They are written to while marking is active.
@ -625,28 +566,6 @@ public:
uint worker_id,
HeapRegion* hr = NULL);
// It iterates over the heap and for each object it comes across it
// will dump the contents of its reference fields, as well as
// liveness information for the object and its referents. The dump
// will be written to a file with the following name:
// G1PrintReachableBaseFile + "." + str.
// vo decides whether the prev (vo == UsePrevMarking), the next
// (vo == UseNextMarking) marking information, or the mark word
// (vo == UseMarkWord) will be used to determine the liveness of
// each object / referent.
// If all is true, all objects in the heap will be dumped, otherwise
// only the live ones. In the dump the following symbols / breviations
// are used:
// M : an explicitly live object (its bitmap bit is set)
// > : an implicitly live object (over tams)
// O : an object outside the G1 heap (typically: in the perm gen)
// NOT : a reference field whose referent is not live
// AND MARKED : indicates that an object is both explicitly and
// implicitly live (it should be one or the other, not both)
void print_reachable(const char* str,
VerifyOption vo,
bool all) PRODUCT_RETURN;
// Clear the next marking bitmap (will be called concurrently).
void clearNextBitmap();
@ -686,7 +605,6 @@ public:
// next bitmaps. NB: the previous bitmap is usually
// read-only, so use this carefully!
void clearRangePrevBitmap(MemRegion mr);
void clearRangeNextBitmap(MemRegion mr);
// Notify data structures that a GC has started.
void note_start_of_gc() {

View file

@ -185,11 +185,6 @@ inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
return true;
}
inline bool CMBitMapRO::iterate(BitMapClosure* cl) {
MemRegion mr(startWord(), sizeInWords());
return iterate(cl, mr);
}
#define check_mark(addr) \
assert(_bmStartWord <= (addr) && (addr) < (_bmStartWord + _bmWordSize), \
"outside underlying space?"); \
@ -213,11 +208,6 @@ inline bool CMBitMap::parMark(HeapWord* addr) {
return _bm.par_set_bit(heapWordToOffset(addr));
}
inline bool CMBitMap::parClear(HeapWord* addr) {
check_mark(addr);
return _bm.par_clear_bit(heapWordToOffset(addr));
}
#undef check_mark
template<typename Fn>

View file

@ -499,11 +499,14 @@ HeapWord* G1BlockOffsetArrayContigSpace::initialize_threshold() {
return _next_offset_threshold;
}
void G1BlockOffsetArrayContigSpace::set_for_starts_humongous(HeapWord* obj_top) {
void G1BlockOffsetArrayContigSpace::set_for_starts_humongous(HeapWord* obj_top, size_t fill_size) {
// The first BOT entry should have offset 0.
reset_bot();
alloc_block(_bottom, obj_top);
}
if (fill_size > 0) {
alloc_block(obj_top, fill_size);
}
}
#ifndef PRODUCT
void G1BlockOffsetArrayContigSpace::print_on(outputStream* out) {

View file

@ -372,7 +372,7 @@ class G1BlockOffsetArrayContigSpace: public G1BlockOffsetArray {
HeapWord* block_start_unsafe(const void* addr);
HeapWord* block_start_unsafe_const(const void* addr) const;
void set_for_starts_humongous(HeapWord* obj_top);
void set_for_starts_humongous(HeapWord* obj_top, size_t fill_size);
virtual void print_on(outputStream* out) PRODUCT_RETURN;
};

View file

@ -301,8 +301,8 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(uint first,
assert(is_humongous(word_size), "word_size should be humongous");
assert(num_regions * HeapRegion::GrainWords >= word_size, "pre-condition");
// Index of last region in the series + 1.
uint last = first + num_regions;
// Index of last region in the series.
uint last = first + num_regions - 1;
// We need to initialize the region(s) we just discovered. This is
// a bit tricky given that it can happen concurrently with
@ -339,16 +339,30 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(uint first,
// thread to calculate the object size incorrectly.
Copy::fill_to_words(new_obj, oopDesc::header_size(), 0);
// How many words we use for filler objects.
size_t word_fill_size = word_size_sum - word_size;
// How many words memory we "waste" which cannot hold a filler object.
size_t words_not_fillable = 0;
if (word_fill_size >= min_fill_size()) {
fill_with_objects(obj_top, word_fill_size);
} else if (word_fill_size > 0) {
// We have space to fill, but we cannot fit an object there.
words_not_fillable = word_fill_size;
word_fill_size = 0;
}
// We will set up the first region as "starts humongous". This
// will also update the BOT covering all the regions to reflect
// that there is a single object that starts at the bottom of the
// first region.
first_hr->set_starts_humongous(obj_top);
first_hr->set_starts_humongous(obj_top, word_fill_size);
first_hr->set_allocation_context(context);
// Then, if there are any, we will set up the "continues
// humongous" regions.
HeapRegion* hr = NULL;
for (uint i = first + 1; i < last; ++i) {
for (uint i = first + 1; i <= last; ++i) {
hr = region_at(i);
hr->set_continues_humongous(first_hr);
hr->set_allocation_context(context);
@ -363,40 +377,38 @@ G1CollectedHeap::humongous_obj_allocate_initialize_regions(uint first,
// object header and the BOT initialization.
OrderAccess::storestore();
// Now that the BOT and the object header have been initialized,
// we can update top of the "starts humongous" region.
first_hr->set_top(MIN2(first_hr->end(), obj_top));
if (_hr_printer.is_active()) {
_hr_printer.alloc(G1HRPrinter::StartsHumongous, first_hr, first_hr->top());
// Now, we will update the top fields of the "continues humongous"
// regions except the last one.
for (uint i = first; i < last; ++i) {
hr = region_at(i);
hr->set_top(hr->end());
}
// Now, we will update the top fields of the "continues humongous"
// regions.
hr = NULL;
for (uint i = first + 1; i < last; ++i) {
hr = region_at(i);
if ((i + 1) == last) {
// last continues humongous region
assert(hr->bottom() < obj_top && obj_top <= hr->end(),
"new_top should fall on this region");
hr->set_top(obj_top);
_hr_printer.alloc(G1HRPrinter::ContinuesHumongous, hr, obj_top);
} else {
// not last one
assert(obj_top > hr->end(), "obj_top should be above this region");
hr->set_top(hr->end());
_hr_printer.alloc(G1HRPrinter::ContinuesHumongous, hr, hr->end());
}
}
// If we have continues humongous regions (hr != NULL), its top should
// match obj_top.
assert(hr == NULL || (hr->top() == obj_top), "sanity");
hr = region_at(last);
// If we cannot fit a filler object, we must set top to the end
// of the humongous object, otherwise we cannot iterate the heap
// and the BOT will not be complete.
hr->set_top(hr->end() - words_not_fillable);
assert(hr->bottom() < obj_top && obj_top <= hr->end(),
"obj_top should be in last region");
check_bitmaps("Humongous Region Allocation", first_hr);
increase_used(word_size * HeapWordSize);
assert(words_not_fillable == 0 ||
first_hr->bottom() + word_size_sum - words_not_fillable == hr->top(),
"Miscalculation in humongous allocation");
for (uint i = first; i < last; ++i) {
_humongous_set.add(region_at(i));
increase_used((word_size_sum - words_not_fillable) * HeapWordSize);
for (uint i = first; i <= last; ++i) {
hr = region_at(i);
_humongous_set.add(hr);
if (i == first) {
_hr_printer.alloc(G1HRPrinter::StartsHumongous, hr, hr->top());
} else {
_hr_printer.alloc(G1HRPrinter::ContinuesHumongous, hr, hr->top());
}
}
return new_obj;
@ -1202,9 +1214,8 @@ void G1CollectedHeap::print_hrm_post_compaction() {
heap_region_iterate(&cl);
}
bool G1CollectedHeap::do_collection(bool explicit_gc,
bool clear_all_soft_refs,
size_t word_size) {
bool G1CollectedHeap::do_full_collection(bool explicit_gc,
bool clear_all_soft_refs) {
assert_at_safepoint(true /* should_be_vm_thread */);
if (GC_locker::check_active_before_gc()) {
@ -1362,8 +1373,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
clear_rsets_post_compaction();
check_gc_time_stamps();
// Resize the heap if necessary.
resize_if_necessary_after_full_collection(explicit_gc ? 0 : word_size);
resize_if_necessary_after_full_collection();
if (_hr_printer.is_active()) {
// We should do this after we potentially resize the heap so
@ -1471,22 +1481,15 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
}
void G1CollectedHeap::do_full_collection(bool clear_all_soft_refs) {
// do_collection() will return whether it succeeded in performing
// the GC. Currently, there is no facility on the
// do_full_collection() API to notify the caller than the collection
// did not succeed (e.g., because it was locked out by the GC
// locker). So, right now, we'll ignore the return value.
bool dummy = do_collection(true, /* explicit_gc */
clear_all_soft_refs,
0 /* word_size */);
// Currently, there is no facility in the do_full_collection(bool) API to notify
// the caller that the collection did not succeed (e.g., because it was locked
// out by the GC locker). So, right now, we'll ignore the return value.
bool dummy = do_full_collection(true, /* explicit_gc */
clear_all_soft_refs);
}
// This code is mostly copied from TenuredGeneration.
void
G1CollectedHeap::
resize_if_necessary_after_full_collection(size_t word_size) {
// Include the current allocation, if any, and bytes that will be
// pre-allocated to support collections, as "used".
void G1CollectedHeap::resize_if_necessary_after_full_collection() {
// Include bytes that will be pre-allocated to support collections, as "used".
const size_t used_after_gc = used();
const size_t capacity_after_gc = capacity();
const size_t free_after_gc = capacity_after_gc - used_after_gc;
@ -1598,9 +1601,8 @@ HeapWord* G1CollectedHeap::satisfy_failed_allocation_helper(size_t word_size,
if (do_gc) {
// Expansion didn't work, we'll try to do a Full GC.
*gc_succeeded = do_collection(false, /* explicit_gc */
clear_all_soft_refs,
word_size);
*gc_succeeded = do_full_collection(false, /* explicit_gc */
clear_all_soft_refs);
}
return NULL;

View file

@ -471,26 +471,20 @@ protected:
void retire_gc_alloc_region(HeapRegion* alloc_region,
size_t allocated_bytes, InCSetState dest);
// - if explicit_gc is true, the GC is for a System.gc() or a heap
// inspection request and should collect the entire heap
// - if explicit_gc is true, the GC is for a System.gc() etc,
// otherwise it's for a failed allocation.
// - if clear_all_soft_refs is true, all soft references should be
// cleared during the GC
// - if explicit_gc is false, word_size describes the allocation that
// the GC should attempt (at least) to satisfy
// cleared during the GC.
// - it returns false if it is unable to do the collection due to the
// GC locker being active, true otherwise
bool do_collection(bool explicit_gc,
bool clear_all_soft_refs,
size_t word_size);
// GC locker being active, true otherwise.
bool do_full_collection(bool explicit_gc,
bool clear_all_soft_refs);
// Callback from VM_G1CollectFull operation.
// Perform a full collection.
// Callback from VM_G1CollectFull operation, or collect_as_vm_thread.
virtual void do_full_collection(bool clear_all_soft_refs);
// Resize the heap if necessary after a full collection. If this is
// after a collect-for allocation, "word_size" is the allocation size,
// and will be considered part of the used portion of the heap.
void resize_if_necessary_after_full_collection(size_t word_size);
// Resize the heap if necessary after a full collection.
void resize_if_necessary_after_full_collection();
// Callback from VM_G1CollectForAllocation operation.
// This function does everything necessary/possible to satisfy a
@ -1150,9 +1144,6 @@ public:
// "CollectedHeap" supports.
virtual void collect(GCCause::Cause cause);
// The same as above but assume that the caller holds the Heap_lock.
void collect_locked(GCCause::Cause cause);
virtual bool copy_allocation_context_stats(const jint* contexts,
jlong* totals,
jbyte* accuracy,
@ -1352,14 +1343,6 @@ public:
return (region_size / 2);
}
// Update mod union table with the set of dirty cards.
void updateModUnion();
// Set the mod union bits corresponding to the given memRegion. Note
// that this is always a safe operation, since it doesn't clear any
// bits.
void markModUnionRange(MemRegion mr);
// Print the maximum heap capacity.
virtual size_t max_capacity() const;

View file

@ -123,16 +123,13 @@ enum G1Mark {
template <G1Barrier barrier, G1Mark do_mark_object>
class G1ParCopyClosure : public G1ParCopyHelper {
private:
template <class T> void do_oop_work(T* p);
public:
G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) :
G1ParCopyHelper(g1, par_scan_state) {
assert(ref_processor() == NULL, "sanity");
}
template <class T> void do_oop_nv(T* p) { do_oop_work(p); }
template <class T> void do_oop_nv(T* p);
virtual void do_oop(oop* p) { do_oop_nv(p); }
virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
};

View file

@ -251,7 +251,7 @@ void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) {
template <G1Barrier barrier, G1Mark do_mark_object>
template <class T>
void G1ParCopyClosure<barrier, do_mark_object>::do_oop_work(T* p) {
void G1ParCopyClosure<barrier, do_mark_object>::do_oop_nv(T* p) {
T heap_oop = oopDesc::load_heap_oop(p);
if (oopDesc::is_null(heap_oop)) {

View file

@ -73,138 +73,111 @@ G1RemSet::~G1RemSet() {
FREE_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, _cset_rs_update_cl);
}
class ScanRSClosure : public HeapRegionClosure {
size_t _cards_done, _cards;
G1CollectedHeap* _g1h;
G1ParPushHeapRSClosure* _oc;
CodeBlobClosure* _code_root_cl;
G1BlockOffsetSharedArray* _bot_shared;
G1SATBCardTableModRefBS *_ct_bs;
double _strong_code_root_scan_time_sec;
uint _worker_i;
size_t _block_size;
bool _try_claimed;
public:
ScanRSClosure(G1ParPushHeapRSClosure* oc,
CodeBlobClosure* code_root_cl,
uint worker_i) :
ScanRSClosure::ScanRSClosure(G1ParPushHeapRSClosure* oc,
CodeBlobClosure* code_root_cl,
uint worker_i) :
_oc(oc),
_code_root_cl(code_root_cl),
_strong_code_root_scan_time_sec(0.0),
_cards(0),
_cards_done(0),
_worker_i(worker_i),
_try_claimed(false)
{
_g1h = G1CollectedHeap::heap();
_bot_shared = _g1h->bot_shared();
_ct_bs = _g1h->g1_barrier_set();
_block_size = MAX2<size_t>(G1RSetScanBlockSize, 1);
_try_claimed(false) {
_g1h = G1CollectedHeap::heap();
_bot_shared = _g1h->bot_shared();
_ct_bs = _g1h->g1_barrier_set();
_block_size = MAX2<size_t>(G1RSetScanBlockSize, 1);
}
void ScanRSClosure::scanCard(size_t index, HeapRegion *r) {
// Stack allocate the DirtyCardToOopClosure instance
HeapRegionDCTOC cl(_g1h, r, _oc,
CardTableModRefBS::Precise);
// Set the "from" region in the closure.
_oc->set_region(r);
MemRegion card_region(_bot_shared->address_for_index(index), G1BlockOffsetSharedArray::N_words);
MemRegion pre_gc_allocated(r->bottom(), r->scan_top());
MemRegion mr = pre_gc_allocated.intersection(card_region);
if (!mr.is_empty() && !_ct_bs->is_card_claimed(index)) {
// We make the card as "claimed" lazily (so races are possible
// but they're benign), which reduces the number of duplicate
// scans (the rsets of the regions in the cset can intersect).
_ct_bs->set_card_claimed(index);
_cards_done++;
cl.do_MemRegion(mr);
}
}
void set_try_claimed() { _try_claimed = true; }
void ScanRSClosure::printCard(HeapRegion* card_region, size_t card_index,
HeapWord* card_start) {
gclog_or_tty->print_cr("T %u Region [" PTR_FORMAT ", " PTR_FORMAT ") "
"RS names card " SIZE_FORMAT_HEX ": "
"[" PTR_FORMAT ", " PTR_FORMAT ")",
_worker_i,
p2i(card_region->bottom()), p2i(card_region->end()),
card_index,
p2i(card_start), p2i(card_start + G1BlockOffsetSharedArray::N_words));
}
void scanCard(size_t index, HeapRegion *r) {
// Stack allocate the DirtyCardToOopClosure instance
HeapRegionDCTOC cl(_g1h, r, _oc,
CardTableModRefBS::Precise);
void ScanRSClosure::scan_strong_code_roots(HeapRegion* r) {
double scan_start = os::elapsedTime();
r->strong_code_roots_do(_code_root_cl);
_strong_code_root_scan_time_sec += (os::elapsedTime() - scan_start);
}
// Set the "from" region in the closure.
_oc->set_region(r);
MemRegion card_region(_bot_shared->address_for_index(index), G1BlockOffsetSharedArray::N_words);
MemRegion pre_gc_allocated(r->bottom(), r->scan_top());
MemRegion mr = pre_gc_allocated.intersection(card_region);
if (!mr.is_empty() && !_ct_bs->is_card_claimed(index)) {
// We make the card as "claimed" lazily (so races are possible
// but they're benign), which reduces the number of duplicate
// scans (the rsets of the regions in the cset can intersect).
_ct_bs->set_card_claimed(index);
_cards_done++;
cl.do_MemRegion(mr);
bool ScanRSClosure::doHeapRegion(HeapRegion* r) {
assert(r->in_collection_set(), "should only be called on elements of CS.");
HeapRegionRemSet* hrrs = r->rem_set();
if (hrrs->iter_is_complete()) return false; // All done.
if (!_try_claimed && !hrrs->claim_iter()) return false;
// If we ever free the collection set concurrently, we should also
// clear the card table concurrently therefore we won't need to
// add regions of the collection set to the dirty cards region.
_g1h->push_dirty_cards_region(r);
// If we didn't return above, then
// _try_claimed || r->claim_iter()
// is true: either we're supposed to work on claimed-but-not-complete
// regions, or we successfully claimed the region.
HeapRegionRemSetIterator iter(hrrs);
size_t card_index;
// We claim cards in block so as to reduce the contention. The block size is determined by
// the G1RSetScanBlockSize parameter.
size_t jump_to_card = hrrs->iter_claimed_next(_block_size);
for (size_t current_card = 0; iter.has_next(card_index); current_card++) {
if (current_card >= jump_to_card + _block_size) {
jump_to_card = hrrs->iter_claimed_next(_block_size);
}
}
void printCard(HeapRegion* card_region, size_t card_index,
HeapWord* card_start) {
gclog_or_tty->print_cr("T %u Region [" PTR_FORMAT ", " PTR_FORMAT ") "
"RS names card " SIZE_FORMAT_HEX ": "
"[" PTR_FORMAT ", " PTR_FORMAT ")",
_worker_i,
p2i(card_region->bottom()), p2i(card_region->end()),
card_index,
p2i(card_start), p2i(card_start + G1BlockOffsetSharedArray::N_words));
}
void scan_strong_code_roots(HeapRegion* r) {
double scan_start = os::elapsedTime();
r->strong_code_roots_do(_code_root_cl);
_strong_code_root_scan_time_sec += (os::elapsedTime() - scan_start);
}
bool doHeapRegion(HeapRegion* r) {
assert(r->in_collection_set(), "should only be called on elements of CS.");
HeapRegionRemSet* hrrs = r->rem_set();
if (hrrs->iter_is_complete()) return false; // All done.
if (!_try_claimed && !hrrs->claim_iter()) return false;
// If we ever free the collection set concurrently, we should also
// clear the card table concurrently therefore we won't need to
// add regions of the collection set to the dirty cards region.
_g1h->push_dirty_cards_region(r);
// If we didn't return above, then
// _try_claimed || r->claim_iter()
// is true: either we're supposed to work on claimed-but-not-complete
// regions, or we successfully claimed the region.
HeapRegionRemSetIterator iter(hrrs);
size_t card_index;
// We claim cards in block so as to reduce the contention. The block size is determined by
// the G1RSetScanBlockSize parameter.
size_t jump_to_card = hrrs->iter_claimed_next(_block_size);
for (size_t current_card = 0; iter.has_next(card_index); current_card++) {
if (current_card >= jump_to_card + _block_size) {
jump_to_card = hrrs->iter_claimed_next(_block_size);
}
if (current_card < jump_to_card) continue;
HeapWord* card_start = _g1h->bot_shared()->address_for_index(card_index);
if (current_card < jump_to_card) continue;
HeapWord* card_start = _g1h->bot_shared()->address_for_index(card_index);
#if 0
gclog_or_tty->print("Rem set iteration yielded card [" PTR_FORMAT ", " PTR_FORMAT ").\n",
card_start, card_start + CardTableModRefBS::card_size_in_words);
gclog_or_tty->print("Rem set iteration yielded card [" PTR_FORMAT ", " PTR_FORMAT ").\n",
card_start, card_start + CardTableModRefBS::card_size_in_words);
#endif
HeapRegion* card_region = _g1h->heap_region_containing(card_start);
_cards++;
HeapRegion* card_region = _g1h->heap_region_containing(card_start);
_cards++;
if (!card_region->is_on_dirty_cards_region_list()) {
_g1h->push_dirty_cards_region(card_region);
}
// If the card is dirty, then we will scan it during updateRS.
if (!card_region->in_collection_set() &&
!_ct_bs->is_card_dirty(card_index)) {
scanCard(card_index, card_region);
}
if (!card_region->is_on_dirty_cards_region_list()) {
_g1h->push_dirty_cards_region(card_region);
}
if (!_try_claimed) {
// Scan the strong code root list attached to the current region
scan_strong_code_roots(r);
hrrs->set_iter_complete();
// If the card is dirty, then we will scan it during updateRS.
if (!card_region->in_collection_set() &&
!_ct_bs->is_card_dirty(card_index)) {
scanCard(card_index, card_region);
}
return false;
}
if (!_try_claimed) {
// Scan the strong code root list attached to the current region
scan_strong_code_roots(r);
double strong_code_root_scan_time_sec() {
return _strong_code_root_scan_time_sec;
hrrs->set_iter_complete();
}
size_t cards_done() { return _cards_done;}
size_t cards_looked_up() { return _cards;}
};
return false;
}
size_t G1RemSet::scanRS(G1ParPushHeapRSClosure* oc,
CodeBlobClosure* heap_region_codeblobs,

View file

@ -54,16 +54,6 @@ protected:
uint n_workers();
protected:
enum SomePrivateConstants {
UpdateRStoMergeSync = 0,
MergeRStoDoDirtySync = 1,
DoDirtySync = 2,
LastSync = 3,
SeqTask = 0,
NumSeqTasks = 1
};
CardTableModRefBS* _ct_bs;
G1CollectorPolicy* _g1p;
@ -123,7 +113,6 @@ public:
// Record, if necessary, the fact that *p (where "p" is in region "from",
// which is required to be non-NULL) has changed to a new non-NULL value.
template <class T> void write_ref(HeapRegion* from, T* p);
template <class T> void par_write_ref(HeapRegion* from, T* p, uint tid);
// Requires "region_bm" and "card_bm" to be bitmaps with 1 bit per region
@ -156,6 +145,41 @@ public:
}
};
class ScanRSClosure : public HeapRegionClosure {
size_t _cards_done, _cards;
G1CollectedHeap* _g1h;
G1ParPushHeapRSClosure* _oc;
CodeBlobClosure* _code_root_cl;
G1BlockOffsetSharedArray* _bot_shared;
G1SATBCardTableModRefBS *_ct_bs;
double _strong_code_root_scan_time_sec;
uint _worker_i;
size_t _block_size;
bool _try_claimed;
public:
ScanRSClosure(G1ParPushHeapRSClosure* oc,
CodeBlobClosure* code_root_cl,
uint worker_i);
bool doHeapRegion(HeapRegion* r);
double strong_code_root_scan_time_sec() {
return _strong_code_root_scan_time_sec;
}
size_t cards_done() { return _cards_done;}
size_t cards_looked_up() { return _cards;}
void set_try_claimed() { _try_claimed = true; }
private:
void scanCard(size_t index, HeapRegion *r);
void printCard(HeapRegion* card_region, size_t card_index,
HeapWord* card_start);
void scan_strong_code_roots(HeapRegion* r);
};
class UpdateRSOopClosure: public ExtendedOopClosure {
HeapRegion* _from;
G1RemSet* _rs;

View file

@ -34,11 +34,6 @@ inline uint G1RemSet::n_workers() {
return _g1->workers()->total_workers();
}
template <class T>
inline void G1RemSet::write_ref(HeapRegion* from, T* p) {
par_write_ref(from, p, 0);
}
template <class T>
inline void G1RemSet::par_write_ref(HeapRegion* from, T* p, uint tid) {
oop obj = oopDesc::load_decode_heap_oop(p);

View file

@ -211,14 +211,14 @@ void HeapRegion::calc_gc_efficiency() {
_gc_efficiency = (double) reclaimable_bytes() / region_elapsed_time_ms;
}
void HeapRegion::set_starts_humongous(HeapWord* obj_top) {
void HeapRegion::set_starts_humongous(HeapWord* obj_top, size_t fill_size) {
assert(!is_humongous(), "sanity / pre-condition");
assert(top() == bottom(), "should be empty");
_type.set_starts_humongous();
_humongous_start_region = this;
_offsets.set_for_starts_humongous(obj_top);
_offsets.set_for_starts_humongous(obj_top, fill_size);
}
void HeapRegion::set_continues_humongous(HeapRegion* first_hr) {
@ -756,16 +756,6 @@ void HeapRegion::verify(VerifyOption vo,
size_t obj_size = block_size(p);
object_num += 1;
if (is_region_humongous != g1->is_humongous(obj_size) &&
!g1->is_obj_dead(obj, this)) { // Dead objects may have bigger block_size since they span several objects.
gclog_or_tty->print_cr("obj " PTR_FORMAT " is of %shumongous size ("
SIZE_FORMAT " words) in a %shumongous region",
p2i(p), g1->is_humongous(obj_size) ? "" : "non-",
obj_size, is_region_humongous ? "" : "non-");
*failures = true;
return;
}
if (!g1->is_obj_dead_cond(obj, this, vo)) {
if (obj->is_oop()) {
Klass* klass = obj->klass();
@ -876,14 +866,6 @@ void HeapRegion::verify(VerifyOption vo,
}
}
if (is_region_humongous && object_num > 1) {
gclog_or_tty->print_cr("region [" PTR_FORMAT "," PTR_FORMAT "] is humongous "
"but has " SIZE_FORMAT ", objects",
p2i(bottom()), p2i(end()), object_num);
*failures = true;
return;
}
verify_strong_code_roots(vo, failures);
}

View file

@ -455,9 +455,9 @@ class HeapRegion: public G1OffsetTableContigSpace {
// the first region in a series of one or more contiguous regions
// that will contain a single "humongous" object.
//
// obj_top : points to the end of the humongous object that's being
// allocated.
void set_starts_humongous(HeapWord* obj_top);
// obj_top : points to the top of the humongous object.
// fill_size : size of the filler object at the end of the region series.
void set_starts_humongous(HeapWord* obj_top, size_t fill_size);
// Makes the current region be a "continues humongous'
// region. first_hr is the "start humongous" region of the series

View file

@ -245,7 +245,6 @@ LinkInfo::LinkInfo(const constantPoolHandle& pool, int index, TRAPS) {
// Get name, signature, and static klass
_name = pool->name_ref_at(index);
_signature = pool->signature_ref_at(index);
_tag = pool->tag_ref_at(index);
_current_klass = KlassHandle(THREAD, pool->pool_holder());
// Coming from the constant pool always checks access
@ -682,15 +681,6 @@ methodHandle LinkResolver::resolve_method(const LinkInfo& link_info,
THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
}
// check tag at call is method
if (!link_info.tag().is_invalid() && !link_info.tag().is_method()) {
ResourceMark rm(THREAD);
char buf[200];
jio_snprintf(buf, sizeof(buf), "Resolving to non regular method %s", link_info.method_string());
THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
}
// 2. lookup method in resolved klass and its super klasses
methodHandle resolved_method = lookup_method_in_klasses(link_info, true, false, CHECK_NULL);
@ -750,14 +740,6 @@ methodHandle LinkResolver::resolve_interface_method(const LinkInfo& link_info,
THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
}
// check tag at call is an interface method
if (!link_info.tag().is_invalid() && !link_info.tag().is_interface_method()) {
ResourceMark rm(THREAD);
char buf[200];
jio_snprintf(buf, sizeof(buf), "Resolving to non interface method %s", link_info.method_string());
THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
}
// lookup method in this interface or its super, java.lang.Object
// JDK8: also look for static methods
methodHandle resolved_method = lookup_method_in_klasses(link_info, false, true, CHECK_NULL);
@ -935,8 +917,7 @@ void LinkResolver::resolve_static_call(CallInfo& result,
resolved_klass->initialize(CHECK);
// Use updated LinkInfo (to reresolve with resolved_klass as method_holder?)
LinkInfo new_info(resolved_klass, link_info.name(), link_info.signature(),
link_info.current_klass(),
link_info.check_access() ? LinkInfo::needs_access_check : LinkInfo::skip_access_check);
link_info.current_klass(), link_info.check_access());
resolved_method = linktime_resolve_static_method(new_info, CHECK);
}

View file

@ -135,35 +135,20 @@ class LinkInfo : public StackObj {
KlassHandle _resolved_klass; // class that the constant pool entry points to
KlassHandle _current_klass; // class that owns the constant pool
bool _check_access;
constantTag _tag;
public:
enum AccessCheck {
needs_access_check,
skip_access_check
};
LinkInfo(const constantPoolHandle& pool, int index, TRAPS);
// Condensed information from other call sites within the vm.
LinkInfo(KlassHandle resolved_klass, Symbol* name, Symbol* signature, KlassHandle current_klass,
AccessCheck check_access = needs_access_check,
constantTag tag = JVM_CONSTANT_Invalid) :
LinkInfo(KlassHandle resolved_klass, Symbol* name, Symbol* signature,
KlassHandle current_klass, bool check_access = true) :
_resolved_klass(resolved_klass),
_name(name), _signature(signature), _current_klass(current_klass),
_check_access(check_access == needs_access_check && current_klass.not_null()), _tag(tag) {}
// Case where we just find the method and don't check access against the current class
LinkInfo(KlassHandle resolved_klass, Symbol*name, Symbol* signature) :
_resolved_klass(resolved_klass),
_name(name), _signature(signature), _current_klass(NULL),
_check_access(false), _tag(JVM_CONSTANT_Invalid) {}
_check_access(check_access) {}
// accessors
Symbol* name() const { return _name; }
Symbol* signature() const { return _signature; }
KlassHandle resolved_klass() const { return _resolved_klass; }
KlassHandle current_klass() const { return _current_klass; }
constantTag tag() const { return _tag; }
bool check_access() const { return _check_access; }
char* method_string() const;

View file

@ -574,7 +574,7 @@ C2V_VMENTRY(jobject, resolveMethod, (JNIEnv *, jobject, jobject receiver_jvmci_t
if (holder_klass->is_interface()) {
// do link-time resolution to check all access rules.
LinkInfo link_info(holder_klass, method_name, method_signature, caller_klass);
LinkInfo link_info(holder_klass, method_name, method_signature, caller_klass, true);
methodHandle resolved_method = LinkResolver::linktime_resolve_interface_method_or_null(link_info);
if (resolved_method.is_null() || resolved_method->is_private()) {
return NULL;
@ -586,7 +586,7 @@ C2V_VMENTRY(jobject, resolveMethod, (JNIEnv *, jobject, jobject receiver_jvmci_t
return JNIHandles::make_local(THREAD, result);
} else {
// do link-time resolution to check all access rules.
LinkInfo link_info(holder_klass, method_name, method_signature, caller_klass);
LinkInfo link_info(holder_klass, method_name, method_signature, caller_klass, true);
methodHandle resolved_method = LinkResolver::linktime_resolve_virtual_method_or_null(link_info);
if (resolved_method.is_null()) {
return NULL;

View file

@ -282,12 +282,11 @@ methodHandle JVMCIEnv::lookup_method(instanceKlassHandle& h_accessor,
instanceKlassHandle& h_holder,
Symbol* name,
Symbol* sig,
Bytecodes::Code bc,
constantTag tag) {
Bytecodes::Code bc) {
JVMCI_EXCEPTION_CONTEXT;
LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
methodHandle dest_method;
LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag);
LinkInfo link_info(h_holder, name, sig, h_accessor, /*check_access*/true);
switch (bc) {
case Bytecodes::_invokestatic:
dest_method =
@ -360,8 +359,7 @@ methodHandle JVMCIEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
if (holder_is_accessible) { // Our declared holder is loaded.
instanceKlassHandle lookup = get_instance_klass_for_declared_method_holder(holder);
constantTag tag = cpool->tag_ref_at(index);
methodHandle m = lookup_method(accessor, lookup, name_sym, sig_sym, bc, tag);
methodHandle m = lookup_method(accessor, lookup, name_sym, sig_sym, bc);
if (!m.is_null() &&
(bc == Bytecodes::_invokestatic
? InstanceKlass::cast(m->method_holder())->is_not_initialized()

View file

@ -125,8 +125,7 @@ private:
instanceKlassHandle& holder,
Symbol* name,
Symbol* sig,
Bytecodes::Code bc,
constantTag tag);
Bytecodes::Code bc);
private:

View file

@ -37,10 +37,10 @@ void Test_log_length() {
// Write long message to output file
MutexLocker ml(LogConfiguration_lock);
LogConfiguration::parse_log_arguments("loglengthoutput.txt", "logging=develop",
LogConfiguration::parse_log_arguments("loglengthoutput.txt", "logging=trace",
NULL, NULL, NULL);
ResourceMark rm;
outputStream* logstream = LogHandle(logging)::develop_stream();
outputStream* logstream = LogHandle(logging)::trace_stream();
logstream->print_cr("01:1234567890-"
"02:1234567890-"
"03:1234567890-"

View file

@ -49,11 +49,21 @@
#define log_info(...) (!log_is_enabled(Info, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Info>
#define log_debug(...) (!log_is_enabled(Debug, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Debug>
#define log_trace(...) (!log_is_enabled(Trace, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Trace>
// Macros for logging that should be excluded in product builds.
// Available for levels Info, Debug and Trace. Includes test macro that
// evaluates to false in product builds.
#ifndef PRODUCT
#define log_develop(...) (!log_is_enabled(Develop, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Develop>
#define log_develop_info(...) (!log_is_enabled(Info, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Info>
#define log_develop_debug(...) (!log_is_enabled(Debug, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Debug>
#define log_develop_trace(...) (!log_is_enabled(Trace, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Trace>
#define develop_log_is_enabled(level, ...) log_is_enabled(level, __VA_ARGS__)
#else
#define DUMMY_ARGUMENT_CONSUMER(...)
#define log_develop(...) DUMMY_ARGUMENT_CONSUMER
#define log_develop_info(...) DUMMY_ARGUMENT_CONSUMER
#define log_develop_debug(...) DUMMY_ARGUMENT_CONSUMER
#define log_develop_trace(...) DUMMY_ARGUMENT_CONSUMER
#define develop_log_is_enabled(...) false
#endif
// Convenience macro to test if the logging is enabled on the specified level for given tags.
@ -88,6 +98,11 @@ class Log VALUE_OBJ_CLASS_SPEC {
// is not __NO_TAG, the number of tags given exceeds the maximum allowed.
STATIC_ASSERT(GuardTag == LogTag::__NO_TAG); // Number of logging tags exceeds maximum supported!
// Empty constructor to avoid warnings on MSVC about unused variables
// when the log instance is only used for static functions.
Log() {
}
static bool is_level(LogLevelType level) {
return LogTagSetMapping<T0, T1, T2, T3, T4>::tagset().is_level(level);
}

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