6953477: Increase portability and flexibility of building Hotspot

Tue, 03 Aug 2010 08:13:38 -0400

author
bobv
date
Tue, 03 Aug 2010 08:13:38 -0400
changeset 2036
126ea7725993
parent 2035
a64438a2b7e8
child 2044
f4f596978298
child 2049
ab3fd720516c

6953477: Increase portability and flexibility of building Hotspot
Summary: A collection of portability improvements including shared code support for PPC, ARM platforms, software floating point, cross compilation support and improvements in error crash detail.
Reviewed-by: phh, never, coleenp, dholmes

agent/src/os/linux/ps_proc.c file | annotate | diff | comparison | revisions
make/Makefile file | annotate | diff | comparison | revisions
make/defs.make file | annotate | diff | comparison | revisions
make/linux/makefiles/build_vm_def.sh file | annotate | diff | comparison | revisions
make/linux/makefiles/buildtree.make file | annotate | diff | comparison | revisions
make/linux/makefiles/defs.make file | annotate | diff | comparison | revisions
make/linux/makefiles/gcc.make file | annotate | diff | comparison | revisions
make/linux/makefiles/product.make file | annotate | diff | comparison | revisions
make/linux/makefiles/sa.make file | annotate | diff | comparison | revisions
make/linux/makefiles/saproc.make file | annotate | diff | comparison | revisions
make/linux/makefiles/vm.make file | annotate | diff | comparison | revisions
make/solaris/makefiles/defs.make file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/c1_Runtime1_sparc.cpp file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/interpreterRT_sparc.cpp file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp file | annotate | diff | comparison | revisions
src/cpu/sparc/vm/templateTable_sparc.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/c1_LIRGenerator_x86.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/c1_Runtime1_x86.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/frame_x86.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/interpreterRT_x86_32.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/javaFrameAnchor_x86.hpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/templateTable_x86_32.cpp file | annotate | diff | comparison | revisions
src/cpu/x86/vm/templateTable_x86_64.cpp file | annotate | diff | comparison | revisions
src/os/linux/launcher/java_md.c file | annotate | diff | comparison | revisions
src/os/linux/vm/os_linux.cpp file | annotate | diff | comparison | revisions
src/os/solaris/vm/os_solaris.cpp file | annotate | diff | comparison | revisions
src/os/windows/vm/os_windows.cpp file | annotate | diff | comparison | revisions
src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp file | annotate | diff | comparison | revisions
src/os_cpu/linux_x86/vm/os_linux_x86.cpp file | annotate | diff | comparison | revisions
src/os_cpu/linux_x86/vm/thread_linux_x86.cpp file | annotate | diff | comparison | revisions
src/os_cpu/linux_zero/vm/thread_linux_zero.cpp file | annotate | diff | comparison | revisions
src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp file | annotate | diff | comparison | revisions
src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp file | annotate | diff | comparison | revisions
src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp file | annotate | diff | comparison | revisions
src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp file | annotate | diff | comparison | revisions
src/os_cpu/windows_x86/vm/os_windows_x86.cpp file | annotate | diff | comparison | revisions
src/os_cpu/windows_x86/vm/thread_windows_x86.cpp file | annotate | diff | comparison | revisions
src/share/vm/asm/codeBuffer.hpp file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_CodeStubs.hpp file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_Compilation.hpp file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_FrameMap.cpp file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_FrameMap.hpp file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_LIR.cpp file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_LIR.hpp file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_LIRGenerator.cpp file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_LIRGenerator.hpp file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_LinearScan.cpp file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_Runtime1.cpp file | annotate | diff | comparison | revisions
src/share/vm/c1/c1_Runtime1.hpp file | annotate | diff | comparison | revisions
src/share/vm/code/codeBlob.cpp file | annotate | diff | comparison | revisions
src/share/vm/code/codeBlob.hpp file | annotate | diff | comparison | revisions
src/share/vm/code/nmethod.hpp file | annotate | diff | comparison | revisions
src/share/vm/code/vtableStubs.cpp file | annotate | diff | comparison | revisions
src/share/vm/code/vtableStubs.hpp file | annotate | diff | comparison | revisions
src/share/vm/compiler/disassembler.cpp file | annotate | diff | comparison | revisions
src/share/vm/includeDB_compiler1 file | annotate | diff | comparison | revisions
src/share/vm/includeDB_core file | annotate | diff | comparison | revisions
src/share/vm/interpreter/bytecodeInterpreter.cpp file | annotate | diff | comparison | revisions
src/share/vm/interpreter/bytecodeInterpreter.hpp file | annotate | diff | comparison | revisions
src/share/vm/interpreter/bytecodeInterpreter.inline.hpp file | annotate | diff | comparison | revisions
src/share/vm/interpreter/interpreter.cpp file | annotate | diff | comparison | revisions
src/share/vm/interpreter/interpreter.hpp file | annotate | diff | comparison | revisions
src/share/vm/interpreter/oopMapCache.cpp file | annotate | diff | comparison | revisions
src/share/vm/memory/allocation.cpp file | annotate | diff | comparison | revisions
src/share/vm/memory/allocation.hpp file | annotate | diff | comparison | revisions
src/share/vm/memory/genCollectedHeap.cpp file | annotate | diff | comparison | revisions
src/share/vm/memory/generation.hpp file | annotate | diff | comparison | revisions
src/share/vm/oops/arrayKlass.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/arrayKlass.hpp file | annotate | diff | comparison | revisions
src/share/vm/oops/arrayKlassKlass.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/arrayKlassKlass.hpp file | annotate | diff | comparison | revisions
src/share/vm/oops/compiledICHolderKlass.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/compiledICHolderKlass.hpp file | annotate | diff | comparison | revisions
src/share/vm/oops/constMethodKlass.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/constMethodKlass.hpp file | annotate | diff | comparison | revisions
src/share/vm/oops/constantPoolKlass.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/constantPoolKlass.hpp file | annotate | diff | comparison | revisions
src/share/vm/oops/cpCacheKlass.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/cpCacheKlass.hpp file | annotate | diff | comparison | revisions
src/share/vm/oops/generateOopMap.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/klass.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/klass.hpp file | annotate | diff | comparison | revisions
src/share/vm/oops/klassKlass.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/klassKlass.hpp file | annotate | diff | comparison | revisions
src/share/vm/oops/oop.cpp file | annotate | diff | comparison | revisions
src/share/vm/prims/jni.cpp file | annotate | diff | comparison | revisions
src/share/vm/prims/jvmtiEnvThreadState.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/arguments.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/frame.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/frame.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/globals.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/java.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/javaFrameAnchor.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/os.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/os.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/sharedRuntime.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/sharedRuntime.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/sharedRuntimeTrans.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/signature.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/stubCodeGenerator.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/stubCodeGenerator.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/thread.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/thread.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/vm_version.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/vm_version.hpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/debug.cpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/globalDefinitions_gcc.hpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/macros.hpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/vmError.cpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/vmError.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/agent/src/os/linux/ps_proc.c	Wed Jul 28 17:57:43 2010 -0400
     1.2 +++ b/agent/src/os/linux/ps_proc.c	Tue Aug 03 08:13:38 2010 -0400
     1.3 @@ -253,7 +253,11 @@
     1.4      if (nwords > 5 && find_lib(ph, word[5]) == false) {
     1.5         intptr_t base;
     1.6         lib_info* lib;
     1.7 +#ifdef _LP64
     1.8         sscanf(word[0], "%lx", &base);
     1.9 +#else
    1.10 +       sscanf(word[0], "%x", &base);
    1.11 +#endif
    1.12         if ((lib = add_lib_info(ph, word[5], (uintptr_t)base)) == NULL)
    1.13            continue; // ignore, add_lib_info prints error
    1.14  
     2.1 --- a/make/Makefile	Wed Jul 28 17:57:43 2010 -0400
     2.2 +++ b/make/Makefile	Tue Aug 03 08:13:38 2010 -0400
     2.3 @@ -90,9 +90,15 @@
     2.4  JDK_DIRS=bin include jre lib demo
     2.5  
     2.6  all:           all_product all_fastdebug
     2.7 +ifndef BUILD_CLIENT_ONLY
     2.8  all_product:   product product1 productkernel docs export_product
     2.9  all_fastdebug: fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
    2.10  all_debug:     jvmg jvmg1 jvmgkernel docs export_debug
    2.11 +else
    2.12 +all_product:   product1 docs export_product
    2.13 +all_fastdebug: fastdebug1 docs export_fastdebug
    2.14 +all_debug:     jvmg1 docs export_debug
    2.15 +endif
    2.16  all_optimized: optimized optimized1 optimizedkernel docs export_optimized
    2.17  
    2.18  allzero:           all_productzero all_fastdebugzero
    2.19 @@ -295,6 +301,8 @@
    2.20  $(EXPORT_SERVER_DIR)/%.so:       $(ZERO_DIR)/%.so
    2.21  	$(install-file)
    2.22    else
    2.23 +$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C1_DIR)/%.so
    2.24 +	$(install-file)
    2.25  $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
    2.26  	$(install-file)
    2.27  $(EXPORT_CLIENT_DIR)/%.so:       $(C1_DIR)/%.so
     3.1 --- a/make/defs.make	Wed Jul 28 17:57:43 2010 -0400
     3.2 +++ b/make/defs.make	Tue Aug 03 08:13:38 2010 -0400
     3.3 @@ -192,13 +192,16 @@
     3.4  
     3.5    # Use uname output for SRCARCH, but deal with platform differences. If ARCH
     3.6    # is not explicitly listed below, it is treated as x86. 
     3.7 -  SRCARCH     = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 zero,$(ARCH)))
     3.8 +  SRCARCH     = $(ARCH/$(filter sparc sparc64 ia64 amd64 x86_64 arm ppc zero,$(ARCH)))
     3.9    ARCH/       = x86
    3.10    ARCH/sparc  = sparc
    3.11    ARCH/sparc64= sparc
    3.12    ARCH/ia64   = ia64
    3.13    ARCH/amd64  = x86
    3.14    ARCH/x86_64 = x86
    3.15 +  ARCH/ppc64  = ppc
    3.16 +  ARCH/ppc    = ppc
    3.17 +  ARCH/arm    = arm
    3.18    ARCH/zero   = zero
    3.19  
    3.20    # BUILDARCH is usually the same as SRCARCH, except for sparcv9
    3.21 @@ -223,6 +226,9 @@
    3.22    LIBARCH/sparc   = sparc
    3.23    LIBARCH/sparcv9 = sparcv9
    3.24    LIBARCH/ia64    = ia64
    3.25 +  LIBARCH/ppc64   = ppc
    3.26 +  LIBARCH/ppc     = ppc
    3.27 +  LIBARCH/arm     = arm
    3.28    LIBARCH/zero    = $(ZERO_LIBARCH)
    3.29  
    3.30    LP64_ARCH = sparcv9 amd64 ia64 zero
     4.1 --- a/make/linux/makefiles/build_vm_def.sh	Wed Jul 28 17:57:43 2010 -0400
     4.2 +++ b/make/linux/makefiles/build_vm_def.sh	Tue Aug 03 08:13:38 2010 -0400
     4.3 @@ -1,5 +1,12 @@
     4.4  #!/bin/sh
     4.5  
     4.6 -nm --defined-only $* | awk '
     4.7 +# If we're cross compiling use that path for nm
     4.8 +if [ "$ALT_COMPILER_PATH" != "" ]; then 
     4.9 +NM=$ALT_COMPILER_PATH/nm
    4.10 +else
    4.11 +NM=nm
    4.12 +fi
    4.13 +
    4.14 +$NM --defined-only $* | awk '
    4.15     { if ($3 ~ /^_ZTV/ || $3 ~ /^gHotSpotVM/) print "\t" $3 ";" }
    4.16     '
     5.1 --- a/make/linux/makefiles/buildtree.make	Wed Jul 28 17:57:43 2010 -0400
     5.2 +++ b/make/linux/makefiles/buildtree.make	Tue Aug 03 08:13:38 2010 -0400
     5.3 @@ -339,12 +339,16 @@
     5.4  WRONG_DATA_MODE_MSG = \
     5.5  	echo "JAVA_HOME must point to $(DATA_MODE)bit JDK."
     5.6  
     5.7 +CROSS_COMPILING_MSG = \
     5.8 +	echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
     5.9 +
    5.10  test_gamma:  $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
    5.11  	@echo Creating $@ ...
    5.12  	$(QUIETLY) ( \
    5.13  	echo '#!/bin/sh'; \
    5.14  	$(BUILDTREE_COMMENT); \
    5.15  	echo '. ./env.sh'; \
    5.16 +	echo "if [ \"$(CROSS_COMPILE_ARCH)\" != \"\" ]; then { $(CROSS_COMPILING_MSG); exit 0; }; fi"; \
    5.17  	echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \
    5.18  	echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \
    5.19  	echo "then"; \
     6.1 --- a/make/linux/makefiles/defs.make	Wed Jul 28 17:57:43 2010 -0400
     6.2 +++ b/make/linux/makefiles/defs.make	Tue Aug 03 08:13:38 2010 -0400
     6.3 @@ -98,6 +98,22 @@
     6.4    HS_ARCH          = x86
     6.5  endif
     6.6  
     6.7 +# ARM
     6.8 +ifeq ($(ARCH), arm)
     6.9 +  ARCH_DATA_MODEL  = 32
    6.10 +  PLATFORM         = linux-arm
    6.11 +  VM_PLATFORM      = linux_arm
    6.12 +  HS_ARCH          = arm
    6.13 +endif
    6.14 +
    6.15 +# PPC
    6.16 +ifeq ($(ARCH), ppc)
    6.17 +  ARCH_DATA_MODEL  = 32
    6.18 +  PLATFORM         = linux-ppc
    6.19 +  VM_PLATFORM      = linux_ppc
    6.20 +  HS_ARCH          = ppc
    6.21 +endif
    6.22 +
    6.23  JDK_INCLUDE_SUBDIR=linux
    6.24  
    6.25  # FIXUP: The subdirectory for a debug build is NOT the same on all platforms
    6.26 @@ -107,22 +123,32 @@
    6.27  
    6.28  # client and server subdirectories have symbolic links to ../libjsig.so
    6.29  EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so
    6.30 +EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
    6.31  
    6.32 -EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
    6.33 +ifndef BUILD_CLIENT_ONLY
    6.34  EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
    6.35  EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
    6.36 +endif
    6.37 +
    6.38  ifneq ($(ZERO_BUILD), true)
    6.39    ifeq ($(ARCH_DATA_MODEL), 32)
    6.40      EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
    6.41      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
    6.42      EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so 
    6.43 -    EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
    6.44 -    EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar 
    6.45 -  else
    6.46 -    ifeq ($(ARCH),ia64)
    6.47 -      else
    6.48 -        EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
    6.49 -        EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar
    6.50 -    endif
    6.51    endif
    6.52  endif
    6.53 +
    6.54 +# Serviceability Binaries
    6.55 +# No SA Support for PPC, IA64, ARM or zero
    6.56 +ADD_SA_BINARIES/x86   = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
    6.57 +                        $(EXPORT_LIB_DIR)/sa-jdi.jar 
    6.58 +ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
    6.59 +                        $(EXPORT_LIB_DIR)/sa-jdi.jar 
    6.60 +ADD_SA_BINARIES/ppc   = 
    6.61 +ADD_SA_BINARIES/ia64  = 
    6.62 +ADD_SA_BINARIES/arm   = 
    6.63 +ADD_SA_BINARIES/zero  = 
    6.64 +
    6.65 +EXPORT_LIST += $(ADD_SA_BINARIES/$(HS_ARCH))
    6.66 +
    6.67 +
     7.1 --- a/make/linux/makefiles/gcc.make	Wed Jul 28 17:57:43 2010 -0400
     7.2 +++ b/make/linux/makefiles/gcc.make	Tue Aug 03 08:13:38 2010 -0400
     7.3 @@ -25,8 +25,14 @@
     7.4  #------------------------------------------------------------------------
     7.5  # CC, CPP & AS
     7.6  
     7.7 +ifdef ALT_COMPILER_PATH
     7.8 +CPP = $(ALT_COMPILER_PATH)/g++
     7.9 +CC  = $(ALT_COMPILER_PATH)/gcc
    7.10 +else
    7.11  CPP = g++
    7.12  CC  = gcc
    7.13 +endif
    7.14 +
    7.15  AS  = $(CC) -c
    7.16  
    7.17  # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
    7.18 @@ -67,18 +73,31 @@
    7.19  ARCHFLAG/ia64    =
    7.20  ARCHFLAG/sparc   = -m32 -mcpu=v9
    7.21  ARCHFLAG/sparcv9 = -m64 -mcpu=v9
    7.22 +ARCHFLAG/arm     =  -fsigned-char
    7.23  ARCHFLAG/zero    = $(ZERO_ARCHFLAG)
    7.24 +ifndef E500V2
    7.25 +ARCHFLAG/ppc     =  -mcpu=powerpc
    7.26 +endif
    7.27  
    7.28  CFLAGS     += $(ARCHFLAG)
    7.29  AOUT_FLAGS += $(ARCHFLAG)
    7.30  LFLAGS     += $(ARCHFLAG)
    7.31  ASFLAGS    += $(ARCHFLAG)
    7.32  
    7.33 +ifdef E500V2
    7.34 +CFLAGS += -DE500V2
    7.35 +endif
    7.36 +
    7.37  # Use C++ Interpreter
    7.38  ifdef CC_INTERP
    7.39    CFLAGS += -DCC_INTERP
    7.40  endif
    7.41  
    7.42 +# Build for embedded targets
    7.43 +ifdef JAVASE_EMBEDDED
    7.44 +  CFLAGS += -DJAVASE_EMBEDDED
    7.45 +endif
    7.46 +
    7.47  # Keep temporary files (.ii, .s)
    7.48  ifdef NEED_ASM
    7.49    CFLAGS += -save-temps
    7.50 @@ -171,6 +190,8 @@
    7.51  # Note: The Itanium gcc compiler crashes when using -gstabs.
    7.52  DEBUG_CFLAGS/ia64  = -g
    7.53  DEBUG_CFLAGS/amd64 = -g
    7.54 +DEBUG_CFLAGS/arm   = -g
    7.55 +DEBUG_CFLAGS/ppc   = -g
    7.56  DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
    7.57  ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
    7.58  DEBUG_CFLAGS += -gstabs
    7.59 @@ -181,3 +202,15 @@
    7.60    DEBUG_CFLAGS = -g
    7.61    CFLAGS += $(DEBUG_CFLAGS)
    7.62  endif
    7.63 +
    7.64 +# If we are building HEADLESS, pass on to VM
    7.65 +# so it can set the java.awt.headless property
    7.66 +ifdef HEADLESS
    7.67 +CFLAGS += -DHEADLESS
    7.68 +endif
    7.69 +
    7.70 +# We are building Embedded for a small device
    7.71 +# favor code space over speed
    7.72 +ifdef MINIMIZE_RAM_USAGE
    7.73 +CFLAGS += -DMINIMIZE_RAM_USAGE
    7.74 +endif
     8.1 --- a/make/linux/makefiles/product.make	Wed Jul 28 17:57:43 2010 -0400
     8.2 +++ b/make/linux/makefiles/product.make	Tue Aug 03 08:13:38 2010 -0400
     8.3 @@ -46,7 +46,11 @@
     8.4  
     8.5  # use -g to strip library as -x will discard its symbol table; -x is fine for
     8.6  # executables.
     8.7 -STRIP = strip
     8.8 +ifdef CROSS_COMPILE_ARCH
     8.9 +  STRIP = $(ALT_COMPILER_PATH)/strip
    8.10 +else
    8.11 +  STRIP = strip
    8.12 +endif
    8.13  STRIP_LIBJVM = $(STRIP) -g $@ || exit 1;
    8.14  STRIP_AOUT   = $(STRIP) -x $@ || exit 1;
    8.15  
     9.1 --- a/make/linux/makefiles/sa.make	Wed Jul 28 17:57:43 2010 -0400
     9.2 +++ b/make/linux/makefiles/sa.make	Tue Aug 03 08:13:38 2010 -0400
     9.3 @@ -55,10 +55,13 @@
     9.4  SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
     9.5  
     9.6  # if $(AGENT_DIR) does not exist, we don't build SA
     9.7 -# also, we don't build SA on Itanium or zero.
     9.8 +# also, we don't build SA on Itanium, PowerPC, ARM or zero.
     9.9  
    9.10  all: 
    9.11 -	if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "zero" ] ; then \
    9.12 +	if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \
    9.13 +             -a "$(SRCARCH)" != "arm" \
    9.14 +             -a "$(SRCARCH)" != "ppc" \
    9.15 +             -a "$(SRCARCH)" != "zero" ] ; then \
    9.16  	   $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
    9.17  	fi
    9.18  
    10.1 --- a/make/linux/makefiles/saproc.make	Wed Jul 28 17:57:43 2010 -0400
    10.2 +++ b/make/linux/makefiles/saproc.make	Tue Aug 03 08:13:38 2010 -0400
    10.3 @@ -53,10 +53,10 @@
    10.4  endif
    10.5  
    10.6  # if $(AGENT_DIR) does not exist, we don't build SA
    10.7 -# also, we don't build SA on Itanium or zero.
    10.8 +# also, we don't build SA on Itanium, PPC, ARM or zero.
    10.9  
   10.10  checkAndBuildSA:
   10.11 -	$(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "zero" ] ; then \
   10.12 +	$(QUIETLY) if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" -a "$(SRCARCH)" != "arm" -a "$(SRCARCH)" != "ppc" -a "$(SRCARCH)" != "zero" ] ; then \
   10.13  	   $(MAKE) -f vm.make $(LIBSAPROC); \
   10.14  	fi
   10.15  
    11.1 --- a/make/linux/makefiles/vm.make	Wed Jul 28 17:57:43 2010 -0400
    11.2 +++ b/make/linux/makefiles/vm.make	Tue Aug 03 08:13:38 2010 -0400
    11.3 @@ -98,6 +98,7 @@
    11.4  
    11.5  # Extra flags from gnumake's invocation or environment
    11.6  CFLAGS += $(EXTRA_CFLAGS)
    11.7 +LFLAGS += $(EXTRA_CFLAGS)
    11.8  
    11.9  LIBS += -lm -ldl -lpthread
   11.10  
   11.11 @@ -210,15 +211,17 @@
   11.12  	    $(LINK_LIB.CC/POST_HOOK)                                    \
   11.13  	    rm -f $@.1; ln -s $@ $@.1;                                  \
   11.14  	    [ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \
   11.15 -	    if [ -x /usr/sbin/selinuxenabled ] ; then                   \
   11.16 -	      /usr/sbin/selinuxenabled;                                 \
   11.17 -              if [ $$? = 0 ] ; then					\
   11.18 -		/usr/bin/chcon -t textrel_shlib_t $@;                   \
   11.19 -		if [ $$? != 0 ]; then                                   \
   11.20 -		  echo "ERROR: Cannot chcon $@";			\
   11.21 -		fi							\
   11.22 -	      fi							\
   11.23 -	    fi                                                          \
   11.24 +            if [ \"$(CROSS_COMPILE_ARCH)\" = \"\" ] ; then                    \
   11.25 +	      if [ -x /usr/sbin/selinuxenabled ] ; then                 \
   11.26 +	        /usr/sbin/selinuxenabled;                               \
   11.27 +                if [ $$? = 0 ] ; then					\
   11.28 +		  /usr/bin/chcon -t textrel_shlib_t $@;                 \
   11.29 +		  if [ $$? != 0 ]; then                                 \
   11.30 +		    echo "ERROR: Cannot chcon $@";			\
   11.31 +		  fi							\
   11.32 +	        fi							\
   11.33 +	      fi                                                        \
   11.34 +            fi 								\
   11.35  	}
   11.36  
   11.37  DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
    12.1 --- a/make/solaris/makefiles/defs.make	Wed Jul 28 17:57:43 2010 -0400
    12.2 +++ b/make/solaris/makefiles/defs.make	Tue Aug 03 08:13:38 2010 -0400
    12.3 @@ -70,20 +70,24 @@
    12.4  EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so
    12.5  
    12.6  EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
    12.7 +ifneq ($(BUILD_CLIENT_ONLY),true)
    12.8  EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
    12.9  EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
   12.10  EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.so
   12.11  EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.so
   12.12 +endif
   12.13  ifeq ($(ARCH_DATA_MODEL), 32)
   12.14    EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
   12.15    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
   12.16    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so 
   12.17    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.so 
   12.18 -  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.so 
   12.19 -  EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.so
   12.20 +  EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.so
   12.21    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.so
   12.22 -  EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.so
   12.23    EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.so
   12.24 +  ifneq ($(BUILD_CLIENT_ONLY), true)
   12.25 +    EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.so
   12.26 +    EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.so
   12.27 +  endif
   12.28  endif
   12.29  
   12.30  EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so
    13.1 --- a/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp	Wed Jul 28 17:57:43 2010 -0400
    13.2 +++ b/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp	Tue Aug 03 08:13:38 2010 -0400
    13.3 @@ -236,19 +236,19 @@
    13.4  }
    13.5  
    13.6  inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) {
    13.7 -  return op1 <<  op2;
    13.8 +  return op1 << (op2 & 0x1f);
    13.9  }
   13.10  
   13.11  inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) {
   13.12 -  return op1 >>  op2; // QQ op2 & 0x1f??
   13.13 +  return op1 >> (op2 & 0x1f);
   13.14  }
   13.15  
   13.16  inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) {
   13.17    return op1 - op2;
   13.18  }
   13.19  
   13.20 -inline jint BytecodeInterpreter::VMintUshr(jint op1, jint op2) {
   13.21 -  return ((juint) op1) >> op2; // QQ op2 & 0x1f??
   13.22 +inline juint BytecodeInterpreter::VMintUshr(jint op1, jint op2) {
   13.23 +  return ((juint) op1) >> (op2 & 0x1f);
   13.24  }
   13.25  
   13.26  inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) {
    14.1 --- a/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Wed Jul 28 17:57:43 2010 -0400
    14.2 +++ b/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp	Tue Aug 03 08:13:38 2010 -0400
    14.3 @@ -409,7 +409,7 @@
    14.4    LIR_Opr lock      = FrameMap::G1_opr;
    14.5    LIR_Opr hdr       = FrameMap::G3_opr;
    14.6    LIR_Opr obj_temp  = FrameMap::G4_opr;
    14.7 -  monitor_exit(obj_temp, lock, hdr, x->monitor_no());
    14.8 +  monitor_exit(obj_temp, lock, hdr, LIR_OprFact::illegalOpr, x->monitor_no());
    14.9  }
   14.10  
   14.11  
    15.1 --- a/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Wed Jul 28 17:57:43 2010 -0400
    15.2 +++ b/src/cpu/sparc/vm/c1_Runtime1_sparc.cpp	Tue Aug 03 08:13:38 2010 -0400
    15.3 @@ -1031,3 +1031,7 @@
    15.4  #undef __
    15.5  
    15.6  #define __ masm->
    15.7 +
    15.8 +const char *Runtime1::pd_name_for_address(address entry) {
    15.9 +  return "<unknown function>";
   15.10 +}
    16.1 --- a/src/cpu/sparc/vm/interpreterRT_sparc.cpp	Wed Jul 28 17:57:43 2010 -0400
    16.2 +++ b/src/cpu/sparc/vm/interpreterRT_sparc.cpp	Tue Aug 03 08:13:38 2010 -0400
    16.3 @@ -56,14 +56,18 @@
    16.4  }
    16.5  
    16.6  
    16.7 -#ifdef _LP64
    16.8  void InterpreterRuntime::SignatureHandlerGenerator::pass_float() {
    16.9    Argument  jni_arg(jni_offset(), false);
   16.10 +#ifdef _LP64
   16.11    FloatRegister  Rtmp = F0;
   16.12    __ ldf(FloatRegisterImpl::S, Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp);
   16.13    __ store_float_argument(Rtmp, jni_arg);
   16.14 +#else
   16.15 +  Register     Rtmp = O0;
   16.16 +  __ ld(Llocals, Interpreter::local_offset_in_bytes(offset()), Rtmp);
   16.17 +  __ store_argument(Rtmp, jni_arg);
   16.18 +#endif
   16.19  }
   16.20 -#endif
   16.21  
   16.22  
   16.23  void InterpreterRuntime::SignatureHandlerGenerator::pass_double() {
   16.24 @@ -185,6 +189,13 @@
   16.25      _from -= 2*Interpreter::stackElementSize;
   16.26      add_signature( non_float );
   16.27    }
   16.28 +
   16.29 +  virtual void pass_float() {
   16.30 +    *_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
   16.31 +    _from -= Interpreter::stackElementSize;
   16.32 +    add_signature( non_float );
   16.33 +  }
   16.34 +
   16.35  #endif // _LP64
   16.36  
   16.37    virtual void add_signature( intptr_t sig_type ) {
    17.1 --- a/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp	Wed Jul 28 17:57:43 2010 -0400
    17.2 +++ b/src/cpu/sparc/vm/javaFrameAnchor_sparc.hpp	Tue Aug 03 08:13:38 2010 -0400
    17.3 @@ -76,6 +76,8 @@
    17.4  
    17.5    void set_last_Java_sp(intptr_t* sp)            { _last_Java_sp = sp; }
    17.6  
    17.7 +  address last_Java_pc(void)                     { return _last_Java_pc; }
    17.8 +
    17.9    // These are only used by friends
   17.10  private:
   17.11  
    18.1 --- a/src/cpu/sparc/vm/templateTable_sparc.cpp	Wed Jul 28 17:57:43 2010 -0400
    18.2 +++ b/src/cpu/sparc/vm/templateTable_sparc.cpp	Tue Aug 03 08:13:38 2010 -0400
    18.3 @@ -3236,12 +3236,14 @@
    18.4    __ get_2_byte_integer_at_bcp(1, Rscratch, Roffset, InterpreterMacroAssembler::Unsigned);
    18.5    __ get_cpool_and_tags(Rscratch, G3_scratch);
    18.6    // make sure the class we're about to instantiate has been resolved
    18.7 +  // This is done before loading instanceKlass to be consistent with the order
    18.8 +  // how Constant Pool is updated (see constantPoolOopDesc::klass_at_put)
    18.9    __ add(G3_scratch, typeArrayOopDesc::header_size(T_BYTE) * wordSize, G3_scratch);
   18.10    __ ldub(G3_scratch, Roffset, G3_scratch);
   18.11    __ cmp(G3_scratch, JVM_CONSTANT_Class);
   18.12    __ br(Assembler::notEqual, false, Assembler::pn, slow_case);
   18.13    __ delayed()->sll(Roffset, LogBytesPerWord, Roffset);
   18.14 -
   18.15 +  // get instanceKlass
   18.16    //__ sll(Roffset, LogBytesPerWord, Roffset);        // executed in delay slot
   18.17    __ add(Roffset, sizeof(constantPoolOopDesc), Roffset);
   18.18    __ ld_ptr(Rscratch, Roffset, RinstanceKlass);
    19.1 --- a/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp	Wed Jul 28 17:57:43 2010 -0400
    19.2 +++ b/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp	Tue Aug 03 08:13:38 2010 -0400
    19.3 @@ -236,11 +236,11 @@
    19.4  }
    19.5  
    19.6  inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) {
    19.7 -  return op1 <<  op2;
    19.8 +  return op1 << op2;
    19.9  }
   19.10  
   19.11  inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) {
   19.12 -  return op1 >>  op2; // QQ op2 & 0x1f??
   19.13 +  return op1 >> (op2 & 0x1f);
   19.14  }
   19.15  
   19.16  inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) {
   19.17 @@ -248,7 +248,7 @@
   19.18  }
   19.19  
   19.20  inline jint BytecodeInterpreter::VMintUshr(jint op1, jint op2) {
   19.21 -  return ((juint) op1) >> op2; // QQ op2 & 0x1f??
   19.22 +  return ((juint) op1) >> (op2 & 0x1f);
   19.23  }
   19.24  
   19.25  inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) {
    20.1 --- a/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Wed Jul 28 17:57:43 2010 -0400
    20.2 +++ b/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp	Tue Aug 03 08:13:38 2010 -0400
    20.3 @@ -349,7 +349,7 @@
    20.4    LIR_Opr lock = new_register(T_INT);
    20.5    LIR_Opr obj_temp = new_register(T_INT);
    20.6    set_no_result(x);
    20.7 -  monitor_exit(obj_temp, lock, syncTempOpr(), x->monitor_no());
    20.8 +  monitor_exit(obj_temp, lock, syncTempOpr(), LIR_OprFact::illegalOpr, x->monitor_no());
    20.9  }
   20.10  
   20.11  
    21.1 --- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Wed Jul 28 17:57:43 2010 -0400
    21.2 +++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Tue Aug 03 08:13:38 2010 -0400
    21.3 @@ -1779,3 +1779,7 @@
    21.4  }
    21.5  
    21.6  #undef __
    21.7 +
    21.8 +const char *Runtime1::pd_name_for_address(address entry) {
    21.9 +  return "<unknown function>";
   21.10 +}
    22.1 --- a/src/cpu/x86/vm/frame_x86.cpp	Wed Jul 28 17:57:43 2010 -0400
    22.2 +++ b/src/cpu/x86/vm/frame_x86.cpp	Tue Aug 03 08:13:38 2010 -0400
    22.3 @@ -575,8 +575,8 @@
    22.4  
    22.5  BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) {
    22.6  #ifdef CC_INTERP
    22.7 -  // Needed for JVMTI. The result should always be in the interpreterState object
    22.8 -  assert(false, "NYI");
    22.9 +  // Needed for JVMTI. The result should always be in the
   22.10 +  // interpreterState object
   22.11    interpreterState istate = get_interpreterState();
   22.12  #endif // CC_INTERP
   22.13    assert(is_interpreted_frame(), "interpreted frame expected");
    23.1 --- a/src/cpu/x86/vm/interpreterRT_x86_32.cpp	Wed Jul 28 17:57:43 2010 -0400
    23.2 +++ b/src/cpu/x86/vm/interpreterRT_x86_32.cpp	Tue Aug 03 08:13:38 2010 -0400
    23.3 @@ -34,6 +34,10 @@
    23.4    move(offset(), jni_offset() + 1);
    23.5  }
    23.6  
    23.7 +void InterpreterRuntime::SignatureHandlerGenerator::pass_float() {
    23.8 +  move(offset(), jni_offset() + 1);
    23.9 +}
   23.10 +
   23.11  void InterpreterRuntime::SignatureHandlerGenerator::pass_long() {
   23.12     move(offset(), jni_offset() + 2);
   23.13     move(offset() + 1, jni_offset() + 1);
   23.14 @@ -91,6 +95,11 @@
   23.15      _from -= Interpreter::stackElementSize;
   23.16    }
   23.17  
   23.18 +  virtual void pass_float() {
   23.19 +    *_to++ = *(jint *)(_from+Interpreter::local_offset_in_bytes(0));
   23.20 +    _from -= Interpreter::stackElementSize;
   23.21 +  }
   23.22 +
   23.23    virtual void pass_long() {
   23.24      _to[0] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(1));
   23.25      _to[1] = *(intptr_t*)(_from+Interpreter::local_offset_in_bytes(0));
    24.1 --- a/src/cpu/x86/vm/javaFrameAnchor_x86.hpp	Wed Jul 28 17:57:43 2010 -0400
    24.2 +++ b/src/cpu/x86/vm/javaFrameAnchor_x86.hpp	Tue Aug 03 08:13:38 2010 -0400
    24.3 @@ -66,6 +66,8 @@
    24.4  
    24.5    intptr_t* last_Java_sp(void) const             { return _last_Java_sp; }
    24.6  
    24.7 +  address last_Java_pc(void)                     { return _last_Java_pc; }
    24.8 +
    24.9  private:
   24.10  
   24.11    static ByteSize last_Java_fp_offset()          { return byte_offset_of(JavaFrameAnchor, _last_Java_fp); }
    25.1 --- a/src/cpu/x86/vm/templateTable_x86_32.cpp	Wed Jul 28 17:57:43 2010 -0400
    25.2 +++ b/src/cpu/x86/vm/templateTable_x86_32.cpp	Tue Aug 03 08:13:38 2010 -0400
    25.3 @@ -3112,22 +3112,25 @@
    25.4    transition(vtos, atos);
    25.5    __ get_unsigned_2_byte_index_at_bcp(rdx, 1);
    25.6    Label slow_case;
    25.7 +  Label slow_case_no_pop;
    25.8    Label done;
    25.9    Label initialize_header;
   25.10    Label initialize_object;  // including clearing the fields
   25.11    Label allocate_shared;
   25.12  
   25.13    __ get_cpool_and_tags(rcx, rax);
   25.14 +
   25.15 +  // Make sure the class we're about to instantiate has been resolved.
   25.16 +  // This is done before loading instanceKlass to be consistent with the order
   25.17 +  // how Constant Pool is updated (see constantPoolOopDesc::klass_at_put)
   25.18 +  const int tags_offset = typeArrayOopDesc::header_size(T_BYTE) * wordSize;
   25.19 +  __ cmpb(Address(rax, rdx, Address::times_1, tags_offset), JVM_CONSTANT_Class);
   25.20 +  __ jcc(Assembler::notEqual, slow_case_no_pop);
   25.21 +
   25.22    // get instanceKlass
   25.23    __ movptr(rcx, Address(rcx, rdx, Address::times_ptr, sizeof(constantPoolOopDesc)));
   25.24    __ push(rcx);  // save the contexts of klass for initializing the header
   25.25  
   25.26 -  // make sure the class we're about to instantiate has been resolved.
   25.27 -  // Note: slow_case does a pop of stack, which is why we loaded class/pushed above
   25.28 -  const int tags_offset = typeArrayOopDesc::header_size(T_BYTE) * wordSize;
   25.29 -  __ cmpb(Address(rax, rdx, Address::times_1, tags_offset), JVM_CONSTANT_Class);
   25.30 -  __ jcc(Assembler::notEqual, slow_case);
   25.31 -
   25.32    // make sure klass is initialized & doesn't have finalizer
   25.33    // make sure klass is fully initialized
   25.34    __ cmpl(Address(rcx, instanceKlass::init_state_offset_in_bytes() + sizeof(oopDesc)), instanceKlass::fully_initialized);
   25.35 @@ -3255,6 +3258,7 @@
   25.36    // slow case
   25.37    __ bind(slow_case);
   25.38    __ pop(rcx);   // restore stack pointer to what it was when we came in.
   25.39 +  __ bind(slow_case_no_pop);
   25.40    __ get_constant_pool(rax);
   25.41    __ get_unsigned_2_byte_index_at_bcp(rdx, 1);
   25.42    call_VM(rax, CAST_FROM_FN_PTR(address, InterpreterRuntime::_new), rax, rdx);
    26.1 --- a/src/cpu/x86/vm/templateTable_x86_64.cpp	Wed Jul 28 17:57:43 2010 -0400
    26.2 +++ b/src/cpu/x86/vm/templateTable_x86_64.cpp	Tue Aug 03 08:13:38 2010 -0400
    26.3 @@ -3126,18 +3126,18 @@
    26.4    Label allocate_shared;
    26.5  
    26.6    __ get_cpool_and_tags(rsi, rax);
    26.7 -  // get instanceKlass
    26.8 -  __ movptr(rsi, Address(rsi, rdx,
    26.9 -                         Address::times_8, sizeof(constantPoolOopDesc)));
   26.10 -
   26.11 -  // make sure the class we're about to instantiate has been
   26.12 -  // resolved. Note: slow_case does a pop of stack, which is why we
   26.13 -  // loaded class/pushed above
   26.14 +  // Make sure the class we're about to instantiate has been resolved.
   26.15 +  // This is done before loading instanceKlass to be consistent with the order
   26.16 +  // how Constant Pool is updated (see constantPoolOopDesc::klass_at_put)
   26.17    const int tags_offset = typeArrayOopDesc::header_size(T_BYTE) * wordSize;
   26.18    __ cmpb(Address(rax, rdx, Address::times_1, tags_offset),
   26.19            JVM_CONSTANT_Class);
   26.20    __ jcc(Assembler::notEqual, slow_case);
   26.21  
   26.22 +  // get instanceKlass
   26.23 +  __ movptr(rsi, Address(rsi, rdx,
   26.24 +            Address::times_8, sizeof(constantPoolOopDesc)));
   26.25 +
   26.26    // make sure klass is initialized & doesn't have finalizer
   26.27    // make sure klass is fully initialized
   26.28    __ cmpl(Address(rsi,
    27.1 --- a/src/os/linux/launcher/java_md.c	Wed Jul 28 17:57:43 2010 -0400
    27.2 +++ b/src/os/linux/launcher/java_md.c	Tue Aug 03 08:13:38 2010 -0400
    27.3 @@ -79,6 +79,10 @@
    27.4  #    define ARCH "i386"
    27.5  #  elif defined(__sparc)
    27.6  #    define ARCH "sparc"
    27.7 +#  elif defined(arm)
    27.8 +#    define ARCH "arm"
    27.9 +#  elif defined(PPC)
   27.10 +#    define ARCH "ppc"
   27.11  #  endif
   27.12  
   27.13  #endif /* _LP64 */
    28.1 --- a/src/os/linux/vm/os_linux.cpp	Wed Jul 28 17:57:43 2010 -0400
    28.2 +++ b/src/os/linux/vm/os_linux.cpp	Tue Aug 03 08:13:38 2010 -0400
    28.3 @@ -30,6 +30,8 @@
    28.4  // put OS-includes here
    28.5  # include <sys/types.h>
    28.6  # include <sys/mman.h>
    28.7 +# include <sys/stat.h>
    28.8 +# include <sys/select.h>
    28.9  # include <pthread.h>
   28.10  # include <signal.h>
   28.11  # include <errno.h>
   28.12 @@ -188,6 +190,10 @@
   28.13  static char cpu_arch[] = "i386";
   28.14  #elif defined(AMD64)
   28.15  static char cpu_arch[] = "amd64";
   28.16 +#elif defined(ARM)
   28.17 +static char cpu_arch[] = "arm";
   28.18 +#elif defined(PPC)
   28.19 +static char cpu_arch[] = "ppc";
   28.20  #elif defined(SPARC)
   28.21  #  ifdef _LP64
   28.22  static char cpu_arch[] = "sparcv9";
   28.23 @@ -1137,8 +1143,8 @@
   28.24      long it_real;
   28.25      uintptr_t start;
   28.26      uintptr_t vsize;
   28.27 -    uintptr_t rss;
   28.28 -    unsigned long rsslim;
   28.29 +    intptr_t rss;
   28.30 +    uintptr_t rsslim;
   28.31      uintptr_t scodes;
   28.32      uintptr_t ecode;
   28.33      int i;
   28.34 @@ -1168,12 +1174,12 @@
   28.35          // Skip blank chars
   28.36          do s++; while (isspace(*s));
   28.37  
   28.38 -        /*                                     1   1   1   1   1   1   1   1   1   1   2   2   2   2   2   2   2   2   2 */
   28.39 -        /*              3  4  5  6  7  8   9   0   1   2   3   4   5   6   7   8   9   0   1   2   3   4   5   6   7   8 */
   28.40 -        i = sscanf(s, "%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld "
   28.41 -                   UINTX_FORMAT UINTX_FORMAT UINTX_FORMAT
   28.42 -                   " %lu "
   28.43 -                   UINTX_FORMAT UINTX_FORMAT UINTX_FORMAT,
   28.44 +#define _UFM UINTX_FORMAT
   28.45 +#define _DFM INTX_FORMAT
   28.46 +
   28.47 +        /*                                     1   1   1   1   1   1   1   1   1   1   2   2    2    2    2    2    2    2    2 */
   28.48 +        /*              3  4  5  6  7  8   9   0   1   2   3   4   5   6   7   8   9   0   1    2    3    4    5    6    7    8 */
   28.49 +        i = sscanf(s, "%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld " _UFM _UFM _DFM _UFM _UFM _UFM _UFM,
   28.50               &state,          /* 3  %c  */
   28.51               &ppid,           /* 4  %d  */
   28.52               &pgrp,           /* 5  %d  */
   28.53 @@ -1193,15 +1199,18 @@
   28.54               &nice,           /* 19 %ld  */
   28.55               &junk,           /* 20 %ld  */
   28.56               &it_real,        /* 21 %ld  */
   28.57 -             &start,          /* 22 UINTX_FORMAT  */
   28.58 -             &vsize,          /* 23 UINTX_FORMAT  */
   28.59 -             &rss,            /* 24 UINTX_FORMAT  */
   28.60 -             &rsslim,         /* 25 %lu  */
   28.61 -             &scodes,         /* 26 UINTX_FORMAT  */
   28.62 -             &ecode,          /* 27 UINTX_FORMAT  */
   28.63 -             &stack_start);   /* 28 UINTX_FORMAT  */
   28.64 +             &start,          /* 22 UINTX_FORMAT */
   28.65 +             &vsize,          /* 23 UINTX_FORMAT */
   28.66 +             &rss,            /* 24 INTX_FORMAT  */
   28.67 +             &rsslim,         /* 25 UINTX_FORMAT */
   28.68 +             &scodes,         /* 26 UINTX_FORMAT */
   28.69 +             &ecode,          /* 27 UINTX_FORMAT */
   28.70 +             &stack_start);   /* 28 UINTX_FORMAT */
   28.71        }
   28.72  
   28.73 +#undef _UFM
   28.74 +#undef _DFM
   28.75 +
   28.76        if (i != 28 - 2) {
   28.77           assert(false, "Bad conversion from /proc/self/stat");
   28.78           // product mode - assume we are the initial thread, good luck in the
   28.79 @@ -1336,14 +1345,16 @@
   28.80  
   28.81  #if defined(IA32) || defined(AMD64)
   28.82  #define SYS_clock_getres IA32_ONLY(266)  AMD64_ONLY(229)
   28.83 +#define sys_clock_getres(x,y)  ::syscall(SYS_clock_getres, x, y)
   28.84  #else
   28.85 -#error Value of SYS_clock_getres not known on this platform
   28.86 +#warning "SYS_clock_getres not defined for this platform, disabling fast_thread_cpu_time"
   28.87 +#define sys_clock_getres(x,y)  -1
   28.88  #endif
   28.89  
   28.90 +#else
   28.91 +#define sys_clock_getres(x,y)  ::syscall(SYS_clock_getres, x, y)
   28.92  #endif
   28.93  
   28.94 -#define sys_clock_getres(x,y)  ::syscall(SYS_clock_getres, x, y)
   28.95 -
   28.96  void os::Linux::fast_thread_clock_init() {
   28.97    if (!UseLinuxPosixThreadCPUClocks) {
   28.98      return;
   28.99 @@ -1905,7 +1916,9 @@
  28.100        !_print_ascii_file("/etc/SuSE-release", st) &&
  28.101        !_print_ascii_file("/etc/turbolinux-release", st) &&
  28.102        !_print_ascii_file("/etc/gentoo-release", st) &&
  28.103 -      !_print_ascii_file("/etc/debian_version", st)) {
  28.104 +      !_print_ascii_file("/etc/debian_version", st) &&
  28.105 +      !_print_ascii_file("/etc/ltib-release", st) &&
  28.106 +      !_print_ascii_file("/etc/angstrom-version", st)) {
  28.107        st->print("Linux");
  28.108    }
  28.109    st->cr();
  28.110 @@ -1971,6 +1984,11 @@
  28.111    os::loadavg(loadavg, 3);
  28.112    st->print("%0.02f %0.02f %0.02f", loadavg[0], loadavg[1], loadavg[2]);
  28.113    st->cr();
  28.114 +
  28.115 +  // meminfo
  28.116 +  st->print("\n/proc/meminfo:\n");
  28.117 +  _print_ascii_file("/proc/meminfo", st);
  28.118 +  st->cr();
  28.119  }
  28.120  
  28.121  void os::print_memory_info(outputStream* st) {
  28.122 @@ -2097,7 +2115,8 @@
  28.123                  CAST_FROM_FN_PTR(address, os::jvm_path),
  28.124                  dli_fname, sizeof(dli_fname), NULL);
  28.125    assert(ret != 0, "cannot locate libjvm");
  28.126 -  if (realpath(dli_fname, buf) == NULL)
  28.127 +  char *rp = realpath(dli_fname, buf);
  28.128 +  if (rp == NULL)
  28.129      return;
  28.130  
  28.131    if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) {
  28.132 @@ -2125,7 +2144,8 @@
  28.133          assert(strstr(p, "/libjvm") == p, "invalid library name");
  28.134          p = strstr(p, "_g") ? "_g" : "";
  28.135  
  28.136 -        if (realpath(java_home_var, buf) == NULL)
  28.137 +        rp = realpath(java_home_var, buf);
  28.138 +        if (rp == NULL)
  28.139            return;
  28.140  
  28.141          // determine if this is a legacy image or modules image
  28.142 @@ -2147,7 +2167,8 @@
  28.143            snprintf(buf + len, buflen-len, "/hotspot/libjvm%s.so", p);
  28.144          } else {
  28.145            // Go back to path of .so
  28.146 -          if (realpath(dli_fname, buf) == NULL)
  28.147 +          rp = realpath(dli_fname, buf);
  28.148 +          if (rp == NULL)
  28.149              return;
  28.150          }
  28.151        }
  28.152 @@ -2508,9 +2529,9 @@
  28.153  unsigned long* os::Linux::_numa_all_nodes;
  28.154  
  28.155  bool os::uncommit_memory(char* addr, size_t size) {
  28.156 -  return ::mmap(addr, size, PROT_NONE,
  28.157 -                MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE|MAP_ANONYMOUS, -1, 0)
  28.158 -    != MAP_FAILED;
  28.159 +  uintptr_t res = (uintptr_t) ::mmap(addr, size, PROT_NONE,
  28.160 +                MAP_PRIVATE|MAP_FIXED|MAP_NORESERVE|MAP_ANONYMOUS, -1, 0);
  28.161 +  return res  != (uintptr_t) MAP_FAILED;
  28.162  }
  28.163  
  28.164  // Linux uses a growable mapping for the stack, and if the mapping for
  28.165 @@ -2718,7 +2739,8 @@
  28.166      // the processor.
  28.167  
  28.168  #ifndef ZERO
  28.169 -    _large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M);
  28.170 +    _large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M)
  28.171 +                       ARM_ONLY(2 * M) PPC_ONLY(4 * M);
  28.172  #endif // ZERO
  28.173  
  28.174      FILE *fp = fopen("/proc/meminfo", "r");
  28.175 @@ -3981,6 +4003,9 @@
  28.176    return JNI_OK;
  28.177  }
  28.178  
  28.179 +// this is called at the end of vm_initialization
  28.180 +void os::init_3(void) { }
  28.181 +
  28.182  // Mark the polling page as unreadable
  28.183  void os::make_polling_page_unreadable(void) {
  28.184    if( !guard_memory((char*)_polling_page, Linux::page_size()) )
  28.185 @@ -4061,7 +4086,6 @@
  28.186  ////////////////////////////////////////////////////////////////////////////////
  28.187  // debug support
  28.188  
  28.189 -#ifndef PRODUCT
  28.190  static address same_page(address x, address y) {
  28.191    int page_bits = -os::vm_page_size();
  28.192    if ((intptr_t(x) & page_bits) == (intptr_t(y) & page_bits))
  28.193 @@ -4072,26 +4096,26 @@
  28.194      return (address)(intptr_t(y) & page_bits);
  28.195  }
  28.196  
  28.197 -bool os::find(address addr) {
  28.198 +bool os::find(address addr, outputStream* st) {
  28.199    Dl_info dlinfo;
  28.200    memset(&dlinfo, 0, sizeof(dlinfo));
  28.201    if (dladdr(addr, &dlinfo)) {
  28.202 -    tty->print(PTR_FORMAT ": ", addr);
  28.203 +    st->print(PTR_FORMAT ": ", addr);
  28.204      if (dlinfo.dli_sname != NULL) {
  28.205 -      tty->print("%s+%#x", dlinfo.dli_sname,
  28.206 +      st->print("%s+%#x", dlinfo.dli_sname,
  28.207                   addr - (intptr_t)dlinfo.dli_saddr);
  28.208      } else if (dlinfo.dli_fname) {
  28.209 -      tty->print("<offset %#x>", addr - (intptr_t)dlinfo.dli_fbase);
  28.210 +      st->print("<offset %#x>", addr - (intptr_t)dlinfo.dli_fbase);
  28.211      } else {
  28.212 -      tty->print("<absolute address>");
  28.213 +      st->print("<absolute address>");
  28.214      }
  28.215      if (dlinfo.dli_fname) {
  28.216 -      tty->print(" in %s", dlinfo.dli_fname);
  28.217 +      st->print(" in %s", dlinfo.dli_fname);
  28.218      }
  28.219      if (dlinfo.dli_fbase) {
  28.220 -      tty->print(" at " PTR_FORMAT, dlinfo.dli_fbase);
  28.221 +      st->print(" at " PTR_FORMAT, dlinfo.dli_fbase);
  28.222      }
  28.223 -    tty->cr();
  28.224 +    st->cr();
  28.225  
  28.226      if (Verbose) {
  28.227        // decode some bytes around the PC
  28.228 @@ -4104,15 +4128,13 @@
  28.229        if (dladdr(end, &dlinfo2) && dlinfo2.dli_saddr != dlinfo.dli_saddr
  28.230            && end > dlinfo2.dli_saddr && dlinfo2.dli_saddr > begin)
  28.231          end = (address) dlinfo2.dli_saddr;
  28.232 -      Disassembler::decode(begin, end);
  28.233 +      Disassembler::decode(begin, end, st);
  28.234      }
  28.235      return true;
  28.236    }
  28.237    return false;
  28.238  }
  28.239  
  28.240 -#endif
  28.241 -
  28.242  ////////////////////////////////////////////////////////////////////////////////
  28.243  // misc
  28.244  
  28.245 @@ -4321,6 +4343,7 @@
  28.246    int count;
  28.247    long sys_time, user_time;
  28.248    char string[64];
  28.249 +  char cdummy;
  28.250    int idummy;
  28.251    long ldummy;
  28.252    FILE *fp;
  28.253 @@ -4381,11 +4404,11 @@
  28.254    // Skip blank chars
  28.255    do s++; while (isspace(*s));
  28.256  
  28.257 -  count = sscanf(s,"%*c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu",
  28.258 -                 &idummy, &idummy, &idummy, &idummy, &idummy,
  28.259 +  count = sscanf(s,"%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu",
  28.260 +                 &cdummy, &idummy, &idummy, &idummy, &idummy, &idummy,
  28.261                   &ldummy, &ldummy, &ldummy, &ldummy, &ldummy,
  28.262                   &user_time, &sys_time);
  28.263 -  if ( count != 12 ) return -1;
  28.264 +  if ( count != 13 ) return -1;
  28.265    if (user_sys_cpu_time) {
  28.266      return ((jlong)sys_time + (jlong)user_time) * (1000000000 / clock_tics_per_sec);
  28.267    } else {
  28.268 @@ -4980,3 +5003,43 @@
  28.269      }
  28.270    }
  28.271  }
  28.272 +
  28.273 +// is_headless_jre()
  28.274 +//
  28.275 +// Test for the existence of libmawt in motif21 or xawt directories
  28.276 +// in order to report if we are running in a headless jre
  28.277 +//
  28.278 +bool os::is_headless_jre() {
  28.279 +    struct stat statbuf;
  28.280 +    char buf[MAXPATHLEN];
  28.281 +    char libmawtpath[MAXPATHLEN];
  28.282 +    const char *xawtstr  = "/xawt/libmawt.so";
  28.283 +    const char *motifstr = "/motif21/libmawt.so";
  28.284 +    char *p;
  28.285 +
  28.286 +    // Get path to libjvm.so
  28.287 +    os::jvm_path(buf, sizeof(buf));
  28.288 +
  28.289 +    // Get rid of libjvm.so
  28.290 +    p = strrchr(buf, '/');
  28.291 +    if (p == NULL) return false;
  28.292 +    else *p = '\0';
  28.293 +
  28.294 +    // Get rid of client or server
  28.295 +    p = strrchr(buf, '/');
  28.296 +    if (p == NULL) return false;
  28.297 +    else *p = '\0';
  28.298 +
  28.299 +    // check xawt/libmawt.so
  28.300 +    strcpy(libmawtpath, buf);
  28.301 +    strcat(libmawtpath, xawtstr);
  28.302 +    if (::stat(libmawtpath, &statbuf) == 0) return false;
  28.303 +
  28.304 +    // check motif21/libmawt.so
  28.305 +    strcpy(libmawtpath, buf);
  28.306 +    strcat(libmawtpath, motifstr);
  28.307 +    if (::stat(libmawtpath, &statbuf) == 0) return false;
  28.308 +
  28.309 +    return true;
  28.310 +}
  28.311 +
    29.1 --- a/src/os/solaris/vm/os_solaris.cpp	Wed Jul 28 17:57:43 2010 -0400
    29.2 +++ b/src/os/solaris/vm/os_solaris.cpp	Tue Aug 03 08:13:38 2010 -0400
    29.3 @@ -1839,8 +1839,8 @@
    29.4  
    29.5    // Quietly truncate on buffer overflow.  Should be an error.
    29.6    if (pnamelen + strlen(fname) + 10 > (size_t) buflen) {
    29.7 -      *buffer = '\0';
    29.8 -      return;
    29.9 +    *buffer = '\0';
   29.10 +    return;
   29.11    }
   29.12  
   29.13    if (pnamelen == 0) {
   29.14 @@ -2051,7 +2051,8 @@
   29.15      {EM_SPARC32PLUS, EM_SPARC,   ELFCLASS32, ELFDATA2MSB, (char*)"Sparc 32"},
   29.16      {EM_SPARCV9,     EM_SPARCV9, ELFCLASS64, ELFDATA2MSB, (char*)"Sparc v9 64"},
   29.17      {EM_PPC,         EM_PPC,     ELFCLASS32, ELFDATA2MSB, (char*)"Power PC 32"},
   29.18 -    {EM_PPC64,       EM_PPC64,   ELFCLASS64, ELFDATA2MSB, (char*)"Power PC 64"}
   29.19 +    {EM_PPC64,       EM_PPC64,   ELFCLASS64, ELFDATA2MSB, (char*)"Power PC 64"},
   29.20 +    {EM_ARM,         EM_ARM,     ELFCLASS32, ELFDATA2LSB, (char*)"ARM 32"}
   29.21    };
   29.22  
   29.23    #if  (defined IA32)
   29.24 @@ -2068,9 +2069,11 @@
   29.25      static  Elf32_Half running_arch_code=EM_PPC64;
   29.26    #elif  (defined __powerpc__)
   29.27      static  Elf32_Half running_arch_code=EM_PPC;
   29.28 +  #elif (defined ARM)
   29.29 +    static  Elf32_Half running_arch_code=EM_ARM;
   29.30    #else
   29.31      #error Method os::dll_load requires that one of following is defined:\
   29.32 -         IA32, AMD64, IA64, __sparc, __powerpc__
   29.33 +         IA32, AMD64, IA64, __sparc, __powerpc__, ARM, ARM
   29.34    #endif
   29.35  
   29.36    // Identify compatability class for VM's architecture and library's architecture
   29.37 @@ -3149,7 +3152,8 @@
   29.38    // ISM is only recommended on old Solaris where there is no MPSS support.
   29.39    // Simply choose a conservative value as default.
   29.40    *page_size = LargePageSizeInBytes ? LargePageSizeInBytes :
   29.41 -               SPARC_ONLY(4 * M) IA32_ONLY(4 * M) AMD64_ONLY(2 * M);
   29.42 +               SPARC_ONLY(4 * M) IA32_ONLY(4 * M) AMD64_ONLY(2 * M)
   29.43 +               ARM_ONLY(2 * M);
   29.44  
   29.45    // ISM is available on all supported Solaris versions
   29.46    return true;
   29.47 @@ -5007,6 +5011,9 @@
   29.48    return JNI_OK;
   29.49  }
   29.50  
   29.51 +void os::init_3(void) {
   29.52 +  return;
   29.53 +}
   29.54  
   29.55  // Mark the polling page as unreadable
   29.56  void os::make_polling_page_unreadable(void) {
   29.57 @@ -5412,7 +5419,6 @@
   29.58  }
   29.59  
   29.60  //---------------------------------------------------------------------------------
   29.61 -#ifndef PRODUCT
   29.62  
   29.63  static address same_page(address x, address y) {
   29.64    intptr_t page_bits = -os::vm_page_size();
   29.65 @@ -5424,28 +5430,28 @@
   29.66      return (address)(intptr_t(y) & page_bits);
   29.67  }
   29.68  
   29.69 -bool os::find(address addr) {
   29.70 +bool os::find(address addr, outputStream* st) {
   29.71    Dl_info dlinfo;
   29.72    memset(&dlinfo, 0, sizeof(dlinfo));
   29.73    if (dladdr(addr, &dlinfo)) {
   29.74  #ifdef _LP64
   29.75 -    tty->print("0x%016lx: ", addr);
   29.76 +    st->print("0x%016lx: ", addr);
   29.77  #else
   29.78 -    tty->print("0x%08x: ", addr);
   29.79 +    st->print("0x%08x: ", addr);
   29.80  #endif
   29.81      if (dlinfo.dli_sname != NULL)
   29.82 -      tty->print("%s+%#lx", dlinfo.dli_sname, addr-(intptr_t)dlinfo.dli_saddr);
   29.83 +      st->print("%s+%#lx", dlinfo.dli_sname, addr-(intptr_t)dlinfo.dli_saddr);
   29.84      else if (dlinfo.dli_fname)
   29.85 -      tty->print("<offset %#lx>", addr-(intptr_t)dlinfo.dli_fbase);
   29.86 +      st->print("<offset %#lx>", addr-(intptr_t)dlinfo.dli_fbase);
   29.87      else
   29.88 -      tty->print("<absolute address>");
   29.89 -    if (dlinfo.dli_fname)  tty->print(" in %s", dlinfo.dli_fname);
   29.90 +      st->print("<absolute address>");
   29.91 +    if (dlinfo.dli_fname)  st->print(" in %s", dlinfo.dli_fname);
   29.92  #ifdef _LP64
   29.93 -    if (dlinfo.dli_fbase)  tty->print(" at 0x%016lx", dlinfo.dli_fbase);
   29.94 +    if (dlinfo.dli_fbase)  st->print(" at 0x%016lx", dlinfo.dli_fbase);
   29.95  #else
   29.96 -    if (dlinfo.dli_fbase)  tty->print(" at 0x%08x", dlinfo.dli_fbase);
   29.97 +    if (dlinfo.dli_fbase)  st->print(" at 0x%08x", dlinfo.dli_fbase);
   29.98  #endif
   29.99 -    tty->cr();
  29.100 +    st->cr();
  29.101  
  29.102      if (Verbose) {
  29.103        // decode some bytes around the PC
  29.104 @@ -5458,16 +5464,13 @@
  29.105        if (dladdr(end, &dlinfo2) && dlinfo2.dli_saddr != dlinfo.dli_saddr
  29.106            && end > dlinfo2.dli_saddr && dlinfo2.dli_saddr > begin)
  29.107          end = (address) dlinfo2.dli_saddr;
  29.108 -      Disassembler::decode(begin, end);
  29.109 +      Disassembler::decode(begin, end, st);
  29.110      }
  29.111      return true;
  29.112    }
  29.113    return false;
  29.114  }
  29.115  
  29.116 -#endif
  29.117 -
  29.118 -
  29.119  // Following function has been added to support HotSparc's libjvm.so running
  29.120  // under Solaris production JDK 1.2.2 / 1.3.0.  These came from
  29.121  // src/solaris/hpi/native_threads in the EVM codebase.
  29.122 @@ -5910,7 +5913,6 @@
  29.123    if (jt->handle_special_suspend_equivalent_condition()) {
  29.124      jt->java_suspend_self();
  29.125    }
  29.126 -
  29.127    OrderAccess::fence();
  29.128  }
  29.129  
  29.130 @@ -5997,3 +5999,44 @@
  29.131      }
  29.132    }
  29.133  }
  29.134 +
  29.135 +// is_headless_jre()
  29.136 +//
  29.137 +// Test for the existence of libmawt in motif21 or xawt directories
  29.138 +// in order to report if we are running in a headless jre
  29.139 +//
  29.140 +bool os::is_headless_jre() {
  29.141 +    struct stat statbuf;
  29.142 +    char buf[MAXPATHLEN];
  29.143 +    char libmawtpath[MAXPATHLEN];
  29.144 +    const char *xawtstr  = "/xawt/libmawt.so";
  29.145 +    const char *motifstr = "/motif21/libmawt.so";
  29.146 +    char *p;
  29.147 +
  29.148 +    // Get path to libjvm.so
  29.149 +    os::jvm_path(buf, sizeof(buf));
  29.150 +
  29.151 +    // Get rid of libjvm.so
  29.152 +    p = strrchr(buf, '/');
  29.153 +    if (p == NULL) return false;
  29.154 +    else *p = '\0';
  29.155 +
  29.156 +    // Get rid of client or server
  29.157 +    p = strrchr(buf, '/');
  29.158 +    if (p == NULL) return false;
  29.159 +    else *p = '\0';
  29.160 +
  29.161 +    // check xawt/libmawt.so
  29.162 +    strcpy(libmawtpath, buf);
  29.163 +    strcat(libmawtpath, xawtstr);
  29.164 +    if (::stat(libmawtpath, &statbuf) == 0) return false;
  29.165 +
  29.166 +    // check motif21/libmawt.so
  29.167 +    strcpy(libmawtpath, buf);
  29.168 +    strcat(libmawtpath, motifstr);
  29.169 +    if (::stat(libmawtpath, &statbuf) == 0) return false;
  29.170 +
  29.171 +    return true;
  29.172 +}
  29.173 +
  29.174 +
    30.1 --- a/src/os/windows/vm/os_windows.cpp	Wed Jul 28 17:57:43 2010 -0400
    30.2 +++ b/src/os/windows/vm/os_windows.cpp	Tue Aug 03 08:13:38 2010 -0400
    30.3 @@ -3444,6 +3444,9 @@
    30.4    return JNI_OK;
    30.5  }
    30.6  
    30.7 +void os::init_3(void) {
    30.8 +  return;
    30.9 +}
   30.10  
   30.11  // Mark the polling page as unreadable
   30.12  void os::make_polling_page_unreadable(void) {
   30.13 @@ -4105,12 +4108,10 @@
   30.14  }
   30.15  
   30.16  
   30.17 -#ifndef PRODUCT
   30.18 -bool os::find(address addr) {
   30.19 +bool os::find(address addr, outputStream* st) {
   30.20    // Nothing yet
   30.21    return false;
   30.22  }
   30.23 -#endif
   30.24  
   30.25  LONG WINAPI os::win32::serialize_fault_filter(struct _EXCEPTION_POINTERS* e) {
   30.26    DWORD exception_code = e->ExceptionRecord->ExceptionCode;
   30.27 @@ -4164,3 +4165,8 @@
   30.28      }
   30.29      return 0;
   30.30  }
   30.31 +
   30.32 +
   30.33 +// We don't build a headless jre for Windows
   30.34 +bool os::is_headless_jre() { return false; }
   30.35 +
    31.1 --- a/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp	Wed Jul 28 17:57:43 2010 -0400
    31.2 +++ b/src/os_cpu/linux_sparc/vm/thread_linux_sparc.cpp	Tue Aug 03 08:13:38 2010 -0400
    31.3 @@ -105,3 +105,6 @@
    31.4    // nothing else to try
    31.5    return false;
    31.6  }
    31.7 +
    31.8 +void JavaThread::cache_global_variables() { }
    31.9 +
    32.1 --- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Wed Jul 28 17:57:43 2010 -0400
    32.2 +++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp	Tue Aug 03 08:13:38 2010 -0400
    32.3 @@ -718,6 +718,11 @@
    32.4  
    32.5    ucontext_t *uc = (ucontext_t*)context;
    32.6    st->print_cr("Registers:");
    32.7 +
    32.8 +  // this is horrendously verbose but the layout of the registers in the
    32.9 +  // context does not match how we defined our abstract Register set, so
   32.10 +  // we can't just iterate through the gregs area
   32.11 +
   32.12  #ifdef AMD64
   32.13    st->print(  "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
   32.14    st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
   32.15 @@ -745,6 +750,63 @@
   32.16    st->print(", ERR=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ERR]);
   32.17    st->cr();
   32.18    st->print("  TRAPNO=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_TRAPNO]);
   32.19 +
   32.20 +  st->cr();
   32.21 +  st->cr();
   32.22 +
   32.23 +  st->print_cr("Register to memory mapping:");
   32.24 +  st->cr();
   32.25 +
   32.26 +  // this is only for the "general purpose" registers
   32.27 +
   32.28 +  st->print_cr("RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
   32.29 +  print_location(st, uc->uc_mcontext.gregs[REG_RAX]);
   32.30 +  st->cr();
   32.31 +  st->print_cr("RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
   32.32 +  print_location(st, uc->uc_mcontext.gregs[REG_RBX]);
   32.33 +  st->cr();
   32.34 +  st->print_cr("RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
   32.35 +  print_location(st, uc->uc_mcontext.gregs[REG_RCX]);
   32.36 +  st->cr();
   32.37 +  st->print_cr("RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
   32.38 +  print_location(st, uc->uc_mcontext.gregs[REG_RDX]);
   32.39 +  st->cr();
   32.40 +  st->print_cr("RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]);
   32.41 +  print_location(st, uc->uc_mcontext.gregs[REG_RSP]);
   32.42 +  st->cr();
   32.43 +  st->print_cr("RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]);
   32.44 +  print_location(st, uc->uc_mcontext.gregs[REG_RBP]);
   32.45 +  st->cr();
   32.46 +  st->print_cr("RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]);
   32.47 +  print_location(st, uc->uc_mcontext.gregs[REG_RSI]);
   32.48 +  st->cr();
   32.49 +  st->print_cr("RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]);
   32.50 +  print_location(st, uc->uc_mcontext.gregs[REG_RDI]);
   32.51 +  st->cr();
   32.52 +  st->print_cr("R8 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]);
   32.53 +  print_location(st, uc->uc_mcontext.gregs[REG_R8]);
   32.54 +  st->cr();
   32.55 +  st->print_cr("R9 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]);
   32.56 +  print_location(st, uc->uc_mcontext.gregs[REG_R9]);
   32.57 +  st->cr();
   32.58 +  st->print_cr("R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]);
   32.59 +  print_location(st, uc->uc_mcontext.gregs[REG_R10]);
   32.60 +  st->cr();
   32.61 +  st->print_cr("R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]);
   32.62 +  print_location(st, uc->uc_mcontext.gregs[REG_R11]);
   32.63 +  st->cr();
   32.64 +  st->print_cr("R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]);
   32.65 +  print_location(st, uc->uc_mcontext.gregs[REG_R12]);
   32.66 +  st->cr();
   32.67 +  st->print_cr("R13=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R13]);
   32.68 +  print_location(st, uc->uc_mcontext.gregs[REG_R13]);
   32.69 +  st->cr();
   32.70 +  st->print_cr("R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]);
   32.71 +  print_location(st, uc->uc_mcontext.gregs[REG_R14]);
   32.72 +  st->cr();
   32.73 +  st->print_cr("R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]);
   32.74 +  print_location(st, uc->uc_mcontext.gregs[REG_R15]);
   32.75 +
   32.76  #else
   32.77    st->print(  "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]);
   32.78    st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]);
   32.79 @@ -759,6 +821,39 @@
   32.80    st->print(  "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EIP]);
   32.81    st->print(", CR2=" INTPTR_FORMAT, uc->uc_mcontext.cr2);
   32.82    st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EFL]);
   32.83 +
   32.84 +  st->cr();
   32.85 +  st->cr();
   32.86 +
   32.87 +  st->print_cr("Register to memory mapping:");
   32.88 +  st->cr();
   32.89 +
   32.90 +  // this is only for the "general purpose" registers
   32.91 +
   32.92 +  st->print_cr("EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EAX]);
   32.93 +  print_location(st, uc->uc_mcontext.gregs[REG_EAX]);
   32.94 +  st->cr();
   32.95 +  st->print_cr("EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBX]);
   32.96 +  print_location(st, uc->uc_mcontext.gregs[REG_EBX]);
   32.97 +  st->cr();
   32.98 +  st->print_cr("ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ECX]);
   32.99 +  print_location(st, uc->uc_mcontext.gregs[REG_ECX]);
  32.100 +  st->cr();
  32.101 +  st->print_cr("EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDX]);
  32.102 +  print_location(st, uc->uc_mcontext.gregs[REG_EDX]);
  32.103 +  st->cr();
  32.104 +  st->print_cr("ESP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ESP]);
  32.105 +  print_location(st, uc->uc_mcontext.gregs[REG_ESP]);
  32.106 +  st->cr();
  32.107 +  st->print_cr("EBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EBP]);
  32.108 +  print_location(st, uc->uc_mcontext.gregs[REG_EBP]);
  32.109 +  st->cr();
  32.110 +  st->print_cr("ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_ESI]);
  32.111 +  print_location(st, uc->uc_mcontext.gregs[REG_ESI]);
  32.112 +  st->cr();
  32.113 +  st->print_cr("EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_EDI]);
  32.114 +  print_location(st, uc->uc_mcontext.gregs[REG_EDI]);
  32.115 +
  32.116  #endif // AMD64
  32.117    st->cr();
  32.118    st->cr();
    33.1 --- a/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp	Wed Jul 28 17:57:43 2010 -0400
    33.2 +++ b/src/os_cpu/linux_x86/vm/thread_linux_x86.cpp	Tue Aug 03 08:13:38 2010 -0400
    33.3 @@ -79,3 +79,6 @@
    33.4    // nothing else to try
    33.5    return false;
    33.6  }
    33.7 +
    33.8 +void JavaThread::cache_global_variables() { }
    33.9 +
    34.1 --- a/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp	Wed Jul 28 17:57:43 2010 -0400
    34.2 +++ b/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp	Tue Aug 03 08:13:38 2010 -0400
    34.3 @@ -24,3 +24,5 @@
    34.4   */
    34.5  
    34.6  // This file is intentionally empty
    34.7 +
    34.8 +void JavaThread::cache_global_variables() { }
    35.1 --- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Wed Jul 28 17:57:43 2010 -0400
    35.2 +++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Tue Aug 03 08:13:38 2010 -0400
    35.3 @@ -587,6 +587,61 @@
    35.4    st->print_cr(" PC=" INTPTR_FORMAT " nPC=" INTPTR_FORMAT,
    35.5              uc->uc_mcontext.gregs[REG_PC],
    35.6              uc->uc_mcontext.gregs[REG_nPC]);
    35.7 +
    35.8 +  st->cr();
    35.9 +  st->cr();
   35.10 +
   35.11 +  st->print_cr("Register to memory mapping:");
   35.12 +  st->cr();
   35.13 +
   35.14 +  // this is only for the "general purpose" registers
   35.15 +
   35.16 +  st->print_cr("O0=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O0]);
   35.17 +  print_location(st, uc->uc_mcontext.gregs[REG_O0]);
   35.18 +  st->cr();
   35.19 +  st->print_cr("O1=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O1]);
   35.20 +  print_location(st, uc->uc_mcontext.gregs[REG_O1]);
   35.21 +  st->cr();
   35.22 +  st->print_cr("O2=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O2]);
   35.23 +  print_location(st, uc->uc_mcontext.gregs[REG_O2]);
   35.24 +  st->cr();
   35.25 +  st->print_cr("O3=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O3]);
   35.26 +  print_location(st, uc->uc_mcontext.gregs[REG_O3]);
   35.27 +  st->cr();
   35.28 +  st->print_cr("O4=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O4]);
   35.29 +  print_location(st, uc->uc_mcontext.gregs[REG_O4]);
   35.30 +  st->cr();
   35.31 +  st->print_cr("O5=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O5]);
   35.32 +  print_location(st, uc->uc_mcontext.gregs[REG_O5]);
   35.33 +  st->cr();
   35.34 +  st->print_cr("O6=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O6]);
   35.35 +  print_location(st, uc->uc_mcontext.gregs[REG_O6]);
   35.36 +  st->cr();
   35.37 +  st->print_cr("O7=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_O7]);
   35.38 +  print_location(st, uc->uc_mcontext.gregs[REG_O7]);
   35.39 +  st->cr();
   35.40 +
   35.41 +  st->print_cr("G1=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G1]);
   35.42 +  print_location(st, uc->uc_mcontext.gregs[REG_G1]);
   35.43 +  st->cr();
   35.44 +  st->print_cr("G2=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G2]);
   35.45 +  print_location(st, uc->uc_mcontext.gregs[REG_G2]);
   35.46 +  st->cr();
   35.47 +  st->print_cr("G3=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G3]);
   35.48 +  print_location(st, uc->uc_mcontext.gregs[REG_G3]);
   35.49 +  st->cr();
   35.50 +  st->print_cr("G4=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G4]);
   35.51 +  print_location(st, uc->uc_mcontext.gregs[REG_G4]);
   35.52 +  st->cr();
   35.53 +  st->print_cr("G5=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G5]);
   35.54 +  print_location(st, uc->uc_mcontext.gregs[REG_G5]);
   35.55 +  st->cr();
   35.56 +  st->print_cr("G6=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G6]);
   35.57 +  print_location(st, uc->uc_mcontext.gregs[REG_G6]);
   35.58 +  st->cr();
   35.59 +  st->print_cr("G7=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_G7]);
   35.60 +  print_location(st, uc->uc_mcontext.gregs[REG_G7]);
   35.61 +
   35.62    st->cr();
   35.63    st->cr();
   35.64  
    36.1 --- a/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp	Wed Jul 28 17:57:43 2010 -0400
    36.2 +++ b/src/os_cpu/solaris_sparc/vm/thread_solaris_sparc.cpp	Tue Aug 03 08:13:38 2010 -0400
    36.3 @@ -140,3 +140,6 @@
    36.4    *fr_addr = ret_frame;
    36.5    return true;
    36.6  }
    36.7 +
    36.8 +void JavaThread::cache_global_variables() { }
    36.9 +
    37.1 --- a/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Wed Jul 28 17:57:43 2010 -0400
    37.2 +++ b/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp	Tue Aug 03 08:13:38 2010 -0400
    37.3 @@ -719,6 +719,11 @@
    37.4  
    37.5    ucontext_t *uc = (ucontext_t*)context;
    37.6    st->print_cr("Registers:");
    37.7 +
    37.8 +  // this is horrendously verbose but the layout of the registers in the
    37.9 +  // context does not match how we defined our abstract Register set, so
   37.10 +  // we can't just iterate through the gregs area
   37.11 +
   37.12  #ifdef AMD64
   37.13    st->print(  "RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
   37.14    st->print(", RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
   37.15 @@ -742,6 +747,63 @@
   37.16    st->cr();
   37.17    st->print(  "RIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RIP]);
   37.18    st->print(", RFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RFL]);
   37.19 +
   37.20 +  st->cr();
   37.21 +  st->cr();
   37.22 +
   37.23 +  st->print_cr("Register to memory mapping:");
   37.24 +  st->cr();
   37.25 +
   37.26 +  // this is only for the "general purpose" registers
   37.27 +
   37.28 +  st->print_cr("RAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RAX]);
   37.29 +  print_location(st, uc->uc_mcontext.gregs[REG_RAX]);
   37.30 +  st->cr();
   37.31 +  st->print_cr("RBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBX]);
   37.32 +  print_location(st, uc->uc_mcontext.gregs[REG_RBX]);
   37.33 +  st->cr();
   37.34 +  st->print_cr("RCX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RCX]);
   37.35 +  print_location(st, uc->uc_mcontext.gregs[REG_RCX]);
   37.36 +  st->cr();
   37.37 +  st->print_cr("RDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDX]);
   37.38 +  print_location(st, uc->uc_mcontext.gregs[REG_RDX]);
   37.39 +  st->cr();
   37.40 +  st->print_cr("RSP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSP]);
   37.41 +  print_location(st, uc->uc_mcontext.gregs[REG_RSP]);
   37.42 +  st->cr();
   37.43 +  st->print_cr("RBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RBP]);
   37.44 +  print_location(st, uc->uc_mcontext.gregs[REG_RSP]);
   37.45 +  st->cr();
   37.46 +  st->print_cr("RSI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RSI]);
   37.47 +  print_location(st, uc->uc_mcontext.gregs[REG_RSI]);
   37.48 +  st->cr();
   37.49 +  st->print_cr("RDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_RDI]);
   37.50 +  print_location(st, uc->uc_mcontext.gregs[REG_RDI]);
   37.51 +  st->cr();
   37.52 +  st->print_cr("R8 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R8]);
   37.53 +  print_location(st, uc->uc_mcontext.gregs[REG_R8]);
   37.54 +  st->cr();
   37.55 +  st->print_cr("R9 =" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R9]);
   37.56 +  print_location(st, uc->uc_mcontext.gregs[REG_R9]);
   37.57 +  st->cr();
   37.58 +  st->print_cr("R10=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R10]);
   37.59 +  print_location(st, uc->uc_mcontext.gregs[REG_R10]);
   37.60 +  st->cr();
   37.61 +  st->print_cr("R11=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R11]);
   37.62 +  print_location(st, uc->uc_mcontext.gregs[REG_R11]);
   37.63 +  st->cr();
   37.64 +  st->print_cr("R12=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R12]);
   37.65 +  print_location(st, uc->uc_mcontext.gregs[REG_R12]);
   37.66 +  st->cr();
   37.67 +  st->print_cr("R13=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R13]);
   37.68 +  print_location(st, uc->uc_mcontext.gregs[REG_R13]);
   37.69 +  st->cr();
   37.70 +  st->print_cr("R14=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R14]);
   37.71 +  print_location(st, uc->uc_mcontext.gregs[REG_R14]);
   37.72 +  st->cr();
   37.73 +  st->print_cr("R15=" INTPTR_FORMAT, uc->uc_mcontext.gregs[REG_R15]);
   37.74 +  print_location(st, uc->uc_mcontext.gregs[REG_R15]);
   37.75 +
   37.76  #else
   37.77    st->print(  "EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EAX]);
   37.78    st->print(", EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBX]);
   37.79 @@ -755,6 +817,39 @@
   37.80    st->cr();
   37.81    st->print(  "EIP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EIP]);
   37.82    st->print(", EFLAGS=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EFL]);
   37.83 +
   37.84 +  st->cr();
   37.85 +  st->cr();
   37.86 +
   37.87 +  st->print_cr("Register to memory mapping:");
   37.88 +  st->cr();
   37.89 +
   37.90 +  // this is only for the "general purpose" registers
   37.91 +
   37.92 +  st->print_cr("EAX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EAX]);
   37.93 +  print_location(st, uc->uc_mcontext.gregs[EAX]);
   37.94 +  st->cr();
   37.95 +  st->print_cr("EBX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBX]);
   37.96 +  print_location(st, uc->uc_mcontext.gregs[EBX]);
   37.97 +  st->cr();
   37.98 +  st->print_cr("ECX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ECX]);
   37.99 +  print_location(st, uc->uc_mcontext.gregs[ECX]);
  37.100 +  st->cr();
  37.101 +  st->print_cr("EDX=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDX]);
  37.102 +  print_location(st, uc->uc_mcontext.gregs[EDX]);
  37.103 +  st->cr();
  37.104 +  st->print_cr("ESP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[UESP]);
  37.105 +  print_location(st, uc->uc_mcontext.gregs[UESP]);
  37.106 +  st->cr();
  37.107 +  st->print_cr("EBP=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EBP]);
  37.108 +  print_location(st, uc->uc_mcontext.gregs[EBP]);
  37.109 +  st->cr();
  37.110 +  st->print_cr("ESI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[ESI]);
  37.111 +  print_location(st, uc->uc_mcontext.gregs[ESI]);
  37.112 +  st->cr();
  37.113 +  st->print_cr("EDI=" INTPTR_FORMAT, uc->uc_mcontext.gregs[EDI]);
  37.114 +  print_location(st, uc->uc_mcontext.gregs[EDI]);
  37.115 +
  37.116  #endif // AMD64
  37.117    st->cr();
  37.118    st->cr();
  37.119 @@ -773,6 +868,7 @@
  37.120    print_hex_dump(st, pc - 16, pc + 16, sizeof(char));
  37.121  }
  37.122  
  37.123 +
  37.124  #ifdef AMD64
  37.125  void os::Solaris::init_thread_fpu_state(void) {
  37.126    // Nothing to do
    38.1 --- a/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp	Wed Jul 28 17:57:43 2010 -0400
    38.2 +++ b/src/os_cpu/solaris_x86/vm/thread_solaris_x86.cpp	Tue Aug 03 08:13:38 2010 -0400
    38.3 @@ -82,3 +82,6 @@
    38.4    return true;
    38.5  
    38.6  }
    38.7 +
    38.8 +void JavaThread::cache_global_variables() { }
    38.9 +
    39.1 --- a/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Wed Jul 28 17:57:43 2010 -0400
    39.2 +++ b/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Tue Aug 03 08:13:38 2010 -0400
    39.3 @@ -377,18 +377,84 @@
    39.4  
    39.5    st->print_cr("Registers:");
    39.6  #ifdef AMD64
    39.7 -  st->print(  "EAX=" INTPTR_FORMAT, uc->Rax);
    39.8 -  st->print(", EBX=" INTPTR_FORMAT, uc->Rbx);
    39.9 -  st->print(", ECX=" INTPTR_FORMAT, uc->Rcx);
   39.10 -  st->print(", EDX=" INTPTR_FORMAT, uc->Rdx);
   39.11 +  st->print(  "RAX=" INTPTR_FORMAT, uc->Rax);
   39.12 +  st->print(", RBX=" INTPTR_FORMAT, uc->Rbx);
   39.13 +  st->print(", RCX=" INTPTR_FORMAT, uc->Rcx);
   39.14 +  st->print(", RDX=" INTPTR_FORMAT, uc->Rdx);
   39.15    st->cr();
   39.16 -  st->print(  "ESP=" INTPTR_FORMAT, uc->Rsp);
   39.17 -  st->print(", EBP=" INTPTR_FORMAT, uc->Rbp);
   39.18 -  st->print(", ESI=" INTPTR_FORMAT, uc->Rsi);
   39.19 -  st->print(", EDI=" INTPTR_FORMAT, uc->Rdi);
   39.20 +  st->print(  "RSP=" INTPTR_FORMAT, uc->Rsp);
   39.21 +  st->print(", RBP=" INTPTR_FORMAT, uc->Rbp);
   39.22 +  st->print(", RSI=" INTPTR_FORMAT, uc->Rsi);
   39.23 +  st->print(", RDI=" INTPTR_FORMAT, uc->Rdi);
   39.24    st->cr();
   39.25 -  st->print(  "EIP=" INTPTR_FORMAT, uc->Rip);
   39.26 +  st->print(  "R8=" INTPTR_FORMAT,  uc->R8);
   39.27 +  st->print(", R9=" INTPTR_FORMAT,  uc->R9);
   39.28 +  st->print(", R10=" INTPTR_FORMAT, uc->R10);
   39.29 +  st->print(", R11=" INTPTR_FORMAT, uc->R11);
   39.30 +  st->cr();
   39.31 +  st->print(  "R12=" INTPTR_FORMAT, uc->R12);
   39.32 +  st->print(", R13=" INTPTR_FORMAT, uc->R13);
   39.33 +  st->print(", R14=" INTPTR_FORMAT, uc->R14);
   39.34 +  st->print(", R15=" INTPTR_FORMAT, uc->R15);
   39.35 +  st->cr();
   39.36 +  st->print(  "RIP=" INTPTR_FORMAT, uc->Rip);
   39.37    st->print(", EFLAGS=" INTPTR_FORMAT, uc->EFlags);
   39.38 +
   39.39 +  st->cr();
   39.40 +  st->cr();
   39.41 +
   39.42 +  st->print_cr("Register to memory mapping:");
   39.43 +  st->cr();
   39.44 +
   39.45 +  // this is only for the "general purpose" registers
   39.46 +
   39.47 +  st->print_cr("RAX=" INTPTR_FORMAT, uc->Rax);
   39.48 +  print_location(st, uc->Rax);
   39.49 +  st->cr();
   39.50 +  st->print_cr("RBX=" INTPTR_FORMAT, uc->Rbx);
   39.51 +  print_location(st, uc->Rbx);
   39.52 +  st->cr();
   39.53 +  st->print_cr("RCX=" INTPTR_FORMAT, uc->Rcx);
   39.54 +  print_location(st, uc->Rcx);
   39.55 +  st->cr();
   39.56 +  st->print_cr("RDX=" INTPTR_FORMAT, uc->Rdx);
   39.57 +  print_location(st, uc->Rdx);
   39.58 +  st->cr();
   39.59 +  st->print_cr("RSP=" INTPTR_FORMAT, uc->Rsp);
   39.60 +  print_location(st, uc->Rsp);
   39.61 +  st->cr();
   39.62 +  st->print_cr("RBP=" INTPTR_FORMAT, uc->Rbp);
   39.63 +  print_location(st, uc->Rbp);
   39.64 +  st->cr();
   39.65 +  st->print_cr("RSI=" INTPTR_FORMAT, uc->Rsi);
   39.66 +  print_location(st, uc->Rsi);
   39.67 +  st->cr();
   39.68 +  st->print_cr("RDI=" INTPTR_FORMAT, uc->Rdi);
   39.69 +  print_location(st, uc->Rdi);
   39.70 +  st->cr();
   39.71 +  st->print_cr("R8 =" INTPTR_FORMAT, uc->R8);
   39.72 +  print_location(st, uc->R8);
   39.73 +  st->cr();
   39.74 +  st->print_cr("R9 =" INTPTR_FORMAT, uc->R9);
   39.75 +  print_location(st, uc->R9);
   39.76 +  st->cr();
   39.77 +  st->print_cr("R10=" INTPTR_FORMAT, uc->R10);
   39.78 +  print_location(st, uc->R10);
   39.79 +  st->cr();
   39.80 +  st->print_cr("R11=" INTPTR_FORMAT, uc->R11);
   39.81 +  print_location(st, uc->R11);
   39.82 +  st->cr();
   39.83 +  st->print_cr("R12=" INTPTR_FORMAT, uc->R12);
   39.84 +  print_location(st, uc->R12);
   39.85 +  st->cr();
   39.86 +  st->print_cr("R13=" INTPTR_FORMAT, uc->R13);
   39.87 +  print_location(st, uc->R13);
   39.88 +  st->cr();
   39.89 +  st->print_cr("R14=" INTPTR_FORMAT, uc->R14);
   39.90 +  print_location(st, uc->R14);
   39.91 +  st->cr();
   39.92 +  st->print_cr("R15=" INTPTR_FORMAT, uc->R15);
   39.93 +  print_location(st, uc->R15);
   39.94  #else
   39.95    st->print(  "EAX=" INTPTR_FORMAT, uc->Eax);
   39.96    st->print(", EBX=" INTPTR_FORMAT, uc->Ebx);
   39.97 @@ -402,6 +468,38 @@
   39.98    st->cr();
   39.99    st->print(  "EIP=" INTPTR_FORMAT, uc->Eip);
  39.100    st->print(", EFLAGS=" INTPTR_FORMAT, uc->EFlags);
  39.101 +
  39.102 +  st->cr();
  39.103 +  st->cr();
  39.104 +
  39.105 +  st->print_cr("Register to memory mapping:");
  39.106 +  st->cr();
  39.107 +
  39.108 +  // this is only for the "general purpose" registers
  39.109 +
  39.110 +  st->print_cr("EAX=" INTPTR_FORMAT, uc->Eax);
  39.111 +  print_location(st, uc->Eax);
  39.112 +  st->cr();
  39.113 +  st->print_cr("EBX=" INTPTR_FORMAT, uc->Ebx);
  39.114 +  print_location(st, uc->Ebx);
  39.115 +  st->cr();
  39.116 +  st->print_cr("ECX=" INTPTR_FORMAT, uc->Ecx);
  39.117 +  print_location(st, uc->Ecx);
  39.118 +  st->cr();
  39.119 +  st->print_cr("EDX=" INTPTR_FORMAT, uc->Edx);
  39.120 +  print_location(st, uc->Edx);
  39.121 +  st->cr();
  39.122 +  st->print_cr("ESP=" INTPTR_FORMAT, uc->Esp);
  39.123 +  print_location(st, uc->Esp);
  39.124 +  st->cr();
  39.125 +  st->print_cr("EBP=" INTPTR_FORMAT, uc->Ebp);
  39.126 +  print_location(st, uc->Ebp);
  39.127 +  st->cr();
  39.128 +  st->print_cr("ESI=" INTPTR_FORMAT, uc->Esi);
  39.129 +  print_location(st, uc->Esi);
  39.130 +  st->cr();
  39.131 +  st->print_cr("EDI=" INTPTR_FORMAT, uc->Edi);
  39.132 +  print_location(st, uc->Edi);
  39.133  #endif // AMD64
  39.134    st->cr();
  39.135    st->cr();
    40.1 --- a/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp	Wed Jul 28 17:57:43 2010 -0400
    40.2 +++ b/src/os_cpu/windows_x86/vm/thread_windows_x86.cpp	Tue Aug 03 08:13:38 2010 -0400
    40.3 @@ -84,3 +84,6 @@
    40.4    // nothing else to try
    40.5    return false;
    40.6  }
    40.7 +
    40.8 +void JavaThread::cache_global_variables() { }
    40.9 +
    41.1 --- a/src/share/vm/asm/codeBuffer.hpp	Wed Jul 28 17:57:43 2010 -0400
    41.2 +++ b/src/share/vm/asm/codeBuffer.hpp	Tue Aug 03 08:13:38 2010 -0400
    41.3 @@ -102,7 +102,7 @@
    41.4      _locs_point    = NULL;
    41.5      _locs_own      = false;
    41.6      _frozen        = false;
    41.7 -    debug_only(_index = -1);
    41.8 +    debug_only(_index = (char)-1);
    41.9      debug_only(_outer = (CodeBuffer*)badAddress);
   41.10    }
   41.11  
    42.1 --- a/src/share/vm/c1/c1_CodeStubs.hpp	Wed Jul 28 17:57:43 2010 -0400
    42.2 +++ b/src/share/vm/c1/c1_CodeStubs.hpp	Tue Aug 03 08:13:38 2010 -0400
    42.3 @@ -448,6 +448,10 @@
    42.4      _obj(obj), _info(info), _stub(stub) {
    42.5    }
    42.6  
    42.7 +  void set_obj(LIR_Opr obj) {
    42.8 +    _obj = obj;
    42.9 +  }
   42.10 +
   42.11    virtual void emit_code(LIR_Assembler* e);
   42.12    virtual CodeEmitInfo* info() const             { return _info; }
   42.13    virtual bool is_exception_throw_stub() const   { return true; }
    43.1 --- a/src/share/vm/c1/c1_Compilation.hpp	Wed Jul 28 17:57:43 2010 -0400
    43.2 +++ b/src/share/vm/c1/c1_Compilation.hpp	Tue Aug 03 08:13:38 2010 -0400
    43.3 @@ -168,10 +168,19 @@
    43.4    const char* bailout_msg() const                { return _bailout_msg; }
    43.5  
    43.6    static int desired_max_code_buffer_size() {
    43.7 +#ifndef PPC
    43.8      return (int) NMethodSizeLimit;  // default 256K or 512K
    43.9 +#else
   43.10 +    // conditional branches on PPC are restricted to 16 bit signed
   43.11 +    return MAX2((unsigned int)NMethodSizeLimit,32*K);
   43.12 +#endif
   43.13    }
   43.14    static int desired_max_constant_size() {
   43.15 +#ifndef PPC
   43.16      return (int) NMethodSizeLimit / 10;  // about 25K
   43.17 +#else
   43.18 +    return (MAX2((unsigned int)NMethodSizeLimit, 32*K)) / 10;
   43.19 +#endif
   43.20    }
   43.21  
   43.22    static void setup_code_buffer(CodeBuffer* cb, int call_stub_estimate);
    44.1 --- a/src/share/vm/c1/c1_FrameMap.cpp	Wed Jul 28 17:57:43 2010 -0400
    44.2 +++ b/src/share/vm/c1/c1_FrameMap.cpp	Tue Aug 03 08:13:38 2010 -0400
    44.3 @@ -90,7 +90,7 @@
    44.4  
    44.5    if (outgoing) {
    44.6      // update the space reserved for arguments.
    44.7 -    update_reserved_argument_area_size(out_preserve);
    44.8 +    update_reserved_argument_area_size(out_preserve * BytesPerWord);
    44.9    }
   44.10    return new CallingConvention(args, out_preserve);
   44.11  }
   44.12 @@ -138,7 +138,7 @@
   44.13    }
   44.14    assert(args->length() == signature->length(), "size mismatch");
   44.15    out_preserve += SharedRuntime::out_preserve_stack_slots();
   44.16 -  update_reserved_argument_area_size(out_preserve);
   44.17 +  update_reserved_argument_area_size(out_preserve * BytesPerWord);
   44.18    return new CallingConvention(args, out_preserve);
   44.19  }
   44.20  
    45.1 --- a/src/share/vm/c1/c1_FrameMap.hpp	Wed Jul 28 17:57:43 2010 -0400
    45.2 +++ b/src/share/vm/c1/c1_FrameMap.hpp	Tue Aug 03 08:13:38 2010 -0400
    45.3 @@ -154,7 +154,6 @@
    45.4    static LIR_Opr method_handle_invoke_SP_save_opr();
    45.5  
    45.6    static BasicTypeArray*     signature_type_array_for(const ciMethod* method);
    45.7 -  static BasicTypeArray*     signature_type_array_for(const char * signature);
    45.8  
    45.9    // for outgoing calls, these also update the reserved area to
   45.10    // include space for arguments and any ABI area.
    46.1 --- a/src/share/vm/c1/c1_LIR.cpp	Wed Jul 28 17:57:43 2010 -0400
    46.2 +++ b/src/share/vm/c1/c1_LIR.cpp	Tue Aug 03 08:13:38 2010 -0400
    46.3 @@ -50,8 +50,7 @@
    46.4  
    46.5  #endif // X86
    46.6  
    46.7 -
    46.8 -#ifdef SPARC
    46.9 +#if defined(SPARC) || defined(PPC)
   46.10  
   46.11  FloatRegister LIR_OprDesc::as_float_reg() const {
   46.12    return FrameMap::nr2floatreg(fpu_regnr());
   46.13 @@ -63,6 +62,19 @@
   46.14  
   46.15  #endif
   46.16  
   46.17 +#ifdef ARM
   46.18 +
   46.19 +FloatRegister LIR_OprDesc::as_float_reg() const {
   46.20 +  return as_FloatRegister(fpu_regnr());
   46.21 +}
   46.22 +
   46.23 +FloatRegister LIR_OprDesc::as_double_reg() const {
   46.24 +  return as_FloatRegister(fpu_regnrLo());
   46.25 +}
   46.26 +
   46.27 +#endif
   46.28 +
   46.29 +
   46.30  LIR_Opr LIR_OprFact::illegalOpr = LIR_OprFact::illegal();
   46.31  
   46.32  LIR_Opr LIR_OprFact::value_type(ValueType* type) {
   46.33 @@ -119,10 +131,14 @@
   46.34  
   46.35  #ifndef PRODUCT
   46.36  void LIR_Address::verify() const {
   46.37 -#ifdef SPARC
   46.38 -  assert(scale() == times_1, "Scaled addressing mode not available on SPARC and should not be used");
   46.39 +#if defined(SPARC) || defined(PPC)
   46.40 +  assert(scale() == times_1, "Scaled addressing mode not available on SPARC/PPC and should not be used");
   46.41    assert(disp() == 0 || index()->is_illegal(), "can't have both");
   46.42  #endif
   46.43 +#ifdef ARM
   46.44 +  assert(disp() == 0 || index()->is_illegal(), "can't have both");
   46.45 +  assert(-4096 < disp() && disp() < 4096, "architecture constraint");
   46.46 +#endif
   46.47  #ifdef _LP64
   46.48    assert(base()->is_cpu_register(), "wrong base operand");
   46.49    assert(index()->is_illegal() || index()->is_double_cpu(), "wrong index operand");
   46.50 @@ -173,13 +189,22 @@
   46.51    if (!is_pointer() && !is_illegal()) {
   46.52      switch (as_BasicType(type_field())) {
   46.53      case T_LONG:
   46.54 -      assert((kind_field() == cpu_register || kind_field() == stack_value) && size_field() == double_size, "must match");
   46.55 +      assert((kind_field() == cpu_register || kind_field() == stack_value) &&
   46.56 +             size_field() == double_size, "must match");
   46.57        break;
   46.58      case T_FLOAT:
   46.59 -      assert((kind_field() == fpu_register || kind_field() == stack_value) && size_field() == single_size, "must match");
   46.60 +      // FP return values can be also in CPU registers on ARM and PPC (softfp ABI)
   46.61 +      assert((kind_field() == fpu_register || kind_field() == stack_value
   46.62 +             ARM_ONLY(|| kind_field() == cpu_register)
   46.63 +             PPC_ONLY(|| kind_field() == cpu_register) ) &&
   46.64 +             size_field() == single_size, "must match");
   46.65        break;
   46.66      case T_DOUBLE:
   46.67 -      assert((kind_field() == fpu_register || kind_field() == stack_value) && size_field() == double_size, "must match");
   46.68 +      // FP return values can be also in CPU registers on ARM and PPC (softfp ABI)
   46.69 +      assert((kind_field() == fpu_register || kind_field() == stack_value
   46.70 +             ARM_ONLY(|| kind_field() == cpu_register)
   46.71 +             PPC_ONLY(|| kind_field() == cpu_register) ) &&
   46.72 +             size_field() == double_size, "must match");
   46.73        break;
   46.74      case T_BOOLEAN:
   46.75      case T_CHAR:
   46.76 @@ -188,7 +213,8 @@
   46.77      case T_INT:
   46.78      case T_OBJECT:
   46.79      case T_ARRAY:
   46.80 -      assert((kind_field() == cpu_register || kind_field() == stack_value) && size_field() == single_size, "must match");
   46.81 +      assert((kind_field() == cpu_register || kind_field() == stack_value) &&
   46.82 +             size_field() == single_size, "must match");
   46.83        break;
   46.84  
   46.85      case T_ILLEGAL:
   46.86 @@ -503,6 +529,10 @@
   46.87        assert(opConvert->_info == NULL, "must be");
   46.88        if (opConvert->_opr->is_valid())       do_input(opConvert->_opr);
   46.89        if (opConvert->_result->is_valid())    do_output(opConvert->_result);
   46.90 +#ifdef PPC
   46.91 +      if (opConvert->_tmp1->is_valid())      do_temp(opConvert->_tmp1);
   46.92 +      if (opConvert->_tmp2->is_valid())      do_temp(opConvert->_tmp2);
   46.93 +#endif
   46.94        do_stub(opConvert->_stub);
   46.95  
   46.96        break;
   46.97 @@ -530,7 +560,9 @@
   46.98        LIR_OpAllocObj* opAllocObj = (LIR_OpAllocObj*)op;
   46.99  
  46.100        if (opAllocObj->_info)                     do_info(opAllocObj->_info);
  46.101 -      if (opAllocObj->_opr->is_valid())          do_input(opAllocObj->_opr);
  46.102 +      if (opAllocObj->_opr->is_valid()) {        do_input(opAllocObj->_opr);
  46.103 +                                                 do_temp(opAllocObj->_opr);
  46.104 +                                        }
  46.105        if (opAllocObj->_tmp1->is_valid())         do_temp(opAllocObj->_tmp1);
  46.106        if (opAllocObj->_tmp2->is_valid())         do_temp(opAllocObj->_tmp2);
  46.107        if (opAllocObj->_tmp3->is_valid())         do_temp(opAllocObj->_tmp3);
  46.108 @@ -826,10 +858,16 @@
  46.109        assert(op->as_OpCompareAndSwap() != NULL, "must be");
  46.110        LIR_OpCompareAndSwap* opCompareAndSwap = (LIR_OpCompareAndSwap*)op;
  46.111  
  46.112 +      assert(opCompareAndSwap->_addr->is_valid(),      "used");
  46.113 +      assert(opCompareAndSwap->_cmp_value->is_valid(), "used");
  46.114 +      assert(opCompareAndSwap->_new_value->is_valid(), "used");
  46.115        if (opCompareAndSwap->_info)                    do_info(opCompareAndSwap->_info);
  46.116 -      if (opCompareAndSwap->_addr->is_valid())        do_input(opCompareAndSwap->_addr);
  46.117 -      if (opCompareAndSwap->_cmp_value->is_valid())   do_input(opCompareAndSwap->_cmp_value);
  46.118 -      if (opCompareAndSwap->_new_value->is_valid())   do_input(opCompareAndSwap->_new_value);
  46.119 +                                                      do_input(opCompareAndSwap->_addr);
  46.120 +                                                      do_temp(opCompareAndSwap->_addr);
  46.121 +                                                      do_input(opCompareAndSwap->_cmp_value);
  46.122 +                                                      do_temp(opCompareAndSwap->_cmp_value);
  46.123 +                                                      do_input(opCompareAndSwap->_new_value);
  46.124 +                                                      do_temp(opCompareAndSwap->_new_value);
  46.125        if (opCompareAndSwap->_tmp1->is_valid())        do_temp(opCompareAndSwap->_tmp1);
  46.126        if (opCompareAndSwap->_tmp2->is_valid())        do_temp(opCompareAndSwap->_tmp2);
  46.127        if (opCompareAndSwap->_result->is_valid())      do_output(opCompareAndSwap->_result);
  46.128 @@ -1303,13 +1341,13 @@
  46.129                      info));
  46.130  }
  46.131  
  46.132 -void LIR_List::unlock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, CodeStub* stub) {
  46.133 +void LIR_List::unlock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, LIR_Opr scratch, CodeStub* stub) {
  46.134    append(new LIR_OpLock(
  46.135                      lir_unlock,
  46.136                      hdr,
  46.137                      obj,
  46.138                      lock,
  46.139 -                    LIR_OprFact::illegalOpr,
  46.140 +                    scratch,
  46.141                      stub,
  46.142                      NULL));
  46.143  }
  46.144 @@ -1342,22 +1380,19 @@
  46.145  }
  46.146  
  46.147  
  46.148 -void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2) {
  46.149 -  // Compare and swap produces condition code "zero" if contents_of(addr) == cmp_value,
  46.150 -  // implying successful swap of new_value into addr
  46.151 -  append(new LIR_OpCompareAndSwap(lir_cas_long, addr, cmp_value, new_value, t1, t2));
  46.152 +void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
  46.153 +                        LIR_Opr t1, LIR_Opr t2, LIR_Opr result) {
  46.154 +  append(new LIR_OpCompareAndSwap(lir_cas_long, addr, cmp_value, new_value, t1, t2, result));
  46.155  }
  46.156  
  46.157 -void LIR_List::cas_obj(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2) {
  46.158 -  // Compare and swap produces condition code "zero" if contents_of(addr) == cmp_value,
  46.159 -  // implying successful swap of new_value into addr
  46.160 -  append(new LIR_OpCompareAndSwap(lir_cas_obj, addr, cmp_value, new_value, t1, t2));
  46.161 +void LIR_List::cas_obj(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
  46.162 +                       LIR_Opr t1, LIR_Opr t2, LIR_Opr result) {
  46.163 +  append(new LIR_OpCompareAndSwap(lir_cas_obj, addr, cmp_value, new_value, t1, t2, result));
  46.164  }
  46.165  
  46.166 -void LIR_List::cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2) {
  46.167 -  // Compare and swap produces condition code "zero" if contents_of(addr) == cmp_value,
  46.168 -  // implying successful swap of new_value into addr
  46.169 -  append(new LIR_OpCompareAndSwap(lir_cas_int, addr, cmp_value, new_value, t1, t2));
  46.170 +void LIR_List::cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
  46.171 +                       LIR_Opr t1, LIR_Opr t2, LIR_Opr result) {
  46.172 +  append(new LIR_OpCompareAndSwap(lir_cas_int, addr, cmp_value, new_value, t1, t2, result));
  46.173  }
  46.174  
  46.175  
  46.176 @@ -1400,6 +1435,11 @@
  46.177      out->print("fpu%d", fpu_regnr());
  46.178    } else if (is_double_fpu()) {
  46.179      out->print("fpu%d", fpu_regnrLo());
  46.180 +#elif defined(ARM)
  46.181 +  } else if (is_single_fpu()) {
  46.182 +    out->print("s%d", fpu_regnr());
  46.183 +  } else if (is_double_fpu()) {
  46.184 +    out->print("d%d", fpu_regnrLo() >> 1);
  46.185  #else
  46.186    } else if (is_single_fpu()) {
  46.187      out->print(as_float_reg()->name());
  46.188 @@ -1756,6 +1796,12 @@
  46.189    print_bytecode(out, bytecode());
  46.190    in_opr()->print(out);                  out->print(" ");
  46.191    result_opr()->print(out);              out->print(" ");
  46.192 +#ifdef PPC
  46.193 +  if(tmp1()->is_valid()) {
  46.194 +    tmp1()->print(out); out->print(" ");
  46.195 +    tmp2()->print(out); out->print(" ");
  46.196 +  }
  46.197 +#endif
  46.198  }
  46.199  
  46.200  void LIR_OpConvert::print_bytecode(outputStream* out, Bytecodes::Code code) {
    47.1 --- a/src/share/vm/c1/c1_LIR.hpp	Wed Jul 28 17:57:43 2010 -0400
    47.2 +++ b/src/share/vm/c1/c1_LIR.hpp	Tue Aug 03 08:13:38 2010 -0400
    47.3 @@ -432,8 +432,7 @@
    47.4    // for compatibility with RInfo
    47.5    int fpu () const                                  { return lo_reg_half(); }
    47.6  #endif // X86
    47.7 -
    47.8 -#ifdef SPARC
    47.9 +#if defined(SPARC) || defined(ARM) || defined(PPC)
   47.10    FloatRegister as_float_reg   () const;
   47.11    FloatRegister as_double_reg  () const;
   47.12  #endif
   47.13 @@ -519,14 +518,14 @@
   47.14       , _type(type)
   47.15       , _disp(0) { verify(); }
   47.16  
   47.17 -#ifdef X86
   47.18 +#if defined(X86) || defined(ARM)
   47.19    LIR_Address(LIR_Opr base, LIR_Opr index, Scale scale, intx disp, BasicType type):
   47.20         _base(base)
   47.21       , _index(index)
   47.22       , _scale(scale)
   47.23       , _type(type)
   47.24       , _disp(disp) { verify(); }
   47.25 -#endif // X86
   47.26 +#endif // X86 || ARM
   47.27  
   47.28    LIR_Opr base()  const                          { return _base;  }
   47.29    LIR_Opr index() const                          { return _index; }
   47.30 @@ -566,7 +565,11 @@
   47.31                                                                               LIR_OprDesc::float_type           |
   47.32                                                                               LIR_OprDesc::fpu_register         |
   47.33                                                                               LIR_OprDesc::single_size); }
   47.34 -
   47.35 +#if defined(ARM)
   47.36 +  static LIR_Opr double_fpu(int reg1, int reg2)    { return (LIR_Opr)((reg1 << LIR_OprDesc::reg1_shift) | (reg2 << LIR_OprDesc::reg2_shift) | LIR_OprDesc::double_type | LIR_OprDesc::fpu_register | LIR_OprDesc::double_size); }
   47.37 +  static LIR_Opr single_softfp(int reg)            { return (LIR_Opr)((reg  << LIR_OprDesc::reg1_shift) |                                     LIR_OprDesc::float_type  | LIR_OprDesc::cpu_register | LIR_OprDesc::single_size); }
   47.38 +  static LIR_Opr double_softfp(int reg1, int reg2) { return (LIR_Opr)((reg1 << LIR_OprDesc::reg1_shift) | (reg2 << LIR_OprDesc::reg2_shift) | LIR_OprDesc::double_type | LIR_OprDesc::cpu_register | LIR_OprDesc::double_size); }
   47.39 +#endif
   47.40  #ifdef SPARC
   47.41    static LIR_Opr double_fpu(int reg1, int reg2) { return (LIR_Opr)(intptr_t)((reg1 << LIR_OprDesc::reg1_shift) |
   47.42                                                                               (reg2 << LIR_OprDesc::reg2_shift) |
   47.43 @@ -593,7 +596,22 @@
   47.44                                                                               LIR_OprDesc::double_size          |
   47.45                                                                               LIR_OprDesc::is_xmm_mask); }
   47.46  #endif // X86
   47.47 -
   47.48 +#ifdef PPC
   47.49 +  static LIR_Opr double_fpu(int reg)            { return (LIR_Opr)(intptr_t)((reg  << LIR_OprDesc::reg1_shift) |
   47.50 +                                                                             (reg  << LIR_OprDesc::reg2_shift) |
   47.51 +                                                                             LIR_OprDesc::double_type          |
   47.52 +                                                                             LIR_OprDesc::fpu_register         |
   47.53 +                                                                             LIR_OprDesc::double_size); }
   47.54 +  static LIR_Opr single_softfp(int reg)            { return (LIR_Opr)((reg  << LIR_OprDesc::reg1_shift)        |
   47.55 +                                                                             LIR_OprDesc::float_type           |
   47.56 +                                                                             LIR_OprDesc::cpu_register         |
   47.57 +                                                                             LIR_OprDesc::single_size); }
   47.58 +  static LIR_Opr double_softfp(int reg1, int reg2) { return (LIR_Opr)((reg2 << LIR_OprDesc::reg1_shift)        |
   47.59 +                                                                             (reg1 << LIR_OprDesc::reg2_shift) |
   47.60 +                                                                             LIR_OprDesc::double_type          |
   47.61 +                                                                             LIR_OprDesc::cpu_register         |
   47.62 +                                                                             LIR_OprDesc::double_size); }
   47.63 +#endif // PPC
   47.64  
   47.65    static LIR_Opr virtual_register(int index, BasicType type) {
   47.66      LIR_Opr res;
   47.67 @@ -623,6 +641,22 @@
   47.68                                    LIR_OprDesc::virtual_mask);
   47.69          break;
   47.70  
   47.71 +#ifdef __SOFTFP__
   47.72 +      case T_FLOAT:
   47.73 +        res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
   47.74 +                                  LIR_OprDesc::float_type  |
   47.75 +                                  LIR_OprDesc::cpu_register |
   47.76 +                                  LIR_OprDesc::single_size |
   47.77 +                                  LIR_OprDesc::virtual_mask);
   47.78 +        break;
   47.79 +      case T_DOUBLE:
   47.80 +        res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
   47.81 +                                  LIR_OprDesc::double_type |
   47.82 +                                  LIR_OprDesc::cpu_register |
   47.83 +                                  LIR_OprDesc::double_size |
   47.84 +                                  LIR_OprDesc::virtual_mask);
   47.85 +        break;
   47.86 +#else // __SOFTFP__
   47.87        case T_FLOAT:
   47.88          res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
   47.89                                    LIR_OprDesc::float_type           |
   47.90 @@ -638,7 +672,7 @@
   47.91                                              LIR_OprDesc::double_size           |
   47.92                                              LIR_OprDesc::virtual_mask);
   47.93          break;
   47.94 -
   47.95 +#endif // __SOFTFP__
   47.96        default:       ShouldNotReachHere(); res = illegalOpr;
   47.97      }
   47.98  
   47.99 @@ -650,11 +684,18 @@
  47.100  
  47.101      // old-style calculation; check if old and new method are equal
  47.102      LIR_OprDesc::OprType t = as_OprType(type);
  47.103 +#ifdef __SOFTFP__
  47.104 +    LIR_Opr old_res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) |
  47.105 +                               t |
  47.106 +                               LIR_OprDesc::cpu_register |
  47.107 +                               LIR_OprDesc::size_for(type) | LIR_OprDesc::virtual_mask);
  47.108 +#else // __SOFTFP__
  47.109      LIR_Opr old_res = (LIR_Opr)(intptr_t)((index << LIR_OprDesc::data_shift) | t |
  47.110                                            ((type == T_FLOAT || type == T_DOUBLE) ?  LIR_OprDesc::fpu_register : LIR_OprDesc::cpu_register) |
  47.111                                 LIR_OprDesc::size_for(type) | LIR_OprDesc::virtual_mask);
  47.112      assert(res == old_res, "old and new method not equal");
  47.113 -#endif
  47.114 +#endif // __SOFTFP__
  47.115 +#endif // ASSERT
  47.116  
  47.117      return res;
  47.118    }
  47.119 @@ -1306,15 +1347,37 @@
  47.120   private:
  47.121     Bytecodes::Code _bytecode;
  47.122     ConversionStub* _stub;
  47.123 +#ifdef PPC
  47.124 +  LIR_Opr _tmp1;
  47.125 +  LIR_Opr _tmp2;
  47.126 +#endif
  47.127  
  47.128   public:
  47.129     LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub)
  47.130       : LIR_Op1(lir_convert, opr, result)
  47.131       , _stub(stub)
  47.132 +#ifdef PPC
  47.133 +     , _tmp1(LIR_OprDesc::illegalOpr())
  47.134 +     , _tmp2(LIR_OprDesc::illegalOpr())
  47.135 +#endif
  47.136       , _bytecode(code)                           {}
  47.137  
  47.138 +#ifdef PPC
  47.139 +   LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub
  47.140 +                 ,LIR_Opr tmp1, LIR_Opr tmp2)
  47.141 +     : LIR_Op1(lir_convert, opr, result)
  47.142 +     , _stub(stub)
  47.143 +     , _tmp1(tmp1)
  47.144 +     , _tmp2(tmp2)
  47.145 +     , _bytecode(code)                           {}
  47.146 +#endif
  47.147 +
  47.148    Bytecodes::Code bytecode() const               { return _bytecode; }
  47.149    ConversionStub* stub() const                   { return _stub; }
  47.150 +#ifdef PPC
  47.151 +  LIR_Opr tmp1() const                           { return _tmp1; }
  47.152 +  LIR_Opr tmp2() const                           { return _tmp2; }
  47.153 +#endif
  47.154  
  47.155    virtual void emit_code(LIR_Assembler* masm);
  47.156    virtual LIR_OpConvert* as_OpConvert() { return this; }
  47.157 @@ -1502,6 +1565,9 @@
  47.158    LIR_Condition condition() const  {
  47.159      assert(code() == lir_cmp || code() == lir_cmove, "only valid for cmp and cmove"); return _condition;
  47.160    }
  47.161 +  void set_condition(LIR_Condition condition) {
  47.162 +    assert(code() == lir_cmp || code() == lir_cmove, "only valid for cmp and cmove");  _condition = condition;
  47.163 +  }
  47.164  
  47.165    void set_fpu_stack_size(int size)              { _fpu_stack_size = size; }
  47.166    int  fpu_stack_size() const                    { return _fpu_stack_size; }
  47.167 @@ -1650,8 +1716,9 @@
  47.168    LIR_Opr _tmp2;
  47.169  
  47.170   public:
  47.171 -  LIR_OpCompareAndSwap(LIR_Code code, LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2)
  47.172 -    : LIR_Op(code, LIR_OprFact::illegalOpr, NULL)  // no result, no info
  47.173 +  LIR_OpCompareAndSwap(LIR_Code code, LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
  47.174 +                       LIR_Opr t1, LIR_Opr t2, LIR_Opr result)
  47.175 +    : LIR_Op(code, result, NULL)  // no result, no info
  47.176      , _addr(addr)
  47.177      , _cmp_value(cmp_value)
  47.178      , _new_value(new_value)
  47.179 @@ -1832,6 +1899,9 @@
  47.180  
  47.181    void safepoint(LIR_Opr tmp, CodeEmitInfo* info)  { append(new LIR_Op1(lir_safepoint, tmp, info)); }
  47.182  
  47.183 +#ifdef PPC
  47.184 +  void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_OpConvert(code, left, dst, NULL, tmp1, tmp2)); }
  47.185 +#endif
  47.186    void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL/*, bool is_32bit = false*/) { append(new LIR_OpConvert(code, left, dst, stub)); }
  47.187  
  47.188    void logical_and (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_and,  left, right, dst)); }
  47.189 @@ -1867,9 +1937,12 @@
  47.190      append(new LIR_Op2(lir_cmove, condition, src1, src2, dst));
  47.191    }
  47.192  
  47.193 -  void cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2);
  47.194 -  void cas_obj(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2);
  47.195 -  void cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2);
  47.196 +  void cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
  47.197 +                LIR_Opr t1, LIR_Opr t2, LIR_Opr result = LIR_OprFact::illegalOpr);
  47.198 +  void cas_obj(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
  47.199 +               LIR_Opr t1, LIR_Opr t2, LIR_Opr result = LIR_OprFact::illegalOpr);
  47.200 +  void cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
  47.201 +               LIR_Opr t1, LIR_Opr t2, LIR_Opr result = LIR_OprFact::illegalOpr);
  47.202  
  47.203    void abs (LIR_Opr from, LIR_Opr to, LIR_Opr tmp)                { append(new LIR_Op2(lir_abs , from, tmp, to)); }
  47.204    void sqrt(LIR_Opr from, LIR_Opr to, LIR_Opr tmp)                { append(new LIR_Op2(lir_sqrt, from, tmp, to)); }
  47.205 @@ -1950,7 +2023,7 @@
  47.206    }
  47.207  
  47.208    void load_stack_address_monitor(int monitor_ix, LIR_Opr dst)  { append(new LIR_Op1(lir_monaddr, LIR_OprFact::intConst(monitor_ix), dst)); }
  47.209 -  void unlock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, CodeStub* stub);
  47.210 +  void unlock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, LIR_Opr scratch, CodeStub* stub);
  47.211    void lock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, LIR_Opr scratch, CodeStub* stub, CodeEmitInfo* info);
  47.212  
  47.213    void set_24bit_fpu()                                               { append(new LIR_Op0(lir_24bit_FPU )); }
    48.1 --- a/src/share/vm/c1/c1_LIRGenerator.cpp	Wed Jul 28 17:57:43 2010 -0400
    48.2 +++ b/src/share/vm/c1/c1_LIRGenerator.cpp	Tue Aug 03 08:13:38 2010 -0400
    48.3 @@ -31,6 +31,12 @@
    48.4  #define __ gen()->lir()->
    48.5  #endif
    48.6  
    48.7 +// TODO: ARM - Use some recognizable constant which still fits architectural constraints
    48.8 +#ifdef ARM
    48.9 +#define PATCHED_ADDR  (204)
   48.10 +#else
   48.11 +#define PATCHED_ADDR  (max_jint)
   48.12 +#endif
   48.13  
   48.14  void PhiResolverState::reset(int max_vregs) {
   48.15    // Initialize array sizes
   48.16 @@ -225,13 +231,13 @@
   48.17  void LIRItem::load_item_force(LIR_Opr reg) {
   48.18    LIR_Opr r = result();
   48.19    if (r != reg) {
   48.20 +#if !defined(ARM) && !defined(E500V2)
   48.21      if (r->type() != reg->type()) {
   48.22        // moves between different types need an intervening spill slot
   48.23 -      LIR_Opr tmp = _gen->force_to_spill(r, reg->type());
   48.24 -      __ move(tmp, reg);
   48.25 -    } else {
   48.26 -      __ move(r, reg);
   48.27 +      r = _gen->force_to_spill(r, reg->type());
   48.28      }
   48.29 +#endif
   48.30 +    __ move(r, reg);
   48.31      _result = reg;
   48.32    }
   48.33  }
   48.34 @@ -628,14 +634,14 @@
   48.35  }
   48.36  
   48.37  
   48.38 -void LIRGenerator::monitor_exit(LIR_Opr object, LIR_Opr lock, LIR_Opr new_hdr, int monitor_no) {
   48.39 +void LIRGenerator::monitor_exit(LIR_Opr object, LIR_Opr lock, LIR_Opr new_hdr, LIR_Opr scratch, int monitor_no) {
   48.40    if (!GenerateSynchronizationCode) return;
   48.41    // setup registers
   48.42    LIR_Opr hdr = lock;
   48.43    lock = new_hdr;
   48.44    CodeStub* slow_path = new MonitorExitStub(lock, UseFastLocking, monitor_no);
   48.45    __ load_stack_address_monitor(monitor_no, lock);
   48.46 -  __ unlock_object(hdr, object, lock, slow_path);
   48.47 +  __ unlock_object(hdr, object, lock, scratch, slow_path);
   48.48  }
   48.49  
   48.50  
   48.51 @@ -1400,6 +1406,25 @@
   48.52    }
   48.53    assert(addr->is_register(), "must be a register at this point");
   48.54  
   48.55 +#ifdef ARM
   48.56 +  // TODO: ARM - move to platform-dependent code
   48.57 +  LIR_Opr tmp = FrameMap::R14_opr;
   48.58 +  if (VM_Version::supports_movw()) {
   48.59 +    __ move((LIR_Opr)card_table_base, tmp);
   48.60 +  } else {
   48.61 +    __ move(new LIR_Address(FrameMap::Rthread_opr, in_bytes(JavaThread::card_table_base_offset()), T_ADDRESS), tmp);
   48.62 +  }
   48.63 +
   48.64 +  CardTableModRefBS* ct = (CardTableModRefBS*)_bs;
   48.65 +  LIR_Address *card_addr = new LIR_Address(tmp, addr, (LIR_Address::Scale) -CardTableModRefBS::card_shift, 0, T_BYTE);
   48.66 +  if(((int)ct->byte_map_base & 0xff) == 0) {
   48.67 +    __ move(tmp, card_addr);
   48.68 +  } else {
   48.69 +    LIR_Opr tmp_zero = new_register(T_INT);
   48.70 +    __ move(LIR_OprFact::intConst(0), tmp_zero);
   48.71 +    __ move(tmp_zero, card_addr);
   48.72 +  }
   48.73 +#else // ARM
   48.74    LIR_Opr tmp = new_pointer_register();
   48.75    if (TwoOperandLIRForm) {
   48.76      __ move(addr, tmp);
   48.77 @@ -1415,6 +1440,7 @@
   48.78                new LIR_Address(tmp, load_constant(card_table_base),
   48.79                                T_BYTE));
   48.80    }
   48.81 +#endif // ARM
   48.82  }
   48.83  
   48.84  
   48.85 @@ -1507,7 +1533,7 @@
   48.86      // generate_address to try to be smart about emitting the -1.
   48.87      // Otherwise the patching code won't know how to find the
   48.88      // instruction to patch.
   48.89 -    address = new LIR_Address(object.result(), max_jint, field_type);
   48.90 +    address = new LIR_Address(object.result(), PATCHED_ADDR, field_type);
   48.91    } else {
   48.92      address = generate_address(object.result(), x->offset(), field_type);
   48.93    }
   48.94 @@ -1584,7 +1610,7 @@
   48.95      // generate_address to try to be smart about emitting the -1.
   48.96      // Otherwise the patching code won't know how to find the
   48.97      // instruction to patch.
   48.98 -    address = new LIR_Address(object.result(), max_jint, field_type);
   48.99 +    address = new LIR_Address(object.result(), PATCHED_ADDR, field_type);
  48.100    } else {
  48.101      address = generate_address(object.result(), x->offset(), field_type);
  48.102    }
  48.103 @@ -1844,6 +1870,8 @@
  48.104      }
  48.105  #endif
  48.106      addr = new LIR_Address(base_op, index_op, LIR_Address::Scale(log2_scale), 0, dst_type);
  48.107 +#elif defined(ARM)
  48.108 +    addr = generate_address(base_op, index_op, log2_scale, 0, dst_type);
  48.109  #else
  48.110      if (index_op->is_illegal() || log2_scale == 0) {
  48.111  #ifdef _LP64
  48.112 @@ -1916,6 +1944,7 @@
  48.113        __ convert(Bytecodes::_i2l, idx.result(), index_op);
  48.114      } else {
  48.115  #endif
  48.116 +      // TODO: ARM also allows embedded shift in the address
  48.117        __ move(idx.result(), index_op);
  48.118  #ifdef _LP64
  48.119      }
  48.120 @@ -2204,7 +2233,10 @@
  48.121      // Assign new location to Local instruction for this local
  48.122      Local* local = x->state()->local_at(java_index)->as_Local();
  48.123      assert(local != NULL, "Locals for incoming arguments must have been created");
  48.124 +#ifndef __SOFTFP__
  48.125 +    // The java calling convention passes double as long and float as int.
  48.126      assert(as_ValueType(t)->tag() == local->type()->tag(), "check");
  48.127 +#endif // __SOFTFP__
  48.128      local->set_operand(dest);
  48.129      _instruction_for_operand.at_put_grow(dest->vreg_number(), local, NULL);
  48.130      java_index += type2size[t];
    49.1 --- a/src/share/vm/c1/c1_LIRGenerator.hpp	Wed Jul 28 17:57:43 2010 -0400
    49.2 +++ b/src/share/vm/c1/c1_LIRGenerator.hpp	Tue Aug 03 08:13:38 2010 -0400
    49.3 @@ -314,7 +314,7 @@
    49.4    void logic_op   (Bytecodes::Code code, LIR_Opr dst_reg, LIR_Opr left, LIR_Opr right);
    49.5  
    49.6    void monitor_enter (LIR_Opr object, LIR_Opr lock, LIR_Opr hdr, LIR_Opr scratch, int monitor_no, CodeEmitInfo* info_for_exception, CodeEmitInfo* info);
    49.7 -  void monitor_exit  (LIR_Opr object, LIR_Opr lock, LIR_Opr hdr, int monitor_no);
    49.8 +  void monitor_exit  (LIR_Opr object, LIR_Opr lock, LIR_Opr hdr, LIR_Opr scratch, int monitor_no);
    49.9  
   49.10    void new_instance    (LIR_Opr  dst, ciInstanceKlass* klass, LIR_Opr  scratch1, LIR_Opr  scratch2, LIR_Opr  scratch3,  LIR_Opr scratch4, LIR_Opr  klass_reg, CodeEmitInfo* info);
   49.11  
   49.12 @@ -338,6 +338,9 @@
   49.13    }
   49.14    LIR_Address* emit_array_address(LIR_Opr array_opr, LIR_Opr index_opr, BasicType type, bool needs_card_mark);
   49.15  
   49.16 +  // the helper for generate_address
   49.17 +  void add_large_constant(LIR_Opr src, int c, LIR_Opr dest);
   49.18 +
   49.19    // machine preferences and characteristics
   49.20    bool can_inline_as_constant(Value i) const;
   49.21    bool can_inline_as_constant(LIR_Const* c) const;
   49.22 @@ -393,6 +396,10 @@
   49.23      return l;
   49.24    }
   49.25  
   49.26 +#ifdef __SOFTFP__
   49.27 +  void do_soft_float_compare(If *x);
   49.28 +#endif // __SOFTFP__
   49.29 +
   49.30    void init();
   49.31  
   49.32    SwitchRangeArray* create_lookup_ranges(TableSwitch* x);
   49.33 @@ -444,6 +451,7 @@
   49.34    static LIR_Opr remOutOpr();
   49.35    static LIR_Opr shiftCountOpr();
   49.36    LIR_Opr syncTempOpr();
   49.37 +  LIR_Opr atomicLockOpr();
   49.38  
   49.39    // returns a register suitable for saving the thread in a
   49.40    // call_runtime_leaf if one is needed.
    50.1 --- a/src/share/vm/c1/c1_LinearScan.cpp	Wed Jul 28 17:57:43 2010 -0400
    50.2 +++ b/src/share/vm/c1/c1_LinearScan.cpp	Tue Aug 03 08:13:38 2010 -0400
    50.3 @@ -169,7 +169,11 @@
    50.4  }
    50.5  
    50.6  bool LinearScan::is_virtual_cpu_interval(const Interval* i) {
    50.7 +#if defined(__SOFTFP__) || defined(E500V2)
    50.8 +  return i->reg_num() >= LIR_OprDesc::vreg_base;
    50.9 +#else
   50.10    return i->reg_num() >= LIR_OprDesc::vreg_base && (i->type() != T_FLOAT && i->type() != T_DOUBLE);
   50.11 +#endif // __SOFTFP__ or E500V2
   50.12  }
   50.13  
   50.14  bool LinearScan::is_precolored_fpu_interval(const Interval* i) {
   50.15 @@ -177,7 +181,11 @@
   50.16  }
   50.17  
   50.18  bool LinearScan::is_virtual_fpu_interval(const Interval* i) {
   50.19 +#if defined(__SOFTFP__) || defined(E500V2)
   50.20 +  return false;
   50.21 +#else
   50.22    return i->reg_num() >= LIR_OprDesc::vreg_base && (i->type() == T_FLOAT || i->type() == T_DOUBLE);
   50.23 +#endif // __SOFTFP__ or E500V2
   50.24  }
   50.25  
   50.26  bool LinearScan::is_in_fpu_register(const Interval* i) {
   50.27 @@ -2010,12 +2018,18 @@
   50.28          return LIR_OprFact::single_cpu_oop(assigned_reg);
   50.29        }
   50.30  
   50.31 +#ifdef __SOFTFP__
   50.32 +      case T_FLOAT:  // fall through
   50.33 +#endif // __SOFTFP__
   50.34        case T_INT: {
   50.35          assert(assigned_reg >= pd_first_cpu_reg && assigned_reg <= pd_last_cpu_reg, "no cpu register");
   50.36          assert(interval->assigned_regHi() == any_reg, "must not have hi register");
   50.37          return LIR_OprFact::single_cpu(assigned_reg);
   50.38        }
   50.39  
   50.40 +#ifdef __SOFTFP__
   50.41 +      case T_DOUBLE:  // fall through
   50.42 +#endif // __SOFTFP__
   50.43        case T_LONG: {
   50.44          int assigned_regHi = interval->assigned_regHi();
   50.45          assert(assigned_reg >= pd_first_cpu_reg && assigned_reg <= pd_last_cpu_reg, "no cpu register");
   50.46 @@ -2033,7 +2047,7 @@
   50.47  #ifdef _LP64
   50.48          return LIR_OprFact::double_cpu(assigned_reg, assigned_reg);
   50.49  #else
   50.50 -#ifdef SPARC
   50.51 +#if defined(SPARC) || defined(PPC)
   50.52          return LIR_OprFact::double_cpu(assigned_regHi, assigned_reg);
   50.53  #else
   50.54          return LIR_OprFact::double_cpu(assigned_reg, assigned_regHi);
   50.55 @@ -2041,6 +2055,7 @@
   50.56  #endif // LP64
   50.57        }
   50.58  
   50.59 +#ifndef __SOFTFP__
   50.60        case T_FLOAT: {
   50.61  #ifdef X86
   50.62          if (UseSSE >= 1) {
   50.63 @@ -2069,6 +2084,11 @@
   50.64          assert(interval->assigned_regHi() >= pd_first_fpu_reg && interval->assigned_regHi() <= pd_last_fpu_reg, "no fpu register");
   50.65          assert(assigned_reg % 2 == 0 && assigned_reg + 1 == interval->assigned_regHi(), "must be sequential and even");
   50.66          LIR_Opr result = LIR_OprFact::double_fpu(interval->assigned_regHi() - pd_first_fpu_reg, assigned_reg - pd_first_fpu_reg);
   50.67 +#elif defined(ARM)
   50.68 +        assert(assigned_reg >= pd_first_fpu_reg && assigned_reg <= pd_last_fpu_reg, "no fpu register");
   50.69 +        assert(interval->assigned_regHi() >= pd_first_fpu_reg && interval->assigned_regHi() <= pd_last_fpu_reg, "no fpu register");
   50.70 +        assert(assigned_reg % 2 == 0 && assigned_reg + 1 == interval->assigned_regHi(), "must be sequential and even");
   50.71 +        LIR_Opr result = LIR_OprFact::double_fpu(assigned_reg - pd_first_fpu_reg, interval->assigned_regHi() - pd_first_fpu_reg);
   50.72  #else
   50.73          assert(assigned_reg >= pd_first_fpu_reg && assigned_reg <= pd_last_fpu_reg, "no fpu register");
   50.74          assert(interval->assigned_regHi() == any_reg, "must not have hi register (double fpu values are stored in one register on Intel)");
   50.75 @@ -2076,6 +2096,7 @@
   50.76  #endif
   50.77          return result;
   50.78        }
   50.79 +#endif // __SOFTFP__
   50.80  
   50.81        default: {
   50.82          ShouldNotReachHere();
   50.83 @@ -2638,6 +2659,12 @@
   50.84  #ifdef SPARC
   50.85        assert(opr->fpu_regnrLo() == opr->fpu_regnrHi() + 1, "assumed in calculation (only fpu_regnrHi is used)");
   50.86  #endif
   50.87 +#ifdef ARM
   50.88 +      assert(opr->fpu_regnrHi() == opr->fpu_regnrLo() + 1, "assumed in calculation (only fpu_regnrLo is used)");
   50.89 +#endif
   50.90 +#ifdef PPC
   50.91 +      assert(opr->fpu_regnrLo() == opr->fpu_regnrHi(), "assumed in calculation (only fpu_regnrHi is used)");
   50.92 +#endif
   50.93  
   50.94        VMReg rname_first = frame_map()->fpu_regname(opr->fpu_regnrHi());
   50.95  #ifdef _LP64
   50.96 @@ -6135,6 +6162,17 @@
   50.97              assert(prev_op->as_OpBranch() != NULL, "branch must be of type LIR_OpBranch");
   50.98              LIR_OpBranch* prev_branch = (LIR_OpBranch*)prev_op;
   50.99  
  50.100 +            LIR_Op2* prev_cmp = NULL;
  50.101 +
  50.102 +            for(int j = instructions->length() - 3; j >= 0 && prev_cmp == NULL; j--) {
  50.103 +              prev_op = instructions->at(j);
  50.104 +              if(prev_op->code() == lir_cmp) {
  50.105 +                assert(prev_op->as_Op2() != NULL, "branch must be of type LIR_Op2");
  50.106 +                prev_cmp = (LIR_Op2*)prev_op;
  50.107 +                assert(prev_branch->cond() == prev_cmp->condition(), "should be the same");
  50.108 +              }
  50.109 +            }
  50.110 +            assert(prev_cmp != NULL, "should have found comp instruction for branch");
  50.111              if (prev_branch->block() == code->at(i + 1) && prev_branch->info() == NULL) {
  50.112  
  50.113                TRACE_LINEAR_SCAN(3, tty->print_cr("Negating conditional branch and deleting unconditional branch at end of block B%d", block->block_id()));
  50.114 @@ -6142,6 +6180,7 @@
  50.115                // eliminate a conditional branch to the immediate successor
  50.116                prev_branch->change_block(last_branch->block());
  50.117                prev_branch->negate_cond();
  50.118 +              prev_cmp->set_condition(prev_branch->cond());
  50.119                instructions->truncate(instructions->length() - 1);
  50.120              }
  50.121            }
    51.1 --- a/src/share/vm/c1/c1_Runtime1.cpp	Wed Jul 28 17:57:43 2010 -0400
    51.2 +++ b/src/share/vm/c1/c1_Runtime1.cpp	Tue Aug 03 08:13:38 2010 -0400
    51.3 @@ -144,7 +144,7 @@
    51.4  #ifndef TIERED
    51.5      case counter_overflow_id: // Not generated outside the tiered world
    51.6  #endif
    51.7 -#ifdef SPARC
    51.8 +#if defined(SPARC) || defined(PPC)
    51.9      case handle_exception_nofpu_id:  // Unused on sparc
   51.10  #endif
   51.11        break;
   51.12 @@ -240,7 +240,8 @@
   51.13  
   51.14  #undef FUNCTION_CASE
   51.15  
   51.16 -  return "<unknown function>";
   51.17 +  // Soft float adds more runtime names.
   51.18 +  return pd_name_for_address(entry);
   51.19  }
   51.20  
   51.21  
   51.22 @@ -896,7 +897,10 @@
   51.23            } else {
   51.24              // patch the instruction <move reg, klass>
   51.25              NativeMovConstReg* n_copy = nativeMovConstReg_at(copy_buff);
   51.26 -            assert(n_copy->data() == 0, "illegal init value");
   51.27 +
   51.28 +            assert(n_copy->data() == 0 ||
   51.29 +                   n_copy->data() == (int)Universe::non_oop_word(),
   51.30 +                   "illegal init value");
   51.31              assert(load_klass() != NULL, "klass not set");
   51.32              n_copy->set_data((intx) (load_klass()));
   51.33  
   51.34 @@ -904,7 +908,7 @@
   51.35                Disassembler::decode(copy_buff, copy_buff + *byte_count, tty);
   51.36              }
   51.37  
   51.38 -#ifdef SPARC
   51.39 +#if defined(SPARC) || defined(PPC)
   51.40              // Update the oop location in the nmethod with the proper
   51.41              // oop.  When the code was generated, a NULL was stuffed
   51.42              // in the oop table and that table needs to be update to
   51.43 @@ -934,6 +938,14 @@
   51.44          if (do_patch) {
   51.45            // replace instructions
   51.46            // first replace the tail, then the call
   51.47 +#ifdef ARM
   51.48 +          if(stub_id == Runtime1::load_klass_patching_id && !VM_Version::supports_movw()) {
   51.49 +            copy_buff -= *byte_count;
   51.50 +            NativeMovConstReg* n_copy2 = nativeMovConstReg_at(copy_buff);
   51.51 +            n_copy2->set_data((intx) (load_klass()), instr_pc);
   51.52 +          }
   51.53 +#endif
   51.54 +
   51.55            for (int i = NativeCall::instruction_size; i < *byte_count; i++) {
   51.56              address ptr = copy_buff + i;
   51.57              int a_byte = (*ptr) & 0xFF;
   51.58 @@ -961,6 +973,12 @@
   51.59              relocInfo::change_reloc_info_for_address(&iter2, (address) instr_pc2,
   51.60                                                       relocInfo::none, relocInfo::oop_type);
   51.61  #endif
   51.62 +#ifdef PPC
   51.63 +          { address instr_pc2 = instr_pc + NativeMovConstReg::lo_offset;
   51.64 +            RelocIterator iter2(nm, instr_pc2, instr_pc2 + 1);
   51.65 +            relocInfo::change_reloc_info_for_address(&iter2, (address) instr_pc2, relocInfo::none, relocInfo::oop_type);
   51.66 +          }
   51.67 +#endif
   51.68            }
   51.69  
   51.70          } else {
    52.1 --- a/src/share/vm/c1/c1_Runtime1.hpp	Wed Jul 28 17:57:43 2010 -0400
    52.2 +++ b/src/share/vm/c1/c1_Runtime1.hpp	Tue Aug 03 08:13:38 2010 -0400
    52.3 @@ -159,6 +159,9 @@
    52.4    static const char* name_for (StubID id);
    52.5    static const char* name_for_address(address entry);
    52.6  
    52.7 +  // platform might add runtime names.
    52.8 +  static const char* pd_name_for_address(address entry);
    52.9 +
   52.10    // method tracing
   52.11    static void trace_block_entry(jint block_id);
   52.12  
    53.1 --- a/src/share/vm/code/codeBlob.cpp	Wed Jul 28 17:57:43 2010 -0400
    53.2 +++ b/src/share/vm/code/codeBlob.cpp	Tue Aug 03 08:13:38 2010 -0400
    53.3 @@ -564,72 +564,53 @@
    53.4    ShouldNotReachHere();
    53.5  }
    53.6  
    53.7 -#ifndef PRODUCT
    53.8 -
    53.9 -void CodeBlob::print() const {
   53.10 -  tty->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", this);
   53.11 -  tty->print_cr("Framesize: %d", _frame_size);
   53.12 +void CodeBlob::print_on(outputStream* st) const {
   53.13 +  st->print_cr("[CodeBlob (" INTPTR_FORMAT ")]", this);
   53.14 +  st->print_cr("Framesize: %d", _frame_size);
   53.15  }
   53.16  
   53.17 -
   53.18  void CodeBlob::print_value_on(outputStream* st) const {
   53.19    st->print_cr("[CodeBlob]");
   53.20  }
   53.21  
   53.22 -#endif
   53.23 -
   53.24  void BufferBlob::verify() {
   53.25    // unimplemented
   53.26  }
   53.27  
   53.28 -#ifndef PRODUCT
   53.29 -
   53.30 -void BufferBlob::print() const {
   53.31 -  CodeBlob::print();
   53.32 -  print_value_on(tty);
   53.33 +void BufferBlob::print_on(outputStream* st) const {
   53.34 +  CodeBlob::print_on(st);
   53.35 +  print_value_on(st);
   53.36  }
   53.37  
   53.38 -
   53.39  void BufferBlob::print_value_on(outputStream* st) const {
   53.40    st->print_cr("BufferBlob (" INTPTR_FORMAT  ") used for %s", this, name());
   53.41  }
   53.42  
   53.43 -
   53.44 -#endif
   53.45 -
   53.46  void RuntimeStub::verify() {
   53.47    // unimplemented
   53.48  }
   53.49  
   53.50 -#ifndef PRODUCT
   53.51 -
   53.52 -void RuntimeStub::print() const {
   53.53 -  CodeBlob::print();
   53.54 -  tty->print("Runtime Stub (" INTPTR_FORMAT "): ", this);
   53.55 -  tty->print_cr(name());
   53.56 -  Disassembler::decode((CodeBlob*)this);
   53.57 +void RuntimeStub::print_on(outputStream* st) const {
   53.58 +  CodeBlob::print_on(st);
   53.59 +  st->print("Runtime Stub (" INTPTR_FORMAT "): ", this);
   53.60 +  st->print_cr(name());
   53.61 +  Disassembler::decode((CodeBlob*)this, st);
   53.62  }
   53.63  
   53.64 -
   53.65  void RuntimeStub::print_value_on(outputStream* st) const {
   53.66    st->print("RuntimeStub (" INTPTR_FORMAT "): ", this); st->print(name());
   53.67  }
   53.68  
   53.69 -#endif
   53.70 -
   53.71  void SingletonBlob::verify() {
   53.72    // unimplemented
   53.73  }
   53.74  
   53.75 -#ifndef PRODUCT
   53.76 -
   53.77 -void SingletonBlob::print() const {
   53.78 -  CodeBlob::print();
   53.79 -  tty->print_cr(name());
   53.80 -  Disassembler::decode((CodeBlob*)this);
   53.81 +void SingletonBlob::print_on(outputStream* st) const {
   53.82 +  CodeBlob::print_on(st);
   53.83 +  st->print_cr(name());
   53.84 +  Disassembler::decode((CodeBlob*)this, st);
   53.85  }
   53.86  
   53.87 -
   53.88  void SingletonBlob::print_value_on(outputStream* st) const {
   53.89    st->print_cr(name());
   53.90  }
   53.91 @@ -637,5 +618,3 @@
   53.92  void DeoptimizationBlob::print_value_on(outputStream* st) const {
   53.93    st->print_cr("Deoptimization (frame not available)");
   53.94  }
   53.95 -
   53.96 -#endif // PRODUCT
    54.1 --- a/src/share/vm/code/codeBlob.hpp	Wed Jul 28 17:57:43 2010 -0400
    54.2 +++ b/src/share/vm/code/codeBlob.hpp	Tue Aug 03 08:13:38 2010 -0400
    54.3 @@ -163,8 +163,9 @@
    54.4  
    54.5    // Debugging
    54.6    virtual void verify();
    54.7 -  virtual void print() const                     PRODUCT_RETURN;
    54.8 -  virtual void print_value_on(outputStream* st) const PRODUCT_RETURN;
    54.9 +  void print() const                             { print_on(tty); }
   54.10 +  virtual void print_on(outputStream* st) const;
   54.11 +  virtual void print_value_on(outputStream* st) const;
   54.12  
   54.13    // Print the comment associated with offset on stream, if there is one
   54.14    virtual void print_block_comment(outputStream* stream, address block_begin) {
   54.15 @@ -209,8 +210,8 @@
   54.16    bool is_alive() const                          { return true; }
   54.17  
   54.18    void verify();
   54.19 -  void print() const                             PRODUCT_RETURN;
   54.20 -  void print_value_on(outputStream* st) const    PRODUCT_RETURN;
   54.21 +  void print_on(outputStream* st) const;
   54.22 +  void print_value_on(outputStream* st) const;
   54.23  };
   54.24  
   54.25  
   54.26 @@ -292,8 +293,8 @@
   54.27    bool is_alive() const                          { return true; }
   54.28  
   54.29    void verify();
   54.30 -  void print() const                             PRODUCT_RETURN;
   54.31 -  void print_value_on(outputStream* st) const    PRODUCT_RETURN;
   54.32 +  void print_on(outputStream* st) const;
   54.33 +  void print_value_on(outputStream* st) const;
   54.34  };
   54.35  
   54.36  
   54.37 @@ -317,8 +318,8 @@
   54.38     bool is_alive() const                         { return true; }
   54.39  
   54.40     void verify(); // does nothing
   54.41 -   void print() const                            PRODUCT_RETURN;
   54.42 -   void print_value_on(outputStream* st) const   PRODUCT_RETURN;
   54.43 +   void print_on(outputStream* st) const;
   54.44 +   void print_value_on(outputStream* st) const;
   54.45  };
   54.46  
   54.47  
   54.48 @@ -373,7 +374,7 @@
   54.49    void preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { /* Nothing to do */ }
   54.50  
   54.51    // Printing
   54.52 -  void print_value_on(outputStream* st) const PRODUCT_RETURN;
   54.53 +  void print_value_on(outputStream* st) const;
   54.54  
   54.55    address unpack() const                         { return instructions_begin() + _unpack_offset;           }
   54.56    address unpack_with_exception() const          { return instructions_begin() + _unpack_with_exception;   }
    55.1 --- a/src/share/vm/code/nmethod.hpp	Wed Jul 28 17:57:43 2010 -0400
    55.2 +++ b/src/share/vm/code/nmethod.hpp	Tue Aug 03 08:13:38 2010 -0400
    55.3 @@ -606,6 +606,8 @@
    55.4    void print_nul_chk_table()                      PRODUCT_RETURN;
    55.5    void print_nmethod(bool print_code);
    55.6  
    55.7 +  // need to re-define this from CodeBlob else the overload hides it
    55.8 +  virtual void print_on(outputStream* st) const { CodeBlob::print_on(st); }
    55.9    void print_on(outputStream* st, const char* title) const;
   55.10  
   55.11    // Logging
    56.1 --- a/src/share/vm/code/vtableStubs.cpp	Wed Jul 28 17:57:43 2010 -0400
    56.2 +++ b/src/share/vm/code/vtableStubs.cpp	Tue Aug 03 08:13:38 2010 -0400
    56.3 @@ -67,8 +67,8 @@
    56.4  }
    56.5  
    56.6  
    56.7 -void VtableStub::print() {
    56.8 -  tty->print("vtable stub (index = %d, receiver_location = %d, code = [" INTPTR_FORMAT ", " INTPTR_FORMAT "[)",
    56.9 +void VtableStub::print_on(outputStream* st) const {
   56.10 +  st->print("vtable stub (index = %d, receiver_location = %d, code = [" INTPTR_FORMAT ", " INTPTR_FORMAT "[)",
   56.11               index(), receiver_location(), code_begin(), code_end());
   56.12  }
   56.13  
    57.1 --- a/src/share/vm/code/vtableStubs.hpp	Wed Jul 28 17:57:43 2010 -0400
    57.2 +++ b/src/share/vm/code/vtableStubs.hpp	Tue Aug 03 08:13:38 2010 -0400
    57.3 @@ -86,7 +86,9 @@
    57.4    bool is_abstract_method_error(address epc)     { return epc == code_begin()+_ame_offset; }
    57.5    bool is_null_pointer_exception(address epc)    { return epc == code_begin()+_npe_offset; }
    57.6  
    57.7 -  void print();
    57.8 +  void print_on(outputStream* st) const;
    57.9 +  void print() const                             { print_on(tty); }
   57.10 +
   57.11  };
   57.12  
   57.13  
    58.1 --- a/src/share/vm/compiler/disassembler.cpp	Wed Jul 28 17:57:43 2010 -0400
    58.2 +++ b/src/share/vm/compiler/disassembler.cpp	Tue Aug 03 08:13:38 2010 -0400
    58.3 @@ -371,7 +371,7 @@
    58.4  address decode_env::decode_instructions(address start, address end) {
    58.5    _start = start; _end = end;
    58.6  
    58.7 -  assert((((intptr_t)start | (intptr_t)end) % Disassembler::pd_instruction_alignment() == 0), "misaligned insn addr");
    58.8 +  assert(((((intptr_t)start | (intptr_t)end) % Disassembler::pd_instruction_alignment()) == 0), "misaligned insn addr");
    58.9  
   58.10    const int show_bytes = false; // for disassembler debugging
   58.11  
    59.1 --- a/src/share/vm/includeDB_compiler1	Wed Jul 28 17:57:43 2010 -0400
    59.2 +++ b/src/share/vm/includeDB_compiler1	Tue Aug 03 08:13:38 2010 -0400
    59.3 @@ -252,6 +252,7 @@
    59.4  c1_LIRGenerator.cpp                     ciInstance.hpp
    59.5  c1_LIRGenerator.cpp                     heapRegion.hpp
    59.6  c1_LIRGenerator.cpp                     sharedRuntime.hpp
    59.7 +c1_LIRGenerator.cpp                     stubRoutines.hpp
    59.8  
    59.9  c1_LIRGenerator.hpp                     c1_Instruction.hpp
   59.10  c1_LIRGenerator.hpp                     c1_LIR.hpp
   59.11 @@ -270,6 +271,8 @@
   59.12  c1_LIRGenerator_<arch>.cpp             ciTypeArrayKlass.hpp
   59.13  c1_LIRGenerator_<arch>.cpp             sharedRuntime.hpp
   59.14  c1_LIRGenerator_<arch>.cpp             vmreg_<arch>.inline.hpp
   59.15 +c1_LIRGenerator_<arch>.cpp             stubRoutines.hpp
   59.16 +
   59.17  
   59.18  c1_LinearScan.cpp                       bitMap.inline.hpp
   59.19  c1_LinearScan.cpp                       c1_CFGPrinter.hpp
   59.20 @@ -413,6 +416,7 @@
   59.21  compileBroker.cpp                       c1_Compiler.hpp
   59.22  
   59.23  frame_<arch>.cpp                        c1_Runtime1.hpp
   59.24 +frame_<arch>.cpp                        vframeArray.hpp
   59.25  
   59.26  globals.cpp                             c1_globals.hpp
   59.27  
    60.1 --- a/src/share/vm/includeDB_core	Wed Jul 28 17:57:43 2010 -0400
    60.2 +++ b/src/share/vm/includeDB_core	Tue Aug 03 08:13:38 2010 -0400
    60.3 @@ -284,6 +284,7 @@
    60.4  atomic_<os_arch>.inline.hpp             atomic.hpp
    60.5  atomic_<os_arch>.inline.hpp             os.hpp
    60.6  atomic_<os_arch>.inline.hpp             vm_version_<arch>.hpp
    60.7 +atomic_<os_arch>.inline.hpp             orderAccess_<os_arch>.inline.hpp
    60.8  
    60.9  // attachListener is jck optional, put cpp deps in includeDB_features
   60.10  
   60.11 @@ -1734,6 +1735,7 @@
   60.12  genCollectedHeap.cpp                    space.hpp
   60.13  genCollectedHeap.cpp                    symbolTable.hpp
   60.14  genCollectedHeap.cpp                    systemDictionary.hpp
   60.15 +genCollectedHeap.cpp                    vmError.hpp
   60.16  genCollectedHeap.cpp                    vmGCOperations.hpp
   60.17  genCollectedHeap.cpp                    vmSymbols.hpp
   60.18  genCollectedHeap.cpp                    vmThread.hpp
   60.19 @@ -3230,6 +3232,7 @@
   60.20  os.cpp                                  events.hpp
   60.21  os.cpp                                  frame.inline.hpp
   60.22  os.cpp                                  hpi.hpp
   60.23 +os.cpp					icBuffer.hpp
   60.24  os.cpp                                  interfaceSupport.hpp
   60.25  os.cpp                                  interpreter.hpp
   60.26  os.cpp                                  java.hpp
   60.27 @@ -3241,6 +3244,7 @@
   60.28  os.cpp                                  oop.inline.hpp
   60.29  os.cpp                                  os.hpp
   60.30  os.cpp                                  os_<os_family>.inline.hpp
   60.31 +os.cpp	                                privilegedStack.hpp
   60.32  os.cpp                                  stubRoutines.hpp
   60.33  os.cpp                                  systemDictionary.hpp
   60.34  os.cpp                                  threadService.hpp
    61.1 --- a/src/share/vm/interpreter/bytecodeInterpreter.cpp	Wed Jul 28 17:57:43 2010 -0400
    61.2 +++ b/src/share/vm/interpreter/bytecodeInterpreter.cpp	Tue Aug 03 08:13:38 2010 -0400
    61.3 @@ -339,7 +339,8 @@
    61.4  #define CHECK_NULL(obj_)                                                 \
    61.5      if ((obj_) == NULL) {                                                \
    61.6          VM_JAVA_ERROR(vmSymbols::java_lang_NullPointerException(), "");  \
    61.7 -    }
    61.8 +    }                                                                    \
    61.9 +    VERIFY_OOP(obj_)
   61.10  
   61.11  #define VMdoubleConstZero() 0.0
   61.12  #define VMdoubleConstOne() 1.0
   61.13 @@ -509,7 +510,7 @@
   61.14  
   61.15  /* 0xB0 */ &&opc_areturn,     &&opc_return,         &&opc_getstatic,    &&opc_putstatic,
   61.16  /* 0xB4 */ &&opc_getfield,    &&opc_putfield,       &&opc_invokevirtual,&&opc_invokespecial,
   61.17 -/* 0xB8 */ &&opc_invokestatic,&&opc_invokeinterface,NULL,               &&opc_new,
   61.18 +/* 0xB8 */ &&opc_invokestatic,&&opc_invokeinterface,&&opc_default,      &&opc_new,
   61.19  /* 0xBC */ &&opc_newarray,    &&opc_anewarray,      &&opc_arraylength,  &&opc_athrow,
   61.20  
   61.21  /* 0xC0 */ &&opc_checkcast,   &&opc_instanceof,     &&opc_monitorenter, &&opc_monitorexit,
   61.22 @@ -539,6 +540,7 @@
   61.23    // this will trigger a VERIFY_OOP on entry
   61.24    if (istate->msg() != initialize && ! METHOD->is_static()) {
   61.25      oop rcvr = LOCALS_OBJECT(0);
   61.26 +    VERIFY_OOP(rcvr);
   61.27    }
   61.28  #endif
   61.29  // #define HACK
   61.30 @@ -547,7 +549,7 @@
   61.31  #endif // HACK
   61.32  
   61.33    /* QQQ this should be a stack method so we don't know actual direction */
   61.34 -  assert(istate->msg() == initialize ||
   61.35 +  guarantee(istate->msg() == initialize ||
   61.36           topOfStack >= istate->stack_limit() &&
   61.37           topOfStack < istate->stack_base(),
   61.38           "Stack top out of range");
   61.39 @@ -613,6 +615,7 @@
   61.40              rcvr = METHOD->constants()->pool_holder()->klass_part()->java_mirror();
   61.41            } else {
   61.42              rcvr = LOCALS_OBJECT(0);
   61.43 +            VERIFY_OOP(rcvr);
   61.44            }
   61.45            // The initial monitor is ours for the taking
   61.46            BasicObjectLock* mon = &istate->monitor_base()[-1];
   61.47 @@ -735,6 +738,7 @@
   61.48      case popping_frame: {
   61.49        // returned from a java call to pop the frame, restart the call
   61.50        // clear the message so we don't confuse ourselves later
   61.51 +      ShouldNotReachHere();  // we don't return this.
   61.52        assert(THREAD->pop_frame_in_process(), "wrong frame pop state");
   61.53        istate->set_msg(no_request);
   61.54        THREAD->clr_pop_frame_in_process();
   61.55 @@ -801,6 +805,7 @@
   61.56        // continue locking now that we have a monitor to use
   61.57        // we expect to find newly allocated monitor at the "top" of the monitor stack.
   61.58        oop lockee = STACK_OBJECT(-1);
   61.59 +      VERIFY_OOP(lockee);
   61.60        // derefing's lockee ought to provoke implicit null check
   61.61        // find a free monitor
   61.62        BasicObjectLock* entry = (BasicObjectLock*) istate->stack_base();
   61.63 @@ -911,6 +916,7 @@
   61.64            /* load from local variable */
   61.65  
   61.66        CASE(_aload):
   61.67 +          VERIFY_OOP(LOCALS_OBJECT(pc[1]));
   61.68            SET_STACK_OBJECT(LOCALS_OBJECT(pc[1]), 0);
   61.69            UPDATE_PC_AND_TOS_AND_CONTINUE(2, 1);
   61.70  
   61.71 @@ -930,6 +936,7 @@
   61.72  #undef  OPC_LOAD_n
   61.73  #define OPC_LOAD_n(num)                                                 \
   61.74        CASE(_aload_##num):                                               \
   61.75 +          VERIFY_OOP(LOCALS_OBJECT(num));                               \
   61.76            SET_STACK_OBJECT(LOCALS_OBJECT(num), 0);                      \
   61.77            UPDATE_PC_AND_TOS_AND_CONTINUE(1, 1);                         \
   61.78                                                                          \
   61.79 @@ -975,6 +982,7 @@
   61.80            opcode = pc[1];
   61.81            switch(opcode) {
   61.82                case Bytecodes::_aload:
   61.83 +                  VERIFY_OOP(LOCALS_OBJECT(reg));
   61.84                    SET_STACK_OBJECT(LOCALS_OBJECT(reg), 0);
   61.85                    UPDATE_PC_AND_TOS_AND_CONTINUE(4, 1);
   61.86  
   61.87 @@ -1099,7 +1107,7 @@
   61.88        CASE(_i##opcname):                                                \
   61.89            if (test && (STACK_INT(-1) == 0)) {                           \
   61.90                VM_JAVA_ERROR(vmSymbols::java_lang_ArithmeticException(), \
   61.91 -                            "/ by int zero");                           \
   61.92 +                            "/ by zero");                               \
   61.93            }                                                             \
   61.94            SET_STACK_INT(VMint##opname(STACK_INT(-2),                    \
   61.95                                        STACK_INT(-1)),                   \
   61.96 @@ -1277,7 +1285,12 @@
   61.97            jfloat f;
   61.98            jdouble r;
   61.99            f = STACK_FLOAT(-1);
  61.100 +#ifdef IA64
  61.101 +          // IA64 gcc bug
  61.102 +          r = ( f == 0.0f ) ? (jdouble) f : (jdouble) f + ia64_double_zero;
  61.103 +#else
  61.104            r = (jdouble) f;
  61.105 +#endif
  61.106            MORE_STACK(-1); // POP
  61.107            SET_STACK_DOUBLE(r, 1);
  61.108            UPDATE_PC_AND_TOS_AND_CONTINUE(1, 2);
  61.109 @@ -1471,6 +1484,7 @@
  61.110        CASE(_return_register_finalizer): {
  61.111  
  61.112            oop rcvr = LOCALS_OBJECT(0);
  61.113 +          VERIFY_OOP(rcvr);
  61.114            if (rcvr->klass()->klass_part()->has_finalizer()) {
  61.115              CALL_VM(InterpreterRuntime::register_finalizer(THREAD, rcvr), handle_exception);
  61.116            }
  61.117 @@ -1561,6 +1575,7 @@
  61.118         */
  61.119        CASE(_aastore): {
  61.120            oop rhsObject = STACK_OBJECT(-1);
  61.121 +          VERIFY_OOP(rhsObject);
  61.122            ARRAY_INTRO( -3);
  61.123            // arrObj, index are set
  61.124            if (rhsObject != NULL) {
  61.125 @@ -1703,6 +1718,7 @@
  61.126                  obj = (oop)NULL;
  61.127                } else {
  61.128                  obj = (oop) STACK_OBJECT(-1);
  61.129 +                VERIFY_OOP(obj);
  61.130                }
  61.131                CALL_VM(InterpreterRuntime::post_field_access(THREAD,
  61.132                                            obj,
  61.133 @@ -1728,6 +1744,7 @@
  61.134            int field_offset = cache->f2();
  61.135            if (cache->is_volatile()) {
  61.136              if (tos_type == atos) {
  61.137 +              VERIFY_OOP(obj->obj_field_acquire(field_offset));
  61.138                SET_STACK_OBJECT(obj->obj_field_acquire(field_offset), -1);
  61.139              } else if (tos_type == itos) {
  61.140                SET_STACK_INT(obj->int_field_acquire(field_offset), -1);
  61.141 @@ -1748,6 +1765,7 @@
  61.142              }
  61.143            } else {
  61.144              if (tos_type == atos) {
  61.145 +              VERIFY_OOP(obj->obj_field(field_offset));
  61.146                SET_STACK_OBJECT(obj->obj_field(field_offset), -1);
  61.147              } else if (tos_type == itos) {
  61.148                SET_STACK_INT(obj->int_field(field_offset), -1);
  61.149 @@ -1799,6 +1817,7 @@
  61.150                  } else {
  61.151                    obj = (oop) STACK_OBJECT(-2);
  61.152                  }
  61.153 +                VERIFY_OOP(obj);
  61.154                }
  61.155  
  61.156                CALL_VM(InterpreterRuntime::post_field_modification(THREAD,
  61.157 @@ -1837,6 +1856,7 @@
  61.158              if (tos_type == itos) {
  61.159                obj->release_int_field_put(field_offset, STACK_INT(-1));
  61.160              } else if (tos_type == atos) {
  61.161 +              VERIFY_OOP(STACK_OBJECT(-1));
  61.162                obj->release_obj_field_put(field_offset, STACK_OBJECT(-1));
  61.163                OrderAccess::release_store(&BYTE_MAP_BASE[(uintptr_t)obj >> CardTableModRefBS::card_shift], 0);
  61.164              } else if (tos_type == btos) {
  61.165 @@ -1857,6 +1877,7 @@
  61.166              if (tos_type == itos) {
  61.167                obj->int_field_put(field_offset, STACK_INT(-1));
  61.168              } else if (tos_type == atos) {
  61.169 +              VERIFY_OOP(STACK_OBJECT(-1));
  61.170                obj->obj_field_put(field_offset, STACK_OBJECT(-1));
  61.171                OrderAccess::release_store(&BYTE_MAP_BASE[(uintptr_t)obj >> CardTableModRefBS::card_shift], 0);
  61.172              } else if (tos_type == btos) {
  61.173 @@ -1961,6 +1982,7 @@
  61.174        }
  61.175        CASE(_checkcast):
  61.176            if (STACK_OBJECT(-1) != NULL) {
  61.177 +            VERIFY_OOP(STACK_OBJECT(-1));
  61.178              u2 index = Bytes::get_Java_u2(pc+1);
  61.179              if (ProfileInterpreter) {
  61.180                // needs Profile_checkcast QQQ
  61.181 @@ -1999,6 +2021,7 @@
  61.182            if (STACK_OBJECT(-1) == NULL) {
  61.183              SET_STACK_INT(0, -1);
  61.184            } else {
  61.185 +            VERIFY_OOP(STACK_OBJECT(-1));
  61.186              u2 index = Bytes::get_Java_u2(pc+1);
  61.187              // Constant pool may have actual klass or unresolved klass. If it is
  61.188              // unresolved we must resolve it
  61.189 @@ -2044,10 +2067,12 @@
  61.190              break;
  61.191  
  61.192            case JVM_CONSTANT_String:
  61.193 +            VERIFY_OOP(constants->resolved_string_at(index));
  61.194              SET_STACK_OBJECT(constants->resolved_string_at(index), 0);
  61.195              break;
  61.196  
  61.197            case JVM_CONSTANT_Class:
  61.198 +            VERIFY_OOP(constants->resolved_klass_at(index)->klass_part()->java_mirror());
  61.199              SET_STACK_OBJECT(constants->resolved_klass_at(index)->klass_part()->java_mirror(), 0);
  61.200              break;
  61.201  
  61.202 @@ -2059,17 +2084,6 @@
  61.203              THREAD->set_vm_result(NULL);
  61.204              break;
  61.205  
  61.206 -#if 0
  61.207 -          CASE(_fast_igetfield):
  61.208 -          CASE(_fastagetfield):
  61.209 -          CASE(_fast_aload_0):
  61.210 -          CASE(_fast_iaccess_0):
  61.211 -          CASE(__fast_aaccess_0):
  61.212 -          CASE(_fast_linearswitch):
  61.213 -          CASE(_fast_binaryswitch):
  61.214 -            fatal("unsupported fast bytecode");
  61.215 -#endif
  61.216 -
  61.217            default:  ShouldNotReachHere();
  61.218            }
  61.219            UPDATE_PC_AND_TOS_AND_CONTINUE(incr, 1);
  61.220 @@ -2122,6 +2136,7 @@
  61.221              // get receiver
  61.222              int parms = cache->parameter_size();
  61.223              // Same comments as invokevirtual apply here
  61.224 +            VERIFY_OOP(STACK_OBJECT(-parms));
  61.225              instanceKlass* rcvrKlass = (instanceKlass*)
  61.226                                   STACK_OBJECT(-parms)->klass()->klass_part();
  61.227              callee = (methodOop) rcvrKlass->start_of_vtable()[ cache->f2()];
  61.228 @@ -2205,6 +2220,7 @@
  61.229                // this fails with an assert
  61.230                // instanceKlass* rcvrKlass = instanceKlass::cast(STACK_OBJECT(-parms)->klass());
  61.231                // but this works
  61.232 +              VERIFY_OOP(STACK_OBJECT(-parms));
  61.233                instanceKlass* rcvrKlass = (instanceKlass*) STACK_OBJECT(-parms)->klass()->klass_part();
  61.234                /*
  61.235                  Executing this code in java.lang.String:
  61.236 @@ -2651,14 +2667,14 @@
  61.237                                  LOCALS_SLOT(METHOD->size_of_parameters() - 1));
  61.238          THREAD->set_popframe_condition_bit(JavaThread::popframe_force_deopt_reexecution_bit);
  61.239        }
  61.240 -      UPDATE_PC_AND_RETURN(1);
  61.241 -    } else {
  61.242 -      // Normal return
  61.243 -      // Advance the pc and return to frame manager
  61.244 -      istate->set_msg(return_from_method);
  61.245 -      istate->set_return_kind((Bytecodes::Code)opcode);
  61.246 -      UPDATE_PC_AND_RETURN(1);
  61.247 +      THREAD->clr_pop_frame_in_process();
  61.248      }
  61.249 +
  61.250 +    // Normal return
  61.251 +    // Advance the pc and return to frame manager
  61.252 +    istate->set_msg(return_from_method);
  61.253 +    istate->set_return_kind((Bytecodes::Code)opcode);
  61.254 +    UPDATE_PC_AND_RETURN(1);
  61.255    } /* handle_return: */
  61.256  
  61.257  // This is really a fatal error return
    62.1 --- a/src/share/vm/interpreter/bytecodeInterpreter.hpp	Wed Jul 28 17:57:43 2010 -0400
    62.2 +++ b/src/share/vm/interpreter/bytecodeInterpreter.hpp	Tue Aug 03 08:13:38 2010 -0400
    62.3 @@ -440,7 +440,7 @@
    62.4   * iushr, ishl, and ishr bytecodes, respectively.
    62.5   */
    62.6  
    62.7 -static jint VMintUshr(jint op, jint num);
    62.8 +static juint VMintUshr(jint op, jint num);
    62.9  static jint VMintShl (jint op, jint num);
   62.10  static jint VMintShr (jint op, jint num);
   62.11  
    63.1 --- a/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp	Wed Jul 28 17:57:43 2010 -0400
    63.2 +++ b/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp	Tue Aug 03 08:13:38 2010 -0400
    63.3 @@ -27,14 +27,11 @@
    63.4  #ifdef CC_INTERP
    63.5  
    63.6  #ifdef ASSERT
    63.7 -extern "C" { typedef void (*verify_oop_fn_t)(oop, const char *);};
    63.8 -#define VERIFY_OOP(o) \
    63.9 -        /*{ verify_oop_fn_t verify_oop_entry = \
   63.10 -            *StubRoutines::verify_oop_subroutine_entry_address(); \
   63.11 -          if (verify_oop_entry) { \
   63.12 -             (*verify_oop_entry)((o), "Not an oop!"); \
   63.13 -          } \
   63.14 -        }*/
   63.15 +#define VERIFY_OOP(o_) \
   63.16 +      if (VerifyOops) { \
   63.17 +        assert((oop(o_))->is_oop_or_null(), "Not an oop!"); \
   63.18 +        StubRoutines::_verify_oop_count++;  \
   63.19 +      }
   63.20  #else
   63.21  #define VERIFY_OOP(o)
   63.22  #endif
    64.1 --- a/src/share/vm/interpreter/interpreter.cpp	Wed Jul 28 17:57:43 2010 -0400
    64.2 +++ b/src/share/vm/interpreter/interpreter.cpp	Tue Aug 03 08:13:38 2010 -0400
    64.3 @@ -41,20 +41,20 @@
    64.4  }
    64.5  
    64.6  
    64.7 -void InterpreterCodelet::print() {
    64.8 +void InterpreterCodelet::print_on(outputStream* st) const {
    64.9    if (PrintInterpreter) {
   64.10 -    tty->cr();
   64.11 -    tty->print_cr("----------------------------------------------------------------------");
   64.12 +    st->cr();
   64.13 +    st->print_cr("----------------------------------------------------------------------");
   64.14    }
   64.15  
   64.16 -  if (description() != NULL) tty->print("%s  ", description());
   64.17 -  if (bytecode()    >= 0   ) tty->print("%d %s  ", bytecode(), Bytecodes::name(bytecode()));
   64.18 -  tty->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "]  %d bytes",
   64.19 +  if (description() != NULL) st->print("%s  ", description());
   64.20 +  if (bytecode()    >= 0   ) st->print("%d %s  ", bytecode(), Bytecodes::name(bytecode()));
   64.21 +  st->print_cr("[" INTPTR_FORMAT ", " INTPTR_FORMAT "]  %d bytes",
   64.22                  code_begin(), code_end(), code_size());
   64.23  
   64.24    if (PrintInterpreter) {
   64.25 -    tty->cr();
   64.26 -    Disassembler::decode(code_begin(), code_end(), tty);
   64.27 +    st->cr();
   64.28 +    Disassembler::decode(code_begin(), code_end(), st);
   64.29    }
   64.30  }
   64.31  
    65.1 --- a/src/share/vm/interpreter/interpreter.hpp	Wed Jul 28 17:57:43 2010 -0400
    65.2 +++ b/src/share/vm/interpreter/interpreter.hpp	Tue Aug 03 08:13:38 2010 -0400
    65.3 @@ -52,7 +52,8 @@
    65.4  
    65.5    // Debugging
    65.6    void    verify();
    65.7 -  void    print();
    65.8 +  void    print_on(outputStream* st) const;
    65.9 +  void    print() const { print_on(tty); }
   65.10  
   65.11    // Interpreter-specific initialization
   65.12    void    initialize(const char* description, Bytecodes::Code bytecode);
    66.1 --- a/src/share/vm/interpreter/oopMapCache.cpp	Wed Jul 28 17:57:43 2010 -0400
    66.2 +++ b/src/share/vm/interpreter/oopMapCache.cpp	Tue Aug 03 08:13:38 2010 -0400
    66.3 @@ -281,9 +281,7 @@
    66.4   public:
    66.5    void pass_int()                                { /* ignore */ }
    66.6    void pass_long()                               { /* ignore */ }
    66.7 -#if defined(_LP64) || defined(ZERO)
    66.8    void pass_float()                              { /* ignore */ }
    66.9 -#endif
   66.10    void pass_double()                             { /* ignore */ }
   66.11    void pass_object()                             { set_one(offset()); }
   66.12  
    67.1 --- a/src/share/vm/memory/allocation.cpp	Wed Jul 28 17:57:43 2010 -0400
    67.2 +++ b/src/share/vm/memory/allocation.cpp	Tue Aug 03 08:13:38 2010 -0400
    67.3 @@ -166,32 +166,40 @@
    67.4      _medium_pool = new ChunkPool(Chunk::medium_size + Chunk::aligned_overhead_size());
    67.5      _small_pool  = new ChunkPool(Chunk::init_size   + Chunk::aligned_overhead_size());
    67.6    }
    67.7 +
    67.8 +  static void clean() {
    67.9 +    enum { BlocksToKeep = 5 };
   67.10 +     _small_pool->free_all_but(BlocksToKeep);
   67.11 +     _medium_pool->free_all_but(BlocksToKeep);
   67.12 +     _large_pool->free_all_but(BlocksToKeep);
   67.13 +  }
   67.14  };
   67.15  
   67.16  ChunkPool* ChunkPool::_large_pool  = NULL;
   67.17  ChunkPool* ChunkPool::_medium_pool = NULL;
   67.18  ChunkPool* ChunkPool::_small_pool  = NULL;
   67.19  
   67.20 -
   67.21  void chunkpool_init() {
   67.22    ChunkPool::initialize();
   67.23  }
   67.24  
   67.25 +void
   67.26 +Chunk::clean_chunk_pool() {
   67.27 +  ChunkPool::clean();
   67.28 +}
   67.29 +
   67.30  
   67.31  //--------------------------------------------------------------------------------------
   67.32  // ChunkPoolCleaner implementation
   67.33 +//
   67.34  
   67.35  class ChunkPoolCleaner : public PeriodicTask {
   67.36 -  enum { CleaningInterval = 5000,        // cleaning interval in ms
   67.37 -         BlocksToKeep     = 5            // # of extra blocks to keep
   67.38 -  };
   67.39 +  enum { CleaningInterval = 5000 };      // cleaning interval in ms
   67.40  
   67.41   public:
   67.42     ChunkPoolCleaner() : PeriodicTask(CleaningInterval) {}
   67.43     void task() {
   67.44 -     ChunkPool::small_pool()->free_all_but(BlocksToKeep);
   67.45 -     ChunkPool::medium_pool()->free_all_but(BlocksToKeep);
   67.46 -     ChunkPool::large_pool()->free_all_but(BlocksToKeep);
   67.47 +     ChunkPool::clean();
   67.48     }
   67.49  };
   67.50  
    68.1 --- a/src/share/vm/memory/allocation.hpp	Wed Jul 28 17:57:43 2010 -0400
    68.2 +++ b/src/share/vm/memory/allocation.hpp	Tue Aug 03 08:13:38 2010 -0400
    68.3 @@ -174,9 +174,10 @@
    68.4  
    68.5    // Start the chunk_pool cleaner task
    68.6    static void start_chunk_pool_cleaner_task();
    68.7 +
    68.8 +  static void clean_chunk_pool();
    68.9  };
   68.10  
   68.11 -
   68.12  //------------------------------Arena------------------------------------------
   68.13  // Fast allocation of memory
   68.14  class Arena: public CHeapObj {
    69.1 --- a/src/share/vm/memory/genCollectedHeap.cpp	Wed Jul 28 17:57:43 2010 -0400
    69.2 +++ b/src/share/vm/memory/genCollectedHeap.cpp	Tue Aug 03 08:13:38 2010 -0400
    69.3 @@ -941,7 +941,9 @@
    69.4              VerifyBeforeExit ||
    69.5              PrintAssembly    ||
    69.6              tty->count() != 0 ||   // already printing
    69.7 -            VerifyAfterGC, "too expensive");
    69.8 +            VerifyAfterGC    ||
    69.9 +    VMError::fatal_error_in_progress(), "too expensive");
   69.10 +
   69.11    #endif
   69.12    // This might be sped up with a cache of the last generation that
   69.13    // answered yes.
    70.1 --- a/src/share/vm/memory/generation.hpp	Wed Jul 28 17:57:43 2010 -0400
    70.2 +++ b/src/share/vm/memory/generation.hpp	Tue Aug 03 08:13:38 2010 -0400
    70.3 @@ -131,7 +131,9 @@
    70.4    enum SomePublicConstants {
    70.5      // Generations are GenGrain-aligned and have size that are multiples of
    70.6      // GenGrain.
    70.7 -    LogOfGenGrain = 16,
    70.8 +    // Note: on ARM we add 1 bit for card_table_base to be properly aligned
    70.9 +    // (we expect its low byte to be zero - see implementation of post_barrier)
   70.10 +    LogOfGenGrain = 16 ARM_ONLY(+1),
   70.11      GenGrain = 1 << LogOfGenGrain
   70.12    };
   70.13  
    71.1 --- a/src/share/vm/oops/arrayKlass.cpp	Wed Jul 28 17:57:43 2010 -0400
    71.2 +++ b/src/share/vm/oops/arrayKlass.cpp	Tue Aug 03 08:13:38 2010 -0400
    71.3 @@ -179,8 +179,6 @@
    71.4    return JVMTI_CLASS_STATUS_ARRAY;
    71.5  }
    71.6  
    71.7 -#ifndef PRODUCT
    71.8 -
    71.9  // Printing
   71.10  
   71.11  void arrayKlass::oop_print_on(oop obj, outputStream* st) {
   71.12 @@ -189,8 +187,6 @@
   71.13    st->print_cr(" - length: %d", arrayOop(obj)->length());
   71.14  }
   71.15  
   71.16 -#endif
   71.17 -
   71.18  // Verification
   71.19  
   71.20  void arrayKlass::oop_verify_on(oop obj, outputStream* st) {
    72.1 --- a/src/share/vm/oops/arrayKlass.hpp	Wed Jul 28 17:57:43 2010 -0400
    72.2 +++ b/src/share/vm/oops/arrayKlass.hpp	Tue Aug 03 08:13:38 2010 -0400
    72.3 @@ -115,20 +115,15 @@
    72.4    // Return a handle.
    72.5    static void     complete_create_array_klass(arrayKlassHandle k, KlassHandle super_klass, TRAPS);
    72.6  
    72.7 - public:
    72.8 -   // jvm support
    72.9 -   jint compute_modifier_flags(TRAPS) const;
   72.10 +  // jvm support
   72.11 +  jint compute_modifier_flags(TRAPS) const;
   72.12  
   72.13 - public:
   72.14 -   // JVMTI support
   72.15 -   jint jvmti_class_status() const;
   72.16 +  // JVMTI support
   72.17 +  jint jvmti_class_status() const;
   72.18  
   72.19 -#ifndef PRODUCT
   72.20 - public:
   72.21    // Printing
   72.22    void oop_print_on(oop obj, outputStream* st);
   72.23 -#endif
   72.24 - public:
   72.25 +
   72.26    // Verification
   72.27    void oop_verify_on(oop obj, outputStream* st);
   72.28  };
    73.1 --- a/src/share/vm/oops/arrayKlassKlass.cpp	Wed Jul 28 17:57:43 2010 -0400
    73.2 +++ b/src/share/vm/oops/arrayKlassKlass.cpp	Tue Aug 03 08:13:38 2010 -0400
    73.3 @@ -151,15 +151,12 @@
    73.4  }
    73.5  #endif // SERIALGC
    73.6  
    73.7 -#ifndef PRODUCT
    73.8 -
    73.9  // Printing
   73.10  
   73.11  void arrayKlassKlass::oop_print_on(oop obj, outputStream* st) {
   73.12    assert(obj->is_klass(), "must be klass");
   73.13    klassKlass::oop_print_on(obj, st);
   73.14  }
   73.15 -#endif //PRODUCT
   73.16  
   73.17  void arrayKlassKlass::oop_print_value_on(oop obj, outputStream* st) {
   73.18    assert(obj->is_klass(), "must be klass");
    74.1 --- a/src/share/vm/oops/arrayKlassKlass.hpp	Wed Jul 28 17:57:43 2010 -0400
    74.2 +++ b/src/share/vm/oops/arrayKlassKlass.hpp	Tue Aug 03 08:13:38 2010 -0400
    74.3 @@ -55,12 +55,9 @@
    74.4    int oop_oop_iterate(oop obj, OopClosure* blk);
    74.5    int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr);
    74.6  
    74.7 - public:
    74.8    // Printing
    74.9    void oop_print_value_on(oop obj, outputStream* st);
   74.10 -#ifndef PRODUCT
   74.11    void oop_print_on(oop obj, outputStream* st);
   74.12 -#endif //PRODUCT
   74.13  
   74.14    // Verification
   74.15    const char* internal_name() const;
    75.1 --- a/src/share/vm/oops/compiledICHolderKlass.cpp	Wed Jul 28 17:57:43 2010 -0400
    75.2 +++ b/src/share/vm/oops/compiledICHolderKlass.cpp	Tue Aug 03 08:13:38 2010 -0400
    75.3 @@ -154,8 +154,6 @@
    75.4  }
    75.5  #endif // SERIALGC
    75.6  
    75.7 -#ifndef PRODUCT
    75.8 -
    75.9  // Printing
   75.10  
   75.11  void compiledICHolderKlass::oop_print_on(oop obj, outputStream* st) {
   75.12 @@ -166,8 +164,6 @@
   75.13    st->print(" - klass:  "); c->holder_klass()->print_value_on(st); st->cr();
   75.14  }
   75.15  
   75.16 -#endif //PRODUCT
   75.17 -
   75.18  void compiledICHolderKlass::oop_print_value_on(oop obj, outputStream* st) {
   75.19    assert(obj->is_compiledICHolder(), "must be compiledICHolder");
   75.20    Klass::oop_print_value_on(obj, st);
    76.1 --- a/src/share/vm/oops/compiledICHolderKlass.hpp	Wed Jul 28 17:57:43 2010 -0400
    76.2 +++ b/src/share/vm/oops/compiledICHolderKlass.hpp	Tue Aug 03 08:13:38 2010 -0400
    76.3 @@ -68,12 +68,9 @@
    76.4    int  oop_oop_iterate(oop obj, OopClosure* blk);
    76.5    int  oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr);
    76.6  
    76.7 - public:
    76.8    // Printing
    76.9    void oop_print_value_on(oop obj, outputStream* st);
   76.10 -#ifndef PRODUCT
   76.11    void oop_print_on      (oop obj, outputStream* st);
   76.12 -#endif //PRODUCT
   76.13  
   76.14    // Verification
   76.15    const char* internal_name() const;
    77.1 --- a/src/share/vm/oops/constMethodKlass.cpp	Wed Jul 28 17:57:43 2010 -0400
    77.2 +++ b/src/share/vm/oops/constMethodKlass.cpp	Tue Aug 03 08:13:38 2010 -0400
    77.3 @@ -197,8 +197,6 @@
    77.4  }
    77.5  #endif // SERIALGC
    77.6  
    77.7 -#ifndef PRODUCT
    77.8 -
    77.9  // Printing
   77.10  
   77.11  void constMethodKlass::oop_print_on(oop obj, outputStream* st) {
   77.12 @@ -216,8 +214,6 @@
   77.13    }
   77.14  }
   77.15  
   77.16 -#endif //PRODUCT
   77.17 -
   77.18  // Short version of printing constMethodOop - just print the name of the
   77.19  // method it belongs to.
   77.20  void constMethodKlass::oop_print_value_on(oop obj, outputStream* st) {
    78.1 --- a/src/share/vm/oops/constMethodKlass.hpp	Wed Jul 28 17:57:43 2010 -0400
    78.2 +++ b/src/share/vm/oops/constMethodKlass.hpp	Tue Aug 03 08:13:38 2010 -0400
    78.3 @@ -77,12 +77,9 @@
    78.4    int oop_oop_iterate(oop obj, OopClosure* blk);
    78.5    int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr);
    78.6  
    78.7 - public:
    78.8    // Printing
    78.9    void oop_print_value_on(oop obj, outputStream* st);
   78.10 -#ifndef PRODUCT
   78.11    void oop_print_on      (oop obj, outputStream* st);
   78.12 -#endif //PRODUCT
   78.13  
   78.14    // Verify operations
   78.15    const char* internal_name() const;
    79.1 --- a/src/share/vm/oops/constantPoolKlass.cpp	Wed Jul 28 17:57:43 2010 -0400
    79.2 +++ b/src/share/vm/oops/constantPoolKlass.cpp	Tue Aug 03 08:13:38 2010 -0400
    79.3 @@ -299,8 +299,6 @@
    79.4  }
    79.5  #endif // SERIALGC
    79.6  
    79.7 -#ifndef PRODUCT
    79.8 -
    79.9  // Printing
   79.10  
   79.11  void constantPoolKlass::oop_print_on(oop obj, outputStream* st) {
   79.12 @@ -392,8 +390,6 @@
   79.13    st->cr();
   79.14  }
   79.15  
   79.16 -#endif
   79.17 -
   79.18  void constantPoolKlass::oop_print_value_on(oop obj, outputStream* st) {
   79.19    assert(obj->is_constantPool(), "must be constantPool");
   79.20    constantPoolOop cp = constantPoolOop(obj);
    80.1 --- a/src/share/vm/oops/constantPoolKlass.hpp	Wed Jul 28 17:57:43 2010 -0400
    80.2 +++ b/src/share/vm/oops/constantPoolKlass.hpp	Tue Aug 03 08:13:38 2010 -0400
    80.3 @@ -61,18 +61,13 @@
    80.4    int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr);
    80.5  
    80.6    // Allocation profiling support
    80.7 -  // no idea why this is pure virtual and not in Klass ???
    80.8    juint alloc_size() const              { return _alloc_size; }
    80.9    void set_alloc_size(juint n)          { _alloc_size = n; }
   80.10  
   80.11 - public:
   80.12    // Printing
   80.13    void oop_print_value_on(oop obj, outputStream* st);
   80.14 -#ifndef PRODUCT
   80.15    void oop_print_on(oop obj, outputStream* st);
   80.16 -#endif
   80.17  
   80.18 - public:
   80.19    // Verification
   80.20    const char* internal_name() const;
   80.21    void oop_verify_on(oop obj, outputStream* st);
    81.1 --- a/src/share/vm/oops/cpCacheKlass.cpp	Wed Jul 28 17:57:43 2010 -0400
    81.2 +++ b/src/share/vm/oops/cpCacheKlass.cpp	Tue Aug 03 08:13:38 2010 -0400
    81.3 @@ -248,8 +248,6 @@
    81.4  }
    81.5  #endif // SERIALGC
    81.6  
    81.7 -#ifndef PRODUCT
    81.8 -
    81.9  void constantPoolCacheKlass::oop_print_on(oop obj, outputStream* st) {
   81.10    assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
   81.11    constantPoolCacheOop cache = (constantPoolCacheOop)obj;
   81.12 @@ -259,8 +257,6 @@
   81.13    for (int i = 0; i < cache->length(); i++) cache->entry_at(i)->print(st, i);
   81.14  }
   81.15  
   81.16 -#endif
   81.17 -
   81.18  void constantPoolCacheKlass::oop_print_value_on(oop obj, outputStream* st) {
   81.19    assert(obj->is_constantPoolCache(), "obj must be constant pool cache");
   81.20    constantPoolCacheOop cache = (constantPoolCacheOop)obj;
    82.1 --- a/src/share/vm/oops/cpCacheKlass.hpp	Wed Jul 28 17:57:43 2010 -0400
    82.2 +++ b/src/share/vm/oops/cpCacheKlass.hpp	Tue Aug 03 08:13:38 2010 -0400
    82.3 @@ -61,14 +61,10 @@
    82.4    juint alloc_size() const              { return _alloc_size; }
    82.5    void set_alloc_size(juint n)          { _alloc_size = n; }
    82.6  
    82.7 - public:
    82.8    // Printing
    82.9    void oop_print_value_on(oop obj, outputStream* st);
   82.10 -#ifndef PRODUCT
   82.11    void oop_print_on(oop obj, outputStream* st);
   82.12 -#endif
   82.13  
   82.14 - public:
   82.15    // Verification
   82.16    const char* internal_name() const;
   82.17    void oop_verify_on(oop obj, outputStream* st);
    83.1 --- a/src/share/vm/oops/generateOopMap.cpp	Wed Jul 28 17:57:43 2010 -0400
    83.2 +++ b/src/share/vm/oops/generateOopMap.cpp	Tue Aug 03 08:13:38 2010 -0400
    83.3 @@ -2111,7 +2111,13 @@
    83.4    // We do not distinguish between different types of errors for verification
    83.5    // errors.  Let the verifier give a better message.
    83.6    const char *msg = "Illegal class file encountered. Try running with -Xverify:all";
    83.7 -  error_work(msg, NULL);
    83.8 +  _got_error = true;
    83.9 +  // Append method name
   83.10 +  char msg_buffer2[512];
   83.11 +  jio_snprintf(msg_buffer2, sizeof(msg_buffer2), "%s in method %s", msg,
   83.12 +               method()->name()->as_C_string());
   83.13 +  _exception = Exceptions::new_exception(Thread::current(),
   83.14 +                vmSymbols::java_lang_LinkageError(), msg_buffer2);
   83.15  }
   83.16  
   83.17  //
    84.1 --- a/src/share/vm/oops/klass.cpp	Wed Jul 28 17:57:43 2010 -0400
    84.2 +++ b/src/share/vm/oops/klass.cpp	Tue Aug 03 08:13:38 2010 -0400
    84.3 @@ -520,8 +520,6 @@
    84.4    return 0;
    84.5  }
    84.6  
    84.7 -#ifndef PRODUCT
    84.8 -
    84.9  // Printing
   84.10  
   84.11  void Klass::oop_print_on(oop obj, outputStream* st) {
   84.12 @@ -541,8 +539,6 @@
   84.13    st->cr();
   84.14  }
   84.15  
   84.16 -#endif //PRODUCT
   84.17 -
   84.18  void Klass::oop_print_value_on(oop obj, outputStream* st) {
   84.19    // print title
   84.20    ResourceMark rm;              // Cannot print in debug mode without this
    85.1 --- a/src/share/vm/oops/klass.hpp	Wed Jul 28 17:57:43 2010 -0400
    85.2 +++ b/src/share/vm/oops/klass.hpp	Tue Aug 03 08:13:38 2010 -0400
    85.3 @@ -772,16 +772,12 @@
    85.4    // jvm support
    85.5    virtual jint compute_modifier_flags(TRAPS) const;
    85.6  
    85.7 - public:
    85.8    // JVMTI support
    85.9    virtual jint jvmti_class_status() const;
   85.10  
   85.11 - public:
   85.12    // Printing
   85.13    virtual void oop_print_value_on(oop obj, outputStream* st);
   85.14 -#ifndef PRODUCT
   85.15    virtual void oop_print_on      (oop obj, outputStream* st);
   85.16 -#endif //PRODUCT
   85.17  
   85.18    // Verification
   85.19    virtual const char* internal_name() const = 0;
    86.1 --- a/src/share/vm/oops/klassKlass.cpp	Wed Jul 28 17:57:43 2010 -0400
    86.2 +++ b/src/share/vm/oops/klassKlass.cpp	Tue Aug 03 08:13:38 2010 -0400
    86.3 @@ -194,16 +194,12 @@
    86.4  #endif // SERIALGC
    86.5  
    86.6  
    86.7 -#ifndef PRODUCT
    86.8 -
    86.9  // Printing
   86.10  
   86.11  void klassKlass::oop_print_on(oop obj, outputStream* st) {
   86.12    Klass::oop_print_on(obj, st);
   86.13  }
   86.14  
   86.15 -#endif //PRODUCT
   86.16 -
   86.17  void klassKlass::oop_print_value_on(oop obj, outputStream* st) {
   86.18    Klass::oop_print_value_on(obj, st);
   86.19  }
    87.1 --- a/src/share/vm/oops/klassKlass.hpp	Wed Jul 28 17:57:43 2010 -0400
    87.2 +++ b/src/share/vm/oops/klassKlass.hpp	Tue Aug 03 08:13:38 2010 -0400
    87.3 @@ -67,12 +67,9 @@
    87.4    juint alloc_size() const              { return _alloc_size; }
    87.5    void set_alloc_size(juint n)          { _alloc_size = n; }
    87.6  
    87.7 - public:
    87.8    // Printing
    87.9    void oop_print_value_on(oop obj, outputStream* st);
   87.10 -#ifndef PRODUCT
   87.11    void oop_print_on      (oop obj, outputStream* st);
   87.12 -#endif //PRODUCT
   87.13  
   87.14    // Verification
   87.15    const char* internal_name() const;
    88.1 --- a/src/share/vm/oops/oop.cpp	Wed Jul 28 17:57:43 2010 -0400
    88.2 +++ b/src/share/vm/oops/oop.cpp	Tue Aug 03 08:13:38 2010 -0400
    88.3 @@ -29,15 +29,6 @@
    88.4  
    88.5  BarrierSet* oopDesc::_bs = NULL;
    88.6  
    88.7 -#ifdef PRODUCT
    88.8 -void oopDesc::print_on(outputStream* st) const {}
    88.9 -void oopDesc::print_address_on(outputStream* st) const {}
   88.10 -char* oopDesc::print_string() { return NULL; }
   88.11 -void oopDesc::print()         {}
   88.12 -void oopDesc::print_address() {}
   88.13 -
   88.14 -#else //PRODUCT
   88.15 -
   88.16  void oopDesc::print_on(outputStream* st) const {
   88.17    if (this == NULL) {
   88.18      st->print_cr("NULL");
   88.19 @@ -62,10 +53,6 @@
   88.20    return st.as_string();
   88.21  }
   88.22  
   88.23 -#endif // PRODUCT
   88.24 -
   88.25 -// The print_value functions are present in all builds, to support the disassembler.
   88.26 -
   88.27  void oopDesc::print_value() {
   88.28    print_value_on(tty);
   88.29  }
   88.30 @@ -83,9 +70,7 @@
   88.31      st->print("NULL");
   88.32    } else if (java_lang_String::is_instance(obj)) {
   88.33      java_lang_String::print(obj, st);
   88.34 -#ifndef PRODUCT
   88.35      if (PrintOopAddress) print_address_on(st);
   88.36 -#endif //PRODUCT
   88.37  #ifdef ASSERT
   88.38    } else if (!Universe::heap()->is_in(obj) || !Universe::heap()->is_in(klass())) {
   88.39      st->print("### BAD OOP %p ###", (address)obj);
    89.1 --- a/src/share/vm/prims/jni.cpp	Wed Jul 28 17:57:43 2010 -0400
    89.2 +++ b/src/share/vm/prims/jni.cpp	Tue Aug 03 08:13:38 2010 -0400
    89.3 @@ -3414,6 +3414,8 @@
    89.4  
    89.5    thread->initialize_tlab();
    89.6  
    89.7 +  thread->cache_global_variables();
    89.8 +
    89.9    // Crucial that we do not have a safepoint check for this thread, since it has
   89.10    // not been added to the Thread list yet.
   89.11    { Threads_lock->lock_without_safepoint_check();
    90.1 --- a/src/share/vm/prims/jvmtiEnvThreadState.hpp	Wed Jul 28 17:57:43 2010 -0400
    90.2 +++ b/src/share/vm/prims/jvmtiEnvThreadState.hpp	Tue Aug 03 08:13:38 2010 -0400
    90.3 @@ -24,6 +24,8 @@
    90.4  #ifndef _JAVA_JVMTIENVTHREADSTATE_H_
    90.5  #define _JAVA_JVMTIENVTHREADSTATE_H_
    90.6  
    90.7 +class JvmtiEnv;
    90.8 +
    90.9  ///////////////////////////////////////////////////////////////
   90.10  //
   90.11  // class JvmtiFramePop
    91.1 --- a/src/share/vm/runtime/arguments.cpp	Wed Jul 28 17:57:43 2010 -0400
    91.2 +++ b/src/share/vm/runtime/arguments.cpp	Tue Aug 03 08:13:38 2010 -0400
    91.3 @@ -2665,6 +2665,28 @@
    91.4    }
    91.5  #endif
    91.6  
    91.7 +  // If we are running in a headless jre, force java.awt.headless property
    91.8 +  // to be true unless the property has already been set.
    91.9 +  // Also allow the OS environment variable JAVA_AWT_HEADLESS to set headless state.
   91.10 +  if (os::is_headless_jre()) {
   91.11 +    const char* headless = Arguments::get_property("java.awt.headless");
   91.12 +    if (headless == NULL) {
   91.13 +      char envbuffer[128];
   91.14 +      if (!os::getenv("JAVA_AWT_HEADLESS", envbuffer, sizeof(envbuffer))) {
   91.15 +        if (!add_property("java.awt.headless=true")) {
   91.16 +          return JNI_ENOMEM;
   91.17 +        }
   91.18 +      } else {
   91.19 +        char buffer[256];
   91.20 +        strcpy(buffer, "java.awt.headless=");
   91.21 +        strcat(buffer, envbuffer);
   91.22 +        if (!add_property(buffer)) {
   91.23 +          return JNI_ENOMEM;
   91.24 +        }
   91.25 +      }
   91.26 +    }
   91.27 +  }
   91.28 +
   91.29    if (!check_vm_args_consistency()) {
   91.30      return JNI_ERR;
   91.31    }
   91.32 @@ -2985,6 +3007,14 @@
   91.33      CommandLineFlags::printFlags();
   91.34    }
   91.35  
   91.36 +  // Apply CPU specific policy for the BiasedLocking
   91.37 +  if (UseBiasedLocking) {
   91.38 +    if (!VM_Version::use_biased_locking() &&
   91.39 +        !(FLAG_IS_CMDLINE(UseBiasedLocking))) {
   91.40 +      UseBiasedLocking = false;
   91.41 +    }
   91.42 +  }
   91.43 +
   91.44    return JNI_OK;
   91.45  }
   91.46  
    92.1 --- a/src/share/vm/runtime/frame.cpp	Wed Jul 28 17:57:43 2010 -0400
    92.2 +++ b/src/share/vm/runtime/frame.cpp	Tue Aug 03 08:13:38 2010 -0400
    92.3 @@ -876,6 +876,7 @@
    92.4  
    92.5  #endif /* CC_INTERP */
    92.6  
    92.7 +#ifndef PPC
    92.8    if (m->is_native()) {
    92.9  #ifdef CC_INTERP
   92.10      f->do_oop((oop*)&istate->_oop_temp);
   92.11 @@ -883,6 +884,11 @@
   92.12      f->do_oop((oop*)( fp() + interpreter_frame_oop_temp_offset ));
   92.13  #endif /* CC_INTERP */
   92.14    }
   92.15 +#else // PPC
   92.16 +  if (m->is_native() && m->is_static()) {
   92.17 +    f->do_oop(interpreter_frame_mirror_addr());
   92.18 +  }
   92.19 +#endif // PPC
   92.20  
   92.21    int max_locals = m->is_native() ? m->size_of_parameters() : m->max_locals();
   92.22  
    93.1 --- a/src/share/vm/runtime/frame.hpp	Wed Jul 28 17:57:43 2010 -0400
    93.2 +++ b/src/share/vm/runtime/frame.hpp	Tue Aug 03 08:13:38 2010 -0400
    93.3 @@ -25,6 +25,7 @@
    93.4  typedef class BytecodeInterpreter* interpreterState;
    93.5  
    93.6  class CodeBlob;
    93.7 +class vframeArray;
    93.8  
    93.9  
   93.10  // A frame represents a physical stack frame (an activation).  Frames
   93.11 @@ -296,6 +297,9 @@
   93.12    void interpreter_frame_set_method(methodOop method);
   93.13    methodOop* interpreter_frame_method_addr() const;
   93.14    constantPoolCacheOop* interpreter_frame_cache_addr() const;
   93.15 +#ifdef PPC
   93.16 +  oop* interpreter_frame_mirror_addr() const;
   93.17 +#endif
   93.18  
   93.19   public:
   93.20    // Entry frames
    94.1 --- a/src/share/vm/runtime/globals.hpp	Wed Jul 28 17:57:43 2010 -0400
    94.2 +++ b/src/share/vm/runtime/globals.hpp	Tue Aug 03 08:13:38 2010 -0400
    94.3 @@ -607,7 +607,7 @@
    94.4    notproduct(bool, PrintMallocFree, false,                                  \
    94.5            "Trace calls to C heap malloc/free allocation")                   \
    94.6                                                                              \
    94.7 -  notproduct(bool, PrintOopAddress, false,                                  \
    94.8 +  product(bool, PrintOopAddress, false,                                     \
    94.9            "Always print the location of the oop")                           \
   94.10                                                                              \
   94.11    notproduct(bool, VerifyCodeCacheOften, false,                             \
   94.12 @@ -3554,7 +3554,6 @@
   94.13            "EINTR for I/O operations results in OS_INTRPT. The default value"\
   94.14            " of this flag is true for JDK 6 and earliers")
   94.15  
   94.16 -
   94.17  /*
   94.18   *  Macros for factoring of globals
   94.19   */
    95.1 --- a/src/share/vm/runtime/java.cpp	Wed Jul 28 17:57:43 2010 -0400
    95.2 +++ b/src/share/vm/runtime/java.cpp	Tue Aug 03 08:13:38 2010 -0400
    95.3 @@ -378,7 +378,8 @@
    95.4    }
    95.5  
    95.6    // Terminate watcher thread - must before disenrolling any periodic task
    95.7 -  WatcherThread::stop();
    95.8 +  if (PeriodicTask::num_tasks() > 0)
    95.9 +    WatcherThread::stop();
   95.10  
   95.11    // Print statistics gathered (profiling ...)
   95.12    if (Arguments::has_profile()) {
    96.1 --- a/src/share/vm/runtime/javaFrameAnchor.hpp	Wed Jul 28 17:57:43 2010 -0400
    96.2 +++ b/src/share/vm/runtime/javaFrameAnchor.hpp	Tue Aug 03 08:13:38 2010 -0400
    96.3 @@ -76,7 +76,6 @@
    96.4    JavaFrameAnchor()                              { clear(); }
    96.5    JavaFrameAnchor(JavaFrameAnchor *src)          { copy(src); }
    96.6  
    96.7 -  address last_Java_pc(void)                     { return _last_Java_pc; }
    96.8    void set_last_Java_pc(address pc)              { _last_Java_pc = pc; }
    96.9  
   96.10    // Assembly stub generation helpers
    97.1 --- a/src/share/vm/runtime/os.cpp	Wed Jul 28 17:57:43 2010 -0400
    97.2 +++ b/src/share/vm/runtime/os.cpp	Tue Aug 03 08:13:38 2010 -0400
    97.3 @@ -735,6 +735,152 @@
    97.4    st->print_cr("elapsed time: %d seconds", (int)t);
    97.5  }
    97.6  
    97.7 +// moved from debug.cpp (used to be find()) but still called from there
    97.8 +// The print_pc parameter is only set by the debug code in one case
    97.9 +void os::print_location(outputStream* st, intptr_t x, bool print_pc) {
   97.10 +  address addr = (address)x;
   97.11 +  CodeBlob* b = CodeCache::find_blob_unsafe(addr);
   97.12 +  if (b != NULL) {
   97.13 +    if (b->is_buffer_blob()) {
   97.14 +      // the interpreter is generated into a buffer blob
   97.15 +      InterpreterCodelet* i = Interpreter::codelet_containing(addr);
   97.16 +      if (i != NULL) {
   97.17 +        i->print_on(st);
   97.18 +        return;
   97.19 +      }
   97.20 +      if (Interpreter::contains(addr)) {
   97.21 +        st->print_cr(INTPTR_FORMAT " is pointing into interpreter code"
   97.22 +                     " (not bytecode specific)", addr);
   97.23 +        return;
   97.24 +      }
   97.25 +      //
   97.26 +      if (AdapterHandlerLibrary::contains(b)) {
   97.27 +        st->print_cr("Printing AdapterHandler");
   97.28 +        AdapterHandlerLibrary::print_handler_on(st, b);
   97.29 +      }
   97.30 +      // the stubroutines are generated into a buffer blob
   97.31 +      StubCodeDesc* d = StubCodeDesc::desc_for(addr);
   97.32 +      if (d != NULL) {
   97.33 +        d->print_on(st);
   97.34 +        if (print_pc) st->cr();
   97.35 +        return;
   97.36 +      }
   97.37 +      if (StubRoutines::contains(addr)) {
   97.38 +        st->print_cr(INTPTR_FORMAT " is pointing to an (unnamed) "
   97.39 +                     "stub routine", addr);
   97.40 +        return;
   97.41 +      }
   97.42 +      // the InlineCacheBuffer is using stubs generated into a buffer blob
   97.43 +      if (InlineCacheBuffer::contains(addr)) {
   97.44 +        st->print_cr(INTPTR_FORMAT " is pointing into InlineCacheBuffer", addr);
   97.45 +        return;
   97.46 +      }
   97.47 +      VtableStub* v = VtableStubs::stub_containing(addr);
   97.48 +      if (v != NULL) {
   97.49 +        v->print_on(st);
   97.50 +        return;
   97.51 +      }
   97.52 +    }
   97.53 +    if (print_pc && b->is_nmethod()) {
   97.54 +      ResourceMark rm;
   97.55 +      st->print("%#p: Compiled ", addr);
   97.56 +      ((nmethod*)b)->method()->print_value_on(st);
   97.57 +      st->print("  = (CodeBlob*)" INTPTR_FORMAT, b);
   97.58 +      st->cr();
   97.59 +      return;
   97.60 +    }
   97.61 +    if ( b->is_nmethod()) {
   97.62 +      if (b->is_zombie()) {
   97.63 +        st->print_cr(INTPTR_FORMAT " is zombie nmethod", b);
   97.64 +      } else if (b->is_not_entrant()) {
   97.65 +        st->print_cr(INTPTR_FORMAT " is non-entrant nmethod", b);
   97.66 +      }
   97.67 +    }
   97.68 +    b->print_on(st);
   97.69 +    return;
   97.70 +  }
   97.71 +
   97.72 +  if (Universe::heap()->is_in(addr)) {
   97.73 +    HeapWord* p = Universe::heap()->block_start(addr);
   97.74 +    bool print = false;
   97.75 +    // If we couldn't find it it just may mean that heap wasn't parseable
   97.76 +    // See if we were just given an oop directly
   97.77 +    if (p != NULL && Universe::heap()->block_is_obj(p)) {
   97.78 +      print = true;
   97.79 +    } else if (p == NULL && ((oopDesc*)addr)->is_oop()) {
   97.80 +      p = (HeapWord*) addr;
   97.81 +      print = true;
   97.82 +    }
   97.83 +    if (print) {
   97.84 +      oop(p)->print_on(st);
   97.85 +      if (p != (HeapWord*)x && oop(p)->is_constMethod() &&
   97.86 +          constMethodOop(p)->contains(addr)) {
   97.87 +        Thread *thread = Thread::current();
   97.88 +        HandleMark hm(thread);
   97.89 +        methodHandle mh (thread, constMethodOop(p)->method());
   97.90 +        if (!mh->is_native()) {
   97.91 +          st->print_cr("bci_from(%p) = %d; print_codes():",
   97.92 +                        addr, mh->bci_from(address(x)));
   97.93 +          mh->print_codes_on(st);
   97.94 +        }
   97.95 +      }
   97.96 +      return;
   97.97 +    }
   97.98 +  } else {
   97.99 +    if (Universe::heap()->is_in_reserved(addr)) {
  97.100 +      st->print_cr(INTPTR_FORMAT " is an unallocated location "
  97.101 +                   "in the heap", addr);
  97.102 +      return;
  97.103 +    }
  97.104 +  }
  97.105 +  if (JNIHandles::is_global_handle((jobject) addr)) {
  97.106 +    st->print_cr(INTPTR_FORMAT " is a global jni handle", addr);
  97.107 +    return;
  97.108 +  }
  97.109 +  if (JNIHandles::is_weak_global_handle((jobject) addr)) {
  97.110 +    st->print_cr(INTPTR_FORMAT " is a weak global jni handle", addr);
  97.111 +    return;
  97.112 +  }
  97.113 +#ifndef PRODUCT
  97.114 +  // we don't keep the block list in product mode
  97.115 +  if (JNIHandleBlock::any_contains((jobject) addr)) {
  97.116 +    st->print_cr(INTPTR_FORMAT " is a local jni handle", addr);
  97.117 +    return;
  97.118 +  }
  97.119 +#endif
  97.120 +
  97.121 +  for(JavaThread *thread = Threads::first(); thread; thread = thread->next()) {
  97.122 +    // Check for privilege stack
  97.123 +    if (thread->privileged_stack_top() != NULL &&
  97.124 +        thread->privileged_stack_top()->contains(addr)) {
  97.125 +      st->print_cr(INTPTR_FORMAT " is pointing into the privilege stack "
  97.126 +                   "for thread: " INTPTR_FORMAT, addr, thread);
  97.127 +      thread->print_on(st);
  97.128 +      return;
  97.129 +    }
  97.130 +    // If the addr is a java thread print information about that.
  97.131 +    if (addr == (address)thread) {
  97.132 +      thread->print_on(st);
  97.133 +      return;
  97.134 +    }
  97.135 +    // If the addr is in the stack region for this thread then report that
  97.136 +    // and print thread info
  97.137 +    if (thread->stack_base() >= addr &&
  97.138 +        addr > (thread->stack_base() - thread->stack_size())) {
  97.139 +      st->print_cr(INTPTR_FORMAT " is pointing into the stack for thread: "
  97.140 +                   INTPTR_FORMAT, addr, thread);
  97.141 +      thread->print_on(st);
  97.142 +      return;
  97.143 +    }
  97.144 +
  97.145 +  }
  97.146 +  // Try an OS specific find
  97.147 +  if (os::find(addr, st)) {
  97.148 +    return;
  97.149 +  }
  97.150 +
  97.151 +  st->print_cr(INTPTR_FORMAT " is pointing to unknown location", addr);
  97.152 +}
  97.153  
  97.154  // Looks like all platforms except IA64 can use the same function to check
  97.155  // if C stack is walkable beyond current frame. The check for fp() is not
    98.1 --- a/src/share/vm/runtime/os.hpp	Wed Jul 28 17:57:43 2010 -0400
    98.2 +++ b/src/share/vm/runtime/os.hpp	Tue Aug 03 08:13:38 2010 -0400
    98.3 @@ -1,5 +1,5 @@
    98.4  /*
    98.5 - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
    98.6 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
    98.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    98.8   *
    98.9   * This code is free software; you can redistribute it and/or modify it
   98.10 @@ -78,8 +78,10 @@
   98.11    }
   98.12  
   98.13   public:
   98.14 -  static void init(void);   // Called before command line parsing
   98.15 -  static jint init_2(void); // Called after command line parsing
   98.16 +
   98.17 +  static void init(void);                      // Called before command line parsing
   98.18 +  static jint init_2(void);                    // Called after command line parsing
   98.19 +  static void init_3(void);                    // Called at the end of vm init
   98.20  
   98.21    // File names are case-insensitive on windows only
   98.22    // Override me as needed
   98.23 @@ -322,7 +324,8 @@
   98.24      pgc_thread,        // Parallel GC thread
   98.25      java_thread,
   98.26      compiler_thread,
   98.27 -    watcher_thread
   98.28 +    watcher_thread,
   98.29 +    os_thread
   98.30    };
   98.31  
   98.32    static bool create_thread(Thread* thread,
   98.33 @@ -451,6 +454,8 @@
   98.34    static void print_signal_handlers(outputStream* st, char* buf, size_t buflen);
   98.35    static void print_date_and_time(outputStream* st);
   98.36  
   98.37 +  static void print_location(outputStream* st, intptr_t x, bool print_pc = false);
   98.38 +
   98.39    // The following two functions are used by fatal error handler to trace
   98.40    // native (C) frames. They are not part of frame.hpp/frame.cpp because
   98.41    // frame.hpp/cpp assume thread is JavaThread, and also because different
   98.42 @@ -480,6 +485,9 @@
   98.43    // Fills in path to jvm.dll/libjvm.so (this info used to find hpi).
   98.44    static void     jvm_path(char *buf, jint buflen);
   98.45  
   98.46 +  // Returns true if we are running in a headless jre.
   98.47 +  static bool     is_headless_jre();
   98.48 +
   98.49    // JNI names
   98.50    static void     print_jni_name_prefix_on(outputStream* st, int args_size);
   98.51    static void     print_jni_name_suffix_on(outputStream* st, int args_size);
   98.52 @@ -580,8 +588,8 @@
   98.53    // Platform dependent stuff
   98.54    #include "incls/_os_pd.hpp.incl"
   98.55  
   98.56 -  // debugging support (mostly used by debug.cpp)
   98.57 -  static bool find(address pc) PRODUCT_RETURN0; // OS specific function to make sense out of an address
   98.58 +  // debugging support (mostly used by debug.cpp but also fatal error handler)
   98.59 +  static bool find(address pc, outputStream* st = tty); // OS specific function to make sense out of an address
   98.60  
   98.61    static bool dont_yield();                     // when true, JVM_Yield() is nop
   98.62    static void print_statistics();
    99.1 --- a/src/share/vm/runtime/sharedRuntime.cpp	Wed Jul 28 17:57:43 2010 -0400
    99.2 +++ b/src/share/vm/runtime/sharedRuntime.cpp	Tue Aug 03 08:13:38 2010 -0400
    99.3 @@ -191,6 +191,121 @@
    99.4    return ((jdouble)fmod((double)x,(double)y));
    99.5  JRT_END
    99.6  
    99.7 +#ifdef __SOFTFP__
    99.8 +JRT_LEAF(jfloat, SharedRuntime::fadd(jfloat x, jfloat y))
    99.9 +  return x + y;
   99.10 +JRT_END
   99.11 +
   99.12 +JRT_LEAF(jfloat, SharedRuntime::fsub(jfloat x, jfloat y))
   99.13 +  return x - y;
   99.14 +JRT_END
   99.15 +
   99.16 +JRT_LEAF(jfloat, SharedRuntime::fmul(jfloat x, jfloat y))
   99.17 +  return x * y;
   99.18 +JRT_END
   99.19 +
   99.20 +JRT_LEAF(jfloat, SharedRuntime::fdiv(jfloat x, jfloat y))
   99.21 +  return x / y;
   99.22 +JRT_END
   99.23 +
   99.24 +JRT_LEAF(jdouble, SharedRuntime::dadd(jdouble x, jdouble y))
   99.25 +  return x + y;
   99.26 +JRT_END
   99.27 +
   99.28 +JRT_LEAF(jdouble, SharedRuntime::dsub(jdouble x, jdouble y))
   99.29 +  return x - y;
   99.30 +JRT_END
   99.31 +
   99.32 +JRT_LEAF(jdouble, SharedRuntime::dmul(jdouble x, jdouble y))
   99.33 +  return x * y;
   99.34 +JRT_END
   99.35 +
   99.36 +JRT_LEAF(jdouble, SharedRuntime::ddiv(jdouble x, jdouble y))
   99.37 +  return x / y;
   99.38 +JRT_END
   99.39 +
   99.40 +JRT_LEAF(jfloat, SharedRuntime::i2f(jint x))
   99.41 +  return (jfloat)x;
   99.42 +JRT_END
   99.43 +
   99.44 +JRT_LEAF(jdouble, SharedRuntime::i2d(jint x))
   99.45 +  return (jdouble)x;
   99.46 +JRT_END
   99.47 +
   99.48 +JRT_LEAF(jdouble, SharedRuntime::f2d(jfloat x))
   99.49 +  return (jdouble)x;
   99.50 +JRT_END
   99.51 +
   99.52 +JRT_LEAF(int,  SharedRuntime::fcmpl(float x, float y))
   99.53 +  return x>y ? 1 : (x==y ? 0 : -1);  /* x<y or is_nan*/
   99.54 +JRT_END
   99.55 +
   99.56 +JRT_LEAF(int,  SharedRuntime::fcmpg(float x, float y))
   99.57 +  return x<y ? -1 : (x==y ? 0 : 1);  /* x>y or is_nan */
   99.58 +JRT_END
   99.59 +
   99.60 +JRT_LEAF(int,  SharedRuntime::dcmpl(double x, double y))
   99.61 +  return x>y ? 1 : (x==y ? 0 : -1); /* x<y or is_nan */
   99.62 +JRT_END
   99.63 +
   99.64 +JRT_LEAF(int,  SharedRuntime::dcmpg(double x, double y))
   99.65 +  return x<y ? -1 : (x==y ? 0 : 1);  /* x>y or is_nan */
   99.66 +JRT_END
   99.67 +
   99.68 +// Functions to return the opposite of the aeabi functions for nan.
   99.69 +JRT_LEAF(int, SharedRuntime::unordered_fcmplt(float x, float y))
   99.70 +  return (x < y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
   99.71 +JRT_END
   99.72 +
   99.73 +JRT_LEAF(int, SharedRuntime::unordered_dcmplt(double x, double y))
   99.74 +  return (x < y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
   99.75 +JRT_END
   99.76 +
   99.77 +JRT_LEAF(int, SharedRuntime::unordered_fcmple(float x, float y))
   99.78 +  return (x <= y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
   99.79 +JRT_END
   99.80 +
   99.81 +JRT_LEAF(int, SharedRuntime::unordered_dcmple(double x, double y))
   99.82 +  return (x <= y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
   99.83 +JRT_END
   99.84 +
   99.85 +JRT_LEAF(int, SharedRuntime::unordered_fcmpge(float x, float y))
   99.86 +  return (x >= y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
   99.87 +JRT_END
   99.88 +
   99.89 +JRT_LEAF(int, SharedRuntime::unordered_dcmpge(double x, double y))
   99.90 +  return (x >= y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
   99.91 +JRT_END
   99.92 +
   99.93 +JRT_LEAF(int, SharedRuntime::unordered_fcmpgt(float x, float y))
   99.94 +  return (x > y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
   99.95 +JRT_END
   99.96 +
   99.97 +JRT_LEAF(int, SharedRuntime::unordered_dcmpgt(double x, double y))
   99.98 +  return (x > y) ? 1 : ((g_isnan(x) || g_isnan(y)) ? 1 : 0);
   99.99 +JRT_END
  99.100 +
  99.101 +// Intrinsics make gcc generate code for these.
  99.102 +float  SharedRuntime::fneg(float f)   {
  99.103 +  return -f;
  99.104 +}
  99.105 +
  99.106 +double SharedRuntime::dneg(double f)  {
  99.107 +  return -f;
  99.108 +}
  99.109 +
  99.110 +#endif // __SOFTFP__
  99.111 +
  99.112 +#if defined(__SOFTFP__) || defined(E500V2)
  99.113 +// Intrinsics make gcc generate code for these.
  99.114 +double SharedRuntime::dabs(double f)  {
  99.115 +  return (f <= (double)0.0) ? (double)0.0 - f : f;
  99.116 +}
  99.117 +
  99.118 +double SharedRuntime::dsqrt(double f) {
  99.119 +  return sqrt(f);
  99.120 +}
  99.121 +#endif
  99.122  
  99.123  JRT_LEAF(jint, SharedRuntime::f2i(jfloat  x))
  99.124    if (g_isnan(x))
  99.125 @@ -2046,6 +2161,8 @@
  99.126  int AdapterHandlerTable::_hits;
  99.127  int AdapterHandlerTable::_compact;
  99.128  
  99.129 +#endif
  99.130 +
  99.131  class AdapterHandlerTableIterator : public StackObj {
  99.132   private:
  99.133    AdapterHandlerTable* _table;
  99.134 @@ -2081,7 +2198,6 @@
  99.135      }
  99.136    }
  99.137  };
  99.138 -#endif
  99.139  
  99.140  
  99.141  // ---------------------------------------------------------------------------
  99.142 @@ -2619,7 +2735,6 @@
  99.143    FREE_C_HEAP_ARRAY(intptr_t,buf);
  99.144  JRT_END
  99.145  
  99.146 -#ifndef PRODUCT
  99.147  bool AdapterHandlerLibrary::contains(CodeBlob* b) {
  99.148    AdapterHandlerTableIterator iter(_adapters);
  99.149    while (iter.has_next()) {
  99.150 @@ -2629,21 +2744,24 @@
  99.151    return false;
  99.152  }
  99.153  
  99.154 -void AdapterHandlerLibrary::print_handler(CodeBlob* b) {
  99.155 +void AdapterHandlerLibrary::print_handler_on(outputStream* st, CodeBlob* b) {
  99.156    AdapterHandlerTableIterator iter(_adapters);
  99.157    while (iter.has_next()) {
  99.158      AdapterHandlerEntry* a = iter.next();
  99.159      if ( b == CodeCache::find_blob(a->get_i2c_entry()) ) {
  99.160 -      tty->print("Adapter for signature: ");
  99.161 -      tty->print_cr("%s i2c: " INTPTR_FORMAT " c2i: " INTPTR_FORMAT " c2iUV: " INTPTR_FORMAT,
  99.162 -                    a->fingerprint()->as_string(),
  99.163 -                    a->get_i2c_entry(), a->get_c2i_entry(), a->get_c2i_unverified_entry());
  99.164 +      st->print("Adapter for signature: ");
  99.165 +      st->print_cr("%s i2c: " INTPTR_FORMAT " c2i: " INTPTR_FORMAT " c2iUV: " INTPTR_FORMAT,
  99.166 +                   a->fingerprint()->as_string(),
  99.167 +                   a->get_i2c_entry(), a->get_c2i_entry(), a->get_c2i_unverified_entry());
  99.168 +
  99.169        return;
  99.170      }
  99.171    }
  99.172    assert(false, "Should have found handler");
  99.173  }
  99.174  
  99.175 +#ifndef PRODUCT
  99.176 +
  99.177  void AdapterHandlerLibrary::print_statistics() {
  99.178    _adapters->print_statistics();
  99.179  }
   100.1 --- a/src/share/vm/runtime/sharedRuntime.hpp	Wed Jul 28 17:57:43 2010 -0400
   100.2 +++ b/src/share/vm/runtime/sharedRuntime.hpp	Tue Aug 03 08:13:38 2010 -0400
   100.3 @@ -78,6 +78,18 @@
   100.4    static jfloat  frem(jfloat  x, jfloat  y);
   100.5    static jdouble drem(jdouble x, jdouble y);
   100.6  
   100.7 +#ifdef __SOFTFP__
   100.8 +  static jfloat  fadd(jfloat x, jfloat y);
   100.9 +  static jfloat  fsub(jfloat x, jfloat y);
  100.10 +  static jfloat  fmul(jfloat x, jfloat y);
  100.11 +  static jfloat  fdiv(jfloat x, jfloat y);
  100.12 +
  100.13 +  static jdouble dadd(jdouble x, jdouble y);
  100.14 +  static jdouble dsub(jdouble x, jdouble y);
  100.15 +  static jdouble dmul(jdouble x, jdouble y);
  100.16 +  static jdouble ddiv(jdouble x, jdouble y);
  100.17 +#endif // __SOFTFP__
  100.18 +
  100.19    // float conversion (needs to set appropriate rounding mode)
  100.20    static jint    f2i (jfloat  x);
  100.21    static jlong   f2l (jfloat  x);
  100.22 @@ -87,6 +99,12 @@
  100.23    static jfloat  l2f (jlong   x);
  100.24    static jdouble l2d (jlong   x);
  100.25  
  100.26 +#ifdef __SOFTFP__
  100.27 +  static jfloat  i2f (jint    x);
  100.28 +  static jdouble i2d (jint    x);
  100.29 +  static jdouble f2d (jfloat  x);
  100.30 +#endif // __SOFTFP__
  100.31 +
  100.32    // double trigonometrics and transcendentals
  100.33    static jdouble dsin(jdouble x);
  100.34    static jdouble dcos(jdouble x);
  100.35 @@ -96,6 +114,32 @@
  100.36    static jdouble dexp(jdouble x);
  100.37    static jdouble dpow(jdouble x, jdouble y);
  100.38  
  100.39 +#if defined(__SOFTFP__) || defined(E500V2)
  100.40 +  static double dabs(double f);
  100.41 +  static double dsqrt(double f);
  100.42 +#endif
  100.43 +
  100.44 +#ifdef __SOFTFP__
  100.45 +  // C++ compiler generates soft float instructions as well as passing
  100.46 +  // float and double in registers.
  100.47 +  static int  fcmpl(float x, float y);
  100.48 +  static int  fcmpg(float x, float y);
  100.49 +  static int  dcmpl(double x, double y);
  100.50 +  static int  dcmpg(double x, double y);
  100.51 +
  100.52 +  static int unordered_fcmplt(float x, float y);
  100.53 +  static int unordered_dcmplt(double x, double y);
  100.54 +  static int unordered_fcmple(float x, float y);
  100.55 +  static int unordered_dcmple(double x, double y);
  100.56 +  static int unordered_fcmpge(float x, float y);
  100.57 +  static int unordered_dcmpge(double x, double y);
  100.58 +  static int unordered_fcmpgt(float x, float y);
  100.59 +  static int unordered_dcmpgt(double x, double y);
  100.60 +
  100.61 +  static float  fneg(float f);
  100.62 +  static double dneg(double f);
  100.63 +#endif
  100.64 +
  100.65    // exception handling across interpreter/compiler boundaries
  100.66    static address raw_exception_handler_for_return_address(JavaThread* thread, address return_address);
  100.67    static address exception_handler_for_return_address(JavaThread* thread, address return_address);
  100.68 @@ -585,9 +629,7 @@
  100.69    bool compare_code(unsigned char* code, int length, int total_args_passed, BasicType* sig_bt);
  100.70  #endif
  100.71  
  100.72 -#ifndef PRODUCT
  100.73    void print();
  100.74 -#endif /* PRODUCT */
  100.75  };
  100.76  
  100.77  class AdapterHandlerLibrary: public AllStatic {
  100.78 @@ -609,9 +651,10 @@
  100.79    static nmethod* create_dtrace_nmethod (methodHandle method);
  100.80  #endif // HAVE_DTRACE_H
  100.81  
  100.82 +  static void print_handler(CodeBlob* b) { print_handler_on(tty, b); }
  100.83 +  static void print_handler_on(outputStream* st, CodeBlob* b);
  100.84 +  static bool contains(CodeBlob* b);
  100.85  #ifndef PRODUCT
  100.86 -  static void print_handler(CodeBlob* b);
  100.87 -  static bool contains(CodeBlob* b);
  100.88    static void print_statistics();
  100.89  #endif /* PRODUCT */
  100.90  
   101.1 --- a/src/share/vm/runtime/sharedRuntimeTrans.cpp	Wed Jul 28 17:57:43 2010 -0400
   101.2 +++ b/src/share/vm/runtime/sharedRuntimeTrans.cpp	Tue Aug 03 08:13:38 2010 -0400
   101.3 @@ -572,7 +572,11 @@
   101.4        if(hy<0) z = one/z;       /* z = (1/|x|) */
   101.5        if(hx<0) {
   101.6          if(((ix-0x3ff00000)|yisint)==0) {
   101.7 +#ifdef CAN_USE_NAN_DEFINE
   101.8 +          z = NAN;
   101.9 +#else
  101.10            z = (z-z)/(z-z); /* (-1)**non-int is NaN */
  101.11 +#endif
  101.12          } else if(yisint==1)
  101.13            z = -1.0*z;           /* (x<0)**odd = -(|x|**odd) */
  101.14        }
  101.15 @@ -583,7 +587,12 @@
  101.16    n = (hx>>31)+1;
  101.17  
  101.18    /* (x<0)**(non-int) is NaN */
  101.19 -  if((n|yisint)==0) return (x-x)/(x-x);
  101.20 +  if((n|yisint)==0)
  101.21 +#ifdef CAN_USE_NAN_DEFINE
  101.22 +    return NAN;
  101.23 +#else
  101.24 +    return (x-x)/(x-x);
  101.25 +#endif
  101.26  
  101.27    s = one; /* s (sign of result -ve**odd) = -1 else = 1 */
  101.28    if((n|(yisint-1))==0) s = -one;/* (-ve)**(odd int) */
   102.1 --- a/src/share/vm/runtime/signature.hpp	Wed Jul 28 17:57:43 2010 -0400
   102.2 +++ b/src/share/vm/runtime/signature.hpp	Tue Aug 03 08:13:38 2010 -0400
   102.3 @@ -275,11 +275,7 @@
   102.4  
   102.5    void do_bool  ()                     { pass_int();    _jni_offset++; _offset++;       }
   102.6    void do_char  ()                     { pass_int();    _jni_offset++; _offset++;       }
   102.7 -#if defined(_LP64) || defined(ZERO)
   102.8    void do_float ()                     { pass_float();  _jni_offset++; _offset++;       }
   102.9 -#else
  102.10 -  void do_float ()                     { pass_int();    _jni_offset++; _offset++;       }
  102.11 -#endif
  102.12  #ifdef _LP64
  102.13    void do_double()                     { pass_double(); _jni_offset++; _offset += 2;    }
  102.14  #else
  102.15 @@ -306,9 +302,7 @@
  102.16    virtual void pass_int()              = 0;
  102.17    virtual void pass_long()             = 0;
  102.18    virtual void pass_object()           = 0;
  102.19 -#if defined(_LP64) || defined(ZERO)
  102.20    virtual void pass_float()            = 0;
  102.21 -#endif
  102.22  #ifdef _LP64
  102.23    virtual void pass_double()           = 0;
  102.24  #else
   103.1 --- a/src/share/vm/runtime/stubCodeGenerator.cpp	Wed Jul 28 17:57:43 2010 -0400
   103.2 +++ b/src/share/vm/runtime/stubCodeGenerator.cpp	Tue Aug 03 08:13:38 2010 -0400
   103.3 @@ -53,15 +53,13 @@
   103.4  }
   103.5  
   103.6  
   103.7 -void StubCodeDesc::print() {
   103.8 -  tty->print(group());
   103.9 -  tty->print("::");
  103.10 -  tty->print(name());
  103.11 -  tty->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", begin(), end(), size_in_bytes());
  103.12 +void StubCodeDesc::print_on(outputStream* st) const {
  103.13 +  st->print(group());
  103.14 +  st->print("::");
  103.15 +  st->print(name());
  103.16 +  st->print(" [" INTPTR_FORMAT ", " INTPTR_FORMAT "[ (%d bytes)", begin(), end(), size_in_bytes());
  103.17  }
  103.18  
  103.19 -
  103.20 -
  103.21  // Implementation of StubCodeGenerator
  103.22  
  103.23  StubCodeGenerator::StubCodeGenerator(CodeBuffer* code) {
   104.1 --- a/src/share/vm/runtime/stubCodeGenerator.hpp	Wed Jul 28 17:57:43 2010 -0400
   104.2 +++ b/src/share/vm/runtime/stubCodeGenerator.hpp	Tue Aug 03 08:13:38 2010 -0400
   104.3 @@ -79,7 +79,8 @@
   104.4    address     end() const                        { return _end; }
   104.5    int         size_in_bytes() const              { return _end - _begin; }
   104.6    bool        contains(address pc) const         { return _begin <= pc && pc < _end; }
   104.7 -  void        print();
   104.8 +  void        print_on(outputStream* st) const;
   104.9 +  void        print() const                      { print_on(tty); }
  104.10  };
  104.11  
  104.12  // The base class for all stub-generating code generators.
   105.1 --- a/src/share/vm/runtime/thread.cpp	Wed Jul 28 17:57:43 2010 -0400
   105.2 +++ b/src/share/vm/runtime/thread.cpp	Tue Aug 03 08:13:38 2010 -0400
   105.3 @@ -1020,7 +1020,7 @@
   105.4  // timer interrupts exists on the platform.
   105.5  
   105.6  WatcherThread* WatcherThread::_watcher_thread   = NULL;
   105.7 -bool           WatcherThread::_should_terminate = false;
   105.8 +volatile bool  WatcherThread::_should_terminate = false;
   105.9  
  105.10  WatcherThread::WatcherThread() : Thread() {
  105.11    assert(watcher_thread() == NULL, "we can only allocate one WatcherThread");
  105.12 @@ -1052,8 +1052,26 @@
  105.13  
  105.14      // Calculate how long it'll be until the next PeriodicTask work
  105.15      // should be done, and sleep that amount of time.
  105.16 -    const size_t time_to_wait = PeriodicTask::time_to_wait();
  105.17 -    os::sleep(this, time_to_wait, false);
  105.18 +    size_t time_to_wait = PeriodicTask::time_to_wait();
  105.19 +
  105.20 +    // we expect this to timeout - we only ever get unparked when
  105.21 +    // we should terminate
  105.22 +    {
  105.23 +      OSThreadWaitState osts(this->osthread(), false /* not Object.wait() */);
  105.24 +
  105.25 +      jlong prev_time = os::javaTimeNanos();
  105.26 +      for (;;) {
  105.27 +        int res= _SleepEvent->park(time_to_wait);
  105.28 +        if (res == OS_TIMEOUT || _should_terminate)
  105.29 +          break;
  105.30 +        // spurious wakeup of some kind
  105.31 +        jlong now = os::javaTimeNanos();
  105.32 +        time_to_wait -= (now - prev_time) / 1000000;
  105.33 +        if (time_to_wait <= 0)
  105.34 +          break;
  105.35 +        prev_time = now;
  105.36 +      }
  105.37 +    }
  105.38  
  105.39      if (is_error_reported()) {
  105.40        // A fatal error has happened, the error handler(VMError::report_and_die)
  105.41 @@ -1115,6 +1133,12 @@
  105.42    // it is ok to take late safepoints here, if needed
  105.43    MutexLocker mu(Terminator_lock);
  105.44    _should_terminate = true;
  105.45 +  OrderAccess::fence();  // ensure WatcherThread sees update in main loop
  105.46 +
  105.47 +  Thread* watcher = watcher_thread();
  105.48 +  if (watcher != NULL)
  105.49 +    watcher->_SleepEvent->unpark();
  105.50 +
  105.51    while(watcher_thread() != NULL) {
  105.52      // This wait should make safepoint checks, wait without a timeout,
  105.53      // and wait as a suspend-equivalent condition.
  105.54 @@ -1364,6 +1388,8 @@
  105.55  
  105.56    this->create_stack_guard_pages();
  105.57  
  105.58 +  this->cache_global_variables();
  105.59 +
  105.60    // Thread is now sufficient initialized to be handled by the safepoint code as being
  105.61    // in the VM. Change thread state from _thread_new to _thread_in_vm
  105.62    ThreadStateTransition::transition_and_fence(this, _thread_new, _thread_in_vm);
  105.63 @@ -2955,6 +2981,9 @@
  105.64      return status;
  105.65    }
  105.66  
  105.67 +  // Should be done after the heap is fully created
  105.68 +  main_thread->cache_global_variables();
  105.69 +
  105.70    HandleMark hm;
  105.71  
  105.72    { MutexLocker mu(Threads_lock);
  105.73 @@ -3230,6 +3259,9 @@
  105.74      WatcherThread::start();
  105.75    }
  105.76  
  105.77 +  // Give os specific code one last chance to start
  105.78 +  os::init_3();
  105.79 +
  105.80    create_vm_timer.end();
  105.81    return JNI_OK;
  105.82  }
   106.1 --- a/src/share/vm/runtime/thread.hpp	Wed Jul 28 17:57:43 2010 -0400
   106.2 +++ b/src/share/vm/runtime/thread.hpp	Tue Aug 03 08:13:38 2010 -0400
   106.3 @@ -410,9 +410,6 @@
   106.4    // Sweeper support
   106.5    void nmethods_do(CodeBlobClosure* cf);
   106.6  
   106.7 -  // Tells if adr belong to this thread. This is used
   106.8 -  // for checking if a lock is owned by the running thread.
   106.9 -
  106.10    // Used by fast lock support
  106.11    virtual bool is_lock_owned(address adr) const;
  106.12  
  106.13 @@ -609,7 +606,7 @@
  106.14   private:
  106.15    static WatcherThread* _watcher_thread;
  106.16  
  106.17 -  static bool _should_terminate;
  106.18 +  volatile static bool _should_terminate; // updated without holding lock
  106.19   public:
  106.20    enum SomeConstants {
  106.21      delay_interval = 10                          // interrupt delay in milliseconds
  106.22 @@ -839,6 +836,10 @@
  106.23      return (struct JNINativeInterface_ *)_jni_environment.functions;
  106.24    }
  106.25  
  106.26 +  // This function is called at thread creation to allow
  106.27 +  // platform specific thread variables to be initialized.
  106.28 +  void cache_global_variables();
  106.29 +
  106.30    // Executes Shutdown.shutdown()
  106.31    void invoke_shutdown_hooks();
  106.32  
   107.1 --- a/src/share/vm/runtime/vm_version.cpp	Wed Jul 28 17:57:43 2010 -0400
   107.2 +++ b/src/share/vm/runtime/vm_version.cpp	Tue Aug 03 08:13:38 2010 -0400
   107.3 @@ -152,6 +152,8 @@
   107.4  #define CPU      IA32_ONLY("x86")                \
   107.5                   IA64_ONLY("ia64")               \
   107.6                   AMD64_ONLY("amd64")             \
   107.7 +                 ARM_ONLY("arm")                 \
   107.8 +                 PPC_ONLY("ppc")                 \
   107.9                   SPARC_ONLY("sparc")
  107.10  #endif // ZERO
  107.11  
   108.1 --- a/src/share/vm/runtime/vm_version.hpp	Wed Jul 28 17:57:43 2010 -0400
   108.2 +++ b/src/share/vm/runtime/vm_version.hpp	Tue Aug 03 08:13:38 2010 -0400
   108.3 @@ -70,6 +70,9 @@
   108.4      return _logical_processors_per_package;
   108.5    }
   108.6  
   108.7 +  // ARCH specific policy for the BiasedLocking
   108.8 +  static bool use_biased_locking()  { return true; }
   108.9 +
  108.10    // Number of page sizes efficiently supported by the hardware.  Most chips now
  108.11    // support two sizes, thus this default implementation.  Processor-specific
  108.12    // subclasses should define new versions to hide this one as needed.  Note
   109.1 --- a/src/share/vm/utilities/debug.cpp	Wed Jul 28 17:57:43 2010 -0400
   109.2 +++ b/src/share/vm/utilities/debug.cpp	Tue Aug 03 08:13:38 2010 -0400
   109.3 @@ -1,5 +1,5 @@
   109.4  /*
   109.5 - * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
   109.6 + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   109.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   109.8   *
   109.9   * This code is free software; you can redistribute it and/or modify it
  109.10 @@ -552,140 +552,6 @@
  109.11    }
  109.12  }
  109.13  
  109.14 -
  109.15 -static void find(intptr_t x, bool print_pc) {
  109.16 -  address addr = (address)x;
  109.17 -
  109.18 -  CodeBlob* b = CodeCache::find_blob_unsafe(addr);
  109.19 -  if (b != NULL) {
  109.20 -    if (b->is_buffer_blob()) {
  109.21 -      // the interpreter is generated into a buffer blob
  109.22 -      InterpreterCodelet* i = Interpreter::codelet_containing(addr);
  109.23 -      if (i != NULL) {
  109.24 -        i->print();
  109.25 -        return;
  109.26 -      }
  109.27 -      if (Interpreter::contains(addr)) {
  109.28 -        tty->print_cr(INTPTR_FORMAT " is pointing into interpreter code (not bytecode specific)", addr);
  109.29 -        return;
  109.30 -      }
  109.31 -      //
  109.32 -      if (AdapterHandlerLibrary::contains(b)) {
  109.33 -        AdapterHandlerLibrary::print_handler(b);
  109.34 -      }
  109.35 -      // the stubroutines are generated into a buffer blob
  109.36 -      StubCodeDesc* d = StubCodeDesc::desc_for(addr);
  109.37 -      if (d != NULL) {
  109.38 -        d->print();
  109.39 -        if (print_pc) tty->cr();
  109.40 -        return;
  109.41 -      }
  109.42 -      if (StubRoutines::contains(addr)) {
  109.43 -        tty->print_cr(INTPTR_FORMAT " is pointing to an (unnamed) stub routine", addr);
  109.44 -        return;
  109.45 -      }
  109.46 -      // the InlineCacheBuffer is using stubs generated into a buffer blob
  109.47 -      if (InlineCacheBuffer::contains(addr)) {
  109.48 -        tty->print_cr(INTPTR_FORMAT " is pointing into InlineCacheBuffer", addr);
  109.49 -        return;
  109.50 -      }
  109.51 -      VtableStub* v = VtableStubs::stub_containing(addr);
  109.52 -      if (v != NULL) {
  109.53 -        v->print();
  109.54 -        return;
  109.55 -      }
  109.56 -    }
  109.57 -    if (print_pc && b->is_nmethod()) {
  109.58 -      ResourceMark rm;
  109.59 -      tty->print("%#p: Compiled ", addr);
  109.60 -      ((nmethod*)b)->method()->print_value_on(tty);
  109.61 -      tty->print("  = (CodeBlob*)" INTPTR_FORMAT, b);
  109.62 -      tty->cr();
  109.63 -      return;
  109.64 -    }
  109.65 -    if ( b->is_nmethod()) {
  109.66 -      if (b->is_zombie()) {
  109.67 -        tty->print_cr(INTPTR_FORMAT " is zombie nmethod", b);
  109.68 -      } else if (b->is_not_entrant()) {
  109.69 -        tty->print_cr(INTPTR_FORMAT " is non-entrant nmethod", b);
  109.70 -      }
  109.71 -    }
  109.72 -    b->print();
  109.73 -    return;
  109.74 -  }
  109.75 -
  109.76 -  if (Universe::heap()->is_in(addr)) {
  109.77 -    HeapWord* p = Universe::heap()->block_start(addr);
  109.78 -    bool print = false;
  109.79 -    // If we couldn't find it it just may mean that heap wasn't parseable
  109.80 -    // See if we were just given an oop directly
  109.81 -    if (p != NULL && Universe::heap()->block_is_obj(p)) {
  109.82 -      print = true;
  109.83 -    } else if (p == NULL && ((oopDesc*)addr)->is_oop()) {
  109.84 -      p = (HeapWord*) addr;
  109.85 -      print = true;
  109.86 -    }
  109.87 -    if (print) {
  109.88 -      oop(p)->print();
  109.89 -      if (p != (HeapWord*)x && oop(p)->is_constMethod() &&
  109.90 -          constMethodOop(p)->contains(addr)) {
  109.91 -        Thread *thread = Thread::current();
  109.92 -        HandleMark hm(thread);
  109.93 -        methodHandle mh (thread, constMethodOop(p)->method());
  109.94 -        if (!mh->is_native()) {
  109.95 -          tty->print_cr("bci_from(%p) = %d; print_codes():",
  109.96 -                        addr, mh->bci_from(address(x)));
  109.97 -          mh->print_codes();
  109.98 -        }
  109.99 -      }
 109.100 -      return;
 109.101 -    }
 109.102 -  } else if (Universe::heap()->is_in_reserved(addr)) {
 109.103 -    tty->print_cr(INTPTR_FORMAT " is an unallocated location in the heap", addr);
 109.104 -    return;
 109.105 -  }
 109.106 -
 109.107 -  if (JNIHandles::is_global_handle((jobject) addr)) {
 109.108 -    tty->print_cr(INTPTR_FORMAT " is a global jni handle", addr);
 109.109 -    return;
 109.110 -  }
 109.111 -  if (JNIHandles::is_weak_global_handle((jobject) addr)) {
 109.112 -    tty->print_cr(INTPTR_FORMAT " is a weak global jni handle", addr);
 109.113 -    return;
 109.114 -  }
 109.115 -  if (JNIHandleBlock::any_contains((jobject) addr)) {
 109.116 -    tty->print_cr(INTPTR_FORMAT " is a local jni handle", addr);
 109.117 -    return;
 109.118 -  }
 109.119 -
 109.120 -  for(JavaThread *thread = Threads::first(); thread; thread = thread->next()) {
 109.121 -    // Check for privilege stack
 109.122 -    if (thread->privileged_stack_top() != NULL && thread->privileged_stack_top()->contains(addr)) {
 109.123 -      tty->print_cr(INTPTR_FORMAT " is pointing into the privilege stack for thread: " INTPTR_FORMAT, addr, thread);
 109.124 -      return;
 109.125 -    }
 109.126 -    // If the addr is a java thread print information about that.
 109.127 -    if (addr == (address)thread) {
 109.128 -       thread->print();
 109.129 -       return;
 109.130 -    }
 109.131 -  }
 109.132 -
 109.133 -  // Try an OS specific find
 109.134 -  if (os::find(addr)) {
 109.135 -    return;
 109.136 -  }
 109.137 -
 109.138 -  if (print_pc) {
 109.139 -    tty->print_cr(INTPTR_FORMAT ": probably in C++ code; check debugger", addr);
 109.140 -    Disassembler::decode(same_page(addr-40,addr),same_page(addr+40,addr));
 109.141 -    return;
 109.142 -  }
 109.143 -
 109.144 -  tty->print_cr(INTPTR_FORMAT " is pointing to unknown location", addr);
 109.145 -}
 109.146 -
 109.147 -
 109.148  class LookForRefInGenClosure : public OopsInGenClosure {
 109.149  public:
 109.150    oop target;
 109.151 @@ -767,7 +633,7 @@
 109.152  // Can we someday rename the other find to hsfind?
 109.153  extern "C" void hsfind(intptr_t x) {
 109.154    Command c("hsfind");
 109.155 -  find(x, false);
 109.156 +  os::print_location(tty, x, false);
 109.157  }
 109.158  
 109.159  
 109.160 @@ -778,13 +644,13 @@
 109.161  
 109.162  extern "C" void find(intptr_t x) {
 109.163    Command c("find");
 109.164 -  find(x, false);
 109.165 +  os::print_location(tty, x, false);
 109.166  }
 109.167  
 109.168  
 109.169  extern "C" void findpc(intptr_t x) {
 109.170    Command c("findpc");
 109.171 -  find(x, true);
 109.172 +  os::print_location(tty, x, true);
 109.173  }
 109.174  
 109.175  
   110.1 --- a/src/share/vm/utilities/globalDefinitions_gcc.hpp	Wed Jul 28 17:57:43 2010 -0400
   110.2 +++ b/src/share/vm/utilities/globalDefinitions_gcc.hpp	Tue Aug 03 08:13:38 2010 -0400
   110.3 @@ -216,8 +216,16 @@
   110.4  
   110.5  #define DEBUG_EXCEPTION ::abort();
   110.6  
   110.7 +#ifdef ARM
   110.8 +#ifdef SOLARIS
   110.9 +#define BREAKPOINT __asm__ volatile (".long 0xe1200070")
  110.10 +#else
  110.11 +#define BREAKPOINT __asm__ volatile (".long 0xe7f001f0")
  110.12 +#endif
  110.13 +#else
  110.14  extern "C" void breakpoint();
  110.15  #define BREAKPOINT ::breakpoint()
  110.16 +#endif
  110.17  
  110.18  // checking for nanness
  110.19  #ifdef SOLARIS
  110.20 @@ -235,6 +243,12 @@
  110.21  #error "missing platform-specific definition here"
  110.22  #endif
  110.23  
  110.24 +// GCC 4.3 does not allow 0.0/0.0 to produce a NAN value
  110.25 +#if (__GNUC__ == 4) && (__GNUC_MINOR__ > 2)
  110.26 +#define CAN_USE_NAN_DEFINE 1
  110.27 +#endif
  110.28 +
  110.29 +
  110.30  // Checking for finiteness
  110.31  
  110.32  inline int g_isfinite(jfloat  f)                 { return finite(f); }
   111.1 --- a/src/share/vm/utilities/macros.hpp	Wed Jul 28 17:57:43 2010 -0400
   111.2 +++ b/src/share/vm/utilities/macros.hpp	Tue Aug 03 08:13:38 2010 -0400
   111.3 @@ -188,4 +188,37 @@
   111.4  #define NOT_SPARC(code) code
   111.5  #endif
   111.6  
   111.7 +#ifdef PPC
   111.8 +#define PPC_ONLY(code) code
   111.9 +#define NOT_PPC(code)
  111.10 +#else
  111.11 +#define PPC_ONLY(code)
  111.12 +#define NOT_PPC(code) code
  111.13 +#endif
  111.14 +
  111.15 +#ifdef E500V2
  111.16 +#define E500V2_ONLY(code) code
  111.17 +#define NOT_E500V2(code)
  111.18 +#else
  111.19 +#define E500V2_ONLY(code)
  111.20 +#define NOT_E500V2(code) code
  111.21 +#endif
  111.22 +
  111.23 +
  111.24 +#ifdef ARM
  111.25 +#define ARM_ONLY(code) code
  111.26 +#define NOT_ARM(code)
  111.27 +#else
  111.28 +#define ARM_ONLY(code)
  111.29 +#define NOT_ARM(code) code
  111.30 +#endif
  111.31 +
  111.32 +#ifdef JAVASE_EMBEDDED
  111.33 +#define EMBEDDED_ONLY(code) code
  111.34 +#define NOT_EMBEDDED(code)
  111.35 +#else
  111.36 +#define EMBEDDED_ONLY(code)
  111.37 +#define NOT_EMBEDDED(code) code
  111.38 +#endif
  111.39 +
  111.40  #define define_pd_global(type, name, value) const type pd_##name = value;
   112.1 --- a/src/share/vm/utilities/vmError.cpp	Wed Jul 28 17:57:43 2010 -0400
   112.2 +++ b/src/share/vm/utilities/vmError.cpp	Tue Aug 03 08:13:38 2010 -0400
   112.3 @@ -687,16 +687,13 @@
   112.4  # undef END
   112.5  }
   112.6  
   112.7 +VMError* volatile VMError::first_error = NULL;
   112.8 +volatile jlong VMError::first_error_tid = -1;
   112.9  
  112.10  void VMError::report_and_die() {
  112.11    // Don't allocate large buffer on stack
  112.12    static char buffer[O_BUFLEN];
  112.13  
  112.14 -  // First error, and its thread id. We must be able to handle native thread,
  112.15 -  // so use thread id instead of Thread* to identify thread.
  112.16 -  static VMError* first_error;
  112.17 -  static jlong    first_error_tid;
  112.18 -
  112.19    // An error could happen before tty is initialized or after it has been
  112.20    // destroyed. Here we use a very simple unbuffered fdStream for printing.
  112.21    // Only out.print_raw() and out.print_raw_cr() should be used, as other
   113.1 --- a/src/share/vm/utilities/vmError.hpp	Wed Jul 28 17:57:43 2010 -0400
   113.2 +++ b/src/share/vm/utilities/vmError.hpp	Tue Aug 03 08:13:38 2010 -0400
   113.3 @@ -57,6 +57,10 @@
   113.4    int          _current_step;
   113.5    const char * _current_step_info;
   113.6    int          _verbose;
   113.7 +  // First error, and its thread id. We must be able to handle native thread,
   113.8 +  // so use thread id instead of Thread* to identify thread.
   113.9 +  static VMError* volatile first_error;
  113.10 +  static volatile jlong    first_error_tid;
  113.11  
  113.12    // used by reporting about OOM
  113.13    size_t       _size;
  113.14 @@ -108,4 +112,7 @@
  113.15    // returns original handler for signal, if it was resetted, or NULL if
  113.16    // signal was not changed by error reporter
  113.17    static address get_resetted_sighandler(int sig);
  113.18 +
  113.19 +  // check to see if fatal error reporting is in progress
  113.20 +  static bool fatal_error_in_progress() { return first_error != NULL; }
  113.21  };

mercurial