Fri, 21 Nov 2008 16:11:03 -0800
Merge
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentGCThread.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/gc_implementation/concurrentMarkSweep/concurrentGCThread.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/make/linux/makefiles/top.make Thu Nov 20 11:39:38 2008 -0800 1.2 +++ b/make/linux/makefiles/top.make Fri Nov 21 16:11:03 2008 -0800 1.3 @@ -85,9 +85,9 @@ 1.4 1.5 AD_Dir = $(GENERATED)/adfiles 1.6 ADLC = $(AD_Dir)/adlc 1.7 -AD_Spec = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch).ad 1.8 +AD_Spec = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad 1.9 AD_Src = $(GAMMADIR)/src/share/vm/adlc 1.10 -AD_Names = ad_$(Platform_arch).hpp ad_$(Platform_arch).cpp 1.11 +AD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp 1.12 AD_Files = $(AD_Names:%=$(AD_Dir)/%) 1.13 1.14 # AD_Files_If_Required/COMPILER1 = ad_stuff
2.1 --- a/make/solaris/makefiles/amd64.make Thu Nov 20 11:39:38 2008 -0800 2.2 +++ b/make/solaris/makefiles/amd64.make Fri Nov 21 16:11:03 2008 -0800 2.3 @@ -26,7 +26,6 @@ 2.4 CFLAGS += -DVM_LITTLE_ENDIAN 2.5 2.6 # Not included in includeDB because it has no dependencies 2.7 -# Obj_Files += solaris_amd64.o 2.8 Obj_Files += solaris_x86_64.o 2.9 2.10 # 2.11 @@ -38,8 +37,6 @@ 2.12 2.13 # _lwp_create_interpose must have a frame 2.14 OPT_CFLAGS/os_solaris_x86_64.o = -xO1 2.15 -# force C++ interpreter to be full optimization 2.16 -#OPT_CFLAGS/interpret.o = -fast -O4 2.17 2.18 # Temporary until SS10 C++ compiler is fixed 2.19 OPT_CFLAGS/generateOptoStub.o = -xO2 2.20 @@ -51,8 +48,6 @@ 2.21 # gcc 2.22 # The serviceability agent relies on frame pointer (%rbp) to walk thread stack 2.23 CFLAGS += -fno-omit-frame-pointer 2.24 -# force C++ interpreter to be full optimization 2.25 -#OPT_CFLAGS/interpret.o = -O3 2.26 2.27 else 2.28 # error
3.1 --- a/make/solaris/makefiles/debug.make Thu Nov 20 11:39:38 2008 -0800 3.2 +++ b/make/solaris/makefiles/debug.make Fri Nov 21 16:11:03 2008 -0800 3.3 @@ -30,7 +30,7 @@ 3.4 3.5 ifeq ("${Platform_compiler}", "sparcWorks") 3.6 3.7 -ifeq ($(COMPILER_REV),5.8) 3.8 +ifeq ($(COMPILER_REV_NUMERIC),508) 3.9 # SS11 SEGV when compiling with -g and -xarch=v8, using different backend 3.10 DEBUG_CFLAGS/compileBroker.o = $(DEBUG_CFLAGS) -xO0 3.11 DEBUG_CFLAGS/jvmtiTagMap.o = $(DEBUG_CFLAGS) -xO0
4.1 --- a/make/solaris/makefiles/dtrace.make Thu Nov 20 11:39:38 2008 -0800 4.2 +++ b/make/solaris/makefiles/dtrace.make Fri Nov 21 16:11:03 2008 -0800 4.3 @@ -87,17 +87,16 @@ 4.4 4.5 XLIBJVM_DB = 64/$(LIBJVM_DB) 4.6 XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE) 4.7 -XARCH = $(subst sparcv9,v9,$(shell echo $(ISA))) 4.8 4.9 $(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) 4.10 @echo Making $@ 4.11 $(QUIETLY) mkdir -p 64/ ; \ 4.12 - $(CC) $(SYMFLAG) $(ARCHFLAG/$(XARCH)) -D$(TYPE) -I. -I$(GENERATED) \ 4.13 + $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \ 4.14 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc 4.15 $(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) 4.16 @echo Making $@ 4.17 $(QUIETLY) mkdir -p 64/ ; \ 4.18 - $(CC) $(SYMFLAG) $(ARCHFLAG/$(XARCH)) -D$(TYPE) -I. \ 4.19 + $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \ 4.20 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor 4.21 endif # ifneq ("${ISA}","${BUILDARCH}") 4.22 4.23 @@ -116,27 +115,25 @@ 4.24 $(QUIETLY) $(LINK.CC) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \ 4.25 ./lib$(GENOFFS).so 4.26 4.27 -# $@.tmp is created first. It's to avoid empty $(JVMOFFS).h produced in error case. 4.28 +CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \ 4.29 + cmp -s $@ $@.tmp; \ 4.30 + case $$? in \ 4.31 + 0) rm -f $@.tmp;; \ 4.32 + *) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \ 4.33 + esac 4.34 + 4.35 +# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. 4.36 $(JVMOFFS).h: $(GENOFFS) 4.37 - $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp ; \ 4.38 - if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \ 4.39 - then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \ 4.40 - else rm -f $@.tmp; \ 4.41 - fi 4.42 + $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp 4.43 + $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) 4.44 4.45 $(JVMOFFS)Index.h: $(GENOFFS) 4.46 - $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp ; \ 4.47 - if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \ 4.48 - then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \ 4.49 - else rm -f $@.tmp; \ 4.50 - fi 4.51 + $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp 4.52 + $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) 4.53 4.54 $(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h 4.55 - $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp ; \ 4.56 - if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \ 4.57 - then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \ 4.58 - else rm -f $@.tmp; \ 4.59 - fi 4.60 + $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp 4.61 + $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) 4.62 4.63 $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 4.64 $(QUIETLY) $(CCC) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
5.1 --- a/make/solaris/makefiles/fastdebug.make Thu Nov 20 11:39:38 2008 -0800 5.2 +++ b/make/solaris/makefiles/fastdebug.make Fri Nov 21 16:11:03 2008 -0800 5.3 @@ -37,7 +37,7 @@ 5.4 OPT_CFLAGS/SLOWER = -xO2 5.5 5.6 # Problem with SS12 compiler, dtrace doesn't like the .o files (bug 6693876) 5.7 -ifeq ($(COMPILER_REV), 5.9) 5.8 +ifeq ($(COMPILER_REV_NUMERIC), 509) 5.9 # To avoid jvm98 crash 5.10 OPT_CFLAGS/instanceKlass.o = $(OPT_CFLAGS/SLOWER) 5.11 # Not clear this workaround could be skipped in some cases. 5.12 @@ -46,47 +46,41 @@ 5.13 OPT_CFLAGS/jni.o = $(OPT_CFLAGS/SLOWER) 5.14 endif 5.15 5.16 -ifeq ($(COMPILER_REV), 5.5) 5.17 +ifeq ($(COMPILER_REV_NUMERIC), 505) 5.18 # CC 5.5 has bug 4908364 with -xO4 (Fixed in 5.6) 5.19 OPT_CFLAGS/library_call.o = $(OPT_CFLAGS/SLOWER) 5.20 -endif # COMPILER_REV == 5.5 5.21 +endif # COMPILER_REV_NUMERIC == 505 5.22 5.23 -ifeq ($(shell expr $(COMPILER_REV) \<= 5.4), 1) 5.24 +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \<= 504), 1) 5.25 # Compilation of *_<arch>.cpp can take an hour or more at O3. Use O2 5.26 # See comments at top of sparc.make. 5.27 -OPT_CFLAGS/ad_$(Platform_arch).o = $(OPT_CFLAGS/SLOWER) 5.28 -OPT_CFLAGS/dfa_$(Platform_arch).o = $(OPT_CFLAGS/SLOWER) 5.29 -endif # COMPILER_REV <= 5.4 5.30 +OPT_CFLAGS/ad_$(Platform_arch_model).o = $(OPT_CFLAGS/SLOWER) 5.31 +OPT_CFLAGS/dfa_$(Platform_arch_model).o = $(OPT_CFLAGS/SLOWER) 5.32 +endif # COMPILER_REV_NUMERIC <= 504 5.33 5.34 -ifeq (${COMPILER_REV}, 5.0) 5.35 -# Avoid a compiler bug caused by using -xO<level> -g<level> 5.36 -# Since the bug also occurs with -xO0, use an innocuous value (must not be null) 5.37 -OPT_CFLAGS/c1_LIROptimizer_i486.o = -c 5.38 -endif 5.39 - 5.40 -ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1) 5.41 -# Same problem with Solaris/x86 compiler (both 5.0 and 5.2) on ad_i486.cpp. 5.42 -# CC build time is also too long for ad_i486_{gen,misc}.o 5.43 -OPT_CFLAGS/ad_i486.o = -c 5.44 -OPT_CFLAGS/ad_i486_gen.o = -c 5.45 -OPT_CFLAGS/ad_i486_misc.o = -c 5.46 -ifeq ($(Platform_arch), i486) 5.47 +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 505), 1) 5.48 +# Same problem with Solaris/x86 compiler (both 5.0 and 5.2) on ad_x86_{32,64}.cpp. 5.49 +# CC build time is also too long for ad_$(Platform_arch_model)_{gen,misc}.o 5.50 +OPT_CFLAGS/ad_$(Platform_arch_model).o = -c 5.51 +OPT_CFLAGS/ad_$(Platform_arch_model)_gen.o = -c 5.52 +OPT_CFLAGS/ad_$(Platform_arch_model)_misc.o = -c 5.53 +ifeq ($(Platform_arch), x86) 5.54 # Same problem for the wrapper roosts: jni.o jvm.o 5.55 OPT_CFLAGS/jni.o = -c 5.56 OPT_CFLAGS/jvm.o = -c 5.57 # Same problem in parse2.o (probably the Big Switch over bytecodes) 5.58 OPT_CFLAGS/parse2.o = -c 5.59 -endif # Platform_arch == i486 5.60 +endif # Platform_arch == x86 5.61 endif 5.62 5.63 # Frame size > 100k if we allow inlining via -g0! 5.64 DEBUG_CFLAGS/bytecodeInterpreter.o = -g 5.65 DEBUG_CFLAGS/bytecodeInterpreterWithChecks.o = -g 5.66 -ifeq ($(Platform_arch), i486) 5.67 +ifeq ($(Platform_arch), x86) 5.68 # ube explodes on x86 5.69 OPT_CFLAGS/bytecodeInterpreter.o = -xO1 5.70 OPT_CFLAGS/bytecodeInterpreterWithChecks.o = -xO1 5.71 -endif # Platform_arch == i486 5.72 +endif # Platform_arch == x86 5.73 5.74 endif # Platform_compiler == sparcWorks 5.75
6.1 --- a/make/solaris/makefiles/i486.make Thu Nov 20 11:39:38 2008 -0800 6.2 +++ b/make/solaris/makefiles/i486.make Fri Nov 21 16:11:03 2008 -0800 6.3 @@ -35,17 +35,13 @@ 6.4 ifeq ("${Platform_compiler}", "sparcWorks") 6.5 6.6 # _lwp_create_interpose must have a frame 6.7 -OPT_CFLAGS/os_solaris_i486.o = -xO1 6.8 -# force C++ interpreter to be full optimization 6.9 -OPT_CFLAGS/interpret.o = -fast -O4 6.10 +OPT_CFLAGS/os_solaris_x86.o = -xO1 6.11 else 6.12 6.13 ifeq ("${Platform_compiler}", "gcc") 6.14 # gcc 6.15 # _lwp_create_interpose must have a frame 6.16 -OPT_CFLAGS/os_solaris_i486.o = -fno-omit-frame-pointer 6.17 -# force C++ interpreter to be full optimization 6.18 -OPT_CFLAGS/interpret.o = -O3 6.19 +OPT_CFLAGS/os_solaris_x86.o = -fno-omit-frame-pointer 6.20 # 6.21 else 6.22 # error 6.23 @@ -57,7 +53,7 @@ 6.24 6.25 ifeq ("${Platform_compiler}", "sparcWorks") 6.26 # ILD is gone as of SS11 (5.8), not supported in SS10 (5.7) 6.27 -ifeq ($(shell expr $(COMPILER_REV) \< 5.7), 1) 6.28 +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 507), 1) 6.29 # 6.30 # Bug in ild causes it to fail randomly. Until we get a fix we can't 6.31 # use ild.
7.1 --- a/make/solaris/makefiles/jvmg.make Thu Nov 20 11:39:38 2008 -0800 7.2 +++ b/make/solaris/makefiles/jvmg.make Fri Nov 21 16:11:03 2008 -0800 7.3 @@ -30,7 +30,7 @@ 7.4 7.5 ifeq ("${Platform_compiler}", "sparcWorks") 7.6 7.7 -ifeq ($(COMPILER_REV),5.8) 7.8 +ifeq ($(COMPILER_REV_NUMERIC),508) 7.9 # SS11 SEGV when compiling with -g and -xarch=v8, using different backend 7.10 DEBUG_CFLAGS/compileBroker.o = $(DEBUG_CFLAGS) -xO0 7.11 DEBUG_CFLAGS/jvmtiTagMap.o = $(DEBUG_CFLAGS) -xO0
8.1 --- a/make/solaris/makefiles/optimized.make Thu Nov 20 11:39:38 2008 -0800 8.2 +++ b/make/solaris/makefiles/optimized.make Fri Nov 21 16:11:03 2008 -0800 8.3 @@ -33,7 +33,7 @@ 8.4 ifeq ("${Platform_compiler}", "sparcWorks") 8.5 8.6 # Problem with SS12 compiler, dtrace doesn't like the .o files (bug 6693876) 8.7 -ifeq ($(COMPILER_REV),5.9) 8.8 +ifeq ($(COMPILER_REV_NUMERIC),509) 8.9 # Not clear this workaround could be skipped in some cases. 8.10 OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER) -g 8.11 OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER) -g 8.12 @@ -41,9 +41,9 @@ 8.13 endif 8.14 8.15 # Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12) 8.16 -ifeq ($(COMPILER_REV),5.8)) 8.17 +ifeq ($(COMPILER_REV_NUMERIC),508)) 8.18 OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2) 8.19 -endif # COMPILER_REV == 5.8 8.20 +endif # COMPILER_REV_NUMERIC == 508 8.21 8.22 endif # Platform_compiler == sparcWorks 8.23
9.1 --- a/make/solaris/makefiles/product.make Thu Nov 20 11:39:38 2008 -0800 9.2 +++ b/make/solaris/makefiles/product.make Fri Nov 21 16:11:03 2008 -0800 9.3 @@ -41,7 +41,7 @@ 9.4 ifeq ("${Platform_compiler}", "sparcWorks") 9.5 9.6 # Problem with SS12 compiler, dtrace doesn't like the .o files (bug 6693876) 9.7 -ifeq ($(COMPILER_REV),5.9) 9.8 +ifeq ($(COMPILER_REV_NUMERIC),509) 9.9 # Not clear this workaround could be skipped in some cases. 9.10 OPT_CFLAGS/vmGCOperations.o = $(OPT_CFLAGS/SLOWER) -g 9.11 OPT_CFLAGS/java.o = $(OPT_CFLAGS/SLOWER) -g 9.12 @@ -49,9 +49,9 @@ 9.13 endif 9.14 9.15 # Workaround SS11 bug 6345274 (all platforms) (Fixed in SS11 patch and SS12) 9.16 -ifeq ($(COMPILER_REV),5.8) 9.17 +ifeq ($(COMPILER_REV_NUMERIC),508) 9.18 OPT_CFLAGS/ciTypeFlow.o = $(OPT_CFLAGS/O2) 9.19 -endif # COMPILER_REV == 5.8 9.20 +endif # COMPILER_REV_NUMERIC == 508 9.21 9.22 endif # Platform_compiler == sparcWorks 9.23
10.1 --- a/make/solaris/makefiles/sparc.make Thu Nov 20 11:39:38 2008 -0800 10.2 +++ b/make/solaris/makefiles/sparc.make Fri Nov 21 16:11:03 2008 -0800 10.3 @@ -26,7 +26,7 @@ 10.4 ASFLAGS += $(AS_ARCHFLAG) 10.5 10.6 ifeq ("${Platform_compiler}", "sparcWorks") 10.7 -ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1) 10.8 +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 505), 1) 10.9 # For 5.2 ad_sparc file is compiled with -O2 %%%% remove when adlc is fixed 10.10 OPT_CFLAGS/ad_sparc.o = $(OPT_CFLAGS/SLOWER) 10.11 OPT_CFLAGS/dfa_sparc.o = $(OPT_CFLAGS/SLOWER) 10.12 @@ -39,7 +39,7 @@ 10.13 OPT_CFLAGS/jniHandles.o = $(OPT_CFLAGS/O2) 10.14 # CC brings an US-II to its knees compiling the vmStructs asserts under -xO4 10.15 OPT_CFLAGS/vmStructs.o = $(OPT_CFLAGS/O2) 10.16 -endif 10.17 +endif # COMPILER_REV_NUMERIC < 505 10.18 else 10.19 # Options for gcc 10.20 OPT_CFLAGS/ad_sparc.o = $(OPT_CFLAGS/SLOWER)
11.1 --- a/make/solaris/makefiles/sparcWorks.make Thu Nov 20 11:39:38 2008 -0800 11.2 +++ b/make/solaris/makefiles/sparcWorks.make Fri Nov 21 16:11:03 2008 -0800 11.3 @@ -41,9 +41,9 @@ 11.4 11.5 # Get the last thing on the line that looks like x.x+ (x is a digit). 11.6 COMPILER_REV := \ 11.7 -$(shell $(CPP) -V 2>&1 | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') 11.8 +$(shell $(CPP) -V 2>&1 | sed -n 's/^.*[ ,\t]C++[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p') 11.9 C_COMPILER_REV := \ 11.10 -$(shell $(CC) -V 2>&1 | grep -i "cc:" | sed -e 's/^.*\([1-9]\.[0-9][0-9]*\).*/\1/') 11.11 +$(shell $(CC) -V 2>&1 | sed -n 's/^.*[ ,\t]C[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p') 11.12 11.13 # Pick which compiler is validated 11.14 ifeq ($(JDK_MINOR_VERSION),6) 11.15 @@ -60,17 +60,19 @@ 11.16 ENFORCE_COMPILER_REV${ENFORCE_COMPILER_REV} := ${VALIDATED_COMPILER_REV} 11.17 ifneq (${COMPILER_REV},${ENFORCE_COMPILER_REV}) 11.18 dummy_target_to_enforce_compiler_rev:=\ 11.19 -$(info WARNING: You are using CC version ${COMPILER_REV} \ 11.20 -and should be using version ${ENFORCE_COMPILER_REV}) 11.21 +$(shell echo >&2 WARNING: You are using CC version ${COMPILER_REV} \ 11.22 +and should be using version ${ENFORCE_COMPILER_REV}. Set ENFORCE_COMPILER_REV=${COMPILER_REV} to avoid this warning.) 11.23 endif 11.24 11.25 ENFORCE_C_COMPILER_REV${ENFORCE_C_COMPILER_REV} := ${VALIDATED_C_COMPILER_REV} 11.26 ifneq (${C_COMPILER_REV},${ENFORCE_C_COMPILER_REV}) 11.27 dummy_target_to_enforce_c_compiler_rev:=\ 11.28 -$(info WARNING: You are using cc version ${C_COMPILER_REV} \ 11.29 -and should be using version ${ENFORCE_C_COMPILER_REV}) 11.30 +$(shell echo >&2 WARNING: You are using cc version ${C_COMPILER_REV} \ 11.31 +and should be using version ${ENFORCE_C_COMPILER_REV}. Set ENFORCE_C_COMPILER_REV=${C_COMPILER_REV} to avoid this warning.) 11.32 endif 11.33 11.34 +COMPILER_REV_NUMERIC := $(shell echo $(COMPILER_REV) | awk -F. '{ print $$1 * 100 + $$2 }') 11.35 + 11.36 # Fail the build if __fabsf is used. __fabsf exists only in Solaris 8 2/04 11.37 # and newer; objects with a dependency on this symbol will not run on older 11.38 # Solaris 8. 11.39 @@ -120,7 +122,7 @@ 11.40 ARCHFLAG_NEW/amd64 = -m64 11.41 11.42 # Select the ARCHFLAGs and other SS12 (5.9) options 11.43 -ifeq ($(shell expr $(COMPILER_REV) \>= 5.9), 1) 11.44 +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) 11.45 ARCHFLAG/sparc = $(ARCHFLAG_NEW/sparc) 11.46 ARCHFLAG/sparcv9 = $(ARCHFLAG_NEW/sparcv9) 11.47 ARCHFLAG/i486 = $(ARCHFLAG_NEW/i486) 11.48 @@ -150,7 +152,7 @@ 11.49 # Begin current (>=5.6) Forte compiler options # 11.50 ################################################# 11.51 11.52 -ifeq ($(shell expr $(COMPILER_REV) \>= 5.6), 1) 11.53 +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 506), 1) 11.54 11.55 ifeq ("${Platform_arch}", "sparc") 11.56 11.57 @@ -167,7 +169,7 @@ 11.58 # Begin current (>=5.5) Forte compiler options # 11.59 ################################################# 11.60 11.61 -ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1) 11.62 +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1) 11.63 11.64 CFLAGS += $(ARCHFLAG) 11.65 AOUT_FLAGS += $(ARCHFLAG) 11.66 @@ -255,7 +257,7 @@ 11.67 11.68 LFLAGS += -mt 11.69 11.70 -endif # COMPILER_REV >= 5.5 11.71 +endif # COMPILER_REV_NUMERIC >= 505 11.72 11.73 ###################################### 11.74 # End 5.5 Forte compiler options # 11.75 @@ -265,7 +267,7 @@ 11.76 # Begin 5.2 Forte compiler options # 11.77 ###################################### 11.78 11.79 -ifeq ($(COMPILER_REV), 5.2) 11.80 +ifeq ($(COMPILER_REV_NUMERIC), 502) 11.81 11.82 CFLAGS += $(ARCHFLAG) 11.83 AOUT_FLAGS += $(ARCHFLAG) 11.84 @@ -324,7 +326,7 @@ 11.85 LFLAGS += -library=Crun 11.86 LIBS += -library=Crun -lCrun 11.87 11.88 -endif # COMPILER_REV == 5.2 11.89 +endif # COMPILER_REV_NUMERIC == 502 11.90 11.91 ################################## 11.92 # End 5.2 Forte compiler options # 11.93 @@ -333,7 +335,7 @@ 11.94 ################################## 11.95 # Begin old 5.1 compiler options # 11.96 ################################## 11.97 -ifeq ($(COMPILER_REV), 5.1) 11.98 +ifeq ($(COMPILER_REV_NUMERIC), 501) 11.99 11.100 _JUNK_ := $(shell echo >&2 \ 11.101 "*** ERROR: sparkWorks.make incomplete for 5.1 compiler") 11.102 @@ -347,7 +349,7 @@ 11.103 # Begin old 5.0 compiler options # 11.104 ################################## 11.105 11.106 -ifeq (${COMPILER_REV}, 5.0) 11.107 +ifeq (${COMPILER_REV_NUMERIC}, 500) 11.108 11.109 # Had to hoist this higher apparently because of other changes. Must 11.110 # come before -xarch specification. 11.111 @@ -379,7 +381,7 @@ 11.112 11.113 ifeq ("${Platform_arch_model}", "x86_32") 11.114 OPT_CFLAGS=-xtarget=pentium $(EXTRA_OPT_CFLAGS) 11.115 -ifeq ("${COMPILER_REV}", "5.0") 11.116 +ifeq ("${COMPILER_REV_NUMERIC}", "500") 11.117 # SC5.0 tools on x86 are flakey at -xO4 11.118 OPT_CFLAGS+=-xO3 11.119 else 11.120 @@ -405,13 +407,13 @@ 11.121 PICFLAG/BETTER = $(PICFLAG/DEFAULT) 11.122 PICFLAG/BYFILE = $(PICFLAG/$@)$(PICFLAG/DEFAULT$(PICFLAG/$@)) 11.123 11.124 -endif # COMPILER_REV = 5.0 11.125 +endif # COMPILER_REV_NUMERIC = 500 11.126 11.127 ################################ 11.128 # End old 5.0 compiler options # 11.129 ################################ 11.130 11.131 -ifeq ("${COMPILER_REV}", "4.2") 11.132 +ifeq ("${COMPILER_REV_NUMERIC}", "402") 11.133 # 4.2 COMPILERS SHOULD NO LONGER BE USED 11.134 _JUNK_ := $(shell echo >&2 \ 11.135 "*** ERROR: SC4.2 compilers are not supported by this code base!") 11.136 @@ -443,7 +445,7 @@ 11.137 LINK_MODE/optimized = -Bsymbolic -znodefs 11.138 11.139 # Have thread local errnos 11.140 -ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1) 11.141 +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1) 11.142 CFLAGS += -mt 11.143 else 11.144 CFLAGS += -D_REENTRANT 11.145 @@ -460,7 +462,7 @@ 11.146 # The -g0 setting allows the C++ frontend to inline, which is a big win. 11.147 11.148 # Special global options for SS12 11.149 -ifeq ($(COMPILER_REV),5.9) 11.150 +ifeq ($(COMPILER_REV_NUMERIC),509) 11.151 # There appears to be multiple issues with the new Dwarf2 debug format, so 11.152 # we tell the compiler to use the older 'stabs' debug format all the time. 11.153 # Note that this needs to be used in optimized compiles too to be 100%. 11.154 @@ -479,8 +481,8 @@ 11.155 #DEBUG_CFLAGS += -Qoption ccfe -xglobalstatic 11.156 #FASTDEBUG_CFLAGS += -Qoption ccfe -xglobalstatic 11.157 11.158 -ifeq (${COMPILER_REV}, 5.2) 11.159 -COMPILER_DATE := $(shell $(CPP) -V 2>&1 | awk '{ print $$NF; }') 11.160 +ifeq (${COMPILER_REV_NUMERIC}, 502) 11.161 +COMPILER_DATE := $(shell $(CPP) -V 2>&1 | sed -n '/^.*[ ]C++[ ]\([1-9]\.[0-9][0-9]*\)/p' | awk '{ print $$NF; }') 11.162 ifeq (${COMPILER_DATE}, 2001/01/31) 11.163 # disable -g0 in fastdebug since SC6.1 dated 2001/01/31 seems to be buggy 11.164 # use an innocuous value because it will get -g if it's empty 11.165 @@ -493,7 +495,7 @@ 11.166 CFLAGS += $(CFLAGS_BROWSE) 11.167 11.168 # ILD is gone as of SS11 (5.8), not supportted in SS10 (5.7) 11.169 -ifeq ($(shell expr $(COMPILER_REV) \< 5.7), 1) 11.170 +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 507), 1) 11.171 # use ild when debugging (but when optimizing we want reproducible results) 11.172 ILDFLAG = $(ILDFLAG/$(VERSION)) 11.173 ILDFLAG/debug = -xildon
12.1 --- a/make/solaris/makefiles/sparcv9.make Thu Nov 20 11:39:38 2008 -0800 12.2 +++ b/make/solaris/makefiles/sparcv9.make Fri Nov 21 16:11:03 2008 -0800 12.3 @@ -26,7 +26,7 @@ 12.4 ASFLAGS += $(AS_ARCHFLAG) 12.5 12.6 ifeq ("${Platform_compiler}", "sparcWorks") 12.7 -ifeq ($(shell expr $(COMPILER_REV) \< 5.5), 1) 12.8 +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \< 505), 1) 12.9 # When optimized fully, stubGenerator_sparc.cpp 12.10 # has bogus code for the routine 12.11 # StubGenerator::generate_flush_callers_register_windows()
13.1 --- a/make/solaris/makefiles/top.make Thu Nov 20 11:39:38 2008 -0800 13.2 +++ b/make/solaris/makefiles/top.make Fri Nov 21 16:11:03 2008 -0800 13.3 @@ -83,9 +83,9 @@ 13.4 13.5 AD_Dir = $(GENERATED)/adfiles 13.6 ADLC = $(AD_Dir)/adlc 13.7 -AD_Spec = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch).ad 13.8 +AD_Spec = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad 13.9 AD_Src = $(GAMMADIR)/src/share/vm/adlc 13.10 -AD_Names = ad_$(Platform_arch).hpp ad_$(Platform_arch).cpp 13.11 +AD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp 13.12 AD_Files = $(AD_Names:%=$(AD_Dir)/%) 13.13 13.14 # AD_Files_If_Required/COMPILER1 = ad_stuff
14.1 --- a/make/solaris/makefiles/vm.make Thu Nov 20 11:39:38 2008 -0800 14.2 +++ b/make/solaris/makefiles/vm.make Fri Nov 21 16:11:03 2008 -0800 14.3 @@ -101,7 +101,7 @@ 14.4 14.5 ifeq ("${Platform_compiler}", "sparcWorks") 14.6 # The whole megilla: 14.7 -ifeq ($(shell expr $(COMPILER_REV) \>= 5.5), 1) 14.8 +ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1) 14.9 # Old Comment: List the libraries in the order the compiler was designed for 14.10 # Not sure what the 'designed for' comment is referring too above. 14.11 # The order may not be too significant anymore, but I have placed this
15.1 --- a/make/windows/makefiles/adlc.make Thu Nov 20 11:39:38 2008 -0800 15.2 +++ b/make/windows/makefiles/adlc.make Fri Nov 21 16:11:03 2008 -0800 15.3 @@ -102,6 +102,12 @@ 15.4 adlc.exe: main.obj adlparse.obj archDesc.obj arena.obj dfa.obj dict2.obj filebuff.obj \ 15.5 forms.obj formsopt.obj formssel.obj opcodes.obj output_c.obj output_h.obj 15.6 $(LINK) $(LINK_FLAGS) /subsystem:console /out:$@ $** 15.7 +!if "$(MT)" != "" 15.8 +# The previous link command created a .manifest file that we want to 15.9 +# insert into the linked artifact so we do not need to track it 15.10 +# separately. Use ";#2" for .dll and ";#1" for .exe: 15.11 + $(MT) /manifest $@.manifest /outputresource:$@;#1 15.12 +!endif 15.13 15.14 $(GENERATED_NAMES_IN_INCL): $(Platform_arch_model).ad adlc.exe includeDB.current 15.15 rm -f $(GENERATED_NAMES)
16.1 --- a/make/windows/makefiles/compile.make Thu Nov 20 11:39:38 2008 -0800 16.2 +++ b/make/windows/makefiles/compile.make Fri Nov 21 16:11:03 2008 -0800 16.3 @@ -30,7 +30,7 @@ 16.4 # /W3 Warning level 3 16.5 # /Zi Include debugging information 16.6 # /WX Treat any warning error as a fatal error 16.7 -# /MD Use dynamic multi-threaded runtime (msvcrt.dll or msvc*71.dll) 16.8 +# /MD Use dynamic multi-threaded runtime (msvcrt.dll or msvc*NN.dll) 16.9 # /MTd Use static multi-threaded runtime debug versions 16.10 # /O1 Optimize for size (/Os), skips /Oi 16.11 # /O2 Optimize for speed (/Ot), adds /Oi to /O1 16.12 @@ -80,8 +80,10 @@ 16.13 CPP=ARCH_ERROR 16.14 !endif 16.15 16.16 -# MSC_VER is a 4 digit number that tells us what compiler is being used, it is 16.17 -# generated when the local.make file is created by the script gen_msc_ver.sh. 16.18 +# MSC_VER is a 4 digit number that tells us what compiler is being used 16.19 +# and is generated when the local.make file is created by build.make 16.20 +# via the script get_msc_ver.sh 16.21 +# 16.22 # If MSC_VER is set, it overrides the above default setting. 16.23 # But it should be set. 16.24 # Possible values: 16.25 @@ -89,13 +91,14 @@ 16.26 # 1300 and 1310 is VS2003 or VC7 16.27 # 1399 is our fake number for the VS2005 compiler that really isn't 1400 16.28 # 1400 is for VS2005 16.29 +# 1500 is for VS2008 16.30 # Do not confuse this MSC_VER with the predefined macro _MSC_VER that the 16.31 # compiler provides, when MSC_VER==1399, _MSC_VER will be 1400. 16.32 # Normally they are the same, but a pre-release of the VS2005 compilers 16.33 # in the Windows 64bit Platform SDK said it was 1400 when it was really 16.34 # closer to VS2003 in terms of option spellings, so we use 1399 for that 16.35 # 1400 version that really isn't 1400. 16.36 -# See the file gen_msc_ver.sh for more info. 16.37 +# See the file get_msc_ver.sh for more info. 16.38 !if "x$(MSC_VER)" == "x" 16.39 COMPILER_NAME=$(DEFAULT_COMPILER_NAME) 16.40 !else 16.41 @@ -115,6 +118,9 @@ 16.42 !if "$(MSC_VER)" == "1400" 16.43 COMPILER_NAME=VS2005 16.44 !endif 16.45 +!if "$(MSC_VER)" == "1500" 16.46 +COMPILER_NAME=VS2008 16.47 +!endif 16.48 !endif 16.49 16.50 # Add what version of the compiler we think this is to the compile line 16.51 @@ -160,7 +166,25 @@ 16.52 # externals at link time. Even with /GS-, you need bufferoverflowU.lib. 16.53 # NOTE: Currently we decided to not use /GS- 16.54 BUFFEROVERFLOWLIB = bufferoverflowU.lib 16.55 -LINK_FLAGS = $(LINK_FLAGS) $(BUFFEROVERFLOWLIB) 16.56 +LINK_FLAGS = /manifest $(LINK_FLAGS) $(BUFFEROVERFLOWLIB) 16.57 +# Manifest Tool - used in VS2005 and later to adjust manifests stored 16.58 +# as resources inside build artifacts. 16.59 +MT=mt.exe 16.60 +!if "$(BUILDARCH)" == "i486" 16.61 +# VS2005 on x86 restricts the use of certain libc functions without this 16.62 +CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_DEPRECATE 16.63 +!endif 16.64 +!endif 16.65 + 16.66 +!if "$(COMPILER_NAME)" == "VS2008" 16.67 +PRODUCT_OPT_OPTION = /O2 /Oy- 16.68 +FASTDEBUG_OPT_OPTION = /O2 /Oy- 16.69 +DEBUG_OPT_OPTION = /Od 16.70 +GX_OPTION = /EHsc 16.71 +LINK_FLAGS = /manifest $(LINK_FLAGS) 16.72 +# Manifest Tool - used in VS2005 and later to adjust manifests stored 16.73 +# as resources inside build artifacts. 16.74 +MT=mt.exe 16.75 !if "$(BUILDARCH)" == "i486" 16.76 # VS2005 on x86 restricts the use of certain libc functions without this 16.77 CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_DEPRECATE
17.1 --- a/make/windows/makefiles/debug.make Thu Nov 20 11:39:38 2008 -0800 17.2 +++ b/make/windows/makefiles/debug.make Fri Nov 21 16:11:03 2008 -0800 17.3 @@ -50,6 +50,12 @@ 17.4 $(LINK) @<< 17.5 $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files) 17.6 << 17.7 +!if "$(MT)" != "" 17.8 +# The previous link command created a .manifest file that we want to 17.9 +# insert into the linked artifact so we do not need to track it 17.10 +# separately. Use ";#2" for .dll and ";#1" for .exe: 17.11 + $(MT) /manifest $@.manifest /outputresource:$@;#2 17.12 +!endif 17.13 17.14 !include $(WorkSpace)/make/windows/makefiles/shared.make 17.15 !include $(WorkSpace)/make/windows/makefiles/sa.make
18.1 --- a/make/windows/makefiles/defs.make Thu Nov 20 11:39:38 2008 -0800 18.2 +++ b/make/windows/makefiles/defs.make Fri Nov 21 16:11:03 2008 -0800 18.3 @@ -25,7 +25,7 @@ 18.4 # The common definitions for hotspot windows builds. 18.5 # Include the top level defs.make under make directory instead of this one. 18.6 # This file is included into make/defs.make. 18.7 -# On windows it is only used to construct parameters for 18.8 +# On windows it is only used to construct parameters for 18.9 # make/windows/build.make when make/Makefile is used to build VM. 18.10 18.11 SLASH_JAVA ?= J: 18.12 @@ -69,7 +69,7 @@ 18.13 18.14 JDK_INCLUDE_SUBDIR=win32 18.15 18.16 -# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined 18.17 +# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined 18.18 # and added to MAKE_ARGS list in $(GAMMADIR)/make/defs.make. 18.19 18.20 # next parameters are defined in $(GAMMADIR)/make/defs.make. 18.21 @@ -125,7 +125,7 @@ 18.22 endif 18.23 18.24 ifeq ($(BUILD_WIN_SA), 1) 18.25 - ifeq ($(ARCH),ia64) 18.26 + ifeq ($(ARCH),ia64) 18.27 BUILD_WIN_SA = 0 18.28 endif 18.29 endif 18.30 @@ -154,7 +154,7 @@ 18.31 EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.dll 18.32 EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.pdb 18.33 EXPORT_LIST += $(EXPORT_JRE_BIN_DIR)/sawindbg.map 18.34 - EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar 18.35 + EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar 18.36 # Must pass this down to nmake. 18.37 MAKE_ARGS += BUILD_WIN_SA=1 18.38 endif
19.1 --- a/make/windows/makefiles/fastdebug.make Thu Nov 20 11:39:38 2008 -0800 19.2 +++ b/make/windows/makefiles/fastdebug.make Fri Nov 21 16:11:03 2008 -0800 19.3 @@ -50,6 +50,13 @@ 19.4 $(LINK) @<< 19.5 $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files) 19.6 << 19.7 +!if "$(MT)" != "" 19.8 +# The previous link command created a .manifest file that we want to 19.9 +# insert into the linked artifact so we do not need to track it 19.10 +# separately. Use ";#2" for .dll and ";#1" for .exe: 19.11 + $(MT) /manifest $@.manifest /outputresource:$@;#2 19.12 +!endif 19.13 + 19.14 19.15 !include $(WorkSpace)/make/windows/makefiles/shared.make 19.16 !include $(WorkSpace)/make/windows/makefiles/sa.make
20.1 --- a/make/windows/makefiles/product.make Thu Nov 20 11:39:38 2008 -0800 20.2 +++ b/make/windows/makefiles/product.make Fri Nov 21 16:11:03 2008 -0800 20.3 @@ -61,6 +61,12 @@ 20.4 $(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files) 20.5 << 20.6 !endif 20.7 +!if "$(MT)" != "" 20.8 +# The previous link command created a .manifest file that we want to 20.9 +# insert into the linked artifact so we do not need to track it 20.10 +# separately. Use ";#2" for .dll and ";#1" for .exe: 20.11 + $(MT) /manifest $@.manifest /outputresource:$@;#2 20.12 +!endif 20.13 20.14 !include $(WorkSpace)/make/windows/makefiles/shared.make 20.15 !include $(WorkSpace)/make/windows/makefiles/sa.make
21.1 --- a/make/windows/makefiles/sa.make Thu Nov 20 11:39:38 2008 -0800 21.2 +++ b/make/windows/makefiles/sa.make Fri Nov 21 16:11:03 2008 -0800 21.3 @@ -92,13 +92,18 @@ 21.4 !else 21.5 SA_CFLAGS = /nologo $(MS_RUNTIME_OPTION) /W3 /Gm $(GX_OPTION) /ZI /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c 21.6 !endif 21.7 - 21.8 +!if "$(MT)" != "" 21.9 + SA_LINK_FLAGS = /manifest $(SA_LINK_FLAGS) 21.10 +!endif 21.11 SASRCFILE = $(AGENT_DIR)/src/os/win32/windbg/sawindbg.cpp 21.12 SA_LFLAGS = $(SA_LINK_FLAGS) /nologo /subsystem:console /map /debug /machine:$(MACHINE) 21.13 21.14 # Note that we do not keep sawindbj.obj around as it would then 21.15 # get included in the dumpbin command in build_vm_def.sh 21.16 21.17 +# In VS2005 or VS2008 the link command creates a .manifest file that we want 21.18 +# to insert into the linked artifact so we do not need to track it separately. 21.19 +# Use ";#2" for .dll and ";#1" for .exe in the MT command below: 21.20 $(SAWINDBG): $(SASRCFILE) 21.21 set INCLUDE=$(SA_INCLUDE)$(INCLUDE) 21.22 $(CPP) @<< 21.23 @@ -109,6 +114,9 @@ 21.24 << 21.25 set LIB=$(SA_LIB)$(LIB) 21.26 $(LINK) /out:$@ /DLL sawindbg.obj dbgeng.lib $(SA_LFLAGS) 21.27 +!if "$(MT)" != "" 21.28 + $(MT) /manifest $(@F).manifest /outputresource:$(@F);#2 21.29 +!endif 21.30 -@rm -f sawindbg.obj 21.31 21.32 cleanall :
22.1 --- a/make/windows/projectfiles/common/Makefile Thu Nov 20 11:39:38 2008 -0800 22.2 +++ b/make/windows/projectfiles/common/Makefile Fri Nov 21 16:11:03 2008 -0800 22.3 @@ -56,7 +56,8 @@ 22.4 $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_shared \ 22.5 $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_parNew \ 22.6 $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge \ 22.7 - $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep 22.8 + $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_concurrentMarkSweep \ 22.9 + $(HOTSPOTWORKSPACE)/src/share/vm/gc_implementation/includeDB_gc_g1 22.10 22.11 22.12 IncludeDBs_kernel =$(IncludeDBs_base) \
23.1 --- a/src/cpu/x86/vm/register_definitions_x86.cpp Thu Nov 20 11:39:38 2008 -0800 23.2 +++ b/src/cpu/x86/vm/register_definitions_x86.cpp Fri Nov 21 16:11:03 2008 -0800 23.3 @@ -22,9 +22,6 @@ 23.4 * 23.5 */ 23.6 23.7 -// make sure the defines don't screw up the declarations later on in this file 23.8 -#define DONT_USE_REGISTER_DEFINES 23.9 - 23.10 #include "incls/_precompiled.incl" 23.11 #include "incls/_register_definitions_x86.cpp.incl" 23.12
24.1 --- a/src/os/solaris/vm/os_solaris.cpp Thu Nov 20 11:39:38 2008 -0800 24.2 +++ b/src/os/solaris/vm/os_solaris.cpp Fri Nov 21 16:11:03 2008 -0800 24.3 @@ -3756,7 +3756,6 @@ 24.4 int maxClamped = MIN2(iaLimits.maxPrio, (int)iaInfo->ia_uprilim); 24.5 iaInfo->ia_upri = scale_to_lwp_priority(iaLimits.minPrio, maxClamped, newPrio); 24.6 iaInfo->ia_uprilim = IA_NOCHANGE; 24.7 - iaInfo->ia_nice = IA_NOCHANGE; 24.8 iaInfo->ia_mode = IA_NOCHANGE; 24.9 if (ThreadPriorityVerbose) { 24.10 tty->print_cr ("IA: [%d...%d] %d->%d\n",
25.1 --- a/src/share/vm/adlc/archDesc.cpp Thu Nov 20 11:39:38 2008 -0800 25.2 +++ b/src/share/vm/adlc/archDesc.cpp Fri Nov 21 16:11:03 2008 -0800 25.3 @@ -212,9 +212,9 @@ 25.4 // Initialize I/O Files 25.5 _ADL_file._name = NULL; _ADL_file._fp = NULL; 25.6 // Machine dependent output files 25.7 - _DFA_file._name = "dfa_i486.cpp"; _DFA_file._fp = NULL; 25.8 - _HPP_file._name = "ad_i486.hpp"; _HPP_file._fp = NULL; 25.9 - _CPP_file._name = "ad_i486.cpp"; _CPP_file._fp = NULL; 25.10 + _DFA_file._name = NULL; _DFA_file._fp = NULL; 25.11 + _HPP_file._name = NULL; _HPP_file._fp = NULL; 25.12 + _CPP_file._name = NULL; _CPP_file._fp = NULL; 25.13 _bug_file._name = "bugs.out"; _bug_file._fp = NULL; 25.14 25.15 // Initialize Register & Pipeline Form Pointers
26.1 --- a/src/share/vm/c1/c1_IR.cpp Thu Nov 20 11:39:38 2008 -0800 26.2 +++ b/src/share/vm/c1/c1_IR.cpp Fri Nov 21 16:11:03 2008 -0800 26.3 @@ -574,12 +574,23 @@ 26.4 TRACE_LINEAR_SCAN(3, tty->print_cr("backward branch")); 26.5 assert(is_visited(cur), "block must be visisted when block is active"); 26.6 assert(parent != NULL, "must have parent"); 26.7 - assert(parent->number_of_sux() == 1, "loop end blocks must have one successor (critical edges are split)"); 26.8 26.9 cur->set(BlockBegin::linear_scan_loop_header_flag); 26.10 cur->set(BlockBegin::backward_branch_target_flag); 26.11 26.12 parent->set(BlockBegin::linear_scan_loop_end_flag); 26.13 + 26.14 + // When a loop header is also the start of an exception handler, then the backward branch is 26.15 + // an exception edge. Because such edges are usually critical edges which cannot be split, the 26.16 + // loop must be excluded here from processing. 26.17 + if (cur->is_set(BlockBegin::exception_entry_flag)) { 26.18 + // Make sure that dominators are correct in this weird situation 26.19 + _iterative_dominators = true; 26.20 + return; 26.21 + } 26.22 + assert(parent->number_of_sux() == 1 && parent->sux_at(0) == cur, 26.23 + "loop end blocks must have one successor (critical edges are split)"); 26.24 + 26.25 _loop_end_blocks.append(parent); 26.26 return; 26.27 }
27.1 --- a/src/share/vm/ci/ciEnv.cpp Thu Nov 20 11:39:38 2008 -0800 27.2 +++ b/src/share/vm/ci/ciEnv.cpp Fri Nov 21 16:11:03 2008 -0800 27.3 @@ -484,11 +484,16 @@ 27.4 } else if (tag.is_double()) { 27.5 return ciConstant((jdouble)cpool->double_at(index)); 27.6 } else if (tag.is_string() || tag.is_unresolved_string()) { 27.7 - oop string = cpool->string_at(index, THREAD); 27.8 - if (HAS_PENDING_EXCEPTION) { 27.9 - CLEAR_PENDING_EXCEPTION; 27.10 - record_out_of_memory_failure(); 27.11 - return ciConstant(); 27.12 + oop string = NULL; 27.13 + if (cpool->is_pseudo_string_at(index)) { 27.14 + string = cpool->pseudo_string_at(index); 27.15 + } else { 27.16 + string = cpool->string_at(index, THREAD); 27.17 + if (HAS_PENDING_EXCEPTION) { 27.18 + CLEAR_PENDING_EXCEPTION; 27.19 + record_out_of_memory_failure(); 27.20 + return ciConstant(); 27.21 + } 27.22 } 27.23 ciObject* constant = get_object(string); 27.24 assert (constant->is_instance(), "must be an instance, or not? ");
28.1 --- a/src/share/vm/classfile/classFileParser.cpp Thu Nov 20 11:39:38 2008 -0800 28.2 +++ b/src/share/vm/classfile/classFileParser.cpp Fri Nov 21 16:11:03 2008 -0800 28.3 @@ -168,11 +168,23 @@ 28.4 // Got utf8 string, guarantee utf8_length+1 bytes, set stream position forward. 28.5 cfs->guarantee_more(utf8_length+1, CHECK); // utf8 string, tag/access_flags 28.6 cfs->skip_u1_fast(utf8_length); 28.7 + 28.8 // Before storing the symbol, make sure it's legal 28.9 if (_need_verify) { 28.10 verify_legal_utf8((unsigned char*)utf8_buffer, utf8_length, CHECK); 28.11 } 28.12 28.13 + if (AnonymousClasses && has_cp_patch_at(index)) { 28.14 + Handle patch = clear_cp_patch_at(index); 28.15 + guarantee_property(java_lang_String::is_instance(patch()), 28.16 + "Illegal utf8 patch at %d in class file %s", 28.17 + index, CHECK); 28.18 + char* str = java_lang_String::as_utf8_string(patch()); 28.19 + // (could use java_lang_String::as_symbol instead, but might as well batch them) 28.20 + utf8_buffer = (u1*) str; 28.21 + utf8_length = (int) strlen(str); 28.22 + } 28.23 + 28.24 unsigned int hash; 28.25 symbolOop result = SymbolTable::lookup_only((char*)utf8_buffer, utf8_length, hash); 28.26 if (result == NULL) { 28.27 @@ -245,7 +257,7 @@ 28.28 int klass_ref_index = cp->klass_ref_index_at(index); 28.29 int name_and_type_ref_index = cp->name_and_type_ref_index_at(index); 28.30 check_property(valid_cp_range(klass_ref_index, length) && 28.31 - cp->tag_at(klass_ref_index).is_klass_reference(), 28.32 + is_klass_reference(cp, klass_ref_index), 28.33 "Invalid constant pool index %u in class file %s", 28.34 klass_ref_index, 28.35 CHECK_(nullHandle)); 28.36 @@ -326,16 +338,46 @@ 28.37 } // end of switch 28.38 } // end of for 28.39 28.40 + if (_cp_patches != NULL) { 28.41 + // need to treat this_class specially... 28.42 + assert(AnonymousClasses, ""); 28.43 + int this_class_index; 28.44 + { 28.45 + cfs->guarantee_more(8, CHECK_(nullHandle)); // flags, this_class, super_class, infs_len 28.46 + u1* mark = cfs->current(); 28.47 + u2 flags = cfs->get_u2_fast(); 28.48 + this_class_index = cfs->get_u2_fast(); 28.49 + cfs->set_current(mark); // revert to mark 28.50 + } 28.51 + 28.52 + for (index = 1; index < length; index++) { // Index 0 is unused 28.53 + if (has_cp_patch_at(index)) { 28.54 + guarantee_property(index != this_class_index, 28.55 + "Illegal constant pool patch to self at %d in class file %s", 28.56 + index, CHECK_(nullHandle)); 28.57 + patch_constant_pool(cp, index, cp_patch_at(index), CHECK_(nullHandle)); 28.58 + } 28.59 + } 28.60 + // Ensure that all the patches have been used. 28.61 + for (index = 0; index < _cp_patches->length(); index++) { 28.62 + guarantee_property(!has_cp_patch_at(index), 28.63 + "Unused constant pool patch at %d in class file %s", 28.64 + index, CHECK_(nullHandle)); 28.65 + } 28.66 + } 28.67 + 28.68 if (!_need_verify) { 28.69 return cp; 28.70 } 28.71 28.72 // second verification pass - checks the strings are of the right format. 28.73 + // but not yet to the other entries 28.74 for (index = 1; index < length; index++) { 28.75 jbyte tag = cp->tag_at(index).value(); 28.76 switch (tag) { 28.77 case JVM_CONSTANT_UnresolvedClass: { 28.78 symbolHandle class_name(THREAD, cp->unresolved_klass_at(index)); 28.79 + // check the name, even if _cp_patches will overwrite it 28.80 verify_legal_class_name(class_name, CHECK_(nullHandle)); 28.81 break; 28.82 } 28.83 @@ -378,6 +420,73 @@ 28.84 } 28.85 28.86 28.87 +void ClassFileParser::patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS) { 28.88 + assert(AnonymousClasses, ""); 28.89 + BasicType patch_type = T_VOID; 28.90 + switch (cp->tag_at(index).value()) { 28.91 + 28.92 + case JVM_CONSTANT_UnresolvedClass : 28.93 + // Patching a class means pre-resolving it. 28.94 + // The name in the constant pool is ignored. 28.95 + if (patch->klass() == SystemDictionary::class_klass()) { // %%% java_lang_Class::is_instance 28.96 + guarantee_property(!java_lang_Class::is_primitive(patch()), 28.97 + "Illegal class patch at %d in class file %s", 28.98 + index, CHECK); 28.99 + cp->klass_at_put(index, java_lang_Class::as_klassOop(patch())); 28.100 + } else { 28.101 + guarantee_property(java_lang_String::is_instance(patch()), 28.102 + "Illegal class patch at %d in class file %s", 28.103 + index, CHECK); 28.104 + symbolHandle name = java_lang_String::as_symbol(patch(), CHECK); 28.105 + cp->unresolved_klass_at_put(index, name()); 28.106 + } 28.107 + break; 28.108 + 28.109 + case JVM_CONSTANT_UnresolvedString : 28.110 + // Patching a string means pre-resolving it. 28.111 + // The spelling in the constant pool is ignored. 28.112 + // The constant reference may be any object whatever. 28.113 + // If it is not a real interned string, the constant is referred 28.114 + // to as a "pseudo-string", and must be presented to the CP 28.115 + // explicitly, because it may require scavenging. 28.116 + cp->pseudo_string_at_put(index, patch()); 28.117 + break; 28.118 + 28.119 + case JVM_CONSTANT_Integer : patch_type = T_INT; goto patch_prim; 28.120 + case JVM_CONSTANT_Float : patch_type = T_FLOAT; goto patch_prim; 28.121 + case JVM_CONSTANT_Long : patch_type = T_LONG; goto patch_prim; 28.122 + case JVM_CONSTANT_Double : patch_type = T_DOUBLE; goto patch_prim; 28.123 + patch_prim: 28.124 + { 28.125 + jvalue value; 28.126 + BasicType value_type = java_lang_boxing_object::get_value(patch(), &value); 28.127 + guarantee_property(value_type == patch_type, 28.128 + "Illegal primitive patch at %d in class file %s", 28.129 + index, CHECK); 28.130 + switch (value_type) { 28.131 + case T_INT: cp->int_at_put(index, value.i); break; 28.132 + case T_FLOAT: cp->float_at_put(index, value.f); break; 28.133 + case T_LONG: cp->long_at_put(index, value.j); break; 28.134 + case T_DOUBLE: cp->double_at_put(index, value.d); break; 28.135 + default: assert(false, ""); 28.136 + } 28.137 + } 28.138 + break; 28.139 + 28.140 + default: 28.141 + // %%% TODO: put method handles into CONSTANT_InterfaceMethodref, etc. 28.142 + guarantee_property(!has_cp_patch_at(index), 28.143 + "Illegal unexpected patch at %d in class file %s", 28.144 + index, CHECK); 28.145 + return; 28.146 + } 28.147 + 28.148 + // On fall-through, mark the patch as used. 28.149 + clear_cp_patch_at(index); 28.150 +} 28.151 + 28.152 + 28.153 + 28.154 class NameSigHash: public ResourceObj { 28.155 public: 28.156 symbolOop _name; // name 28.157 @@ -448,25 +557,32 @@ 28.158 int index; 28.159 for (index = 0; index < length; index++) { 28.160 u2 interface_index = cfs->get_u2(CHECK_(nullHandle)); 28.161 + KlassHandle interf; 28.162 check_property( 28.163 valid_cp_range(interface_index, cp->length()) && 28.164 - cp->tag_at(interface_index).is_unresolved_klass(), 28.165 + is_klass_reference(cp, interface_index), 28.166 "Interface name has bad constant pool index %u in class file %s", 28.167 interface_index, CHECK_(nullHandle)); 28.168 - symbolHandle unresolved_klass (THREAD, cp->klass_name_at(interface_index)); 28.169 - 28.170 - // Don't need to check legal name because it's checked when parsing constant pool. 28.171 - // But need to make sure it's not an array type. 28.172 - guarantee_property(unresolved_klass->byte_at(0) != JVM_SIGNATURE_ARRAY, 28.173 - "Bad interface name in class file %s", CHECK_(nullHandle)); 28.174 - 28.175 - vmtimer->suspend(); // do not count recursive loading twice 28.176 - // Call resolve_super so classcircularity is checked 28.177 - klassOop k = SystemDictionary::resolve_super_or_fail(class_name, 28.178 - unresolved_klass, class_loader, protection_domain, 28.179 - false, CHECK_(nullHandle)); 28.180 - KlassHandle interf (THREAD, k); 28.181 - vmtimer->resume(); 28.182 + if (cp->tag_at(interface_index).is_klass()) { 28.183 + interf = KlassHandle(THREAD, cp->resolved_klass_at(interface_index)); 28.184 + } else { 28.185 + symbolHandle unresolved_klass (THREAD, cp->klass_name_at(interface_index)); 28.186 + 28.187 + // Don't need to check legal name because it's checked when parsing constant pool. 28.188 + // But need to make sure it's not an array type. 28.189 + guarantee_property(unresolved_klass->byte_at(0) != JVM_SIGNATURE_ARRAY, 28.190 + "Bad interface name in class file %s", CHECK_(nullHandle)); 28.191 + 28.192 + vmtimer->suspend(); // do not count recursive loading twice 28.193 + // Call resolve_super so classcircularity is checked 28.194 + klassOop k = SystemDictionary::resolve_super_or_fail(class_name, 28.195 + unresolved_klass, class_loader, protection_domain, 28.196 + false, CHECK_(nullHandle)); 28.197 + interf = KlassHandle(THREAD, k); 28.198 + vmtimer->resume(); 28.199 + 28.200 + cp->klass_at_put(interface_index, interf()); // eagerly resolve 28.201 + } 28.202 28.203 if (!Klass::cast(interf())->is_interface()) { 28.204 THROW_MSG_(vmSymbols::java_lang_IncompatibleClassChangeError(), "Implementing class", nullHandle); 28.205 @@ -877,8 +993,7 @@ 28.206 "Illegal exception table handler in class file %s", CHECK_(nullHandle)); 28.207 if (catch_type_index != 0) { 28.208 guarantee_property(valid_cp_range(catch_type_index, cp->length()) && 28.209 - (cp->tag_at(catch_type_index).is_klass() || 28.210 - cp->tag_at(catch_type_index).is_unresolved_klass()), 28.211 + is_klass_reference(cp, catch_type_index), 28.212 "Catch type in exception table has bad constant type in class file %s", CHECK_(nullHandle)); 28.213 } 28.214 } 28.215 @@ -1117,7 +1232,7 @@ 28.216 } else if (tag == ITEM_Object) { 28.217 u2 class_index = u2_array[i2++] = cfs->get_u2(CHECK); 28.218 guarantee_property(valid_cp_range(class_index, cp->length()) && 28.219 - cp->tag_at(class_index).is_unresolved_klass(), 28.220 + is_klass_reference(cp, class_index), 28.221 "Bad class index %u in StackMap in class file %s", 28.222 class_index, CHECK); 28.223 } else if (tag == ITEM_Uninitialized) { 28.224 @@ -1183,7 +1298,7 @@ 28.225 checked_exception = cfs->get_u2_fast(); 28.226 check_property( 28.227 valid_cp_range(checked_exception, cp->length()) && 28.228 - cp->tag_at(checked_exception).is_klass_reference(), 28.229 + is_klass_reference(cp, checked_exception), 28.230 "Exception name has bad type at constant pool %u in class file %s", 28.231 checked_exception, CHECK_NULL); 28.232 } 28.233 @@ -1918,7 +2033,7 @@ 28.234 check_property( 28.235 inner_class_info_index == 0 || 28.236 (valid_cp_range(inner_class_info_index, cp_size) && 28.237 - cp->tag_at(inner_class_info_index).is_klass_reference()), 28.238 + is_klass_reference(cp, inner_class_info_index)), 28.239 "inner_class_info_index %u has bad constant type in class file %s", 28.240 inner_class_info_index, CHECK_0); 28.241 // Outer class index 28.242 @@ -1926,7 +2041,7 @@ 28.243 check_property( 28.244 outer_class_info_index == 0 || 28.245 (valid_cp_range(outer_class_info_index, cp_size) && 28.246 - cp->tag_at(outer_class_info_index).is_klass_reference()), 28.247 + is_klass_reference(cp, outer_class_info_index)), 28.248 "outer_class_info_index %u has bad constant type in class file %s", 28.249 outer_class_info_index, CHECK_0); 28.250 // Inner class name 28.251 @@ -2088,7 +2203,7 @@ 28.252 } 28.253 // Validate the constant pool indices and types 28.254 if (!cp->is_within_bounds(class_index) || 28.255 - !cp->tag_at(class_index).is_klass_reference()) { 28.256 + !is_klass_reference(cp, class_index)) { 28.257 classfile_parse_error("Invalid or out-of-bounds class index in EnclosingMethod attribute in class file %s", CHECK); 28.258 } 28.259 if (method_index != 0 && 28.260 @@ -2349,6 +2464,7 @@ 28.261 instanceKlassHandle ClassFileParser::parseClassFile(symbolHandle name, 28.262 Handle class_loader, 28.263 Handle protection_domain, 28.264 + GrowableArray<Handle>* cp_patches, 28.265 symbolHandle& parsed_name, 28.266 TRAPS) { 28.267 // So that JVMTI can cache class file in the state before retransformable agents 28.268 @@ -2380,6 +2496,7 @@ 28.269 } 28.270 } 28.271 28.272 + _cp_patches = cp_patches; 28.273 28.274 instanceKlassHandle nullHandle; 28.275 28.276 @@ -2510,14 +2627,22 @@ 28.277 CHECK_(nullHandle)); 28.278 } else { 28.279 check_property(valid_cp_range(super_class_index, cp_size) && 28.280 - cp->tag_at(super_class_index).is_unresolved_klass(), 28.281 + is_klass_reference(cp, super_class_index), 28.282 "Invalid superclass index %u in class file %s", 28.283 super_class_index, 28.284 CHECK_(nullHandle)); 28.285 // The class name should be legal because it is checked when parsing constant pool. 28.286 // However, make sure it is not an array type. 28.287 + bool is_array = false; 28.288 + if (cp->tag_at(super_class_index).is_klass()) { 28.289 + super_klass = instanceKlassHandle(THREAD, cp->resolved_klass_at(super_class_index)); 28.290 + if (_need_verify) 28.291 + is_array = super_klass->oop_is_array(); 28.292 + } else if (_need_verify) { 28.293 + is_array = (cp->unresolved_klass_at(super_class_index)->byte_at(0) == JVM_SIGNATURE_ARRAY); 28.294 + } 28.295 if (_need_verify) { 28.296 - guarantee_property(cp->unresolved_klass_at(super_class_index)->byte_at(0) != JVM_SIGNATURE_ARRAY, 28.297 + guarantee_property(!is_array, 28.298 "Bad superclass name in class file %s", CHECK_(nullHandle)); 28.299 } 28.300 } 28.301 @@ -2557,7 +2682,7 @@ 28.302 objArrayHandle methods_default_annotations(THREAD, methods_default_annotations_oop); 28.303 28.304 // We check super class after class file is parsed and format is checked 28.305 - if (super_class_index > 0) { 28.306 + if (super_class_index > 0 && super_klass.is_null()) { 28.307 symbolHandle sk (THREAD, cp->klass_name_at(super_class_index)); 28.308 if (access_flags.is_interface()) { 28.309 // Before attempting to resolve the superclass, check for class format 28.310 @@ -2574,6 +2699,9 @@ 28.311 CHECK_(nullHandle)); 28.312 KlassHandle kh (THREAD, k); 28.313 super_klass = instanceKlassHandle(THREAD, kh()); 28.314 + cp->klass_at_put(super_class_index, super_klass()); // eagerly resolve 28.315 + } 28.316 + if (super_klass.not_null()) { 28.317 if (super_klass->is_interface()) { 28.318 ResourceMark rm(THREAD); 28.319 Exceptions::fthrow( 28.320 @@ -3000,6 +3128,7 @@ 28.321 this_klass->set_method_ordering(method_ordering()); 28.322 this_klass->set_initial_method_idnum(methods->length()); 28.323 this_klass->set_name(cp->klass_name_at(this_class_index)); 28.324 + cp->klass_at_put(this_class_index, this_klass()); // eagerly resolve 28.325 this_klass->set_protection_domain(protection_domain()); 28.326 this_klass->set_fields_annotations(fields_annotations()); 28.327 this_klass->set_methods_annotations(methods_annotations());
29.1 --- a/src/share/vm/classfile/classFileParser.hpp Thu Nov 20 11:39:38 2008 -0800 29.2 +++ b/src/share/vm/classfile/classFileParser.hpp Fri Nov 21 16:11:03 2008 -0800 29.3 @@ -33,6 +33,7 @@ 29.4 u2 _major_version; 29.5 u2 _minor_version; 29.6 symbolHandle _class_name; 29.7 + GrowableArray<Handle>* _cp_patches; // overrides for CP entries 29.8 29.9 bool _has_finalizer; 29.10 bool _has_empty_finalizer; 29.11 @@ -203,6 +204,35 @@ 29.12 char* skip_over_field_name(char* name, bool slash_ok, unsigned int length); 29.13 char* skip_over_field_signature(char* signature, bool void_ok, unsigned int length, TRAPS); 29.14 29.15 + bool has_cp_patch_at(int index) { 29.16 + assert(AnonymousClasses, ""); 29.17 + assert(index >= 0, "oob"); 29.18 + return (_cp_patches != NULL 29.19 + && index < _cp_patches->length() 29.20 + && _cp_patches->adr_at(index)->not_null()); 29.21 + } 29.22 + Handle cp_patch_at(int index) { 29.23 + assert(has_cp_patch_at(index), "oob"); 29.24 + return _cp_patches->at(index); 29.25 + } 29.26 + Handle clear_cp_patch_at(int index) { 29.27 + Handle patch = cp_patch_at(index); 29.28 + _cp_patches->at_put(index, Handle()); 29.29 + assert(!has_cp_patch_at(index), ""); 29.30 + return patch; 29.31 + } 29.32 + void patch_constant_pool(constantPoolHandle cp, int index, Handle patch, TRAPS); 29.33 + 29.34 + // Wrapper for constantTag.is_klass_[or_]reference. 29.35 + // In older versions of the VM, klassOops cannot sneak into early phases of 29.36 + // constant pool construction, but in later versions they can. 29.37 + // %%% Let's phase out the old is_klass_reference. 29.38 + bool is_klass_reference(constantPoolHandle cp, int index) { 29.39 + return ((LinkWellKnownClasses || AnonymousClasses) 29.40 + ? cp->tag_at(index).is_klass_or_reference() 29.41 + : cp->tag_at(index).is_klass_reference()); 29.42 + } 29.43 + 29.44 public: 29.45 // Constructor 29.46 ClassFileParser(ClassFileStream* st) { set_stream(st); } 29.47 @@ -218,6 +248,14 @@ 29.48 Handle class_loader, 29.49 Handle protection_domain, 29.50 symbolHandle& parsed_name, 29.51 + TRAPS) { 29.52 + return parseClassFile(name, class_loader, protection_domain, NULL, parsed_name, THREAD); 29.53 + } 29.54 + instanceKlassHandle parseClassFile(symbolHandle name, 29.55 + Handle class_loader, 29.56 + Handle protection_domain, 29.57 + GrowableArray<Handle>* cp_patches, 29.58 + symbolHandle& parsed_name, 29.59 TRAPS); 29.60 29.61 // Verifier checks
30.1 --- a/src/share/vm/classfile/systemDictionary.cpp Thu Nov 20 11:39:38 2008 -0800 30.2 +++ b/src/share/vm/classfile/systemDictionary.cpp Fri Nov 21 16:11:03 2008 -0800 30.3 @@ -937,6 +937,8 @@ 30.4 Handle class_loader, 30.5 Handle protection_domain, 30.6 ClassFileStream* st, 30.7 + KlassHandle host_klass, 30.8 + GrowableArray<Handle>* cp_patches, 30.9 TRAPS) { 30.10 symbolHandle parsed_name; 30.11 30.12 @@ -953,10 +955,10 @@ 30.13 instanceKlassHandle k = ClassFileParser(st).parseClassFile(class_name, 30.14 class_loader, 30.15 protection_domain, 30.16 + cp_patches, 30.17 parsed_name, 30.18 THREAD); 30.19 30.20 - 30.21 // We don't redefine the class, so we just need to clean up whether there 30.22 // was an error or not (don't want to modify any system dictionary 30.23 // data structures). 30.24 @@ -973,6 +975,30 @@ 30.25 } 30.26 } 30.27 30.28 + if (host_klass.not_null() && k.not_null()) { 30.29 + assert(AnonymousClasses, ""); 30.30 + // If it's anonymous, initialize it now, since nobody else will. 30.31 + k->set_host_klass(host_klass()); 30.32 + 30.33 + { 30.34 + MutexLocker mu_r(Compile_lock, THREAD); 30.35 + 30.36 + // Add to class hierarchy, initialize vtables, and do possible 30.37 + // deoptimizations. 30.38 + add_to_hierarchy(k, CHECK_NULL); // No exception, but can block 30.39 + 30.40 + // But, do not add to system dictionary. 30.41 + } 30.42 + 30.43 + k->eager_initialize(THREAD); 30.44 + 30.45 + // notify jvmti 30.46 + if (JvmtiExport::should_post_class_load()) { 30.47 + assert(THREAD->is_Java_thread(), "thread->is_Java_thread()"); 30.48 + JvmtiExport::post_class_load((JavaThread *) THREAD, k()); 30.49 + } 30.50 + } 30.51 + 30.52 return k(); 30.53 } 30.54
31.1 --- a/src/share/vm/classfile/systemDictionary.hpp Thu Nov 20 11:39:38 2008 -0800 31.2 +++ b/src/share/vm/classfile/systemDictionary.hpp Fri Nov 21 16:11:03 2008 -0800 31.3 @@ -228,6 +228,16 @@ 31.4 Handle class_loader, 31.5 Handle protection_domain, 31.6 ClassFileStream* st, 31.7 + TRAPS) { 31.8 + KlassHandle nullHandle; 31.9 + return parse_stream(class_name, class_loader, protection_domain, st, nullHandle, NULL, THREAD); 31.10 + } 31.11 + static klassOop parse_stream(symbolHandle class_name, 31.12 + Handle class_loader, 31.13 + Handle protection_domain, 31.14 + ClassFileStream* st, 31.15 + KlassHandle host_klass, 31.16 + GrowableArray<Handle>* cp_patches, 31.17 TRAPS); 31.18 31.19 // Resolve from stream (called by jni_DefineClass and JVM_DefineClass)
32.1 --- a/src/share/vm/classfile/verifier.cpp Thu Nov 20 11:39:38 2008 -0800 32.2 +++ b/src/share/vm/classfile/verifier.cpp Fri Nov 21 16:11:03 2008 -0800 32.3 @@ -1600,7 +1600,11 @@ 32.4 types = (1 << JVM_CONSTANT_Double) | (1 << JVM_CONSTANT_Long); 32.5 verify_cp_type(index, cp, types, CHECK_VERIFY(this)); 32.6 } 32.7 - if (tag.is_string() || tag.is_unresolved_string()) { 32.8 + if (tag.is_string() && cp->is_pseudo_string_at(index)) { 32.9 + current_frame->push_stack( 32.10 + VerificationType::reference_type( 32.11 + vmSymbols::java_lang_Object()), CHECK_VERIFY(this)); 32.12 + } else if (tag.is_string() || tag.is_unresolved_string()) { 32.13 current_frame->push_stack( 32.14 VerificationType::reference_type( 32.15 vmSymbols::java_lang_String()), CHECK_VERIFY(this));
33.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentGCThread.cpp Thu Nov 20 11:39:38 2008 -0800 33.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 33.3 @@ -1,314 +0,0 @@ 33.4 -/* 33.5 - * Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. 33.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 33.7 - * 33.8 - * This code is free software; you can redistribute it and/or modify it 33.9 - * under the terms of the GNU General Public License version 2 only, as 33.10 - * published by the Free Software Foundation. 33.11 - * 33.12 - * This code is distributed in the hope that it will be useful, but WITHOUT 33.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 33.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 33.15 - * version 2 for more details (a copy is included in the LICENSE file that 33.16 - * accompanied this code). 33.17 - * 33.18 - * You should have received a copy of the GNU General Public License version 33.19 - * 2 along with this work; if not, write to the Free Software Foundation, 33.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 33.21 - * 33.22 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 33.23 - * CA 95054 USA or visit www.sun.com if you need additional information or 33.24 - * have any questions. 33.25 - * 33.26 - */ 33.27 - 33.28 -// CopyrightVersion 1.2 33.29 - 33.30 -# include "incls/_precompiled.incl" 33.31 -# include "incls/_concurrentGCThread.cpp.incl" 33.32 - 33.33 -bool ConcurrentGCThread::_should_terminate = false; 33.34 -bool ConcurrentGCThread::_has_terminated = false; 33.35 -int ConcurrentGCThread::_CGC_flag = CGC_nil; 33.36 - 33.37 -SuspendibleThreadSet ConcurrentGCThread::_sts; 33.38 - 33.39 -ConcurrentGCThread::ConcurrentGCThread() { 33.40 - _sts.initialize(); 33.41 -}; 33.42 - 33.43 -void ConcurrentGCThread::stopWorldAndDo(VoidClosure* op) { 33.44 - MutexLockerEx x(Heap_lock, 33.45 - Mutex::_no_safepoint_check_flag); 33.46 - // warning("CGC: about to try stopping world"); 33.47 - SafepointSynchronize::begin(); 33.48 - // warning("CGC: successfully stopped world"); 33.49 - op->do_void(); 33.50 - SafepointSynchronize::end(); 33.51 - // warning("CGC: successfully restarted world"); 33.52 -} 33.53 - 33.54 -void ConcurrentGCThread::safepoint_synchronize() { 33.55 - _sts.suspend_all(); 33.56 -} 33.57 - 33.58 -void ConcurrentGCThread::safepoint_desynchronize() { 33.59 - _sts.resume_all(); 33.60 -} 33.61 - 33.62 -void ConcurrentGCThread::create_and_start() { 33.63 - if (os::create_thread(this, os::cgc_thread)) { 33.64 - // XXX: need to set this to low priority 33.65 - // unless "agressive mode" set; priority 33.66 - // should be just less than that of VMThread. 33.67 - os::set_priority(this, NearMaxPriority); 33.68 - if (!_should_terminate && !DisableStartThread) { 33.69 - os::start_thread(this); 33.70 - } 33.71 - } 33.72 -} 33.73 - 33.74 -void ConcurrentGCThread::initialize_in_thread() { 33.75 - this->record_stack_base_and_size(); 33.76 - this->initialize_thread_local_storage(); 33.77 - this->set_active_handles(JNIHandleBlock::allocate_block()); 33.78 - // From this time Thread::current() should be working. 33.79 - assert(this == Thread::current(), "just checking"); 33.80 -} 33.81 - 33.82 -void ConcurrentGCThread::wait_for_universe_init() { 33.83 - MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag); 33.84 - while (!is_init_completed() && !_should_terminate) { 33.85 - CGC_lock->wait(Mutex::_no_safepoint_check_flag, 200); 33.86 - } 33.87 -} 33.88 - 33.89 -void ConcurrentGCThread::terminate() { 33.90 - // Signal that it is terminated 33.91 - { 33.92 - MutexLockerEx mu(Terminator_lock, 33.93 - Mutex::_no_safepoint_check_flag); 33.94 - _has_terminated = true; 33.95 - Terminator_lock->notify(); 33.96 - } 33.97 - 33.98 - // Thread destructor usually does this.. 33.99 - ThreadLocalStorage::set_thread(NULL); 33.100 -} 33.101 - 33.102 - 33.103 -void SuspendibleThreadSet::initialize_work() { 33.104 - MutexLocker x(STS_init_lock); 33.105 - if (!_initialized) { 33.106 - _m = new Monitor(Mutex::leaf, 33.107 - "SuspendibleThreadSetLock", true); 33.108 - _async = 0; 33.109 - _async_stop = false; 33.110 - _async_stopped = 0; 33.111 - _initialized = true; 33.112 - } 33.113 -} 33.114 - 33.115 -void SuspendibleThreadSet::join() { 33.116 - initialize(); 33.117 - MutexLockerEx x(_m, Mutex::_no_safepoint_check_flag); 33.118 - while (_async_stop) _m->wait(Mutex::_no_safepoint_check_flag); 33.119 - _async++; 33.120 - assert(_async > 0, "Huh."); 33.121 -} 33.122 - 33.123 -void SuspendibleThreadSet::leave() { 33.124 - assert(_initialized, "Must be initialized."); 33.125 - MutexLockerEx x(_m, Mutex::_no_safepoint_check_flag); 33.126 - _async--; 33.127 - assert(_async >= 0, "Huh."); 33.128 - if (_async_stop) _m->notify_all(); 33.129 -} 33.130 - 33.131 -void SuspendibleThreadSet::yield(const char* id) { 33.132 - assert(_initialized, "Must be initialized."); 33.133 - if (_async_stop) { 33.134 - MutexLockerEx x(_m, Mutex::_no_safepoint_check_flag); 33.135 - if (_async_stop) { 33.136 - _async_stopped++; 33.137 - assert(_async_stopped > 0, "Huh."); 33.138 - if (_async_stopped == _async) { 33.139 - if (ConcGCYieldTimeout > 0) { 33.140 - double now = os::elapsedTime(); 33.141 - guarantee((now - _suspend_all_start) * 1000.0 < 33.142 - (double)ConcGCYieldTimeout, 33.143 - "Long delay; whodunit?"); 33.144 - } 33.145 - } 33.146 - _m->notify_all(); 33.147 - while (_async_stop) _m->wait(Mutex::_no_safepoint_check_flag); 33.148 - _async_stopped--; 33.149 - assert(_async >= 0, "Huh"); 33.150 - _m->notify_all(); 33.151 - } 33.152 - } 33.153 -} 33.154 - 33.155 -void SuspendibleThreadSet::suspend_all() { 33.156 - initialize(); // If necessary. 33.157 - if (ConcGCYieldTimeout > 0) { 33.158 - _suspend_all_start = os::elapsedTime(); 33.159 - } 33.160 - MutexLockerEx x(_m, Mutex::_no_safepoint_check_flag); 33.161 - assert(!_async_stop, "Only one at a time."); 33.162 - _async_stop = true; 33.163 - while (_async_stopped < _async) _m->wait(Mutex::_no_safepoint_check_flag); 33.164 -} 33.165 - 33.166 -void SuspendibleThreadSet::resume_all() { 33.167 - assert(_initialized, "Must be initialized."); 33.168 - MutexLockerEx x(_m, Mutex::_no_safepoint_check_flag); 33.169 - assert(_async_stopped == _async, "Huh."); 33.170 - _async_stop = false; 33.171 - _m->notify_all(); 33.172 -} 33.173 - 33.174 -static void _sltLoop(JavaThread* thread, TRAPS) { 33.175 - SurrogateLockerThread* slt = (SurrogateLockerThread*)thread; 33.176 - slt->loop(); 33.177 -} 33.178 - 33.179 -SurrogateLockerThread::SurrogateLockerThread() : 33.180 - JavaThread(&_sltLoop), 33.181 - _monitor(Mutex::nonleaf, "SLTMonitor"), 33.182 - _buffer(empty) 33.183 -{} 33.184 - 33.185 -SurrogateLockerThread* SurrogateLockerThread::make(TRAPS) { 33.186 - klassOop k = 33.187 - SystemDictionary::resolve_or_fail(vmSymbolHandles::java_lang_Thread(), 33.188 - true, CHECK_NULL); 33.189 - instanceKlassHandle klass (THREAD, k); 33.190 - instanceHandle thread_oop = klass->allocate_instance_handle(CHECK_NULL); 33.191 - 33.192 - const char thread_name[] = "Surrogate Locker Thread (CMS)"; 33.193 - Handle string = java_lang_String::create_from_str(thread_name, CHECK_NULL); 33.194 - 33.195 - // Initialize thread_oop to put it into the system threadGroup 33.196 - Handle thread_group (THREAD, Universe::system_thread_group()); 33.197 - JavaValue result(T_VOID); 33.198 - JavaCalls::call_special(&result, thread_oop, 33.199 - klass, 33.200 - vmSymbolHandles::object_initializer_name(), 33.201 - vmSymbolHandles::threadgroup_string_void_signature(), 33.202 - thread_group, 33.203 - string, 33.204 - CHECK_NULL); 33.205 - 33.206 - SurrogateLockerThread* res; 33.207 - { 33.208 - MutexLocker mu(Threads_lock); 33.209 - res = new SurrogateLockerThread(); 33.210 - 33.211 - // At this point it may be possible that no osthread was created for the 33.212 - // JavaThread due to lack of memory. We would have to throw an exception 33.213 - // in that case. However, since this must work and we do not allow 33.214 - // exceptions anyway, check and abort if this fails. 33.215 - if (res == NULL || res->osthread() == NULL) { 33.216 - vm_exit_during_initialization("java.lang.OutOfMemoryError", 33.217 - "unable to create new native thread"); 33.218 - } 33.219 - java_lang_Thread::set_thread(thread_oop(), res); 33.220 - java_lang_Thread::set_priority(thread_oop(), NearMaxPriority); 33.221 - java_lang_Thread::set_daemon(thread_oop()); 33.222 - 33.223 - res->set_threadObj(thread_oop()); 33.224 - Threads::add(res); 33.225 - Thread::start(res); 33.226 - } 33.227 - os::yield(); // This seems to help with initial start-up of SLT 33.228 - return res; 33.229 -} 33.230 - 33.231 -void SurrogateLockerThread::manipulatePLL(SLT_msg_type msg) { 33.232 - MutexLockerEx x(&_monitor, Mutex::_no_safepoint_check_flag); 33.233 - assert(_buffer == empty, "Should be empty"); 33.234 - assert(msg != empty, "empty message"); 33.235 - _buffer = msg; 33.236 - while (_buffer != empty) { 33.237 - _monitor.notify(); 33.238 - _monitor.wait(Mutex::_no_safepoint_check_flag); 33.239 - } 33.240 -} 33.241 - 33.242 -// ======= Surrogate Locker Thread ============= 33.243 - 33.244 -void SurrogateLockerThread::loop() { 33.245 - BasicLock pll_basic_lock; 33.246 - SLT_msg_type msg; 33.247 - debug_only(unsigned int owned = 0;) 33.248 - 33.249 - while (/* !isTerminated() */ 1) { 33.250 - { 33.251 - MutexLocker x(&_monitor); 33.252 - // Since we are a JavaThread, we can't be here at a safepoint. 33.253 - assert(!SafepointSynchronize::is_at_safepoint(), 33.254 - "SLT is a JavaThread"); 33.255 - // wait for msg buffer to become non-empty 33.256 - while (_buffer == empty) { 33.257 - _monitor.notify(); 33.258 - _monitor.wait(); 33.259 - } 33.260 - msg = _buffer; 33.261 - } 33.262 - switch(msg) { 33.263 - case acquirePLL: { 33.264 - instanceRefKlass::acquire_pending_list_lock(&pll_basic_lock); 33.265 - debug_only(owned++;) 33.266 - break; 33.267 - } 33.268 - case releaseAndNotifyPLL: { 33.269 - assert(owned > 0, "Don't have PLL"); 33.270 - instanceRefKlass::release_and_notify_pending_list_lock(&pll_basic_lock); 33.271 - debug_only(owned--;) 33.272 - break; 33.273 - } 33.274 - case empty: 33.275 - default: { 33.276 - guarantee(false,"Unexpected message in _buffer"); 33.277 - break; 33.278 - } 33.279 - } 33.280 - { 33.281 - MutexLocker x(&_monitor); 33.282 - // Since we are a JavaThread, we can't be here at a safepoint. 33.283 - assert(!SafepointSynchronize::is_at_safepoint(), 33.284 - "SLT is a JavaThread"); 33.285 - _buffer = empty; 33.286 - _monitor.notify(); 33.287 - } 33.288 - } 33.289 - assert(!_monitor.owned_by_self(), "Should unlock before exit."); 33.290 -} 33.291 - 33.292 - 33.293 -// ===== STS Access From Outside CGCT ===== 33.294 - 33.295 -void ConcurrentGCThread::stsYield(const char* id) { 33.296 - assert( Thread::current()->is_ConcurrentGC_thread(), 33.297 - "only a conc GC thread can call this" ); 33.298 - _sts.yield(id); 33.299 -} 33.300 - 33.301 -bool ConcurrentGCThread::stsShouldYield() { 33.302 - assert( Thread::current()->is_ConcurrentGC_thread(), 33.303 - "only a conc GC thread can call this" ); 33.304 - return _sts.should_yield(); 33.305 -} 33.306 - 33.307 -void ConcurrentGCThread::stsJoin() { 33.308 - assert( Thread::current()->is_ConcurrentGC_thread(), 33.309 - "only a conc GC thread can call this" ); 33.310 - _sts.join(); 33.311 -} 33.312 - 33.313 -void ConcurrentGCThread::stsLeave() { 33.314 - assert( Thread::current()->is_ConcurrentGC_thread(), 33.315 - "only a conc GC thread can call this" ); 33.316 - _sts.leave(); 33.317 -}
34.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentGCThread.hpp Thu Nov 20 11:39:38 2008 -0800 34.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 34.3 @@ -1,167 +0,0 @@ 34.4 -/* 34.5 - * Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. 34.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 34.7 - * 34.8 - * This code is free software; you can redistribute it and/or modify it 34.9 - * under the terms of the GNU General Public License version 2 only, as 34.10 - * published by the Free Software Foundation. 34.11 - * 34.12 - * This code is distributed in the hope that it will be useful, but WITHOUT 34.13 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 34.14 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 34.15 - * version 2 for more details (a copy is included in the LICENSE file that 34.16 - * accompanied this code). 34.17 - * 34.18 - * You should have received a copy of the GNU General Public License version 34.19 - * 2 along with this work; if not, write to the Free Software Foundation, 34.20 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 34.21 - * 34.22 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 34.23 - * CA 95054 USA or visit www.sun.com if you need additional information or 34.24 - * have any questions. 34.25 - * 34.26 - */ 34.27 - 34.28 -class VoidClosure; 34.29 - 34.30 -// A SuspendibleThreadSet is (obviously) a set of threads that can be 34.31 -// suspended. A thread can join and later leave the set, and periodically 34.32 -// yield. If some thread (not in the set) requests, via suspend_all, that 34.33 -// the threads be suspended, then the requesting thread is blocked until 34.34 -// all the threads in the set have yielded or left the set. (Threads may 34.35 -// not enter the set when an attempted suspension is in progress.) The 34.36 -// suspending thread later calls resume_all, allowing the suspended threads 34.37 -// to continue. 34.38 - 34.39 -class SuspendibleThreadSet { 34.40 - Monitor* _m; 34.41 - int _async; 34.42 - bool _async_stop; 34.43 - int _async_stopped; 34.44 - bool _initialized; 34.45 - double _suspend_all_start; 34.46 - 34.47 - void initialize_work(); 34.48 - 34.49 - public: 34.50 - SuspendibleThreadSet() : _initialized(false) {} 34.51 - 34.52 - // Add the current thread to the set. May block if a suspension 34.53 - // is in progress. 34.54 - void join(); 34.55 - // Removes the current thread from the set. 34.56 - void leave(); 34.57 - // Returns "true" iff an suspension is in progress. 34.58 - bool should_yield() { return _async_stop; } 34.59 - // Suspends the current thread if a suspension is in progress (for 34.60 - // the duration of the suspension.) 34.61 - void yield(const char* id); 34.62 - // Return when all threads in the set are suspended. 34.63 - void suspend_all(); 34.64 - // Allow suspended threads to resume. 34.65 - void resume_all(); 34.66 - // Redundant initializations okay. 34.67 - void initialize() { 34.68 - // Double-check dirty read idiom. 34.69 - if (!_initialized) initialize_work(); 34.70 - } 34.71 -}; 34.72 - 34.73 - 34.74 -class ConcurrentGCThread: public NamedThread { 34.75 - friend class VMStructs; 34.76 - 34.77 -protected: 34.78 - static bool _should_terminate; 34.79 - static bool _has_terminated; 34.80 - 34.81 - enum CGC_flag_type { 34.82 - CGC_nil = 0x0, 34.83 - CGC_dont_suspend = 0x1, 34.84 - CGC_CGC_safepoint = 0x2, 34.85 - CGC_VM_safepoint = 0x4 34.86 - }; 34.87 - 34.88 - static int _CGC_flag; 34.89 - 34.90 - static bool CGC_flag_is_set(int b) { return (_CGC_flag & b) != 0; } 34.91 - static int set_CGC_flag(int b) { return _CGC_flag |= b; } 34.92 - static int reset_CGC_flag(int b) { return _CGC_flag &= ~b; } 34.93 - 34.94 - void stopWorldAndDo(VoidClosure* op); 34.95 - 34.96 - // All instances share this one set. 34.97 - static SuspendibleThreadSet _sts; 34.98 - 34.99 - // Create and start the thread (setting it's priority high.) 34.100 - void create_and_start(); 34.101 - 34.102 - // Do initialization steps in the thread: record stack base and size, 34.103 - // init thread local storage, set JNI handle block. 34.104 - void initialize_in_thread(); 34.105 - 34.106 - // Wait until Universe::is_fully_initialized(); 34.107 - void wait_for_universe_init(); 34.108 - 34.109 - // Record that the current thread is terminating, and will do more 34.110 - // concurrent work. 34.111 - void terminate(); 34.112 - 34.113 -public: 34.114 - // Constructor 34.115 - 34.116 - ConcurrentGCThread(); 34.117 - ~ConcurrentGCThread() {} // Exists to call NamedThread destructor. 34.118 - 34.119 - // Tester 34.120 - bool is_ConcurrentGC_thread() const { return true; } 34.121 - 34.122 - static void safepoint_synchronize(); 34.123 - static void safepoint_desynchronize(); 34.124 - 34.125 - // All overridings should probably do _sts::yield, but we allow 34.126 - // overriding for distinguished debugging messages. Default is to do 34.127 - // nothing. 34.128 - virtual void yield() {} 34.129 - 34.130 - bool should_yield() { return _sts.should_yield(); } 34.131 - 34.132 - // they are prefixed by sts since there are already yield() and 34.133 - // should_yield() (non-static) methods in this class and it was an 34.134 - // easy way to differentiate them. 34.135 - static void stsYield(const char* id); 34.136 - static bool stsShouldYield(); 34.137 - static void stsJoin(); 34.138 - static void stsLeave(); 34.139 - 34.140 -}; 34.141 - 34.142 -// The SurrogateLockerThread is used by concurrent GC threads for 34.143 -// manipulating Java monitors, in particular, currently for 34.144 -// manipulating the pending_list_lock. XXX 34.145 -class SurrogateLockerThread: public JavaThread { 34.146 - friend class VMStructs; 34.147 - public: 34.148 - enum SLT_msg_type { 34.149 - empty = 0, // no message 34.150 - acquirePLL, // acquire pending list lock 34.151 - releaseAndNotifyPLL // notify and release pending list lock 34.152 - }; 34.153 - private: 34.154 - // the following are shared with the CMSThread 34.155 - SLT_msg_type _buffer; // communication buffer 34.156 - Monitor _monitor; // monitor controlling buffer 34.157 - BasicLock _basicLock; // used for PLL locking 34.158 - 34.159 - public: 34.160 - static SurrogateLockerThread* make(TRAPS); 34.161 - 34.162 - SurrogateLockerThread(); 34.163 - 34.164 - bool is_hidden_from_external_view() const { return true; } 34.165 - 34.166 - void loop(); // main method 34.167 - 34.168 - void manipulatePLL(SLT_msg_type msg); 34.169 - 34.170 -};
35.1 --- a/src/share/vm/gc_implementation/g1/ptrQueue.cpp Thu Nov 20 11:39:38 2008 -0800 35.2 +++ b/src/share/vm/gc_implementation/g1/ptrQueue.cpp Fri Nov 21 16:11:03 2008 -0800 35.3 @@ -30,7 +30,7 @@ 35.4 _perm(perm), _lock(NULL) 35.5 {} 35.6 35.7 -PtrQueue::~PtrQueue() { 35.8 +void PtrQueue::flush() { 35.9 if (!_perm && _buf != NULL) { 35.10 if (_index == _sz) { 35.11 // No work to do. 35.12 @@ -41,8 +41,9 @@ 35.13 _buf[byte_index_to_index((int)i)] = NULL; 35.14 } 35.15 qset()->enqueue_complete_buffer(_buf); 35.16 - _buf = NULL; 35.17 } 35.18 + _buf = NULL; 35.19 + _index = 0; 35.20 } 35.21 } 35.22
36.1 --- a/src/share/vm/gc_implementation/g1/ptrQueue.hpp Thu Nov 20 11:39:38 2008 -0800 36.2 +++ b/src/share/vm/gc_implementation/g1/ptrQueue.hpp Fri Nov 21 16:11:03 2008 -0800 36.3 @@ -62,7 +62,9 @@ 36.4 // given PtrQueueSet. 36.5 PtrQueue(PtrQueueSet*, bool perm = false); 36.6 // Release any contained resources. 36.7 - ~PtrQueue(); 36.8 + void flush(); 36.9 + // Calls flush() when destroyed. 36.10 + ~PtrQueue() { flush(); } 36.11 36.12 // Associate a lock with a ptr queue. 36.13 void set_lock(Mutex* lock) { _lock = lock; }
37.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp Thu Nov 20 11:39:38 2008 -0800 37.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp Fri Nov 21 16:11:03 2008 -0800 37.3 @@ -90,10 +90,10 @@ 37.4 */ 37.5 bool skip_dead = ((PSMarkSweep::total_invocations() % MarkSweepAlwaysCompactCount) != 0); 37.6 37.7 - ssize_t allowed_deadspace = 0; 37.8 + size_t allowed_deadspace = 0; 37.9 if (skip_dead) { 37.10 - int ratio = allowed_dead_ratio(); 37.11 - allowed_deadspace = (space()->capacity_in_bytes() * ratio / 100) / HeapWordSize; 37.12 + const size_t ratio = allowed_dead_ratio(); 37.13 + allowed_deadspace = space()->capacity_in_words() * ratio / 100; 37.14 } 37.15 37.16 // Fetch the current destination decorator 37.17 @@ -271,10 +271,10 @@ 37.18 dest->set_compaction_top(compact_top); 37.19 } 37.20 37.21 -bool PSMarkSweepDecorator::insert_deadspace(ssize_t& allowed_deadspace_words, 37.22 - HeapWord* q, size_t deadlength) { 37.23 - allowed_deadspace_words -= deadlength; 37.24 - if (allowed_deadspace_words >= 0) { 37.25 +bool PSMarkSweepDecorator::insert_deadspace(size_t& allowed_deadspace_words, 37.26 + HeapWord* q, size_t deadlength) { 37.27 + if (allowed_deadspace_words >= deadlength) { 37.28 + allowed_deadspace_words -= deadlength; 37.29 oop(q)->set_mark(markOopDesc::prototype()->set_marked()); 37.30 const size_t aligned_min_int_array_size = 37.31 align_object_size(typeArrayOopDesc::header_size(T_INT));
38.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp Thu Nov 20 11:39:38 2008 -0800 38.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.hpp Fri Nov 21 16:11:03 2008 -0800 38.3 @@ -39,14 +39,16 @@ 38.4 HeapWord* _first_dead; 38.5 HeapWord* _end_of_live; 38.6 HeapWord* _compaction_top; 38.7 - unsigned int _allowed_dead_ratio; 38.8 + size_t _allowed_dead_ratio; 38.9 38.10 - bool insert_deadspace(ssize_t& allowed_deadspace_words, HeapWord* q, size_t word_len); 38.11 + bool insert_deadspace(size_t& allowed_deadspace_words, HeapWord* q, 38.12 + size_t word_len); 38.13 38.14 public: 38.15 PSMarkSweepDecorator(MutableSpace* space, ObjectStartArray* start_array, 38.16 - unsigned int allowed_dead_ratio) : 38.17 - _space(space), _start_array(start_array), _allowed_dead_ratio(allowed_dead_ratio) { } 38.18 + size_t allowed_dead_ratio) : 38.19 + _space(space), _start_array(start_array), 38.20 + _allowed_dead_ratio(allowed_dead_ratio) { } 38.21 38.22 // During a compacting collection, we need to collapse objects into 38.23 // spaces in a given order. We want to fill space A, space B, and so 38.24 @@ -57,14 +59,14 @@ 38.25 static PSMarkSweepDecorator* destination_decorator(); 38.26 38.27 // Accessors 38.28 - MutableSpace* space() { return _space; } 38.29 - ObjectStartArray* start_array() { return _start_array; } 38.30 + MutableSpace* space() { return _space; } 38.31 + ObjectStartArray* start_array() { return _start_array; } 38.32 38.33 - HeapWord* compaction_top() { return _compaction_top; } 38.34 - void set_compaction_top(HeapWord* value) { _compaction_top = value; } 38.35 + HeapWord* compaction_top() { return _compaction_top; } 38.36 + void set_compaction_top(HeapWord* value) { _compaction_top = value; } 38.37 38.38 - unsigned int allowed_dead_ratio() { return _allowed_dead_ratio; } 38.39 - void set_allowed_dead_ratio(unsigned int value) { _allowed_dead_ratio = value; } 38.40 + size_t allowed_dead_ratio() { return _allowed_dead_ratio; } 38.41 + void set_allowed_dead_ratio(size_t value) { _allowed_dead_ratio = value; } 38.42 38.43 // Work methods 38.44 void adjust_pointers();
39.1 --- a/src/share/vm/includeDB_gc_parallel Thu Nov 20 11:39:38 2008 -0800 39.2 +++ b/src/share/vm/includeDB_gc_parallel Fri Nov 21 16:11:03 2008 -0800 39.3 @@ -30,6 +30,12 @@ 39.4 39.5 compiledICHolderKlass.cpp oop.pcgc.inline.hpp 39.6 39.7 +constantPoolKlass.cpp cardTableRS.hpp 39.8 +constantPoolKlass.cpp oop.pcgc.inline.hpp 39.9 +constantPoolKlass.cpp psPromotionManager.inline.hpp 39.10 +constantPoolKlass.cpp psScavenge.inline.hpp 39.11 +constantPoolKlass.cpp parOopClosures.inline.hpp 39.12 + 39.13 genCollectedHeap.cpp concurrentMarkSweepThread.hpp 39.14 genCollectedHeap.cpp vmCMSOperations.hpp 39.15
40.1 --- a/src/share/vm/memory/space.cpp Thu Nov 20 11:39:38 2008 -0800 40.2 +++ b/src/share/vm/memory/space.cpp Fri Nov 21 16:11:03 2008 -0800 40.3 @@ -997,11 +997,11 @@ 40.4 } 40.5 40.6 40.7 -int TenuredSpace::allowed_dead_ratio() const { 40.8 +size_t TenuredSpace::allowed_dead_ratio() const { 40.9 return MarkSweepDeadRatio; 40.10 } 40.11 40.12 40.13 -int ContigPermSpace::allowed_dead_ratio() const { 40.14 +size_t ContigPermSpace::allowed_dead_ratio() const { 40.15 return PermMarkSweepDeadRatio; 40.16 }
41.1 --- a/src/share/vm/memory/space.hpp Thu Nov 20 11:39:38 2008 -0800 41.2 +++ b/src/share/vm/memory/space.hpp Fri Nov 21 16:11:03 2008 -0800 41.3 @@ -421,7 +421,7 @@ 41.4 41.5 // The maximum percentage of objects that can be dead in the compacted 41.6 // live part of a compacted space ("deadwood" support.) 41.7 - virtual int allowed_dead_ratio() const { return 0; }; 41.8 + virtual size_t allowed_dead_ratio() const { return 0; }; 41.9 41.10 // Some contiguous spaces may maintain some data structures that should 41.11 // be updated whenever an allocation crosses a boundary. This function 41.12 @@ -507,7 +507,7 @@ 41.13 \ 41.14 size_t allowed_deadspace = 0; \ 41.15 if (skip_dead) { \ 41.16 - int ratio = allowed_dead_ratio(); \ 41.17 + const size_t ratio = allowed_dead_ratio(); \ 41.18 allowed_deadspace = (capacity() * ratio / 100) / HeapWordSize; \ 41.19 } \ 41.20 \ 41.21 @@ -1079,7 +1079,7 @@ 41.22 friend class VMStructs; 41.23 protected: 41.24 // Mark sweep support 41.25 - int allowed_dead_ratio() const; 41.26 + size_t allowed_dead_ratio() const; 41.27 public: 41.28 // Constructor 41.29 TenuredSpace(BlockOffsetSharedArray* sharedOffsetArray, 41.30 @@ -1094,7 +1094,7 @@ 41.31 friend class VMStructs; 41.32 protected: 41.33 // Mark sweep support 41.34 - int allowed_dead_ratio() const; 41.35 + size_t allowed_dead_ratio() const; 41.36 public: 41.37 // Constructor 41.38 ContigPermSpace(BlockOffsetSharedArray* sharedOffsetArray, MemRegion mr) :
42.1 --- a/src/share/vm/memory/tenuredGeneration.hpp Thu Nov 20 11:39:38 2008 -0800 42.2 +++ b/src/share/vm/memory/tenuredGeneration.hpp Fri Nov 21 16:11:03 2008 -0800 42.3 @@ -73,7 +73,6 @@ 42.4 42.5 // Mark sweep support 42.6 void compute_new_size(); 42.7 - int allowed_dead_ratio() const; 42.8 42.9 virtual void gc_prologue(bool full); 42.10 virtual void gc_epilogue(bool full);
43.1 --- a/src/share/vm/oops/constantPoolKlass.cpp Thu Nov 20 11:39:38 2008 -0800 43.2 +++ b/src/share/vm/oops/constantPoolKlass.cpp Fri Nov 21 16:11:03 2008 -0800 43.3 @@ -35,6 +35,7 @@ 43.4 c->set_tags(NULL); 43.5 c->set_cache(NULL); 43.6 c->set_pool_holder(NULL); 43.7 + c->set_flags(0); 43.8 // only set to non-zero if constant pool is merged by RedefineClasses 43.9 c->set_orig_length(0); 43.10 // all fields are initialized; needed for GC 43.11 @@ -261,10 +262,32 @@ 43.12 43.13 void constantPoolKlass::oop_copy_contents(PSPromotionManager* pm, oop obj) { 43.14 assert(obj->is_constantPool(), "should be constant pool"); 43.15 + constantPoolOop cp = (constantPoolOop) obj; 43.16 + if (AnonymousClasses && cp->has_pseudo_string() && cp->tags() != NULL) { 43.17 + oop* base = (oop*)cp->base(); 43.18 + for (int i = 0; i < cp->length(); ++i, ++base) { 43.19 + if (cp->tag_at(i).is_string()) { 43.20 + if (PSScavenge::should_scavenge(base)) { 43.21 + pm->claim_or_forward_breadth(base); 43.22 + } 43.23 + } 43.24 + } 43.25 + } 43.26 } 43.27 43.28 void constantPoolKlass::oop_push_contents(PSPromotionManager* pm, oop obj) { 43.29 assert(obj->is_constantPool(), "should be constant pool"); 43.30 + constantPoolOop cp = (constantPoolOop) obj; 43.31 + if (AnonymousClasses && cp->has_pseudo_string() && cp->tags() != NULL) { 43.32 + oop* base = (oop*)cp->base(); 43.33 + for (int i = 0; i < cp->length(); ++i, ++base) { 43.34 + if (cp->tag_at(i).is_string()) { 43.35 + if (PSScavenge::should_scavenge(base)) { 43.36 + pm->claim_or_forward_depth(base); 43.37 + } 43.38 + } 43.39 + } 43.40 + } 43.41 } 43.42 #endif // SERIALGC 43.43 43.44 @@ -278,6 +301,11 @@ 43.45 assert(obj->is_constantPool(), "must be constantPool"); 43.46 Klass::oop_print_on(obj, st); 43.47 constantPoolOop cp = constantPoolOop(obj); 43.48 + if (cp->flags() != 0) { 43.49 + st->print(" - flags : 0x%x", cp->flags()); 43.50 + if (cp->has_pseudo_string()) st->print(" has_pseudo_string"); 43.51 + st->cr(); 43.52 + } 43.53 43.54 // Temp. remove cache so we can do lookups with original indicies. 43.55 constantPoolCacheHandle cache (THREAD, cp->cache()); 43.56 @@ -302,7 +330,11 @@ 43.57 break; 43.58 case JVM_CONSTANT_UnresolvedString : 43.59 case JVM_CONSTANT_String : 43.60 - anObj = cp->string_at(index, CATCH); 43.61 + if (cp->is_pseudo_string_at(index)) { 43.62 + anObj = cp->pseudo_string_at(index); 43.63 + } else { 43.64 + anObj = cp->string_at(index, CATCH); 43.65 + } 43.66 anObj->print_value_on(st); 43.67 st->print(" {0x%lx}", (address)anObj); 43.68 break; 43.69 @@ -382,8 +414,12 @@ 43.70 "should be symbol or instance"); 43.71 } 43.72 if (cp->tag_at(i).is_string()) { 43.73 - guarantee((*base)->is_perm(), "should be in permspace"); 43.74 - guarantee((*base)->is_instance(), "should be instance"); 43.75 + if (!cp->has_pseudo_string()) { 43.76 + guarantee((*base)->is_perm(), "should be in permspace"); 43.77 + guarantee((*base)->is_instance(), "should be instance"); 43.78 + } else { 43.79 + // can be non-perm, can be non-instance (array) 43.80 + } 43.81 } 43.82 base++; 43.83 }
44.1 --- a/src/share/vm/oops/constantPoolOop.cpp Thu Nov 20 11:39:38 2008 -0800 44.2 +++ b/src/share/vm/oops/constantPoolOop.cpp Fri Nov 21 16:11:03 2008 -0800 44.3 @@ -25,6 +25,18 @@ 44.4 # include "incls/_precompiled.incl" 44.5 # include "incls/_constantPoolOop.cpp.incl" 44.6 44.7 +void constantPoolOopDesc::set_flag_at(FlagBit fb) { 44.8 + const int MAX_STATE_CHANGES = 2; 44.9 + for (int i = MAX_STATE_CHANGES + 10; i > 0; i--) { 44.10 + int oflags = _flags; 44.11 + int nflags = oflags | (1 << (int)fb); 44.12 + if (Atomic::cmpxchg(nflags, &_flags, oflags) == oflags) 44.13 + return; 44.14 + } 44.15 + assert(false, "failed to cmpxchg flags"); 44.16 + _flags |= (1 << (int)fb); // better than nothing 44.17 +} 44.18 + 44.19 klassOop constantPoolOopDesc::klass_at_impl(constantPoolHandle this_oop, int which, TRAPS) { 44.20 // A resolved constantPool entry will contain a klassOop, otherwise a symbolOop. 44.21 // It is not safe to rely on the tag bit's here, since we don't have a lock, and the entry and 44.22 @@ -333,8 +345,10 @@ 44.23 oop entry = *(obj_at_addr(which)); 44.24 if (entry->is_symbol()) { 44.25 return ((symbolOop)entry)->as_C_string(); 44.26 + } else if (java_lang_String::is_instance(entry)) { 44.27 + return java_lang_String::as_utf8_string(entry); 44.28 } else { 44.29 - return java_lang_String::as_utf8_string(entry); 44.30 + return (char*)"<pseudo-string>"; 44.31 } 44.32 } 44.33 44.34 @@ -385,6 +399,19 @@ 44.35 } 44.36 44.37 44.38 +bool constantPoolOopDesc::is_pseudo_string_at(int which) { 44.39 + oop entry = *(obj_at_addr(which)); 44.40 + if (entry->is_symbol()) 44.41 + // Not yet resolved, but it will resolve to a string. 44.42 + return false; 44.43 + else if (java_lang_String::is_instance(entry)) 44.44 + return false; // actually, it might be a non-interned or non-perm string 44.45 + else 44.46 + // truly pseudo 44.47 + return true; 44.48 +} 44.49 + 44.50 + 44.51 bool constantPoolOopDesc::klass_name_at_matches(instanceKlassHandle k, 44.52 int which) { 44.53 // Names are interned, so we can compare symbolOops directly
45.1 --- a/src/share/vm/oops/constantPoolOop.hpp Thu Nov 20 11:39:38 2008 -0800 45.2 +++ b/src/share/vm/oops/constantPoolOop.hpp Fri Nov 21 16:11:03 2008 -0800 45.3 @@ -41,6 +41,7 @@ 45.4 typeArrayOop _tags; // the tag array describing the constant pool's contents 45.5 constantPoolCacheOop _cache; // the cache holding interpreter runtime information 45.6 klassOop _pool_holder; // the corresponding class 45.7 + int _flags; // a few header bits to describe contents for GC 45.8 int _length; // number of elements in the array 45.9 // only set to non-zero if constant pool is merged by RedefineClasses 45.10 int _orig_length; 45.11 @@ -49,6 +50,16 @@ 45.12 void tag_at_put(int which, jbyte t) { tags()->byte_at_put(which, t); } 45.13 void release_tag_at_put(int which, jbyte t) { tags()->release_byte_at_put(which, t); } 45.14 45.15 + enum FlagBit { 45.16 + FB_has_pseudo_string = 2 45.17 + }; 45.18 + 45.19 + int flags() const { return _flags; } 45.20 + void set_flags(int f) { _flags = f; } 45.21 + bool flag_at(FlagBit fb) const { return (_flags & (1 << (int)fb)) != 0; } 45.22 + void set_flag_at(FlagBit fb); 45.23 + // no clear_flag_at function; they only increase 45.24 + 45.25 private: 45.26 intptr_t* base() const { return (intptr_t*) (((char*) this) + sizeof(constantPoolOopDesc)); } 45.27 oop* tags_addr() { return (oop*)&_tags; } 45.28 @@ -82,6 +93,9 @@ 45.29 public: 45.30 typeArrayOop tags() const { return _tags; } 45.31 45.32 + bool has_pseudo_string() const { return flag_at(FB_has_pseudo_string); } 45.33 + void set_pseudo_string() { set_flag_at(FB_has_pseudo_string); } 45.34 + 45.35 // Klass holding pool 45.36 klassOop pool_holder() const { return _pool_holder; } 45.37 void set_pool_holder(klassOop k) { oop_store_without_check((oop*)&_pool_holder, (oop) k); } 45.38 @@ -272,6 +286,27 @@ 45.39 return string_at_impl(h_this, which, CHECK_NULL); 45.40 } 45.41 45.42 + // A "pseudo-string" is an non-string oop that has found is way into 45.43 + // a String entry. 45.44 + // Under AnonymousClasses this can happen if the user patches a live 45.45 + // object into a CONSTANT_String entry of an anonymous class. 45.46 + // Method oops internally created for method handles may also 45.47 + // use pseudo-strings to link themselves to related metaobjects. 45.48 + 45.49 + bool is_pseudo_string_at(int which); 45.50 + 45.51 + oop pseudo_string_at(int which) { 45.52 + assert(tag_at(which).is_string(), "Corrupted constant pool"); 45.53 + return *obj_at_addr(which); 45.54 + } 45.55 + 45.56 + void pseudo_string_at_put(int which, oop x) { 45.57 + assert(AnonymousClasses, ""); 45.58 + set_pseudo_string(); // mark header 45.59 + assert(tag_at(which).is_string() || tag_at(which).is_unresolved_string(), "Corrupted constant pool"); 45.60 + string_at_put(which, x); // this works just fine 45.61 + } 45.62 + 45.63 // only called when we are sure a string entry is already resolved (via an 45.64 // earlier string_at call. 45.65 oop resolved_string_at(int which) { 45.66 @@ -293,6 +328,7 @@ 45.67 // UTF8 char* representation was chosen to avoid conversion of 45.68 // java_lang_Strings at resolved entries into symbolOops 45.69 // or vice versa. 45.70 + // Caller is responsible for checking for pseudo-strings. 45.71 char* string_at_noresolve(int which); 45.72 45.73 jint name_and_type_at(int which) {
46.1 --- a/src/share/vm/oops/instanceKlass.hpp Thu Nov 20 11:39:38 2008 -0800 46.2 +++ b/src/share/vm/oops/instanceKlass.hpp Fri Nov 21 16:11:03 2008 -0800 46.3 @@ -147,6 +147,10 @@ 46.4 oop _class_loader; 46.5 // Protection domain. 46.6 oop _protection_domain; 46.7 + // Host class, which grants its access privileges to this class also. 46.8 + // This is only non-null for an anonymous class (AnonymousClasses enabled). 46.9 + // The host class is either named, or a previously loaded anonymous class. 46.10 + klassOop _host_klass; 46.11 // Class signers. 46.12 objArrayOop _signers; 46.13 // Name of source file containing this klass, NULL if not specified. 46.14 @@ -375,6 +379,11 @@ 46.15 oop protection_domain() { return _protection_domain; } 46.16 void set_protection_domain(oop pd) { oop_store((oop*) &_protection_domain, pd); } 46.17 46.18 + // host class 46.19 + oop host_klass() const { return _host_klass; } 46.20 + void set_host_klass(oop host) { oop_store((oop*) &_host_klass, host); } 46.21 + bool is_anonymous() const { return _host_klass != NULL; } 46.22 + 46.23 // signers 46.24 objArrayOop signers() const { return _signers; } 46.25 void set_signers(objArrayOop s) { oop_store((oop*) &_signers, oop(s)); } 46.26 @@ -709,6 +718,7 @@ 46.27 oop* adr_constants() const { return (oop*)&this->_constants;} 46.28 oop* adr_class_loader() const { return (oop*)&this->_class_loader;} 46.29 oop* adr_protection_domain() const { return (oop*)&this->_protection_domain;} 46.30 + oop* adr_host_klass() const { return (oop*)&this->_host_klass;} 46.31 oop* adr_signers() const { return (oop*)&this->_signers;} 46.32 oop* adr_source_file_name() const { return (oop*)&this->_source_file_name;} 46.33 oop* adr_source_debug_extension() const { return (oop*)&this->_source_debug_extension;}
47.1 --- a/src/share/vm/oops/instanceKlassKlass.cpp Thu Nov 20 11:39:38 2008 -0800 47.2 +++ b/src/share/vm/oops/instanceKlassKlass.cpp Fri Nov 21 16:11:03 2008 -0800 47.3 @@ -81,6 +81,7 @@ 47.4 MarkSweep::mark_and_push(ik->adr_source_debug_extension()); 47.5 MarkSweep::mark_and_push(ik->adr_inner_classes()); 47.6 MarkSweep::mark_and_push(ik->adr_protection_domain()); 47.7 + MarkSweep::mark_and_push(ik->adr_host_klass()); 47.8 MarkSweep::mark_and_push(ik->adr_signers()); 47.9 MarkSweep::mark_and_push(ik->adr_generic_signature()); 47.10 MarkSweep::mark_and_push(ik->adr_class_annotations()); 47.11 @@ -120,6 +121,7 @@ 47.12 PSParallelCompact::mark_and_push(cm, ik->adr_source_debug_extension()); 47.13 PSParallelCompact::mark_and_push(cm, ik->adr_inner_classes()); 47.14 PSParallelCompact::mark_and_push(cm, ik->adr_protection_domain()); 47.15 + PSParallelCompact::mark_and_push(cm, ik->adr_host_klass()); 47.16 PSParallelCompact::mark_and_push(cm, ik->adr_signers()); 47.17 PSParallelCompact::mark_and_push(cm, ik->adr_generic_signature()); 47.18 PSParallelCompact::mark_and_push(cm, ik->adr_class_annotations()); 47.19 @@ -159,6 +161,7 @@ 47.20 blk->do_oop(ik->adr_constants()); 47.21 blk->do_oop(ik->adr_class_loader()); 47.22 blk->do_oop(ik->adr_protection_domain()); 47.23 + blk->do_oop(ik->adr_host_klass()); 47.24 blk->do_oop(ik->adr_signers()); 47.25 blk->do_oop(ik->adr_source_file_name()); 47.26 blk->do_oop(ik->adr_source_debug_extension()); 47.27 @@ -211,6 +214,8 @@ 47.28 if (mr.contains(adr)) blk->do_oop(adr); 47.29 adr = ik->adr_protection_domain(); 47.30 if (mr.contains(adr)) blk->do_oop(adr); 47.31 + adr = ik->adr_host_klass(); 47.32 + if (mr.contains(adr)) blk->do_oop(adr); 47.33 adr = ik->adr_signers(); 47.34 if (mr.contains(adr)) blk->do_oop(adr); 47.35 adr = ik->adr_source_file_name(); 47.36 @@ -260,6 +265,7 @@ 47.37 MarkSweep::adjust_pointer(ik->adr_constants()); 47.38 MarkSweep::adjust_pointer(ik->adr_class_loader()); 47.39 MarkSweep::adjust_pointer(ik->adr_protection_domain()); 47.40 + MarkSweep::adjust_pointer(ik->adr_host_klass()); 47.41 MarkSweep::adjust_pointer(ik->adr_signers()); 47.42 MarkSweep::adjust_pointer(ik->adr_source_file_name()); 47.43 MarkSweep::adjust_pointer(ik->adr_source_debug_extension()); 47.44 @@ -295,6 +301,11 @@ 47.45 pm->claim_or_forward_breadth(pd_addr); 47.46 } 47.47 47.48 + oop* hk_addr = ik->adr_host_klass(); 47.49 + if (PSScavenge::should_scavenge(hk_addr)) { 47.50 + pm->claim_or_forward_breadth(hk_addr); 47.51 + } 47.52 + 47.53 oop* sg_addr = ik->adr_signers(); 47.54 if (PSScavenge::should_scavenge(sg_addr)) { 47.55 pm->claim_or_forward_breadth(sg_addr); 47.56 @@ -318,6 +329,11 @@ 47.57 pm->claim_or_forward_depth(pd_addr); 47.58 } 47.59 47.60 + oop* hk_addr = ik->adr_host_klass(); 47.61 + if (PSScavenge::should_scavenge(hk_addr)) { 47.62 + pm->claim_or_forward_depth(hk_addr); 47.63 + } 47.64 + 47.65 oop* sg_addr = ik->adr_signers(); 47.66 if (PSScavenge::should_scavenge(sg_addr)) { 47.67 pm->claim_or_forward_depth(sg_addr); 47.68 @@ -421,6 +437,7 @@ 47.69 ik->set_constants(NULL); 47.70 ik->set_class_loader(NULL); 47.71 ik->set_protection_domain(NULL); 47.72 + ik->set_host_klass(NULL); 47.73 ik->set_signers(NULL); 47.74 ik->set_source_file_name(NULL); 47.75 ik->set_source_debug_extension(NULL); 47.76 @@ -526,6 +543,7 @@ 47.77 st->print(" - constants: "); ik->constants()->print_value_on(st); st->cr(); 47.78 st->print(" - class loader: "); ik->class_loader()->print_value_on(st); st->cr(); 47.79 st->print(" - protection domain: "); ik->protection_domain()->print_value_on(st); st->cr(); 47.80 + st->print(" - host class: "); ik->host_klass()->print_value_on(st); st->cr(); 47.81 st->print(" - signers: "); ik->signers()->print_value_on(st); st->cr(); 47.82 if (ik->source_file_name() != NULL) { 47.83 st->print(" - source file: "); 47.84 @@ -626,7 +644,7 @@ 47.85 ik->_verify_count = Universe::verify_count(); 47.86 #endif 47.87 // Verify that klass is present in SystemDictionary 47.88 - if (ik->is_loaded()) { 47.89 + if (ik->is_loaded() && !ik->is_anonymous()) { 47.90 symbolHandle h_name (thread, ik->name()); 47.91 Handle h_loader (thread, ik->class_loader()); 47.92 Handle h_obj(thread, obj); 47.93 @@ -764,6 +782,9 @@ 47.94 if (ik->protection_domain() != NULL) { 47.95 guarantee(ik->protection_domain()->is_oop(), "should be oop"); 47.96 } 47.97 + if (ik->host_klass() != NULL) { 47.98 + guarantee(ik->host_klass()->is_oop(), "should be oop"); 47.99 + } 47.100 if (ik->signers() != NULL) { 47.101 guarantee(ik->signers()->is_objArray(), "should be obj array"); 47.102 }
48.1 --- a/src/share/vm/oops/klass.cpp Thu Nov 20 11:39:38 2008 -0800 48.2 +++ b/src/share/vm/oops/klass.cpp Fri Nov 21 16:11:03 2008 -0800 48.3 @@ -478,6 +478,24 @@ 48.4 48.5 48.6 const char* Klass::external_name() const { 48.7 + if (oop_is_instance()) { 48.8 + instanceKlass* ik = (instanceKlass*) this; 48.9 + if (ik->is_anonymous()) { 48.10 + assert(AnonymousClasses, ""); 48.11 + intptr_t hash = ik->java_mirror()->identity_hash(); 48.12 + char hash_buf[40]; 48.13 + sprintf(hash_buf, "/" UINTX_FORMAT, (uintx)hash); 48.14 + size_t hash_len = strlen(hash_buf); 48.15 + 48.16 + size_t result_len = name()->utf8_length(); 48.17 + char* result = NEW_RESOURCE_ARRAY(char, result_len + hash_len + 1); 48.18 + name()->as_klass_external_name(result, (int) result_len + 1); 48.19 + assert(strlen(result) == result_len, ""); 48.20 + strcpy(result + result_len, hash_buf); 48.21 + assert(strlen(result) == result_len + hash_len, ""); 48.22 + return result; 48.23 + } 48.24 + } 48.25 return name()->as_klass_external_name(); 48.26 } 48.27
49.1 --- a/src/share/vm/opto/c2_globals.hpp Thu Nov 20 11:39:38 2008 -0800 49.2 +++ b/src/share/vm/opto/c2_globals.hpp Fri Nov 21 16:11:03 2008 -0800 49.3 @@ -256,10 +256,10 @@ 49.4 develop(intx, PrintIdealGraphPort, 4444, \ 49.5 "Ideal graph printer to network port") \ 49.6 \ 49.7 - develop(ccstr, PrintIdealGraphAddress, "127.0.0.1", \ 49.8 + notproduct(ccstr, PrintIdealGraphAddress, "127.0.0.1", \ 49.9 "IP address to connect to visualizer") \ 49.10 \ 49.11 - develop(ccstr, PrintIdealGraphFile, NULL, \ 49.12 + notproduct(ccstr, PrintIdealGraphFile, NULL, \ 49.13 "File to dump ideal graph to. If set overrides the " \ 49.14 "use of the network") \ 49.15 \
50.1 --- a/src/share/vm/opto/macro.cpp Thu Nov 20 11:39:38 2008 -0800 50.2 +++ b/src/share/vm/opto/macro.cpp Fri Nov 21 16:11:03 2008 -0800 50.3 @@ -1673,7 +1673,6 @@ 50.4 if (klass_node == NULL) { 50.5 Node* k_adr = basic_plus_adr(obj, oopDesc::klass_offset_in_bytes()); 50.6 klass_node = transform_later( LoadKlassNode::make(_igvn, mem, k_adr, _igvn.type(k_adr)->is_ptr()) ); 50.7 - klass_node->init_req(0, ctrl); 50.8 } 50.9 Node *proto_node = make_load(ctrl, mem, klass_node, Klass::prototype_header_offset_in_bytes() + sizeof(oopDesc), TypeX_X, TypeX_X->basic_type()); 50.10
51.1 --- a/src/share/vm/opto/parse.hpp Thu Nov 20 11:39:38 2008 -0800 51.2 +++ b/src/share/vm/opto/parse.hpp Fri Nov 21 16:11:03 2008 -0800 51.3 @@ -175,7 +175,7 @@ 51.4 bool is_SEL_backedge(Block* pred) const{ return is_SEL_head() && pred->rpo() >= rpo(); } 51.5 bool is_invariant_local(uint i) const { 51.6 const JVMState* jvms = start_map()->jvms(); 51.7 - if (!jvms->is_loc(i)) return false; 51.8 + if (!jvms->is_loc(i) || flow()->outer()->has_irreducible_entry()) return false; 51.9 return flow()->is_invariant_local(i - jvms->locoff()); 51.10 } 51.11 bool can_elide_SEL_phi(uint i) const { assert(is_SEL_head(),""); return is_invariant_local(i); }
52.1 --- a/src/share/vm/prims/jvm.cpp Thu Nov 20 11:39:38 2008 -0800 52.2 +++ b/src/share/vm/prims/jvm.cpp Fri Nov 21 16:11:03 2008 -0800 52.3 @@ -744,6 +744,7 @@ 52.4 52.5 // common code for JVM_DefineClass() and JVM_DefineClassWithSource() 52.6 static jclass jvm_define_class_common(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len, jobject pd, const char *source, TRAPS) { 52.7 + if (source == NULL) source = "__JVM_DefineClass__"; 52.8 52.9 // Since exceptions can be thrown, class initialization can take place 52.10 // if name is NULL no check for class name in .class stream has to be made. 52.11 @@ -782,7 +783,7 @@ 52.12 JVM_ENTRY(jclass, JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len, jobject pd)) 52.13 JVMWrapper2("JVM_DefineClass %s", name); 52.14 52.15 - return jvm_define_class_common(env, name, loader, buf, len, pd, "__JVM_DefineClass__", THREAD); 52.16 + return jvm_define_class_common(env, name, loader, buf, len, pd, NULL, THREAD); 52.17 JVM_END 52.18 52.19
53.1 --- a/src/share/vm/prims/jvm.h Thu Nov 20 11:39:38 2008 -0800 53.2 +++ b/src/share/vm/prims/jvm.h Fri Nov 21 16:11:03 2008 -0800 53.3 @@ -422,6 +422,14 @@ 53.4 const jbyte *buf, jsize len, jobject pd, 53.5 const char *source); 53.6 53.7 +/* Define a class with a source (MLVM) */ 53.8 +JNIEXPORT jclass JNICALL 53.9 +JVM_DefineClassWithCP(JNIEnv *env, const char *name, jobject loader, 53.10 + const jbyte *buf, jsize len, jobject pd, 53.11 + const char *source, 53.12 + // same args as JVM_DefineClassWithSource to this point 53.13 + jobjectArray constants); 53.14 + 53.15 /* 53.16 * Reflection support functions 53.17 */
54.1 --- a/src/share/vm/prims/unsafe.cpp Thu Nov 20 11:39:38 2008 -0800 54.2 +++ b/src/share/vm/prims/unsafe.cpp Fri Nov 21 16:11:03 2008 -0800 54.3 @@ -837,6 +837,163 @@ 54.4 } 54.5 UNSAFE_END 54.6 54.7 +#define DAC_Args CLS"[B["OBJ 54.8 +// define a class but do not make it known to the class loader or system dictionary 54.9 +// - host_class: supplies context for linkage, access control, protection domain, and class loader 54.10 +// - data: bytes of a class file, a raw memory address (length gives the number of bytes) 54.11 +// - cp_patches: where non-null entries exist, they replace corresponding CP entries in data 54.12 + 54.13 +// When you load an anonymous class U, it works as if you changed its name just before loading, 54.14 +// to a name that you will never use again. Since the name is lost, no other class can directly 54.15 +// link to any member of U. Just after U is loaded, the only way to use it is reflectively, 54.16 +// through java.lang.Class methods like Class.newInstance. 54.17 + 54.18 +// Access checks for linkage sites within U continue to follow the same rules as for named classes. 54.19 +// The package of an anonymous class is given by the package qualifier on the name under which it was loaded. 54.20 +// An anonymous class also has special privileges to access any member of its host class. 54.21 +// This is the main reason why this loading operation is unsafe. The purpose of this is to 54.22 +// allow language implementations to simulate "open classes"; a host class in effect gets 54.23 +// new code when an anonymous class is loaded alongside it. A less convenient but more 54.24 +// standard way to do this is with reflection, which can also be set to ignore access 54.25 +// restrictions. 54.26 + 54.27 +// Access into an anonymous class is possible only through reflection. Therefore, there 54.28 +// are no special access rules for calling into an anonymous class. The relaxed access 54.29 +// rule for the host class is applied in the opposite direction: A host class reflectively 54.30 +// access one of its anonymous classes. 54.31 + 54.32 +// If you load the same bytecodes twice, you get two different classes. You can reload 54.33 +// the same bytecodes with or without varying CP patches. 54.34 + 54.35 +// By using the CP patching array, you can have a new anonymous class U2 refer to an older one U1. 54.36 +// The bytecodes for U2 should refer to U1 by a symbolic name (doesn't matter what the name is). 54.37 +// The CONSTANT_Class entry for that name can be patched to refer directly to U1. 54.38 + 54.39 +// This allows, for example, U2 to use U1 as a superclass or super-interface, or as 54.40 +// an outer class (so that U2 is an anonymous inner class of anonymous U1). 54.41 +// It is not possible for a named class, or an older anonymous class, to refer by 54.42 +// name (via its CP) to a newer anonymous class. 54.43 + 54.44 +// CP patching may also be used to modify (i.e., hack) the names of methods, classes, 54.45 +// or type descriptors used in the loaded anonymous class. 54.46 + 54.47 +// Finally, CP patching may be used to introduce "live" objects into the constant pool, 54.48 +// instead of "dead" strings. A compiled statement like println((Object)"hello") can 54.49 +// be changed to println(greeting), where greeting is an arbitrary object created before 54.50 +// the anonymous class is loaded. This is useful in dynamic languages, in which 54.51 +// various kinds of metaobjects must be introduced as constants into bytecode. 54.52 +// Note the cast (Object), which tells the verifier to expect an arbitrary object, 54.53 +// not just a literal string. For such ldc instructions, the verifier uses the 54.54 +// type Object instead of String, if the loaded constant is not in fact a String. 54.55 + 54.56 +static oop 54.57 +Unsafe_DefineAnonymousClass_impl(JNIEnv *env, 54.58 + jclass host_class, jbyteArray data, jobjectArray cp_patches_jh, 54.59 + HeapWord* *temp_alloc, 54.60 + TRAPS) { 54.61 + 54.62 + if (UsePerfData) { 54.63 + ClassLoader::unsafe_defineClassCallCounter()->inc(); 54.64 + } 54.65 + 54.66 + if (data == NULL) { 54.67 + THROW_0(vmSymbols::java_lang_NullPointerException()); 54.68 + } 54.69 + 54.70 + jint length = typeArrayOop(JNIHandles::resolve_non_null(data))->length(); 54.71 + jint word_length = (length + sizeof(HeapWord)-1) / sizeof(HeapWord); 54.72 + HeapWord* body = NEW_C_HEAP_ARRAY(HeapWord, word_length); 54.73 + if (body == NULL) { 54.74 + THROW_0(vmSymbols::java_lang_OutOfMemoryError()); 54.75 + } 54.76 + 54.77 + // caller responsible to free it: 54.78 + (*temp_alloc) = body; 54.79 + 54.80 + { 54.81 + jbyte* array_base = typeArrayOop(JNIHandles::resolve_non_null(data))->byte_at_addr(0); 54.82 + Copy::conjoint_words((HeapWord*) array_base, body, word_length); 54.83 + } 54.84 + 54.85 + u1* class_bytes = (u1*) body; 54.86 + int class_bytes_length = (int) length; 54.87 + if (class_bytes_length < 0) class_bytes_length = 0; 54.88 + if (class_bytes == NULL 54.89 + || host_class == NULL 54.90 + || length != class_bytes_length) 54.91 + THROW_0(vmSymbols::java_lang_IllegalArgumentException()); 54.92 + 54.93 + objArrayHandle cp_patches_h; 54.94 + if (cp_patches_jh != NULL) { 54.95 + oop p = JNIHandles::resolve_non_null(cp_patches_jh); 54.96 + if (!p->is_objArray()) 54.97 + THROW_0(vmSymbols::java_lang_IllegalArgumentException()); 54.98 + cp_patches_h = objArrayHandle(THREAD, (objArrayOop)p); 54.99 + } 54.100 + 54.101 + KlassHandle host_klass(THREAD, java_lang_Class::as_klassOop(JNIHandles::resolve_non_null(host_class))); 54.102 + const char* host_source = host_klass->external_name(); 54.103 + Handle host_loader(THREAD, host_klass->class_loader()); 54.104 + Handle host_domain(THREAD, host_klass->protection_domain()); 54.105 + 54.106 + GrowableArray<Handle>* cp_patches = NULL; 54.107 + if (cp_patches_h.not_null()) { 54.108 + int alen = cp_patches_h->length(); 54.109 + for (int i = alen-1; i >= 0; i--) { 54.110 + oop p = cp_patches_h->obj_at(i); 54.111 + if (p != NULL) { 54.112 + Handle patch(THREAD, p); 54.113 + if (cp_patches == NULL) 54.114 + cp_patches = new GrowableArray<Handle>(i+1, i+1, Handle()); 54.115 + cp_patches->at_put(i, patch); 54.116 + } 54.117 + } 54.118 + } 54.119 + 54.120 + ClassFileStream st(class_bytes, class_bytes_length, (char*) host_source); 54.121 + 54.122 + instanceKlassHandle anon_klass; 54.123 + { 54.124 + symbolHandle no_class_name; 54.125 + klassOop anonk = SystemDictionary::parse_stream(no_class_name, 54.126 + host_loader, host_domain, 54.127 + &st, host_klass, cp_patches, 54.128 + CHECK_NULL); 54.129 + if (anonk == NULL) return NULL; 54.130 + anon_klass = instanceKlassHandle(THREAD, anonk); 54.131 + } 54.132 + 54.133 + // let caller initialize it as needed... 54.134 + 54.135 + return anon_klass->java_mirror(); 54.136 +} 54.137 + 54.138 +UNSAFE_ENTRY(jclass, Unsafe_DefineAnonymousClass(JNIEnv *env, jobject unsafe, jclass host_class, jbyteArray data, jobjectArray cp_patches_jh)) 54.139 +{ 54.140 + UnsafeWrapper("Unsafe_DefineAnonymousClass"); 54.141 + ResourceMark rm(THREAD); 54.142 + 54.143 + HeapWord* temp_alloc = NULL; 54.144 + 54.145 + jobject res_jh = NULL; 54.146 + 54.147 + { oop res_oop = Unsafe_DefineAnonymousClass_impl(env, 54.148 + host_class, data, cp_patches_jh, 54.149 + &temp_alloc, THREAD); 54.150 + if (res_oop != NULL) 54.151 + res_jh = JNIHandles::make_local(env, res_oop); 54.152 + } 54.153 + 54.154 + // try/finally clause: 54.155 + if (temp_alloc != NULL) { 54.156 + FREE_C_HEAP_ARRAY(HeapWord, temp_alloc); 54.157 + } 54.158 + 54.159 + return (jclass) res_jh; 54.160 +} 54.161 +UNSAFE_END 54.162 + 54.163 + 54.164 54.165 UNSAFE_ENTRY(void, Unsafe_MonitorEnter(JNIEnv *env, jobject unsafe, jobject jobj)) 54.166 UnsafeWrapper("Unsafe_MonitorEnter"); 54.167 @@ -1292,6 +1449,9 @@ 54.168 {CC"copyMemory", CC"("ADR ADR"J)V", FN_PTR(Unsafe_CopyMemory)} 54.169 }; 54.170 54.171 +JNINativeMethod anonk_methods[] = { 54.172 + {CC"defineAnonymousClass", CC"("DAC_Args")"CLS, FN_PTR(Unsafe_DefineAnonymousClass)}, 54.173 +}; 54.174 54.175 #undef CC 54.176 #undef FN_PTR 54.177 @@ -1354,6 +1514,15 @@ 54.178 } 54.179 } 54.180 } 54.181 + if (AnonymousClasses) { 54.182 + env->RegisterNatives(unsafecls, anonk_methods, sizeof(anonk_methods)/sizeof(JNINativeMethod)); 54.183 + if (env->ExceptionOccurred()) { 54.184 + if (PrintMiscellaneous && (Verbose || WizardMode)) { 54.185 + tty->print_cr("Warning: SDK 1.7 Unsafe.defineClass (anonymous version) not found."); 54.186 + } 54.187 + env->ExceptionClear(); 54.188 + } 54.189 + } 54.190 int status = env->RegisterNatives(unsafecls, methods, sizeof(methods)/sizeof(JNINativeMethod)); 54.191 if (env->ExceptionOccurred()) { 54.192 if (PrintMiscellaneous && (Verbose || WizardMode)) {
55.1 --- a/src/share/vm/runtime/globals.hpp Thu Nov 20 11:39:38 2008 -0800 55.2 +++ b/src/share/vm/runtime/globals.hpp Fri Nov 21 16:11:03 2008 -0800 55.3 @@ -493,7 +493,7 @@ 55.4 develop(bool, DeoptimizeALot, false, \ 55.5 "deoptimize at every exit from the runtime system") \ 55.6 \ 55.7 - develop(ccstrlist, DeoptimizeOnlyAt, "", \ 55.8 + notproduct(ccstrlist, DeoptimizeOnlyAt, "", \ 55.9 "a comma separated list of bcis to deoptimize at") \ 55.10 \ 55.11 product(bool, DeoptimizeRandom, false, \ 55.12 @@ -2792,7 +2792,7 @@ 55.13 product(intx, TargetSurvivorRatio, 50, \ 55.14 "Desired percentage of survivor space used after scavenge") \ 55.15 \ 55.16 - product(intx, MarkSweepDeadRatio, 5, \ 55.17 + product(uintx, MarkSweepDeadRatio, 5, \ 55.18 "Percentage (0-100) of the old gen allowed as dead wood." \ 55.19 "Serial mark sweep treats this as both the min and max value." \ 55.20 "CMS uses this value only if it falls back to mark sweep." \ 55.21 @@ -2801,7 +2801,7 @@ 55.22 "either completely full or completely empty. Par compact also" \ 55.23 "has a smaller default value; see arguments.cpp.") \ 55.24 \ 55.25 - product(intx, PermMarkSweepDeadRatio, 20, \ 55.26 + product(uintx, PermMarkSweepDeadRatio, 20, \ 55.27 "Percentage (0-100) of the perm gen allowed as dead wood." \ 55.28 "See MarkSweepDeadRatio for collector-specific comments.") \ 55.29 \ 55.30 @@ -3230,6 +3230,9 @@ 55.31 "Skip assert() and verify() which page-in unwanted shared " \ 55.32 "objects. ") \ 55.33 \ 55.34 + product(bool, AnonymousClasses, false, \ 55.35 + "support sun.misc.Unsafe.defineAnonymousClass") \ 55.36 + \ 55.37 product(bool, TaggedStackInterpreter, false, \ 55.38 "Insert tags in interpreter execution stack for oopmap generaion")\ 55.39 \
56.1 --- a/src/share/vm/runtime/perfMemory.cpp Thu Nov 20 11:39:38 2008 -0800 56.2 +++ b/src/share/vm/runtime/perfMemory.cpp Fri Nov 21 16:11:03 2008 -0800 56.3 @@ -25,6 +25,14 @@ 56.4 # include "incls/_precompiled.incl" 56.5 # include "incls/_perfMemory.cpp.incl" 56.6 56.7 +// Prefix of performance data file. 56.8 +const char PERFDATA_NAME[] = "hsperfdata"; 56.9 + 56.10 +// Add 1 for the '_' character between PERFDATA_NAME and pid. The '\0' terminating 56.11 +// character will be included in the sizeof(PERFDATA_NAME) operation. 56.12 +static const size_t PERFDATA_FILENAME_LEN = sizeof(PERFDATA_NAME) + 56.13 + UINT_CHARS + 1; 56.14 + 56.15 char* PerfMemory::_start = NULL; 56.16 char* PerfMemory::_end = NULL; 56.17 char* PerfMemory::_top = NULL;
57.1 --- a/src/share/vm/runtime/perfMemory.hpp Thu Nov 20 11:39:38 2008 -0800 57.2 +++ b/src/share/vm/runtime/perfMemory.hpp Fri Nov 21 16:11:03 2008 -0800 57.3 @@ -95,7 +95,7 @@ 57.4 } PerfDataEntry; 57.5 57.6 // Prefix of performance data file. 57.7 -static const char PERFDATA_NAME[] = "hsperfdata"; 57.8 +extern const char PERFDATA_NAME[]; 57.9 57.10 // UINT_CHARS contains the number of characters holding a process id 57.11 // (i.e. pid). pid is defined as unsigned "int" so the maximum possible pid value 57.12 @@ -103,11 +103,6 @@ 57.13 // string. 57.14 static const size_t UINT_CHARS = 10; 57.15 57.16 -// Add 1 for the '_' character between PERFDATA_NAME and pid. The '\0' terminating 57.17 -// character will be included in the sizeof(PERFDATA_NAME) operation. 57.18 -static const size_t PERFDATA_FILENAME_LEN = sizeof(PERFDATA_NAME) + 57.19 - UINT_CHARS + 1; 57.20 - 57.21 /* the PerfMemory class manages creation, destruction, 57.22 * and allocation of the PerfData region. 57.23 */
58.1 --- a/src/share/vm/runtime/reflection.cpp Thu Nov 20 11:39:38 2008 -0800 58.2 +++ b/src/share/vm/runtime/reflection.cpp Fri Nov 21 16:11:03 2008 -0800 58.3 @@ -456,10 +456,32 @@ 58.4 return can_relax_access_check_for(current_class, new_class, classloader_only); 58.5 } 58.6 58.7 +static bool under_host_klass(instanceKlass* ik, klassOop host_klass) { 58.8 + DEBUG_ONLY(int inf_loop_check = 1000 * 1000 * 1000); 58.9 + for (;;) { 58.10 + klassOop hc = (klassOop) ik->host_klass(); 58.11 + if (hc == NULL) return false; 58.12 + if (hc == host_klass) return true; 58.13 + ik = instanceKlass::cast(hc); 58.14 + 58.15 + // There's no way to make a host class loop short of patching memory. 58.16 + // Therefore there cannot be a loop here unles there's another bug. 58.17 + // Still, let's check for it. 58.18 + assert(--inf_loop_check > 0, "no host_klass loop"); 58.19 + } 58.20 +} 58.21 + 58.22 bool Reflection::can_relax_access_check_for( 58.23 klassOop accessor, klassOop accessee, bool classloader_only) { 58.24 instanceKlass* accessor_ik = instanceKlass::cast(accessor); 58.25 instanceKlass* accessee_ik = instanceKlass::cast(accessee); 58.26 + 58.27 + // If either is on the other's host_klass chain, access is OK, 58.28 + // because one is inside the other. 58.29 + if (under_host_klass(accessor_ik, accessee) || 58.30 + under_host_klass(accessee_ik, accessor)) 58.31 + return true; 58.32 + 58.33 if (RelaxAccessControlCheck || 58.34 (accessor_ik->major_version() < JAVA_1_5_VERSION && 58.35 accessee_ik->major_version() < JAVA_1_5_VERSION)) {
59.1 --- a/src/share/vm/runtime/thread.cpp Thu Nov 20 11:39:38 2008 -0800 59.2 +++ b/src/share/vm/runtime/thread.cpp Fri Nov 21 16:11:03 2008 -0800 59.3 @@ -1422,6 +1422,7 @@ 59.4 thread->clear_pending_exception(); 59.5 } 59.6 59.7 + 59.8 // For any new cleanup additions, please check to see if they need to be applied to 59.9 // cleanup_failed_attach_current_thread as well. 59.10 void JavaThread::exit(bool destroy_vm, ExitType exit_type) { 59.11 @@ -1592,39 +1593,62 @@ 59.12 JvmtiExport::cleanup_thread(this); 59.13 } 59.14 59.15 +#ifndef SERIALGC 59.16 + // We must flush G1-related buffers before removing a thread from 59.17 + // the list of active threads. 59.18 + if (UseG1GC) { 59.19 + flush_barrier_queues(); 59.20 + } 59.21 +#endif 59.22 + 59.23 // Remove from list of active threads list, and notify VM thread if we are the last non-daemon thread 59.24 Threads::remove(this); 59.25 } 59.26 59.27 +#ifndef SERIALGC 59.28 +// Flush G1-related queues. 59.29 +void JavaThread::flush_barrier_queues() { 59.30 + satb_mark_queue().flush(); 59.31 + dirty_card_queue().flush(); 59.32 +} 59.33 +#endif 59.34 + 59.35 void JavaThread::cleanup_failed_attach_current_thread() { 59.36 - 59.37 - if (get_thread_profiler() != NULL) { 59.38 - get_thread_profiler()->disengage(); 59.39 - ResourceMark rm; 59.40 - get_thread_profiler()->print(get_thread_name()); 59.41 - } 59.42 - 59.43 - if (active_handles() != NULL) { 59.44 - JNIHandleBlock* block = active_handles(); 59.45 - set_active_handles(NULL); 59.46 - JNIHandleBlock::release_block(block); 59.47 - } 59.48 - 59.49 - if (free_handle_block() != NULL) { 59.50 - JNIHandleBlock* block = free_handle_block(); 59.51 - set_free_handle_block(NULL); 59.52 - JNIHandleBlock::release_block(block); 59.53 - } 59.54 - 59.55 - if (UseTLAB) { 59.56 - tlab().make_parsable(true); // retire TLAB, if any 59.57 - } 59.58 - 59.59 - Threads::remove(this); 59.60 - delete this; 59.61 + if (get_thread_profiler() != NULL) { 59.62 + get_thread_profiler()->disengage(); 59.63 + ResourceMark rm; 59.64 + get_thread_profiler()->print(get_thread_name()); 59.65 + } 59.66 + 59.67 + if (active_handles() != NULL) { 59.68 + JNIHandleBlock* block = active_handles(); 59.69 + set_active_handles(NULL); 59.70 + JNIHandleBlock::release_block(block); 59.71 + } 59.72 + 59.73 + if (free_handle_block() != NULL) { 59.74 + JNIHandleBlock* block = free_handle_block(); 59.75 + set_free_handle_block(NULL); 59.76 + JNIHandleBlock::release_block(block); 59.77 + } 59.78 + 59.79 + if (UseTLAB) { 59.80 + tlab().make_parsable(true); // retire TLAB, if any 59.81 + } 59.82 + 59.83 +#ifndef SERIALGC 59.84 + if (UseG1GC) { 59.85 + flush_barrier_queues(); 59.86 + } 59.87 +#endif 59.88 + 59.89 + Threads::remove(this); 59.90 + delete this; 59.91 } 59.92 59.93 59.94 + 59.95 + 59.96 JavaThread* JavaThread::active() { 59.97 Thread* thread = ThreadLocalStorage::thread(); 59.98 assert(thread != NULL, "just checking");
60.1 --- a/src/share/vm/runtime/thread.hpp Thu Nov 20 11:39:38 2008 -0800 60.2 +++ b/src/share/vm/runtime/thread.hpp Fri Nov 21 16:11:03 2008 -0800 60.3 @@ -793,6 +793,8 @@ 60.4 DirtyCardQueue _dirty_card_queue; // Thread-local log for dirty cards. 60.5 // Set of all such queues. 60.6 static DirtyCardQueueSet _dirty_card_queue_set; 60.7 + 60.8 + void flush_barrier_queues(); 60.9 #endif // !SERIALGC 60.10 60.11 friend class VMThread;
61.1 --- a/src/share/vm/utilities/array.hpp Thu Nov 20 11:39:38 2008 -0800 61.2 +++ b/src/share/vm/utilities/array.hpp Fri Nov 21 16:11:03 2008 -0800 61.3 @@ -40,11 +40,18 @@ 61.4 _length = 0; 61.5 _data = NULL; 61.6 DEBUG_ONLY(init_nesting();) 61.7 + // client may call initialize, at most once 61.8 } 61.9 61.10 61.11 ResourceArray(size_t esize, int length) { 61.12 + DEBUG_ONLY(_data = NULL); 61.13 + initialize(esize, length); 61.14 + } 61.15 + 61.16 + void initialize(size_t esize, int length) { 61.17 assert(length >= 0, "illegal length"); 61.18 + assert(_data == NULL, "must be new object"); 61.19 _length = length; 61.20 _data = resource_allocate_bytes(esize * length); 61.21 DEBUG_ONLY(init_nesting();) 61.22 @@ -111,7 +118,10 @@ 61.23 /* creation */ \ 61.24 array_name() : base_class() {} \ 61.25 array_name(const int length) : base_class(esize, length) {} \ 61.26 - array_name(const int length, const etype fx) : base_class(esize, length) { \ 61.27 + array_name(const int length, const etype fx) { initialize(length, fx); } \ 61.28 + void initialize(const int length) { base_class::initialize(esize, length); } \ 61.29 + void initialize(const int length, const etype fx) { \ 61.30 + initialize(length); \ 61.31 for (int i = 0; i < length; i++) ((etype*)_data)[i] = fx; \ 61.32 } \ 61.33 \ 61.34 @@ -157,16 +167,29 @@ 61.35 \ 61.36 public: \ 61.37 /* creation */ \ 61.38 - stack_name() : array_name() { _size = 0; } \ 61.39 - stack_name(const int size) : array_name(size){ _length = 0; _size = size; } \ 61.40 - stack_name(const int size, const etype fx) : array_name(size, fx) { _size = size; } \ 61.41 + stack_name() : array_name() { _size = 0; } \ 61.42 + stack_name(const int size) { initialize(size); } \ 61.43 + stack_name(const int size, const etype fx) { initialize(size, fx); } \ 61.44 + void initialize(const int size, const etype fx) { \ 61.45 + _size = size; \ 61.46 + array_name::initialize(size, fx); \ 61.47 + /* _length == size, allocation and size are the same */ \ 61.48 + } \ 61.49 + void initialize(const int size) { \ 61.50 + _size = size; \ 61.51 + array_name::initialize(size); \ 61.52 + _length = 0; /* reset length to zero; _size records the allocation */ \ 61.53 + } \ 61.54 \ 61.55 /* standard operations */ \ 61.56 int size() const { return _size; } \ 61.57 \ 61.58 - void push(const etype x) { \ 61.59 - if (length() >= size()) expand(esize, length(), _size); \ 61.60 - ((etype*)_data)[_length++] = x; \ 61.61 + int push(const etype x) { \ 61.62 + int len = length(); \ 61.63 + if (len >= size()) expand(esize, len, _size); \ 61.64 + ((etype*)_data)[len] = x; \ 61.65 + _length = len+1; \ 61.66 + return len; \ 61.67 } \ 61.68 \ 61.69 etype pop() { \ 61.70 @@ -235,7 +258,7 @@ 61.71 int capacity() const { return size(); } \ 61.72 void clear() { truncate(0); } \ 61.73 void trunc_to(const int length) { truncate(length); } \ 61.74 - void append(const etype x) { push(x); } \ 61.75 + int append(const etype x) { return push(x); } \ 61.76 void appendAll(const stack_name* stack) { push_all(stack); } \ 61.77 etype last() const { return top(); } \ 61.78 }; \
62.1 --- a/src/share/vm/utilities/constantTag.hpp Thu Nov 20 11:39:38 2008 -0800 62.2 +++ b/src/share/vm/utilities/constantTag.hpp Fri Nov 21 16:11:03 2008 -0800 62.3 @@ -71,6 +71,7 @@ 62.4 bool is_string_index() const { return _tag == JVM_CONSTANT_StringIndex; } 62.5 62.6 bool is_klass_reference() const { return is_klass_index() || is_unresolved_klass(); } 62.7 + bool is_klass_or_reference() const{ return is_klass() || is_klass_reference(); } 62.8 bool is_field_or_method() const { return is_field() || is_method() || is_interface_method(); } 62.9 bool is_symbol() const { return is_utf8(); } 62.10
63.1 --- a/src/share/vm/utilities/debug.cpp Thu Nov 20 11:39:38 2008 -0800 63.2 +++ b/src/share/vm/utilities/debug.cpp Fri Nov 21 16:11:03 2008 -0800 63.3 @@ -567,7 +567,7 @@ 63.4 } 63.5 // the InlineCacheBuffer is using stubs generated into a buffer blob 63.6 if (InlineCacheBuffer::contains(addr)) { 63.7 - tty->print_cr(INTPTR_FORMAT "is pointing into InlineCacheBuffer", addr); 63.8 + tty->print_cr(INTPTR_FORMAT " is pointing into InlineCacheBuffer", addr); 63.9 return; 63.10 } 63.11 VtableStub* v = VtableStubs::stub_containing(addr); 63.12 @@ -595,7 +595,7 @@ 63.13 return; 63.14 } 63.15 63.16 - if (Universe::heap()->is_in_reserved(addr)) { 63.17 + if (Universe::heap()->is_in(addr)) { 63.18 HeapWord* p = Universe::heap()->block_start(addr); 63.19 bool print = false; 63.20 // If we couldn't find it it just may mean that heap wasn't parseable 63.21 @@ -621,24 +621,28 @@ 63.22 } 63.23 return; 63.24 } 63.25 + } else if (Universe::heap()->is_in_reserved(addr)) { 63.26 + tty->print_cr(INTPTR_FORMAT " is an unallocated location in the heap", addr); 63.27 + return; 63.28 } 63.29 + 63.30 if (JNIHandles::is_global_handle((jobject) addr)) { 63.31 - tty->print_cr(INTPTR_FORMAT "is a global jni handle", addr); 63.32 + tty->print_cr(INTPTR_FORMAT " is a global jni handle", addr); 63.33 return; 63.34 } 63.35 if (JNIHandles::is_weak_global_handle((jobject) addr)) { 63.36 - tty->print_cr(INTPTR_FORMAT "is a weak global jni handle", addr); 63.37 + tty->print_cr(INTPTR_FORMAT " is a weak global jni handle", addr); 63.38 return; 63.39 } 63.40 if (JNIHandleBlock::any_contains((jobject) addr)) { 63.41 - tty->print_cr(INTPTR_FORMAT "is a local jni handle", addr); 63.42 + tty->print_cr(INTPTR_FORMAT " is a local jni handle", addr); 63.43 return; 63.44 } 63.45 63.46 for(JavaThread *thread = Threads::first(); thread; thread = thread->next()) { 63.47 - // Check for priviledge stack 63.48 + // Check for privilege stack 63.49 if (thread->privileged_stack_top() != NULL && thread->privileged_stack_top()->contains(addr)) { 63.50 - tty->print_cr(INTPTR_FORMAT "is pointing into the priviledge stack for thread: " INTPTR_FORMAT, addr, thread); 63.51 + tty->print_cr(INTPTR_FORMAT " is pointing into the privilege stack for thread: " INTPTR_FORMAT, addr, thread); 63.52 return; 63.53 } 63.54 // If the addr is a java thread print information about that. 63.55 @@ -659,7 +663,7 @@ 63.56 return; 63.57 } 63.58 63.59 - tty->print_cr(INTPTR_FORMAT "is pointing to unknown location", addr); 63.60 + tty->print_cr(INTPTR_FORMAT " is pointing to unknown location", addr); 63.61 } 63.62 63.63
64.1 --- a/src/share/vm/utilities/growableArray.hpp Thu Nov 20 11:39:38 2008 -0800 64.2 +++ b/src/share/vm/utilities/growableArray.hpp Fri Nov 21 16:11:03 2008 -0800 64.3 @@ -111,6 +111,12 @@ 64.4 } 64.5 64.6 void* raw_allocate(int elementSize); 64.7 + 64.8 + // some uses pass the Thread explicitly for speed (4990299 tuning) 64.9 + void* raw_allocate(Thread* thread, int elementSize) { 64.10 + assert(on_stack(), "fast ResourceObj path only"); 64.11 + return (void*)resource_allocate_bytes(thread, elementSize * _max); 64.12 + } 64.13 }; 64.14 64.15 template<class E> class GrowableArray : public GenericGrowableArray { 64.16 @@ -121,6 +127,11 @@ 64.17 void raw_at_put_grow(int i, const E& p, const E& fill); 64.18 void clear_and_deallocate(); 64.19 public: 64.20 + GrowableArray(Thread* thread, int initial_size) : GenericGrowableArray(initial_size, 0, false) { 64.21 + _data = (E*)raw_allocate(thread, sizeof(E)); 64.22 + for (int i = 0; i < _max; i++) ::new ((void*)&_data[i]) E(); 64.23 + } 64.24 + 64.25 GrowableArray(int initial_size, bool C_heap = false) : GenericGrowableArray(initial_size, 0, C_heap) { 64.26 _data = (E*)raw_allocate(sizeof(E)); 64.27 for (int i = 0; i < _max; i++) ::new ((void*)&_data[i]) E(); 64.28 @@ -159,10 +170,12 @@ 64.29 64.30 void print(); 64.31 64.32 - void append(const E& elem) { 64.33 + int append(const E& elem) { 64.34 check_nesting(); 64.35 if (_len == _max) grow(_len); 64.36 - _data[_len++] = elem; 64.37 + int idx = _len++; 64.38 + _data[idx] = elem; 64.39 + return idx; 64.40 } 64.41 64.42 void append_if_missing(const E& elem) {
65.1 --- a/src/share/vm/utilities/hashtable.cpp Thu Nov 20 11:39:38 2008 -0800 65.2 +++ b/src/share/vm/utilities/hashtable.cpp Fri Nov 21 16:11:03 2008 -0800 65.3 @@ -43,9 +43,11 @@ 65.4 entry = _free_list; 65.5 _free_list = _free_list->next(); 65.6 } else { 65.7 - const int block_size = 500; 65.8 - if (_first_free_entry == _end_block) { 65.9 + if (_first_free_entry + _entry_size >= _end_block) { 65.10 + int block_size = MIN2(512, MAX2((int)_table_size / 2, (int)_number_of_entries)); 65.11 int len = _entry_size * block_size; 65.12 + len = 1 << log2_intptr(len); // round down to power of 2 65.13 + assert(len >= _entry_size, ""); 65.14 _first_free_entry = NEW_C_HEAP_ARRAY(char, len); 65.15 _end_block = _first_free_entry + len; 65.16 } 65.17 @@ -53,6 +55,7 @@ 65.18 _first_free_entry += _entry_size; 65.19 } 65.20 65.21 + assert(_entry_size % HeapWordSize == 0, ""); 65.22 entry->set_hash(hashValue); 65.23 return entry; 65.24 }