Mercurial > hg > openjdk > bsd-port > hotspot
changeset 4435:88f46d208452 hs24-b32
Merge
author | amurillo |
---|---|
date | Fri, 01 Feb 2013 12:36:53 -0800 |
parents | acf5f0fbba89 (current diff) a7ffe4177db0 (diff) |
children | 38b173289e57 |
files | .hgtags make/solaris/makefiles/kernel.make |
diffstat | 103 files changed, 980 insertions(+), 1490 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Fri Feb 01 09:56:38 2013 -0800 +++ b/.hgtags Fri Feb 01 12:36:53 2013 -0800 @@ -429,4 +429,5 @@ 181528fd1e74863a902f171a2ad46270a2fb15e0 jdk7u14-b10 4008cf63c30133f2fac148a39903552fe7a33cea hs24-b30 06a41c6e29c2b1aa9c5f7807fe23f75fe2a0038d jdk7u14-b11 +7b2efda91ffcad410878d2fa14b8704558e35b4d hs24-b31 bfa88fb4cb016d4e94a338bea3d090b548830ec4 jdk7u14-b12
--- a/make/Makefile Fri Feb 01 09:56:38 2013 -0800 +++ b/make/Makefile Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -85,13 +85,12 @@ # Typical C1/C2 targets made available with this Makefile C1_VM_TARGETS=product1 fastdebug1 optimized1 jvmg1 C2_VM_TARGETS=product fastdebug optimized jvmg -KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark jvmgshark -COMMON_VM_PRODUCT_TARGETS=product product1 productkernel docs export_product -COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 fastdebugkernel docs export_fastdebug -COMMON_VM_DEBUG_TARGETS=jvmg jvmg1 jvmgkernel docs export_debug +COMMON_VM_PRODUCT_TARGETS=product product1 docs export_product +COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 docs export_fastdebug +COMMON_VM_DEBUG_TARGETS=jvmg jvmg1 docs export_debug # JDK directory list JDK_DIRS=bin include jre lib demo @@ -114,7 +113,7 @@ endif endif -all_optimized: optimized optimized1 optimizedkernel docs export_optimized +all_optimized: optimized optimized1 docs export_optimized allzero: all_productzero all_fastdebugzero all_productzero: productzero docs export_product @@ -152,11 +151,6 @@ $(CD) $(GAMMADIR)/make; \ $(MAKE) BUILD_FLAVOR=$@ VM_TARGET=$@ generic_build2 $(ALT_OUT) -$(KERNEL_VM_TARGETS): - $(CD) $(GAMMADIR)/make; \ - $(MAKE) BUILD_FLAVOR=$(@:%kernel=%) VM_TARGET=$@ \ - generic_buildkernel $(ALT_OUT) - $(ZERO_VM_TARGETS): $(CD) $(GAMMADIR)/make; \ $(MAKE) BUILD_FLAVOR=$(@:%zero=%) VM_TARGET=$@ \ @@ -209,24 +203,6 @@ $(MAKE_ARGS) $(VM_TARGET) endif -generic_buildkernel: - $(MKDIR) -p $(OUTPUTDIR) -ifeq ($(OSNAME),windows) - ifeq ($(ARCH_DATA_MODEL), 32) - $(CD) $(OUTPUTDIR); \ - $(NMAKE) -f $(ABS_OS_MAKEFILE) \ - Variant=kernel \ - WorkSpace=$(ABS_GAMMADIR) \ - BootStrapDir=$(ABS_BOOTDIR) \ - BuildUser=$(USERNAME) \ - $(MAKE_ARGS) $(VM_TARGET:%kernel=%) - else - @$(ECHO) "No kernel ($(VM_TARGET)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" - endif -else - @$(ECHO) "No kernel ($(VM_TARGET)) for OS_NAME=$(OSNAME)" -endif - generic_buildzero: $(MKDIR) -p $(OUTPUTDIR) $(CD) $(OUTPUTDIR); \ @@ -279,12 +255,10 @@ DOCS_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_docs C1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1 C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2 -KERNEL_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_kernel ZERO_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_zero SHARK_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_shark C1_DIR=$(C1_BASE_DIR)/$(VM_SUBDIR) C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR) -KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR) ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR) SHARK_DIR=$(SHARK_BASE_DIR)/$(VM_SUBDIR) @@ -296,10 +270,6 @@ MISC_DIR=$(C1_DIR) GEN_DIR=$(C1_BASE_DIR)/generated endif -ifeq ($(JVM_VARIANT_KERNEL), true) - MISC_DIR=$(C2_DIR) - GEN_DIR=$(C2_BASE_DIR)/generated -endif ifeq ($(JVM_VARIANT_ZEROSHARK), true) MISC_DIR=$(SHARK_DIR) GEN_DIR=$(SHARK_BASE_DIR)/generated @@ -345,16 +315,6 @@ $(install-file) $(EXPORT_SERVER_DIR)/%.map: $(C2_DIR)/%.map $(install-file) - -# Kernel files always come from kernel area -$(EXPORT_KERNEL_DIR)/%.diz: $(KERNEL_DIR)/%.diz - $(install-file) -$(EXPORT_KERNEL_DIR)/%.dll: $(KERNEL_DIR)/%.dll - $(install-file) -$(EXPORT_KERNEL_DIR)/%.pdb: $(KERNEL_DIR)/%.pdb - $(install-file) -$(EXPORT_KERNEL_DIR)/%.map: $(KERNEL_DIR)/%.map - $(install-file) endif # Shared Library @@ -402,14 +362,30 @@ ifeq ($(JVM_VARIANT_ZEROSHARK), true) $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) + $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(SHARK_DIR)/%.debuginfo + $(install-file) + $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(SHARK_DIR)/%.diz + $(install-file) $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) + $(EXPORT_SERVER_DIR)/%.debuginfo: $(SHARK_DIR)/%.debuginfo + $(install-file) + $(EXPORT_SERVER_DIR)/%.diz: $(SHARK_DIR)/%.diz + $(install-file) endif ifeq ($(JVM_VARIANT_ZERO), true) $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) + $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(ZERO_DIR)/%.debuginfo + $(install-file) + $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(ZERO_DIR)/%.diz + $(install-file) $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) + $(EXPORT_SERVER_DIR)/%.debuginfo: $(ZERO_DIR)/%.debuginfo + $(install-file) + $(EXPORT_SERVER_DIR)/%.diz: $(ZERO_DIR)/%.diz + $(install-file) endif endif @@ -451,7 +427,7 @@ $(install-file) # Xusage file -$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE) +$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt: $(XUSAGE) $(prep-target) $(RM) $@.temp $(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp @@ -464,7 +440,6 @@ clean_build: $(RM) -r $(C1_DIR) $(RM) -r $(C2_DIR) - $(RM) -r $(KERNEL_DIR) $(RM) -r $(ZERO_DIR) $(RM) -r $(SHARK_DIR) clean_export: @@ -498,10 +473,6 @@ $(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -server -Xinternalversion $(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -server -version endif - ifeq ($(JVM_VARIANT_KERNEL), true) - $(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -kernel -Xinternalversion - $(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -kernel -version - endif copy_product_jdk:: $(RM) -r $(JDK_IMAGE_DIR) @@ -577,7 +548,6 @@ @$(ECHO) "Others targets are:" @$(ECHO) " $(C1_VM_TARGETS)" @$(ECHO) " $(C2_VM_TARGETS)" - @$(ECHO) " $(KERNEL_VM_TARGETS)" # Variable help (only common ones used by this workspace) variable_help: variable_help_intro variable_list variable_help_end @@ -672,8 +642,7 @@ include $(GAMMADIR)/make/jprt.gmk .PHONY: all world clobber clean help $(C1_VM_TARGETS) $(C2_VM_TARGETS) \ - $(KERNEL_VM_TARGETS) \ - generic_build1 generic_build2 generic_buildkernel generic_export \ + generic_build1 generic_build2 generic_export \ export_product export_fastdebug export_debug export_optimized \ export_jdk_product export_jdk_fastdebug export_jdk_debug \ create_jdk copy_jdk update_jdk test_jdk \
--- a/make/bsd/makefiles/dtrace.make Fri Feb 01 09:56:38 2013 -0800 +++ b/make/bsd/makefiles/dtrace.make Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,9 @@ # Rules to build jvm_db/dtrace, used by vm.make # We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2 -# but not for CORE or KERNEL configurations. +# but not for CORE configuration. ifneq ("${TYPE}", "CORE") -ifneq ("${TYPE}", "KERNEL") ifeq ($(OS_VENDOR), Darwin) # we build dtrace for macosx using USDT2 probes @@ -288,13 +287,6 @@ endif # ifeq ($(OS_VENDOR), Darwin) -else # KERNEL build - -dtraceCheck: - $(QUIETLY) echo "**NOTICE** Dtrace support disabled for KERNEL builds" - -endif # ifneq ("${TYPE}", "KERNEL") - else # CORE build dtraceCheck:
--- a/make/hotspot_version Fri Feb 01 09:56:38 2013 -0800 +++ b/make/hotspot_version Fri Feb 01 12:36:53 2013 -0800 @@ -35,7 +35,7 @@ HS_MAJOR_VER=24 HS_MINOR_VER=0 -HS_BUILD_NUMBER=30 +HS_BUILD_NUMBER=32 JDK_MAJOR_VER=1 JDK_MINOR_VER=7
--- a/make/jprt.properties Fri Feb 01 09:56:38 2013 -0800 +++ b/make/jprt.properties Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -38,7 +38,7 @@ # This tells jprt what default release we want to build -jprt.hotspot.default.release=jdk7u12 +jprt.hotspot.default.release=jdk7u14 jprt.tools.default.release=${jprt.submit.option.release?${jprt.submit.option.release}:${jprt.hotspot.default.release}} @@ -54,97 +54,97 @@ # Define the Solaris platforms we want for the various releases jprt.my.solaris.sparc.jdk8=solaris_sparc_5.10 jprt.my.solaris.sparc.jdk7=solaris_sparc_5.10 -jprt.my.solaris.sparc.jdk7u12=${jprt.my.solaris.sparc.jdk7} +jprt.my.solaris.sparc.jdk7u14=${jprt.my.solaris.sparc.jdk7} jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}} jprt.my.solaris.sparcv9.jdk8=solaris_sparcv9_5.10 jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10 -jprt.my.solaris.sparcv9.jdk7u12=${jprt.my.solaris.sparcv9.jdk7} +jprt.my.solaris.sparcv9.jdk7u14=${jprt.my.solaris.sparcv9.jdk7} jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}} jprt.my.solaris.i586.jdk8=solaris_i586_5.10 jprt.my.solaris.i586.jdk7=solaris_i586_5.10 -jprt.my.solaris.i586.jdk7u12=${jprt.my.solaris.i586.jdk7} +jprt.my.solaris.i586.jdk7u14=${jprt.my.solaris.i586.jdk7} jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}} jprt.my.solaris.x64.jdk8=solaris_x64_5.10 jprt.my.solaris.x64.jdk7=solaris_x64_5.10 -jprt.my.solaris.x64.jdk7u12=${jprt.my.solaris.x64.jdk7} +jprt.my.solaris.x64.jdk7u14=${jprt.my.solaris.x64.jdk7} jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}} jprt.my.linux.i586.jdk8=linux_i586_2.6 jprt.my.linux.i586.jdk7=linux_i586_2.6 -jprt.my.linux.i586.jdk7u12=${jprt.my.linux.i586.jdk7} +jprt.my.linux.i586.jdk7u14=${jprt.my.linux.i586.jdk7} jprt.my.linux.i586=${jprt.my.linux.i586.${jprt.tools.default.release}} jprt.my.linux.x64.jdk8=linux_x64_2.6 jprt.my.linux.x64.jdk7=linux_x64_2.6 -jprt.my.linux.x64.jdk7u12=${jprt.my.linux.x64.jdk7} +jprt.my.linux.x64.jdk7u14=${jprt.my.linux.x64.jdk7} jprt.my.linux.x64=${jprt.my.linux.x64.${jprt.tools.default.release}} jprt.my.linux.ppc.jdk8=linux_ppc_2.6 jprt.my.linux.ppc.jdk7=linux_ppc_2.6 -jprt.my.linux.ppc.jdk7u12=${jprt.my.linux.ppc.jdk7} +jprt.my.linux.ppc.jdk7u14=${jprt.my.linux.ppc.jdk7} jprt.my.linux.ppc=${jprt.my.linux.ppc.${jprt.tools.default.release}} jprt.my.linux.ppcv2.jdk8=linux_ppcv2_2.6 jprt.my.linux.ppcv2.jdk7=linux_ppcv2_2.6 -jprt.my.linux.ppcv2.jdk7u12=${jprt.my.linux.ppcv2.jdk7} +jprt.my.linux.ppcv2.jdk7u14=${jprt.my.linux.ppcv2.jdk7} jprt.my.linux.ppcv2=${jprt.my.linux.ppcv2.${jprt.tools.default.release}} jprt.my.linux.ppcsflt.jdk8=linux_ppcsflt_2.6 jprt.my.linux.ppcsflt.jdk7=linux_ppcsflt_2.6 -jprt.my.linux.ppcsflt.jdk7u12=${jprt.my.linux.ppcsflt.jdk7} +jprt.my.linux.ppcsflt.jdk7u14=${jprt.my.linux.ppcsflt.jdk7} jprt.my.linux.ppcsflt=${jprt.my.linux.ppcsflt.${jprt.tools.default.release}} jprt.my.linux.armvfp.jdk8=linux_armvfp_2.6 jprt.my.linux.armvfp.jdk7=linux_armvfp_2.6 -jprt.my.linux.armvfp.jdk7u12=${jprt.my.linux.armvfp.jdk7} +jprt.my.linux.armvfp.jdk7u14=${jprt.my.linux.armvfp.jdk7} jprt.my.linux.armvfp=${jprt.my.linux.armvfp.${jprt.tools.default.release}} jprt.my.linux.armvfpsflt.jdk8=linux_armvfpsflt_2.6 jprt.my.linux.armvfpsflt.jdk7=linux_armvfpsflt_2.6 -jprt.my.linux.armvfpsflt.jdk7u12=${jprt.my.linux.armvfpsflt.jdk7} +jprt.my.linux.armvfpsflt.jdk7u14=${jprt.my.linux.armvfpsflt.jdk7} jprt.my.linux.armvfpsflt=${jprt.my.linux.armvfpsflt.${jprt.tools.default.release}} jprt.my.linux.armvfphflt.jdk8=linux_armvfphflt_2.6 jprt.my.linux.armvfphflt.jdk7=linux_armvfphflt_2.6 -jprt.my.linux.armvfphflt.jdk7u12=${jprt.my.linux.armvfphflt.jdk7} +jprt.my.linux.armvfphflt.jdk7u14=${jprt.my.linux.armvfphflt.jdk7} jprt.my.linux.armvfphflt=${jprt.my.linux.armvfphflt.${jprt.tools.default.release}} jprt.my.linux.armv6.jdk8=linux_armv6_2.6 jprt.my.linux.armv6.jdk7=linux_armv6_2.6 -jprt.my.linux.armv6.jdk7u12=${jprt.my.linux.armv6.jdk7} +jprt.my.linux.armv6.jdk7u14=${jprt.my.linux.armv6.jdk7} jprt.my.linux.armv6=${jprt.my.linux.armv6.${jprt.tools.default.release}} jprt.my.linux.armvs.jdk8=linux_armvs_2.6 jprt.my.linux.armvs.jdk7=linux_armvs_2.6 -jprt.my.linux.armvs.jdk7u12=${jprt.my.linux.armvs.jdk7} +jprt.my.linux.armvs.jdk7u14=${jprt.my.linux.armvs.jdk7} jprt.my.linux.armvs=${jprt.my.linux.armvs.${jprt.tools.default.release}} jprt.my.linux.armvh.jdk8=linux_armvh_2.6 jprt.my.linux.armvh.jdk7=linux_armvh_2.6 -jprt.my.linux.armvh.jdk7u12=${jprt.my.linux.armvh.jdk7} +jprt.my.linux.armvh.jdk7u14=${jprt.my.linux.armvh.jdk7} jprt.my.linux.armvh=${jprt.my.linux.armvh.${jprt.tools.default.release}} jprt.my.linux.armsflt.jdk8=linux_armsflt_2.6 jprt.my.linux.armsflt.jdk7=linux_armsflt_2.6 -jprt.my.linux.armsflt.jdk7u12=${jprt.my.linux.armsflt.jdk7} +jprt.my.linux.armsflt.jdk7u14=${jprt.my.linux.armsflt.jdk7} jprt.my.linux.armsflt=${jprt.my.linux.armsflt.${jprt.tools.default.release}} jprt.my.macosx.x64.jdk8=macosx_x64_10.7 jprt.my.macosx.x64.jdk7=macosx_x64_10.7 -jprt.my.macosx.x64.jdk7u12=${jprt.my.macosx.x64.jdk7} +jprt.my.macosx.x64.jdk7u14=${jprt.my.macosx.x64.jdk7} jprt.my.macosx.x64=${jprt.my.macosx.x64.${jprt.tools.default.release}} jprt.my.windows.i586.jdk8=windows_i586_5.1 jprt.my.windows.i586.jdk7=windows_i586_5.1 -jprt.my.windows.i586.jdk7u12=${jprt.my.windows.i586.jdk7} +jprt.my.windows.i586.jdk7u14=${jprt.my.windows.i586.jdk7} jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}} jprt.my.windows.x64.jdk8=windows_x64_5.2 jprt.my.windows.x64.jdk7=windows_x64_5.2 -jprt.my.windows.x64.jdk7u12=${jprt.my.windows.x64.jdk7} +jprt.my.windows.x64.jdk7u14=${jprt.my.windows.x64.jdk7} jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}} # Standard list of jprt build targets for this source tree @@ -183,7 +183,7 @@ jprt.build.targets.jdk8=${jprt.build.targets.all} jprt.build.targets.jdk7=${jprt.build.targets.all} -jprt.build.targets.jdk7u12=${jprt.build.targets.all} +jprt.build.targets.jdk7u14=${jprt.build.targets.all} jprt.build.targets=${jprt.build.targets.${jprt.tools.default.release}} # Subset lists of test targets for this source tree @@ -476,7 +476,7 @@ jprt.test.targets.jdk8=${jprt.test.targets.standard} jprt.test.targets.jdk7=${jprt.test.targets.standard} -jprt.test.targets.jdk7u12=${jprt.test.targets.jdk7} +jprt.test.targets.jdk7u14=${jprt.test.targets.jdk7} jprt.test.targets=${jprt.test.targets.${jprt.tools.default.release}} # The default test/Makefile targets that should be run @@ -536,7 +536,7 @@ jprt.make.rule.test.targets.jdk8=${jprt.make.rule.test.targets.standard} jprt.make.rule.test.targets.jdk7=${jprt.make.rule.test.targets.standard} -jprt.make.rule.test.targets.jdk7u12=${jprt.make.rule.test.targets.jdk7} +jprt.make.rule.test.targets.jdk7u14=${jprt.make.rule.test.targets.jdk7} jprt.make.rule.test.targets=${jprt.make.rule.test.targets.${jprt.tools.default.release}} # 7155453: Work-around to prevent popups on OSX from blocking test completion
--- a/make/solaris/Makefile Fri Feb 01 09:56:38 2013 -0800 +++ b/make/solaris/Makefile Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -157,13 +157,11 @@ SUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS)) SUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS)) SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS)) -SUBDIRS_KERNEL = $(addprefix $(OSNAME)_$(BUILDARCH)_kernel/,$(TARGETS)) TARGETS_C2 = $(TARGETS) TARGETS_C1 = $(addsuffix 1,$(TARGETS)) TARGETS_TIERED = $(addsuffix tiered,$(TARGETS)) TARGETS_CORE = $(addsuffix core,$(TARGETS)) -TARGETS_KERNEL = $(addsuffix kernel,$(TARGETS)) BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) @@ -229,10 +227,6 @@ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks $(BUILDTREE) VARIANT=core -$(SUBDIRS_KERNEL): $(BUILDTREE_MAKE) - $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks - $(BUILDTREE) VARIANT=kernel - # Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME $(TARGETS_C2): $(SUBDIRS_C2) @@ -263,18 +257,10 @@ cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install endif -$(TARGETS_KERNEL): $(SUBDIRS_KERNEL) - cd $(OSNAME)_$(BUILDARCH)_kernel/$(patsubst %kernel,%,$@) && $(MAKE) $(MFLAGS) - cd $(OSNAME)_$(BUILDARCH)_kernel/$(patsubst %kernel,%,$@) && ./test_gamma -ifdef INSTALL - cd $(OSNAME)_$(BUILDARCH)_kernel/$(patsubst %kernel,%,$@) && $(MAKE) $(MFLAGS) install -endif - # Just build the tree, and nothing else: tree: $(SUBDIRS_C2) tree1: $(SUBDIRS_C1) treecore: $(SUBDIRS_CORE) -treekernel: $(SUBDIRS_KERNEL) # Doc target. This is the same for all build options. # Hence create a docs directory beside ...$(ARCH)_[...] @@ -294,10 +280,10 @@ clean_docs: rm -rf $(SUBDIR_DOCS) -clean_compiler1 clean_compiler2 clean_core clean_kernel: +clean_compiler1 clean_compiler2 clean_core: rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@) -clean: clean_compiler2 clean_compiler1 clean_core clean_docs clean_kernel +clean: clean_compiler2 clean_compiler1 clean_core clean_docs include $(GAMMADIR)/make/cscope.make
--- a/make/solaris/makefiles/dtrace.make Fri Feb 01 09:56:38 2013 -0800 +++ b/make/solaris/makefiles/dtrace.make Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,9 @@ # Rules to build jvm_db/dtrace, used by vm.make # We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2 -# but not for CORE or KERNEL configurations. +# but not for CORE configuration. ifneq ("${TYPE}", "CORE") -ifneq ("${TYPE}", "KERNEL") ifdef USE_GCC @@ -386,13 +385,6 @@ endif # ifdef USE_GCC -else # KERNEL build - -dtraceCheck: - $(QUIETLY) echo "**NOTICE** Dtrace support disabled for KERNEL builds" - -endif # ifneq ("${TYPE}", "KERNEL") - else # CORE build dtraceCheck:
--- a/make/solaris/makefiles/kernel.make Fri Feb 01 09:56:38 2013 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -# -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. -# 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. -# -# -# -# Sets make macros for making kernel version of VM. -# This target on solaris is just tempoarily for debugging the kernel build. - -TYPE=KERNEL - -VM_SUBDIR = client - -CFLAGS += -DKERNEL
--- a/make/windows/build.bat Fri Feb 01 09:56:38 2013 -0800 +++ b/make/windows/build.bat Fri Feb 01 12:36:53 2013 -0800 @@ -1,6 +1,6 @@ @echo off REM -REM Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +REM Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. REM REM This code is free software; you can redistribute it and/or modify it @@ -67,7 +67,6 @@ :test1 if "%2" == "core" goto test2 -if "%2" == "kernel" goto test2 if "%2" == "compiler1" goto test2 if "%2" == "compiler2" goto test2 if "%2" == "tiered" goto test2 @@ -109,7 +108,7 @@ echo. echo where: echo flavor is "product", "debug" or "fastdebug", -echo version is "core", "kernel", "compiler1", "compiler2", or "tiered", +echo version is "core", "compiler1", "compiler2", or "tiered", echo workspace is source directory without trailing slash, echo bootstrap_dir is a full path to a JDK in which bin/java echo and bin/javac are present and working, and build_id is an
--- a/make/windows/create_obj_files.sh Fri Feb 01 09:56:38 2013 -0800 +++ b/make/windows/create_obj_files.sh Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -105,7 +105,6 @@ # Include dirs per type. case "${TYPE}" in "core") Src_Dirs="${CORE_PATHS}" ;; - "kernel") Src_Dirs="${BASE_PATHS} ${COMPILER1_PATHS}" ;; "compiler1") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS}" ;; "compiler2") Src_Dirs="${CORE_PATHS} ${COMPILER2_PATHS}" ;; "tiered") Src_Dirs="${CORE_PATHS} ${COMPILER1_PATHS} ${COMPILER2_PATHS}" ;; @@ -118,16 +117,12 @@ SHARK_SPECIFIC_FILES="shark" ZERO_SPECIFIC_FILES="zero" -# These files need to be excluded when building the kernel target. -KERNEL_EXCLUDED_FILES="attachListener.cpp attachListener_windows.cpp dump.cpp dump_${Platform_arch_model}.cpp forte.cpp fprofiler.cpp heapDumper.cpp heapInspection.cpp jniCheck.cpp jvmtiCodeBlobEvents.cpp jvmtiExtensions.cpp jvmtiImpl.cpp jvmtiRawMonitor.cpp jvmtiTagMap.cpp jvmtiTrace.cpp restore.cpp serialize.cpp vmStructs.cpp g1MemoryPool.cpp psMemoryPool.cpp gcAdaptivePolicyCounters.cpp concurrentGCThread.cpp mutableNUMASpace.cpp allocationStats.cpp gSpaceCounters.cpp immutableSpace.cpp mutableSpace.cpp spaceCounters.cpp yieldingWorkgroup.cpp" - # Always exclude these. Src_Files_EXCLUDE="jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp" # Exclude per type. case "${TYPE}" in "core") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;; - "kernel") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ${KERNEL_EXCLUDED_FILES} ciTypeFlow.cpp" ;; "compiler1") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER2_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES} ciTypeFlow.cpp" ;; "compiler2") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${COMPILER1_SPECIFIC_FILES} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;; "tiered") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} ${ZERO_SPECIFIC_FILES} ${SHARK_SPECIFIC_FILES}" ;;
--- a/make/windows/makefiles/defs.make Fri Feb 01 09:56:38 2013 -0800 +++ b/make/windows/makefiles/defs.make Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -157,13 +157,12 @@ MAKE_ARGS += RM="$(RM)" MAKE_ARGS += ZIPEXE=$(ZIPEXE) -# On 32 bit windows we build server, client and kernel, on 64 bit just server. +# On 32 bit windows we build server and client, on 64 bit just server. ifeq ($(JVM_VARIANTS),) ifeq ($(ARCH_DATA_MODEL), 32) - JVM_VARIANTS:=client,server,kernel + JVM_VARIANTS:=client,server JVM_VARIANT_CLIENT:=true JVM_VARIANT_SERVER:=true - JVM_VARIANT_KERNEL:=true else JVM_VARIANTS:=server JVM_VARIANT_SERVER:=true @@ -251,7 +250,6 @@ EXPORT_SERVER_DIR = $(EXPORT_JRE_BIN_DIR)/server EXPORT_CLIENT_DIR = $(EXPORT_JRE_BIN_DIR)/client -EXPORT_KERNEL_DIR = $(EXPORT_JRE_BIN_DIR)/kernel ifeq ($(JVM_VARIANT_SERVER),true) EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt @@ -278,18 +276,6 @@ endif endif endif -ifeq ($(JVM_VARIANT_KERNEL),true) - EXPORT_LIST += $(EXPORT_KERNEL_DIR)/Xusage.txt - EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.$(LIBRARY_SUFFIX) - ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) - ifeq ($(ZIP_DEBUGINFO_FILES),1) - EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.diz - else - EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.pdb - EXPORT_LIST += $(EXPORT_KERNEL_DIR)/jvm.map - endif - endif -endif EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
--- a/make/windows/makefiles/projectcreator.make Fri Feb 01 09:56:38 2013 -0800 +++ b/make/windows/makefiles/projectcreator.make Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -167,63 +167,6 @@ $(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=core) ################################################## -# JKERNEL specific options -################################################## -ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ - -define_kernel KERNEL \ -$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=kernel) \ - -ignorePath_kernel src/share/vm/gc_implementation/parallelScavenge \ - -ignorePath_kernel src/share/vm/gc_implementation/parNew \ - -ignorePath_kernel src/share/vm/gc_implementation/concurrentMarkSweep \ - -ignorePath_kernel src/share/vm/gc_implementation/g1 \ - -ignoreFile_kernel attachListener.cpp \ - -ignoreFile_kernel attachListener_windows.cpp \ - -ignoreFile_kernel dump.cpp \ - -ignoreFile_kernel dump_$(Platform_arch_model).cpp \ - -ignoreFile_kernel forte.cpp \ - -ignoreFile_kernel fprofiler.cpp \ - -ignoreFile_kernel heapDumper.cpp \ - -ignoreFile_kernel heapInspection.cpp \ - -ignoreFile_kernel jniCheck.cpp \ - -ignoreFile_kernel jvmtiCodeBlobEvents.cpp \ - -ignoreFile_kernel jvmtiExtensions.cpp \ - -ignoreFile_kernel jvmtiImpl.cpp \ - -ignoreFile_kernel jvmtiRawMonitor.cpp \ - -ignoreFile_kernel jvmtiTagMap.cpp \ - -ignoreFile_kernel jvmtiTrace.cpp \ - -ignoreFile_kernel jvmtiTrace.hpp \ - -ignoreFile_kernel restore.cpp \ - -ignoreFile_kernel serialize.cpp \ - -ignoreFile_kernel vmStructs.cpp \ - -ignoreFile_kernel g1MemoryPool.cpp \ - -ignoreFile_kernel g1MemoryPool.hpp \ - -ignoreFile_kernel psMemoryPool.cpp \ - -ignoreFile_kernel psMemoryPool.hpp \ - -ignoreFile_kernel gcAdaptivePolicyCounters.cpp \ - -ignoreFile_kernel concurrentGCThread.cpp \ - -ignoreFile_kernel mutableNUMASpace.cpp \ - -ignoreFile_kernel ciTypeFlow.cpp \ - -ignoreFile_kernel ciTypeFlow.hpp \ - -ignoreFile_kernel oop.pcgc.inline.hpp \ - -ignoreFile_kernel oop.psgc.inline.hpp \ - -ignoreFile_kernel allocationStats.cpp \ - -ignoreFile_kernel allocationStats.hpp \ - -ignoreFile_kernel concurrentGCThread.hpp \ - -ignoreFile_kernel gSpaceCounters.cpp \ - -ignoreFile_kernel gSpaceCounters.hpp \ - -ignoreFile_kernel gcAdaptivePolicyCounters.hpp \ - -ignoreFile_kernel immutableSpace.cpp \ - -ignoreFile_kernel mutableNUMASpace.hpp \ - -ignoreFile_kernel mutableSpace.cpp \ - -ignoreFile_kernel spaceCounters.cpp \ - -ignoreFile_kernel spaceCounters.hpp \ - -ignoreFile_kernel yieldingWorkgroup.cpp \ - -ignoreFile_kernel yieldingWorkgroup.hpp \ - -ignorePath_kernel vmStructs_ \ - -ignoreFile_kernel $(Platform_arch_model).ad \ - -additionalFile_kernel gcTaskManager.hpp - -################################################## # Client(C1) compiler specific options ################################################## ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
--- a/make/windows/makefiles/vm.make Fri Feb 01 09:56:38 2013 -0800 +++ b/make/windows/makefiles/vm.make Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -44,10 +44,6 @@ # No need to define anything, CORE is defined as !COMPILER1 && !COMPILER2 !endif -!if "$(Variant)" == "kernel" -CXX_FLAGS=$(CXX_FLAGS) /D "KERNEL" -!endif - !if "$(Variant)" == "compiler1" CXX_FLAGS=$(CXX_FLAGS) /D "COMPILER1" !endif @@ -93,12 +89,8 @@ # AsyncGetCallTrace is not supported on IA64 yet AGCT_EXPORT= !else -!if "$(Variant)" == "kernel" -AGCT_EXPORT= -!else AGCT_EXPORT=/export:AsyncGetCallTrace !endif -!endif # If you modify exports below please do the corresponding changes in # src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
--- a/src/cpu/x86/vm/assembler_x86.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/cpu/x86/vm/assembler_x86.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -549,7 +549,7 @@ // of instructions are freely declared without the need for wrapping them an ifdef. // (Some dangerous instructions are ifdef's out of inappropriate jvm's.) // In the .cpp file the implementations are wrapped so that they are dropped out - // of the resulting jvm. This is done mostly to keep the footprint of KERNEL + // of the resulting jvm. This is done mostly to keep the footprint of minimal // to the size it was prior to merging up the 32bit and 64bit assemblers. // // This does mean you'll get a linker/runtime error if you use a 64bit only instruction
--- a/src/cpu/x86/vm/vm_version_x86.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/cpu/x86/vm/vm_version_x86.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -660,6 +660,14 @@ } } } +#if defined(COMPILER2) && defined(_ALLBSD_SOURCE) + if (MaxVectorSize > 16) { + // Limit vectors size to 16 bytes on BSD until it fixes + // restoring upper 128bit of YMM registers on return + // from signal handler. + FLAG_SET_DEFAULT(MaxVectorSize, 16); + } +#endif // COMPILER2 // Use population count instruction if available. if (supports_popcnt()) {
--- a/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2008, 2009 Red Hat, Inc. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2013, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,12 +31,17 @@ return _masm; } - protected: - address generate_entry(address entry_point) { - ZeroEntry *entry = (ZeroEntry *) assembler()->pc(); - assembler()->advance(sizeof(ZeroEntry)); + public: + static address generate_entry_impl(MacroAssembler* masm, address entry_point) { + ZeroEntry *entry = (ZeroEntry *) masm->pc(); + masm->advance(sizeof(ZeroEntry)); entry->set_entry_point(entry_point); return (address) entry; } + protected: + address generate_entry(address entry_point) { + return generate_entry_impl(assembler(), entry_point); + } + #endif // CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP
--- a/src/cpu/zero/vm/cppInterpreter_zero.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -180,25 +180,6 @@ method, istate->osr_entry(), istate->osr_buf(), THREAD); return; } - else if (istate->msg() == BytecodeInterpreter::call_method_handle) { - oop method_handle = istate->callee(); - - // Trim back the stack to put the parameters at the top - stack->set_sp(istate->stack() + 1); - - // Make the call - process_method_handle(method_handle, THREAD); - fixup_after_potential_safepoint(); - - // Convert the result - istate->set_stack(stack->sp() - 1); - - // Restore the stack - stack->set_sp(istate->stack_limit() + 1); - - // Resume the interpreter - istate->set_msg(BytecodeInterpreter::method_resume); - } else { ShouldNotReachHere(); } @@ -535,35 +516,35 @@ if (entry->is_volatile()) { switch (entry->flag_state()) { case ctos: - SET_LOCALS_INT(object->char_field_acquire(entry->f2()), 0); + SET_LOCALS_INT(object->char_field_acquire(entry->f2_as_index()), 0); break; case btos: - SET_LOCALS_INT(object->byte_field_acquire(entry->f2()), 0); + SET_LOCALS_INT(object->byte_field_acquire(entry->f2_as_index()), 0); break; case stos: - SET_LOCALS_INT(object->short_field_acquire(entry->f2()), 0); + SET_LOCALS_INT(object->short_field_acquire(entry->f2_as_index()), 0); break; case itos: - SET_LOCALS_INT(object->int_field_acquire(entry->f2()), 0); + SET_LOCALS_INT(object->int_field_acquire(entry->f2_as_index()), 0); break; case ltos: - SET_LOCALS_LONG(object->long_field_acquire(entry->f2()), 0); + SET_LOCALS_LONG(object->long_field_acquire(entry->f2_as_index()), 0); break; case ftos: - SET_LOCALS_FLOAT(object->float_field_acquire(entry->f2()), 0); + SET_LOCALS_FLOAT(object->float_field_acquire(entry->f2_as_index()), 0); break; case dtos: - SET_LOCALS_DOUBLE(object->double_field_acquire(entry->f2()), 0); + SET_LOCALS_DOUBLE(object->double_field_acquire(entry->f2_as_index()), 0); break; case atos: - SET_LOCALS_OBJECT(object->obj_field_acquire(entry->f2()), 0); + SET_LOCALS_OBJECT(object->obj_field_acquire(entry->f2_as_index()), 0); break; default: @@ -573,35 +554,35 @@ else { switch (entry->flag_state()) { case ctos: - SET_LOCALS_INT(object->char_field(entry->f2()), 0); + SET_LOCALS_INT(object->char_field(entry->f2_as_index()), 0); break; case btos: - SET_LOCALS_INT(object->byte_field(entry->f2()), 0); + SET_LOCALS_INT(object->byte_field(entry->f2_as_index()), 0); break; case stos: - SET_LOCALS_INT(object->short_field(entry->f2()), 0); + SET_LOCALS_INT(object->short_field(entry->f2_as_index()), 0); break; case itos: - SET_LOCALS_INT(object->int_field(entry->f2()), 0); + SET_LOCALS_INT(object->int_field(entry->f2_as_index()), 0); break; case ltos: - SET_LOCALS_LONG(object->long_field(entry->f2()), 0); + SET_LOCALS_LONG(object->long_field(entry->f2_as_index()), 0); break; case ftos: - SET_LOCALS_FLOAT(object->float_field(entry->f2()), 0); + SET_LOCALS_FLOAT(object->float_field(entry->f2_as_index()), 0); break; case dtos: - SET_LOCALS_DOUBLE(object->double_field(entry->f2()), 0); + SET_LOCALS_DOUBLE(object->double_field(entry->f2_as_index()), 0); break; case atos: - SET_LOCALS_OBJECT(object->obj_field(entry->f2()), 0); + SET_LOCALS_OBJECT(object->obj_field(entry->f2_as_index()), 0); break; default: @@ -629,516 +610,6 @@ return 0; } -int CppInterpreter::method_handle_entry(methodOop method, - intptr_t UNUSED, TRAPS) { - JavaThread *thread = (JavaThread *) THREAD; - ZeroStack *stack = thread->zero_stack(); - int argument_slots = method->size_of_parameters(); - int result_slots = type2size[result_type_of(method)]; - intptr_t *vmslots = stack->sp(); - intptr_t *unwind_sp = vmslots + argument_slots; - - // Find the MethodType - address p = (address) method; - for (jint* pc = method->method_type_offsets_chain(); (*pc) != -1; pc++) { - p = *(address*)(p + (*pc)); - } - oop method_type = (oop) p; - - // The MethodHandle is in the slot after the arguments - int num_vmslots = argument_slots - 1; - oop method_handle = VMSLOTS_OBJECT(num_vmslots); - - // InvokeGeneric requires some extra shuffling - oop mhtype = java_lang_invoke_MethodHandle::type(method_handle); - bool is_exact = mhtype == method_type; - if (!is_exact) { - if (true || // FIXME - method->intrinsic_id() == vmIntrinsics::_invokeExact) { - CALL_VM_NOCHECK_NOFIX( - SharedRuntime::throw_WrongMethodTypeException( - thread, method_type, mhtype)); - // NB all oops trashed! - assert(HAS_PENDING_EXCEPTION, "should do"); - stack->set_sp(unwind_sp); - return 0; - } - assert(method->intrinsic_id() == vmIntrinsics::_invokeGeneric, "should be"); - - // Load up an adapter from the calling type - // NB the x86 code for this (in methodHandles_x86.cpp, search for - // "genericInvoker") is really really odd. I'm hoping it's trying - // to accomodate odd VM/class library combinations I can ignore. - oop adapter = NULL; //FIXME: load the adapter from the CP cache - IF (adapter == NULL) { - CALL_VM_NOCHECK_NOFIX( - SharedRuntime::throw_WrongMethodTypeException( - thread, method_type, mhtype)); - // NB all oops trashed! - assert(HAS_PENDING_EXCEPTION, "should do"); - stack->set_sp(unwind_sp); - return 0; - } - - // Adapters are shared among form-families of method-type. The - // type being called is passed as a trusted first argument so that - // the adapter knows the actual types of its arguments and return - // values. - insert_vmslots(num_vmslots + 1, 1, THREAD); - if (HAS_PENDING_EXCEPTION) { - // NB all oops trashed! - stack->set_sp(unwind_sp); - return 0; - } - - vmslots = stack->sp(); - num_vmslots++; - SET_VMSLOTS_OBJECT(method_type, num_vmslots); - - method_handle = adapter; - } - - // Start processing - process_method_handle(method_handle, THREAD); - if (HAS_PENDING_EXCEPTION) - result_slots = 0; - - // If this is an invokeExact then the eventual callee will not - // have unwound the method handle argument so we have to do it. - // If a result is being returned the it will be above the method - // handle argument we're unwinding. - if (is_exact) { - intptr_t result[2]; - for (int i = 0; i < result_slots; i++) - result[i] = stack->pop(); - stack->pop(); - for (int i = result_slots - 1; i >= 0; i--) - stack->push(result[i]); - } - - // Check - assert(stack->sp() == unwind_sp - result_slots, "should be"); - - // No deoptimized frames on the stack - return 0; -} - -void CppInterpreter::process_method_handle(oop method_handle, TRAPS) { - JavaThread *thread = (JavaThread *) THREAD; - ZeroStack *stack = thread->zero_stack(); - intptr_t *vmslots = stack->sp(); - - bool direct_to_method = false; - BasicType src_rtype = T_ILLEGAL; - BasicType dst_rtype = T_ILLEGAL; - - MethodHandleEntry *entry = - java_lang_invoke_MethodHandle::vmentry(method_handle); - MethodHandles::EntryKind entry_kind = - (MethodHandles::EntryKind) (((intptr_t) entry) & 0xffffffff); - - methodOop method = NULL; - switch (entry_kind) { - case MethodHandles::_invokestatic_mh: - direct_to_method = true; - break; - - case MethodHandles::_invokespecial_mh: - case MethodHandles::_invokevirtual_mh: - case MethodHandles::_invokeinterface_mh: - { - oop receiver = - VMSLOTS_OBJECT( - java_lang_invoke_MethodHandle::vmslots(method_handle) - 1); - if (receiver == NULL) { - stack->set_sp(calculate_unwind_sp(stack, method_handle)); - CALL_VM_NOCHECK_NOFIX( - throw_exception( - thread, vmSymbols::java_lang_NullPointerException())); - // NB all oops trashed! - assert(HAS_PENDING_EXCEPTION, "should do"); - return; - } - if (entry_kind != MethodHandles::_invokespecial_mh) { - intptr_t index = java_lang_invoke_DirectMethodHandle::vmindex(method_handle); - instanceKlass* rcvrKlass = - (instanceKlass *) receiver->klass()->klass_part(); - if (entry_kind == MethodHandles::_invokevirtual_mh) { - method = (methodOop) rcvrKlass->start_of_vtable()[index]; - } - else { - oop iclass = java_lang_invoke_MethodHandle::vmtarget(method_handle); - itableOffsetEntry* ki = - (itableOffsetEntry *) rcvrKlass->start_of_itable(); - int i, length = rcvrKlass->itable_length(); - for (i = 0; i < length; i++, ki++ ) { - if (ki->interface_klass() == iclass) - break; - } - if (i == length) { - stack->set_sp(calculate_unwind_sp(stack, method_handle)); - CALL_VM_NOCHECK_NOFIX( - throw_exception( - thread, vmSymbols::java_lang_IncompatibleClassChangeError())); - // NB all oops trashed! - assert(HAS_PENDING_EXCEPTION, "should do"); - return; - } - itableMethodEntry* im = ki->first_method_entry(receiver->klass()); - method = im[index].method(); - if (method == NULL) { - stack->set_sp(calculate_unwind_sp(stack, method_handle)); - CALL_VM_NOCHECK_NOFIX( - throw_exception( - thread, vmSymbols::java_lang_AbstractMethodError())); - // NB all oops trashed! - assert(HAS_PENDING_EXCEPTION, "should do"); - return; - } - } - } - } - direct_to_method = true; - break; - - case MethodHandles::_bound_ref_direct_mh: - case MethodHandles::_bound_int_direct_mh: - case MethodHandles::_bound_long_direct_mh: - direct_to_method = true; - // fall through - case MethodHandles::_bound_ref_mh: - case MethodHandles::_bound_int_mh: - case MethodHandles::_bound_long_mh: - { - BasicType arg_type = T_ILLEGAL; - int arg_mask = -1; - int arg_slots = -1; - MethodHandles::get_ek_bound_mh_info( - entry_kind, arg_type, arg_mask, arg_slots); - int arg_slot = - java_lang_invoke_BoundMethodHandle::vmargslot(method_handle); - - // Create the new slot(s) - intptr_t *unwind_sp = calculate_unwind_sp(stack, method_handle); - insert_vmslots(arg_slot, arg_slots, THREAD); - if (HAS_PENDING_EXCEPTION) { - // all oops trashed - stack->set_sp(unwind_sp); - return; - } - vmslots = stack->sp(); - - // Store bound argument into new stack slot - oop arg = java_lang_invoke_BoundMethodHandle::argument(method_handle); - if (arg_type == T_OBJECT) { - assert(arg_slots == 1, "should be"); - SET_VMSLOTS_OBJECT(arg, arg_slot); - } - else { - jvalue arg_value; - arg_type = java_lang_boxing_object::get_value(arg, &arg_value); - switch (arg_type) { - case T_BOOLEAN: - SET_VMSLOTS_INT(arg_value.z, arg_slot); - break; - case T_CHAR: - SET_VMSLOTS_INT(arg_value.c, arg_slot); - break; - case T_BYTE: - SET_VMSLOTS_INT(arg_value.b, arg_slot); - break; - case T_SHORT: - SET_VMSLOTS_INT(arg_value.s, arg_slot); - break; - case T_INT: - SET_VMSLOTS_INT(arg_value.i, arg_slot); - break; - case T_FLOAT: - SET_VMSLOTS_FLOAT(arg_value.f, arg_slot); - break; - case T_LONG: - SET_VMSLOTS_LONG(arg_value.j, arg_slot + 1); - break; - case T_DOUBLE: - SET_VMSLOTS_DOUBLE(arg_value.d, arg_slot + 1); - break; - default: - tty->print_cr("unhandled type %s", type2name(arg_type)); - ShouldNotReachHere(); - } - } - } - break; - - case MethodHandles::_adapter_retype_only: - case MethodHandles::_adapter_retype_raw: - src_rtype = result_type_of_handle( - java_lang_invoke_MethodHandle::vmtarget(method_handle)); - dst_rtype = result_type_of_handle(method_handle); - break; - - case MethodHandles::_adapter_check_cast: - { - int arg_slot = - java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle); - oop arg = VMSLOTS_OBJECT(arg_slot); - if (arg != NULL) { - klassOop objKlassOop = arg->klass(); - klassOop klassOf = java_lang_Class::as_klassOop( - java_lang_invoke_AdapterMethodHandle::argument(method_handle)); - - if (objKlassOop != klassOf && - !objKlassOop->klass_part()->is_subtype_of(klassOf)) { - ResourceMark rm(THREAD); - const char* objName = Klass::cast(objKlassOop)->external_name(); - const char* klassName = Klass::cast(klassOf)->external_name(); - char* message = SharedRuntime::generate_class_cast_message( - objName, klassName); - - stack->set_sp(calculate_unwind_sp(stack, method_handle)); - CALL_VM_NOCHECK_NOFIX( - throw_exception( - thread, vmSymbols::java_lang_ClassCastException(), message)); - // NB all oops trashed! - assert(HAS_PENDING_EXCEPTION, "should do"); - return; - } - } - } - break; - - case MethodHandles::_adapter_dup_args: - { - int arg_slot = - java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle); - int conv = - java_lang_invoke_AdapterMethodHandle::conversion(method_handle); - int num_slots = -MethodHandles::adapter_conversion_stack_move(conv); - assert(num_slots > 0, "should be"); - - // Create the new slot(s) - intptr_t *unwind_sp = calculate_unwind_sp(stack, method_handle); - stack->overflow_check(num_slots, THREAD); - if (HAS_PENDING_EXCEPTION) { - // all oops trashed - stack->set_sp(unwind_sp); - return; - } - - // Duplicate the arguments - for (int i = num_slots - 1; i >= 0; i--) - stack->push(*VMSLOTS_SLOT(arg_slot + i)); - - vmslots = stack->sp(); // unused, but let the compiler figure that out - } - break; - - case MethodHandles::_adapter_drop_args: - { - int arg_slot = - java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle); - int conv = - java_lang_invoke_AdapterMethodHandle::conversion(method_handle); - int num_slots = MethodHandles::adapter_conversion_stack_move(conv); - assert(num_slots > 0, "should be"); - - remove_vmslots(arg_slot, num_slots, THREAD); // doesn't trap - vmslots = stack->sp(); // unused, but let the compiler figure that out - } - break; - - case MethodHandles::_adapter_opt_swap_1: - case MethodHandles::_adapter_opt_swap_2: - case MethodHandles::_adapter_opt_rot_1_up: - case MethodHandles::_adapter_opt_rot_1_down: - case MethodHandles::_adapter_opt_rot_2_up: - case MethodHandles::_adapter_opt_rot_2_down: - { - int arg1 = - java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle); - int conv = - java_lang_invoke_AdapterMethodHandle::conversion(method_handle); - int arg2 = MethodHandles::adapter_conversion_vminfo(conv); - - int swap_bytes = 0, rotate = 0; - MethodHandles::get_ek_adapter_opt_swap_rot_info( - entry_kind, swap_bytes, rotate); - int swap_slots = swap_bytes >> LogBytesPerWord; - - intptr_t tmp; - switch (rotate) { - case 0: // swap - for (int i = 0; i < swap_slots; i++) { - tmp = *VMSLOTS_SLOT(arg1 + i); - SET_VMSLOTS_SLOT(VMSLOTS_SLOT(arg2 + i), arg1 + i); - SET_VMSLOTS_SLOT(&tmp, arg2 + i); - } - break; - - case 1: // up - assert(arg1 - swap_slots > arg2, "should be"); - - tmp = *VMSLOTS_SLOT(arg1); - for (int i = arg1 - swap_slots; i >= arg2; i--) - SET_VMSLOTS_SLOT(VMSLOTS_SLOT(i), i + swap_slots); - SET_VMSLOTS_SLOT(&tmp, arg2); - - break; - - case -1: // down - assert(arg2 - swap_slots > arg1, "should be"); - - tmp = *VMSLOTS_SLOT(arg1); - for (int i = arg1 + swap_slots; i <= arg2; i++) - SET_VMSLOTS_SLOT(VMSLOTS_SLOT(i), i - swap_slots); - SET_VMSLOTS_SLOT(&tmp, arg2); - break; - - default: - ShouldNotReachHere(); - } - } - break; - - case MethodHandles::_adapter_opt_i2l: - { - int arg_slot = - java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle); - int arg = VMSLOTS_INT(arg_slot); - intptr_t *unwind_sp = calculate_unwind_sp(stack, method_handle); - insert_vmslots(arg_slot, 1, THREAD); - if (HAS_PENDING_EXCEPTION) { - // all oops trashed - stack->set_sp(unwind_sp); - return; - } - vmslots = stack->sp(); - arg_slot++; - SET_VMSLOTS_LONG(arg, arg_slot); - } - break; - - case MethodHandles::_adapter_opt_unboxi: - case MethodHandles::_adapter_opt_unboxl: - { - int arg_slot = - java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle); - oop arg = VMSLOTS_OBJECT(arg_slot); - jvalue arg_value; - if (arg == NULL) { - // queue a nullpointer exception for the caller - stack->set_sp(calculate_unwind_sp(stack, method_handle)); - CALL_VM_NOCHECK_NOFIX( - throw_exception( - thread, vmSymbols::java_lang_NullPointerException())); - // NB all oops trashed! - assert(HAS_PENDING_EXCEPTION, "should do"); - return; - } - BasicType arg_type = java_lang_boxing_object::get_value(arg, &arg_value); - if (arg_type == T_LONG || arg_type == T_DOUBLE) { - intptr_t *unwind_sp = calculate_unwind_sp(stack, method_handle); - insert_vmslots(arg_slot, 1, THREAD); - if (HAS_PENDING_EXCEPTION) { - // all oops trashed - stack->set_sp(unwind_sp); - return; - } - vmslots = stack->sp(); - arg_slot++; - } - switch (arg_type) { - case T_BOOLEAN: - SET_VMSLOTS_INT(arg_value.z, arg_slot); - break; - case T_CHAR: - SET_VMSLOTS_INT(arg_value.c, arg_slot); - break; - case T_BYTE: - SET_VMSLOTS_INT(arg_value.b, arg_slot); - break; - case T_SHORT: - SET_VMSLOTS_INT(arg_value.s, arg_slot); - break; - case T_INT: - SET_VMSLOTS_INT(arg_value.i, arg_slot); - break; - case T_FLOAT: - SET_VMSLOTS_FLOAT(arg_value.f, arg_slot); - break; - case T_LONG: - SET_VMSLOTS_LONG(arg_value.j, arg_slot); - break; - case T_DOUBLE: - SET_VMSLOTS_DOUBLE(arg_value.d, arg_slot); - break; - default: - tty->print_cr("unhandled type %s", type2name(arg_type)); - ShouldNotReachHere(); - } - } - break; - - default: - tty->print_cr("unhandled entry_kind %s", - MethodHandles::entry_name(entry_kind)); - ShouldNotReachHere(); - } - - // Continue along the chain - if (direct_to_method) { - if (method == NULL) { - method = - (methodOop) java_lang_invoke_MethodHandle::vmtarget(method_handle); - } - address entry_point = method->from_interpreted_entry(); - Interpreter::invoke_method(method, entry_point, THREAD); - } - else { - process_method_handle( - java_lang_invoke_MethodHandle::vmtarget(method_handle), THREAD); - } - // NB all oops now trashed - - // Adapt the result type, if necessary - if (src_rtype != dst_rtype && !HAS_PENDING_EXCEPTION) { - switch (dst_rtype) { - case T_VOID: - for (int i = 0; i < type2size[src_rtype]; i++) - stack->pop(); - return; - - case T_INT: - switch (src_rtype) { - case T_VOID: - stack->overflow_check(1, CHECK); - stack->push(0); - return; - - case T_BOOLEAN: - case T_CHAR: - case T_BYTE: - case T_SHORT: - return; - } - // INT results sometimes need narrowing - case T_BOOLEAN: - case T_CHAR: - case T_BYTE: - case T_SHORT: - switch (src_rtype) { - case T_INT: - return; - } - } - - tty->print_cr("unhandled conversion:"); - tty->print_cr("src_rtype = %s", type2name(src_rtype)); - tty->print_cr("dst_rtype = %s", type2name(dst_rtype)); - ShouldNotReachHere(); - } -} - // The new slots will be inserted before slot insert_before. // Slots < insert_before will have the same slot number after the insert. // Slots >= insert_before will become old_slot + num_slots. @@ -1380,10 +851,6 @@ entry_point = ((InterpreterGenerator*) this)->generate_abstract_entry(); break; - case Interpreter::method_handle: - entry_point = ((InterpreterGenerator*) this)->generate_method_handle_entry(); - break; - case Interpreter::java_lang_math_sin: case Interpreter::java_lang_math_cos: case Interpreter::java_lang_math_tan: @@ -1391,6 +858,8 @@ case Interpreter::java_lang_math_log: case Interpreter::java_lang_math_log10: case Interpreter::java_lang_math_sqrt: + case Interpreter::java_lang_math_pow: + case Interpreter::java_lang_math_exp: entry_point = ((InterpreterGenerator*) this)->generate_math_entry(kind); break;
--- a/src/cpu/zero/vm/cppInterpreter_zero.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/cpu/zero/vm/cppInterpreter_zero.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008, 2010, 2011 Red Hat, Inc. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ static int native_entry(methodOop method, intptr_t UNUSED, TRAPS); static int accessor_entry(methodOop method, intptr_t UNUSED, TRAPS); static int empty_entry(methodOop method, intptr_t UNUSED, TRAPS); - static int method_handle_entry(methodOop method, intptr_t UNUSED, TRAPS); public: // Main loop of normal_entry @@ -44,7 +43,6 @@ private: // Helpers for method_handle_entry - static void process_method_handle(oop method_handle, TRAPS); static void insert_vmslots(int insert_before, int num_slots, TRAPS); static void remove_vmslots(int first_slot, int num_slots, TRAPS); static BasicType result_type_of_handle(oop method_handle);
--- a/src/cpu/zero/vm/frame_zero.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/cpu/zero/vm/frame_zero.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -351,7 +351,7 @@ switch (offset) { case pc_off: strncpy(fieldbuf, "pc", buflen); - if (method()->is_oop()) { + if (method()->is_method()) { nmethod *code = method()->code(); if (code && code->pc_desc_at(pc())) { SimpleScopeDesc ssd(code, pc()); @@ -367,7 +367,7 @@ case method_off: strncpy(fieldbuf, "method", buflen); - if (method()->is_oop()) { + if (method()->is_method()) { method()->name_and_sig_as_C_string(valuebuf, buflen); } return; @@ -378,7 +378,7 @@ } // Variable part - if (method()->is_oop()) { + if (method()->is_method()) { identify_vp_word(frame_index, addr_of_word(offset), addr_of_word(header_words + 1), unextended_sp() + method()->max_stack(), @@ -430,4 +430,3 @@ // unused... but returns fp() to minimize changes introduced by 7087445 return fp(); } -
--- a/src/cpu/zero/vm/frame_zero.inline.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/cpu/zero/vm/frame_zero.inline.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,8 @@ _deopt_state = unknown; } +inline address frame::sender_pc() const { ShouldNotCallThis(); } + inline frame::frame(ZeroFrame* zf, intptr_t* sp) { _zeroframe = zf; _sp = sp;
--- a/src/cpu/zero/vm/methodHandles_zero.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/cpu/zero/vm/methodHandles_zero.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009, 2010, 2011 Red Hat, Inc. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2013, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,26 +24,159 @@ */ #include "precompiled.hpp" +#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreter.hpp" #include "memory/allocation.inline.hpp" #include "prims/methodHandles.hpp" -int MethodHandles::adapter_conversion_ops_supported_mask() { - return ((1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_ONLY) - |(1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW) - |(1<<java_lang_invoke_AdapterMethodHandle::OP_CHECK_CAST) - |(1<<java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_PRIM) - |(1<<java_lang_invoke_AdapterMethodHandle::OP_REF_TO_PRIM) - |(1<<java_lang_invoke_AdapterMethodHandle::OP_SWAP_ARGS) - |(1<<java_lang_invoke_AdapterMethodHandle::OP_ROT_ARGS) - |(1<<java_lang_invoke_AdapterMethodHandle::OP_DUP_ARGS) - |(1<<java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS) - //|(1<<java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG! - ); - // FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS. +void MethodHandles::invoke_target(methodOop method, TRAPS) { + + JavaThread *thread = (JavaThread *) THREAD; + ZeroStack *stack = thread->zero_stack(); + InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame(); + interpreterState istate = frame->interpreter_state(); + + // Trim back the stack to put the parameters at the top + stack->set_sp(istate->stack() + 1); + + Interpreter::invoke_method(method, method->from_interpreted_entry(), THREAD); + + // Convert the result + istate->set_stack(stack->sp() - 1); + +} + +oop MethodHandles::popFromStack(TRAPS) { + + JavaThread *thread = (JavaThread *) THREAD; + InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame(); + interpreterState istate = frame->interpreter_state(); + intptr_t* topOfStack = istate->stack(); + + oop top = STACK_OBJECT(-1); + MORE_STACK(-1); + istate->set_stack(topOfStack); + + return top; + +} + +int MethodHandles::method_handle_entry_invokeBasic(methodOop method, intptr_t UNUSED, TRAPS) { + + JavaThread *thread = (JavaThread *) THREAD; + InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame(); + interpreterState istate = frame->interpreter_state(); + intptr_t* topOfStack = istate->stack(); + + // 'this' is a MethodHandle. We resolve the target method by accessing this.form.vmentry.vmtarget. + int numArgs = method->size_of_parameters(); + oop lform1 = java_lang_invoke_MethodHandle::form(STACK_OBJECT(-numArgs)); // this.form + oop vmEntry1 = java_lang_invoke_LambdaForm::vmentry(lform1); + methodOop vmtarget = (methodOop) java_lang_invoke_MemberName::vmtarget(vmEntry1); + + invoke_target(vmtarget, THREAD); + + // No deoptimized frames on the stack + return 0; +} + +int MethodHandles::method_handle_entry_linkToStaticOrSpecial(methodOop method, intptr_t UNUSED, TRAPS) { + + // Pop appendix argument from stack. This is a MemberName which we resolve to the + // target method. + oop vmentry = popFromStack(THREAD); + + methodOop vmtarget = (methodOop) java_lang_invoke_MemberName::vmtarget(vmentry); + + invoke_target(vmtarget, THREAD); + + return 0; } -void MethodHandles::generate_method_handle_stub(MacroAssembler* masm, - MethodHandles::EntryKind ek) { - init_entry(ek, (MethodHandleEntry *) ek); +int MethodHandles::method_handle_entry_linkToInterface(methodOop method, intptr_t UNUSED, TRAPS) { + JavaThread *thread = (JavaThread *) THREAD; + InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame(); + interpreterState istate = frame->interpreter_state(); + + // Pop appendix argument from stack. This is a MemberName which we resolve to the + // target method. + oop vmentry = popFromStack(THREAD); + intptr_t* topOfStack = istate->stack(); + + // Resolve target method by looking up in the receiver object's itable. + klassOop clazz = java_lang_Class::as_klassOop(java_lang_invoke_MemberName::clazz(vmentry)); + intptr_t vmindex = java_lang_invoke_MemberName::vmindex(vmentry); + methodOop target = (methodOop) java_lang_invoke_MemberName::vmtarget(vmentry); + + int numArgs = target->size_of_parameters(); + oop recv = STACK_OBJECT(-numArgs); + + instanceKlass* recvKlass = (instanceKlass *) recv->klass()->klass_part(); + itableOffsetEntry* ki = (itableOffsetEntry*) recvKlass->start_of_itable(); + int i; + for ( i = 0 ; i < recvKlass->itable_length() ; i++, ki++ ) { + if (ki->interface_klass() == clazz) break; + } + + itableMethodEntry* im = ki->first_method_entry(recv->klass()); + methodOop vmtarget = im[vmindex].method(); + + invoke_target(vmtarget, THREAD); + + return 0; } + +int MethodHandles::method_handle_entry_linkToVirtual(methodOop method, intptr_t UNUSED, TRAPS) { + JavaThread *thread = (JavaThread *) THREAD; + + InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame(); + interpreterState istate = frame->interpreter_state(); + + // Pop appendix argument from stack. This is a MemberName which we resolve to the + // target method. + oop vmentry = popFromStack(THREAD); + intptr_t* topOfStack = istate->stack(); + + // Resolve target method by looking up in the receiver object's vtable. + intptr_t vmindex = java_lang_invoke_MemberName::vmindex(vmentry); + methodOop target = (methodOop) java_lang_invoke_MemberName::vmtarget(vmentry); + int numArgs = target->size_of_parameters(); + oop recv = STACK_OBJECT(-numArgs); + instanceKlass* recvKlass_part = (instanceKlass *) recv->klass()->klass_part(); + + klassVtable* vtable = recvKlass_part->vtable(); + methodOop vmtarget = vtable->method_at(vmindex); + + invoke_target(vmtarget, THREAD); + + return 0; +} + +int MethodHandles::method_handle_entry_invalid(methodOop method, intptr_t UNUSED, TRAPS) { + ShouldNotReachHere(); + return 0; +} + +address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* masm, + vmIntrinsics::ID iid) { + switch (iid) { + case vmIntrinsics::_invokeGeneric: + case vmIntrinsics::_compiledLambdaForm: + // Perhaps surprisingly, the symbolic references visible to Java are not directly used. + // They are linked to Java-generated adapters via MethodHandleNatives.linkMethod. + // They all allow an appendix argument. + return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invalid); + case vmIntrinsics::_invokeBasic: + return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invokeBasic); + case vmIntrinsics::_linkToStatic: + case vmIntrinsics::_linkToSpecial: + return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToStaticOrSpecial); + case vmIntrinsics::_linkToInterface: + return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToInterface); + case vmIntrinsics::_linkToVirtual: + return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToVirtual); + default: + ShouldNotReachHere(); + return NULL; + } +}
--- a/src/cpu/zero/vm/methodHandles_zero.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/cpu/zero/vm/methodHandles_zero.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Red Hat, Inc. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,14 @@ // Adapters enum /* platform_dependent_constants */ { - adapter_code_size = 0 + adapter_code_size = sizeof(ZeroEntry) * (Interpreter::method_handle_invoke_LAST - Interpreter::method_handle_invoke_FIRST + 1) }; +private: + static oop popFromStack(TRAPS); + static void invoke_target(methodOop method, TRAPS); + static int method_handle_entry_invokeBasic(methodOop method, intptr_t UNUSED, TRAPS); + static int method_handle_entry_linkToStaticOrSpecial(methodOop method, intptr_t UNUSED, TRAPS); + static int method_handle_entry_linkToVirtual(methodOop method, intptr_t UNUSED, TRAPS); + static int method_handle_entry_linkToInterface(methodOop method, intptr_t UNUSED, TRAPS); + static int method_handle_entry_invalid(methodOop method, intptr_t UNUSED, TRAPS);
--- a/src/cpu/zero/vm/register_zero.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/cpu/zero/vm/register_zero.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007 Red Hat, Inc. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -114,5 +114,8 @@ }; CONSTANT_REGISTER_DECLARATION(Register, noreg, (-1)); +#ifndef DONT_USE_REGISTER_DEFINES +#define noreg ((Register)(noreg_RegisterEnumValue)) +#endif #endif // CPU_ZERO_VM_REGISTER_ZERO_HPP
--- a/src/cpu/zero/vm/sharedRuntime_zero.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/cpu/zero/vm/sharedRuntime_zero.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2013, Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,6 +35,7 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/vframeArray.hpp" #include "vmreg_zero.inline.hpp" + #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif @@ -47,6 +48,12 @@ #endif + +static address zero_null_code_stub() { + address start = ShouldNotCallThisStub(); + return start; +} + int SharedRuntime::java_calling_convention(const BasicType *sig_bt, VMRegPair *regs, int total_args_passed, @@ -63,16 +70,14 @@ AdapterFingerPrint *fingerprint) { return AdapterHandlerLibrary::new_entry( fingerprint, - ShouldNotCallThisStub(), - ShouldNotCallThisStub(), - ShouldNotCallThisStub()); + CAST_FROM_FN_PTR(address,zero_null_code_stub), + CAST_FROM_FN_PTR(address,zero_null_code_stub), + CAST_FROM_FN_PTR(address,zero_null_code_stub)); } nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, methodHandle method, int compile_id, - int total_args_passed, - int max_arg, BasicType *sig_bt, VMRegPair *regs, BasicType ret_type) { @@ -96,19 +101,22 @@ ShouldNotCallThis(); } +JRT_LEAF(void, zero_stub()) + ShouldNotCallThis(); +JRT_END + + static RuntimeStub* generate_empty_runtime_stub(const char* name) { CodeBuffer buffer(name, 0, 0); return RuntimeStub::new_runtime_stub(name, &buffer, 0, 0, NULL, false); } static SafepointBlob* generate_empty_safepoint_blob() { - CodeBuffer buffer("handler_blob", 0, 0); - return SafepointBlob::create(&buffer, NULL, 0); + return CAST_FROM_FN_PTR(SafepointBlob*,zero_stub); } static DeoptimizationBlob* generate_empty_deopt_blob() { - CodeBuffer buffer("handler_blob", 0, 0); - return DeoptimizationBlob::create(&buffer, NULL, 0, 0, 0, 0); + return CAST_FROM_FN_PTR(DeoptimizationBlob*,zero_stub); } @@ -116,7 +124,7 @@ _deopt_blob = generate_empty_deopt_blob(); } -SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause_return) { +SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_type) { return generate_empty_safepoint_blob(); } @@ -124,6 +132,7 @@ return generate_empty_runtime_stub("resolve_blob"); } + int SharedRuntime::c_calling_convention(const BasicType *sig_bt, VMRegPair *regs, int total_args_passed) {
--- a/src/os/bsd/vm/os_bsd.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/os/bsd/vm/os_bsd.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -336,29 +336,32 @@ int mib[2]; size_t len; int cpu_val; - u_long mem_val; + julong mem_val; /* get processors count via hw.ncpus sysctl */ mib[0] = CTL_HW; mib[1] = HW_NCPU; len = sizeof(cpu_val); if (sysctl(mib, 2, &cpu_val, &len, NULL, 0) != -1 && cpu_val >= 1) { + assert(len == sizeof(cpu_val), "unexpected data size"); set_processor_count(cpu_val); } else { set_processor_count(1); // fallback } - /* get physical memory via hw.usermem sysctl (hw.usermem is used - * instead of hw.physmem because we need size of allocatable memory + /* get physical memory via hw.memsize sysctl (hw.memsize is used + * since it returns a 64 bit value) */ mib[0] = CTL_HW; - mib[1] = HW_USERMEM; + mib[1] = HW_MEMSIZE; len = sizeof(mem_val); - if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1) + if (sysctl(mib, 2, &mem_val, &len, NULL, 0) != -1) { + assert(len == sizeof(mem_val), "unexpected data size"); _physical_memory = mem_val; - else + } else { _physical_memory = 256*1024*1024; // fallback (XXXBSD?) + } #ifdef __OpenBSD__ {
--- a/src/os/solaris/vm/os_solaris.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/os/solaris/vm/os_solaris.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -5981,12 +5981,9 @@ } } -// Just to get the Kernel build to link on solaris for testing. - extern "C" { class ASGCT_CallTrace; -void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) - KERNEL_RETURN; +void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext); }
--- a/src/os/windows/vm/decoder_windows.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/os/windows/vm/decoder_windows.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -49,7 +49,7 @@ pfn_SymSetOptions _pfnSymSetOptions = (pfn_SymSetOptions)::GetProcAddress(handle, "SymSetOptions"); pfn_SymInitialize _pfnSymInitialize = (pfn_SymInitialize)::GetProcAddress(handle, "SymInitialize"); _pfnSymGetSymFromAddr64 = (pfn_SymGetSymFromAddr64)::GetProcAddress(handle, "SymGetSymFromAddr64"); - _pfnUndecorateSymbolName = (pfn_UndecorateSymbolName)GetProcAddress(handle, "UnDecorateSymbolName"); + _pfnUndecorateSymbolName = (pfn_UndecorateSymbolName)::GetProcAddress(handle, "UnDecorateSymbolName"); if (_pfnSymSetOptions == NULL || _pfnSymInitialize == NULL || _pfnSymGetSymFromAddr64 == NULL) { _pfnSymGetSymFromAddr64 = NULL; @@ -60,8 +60,9 @@ return; } - _pfnSymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS); - if (!_pfnSymInitialize(GetCurrentProcess(), NULL, TRUE)) { + HANDLE hProcess = ::GetCurrentProcess(); + _pfnSymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS | SYMOPT_EXACT_SYMBOLS); + if (!_pfnSymInitialize(hProcess, NULL, TRUE)) { _pfnSymGetSymFromAddr64 = NULL; _pfnUndecorateSymbolName = NULL; ::FreeLibrary(handle); @@ -70,6 +71,77 @@ return; } + // set pdb search paths + pfn_SymSetSearchPath _pfn_SymSetSearchPath = + (pfn_SymSetSearchPath)::GetProcAddress(handle, "SymSetSearchPath"); + pfn_SymGetSearchPath _pfn_SymGetSearchPath = + (pfn_SymGetSearchPath)::GetProcAddress(handle, "SymGetSearchPath"); + if (_pfn_SymSetSearchPath != NULL && _pfn_SymGetSearchPath != NULL) { + char paths[MAX_PATH]; + int len = sizeof(paths); + if (!_pfn_SymGetSearchPath(hProcess, paths, len)) { + paths[0] = '\0'; + } else { + // available spaces in path buffer + len -= (int)strlen(paths); + } + + char tmp_path[MAX_PATH]; + DWORD dwSize; + HMODULE hJVM = ::GetModuleHandle("jvm.dll"); + tmp_path[0] = '\0'; + // append the path where jvm.dll is located + if (hJVM != NULL && (dwSize = ::GetModuleFileName(hJVM, tmp_path, sizeof(tmp_path))) > 0) { + while (dwSize > 0 && tmp_path[dwSize] != '\\') { + dwSize --; + } + + tmp_path[dwSize] = '\0'; + + if (dwSize > 0 && len > (int)dwSize + 1) { + strncat(paths, os::path_separator(), 1); + strncat(paths, tmp_path, dwSize); + len -= dwSize + 1; + } + } + + // append $JRE/bin. Arguments::get_java_home actually returns $JRE + // path + char *p = Arguments::get_java_home(); + assert(p != NULL, "empty java home"); + size_t java_home_len = strlen(p); + if (len > (int)java_home_len + 5) { + strncat(paths, os::path_separator(), 1); + strncat(paths, p, java_home_len); + strncat(paths, "\\bin", 4); + len -= (int)(java_home_len + 5); + } + + // append $JDK/bin path if it exists + assert(java_home_len < MAX_PATH, "Invalid path length"); + // assume $JRE is under $JDK, construct $JDK/bin path and + // see if it exists or not + if (strncmp(&p[java_home_len - 3], "jre", 3) == 0) { + strncpy(tmp_path, p, java_home_len - 3); + tmp_path[java_home_len - 3] = '\0'; + strncat(tmp_path, "bin", 3); + + // if the directory exists + DWORD dwAttrib = GetFileAttributes(tmp_path); + if (dwAttrib != INVALID_FILE_ATTRIBUTES && + (dwAttrib & FILE_ATTRIBUTE_DIRECTORY)) { + // tmp_path should have the same length as java_home_len, since we only + // replaced 'jre' with 'bin' + if (len > (int)java_home_len + 1) { + strncat(paths, os::path_separator(), 1); + strncat(paths, tmp_path, java_home_len); + } + } + } + + _pfn_SymSetSearchPath(hProcess, paths); + } + // find out if jvm.dll contains private symbols, by decoding // current function and comparing the result address addr = (address)Decoder::demangle;
--- a/src/os/windows/vm/decoder_windows.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/os/windows/vm/decoder_windows.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -35,6 +35,8 @@ typedef BOOL (WINAPI *pfn_SymInitialize)(HANDLE, PCTSTR, BOOL); typedef BOOL (WINAPI *pfn_SymGetSymFromAddr64)(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64); typedef DWORD (WINAPI *pfn_UndecorateSymbolName)(const char*, char*, DWORD, DWORD); +typedef BOOL (WINAPI *pfn_SymSetSearchPath)(HANDLE, PCTSTR); +typedef BOOL (WINAPI *pfn_SymGetSearchPath)(HANDLE, PTSTR, int); class WindowsDecoder : public AbstractDecoder {
--- a/src/os/windows/vm/os_windows.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/os/windows/vm/os_windows.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1888,8 +1888,22 @@ } return TRUE; break; + case CTRL_LOGOFF_EVENT: { + // Don't terminate JVM if it is running in a non-interactive session, + // such as a service process. + USEROBJECTFLAGS flags; + HANDLE handle = GetProcessWindowStation(); + if (handle != NULL && + GetUserObjectInformation(handle, UOI_FLAGS, &flags, + sizeof( USEROBJECTFLAGS), NULL)) { + // If it is a non-interactive session, let next handler to deal + // with it. + if ((flags.dwFlags & WSF_VISIBLE) == 0) { + return FALSE; + } + } + } case CTRL_CLOSE_EVENT: - case CTRL_LOGOFF_EVENT: case CTRL_SHUTDOWN_EVENT: os::signal_raise(SIGTERM); return TRUE;
--- a/src/share/vm/asm/codeBuffer.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/asm/codeBuffer.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -674,7 +674,7 @@ } } - if (dest->blob() == NULL) { + if (dest->blob() == NULL && dest_filled != NULL) { // Destination is a final resting place, not just another buffer. // Normalize uninitialized bytes in the final padding. Copy::fill_to_bytes(dest_filled, dest_end - dest_filled,
--- a/src/share/vm/c1/c1_GraphBuilder.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/c1/c1_GraphBuilder.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -3223,7 +3223,12 @@ } if (try_inline_full(callee, holder_known, bc, receiver)) return true; - print_inlining(callee, _inline_bailout_msg, /*success*/ false); + + // Entire compilation could fail during try_inline_full call. + // In that case printing inlining decision info is useless. + if (!bailed_out()) + print_inlining(callee, _inline_bailout_msg, /*success*/ false); + return false; } @@ -3748,7 +3753,8 @@ push_scope(callee, cont); // the BlockListBuilder for the callee could have bailed out - CHECK_BAILOUT_(false); + if (bailed_out()) + return false; // Temporarily set up bytecode stream so we can append instructions // (only using the bci of this stream) @@ -3814,7 +3820,8 @@ iterate_all_blocks(callee_start_block == NULL); // If we bailed out during parsing, return immediately (this is bad news) - if (bailed_out()) return false; + if (bailed_out()) + return false; // iterate_all_blocks theoretically traverses in random order; in // practice, we have only traversed the continuation if we are @@ -3823,9 +3830,6 @@ !continuation()->is_set(BlockBegin::was_visited_flag), "continuation should not have been parsed yet if we created it"); - // If we bailed out during parsing, return immediately (this is bad news) - CHECK_BAILOUT_(false); - // At this point we are almost ready to return and resume parsing of // the caller back in the GraphBuilder. The only thing we want to do // first is an optimization: during parsing of the callee we @@ -4166,7 +4170,10 @@ else log->inline_success("receiver is statically known"); } else { - log->inline_fail(msg); + if (msg != NULL) + log->inline_fail(msg); + else + log->inline_fail("reason unknown"); } }
--- a/src/share/vm/ci/ciType.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/ci/ciType.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -64,6 +64,19 @@ } // ------------------------------------------------------------------ +// ciType::name +// +// Return the name of this type +const char* ciType::name() { + if (is_primitive_type()) { + return type2name(basic_type()); + } else { + assert(is_klass(), "must be"); + return as_klass()->name()->as_utf8(); + } +} + +// ------------------------------------------------------------------ // ciType::print_impl // // Implementation of the print method. @@ -77,7 +90,8 @@ // // Print the name of this type void ciType::print_name_on(outputStream* st) { - st->print(type2name(basic_type())); + ResourceMark rm; + st->print(name()); }
--- a/src/share/vm/ci/ciType.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/ci/ciType.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -79,6 +79,7 @@ bool is_type() { return true; } bool is_classless() const { return is_primitive_type(); } + const char* name(); virtual void print_name_on(outputStream* st); void print_name() { print_name_on(tty);
--- a/src/share/vm/classfile/systemDictionary.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/classfile/systemDictionary.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1238,66 +1238,6 @@ return ik; } -#ifdef KERNEL -// Some classes on the bootstrap class path haven't been installed on the -// system yet. Call the DownloadManager method to make them appear in the -// bootstrap class path and try again to load the named class. -// Note that with delegation class loaders all classes in another loader will -// first try to call this so it'd better be fast!! -static instanceKlassHandle download_and_retry_class_load( - Symbol* class_name, - TRAPS) { - - klassOop dlm = SystemDictionary::DownloadManager_klass(); - instanceKlassHandle nk; - - // If download manager class isn't loaded just return. - if (dlm == NULL) return nk; - - { HandleMark hm(THREAD); - ResourceMark rm(THREAD); - Handle s = java_lang_String::create_from_symbol(class_name, CHECK_(nk)); - Handle class_string = java_lang_String::externalize_classname(s, CHECK_(nk)); - - // return value - JavaValue result(T_OBJECT); - - // Call the DownloadManager. We assume that it has a lock because - // multiple classes could be not found and downloaded at the same time. - // class sun.misc.DownloadManager; - // public static String getBootClassPathEntryForClass(String className); - JavaCalls::call_static(&result, - KlassHandle(THREAD, dlm), - vmSymbols::getBootClassPathEntryForClass_name(), - vmSymbols::string_string_signature(), - class_string, - CHECK_(nk)); - - // Get result.string and add to bootclasspath - assert(result.get_type() == T_OBJECT, "just checking"); - oop obj = (oop) result.get_jobject(); - if (obj == NULL) { return nk; } - - Handle h_obj(THREAD, obj); - char* new_class_name = java_lang_String::as_platform_dependent_str(h_obj, - CHECK_(nk)); - - // lock the loader - // we use this lock because JVMTI does. - Handle loader_lock(THREAD, SystemDictionary::system_loader_lock()); - - ObjectLocker ol(loader_lock, THREAD); - // add the file to the bootclasspath - ClassLoader::update_class_path_entry_list(new_class_name, true); - } // end HandleMark - - if (TraceClassLoading) { - ClassLoader::print_bootclasspath(); - } - return ClassLoader::load_classfile(class_name, CHECK_(nk)); -} -#endif // KERNEL - instanceKlassHandle SystemDictionary::load_instance_class(Symbol* class_name, Handle class_loader, TRAPS) { instanceKlassHandle nh = instanceKlassHandle(); // null Handle @@ -1317,15 +1257,6 @@ k = ClassLoader::load_classfile(class_name, CHECK_(nh)); } -#ifdef KERNEL - // If the VM class loader has failed to load the class, call the - // DownloadManager class to make it magically appear on the classpath - // and try again. This is only configured with the Kernel VM. - if (k.is_null()) { - k = download_and_retry_class_load(class_name, CHECK_(nh)); - } -#endif // KERNEL - // find_or_define_instance_class may return a different instanceKlass if (!k.is_null()) { k = find_or_define_instance_class(class_name, class_loader, k, CHECK_(nh)); @@ -1877,13 +1808,7 @@ Symbol* symbol = vmSymbols::symbol_at((vmSymbols::SID)sid); klassOop* klassp = &_well_known_klasses[id]; bool must_load = (init_opt < SystemDictionary::Opt); - bool try_load = true; - if (init_opt == SystemDictionary::Opt_Kernel) { -#ifndef KERNEL - try_load = false; -#endif //KERNEL - } - if ((*klassp) == NULL && try_load) { + if ((*klassp) == NULL) { if (must_load) { (*klassp) = resolve_or_fail(symbol, true, CHECK_0); // load required class } else { @@ -1965,12 +1890,6 @@ //_box_klasses[T_OBJECT] = WK_KLASS(object_klass); //_box_klasses[T_ARRAY] = WK_KLASS(object_klass); -#ifdef KERNEL - if (DownloadManager_klass() == NULL) { - warning("Cannot find sun/jkernel/DownloadManager"); - } -#endif // KERNEL - { // Compute whether we should use loadClass or loadClassInternal when loading classes. methodOop method = instanceKlass::cast(ClassLoader_klass())->find_method(vmSymbols::loadClassInternal_name(), vmSymbols::string_class_signature()); _has_loadClassInternal = (method != NULL);
--- a/src/share/vm/classfile/systemDictionary.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/classfile/systemDictionary.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -166,8 +166,6 @@ /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \ \ - do_klass(DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel ) \ - \ do_klass(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt ) \ \ /* Preload boxing klasses */ \ @@ -211,7 +209,6 @@ Opt, // preload tried; NULL if not present Opt_Only_JDK14NewRef, // preload tried; use only with NewReflection Opt_Only_JDK15, // preload tried; use only with JDK1.5+ - Opt_Kernel, // preload tried only #ifdef KERNEL OPTION_LIMIT, CEIL_LG_OPTION_LIMIT = 4 // OPTION_LIMIT <= (1<<CEIL_LG_OPTION_LIMIT) }; @@ -399,7 +396,6 @@ static klassOop check_klass_Pre( klassOop k) { return check_klass(k); } static klassOop check_klass_Pre_JSR292(klassOop k) { return EnableInvokeDynamic ? check_klass(k) : k; } static klassOop check_klass_Opt( klassOop k) { return k; } - static klassOop check_klass_Opt_Kernel(klassOop k) { return k; } //== Opt static klassOop check_klass_Opt_Only_JDK15(klassOop k) { assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only"); return k;
--- a/src/share/vm/classfile/vmSymbols.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/classfile/vmSymbols.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -107,7 +107,6 @@ template(java_lang_Compiler, "java/lang/Compiler") \ template(sun_misc_Signal, "sun/misc/Signal") \ template(java_lang_AssertionStatusDirectives, "java/lang/AssertionStatusDirectives") \ - template(sun_jkernel_DownloadManager, "sun/jkernel/DownloadManager") \ template(getBootClassPathEntryForClass_name, "getBootClassPathEntryForClass") \ template(sun_misc_PostVMInitHook, "sun/misc/PostVMInitHook") \ template(sun_misc_Launcher_ExtClassLoader, "sun/misc/Launcher$ExtClassLoader") \
--- a/src/share/vm/interpreter/abstractInterpreter.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/interpreter/abstractInterpreter.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -320,6 +320,7 @@ void bang_stack_shadow_pages(bool native_call); void generate_all(); + void initialize_method_handle_entries(); public: AbstractInterpreterGenerator(StubQueue* _code);
--- a/src/share/vm/interpreter/bytecodeInterpreter.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -235,10 +235,6 @@ #endif #endif -// JavaStack Implementation -#define MORE_STACK(count) \ - (topOfStack -= ((count) * Interpreter::stackElementWords)) - #define UPDATE_PC(opsize) {pc += opsize; } /* @@ -575,7 +571,7 @@ /* 0xE0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, /* 0xE4 */ &&opc_default, &&opc_fast_aldc, &&opc_fast_aldc_w, &&opc_return_register_finalizer, -/* 0xE8 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, +/* 0xE8 */ &&opc_invokehandle,&&opc_default, &&opc_default, &&opc_default, /* 0xEC */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, /* 0xF0 */ &&opc_default, &&opc_default, &&opc_default, &&opc_default, @@ -2199,15 +2195,15 @@ ShouldNotReachHere(); } - int index = Bytes::get_native_u4(pc+1); + u4 index = Bytes::get_native_u4(pc+1); + ConstantPoolCacheEntry* cache = cp->secondary_entry_at(index); + oop result = cache->f1_as_instance(); // We are resolved if the f1 field contains a non-null object (CallSite, etc.) // This kind of CP cache entry does not need to match the flags byte, because // there is a 1-1 relation between bytecode type and CP entry type. assert(constantPoolCacheOopDesc::is_secondary_index(index), "incorrect format"); - ConstantPoolCacheEntry* cache = cp->secondary_entry_at(index); - oop result = cache->f1_as_instance(); - if (result == NULL) { + if (! cache->is_resolved((Bytecodes::Code) opcode)) { CALL_VM(InterpreterRuntime::resolve_invokedynamic(THREAD), handle_exception); result = cache->f1_as_instance(); @@ -2217,12 +2213,54 @@ oop method_handle = java_lang_invoke_CallSite::target(result); CHECK_NULL(method_handle); - istate->set_msg(call_method_handle); - istate->set_callee((methodOop) method_handle); + methodOop method = cache->f1_as_method(); + VERIFY_OOP(method); + + if (cache->has_appendix()) { + constantPoolOop constants = METHOD->constants(); + SET_STACK_OBJECT(cache->appendix_if_resolved(constants), 0); + MORE_STACK(1); + } + + istate->set_msg(call_method); + istate->set_callee(method); + istate->set_callee_entry_point(method->from_interpreted_entry()); istate->set_bcp_advance(5); UPDATE_PC_AND_RETURN(0); // I'll be back... } + CASE(_invokehandle): { + + if (!EnableInvokeDynamic) { + ShouldNotReachHere(); + } + + u2 index = Bytes::get_native_u2(pc+1); + ConstantPoolCacheEntry* cache = cp->entry_at(index); + + if (! cache->is_resolved((Bytecodes::Code) opcode)) { + CALL_VM(InterpreterRuntime::resolve_invokehandle(THREAD), + handle_exception); + cache = cp->entry_at(index); + } + + methodOop method = cache->f1_as_method(); + + VERIFY_OOP(method); + + if (cache->has_appendix()) { + constantPoolOop constants = METHOD->constants(); + SET_STACK_OBJECT(cache->appendix_if_resolved(constants), 0); + MORE_STACK(1); + } + + istate->set_msg(call_method); + istate->set_callee(method); + istate->set_callee_entry_point(method->from_interpreted_entry()); + istate->set_bcp_advance(3); + + UPDATE_PC_AND_RETURN(0); // I'll be back... + } CASE(_invokeinterface): { u2 index = Bytes::get_native_u2(pc+1);
--- a/src/share/vm/interpreter/bytecodeInterpreter.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/interpreter/bytecodeInterpreter.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,6 +50,10 @@ #ifdef CC_INTERP +// JavaStack Implementation +#define MORE_STACK(count) \ + (topOfStack -= ((count) * Interpreter::stackElementWords)) + // CVM definitions find hotspot equivalents... union VMJavaVal64 { @@ -107,7 +111,6 @@ rethrow_exception, // unwinding and throwing exception // requests to frame manager from C++ interpreter call_method, // request for new frame from interpreter, manager responds with method_entry - call_method_handle, // like the above, except the callee is a method handle return_from_method, // request from interpreter to unwind, manager responds with method_continue more_monitors, // need a new monitor throwing_exception, // unwind stack and rethrow
--- a/src/share/vm/interpreter/cppInterpreter.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/interpreter/cppInterpreter.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -117,7 +117,6 @@ method_entry(empty); method_entry(accessor); method_entry(abstract); - method_entry(method_handle); method_entry(java_lang_math_sin ); method_entry(java_lang_math_cos ); method_entry(java_lang_math_tan ); @@ -125,7 +124,12 @@ method_entry(java_lang_math_sqrt ); method_entry(java_lang_math_log ); method_entry(java_lang_math_log10 ); + method_entry(java_lang_math_pow ); + method_entry(java_lang_math_exp ); method_entry(java_lang_ref_reference_get); + + initialize_method_handle_entries(); + Interpreter::_native_entry_begin = Interpreter::code()->code_end(); method_entry(native); method_entry(native_synchronized);
--- a/src/share/vm/interpreter/interpreter.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/interpreter/interpreter.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -464,3 +464,11 @@ } } } + +void AbstractInterpreterGenerator::initialize_method_handle_entries() { + // method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate: + for (int i = Interpreter::method_handle_invoke_FIRST; i <= Interpreter::method_handle_invoke_LAST; i++) { + Interpreter::MethodKind kind = (Interpreter::MethodKind) i; + Interpreter::_entry_table[kind] = Interpreter::_entry_table[Interpreter::abstract]; + } +}
--- a/src/share/vm/interpreter/templateInterpreter.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/interpreter/templateInterpreter.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -373,11 +373,7 @@ method_entry(java_lang_math_pow ) method_entry(java_lang_ref_reference_get) - // method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate: - for (int i = Interpreter::method_handle_invoke_FIRST; i <= Interpreter::method_handle_invoke_LAST; i++) { - Interpreter::MethodKind kind = (Interpreter::MethodKind) i; - Interpreter::_entry_table[kind] = Interpreter::_entry_table[Interpreter::abstract]; - } + initialize_method_handle_entries(); // all native method kinds (must be one contiguous block) Interpreter::_native_entry_begin = Interpreter::code()->code_end();
--- a/src/share/vm/memory/compactingPermGenGen.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/memory/compactingPermGenGen.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -233,7 +233,7 @@ void verify(); // Serialization - static void initialize_oops() KERNEL_RETURN; + static void initialize_oops(); static void serialize_oops(SerializeOopClosure* soc); void serialize_bts(SerializeOopClosure* soc);
--- a/src/share/vm/memory/genCollectedHeap.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/memory/genCollectedHeap.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -549,7 +549,7 @@ virtual void gc_epilogue(bool full); public: - virtual void preload_and_dump(TRAPS) KERNEL_RETURN; + virtual void preload_and_dump(TRAPS); }; #endif // SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP
--- a/src/share/vm/memory/heapInspection.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/memory/heapInspection.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,8 +28,6 @@ #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" -#ifndef SERVICES_KERNEL - // HeapInspection @@ -129,12 +127,11 @@ void sort(); }; -#endif // SERVICES_KERNEL class HeapInspection : public AllStatic { public: - static void heap_inspection(outputStream* st, bool need_prologue) KERNEL_RETURN; - static void find_instances_at_safepoint(klassOop k, GrowableArray<oop>* result) KERNEL_RETURN; + static void heap_inspection(outputStream* st, bool need_prologue); + static void find_instances_at_safepoint(klassOop k, GrowableArray<oop>* result); }; #endif // SHARE_VM_MEMORY_HEAPINSPECTION_HPP
--- a/src/share/vm/oops/instanceKlass.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/oops/instanceKlass.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -168,6 +168,8 @@ #endif // ndef DTRACE_ENABLED +volatile int instanceKlass::_total_instanceKlass_count = 0; + bool instanceKlass::should_be_initialized() const { return !is_initialized(); } @@ -1947,6 +1949,9 @@ _constants->unreference_symbols(); if (_source_debug_extension != NULL) FREE_C_HEAP_ARRAY(char, _source_debug_extension, mtClass); + + assert(_total_instanceKlass_count >= 1, "Sanity check"); + Atomic::dec(&_total_instanceKlass_count); } void instanceKlass::set_source_file_name(Symbol* n) {
--- a/src/share/vm/oops/instanceKlass.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/oops/instanceKlass.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ #include "oops/klassOop.hpp" #include "oops/klassVtable.hpp" #include "oops/objArrayOop.hpp" +#include "runtime/atomic.hpp" #include "runtime/handles.hpp" #include "runtime/os.hpp" #include "utilities/accessFlags.hpp" @@ -154,6 +155,11 @@ oop* oop_block_beg() const { return adr_array_klasses(); } oop* oop_block_end() const { return adr_methods_default_annotations() + 1; } + static int number_of_instance_classes() { return _total_instanceKlass_count; } + + private: + static volatile int _total_instanceKlass_count; + protected: // // The oop block. See comment in klass.hpp before making changes.
--- a/src/share/vm/oops/instanceKlassKlass.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/oops/instanceKlassKlass.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,6 +49,7 @@ #include "memory/cardTableRS.hpp" #include "oops/oop.pcgc.inline.hpp" #endif +#include "runtime/atomic.hpp" klassOop instanceKlassKlass::create_klass(TRAPS) { instanceKlassKlass o; @@ -456,6 +457,8 @@ // To get verify to work - must be set to partial loaded before first GC point. k()->set_partially_loaded(); } + + Atomic::inc(&instanceKlass::_total_instanceKlass_count); return k(); }
--- a/src/share/vm/opto/callGenerator.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/opto/callGenerator.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -717,6 +717,7 @@ (input_not_const || !C->inlining_incrementally() || C->over_inlining_cutoff())) { return CallGenerator::for_mh_late_inline(caller, callee, input_not_const); } else { + // Out-of-line call. return CallGenerator::for_direct_call(callee); } } @@ -739,7 +740,7 @@ guarantee(!target->is_method_handle_intrinsic(), "should not happen"); // XXX remove const int vtable_index = methodOopDesc::invalid_vtable_index; CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS, true, true); - assert (!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); + assert(!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); if (cg != NULL && cg->is_inline()) return cg; } @@ -787,10 +788,25 @@ } } } - const int vtable_index = methodOopDesc::invalid_vtable_index; - const bool call_is_virtual = target->is_abstract(); // FIXME workaround - CallGenerator* cg = C->call_generator(target, vtable_index, call_is_virtual, jvms, true, PROB_ALWAYS, true, true); - assert (!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); + + // Try to get the most accurate receiver type + const bool is_virtual = (iid == vmIntrinsics::_linkToVirtual); + const bool is_virtual_or_interface = (is_virtual || iid == vmIntrinsics::_linkToInterface); + int vtable_index = methodOopDesc::invalid_vtable_index; + bool call_does_dispatch = false; + + if (is_virtual_or_interface) { + ciInstanceKlass* klass = target->holder(); + Node* receiver_node = kit.argument(0); + const TypeOopPtr* receiver_type = gvn.type(receiver_node)->isa_oopptr(); + // call_does_dispatch and vtable_index are out-parameters. They might be changed. + target = C->optimize_virtual_call(caller, jvms->bci(), klass, target, receiver_type, + is_virtual, + call_does_dispatch, vtable_index); // out-parameters + } + + CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, true, true); + assert(!cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); if (cg != NULL && cg->is_inline()) return cg; }
--- a/src/share/vm/opto/compile.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/opto/compile.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -691,7 +691,7 @@ PhaseGVN gvn(node_arena(), estimated_size); set_initial_gvn(&gvn); - if (PrintInlining) { + if (PrintInlining || PrintIntrinsics NOT_PRODUCT( || PrintOptoInlining)) { _print_inlining_list = new (comp_arena())GrowableArray<PrintInliningBuffer>(comp_arena(), 1, 1, PrintInliningBuffer()); } { // Scope for timing the parser @@ -2059,7 +2059,7 @@ } // (End scope of igvn; run destructor if necessary for asserts.) - dump_inlining(); + dump_inlining(); // A method with only infinite loops has no edges entering loops from root { NOT_PRODUCT( TracePhase t2("graphReshape", &_t_graphReshaping, TimeCompiler); ) @@ -3482,7 +3482,7 @@ } void Compile::dump_inlining() { - if (PrintInlining) { + if (PrintInlining || PrintIntrinsics NOT_PRODUCT( || PrintOptoInlining)) { // Print inlining message for candidates that we couldn't inline // for lack of space or non constant receiver for (int i = 0; i < _late_inlines.length(); i++) {
--- a/src/share/vm/opto/compile.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/opto/compile.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -74,6 +74,7 @@ class JVMState; class TypeData; class TypePtr; +class TypeOopPtr; class TypeFunc; class Unique_Node_List; class nmethod; @@ -753,9 +754,17 @@ // Decide how to build a call. // The profile factor is a discount to apply to this site's interp. profile. - CallGenerator* call_generator(ciMethod* call_method, int vtable_index, bool call_is_virtual, JVMState* jvms, bool allow_inline, float profile_factor, bool allow_intrinsics = true, bool delayed_forbidden = false); + CallGenerator* call_generator(ciMethod* call_method, int vtable_index, bool call_does_dispatch, JVMState* jvms, bool allow_inline, float profile_factor, bool allow_intrinsics = true, bool delayed_forbidden = false); bool should_delay_inlining(ciMethod* call_method, JVMState* jvms); + // Helper functions to identify inlining potential at call-site + ciMethod* optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass, + ciMethod* callee, const TypeOopPtr* receiver_type, + bool is_virtual, + bool &call_does_dispatch, int &vtable_index); + ciMethod* optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass, + ciMethod* callee, const TypeOopPtr* receiver_type); + // Report if there were too many traps at a current method and bci. // Report if a trap was recorded, and/or PerMethodTrapLimit was exceeded. // If there is no MDO at all, report no trap unless told to assume it.
--- a/src/share/vm/opto/doCall.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/opto/doCall.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -62,7 +62,7 @@ } } -CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool call_is_virtual, +CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool call_does_dispatch, JVMState* jvms, bool allow_inline, float prof_factor, bool allow_intrinsics, bool delayed_forbidden) { ciMethod* caller = jvms->method(); @@ -83,7 +83,7 @@ // See how many times this site has been invoked. int site_count = profile.count(); int receiver_count = -1; - if (call_is_virtual && UseTypeProfile && profile.has_receiver(0)) { + if (call_does_dispatch && UseTypeProfile && profile.has_receiver(0)) { // Receivers in the profile structure are ordered by call counts // so that the most called (major) receiver is profile.receiver(0). receiver_count = profile.receiver_count(0); @@ -95,7 +95,7 @@ int r2id = (rid != -1 && profile.has_receiver(1))? log->identify(profile.receiver(1)):-1; log->begin_elem("call method='%d' count='%d' prof_factor='%g'", log->identify(callee), site_count, prof_factor); - if (call_is_virtual) log->print(" virtual='1'"); + if (call_does_dispatch) log->print(" virtual='1'"); if (allow_inline) log->print(" inline='1'"); if (receiver_count >= 0) { log->print(" receiver='%d' receiver_count='%d'", rid, receiver_count); @@ -112,12 +112,12 @@ // We do this before the strict f.p. check below because the // intrinsics handle strict f.p. correctly. if (allow_inline && allow_intrinsics) { - CallGenerator* cg = find_intrinsic(callee, call_is_virtual); + CallGenerator* cg = find_intrinsic(callee, call_does_dispatch); if (cg != NULL) { if (cg->is_predicted()) { // Code without intrinsic but, hopefully, inlined. CallGenerator* inline_cg = this->call_generator(callee, - vtable_index, call_is_virtual, jvms, allow_inline, prof_factor, false); + vtable_index, call_does_dispatch, jvms, allow_inline, prof_factor, false); if (inline_cg != NULL) { cg = CallGenerator::for_predicted_intrinsic(cg, inline_cg); } @@ -132,7 +132,7 @@ // have bytecodes and so normal inlining fails. if (callee->is_method_handle_intrinsic()) { CallGenerator* cg = CallGenerator::for_method_handle_call(jvms, caller, callee, delayed_forbidden); - assert (cg == NULL || !delayed_forbidden || !cg->is_late_inline() || cg->is_mh_late_inline(), "unexpected CallGenerator"); + assert(cg == NULL || !delayed_forbidden || !cg->is_late_inline() || cg->is_mh_late_inline(), "unexpected CallGenerator"); return cg; } @@ -150,7 +150,7 @@ float expected_uses = past_uses; // Try inlining a bytecoded method: - if (!call_is_virtual) { + if (!call_does_dispatch) { InlineTree* ilt; if (UseOldInlining) { ilt = InlineTree::find_subtree_from_root(this->ilt(), jvms->caller(), jvms->method()); @@ -189,14 +189,14 @@ } else if (require_inline || !InlineWarmCalls) { return cg; } else { - CallGenerator* cold_cg = call_generator(callee, vtable_index, call_is_virtual, jvms, false, prof_factor); + CallGenerator* cold_cg = call_generator(callee, vtable_index, call_does_dispatch, jvms, false, prof_factor); return CallGenerator::for_warm_call(ci, cold_cg, cg); } } } // Try using the type profile. - if (call_is_virtual && site_count > 0 && receiver_count > 0) { + if (call_does_dispatch && site_count > 0 && receiver_count > 0) { // The major receiver's count >= TypeProfileMajorReceiverPercent of site_count. bool have_major_receiver = (100.*profile.receiver_prob(0) >= (float)TypeProfileMajorReceiverPercent); ciMethod* receiver_method = NULL; @@ -210,7 +210,7 @@ if (receiver_method != NULL) { // The single majority receiver sufficiently outweighs the minority. CallGenerator* hit_cg = this->call_generator(receiver_method, - vtable_index, !call_is_virtual, jvms, allow_inline, prof_factor); + vtable_index, !call_does_dispatch, jvms, allow_inline, prof_factor); if (hit_cg != NULL) { // Look up second receiver. CallGenerator* next_hit_cg = NULL; @@ -220,7 +220,7 @@ profile.receiver(1)); if (next_receiver_method != NULL) { next_hit_cg = this->call_generator(next_receiver_method, - vtable_index, !call_is_virtual, jvms, + vtable_index, !call_does_dispatch, jvms, allow_inline, prof_factor); if (next_hit_cg != NULL && !next_hit_cg->is_inline() && have_major_receiver && UseOnlyInlinedBimorphic) { @@ -266,7 +266,7 @@ // There was no special inlining tactic, or it bailed out. // Use a more generic tactic, like a simple call. - if (call_is_virtual) { + if (call_does_dispatch) { return CallGenerator::for_virtual_call(callee, vtable_index); } else { // Class Hierarchy Analysis or Type Profile reveals a unique target, @@ -398,6 +398,7 @@ // orig_callee is the resolved callee which's signature includes the // appendix argument. const int nargs = orig_callee->arg_size(); + const bool is_signature_polymorphic = MethodHandles::is_signature_polymorphic(orig_callee->intrinsic_id()); // Push appendix argument (MethodType, CallSite, etc.), if one. if (iter().has_appendix()) { @@ -414,25 +415,18 @@ // Then we may introduce a run-time check and inline on the path where it succeeds. // The other path may uncommon_trap, check for another receiver, or do a v-call. - // Choose call strategy. - bool call_is_virtual = is_virtual_or_interface; - int vtable_index = methodOopDesc::invalid_vtable_index; - ciMethod* callee = orig_callee; + // Try to get the most accurate receiver type + ciMethod* callee = orig_callee; + int vtable_index = methodOopDesc::invalid_vtable_index; + bool call_does_dispatch = false; - // Try to get the most accurate receiver type if (is_virtual_or_interface) { Node* receiver_node = stack(sp() - nargs); const TypeOopPtr* receiver_type = _gvn.type(receiver_node)->isa_oopptr(); - ciMethod* optimized_virtual_method = optimize_inlining(method(), bci(), klass, orig_callee, receiver_type); - - // Have the call been sufficiently improved such that it is no longer a virtual? - if (optimized_virtual_method != NULL) { - callee = optimized_virtual_method; - call_is_virtual = false; - } else if (!UseInlineCaches && is_virtual && callee->is_loaded()) { - // We can make a vtable call at this site - vtable_index = callee->resolve_vtable_index(method()->holder(), klass); - } + // call_does_dispatch and vtable_index are out-parameters. They might be changed. + callee = C->optimize_virtual_call(method(), bci(), klass, orig_callee, receiver_type, + is_virtual, + call_does_dispatch, vtable_index); // out-parameters } // Note: It's OK to try to inline a virtual call. @@ -448,7 +442,7 @@ // Decide call tactic. // This call checks with CHA, the interpreter profile, intrinsics table, etc. // It decides whether inlining is desirable or not. - CallGenerator* cg = C->call_generator(callee, vtable_index, call_is_virtual, jvms, try_inline, prof_factor()); + CallGenerator* cg = C->call_generator(callee, vtable_index, call_does_dispatch, jvms, try_inline, prof_factor()); // NOTE: Don't use orig_callee and callee after this point! Use cg->method() instead. orig_callee = callee = NULL; @@ -488,7 +482,7 @@ // the call site, perhaps because it did not match a pattern the // intrinsic was expecting to optimize. Should always be possible to // get a normal java call that may inline in that case - cg = C->call_generator(cg->method(), vtable_index, call_is_virtual, jvms, try_inline, prof_factor(), /* allow_intrinsics= */ false); + cg = C->call_generator(cg->method(), vtable_index, call_does_dispatch, jvms, try_inline, prof_factor(), /* allow_intrinsics= */ false); if ((new_jvms = cg->generate(jvms)) == NULL) { guarantee(failing(), "call failed to generate: calls should work"); return; @@ -523,55 +517,50 @@ round_double_result(cg->method()); ciType* rtype = cg->method()->return_type(); - if (Bytecodes::has_optional_appendix(iter().cur_bc_raw())) { + ciType* ctype = declared_signature->return_type(); + + if (Bytecodes::has_optional_appendix(iter().cur_bc_raw()) || is_signature_polymorphic) { // Be careful here with return types. - ciType* ctype = declared_signature->return_type(); if (ctype != rtype) { BasicType rt = rtype->basic_type(); BasicType ct = ctype->basic_type(); - Node* retnode = peek(); if (ct == T_VOID) { // It's OK for a method to return a value that is discarded. // The discarding does not require any special action from the caller. // The Java code knows this, at VerifyType.isNullConversion. pop_node(rt); // whatever it was, pop it - retnode = top(); } else if (rt == T_INT || is_subword_type(rt)) { - // FIXME: This logic should be factored out. - if (ct == T_BOOLEAN) { - retnode = _gvn.transform( new (C) AndINode(retnode, intcon(0x1)) ); - } else if (ct == T_CHAR) { - retnode = _gvn.transform( new (C) AndINode(retnode, intcon(0xFFFF)) ); - } else if (ct == T_BYTE) { - retnode = _gvn.transform( new (C) LShiftINode(retnode, intcon(24)) ); - retnode = _gvn.transform( new (C) RShiftINode(retnode, intcon(24)) ); - } else if (ct == T_SHORT) { - retnode = _gvn.transform( new (C) LShiftINode(retnode, intcon(16)) ); - retnode = _gvn.transform( new (C) RShiftINode(retnode, intcon(16)) ); - } else { - assert(ct == T_INT, err_msg_res("rt=%s, ct=%s", type2name(rt), type2name(ct))); - } + // Nothing. These cases are handled in lambda form bytecode. + assert(ct == T_INT || is_subword_type(ct), err_msg_res("must match: rt=%s, ct=%s", type2name(rt), type2name(ct))); } else if (rt == T_OBJECT || rt == T_ARRAY) { assert(ct == T_OBJECT || ct == T_ARRAY, err_msg_res("rt=%s, ct=%s", type2name(rt), type2name(ct))); if (ctype->is_loaded()) { const TypeOopPtr* arg_type = TypeOopPtr::make_from_klass(rtype->as_klass()); const Type* sig_type = TypeOopPtr::make_from_klass(ctype->as_klass()); if (arg_type != NULL && !arg_type->higher_equal(sig_type)) { + Node* retnode = pop(); Node* cast_obj = _gvn.transform(new (C) CheckCastPPNode(control(), retnode, sig_type)); - pop(); push(cast_obj); } } } else { - assert(ct == rt, err_msg_res("unexpected mismatch rt=%d, ct=%d", rt, ct)); + assert(rt == ct, err_msg_res("unexpected mismatch: rt=%s, ct=%s", type2name(rt), type2name(ct))); // push a zero; it's better than getting an oop/int mismatch - retnode = pop_node(rt); - retnode = zerocon(ct); + pop_node(rt); + Node* retnode = zerocon(ct); push_node(ct, retnode); } // Now that the value is well-behaved, continue with the call-site type. rtype = ctype; } + } else { + // Symbolic resolution enforces the types to be the same. + // NOTE: We must relax the assert for unloaded types because two + // different ciType instances of the same unloaded class type + // can appear to be "loaded" by different loaders (depending on + // the accessing class). + assert(!rtype->is_loaded() || !ctype->is_loaded() || rtype == ctype, + err_msg_res("mismatched return types: rtype=%s, ctype=%s", rtype->name(), ctype->name())); } // If the return type of the method is not loaded, assert that the @@ -889,17 +878,39 @@ #endif //PRODUCT +ciMethod* Compile::optimize_virtual_call(ciMethod* caller, int bci, ciInstanceKlass* klass, + ciMethod* callee, const TypeOopPtr* receiver_type, + bool is_virtual, + bool& call_does_dispatch, int& vtable_index) { + // Set default values for out-parameters. + call_does_dispatch = true; + vtable_index = methodOopDesc::invalid_vtable_index; + + // Choose call strategy. + ciMethod* optimized_virtual_method = optimize_inlining(caller, bci, klass, callee, receiver_type); + + // Have the call been sufficiently improved such that it is no longer a virtual? + if (optimized_virtual_method != NULL) { + callee = optimized_virtual_method; + call_does_dispatch = false; + } else if (!UseInlineCaches && is_virtual && callee->is_loaded()) { + // We can make a vtable call at this site + vtable_index = callee->resolve_vtable_index(caller->holder(), klass); + } + return callee; +} + // Identify possible target method and inlining style -ciMethod* Parse::optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass, - ciMethod *dest_method, const TypeOopPtr* receiver_type) { +ciMethod* Compile::optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass, + ciMethod* callee, const TypeOopPtr* receiver_type) { // only use for virtual or interface calls // If it is obviously final, do not bother to call find_monomorphic_target, // because the class hierarchy checks are not needed, and may fail due to // incompletely loaded classes. Since we do our own class loading checks // in this module, we may confidently bind to any method. - if (dest_method->can_be_statically_bound()) { - return dest_method; + if (callee->can_be_statically_bound()) { + return callee; } // Attempt to improve the receiver @@ -908,8 +919,8 @@ if (receiver_type != NULL) { // Array methods are all inherited from Object, and are monomorphic. if (receiver_type->isa_aryptr() && - dest_method->holder() == env()->Object_klass()) { - return dest_method; + callee->holder() == env()->Object_klass()) { + return callee; } // All other interesting cases are instance klasses. @@ -929,7 +940,7 @@ } ciInstanceKlass* calling_klass = caller->holder(); - ciMethod* cha_monomorphic_target = dest_method->find_monomorphic_target(calling_klass, klass, actual_receiver); + ciMethod* cha_monomorphic_target = callee->find_monomorphic_target(calling_klass, klass, actual_receiver); if (cha_monomorphic_target != NULL) { assert(!cha_monomorphic_target->is_abstract(), ""); // Look at the method-receiver type. Does it add "too much information"? @@ -947,10 +958,10 @@ cha_monomorphic_target->print(); tty->cr(); } - if (C->log() != NULL) { - C->log()->elem("missed_CHA_opportunity klass='%d' method='%d'", - C->log()->identify(klass), - C->log()->identify(cha_monomorphic_target)); + if (log() != NULL) { + log()->elem("missed_CHA_opportunity klass='%d' method='%d'", + log()->identify(klass), + log()->identify(cha_monomorphic_target)); } cha_monomorphic_target = NULL; } @@ -962,7 +973,7 @@ // by dynamic class loading. Be sure to test the "static" receiver // dest_method here, as opposed to the actual receiver, which may // falsely lead us to believe that the receiver is final or private. - C->dependencies()->assert_unique_concrete_method(actual_receiver, cha_monomorphic_target); + dependencies()->assert_unique_concrete_method(actual_receiver, cha_monomorphic_target); return cha_monomorphic_target; } @@ -971,7 +982,7 @@ if (actual_receiver_is_exact) { // In case of evolution, there is a dependence on every inlined method, since each // such method can be changed when its class is redefined. - ciMethod* exact_method = dest_method->resolve_invoke(calling_klass, actual_receiver); + ciMethod* exact_method = callee->resolve_invoke(calling_klass, actual_receiver); if (exact_method != NULL) { #ifndef PRODUCT if (PrintOpto) {
--- a/src/share/vm/opto/library_call.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/opto/library_call.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -3532,7 +3532,6 @@ // public static <T,U> T[] java.util.Arrays.copyOf( U[] original, int newLength, Class<? extends T[]> newType); // public static <T,U> T[] java.util.Arrays.copyOfRange(U[] original, int from, int to, Class<? extends T[]> newType); bool LibraryCallKit::inline_array_copyOf(bool is_copyOfRange) { - return false; if (too_many_traps(Deoptimization::Reason_intrinsic)) return false; // Get the arguments.
--- a/src/share/vm/opto/parse.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/opto/parse.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -469,10 +469,6 @@ // Helper function to uncommon-trap or bailout for non-compilable call-sites bool can_not_compile_call_site(ciMethod *dest_method, ciInstanceKlass *klass); - // Helper function to identify inlining potential at call-site - ciMethod* optimize_inlining(ciMethod* caller, int bci, ciInstanceKlass* klass, - ciMethod *dest_method, const TypeOopPtr* receiver_type); - // Helper function to setup for type-profile based inlining bool prepare_type_profile_inline(ciInstanceKlass* prof_klass, ciMethod* prof_method);
--- a/src/share/vm/opto/parse1.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/opto/parse1.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1404,7 +1404,8 @@ do_one_bytecode(); - assert(!have_se || stopped() || failing() || (sp() - pre_bc_sp) == depth, "correct depth prediction"); + assert(!have_se || stopped() || failing() || (sp() - pre_bc_sp) == depth, + err_msg_res("incorrect depth prediction: sp=%d, pre_bc_sp=%d, depth=%d", sp(), pre_bc_sp, depth)); do_exceptions();
--- a/src/share/vm/prims/forte.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/forte.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,8 +29,7 @@ class Forte : AllStatic { public: - static void register_stub(const char* name, address start, address end) - KERNEL_RETURN; + static void register_stub(const char* name, address start, address end); // register internal VM stub };
--- a/src/share/vm/prims/jni.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jni.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -3002,9 +3002,7 @@ HOTSPOT_JNI_GETSTATICOBJECTFIELD_ENTRY( env, clazz, (uintptr_t) fieldID); #endif /* USDT2 */ -#ifndef JNICHECK_KERNEL DEBUG_ONLY(klassOop param_k = jniCheck::validate_class(thread, clazz);) -#endif // JNICHECK_KERNEL JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); assert(id->is_static_field_id(), "invalid static field id"); // Keep JVMTI addition small and only check enabled flag here. @@ -4973,11 +4971,7 @@ // Returns the function structure struct JNINativeInterface_* jni_functions() { -#ifndef JNICHECK_KERNEL if (CheckJNICalls) return jni_functions_check(); -#else // JNICHECK_KERNEL - if (CheckJNICalls) warning("-Xcheck:jni is not supported in kernel vm."); -#endif // JNICHECK_KERNEL return &jni_NativeInterface; }
--- a/src/share/vm/prims/jniCheck.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jniCheck.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,7 @@ #ifndef SHARE_VM_PRIMS_JNICHECK_HPP #define SHARE_VM_PRIMS_JNICHECK_HPP -#ifndef KERNEL #include "runtime/thread.hpp" -#endif extern "C" { // Report a JNI failure caught by -Xcheck:jni. Perform a core dump.
--- a/src/share/vm/prims/jvm.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvm.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -4484,10 +4484,6 @@ // consider to expose this new capability in the sun.rt.jvmCapabilities jvmstat // counter defined in runtimeService.cpp. info->is_attachable = AttachListener::is_attach_supported(); -#ifdef KERNEL - info->is_kernel_jvm = 1; // true; -#else // KERNEL info->is_kernel_jvm = 0; // false; -#endif // KERNEL } JVM_END
--- a/src/share/vm/prims/jvmtiCodeBlobEvents.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvmtiCodeBlobEvents.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,7 @@ #ifndef SHARE_VM_PRIMS_JVMTICODEBLOBEVENTS_HPP #define SHARE_VM_PRIMS_JVMTICODEBLOBEVENTS_HPP -#ifndef JVMTI_KERNEL #include "jvmtifiles/jvmti.h" -#endif // forward declaration class JvmtiEnv;
--- a/src/share/vm/prims/jvmtiEnv.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvmtiEnv.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -660,8 +660,6 @@ return JVMTI_ERROR_NONE; } /* end GetJLocationFormat */ -#ifndef JVMTI_KERNEL - // // Thread functions // @@ -3451,5 +3449,3 @@ } return err; } /* end SetSystemProperty */ - -#endif // !JVMTI_KERNEL
--- a/src/share/vm/prims/jvmtiEnvBase.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvmtiEnvBase.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,10 +74,8 @@ JvmtiManageCapabilities::initialize(); -#ifndef JVMTI_KERNEL // register extension functions and events JvmtiExtensions::register_extensions(); -#endif // !JVMTI_KERNEL #ifdef JVMTI_TRACE JvmtiTrace::initialize(); @@ -236,14 +234,12 @@ // Same situation as with events (see above) set_native_method_prefixes(0, NULL); -#ifndef JVMTI_KERNEL JvmtiTagMap* tag_map_to_deallocate = _tag_map; set_tag_map(NULL); // A tag map can be big, deallocate it now if (tag_map_to_deallocate != NULL) { delete tag_map_to_deallocate; } -#endif // !JVMTI_KERNEL _needs_clean_up = true; } @@ -255,14 +251,12 @@ // There is a small window of time during which the tag map of a // disposed environment could have been reallocated. // Make sure it is gone. -#ifndef JVMTI_KERNEL JvmtiTagMap* tag_map_to_deallocate = _tag_map; set_tag_map(NULL); // A tag map can be big, deallocate it now if (tag_map_to_deallocate != NULL) { delete tag_map_to_deallocate; } -#endif // !JVMTI_KERNEL _magic = BAD_MAGIC; } @@ -593,8 +587,6 @@ return (jclass)jni_reference(Klass::cast(k)->java_mirror()); } -#ifndef JVMTI_KERNEL - // // Field Information // @@ -1482,5 +1474,3 @@ } } } - -#endif // !JVMTI_KERNEL
--- a/src/share/vm/prims/jvmtiExport.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvmtiExport.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -668,16 +668,6 @@ poster.post(); } -void JvmtiExport::report_unsupported(bool on) { - // If any JVMTI service is turned on, we need to exit before native code - // tries to access nonexistant services. - if (on) { - vm_exit_during_initialization("Java Kernel does not support JVMTI."); - } -} - - -#ifndef JVMTI_KERNEL static inline klassOop oop_to_klassOop(oop obj) { klassOop k = obj->klass(); @@ -2174,7 +2164,6 @@ typedef jint (JNICALL *OnAttachEntry_t)(JavaVM*, char *, void *); } -#ifndef SERVICES_KERNEL jint JvmtiExport::load_agent_library(AttachOperation* op, outputStream* st) { char ebuf[1024]; char buffer[JVM_MAXPATHLEN]; @@ -2252,7 +2241,6 @@ } return result; } -#endif // SERVICES_KERNEL //////////////////////////////////////////////////////////////////////////////////////////////// @@ -2450,4 +2438,3 @@ JvmtiExport::post_garbage_collection_finish(); } } -#endif // JVMTI_KERNEL
--- a/src/share/vm/prims/jvmtiExport.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvmtiExport.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,21 +46,12 @@ class JvmtiThreadState; class AttachOperation; -#ifndef JVMTI_KERNEL #define JVMTI_SUPPORT_FLAG(key) \ private: \ static bool _##key; \ public: \ inline static void set_##key(bool on) { _##key = (on != 0); } \ inline static bool key() { return _##key; } -#else // JVMTI_KERNEL -#define JVMTI_SUPPORT_FLAG(key) \ - private: \ - const static bool _##key = false; \ - public: \ - inline static void set_##key(bool on) { report_unsupported(on); } \ - inline static bool key() { return _##key; } -#endif // JVMTI_KERNEL // This class contains the JVMTI interface for the rest of hotspot. @@ -120,9 +111,6 @@ JVMTI_SUPPORT_FLAG(should_clean_up_heap_objects) JVMTI_SUPPORT_FLAG(should_post_vm_object_alloc) - // If flag cannot be implemented, give an error if on=true - static void report_unsupported(bool on); - // these should only be called by the friend class friend class JvmtiManageCapabilities; inline static void set_can_modify_any_class(bool on) { _can_modify_any_class = (on != 0); } @@ -144,7 +132,7 @@ // posts a DynamicCodeGenerated event (internal/private implementation). // The public post_dynamic_code_generated* functions make use of the // internal implementation. Also called from JvmtiDeferredEvent::post() - static void post_dynamic_code_generated_internal(const char *name, const void *code_begin, const void *code_end) KERNEL_RETURN; + static void post_dynamic_code_generated_internal(const char *name, const void *code_begin, const void *code_end); private: @@ -154,9 +142,9 @@ static void post_compiled_method_load(JvmtiEnv* env, const jmethodID method, const jint length, const void *code_begin, const jint map_length, - const jvmtiAddrLocationMap* map) KERNEL_RETURN; + const jvmtiAddrLocationMap* map); static void post_dynamic_code_generated(JvmtiEnv* env, const char *name, const void *code_begin, - const void *code_end) KERNEL_RETURN; + const void *code_end); // The RedefineClasses() API breaks some invariants in the "regular" // system. For example, there are sanity checks when GC'ing nmethods @@ -236,53 +224,51 @@ int * micro); // single stepping management methods - static void at_single_stepping_point(JavaThread *thread, methodOop method, address location) KERNEL_RETURN; - static void expose_single_stepping(JavaThread *thread) KERNEL_RETURN; - static bool hide_single_stepping(JavaThread *thread) KERNEL_RETURN_(false); + static void at_single_stepping_point(JavaThread *thread, methodOop method, address location); + static void expose_single_stepping(JavaThread *thread); + static bool hide_single_stepping(JavaThread *thread); // Methods that notify the debugger that something interesting has happened in the VM. static void post_vm_start (); static void post_vm_initialized (); static void post_vm_death (); - static void post_single_step (JavaThread *thread, methodOop method, address location) KERNEL_RETURN; - static void post_raw_breakpoint (JavaThread *thread, methodOop method, address location) KERNEL_RETURN; + static void post_single_step (JavaThread *thread, methodOop method, address location); + static void post_raw_breakpoint (JavaThread *thread, methodOop method, address location); - static void post_exception_throw (JavaThread *thread, methodOop method, address location, oop exception) KERNEL_RETURN; - static void notice_unwind_due_to_exception (JavaThread *thread, methodOop method, address location, oop exception, bool in_handler_frame) KERNEL_RETURN; + static void post_exception_throw (JavaThread *thread, methodOop method, address location, oop exception); + static void notice_unwind_due_to_exception (JavaThread *thread, methodOop method, address location, oop exception, bool in_handler_frame); static oop jni_GetField_probe (JavaThread *thread, jobject jobj, - oop obj, klassOop klass, jfieldID fieldID, bool is_static) - KERNEL_RETURN_(NULL); + oop obj, klassOop klass, jfieldID fieldID, bool is_static); static oop jni_GetField_probe_nh (JavaThread *thread, jobject jobj, - oop obj, klassOop klass, jfieldID fieldID, bool is_static) - KERNEL_RETURN_(NULL); + oop obj, klassOop klass, jfieldID fieldID, bool is_static); static void post_field_access_by_jni (JavaThread *thread, oop obj, - klassOop klass, jfieldID fieldID, bool is_static) KERNEL_RETURN; + klassOop klass, jfieldID fieldID, bool is_static); static void post_field_access (JavaThread *thread, methodOop method, - address location, KlassHandle field_klass, Handle object, jfieldID field) KERNEL_RETURN; + address location, KlassHandle field_klass, Handle object, jfieldID field); static oop jni_SetField_probe (JavaThread *thread, jobject jobj, oop obj, klassOop klass, jfieldID fieldID, bool is_static, char sig_type, - jvalue *value) KERNEL_RETURN_(NULL); + jvalue *value); static oop jni_SetField_probe_nh (JavaThread *thread, jobject jobj, oop obj, klassOop klass, jfieldID fieldID, bool is_static, char sig_type, - jvalue *value) KERNEL_RETURN_(NULL); + jvalue *value); static void post_field_modification_by_jni(JavaThread *thread, oop obj, klassOop klass, jfieldID fieldID, bool is_static, char sig_type, jvalue *value); static void post_raw_field_modification(JavaThread *thread, methodOop method, address location, KlassHandle field_klass, Handle object, jfieldID field, - char sig_type, jvalue *value) KERNEL_RETURN; + char sig_type, jvalue *value); - static void post_method_entry (JavaThread *thread, methodOop method, frame current_frame) KERNEL_RETURN; - static void post_method_exit (JavaThread *thread, methodOop method, frame current_frame) KERNEL_RETURN; + static void post_method_entry (JavaThread *thread, methodOop method, frame current_frame); + static void post_method_exit (JavaThread *thread, methodOop method, frame current_frame); - static void post_class_load (JavaThread *thread, klassOop klass) KERNEL_RETURN; - static void post_class_unload (klassOop klass) KERNEL_RETURN; - static void post_class_prepare (JavaThread *thread, klassOop klass) KERNEL_RETURN; + static void post_class_load (JavaThread *thread, klassOop klass); + static void post_class_unload (klassOop klass); + static void post_class_prepare (JavaThread *thread, klassOop klass); - static void post_thread_start (JavaThread *thread) KERNEL_RETURN; - static void post_thread_end (JavaThread *thread) KERNEL_RETURN; + static void post_thread_start (JavaThread *thread); + static void post_thread_end (JavaThread *thread); // Support for java.lang.instrument agent loading. static bool _should_post_class_file_load_hook; @@ -293,31 +279,31 @@ unsigned char **data_ptr, unsigned char **end_ptr, unsigned char **cached_data_ptr, jint *cached_length_ptr); - static void post_native_method_bind(methodOop method, address* function_ptr) KERNEL_RETURN; - static void post_compiled_method_load(nmethod *nm) KERNEL_RETURN; - static void post_dynamic_code_generated(const char *name, const void *code_begin, const void *code_end) KERNEL_RETURN; + static void post_native_method_bind(methodOop method, address* function_ptr); + static void post_compiled_method_load(nmethod *nm); + static void post_dynamic_code_generated(const char *name, const void *code_begin, const void *code_end); // used to post a CompiledMethodUnload event - static void post_compiled_method_unload(jmethodID mid, const void *code_begin) KERNEL_RETURN; + static void post_compiled_method_unload(jmethodID mid, const void *code_begin); // similiar to post_dynamic_code_generated except that it can be used to // post a DynamicCodeGenerated event while holding locks in the VM. Any event // posted using this function is recorded by the enclosing event collector // -- JvmtiDynamicCodeEventCollector. - static void post_dynamic_code_generated_while_holding_locks(const char* name, address code_begin, address code_end) KERNEL_RETURN; + static void post_dynamic_code_generated_while_holding_locks(const char* name, address code_begin, address code_end); - static void post_garbage_collection_finish() KERNEL_RETURN; - static void post_garbage_collection_start() KERNEL_RETURN; - static void post_data_dump() KERNEL_RETURN; - static void post_monitor_contended_enter(JavaThread *thread, ObjectMonitor *obj_mntr) KERNEL_RETURN; - static void post_monitor_contended_entered(JavaThread *thread, ObjectMonitor *obj_mntr) KERNEL_RETURN; - static void post_monitor_wait(JavaThread *thread, oop obj, jlong timeout) KERNEL_RETURN; - static void post_monitor_waited(JavaThread *thread, ObjectMonitor *obj_mntr, jboolean timed_out) KERNEL_RETURN; - static void post_object_free(JvmtiEnv* env, jlong tag) KERNEL_RETURN; - static void post_resource_exhausted(jint resource_exhausted_flags, const char* detail) KERNEL_RETURN; - static void record_vm_internal_object_allocation(oop object) KERNEL_RETURN; + static void post_garbage_collection_finish(); + static void post_garbage_collection_start(); + static void post_data_dump(); + static void post_monitor_contended_enter(JavaThread *thread, ObjectMonitor *obj_mntr); + static void post_monitor_contended_entered(JavaThread *thread, ObjectMonitor *obj_mntr); + static void post_monitor_wait(JavaThread *thread, oop obj, jlong timeout); + static void post_monitor_waited(JavaThread *thread, ObjectMonitor *obj_mntr, jboolean timed_out); + static void post_object_free(JvmtiEnv* env, jlong tag); + static void post_resource_exhausted(jint resource_exhausted_flags, const char* detail); + static void record_vm_internal_object_allocation(oop object); // Post objects collected by vm_object_alloc_event_collector. - static void post_vm_object_alloc(JavaThread *thread, oop object) KERNEL_RETURN; + static void post_vm_object_alloc(JavaThread *thread, oop object); // Collects vm internal objects for later event posting. inline static void vm_object_alloc_event_collector(oop object) { if (should_post_vm_object_alloc()) { @@ -331,18 +317,16 @@ } } - static void cleanup_thread (JavaThread* thread) KERNEL_RETURN; + static void cleanup_thread (JavaThread* thread); - static void oops_do(OopClosure* f) KERNEL_RETURN; - static void weak_oops_do(BoolObjectClosure* b, OopClosure* f) KERNEL_RETURN; - static void gc_epilogue() KERNEL_RETURN; + static void oops_do(OopClosure* f); + static void weak_oops_do(BoolObjectClosure* b, OopClosure* f); + static void gc_epilogue(); - static void transition_pending_onload_raw_monitors() KERNEL_RETURN; + static void transition_pending_onload_raw_monitors(); -#ifndef SERVICES_KERNEL // attach support static jint load_agent_library(AttachOperation* op, outputStream* out); -#endif // SERVICES_KERNEL // SetNativeMethodPrefix support static char** get_all_native_method_prefixes(int* count_ptr); @@ -408,8 +392,8 @@ void register_stub(const char* name, address start, address end); public: - JvmtiDynamicCodeEventCollector() KERNEL_RETURN; - ~JvmtiDynamicCodeEventCollector() KERNEL_RETURN; + JvmtiDynamicCodeEventCollector(); + ~JvmtiDynamicCodeEventCollector(); bool is_dynamic_code_event() { return true; } }; @@ -441,8 +425,8 @@ static void oops_do_for_all_threads(OopClosure* f); public: - JvmtiVMObjectAllocEventCollector() KERNEL_RETURN; - ~JvmtiVMObjectAllocEventCollector() KERNEL_RETURN; + JvmtiVMObjectAllocEventCollector(); + ~JvmtiVMObjectAllocEventCollector(); bool is_vm_object_alloc_event() { return true; } bool is_enabled() { return _enable; } @@ -472,16 +456,16 @@ bool was_enabled() { return _collector != NULL; } public: - NoJvmtiVMObjectAllocMark() KERNEL_RETURN; - ~NoJvmtiVMObjectAllocMark() KERNEL_RETURN; + NoJvmtiVMObjectAllocMark(); + ~NoJvmtiVMObjectAllocMark(); }; // Base class for reporting GC events to JVMTI. class JvmtiGCMarker : public StackObj { public: - JvmtiGCMarker() KERNEL_RETURN; - ~JvmtiGCMarker() KERNEL_RETURN; + JvmtiGCMarker(); + ~JvmtiGCMarker(); }; // JvmtiHideSingleStepping is a helper class for hiding
--- a/src/share/vm/prims/jvmtiExtensions.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvmtiExtensions.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,11 +25,9 @@ #ifndef SHARE_VM_PRIMS_JVMTIEXTENSIONS_HPP #define SHARE_VM_PRIMS_JVMTIEXTENSIONS_HPP -#ifndef JVMTI_KERNEL #include "jvmtifiles/jvmti.h" #include "jvmtifiles/jvmtiEnv.hpp" #include "memory/allocation.hpp" -#endif // JvmtiExtensions //
--- a/src/share/vm/prims/jvmtiImpl.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvmtiImpl.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -917,8 +917,6 @@ #endif } -#ifndef KERNEL - JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_load_event( nmethod* nm) { JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_COMPILED_METHOD_LOAD); @@ -1110,5 +1108,3 @@ } } } - -#endif // ndef KERNEL
--- a/src/share/vm/prims/jvmtiImpl.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvmtiImpl.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,6 @@ #ifndef SHARE_VM_PRIMS_JVMTIIMPL_HPP #define SHARE_VM_PRIMS_JVMTIIMPL_HPP -#ifndef JVMTI_KERNEL - #include "classfile/systemDictionary.hpp" #include "jvmtifiles/jvmti.h" #include "oops/objArrayOop.hpp" @@ -431,7 +429,6 @@ static void print(); }; -#endif // !JVMTI_KERNEL /** * When a thread (such as the compiler thread or VM thread) cannot post a @@ -476,16 +473,14 @@ JvmtiDeferredEvent() : _type(TYPE_NONE) {} // Factory methods - static JvmtiDeferredEvent compiled_method_load_event(nmethod* nm) - KERNEL_RETURN_(JvmtiDeferredEvent()); + static JvmtiDeferredEvent compiled_method_load_event(nmethod* nm); static JvmtiDeferredEvent compiled_method_unload_event(nmethod* nm, - jmethodID id, const void* code) KERNEL_RETURN_(JvmtiDeferredEvent()); + jmethodID id, const void* code); static JvmtiDeferredEvent dynamic_code_generated_event( - const char* name, const void* begin, const void* end) - KERNEL_RETURN_(JvmtiDeferredEvent()); + const char* name, const void* begin, const void* end); // Actually posts the event. - void post() KERNEL_RETURN; + void post(); }; /** @@ -516,13 +511,13 @@ static volatile QueueNode* _pending_list; // Uses CAS for read/update // Transfers events from the _pending_list to the _queue. - static void process_pending_events() KERNEL_RETURN; + static void process_pending_events(); public: // Must be holding Service_lock when calling these - static bool has_events() KERNEL_RETURN_(false); - static void enqueue(const JvmtiDeferredEvent& event) KERNEL_RETURN; - static JvmtiDeferredEvent dequeue() KERNEL_RETURN_(JvmtiDeferredEvent()); + static bool has_events(); + static void enqueue(const JvmtiDeferredEvent& event); + static JvmtiDeferredEvent dequeue(); // Used to enqueue events without using a lock, for times (such as during // safepoint) when we can't or don't want to lock the Service_lock. @@ -530,7 +525,7 @@ // Events will be held off to the side until there's a call to // dequeue(), enqueue(), or process_pending_events() (all of which require // the holding of the Service_lock), and will be enqueued at that time. - static void add_pending_event(const JvmtiDeferredEvent&) KERNEL_RETURN; + static void add_pending_event(const JvmtiDeferredEvent&); }; // Utility macro that checks for NULL pointers:
--- a/src/share/vm/prims/jvmtiRawMonitor.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvmtiRawMonitor.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,8 @@ #ifndef SHARE_VM_PRIMS_JVMTIRAWMONITOR_HPP #define SHARE_VM_PRIMS_JVMTIRAWMONITOR_HPP -#ifndef JVMTI_KERNEL #include "runtime/objectMonitor.hpp" #include "utilities/growableArray.hpp" -#endif // // class JvmtiRawMonitor
--- a/src/share/vm/prims/jvmtiRedefineClasses.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvmtiRedefineClasses.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3060,11 +3060,9 @@ klassOop the_class_oop = java_lang_Class::as_klassOop(the_class_mirror); instanceKlassHandle the_class = instanceKlassHandle(THREAD, the_class_oop); -#ifndef JVMTI_KERNEL // Remove all breakpoints in methods of this class JvmtiBreakpoints& jvmti_breakpoints = JvmtiCurrentBreakpoints::get_jvmti_breakpoints(); jvmti_breakpoints.clearall_in_class_at_safepoint(the_class_oop); -#endif // !JVMTI_KERNEL if (the_class_oop == Universe::reflect_invoke_cache()->klass()) { // We are redefining java.lang.reflect.Method. Method.invoke() is
--- a/src/share/vm/prims/jvmtiTagMap.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/prims/jvmtiTagMap.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,14 +27,12 @@ #ifndef SHARE_VM_PRIMS_JVMTITAGMAP_HPP #define SHARE_VM_PRIMS_JVMTITAGMAP_HPP -#ifndef JVMTI_KERNEL #include "gc_interface/collectedHeap.hpp" #include "jvmtifiles/jvmti.h" #include "jvmtifiles/jvmtiEnv.hpp" #include "memory/allocation.hpp" #include "memory/genCollectedHeap.hpp" #include "memory/universe.hpp" -#endif // forward references class JvmtiTagHashmap; @@ -125,7 +123,7 @@ jlong** tag_result_ptr); static void weak_oops_do( - BoolObjectClosure* is_alive, OopClosure* f) KERNEL_RETURN; + BoolObjectClosure* is_alive, OopClosure* f); }; #endif // SHARE_VM_PRIMS_JVMTITAGMAP_HPP
--- a/src/share/vm/runtime/arguments.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/runtime/arguments.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1064,7 +1064,6 @@ } } -#ifndef KERNEL static void disable_adaptive_size_policy(const char* collector_name) { if (UseAdaptiveSizePolicy) { if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) { @@ -1284,7 +1283,6 @@ tty->print_cr("ConcGCThreads: %u", ConcGCThreads); } } -#endif // KERNEL void set_object_alignment() { // Object alignment. @@ -1301,10 +1299,8 @@ // Oop encoding heap max OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes; -#ifndef KERNEL // Set CMS global values CompactibleFreeListSpace::set_cms_values(); -#endif // KERNEL } bool verify_object_alignment() { @@ -2199,11 +2195,6 @@ size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied. options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2); } -#ifdef JVMTI_KERNEL - if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { - warning("profiling and debugging agents are not supported with Kernel VM"); - } else -#endif // JVMTI_KERNEL add_init_library(name, options); } // -agentlib and -agentpath @@ -2219,11 +2210,6 @@ if(pos != NULL) { options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1); } -#ifdef JVMTI_KERNEL - if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { - warning("profiling and debugging agents are not supported with Kernel VM"); - } else -#endif // JVMTI_KERNEL add_init_agent(name, options, is_absolute_path); } @@ -2364,12 +2350,7 @@ // EVM option, ignore silently for compatibility // -Xprof } else if (match_option(option, "-Xprof", &tail)) { -#ifndef FPROF_KERNEL _has_profile = true; -#else // FPROF_KERNEL - // do we have to exit? - warning("Kernel VM does not support flat profiling."); -#endif // FPROF_KERNEL // -Xaprof } else if (match_option(option, "-Xaprof", &tail)) { _has_alloc_profile = true; @@ -2420,9 +2401,6 @@ #elif defined(COMPILER2) vm_exit_during_initialization( "Dumping a shared archive is not supported on the Server JVM.", NULL); -#elif defined(KERNEL) - vm_exit_during_initialization( - "Dumping a shared archive is not supported on the Kernel JVM.", NULL); #else FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true); set_mode_flags(_int); // Prevent compilation, which creates objects @@ -3158,9 +3136,6 @@ #ifdef SERIALGC force_serial_gc(); #endif // SERIALGC -#ifdef KERNEL - no_shared_spaces(); -#endif // KERNEL // Set flags based on ergonomics. set_ergonomics_flags(); @@ -3181,8 +3156,6 @@ "Incompatible compilation policy selected", NULL); } } - -#ifndef KERNEL // Set heap size based on available physical memory set_heap_size(); // Set per-collector flags @@ -3195,7 +3168,6 @@ } else if (UseG1GC) { set_g1_gc_flags(); } -#endif // KERNEL #ifdef SERIALGC assert(verify_serial_gc_flags(), "SerialGC unset"); @@ -3382,36 +3354,6 @@ PropertyList_add(plist, k, v); } -#ifdef KERNEL -char *Arguments::get_kernel_properties() { - // Find properties starting with kernel and append them to string - // We need to find out how long they are first because the URL's that they - // might point to could get long. - int length = 0; - SystemProperty* prop; - for (prop = _system_properties; prop != NULL; prop = prop->next()) { - if (strncmp(prop->key(), "kernel.", 7 ) == 0) { - length += (strlen(prop->key()) + strlen(prop->value()) + 5); // "-D =" - } - } - // Add one for null terminator. - char *props = AllocateHeap(length + 1, mtInternal); - if (length != 0) { - int pos = 0; - for (prop = _system_properties; prop != NULL; prop = prop->next()) { - if (strncmp(prop->key(), "kernel.", 7 ) == 0) { - jio_snprintf(&props[pos], length-pos, - "-D%s=%s ", prop->key(), prop->value()); - pos = strlen(props); - } - } - } - // null terminate props in case of null - props[length] = '\0'; - return props; -} -#endif // KERNEL - // Copies src into buf, replacing "%%" with "%" and "%p" with pid // Returns true if all of the source pointed by src has been copied over to // the destination buffer pointed by buf. Otherwise, returns false.
--- a/src/share/vm/runtime/arguments.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/runtime/arguments.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -537,11 +537,6 @@ // Utility: copies src into buf, replacing "%%" with "%" and "%p" with pid. static bool copy_expand_pid(const char* src, size_t srclen, char* buf, size_t buflen); - -#ifdef KERNEL - // For java kernel vm, return property string for kernel properties. - static char *get_kernel_properties(); -#endif // KERNEL }; #endif // SHARE_VM_RUNTIME_ARGUMENTS_HPP
--- a/src/share/vm/runtime/fprofiler.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/runtime/fprofiler.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,15 +65,14 @@ // For now, the only thread-specific region is the class loader. enum Region { noRegion, classLoaderRegion, extraRegion, maxRegion }; - ThreadProfilerMark(Region) KERNEL_RETURN; - ~ThreadProfilerMark() KERNEL_RETURN; + ThreadProfilerMark(Region); + ~ThreadProfilerMark(); private: ThreadProfiler* _pp; Region _r; }; -#ifndef FPROF_KERNEL class IntervalData VALUE_OBJ_CLASS_SPEC { // Just to keep these things all together @@ -119,29 +118,27 @@ static void print_header(outputStream* st); void print_data(outputStream* st); }; -#endif // FPROF_KERNEL class ThreadProfiler: public CHeapObj<mtInternal> { public: - ThreadProfiler() KERNEL_RETURN; - ~ThreadProfiler() KERNEL_RETURN; + ThreadProfiler(); + ~ThreadProfiler(); // Resets the profiler - void reset() KERNEL_RETURN; + void reset(); // Activates the profiler for a certain thread - void engage() KERNEL_RETURN; + void engage(); // Deactivates the profiler - void disengage() KERNEL_RETURN; + void disengage(); // Prints the collected profiling information - void print(const char* thread_name) KERNEL_RETURN; + void print(const char* thread_name); // Garbage Collection Support - void oops_do(OopClosure* f) KERNEL_RETURN; + void oops_do(OopClosure* f); -#ifndef FPROF_KERNEL private: // for recording ticks. friend class ProfilerNode; @@ -225,39 +222,37 @@ IntervalData* interval_data_ref() { return &_interval_data; } -#endif // FPROF_KERNEL }; class FlatProfiler: AllStatic { public: - static void reset() KERNEL_RETURN ; - static void engage(JavaThread* mainThread, bool fullProfile) KERNEL_RETURN ; - static void disengage() KERNEL_RETURN ; - static void print(int unused) KERNEL_RETURN ; - static bool is_active() KERNEL_RETURN_(false) ; + static void reset() ; + static void engage(JavaThread* mainThread, bool fullProfile) ; + static void disengage() ; + static void print(int unused) ; + static bool is_active(); // This is NULL if each thread has its own thread profiler, // else this is the single thread profiler used by all threads. // In particular it makes a difference during garbage collection, // where you only want to traverse each thread profiler once. - static ThreadProfiler* get_thread_profiler() KERNEL_RETURN_(NULL); + static ThreadProfiler* get_thread_profiler(); // Garbage Collection Support - static void oops_do(OopClosure* f) KERNEL_RETURN ; + static void oops_do(OopClosure* f) ; // Support for disassembler to inspect the PCRecorder // Returns the start address for a given pc // NULL is returned if the PCRecorder is inactive - static address bucket_start_for(address pc) KERNEL_RETURN_(NULL); + static address bucket_start_for(address pc); enum { MillisecsPerTick = 10 }; // ms per profiling ticks // Returns the number of ticks recorded for the bucket // pc belongs to. - static int bucket_count_for(address pc) KERNEL_RETURN_(0); + static int bucket_count_for(address pc); -#ifndef FPROF_KERNEL private: static bool full_profile() { @@ -324,7 +319,6 @@ static void interval_reset(); // reset interval data. enum {interval_print_size = 10}; static IntervalData* interval_data; -#endif // FPROF_KERNEL }; #endif // SHARE_VM_RUNTIME_FPROFILER_HPP
--- a/src/share/vm/runtime/globals_extension.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/runtime/globals_extension.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -94,9 +94,7 @@ typedef enum { RUNTIME_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_EXPERIMENTAL_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER, RUNTIME_MANAGEABLE_FLAG_MEMBER, RUNTIME_PRODUCT_RW_FLAG_MEMBER, RUNTIME_LP64_PRODUCT_FLAG_MEMBER) RUNTIME_OS_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER) -#ifndef KERNEL G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, RUNTIME_PD_DEVELOP_FLAG_MEMBER, RUNTIME_PRODUCT_FLAG_MEMBER, RUNTIME_PD_PRODUCT_FLAG_MEMBER, RUNTIME_DIAGNOSTIC_FLAG_MEMBER, RUNTIME_EXPERIMENTAL_FLAG_MEMBER, RUNTIME_NOTPRODUCT_FLAG_MEMBER, RUNTIME_MANAGEABLE_FLAG_MEMBER, RUNTIME_PRODUCT_RW_FLAG_MEMBER) -#endif #ifdef COMPILER1 C1_FLAGS(C1_DEVELOP_FLAG_MEMBER, C1_PD_DEVELOP_FLAG_MEMBER, C1_PRODUCT_FLAG_MEMBER, C1_PD_PRODUCT_FLAG_MEMBER, C1_NOTPRODUCT_FLAG_MEMBER) #endif @@ -187,7 +185,6 @@ RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE, RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE, RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE) -#ifndef KERNEL G1_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE, RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE, RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE, @@ -197,7 +194,6 @@ RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE, RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE, RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE) -#endif // KERNEL #ifdef COMPILER1 C1_FLAGS(C1_DEVELOP_FLAG_MEMBER_WITH_TYPE, C1_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE,
--- a/src/share/vm/runtime/init.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/runtime/init.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -113,9 +113,7 @@ universe2_init(); // dependent on codeCache_init and stubRoutines_init1 referenceProcessor_init(); jni_handles_init(); -#ifndef VM_STRUCTS_KERNEL vmStructs_init(); -#endif // VM_STRUCTS_KERNEL vtableStubs_init(); InlineCacheBuffer_init();
--- a/src/share/vm/runtime/java.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/runtime/java.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -549,6 +549,10 @@ BeforeExit_lock->notify_all(); } + // Shutdown NMT before exit. Otherwise, + // it will run into trouble when system destroys static variables. + MemTracker::shutdown(MemTracker::NMT_normal); + #undef BEFORE_EXIT_NOT_RUN #undef BEFORE_EXIT_RUNNING #undef BEFORE_EXIT_DONE
--- a/src/share/vm/runtime/thread.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/runtime/thread.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3707,28 +3707,6 @@ // Try to load the agent from the standard dll directory os::dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), name); library = os::dll_load(buffer, ebuf, sizeof ebuf); -#ifdef KERNEL - // Download instrument dll - if (library == NULL && strcmp(name, "instrument") == 0) { - char *props = Arguments::get_kernel_properties(); - char *home = Arguments::get_java_home(); - const char *fmt = "%s/bin/java %s -Dkernel.background.download=false" - " sun.jkernel.DownloadManager -download client_jvm"; - size_t length = strlen(props) + strlen(home) + strlen(fmt) + 1; - char *cmd = NEW_C_HEAP_ARRAY(char, length, mtThread); - jio_snprintf(cmd, length, fmt, home, props); - int status = os::fork_and_exec(cmd); - FreeHeap(props); - if (status == -1) { - warning(cmd); - vm_exit_during_initialization("fork_and_exec failed: %s", - strerror(errno)); - } - FREE_C_HEAP_ARRAY(char, cmd, mtThread); - // when this comes back the instrument.dll should be where it belongs. - library = os::dll_load(buffer, ebuf, sizeof ebuf); - } -#endif // KERNEL if (library == NULL) { // Try the local directory char ns[1] = {0}; os::dll_build_name(buffer, sizeof(buffer), ns, name); @@ -3955,10 +3933,6 @@ Mutex::_as_suspend_equivalent_flag); } - // Shutdown NMT before exit. Otherwise, - // it will run into trouble when system destroys static variables. - MemTracker::shutdown(MemTracker::NMT_normal); - // Hang forever on exit if we are reporting an error. if (ShowMessageBoxOnError && is_error_reported()) { os::infinite_sleep();
--- a/src/share/vm/runtime/vmStructs.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/runtime/vmStructs.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2490,7 +2490,7 @@ /* frame */ \ /**********************/ \ \ - X86_ONLY(declare_constant(frame::entry_frame_call_wrapper_offset)) \ + NOT_ZERO(X86_ONLY(declare_constant(frame::entry_frame_call_wrapper_offset))) \ declare_constant(frame::pc_return_offset) \ \ /*************/ \
--- a/src/share/vm/runtime/vmStructs.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/runtime/vmStructs.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,9 +25,7 @@ #ifndef SHARE_VM_RUNTIME_VMSTRUCTS_HPP #define SHARE_VM_RUNTIME_VMSTRUCTS_HPP -#ifndef VM_STRUCTS_KERNEL #include "utilities/debug.hpp" -#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif
--- a/src/share/vm/runtime/vm_version.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/runtime/vm_version.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -110,9 +110,6 @@ #define VMLP "" #endif -#ifdef KERNEL - #define VMTYPE "Kernel" -#else // KERNEL #ifdef TIERED #define VMTYPE "Server" #else // TIERED @@ -127,7 +124,6 @@ COMPILER2_PRESENT("Server") #endif // ZERO #endif // TIERED -#endif // KERNEL #ifndef HOTSPOT_VM_DISTRO #error HOTSPOT_VM_DISTRO must be defined
--- a/src/share/vm/services/attachListener.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/attachListener.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -170,7 +170,6 @@ return JNI_OK; } -#ifndef SERVICES_KERNEL // Heap dumping not supported // Implementation of "dumpheap" command. // See also: HeapDumpDCmd class // @@ -212,7 +211,6 @@ } return JNI_OK; } -#endif // SERVICES_KERNEL // Implementation of "inspectheap" command // See also: ClassHistogramDCmd class @@ -382,9 +380,7 @@ static AttachOperationFunctionInfo funcs[] = { { "agentProperties", get_agent_properties }, { "datadump", data_dump }, -#ifndef SERVICES_KERNEL { "dumpheap", dump_heap }, -#endif // SERVICES_KERNEL { "load", JvmtiExport::load_agent_library }, { "properties", get_system_properties }, { "threaddump", thread_dump },
--- a/src/share/vm/services/attachListener.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/attachListener.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,8 +38,6 @@ // complets the result value and any result data is returned to the client // tool. -#ifndef SERVICES_KERNEL - class AttachOperation; typedef jint (*AttachOperationFunction)(AttachOperation* op, outputStream* out); @@ -48,25 +46,21 @@ const char* name; AttachOperationFunction func; }; -#endif // SERVICES_KERNEL class AttachListener: AllStatic { public: - static void init() KERNEL_RETURN; - static void abort() KERNEL_RETURN; + static void init(); + static void abort(); // invoke to perform clean-up tasks when all clients detach - static void detachall() KERNEL_RETURN; + static void detachall(); // indicates if the Attach Listener needs to be created at startup - static bool init_at_startup() KERNEL_RETURN_(false); + static bool init_at_startup(); // indicates if we have a trigger to start the Attach Listener - static bool is_init_trigger() KERNEL_RETURN_(false); + static bool is_init_trigger(); -#ifdef SERVICES_KERNEL - static bool is_attach_supported() { return false; } -#else // SERVICES_KERNEL private: static volatile bool _initialized; @@ -94,10 +88,8 @@ // dequeue the next operation static AttachOperation* dequeue(); -#endif // SERVICES_KERNEL }; -#ifndef SERVICES_KERNEL class AttachOperation: public CHeapObj<mtInternal> { public: enum { @@ -151,6 +143,5 @@ // complete operation by sending result code and any result data to the client virtual void complete(jint result, bufferedStream* result_stream) = 0; }; -#endif // SERVICES_KERNEL #endif // SHARE_VM_SERVICES_ATTACHLISTENER_HPP
--- a/src/share/vm/services/diagnosticCommand.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/diagnosticCommand.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,9 +43,7 @@ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<VMUptimeDCmd>(true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<SystemGCDCmd>(true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<RunFinalizationDCmd>(true, false)); -#ifndef SERVICES_KERNEL // Heap dumping not supported DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<HeapDumpDCmd>(true, false)); -#endif // SERVICES_KERNEL DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ClassHistogramDCmd>(true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl<ThreadDumpDCmd>(true, false)); @@ -252,7 +250,6 @@ vmSymbols::void_method_signature(), CHECK); } -#ifndef SERVICES_KERNEL // Heap dumping not supported HeapDumpDCmd::HeapDumpDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap), _filename("filename","Name of the dump file", "STRING",true), @@ -292,7 +289,6 @@ return 0; } } -#endif // SERVICES_KERNEL ClassHistogramDCmd::ClassHistogramDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap), @@ -406,7 +402,32 @@ _jmxremote_ssl_config_file ("jmxremote.ssl.config.file", - "set com.sun.management.jmxremote.ssl_config_file", "STRING", false) + "set com.sun.management.jmxremote.ssl_config_file", "STRING", false), + +// JDP Protocol support + _jmxremote_autodiscovery + ("jmxremote.autodiscovery", + "set com.sun.management.jmxremote.autodiscovery", "STRING", false), + + _jdp_port + ("jdp.port", + "set com.sun.management.jdp.port", "INT", false), + + _jdp_address + ("jdp.address", + "set com.sun.management.jdp.address", "STRING", false), + + _jdp_source_addr + ("jdp.source_addr", + "set com.sun.management.jdp.source_addr", "STRING", false), + + _jdp_ttl + ("jdp.ttl", + "set com.sun.management.jdp.ttl", "INT", false), + + _jdp_pause + ("jdp.pause", + "set com.sun.management.jdp.pause", "INT", false) { _dcmdparser.add_dcmd_option(&_config_file); @@ -422,6 +443,12 @@ _dcmdparser.add_dcmd_option(&_jmxremote_ssl_enabled_protocols); _dcmdparser.add_dcmd_option(&_jmxremote_ssl_need_client_auth); _dcmdparser.add_dcmd_option(&_jmxremote_ssl_config_file); + _dcmdparser.add_dcmd_option(&_jmxremote_autodiscovery); + _dcmdparser.add_dcmd_option(&_jdp_port); + _dcmdparser.add_dcmd_option(&_jdp_address); + _dcmdparser.add_dcmd_option(&_jdp_source_addr); + _dcmdparser.add_dcmd_option(&_jdp_ttl); + _dcmdparser.add_dcmd_option(&_jdp_pause); } @@ -436,7 +463,6 @@ } } - void JMXStartRemoteDCmd::execute(TRAPS) { ResourceMark rm(THREAD); HandleMark hm(THREAD); @@ -466,7 +492,9 @@ // file. #define PUT_OPTION(a) \ if ( (a).is_set() ){ \ - options.print("%scom.sun.management.%s=%s", comma, (a).name(), (a).value()); \ + options.print(\ + ( *((a).type()) == 'I' ) ? "%scom.sun.management.%s=%d" : "%scom.sun.management.%s=%s",\ + comma, (a).name(), (a).value()); \ comma[0] = ','; \ } @@ -483,6 +511,12 @@ PUT_OPTION(_jmxremote_ssl_enabled_protocols); PUT_OPTION(_jmxremote_ssl_need_client_auth); PUT_OPTION(_jmxremote_ssl_config_file); + PUT_OPTION(_jmxremote_autodiscovery); + PUT_OPTION(_jdp_port); + PUT_OPTION(_jdp_address); + PUT_OPTION(_jdp_source_addr); + PUT_OPTION(_jdp_ttl); + PUT_OPTION(_jdp_pause); #undef PUT_OPTION
--- a/src/share/vm/services/diagnosticCommand.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/diagnosticCommand.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -236,6 +236,16 @@ DCmdArgument<char *> _jmxremote_ssl_need_client_auth; DCmdArgument<char *> _jmxremote_ssl_config_file; + // JDP support + // Keep autodiscovery char* not bool to pass true/false + // as property value to java level. + DCmdArgument<char *> _jmxremote_autodiscovery; + DCmdArgument<jlong> _jdp_port; + DCmdArgument<char *> _jdp_address; + DCmdArgument<char *> _jdp_source_addr; + DCmdArgument<jlong> _jdp_ttl; + DCmdArgument<jlong> _jdp_pause; + public: JMXStartRemoteDCmd(outputStream *output, bool heap_allocated);
--- a/src/share/vm/services/heapDumper.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/heapDumper.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,9 +77,9 @@ // returns error message (resource allocated), or NULL if no error char* error_as_C_string() const; - static void dump_heap() KERNEL_RETURN; + static void dump_heap(); - static void dump_heap_from_oome() KERNEL_RETURN; + static void dump_heap_from_oome(); }; #endif // SHARE_VM_SERVICES_HEAPDUMPER_HPP
--- a/src/share/vm/services/management.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/management.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -113,10 +113,8 @@ _optional_support.isBootClassPathSupported = 1; _optional_support.isObjectMonitorUsageSupported = 1; -#ifndef SERVICES_KERNEL // This depends on the heap inspector _optional_support.isSynchronizerUsageSupported = 1; -#endif // SERVICES_KERNEL _optional_support.isThreadAllocatedMemorySupported = 1; // Registration of the diagnostic commands @@ -2116,7 +2114,6 @@ // Dump heap - Returns 0 if succeeds. JVM_ENTRY(jint, jmm_DumpHeap0(JNIEnv *env, jstring outputfile, jboolean live)) -#ifndef SERVICES_KERNEL ResourceMark rm(THREAD); oop on = JNIHandles::resolve_external_guard(outputfile); if (on == NULL) { @@ -2134,9 +2131,6 @@ THROW_MSG_(vmSymbols::java_io_IOException(), errmsg, -1); } return 0; -#else // SERVICES_KERNEL - return -1; -#endif // SERVICES_KERNEL JVM_END JVM_ENTRY(jobjectArray, jmm_GetDiagnosticCommands(JNIEnv *env))
--- a/src/share/vm/services/memBaseline.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/memBaseline.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,6 @@ * */ #include "precompiled.hpp" -#include "classfile/systemDictionary.hpp" #include "memory/allocation.hpp" #include "services/memBaseline.hpp" #include "services/memTracker.hpp" @@ -350,7 +349,7 @@ reset(); _baselined = baseline_malloc_summary(snapshot._alloc_ptrs) && baseline_vm_summary(snapshot._vm_ptrs); - _number_of_classes = SystemDictionary::number_of_classes(); + _number_of_classes = snapshot.number_of_classes(); if (!summary_only && MemTracker::track_callsite() && _baselined) { _baselined = baseline_malloc_details(snapshot._alloc_ptrs) &&
--- a/src/share/vm/services/memRecorder.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/memRecorder.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,10 +84,13 @@ } delete _pointer_records; } - if (_next != NULL) { - delete _next; + // delete all linked recorders + while (_next != NULL) { + MemRecorder* tmp = _next; + _next = _next->next(); + tmp->set_next(NULL); + delete tmp; } - Atomic::dec(&_instance_count); }
--- a/src/share/vm/services/memRecorder.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/memRecorder.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -203,6 +203,7 @@ friend class MemSnapshot; friend class MemTracker; friend class MemTrackWorker; + friend class GenerationData; protected: // the array that holds memory records
--- a/src/share/vm/services/memSnapshot.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/memSnapshot.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -384,6 +384,7 @@ _staging_area.init(); _lock = new (std::nothrow) Mutex(Monitor::max_nonleaf - 1, "memSnapshotLock"); NOT_PRODUCT(_untracked_count = 0;) + _number_of_classes = 0; } MemSnapshot::~MemSnapshot() { @@ -479,7 +480,7 @@ // promote data to next generation -bool MemSnapshot::promote() { +bool MemSnapshot::promote(int number_of_classes) { assert(_alloc_ptrs != NULL && _vm_ptrs != NULL, "Just check"); assert(_staging_area.malloc_data() != NULL && _staging_area.vm_data() != NULL, "Just check"); @@ -496,6 +497,7 @@ NOT_PRODUCT(check_malloc_pointers();) _staging_area.clear(); + _number_of_classes = number_of_classes; return promoted; }
--- a/src/share/vm/services/memSnapshot.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/memSnapshot.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -355,6 +355,9 @@ // the lock to protect this snapshot Monitor* _lock; + // the number of instance classes + int _number_of_classes; + NOT_PRODUCT(size_t _untracked_count;) friend class MemBaseline; @@ -375,8 +378,9 @@ // merge a per-thread memory recorder into staging area bool merge(MemRecorder* rec); // promote staged data to snapshot - bool promote(); + bool promote(int number_of_classes); + int number_of_classes() const { return _number_of_classes; } void wait(long timeout) { assert(_lock != NULL, "Just check");
--- a/src/share/vm/services/memTrackWorker.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/memTrackWorker.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,16 @@ #include "utilities/decoder.hpp" #include "utilities/vmError.hpp" + +void GenerationData::reset() { + _number_of_classes = 0; + while (_recorder_list != NULL) { + MemRecorder* tmp = _recorder_list; + _recorder_list = _recorder_list->next(); + MemTracker::release_thread_recorder(tmp); + } +} + MemTrackWorker::MemTrackWorker() { // create thread uses cgc thread type for now. We should revisit // the option, or create new thread type. @@ -39,7 +49,7 @@ if (!has_error()) { _head = _tail = 0; for(int index = 0; index < MAX_GENERATIONS; index ++) { - _gen[index] = NULL; + ::new ((void*)&_gen[index]) GenerationData(); } } NOT_PRODUCT(_sync_point_count = 0;) @@ -49,10 +59,7 @@ MemTrackWorker::~MemTrackWorker() { for (int index = 0; index < MAX_GENERATIONS; index ++) { - MemRecorder* rc = _gen[index]; - if (rc != NULL) { - delete rc; - } + _gen[index].reset(); } } @@ -90,12 +97,7 @@ { // take a recorder from earliest generation in buffer ThreadCritical tc; - rec = _gen[_head]; - if (rec != NULL) { - _gen[_head] = rec->next(); - } - assert(count_recorder(_gen[_head]) <= MemRecorder::_instance_count, - "infinite loop after dequeue"); + rec = _gen[_head].next_recorder(); } if (rec != NULL) { // merge the recorder into staging area @@ -109,16 +111,20 @@ // no more recorder to merge, promote staging area // to snapshot if (_head != _tail) { + long number_of_classes; { ThreadCritical tc; - if (_gen[_head] != NULL || _head == _tail) { + if (_gen[_head].has_more_recorder() || _head == _tail) { continue; } + number_of_classes = _gen[_head].number_of_classes(); + _gen[_head].reset(); + // done with this generation, increment _head pointer _head = (_head + 1) % MAX_GENERATIONS; } // promote this generation data to snapshot - if (!snapshot->promote()) { + if (!snapshot->promote(number_of_classes)) { // failed to promote, means out of memory MemTracker::shutdown(MemTracker::NMT_out_of_memory); } @@ -126,8 +132,8 @@ snapshot->wait(1000); ThreadCritical tc; // check if more data arrived - if (_gen[_head] == NULL) { - _gen[_head] = MemTracker::get_pending_recorders(); + if (!_gen[_head].has_more_recorder()) { + _gen[_head].add_recorders(MemTracker::get_pending_recorders()); } } } @@ -147,7 +153,7 @@ // 1. add all recorders in pending queue to current generation // 2. increase generation -void MemTrackWorker::at_sync_point(MemRecorder* rec) { +void MemTrackWorker::at_sync_point(MemRecorder* rec, int number_of_classes) { NOT_PRODUCT(_sync_point_count ++;) assert(count_recorder(rec) <= MemRecorder::_instance_count, "pending queue has infinite loop"); @@ -155,23 +161,15 @@ bool out_of_generation_buffer = false; // check shutdown state inside ThreadCritical if (MemTracker::shutdown_in_progress()) return; + + _gen[_tail].set_number_of_classes(number_of_classes); // append the recorders to the end of the generation - if( rec != NULL) { - MemRecorder* cur_head = _gen[_tail]; - if (cur_head == NULL) { - _gen[_tail] = rec; - } else { - while (cur_head->next() != NULL) { - cur_head = cur_head->next(); - } - cur_head->set_next(rec); - } - } - assert(count_recorder(rec) <= MemRecorder::_instance_count, + _gen[_tail].add_recorders(rec); + assert(count_recorder(_gen[_tail].peek()) <= MemRecorder::_instance_count, "after add to current generation has infinite loop"); // we have collected all recorders for this generation. If there is data, // we need to increment _tail to start a new generation. - if (_gen[_tail] != NULL || _head == _tail) { + if (_gen[_tail].has_more_recorder() || _head == _tail) { _tail = (_tail + 1) % MAX_GENERATIONS; out_of_generation_buffer = (_tail == _head); } @@ -194,7 +192,7 @@ int MemTrackWorker::count_pending_recorders() const { int count = 0; for (int index = 0; index < MAX_GENERATIONS; index ++) { - MemRecorder* head = _gen[index]; + MemRecorder* head = _gen[index].peek(); if (head != NULL) { count += count_recorder(head); }
--- a/src/share/vm/services/memTrackWorker.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/memTrackWorker.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,17 +32,58 @@ // Maximum MAX_GENERATIONS generation data can be tracked. #define MAX_GENERATIONS 512 +class GenerationData : public _ValueObj { + private: + int _number_of_classes; + MemRecorder* _recorder_list; + + public: + GenerationData(): _number_of_classes(0), _recorder_list(NULL) { } + + inline int number_of_classes() const { return _number_of_classes; } + inline void set_number_of_classes(long num) { _number_of_classes = num; } + + inline MemRecorder* next_recorder() { + if (_recorder_list == NULL) { + return NULL; + } else { + MemRecorder* tmp = _recorder_list; + _recorder_list = _recorder_list->next(); + return tmp; + } + } + + inline bool has_more_recorder() const { + return (_recorder_list != NULL); + } + + // add recorders to this generation + void add_recorders(MemRecorder* head) { + if (head != NULL) { + if (_recorder_list == NULL) { + _recorder_list = head; + } else { + MemRecorder* tmp = _recorder_list; + for (; tmp->next() != NULL; tmp = tmp->next()); + tmp->set_next(head); + } + } + } + + void reset(); + + NOT_PRODUCT(MemRecorder* peek() const { return _recorder_list; }) +}; class MemTrackWorker : public NamedThread { private: - // circular buffer. This buffer contains recorders to be merged into global + // circular buffer. This buffer contains generation data to be merged into global // snaphsot. - // Each slot holds a linked list of memory recorders, that contains one - // generation of memory data. - MemRecorder* _gen[MAX_GENERATIONS]; - int _head, _tail; // head and tail pointers to above circular buffer + // Each slot holds a generation + GenerationData _gen[MAX_GENERATIONS]; + int _head, _tail; // head and tail pointers to above circular buffer - bool _has_error; + bool _has_error; public: MemTrackWorker(); @@ -56,7 +97,7 @@ inline bool has_error() const { return _has_error; } // task at synchronization point - void at_sync_point(MemRecorder* pending_recorders); + void at_sync_point(MemRecorder* pending_recorders, int number_of_classes); // for debugging purpose, they are not thread safe. NOT_PRODUCT(static int count_recorder(const MemRecorder* head);)
--- a/src/share/vm/services/memTracker.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/memTracker.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "oops/instanceKlass.hpp" #include "runtime/atomic.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/mutexLocker.hpp" @@ -485,7 +486,7 @@ } // check _worker_thread with lock to avoid racing condition if (_worker_thread != NULL) { - _worker_thread->at_sync_point(pending_recorders); + _worker_thread->at_sync_point(pending_recorders, instanceKlass::number_of_instance_classes()); } assert(SequenceGenerator::peek() == 1, "Should not have memory activities during sync-point");
--- a/src/share/vm/services/memTracker.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/memTracker.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,6 +72,7 @@ * MemTracker is the 'gate' class to native memory tracking runtime. */ class MemTracker : AllStatic { + friend class GenerationData; friend class MemTrackWorker; friend class MemSnapshot; friend class SyncThreadRecorderClosure;
--- a/src/share/vm/services/runtimeService.cpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/services/runtimeService.cpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -101,9 +101,6 @@ memset((void*) capabilities, '0', len); capabilities[len-1] = '\0'; capabilities[0] = AttachListener::is_attach_supported() ? '1' : '0'; -#ifdef KERNEL - capabilities[1] = '1'; -#endif // KERNEL PerfDataManager::create_string_constant(SUN_RT, "jvmCapabilities", capabilities, CHECK); }
--- a/src/share/vm/trace/trace.dtd Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/trace/trace.dtd Fri Feb 01 12:36:53 2013 -0800 @@ -23,7 +23,7 @@ --> -<!ELEMENT trace (xi:include, relation_decls, events*, xi:include)> +<!ELEMENT trace (xi:include, relation_decls, events*, xi:include, xi:include)> <!ELEMENT types (content_types, primary_types)> <!ELEMENT content_types (content_type|struct_type)*> <!ELEMENT content_type (value|structvalue|structarray|array)*>
--- a/src/share/vm/trace/trace.xml Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/trace/trace.xml Fri Feb 01 12:36:53 2013 -0800 @@ -155,8 +155,8 @@ <value type="ULONG" field="gcId" label="GC ID" relation="GC_ID" /> <value type="GCNAME" field="name" label="Name" description="The name of the Garbage Collector" /> <value type="GCCAUSE" field="cause" label="Cause" description="The reason for triggering this Garbage Collection" /> - <value type="TICKS" field="sumOfPauses" label="Sum of Pauses" description="Sum of all the times in which Java execution was paused during the garbage collection" /> - <value type="TICKS" field="longestPause" label="Longest Pause" description="Longest individual pause during the garbage collection" /> + <value type="RELATIVE_TICKS" field="sumOfPauses" label="Sum of Pauses" description="Sum of all the times in which Java execution was paused during the garbage collection" /> + <value type="RELATIVE_TICKS" field="longestPause" label="Longest Pause" description="Longest individual pause during the garbage collection" /> </event> <event id="GCParallelOld" path="vm/gc/collector/parold_garbage_collection" label="Parallel Old Garbage Collection" @@ -288,6 +288,10 @@ </events> + <xi:include href="../../../closed/share/vm/trace/traceeventtypes.xml" xmlns:xi="http://www.w3.org/2001/XInclude"> + <xi:fallback/> + </xi:include> + <xi:include href="../../../closed/share/vm/trace/traceevents.xml" xmlns:xi="http://www.w3.org/2001/XInclude"> <xi:fallback/> </xi:include>
--- a/src/share/vm/trace/traceEventClasses.xsl Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/trace/traceEventClasses.xsl Fri Feb 01 12:36:53 2013 -0800 @@ -166,6 +166,14 @@ #endif </xsl:template> +<xsl:template match="value[@type='RELATIVE_TICKS']" mode="write-setters"> +#if INCLUDE_TRACE + <xsl:value-of select="concat('void set_', @field, '(jlong time) { _', @field, ' = time; }')"/> +#else + <xsl:value-of select="concat('void set_', @field, '(jlong ignore) {}')"/> +#endif +</xsl:template> + <xsl:template match="value" mode="write-fields"> <xsl:variable name="type" select="@type"/> <xsl:variable name="wt" select="//primary_type[@symbol=$type]/@type"/>
--- a/src/share/vm/trace/traceTime.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/trace/traceTime.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -28,5 +28,6 @@ #include "prims/jni.h" typedef jlong TracingTime; +typedef jlong RelativeTracingTime; #endif
--- a/src/share/vm/trace/tracetypes.xml Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/trace/tracetypes.xml Fri Feb 01 12:36:53 2013 -0800 @@ -264,10 +264,14 @@ <primary_type symbol="NANOS" datatype="LONG" contenttype="NANOS" type="s8" sizeop="sizeof(s8)"/> - <!-- 64-bit unsigned integer, SEMANTIC value RELATIVE TICKS --> + <!-- 64-bit signed integer, SEMANTIC value ABSOLUTE TICKS --> <primary_type symbol="TICKS" datatype="LONG" contenttype="TICKS" type="s8" sizeop="sizeof(s8)"/> + <!-- 64-bit signed integer, SEMANTIC value RELATIVE TICKS --> + <primary_type symbol="RELATIVE_TICKS" datatype="LONG" contenttype="TICKS" + type="s8" sizeop="sizeof(s8)"/> + <!-- 64-bit unsigned integer, SEMANTIC value ADDRESS (mem loc) --> <primary_type symbol="ADDRESS" datatype="U8" contenttype="ADDRESS" type="u8" sizeop="sizeof(u8)"/>
--- a/src/share/vm/utilities/macros.hpp Fri Feb 01 09:56:38 2013 -0800 +++ b/src/share/vm/utilities/macros.hpp Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,26 +34,6 @@ // Makes a string of the macro expansion of a #define XSTR(a) STR(a) -// KERNEL variant -#ifdef KERNEL -#define COMPILER1 -#define SERIALGC - -#define JVMTI_KERNEL -#define FPROF_KERNEL -#define VM_STRUCTS_KERNEL -#define JNICHECK_KERNEL -#define SERVICES_KERNEL - -#define KERNEL_RETURN {} -#define KERNEL_RETURN_(code) { return code; } - -#else // KERNEL - -#define KERNEL_RETURN /* next token must be ; */ -#define KERNEL_RETURN_(code) /* next token must be ; */ - -#endif // KERNEL // COMPILER1 variant #ifdef COMPILER1 @@ -177,6 +157,22 @@ #define NOT_WIN64(code) code #endif +#if defined(ZERO) +#define ZERO_ONLY(code) code +#define NOT_ZERO(code) +#else +#define ZERO_ONLY(code) +#define NOT_ZERO(code) code +#endif + +#if defined(SHARK) +#define SHARK_ONLY(code) code +#define NOT_SHARK(code) +#else +#define SHARK_ONLY(code) +#define NOT_SHARK(code) code +#endif + #if defined(IA32) || defined(AMD64) #define X86 #define X86_ONLY(code) code
--- a/test/compiler/7190310/Test7190310.java Fri Feb 01 09:56:38 2013 -0800 +++ b/test/compiler/7190310/Test7190310.java Fri Feb 01 12:36:53 2013 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,16 @@ */ /* - * Manual test + * @test + * @bug 7190310 + * @summary Inlining WeakReference.get(), and hoisting $referent may lead to non-terminating loops + * @run main/othervm/timeout=600 -Xbatch Test7190310 + */ + +/* + * Note bug exhibits as infinite loop, timeout is helpful. + * It should normally finish pretty quickly, but on some especially slow machines + * it may not. The companion _unsafe test lacks a timeout, but that is okay. */ import java.lang.ref.*;