7003401: Implement VM error-reporting functionality on erroneous termination

Tue, 08 Feb 2011 17:20:45 -0500

author
kamg
date
Tue, 08 Feb 2011 17:20:45 -0500
changeset 2515
d8a72fbc4be7
parent 2513
5e139f767ddb
child 2517
5fb3ee258e76

7003401: Implement VM error-reporting functionality on erroneous termination
Summary: Add support for distribution-specific error reporting
Reviewed-by: coleenp, phh, jcoomes, ohair

make/Makefile file | annotate | diff | comparison | revisions
make/altsrc.make file | annotate | diff | comparison | revisions
make/closed.make file | annotate | diff | comparison | revisions
make/linux/makefiles/adlc.make file | annotate | diff | comparison | revisions
make/linux/makefiles/buildtree.make file | annotate | diff | comparison | revisions
make/linux/makefiles/rules.make file | annotate | diff | comparison | revisions
make/linux/makefiles/top.make file | annotate | diff | comparison | revisions
make/linux/makefiles/vm.make file | annotate | diff | comparison | revisions
make/solaris/makefiles/adlc.make file | annotate | diff | comparison | revisions
make/solaris/makefiles/buildtree.make file | annotate | diff | comparison | revisions
make/solaris/makefiles/rules.make file | annotate | diff | comparison | revisions
make/solaris/makefiles/top.make file | annotate | diff | comparison | revisions
make/solaris/makefiles/vm.make file | annotate | diff | comparison | revisions
make/windows/create_obj_files.sh file | annotate | diff | comparison | revisions
make/windows/makefiles/vm.make file | annotate | diff | comparison | revisions
src/share/vm/runtime/globals.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/vm_version.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/vm_version.hpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/errorReporter.cpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/errorReporter.hpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/ostream.cpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/ostream.hpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/vmError.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/make/Makefile	Thu Feb 03 20:30:19 2011 -0800
     1.2 +++ b/make/Makefile	Tue Feb 08 17:20:45 2011 -0500
     1.3 @@ -73,7 +73,7 @@
     1.4    include defs.make
     1.5  endif
     1.6  
     1.7 -include $(GAMMADIR)/make/closed.make
     1.8 +include $(GAMMADIR)/make/altsrc.make
     1.9  
    1.10  ifneq ($(ALT_OUTPUTDIR),)
    1.11    ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR)
    1.12 @@ -362,7 +362,8 @@
    1.13  $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/%
    1.14  	$(install-file)
    1.15  
    1.16 -$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h:  $(HS_JNI_ARCH_SRC)
    1.17 +HS_JNI_ARCH_SRC=$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h)
    1.18 +$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_JNI_ARCH_SRC)
    1.19  	$(install-file)
    1.20  
    1.21  $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/%
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/make/altsrc.make	Tue Feb 08 17:20:45 2011 -0500
     2.3 @@ -0,0 +1,92 @@
     2.4 +#
     2.5 +# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     2.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.7 +#
     2.8 +# This code is free software; you can redistribute it and/or modify it
     2.9 +# under the terms of the GNU General Public License version 2 only, as
    2.10 +# published by the Free Software Foundation.
    2.11 +#
    2.12 +# This code is distributed in the hope that it will be useful, but WITHOUT
    2.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    2.14 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    2.15 +# version 2 for more details (a copy is included in the LICENSE file that
    2.16 +# accompanied this code).
    2.17 +#
    2.18 +# You should have received a copy of the GNU General Public License version
    2.19 +# 2 along with this work; if not, write to the Free Software Foundation,
    2.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    2.21 +#
    2.22 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    2.23 +# or visit www.oracle.com if you need additional information or have any
    2.24 +# questions.
    2.25 +#  
    2.26 +#
    2.27 +
    2.28 +# This file defines variables and macros which are used in the makefiles to 
    2.29 +# allow distributions to augment or replace common hotspot code with 
    2.30 +# distribution-specific source files.
    2.31 +
    2.32 +# Requires: GAMMADIR
    2.33 +# Provides:
    2.34 +#   variables: HS_COMMON_SRC, HS_ALT_SRC, HS_COMMON_SRC_REL, and HS_ALT_SRC_REL
    2.35 +#   functions: altsrc-equiv, if-has-altsrc, altsrc, altsrc-replace
    2.36 +
    2.37 +HS_COMMON_SRC_REL=src
    2.38 +
    2.39 +# This needs to be changed to a more generic location, but we keep it as this 
    2.40 +# for now for compatibility
    2.41 +HS_ALT_SRC_REL=src/closed
    2.42 +
    2.43 +HS_COMMON_SRC=$(GAMMADIR)/$(HS_COMMON_SRC_REL)
    2.44 +HS_ALT_SRC=$(GAMMADIR)/$(HS_ALT_SRC_REL)
    2.45 +
    2.46 +
    2.47 +## altsrc-equiv 
    2.48 +# 
    2.49 +# Convert a common source path to an alternative source path
    2.50 +#
    2.51 +# Parameter: An absolute path into the common sources
    2.52 +# Result: The matching path to the alternate-source location
    2.53 +#
    2.54 +altsrc-equiv=$(subst $(HS_COMMON_SRC)/,$(HS_ALT_SRC)/,$(1))
    2.55 +
    2.56 +
    2.57 +## if-has-altsrc
    2.58 +#
    2.59 +# Conditional macro to test for the existence of an alternate source path
    2.60 +#
    2.61 +# Parameter: An absolute path into the common sources
    2.62 +# Parameter: Result if the alternative-source location exists
    2.63 +# Parameter: Result if the alternative-source location does not exist
    2.64 +# Result: expands to parameter 2 or 3 depending on existence of alternate source
    2.65 +#
    2.66 +if-has-altsrc=$(if $(wildcard $(call altsrc-equiv,$(1))),$(2),$(3))
    2.67 +
    2.68 +
    2.69 +## altsrc
    2.70 +#
    2.71 +# Converts common source path to alternate source path if the alternate 
    2.72 +# path exists, otherwise evaluates to nul (empty string)
    2.73 +# 
    2.74 +# Parameter: An absolute path into the common sources
    2.75 +# Result: The equivalent path to the alternate-source location, if such a 
    2.76 +#         location exists on the filesystem.  Otherwise it expands to empty.
    2.77 +# 
    2.78 +altsrc=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1)))
    2.79 +
    2.80 +## commonsrc
    2.81 +# 
    2.82 +# Returns parameter.
    2.83 +#
    2.84 +commonsrc=$(1)
    2.85 +
    2.86 +
    2.87 +## altsrc-replace
    2.88 +#
    2.89 +# Converts a common source path to an alternate source path if the alternate
    2.90 +# source path exists.  Otherwise it evaluates to the input common source path.
    2.91 +#
    2.92 +# Parameter: An absolute path into the common sources
    2.93 +# Result: A path to either the common or alternate sources
    2.94 +#
    2.95 +altsrc-replace=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1)),$(1))
     3.1 --- a/make/closed.make	Thu Feb 03 20:30:19 2011 -0800
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,59 +0,0 @@
     3.4 -#
     3.5 -# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     3.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.7 -#
     3.8 -# This code is free software; you can redistribute it and/or modify it
     3.9 -# under the terms of the GNU General Public License version 2 only, as
    3.10 -# published by the Free Software Foundation.
    3.11 -#
    3.12 -# This code is distributed in the hope that it will be useful, but WITHOUT
    3.13 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    3.14 -# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    3.15 -# version 2 for more details (a copy is included in the LICENSE file that
    3.16 -# accompanied this code).
    3.17 -#
    3.18 -# You should have received a copy of the GNU General Public License version
    3.19 -# 2 along with this work; if not, write to the Free Software Foundation,
    3.20 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    3.21 -#
    3.22 -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    3.23 -# or visit www.oracle.com if you need additional information or have any
    3.24 -# questions.
    3.25 -#  
    3.26 -#
    3.27 -
    3.28 -# Support for setting HS_CLOSED_PATH, required GAMMADIR and SRCARCH
    3.29 -
    3.30 -CLOSED_DIR_EXISTS := $(shell                                \
    3.31 -  if [ -d $(GAMMADIR)/src/closed ] ; then                   \
    3.32 -    echo true;                                              \
    3.33 -  else                                                      \
    3.34 -    echo false;                                             \
    3.35 -  fi)
    3.36 -
    3.37 -CLOSED_SRCARCH_DIR_EXISTS := $(shell                        \
    3.38 -  if [ -d $(GAMMADIR)/src/closed/cpu/$(SRCARCH)/vm ] ; then \
    3.39 -    echo true;                                              \
    3.40 -  else                                                      \
    3.41 -    echo false;                                             \
    3.42 -  fi)
    3.43 -
    3.44 -ifeq ($(CLOSED_SRCARCH_DIR_EXISTS), true)
    3.45 -  HS_CLOSED_PATH=closed/
    3.46 -endif
    3.47 -
    3.48 -# Support for setting HS_JNI_ARCH_SRC, requires HS_SRC_DIR and HS_ARCH
    3.49 -
    3.50 -CLOSED_HS_ARCH_DIR_EXISTS := $(shell                        \
    3.51 -  if [ -d $(HS_SRC_DIR)/closed/cpu/$(HS_ARCH)/vm ] ; then   \
    3.52 -    echo true;                                              \
    3.53 -  else                                                      \
    3.54 -    echo false;                                             \
    3.55 -  fi)
    3.56 -
    3.57 -ifeq ($(CLOSED_HS_ARCH_DIR_EXISTS), true)
    3.58 -  HS_JNI_ARCH_SRC=$(HS_SRC_DIR)/closed/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h
    3.59 -else
    3.60 -  HS_JNI_ARCH_SRC=$(HS_SRC_DIR)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h
    3.61 -endif
    3.62 -
     4.1 --- a/make/linux/makefiles/adlc.make	Thu Feb 03 20:30:19 2011 -0800
     4.2 +++ b/make/linux/makefiles/adlc.make	Tue Feb 08 17:20:45 2011 -0500
     4.3 @@ -1,5 +1,5 @@
     4.4  #
     4.5 -# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
     4.6 +# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
     4.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8  #
     4.9  # This code is free software; you can redistribute it and/or modify it
    4.10 @@ -39,8 +39,9 @@
    4.11  
    4.12  SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad 
    4.13  
    4.14 -SOURCES.AD = $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(ARCH)/vm/$(Platform_arch_model).ad \
    4.15 -	     $(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad 
    4.16 +SOURCES.AD = \
    4.17 +  $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
    4.18 +  $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
    4.19  
    4.20  EXEC	= $(OUTDIR)/adlc
    4.21  
     5.1 --- a/make/linux/makefiles/buildtree.make	Thu Feb 03 20:30:19 2011 -0800
     5.2 +++ b/make/linux/makefiles/buildtree.make	Tue Feb 08 17:20:45 2011 -0500
     5.3 @@ -1,5 +1,5 @@
     5.4  #
     5.5 -# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
     5.6 +# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
     5.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.8  #
     5.9  # This code is free software; you can redistribute it and/or modify it
    5.10 @@ -56,7 +56,7 @@
    5.11  # having to read the dependency files for the vm.
    5.12  
    5.13  include $(GAMMADIR)/make/scm.make
    5.14 -include $(GAMMADIR)/make/closed.make
    5.15 +include $(GAMMADIR)/make/altsrc.make
    5.16  
    5.17  
    5.18  # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
    5.19 @@ -148,7 +148,7 @@
    5.20  # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro
    5.21  # or make/hotspot_distro.
    5.22  ifndef HOTSPOT_VM_DISTRO
    5.23 -  ifeq ($(CLOSED_DIR_EXISTS), true)
    5.24 +  ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
    5.25      include $(GAMMADIR)/make/hotspot_distro
    5.26    else
    5.27      include $(GAMMADIR)/make/openjdk_distro
    5.28 @@ -173,6 +173,11 @@
    5.29  $(SIMPLE_DIRS):
    5.30  	$(QUIETLY) mkdir -p $@
    5.31  
    5.32 +# Convenience macro which takes a source relative path, applies $(1) to the
    5.33 +# absolute path, and then replaces $(GAMMADIR) in the result with a 
    5.34 +# literal "$(GAMMADIR)/" suitable for inclusion in a Makefile.  
    5.35 +gamma-path=$(subst $(GAMMADIR),\$$(GAMMADIR),$(call $(1),$(HS_COMMON_SRC)/$(2)))
    5.36 +
    5.37  flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
    5.38  	@echo Creating $@ ...
    5.39  	$(QUIETLY) ( \
    5.40 @@ -204,16 +209,28 @@
    5.41  	echo; \
    5.42  	echo "Src_Dirs_V = \\"; \
    5.43  	sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \
    5.44 -	echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(SRCARCH)/vm \\"; \
    5.45 -	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
    5.46 -	echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm"; \
    5.47 +	echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \
    5.48 +	echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \
    5.49 +	echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \
    5.50 +	echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \
    5.51 +	echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \
    5.52 +	echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \
    5.53 +	echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \
    5.54 +	echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
    5.55  	echo; \
    5.56  	echo "Src_Dirs_I = \\"; \
    5.57 -	echo "\$$(GAMMADIR)/src/share/vm \\"; \
    5.58 -	echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \
    5.59 -	echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(SRCARCH)/vm \\"; \
    5.60 -	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
    5.61 -	echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm"; \
    5.62 +	echo "$(call gamma-path,altsrc,share/vm/prims) \\"; \
    5.63 +	echo "$(call gamma-path,commonsrc,share/vm/prims) \\"; \
    5.64 +	echo "$(call gamma-path,altsrc,share/vm) \\"; \
    5.65 +	echo "$(call gamma-path,commonsrc,share/vm) \\"; \
    5.66 +	echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \
    5.67 +	echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \
    5.68 +	echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \
    5.69 +	echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \
    5.70 +	echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \
    5.71 +	echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \
    5.72 +	echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \
    5.73 +	echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
    5.74  	[ -n "$(CFLAGS_BROWSE)" ] && \
    5.75  	    echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
    5.76  	[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
    5.77 @@ -237,9 +254,14 @@
    5.78  
    5.79  ../shared_dirs.lst:  $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm
    5.80  	@echo Creating directory list $@
    5.81 -	$(QUIETLY) find $(GAMMADIR)/src/share/vm/* -prune \
    5.82 +	$(QUIETLY) if [ -d $(HS_ALT_SRC)/share/vm ]; then \
    5.83 +          find $(HS_ALT_SRC)/share/vm/* -prune \
    5.84 +	  -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \
    5.85 +          \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@; \
    5.86 +        fi;
    5.87 +	$(QUIETLY) find $(HS_COMMON_SRC)/share/vm/* -prune \
    5.88  	-type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \
    5.89 -        \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@
    5.90 +        \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; >> $@
    5.91  
    5.92  Makefile: $(BUILDTREE_MAKE)
    5.93  	@echo Creating $@ ...
     6.1 --- a/make/linux/makefiles/rules.make	Thu Feb 03 20:30:19 2011 -0800
     6.2 +++ b/make/linux/makefiles/rules.make	Tue Feb 08 17:20:45 2011 -0500
     6.3 @@ -1,5 +1,5 @@
     6.4  #
     6.5 -# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
     6.6 +# Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
     6.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6.8  #
     6.9  # This code is free software; you can redistribute it and/or modify it
    6.10 @@ -146,7 +146,7 @@
    6.11  include $(GAMMADIR)/make/pic.make
    6.12  endif
    6.13  
    6.14 -include $(GAMMADIR)/make/closed.make
    6.15 +include $(GAMMADIR)/make/altsrc.make
    6.16  
    6.17  # The non-PIC object files are only generated for 32 bit platforms.
    6.18  ifdef LP64
     7.1 --- a/make/linux/makefiles/top.make	Thu Feb 03 20:30:19 2011 -0800
     7.2 +++ b/make/linux/makefiles/top.make	Tue Feb 08 17:20:45 2011 -0500
     7.3 @@ -39,7 +39,7 @@
     7.4  # Instead, use "gmake" (or "gnumake") from the command line.  --Rose
     7.5  #MAKE = gmake
     7.6  
     7.7 -include $(GAMMADIR)/make/closed.make
     7.8 +include $(GAMMADIR)/make/altsrc.make
     7.9  
    7.10  TOPDIR      = $(shell echo `pwd`)
    7.11  GENERATED   = $(TOPDIR)/../generated
    7.12 @@ -59,8 +59,8 @@
    7.13  
    7.14  AD_Dir   = $(GENERATED)/adfiles
    7.15  ADLC     = $(AD_Dir)/adlc
    7.16 -AD_Spec  = $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad
    7.17 -AD_Src   = $(GAMMADIR)/src/share/vm/adlc
    7.18 +AD_Spec  = $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad)
    7.19 +AD_Src   = $(call altsrc-replace,$(HS_COMMON_SRC)/share/vm/adlc)
    7.20  AD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp
    7.21  AD_Files = $(AD_Names:%=$(AD_Dir)/%)
    7.22  
     8.1 --- a/make/linux/makefiles/vm.make	Thu Feb 03 20:30:19 2011 -0800
     8.2 +++ b/make/linux/makefiles/vm.make	Tue Feb 08 17:20:45 2011 -0500
     8.3 @@ -28,6 +28,7 @@
     8.4  # Common build rules.
     8.5  MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
     8.6  include $(MAKEFILES_DIR)/rules.make
     8.7 +include $(GAMMADIR)/make/altsrc.make
     8.8  
     8.9  default: build
    8.10  
    8.11 @@ -119,17 +120,27 @@
    8.12  LIBJVM   = lib$(JVM).so
    8.13  LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
    8.14  
    8.15 -CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \))
    8.16 -CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm
    8.17 -CORE_PATHS += $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(Platform_arch)/vm
    8.18 -CORE_PATHS += $(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(Platform_os_arch)/vm
    8.19 -CORE_PATHS += $(GENERATED)/jvmtifiles
    8.20 +SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt
    8.21  
    8.22 -COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1
    8.23 +SOURCE_PATHS=\
    8.24 +  $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \
    8.25 +      \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \))
    8.26 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm
    8.27 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm
    8.28 +SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm
    8.29 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm
    8.30  
    8.31 -COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto
    8.32 -COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt
    8.33 -COMPILER2_PATHS +=  $(GENERATED)/adfiles
    8.34 +CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
    8.35 +CORE_PATHS+=$(GENERATED)/jvmtifiles
    8.36 +
    8.37 +COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1)
    8.38 +COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1
    8.39 +
    8.40 +COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto)
    8.41 +COMPILER2_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/libadt)
    8.42 +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/opto
    8.43 +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/libadt
    8.44 +COMPILER2_PATHS += $(GENERATED)/adfiles
    8.45  
    8.46  # Include dirs per type.
    8.47  Src_Dirs/CORE      := $(CORE_PATHS)
     9.1 --- a/make/solaris/makefiles/adlc.make	Thu Feb 03 20:30:19 2011 -0800
     9.2 +++ b/make/solaris/makefiles/adlc.make	Tue Feb 08 17:20:45 2011 -0500
     9.3 @@ -27,6 +27,7 @@
     9.4  # It knows how to compile, link, and run the adlc.
     9.5  
     9.6  include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/rules.make
     9.7 +include $(GAMMADIR)/make/altsrc.make
     9.8  
     9.9  # #########################################################################
    9.10  
    9.11 @@ -39,8 +40,9 @@
    9.12  
    9.13  SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad 
    9.14  
    9.15 -SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \
    9.16 -	     $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad 
    9.17 +SOURCES.AD = \
    9.18 +  $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \
    9.19 +  $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad)
    9.20  
    9.21  EXEC	= $(OUTDIR)/adlc
    9.22  
    10.1 --- a/make/solaris/makefiles/buildtree.make	Thu Feb 03 20:30:19 2011 -0800
    10.2 +++ b/make/solaris/makefiles/buildtree.make	Tue Feb 08 17:20:45 2011 -0500
    10.3 @@ -56,6 +56,7 @@
    10.4  # having to read the dependency files for the vm.
    10.5  
    10.6  include $(GAMMADIR)/make/scm.make
    10.7 +include $(GAMMADIR)/make/altsrc.make
    10.8  
    10.9  # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
   10.10  QUIETLY$(MAKE_VERBOSE)	= @
   10.11 @@ -139,13 +140,7 @@
   10.12  # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro
   10.13  # or make/hotspot_distro.
   10.14  ifndef HOTSPOT_VM_DISTRO
   10.15 -  CLOSED_DIR_EXISTS := $(shell                \
   10.16 -    if [ -d $(GAMMADIR)/src/closed ] ; then \
   10.17 -      echo true;                              \
   10.18 -    else                                      \
   10.19 -      echo false;                             \
   10.20 -    fi)
   10.21 -  ifeq ($(CLOSED_DIR_EXISTS), true)
   10.22 +  ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
   10.23      include $(GAMMADIR)/make/hotspot_distro
   10.24    else
   10.25      include $(GAMMADIR)/make/openjdk_distro
   10.26 @@ -170,6 +165,11 @@
   10.27  $(SIMPLE_DIRS):
   10.28  	$(QUIETLY) mkdir -p $@
   10.29  
   10.30 +# Convenience macro which takes a source relative path, applies $(1) to the
   10.31 +# absolute path, and then replaces $(GAMMADIR) in the result with a 
   10.32 +# literal "$(GAMMADIR)/" suitable for inclusion in a Makefile.  
   10.33 +gamma-path=$(subst $(GAMMADIR),\$$(GAMMADIR),$(call $(1),$(HS_COMMON_SRC)/$(2)))
   10.34 +
   10.35  flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
   10.36  	@echo Creating $@ ...
   10.37  	$(QUIETLY) ( \
   10.38 @@ -202,16 +202,28 @@
   10.39  	echo; \
   10.40  	echo "Src_Dirs_V = \\"; \
   10.41  	sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \
   10.42 -	echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
   10.43 -	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
   10.44 -	echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
   10.45 +	echo "$(call gamma-path,altsrc,cpu/$(ARCH)/vm) \\"; \
   10.46 +	echo "$(call gamma-path,commonsrc,cpu/$(ARCH)/vm) \\"; \
   10.47 +	echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \
   10.48 +	echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \
   10.49 +	echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \
   10.50 +	echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \
   10.51 +	echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \
   10.52 +	echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
   10.53  	echo; \
   10.54  	echo "Src_Dirs_I = \\"; \
   10.55 -	echo "\$$(GAMMADIR)/src/share/vm \\"; \
   10.56 -	echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \
   10.57 -	echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
   10.58 -	echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
   10.59 -	echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
   10.60 +	echo "$(call gamma-path,altsrc,share/vm/prims) \\"; \
   10.61 +	echo "$(call gamma-path,commonsrc,share/vm/prims) \\"; \
   10.62 +	echo "$(call gamma-path,altsrc,share/vm) \\"; \
   10.63 +	echo "$(call gamma-path,commonsrc,share/vm) \\"; \
   10.64 +	echo "$(call gamma-path,altsrc,cpu/$(ARCH)/vm) \\"; \
   10.65 +	echo "$(call gamma-path,commonsrc,cpu/$(ARCH)/vm) \\"; \
   10.66 +	echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \
   10.67 +	echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \
   10.68 +	echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \
   10.69 +	echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \
   10.70 +	echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \
   10.71 +	echo "$(call gamma-path,commonsrc,os/posix/vm)"; \
   10.72  	[ -n "$(CFLAGS_BROWSE)" ] && \
   10.73  	    echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
   10.74  	[ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
   10.75 @@ -235,9 +247,14 @@
   10.76  
   10.77  ../shared_dirs.lst:  $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm
   10.78  	@echo Creating directory list $@
   10.79 -	$(QUIETLY) find $(GAMMADIR)/src/share/vm/* -prune \
   10.80 +	$(QUIETLY) if [ -d $(HS_ALT_SRC)/share/vm ]; then \
   10.81 +          find $(HS_ALT_SRC)/share/vm/* -prune \
   10.82 +	  -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \
   10.83 +          \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@; \
   10.84 +        fi;
   10.85 +	$(QUIETLY) find $(HS_COMMON_SRC)/share/vm/* -prune \
   10.86  	-type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \
   10.87 -        \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@
   10.88 +        \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; >> $@
   10.89  
   10.90  Makefile: $(BUILDTREE_MAKE)
   10.91  	@echo Creating $@ ...
    11.1 --- a/make/solaris/makefiles/rules.make	Thu Feb 03 20:30:19 2011 -0800
    11.2 +++ b/make/solaris/makefiles/rules.make	Tue Feb 08 17:20:45 2011 -0500
    11.3 @@ -146,6 +146,8 @@
    11.4  include $(GAMMADIR)/make/pic.make
    11.5  endif
    11.6  
    11.7 +include $(GAMMADIR)/make/altsrc.make
    11.8 +
    11.9  # Sun compiler for 64 bit Solaris does not support building non-PIC object files.
   11.10  ifdef LP64
   11.11  %.o: %.cpp
    12.1 --- a/make/solaris/makefiles/top.make	Thu Feb 03 20:30:19 2011 -0800
    12.2 +++ b/make/solaris/makefiles/top.make	Tue Feb 08 17:20:45 2011 -0500
    12.3 @@ -39,6 +39,8 @@
    12.4  # Instead, use "gmake" (or "gnumake") from the command line.  --Rose
    12.5  #MAKE = gmake
    12.6  
    12.7 +include $(GAMMADIR)/make/altsrc.make
    12.8 +
    12.9  GENERATED   = ../generated
   12.10  VM          = $(GAMMADIR)/src/share/vm
   12.11  Plat_File   = $(Platform_file)
   12.12 @@ -48,8 +50,8 @@
   12.13  
   12.14  AD_Dir   = $(GENERATED)/adfiles
   12.15  ADLC     = $(AD_Dir)/adlc
   12.16 -AD_Spec  = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad
   12.17 -AD_Src   = $(GAMMADIR)/src/share/vm/adlc
   12.18 +AD_Spec  = $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad)
   12.19 +AD_Src   = $(call altsrc-replace,$(HS_COMMON_SRC)/share/vm/adlc)
   12.20  AD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp
   12.21  AD_Files = $(AD_Names:%=$(AD_Dir)/%)
   12.22  
    13.1 --- a/make/solaris/makefiles/vm.make	Thu Feb 03 20:30:19 2011 -0800
    13.2 +++ b/make/solaris/makefiles/vm.make	Tue Feb 08 17:20:45 2011 -0500
    13.3 @@ -28,6 +28,7 @@
    13.4  # Common build rules.
    13.5  MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
    13.6  include $(MAKEFILES_DIR)/rules.make
    13.7 +include $(GAMMADIR)/make/altsrc.make
    13.8  
    13.9  default: build
   13.10  
   13.11 @@ -139,16 +140,26 @@
   13.12  LIBJVM   = lib$(JVM).so
   13.13  LIBJVM_G = lib$(JVM)$(G_SUFFIX).so
   13.14  
   13.15 -CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \))
   13.16 -CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm
   13.17 -CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm
   13.18 -CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm
   13.19 -CORE_PATHS += $(GENERATED)/jvmtifiles
   13.20 +SPECIAL_PATHS:=adlc c1 dist gc_implementation opto shark libadt
   13.21  
   13.22 -COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1
   13.23 +SOURCE_PATHS=\
   13.24 +  $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \
   13.25 +      \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \))
   13.26 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm
   13.27 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm
   13.28 +SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm
   13.29 +SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm
   13.30  
   13.31 -COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto
   13.32 -COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt
   13.33 +CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
   13.34 +CORE_PATHS+=$(GENERATED)/jvmtifiles
   13.35 +
   13.36 +COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1)
   13.37 +COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1
   13.38 +
   13.39 +COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto)
   13.40 +COMPILER2_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/libadt)
   13.41 +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/opto
   13.42 +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/libadt
   13.43  COMPILER2_PATHS +=  $(GENERATED)/adfiles
   13.44  
   13.45  # Include dirs per type.
    14.1 --- a/make/windows/create_obj_files.sh	Thu Feb 03 20:30:19 2011 -0800
    14.2 +++ b/make/windows/create_obj_files.sh	Tue Feb 08 17:20:45 2011 -0500
    14.3 @@ -51,21 +51,48 @@
    14.4  WorkSpace=$4
    14.5  GENERATED=$5
    14.6  
    14.7 -BASE_PATHS="` $FIND ${WorkSpace}/src/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)`"
    14.8 -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/share/vm/gc_implementation/shared"
    14.9 -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os/${Platform_os_family}/vm"
   14.10 -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/cpu/${Platform_arch}/vm"
   14.11 -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os_cpu/${Platform_os_arch}/vm"
   14.12 +COMMONSRC_REL=src
   14.13 +ALTSRC_REL=src/closed # Change this to pick up alt sources from somewhere else
   14.14 +
   14.15 +COMMONSRC=${WorkSpace}/${COMMONSRC_REL}
   14.16 +ALTSRC=${WorkSpace}/${ALTSRC_REL}
   14.17 +
   14.18 +BASE_PATHS="`if [ -d ${ALTSRC}/share/vm ]; then $FIND ${ALTSRC}/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \); fi`"
   14.19 +BASE_PATHS="${BASE_PATHS} ` $FIND ${COMMONSRC}/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)`"
   14.20 +
   14.21 +for sd in \
   14.22 +    share/vm/gc_implementation/shared \
   14.23 +    os/${Platform_os_family}/vm \
   14.24 +    cpu/${Platform_arch}/vm \
   14.25 +    os_cpu/${Platform_os_arch}/vm; do 
   14.26 +  if [ -d "${ALTSRC}/${sd}" ]; then
   14.27 +    BASE_PATHS="${BASE_PATHS} ${ALTSRC}/${sd}"
   14.28 +  fi
   14.29 +  BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/${sd}"
   14.30 +done
   14.31 +
   14.32  BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles"
   14.33  
   14.34  CORE_PATHS="${BASE_PATHS}"
   14.35  # shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS.
   14.36 -CORE_PATHS="${CORE_PATHS} `$FIND ${WorkSpace}/src/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
   14.37 +if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then
   14.38 +  CORE_PATHS="${CORE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
   14.39 +fi
   14.40 +CORE_PATHS="${CORE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`"
   14.41  
   14.42 -COMPILER1_PATHS="${WorkSpace}/src/share/vm/c1"
   14.43 +if [ -d "${ALTSRC}/share/vm/c1" ]; then
   14.44 +  COMPILER1_PATHS="${ALTSRC}/share/vm/c1"
   14.45 +fi
   14.46 +COMPILER1_PATHS="${COMPILER1_PATHS} ${COMMONSRC}/share/vm/c1"
   14.47  
   14.48 -COMPILER2_PATHS="${WorkSpace}/src/share/vm/opto"
   14.49 -COMPILER2_PATHS="${COMPILER2_PATHS} ${WorkSpace}/src/share/vm/libadt"
   14.50 +if [ -d "${ALTSRC}/share/vm/opto" ]; then
   14.51 +  COMPILER2_PATHS="${ALTSRC}/share/vm/opto"
   14.52 +fi
   14.53 +COMPILER2_PATHS="${COMPILER2_PATHS} ${COMMONSRC}/share/vm/opto"
   14.54 +if [ -d "${ALTSRC}/share/vm/libadt" ]; then
   14.55 +  COMPILER2_PATHS="${COMPILER2_PATHS} ${ALTSRC}/share/vm/libadt"
   14.56 +fi
   14.57 +COMPILER2_PATHS="${COMPILER2_PATHS} ${COMMONSRC}/share/vm/libadt"
   14.58  COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles"
   14.59  
   14.60  # Include dirs per type.
    15.1 --- a/make/windows/makefiles/vm.make	Thu Feb 03 20:30:19 2011 -0800
    15.2 +++ b/make/windows/makefiles/vm.make	Tue Feb 08 17:20:45 2011 -0500
    15.3 @@ -27,6 +27,9 @@
    15.4  
    15.5  !include ..\generated\objfiles.make
    15.6  
    15.7 +COMMONSRC=$(WorkSpace)\src
    15.8 +ALTSRC=$(WorkSpace)\src\closed
    15.9 +
   15.10  !ifdef RELEASE 
   15.11  !ifdef DEVELOP
   15.12  CPP_FLAGS=$(CPP_FLAGS) /D "DEBUG"
   15.13 @@ -111,13 +114,30 @@
   15.14    /export:JVM_GetThreadStateValues           \
   15.15    /export:JVM_InitAgentProperties
   15.16  
   15.17 -CPP_INCLUDE_DIRS=\
   15.18 -  /I "..\generated" \
   15.19 -  /I "$(WorkSpace)\src\share\vm" \
   15.20 -  /I "$(WorkSpace)\src\share\vm\prims" \
   15.21 -  /I "$(WorkSpace)\src\os\windows\vm" \
   15.22 -  /I "$(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm" \
   15.23 -  /I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm"
   15.24 +CPP_INCLUDE_DIRS=/I "..\generated"
   15.25 +
   15.26 +!if exists($(ALTSRC)\share\vm)
   15.27 +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\share\vm"
   15.28 +!endif
   15.29 +
   15.30 +!if exists($(ALTSRC)\os\windows\vm)
   15.31 +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\os\windows\vm"
   15.32 +!endif
   15.33 +
   15.34 +!if exists($(ALTSRC)\os_cpu\windows_$(Platform_arch)\vm)
   15.35 +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\os_cpu\windows_$(Platform_arch)\vm"
   15.36 +!endif
   15.37 +
   15.38 +!if exists($(ALTSRC)\cpu\$(Platform_arch)\vm)
   15.39 +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\cpu\$(Platform_arch)\vm"
   15.40 +!endif
   15.41 +
   15.42 +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) \
   15.43 +  /I "$(COMMONSRC)\share\vm" \
   15.44 +  /I "$(COMMONSRC)\share\vm\prims" \
   15.45 +  /I "$(COMMONSRC)\os\windows\vm" \
   15.46 +  /I "$(COMMONSRC)\os_cpu\windows_$(Platform_arch)\vm" \
   15.47 +  /I "$(COMMONSRC)\cpu\$(Platform_arch)\vm"
   15.48  
   15.49  CPP_DONT_USE_PCH=/D DONT_USE_PRECOMPILED_HEADER
   15.50  
   15.51 @@ -127,7 +147,7 @@
   15.52  CPP_USE_PCH=$(CPP_DONT_USE_PCH)
   15.53  !endif
   15.54  
   15.55 -# Where to find the source code for the virtual machine
   15.56 +# Where to find the source code for the virtual machine (is this used?)
   15.57  VM_PATH=../generated
   15.58  VM_PATH=$(VM_PATH);../generated/adfiles
   15.59  VM_PATH=$(VM_PATH);../generated/jvmtifiles
   15.60 @@ -188,81 +208,157 @@
   15.61          $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp
   15.62  
   15.63  # Default rules for the Virtual Machine
   15.64 -{$(WorkSpace)\src\share\vm\c1}.cpp.obj::
   15.65 +{$(COMMONSRC)\share\vm\c1}.cpp.obj::
   15.66          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
   15.67  
   15.68 -{$(WorkSpace)\src\share\vm\compiler}.cpp.obj::
   15.69 +{$(COMMONSRC)\share\vm\compiler}.cpp.obj::
   15.70          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
   15.71  
   15.72 -{$(WorkSpace)\src\share\vm\code}.cpp.obj::
   15.73 +{$(COMMONSRC)\share\vm\code}.cpp.obj::
   15.74          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
   15.75  
   15.76 -{$(WorkSpace)\src\share\vm\interpreter}.cpp.obj::
   15.77 +{$(COMMONSRC)\share\vm\interpreter}.cpp.obj::
   15.78          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
   15.79  
   15.80 -{$(WorkSpace)\src\share\vm\ci}.cpp.obj::
   15.81 +{$(COMMONSRC)\share\vm\ci}.cpp.obj::
   15.82          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
   15.83  
   15.84 -{$(WorkSpace)\src\share\vm\classfile}.cpp.obj::
   15.85 +{$(COMMONSRC)\share\vm\classfile}.cpp.obj::
   15.86          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
   15.87  
   15.88 -{$(WorkSpace)\src\share\vm\gc_implementation\parallelScavenge}.cpp.obj::
   15.89 +{$(COMMONSRC)\share\vm\gc_implementation\parallelScavenge}.cpp.obj::
   15.90          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
   15.91  
   15.92 -{$(WorkSpace)\src\share\vm\gc_implementation\shared}.cpp.obj::
   15.93 +{$(COMMONSRC)\share\vm\gc_implementation\shared}.cpp.obj::
   15.94          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
   15.95  
   15.96 -{$(WorkSpace)\src\share\vm\gc_implementation\parNew}.cpp.obj::
   15.97 +{$(COMMONSRC)\share\vm\gc_implementation\parNew}.cpp.obj::
   15.98          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
   15.99  
  15.100 -{$(WorkSpace)\src\share\vm\gc_implementation\concurrentMarkSweep}.cpp.obj::
  15.101 +{$(COMMONSRC)\share\vm\gc_implementation\concurrentMarkSweep}.cpp.obj::
  15.102          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.103  
  15.104 -{$(WorkSpace)\src\share\vm\gc_implementation\g1}.cpp.obj::
  15.105 +{$(COMMONSRC)\share\vm\gc_implementation\g1}.cpp.obj::
  15.106          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.107  
  15.108 -{$(WorkSpace)\src\share\vm\gc_interface}.cpp.obj::
  15.109 +{$(COMMONSRC)\share\vm\gc_interface}.cpp.obj::
  15.110          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.111  
  15.112 -{$(WorkSpace)\src\share\vm\asm}.cpp.obj::
  15.113 +{$(COMMONSRC)\share\vm\asm}.cpp.obj::
  15.114          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.115  
  15.116 -{$(WorkSpace)\src\share\vm\memory}.cpp.obj::
  15.117 +{$(COMMONSRC)\share\vm\memory}.cpp.obj::
  15.118          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.119  
  15.120 -{$(WorkSpace)\src\share\vm\oops}.cpp.obj::
  15.121 +{$(COMMONSRC)\share\vm\oops}.cpp.obj::
  15.122          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.123  
  15.124 -{$(WorkSpace)\src\share\vm\prims}.cpp.obj::
  15.125 +{$(COMMONSRC)\share\vm\prims}.cpp.obj::
  15.126          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.127  
  15.128 -{$(WorkSpace)\src\share\vm\runtime}.cpp.obj::
  15.129 +{$(COMMONSRC)\share\vm\runtime}.cpp.obj::
  15.130          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.131  
  15.132 -{$(WorkSpace)\src\share\vm\services}.cpp.obj::
  15.133 +{$(COMMONSRC)\share\vm\services}.cpp.obj::
  15.134          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.135  
  15.136 -{$(WorkSpace)\src\share\vm\utilities}.cpp.obj::
  15.137 +{$(COMMONSRC)\share\vm\utilities}.cpp.obj::
  15.138          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.139  
  15.140 -{$(WorkSpace)\src\share\vm\libadt}.cpp.obj::
  15.141 +{$(COMMONSRC)\share\vm\libadt}.cpp.obj::
  15.142          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.143  
  15.144 -{$(WorkSpace)\src\share\vm\opto}.cpp.obj::
  15.145 +{$(COMMONSRC)\share\vm\opto}.cpp.obj::
  15.146          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.147  
  15.148 -{$(WorkSpace)\src\os\windows\vm}.cpp.obj::
  15.149 +{$(COMMONSRC)\os\windows\vm}.cpp.obj::
  15.150          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.151  
  15.152  # This guy should remain a single colon rule because
  15.153  # otherwise we can't specify the output filename.
  15.154 -{$(WorkSpace)\src\os\windows\vm}.rc.res:
  15.155 +{$(COMMONSRC)\os\windows\vm}.rc.res:
  15.156          @$(RC) $(RC_FLAGS) /fo"$@" $<
  15.157  
  15.158 -{$(WorkSpace)\src\cpu\$(Platform_arch)\vm}.cpp.obj::
  15.159 +{$(COMMONSRC)\cpu\$(Platform_arch)\vm}.cpp.obj::
  15.160          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.161  
  15.162 -{$(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm}.cpp.obj::
  15.163 +{$(COMMONSRC)\os_cpu\windows_$(Platform_arch)\vm}.cpp.obj::
  15.164 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.165 +
  15.166 +{$(ALTSRC)\share\vm\c1}.cpp.obj::
  15.167 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.168 +
  15.169 +{$(ALTSRC)\share\vm\compiler}.cpp.obj::
  15.170 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.171 +
  15.172 +{$(ALTSRC)\share\vm\code}.cpp.obj::
  15.173 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.174 +
  15.175 +{$(ALTSRC)\share\vm\interpreter}.cpp.obj::
  15.176 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.177 +
  15.178 +{$(ALTSRC)\share\vm\ci}.cpp.obj::
  15.179 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.180 +
  15.181 +{$(ALTSRC)\share\vm\classfile}.cpp.obj::
  15.182 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.183 +
  15.184 +{$(ALTSRC)\share\vm\gc_implementation\parallelScavenge}.cpp.obj::
  15.185 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.186 +
  15.187 +{$(ALTSRC)\share\vm\gc_implementation\shared}.cpp.obj::
  15.188 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.189 +
  15.190 +{$(ALTSRC)\share\vm\gc_implementation\parNew}.cpp.obj::
  15.191 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.192 +
  15.193 +{$(ALTSRC)\share\vm\gc_implementation\concurrentMarkSweep}.cpp.obj::
  15.194 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.195 +
  15.196 +{$(ALTSRC)\share\vm\gc_implementation\g1}.cpp.obj::
  15.197 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.198 +
  15.199 +{$(ALTSRC)\share\vm\gc_interface}.cpp.obj::
  15.200 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.201 +
  15.202 +{$(ALTSRC)\share\vm\asm}.cpp.obj::
  15.203 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.204 +
  15.205 +{$(ALTSRC)\share\vm\memory}.cpp.obj::
  15.206 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.207 +
  15.208 +{$(ALTSRC)\share\vm\oops}.cpp.obj::
  15.209 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.210 +
  15.211 +{$(ALTSRC)\share\vm\prims}.cpp.obj::
  15.212 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.213 +
  15.214 +{$(ALTSRC)\share\vm\runtime}.cpp.obj::
  15.215 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.216 +
  15.217 +{$(ALTSRC)\share\vm\services}.cpp.obj::
  15.218 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.219 +
  15.220 +{$(ALTSRC)\share\vm\utilities}.cpp.obj::
  15.221 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.222 +
  15.223 +{$(ALTSRC)\share\vm\libadt}.cpp.obj::
  15.224 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.225 +
  15.226 +{$(ALTSRC)\share\vm\opto}.cpp.obj::
  15.227 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.228 +
  15.229 +{$(ALTSRC)\os\windows\vm}.cpp.obj::
  15.230 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.231 +
  15.232 +# otherwise we can't specify the output filename.
  15.233 +{$(ALTSRC)\os\windows\vm}.rc.res:
  15.234 +        @$(RC) $(RC_FLAGS) /fo"$@" $<
  15.235 +
  15.236 +{$(ALTSRC)\cpu\$(Platform_arch)\vm}.cpp.obj::
  15.237 +        $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.238 +
  15.239 +{$(ALTSRC)\os_cpu\windows_$(Platform_arch)\vm}.cpp.obj::
  15.240          $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $<
  15.241  
  15.242  {..\generated\incls}.cpp.obj::
    16.1 --- a/src/share/vm/runtime/globals.hpp	Thu Feb 03 20:30:19 2011 -0800
    16.2 +++ b/src/share/vm/runtime/globals.hpp	Tue Feb 08 17:20:45 2011 -0500
    16.3 @@ -3655,6 +3655,12 @@
    16.4    manageable(bool, PrintConcurrentLocks, false,                             \
    16.5            "Print java.util.concurrent locks in thread dump")                \
    16.6                                                                              \
    16.7 +  diagnostic(bool, TransmitErrorReport, false,                              \
    16.8 +          "Enable error report transmission on erroneous termination")      \
    16.9 +                                                                            \
   16.10 +  diagnostic(ccstr, ErrorReportServer, NULL,                                \
   16.11 +          "Override built-in error report server address")                  \
   16.12 +                                                                            \
   16.13    /* Shared spaces */                                                       \
   16.14                                                                              \
   16.15    product(bool, UseSharedSpaces, true,                                      \
    17.1 --- a/src/share/vm/runtime/vm_version.cpp	Thu Feb 03 20:30:19 2011 -0800
    17.2 +++ b/src/share/vm/runtime/vm_version.cpp	Tue Feb 08 17:20:45 2011 -0500
    17.3 @@ -245,6 +245,10 @@
    17.4           " by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER;
    17.5  }
    17.6  
    17.7 +const char *Abstract_VM_Version::vm_build_user() {
    17.8 +  return HOTSPOT_BUILD_USER;
    17.9 +}
   17.10 +
   17.11  unsigned int Abstract_VM_Version::jvm_version() {
   17.12    return ((Abstract_VM_Version::vm_major_version() & 0xFF) << 24) |
   17.13           ((Abstract_VM_Version::vm_minor_version() & 0xFF) << 16) |
    18.1 --- a/src/share/vm/runtime/vm_version.hpp	Thu Feb 03 20:30:19 2011 -0800
    18.2 +++ b/src/share/vm/runtime/vm_version.hpp	Tue Feb 08 17:20:45 2011 -0500
    18.3 @@ -59,6 +59,7 @@
    18.4    static const char* vm_info_string();
    18.5    static const char* vm_release();
    18.6    static const char* vm_platform_string();
    18.7 +  static const char* vm_build_user();
    18.8  
    18.9    static int vm_major_version()               { assert(_initialized, "not initialized"); return _vm_major_version; }
   18.10    static int vm_minor_version()               { assert(_initialized, "not initialized"); return _vm_minor_version; }
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/src/share/vm/utilities/errorReporter.cpp	Tue Feb 08 17:20:45 2011 -0500
    19.3 @@ -0,0 +1,32 @@
    19.4 +/*
    19.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
    19.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    19.7 + *
    19.8 + * This code is free software; you can redistribute it and/or modify it
    19.9 + * under the terms of the GNU General Public License version 2 only, as
   19.10 + * published by the Free Software Foundation.
   19.11 + *
   19.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   19.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   19.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   19.15 + * version 2 for more details (a copy is included in the LICENSE file that
   19.16 + * accompanied this code).
   19.17 + *
   19.18 + * You should have received a copy of the GNU General Public License version
   19.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   19.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   19.21 + *
   19.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   19.23 + * or visit www.oracle.com if you need additional information or have any
   19.24 + * questions.
   19.25 + *
   19.26 + */
   19.27 +
   19.28 +#include "precompiled.hpp"
   19.29 +#include "utilities/errorReporter.hpp"
   19.30 +
   19.31 +ErrorReporter::ErrorReporter() {}
   19.32 +
   19.33 +void ErrorReporter::call(FILE* fd, char* buffer, int length) {
   19.34 +}
   19.35 +
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/src/share/vm/utilities/errorReporter.hpp	Tue Feb 08 17:20:45 2011 -0500
    20.3 @@ -0,0 +1,39 @@
    20.4 +/*
    20.5 + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
    20.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    20.7 + *
    20.8 + * This code is free software; you can redistribute it and/or modify it
    20.9 + * under the terms of the GNU General Public License version 2 only, as
   20.10 + * published by the Free Software Foundation.
   20.11 + *
   20.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
   20.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   20.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   20.15 + * version 2 for more details (a copy is included in the LICENSE file that
   20.16 + * accompanied this code).
   20.17 + *
   20.18 + * You should have received a copy of the GNU General Public License version
   20.19 + * 2 along with this work; if not, write to the Free Software Foundation,
   20.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   20.21 + *
   20.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   20.23 + * or visit www.oracle.com if you need additional information or have any
   20.24 + * questions.
   20.25 + *
   20.26 + */
   20.27 +
   20.28 +#ifndef SHARE_VM_UTILITIES_ERRORREPORTER_HPP
   20.29 +#define SHARE_VM_UTILITIES_ERRORREPORTER_HPP
   20.30 +
   20.31 +#include "utilities/globalDefinitions.hpp"
   20.32 +
   20.33 +class ErrorReporter : public StackObj {
   20.34 +
   20.35 +public:
   20.36 +  ErrorReporter();
   20.37 +  ~ErrorReporter(){};
   20.38 +
   20.39 +  void call(FILE* fd, char *buffer, int length);
   20.40 +};
   20.41 +
   20.42 +#endif // ndef SHARE_VM_UTILITIES_ERRORREPORTER_HPP
    21.1 --- a/src/share/vm/utilities/ostream.cpp	Thu Feb 03 20:30:19 2011 -0800
    21.2 +++ b/src/share/vm/utilities/ostream.cpp	Tue Feb 08 17:20:45 2011 -0500
    21.3 @@ -314,6 +314,11 @@
    21.4    _need_close = true;
    21.5  }
    21.6  
    21.7 +fileStream::fileStream(const char* file_name, const char* opentype) {
    21.8 +  _file = fopen(file_name, opentype);
    21.9 +  _need_close = true;
   21.10 +}
   21.11 +
   21.12  void fileStream::write(const char* s, size_t len) {
   21.13    if (_file != NULL)  {
   21.14      // Make an unused local variable to avoid warning from gcc 4.x compiler.
   21.15 @@ -322,6 +327,25 @@
   21.16    update_position(s, len);
   21.17  }
   21.18  
   21.19 +long fileStream::fileSize() {
   21.20 +  long size = -1;
   21.21 +  if (_file != NULL) {
   21.22 +    long pos  = ::ftell(_file);
   21.23 +    if (::fseek(_file, 0, SEEK_END) == 0) {
   21.24 +      size = ::ftell(_file);
   21.25 +    }
   21.26 +    ::fseek(_file, pos, SEEK_SET);
   21.27 +  }
   21.28 +  return size;
   21.29 +}
   21.30 +
   21.31 +char* fileStream::readln(char *data, int count ) {
   21.32 +  char * ret = ::fgets(data, count, _file);
   21.33 +  //Get rid of annoying \n char
   21.34 +  data[::strlen(data)-1] = '\0';
   21.35 +  return ret;
   21.36 +}
   21.37 +
   21.38  fileStream::~fileStream() {
   21.39    if (_file != NULL) {
   21.40      if (_need_close) fclose(_file);
    22.1 --- a/src/share/vm/utilities/ostream.hpp	Thu Feb 03 20:30:19 2011 -0800
    22.2 +++ b/src/share/vm/utilities/ostream.hpp	Tue Feb 08 17:20:45 2011 -0500
    22.3 @@ -159,10 +159,17 @@
    22.4    bool  _need_close;
    22.5   public:
    22.6    fileStream(const char* file_name);
    22.7 +  fileStream(const char* file_name, const char* opentype);
    22.8    fileStream(FILE* file) { _file = file; _need_close = false; }
    22.9    ~fileStream();
   22.10    bool is_open() const { return _file != NULL; }
   22.11 +  void set_need_close(bool b) { _need_close = b;}
   22.12    virtual void write(const char* c, size_t len);
   22.13 +  size_t read(void *data, size_t size, size_t count) { return ::fread(data, size, count, _file); }
   22.14 +  char* readln(char *data, int count);
   22.15 +  int eof() { return feof(_file); }
   22.16 +  long fileSize();
   22.17 +  void rewind() { ::rewind(_file); }
   22.18    void flush();
   22.19  };
   22.20  
    23.1 --- a/src/share/vm/utilities/vmError.cpp	Thu Feb 03 20:30:19 2011 -0800
    23.2 +++ b/src/share/vm/utilities/vmError.cpp	Tue Feb 08 17:20:45 2011 -0500
    23.3 @@ -35,6 +35,7 @@
    23.4  #include "utilities/debug.hpp"
    23.5  #include "utilities/decoder.hpp"
    23.6  #include "utilities/defaultStream.hpp"
    23.7 +#include "utilities/errorReporter.hpp"
    23.8  #include "utilities/top.hpp"
    23.9  #include "utilities/vmError.hpp"
   23.10  
   23.11 @@ -769,6 +770,7 @@
   23.12    // then save detailed information in log file (verbose = true).
   23.13    static bool out_done = false;         // done printing to standard out
   23.14    static bool log_done = false;         // done saving error log
   23.15 +  static bool transmit_report_done = false; // done error reporting
   23.16    static fdStream log;                  // error log
   23.17  
   23.18    if (SuppressFatalErrorMessage) {
   23.19 @@ -859,7 +861,7 @@
   23.20          bool copy_ok =
   23.21            Arguments::copy_expand_pid(ErrorFile, strlen(ErrorFile), buffer, sizeof(buffer));
   23.22          if (copy_ok) {
   23.23 -          fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666);
   23.24 +          fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666);
   23.25          }
   23.26        }
   23.27  
   23.28 @@ -870,7 +872,7 @@
   23.29          // so use the default name in the current directory
   23.30          jio_snprintf(&buffer[len], sizeof(buffer)-len, "%shs_err_pid%u.log",
   23.31                       os::file_separator(), os::current_process_id());
   23.32 -        fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666);
   23.33 +        fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666);
   23.34        }
   23.35  
   23.36        if (fd == -1) {
   23.37 @@ -879,7 +881,7 @@
   23.38          if (tmpdir != NULL && tmpdir[0] != '\0') {
   23.39            jio_snprintf(buffer, sizeof(buffer), "%s%shs_err_pid%u.log",
   23.40                         tmpdir, os::file_separator(), os::current_process_id());
   23.41 -          fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666);
   23.42 +          fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666);
   23.43          }
   23.44        }
   23.45  
   23.46 @@ -892,6 +894,9 @@
   23.47        } else {
   23.48          out.print_raw_cr("# Can not save log file, dump to screen..");
   23.49          log.set_fd(defaultStream::output_fd());
   23.50 +        /* Error reporting currently needs dumpfile.
   23.51 +         * Maybe implement direct streaming in the future.*/
   23.52 +        transmit_report_done = true;
   23.53        }
   23.54      }
   23.55  
   23.56 @@ -900,6 +905,16 @@
   23.57      first_error->_current_step = 0;         // reset current_step
   23.58      first_error->_current_step_info = "";   // reset current_step string
   23.59  
   23.60 +    // Run error reporting to determine whether or not to report the crash.
   23.61 +    if (!transmit_report_done && should_report_bug(first_error->_id)) {
   23.62 +      transmit_report_done = true;
   23.63 +      FILE* hs_err = ::fdopen(log.fd(), "r");
   23.64 +      if (NULL != hs_err) {
   23.65 +        ErrorReporter er;
   23.66 +        er.call(hs_err, buffer, O_BUFLEN);
   23.67 +      }
   23.68 +    }
   23.69 +
   23.70      if (log.fd() != defaultStream::output_fd()) {
   23.71        close(log.fd());
   23.72      }

mercurial