Thu, 16 Dec 2010 12:56:51 -0800
Merge
1.1 --- a/make/linux/makefiles/build_vm_def.sh Thu Dec 16 09:14:34 2010 -0800 1.2 +++ b/make/linux/makefiles/build_vm_def.sh Thu Dec 16 12:56:51 2010 -0800 1.3 @@ -1,7 +1,7 @@ 1.4 #!/bin/sh 1.5 1.6 # If we're cross compiling use that path for nm 1.7 -if [ "$ALT_COMPILER_PATH" != "" ]; then 1.8 +if [ "$CROSS_COMPILE_ARCH" != "" ]; then 1.9 NM=$ALT_COMPILER_PATH/nm 1.10 else 1.11 NM=nm
2.1 --- a/make/linux/makefiles/buildtree.make Thu Dec 16 09:14:34 2010 -0800 2.2 +++ b/make/linux/makefiles/buildtree.make Thu Dec 16 12:56:51 2010 -0800 2.3 @@ -124,7 +124,7 @@ 2.4 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make 2.5 2.6 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \ 2.7 - env.sh env.csh .dbxrc test_gamma 2.8 + env.sh env.csh jdkpath.sh .dbxrc test_gamma 2.9 2.10 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ 2.11 ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) 2.12 @@ -318,6 +318,13 @@ 2.13 sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \ 2.14 ) > $@ 2.15 2.16 +jdkpath.sh: $(BUILDTREE_MAKE) 2.17 + @echo Creating $@ ... 2.18 + $(QUIETLY) ( \ 2.19 + $(BUILDTREE_COMMENT); \ 2.20 + echo "JDK=${JAVA_HOME}"; \ 2.21 + ) > $@ 2.22 + 2.23 .dbxrc: $(BUILDTREE_MAKE) 2.24 @echo Creating $@ ... 2.25 $(QUIETLY) ( \
3.1 --- a/make/linux/makefiles/gcc.make Thu Dec 16 09:14:34 2010 -0800 3.2 +++ b/make/linux/makefiles/gcc.make Thu Dec 16 12:56:51 2010 -0800 3.3 @@ -25,7 +25,9 @@ 3.4 #------------------------------------------------------------------------ 3.5 # CC, CPP & AS 3.6 3.7 -ifdef ALT_COMPILER_PATH 3.8 +# When cross-compiling the ALT_COMPILER_PATH points 3.9 +# to the cross-compilation toolset 3.10 +ifdef CROSS_COMPILE_ARCH 3.11 CPP = $(ALT_COMPILER_PATH)/g++ 3.12 CC = $(ALT_COMPILER_PATH)/gcc 3.13 else
4.1 --- a/make/linux/makefiles/vm.make Thu Dec 16 09:14:34 2010 -0800 4.2 +++ b/make/linux/makefiles/vm.make Thu Dec 16 12:56:51 2010 -0800 4.3 @@ -168,7 +168,9 @@ 4.4 4.5 # Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE. 4.6 define findsrc 4.7 - $(notdir $(shell find $(1) \( -name \*.c -o -name \*.cpp -o -name \*.s \) -a \! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \) )) 4.8 + $(notdir $(shell find $(1)/. ! -name . -prune \ 4.9 + -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \ 4.10 + -a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \))) 4.11 endef 4.12 4.13 Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
5.1 --- a/make/solaris/makefiles/buildtree.make Thu Dec 16 09:14:34 2010 -0800 5.2 +++ b/make/solaris/makefiles/buildtree.make Thu Dec 16 12:56:51 2010 -0800 5.3 @@ -117,7 +117,7 @@ 5.4 BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make 5.5 5.6 BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \ 5.7 - env.ksh env.csh .dbxrc test_gamma 5.8 + env.ksh env.csh jdkpath.sh .dbxrc test_gamma 5.9 5.10 BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ 5.11 ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) 5.12 @@ -314,6 +314,13 @@ 5.13 sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \ 5.14 ) > $@ 5.15 5.16 +jdkpath.sh: $(BUILDTREE_MAKE) 5.17 + @echo Creating $@ ... 5.18 + $(QUIETLY) ( \ 5.19 + $(BUILDTREE_COMMENT); \ 5.20 + echo "JDK=${JAVA_HOME}"; \ 5.21 + ) > $@ 5.22 + 5.23 .dbxrc: $(BUILDTREE_MAKE) 5.24 @echo Creating $@ ... 5.25 $(QUIETLY) ( \
6.1 --- a/make/solaris/makefiles/vm.make Thu Dec 16 09:14:34 2010 -0800 6.2 +++ b/make/solaris/makefiles/vm.make Thu Dec 16 12:56:51 2010 -0800 6.3 @@ -106,17 +106,17 @@ 6.4 # Not sure what the 'designed for' comment is referring too above. 6.5 # The order may not be too significant anymore, but I have placed this 6.6 # older libm before libCrun, just to make sure it's found and used first. 6.7 -LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc 6.8 +LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc -ldemangle 6.9 else 6.10 ifeq ($(COMPILER_REV_NUMERIC), 502) 6.11 # SC6.1 has it's own libm.so: specifying anything else provokes a name conflict. 6.12 -LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor 6.13 +LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor -ldemangle 6.14 else 6.15 -LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor 6.16 +LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor -ldemangle 6.17 endif # 502 6.18 endif # 505 6.19 else 6.20 -LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc 6.21 +LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc -ldemangle 6.22 endif # sparcWorks 6.23 6.24 # By default, link the *.o into the library, not the executable. 6.25 @@ -184,7 +184,9 @@ 6.26 6.27 # Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE. 6.28 define findsrc 6.29 - $(notdir $(shell find $(1) \( -name \*.c -o -name \*.cpp -o -name \*.s \) -a \! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \) )) 6.30 + $(notdir $(shell find $(1)/. ! -name . -prune \ 6.31 + -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \ 6.32 + -a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \))) 6.33 endef 6.34 6.35 Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
7.1 --- a/make/windows/build_vm_def.sh Thu Dec 16 09:14:34 2010 -0800 7.2 +++ b/make/windows/build_vm_def.sh Thu Dec 16 12:56:51 2010 -0800 7.3 @@ -1,5 +1,5 @@ 7.4 # 7.5 -# Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. 7.6 +# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 7.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 7.8 # 7.9 # This code is free software; you can redistribute it and/or modify it 7.10 @@ -45,6 +45,9 @@ 7.11 echo "EXPORTS" > vm1.def 7.12 7.13 AWK="$MKS_HOME/awk.exe" 7.14 +if [ ! -e $AWK ]; then 7.15 + AWK="$MKS_HOME/gawk.exe" 7.16 +fi 7.17 GREP="$MKS_HOME/grep.exe" 7.18 SORT="$MKS_HOME/sort.exe" 7.19 UNIQ="$MKS_HOME/uniq.exe" 7.20 @@ -57,7 +60,7 @@ 7.21 LINK_VER="$1" 7.22 fi 7.23 7.24 -if [ "x$LINK_VER" != "x800" -a "x$LINK_VER" != "x900" ]; then 7.25 +if [ "x$LINK_VER" != "x800" -a "x$LINK_VER" != "x900" -a "x$LINK_VER" != "x1000" ]; then 7.26 $DUMPBIN /symbols *.obj | "$GREP" "??_7.*@@6B@" | "$GREP" -v "type_info" | "$AWK" '{print $7}' | "$SORT" | "$UNIQ" > vm2.def 7.27 else 7.28 # Can't use pipes when calling cl.exe or link.exe from IDE. Using transit file vm3.def
8.1 --- a/make/windows/create.bat Thu Dec 16 09:14:34 2010 -0800 8.2 +++ b/make/windows/create.bat Thu Dec 16 12:56:51 2010 -0800 8.3 @@ -36,6 +36,20 @@ 8.4 REM Note: Running this batch file from the Windows command shell requires 8.5 REM that "grep" be accessible on the PATH. An MKS install does this. 8.6 REM 8.7 + 8.8 +cl 2>NUL >NUL 8.9 +if %errorlevel% == 0 goto nexttest 8.10 +echo Make sure cl.exe is in your PATH before running this script. 8.11 +goto end 8.12 + 8.13 +:nexttest 8.14 +grep -V 2>NUL >NUL 8.15 +if %errorlevel% == 0 goto testit 8.16 +echo Make sure grep.exe is in your PATH before running this script. Either cygwin or MKS should work. 8.17 +goto end 8.18 + 8.19 + 8.20 +:testit 8.21 cl 2>&1 | grep "IA-64" >NUL 8.22 if %errorlevel% == 0 goto isia64 8.23 cl 2>&1 | grep "AMD64" >NUL 8.24 @@ -44,37 +58,40 @@ 8.25 set BUILDARCH=i486 8.26 set Platform_arch=x86 8.27 set Platform_arch_model=x86_32 8.28 -goto end 8.29 +goto done 8.30 :amd64 8.31 set ARCH=x86 8.32 set BUILDARCH=amd64 8.33 set Platform_arch=x86 8.34 set Platform_arch_model=x86_64 8.35 -goto end 8.36 +goto done 8.37 :isia64 8.38 set ARCH=ia64 8.39 set BUILDARCH=ia64 8.40 set Platform_arch=ia64 8.41 set Platform_arch_model=ia64 8.42 -:end 8.43 +:done 8.44 8.45 setlocal 8.46 8.47 if "%1" == "" goto usage 8.48 8.49 -if not "%4" == "" goto usage 8.50 +if not "%2" == "" goto usage 8.51 8.52 -set HotSpotWorkSpace=%1 8.53 -set HotSpotBuildSpace=%2 8.54 -set HotSpotJDKDist=%3 8.55 +REM Set HotSpotWorkSpace to the directy two steps above this script 8.56 +for %%i in ("%~dp0..") do ( set HotSpotWorkSpace=%%~dpi) 8.57 +set HotSpotBuildRoot=%HotSpotWorkSpace%build 8.58 +set HotSpotBuildSpace=%HotSpotBuildRoot%\vs 8.59 +set HotSpotJDKDist=%1 8.60 + 8.61 8.62 REM figure out MSC version 8.63 for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i 8.64 8.65 echo ************************************************************** 8.66 -set ProjectFile=vm.vcproj 8.67 +set ProjectFile=jvm.vcproj 8.68 if "%MSC_VER%" == "1200" ( 8.69 -set ProjectFile=vm.dsp 8.70 +set ProjectFile=jvm.dsp 8.71 echo Will generate VC6 project {unsupported} 8.72 ) else ( 8.73 if "%MSC_VER%" == "1400" ( 8.74 @@ -83,10 +100,16 @@ 8.75 if "%MSC_VER%" == "1500" ( 8.76 echo Will generate VC9 {Visual Studio 2008} 8.77 ) else ( 8.78 +if "%MSC_VER%" == "1600" ( 8.79 +echo Detected Visual Studio 2010, but 8.80 +echo will generate VC9 {Visual Studio 2008} 8.81 +echo Use conversion wizard in VS 2010. 8.82 +) else ( 8.83 echo Will generate VC7 project {Visual Studio 2003 .NET} 8.84 ) 8.85 ) 8.86 ) 8.87 +) 8.88 echo %ProjectFile% 8.89 echo ************************************************************** 8.90 8.91 @@ -118,6 +141,8 @@ 8.92 8.93 :test3 8.94 if not "%HOTSPOTMKSHOME%" == "" goto makedir 8.95 +if exist c:\cygwin\bin set HOTSPOTMKSHOME=c:\cygwin\bin 8.96 +if not "%HOTSPOTMKSHOME%" == "" goto makedir 8.97 echo Warning: please set variable HOTSPOTMKSHOME to place where 8.98 echo your MKS/Cygwin installation is 8.99 echo. 8.100 @@ -133,21 +158,24 @@ 8.101 REM This is now safe to do. 8.102 :copyfiles 8.103 for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( 8.104 -if NOT EXIST %HotSpotBuildSpace%\%%i mkdir %HotSpotBuildSpace%\%%i 8.105 -copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ > NUL 8.106 +if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated 8.107 +copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL 8.108 ) 8.109 8.110 REM force regneration of ProjectFile 8.111 if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile% 8.112 8.113 for /D %%i in (compiler1, compiler2, tiered, core, kernel) do ( 8.114 - 8.115 -echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make 8.116 +echo -- %%i -- 8.117 +echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make 8.118 echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make 8.119 echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make 8.120 -echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make 8.121 +echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make 8.122 echo. >> %HotSpotBuildSpace%\%%i\local.make 8.123 +echo Variant=%%i >> %HotSpotBuildSpace%\%%i\local.make 8.124 +echo WorkSpace=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make 8.125 echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make 8.126 +echo HOTSPOTBUILDROOT=%HotSpotBuildRoot% >> %HotSpotBuildSpace%\%%i\local.make 8.127 echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make 8.128 echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make 8.129 echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make 8.130 @@ -155,42 +183,35 @@ 8.131 echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make 8.132 echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make 8.133 8.134 -pushd %HotSpotBuildSpace%\%%i 8.135 +for /D %%j in (debug, fastdebug, product) do ( 8.136 +if NOT EXIST %HotSpotBuildSpace%\%%i\%%j mkdir %HotSpotBuildSpace%\%%i\%%j 8.137 +) 8.138 + 8.139 +pushd %HotSpotBuildSpace%\%%i\generated 8.140 nmake /nologo 8.141 popd 8.142 8.143 ) 8.144 8.145 -pushd %HotSpotBuildSpace% 8.146 +pushd %HotSpotBuildRoot% 8.147 8.148 -echo # Generated file! > local.make 8.149 -echo # Changing a variable below and then deleting %ProjectFile% will cause >> local.make 8.150 -echo # %ProjectFile% to be regenerated with the new values. Changing the >> local.make 8.151 -echo # version requires rerunning create.bat. >> local.make 8.152 -echo. >> local.make 8.153 -echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> local.make 8.154 -echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> local.make 8.155 -echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> local.make 8.156 -echo ARCH=%ARCH% >> local.make 8.157 -echo BUILDARCH=%BUILDARCH% >> local.make 8.158 -echo Platform_arch=%Platform_arch% >> local.make 8.159 -echo Platform_arch_model=%Platform_arch_model% >> local.make 8.160 - 8.161 -nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile %HotSpotBuildSpace%/%ProjectFile% 8.162 +REM It doesn't matter which variant we use here, "compiler1" is as good as any of the others - we need the common variables 8.163 +nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile LOCAL_MAKE=%HotSpotBuildSpace%\compiler1\local.make %HotSpotBuildRoot%/%ProjectFile% 8.164 8.165 popd 8.166 8.167 goto end 8.168 8.169 :usage 8.170 -echo Usage: create HotSpotWorkSpace HotSpotBuildSpace HotSpotJDKDist 8.171 +echo Usage: create HotSpotJDKDist 8.172 echo. 8.173 -echo This is the interactive build setup script (as opposed to the batch 8.174 -echo build execution script). It creates HotSpotBuildSpace if necessary, 8.175 -echo copies the appropriate files out of HotSpotWorkSpace into it, and 8.176 +echo This is the VS build setup script (as opposed to the batch 8.177 +echo build execution script). It creates a build directory if necessary, 8.178 +echo copies the appropriate files out of the workspace into it, and 8.179 echo builds and runs ProjectCreator in it. This has the side-effect of creating 8.180 echo the %ProjectFile% file in the build space, which is then used in Visual C++. 8.181 -echo The HotSpotJDKDist defines place where JVM binaries should be placed. 8.182 +echo. 8.183 +echo The HotSpotJDKDist defines the JDK that should be used when running the JVM. 8.184 echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection. 8.185 echo. 8.186 echo NOTE that it is now NOT safe to modify any of the files in the build
9.1 --- a/make/windows/create_obj_files.sh Thu Dec 16 09:14:34 2010 -0800 9.2 +++ b/make/windows/create_obj_files.sh Thu Dec 16 12:56:51 2010 -0800 9.3 @@ -107,8 +107,12 @@ 9.4 "x86_64") Src_Files_EXCLUDE="${Src_Files_EXCLUDE} *x86_32*" ;; 9.5 esac 9.6 9.7 +# Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE. 9.8 function findsrc { 9.9 - $FIND ${1} \( -name \*.c -o -name \*.cpp -o -name \*.s \) -a \! \( -name ${Src_Files_EXCLUDE// / -o -name } \) | sed 's/.*\/\(.*\)/\1/'; 9.10 + $FIND ${1}/. ! -name . -prune \ 9.11 + -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \ 9.12 + -a \! \( -name ${Src_Files_EXCLUDE// / -o -name } \) \ 9.13 + | sed 's/.*\/\(.*\)/\1/'; 9.14 } 9.15 9.16 Src_Files=
10.1 --- a/make/windows/makefiles/adlc.make Thu Dec 16 09:14:34 2010 -0800 10.2 +++ b/make/windows/makefiles/adlc.make Thu Dec 16 12:56:51 2010 -0800 10.3 @@ -22,7 +22,6 @@ 10.4 # 10.5 # 10.6 10.7 -!include $(WorkSpace)/make/windows/makefiles/compile.make 10.8 10.9 # Rules for building adlc.exe 10.10 10.11 @@ -46,15 +45,7 @@ 10.12 ADLCFLAGS=-q -T -U_LP64 10.13 !endif 10.14 10.15 -CPP_FLAGS=$(CPP_FLAGS) \ 10.16 - /D TARGET_OS_FAMILY_windows \ 10.17 - /D TARGET_ARCH_$(Platform_arch) \ 10.18 - /D TARGET_ARCH_MODEL_$(Platform_arch_model) \ 10.19 - /D TARGET_OS_ARCH_windows_$(Platform_arch) \ 10.20 - /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model) \ 10.21 - /D TARGET_COMPILER_visCPP 10.22 - 10.23 -CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE 10.24 +ADLC_CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE 10.25 10.26 CPP_INCLUDE_DIRS=\ 10.27 /I "..\generated" \ 10.28 @@ -92,10 +83,10 @@ 10.29 $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp 10.30 10.31 {$(WorkSpace)\src\share\vm\adlc}.cpp.obj:: 10.32 - $(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $< 10.33 + $(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $< 10.34 10.35 {$(WorkSpace)\src\share\vm\opto}.cpp.obj:: 10.36 - $(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $< 10.37 + $(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $< 10.38 10.39 adlc.exe: main.obj adlparse.obj archDesc.obj arena.obj dfa.obj dict2.obj filebuff.obj \ 10.40 forms.obj formsopt.obj formssel.obj opcodes.obj output_c.obj output_h.obj
11.1 --- a/make/windows/makefiles/compile.make Thu Dec 16 09:14:34 2010 -0800 11.2 +++ b/make/windows/makefiles/compile.make Thu Dec 16 12:56:51 2010 -0800 11.3 @@ -1,5 +1,5 @@ 11.4 # 11.5 -# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. 11.6 +# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 11.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 11.8 # 11.9 # This code is free software; you can redistribute it and/or modify it 11.10 @@ -80,6 +80,20 @@ 11.11 CPP=ARCH_ERROR 11.12 !endif 11.13 11.14 +CPP_FLAGS=$(CPP_FLAGS) /D "WIN32" /D "_WINDOWS" 11.15 + 11.16 +# Must specify this for sharedRuntimeTrig.cpp 11.17 +CPP_FLAGS=$(CPP_FLAGS) /D "VM_LITTLE_ENDIAN" 11.18 + 11.19 +# Used for platform dispatching 11.20 +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_FAMILY_windows 11.21 +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_$(Platform_arch) 11.22 +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_MODEL_$(Platform_arch_model) 11.23 +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_windows_$(Platform_arch) 11.24 +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model) 11.25 +CPP_FLAGS=$(CPP_FLAGS) /D TARGET_COMPILER_visCPP 11.26 + 11.27 + 11.28 # MSC_VER is a 4 digit number that tells us what compiler is being used 11.29 # and is generated when the local.make file is created by build.make 11.30 # via the script get_msc_ver.sh
12.1 --- a/make/windows/makefiles/debug.make Thu Dec 16 09:14:34 2010 -0800 12.2 +++ b/make/windows/makefiles/debug.make Thu Dec 16 12:56:51 2010 -0800 12.3 @@ -26,7 +26,6 @@ 12.4 HS_FNAME=$(HS_INTERNAL_NAME).dll 12.5 AOUT=$(HS_FNAME) 12.6 SAWINDBG=sawindbg.dll 12.7 -LAUNCHER_NAME=hotspot.exe 12.8 GENERATED=../generated 12.9 12.10 # Allow the user to turn off precompiled headers from the command line. 12.11 @@ -34,7 +33,7 @@ 12.12 BUILD_PCH_FILE=_build_pch_file.obj 12.13 !endif 12.14 12.15 -default:: $(BUILD_PCH_FILE) $(AOUT) $(LAUNCHER_NAME) checkAndBuildSA 12.16 +default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA 12.17 12.18 !include ../local.make 12.19 !include compile.make 12.20 @@ -49,8 +48,10 @@ 12.21 # Force resources to be rebuilt every time 12.22 $(Res_Files): FORCE 12.23 12.24 -$(AOUT): $(Res_Files) $(Obj_Files) 12.25 +vm.def: $(Obj_Files) 12.26 sh $(WorkSpace)/make/windows/build_vm_def.sh 12.27 + 12.28 +$(AOUT): $(Res_Files) $(Obj_Files) vm.def 12.29 $(LINK) @<< 12.30 $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files) 12.31 <<
13.1 --- a/make/windows/makefiles/fastdebug.make Thu Dec 16 09:14:34 2010 -0800 13.2 +++ b/make/windows/makefiles/fastdebug.make Thu Dec 16 12:56:51 2010 -0800 13.3 @@ -26,7 +26,6 @@ 13.4 HS_FNAME=$(HS_INTERNAL_NAME).dll 13.5 AOUT=$(HS_FNAME) 13.6 SAWINDBG=sawindbg.dll 13.7 -LAUNCHER_NAME=hotspot.exe 13.8 GENERATED=../generated 13.9 13.10 # Allow the user to turn off precompiled headers from the command line. 13.11 @@ -34,7 +33,7 @@ 13.12 BUILD_PCH_FILE=_build_pch_file.obj 13.13 !endif 13.14 13.15 -default:: $(BUILD_PCH_FILE) $(AOUT) $(LAUNCHER_NAME) checkAndBuildSA 13.16 +default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA 13.17 13.18 !include ../local.make 13.19 !include compile.make 13.20 @@ -49,8 +48,10 @@ 13.21 # Force resources to be rebuilt every time 13.22 $(Res_Files): FORCE 13.23 13.24 -$(AOUT): $(Res_Files) $(Obj_Files) 13.25 +vm.def: $(Obj_Files) 13.26 sh $(WorkSpace)/make/windows/build_vm_def.sh 13.27 + 13.28 +$(AOUT): $(Res_Files) $(Obj_Files) vm.def 13.29 $(LINK) @<< 13.30 $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files) 13.31 <<
14.1 --- a/make/windows/makefiles/generated.make Thu Dec 16 09:14:34 2010 -0800 14.2 +++ b/make/windows/makefiles/generated.make Thu Dec 16 12:56:51 2010 -0800 14.3 @@ -51,6 +51,7 @@ 14.4 14.5 !if ("$(Variant)" == "compiler2") || ("$(Variant)" == "tiered") 14.6 14.7 +!include $(WorkSpace)/make/windows/makefiles/compile.make 14.8 !include $(WorkSpace)/make/windows/makefiles/adlc.make 14.9 14.10 !endif
15.1 --- a/make/windows/makefiles/launcher.make Thu Dec 16 09:14:34 2010 -0800 15.2 +++ b/make/windows/makefiles/launcher.make Thu Dec 16 12:56:51 2010 -0800 15.3 @@ -22,7 +22,8 @@ 15.4 # 15.5 # 15.6 15.7 -LAUNCHER_FLAGS=$(ARCHFLAG) \ 15.8 + 15.9 +LAUNCHER_FLAGS=$(CPP_FLAGS) $(ARCHFLAG) \ 15.10 /D FULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ 15.11 /D JDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \ 15.12 /D JDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \ 15.13 @@ -32,9 +33,11 @@ 15.14 /D _CRT_SECURE_NO_DEPRECATE \ 15.15 /D LINK_INTO_LIBJVM \ 15.16 /I $(WorkSpace)\src\os\windows\launcher \ 15.17 - /I $(WorkSpace)\src\share\tools\launcher 15.18 - 15.19 -CPP_FLAGS=$(CPP_FLAGS) $(LAUNCHER_FLAGS) 15.20 + /I $(WorkSpace)\src\share\tools\launcher \ 15.21 + /I $(WorkSpace)\src\share\vm\prims \ 15.22 + /I $(WorkSpace)\src\share\vm \ 15.23 + /I $(WorkSpace)\src\cpu\$(Platform_arch)\vm \ 15.24 + /I $(WorkSpace)\src\os\windows\vm 15.25 15.26 LINK_FLAGS=/manifest $(HS_INTERNAL_NAME).lib kernel32.lib user32.lib /nologo /machine:$(MACHINE) /map /debug /subsystem:console 15.27 15.28 @@ -46,22 +49,23 @@ 15.29 LINK_FLAGS = $(LINK_FLAGS) $(BUFFEROVERFLOWLIB) 15.30 !endif 15.31 15.32 -LAUNCHERDIR = $(GAMMADIR)/src/os/windows/launcher 15.33 -LAUNCHERDIR_SHARE = $(GAMMADIR)/src/share/tools/launcher 15.34 +LAUNCHERDIR = $(WorkSpace)/src/os/windows/launcher 15.35 +LAUNCHERDIR_SHARE = $(WorkSpace)/src/share/tools/launcher 15.36 15.37 OUTDIR = launcher 15.38 15.39 {$(LAUNCHERDIR)}.c{$(OUTDIR)}.obj: 15.40 - -mkdir $(OUTDIR) 15.41 - $(CPP) $(CPP_FLAGS) /c /Fo$@ $< 15.42 + -mkdir $(OUTDIR) 2>NUL >NUL 15.43 + $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $< 15.44 15.45 {$(LAUNCHERDIR_SHARE)}.c{$(OUTDIR)}.obj: 15.46 - -mkdir $(OUTDIR) 15.47 - $(CPP) $(CPP_FLAGS) /c /Fo$@ $< 15.48 + -mkdir $(OUTDIR) 2>NUL >NUL 15.49 + $(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $< 15.50 15.51 $(OUTDIR)\*.obj: $(LAUNCHERDIR)\*.c $(LAUNCHERDIR)\*.h $(LAUNCHERDIR_SHARE)\*.c $(LAUNCHERDIR_SHARE)\*.h 15.52 15.53 -$(LAUNCHER_NAME): $(OUTDIR)\java.obj $(OUTDIR)\java_md.obj $(OUTDIR)\jli_util.obj 15.54 - $(LINK) $(LINK_FLAGS) /out:$@ $** 15.55 +launcher: $(OUTDIR)\java.obj $(OUTDIR)\java_md.obj $(OUTDIR)\jli_util.obj 15.56 + echo $(JAVA_HOME) > jdkpath.txt 15.57 + $(LINK) $(LINK_FLAGS) /out:hotspot.exe $** 15.58 15.59
16.1 --- a/make/windows/makefiles/product.make Thu Dec 16 09:14:34 2010 -0800 16.2 +++ b/make/windows/makefiles/product.make Thu Dec 16 12:56:51 2010 -0800 16.3 @@ -25,7 +25,6 @@ 16.4 HS_INTERNAL_NAME=jvm 16.5 HS_FNAME=$(HS_INTERNAL_NAME).dll 16.6 AOUT=$(HS_FNAME) 16.7 -LAUNCHER_NAME=hotspot.exe 16.8 GENERATED=../generated 16.9 16.10 # Allow the user to turn off precompiled headers from the command line. 16.11 @@ -33,7 +32,7 @@ 16.12 BUILD_PCH_FILE=_build_pch_file.obj 16.13 !endif 16.14 16.15 -default:: $(BUILD_PCH_FILE) $(AOUT) $(LAUNCHER_NAME) checkAndBuildSA 16.16 +default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA 16.17 16.18 !include ../local.make 16.19 !include compile.make 16.20 @@ -59,8 +58,10 @@ 16.21 $(LINK_FLAGS) /out:$@ /implib:$*.lib $(Obj_Files) $(Res_Files) 16.22 << 16.23 !else 16.24 -$(AOUT): $(Res_Files) $(Obj_Files) 16.25 +vm.def: $(Obj_Files) 16.26 sh $(WorkSpace)/make/windows/build_vm_def.sh 16.27 + 16.28 +$(AOUT): $(Res_Files) $(Obj_Files) vm.def 16.29 $(LINK) @<< 16.30 $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files) 16.31 <<
17.1 --- a/make/windows/makefiles/projectcreator.make Thu Dec 16 09:14:34 2010 -0800 17.2 +++ b/make/windows/makefiles/projectcreator.make Thu Dec 16 12:56:51 2010 -0800 17.3 @@ -84,11 +84,12 @@ 17.4 -buildBase $(HOTSPOTBUILDSPACE)\%f\%b \ 17.5 -startAt src \ 17.6 -compiler $(VcVersion) \ 17.7 - -projectFileName $(HOTSPOTBUILDSPACE)\$(ProjectFile) \ 17.8 + -projectFileName $(HOTSPOTBUILDROOT)\$(ProjectFile) \ 17.9 -jdkTargetRoot $(HOTSPOTJDKDIST) \ 17.10 -define ALIGN_STACK_FRAMES \ 17.11 -define VM_LITTLE_ENDIAN \ 17.12 -prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LINK_VER)" \ 17.13 + -postbuild "" "Building hotspot.exe..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) nmake -f $(HOTSPOTWORKSPACE)\make\windows\projectfiles\common\Makefile LOCAL_MAKE=$(HOTSPOTBUILDSPACE)\%f\local.make JAVA_HOME=$(HOTSPOTJDKDIST) launcher" \ 17.14 -ignoreFile jsig.c \ 17.15 -ignoreFile jvmtiEnvRecommended.cpp \ 17.16 -ignoreFile jvmtiEnvStub.cpp \
18.1 --- a/make/windows/makefiles/rules.make Thu Dec 16 09:14:34 2010 -0800 18.2 +++ b/make/windows/makefiles/rules.make Thu Dec 16 12:56:51 2010 -0800 18.3 @@ -1,5 +1,5 @@ 18.4 # 18.5 -# Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. 18.6 +# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 18.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 18.8 # 18.9 # This code is free software; you can redistribute it and/or modify it 18.10 @@ -48,7 +48,7 @@ 18.11 JAVAC_FLAGS=-g -encoding ascii 18.12 BOOTSTRAP_JAVAC_FLAGS=$(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION) 18.13 18.14 -ProjectFile=vm.vcproj 18.15 +ProjectFile=jvm.vcproj 18.16 18.17 !if "$(MSC_VER)" == "1200" 18.18 18.19 @@ -63,6 +63,11 @@ 18.20 18.21 VcVersion=VC9 18.22 18.23 +!elseif "$(MSC_VER)" == "1600" 18.24 + 18.25 +# for compatibility - we don't yet have a ProjectCreator for VC10 18.26 +VcVersion=VC9 18.27 + 18.28 !else 18.29 18.30 VcVersion=VC7
19.1 --- a/make/windows/makefiles/vm.make Thu Dec 16 09:14:34 2010 -0800 19.2 +++ b/make/windows/makefiles/vm.make Thu Dec 16 12:56:51 2010 -0800 19.3 @@ -71,22 +71,11 @@ 19.4 CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_USER=\"$(BuildUser)\"" 19.5 CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_VM_DISTRO=\"$(HOTSPOT_VM_DISTRO)\"" 19.6 19.7 -CPP_FLAGS=$(CPP_FLAGS) /D "WIN32" /D "_WINDOWS" $(CPP_INCLUDE_DIRS) 19.8 - 19.9 -# Must specify this for sharedRuntimeTrig.cpp 19.10 -CPP_FLAGS=$(CPP_FLAGS) /D "VM_LITTLE_ENDIAN" 19.11 +CPP_FLAGS=$(CPP_FLAGS) $(CPP_INCLUDE_DIRS) 19.12 19.13 # Define that so jni.h is on correct side 19.14 CPP_FLAGS=$(CPP_FLAGS) /D "_JNI_IMPLEMENTATION_" 19.15 19.16 -# Used for platform dispatching 19.17 -CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_FAMILY_windows 19.18 -CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_$(Platform_arch) 19.19 -CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_MODEL_$(Platform_arch_model) 19.20 -CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_windows_$(Platform_arch) 19.21 -CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model) 19.22 -CPP_FLAGS=$(CPP_FLAGS) /D TARGET_COMPILER_visCPP 19.23 - 19.24 !if "$(BUILDARCH)" == "ia64" 19.25 STACK_SIZE="/STACK:1048576,262144" 19.26 !else 19.27 @@ -104,6 +93,8 @@ 19.28 !endif 19.29 !endif 19.30 19.31 +# If you modify exports below please do the corresponding changes in 19.32 +# src/share/tools/ProjectCreator/WinGammaPlatformVC7.java 19.33 LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \ 19.34 /export:JNI_GetDefaultJavaVMInitArgs \ 19.35 /export:JNI_CreateJavaVM \
20.1 --- a/make/windows/projectfiles/common/Makefile Thu Dec 16 09:14:34 2010 -0800 20.2 +++ b/make/windows/projectfiles/common/Makefile Thu Dec 16 12:56:51 2010 -0800 20.3 @@ -22,7 +22,10 @@ 20.4 # 20.5 # 20.6 20.7 -!include local.make 20.8 +!ifdef LOCAL_MAKE 20.9 +!include $(LOCAL_MAKE) 20.10 +!endif 20.11 + 20.12 20.13 WorkSpace=$(HOTSPOTWORKSPACE) 20.14 20.15 @@ -34,11 +37,18 @@ 20.16 !else 20.17 !ifdef JAVA_HOME 20.18 BootStrapDir=$(JAVA_HOME) 20.19 +!else 20.20 +!ifdef HOTSPOTJDKDIST 20.21 +BootStrapDir=$(HOTSPOTJDKDIST) 20.22 +!endif 20.23 !endif 20.24 !endif 20.25 !endif 20.26 20.27 + 20.28 + 20.29 !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/projectcreator.make 20.30 +!include $(WorkSpace)/make/windows/makefiles/compile.make 20.31 20.32 # Pick up rules for building JVMTI (JSR-163) 20.33 JvmtiOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\jvmtifiles 20.34 @@ -56,6 +66,9 @@ 20.35 !include $(HOTSPOTWORKSPACE)/make/windows/makefiles/adlc.make 20.36 !endif 20.37 20.38 +HS_INTERNAL_NAME=jvm 20.39 +!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/launcher.make 20.40 + 20.41 default:: $(AdditionalTargets) $(JvmtiGeneratedFiles) 20.42 20.43 !include $(HOTSPOTWORKSPACE)/make/hotspot_version 20.44 @@ -97,7 +110,7 @@ 20.45 -define JRE_RELEASE_VERSION=\\\"$(JRE_RELEASE_VERSION)\\\" \ 20.46 -define HOTSPOT_VM_DISTRO=\\\"$(HOTSPOT_VM_DISTRO)\\\" 20.47 20.48 -$(HOTSPOTBUILDSPACE)/$(ProjectFile): local.make $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class 20.49 +$(HOTSPOTBUILDROOT)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class 20.50 @$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions) 20.51 20.52 clean:
21.1 --- a/make/windows/projectfiles/compiler1/Makefile Thu Dec 16 09:14:34 2010 -0800 21.2 +++ b/make/windows/projectfiles/compiler1/Makefile Thu Dec 16 12:56:51 2010 -0800 21.3 @@ -1,5 +1,5 @@ 21.4 # 21.5 -# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved. 21.6 +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 21.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 21.8 # 21.9 # This code is free software; you can redistribute it and/or modify it 21.10 @@ -22,7 +22,6 @@ 21.11 # 21.12 # 21.13 21.14 -Variant=compiler1 21.15 -!include local.make 21.16 +!include ../local.make 21.17 21.18 !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
22.1 --- a/make/windows/projectfiles/compiler1/vm.def Thu Dec 16 09:14:34 2010 -0800 22.2 +++ b/make/windows/projectfiles/compiler1/vm.def Thu Dec 16 12:56:51 2010 -0800 22.3 @@ -2,6 +2,6 @@ 22.4 ; This .DEF file is a placeholder for one which is automatically 22.5 ; generated during the build process. See 22.6 ; make\windows\build_vm_def.sh and 22.7 -; make\windows\makefiles\makedeps.make (esp. the "-prelink" 22.8 +; make\windows\makefiles\projectcreator.make (esp. the "-prelink" 22.9 ; options). 22.10 ;
23.1 --- a/make/windows/projectfiles/compiler2/Makefile Thu Dec 16 09:14:34 2010 -0800 23.2 +++ b/make/windows/projectfiles/compiler2/Makefile Thu Dec 16 12:56:51 2010 -0800 23.3 @@ -22,8 +22,7 @@ 23.4 # 23.5 # 23.6 23.7 -Variant=compiler2 23.8 -!include local.make 23.9 +!include ../local.make 23.10 AdlcOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\adfiles 23.11 AdditionalTargets=$(AdlcOutDir)\ad_$(Platform_arch_model).cpp $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp 23.12
24.1 --- a/make/windows/projectfiles/compiler2/vm.def Thu Dec 16 09:14:34 2010 -0800 24.2 +++ b/make/windows/projectfiles/compiler2/vm.def Thu Dec 16 12:56:51 2010 -0800 24.3 @@ -2,6 +2,6 @@ 24.4 ; This .DEF file is a placeholder for one which is automatically 24.5 ; generated during the build process. See 24.6 ; make\windows\build_vm_def.sh and 24.7 -; make\windows\makefiles\makedeps.make (esp. the "-prelink" 24.8 +; make\windows\makefiles\projectcreator.make (esp. the "-prelink" 24.9 ; options). 24.10 ;
25.1 --- a/make/windows/projectfiles/core/Makefile Thu Dec 16 09:14:34 2010 -0800 25.2 +++ b/make/windows/projectfiles/core/Makefile Thu Dec 16 12:56:51 2010 -0800 25.3 @@ -1,5 +1,5 @@ 25.4 # 25.5 -# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved. 25.6 +# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 25.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 25.8 # 25.9 # This code is free software; you can redistribute it and/or modify it 25.10 @@ -22,7 +22,6 @@ 25.11 # 25.12 # 25.13 25.14 -Variant=core 25.15 -!include local.make 25.16 +!include ../local.make 25.17 25.18 !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
26.1 --- a/make/windows/projectfiles/core/vm.def Thu Dec 16 09:14:34 2010 -0800 26.2 +++ b/make/windows/projectfiles/core/vm.def Thu Dec 16 12:56:51 2010 -0800 26.3 @@ -2,6 +2,6 @@ 26.4 ; This .DEF file is a placeholder for one which is automatically 26.5 ; generated during the build process. See 26.6 ; make\windows\build_vm_def.sh and 26.7 -; make\windows\makefiles\makedeps.make (esp. the "-prelink" 26.8 +; make\windows\makefiles\projectcreator.make (esp. the "-prelink" 26.9 ; options). 26.10 ;
27.1 --- a/make/windows/projectfiles/kernel/Makefile Thu Dec 16 09:14:34 2010 -0800 27.2 +++ b/make/windows/projectfiles/kernel/Makefile Thu Dec 16 12:56:51 2010 -0800 27.3 @@ -1,5 +1,5 @@ 27.4 # 27.5 -# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. 27.6 +# Copyright (c) 2007, 2010 Oracle and/or its affiliates. All rights reserved. 27.7 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 27.8 # 27.9 # This code is free software; you can redistribute it and/or modify it 27.10 @@ -22,7 +22,6 @@ 27.11 # 27.12 # 27.13 27.14 -Variant=kernel 27.15 -!include local.make 27.16 +!include ../local.make 27.17 27.18 !include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
28.1 --- a/make/windows/projectfiles/kernel/vm.def Thu Dec 16 09:14:34 2010 -0800 28.2 +++ b/make/windows/projectfiles/kernel/vm.def Thu Dec 16 12:56:51 2010 -0800 28.3 @@ -2,6 +2,6 @@ 28.4 ; This .DEF file is a placeholder for one which is automatically 28.5 ; generated during the build process. See 28.6 ; make\windows\build_vm_def.sh and 28.7 -; make\windows\makefiles\makedeps.make (esp. the "-prelink" 28.8 +; make\windows\makefiles\projectcreator.make (esp. the "-prelink" 28.9 ; options). 28.10 ;
29.1 --- a/make/windows/projectfiles/tiered/Makefile Thu Dec 16 09:14:34 2010 -0800 29.2 +++ b/make/windows/projectfiles/tiered/Makefile Thu Dec 16 12:56:51 2010 -0800 29.3 @@ -22,8 +22,7 @@ 29.4 # 29.5 # 29.6 29.7 -Variant=tiered 29.8 -!include local.make 29.9 +!include ../local.make 29.10 AdlcOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\adfiles 29.11 AdditionalTargets=$(AdlcOutDir)\ad_$(Platform_arch_model).cpp $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp 29.12
30.1 --- a/make/windows/projectfiles/tiered/vm.def Thu Dec 16 09:14:34 2010 -0800 30.2 +++ b/make/windows/projectfiles/tiered/vm.def Thu Dec 16 12:56:51 2010 -0800 30.3 @@ -2,6 +2,6 @@ 30.4 ; This .DEF file is a placeholder for one which is automatically 30.5 ; generated during the build process. See 30.6 ; make\windows\build_vm_def.sh and 30.7 -; make\windows\makefiles\makedeps.make (esp. the "-prelink" 30.8 +; make\windows\makefiles\projectcreator.make (esp. the "-prelink" 30.9 ; options). 30.10 ;
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 31.2 +++ b/src/os/linux/vm/decoder_linux.cpp Thu Dec 16 12:56:51 2010 -0800 31.3 @@ -0,0 +1,45 @@ 31.4 +/* 31.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 31.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 31.7 + * 31.8 + * This code is free software; you can redistribute it and/or modify it 31.9 + * under the terms of the GNU General Public License version 2 only, as 31.10 + * published by the Free Software Foundation. 31.11 + * 31.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 31.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 31.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 31.15 + * version 2 for more details (a copy is included in the LICENSE file that 31.16 + * accompanied this code). 31.17 + * 31.18 + * You should have received a copy of the GNU General Public License version 31.19 + * 2 along with this work; if not, write to the Free Software Foundation, 31.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 31.21 + * 31.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 31.23 + * or visit www.oracle.com if you need additional information or have any 31.24 + * questions. 31.25 + * 31.26 + */ 31.27 + 31.28 +#include "prims/jvm.h" 31.29 +#include "utilities/decoder.hpp" 31.30 + 31.31 +#include <cxxabi.h> 31.32 + 31.33 +bool Decoder::demangle(const char* symbol, char *buf, int buflen) { 31.34 + int status; 31.35 + char* result; 31.36 + size_t size = (size_t)buflen; 31.37 + 31.38 + // Don't pass buf to __cxa_demangle. In case of the 'buf' is too small, 31.39 + // __cxa_demangle will call system "realloc" for additional memory, which 31.40 + // may use different malloc/realloc mechanism that allocates 'buf'. 31.41 + if ((result = abi::__cxa_demangle(symbol, NULL, NULL, &status)) != NULL) { 31.42 + jio_snprintf(buf, buflen, "%s", result); 31.43 + // call c library's free 31.44 + ::free(result); 31.45 + return true; 31.46 + } 31.47 + return false; 31.48 +}
32.1 --- a/src/os/linux/vm/os_linux.cpp Thu Dec 16 09:14:34 2010 -0800 32.2 +++ b/src/os/linux/vm/os_linux.cpp Thu Dec 16 12:56:51 2010 -0800 32.3 @@ -59,6 +59,7 @@ 32.4 #include "services/attachListener.hpp" 32.5 #include "services/runtimeService.hpp" 32.6 #include "thread_linux.inline.hpp" 32.7 +#include "utilities/decoder.hpp" 32.8 #include "utilities/defaultStream.hpp" 32.9 #include "utilities/events.hpp" 32.10 #include "utilities/growableArray.hpp" 32.11 @@ -1688,14 +1689,23 @@ 32.12 Dl_info dlinfo; 32.13 32.14 if (dladdr((void*)addr, &dlinfo) && dlinfo.dli_sname != NULL) { 32.15 - if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname); 32.16 - if (offset) *offset = addr - (address)dlinfo.dli_saddr; 32.17 + if (buf != NULL) { 32.18 + if(!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) { 32.19 + jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname); 32.20 + } 32.21 + } 32.22 + if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr; 32.23 return true; 32.24 - } else { 32.25 - if (buf) buf[0] = '\0'; 32.26 - if (offset) *offset = -1; 32.27 - return false; 32.28 + } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) { 32.29 + if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase), 32.30 + dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) { 32.31 + return true; 32.32 + } 32.33 } 32.34 + 32.35 + if (buf != NULL) buf[0] = '\0'; 32.36 + if (offset != NULL) *offset = -1; 32.37 + return false; 32.38 } 32.39 32.40 struct _address_to_library_name {
33.1 --- a/src/os/posix/launcher/java_md.c Thu Dec 16 09:14:34 2010 -0800 33.2 +++ b/src/os/posix/launcher/java_md.c Thu Dec 16 12:56:51 2010 -0800 33.3 @@ -28,6 +28,7 @@ 33.4 #include <dlfcn.h> 33.5 #include <fcntl.h> 33.6 #include <inttypes.h> 33.7 +#include <stdint.h> 33.8 #include <stdio.h> 33.9 #include <string.h> 33.10 #include <stdlib.h> 33.11 @@ -812,13 +813,10 @@ 33.12 33.13 #ifdef GAMMA 33.14 { 33.15 - /* gamma launcher uses JAVA_HOME or ALT_JAVA_HOME environment variable to find JDK/JRE */ 33.16 - char* java_home_var = getenv("ALT_JAVA_HOME"); 33.17 + /* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */ 33.18 + char* java_home_var = getenv("JAVA_HOME"); 33.19 if (java_home_var == NULL) { 33.20 - java_home_var = getenv("JAVA_HOME"); 33.21 - } 33.22 - if (java_home_var == NULL) { 33.23 - printf("JAVA_HOME or ALT_JAVA_HOME must point to a valid JDK/JRE to run gamma\n"); 33.24 + printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n"); 33.25 return JNI_FALSE; 33.26 } 33.27 snprintf(buf, bufsize, "%s", java_home_var); 33.28 @@ -1837,7 +1835,7 @@ 33.29 if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) { 33.30 void * tmp; 33.31 pthread_join(tid, &tmp); 33.32 - rslt = (int)tmp; 33.33 + rslt = (int)(intptr_t)tmp; 33.34 } else { 33.35 /* 33.36 * Continue execution in current thread if for some reason (e.g. out of 33.37 @@ -1855,7 +1853,7 @@ 33.38 if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) { 33.39 void * tmp; 33.40 thr_join(tid, NULL, &tmp); 33.41 - rslt = (int)tmp; 33.42 + rslt = (int)(intptr_t)tmp; 33.43 } else { 33.44 /* See above. Continue in current thread if thr_create() failed */ 33.45 rslt = continuation(args);
34.1 --- a/src/os/posix/launcher/launcher.script Thu Dec 16 09:14:34 2010 -0800 34.2 +++ b/src/os/posix/launcher/launcher.script Thu Dec 16 12:56:51 2010 -0800 34.3 @@ -95,17 +95,21 @@ 34.4 ;; 34.5 esac 34.6 34.7 +# Find out the absolute path to this script 34.8 +MYDIR=$(cd $(dirname $SCRIPT) && pwd) 34.9 + 34.10 +JDK= 34.11 if [ "${ALT_JAVA_HOME}" = "" ]; then 34.12 - if [ "${JAVA_HOME}" = "" ]; then 34.13 - echo "Neither ALT_JAVA_HOME nor JAVA_HOME is set. Aborting."; 34.14 - exit 1; 34.15 - else 34.16 - JDK=${JAVA_HOME%%/jre}; 34.17 - fi 34.18 + source ${MYDIR}/jdkpath.sh 34.19 else 34.20 JDK=${ALT_JAVA_HOME%%/jre}; 34.21 fi 34.22 34.23 +if [ "${JDK}" = "" ]; then 34.24 + echo Failed to find JDK. ALT_JAVA_HOME is not set or ./jdkpath.sh is empty or not found. 34.25 + exit 1 34.26 +fi 34.27 + 34.28 # We will set the LD_LIBRARY_PATH as follows: 34.29 # o $JVMPATH (directory portion only) 34.30 # o $JRE/lib/$ARCH
35.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 35.2 +++ b/src/os/solaris/vm/decoder_solaris.cpp Thu Dec 16 12:56:51 2010 -0800 35.3 @@ -0,0 +1,31 @@ 35.4 +/* 35.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 35.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 35.7 + * 35.8 + * This code is free software; you can redistribute it and/or modify it 35.9 + * under the terms of the GNU General Public License version 2 only, as 35.10 + * published by the Free Software Foundation. 35.11 + * 35.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 35.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 35.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 35.15 + * version 2 for more details (a copy is included in the LICENSE file that 35.16 + * accompanied this code). 35.17 + * 35.18 + * You should have received a copy of the GNU General Public License version 35.19 + * 2 along with this work; if not, write to the Free Software Foundation, 35.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 35.21 + * 35.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 35.23 + * or visit www.oracle.com if you need additional information or have any 35.24 + * questions. 35.25 + * 35.26 + */ 35.27 + 35.28 +#include "utilities/decoder.hpp" 35.29 + 35.30 +#include <demangle.h> 35.31 + 35.32 +bool Decoder::demangle(const char* symbol, char *buf, int buflen) { 35.33 + return !cplus_demangle(symbol, buf, (size_t)buflen); 35.34 +}
36.1 --- a/src/os/solaris/vm/os_solaris.cpp Thu Dec 16 09:14:34 2010 -0800 36.2 +++ b/src/os/solaris/vm/os_solaris.cpp Thu Dec 16 12:56:51 2010 -0800 36.3 @@ -57,6 +57,7 @@ 36.4 #include "services/attachListener.hpp" 36.5 #include "services/runtimeService.hpp" 36.6 #include "thread_solaris.inline.hpp" 36.7 +#include "utilities/decoder.hpp" 36.8 #include "utilities/defaultStream.hpp" 36.9 #include "utilities/events.hpp" 36.10 #include "utilities/growableArray.hpp" 36.11 @@ -1969,27 +1970,42 @@ 36.12 Sym * info; 36.13 if (dladdr1_func((void *)addr, &dlinfo, (void **)&info, 36.14 RTLD_DL_SYMENT)) { 36.15 - if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname); 36.16 - if (offset) *offset = addr - (address)dlinfo.dli_saddr; 36.17 - 36.18 - // check if the returned symbol really covers addr 36.19 - return ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr); 36.20 - } else { 36.21 - if (buf) buf[0] = '\0'; 36.22 - if (offset) *offset = -1; 36.23 - return false; 36.24 + if ((char *)dlinfo.dli_saddr + info->st_size > (char *)addr) { 36.25 + if (buf != NULL) { 36.26 + if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) 36.27 + jio_snprintf(buf, buflen, "%s", dlinfo.dli_sname); 36.28 + } 36.29 + if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr; 36.30 + return true; 36.31 + } 36.32 } 36.33 + if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) { 36.34 + if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase), 36.35 + dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) { 36.36 + return true; 36.37 + } 36.38 + } 36.39 + if (buf != NULL) buf[0] = '\0'; 36.40 + if (offset != NULL) *offset = -1; 36.41 + return false; 36.42 } else { 36.43 // no, only dladdr is available 36.44 - if(dladdr((void *)addr, &dlinfo)) { 36.45 - if (buf) jio_snprintf(buf, buflen, dlinfo.dli_sname); 36.46 - if (offset) *offset = addr - (address)dlinfo.dli_saddr; 36.47 + if (dladdr((void *)addr, &dlinfo)) { 36.48 + if (buf != NULL) { 36.49 + if (!Decoder::demangle(dlinfo.dli_sname, buf, buflen)) 36.50 + jio_snprintf(buf, buflen, dlinfo.dli_sname); 36.51 + } 36.52 + if (offset != NULL) *offset = addr - (address)dlinfo.dli_saddr; 36.53 + return true; 36.54 + } else if (dlinfo.dli_fname != NULL && dlinfo.dli_fbase != 0) { 36.55 + if (Decoder::decode((address)(addr - (address)dlinfo.dli_fbase), 36.56 + dlinfo.dli_fname, buf, buflen, offset) == Decoder::no_error) { 36.57 return true; 36.58 - } else { 36.59 - if (buf) buf[0] = '\0'; 36.60 - if (offset) *offset = -1; 36.61 - return false; 36.62 + } 36.63 } 36.64 + if (buf != NULL) buf[0] = '\0'; 36.65 + if (offset != NULL) *offset = -1; 36.66 + return false; 36.67 } 36.68 } 36.69
37.1 --- a/src/os/windows/launcher/java_md.c Thu Dec 16 09:14:34 2010 -0800 37.2 +++ b/src/os/windows/launcher/java_md.c Thu Dec 16 12:56:51 2010 -0800 37.3 @@ -22,6 +22,7 @@ 37.4 * 37.5 */ 37.6 37.7 +#include <ctype.h> 37.8 #include <windows.h> 37.9 #include <io.h> 37.10 #include <process.h> 37.11 @@ -486,16 +487,62 @@ 37.12 37.13 #else /* ifndef GAMMA */ 37.14 37.15 - /* gamma launcher uses JAVA_HOME or ALT_JAVA_HOME environment variable to find JDK/JRE */ 37.16 - char* java_home_var = getenv("ALT_JAVA_HOME"); 37.17 - if (java_home_var == NULL) { 37.18 - java_home_var = getenv("JAVA_HOME"); 37.19 + char env[MAXPATHLEN + 1]; 37.20 + 37.21 + /* gamma launcher uses ALT_JAVA_HOME environment variable or jdkpath.txt file to find JDK/JRE */ 37.22 + 37.23 + if (getenv("ALT_JAVA_HOME") != NULL) { 37.24 + snprintf(buf, bufsize, "%s", getenv("ALT_JAVA_HOME")); 37.25 } 37.26 - if (java_home_var == NULL) { 37.27 - printf("JAVA_HOME or ALT_JAVA_HOME must point to a valid JDK/JRE to run gamma\n"); 37.28 - return JNI_FALSE; 37.29 + else { 37.30 + char path[MAXPATHLEN + 1]; 37.31 + char* p; 37.32 + int len; 37.33 + FILE* fp; 37.34 + 37.35 + // find the path to the currect executable 37.36 + len = GetModuleFileName(NULL, path, MAXPATHLEN + 1); 37.37 + if (len == 0 || len > MAXPATHLEN) { 37.38 + printf("Could not get directory of current executable."); 37.39 + return JNI_FALSE; 37.40 + } 37.41 + // remove last path component ("hotspot.exe") 37.42 + p = strrchr(path, '\\'); 37.43 + if (p == NULL) { 37.44 + printf("Could not parse directory of current executable.\n"); 37.45 + return JNI_FALSE; 37.46 + } 37.47 + *p = '\0'; 37.48 + 37.49 + // open jdkpath.txt and read JAVA_HOME from it 37.50 + if (strlen(path) + strlen("\\jdkpath.txt") + 1 >= MAXPATHLEN) { 37.51 + printf("Path too long: %s\n", path); 37.52 + return JNI_FALSE; 37.53 + } 37.54 + strcat(path, "\\jdkpath.txt"); 37.55 + fp = fopen(path, "r"); 37.56 + if (fp == NULL) { 37.57 + printf("Could not open file %s to get path to JDK.\n", path); 37.58 + return JNI_FALSE; 37.59 + } 37.60 + 37.61 + if (fgets(buf, bufsize, fp) == NULL) { 37.62 + printf("Could not read from file %s to get path to JDK.\n", path); 37.63 + fclose(fp); 37.64 + return JNI_FALSE; 37.65 + } 37.66 + // trim the buffer 37.67 + p = buf + strlen(buf) - 1; 37.68 + while(isspace(*p)) { 37.69 + *p = '\0'; 37.70 + p--; 37.71 + } 37.72 + fclose(fp); 37.73 } 37.74 - snprintf(buf, bufsize, "%s", java_home_var); 37.75 + 37.76 + _snprintf(env, MAXPATHLEN, "JAVA_HOME=%s", buf); 37.77 + _putenv(env); 37.78 + 37.79 return JNI_TRUE; 37.80 #endif /* ifndef GAMMA */ 37.81 }
38.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 38.2 +++ b/src/os/windows/vm/decoder_windows.cpp Thu Dec 16 12:56:51 2010 -0800 38.3 @@ -0,0 +1,123 @@ 38.4 +/* 38.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 38.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 38.7 + * 38.8 + * This code is free software; you can redistribute it and/or modify it 38.9 + * under the terms of the GNU General Public License version 2 only, as 38.10 + * published by the Free Software Foundation. 38.11 + * 38.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 38.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 38.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 38.15 + * version 2 for more details (a copy is included in the LICENSE file that 38.16 + * accompanied this code). 38.17 + * 38.18 + * You should have received a copy of the GNU General Public License version 38.19 + * 2 along with this work; if not, write to the Free Software Foundation, 38.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 38.21 + * 38.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 38.23 + * or visit www.oracle.com if you need additional information or have any 38.24 + * questions. 38.25 + * 38.26 + */ 38.27 + 38.28 +#include "precompiled.hpp" 38.29 +#include "prims/jvm.h" 38.30 +#include "utilities/decoder.hpp" 38.31 + 38.32 +HMODULE Decoder::_dbghelp_handle = NULL; 38.33 +bool Decoder::_can_decode_in_vm = false; 38.34 +pfn_SymGetSymFromAddr64 Decoder::_pfnSymGetSymFromAddr64 = NULL; 38.35 +pfn_UndecorateSymbolName Decoder::_pfnUndecorateSymbolName = NULL; 38.36 + 38.37 +void Decoder::initialize() { 38.38 + if (!_initialized) { 38.39 + _initialized = true; 38.40 + 38.41 + HMODULE handle = ::LoadLibrary("dbghelp.dll"); 38.42 + if (!handle) { 38.43 + _decoder_status = helper_not_found; 38.44 + return; 38.45 + } 38.46 + 38.47 + _dbghelp_handle = handle; 38.48 + 38.49 + pfn_SymSetOptions _pfnSymSetOptions = (pfn_SymSetOptions)::GetProcAddress(handle, "SymSetOptions"); 38.50 + pfn_SymInitialize _pfnSymInitialize = (pfn_SymInitialize)::GetProcAddress(handle, "SymInitialize"); 38.51 + _pfnSymGetSymFromAddr64 = (pfn_SymGetSymFromAddr64)::GetProcAddress(handle, "SymGetSymFromAddr64"); 38.52 + _pfnUndecorateSymbolName = (pfn_UndecorateSymbolName)GetProcAddress(handle, "UnDecorateSymbolName"); 38.53 + 38.54 + if (_pfnSymSetOptions == NULL || _pfnSymInitialize == NULL || _pfnSymGetSymFromAddr64 == NULL) { 38.55 + _pfnSymGetSymFromAddr64 = NULL; 38.56 + _pfnUndecorateSymbolName = NULL; 38.57 + ::FreeLibrary(handle); 38.58 + _dbghelp_handle = NULL; 38.59 + _decoder_status = helper_func_error; 38.60 + return; 38.61 + } 38.62 + 38.63 + _pfnSymSetOptions(SYMOPT_UNDNAME | SYMOPT_DEFERRED_LOADS); 38.64 + if (!_pfnSymInitialize(GetCurrentProcess(), NULL, TRUE)) { 38.65 + _pfnSymGetSymFromAddr64 = NULL; 38.66 + _pfnUndecorateSymbolName = NULL; 38.67 + ::FreeLibrary(handle); 38.68 + _dbghelp_handle = NULL; 38.69 + _decoder_status = helper_init_error; 38.70 + return; 38.71 + } 38.72 + 38.73 + // find out if jvm.dll contains private symbols, by decoding 38.74 + // current function and comparing the result 38.75 + address addr = (address)Decoder::initialize; 38.76 + char buf[MAX_PATH]; 38.77 + if (decode(addr, buf, sizeof(buf), NULL) == no_error) { 38.78 + _can_decode_in_vm = !strcmp(buf, "Decoder::initialize"); 38.79 + } 38.80 + } 38.81 +} 38.82 + 38.83 +void Decoder::uninitialize() { 38.84 + assert(_initialized, "Decoder not yet initialized"); 38.85 + _pfnSymGetSymFromAddr64 = NULL; 38.86 + _pfnUndecorateSymbolName = NULL; 38.87 + if (_dbghelp_handle != NULL) { 38.88 + ::FreeLibrary(_dbghelp_handle); 38.89 + } 38.90 + _initialized = false; 38.91 +} 38.92 + 38.93 +bool Decoder::can_decode_C_frame_in_vm() { 38.94 + initialize(); 38.95 + return _can_decode_in_vm; 38.96 +} 38.97 + 38.98 + 38.99 +Decoder::decoder_status Decoder::decode(address addr, char *buf, int buflen, int *offset) { 38.100 + assert(_initialized, "Decoder not yet initialized"); 38.101 + if (_pfnSymGetSymFromAddr64 != NULL) { 38.102 + PIMAGEHLP_SYMBOL64 pSymbol; 38.103 + char symbolInfo[MAX_PATH + sizeof(IMAGEHLP_SYMBOL64)]; 38.104 + pSymbol = (PIMAGEHLP_SYMBOL64)symbolInfo; 38.105 + pSymbol->MaxNameLength = MAX_PATH; 38.106 + pSymbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL64); 38.107 + DWORD64 displacement; 38.108 + if (_pfnSymGetSymFromAddr64(::GetCurrentProcess(), (DWORD64)addr, &displacement, pSymbol)) { 38.109 + if (buf != NULL) { 38.110 + if (!demangle(pSymbol->Name, buf, buflen)) { 38.111 + jio_snprintf(buf, buflen, "%s", pSymbol->Name); 38.112 + } 38.113 + } 38.114 + if (offset != NULL) *offset = (int)displacement; 38.115 + return no_error; 38.116 + } 38.117 + } 38.118 + return helper_not_found; 38.119 +} 38.120 + 38.121 +bool Decoder::demangle(const char* symbol, char *buf, int buflen) { 38.122 + assert(_initialized, "Decoder not yet initialized"); 38.123 + return _pfnUndecorateSymbolName != NULL && 38.124 + _pfnUndecorateSymbolName(symbol, buf, buflen, UNDNAME_COMPLETE); 38.125 +} 38.126 +
39.1 --- a/src/os/windows/vm/os_windows.cpp Thu Dec 16 09:14:34 2010 -0800 39.2 +++ b/src/os/windows/vm/os_windows.cpp Thu Dec 16 12:56:51 2010 -0800 39.3 @@ -62,6 +62,7 @@ 39.4 #include "services/attachListener.hpp" 39.5 #include "services/runtimeService.hpp" 39.6 #include "thread_windows.inline.hpp" 39.7 +#include "utilities/decoder.hpp" 39.8 #include "utilities/defaultStream.hpp" 39.9 #include "utilities/events.hpp" 39.10 #include "utilities/growableArray.hpp" 39.11 @@ -1365,12 +1366,11 @@ 39.12 39.13 bool os::dll_address_to_function_name(address addr, char *buf, 39.14 int buflen, int *offset) { 39.15 - // Unimplemented on Windows - in order to use SymGetSymFromAddr(), 39.16 - // we need to initialize imagehlp/dbghelp, then load symbol table 39.17 - // for every module. That's too much work to do after a fatal error. 39.18 - // For an example on how to implement this function, see 1.4.2. 39.19 - if (offset) *offset = -1; 39.20 - if (buf) buf[0] = '\0'; 39.21 + if (Decoder::decode(addr, buf, buflen, offset) == Decoder::no_error) { 39.22 + return true; 39.23 + } 39.24 + if (offset != NULL) *offset = -1; 39.25 + if (buf != NULL) buf[0] = '\0'; 39.26 return false; 39.27 } 39.28 39.29 @@ -1711,14 +1711,11 @@ 39.30 buf[0] = '\0'; 39.31 if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) { 39.32 // Support for the gamma launcher. Check for an 39.33 - // ALT_JAVA_HOME or JAVA_HOME environment variable 39.34 + // JAVA_HOME environment variable 39.35 // and fix up the path so it looks like 39.36 // libjvm.so is installed there (append a fake suffix 39.37 // hotspot/libjvm.so). 39.38 - char* java_home_var = ::getenv("ALT_JAVA_HOME"); 39.39 - if (java_home_var == NULL) { 39.40 - java_home_var = ::getenv("JAVA_HOME"); 39.41 - } 39.42 + char* java_home_var = ::getenv("JAVA_HOME"); 39.43 if (java_home_var != NULL && java_home_var[0] != 0) { 39.44 39.45 strncpy(buf, java_home_var, buflen);
40.1 --- a/src/share/tools/ProjectCreator/BuildConfig.java Thu Dec 16 09:14:34 2010 -0800 40.2 +++ b/src/share/tools/ProjectCreator/BuildConfig.java Thu Dec 16 12:56:51 2010 -0800 40.3 @@ -22,8 +22,11 @@ 40.4 * 40.5 */ 40.6 40.7 -import java.util.*; 40.8 import java.io.File; 40.9 +import java.util.Enumeration; 40.10 +import java.util.Hashtable; 40.11 +import java.util.Iterator; 40.12 +import java.util.Vector; 40.13 40.14 class BuildConfig { 40.15 Hashtable vars; 40.16 @@ -57,7 +60,6 @@ 40.17 40.18 // ones mentioned above were needed to expand format 40.19 String buildBase = expandFormat(getFieldString(null, "BuildBase")); 40.20 - String jdkDir = getFieldString(null, "JdkTargetRoot"); 40.21 String sourceBase = getFieldString(null, "SourceBase"); 40.22 String outDir = buildBase; 40.23 40.24 @@ -65,7 +67,7 @@ 40.25 put("OutputDir", outDir); 40.26 put("SourceBase", sourceBase); 40.27 put("BuildBase", buildBase); 40.28 - put("OutputDll", jdkDir + Util.sep + outDll); 40.29 + put("OutputDll", outDir + Util.sep + outDll); 40.30 40.31 context = new String [] {flavourBuild, flavour, build, null}; 40.32 } 40.33 @@ -537,68 +539,75 @@ 40.34 } 40.35 } 40.36 40.37 -class C1DebugConfig extends GenericDebugConfig { 40.38 +abstract class GenericDebugNonKernelConfig extends GenericDebugConfig { 40.39 + protected void init(Vector includes, Vector defines) { 40.40 + super.init(includes, defines); 40.41 + getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags")); 40.42 + } 40.43 +} 40.44 + 40.45 +class C1DebugConfig extends GenericDebugNonKernelConfig { 40.46 String getOptFlag() { 40.47 return getCI().getNoOptFlag(); 40.48 } 40.49 40.50 C1DebugConfig() { 40.51 - initNames("compiler1", "debug", "fastdebug\\jre\\bin\\client\\jvm.dll"); 40.52 + initNames("compiler1", "debug", "jvm.dll"); 40.53 init(getIncludes(), getDefines()); 40.54 } 40.55 } 40.56 40.57 -class C1FastDebugConfig extends GenericDebugConfig { 40.58 +class C1FastDebugConfig extends GenericDebugNonKernelConfig { 40.59 String getOptFlag() { 40.60 return getCI().getOptFlag(); 40.61 } 40.62 40.63 C1FastDebugConfig() { 40.64 - initNames("compiler1", "fastdebug", "fastdebug\\jre\\bin\\client\\jvm.dll"); 40.65 + initNames("compiler1", "fastdebug", "jvm.dll"); 40.66 init(getIncludes(), getDefines()); 40.67 } 40.68 } 40.69 40.70 -class C2DebugConfig extends GenericDebugConfig { 40.71 +class C2DebugConfig extends GenericDebugNonKernelConfig { 40.72 String getOptFlag() { 40.73 return getCI().getNoOptFlag(); 40.74 } 40.75 40.76 C2DebugConfig() { 40.77 - initNames("compiler2", "debug", "fastdebug\\jre\\bin\\server\\jvm.dll"); 40.78 + initNames("compiler2", "debug", "jvm.dll"); 40.79 init(getIncludes(), getDefines()); 40.80 } 40.81 } 40.82 40.83 -class C2FastDebugConfig extends GenericDebugConfig { 40.84 +class C2FastDebugConfig extends GenericDebugNonKernelConfig { 40.85 String getOptFlag() { 40.86 return getCI().getOptFlag(); 40.87 } 40.88 40.89 C2FastDebugConfig() { 40.90 - initNames("compiler2", "fastdebug", "fastdebug\\jre\\bin\\server\\jvm.dll"); 40.91 + initNames("compiler2", "fastdebug", "jvm.dll"); 40.92 init(getIncludes(), getDefines()); 40.93 } 40.94 } 40.95 40.96 -class TieredDebugConfig extends GenericDebugConfig { 40.97 +class TieredDebugConfig extends GenericDebugNonKernelConfig { 40.98 String getOptFlag() { 40.99 return getCI().getNoOptFlag(); 40.100 } 40.101 40.102 TieredDebugConfig() { 40.103 - initNames("tiered", "debug", "fastdebug\\jre\\bin\\server\\jvm.dll"); 40.104 + initNames("tiered", "debug", "jvm.dll"); 40.105 init(getIncludes(), getDefines()); 40.106 } 40.107 } 40.108 40.109 -class TieredFastDebugConfig extends GenericDebugConfig { 40.110 +class TieredFastDebugConfig extends GenericDebugNonKernelConfig { 40.111 String getOptFlag() { 40.112 return getCI().getOptFlag(); 40.113 } 40.114 40.115 TieredFastDebugConfig() { 40.116 - initNames("tiered", "fastdebug", "fastdebug\\jre\\bin\\server\\jvm.dll"); 40.117 + initNames("tiered", "fastdebug", "jvm.dll"); 40.118 init(getIncludes(), getDefines()); 40.119 } 40.120 } 40.121 @@ -618,45 +627,45 @@ 40.122 40.123 class C1ProductConfig extends ProductConfig { 40.124 C1ProductConfig() { 40.125 - initNames("compiler1", "product", "jre\\bin\\client\\jvm.dll"); 40.126 + initNames("compiler1", "product", "jvm.dll"); 40.127 init(getIncludes(), getDefines()); 40.128 } 40.129 } 40.130 40.131 class C2ProductConfig extends ProductConfig { 40.132 C2ProductConfig() { 40.133 - initNames("compiler2", "product", "jre\\bin\\server\\jvm.dll"); 40.134 + initNames("compiler2", "product", "jvm.dll"); 40.135 init(getIncludes(), getDefines()); 40.136 } 40.137 } 40.138 40.139 class TieredProductConfig extends ProductConfig { 40.140 TieredProductConfig() { 40.141 - initNames("tiered", "product", "jre\\bin\\server\\jvm.dll"); 40.142 + initNames("tiered", "product", "jvm.dll"); 40.143 init(getIncludes(), getDefines()); 40.144 } 40.145 } 40.146 40.147 40.148 -class CoreDebugConfig extends GenericDebugConfig { 40.149 +class CoreDebugConfig extends GenericDebugNonKernelConfig { 40.150 String getOptFlag() { 40.151 return getCI().getNoOptFlag(); 40.152 } 40.153 40.154 CoreDebugConfig() { 40.155 - initNames("core", "debug", "fastdebug\\jre\\bin\\core\\jvm.dll"); 40.156 + initNames("core", "debug", "jvm.dll"); 40.157 init(getIncludes(), getDefines()); 40.158 } 40.159 } 40.160 40.161 40.162 -class CoreFastDebugConfig extends GenericDebugConfig { 40.163 +class CoreFastDebugConfig extends GenericDebugNonKernelConfig { 40.164 String getOptFlag() { 40.165 return getCI().getOptFlag(); 40.166 } 40.167 40.168 CoreFastDebugConfig() { 40.169 - initNames("core", "fastdebug", "fastdebug\\jre\\bin\\core\\jvm.dll"); 40.170 + initNames("core", "fastdebug", "jvm.dll"); 40.171 init(getIncludes(), getDefines()); 40.172 } 40.173 } 40.174 @@ -664,7 +673,7 @@ 40.175 40.176 class CoreProductConfig extends ProductConfig { 40.177 CoreProductConfig() { 40.178 - initNames("core", "product", "jre\\bin\\core\\jvm.dll"); 40.179 + initNames("core", "product", "jvm.dll"); 40.180 init(getIncludes(), getDefines()); 40.181 } 40.182 } 40.183 @@ -675,7 +684,7 @@ 40.184 } 40.185 40.186 KernelDebugConfig() { 40.187 - initNames("kernel", "debug", "fastdebug\\jre\\bin\\kernel\\jvm.dll"); 40.188 + initNames("kernel", "debug", "jvm.dll"); 40.189 init(getIncludes(), getDefines()); 40.190 } 40.191 } 40.192 @@ -687,7 +696,7 @@ 40.193 } 40.194 40.195 KernelFastDebugConfig() { 40.196 - initNames("kernel", "fastdebug", "fastdebug\\jre\\bin\\kernel\\jvm.dll"); 40.197 + initNames("kernel", "fastdebug", "jvm.dll"); 40.198 init(getIncludes(), getDefines()); 40.199 } 40.200 } 40.201 @@ -695,7 +704,7 @@ 40.202 40.203 class KernelProductConfig extends ProductConfig { 40.204 KernelProductConfig() { 40.205 - initNames("kernel", "product", "jre\\bin\\kernel\\jvm.dll"); 40.206 + initNames("kernel", "product", "jvm.dll"); 40.207 init(getIncludes(), getDefines()); 40.208 } 40.209 } 40.210 @@ -704,6 +713,7 @@ 40.211 abstract Vector getBaseLinkerFlags(String outDir, String outDll); 40.212 abstract Vector getDebugCompilerFlags(String opt); 40.213 abstract Vector getDebugLinkerFlags(); 40.214 + abstract void getAdditionalNonKernelLinkerFlags(Vector rv); 40.215 abstract Vector getProductCompilerFlags(); 40.216 abstract Vector getProductLinkerFlags(); 40.217 abstract String getOptFlag(); 40.218 @@ -713,4 +723,14 @@ 40.219 void addAttr(Vector receiver, String attr, String value) { 40.220 receiver.add(attr); receiver.add(value); 40.221 } 40.222 + void extAttr(Vector receiver, String attr, String value) { 40.223 + int attr_pos=receiver.indexOf(attr) ; 40.224 + if ( attr_pos == -1) { 40.225 + // If attr IS NOT present in the Vector - add it 40.226 + receiver.add(attr); receiver.add(value); 40.227 + } else { 40.228 + // If attr IS present in the Vector - append value to it 40.229 + receiver.set(attr_pos+1,receiver.get(attr_pos+1)+value); 40.230 + } 40.231 + } 40.232 }
41.1 --- a/src/share/tools/ProjectCreator/WinGammaPlatform.java Thu Dec 16 09:14:34 2010 -0800 41.2 +++ b/src/share/tools/ProjectCreator/WinGammaPlatform.java Thu Dec 16 12:56:51 2010 -0800 41.3 @@ -22,8 +22,15 @@ 41.4 * 41.5 */ 41.6 41.7 -import java.io.*; 41.8 -import java.util.*; 41.9 +import java.io.File; 41.10 +import java.io.IOException; 41.11 +import java.io.PrintWriter; 41.12 +import java.util.Enumeration; 41.13 +import java.util.Hashtable; 41.14 +import java.util.Iterator; 41.15 +import java.util.List; 41.16 +import java.util.TreeSet; 41.17 +import java.util.Vector; 41.18 41.19 abstract class HsArgHandler extends ArgHandler { 41.20 static final int STRING = 1; 41.21 @@ -345,11 +352,23 @@ 41.22 new ArgsParser(args, 41.23 new ArgRule[] 41.24 { 41.25 - new HsArgRule("-sourceBase", 41.26 - "SourceBase", 41.27 - " (Did you set the HotSpotWorkSpace environment variable?)", 41.28 - HsArgHandler.STRING 41.29 - ), 41.30 + new ArgRule("-sourceBase", 41.31 + new HsArgHandler() { 41.32 + public void handle(ArgIterator it) { 41.33 + String cfg = getCfg(it.get()); 41.34 + if (nextNotKey(it)) { 41.35 + String sb = (String) it.get(); 41.36 + if (sb.endsWith(Util.sep)) { 41.37 + sb = sb.substring(0, sb.length() - 1); 41.38 + } 41.39 + BuildConfig.putField(cfg, "SourceBase", sb); 41.40 + it.next(); 41.41 + } else { 41.42 + empty("-sourceBase", null); 41.43 + } 41.44 + } 41.45 + } 41.46 + ), 41.47 41.48 new HsArgRule("-buildBase", 41.49 "BuildBase", 41.50 @@ -512,7 +531,6 @@ 41.51 new HsArgHandler() { 41.52 public void handle(ArgIterator it) { 41.53 if (nextNotKey(it)) { 41.54 - String build = it.get(); 41.55 if (nextNotKey(it)) { 41.56 String description = it.get(); 41.57 if (nextNotKey(it)) { 41.58 @@ -528,7 +546,28 @@ 41.59 empty(null, "** Error: wrong number of args to -prelink"); 41.60 } 41.61 } 41.62 - ) 41.63 + ), 41.64 + 41.65 + new ArgRule("-postbuild", 41.66 + new HsArgHandler() { 41.67 + public void handle(ArgIterator it) { 41.68 + if (nextNotKey(it)) { 41.69 + if (nextNotKey(it)) { 41.70 + String description = it.get(); 41.71 + if (nextNotKey(it)) { 41.72 + String command = it.get(); 41.73 + BuildConfig.putField(null, "PostbuildDescription", description); 41.74 + BuildConfig.putField(null, "PostbuildCommand", command); 41.75 + it.next(); 41.76 + return; 41.77 + } 41.78 + } 41.79 + } 41.80 + 41.81 + empty(null, "** Error: wrong number of args to -postbuild"); 41.82 + } 41.83 + } 41.84 + ), 41.85 }, 41.86 new ArgHandler() { 41.87 public void handle(ArgIterator it) { 41.88 @@ -618,10 +657,6 @@ 41.89 41.90 public int compareTo(Object o) { 41.91 FileInfo oo = (FileInfo)o; 41.92 - // Don't squelch identical short file names where the full 41.93 - // paths are different 41.94 - if (!attr.shortName.equals(oo.attr.shortName)) 41.95 - return attr.shortName.compareTo(oo.attr.shortName); 41.96 return full.compareTo(oo.full); 41.97 } 41.98
42.1 --- a/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java Thu Dec 16 09:14:34 2010 -0800 42.2 +++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java Thu Dec 16 12:56:51 2010 -0800 42.3 @@ -260,6 +260,8 @@ 42.4 return rv; 42.5 } 42.6 42.7 + void getAdditionalNonKernelLinkerFlags(Vector rv) {} 42.8 + 42.9 Vector getProductCompilerFlags() { 42.10 Vector rv = new Vector(); 42.11
43.1 --- a/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java Thu Dec 16 09:14:34 2010 -0800 43.2 +++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java Thu Dec 16 12:56:51 2010 -0800 43.3 @@ -22,8 +22,13 @@ 43.4 * 43.5 */ 43.6 43.7 -import java.io.*; 43.8 -import java.util.*; 43.9 +import java.io.FileWriter; 43.10 +import java.io.IOException; 43.11 +import java.io.PrintWriter; 43.12 +import java.util.Hashtable; 43.13 +import java.util.Iterator; 43.14 +import java.util.TreeSet; 43.15 +import java.util.Vector; 43.16 43.17 public class WinGammaPlatformVC7 extends WinGammaPlatform { 43.18 43.19 @@ -104,7 +109,9 @@ 43.20 43.21 43.22 boolean match(FileInfo fi) { 43.23 - return fi.full.regionMatches(true, baseLen, dir, 0, dirLen); 43.24 + int lastSlashIndex = fi.full.lastIndexOf('/'); 43.25 + String fullDir = fi.full.substring(0, lastSlashIndex); 43.26 + return fullDir.endsWith(dir); 43.27 } 43.28 } 43.29 43.30 @@ -217,65 +224,41 @@ 43.31 // - container filter just provides a container to group together real filters 43.32 // - real filter can select elements from the set according to some rule, put it into XML 43.33 // and remove from the list 43.34 - Vector makeFilters(TreeSet files) { 43.35 + Vector makeFilters(TreeSet<FileInfo> files) { 43.36 Vector rv = new Vector(); 43.37 String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/"); 43.38 43.39 - ContainerFilter rt = new ContainerFilter("Runtime"); 43.40 - rt.add(new DirectoryFilter("share/vm/prims", sbase)); 43.41 - rt.add(new DirectoryFilter("share/vm/runtime", sbase)); 43.42 - rt.add(new DirectoryFilter("share/vm/oops", sbase)); 43.43 - rv.add(rt); 43.44 + String currentDir = ""; 43.45 + DirectoryFilter container = null; 43.46 + for(FileInfo fileInfo : files) { 43.47 43.48 - ContainerFilter gc = new ContainerFilter("GC"); 43.49 - gc.add(new DirectoryFilter("share/vm/memory", sbase)); 43.50 - gc.add(new DirectoryFilter("share/vm/gc_interface", sbase)); 43.51 + if (!fileInfo.full.startsWith(sbase)) { 43.52 + continue; 43.53 + } 43.54 43.55 - ContainerFilter gc_impl = new ContainerFilter("Implementations"); 43.56 - gc_impl.add(new DirectoryFilter("CMS", 43.57 - "share/vm/gc_implementation/concurrentMarkSweep", 43.58 - sbase)); 43.59 - gc_impl.add(new DirectoryFilter("Parallel Scavenge", 43.60 - "share/vm/gc_implementation/parallelScavenge", 43.61 - sbase)); 43.62 - gc_impl.add(new DirectoryFilter("Shared", 43.63 - "share/vm/gc_implementation/shared", 43.64 - sbase)); 43.65 - // for all leftovers 43.66 - gc_impl.add(new DirectoryFilter("Misc", 43.67 - "share/vm/gc_implementation", 43.68 - sbase)); 43.69 + int lastSlash = fileInfo.full.lastIndexOf('/'); 43.70 + String dir = fileInfo.full.substring(sbase.length(), lastSlash); 43.71 + if(dir.equals("share/vm")) { 43.72 + // skip files directly in share/vm - should only be precompiled.hpp which is handled below 43.73 + continue; 43.74 + } 43.75 + if (!dir.equals(currentDir)) { 43.76 + currentDir = dir; 43.77 + if (container != null) { 43.78 + rv.add(container); 43.79 + } 43.80 43.81 - gc.add(gc_impl); 43.82 - rv.add(gc); 43.83 - 43.84 - rv.add(new DirectoryFilter("C1", "share/vm/c1", sbase)); 43.85 - 43.86 - rv.add(new DirectoryFilter("C2", "share/vm/opto", sbase)); 43.87 - 43.88 - ContainerFilter comp = new ContainerFilter("Compiler Common"); 43.89 - comp.add(new DirectoryFilter("share/vm/asm", sbase)); 43.90 - comp.add(new DirectoryFilter("share/vm/ci", sbase)); 43.91 - comp.add(new DirectoryFilter("share/vm/code", sbase)); 43.92 - comp.add(new DirectoryFilter("share/vm/compiler", sbase)); 43.93 - rv.add(comp); 43.94 - 43.95 - rv.add(new DirectoryFilter("Interpreter", 43.96 - "share/vm/interpreter", 43.97 - sbase)); 43.98 - 43.99 - ContainerFilter misc = new ContainerFilter("Misc"); 43.100 - misc.add(new DirectoryFilter("share/vm/libadt", sbase)); 43.101 - misc.add(new DirectoryFilter("share/vm/services", sbase)); 43.102 - misc.add(new DirectoryFilter("share/vm/utilities", sbase)); 43.103 - misc.add(new DirectoryFilter("share/vm/classfile", sbase)); 43.104 - rv.add(misc); 43.105 - 43.106 - rv.add(new DirectoryFilter("os_cpu", sbase)); 43.107 - 43.108 - rv.add(new DirectoryFilter("cpu", sbase)); 43.109 - 43.110 - rv.add(new DirectoryFilter("os", sbase)); 43.111 + // remove "share/vm/" from names 43.112 + String name = dir; 43.113 + if (dir.startsWith("share/vm/")) { 43.114 + name = dir.substring("share/vm/".length(), dir.length()); 43.115 + } 43.116 + container = new DirectoryFilter(name, dir, sbase); 43.117 + } 43.118 + } 43.119 + if (container != null) { 43.120 + rv.add(container); 43.121 + } 43.122 43.123 ContainerFilter generated = new ContainerFilter("Generated"); 43.124 ContainerFilter c1Generated = new ContainerFilter("C1"); 43.125 @@ -397,7 +380,6 @@ 43.126 "Name", cfg, 43.127 "ExcludedFromBuild", "TRUE" 43.128 }); 43.129 - tag("Tool", new String[] {"Name", "VCCLCompilerTool"}); 43.130 endTag("FileConfiguration"); 43.131 43.132 } 43.133 @@ -441,7 +423,11 @@ 43.134 43.135 tag("Tool", 43.136 new String[] { 43.137 - "Name", "VCPostBuildEventTool" 43.138 + "Name", "VCPostBuildEventTool", 43.139 + "Description", BuildConfig.getFieldString(null, "PostbuildDescription"), 43.140 + //Caution: String.replace(String,String) is available from JDK5 onwards only 43.141 + "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace 43.142 + ("\t", "
")) 43.143 } 43.144 ); 43.145 43.146 @@ -469,33 +455,6 @@ 43.147 "Culture", "1033" 43.148 } 43.149 ); 43.150 - tag("Tool", 43.151 - new String[] { 43.152 - "Name", "VCWebServiceProxyGeneratorTool" 43.153 - } 43.154 - ); 43.155 - 43.156 - tag ("Tool", 43.157 - new String[] { 43.158 - "Name", "VCXMLDataGeneratorTool" 43.159 - } 43.160 - ); 43.161 - 43.162 - tag("Tool", 43.163 - new String[] { 43.164 - "Name", "VCWebDeploymentTool" 43.165 - } 43.166 - ); 43.167 - tag("Tool", 43.168 - new String[] { 43.169 - "Name", "VCManagedWrapperGeneratorTool" 43.170 - } 43.171 - ); 43.172 - tag("Tool", 43.173 - new String[] { 43.174 - "Name", "VCAuxiliaryManagedWrapperGeneratorTool" 43.175 - } 43.176 - ); 43.177 43.178 tag("Tool", 43.179 new String[] { 43.180 @@ -597,7 +556,7 @@ 43.181 addAttr(rv, "PrecompiledHeaderFile", outDir+Util.sep+"vm.pch"); 43.182 addAttr(rv, "AssemblerListingLocation", outDir); 43.183 addAttr(rv, "ObjectFile", outDir+Util.sep); 43.184 - addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"vm.pdb"); 43.185 + addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"jvm.pdb"); 43.186 // Set /nologo optin 43.187 addAttr(rv, "SuppressStartupBanner", "TRUE"); 43.188 // Surpass the default /Tc or /Tp. 0 is compileAsDefault 43.189 @@ -631,17 +590,22 @@ 43.190 addAttr(rv, "AdditionalOptions", 43.191 "/export:JNI_GetDefaultJavaVMInitArgs " + 43.192 "/export:JNI_CreateJavaVM " + 43.193 + "/export:JVM_FindClassFromBootLoader "+ 43.194 "/export:JNI_GetCreatedJavaVMs "+ 43.195 "/export:jio_snprintf /export:jio_printf "+ 43.196 "/export:jio_fprintf /export:jio_vfprintf "+ 43.197 - "/export:jio_vsnprintf "); 43.198 + "/export:jio_vsnprintf "+ 43.199 + "/export:JVM_GetVersionInfo "+ 43.200 + "/export:JVM_GetThreadStateNames "+ 43.201 + "/export:JVM_GetThreadStateValues "+ 43.202 + "/export:JVM_InitAgentProperties "); 43.203 addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib"); 43.204 addAttr(rv, "OutputFile", outDll); 43.205 // Set /INCREMENTAL option. 1 is linkIncrementalNo 43.206 addAttr(rv, "LinkIncremental", "1"); 43.207 addAttr(rv, "SuppressStartupBanner", "TRUE"); 43.208 addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def"); 43.209 - addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"vm.pdb"); 43.210 + addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb"); 43.211 // Set /SUBSYSTEM option. 2 is subSystemWindows 43.212 addAttr(rv, "SubSystem", "2"); 43.213 addAttr(rv, "BaseAddress", "0x8000000"); 43.214 @@ -682,6 +646,11 @@ 43.215 return rv; 43.216 } 43.217 43.218 + void getAdditionalNonKernelLinkerFlags(Vector rv) { 43.219 + extAttr(rv, "AdditionalOptions", 43.220 + "/export:AsyncGetCallTrace "); 43.221 + } 43.222 + 43.223 void getProductCompilerFlags_common(Vector rv) { 43.224 // Set /O2 option. 2 is optimizeMaxSpeed 43.225 addAttr(rv, "Optimization", "2");
44.1 --- a/src/share/tools/ProjectCreator/WinGammaPlatformVC8.java Thu Dec 16 09:14:34 2010 -0800 44.2 +++ b/src/share/tools/ProjectCreator/WinGammaPlatformVC8.java Thu Dec 16 12:56:51 2010 -0800 44.3 @@ -22,7 +22,7 @@ 44.4 * 44.5 */ 44.6 44.7 -import java.util.*; 44.8 +import java.util.Vector; 44.9 44.10 public class WinGammaPlatformVC8 extends WinGammaPlatformVC7 { 44.11 44.12 @@ -41,6 +41,9 @@ 44.13 // Set /EHsc- option. 0 is cppExceptionHandlingNo 44.14 addAttr(rv, "ExceptionHandling", "0"); 44.15 44.16 + // enable multi process builds 44.17 + extAttr(rv, "AdditionalOptions", "/MP"); 44.18 + 44.19 return rv; 44.20 } 44.21
45.1 --- a/src/share/tools/launcher/java.c Thu Dec 16 09:14:34 2010 -0800 45.2 +++ b/src/share/tools/launcher/java.c Thu Dec 16 12:56:51 2010 -0800 45.3 @@ -275,6 +275,8 @@ 45.4 jvmpath, sizeof(jvmpath), 45.5 original_argv); 45.6 45.7 + printf("Using java runtime at: %s\n", jrepath); 45.8 + 45.9 ifn.CreateJavaVM = 0; 45.10 ifn.GetDefaultJavaVMInitArgs = 0; 45.11
46.1 --- a/src/share/tools/launcher/jli_util.c Thu Dec 16 09:14:34 2010 -0800 46.2 +++ b/src/share/tools/launcher/jli_util.c Thu Dec 16 12:56:51 2010 -0800 46.3 @@ -1,3 +1,4 @@ 46.4 + 46.5 /* 46.6 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 46.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 46.8 @@ -27,7 +28,7 @@ 46.9 #include "jli_util.h" 46.10 46.11 #ifdef GAMMA 46.12 -#ifdef _WINDOWS 46.13 +#ifdef TARGET_OS_FAMILY_windows 46.14 #define strdup _strdup 46.15 #endif 46.16 #endif
47.1 --- a/src/share/vm/code/nmethod.cpp Thu Dec 16 09:14:34 2010 -0800 47.2 +++ b/src/share/vm/code/nmethod.cpp Thu Dec 16 12:56:51 2010 -0800 47.3 @@ -619,8 +619,8 @@ 47.4 OopMapSet* oop_maps ) 47.5 : CodeBlob("native nmethod", code_buffer, sizeof(nmethod), 47.6 nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps), 47.7 - _compiled_synchronized_native_basic_lock_owner_sp_offset(basic_lock_owner_sp_offset), 47.8 - _compiled_synchronized_native_basic_lock_sp_offset(basic_lock_sp_offset) 47.9 + _native_receiver_sp_offset(basic_lock_owner_sp_offset), 47.10 + _native_basic_lock_sp_offset(basic_lock_sp_offset) 47.11 { 47.12 { 47.13 debug_only(No_Safepoint_Verifier nsv;) 47.14 @@ -696,8 +696,8 @@ 47.15 int frame_size) 47.16 : CodeBlob("dtrace nmethod", code_buffer, sizeof(nmethod), 47.17 nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, NULL), 47.18 - _compiled_synchronized_native_basic_lock_owner_sp_offset(in_ByteSize(-1)), 47.19 - _compiled_synchronized_native_basic_lock_sp_offset(in_ByteSize(-1)) 47.20 + _native_receiver_sp_offset(in_ByteSize(-1)), 47.21 + _native_basic_lock_sp_offset(in_ByteSize(-1)) 47.22 { 47.23 { 47.24 debug_only(No_Safepoint_Verifier nsv;) 47.25 @@ -790,8 +790,8 @@ 47.26 ) 47.27 : CodeBlob("nmethod", code_buffer, sizeof(nmethod), 47.28 nmethod_size, offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps), 47.29 - _compiled_synchronized_native_basic_lock_owner_sp_offset(in_ByteSize(-1)), 47.30 - _compiled_synchronized_native_basic_lock_sp_offset(in_ByteSize(-1)) 47.31 + _native_receiver_sp_offset(in_ByteSize(-1)), 47.32 + _native_basic_lock_sp_offset(in_ByteSize(-1)) 47.33 { 47.34 assert(debug_info->oop_recorder() == code_buffer->oop_recorder(), "shared OR"); 47.35 {
48.1 --- a/src/share/vm/code/nmethod.hpp Thu Dec 16 09:14:34 2010 -0800 48.2 +++ b/src/share/vm/code/nmethod.hpp Thu Dec 16 12:56:51 2010 -0800 48.3 @@ -210,7 +210,7 @@ 48.4 ExceptionCache *_exception_cache; 48.5 PcDescCache _pc_desc_cache; 48.6 48.7 - // These are only used for compiled synchronized native methods to 48.8 + // These are used for compiled synchronized native methods to 48.9 // locate the owner and stack slot for the BasicLock so that we can 48.10 // properly revoke the bias of the owner if necessary. They are 48.11 // needed because there is no debug information for compiled native 48.12 @@ -220,8 +220,10 @@ 48.13 // sharing between platforms. Note that currently biased locking 48.14 // will never cause Class instances to be biased but this code 48.15 // handles the static synchronized case as well. 48.16 - ByteSize _compiled_synchronized_native_basic_lock_owner_sp_offset; 48.17 - ByteSize _compiled_synchronized_native_basic_lock_sp_offset; 48.18 + // JVMTI's GetLocalInstance() also uses these offsets to find the receiver 48.19 + // for non-static native wrapper frames. 48.20 + ByteSize _native_receiver_sp_offset; 48.21 + ByteSize _native_basic_lock_sp_offset; 48.22 48.23 friend class nmethodLocker; 48.24 48.25 @@ -676,11 +678,11 @@ 48.26 bool is_patchable_at(address instr_address); 48.27 48.28 // UseBiasedLocking support 48.29 - ByteSize compiled_synchronized_native_basic_lock_owner_sp_offset() { 48.30 - return _compiled_synchronized_native_basic_lock_owner_sp_offset; 48.31 + ByteSize native_receiver_sp_offset() { 48.32 + return _native_receiver_sp_offset; 48.33 } 48.34 - ByteSize compiled_synchronized_native_basic_lock_sp_offset() { 48.35 - return _compiled_synchronized_native_basic_lock_sp_offset; 48.36 + ByteSize native_basic_lock_sp_offset() { 48.37 + return _native_basic_lock_sp_offset; 48.38 } 48.39 48.40 // support for code generation
49.1 --- a/src/share/vm/oops/instanceRefKlass.cpp Thu Dec 16 09:14:34 2010 -0800 49.2 +++ b/src/share/vm/oops/instanceRefKlass.cpp Thu Dec 16 12:56:51 2010 -0800 49.3 @@ -457,6 +457,12 @@ 49.4 } 49.5 } 49.6 49.7 +bool instanceRefKlass::owns_pending_list_lock(JavaThread* thread) { 49.8 + if (java_lang_ref_Reference::pending_list_lock() == NULL) return false; 49.9 + Handle h_lock(thread, java_lang_ref_Reference::pending_list_lock()); 49.10 + return ObjectSynchronizer::current_thread_holds_lock(thread, h_lock); 49.11 +} 49.12 + 49.13 void instanceRefKlass::acquire_pending_list_lock(BasicLock *pending_list_basic_lock) { 49.14 // we may enter this with pending exception set 49.15 PRESERVE_EXCEPTION_MARK; // exceptions are never thrown, needed for TRAPS argument
50.1 --- a/src/share/vm/oops/instanceRefKlass.hpp Thu Dec 16 09:14:34 2010 -0800 50.2 +++ b/src/share/vm/oops/instanceRefKlass.hpp Thu Dec 16 12:56:51 2010 -0800 50.3 @@ -89,6 +89,7 @@ 50.4 50.5 static void release_and_notify_pending_list_lock(BasicLock *pending_list_basic_lock); 50.6 static void acquire_pending_list_lock(BasicLock *pending_list_basic_lock); 50.7 + static bool owns_pending_list_lock(JavaThread* thread); 50.8 50.9 // Update non-static oop maps so 'referent', 'nextPending' and 50.10 // 'discovered' will look like non-oops
51.1 --- a/src/share/vm/oops/klassVtable.cpp Thu Dec 16 09:14:34 2010 -0800 51.2 +++ b/src/share/vm/oops/klassVtable.cpp Thu Dec 16 12:56:51 2010 -0800 51.3 @@ -518,18 +518,21 @@ 51.4 bool klassVtable::is_miranda(methodOop m, objArrayOop class_methods, klassOop super) { 51.5 symbolOop name = m->name(); 51.6 symbolOop signature = m->signature(); 51.7 + 51.8 if (instanceKlass::find_method(class_methods, name, signature) == NULL) { 51.9 - // did not find it in the method table of the current class 51.10 + // did not find it in the method table of the current class 51.11 if (super == NULL) { 51.12 // super doesn't exist 51.13 return true; 51.14 - } else { 51.15 - if (instanceKlass::cast(super)->lookup_method(name, signature) == NULL) { 51.16 - // super class hierarchy does not implement it 51.17 - return true; 51.18 - } 51.19 + } 51.20 + 51.21 + methodOop mo = instanceKlass::cast(super)->lookup_method(name, signature); 51.22 + if (mo == NULL || mo->access_flags().is_private() ) { 51.23 + // super class hierarchy does not implement it or protection is different 51.24 + return true; 51.25 } 51.26 } 51.27 + 51.28 return false; 51.29 } 51.30
52.1 --- a/src/share/vm/oops/methodOop.cpp Thu Dec 16 09:14:34 2010 -0800 52.2 +++ b/src/share/vm/oops/methodOop.cpp Thu Dec 16 12:56:51 2010 -0800 52.3 @@ -309,6 +309,12 @@ 52.4 // Build a methodDataOop object to hold information about this method 52.5 // collected in the interpreter. 52.6 void methodOopDesc::build_interpreter_method_data(methodHandle method, TRAPS) { 52.7 + // Do not profile method if current thread holds the pending list lock, 52.8 + // which avoids deadlock for acquiring the MethodData_lock. 52.9 + if (instanceRefKlass::owns_pending_list_lock((JavaThread*)THREAD)) { 52.10 + return; 52.11 + } 52.12 + 52.13 // Grab a lock here to prevent multiple 52.14 // methodDataOops from being created. 52.15 MutexLocker ml(MethodData_lock, THREAD);
53.1 --- a/src/share/vm/prims/jvmti.xml Thu Dec 16 09:14:34 2010 -0800 53.2 +++ b/src/share/vm/prims/jvmti.xml Thu Dec 16 12:56:51 2010 -0800 53.3 @@ -5649,6 +5649,45 @@ 53.4 </errors> 53.5 </function> 53.6 53.7 + <function id="GetLocalInstance" num="155" since="1.2"> 53.8 + <synopsis>Get Local Instance</synopsis> 53.9 + <description> 53.10 + This function can be used to retrieve the value of the local object 53.11 + variable at slot 0 (the "<code>this</code>" object) from non-static 53.12 + frames. This function can retrieve the "<code>this</code>" object from 53.13 + native method frames, whereas <code>GetLocalObject()</code> would 53.14 + return <code>JVMTI_ERROR_OPAQUE_FRAME</code> in those cases. 53.15 + </description> 53.16 + <origin>new</origin> 53.17 + <capabilities> 53.18 + <required id="can_access_local_variables"></required> 53.19 + </capabilities> 53.20 + <parameters> 53.21 + <param id="thread"> 53.22 + <jthread null="current" frame="frame"/> 53.23 + <description> 53.24 + The thread of the frame containing the variable's value. 53.25 + </description> 53.26 + </param> 53.27 + <param id="depth"> 53.28 + <jframeID thread="thread"/> 53.29 + <description> 53.30 + The depth of the frame containing the variable's value. 53.31 + </description> 53.32 + </param> 53.33 + <param id="value_ptr"> 53.34 + <outptr><jobject/></outptr> 53.35 + <description> 53.36 + On return, points to the variable's value. 53.37 + </description> 53.38 + </param> 53.39 + </parameters> 53.40 + <errors> 53.41 + <error id="JVMTI_ERROR_INVALID_SLOT"> 53.42 + If the specified frame is a static method frame. 53.43 + </error> 53.44 + </errors> 53.45 + </function> 53.46 <function id="GetLocalInt" num="22"> 53.47 <synopsis>Get Local Variable - Int</synopsis> 53.48 <description>
54.1 --- a/src/share/vm/prims/jvmtiEnv.cpp Thu Dec 16 09:14:34 2010 -0800 54.2 +++ b/src/share/vm/prims/jvmtiEnv.cpp Thu Dec 16 12:56:51 2010 -0800 54.3 @@ -1796,6 +1796,29 @@ 54.4 } 54.5 } /* end GetLocalObject */ 54.6 54.7 +// Threads_lock NOT held, java_thread not protected by lock 54.8 +// java_thread - pre-checked 54.9 +// java_thread - unchecked 54.10 +// depth - pre-checked as non-negative 54.11 +// value - pre-checked for NULL 54.12 +jvmtiError 54.13 +JvmtiEnv::GetLocalInstance(JavaThread* java_thread, jint depth, jobject* value){ 54.14 + JavaThread* current_thread = JavaThread::current(); 54.15 + // rm object is created to clean up the javaVFrame created in 54.16 + // doit_prologue(), but after doit() is finished with it. 54.17 + ResourceMark rm(current_thread); 54.18 + 54.19 + VM_GetReceiver op(java_thread, current_thread, depth); 54.20 + VMThread::execute(&op); 54.21 + jvmtiError err = op.result(); 54.22 + if (err != JVMTI_ERROR_NONE) { 54.23 + return err; 54.24 + } else { 54.25 + *value = op.value().l; 54.26 + return JVMTI_ERROR_NONE; 54.27 + } 54.28 +} /* end GetLocalInstance */ 54.29 + 54.30 54.31 // Threads_lock NOT held, java_thread not protected by lock 54.32 // java_thread - pre-checked
55.1 --- a/src/share/vm/prims/jvmtiImpl.cpp Thu Dec 16 09:14:34 2010 -0800 55.2 +++ b/src/share/vm/prims/jvmtiImpl.cpp Thu Dec 16 12:56:51 2010 -0800 55.3 @@ -586,7 +586,6 @@ 55.4 { 55.5 } 55.6 55.7 - 55.8 vframe *VM_GetOrSetLocal::get_vframe() { 55.9 if (!_thread->has_last_Java_frame()) { 55.10 return NULL; 55.11 @@ -609,7 +608,7 @@ 55.12 } 55.13 javaVFrame *jvf = (javaVFrame*)vf; 55.14 55.15 - if (!vf->is_java_frame() || jvf->method()->is_native()) { 55.16 + if (!vf->is_java_frame()) { 55.17 _result = JVMTI_ERROR_OPAQUE_FRAME; 55.18 return NULL; 55.19 } 55.20 @@ -740,6 +739,15 @@ 55.21 _jvf = get_java_vframe(); 55.22 NULL_CHECK(_jvf, false); 55.23 55.24 + if (_jvf->method()->is_native()) { 55.25 + if (getting_receiver() && !_jvf->method()->is_static()) { 55.26 + return true; 55.27 + } else { 55.28 + _result = JVMTI_ERROR_OPAQUE_FRAME; 55.29 + return false; 55.30 + } 55.31 + } 55.32 + 55.33 if (!check_slot_type(_jvf)) { 55.34 return false; 55.35 } 55.36 @@ -781,40 +789,46 @@ 55.37 HandleMark hm; 55.38 55.39 switch (_type) { 55.40 - case T_INT: locals->set_int_at (_index, _value.i); break; 55.41 - case T_LONG: locals->set_long_at (_index, _value.j); break; 55.42 - case T_FLOAT: locals->set_float_at (_index, _value.f); break; 55.43 - case T_DOUBLE: locals->set_double_at(_index, _value.d); break; 55.44 - case T_OBJECT: { 55.45 - Handle ob_h(JNIHandles::resolve_external_guard(_value.l)); 55.46 - locals->set_obj_at (_index, ob_h); 55.47 - break; 55.48 - } 55.49 - default: ShouldNotReachHere(); 55.50 + case T_INT: locals->set_int_at (_index, _value.i); break; 55.51 + case T_LONG: locals->set_long_at (_index, _value.j); break; 55.52 + case T_FLOAT: locals->set_float_at (_index, _value.f); break; 55.53 + case T_DOUBLE: locals->set_double_at(_index, _value.d); break; 55.54 + case T_OBJECT: { 55.55 + Handle ob_h(JNIHandles::resolve_external_guard(_value.l)); 55.56 + locals->set_obj_at (_index, ob_h); 55.57 + break; 55.58 + } 55.59 + default: ShouldNotReachHere(); 55.60 } 55.61 _jvf->set_locals(locals); 55.62 } else { 55.63 - StackValueCollection *locals = _jvf->locals(); 55.64 + if (_jvf->method()->is_native() && _jvf->is_compiled_frame()) { 55.65 + assert(getting_receiver(), "Can only get here when getting receiver"); 55.66 + oop receiver = _jvf->fr().get_native_receiver(); 55.67 + _value.l = JNIHandles::make_local(_calling_thread, receiver); 55.68 + } else { 55.69 + StackValueCollection *locals = _jvf->locals(); 55.70 55.71 - if (locals->at(_index)->type() == T_CONFLICT) { 55.72 - memset(&_value, 0, sizeof(_value)); 55.73 - _value.l = NULL; 55.74 - return; 55.75 - } 55.76 + if (locals->at(_index)->type() == T_CONFLICT) { 55.77 + memset(&_value, 0, sizeof(_value)); 55.78 + _value.l = NULL; 55.79 + return; 55.80 + } 55.81 55.82 - switch (_type) { 55.83 - case T_INT: _value.i = locals->int_at (_index); break; 55.84 - case T_LONG: _value.j = locals->long_at (_index); break; 55.85 - case T_FLOAT: _value.f = locals->float_at (_index); break; 55.86 - case T_DOUBLE: _value.d = locals->double_at(_index); break; 55.87 - case T_OBJECT: { 55.88 - // Wrap the oop to be returned in a local JNI handle since 55.89 - // oops_do() no longer applies after doit() is finished. 55.90 - oop obj = locals->obj_at(_index)(); 55.91 - _value.l = JNIHandles::make_local(_calling_thread, obj); 55.92 - break; 55.93 - } 55.94 - default: ShouldNotReachHere(); 55.95 + switch (_type) { 55.96 + case T_INT: _value.i = locals->int_at (_index); break; 55.97 + case T_LONG: _value.j = locals->long_at (_index); break; 55.98 + case T_FLOAT: _value.f = locals->float_at (_index); break; 55.99 + case T_DOUBLE: _value.d = locals->double_at(_index); break; 55.100 + case T_OBJECT: { 55.101 + // Wrap the oop to be returned in a local JNI handle since 55.102 + // oops_do() no longer applies after doit() is finished. 55.103 + oop obj = locals->obj_at(_index)(); 55.104 + _value.l = JNIHandles::make_local(_calling_thread, obj); 55.105 + break; 55.106 + } 55.107 + default: ShouldNotReachHere(); 55.108 + } 55.109 } 55.110 } 55.111 } 55.112 @@ -825,6 +839,10 @@ 55.113 } 55.114 55.115 55.116 +VM_GetReceiver::VM_GetReceiver( 55.117 + JavaThread* thread, JavaThread* caller_thread, jint depth) 55.118 + : VM_GetOrSetLocal(thread, caller_thread, depth, 0) {} 55.119 + 55.120 ///////////////////////////////////////////////////////////////////////////////////////// 55.121 55.122 //
56.1 --- a/src/share/vm/prims/jvmtiImpl.hpp Thu Dec 16 09:14:34 2010 -0800 56.2 +++ b/src/share/vm/prims/jvmtiImpl.hpp Thu Dec 16 12:56:51 2010 -0800 56.3 @@ -355,7 +355,7 @@ 56.4 // to the thread simultaneously. 56.5 // 56.6 class VM_GetOrSetLocal : public VM_Operation { 56.7 -private: 56.8 + protected: 56.9 JavaThread* _thread; 56.10 JavaThread* _calling_thread; 56.11 jint _depth; 56.12 @@ -365,6 +365,10 @@ 56.13 javaVFrame* _jvf; 56.14 bool _set; 56.15 56.16 + // It is possible to get the receiver out of a non-static native wrapper 56.17 + // frame. Use VM_GetReceiver to do this. 56.18 + virtual bool getting_receiver() const { return false; } 56.19 + 56.20 jvmtiError _result; 56.21 56.22 vframe* get_vframe(); 56.23 @@ -395,6 +399,15 @@ 56.24 static bool is_assignable(const char* ty_sign, Klass* klass, Thread* thread); 56.25 }; 56.26 56.27 +class VM_GetReceiver : public VM_GetOrSetLocal { 56.28 + protected: 56.29 + virtual bool getting_receiver() const { return true; } 56.30 + 56.31 + public: 56.32 + VM_GetReceiver(JavaThread* thread, JavaThread* calling_thread, jint depth); 56.33 + const char* name() const { return "get receiver"; } 56.34 +}; 56.35 + 56.36 56.37 /////////////////////////////////////////////////////////////// 56.38 //
57.1 --- a/src/share/vm/runtime/frame.cpp Thu Dec 16 09:14:34 2010 -0800 57.2 +++ b/src/share/vm/runtime/frame.cpp Thu Dec 16 12:56:51 2010 -0800 57.3 @@ -41,6 +41,8 @@ 57.4 #include "runtime/signature.hpp" 57.5 #include "runtime/stubCodeGenerator.hpp" 57.6 #include "runtime/stubRoutines.hpp" 57.7 +#include "utilities/decoder.hpp" 57.8 + 57.9 #ifdef TARGET_ARCH_x86 57.10 # include "nativeInst_x86.hpp" 57.11 #endif 57.12 @@ -652,7 +654,7 @@ 57.13 // names if pc is within jvm.dll or libjvm.so, because JVM only has 57.14 // JVM_xxxx and a few other symbols in the dynamic symbol table. Do this 57.15 // only for native libraries. 57.16 - if (!in_vm) { 57.17 + if (!in_vm || Decoder::can_decode_C_frame_in_vm()) { 57.18 found = os::dll_address_to_function_name(pc, buf, buflen, &offset); 57.19 57.20 if (found) { 57.21 @@ -1071,28 +1073,20 @@ 57.22 } 57.23 } 57.24 57.25 -BasicLock* frame::compiled_synchronized_native_monitor(nmethod* nm) { 57.26 - if (nm == NULL) { 57.27 - assert(_cb != NULL && _cb->is_nmethod() && 57.28 - nm->method()->is_native() && 57.29 - nm->method()->is_synchronized(), 57.30 - "should not call this otherwise"); 57.31 - nm = (nmethod*) _cb; 57.32 - } 57.33 - int byte_offset = in_bytes(nm->compiled_synchronized_native_basic_lock_sp_offset()); 57.34 +BasicLock* frame::get_native_monitor() { 57.35 + nmethod* nm = (nmethod*)_cb; 57.36 + assert(_cb != NULL && _cb->is_nmethod() && nm->method()->is_native(), 57.37 + "Should not call this unless it's a native nmethod"); 57.38 + int byte_offset = in_bytes(nm->native_basic_lock_sp_offset()); 57.39 assert(byte_offset >= 0, "should not see invalid offset"); 57.40 return (BasicLock*) &sp()[byte_offset / wordSize]; 57.41 } 57.42 57.43 -oop frame::compiled_synchronized_native_monitor_owner(nmethod* nm) { 57.44 - if (nm == NULL) { 57.45 - assert(_cb != NULL && _cb->is_nmethod() && 57.46 - nm->method()->is_native() && 57.47 - nm->method()->is_synchronized(), 57.48 - "should not call this otherwise"); 57.49 - nm = (nmethod*) _cb; 57.50 - } 57.51 - int byte_offset = in_bytes(nm->compiled_synchronized_native_basic_lock_owner_sp_offset()); 57.52 +oop frame::get_native_receiver() { 57.53 + nmethod* nm = (nmethod*)_cb; 57.54 + assert(_cb != NULL && _cb->is_nmethod() && nm->method()->is_native(), 57.55 + "Should not call this unless it's a native nmethod"); 57.56 + int byte_offset = in_bytes(nm->native_receiver_sp_offset()); 57.57 assert(byte_offset >= 0, "should not see invalid offset"); 57.58 oop owner = ((oop*) sp())[byte_offset / wordSize]; 57.59 assert( Universe::heap()->is_in(owner), "bad receiver" );
58.1 --- a/src/share/vm/runtime/frame.hpp Thu Dec 16 09:14:34 2010 -0800 58.2 +++ b/src/share/vm/runtime/frame.hpp Thu Dec 16 12:56:51 2010 -0800 58.3 @@ -254,10 +254,10 @@ 58.4 58.5 // Return the monitor owner and BasicLock for compiled synchronized 58.6 // native methods so that biased locking can revoke the receiver's 58.7 - // bias if necessary. Takes optional nmethod for this frame as 58.8 - // argument to avoid performing repeated lookups in code cache. 58.9 - BasicLock* compiled_synchronized_native_monitor (nmethod* nm = NULL); 58.10 - oop compiled_synchronized_native_monitor_owner(nmethod* nm = NULL); 58.11 + // bias if necessary. This is also used by JVMTI's GetLocalInstance method 58.12 + // (via VM_GetReceiver) to retrieve the receiver from a native wrapper frame. 58.13 + BasicLock* get_native_monitor(); 58.14 + oop get_native_receiver(); 58.15 58.16 // Find receiver for an invoke when arguments are just pushed on stack (i.e., callee stack-frame is 58.17 // not setup)
59.1 --- a/src/share/vm/runtime/vframe_hp.cpp Thu Dec 16 09:14:34 2010 -0800 59.2 +++ b/src/share/vm/runtime/vframe_hp.cpp Thu Dec 16 12:56:51 2010 -0800 59.3 @@ -207,8 +207,8 @@ 59.4 GrowableArray<MonitorInfo*> *monitors = new GrowableArray<MonitorInfo*>(1); 59.5 // Casting away const 59.6 frame& fr = (frame&) _fr; 59.7 - MonitorInfo* info = new MonitorInfo(fr.compiled_synchronized_native_monitor_owner(nm), 59.8 - fr.compiled_synchronized_native_monitor(nm), false, false); 59.9 + MonitorInfo* info = new MonitorInfo( 59.10 + fr.get_native_receiver(), fr.get_native_monitor(), false, false); 59.11 monitors->push(info); 59.12 return monitors; 59.13 }
60.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 60.2 +++ b/src/share/vm/utilities/decoder.cpp Thu Dec 16 12:56:51 2010 -0800 60.3 @@ -0,0 +1,104 @@ 60.4 +/* 60.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 60.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 60.7 + * 60.8 + * This code is free software; you can redistribute it and/or modify it 60.9 + * under the terms of the GNU General Public License version 2 only, as 60.10 + * published by the Free Software Foundation. 60.11 + * 60.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 60.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 60.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 60.15 + * version 2 for more details (a copy is included in the LICENSE file that 60.16 + * accompanied this code). 60.17 + * 60.18 + * You should have received a copy of the GNU General Public License version 60.19 + * 2 along with this work; if not, write to the Free Software Foundation, 60.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 60.21 + * 60.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 60.23 + * or visit www.oracle.com if you need additional information or have any 60.24 + * questions. 60.25 + * 60.26 + */ 60.27 + 60.28 +#include "precompiled.hpp" 60.29 +#include "prims/jvm.h" 60.30 +#include "utilities/decoder.hpp" 60.31 + 60.32 +Decoder::decoder_status Decoder::_decoder_status = Decoder::no_error; 60.33 +bool Decoder::_initialized = false; 60.34 + 60.35 +#ifndef _WINDOWS 60.36 + 60.37 +// Implementation of common functionalities among Solaris and Linux 60.38 +#include "utilities/elfFile.hpp" 60.39 + 60.40 +ElfFile* Decoder::_opened_elf_files = NULL; 60.41 + 60.42 +bool Decoder::can_decode_C_frame_in_vm() { 60.43 + return true; 60.44 +} 60.45 + 60.46 +void Decoder::initialize() { 60.47 + _initialized = true; 60.48 +} 60.49 + 60.50 +void Decoder::uninitialize() { 60.51 + if (_opened_elf_files != NULL) { 60.52 + delete _opened_elf_files; 60.53 + _opened_elf_files = NULL; 60.54 + } 60.55 + _initialized = false; 60.56 +} 60.57 + 60.58 +Decoder::decoder_status Decoder::decode(address addr, const char* filepath, char *buf, int buflen, int *offset) { 60.59 + if (_decoder_status != no_error) { 60.60 + return _decoder_status; 60.61 + } 60.62 + 60.63 + ElfFile* file = get_elf_file(filepath); 60.64 + if (_decoder_status != no_error) { 60.65 + return _decoder_status; 60.66 + } 60.67 + 60.68 + const char* symbol = file->decode(addr, offset); 60.69 + if (file->get_status() == out_of_memory) { 60.70 + _decoder_status = out_of_memory; 60.71 + return _decoder_status; 60.72 + } else if (symbol != NULL) { 60.73 + if (!demangle(symbol, buf, buflen)) { 60.74 + jio_snprintf(buf, buflen, "%s", symbol); 60.75 + } 60.76 + return no_error; 60.77 + } else { 60.78 + return symbol_not_found; 60.79 + } 60.80 +} 60.81 + 60.82 +ElfFile* Decoder::get_elf_file(const char* filepath) { 60.83 + if (_decoder_status != no_error) { 60.84 + return NULL; 60.85 + } 60.86 + ElfFile* file = _opened_elf_files; 60.87 + while (file != NULL) { 60.88 + if (file->same_elf_file(filepath)) { 60.89 + return file; 60.90 + } 60.91 + file = file->m_next; 60.92 + } 60.93 + 60.94 + file = new ElfFile(filepath); 60.95 + if (file == NULL) { 60.96 + _decoder_status = out_of_memory; 60.97 + } 60.98 + if (_opened_elf_files != NULL) { 60.99 + file->m_next = _opened_elf_files; 60.100 + } 60.101 + 60.102 + _opened_elf_files = file; 60.103 + return file; 60.104 +} 60.105 + 60.106 +#endif 60.107 +
61.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 61.2 +++ b/src/share/vm/utilities/decoder.hpp Thu Dec 16 12:56:51 2010 -0800 61.3 @@ -0,0 +1,102 @@ 61.4 +/* 61.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 61.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 61.7 + * 61.8 + * This code is free software; you can redistribute it and/or modify it 61.9 + * under the terms of the GNU General Public License version 2 only, as 61.10 + * published by the Free Software Foundation. 61.11 + * 61.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 61.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 61.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 61.15 + * version 2 for more details (a copy is included in the LICENSE file that 61.16 + * accompanied this code). 61.17 + * 61.18 + * You should have received a copy of the GNU General Public License version 61.19 + * 2 along with this work; if not, write to the Free Software Foundation, 61.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 61.21 + * 61.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 61.23 + * or visit www.oracle.com if you need additional information or have any 61.24 + * questions. 61.25 + * 61.26 + */ 61.27 + 61.28 + 61.29 +#ifndef __DECODER_HPP 61.30 +#define __DECODER_HPP 61.31 + 61.32 +#include "memory/allocation.hpp" 61.33 + 61.34 +#ifdef _WINDOWS 61.35 +#include <windows.h> 61.36 +#include <imagehlp.h> 61.37 + 61.38 +// functions needed for decoding symbols 61.39 +typedef DWORD (WINAPI *pfn_SymSetOptions)(DWORD); 61.40 +typedef BOOL (WINAPI *pfn_SymInitialize)(HANDLE, PCTSTR, BOOL); 61.41 +typedef BOOL (WINAPI *pfn_SymGetSymFromAddr64)(HANDLE, DWORD64, PDWORD64, PIMAGEHLP_SYMBOL64); 61.42 +typedef DWORD (WINAPI *pfn_UndecorateSymbolName)(const char*, char*, DWORD, DWORD); 61.43 + 61.44 +#else 61.45 + 61.46 +class ElfFile; 61.47 + 61.48 +#endif // _WINDOWS 61.49 + 61.50 + 61.51 +class Decoder: public StackObj { 61.52 + 61.53 + public: 61.54 + // status code for decoding native C frame 61.55 + enum decoder_status { 61.56 + no_error, // successfully decoded frames 61.57 + out_of_memory, // out of memory 61.58 + file_invalid, // invalid elf file 61.59 + file_not_found, // could not found symbol file (on windows), such as jvm.pdb or jvm.map 61.60 + helper_not_found, // could not load dbghelp.dll (Windows only) 61.61 + helper_func_error, // decoding functions not found (Windows only) 61.62 + helper_init_error, // SymInitialize failed (Windows only) 61.63 + symbol_not_found // could not find the symbol 61.64 + }; 61.65 + 61.66 + public: 61.67 + Decoder() { initialize(); }; 61.68 + ~Decoder() { uninitialize(); }; 61.69 + 61.70 + static bool can_decode_C_frame_in_vm(); 61.71 + 61.72 + static void initialize(); 61.73 + static void uninitialize(); 61.74 + 61.75 +#ifdef _WINDOWS 61.76 + static decoder_status decode(address addr, char *buf, int buflen, int *offset); 61.77 +#else 61.78 + static decoder_status decode(address addr, const char* filepath, char *buf, int buflen, int *offset); 61.79 +#endif 61.80 + 61.81 + static bool demangle(const char* symbol, char *buf, int buflen); 61.82 + 61.83 + static decoder_status get_status() { return _decoder_status; }; 61.84 + 61.85 +#ifndef _WINDOWS 61.86 + private: 61.87 + static ElfFile* get_elf_file(const char* filepath); 61.88 +#endif // _WINDOWS 61.89 + 61.90 + 61.91 + private: 61.92 + static decoder_status _decoder_status; 61.93 + static bool _initialized; 61.94 + 61.95 +#ifdef _WINDOWS 61.96 + static HMODULE _dbghelp_handle; 61.97 + static bool _can_decode_in_vm; 61.98 + static pfn_SymGetSymFromAddr64 _pfnSymGetSymFromAddr64; 61.99 + static pfn_UndecorateSymbolName _pfnUndecorateSymbolName; 61.100 +#else 61.101 + static ElfFile* _opened_elf_files; 61.102 +#endif // _WINDOWS 61.103 +}; 61.104 + 61.105 +#endif // __DECODER_HPP
62.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 62.2 +++ b/src/share/vm/utilities/elfFile.cpp Thu Dec 16 12:56:51 2010 -0800 62.3 @@ -0,0 +1,198 @@ 62.4 +/* 62.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 62.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 62.7 + * 62.8 + * This code is free software; you can redistribute it and/or modify it 62.9 + * under the terms of the GNU General Public License version 2 only, as 62.10 + * published by the Free Software Foundation. 62.11 + * 62.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 62.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 62.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 62.15 + * version 2 for more details (a copy is included in the LICENSE file that 62.16 + * accompanied this code). 62.17 + * 62.18 + * You should have received a copy of the GNU General Public License version 62.19 + * 2 along with this work; if not, write to the Free Software Foundation, 62.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 62.21 + * 62.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 62.23 + * or visit www.oracle.com if you need additional information or have any 62.24 + * questions. 62.25 + * 62.26 + */ 62.27 + 62.28 +#include "precompiled.hpp" 62.29 + 62.30 +#ifndef _WINDOWS 62.31 + 62.32 +#include <string.h> 62.33 +#include <stdio.h> 62.34 +#include <limits.h> 62.35 + 62.36 +#include "memory/allocation.inline.hpp" 62.37 +#include "utilities/decoder.hpp" 62.38 +#include "utilities/elfFile.hpp" 62.39 +#include "utilities/elfStringTable.hpp" 62.40 +#include "utilities/elfSymbolTable.hpp" 62.41 + 62.42 + 62.43 +ElfFile::ElfFile(const char* filepath) { 62.44 + assert(filepath, "null file path"); 62.45 + memset(&m_elfHdr, 0, sizeof(m_elfHdr)); 62.46 + m_string_tables = NULL; 62.47 + m_symbol_tables = NULL; 62.48 + m_next = NULL; 62.49 + m_status = Decoder::no_error; 62.50 + 62.51 + int len = strlen(filepath) + 1; 62.52 + m_filepath = NEW_C_HEAP_ARRAY(char, len); 62.53 + if (m_filepath != NULL) { 62.54 + strcpy((char*)m_filepath, filepath); 62.55 + m_file = fopen(filepath, "r"); 62.56 + if (m_file != NULL) { 62.57 + load_tables(); 62.58 + } else { 62.59 + m_status = Decoder::file_not_found; 62.60 + } 62.61 + } else { 62.62 + m_status = Decoder::out_of_memory; 62.63 + } 62.64 +} 62.65 + 62.66 +ElfFile::~ElfFile() { 62.67 + if (m_string_tables != NULL) { 62.68 + delete m_string_tables; 62.69 + } 62.70 + 62.71 + if (m_symbol_tables != NULL) { 62.72 + delete m_symbol_tables; 62.73 + } 62.74 + 62.75 + if (m_file != NULL) { 62.76 + fclose(m_file); 62.77 + } 62.78 + 62.79 + if (m_filepath != NULL) { 62.80 + FREE_C_HEAP_ARRAY(char, m_filepath); 62.81 + } 62.82 + 62.83 + if (m_next != NULL) { 62.84 + delete m_next; 62.85 + } 62.86 +}; 62.87 + 62.88 + 62.89 +//Check elf header to ensure the file is valid. 62.90 +bool ElfFile::is_elf_file(Elf_Ehdr& hdr) { 62.91 + return (ELFMAG0 == hdr.e_ident[EI_MAG0] && 62.92 + ELFMAG1 == hdr.e_ident[EI_MAG1] && 62.93 + ELFMAG2 == hdr.e_ident[EI_MAG2] && 62.94 + ELFMAG3 == hdr.e_ident[EI_MAG3] && 62.95 + ELFCLASSNONE != hdr.e_ident[EI_CLASS] && 62.96 + ELFDATANONE != hdr.e_ident[EI_DATA]); 62.97 +} 62.98 + 62.99 +bool ElfFile::load_tables() { 62.100 + assert(m_file, "file not open"); 62.101 + assert(m_status == Decoder::no_error, "already in error"); 62.102 + 62.103 + // read elf file header 62.104 + if (fread(&m_elfHdr, sizeof(m_elfHdr), 1, m_file) != 1) { 62.105 + m_status = Decoder::file_invalid; 62.106 + return false; 62.107 + } 62.108 + 62.109 + if (!is_elf_file(m_elfHdr)) { 62.110 + m_status = Decoder::file_invalid; 62.111 + return false; 62.112 + } 62.113 + 62.114 + // walk elf file's section headers, and load string tables 62.115 + Elf_Shdr shdr; 62.116 + if (!fseek(m_file, m_elfHdr.e_shoff, SEEK_SET)) { 62.117 + if (m_status != Decoder::no_error) return false; 62.118 + 62.119 + for (int index = 0; index < m_elfHdr.e_shnum; index ++) { 62.120 + if (fread((void*)&shdr, sizeof(Elf_Shdr), 1, m_file) != 1) { 62.121 + m_status = Decoder::file_invalid; 62.122 + return false; 62.123 + } 62.124 + // string table 62.125 + if (shdr.sh_type == SHT_STRTAB) { 62.126 + ElfStringTable* table = new ElfStringTable(m_file, shdr, index); 62.127 + if (table == NULL) { 62.128 + m_status = Decoder::out_of_memory; 62.129 + return false; 62.130 + } 62.131 + add_string_table(table); 62.132 + } else if (shdr.sh_type == SHT_SYMTAB || shdr.sh_type == SHT_DYNSYM) { 62.133 + ElfSymbolTable* table = new ElfSymbolTable(m_file, shdr); 62.134 + if (table == NULL) { 62.135 + m_status = Decoder::out_of_memory; 62.136 + return false; 62.137 + } 62.138 + add_symbol_table(table); 62.139 + } 62.140 + } 62.141 + } 62.142 + return true; 62.143 +} 62.144 + 62.145 +const char* ElfFile::decode(address addr, int* offset) { 62.146 + // something already went wrong, just give up 62.147 + if (m_status != Decoder::no_error) { 62.148 + return NULL; 62.149 + } 62.150 + 62.151 + ElfSymbolTable* symbol_table = m_symbol_tables; 62.152 + int string_table_index; 62.153 + int pos_in_string_table; 62.154 + int off = INT_MAX; 62.155 + bool found_symbol = false; 62.156 + while (symbol_table != NULL) { 62.157 + if (Decoder::no_error == symbol_table->lookup(addr, &string_table_index, &pos_in_string_table, &off)) { 62.158 + found_symbol = true; 62.159 + } 62.160 + symbol_table = symbol_table->m_next; 62.161 + } 62.162 + if (!found_symbol) return NULL; 62.163 + 62.164 + ElfStringTable* string_table = get_string_table(string_table_index); 62.165 + if (string_table == NULL) { 62.166 + m_status = Decoder::file_invalid; 62.167 + return NULL; 62.168 + } 62.169 + if (offset) *offset = off; 62.170 + return string_table->string_at(pos_in_string_table); 62.171 +} 62.172 + 62.173 + 62.174 +void ElfFile::add_symbol_table(ElfSymbolTable* table) { 62.175 + if (m_symbol_tables == NULL) { 62.176 + m_symbol_tables = table; 62.177 + } else { 62.178 + table->m_next = m_symbol_tables; 62.179 + m_symbol_tables = table; 62.180 + } 62.181 +} 62.182 + 62.183 +void ElfFile::add_string_table(ElfStringTable* table) { 62.184 + if (m_string_tables == NULL) { 62.185 + m_string_tables = table; 62.186 + } else { 62.187 + table->m_next = m_string_tables; 62.188 + m_string_tables = table; 62.189 + } 62.190 +} 62.191 + 62.192 +ElfStringTable* ElfFile::get_string_table(int index) { 62.193 + ElfStringTable* p = m_string_tables; 62.194 + while (p != NULL) { 62.195 + if (p->index() == index) return p; 62.196 + p = p->m_next; 62.197 + } 62.198 + return NULL; 62.199 +} 62.200 + 62.201 +#endif // _WINDOWS
63.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 63.2 +++ b/src/share/vm/utilities/elfFile.hpp Thu Dec 16 12:56:51 2010 -0800 63.3 @@ -0,0 +1,140 @@ 63.4 +/* 63.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 63.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 63.7 + * 63.8 + * This code is free software; you can redistribute it and/or modify it 63.9 + * under the terms of the GNU General Public License version 2 only, as 63.10 + * published by the Free Software Foundation. 63.11 + * 63.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 63.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 63.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 63.15 + * version 2 for more details (a copy is included in the LICENSE file that 63.16 + * accompanied this code). 63.17 + * 63.18 + * You should have received a copy of the GNU General Public License version 63.19 + * 2 along with this work; if not, write to the Free Software Foundation, 63.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 63.21 + * 63.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 63.23 + * or visit www.oracle.com if you need additional information or have any 63.24 + * questions. 63.25 + * 63.26 + */ 63.27 + 63.28 +#ifndef __ELF_FILE_HPP 63.29 +#define __ELF_FILE_HPP 63.30 + 63.31 +#ifndef _WINDOWS 63.32 + 63.33 +#include <elf.h> 63.34 +#include <stdio.h> 63.35 + 63.36 +#ifdef _LP64 63.37 + 63.38 +typedef Elf64_Half Elf_Half; 63.39 +typedef Elf64_Word Elf_Word; 63.40 +typedef Elf64_Off Elf_Off; 63.41 +typedef Elf64_Addr Elf_Addr; 63.42 + 63.43 +typedef Elf64_Ehdr Elf_Ehdr; 63.44 +typedef Elf64_Shdr Elf_Shdr; 63.45 +typedef Elf64_Sym Elf_Sym; 63.46 + 63.47 +#define ELF_ST_TYPE ELF64_ST_TYPE 63.48 + 63.49 +#else 63.50 + 63.51 +typedef Elf32_Half Elf_Half; 63.52 +typedef Elf32_Word Elf_Word; 63.53 +typedef Elf32_Off Elf_Off; 63.54 +typedef Elf32_Addr Elf_Addr; 63.55 + 63.56 + 63.57 +typedef Elf32_Ehdr Elf_Ehdr; 63.58 +typedef Elf32_Shdr Elf_Shdr; 63.59 +typedef Elf32_Sym Elf_Sym; 63.60 + 63.61 +#define ELF_ST_TYPE ELF32_ST_TYPE 63.62 +#endif 63.63 + 63.64 +#include "globalDefinitions.hpp" 63.65 +#include "memory/allocation.hpp" 63.66 +#include "utilities/decoder.hpp" 63.67 + 63.68 + 63.69 +class ElfStringTable; 63.70 +class ElfSymbolTable; 63.71 + 63.72 + 63.73 +// On Solaris/Linux platforms, libjvm.so does contain all private symbols. 63.74 +// ElfFile is basically an elf file parser, which can lookup the symbol 63.75 +// that is the nearest to the given address. 63.76 +// Beware, this code is called from vm error reporting code, when vm is already 63.77 +// in "error" state, so there are scenarios, lookup will fail. We want this 63.78 +// part of code to be very defensive, and bait out if anything went wrong. 63.79 + 63.80 +class ElfFile: public CHeapObj { 63.81 + friend class Decoder; 63.82 + public: 63.83 + ElfFile(const char* filepath); 63.84 + ~ElfFile(); 63.85 + 63.86 + const char* decode(address addr, int* offset); 63.87 + const char* filepath() { 63.88 + return m_filepath; 63.89 + } 63.90 + 63.91 + bool same_elf_file(const char* filepath) { 63.92 + assert(filepath, "null file path"); 63.93 + assert(m_filepath, "already out of memory"); 63.94 + return (m_filepath && !strcmp(filepath, m_filepath)); 63.95 + } 63.96 + 63.97 + Decoder::decoder_status get_status() { 63.98 + return m_status; 63.99 + } 63.100 + 63.101 + private: 63.102 + // sanity check, if the file is a real elf file 63.103 + bool is_elf_file(Elf_Ehdr&); 63.104 + 63.105 + // load string tables from the elf file 63.106 + bool load_tables(); 63.107 + 63.108 + // string tables are stored in a linked list 63.109 + void add_string_table(ElfStringTable* table); 63.110 + 63.111 + // symbol tables are stored in a linked list 63.112 + void add_symbol_table(ElfSymbolTable* table); 63.113 + 63.114 + // return a string table at specified section index 63.115 + ElfStringTable* get_string_table(int index); 63.116 + 63.117 + // look up an address and return the nearest symbol 63.118 + const char* look_up(Elf_Shdr shdr, address addr, int* offset); 63.119 + 63.120 + protected: 63.121 + ElfFile* m_next; 63.122 + 63.123 + private: 63.124 + // file 63.125 + const char* m_filepath; 63.126 + FILE* m_file; 63.127 + 63.128 + // Elf header 63.129 + Elf_Ehdr m_elfHdr; 63.130 + 63.131 + // symbol tables 63.132 + ElfSymbolTable* m_symbol_tables; 63.133 + 63.134 + // string tables 63.135 + ElfStringTable* m_string_tables; 63.136 + 63.137 + Decoder::decoder_status m_status; 63.138 +}; 63.139 + 63.140 +#endif // _WINDOWS 63.141 + 63.142 +#endif // __ELF_FILE_HPP 63.143 +
64.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 64.2 +++ b/src/share/vm/utilities/elfStringTable.cpp Thu Dec 16 12:56:51 2010 -0800 64.3 @@ -0,0 +1,89 @@ 64.4 +/* 64.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 64.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 64.7 + * 64.8 + * This code is free software; you can redistribute it and/or modify it 64.9 + * under the terms of the GNU General Public License version 2 only, as 64.10 + * published by the Free Software Foundation. 64.11 + * 64.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 64.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 64.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 64.15 + * version 2 for more details (a copy is included in the LICENSE file that 64.16 + * accompanied this code). 64.17 + * 64.18 + * You should have received a copy of the GNU General Public License version 64.19 + * 2 along with this work; if not, write to the Free Software Foundation, 64.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 64.21 + * 64.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 64.23 + * or visit www.oracle.com if you need additional information or have any 64.24 + * questions. 64.25 + * 64.26 + */ 64.27 + 64.28 +#include "precompiled.hpp" 64.29 + 64.30 +#ifndef _WINDOWS 64.31 + 64.32 +#include "memory/allocation.inline.hpp" 64.33 +#include "utilities/elfStringTable.hpp" 64.34 + 64.35 +// We will try to load whole string table into memory if we can. 64.36 +// Otherwise, fallback to more expensive file operation. 64.37 +ElfStringTable::ElfStringTable(FILE* file, Elf_Shdr shdr, int index) { 64.38 + assert(file, "null file handle"); 64.39 + m_table = NULL; 64.40 + m_index = index; 64.41 + m_next = NULL; 64.42 + m_file = file; 64.43 + m_status = Decoder::no_error; 64.44 + 64.45 + // try to load the string table 64.46 + long cur_offset = ftell(file); 64.47 + m_table = (char*)NEW_C_HEAP_ARRAY(char, shdr.sh_size); 64.48 + if (m_table != NULL) { 64.49 + // if there is an error, mark the error 64.50 + if (fseek(file, shdr.sh_offset, SEEK_SET) || 64.51 + fread((void*)m_table, shdr.sh_size, 1, file) != 1 || 64.52 + fseek(file, cur_offset, SEEK_SET)) { 64.53 + m_status = Decoder::file_invalid; 64.54 + FREE_C_HEAP_ARRAY(char, m_table); 64.55 + m_table = NULL; 64.56 + } 64.57 + } else { 64.58 + memcpy(&m_shdr, &shdr, sizeof(Elf_Shdr)); 64.59 + } 64.60 +} 64.61 + 64.62 +ElfStringTable::~ElfStringTable() { 64.63 + if (m_table != NULL) { 64.64 + FREE_C_HEAP_ARRAY(char, m_table); 64.65 + } 64.66 + 64.67 + if (m_next != NULL) { 64.68 + delete m_next; 64.69 + } 64.70 +} 64.71 + 64.72 +const char* ElfStringTable::string_at(int pos) { 64.73 + if (m_status != Decoder::no_error) { 64.74 + return NULL; 64.75 + } 64.76 + if (m_table != NULL) { 64.77 + return (const char*)(m_table + pos); 64.78 + } else { 64.79 + long cur_pos = ftell(m_file); 64.80 + if (cur_pos == -1 || 64.81 + fseek(m_file, m_shdr.sh_offset + pos, SEEK_SET) || 64.82 + fread(m_symbol, 1, MAX_SYMBOL_LEN, m_file) <= 0 || 64.83 + fseek(m_file, cur_pos, SEEK_SET)) { 64.84 + m_status = Decoder::file_invalid; 64.85 + return NULL; 64.86 + } 64.87 + return (const char*)m_symbol; 64.88 + } 64.89 +} 64.90 + 64.91 +#endif // _WINDOWS 64.92 +
65.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 65.2 +++ b/src/share/vm/utilities/elfStringTable.hpp Thu Dec 16 12:56:51 2010 -0800 65.3 @@ -0,0 +1,82 @@ 65.4 +/* 65.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 65.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 65.7 + * 65.8 + * This code is free software; you can redistribute it and/or modify it 65.9 + * under the terms of the GNU General Public License version 2 only, as 65.10 + * published by the Free Software Foundation. 65.11 + * 65.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 65.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 65.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 65.15 + * version 2 for more details (a copy is included in the LICENSE file that 65.16 + * accompanied this code). 65.17 + * 65.18 + * You should have received a copy of the GNU General Public License version 65.19 + * 2 along with this work; if not, write to the Free Software Foundation, 65.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 65.21 + * 65.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 65.23 + * or visit www.oracle.com if you need additional information or have any 65.24 + * questions. 65.25 + * 65.26 + */ 65.27 + 65.28 +#ifndef __ELF_STRING_TABLE_HPP 65.29 +#define __ELF_STRING_TABLE_HPP 65.30 + 65.31 +#ifndef _WINDOWS 65.32 + 65.33 +#include "memory/allocation.hpp" 65.34 +#include "utilities/decoder.hpp" 65.35 +#include "utilities/elfFile.hpp" 65.36 + 65.37 + 65.38 +// The string table represents a string table section in an elf file. 65.39 +// Whenever there is enough memory, it will load whole string table as 65.40 +// one blob. Otherwise, it will load string from file when requested. 65.41 + 65.42 +#define MAX_SYMBOL_LEN 256 65.43 + 65.44 +class ElfStringTable: CHeapObj { 65.45 + friend class ElfFile; 65.46 + public: 65.47 + ElfStringTable(FILE* file, Elf_Shdr shdr, int index); 65.48 + ~ElfStringTable(); 65.49 + 65.50 + // section index 65.51 + int index() { return m_index; }; 65.52 + 65.53 + // get string at specified offset 65.54 + const char* string_at(int offset); 65.55 + 65.56 + // get status code 65.57 + Decoder::decoder_status get_status() { return m_status; }; 65.58 + 65.59 + protected: 65.60 + ElfStringTable* m_next; 65.61 + 65.62 + // section index 65.63 + int m_index; 65.64 + 65.65 + // holds complete string table if can 65.66 + // allocate enough memory 65.67 + const char* m_table; 65.68 + 65.69 + // file contains string table 65.70 + FILE* m_file; 65.71 + 65.72 + // section header 65.73 + Elf_Shdr m_shdr; 65.74 + 65.75 + // buffer for reading individual string 65.76 + char m_symbol[MAX_SYMBOL_LEN]; 65.77 + 65.78 + // error code 65.79 + Decoder::decoder_status m_status; 65.80 +}; 65.81 + 65.82 +#endif // _WINDOWS 65.83 + 65.84 +#endif // __ELF_STRING_TABLE_HPP 65.85 +
66.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 66.2 +++ b/src/share/vm/utilities/elfSymbolTable.cpp Thu Dec 16 12:56:51 2010 -0800 66.3 @@ -0,0 +1,125 @@ 66.4 +/* 66.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 66.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 66.7 + * 66.8 + * This code is free software; you can redistribute it and/or modify it 66.9 + * under the terms of the GNU General Public License version 2 only, as 66.10 + * published by the Free Software Foundation. 66.11 + * 66.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 66.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 66.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 66.15 + * version 2 for more details (a copy is included in the LICENSE file that 66.16 + * accompanied this code). 66.17 + * 66.18 + * You should have received a copy of the GNU General Public License version 66.19 + * 2 along with this work; if not, write to the Free Software Foundation, 66.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 66.21 + * 66.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 66.23 + * or visit www.oracle.com if you need additional information or have any 66.24 + * questions. 66.25 + * 66.26 + */ 66.27 + 66.28 +#include "precompiled.hpp" 66.29 + 66.30 +#ifndef _WINDOWS 66.31 + 66.32 +#include "memory/allocation.inline.hpp" 66.33 +#include "utilities/elfSymbolTable.hpp" 66.34 + 66.35 +ElfSymbolTable::ElfSymbolTable(FILE* file, Elf_Shdr shdr) { 66.36 + assert(file, "null file handle"); 66.37 + m_symbols = NULL; 66.38 + m_next = NULL; 66.39 + m_file = file; 66.40 + m_status = Decoder::no_error; 66.41 + 66.42 + // try to load the string table 66.43 + long cur_offset = ftell(file); 66.44 + if (cur_offset != -1) { 66.45 + m_symbols = (Elf_Sym*)NEW_C_HEAP_ARRAY(char, shdr.sh_size); 66.46 + if (m_symbols) { 66.47 + if (fseek(file, shdr.sh_offset, SEEK_SET) || 66.48 + fread((void*)m_symbols, shdr.sh_size, 1, file) != 1 || 66.49 + fseek(file, cur_offset, SEEK_SET)) { 66.50 + m_status = Decoder::file_invalid; 66.51 + FREE_C_HEAP_ARRAY(char, m_symbols); 66.52 + m_symbols = NULL; 66.53 + } 66.54 + } 66.55 + if (m_status == Decoder::no_error) { 66.56 + memcpy(&m_shdr, &shdr, sizeof(Elf_Shdr)); 66.57 + } 66.58 + } else { 66.59 + m_status = Decoder::file_invalid; 66.60 + } 66.61 +} 66.62 + 66.63 +ElfSymbolTable::~ElfSymbolTable() { 66.64 + if (m_symbols != NULL) { 66.65 + FREE_C_HEAP_ARRAY(char, m_symbols); 66.66 + } 66.67 + 66.68 + if (m_next != NULL) { 66.69 + delete m_next; 66.70 + } 66.71 +} 66.72 + 66.73 +Decoder::decoder_status ElfSymbolTable::lookup(address addr, int* stringtableIndex, int* posIndex, int* offset) { 66.74 + assert(stringtableIndex, "null string table index pointer"); 66.75 + assert(posIndex, "null string table offset pointer"); 66.76 + assert(offset, "null offset pointer"); 66.77 + 66.78 + if (m_status != Decoder::no_error) { 66.79 + return m_status; 66.80 + } 66.81 + 66.82 + address pc = 0; 66.83 + size_t sym_size = sizeof(Elf_Sym); 66.84 + assert((m_shdr.sh_size % sym_size) == 0, "check size"); 66.85 + int count = m_shdr.sh_size / sym_size; 66.86 + if (m_symbols != NULL) { 66.87 + for (int index = 0; index < count; index ++) { 66.88 + if (STT_FUNC == ELF_ST_TYPE(m_symbols[index].st_info)) { 66.89 + address sym_addr = (address)m_symbols[index].st_value; 66.90 + if (sym_addr < addr && (addr - sym_addr) < *offset) { 66.91 + pc = (address)m_symbols[index].st_value; 66.92 + *offset = (int)(addr - pc); 66.93 + *posIndex = m_symbols[index].st_name; 66.94 + *stringtableIndex = m_shdr.sh_link; 66.95 + } 66.96 + } 66.97 + } 66.98 + } else { 66.99 + long cur_pos; 66.100 + if ((cur_pos = ftell(m_file)) == -1 || 66.101 + fseek(m_file, m_shdr.sh_offset, SEEK_SET)) { 66.102 + m_status = Decoder::file_invalid; 66.103 + return m_status; 66.104 + } 66.105 + 66.106 + Elf_Sym sym; 66.107 + for (int index = 0; index < count; index ++) { 66.108 + if (fread(&sym, sym_size, 1, m_file) == 1) { 66.109 + if (STT_FUNC == ELF_ST_TYPE(sym.st_info)) { 66.110 + address sym_addr = (address)sym.st_value; 66.111 + if (sym_addr < addr && (addr - sym_addr) < *offset) { 66.112 + pc = (address)sym.st_value; 66.113 + *offset = (int)(addr - pc); 66.114 + *posIndex = sym.st_name; 66.115 + *stringtableIndex = m_shdr.sh_link; 66.116 + } 66.117 + } 66.118 + } else { 66.119 + m_status = Decoder::file_invalid; 66.120 + return m_status; 66.121 + } 66.122 + } 66.123 + fseek(m_file, cur_pos, SEEK_SET); 66.124 + } 66.125 + return m_status; 66.126 +} 66.127 + 66.128 +#endif // _WINDOWS
67.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 67.2 +++ b/src/share/vm/utilities/elfSymbolTable.hpp Thu Dec 16 12:56:51 2010 -0800 67.3 @@ -0,0 +1,73 @@ 67.4 +/* 67.5 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 67.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 67.7 + * 67.8 + * This code is free software; you can redistribute it and/or modify it 67.9 + * under the terms of the GNU General Public License version 2 only, as 67.10 + * published by the Free Software Foundation. 67.11 + * 67.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 67.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 67.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 67.15 + * version 2 for more details (a copy is included in the LICENSE file that 67.16 + * accompanied this code). 67.17 + * 67.18 + * You should have received a copy of the GNU General Public License version 67.19 + * 2 along with this work; if not, write to the Free Software Foundation, 67.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 67.21 + * 67.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 67.23 + * or visit www.oracle.com if you need additional information or have any 67.24 + * questions. 67.25 + * 67.26 + */ 67.27 + 67.28 +#ifndef __ELF_SYMBOL_TABLE_HPP 67.29 +#define __ELF_SYMBOL_TABLE_HPP 67.30 + 67.31 +#ifndef _WINDOWS 67.32 + 67.33 + 67.34 +#include "memory/allocation.hpp" 67.35 +#include "utilities/decoder.hpp" 67.36 +#include "utilities/elfFile.hpp" 67.37 + 67.38 +/* 67.39 + * symbol table object represents a symbol section in an elf file. 67.40 + * Whenever possible, it will load all symbols from the corresponding section 67.41 + * of the elf file into memory. Otherwise, it will walk the section in file 67.42 + * to look up the symbol that nearest the given address. 67.43 + */ 67.44 +class ElfSymbolTable: public CHeapObj { 67.45 + friend class ElfFile; 67.46 + public: 67.47 + ElfSymbolTable(FILE* file, Elf_Shdr shdr); 67.48 + ~ElfSymbolTable(); 67.49 + 67.50 + // search the symbol that is nearest to the specified address. 67.51 + Decoder::decoder_status lookup(address addr, int* stringtableIndex, int* posIndex, int* offset); 67.52 + 67.53 + Decoder::decoder_status get_status() { return m_status; }; 67.54 + 67.55 + protected: 67.56 + ElfSymbolTable* m_next; 67.57 + 67.58 + // holds a complete symbol table section if 67.59 + // can allocate enough memory 67.60 + Elf_Sym* m_symbols; 67.61 + 67.62 + // file contains string table 67.63 + FILE* m_file; 67.64 + 67.65 + // section header 67.66 + Elf_Shdr m_shdr; 67.67 + 67.68 + Decoder::decoder_status m_status; 67.69 +}; 67.70 + 67.71 +#endif // _WINDOWS 67.72 + 67.73 +#endif // __ELF_SYMBOL_TABLE_HPP 67.74 + 67.75 + 67.76 +
68.1 --- a/src/share/vm/utilities/vmError.cpp Thu Dec 16 09:14:34 2010 -0800 68.2 +++ b/src/share/vm/utilities/vmError.cpp Thu Dec 16 12:56:51 2010 -0800 68.3 @@ -33,6 +33,7 @@ 68.4 #include "runtime/vmThread.hpp" 68.5 #include "runtime/vm_operations.hpp" 68.6 #include "utilities/debug.hpp" 68.7 +#include "utilities/decoder.hpp" 68.8 #include "utilities/defaultStream.hpp" 68.9 #include "utilities/top.hpp" 68.10 #include "utilities/vmError.hpp" 68.11 @@ -516,8 +517,10 @@ 68.12 if (fr.pc()) { 68.13 st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)"); 68.14 68.15 + // initialize decoder to decode C frames 68.16 + Decoder decoder; 68.17 + 68.18 int count = 0; 68.19 - 68.20 while (count++ < StackPrintLimit) { 68.21 fr.print_on_error(st, buf, sizeof(buf)); 68.22 st->cr();