changeset 2504:c8155bc21432

Update to latest revision of Gary's Zero patch.
author andrew
date Mon, 28 Sep 2009 23:50:43 +0100
parents 180271cfe7c6
children de2100353d9c
files make/Makefile make/linux/Makefile make/linux/makefiles/buildtree.make make/linux/makefiles/defs.make make/linux/makefiles/top.make make/linux/makefiles/vm.make make/linux/makefiles/zero.make make/linux/makefiles/zeroshark.make src/cpu/zero/vm/assembler_zero.cpp src/cpu/zero/vm/assembler_zero.hpp src/cpu/zero/vm/assembler_zero.inline.hpp src/cpu/zero/vm/bytecodeInterpreter_zero.cpp src/cpu/zero/vm/bytecodeInterpreter_zero.hpp src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp src/cpu/zero/vm/bytecodes_zero.cpp src/cpu/zero/vm/bytecodes_zero.hpp src/cpu/zero/vm/bytes_zero.hpp src/cpu/zero/vm/codeBuffer_zero.hpp src/cpu/zero/vm/copy_zero.hpp src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp src/cpu/zero/vm/cppInterpreter_zero.cpp src/cpu/zero/vm/cppInterpreter_zero.hpp src/cpu/zero/vm/debug_zero.cpp src/cpu/zero/vm/deoptimizerFrame_zero.hpp src/cpu/zero/vm/depChecker_zero.cpp src/cpu/zero/vm/depChecker_zero.hpp src/cpu/zero/vm/disassembler_zero.hpp src/cpu/zero/vm/dump_zero.cpp src/cpu/zero/vm/entryFrame_zero.hpp src/cpu/zero/vm/entry_zero.hpp src/cpu/zero/vm/frame_zero.cpp src/cpu/zero/vm/frame_zero.hpp src/cpu/zero/vm/frame_zero.inline.hpp src/cpu/zero/vm/globalDefinitions_zero.hpp src/cpu/zero/vm/icBuffer_zero.cpp src/cpu/zero/vm/icache_zero.cpp src/cpu/zero/vm/icache_zero.hpp src/cpu/zero/vm/interp_masm_zero.cpp src/cpu/zero/vm/interp_masm_zero.hpp src/cpu/zero/vm/interpreterFrame_zero.hpp src/cpu/zero/vm/interpreterGenerator_zero.hpp src/cpu/zero/vm/interpreterRT_zero.cpp src/cpu/zero/vm/interpreterRT_zero.hpp src/cpu/zero/vm/interpreter_zero.cpp src/cpu/zero/vm/interpreter_zero.hpp src/cpu/zero/vm/javaFrameAnchor_zero.hpp src/cpu/zero/vm/jniFastGetField_zero.cpp src/cpu/zero/vm/jni_zero.h src/cpu/zero/vm/methodHandles_zero.cpp src/cpu/zero/vm/nativeInst_zero.cpp src/cpu/zero/vm/nativeInst_zero.hpp src/cpu/zero/vm/registerMap_zero.hpp src/cpu/zero/vm/register_definitions_zero.cpp src/cpu/zero/vm/register_zero.cpp src/cpu/zero/vm/register_zero.hpp src/cpu/zero/vm/relocInfo_zero.cpp src/cpu/zero/vm/relocInfo_zero.hpp src/cpu/zero/vm/sharedRuntime_zero.cpp src/cpu/zero/vm/sharkFrame_zero.hpp src/cpu/zero/vm/stackPrinter_zero.hpp src/cpu/zero/vm/stack_zero.hpp src/cpu/zero/vm/stubGenerator_zero.cpp src/cpu/zero/vm/stubRoutines_zero.hpp src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp src/cpu/zero/vm/templateInterpreter_zero.cpp src/cpu/zero/vm/templateInterpreter_zero.hpp src/cpu/zero/vm/templateTable_zero.cpp src/cpu/zero/vm/templateTable_zero.hpp src/cpu/zero/vm/vm_version_zero.cpp src/cpu/zero/vm/vm_version_zero.hpp src/cpu/zero/vm/vmreg_zero.cpp src/cpu/zero/vm/vmreg_zero.inline.hpp src/cpu/zero/vm/vtableStubs_zero.cpp src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp src/os_cpu/linux_zero/vm/interp_masm_zero.hpp src/os_cpu/linux_zero/vm/interpreterGenerator_zero.hpp src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp src/os_cpu/linux_zero/vm/os_linux_zero.cpp src/os_cpu/linux_zero/vm/os_linux_zero.hpp src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp src/os_cpu/linux_zero/vm/thread_linux_zero.cpp src/os_cpu/linux_zero/vm/thread_linux_zero.hpp src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp src/share/vm/includeDB_core src/share/vm/includeDB_zero src/share/vm/runtime/arguments.cpp src/share/vm/runtime/icache.cpp src/share/vm/runtime/jniHandles.hpp src/share/vm/runtime/vm_version.cpp src/share/vm/utilities/vmError.cpp
diffstat 94 files changed, 1352 insertions(+), 1724 deletions(-) [+]
line wrap: on
line diff
--- a/make/Makefile	Tue Sep 22 18:49:40 2009 +0100
+++ b/make/Makefile	Mon Sep 28 23:50:43 2009 +0100
@@ -84,6 +84,7 @@
 C1_VM_TARGETS=product1 fastdebug1 optimized1 jvmg1
 C2_VM_TARGETS=product  fastdebug  optimized  jvmg
 KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel
+ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
 
 # JDK directory list
 JDK_DIRS=bin include jre lib demo
@@ -94,14 +95,11 @@
 all_debug:     jvmg jvmg1 jvmgkernel docs export_debug
 all_optimized: optimized optimized1 optimizedkernel docs export_optimized
 
-# Core (non-compiler) targets made available with this Makefile
-CORE_VM_TARGETS=productcore fastdebugcore optimizedcore jvmgcore
-
-allcore:           all_productcore all_fastdebugcore
-all_productcore:   productcore docs export_product
-all_fastdebugcore: fastdebugcore docs export_fastdebug
-all_debugcore:     jvmgcore docs export_debug
-all_optimizedcore: optimizedcore docs export_optimized
+allzero:           all_productzero all_fastdebugzero
+all_productzero:   productzero docs export_product
+all_fastdebugzero: fastdebugzero docs export_fastdebug
+all_debugzero:     jvmgzero docs export_debug
+all_optimizedzero: optimizedzero docs export_optimized
 
 # Do everything
 world:         all create_jdk
@@ -125,14 +123,14 @@
 	$(CD) $(GAMMADIR)/make; \
 	$(MAKE) VM_TARGET=$@ generic_build2 $(ALT_OUT)
 
-$(CORE_VM_TARGETS):
-	$(CD) $(GAMMADIR)/make; \
-	$(MAKE) VM_TARGET=$@ generic_buildcore $(ALT_OUT)
-
 $(KERNEL_VM_TARGETS):
 	$(CD) $(GAMMADIR)/make; \
 	$(MAKE) VM_TARGET=$@ generic_buildkernel $(ALT_OUT)
 
+$(ZERO_VM_TARGETS):
+	$(CD) $(GAMMADIR)/make; \
+	$(MAKE) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
+
 # Build compiler1 (client) rule, different for platforms
 generic_build1:
 	$(MKDIR) -p $(OUTPUTDIR)
@@ -175,12 +173,6 @@
 		      $(MAKE_ARGS) $(VM_TARGET)
 endif
 
-generic_buildcore:
-	$(MKDIR) -p $(OUTPUTDIR)
-	$(CD) $(OUTPUTDIR); \
-		$(MAKE) -f $(ABS_OS_MAKEFILE) \
-			$(MAKE_ARGS) $(VM_TARGET)
-
 generic_buildkernel:
 	$(MKDIR) -p $(OUTPUTDIR)
 ifeq ($(OSNAME),windows)
@@ -199,6 +191,12 @@
 	@$(ECHO) "No kernel ($(VM_TARGET)) for OS_NAME=$(OSNAME)"
 endif
 
+generic_buildzero:
+	$(MKDIR) -p $(OUTPUTDIR)
+	$(CD) $(OUTPUTDIR); \
+		$(MAKE) -f $(ABS_OS_MAKEFILE) \
+			$(MAKE_ARGS) $(VM_TARGET)
+
 # Export file rule
 generic_export: $(EXPORT_LIST)
 export_product:
@@ -227,20 +225,18 @@
 XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
 DOCS_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_docs
 C1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler1
-ifeq ($(CORE_BUILD), true)
-C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_core
-else
 C2_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_compiler2
-endif
 KERNEL_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_kernel
+ZERO_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_zero
 C1_DIR=$(C1_BASE_DIR)/$(VM_SUBDIR)
 C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR)
 KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR)
+ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
 
 # Misc files and generated files need to come from C1 or C2 area
-ifeq ($(CORE_BUILD), true)
-  MISC_DIR=$(C2_DIR)
-  GEN_DIR=$(C2_BASE_DIR)/generated
+ifeq ($(ZERO_BUILD), true)
+  MISC_DIR=$(ZERO_DIR)
+  GEN_DIR=$(ZERO_BASE_DIR)/generated
 else
 ifeq ($(ARCH_DATA_MODEL), 32)
   MISC_DIR=$(C1_DIR)
@@ -293,6 +289,12 @@
 
 # Shared Library
 ifneq ($(OSNAME),windows)
+  ifeq ($(ZERO_BUILD), true)
+$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(ZERO_DIR)/%.so
+	$(install-file)
+$(EXPORT_SERVER_DIR)/%.so:       $(ZERO_DIR)/%.so
+	$(install-file)
+  else
 $(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
 	$(install-file)
 $(EXPORT_CLIENT_DIR)/%.so:       $(C1_DIR)/%.so
@@ -303,6 +305,7 @@
 	$(install-file)
 $(EXPORT_SERVER_DIR)/64/%.so:    $(C2_DIR)/%.so
 	$(install-file)
+  endif
 endif
 
 # Jar file (sa-jdi.jar)
@@ -341,6 +344,7 @@
 	$(RM) -r $(C1_DIR)
 	$(RM) -r $(C2_DIR)
 	$(RM) -r $(KERNEL_DIR)
+	$(RM) -r $(ZERO_DIR)
 clean_export:
 	$(RM) -r $(EXPORT_PATH)
 clean_jdk:
@@ -363,8 +367,10 @@
 	 ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
 
 test_jdk:
-  ifeq ($(ARCH_DATA_MODEL), 32)
+  ifneq ($(ZERO_BUILD), true)
+    ifeq ($(ARCH_DATA_MODEL), 32)
 	$(JDK_IMAGE_DIR)/bin/java -client -version
+    endif
   endif
 	$(JDK_IMAGE_DIR)/bin/java -server -version
 
--- a/make/linux/Makefile	Tue Sep 22 18:49:40 2009 +0100
+++ b/make/linux/Makefile	Mon Sep 28 23:50:43 2009 +0100
@@ -158,6 +158,13 @@
 #       profiledcore    core            <os>_<arch>_core/profiled
 #       productcore     core            <os>_<arch>_core/product
 #
+#       debugzero       zero            <os>_<arch>_zero/debug
+#       fastdebugzero   zero            <os>_<arch>_zero/fastdebug
+#       jvmgzero        zero            <os>_<arch>_zero/jvmg
+#       optimizedzero   zero            <os>_<arch>_zero/optimized
+#       profiledzero    zero            <os>_<arch>_zero/profiled
+#       productzero     zero            <os>_<arch>_zero/product
+#
 # What you get with each target:
 #
 # debug*     - "thin" libjvm_g - debug info linked into the gamma_g launcher
@@ -176,11 +183,13 @@
 SUBDIRS_C2        = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS))
 SUBDIRS_TIERED    = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
 SUBDIRS_CORE      = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
+SUBDIRS_ZERO      = $(addprefix $(OSNAME)_$(BUILDARCH)_zero/,$(TARGETS))
 
 TARGETS_C2        = $(TARGETS)
 TARGETS_C1        = $(addsuffix 1,$(TARGETS))
 TARGETS_TIERED    = $(addsuffix tiered,$(TARGETS))
 TARGETS_CORE      = $(addsuffix core,$(TARGETS))
+TARGETS_ZERO      = $(addsuffix zero,$(TARGETS))
 
 BUILDTREE_MAKE    = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
 BUILDTREE_VARS    = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
@@ -196,6 +205,7 @@
 	@echo "  $(TARGETS_C2)"
 	@echo "  $(TARGETS_C1)"
 	@echo "  $(TARGETS_CORE)"
+	@echo "  $(TARGETS_ZERO)"
 
 checks: check_os_version check_j2se_version
 
@@ -224,22 +234,11 @@
 	  exit 1; \
 	fi
 
-# For Zero builds we need to create the platform file from a template.
-# For non-Zero builds the file will be read directly from $(GAMMADIR)
-ifeq ($(ZERO_BUILD), true)
-  PLATFORM_FILE = $(OUTPUTDIR)/platform_zero
-else
-  PLATFORM_FILE =
-endif
-
-$(OUTPUTDIR)/platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
-	$(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
-
-$(SUBDIRS_TIERED): $(BUILDTREE_MAKE) $(PLATFORM_FILE)
+$(SUBDIRS_TIERED): $(BUILDTREE_MAKE)
 	$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
 	$(BUILDTREE) VARIANT=tiered
 
-$(SUBDIRS_C2): $(BUILDTREE_MAKE) $(PLATFORM_FILE)
+$(SUBDIRS_C2): $(BUILDTREE_MAKE)
 ifdef FORCE_TIERED
 	$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
 		$(BUILDTREE) VARIANT=tiered FORCE_TIERED=1
@@ -248,14 +247,21 @@
 		$(BUILDTREE) VARIANT=compiler2
 endif
 
-$(SUBDIRS_C1): $(BUILDTREE_MAKE) $(PLATFORM_FILE)
+$(SUBDIRS_C1): $(BUILDTREE_MAKE)
 	$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
 	$(BUILDTREE) VARIANT=compiler1
 
-$(SUBDIRS_CORE): $(BUILDTREE_MAKE) $(PLATFORM_FILE)
+$(SUBDIRS_CORE): $(BUILDTREE_MAKE)
 	$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
 	$(BUILDTREE) VARIANT=core
 
+$(SUBDIRS_ZERO): $(BUILDTREE_MAKE) $(OUTPUTDIR)/platform_zero
+	$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
+	$(BUILDTREE) VARIANT=zero
+
+$(OUTPUTDIR)/platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
+	$(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
+
 # Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME
 
 $(TARGETS_C2):  $(SUBDIRS_C2)
@@ -286,10 +292,18 @@
 	cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
 endif
 
+$(TARGETS_ZERO):  $(SUBDIRS_ZERO)
+	cd $(OSNAME)_$(BUILDARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
+	cd $(OSNAME)_$(BUILDARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
+ifdef INSTALL
+	cd $(OSNAME)_$(BUILDARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
+endif
+
 # Just build the tree, and nothing else:
 tree:      $(SUBDIRS_C2)
 tree1:     $(SUBDIRS_C1)
 treecore:  $(SUBDIRS_CORE)
+treezero:  $(SUBDIRS_ZERO)
 
 # Doc target.  This is the same for all build options.
 #     Hence create a docs directory beside ...$(ARCH)_[...]
@@ -304,20 +318,22 @@
 
 core: jvmgcore productcore
 
+zero: jvmgzero productzero
+
 clean_docs:
 	rm -rf $(SUBDIR_DOCS)
 
-clean_compiler1 clean_compiler2 clean_core:
+clean_compiler1 clean_compiler2 clean_core clean_zero:
 	rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
 
-clean:  clean_compiler2 clean_compiler1 clean_core clean_docs
+clean:  clean_compiler2 clean_compiler1 clean_core clean_zero clean_docs
 
 include $(GAMMADIR)/make/$(OSNAME)/makefiles/cscope.make
 
 #-------------------------------------------------------------------------------
 
-.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE)
-.PHONY: tree tree1 treecore
-.PHONY: all compiler1 compiler2 core
-.PHONY: clean clean_compiler1 clean_compiler2 clean_core docs clean_docs
+.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO)
+.PHONY: tree tree1 treecore treezero
+.PHONY: all compiler1 compiler2 core zero
+.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero docs clean_docs
 .PHONY: checks check_os_version check_j2se_version
--- a/make/linux/makefiles/buildtree.make	Tue Sep 22 18:49:40 2009 +0100
+++ b/make/linux/makefiles/buildtree.make	Mon Sep 28 23:50:43 2009 +0100
@@ -325,7 +325,7 @@
 DATA_MODE/sparcv9 = 64
 DATA_MODE/amd64   = 64
 DATA_MODE/ia64    = 64
-DATA_MODE/zero    = $(ZERO_BITSPERWORD)
+DATA_MODE/zero    = $(ARCH_DATA_MODEL)
 
 JAVA_FLAG/32 = -d32
 JAVA_FLAG/64 = -d64
--- a/make/linux/makefiles/defs.make	Tue Sep 22 18:49:40 2009 +0100
+++ b/make/linux/makefiles/defs.make	Mon Sep 28 23:50:43 2009 +0100
@@ -39,7 +39,6 @@
 
 # zero
 ifeq ($(ZERO_BUILD), true)
-  ARCH_DATA_MODEL  = $(ZERO_BITSPERWORD)
   ifeq ($(ARCH_DATA_MODEL), 64)
     MAKE_ARGS      += LP64=1
   endif
@@ -109,7 +108,7 @@
 EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjsig.so
 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
-ifneq ($(CORE_BUILD), true)
+ifneq ($(ZERO_BUILD), true)
   ifeq ($(ARCH_DATA_MODEL), 32)
     EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
     EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
--- a/make/linux/makefiles/top.make	Tue Sep 22 18:49:40 2009 +0100
+++ b/make/linux/makefiles/top.make	Mon Sep 28 23:50:43 2009 +0100
@@ -74,6 +74,7 @@
 Include_DBs/COMPILER1   = $(Include_DBs/CORE) $(VM)/includeDB_compiler1
 Include_DBs/COMPILER2   = $(Include_DBs/CORE) $(VM)/includeDB_compiler2
 Include_DBs/TIERED      = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 $(VM)/includeDB_compiler2
+Include_DBs/ZERO        = $(Include_DBs/CORE) $(VM)/includeDB_zero
 Include_DBs = $(Include_DBs/$(TYPE))
 
 Cached_plat = $(GENERATED)/platform.current
--- a/make/linux/makefiles/vm.make	Tue Sep 22 18:49:40 2009 +0100
+++ b/make/linux/makefiles/vm.make	Mon Sep 28 23:50:43 2009 +0100
@@ -40,7 +40,11 @@
 include $(GENERATED)/Dependencies
 
 # read machine-specific adjustments (%%% should do this via buildtree.make?)
-include $(MAKEFILES_DIR)/$(BUILDARCH).make
+ifeq ($(ZERO_BUILD), true)
+  include $(MAKEFILES_DIR)/zeroshark.make
+else
+  include $(MAKEFILES_DIR)/$(BUILDARCH).make
+endif
 
 # set VPATH so make knows where to look for source files
 # Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
@@ -124,8 +128,6 @@
 	rm -f $@
 	cat $^ > $@
 
-STATIC_CXX = true
-
 ifeq ($(ZERO_LIBARCH), ppc64)
   STATIC_CXX = false
 else
--- a/make/linux/makefiles/zero.make	Tue Sep 22 18:49:40 2009 +0100
+++ b/make/linux/makefiles/zero.make	Mon Sep 28 23:50:43 2009 +0100
@@ -1,6 +1,6 @@
 #
-# Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
-# Copyright 2007, 2008 Red Hat, Inc.
+# Copyright 1999-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2009 Red Hat, Inc.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -20,22 +20,13 @@
 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 # CA 95054 USA or visit www.sun.com if you need additional information or
 # have any questions.
-#
+#  
 #
 
-# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
-OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
-# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
-OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
+# Setup for Zero (non-Shark) version of VM
 
-# Specify that the CPU is little endian, if necessary
-ifeq ($(ZERO_ENDIANNESS), little)
-  CFLAGS += -DVM_LITTLE_ENDIAN
-endif
+# Select which includeDB files to use (in top.make)
+TYPE = ZERO
 
-# Specify that the CPU is 64 bit, if necessary
-ifeq ($(ZERO_BITSPERWORD), 64)
-  CFLAGS += -D_LP64=1
-endif
-
-OPT_CFLAGS/compactingPermGenGen.o = -O1
+# Install libjvm.so, etc in in server directory.
+VM_SUBDIR = server
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/linux/makefiles/zeroshark.make	Mon Sep 28 23:50:43 2009 +0100
@@ -0,0 +1,43 @@
+#
+# Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
+# Copyright 2007, 2008 Red Hat, Inc.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Setup common to Zero (non-Shark) and Shark versions of VM
+
+# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
+OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
+# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
+OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
+
+# Specify that the CPU is little endian, if necessary
+ifeq ($(ZERO_ENDIANNESS), little)
+  CFLAGS += -DVM_LITTLE_ENDIAN
+endif
+
+# Specify that the CPU is 64 bit, if necessary
+ifeq ($(ARCH_DATA_MODEL), 64)
+  CFLAGS += -D_LP64=1
+endif
+
+OPT_CFLAGS/compactingPermGenGen.o = -O1
--- a/src/cpu/zero/vm/assembler_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/assembler_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,73 +26,52 @@
 #include "incls/_precompiled.incl"
 #include "incls/_assembler_zero.cpp.incl"
 
-int AbstractAssembler::code_fill_byte()
-{
+int AbstractAssembler::code_fill_byte() {
   return 0;
 }
 
-void Assembler::pd_patch_instruction(address branch, address target)
-{
-  Unimplemented();
+void Assembler::pd_patch_instruction(address branch, address target) {
+  ShouldNotCallThis();
 }
 
 #ifndef PRODUCT
-void Assembler::pd_print_patched_instruction(address branch)
-{
-  Unimplemented();
+void Assembler::pd_print_patched_instruction(address branch) {
+  ShouldNotCallThis();
 }
 #endif // PRODUCT
 
-void MacroAssembler::align(int modulus)
-{
+void MacroAssembler::align(int modulus) {
   while (offset() % modulus != 0)
     emit_byte(AbstractAssembler::code_fill_byte());
 }
 
-void MacroAssembler::bang_stack_with_offset(int offset)
-{
-  Unimplemented();
+void MacroAssembler::bang_stack_with_offset(int offset) {
+  ShouldNotCallThis();
 }
 
-void MacroAssembler::advance(int bytes)
-{
+void MacroAssembler::advance(int bytes) {
   _code_pos += bytes;
   sync();
 }
 
-RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_addr,
-						      Register tmpl, int offset) 
-{
-  Unimplemented();
+RegisterOrConstant MacroAssembler::delayed_value_impl(
+  intptr_t* delayed_value_addr, Register tmpl, int offset) {
+  ShouldNotCallThis();
 }
 
-void MacroAssembler::store_oop(jobject obj)
-{
+void MacroAssembler::store_oop(jobject obj) {
   code_section()->relocate(pc(), oop_Relocation::spec_for_immediate());
   emit_address((address) obj);
 }
 
-static void _UnimplementedStub()
-{
-  report_unimplemented(__FILE__, __LINE__);
+static void should_not_call() {
+  report_should_not_call(__FILE__, __LINE__);
 }
 
-address UnimplementedStub()
-{
-  return (address) _UnimplementedStub;
+address ShouldNotCallThisStub() {
+  return (address) should_not_call;
 }
 
-address UnimplementedEntry()
-{
-  return (address) _UnimplementedStub;
+address ShouldNotCallThisEntry() {
+  return (address) should_not_call;
 }
-
-static void _ShouldNotReachHereStub()
-{
-  report_should_not_reach_here(__FILE__, __LINE__);
-}
-
-address ShouldNotReachHereStub()
-{
-  return (address) _ShouldNotReachHereStub;
-}
--- a/src/cpu/zero/vm/assembler_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/assembler_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -32,6 +32,7 @@
  public:
   Assembler(CodeBuffer* code) : AbstractAssembler(code) {}
 
+ public:
   void pd_patch_instruction(address branch, address target);
 #ifndef PRODUCT
   static void pd_print_patched_instruction(address branch);
@@ -42,29 +43,22 @@
  public:
   MacroAssembler(CodeBuffer* code) : Assembler(code) {}
 
+ public:
   void align(int modulus);
   void bang_stack_with_offset(int offset);
   bool needs_explicit_null_check(intptr_t offset);
   RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr,
-					Register tmp, int offset);
+                                        Register tmp, int offset);
  public:
   void advance(int bytes);
   void store_oop(jobject obj);
 };
 
 #ifdef ASSERT
-inline bool AbstractAssembler::pd_check_instruction_mark()
-{
-  Unimplemented();
+inline bool AbstractAssembler::pd_check_instruction_mark() {
+  ShouldNotCallThis();
 }
 #endif
 
-address UnimplementedStub();
-address UnimplementedEntry();
-address ShouldNotReachHereStub();
-
-// Nothing to do with the assembler (or lack of),
-// just a real convenient place to include these.
-#include <ffi.h>
-#include <entry_zero.hpp>
-#include <stack_zero.hpp>
+address ShouldNotCallThisStub();
+address ShouldNotCallThisEntry();
--- a/src/cpu/zero/vm/assembler_zero.inline.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/assembler_zero.inline.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/bytecodeInterpreter_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -28,8 +28,7 @@
 
 #ifdef CC_INTERP
 
-const char *BytecodeInterpreter::name_of_field_at_address(address addr)
-{
+const char *BytecodeInterpreter::name_of_field_at_address(address addr) {
 #define DO(member) {if (addr == (address) &(member)) return XSTR(member);}
   DO(_thread);
   DO(_bcp);
--- a/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/bytecodeInterpreter_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -35,66 +35,57 @@
   interpreterState _self_link;
 
  public:
-  inline void set_locals(intptr_t* new_locals)
-  {
+  inline void set_locals(intptr_t* new_locals) {
     _locals = new_locals;
   }
-  inline void set_method(methodOop new_method)
-  {
+  inline void set_method(methodOop new_method) {
     _method = new_method;
   }
-  inline interpreterState self_link()
-  {
+  inline interpreterState self_link() {
     return _self_link;
   }
-  inline void set_self_link(interpreterState new_self_link)
-  {
+  inline void set_self_link(interpreterState new_self_link) {
     _self_link = new_self_link;
   }
-  inline interpreterState prev_link()
-  {
+  inline interpreterState prev_link() {
     return _prev_link;
   }
-  inline void set_prev_link(interpreterState new_prev_link)
-  {
+  inline void set_prev_link(interpreterState new_prev_link) {
     _prev_link = new_prev_link;
   }
-  inline void set_stack_limit(intptr_t* new_stack_limit)
-  {
+  inline void set_stack_limit(intptr_t* new_stack_limit) {
     _stack_limit = new_stack_limit;
   }
-  inline void set_stack_base(intptr_t* new_stack_base)
-  {
+  inline void set_stack_base(intptr_t* new_stack_base) {
     _stack_base = new_stack_base;
   }
-  inline void set_monitor_base(BasicObjectLock *new_monitor_base)
-  {
+  inline void set_monitor_base(BasicObjectLock *new_monitor_base) {
     _monitor_base = new_monitor_base;
   }
-  inline void set_thread(JavaThread* new_thread)
-  {
+  inline void set_thread(JavaThread* new_thread) {
     _thread = new_thread;
   }
-  inline void set_constants(constantPoolCacheOop new_constants)
-  {
+  inline void set_constants(constantPoolCacheOop new_constants) {
     _constants = new_constants;
   }
-  inline oop oop_temp()
-  {
+  inline oop oop_temp() {
     return _oop_temp;
   }
-  inline oop *oop_temp_addr()
-  {
+  inline oop *oop_temp_addr() {
     return &_oop_temp;
   }
-  inline void set_oop_temp(oop new_oop_temp)
-  {
+  inline void set_oop_temp(oop new_oop_temp) {
     _oop_temp = new_oop_temp;
   }
-  inline address callee_entry_point()
-  {
+  inline address callee_entry_point() {
     return _result._to_call._callee_entry_point;
   }
+  inline address osr_buf() {
+    return _result._osr._osr_buf;
+  }
+  inline address osr_entry() {
+    return _result._osr._osr_entry;
+  }
 
  public:
   const char *name_of_field_at_address(address addr);
--- a/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/bytecodeInterpreter_zero.inline.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -25,15 +25,33 @@
 
 // Inline interpreter functions for zero
 
-inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; }
-inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) { return op1 - op2; }
-inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) { return op1 * op2; }
-inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) { return op1 / op2; }
-inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) { return fmod(op1, op2); }
+inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) {
+  return op1 + op2;
+}
 
-inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) { return -op; }
+inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) {
+  return op1 - op2;
+}
 
-inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat op1, jfloat op2, int32_t direction) {
+inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) {
+  return op1 * op2;
+}
+
+inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) {
+  return op1 / op2;
+}
+
+inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) {
+  return fmod(op1, op2);
+}
+
+inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) {
+  return -op;
+}
+
+inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat  op1,
+                                                   jfloat  op2,
+                                                   int32_t direction) {
   return ( op1 < op2 ? -1 :
                op1 > op2 ? 1 :
                    op1 == op2 ? 0 :
@@ -41,7 +59,8 @@
 
 }
 
-inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2], const uint32_t from[2]) {
+inline void BytecodeInterpreter::VMmemCopy64(uint32_t       to[2],
+                                             const uint32_t from[2]) {
   *(uint64_t *) to = *(uint64_t *) from;
 }
 
@@ -182,7 +201,9 @@
   return op1 - op2;
 }
 
-inline int32_t BytecodeInterpreter::VMdoubleCompare(jdouble op1, jdouble op2, int32_t direction) {
+inline int32_t BytecodeInterpreter::VMdoubleCompare(jdouble op1,
+                                                    jdouble op2,
+                                                    int32_t direction) {
   return ( op1 < op2 ? -1 :
                op1 > op2 ? 1 :
                    op1 == op2 ? 0 :
--- a/src/cpu/zero/vm/bytecodes_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/bytecodes_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,7 +26,6 @@
 #include "incls/_precompiled.incl"
 #include "incls/_bytecodes_zero.cpp.incl"
 
-void Bytecodes::pd_initialize()
-{
+void Bytecodes::pd_initialize() {
   // No zero specific initialization
 }
--- a/src/cpu/zero/vm/bytecodes_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/bytecodes_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/bytes_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/bytes_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright 1997-2002 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2007, 2008 Red Hat, Inc.
+ * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,12 +23,17 @@
  *
  */
 
+typedef union unaligned {
+  u4 u;
+  u2 us;
+  u8 ul;
+} __attribute__((packed)) unaligned;
+
 class Bytes: AllStatic {
  public:
   // Returns true if the byte ordering used by Java is different
   // from the native byte ordering of the underlying machine.
-  static inline bool is_Java_byte_ordering_different()
-  {
+  static inline bool is_Java_byte_ordering_different() {
 #ifdef VM_LITTLE_ENDIAN
     return true;
 #else
@@ -38,227 +43,85 @@
 
   // Efficient reading and writing of unaligned unsigned data in
   // platform-specific byte ordering.
-#ifdef VM_LITTLE_ENDIAN
-  static inline u2   get_native_u2(address p){
-    return (intptr_t(p) & 1) == 0
-             ?   *(u2*)p
-             :   ( u2(p[1]) << 8 )
-               | ( u2(p[0])      );
+  static inline u2 get_native_u2(address p){
+    unaligned *up = (unaligned *) p;
+    return up->us;
   }
 
-  static inline u4   get_native_u4(address p) {
-    switch (intptr_t(p) & 3) {
-     case 0:  return *(u4*)p;
-
-     case 2:  return (  u4( ((u2*)p)[1] ) << 16  )
-                   | (  u4( ((u2*)p)[0] )                  );
-
-    default:  return ( u4(p[3]) << 24 )
-                   | ( u4(p[2]) << 16 )
-                   | ( u4(p[1]) <<  8 )
-                   |   u4(p[0]);
-    }
+  static inline u4 get_native_u4(address p) {
+    unaligned *up = (unaligned *) p;
+    return up->u;
   }
 
-  static inline u8   get_native_u8(address p) {
-    switch (intptr_t(p) & 7) {
-      case 0:  return *(u8*)p;
-
-      case 4:  return (  u8( ((u4*)p)[1] ) << 32  )
-                    | (  u8( ((u4*)p)[0] )        );
-
-      case 2:  return (  u8( ((u2*)p)[3] ) << 48  )
-                    | (  u8( ((u2*)p)[2] ) << 32  )
-                    | (  u8( ((u2*)p)[1] ) << 16  )
-                    | (  u8( ((u2*)p)[0] )        );
-
-     default:  return ( u8(p[7]) << 56 )
-                    | ( u8(p[6]) << 48 )
-                    | ( u8(p[5]) << 40 )
-                    | ( u8(p[4]) << 32 )
-                    | ( u8(p[3]) << 24 )
-                    | ( u8(p[2]) << 16 )
-                    | ( u8(p[1]) <<  8 )
-                    |   u8(p[0]);
-    }
+  static inline u8 get_native_u8(address p) {
+    unaligned *up = (unaligned *) p;
+    return up->ul;
   }
 
-  static inline void put_native_u2(address p, u2 x)   {
-    if ( (intptr_t(p) & 1) == 0 )  *(u2*)p = x;
-    else {
-      p[1] = x >> 8;
-      p[0] = x;
-    }
+  static inline void put_native_u2(address p, u2 x) {
+    unaligned *up = (unaligned *) p;
+    up->us = x;
   }
 
   static inline void put_native_u4(address p, u4 x) {
-    switch ( intptr_t(p) & 3 ) {
-    case 0:  *(u4*)p = x;
-              break;
-
-    case 2:  ((u2*)p)[1] = x >> 16;
-             ((u2*)p)[0] = x;
-             break;
-
-    default: ((u1*)p)[3] = x >> 24;
-             ((u1*)p)[2] = x >> 16;
-             ((u1*)p)[1] = x >>  8;
-             ((u1*)p)[0] = x;
-             break;
-    }
+    unaligned *up = (unaligned *) p;
+    up->u = x;
   }
 
   static inline void put_native_u8(address p, u8 x) {
-    switch ( intptr_t(p) & 7 ) {
-    case 0:  *(u8*)p = x;
-             break;
-
-    case 4:  ((u4*)p)[1] = x >> 32;
-             ((u4*)p)[0] = x;
-             break;
-
-    case 2:  ((u2*)p)[3] = x >> 48;
-             ((u2*)p)[2] = x >> 32;
-             ((u2*)p)[1] = x >> 16;
-             ((u2*)p)[0] = x;
-             break;
-
-    default: ((u1*)p)[7] = x >> 56;
-             ((u1*)p)[6] = x >> 48;
-             ((u1*)p)[5] = x >> 40;
-             ((u1*)p)[4] = x >> 32;
-             ((u1*)p)[3] = x >> 24;
-             ((u1*)p)[2] = x >> 16;
-             ((u1*)p)[1] = x >>  8;
-             ((u1*)p)[0] = x;
-    }
+    unaligned *up = (unaligned *) p;
+    up->ul = x;
   }
-#else
-  static inline u2   get_native_u2(address p){
-    return (intptr_t(p) & 1) == 0
-             ?   *(u2*)p
-             :   ( u2(p[0]) << 8 )
-               | ( u2(p[1])      );
-  }
-
-  static inline u4   get_native_u4(address p) {
-    switch (intptr_t(p) & 3) {
-     case 0:  return *(u4*)p;
-
-     case 2:  return (  u4( ((u2*)p)[0] ) << 16  )
-                   | (  u4( ((u2*)p)[1] )                  );
-
-    default:  return ( u4(p[0]) << 24 )
-                   | ( u4(p[1]) << 16 )
-                   | ( u4(p[2]) <<  8 )
-                   |   u4(p[3]);
-    }
-  }
-
-  static inline u8   get_native_u8(address p) {
-    switch (intptr_t(p) & 7) {
-      case 0:  return *(u8*)p;
-
-      case 4:  return (  u8( ((u4*)p)[0] ) << 32  )
-                    | (  u8( ((u4*)p)[1] )        );
-
-      case 2:  return (  u8( ((u2*)p)[0] ) << 48  )
-                    | (  u8( ((u2*)p)[1] ) << 32  )
-                    | (  u8( ((u2*)p)[2] ) << 16  )
-                    | (  u8( ((u2*)p)[3] )        );
-
-     default:  return ( u8(p[0]) << 56 )
-                    | ( u8(p[1]) << 48 )
-                    | ( u8(p[2]) << 40 )
-                    | ( u8(p[3]) << 32 )
-                    | ( u8(p[4]) << 24 )
-                    | ( u8(p[5]) << 16 )
-                    | ( u8(p[6]) <<  8 )
-                    |   u8(p[7]);
-    }
-  }
-
-  static inline void put_native_u2(address p, u2 x)   {
-    if ( (intptr_t(p) & 1) == 0 )  *(u2*)p = x;
-    else {
-      p[0] = x >> 8;
-      p[1] = x;
-    }
-  }
-
-  static inline void put_native_u4(address p, u4 x) {
-    switch ( intptr_t(p) & 3 ) {
-    case 0:  *(u4*)p = x;
-              break;
-
-    case 2:  ((u2*)p)[0] = x >> 16;
-             ((u2*)p)[1] = x;
-             break;
-
-    default: ((u1*)p)[0] = x >> 24;
-             ((u1*)p)[1] = x >> 16;
-             ((u1*)p)[2] = x >>  8;
-             ((u1*)p)[3] = x;
-             break;
-    }
-  }
-
-  static inline void put_native_u8(address p, u8 x) {
-    switch ( intptr_t(p) & 7 ) {
-    case 0:  *(u8*)p = x;
-             break;
-
-    case 4:  ((u4*)p)[0] = x >> 32;
-             ((u4*)p)[1] = x;
-             break;
-
-    case 2:  ((u2*)p)[0] = x >> 48;
-             ((u2*)p)[1] = x >> 32;
-             ((u2*)p)[2] = x >> 16;
-             ((u2*)p)[3] = x;
-             break;
-
-    default: ((u1*)p)[0] = x >> 56;
-             ((u1*)p)[1] = x >> 48;
-             ((u1*)p)[2] = x >> 40;
-             ((u1*)p)[3] = x >> 32;
-             ((u1*)p)[4] = x >> 24;
-             ((u1*)p)[5] = x >> 16;
-             ((u1*)p)[6] = x >>  8;
-             ((u1*)p)[7] = x;
-    }
-  }
-#endif // VM_LITTLE_ENDIAN
-
 
   // Efficient reading and writing of unaligned unsigned data in Java
   // byte ordering (i.e. big-endian ordering).
 #ifdef VM_LITTLE_ENDIAN
   // Byte-order reversal is needed
-  static inline u2 get_Java_u2(address p)
-  {
-    return swap_u2(get_native_u2(p));
+  static inline u2 get_Java_u2(address p) {
+    return (u2(p[0]) << 8) |
+           (u2(p[1])     );
   }
-  static inline u4 get_Java_u4(address p)
-  {
-    return swap_u4(get_native_u4(p));
+  static inline u4 get_Java_u4(address p) {
+    return (u4(p[0]) << 24) |
+           (u4(p[1]) << 16) |
+           (u4(p[2]) <<  8) |
+           (u4(p[3])      );
   }
-  static inline u8 get_Java_u8(address p)
-  {
-    return swap_u8(get_native_u8(p));
+  static inline u8 get_Java_u8(address p) {
+    u4 hi, lo;
+    hi = (u4(p[0]) << 24) |
+         (u4(p[1]) << 16) |
+         (u4(p[2]) <<  8) |
+         (u4(p[3])      );
+    lo = (u4(p[4]) << 24) |
+         (u4(p[5]) << 16) |
+         (u4(p[6]) <<  8) |
+         (u4(p[7])      );
+    return u8(lo) | (u8(hi) << 32);
   }
 
-  static inline void put_Java_u2(address p, u2 x)
-  {
-    put_native_u2(p, swap_u2(x));
+  static inline void put_Java_u2(address p, u2 x) {
+    p[0] = x >> 8;
+    p[1] = x;
   }
-  static inline void put_Java_u4(address p, u4 x)
-  {
-    put_native_u4(p, swap_u4(x));
+  static inline void put_Java_u4(address p, u4 x) {
+    p[0] = x >> 24;
+    p[1] = x >> 16;
+    p[2] = x >> 8;
+    p[3] = x;
   }
-  static inline void put_Java_u8(address p, u8 x)
-  {
-    put_native_u8(p, swap_u8(x));
+  static inline void put_Java_u8(address p, u8 x) {
+    u4 hi, lo;
+    lo = x;
+    hi = x >> 32;
+    p[0] = hi >> 24;
+    p[1] = hi >> 16;
+    p[2] = hi >> 8;
+    p[3] = hi;
+    p[4] = lo >> 24;
+    p[5] = lo >> 16;
+    p[6] = lo >> 8;
+    p[7] = lo;
   }
 
   // Efficient swapping of byte ordering
@@ -267,29 +130,23 @@
   static inline u8 swap_u8(u8 x);
 #else
   // No byte-order reversal is needed
-  static inline u2 get_Java_u2(address p)
-  {
+  static inline u2 get_Java_u2(address p) {
     return get_native_u2(p);
   }
-  static inline u4 get_Java_u4(address p)
-  {
+  static inline u4 get_Java_u4(address p) {
     return get_native_u4(p);
   }
-  static inline u8 get_Java_u8(address p)
-  {
+  static inline u8 get_Java_u8(address p) {
     return get_native_u8(p);
   }
 
-  static inline void put_Java_u2(address p, u2 x)
-  {
+  static inline void put_Java_u2(address p, u2 x) {
     put_native_u2(p, x);
   }
-  static inline void put_Java_u4(address p, u4 x)
-  {
+  static inline void put_Java_u4(address p, u4 x) {
     put_native_u4(p, x);
   }
-  static inline void put_Java_u8(address p, u8 x)
-  {
+  static inline void put_Java_u8(address p, u8 x) {
     put_native_u8(p, x);
   }
 
--- a/src/cpu/zero/vm/codeBuffer_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/codeBuffer_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -23,5 +23,5 @@
  *
  */
 
-private:
+ private:
   void pd_initialize() {}
--- a/src/cpu/zero/vm/copy_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/copy_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,7 +26,7 @@
 // Inline functions for memory copy and fill.
 
 static void pd_conjoint_words(HeapWord* from, HeapWord* to, size_t count) {
-  (void)memmove(to, from, count * HeapWordSize);
+  memmove(to, from, count * HeapWordSize);
 }
 
 static void pd_disjoint_words(HeapWord* from, HeapWord* to, size_t count) {
@@ -41,7 +41,7 @@
   case 1:  to[0] = from[0];
   case 0:  break;
   default:
-    (void)memcpy(to, from, count * HeapWordSize);
+    memcpy(to, from, count * HeapWordSize);
     break;
   }
 }
@@ -70,7 +70,7 @@
 static void pd_aligned_conjoint_words(HeapWord* from,
                                       HeapWord* to,
                                       size_t count) {
-  (void)memmove(to, from, count * HeapWordSize);
+  memmove(to, from, count * HeapWordSize);
 }
 
 static void pd_aligned_disjoint_words(HeapWord* from,
@@ -80,11 +80,11 @@
 }
 
 static void pd_conjoint_bytes(void* from, void* to, size_t count) {
-  (void)memmove(to, from, count);
+  memmove(to, from, count);
 }
 
 static void pd_conjoint_bytes_atomic(void* from, void* to, size_t count) {
-  (void)memmove(to, from, count);
+  memmove(to, from, count);
 }
 
 static void pd_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
@@ -109,23 +109,33 @@
 #endif // _LP64
 }
 
-static void pd_arrayof_conjoint_bytes(HeapWord* from, HeapWord* to, size_t count) {
+static void pd_arrayof_conjoint_bytes(HeapWord* from,
+                                      HeapWord* to,
+                                      size_t    count) {
   _Copy_arrayof_conjoint_bytes(from, to, count);
 }
 
-static void pd_arrayof_conjoint_jshorts(HeapWord* from, HeapWord* to, size_t count) {
+static void pd_arrayof_conjoint_jshorts(HeapWord* from,
+                                        HeapWord* to,
+                                        size_t    count) {
   _Copy_arrayof_conjoint_jshorts(from, to, count);
 }
 
-static void pd_arrayof_conjoint_jints(HeapWord* from, HeapWord* to, size_t count) {
+static void pd_arrayof_conjoint_jints(HeapWord* from,
+                                      HeapWord* to,
+                                      size_t    count) {
   _Copy_arrayof_conjoint_jints(from, to, count);
 }
 
-static void pd_arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to, size_t count) {
+static void pd_arrayof_conjoint_jlongs(HeapWord* from,
+                                       HeapWord* to,
+                                       size_t    count) {
   _Copy_arrayof_conjoint_jlongs(from, to, count);
 }
 
-static void pd_arrayof_conjoint_oops(HeapWord* from, HeapWord* to, size_t count) {
+static void pd_arrayof_conjoint_oops(HeapWord* from,
+                                     HeapWord* to,
+                                     size_t    count) {
 #ifdef _LP64
   assert(BytesPerLong == BytesPerOop, "jlongs and oops must be the same size");
   _Copy_arrayof_conjoint_jlongs(from, to, count);
@@ -149,12 +159,14 @@
   }
 }
 
-static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) {
+static void pd_fill_to_aligned_words(HeapWord* tohw,
+                                     size_t    count,
+                                     juint     value) {
   pd_fill_to_words(tohw, count, value);
 }
 
 static void pd_fill_to_bytes(void* to, size_t count, jubyte value) {
-  (void)memset(to, value, count);
+  memset(to, value, count);
 }
 
 static void pd_zero_to_words(HeapWord* tohw, size_t count) {
@@ -162,5 +174,5 @@
 }
 
 static void pd_zero_to_bytes(void* to, size_t count) {
-  (void)memset(to, 0, count);
+  memset(to, 0, count);
 }
--- a/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008 Red Hat, Inc.
+ * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -24,14 +24,12 @@
  */
 
  protected:
-  MacroAssembler* assembler() const
-  {
+  MacroAssembler* assembler() const {
     return _masm;
   }
 
  protected:
-  address generate_entry(ZeroEntry::method_entry_t entry_point)
-  {
+  address generate_entry(address entry_point) {
     ZeroEntry *entry = (ZeroEntry *) assembler()->pc();
     assembler()->advance(sizeof(ZeroEntry));
     entry->set_entry_point(entry_point);
--- a/src/cpu/zero/vm/cppInterpreter_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -37,8 +37,7 @@
   thread->reset_last_Java_frame();              \
   fixup_after_potential_safepoint()
 
-void CppInterpreter::normal_entry(methodOop method, intptr_t UNUSED, TRAPS)
-{
+void CppInterpreter::normal_entry(methodOop method, intptr_t UNUSED, TRAPS) {
   JavaThread *thread = (JavaThread *) THREAD;
   ZeroStack *stack = thread->zero_stack();
 
@@ -61,8 +60,7 @@
   main_loop(0, THREAD);
 }
 
-void CppInterpreter::main_loop(int recurse, TRAPS)
-{
+void CppInterpreter::main_loop(int recurse, TRAPS) {
   JavaThread *thread = (JavaThread *) THREAD;
   ZeroStack *stack = thread->zero_stack();
 
@@ -107,7 +105,7 @@
 
       // Trim back the stack to put the parameters at the top
       stack->set_sp(istate->stack() + 1);
-    
+
       // Make the call
       Interpreter::invoke_method(callee, istate->callee_entry_point(), THREAD);
       fixup_after_potential_safepoint();
@@ -116,7 +114,7 @@
       istate->set_stack(stack->sp() - 1);
 
       // Restore the stack
-      stack->set_sp(istate->stack_limit() + 1);    
+      stack->set_sp(istate->stack_limit() + 1);
 
       // Resume the interpreter
       istate->set_msg(BytecodeInterpreter::method_resume);
@@ -156,6 +154,19 @@
       assert(HAS_PENDING_EXCEPTION, "should do");
       break;
     }
+    else if (istate->msg() == BytecodeInterpreter::do_osr) {
+      // Unwind the current frame
+      thread->pop_zero_frame();
+
+      // Remove any extension of the previous frame
+      int extra_locals = method->max_locals() - method->size_of_parameters();
+      stack->set_sp(stack->sp() + extra_locals);
+
+      // Jump into the OSR method
+      Interpreter::invoke_osr(
+        method, istate->osr_entry(), istate->osr_buf(), THREAD);
+      return;
+    }
     else {
       ShouldNotReachHere();
     }
@@ -174,8 +185,7 @@
     stack->push(result[-i]);
 }
 
-void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS)
-{
+void CppInterpreter::native_entry(methodOop method, intptr_t UNUSED, TRAPS) {
   // Make sure method is native and not abstract
   assert(method->is_native() && !method->is_abstract(), "should be");
 
@@ -216,8 +226,7 @@
   }
 
   // Get the signature handler
-  InterpreterRuntime::SignatureHandler *handler;
-  {
+  InterpreterRuntime::SignatureHandler *handler; {
     address handlerAddr = method->signature_handler();
     if (handlerAddr == NULL) {
       CALL_VM_NOCHECK(InterpreterRuntime::prepare_native_call(thread, method));
@@ -247,22 +256,21 @@
     Unimplemented();
   }
   void **arguments;
-  {
+  void *mirror; {
     arguments =
       (void **) stack->alloc(handler->argument_count() * sizeof(void **));
     void **dst = arguments;
-  
+
     void *env = thread->jni_environment();
     *(dst++) = &env;
-  
-    void *mirror = NULL;
+
     if (method->is_static()) {
       istate->set_oop_temp(
         method->constants()->pool_holder()->klass_part()->java_mirror());
       mirror = istate->oop_temp_addr();
       *(dst++) = &mirror;
     }
-  
+
     intptr_t *src = locals;
     for (int i = dst - arguments; i < handler->argument_count(); i++) {
       ffi_type *type = handler->argument_type(i);
@@ -289,7 +297,7 @@
     }
   }
 
-  // Set up the Java frame anchor  
+  // Set up the Java frame anchor
   thread->set_last_Java_frame();
 
   // Change the thread state to _thread_in_native
@@ -342,7 +350,7 @@
 
   // Reset handle block
   thread->active_handles()->clear();
-  
+
   // Unlock if necessary.  It seems totally wrong that this
   // is skipped in the event of an exception but apparently
   // the template interpreter does this so we do too.
@@ -354,8 +362,7 @@
 
     if (header != NULL) {
       if (Atomic::cmpxchg_ptr(header, rcvr->mark_addr(), lock) != lock) {
-        monitor->set_obj(rcvr);
-        {
+        monitor->set_obj(rcvr); {
           HandleMark hm(thread);
           CALL_VM_NOCHECK(InterpreterRuntime::monitorexit(thread, monitor));
         }
@@ -417,7 +424,7 @@
     case T_LONG:
       SET_LOCALS_LONG(*(jlong *) result, 0);
       break;
-      
+
     case T_FLOAT:
       SET_LOCALS_FLOAT(*(jfloat *) result, 0);
       break;
@@ -437,8 +444,7 @@
   }
 }
 
-void CppInterpreter::accessor_entry(methodOop method, intptr_t UNUSED, TRAPS)
-{
+void CppInterpreter::accessor_entry(methodOop method, intptr_t UNUSED, TRAPS) {
   JavaThread *thread = (JavaThread *) THREAD;
   ZeroStack *stack = thread->zero_stack();
   intptr_t *locals = stack->sp();
@@ -510,8 +516,8 @@
 
     case ltos:
       SET_LOCALS_LONG(object->long_field_acquire(entry->f2()), 0);
-      break;      
-      
+      break;
+
     case ftos:
       SET_LOCALS_FLOAT(object->float_field_acquire(entry->f2()), 0);
       break;
@@ -548,8 +554,8 @@
 
     case ltos:
       SET_LOCALS_LONG(object->long_field(entry->f2()), 0);
-      break;      
-      
+      break;
+
     case ftos:
       SET_LOCALS_FLOAT(object->float_field(entry->f2()), 0);
       break;
@@ -568,8 +574,7 @@
   }
 }
 
-void CppInterpreter::empty_entry(methodOop method, intptr_t UNUSED, TRAPS)
-{
+void CppInterpreter::empty_entry(methodOop method, intptr_t UNUSED, TRAPS) {
   JavaThread *thread = (JavaThread *) THREAD;
   ZeroStack *stack = thread->zero_stack();
 
@@ -583,8 +588,7 @@
   stack->set_sp(stack->sp() + method->size_of_parameters());
 }
 
-bool CppInterpreter::stack_overflow_imminent(JavaThread *thread)
-{
+bool CppInterpreter::stack_overflow_imminent(JavaThread *thread) {
   // How is the ABI stack?
   address stack_top = thread->stack_base() - thread->stack_size();
   int free_stack = os::current_stack_pointer() - stack_top;
@@ -603,14 +607,13 @@
   if (free_stack < StackShadowPages * os::vm_page_size()) {
     return true;
   }
-  
+
   return false;
 }
 
 InterpreterFrame *InterpreterFrame::build(ZeroStack*       stack,
                                           const methodOop  method,
-                                          JavaThread*      thread)
-{
+                                          JavaThread*      thread) {
   int monitor_words =
     method->is_synchronized() ? frame::interpreter_frame_monitor_size() : 0;
   int stack_words = method->is_native() ? 0 : method->max_stack();
@@ -669,8 +672,7 @@
   return (InterpreterFrame *) fp;
 }
 
-int AbstractInterpreter::BasicType_as_index(BasicType type)
-{
+int AbstractInterpreter::BasicType_as_index(BasicType type) {
   int i = 0;
   switch (type) {
     case T_BOOLEAN: i = 0; break;
@@ -691,39 +693,34 @@
   return i;
 }
 
-address InterpreterGenerator::generate_empty_entry()
-{
+address InterpreterGenerator::generate_empty_entry() {
   if (!UseFastEmptyMethods)
     return NULL;
 
-  return generate_entry(CppInterpreter::empty_entry);
+  return generate_entry((address) CppInterpreter::empty_entry);
 }
 
-address InterpreterGenerator::generate_accessor_entry()
-{
+address InterpreterGenerator::generate_accessor_entry() {
   if (!UseFastAccessorMethods)
     return NULL;
 
-  return generate_entry(CppInterpreter::accessor_entry);
+  return generate_entry((address) CppInterpreter::accessor_entry);
 }
 
-address InterpreterGenerator::generate_native_entry(bool synchronized)
-{
-  assert (synchronized == false, "should be");
+address InterpreterGenerator::generate_native_entry(bool synchronized) {
+  assert(synchronized == false, "should be");
 
-  return generate_entry(CppInterpreter::native_entry);
+  return generate_entry((address) CppInterpreter::native_entry);
 }
 
-address InterpreterGenerator::generate_normal_entry(bool synchronized)
-{
-  assert (synchronized == false, "should be");
+address InterpreterGenerator::generate_normal_entry(bool synchronized) {
+  assert(synchronized == false, "should be");
 
-  return generate_entry(CppInterpreter::normal_entry);
+  return generate_entry((address) CppInterpreter::normal_entry);
 }
 
 address AbstractInterpreterGenerator::generate_method_entry(
     AbstractInterpreter::MethodKind kind) {
-
   address entry_point = NULL;
 
   switch (kind) {
@@ -732,27 +729,27 @@
     break;
 
   case Interpreter::native:
-    entry_point = ((InterpreterGenerator*)this)->generate_native_entry(false);
+    entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false);
     break;
 
   case Interpreter::native_synchronized:
-    entry_point = ((InterpreterGenerator*)this)->generate_native_entry(false);
+    entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false);
     break;
 
   case Interpreter::empty:
-    entry_point = ((InterpreterGenerator*)this)->generate_empty_entry();
+    entry_point = ((InterpreterGenerator*) this)->generate_empty_entry();
     break;
 
   case Interpreter::accessor:
-    entry_point = ((InterpreterGenerator*)this)->generate_accessor_entry();
+    entry_point = ((InterpreterGenerator*) this)->generate_accessor_entry();
     break;
 
   case Interpreter::abstract:
-    entry_point = ((InterpreterGenerator*)this)->generate_abstract_entry();
+    entry_point = ((InterpreterGenerator*) this)->generate_abstract_entry();
     break;
 
   case Interpreter::method_handle:
-    entry_point = ((InterpreterGenerator*)this)->generate_method_handle_entry();
+    entry_point = ((InterpreterGenerator*) this)->generate_method_handle_entry();
     break;
 
   case Interpreter::java_lang_math_sin:
@@ -762,7 +759,7 @@
   case Interpreter::java_lang_math_log:
   case Interpreter::java_lang_math_log10:
   case Interpreter::java_lang_math_sqrt:
-    entry_point = ((InterpreterGenerator*)this)->generate_math_entry(kind);
+    entry_point = ((InterpreterGenerator*) this)->generate_math_entry(kind);
     break;
 
   default:
@@ -770,7 +767,7 @@
   }
 
   if (entry_point == NULL)
-    entry_point = ((InterpreterGenerator*)this)->generate_normal_entry(false);
+    entry_point = ((InterpreterGenerator*) this)->generate_normal_entry(false);
 
   return entry_point;
 }
@@ -782,8 +779,7 @@
 
 // Deoptimization helpers
 
-InterpreterFrame *InterpreterFrame::build(ZeroStack* stack, int size)
-{
+InterpreterFrame *InterpreterFrame::build(ZeroStack* stack, int size) {
   int size_in_words = size >> LogBytesPerWord;
   assert(size_in_words * wordSize == size, "unaligned");
   assert(size_in_words >= header_words, "too small");
@@ -817,8 +813,7 @@
                                            int       callee_locals,
                                            frame*    caller,
                                            frame*    interpreter_frame,
-                                           bool      is_top_frame)
-{
+                                           bool      is_top_frame) {
   assert(popframe_extra_args == 0, "what to do?");
   assert(!is_top_frame || (!callee_locals && !callee_param_count),
          "top frame should have no caller")
@@ -848,14 +843,14 @@
     intptr_t *stack_base    = monitor_base - monitor_words;
     intptr_t *stack         = stack_base - tempcount - 1;
 
-    BytecodeInterpreter::layout_interpreterState(istate, 
+    BytecodeInterpreter::layout_interpreterState(istate,
                                                  caller,
                                                  NULL,
-                                                 method, 
-                                                 locals, 
-                                                 stack, 
-                                                 stack_base, 
-                                                 monitor_base, 
+                                                 method,
+                                                 locals,
+                                                 stack,
+                                                 stack_base,
+                                                 monitor_base,
                                                  NULL,
                                                  is_top_frame);
   }
@@ -871,8 +866,7 @@
                                                   intptr_t* stack_base,
                                                   intptr_t* monitor_base,
                                                   intptr_t* frame_bottom,
-                                                  bool      is_top_frame)
-{
+                                                  bool      is_top_frame) {
   istate->set_locals(locals);
   istate->set_method(method);
   istate->set_self_link(istate);
@@ -899,32 +893,28 @@
   istate->set_stack_limit(stack_base - method->max_stack() - 1);
 }
 
-address CppInterpreter::return_entry(TosState state, int length)
-{
-  Unimplemented();
+address CppInterpreter::return_entry(TosState state, int length) {
+  ShouldNotCallThis();
 }
 
-address CppInterpreter::deopt_entry(TosState state, int length)
-{
+address CppInterpreter::deopt_entry(TosState state, int length) {
   return NULL;
 }
 
 // Helper for (runtime) stack overflow checks
 
-int AbstractInterpreter::size_top_interpreter_activation(methodOop method)
-{
+int AbstractInterpreter::size_top_interpreter_activation(methodOop method) {
   return 0;
 }
 
 // Helper for figuring out if frames are interpreter frames
 
-bool CppInterpreter::contains(address pc)
-{
+bool CppInterpreter::contains(address pc) {
 #ifdef PRODUCT
   ShouldNotCallThis();
 #else
   return false; // make frame::print_value_on work
-#endif // !PRODUCT  
+#endif // !PRODUCT
 }
 
 // Result handlers and convertors
@@ -932,25 +922,25 @@
 address CppInterpreterGenerator::generate_result_handler_for(
     BasicType type) {
   assembler()->advance(1);
-  return ShouldNotReachHereStub();
+  return ShouldNotCallThisStub();
 }
 
 address CppInterpreterGenerator::generate_tosca_to_stack_converter(
     BasicType type) {
   assembler()->advance(1);
-  return ShouldNotReachHereStub();
+  return ShouldNotCallThisStub();
 }
 
 address CppInterpreterGenerator::generate_stack_to_stack_converter(
     BasicType type) {
   assembler()->advance(1);
-  return ShouldNotReachHereStub();
+  return ShouldNotCallThisStub();
 }
 
 address CppInterpreterGenerator::generate_stack_to_native_abi_converter(
     BasicType type) {
   assembler()->advance(1);
-  return ShouldNotReachHereStub();
+  return ShouldNotCallThisStub();
 }
 
 #endif // CC_INTERP
--- a/src/cpu/zero/vm/cppInterpreter_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/cppInterpreter_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -23,7 +23,6 @@
  *
  */
 
-
  protected:
   // Size of interpreter code
   const static int InterpreterCodeSize = 6 * K;
--- a/src/cpu/zero/vm/debug_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/debug_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,7 +26,6 @@
 #include "incls/_precompiled.incl"
 #include "incls/_debug_zero.cpp.incl"
 
-void pd_ps(frame f)
-{
-  Unimplemented();
+void pd_ps(frame f) {
+  ShouldNotCallThis();
 }
--- a/src/cpu/zero/vm/deoptimizerFrame_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/deoptimizerFrame_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -31,11 +31,8 @@
 // |  ...               |
 
 class DeoptimizerFrame : public ZeroFrame {
-  friend class ZeroStackPrinter;
-
  private:
-  DeoptimizerFrame() : ZeroFrame()
-  {
+  DeoptimizerFrame() : ZeroFrame() {
     ShouldNotCallThis();
   }
 
@@ -46,4 +43,11 @@
 
  public:
   static DeoptimizerFrame *build(ZeroStack* stack);
+
+ public:
+  void identify_word(int   frame_index,
+                     int   offset,
+                     char* fieldbuf,
+                     char* valuebuf,
+                     int   buflen) const;
 };
--- a/src/cpu/zero/vm/depChecker_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/depChecker_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/depChecker_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/depChecker_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/disassembler_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/disassembler_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -27,9 +27,9 @@
 // with Java specific information.
 
   static int pd_instruction_alignment() {
-    Unimplemented();
+    ShouldNotCallThis();
   }
 
   static const char* pd_cpu_opts() {
-    Unimplemented();
+    ShouldNotCallThis();
   }
--- a/src/cpu/zero/vm/dump_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/dump_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -29,9 +29,8 @@
 void CompactingPermGenGen::generate_vtable_methods(void** vtbl_list,
                                                    void** vtable,
                                                    char** md_top,
-                                                   char* md_end,
+                                                   char*  md_end,
                                                    char** mc_top,
-                                                   char* mc_end)
-{
-  Unimplemented();
+                                                   char*  mc_end) {
+  ShouldNotCallThis();
 }
--- a/src/cpu/zero/vm/entryFrame_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/entryFrame_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -35,11 +35,8 @@
 // |  ...               |
 
 class EntryFrame : public ZeroFrame {
-  friend class ZeroStackPrinter;
-
  private:
-  EntryFrame() : ZeroFrame()
-  {
+  EntryFrame() : ZeroFrame() {
     ShouldNotCallThis();
   }
 
@@ -55,8 +52,14 @@
                            int              parameter_words,
                            JavaCallWrapper* call_wrapper);
  public:
-  JavaCallWrapper *call_wrapper() const
-  {
+  JavaCallWrapper *call_wrapper() const {
     return (JavaCallWrapper *) value_of_word(call_wrapper_off);
   }
+
+ public:
+  void identify_word(int   frame_index,
+                     int   offset,
+                     char* fieldbuf,
+                     char* valuebuf,
+                     int   buflen) const;
 };
--- a/src/cpu/zero/vm/entry_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/entry_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008 Red Hat, Inc.
+ * Copyright 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,36 +25,40 @@
 
 class ZeroEntry {
  public:
-  ZeroEntry()
-  {
+  ZeroEntry() {
     ShouldNotCallThis();
   }
 
- public:
-  typedef void (*method_entry_t)(methodOop method, intptr_t base_pc, TRAPS);
-
  private:
-  method_entry_t _entry_point;
+  address _entry_point;
 
  public:
-  method_entry_t entry_point() const
-  {
+  address entry_point() const {
     return _entry_point;
   }
-  void set_entry_point(method_entry_t entry_point)
-  {
+  void set_entry_point(address entry_point) {
     _entry_point = entry_point;
   }
 
+ private:
+  typedef void (*NormalEntryFunc)(methodOop method,
+                                  intptr_t  base_pc,
+                                  TRAPS);
+  typedef void (*OSREntryFunc)(methodOop method,
+                               address   osr_buf,
+                               intptr_t  base_pc,
+                               TRAPS);
+
  public:
-  void invoke(methodOop method, TRAPS) const
-  {
-    entry_point()(method, (intptr_t) this, THREAD);
+  void invoke(methodOop method, TRAPS) const {
+    ((NormalEntryFunc) entry_point())(method, (intptr_t) this, THREAD);
+  }
+  void invoke_osr(methodOop method, address osr_buf, TRAPS) const {
+    ((OSREntryFunc) entry_point())(method, osr_buf, (intptr_t) this, THREAD);
   }
 
  public:
-  static ByteSize entry_point_offset()
-  {
+  static ByteSize entry_point_offset() {
     return byte_offset_of(ZeroEntry, _entry_point);
   }
 };
--- a/src/cpu/zero/vm/frame_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/frame_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2007, 2008 Red Hat, Inc.
+ * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -27,50 +27,42 @@
 #include "incls/_frame_zero.cpp.incl"
 
 #ifdef ASSERT
-void RegisterMap::check_location_valid()
-{
-  Unimplemented();
+void RegisterMap::check_location_valid() {
+  ShouldNotCallThis();
 }
 #endif
 
-bool frame::is_interpreted_frame() const
-{
+bool frame::is_interpreted_frame() const {
   return zeroframe()->is_interpreter_frame();
 }
 
-bool frame::is_deoptimizer_frame() const
-{
+bool frame::is_deoptimizer_frame() const {
   return zeroframe()->is_deoptimizer_frame();
 }
 
-frame frame::sender_for_entry_frame(RegisterMap *map) const
-{
+frame frame::sender_for_entry_frame(RegisterMap *map) const {
   assert(map != NULL, "map must be set");
   assert(!entry_frame_is_first(), "next Java fp must be non zero");
   assert(entry_frame_call_wrapper()->anchor()->last_Java_sp() == sender_sp(),
          "sender should be next Java frame");
   map->clear();
   assert(map->include_argument_oops(), "should be set by clear");
-  return frame(sender_sp());
+  return frame(sender_sp(), sp() + 1);
 }
 
-frame frame::sender_for_interpreter_frame(RegisterMap *map) const
-{
-  return frame(sender_sp());
+frame frame::sender_for_interpreter_frame(RegisterMap *map) const {
+  return frame(sender_sp(), sp() + 1);
 }
 
-frame frame::sender_for_compiled_frame(RegisterMap *map) const
-{
-  return frame(sender_sp());
+frame frame::sender_for_compiled_frame(RegisterMap *map) const {
+  return frame(sender_sp(), sp() + 1);
 }
 
-frame frame::sender_for_deoptimizer_frame(RegisterMap *map) const
-{
-  return frame(sender_sp());
+frame frame::sender_for_deoptimizer_frame(RegisterMap *map) const {
+  return frame(sender_sp(), sp() + 1);
 }
 
-frame frame::sender(RegisterMap* map) const
-{
+frame frame::sender(RegisterMap* map) const {
   // Default is not to follow arguments; the various
   // sender_for_xxx methods update this accordingly.
   map->set_include_argument_oops(false);
@@ -89,46 +81,39 @@
   if (is_deoptimizer_frame())
     return sender_for_deoptimizer_frame(map);
 
-  Unimplemented();
+  ShouldNotReachHere();
 }
 
 #ifdef CC_INTERP
-BasicObjectLock* frame::interpreter_frame_monitor_begin() const
-{
+BasicObjectLock* frame::interpreter_frame_monitor_begin() const {
   return get_interpreterState()->monitor_base();
 }
 
-BasicObjectLock* frame::interpreter_frame_monitor_end() const
-{
+BasicObjectLock* frame::interpreter_frame_monitor_end() const {
   return (BasicObjectLock*) get_interpreterState()->stack_base();
 }
 #endif // CC_INTERP
 
-void frame::patch_pc(Thread* thread, address pc)
-{
+void frame::patch_pc(Thread* thread, address pc) {
   // We borrow this call to set the thread pointer in the interpreter
   // state; the hook to set up deoptimized frames isn't supplied it.
   assert(pc == NULL, "should be");
   get_interpreterState()->set_thread((JavaThread *) thread);
 }
 
-bool frame::safe_for_sender(JavaThread *thread)
-{
-  Unimplemented();
+bool frame::safe_for_sender(JavaThread *thread) {
+  ShouldNotCallThis();
 }
 
-void frame::pd_gc_epilog()
-{
+void frame::pd_gc_epilog() {
 }
 
-bool frame::is_interpreted_frame_valid(JavaThread *thread) const
-{
-  Unimplemented();
+bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
+  ShouldNotCallThis();
 }
 
 BasicType frame::interpreter_frame_result(oop* oop_result,
-                                          jvalue* value_result)
-{
+                                          jvalue* value_result) {
   assert(is_interpreted_frame(), "interpreted frame expected");
   methodOop method = interpreter_frame_method();
   BasicType type = method->result_type();
@@ -163,7 +148,7 @@
     value_result->d = *(jdouble *) tos_addr;
     break;
 
-  case T_OBJECT: 
+  case T_OBJECT:
   case T_ARRAY:
     if (method->is_native()) {
       obj = get_interpreterState()->oop_temp();
@@ -183,8 +168,7 @@
   return type;
 }
 
-int frame::frame_size(RegisterMap* map) const
-{
+int frame::frame_size(RegisterMap* map) const {
 #ifdef PRODUCT
   ShouldNotCallThis();
 #else
@@ -192,8 +176,249 @@
 #endif // PRODUCT
 }
 
-intptr_t* frame::interpreter_frame_tos_at(jint offset) const
-{
+intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
   int index = (Interpreter::expr_offset_in_bytes(offset) / wordSize);
   return &interpreter_frame_tos_address()[index];
 }
+
+void frame::zero_print_on_error(int           frame_index,
+                                outputStream* st,
+                                char*         buf,
+                                int           buflen) const {
+  // Divide the buffer between the field and the value
+  buflen >>= 1;
+  char *fieldbuf = buf;
+  char *valuebuf = buf + buflen;
+
+  // Print each word of the frame
+  for (intptr_t *addr = fp(); addr <= sp(); addr++) {
+    int offset = sp() - addr;
+
+    // Fill in default values, then try and improve them
+    snprintf(fieldbuf, buflen, "word[%d]", offset);
+    snprintf(valuebuf, buflen, PTR_FORMAT, *addr);
+    zeroframe()->identify_word(frame_index, offset, fieldbuf, valuebuf, buflen);
+    fieldbuf[buflen - 1] = '\0';
+    valuebuf[buflen - 1] = '\0';
+
+    // Print the result
+    st->print_cr(" " PTR_FORMAT ": %-21s = %s", addr, fieldbuf, valuebuf);
+  }
+}
+
+void ZeroFrame::identify_word(int   frame_index,
+                              int   offset,
+                              char* fieldbuf,
+                              char* valuebuf,
+                              int   buflen) const {
+  switch (offset) {
+  case next_frame_off:
+    strncpy(fieldbuf, "next_frame", buflen);
+    break;
+
+  case frame_type_off:
+    strncpy(fieldbuf, "frame_type", buflen);
+    if (is_entry_frame())
+      strncpy(valuebuf, "ENTRY_FRAME", buflen);
+    else if (is_interpreter_frame())
+      strncpy(valuebuf, "INTERPRETER_FRAME", buflen);
+    else if (is_shark_frame())
+      strncpy(valuebuf, "SHARK_FRAME", buflen);
+    else if (is_deoptimizer_frame())
+      strncpy(valuebuf, "DEOPTIMIZER_FRAME", buflen);
+    break;
+
+  default:
+    if (is_entry_frame()) {
+      as_entry_frame()->identify_word(
+        frame_index, offset, fieldbuf, valuebuf, buflen);
+    }
+    else if (is_interpreter_frame()) {
+      as_interpreter_frame()->identify_word(
+        frame_index, offset, fieldbuf, valuebuf, buflen);
+    }
+    else if (is_shark_frame()) {
+      as_shark_frame()->identify_word(
+        frame_index, offset, fieldbuf, valuebuf, buflen);
+    }
+    else if (is_deoptimizer_frame()) {
+      as_deoptimizer_frame()->identify_word(
+        frame_index, offset, fieldbuf, valuebuf, buflen);
+    }
+  }
+}
+
+void EntryFrame::identify_word(int   frame_index,
+                               int   offset,
+                               char* fieldbuf,
+                               char* valuebuf,
+                               int   buflen) const {
+  switch (offset) {
+  case call_wrapper_off:
+    strncpy(fieldbuf, "call_wrapper", buflen);
+    break;
+
+  default:
+    snprintf(fieldbuf, buflen, "local[%d]", offset - 3);
+  }
+}
+
+void InterpreterFrame::identify_word(int   frame_index,
+                                     int   offset,
+                                     char* fieldbuf,
+                                     char* valuebuf,
+                                     int   buflen) const {
+  interpreterState istate = interpreter_state();
+  bool is_valid = istate->self_link() == istate;
+  intptr_t *addr = addr_of_word(offset);
+
+  // Fixed part
+  if (addr >= (intptr_t *) istate) {
+    const char *field = istate->name_of_field_at_address((address) addr);
+    if (field) {
+      if (is_valid && !strcmp(field, "_method")) {
+        istate->method()->name_and_sig_as_C_string(valuebuf, buflen);
+      }
+      else if (is_valid && !strcmp(field, "_bcp") && istate->bcp()) {
+        snprintf(valuebuf, buflen, PTR_FORMAT " (bci %d)",
+                 (intptr_t) istate->bcp(),
+                 istate->method()->bci_from(istate->bcp()));
+      }
+      snprintf(fieldbuf, buflen, "%sistate->%s",
+               field[strlen(field) - 1] == ')' ? "(": "", field);
+    }
+    else if (addr == (intptr_t *) istate) {
+      strncpy(fieldbuf, "(vtable for istate)", buflen);
+    }
+    return;
+  }
+
+  // Variable part
+  if (!is_valid)
+    return;
+
+  // JNI stuff
+  if (istate->method()->is_native() && addr < istate->stack_base()) {
+    address hA = istate->method()->signature_handler();
+    if (hA != NULL) {
+      if (hA != (address) InterpreterRuntime::slow_signature_handler) {
+        InterpreterRuntime::SignatureHandler *handler =
+          InterpreterRuntime::SignatureHandler::from_handlerAddr(hA);
+
+        intptr_t *params = istate->stack_base() - handler->argument_count();
+        if (addr >= params) {
+          int param = addr - params;
+          const char *desc = "";
+          if (param == 0)
+            desc = " (JNIEnv)";
+          else if (param == 1) {
+            if (istate->method()->is_static())
+              desc = " (mirror)";
+            else
+              desc = " (this)";
+          }
+          snprintf(fieldbuf, buflen, "parameter[%d]%s", param, desc);
+          return;
+        }
+
+        for (int i = 0; i < handler->argument_count(); i++) {
+          if (params[i] == (intptr_t) addr) {
+            snprintf(fieldbuf, buflen, "unboxed parameter[%d]", i);
+            return;
+          }
+        }
+      }
+    }
+    return;
+  }
+
+  // Monitors and stack
+  identify_vp_word(frame_index, addr,
+                   (intptr_t *) istate->monitor_base(),
+                   istate->stack_base(),
+                   fieldbuf, buflen);
+}
+
+void SharkFrame::identify_word(int   frame_index,
+                               int   offset,
+                               char* fieldbuf,
+                               char* valuebuf,
+                               int   buflen) const {
+  // Fixed part
+  switch (offset) {
+  case pc_off:
+    strncpy(fieldbuf, "pc", buflen);
+    if (method()->is_oop()) {
+      nmethod *code = method()->code();
+      if (code && code->pc_desc_at(pc())) {
+        SimpleScopeDesc ssd(code, pc());
+        snprintf(valuebuf, buflen, PTR_FORMAT " (bci %d)",
+                 (intptr_t) pc(), ssd.bci());
+      }
+    }
+    return;
+
+  case unextended_sp_off:
+    strncpy(fieldbuf, "unextended_sp", buflen);
+    return;
+
+  case method_off:
+    strncpy(fieldbuf, "method", buflen);
+    if (method()->is_oop()) {
+      method()->name_and_sig_as_C_string(valuebuf, buflen);
+    }
+    return;
+
+  case oop_tmp_off:
+    strncpy(fieldbuf, "oop_tmp", buflen);
+    return;
+  }
+
+  // Variable part
+  if (method()->is_oop()) {
+    identify_vp_word(frame_index, addr_of_word(offset),
+                     addr_of_word(header_words + 1),
+                     unextended_sp() + method()->max_stack(),
+                     fieldbuf, buflen);
+  }
+}
+
+void ZeroFrame::identify_vp_word(int       frame_index,
+                                 intptr_t* addr,
+                                 intptr_t* monitor_base,
+                                 intptr_t* stack_base,
+                                 char*     fieldbuf,
+                                 int       buflen) const {
+  // Monitors
+  if (addr >= stack_base && addr < monitor_base) {
+    int monitor_size = frame::interpreter_frame_monitor_size();
+    int last_index = (monitor_base - stack_base) / monitor_size - 1;
+    int index = last_index - (addr - stack_base) / monitor_size;
+    intptr_t monitor = (intptr_t) (
+      (BasicObjectLock *) monitor_base - 1 - index);
+    intptr_t offset = (intptr_t) addr - monitor;
+
+    if (offset == BasicObjectLock::obj_offset_in_bytes())
+      snprintf(fieldbuf, buflen, "monitor[%d]->_obj", index);
+    else if (offset ==  BasicObjectLock::lock_offset_in_bytes())
+      snprintf(fieldbuf, buflen, "monitor[%d]->_lock", index);
+
+    return;
+  }
+
+  // Expression stack
+  if (addr < stack_base) {
+    snprintf(fieldbuf, buflen, "%s[%d]",
+             frame_index == 0 ? "stack_word" : "local",
+             (int) (stack_base - addr - 1));
+    return;
+  }
+}
+
+void DeoptimizerFrame::identify_word(int   frame_index,
+                                     int   offset,
+                                     char* fieldbuf,
+                                     char* valuebuf,
+                                     int   buflen) const {
+  // Deoptimizer frames have no extra words to identify
+}
--- a/src/cpu/zero/vm/frame_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/frame_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -23,25 +23,26 @@
  *
  */
 
-  // A frame represents a physical stack frame (an activation).  Frames
-  // can be C or Java frames, and the Java frames can be interpreted or
-  // compiled.  In contrast, vframes represent source-level activations,
-  // so that one physical frame can correspond to multiple source level
-  // frames because of inlining.  A frame is comprised of {pc, sp}
+// A frame represents a physical stack frame on the Zero stack.
 
  public:
   enum {
     pc_return_offset = 0
   };
 
+  // Constructor
  public:
-  // Constructors
-  frame(intptr_t* sp);
+  frame(intptr_t* sp, intptr_t* fp);
 
-  // accessors for the instance variables
-  intptr_t* fp() const
-  {
-    return (intptr_t *) -1;
+  // The sp of a Zero frame is the address of the highest word in
+  // that frame.  We keep track of the lowest address too, so the
+  // boundaries of the frame are available for debug printing.
+ private:
+  intptr_t* _fp;
+
+ public:
+  intptr_t* fp() const {
+    return _fp;
   }
 
 #ifdef CC_INTERP
@@ -49,21 +50,17 @@
 #endif // CC_INTERP
 
  public:
-  const ZeroFrame *zeroframe() const
-  {
+  const ZeroFrame *zeroframe() const {
     return (ZeroFrame *) sp();
   }
 
-  const EntryFrame *zero_entryframe() const
-  {
+  const EntryFrame *zero_entryframe() const {
     return zeroframe()->as_entry_frame();
   }
-  const InterpreterFrame *zero_interpreterframe() const
-  {
+  const InterpreterFrame *zero_interpreterframe() const {
     return zeroframe()->as_interpreter_frame();
   }
-  const SharkFrame *zero_sharkframe() const
-  {
+  const SharkFrame *zero_sharkframe() const {
     return zeroframe()->as_shark_frame();
   }
 
@@ -71,4 +68,10 @@
   bool is_deoptimizer_frame() const;
 
  public:
-  frame sender_for_deoptimizer_frame(RegisterMap* map) const;  
+  frame sender_for_deoptimizer_frame(RegisterMap* map) const;
+
+ public:
+  void zero_print_on_error(int           index,
+                           outputStream* st,
+                           char*         buf,
+                           int           buflen) const;
--- a/src/cpu/zero/vm/frame_zero.inline.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/frame_zero.inline.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2007, 2008 Red Hat, Inc.
+ * Copyright 2007, 2008, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,24 +23,19 @@
  *
  */
 
-#include <entryFrame_zero.hpp>
-#include <interpreterFrame_zero.hpp>
-#include <sharkFrame_zero.hpp>
-#include <deoptimizerFrame_zero.hpp>
-
 // Constructors
 
-inline frame::frame()
-{
+inline frame::frame() {
   _sp = NULL;
+  _fp = NULL;
   _pc = NULL;
   _cb = NULL;
   _deopt_state = unknown;
 }
 
-inline frame::frame(intptr_t* sp)
-{
+inline frame::frame(intptr_t* sp, intptr_t* fp) {
   _sp = sp;
+  _fp = fp;
   switch (zeroframe()->type()) {
   case ZeroFrame::ENTRY_FRAME:
     _pc = StubRoutines::call_stub_return_pc();
@@ -54,7 +49,7 @@
 
   case ZeroFrame::SHARK_FRAME:
     _pc = zero_sharkframe()->pc();
-    _cb = CodeCache::find_blob(pc());
+    _cb = CodeCache::find_blob_unsafe(pc());
     break;
 
   case ZeroFrame::DEOPTIMIZER_FRAME:
@@ -70,104 +65,85 @@
 
 // Accessors
 
-inline intptr_t* frame::sender_sp() const
-{
+inline intptr_t* frame::sender_sp() const {
   return (intptr_t *) zeroframe()->next();
 }
 
-inline intptr_t* frame::link() const
-{
-  Unimplemented();
+inline intptr_t* frame::link() const {
+  ShouldNotCallThis();
 }
 
 #ifdef CC_INTERP
-inline interpreterState frame::get_interpreterState() const
-{
+inline interpreterState frame::get_interpreterState() const {
   return zero_interpreterframe()->interpreter_state();
 }
 
-inline intptr_t** frame::interpreter_frame_locals_addr() const
-{
+inline intptr_t** frame::interpreter_frame_locals_addr() const {
   return &(get_interpreterState()->_locals);
 }
 
-inline intptr_t* frame::interpreter_frame_bcx_addr() const
-{
+inline intptr_t* frame::interpreter_frame_bcx_addr() const {
   return (intptr_t*) &(get_interpreterState()->_bcp);
 }
 
-inline constantPoolCacheOop* frame::interpreter_frame_cache_addr() const
-{
+inline constantPoolCacheOop* frame::interpreter_frame_cache_addr() const {
   return &(get_interpreterState()->_constants);
 }
 
-inline methodOop* frame::interpreter_frame_method_addr() const
-{
+inline methodOop* frame::interpreter_frame_method_addr() const {
   return &(get_interpreterState()->_method);
 }
 
-inline intptr_t* frame::interpreter_frame_mdx_addr() const
-{
+inline intptr_t* frame::interpreter_frame_mdx_addr() const {
   return (intptr_t*) &(get_interpreterState()->_mdx);
 }
 
-inline intptr_t* frame::interpreter_frame_tos_address() const
-{
+inline intptr_t* frame::interpreter_frame_tos_address() const {
   return get_interpreterState()->_stack + 1;
 }
 #endif // CC_INTERP
 
-inline int frame::interpreter_frame_monitor_size()
-{
+inline int frame::interpreter_frame_monitor_size() {
   return BasicObjectLock::size();
 }
 
-inline intptr_t* frame::interpreter_frame_expression_stack() const
-{
+inline intptr_t* frame::interpreter_frame_expression_stack() const {
   intptr_t* monitor_end = (intptr_t*) interpreter_frame_monitor_end();
   return monitor_end - 1;
 }
 
-inline jint frame::interpreter_frame_expression_stack_direction()
-{
+inline jint frame::interpreter_frame_expression_stack_direction() {
   return -1;
 }
 
 // Return a unique id for this frame. The id must have a value where
 // we can distinguish identity and younger/older relationship. NULL
 // represents an invalid (incomparable) frame.
-inline intptr_t* frame::id() const
-{
+inline intptr_t* frame::id() const {
   return sp();
 }
 
-inline JavaCallWrapper* frame::entry_frame_call_wrapper() const
-{
+inline JavaCallWrapper* frame::entry_frame_call_wrapper() const {
   return zero_entryframe()->call_wrapper();
 }
 
-inline void frame::set_saved_oop_result(RegisterMap* map, oop obj)
-{
-  Unimplemented();
+inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
+  ShouldNotCallThis();
 }
 
-inline oop frame::saved_oop_result(RegisterMap* map) const
-{
-  Unimplemented();
+inline oop frame::saved_oop_result(RegisterMap* map) const {
+  ShouldNotCallThis();
 }
 
-inline bool frame::is_older(intptr_t* id) const
-{
-  Unimplemented();
+inline bool frame::is_older(intptr_t* id) const {
+  ShouldNotCallThis();
 }
 
-inline intptr_t* frame::entry_frame_argument_at(int offset) const
-{
-  Unimplemented();
+inline intptr_t* frame::entry_frame_argument_at(int offset) const {
+  ShouldNotCallThis();
 }
 
-inline intptr_t* frame::unextended_sp() const
-{
+inline intptr_t* frame::unextended_sp() const {
   if (zeroframe()->is_shark_frame())
     return zero_sharkframe()->unextended_sp();
   else
--- a/src/cpu/zero/vm/globalDefinitions_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/globalDefinitions_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+#include <ffi.h>
--- a/src/cpu/zero/vm/icBuffer_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/icBuffer_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,8 +26,7 @@
 #include "incls/_precompiled.incl"
 #include "incls/_icBuffer_zero.cpp.incl"
 
-int InlineCacheBuffer::ic_stub_code_size()
-{
+int InlineCacheBuffer::ic_stub_code_size() {
   // NB set this once the functions below are implemented
   return 4;
 }
@@ -36,17 +35,15 @@
                                                 oop cached_oop,
                                                 address entry_point) {
   // NB ic_stub_code_size() must return the size of the code we generate
-  Unimplemented();
+  ShouldNotCallThis();
 }
 
-address InlineCacheBuffer::ic_buffer_entry_point(address code_begin)
-{
+address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) {
   // NB ic_stub_code_size() must return the size of the code we generate
-  Unimplemented();
+  ShouldNotCallThis();
 }
 
-oop InlineCacheBuffer::ic_buffer_cached_oop(address code_begin)
-{
+oop InlineCacheBuffer::ic_buffer_cached_oop(address code_begin) {
   // NB ic_stub_code_size() must return the size of the code we generate
-  Unimplemented();
+  ShouldNotCallThis();
 }
--- a/src/cpu/zero/vm/icache_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/icache_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright 2003-2005 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2007 Red Hat, Inc.
+ * Copyright 2007, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,11 +26,7 @@
 #include "incls/_precompiled.incl"
 #include "incls/_icache_zero.cpp.incl"
 
-
 void ICacheStubGenerator::generate_icache_flush(
   ICache::flush_icache_stub_t* flush_icache_stub) {
-
-  StubCodeMark mark(this, "ICache", "flush_icache_stub");
-
-  *flush_icache_stub = (ICache::flush_icache_stub_t)UnimplementedStub();
+  ShouldNotCallThis();
 }
--- a/src/cpu/zero/vm/icache_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/icache_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -1,6 +1,6 @@
 /*
  * Copyright 2003-2004 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2007 Red Hat, Inc.
+ * Copyright 2007, 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,9 +25,12 @@
 
 // Interface for updating the instruction cache.  Whenever the VM
 // modifies code, part of the processor instruction cache potentially
-// has to be flushed.
+// has to be flushed.  This implementation is empty: Zero never deals
+// with code, and LLVM handles cache flushing for Shark.
 
 class ICache : public AbstractICache {
-
-  // Use default implementation
+ public:
+  static void initialize() {}
+  static void invalidate_word(address addr) {}
+  static void invalidate_range(address start, int nbytes) {}
 };
--- a/src/cpu/zero/vm/interp_masm_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/interp_masm_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/interp_masm_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/interp_masm_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -28,7 +28,11 @@
 class InterpreterMacroAssembler : public MacroAssembler {
  public:
   InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {}
-  RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset) {
-    Unimplemented();
+
+ public:
+  RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr,
+                                        Register  tmp,
+                                        int       offset) {
+    ShouldNotCallThis();
   }
 };
--- a/src/cpu/zero/vm/interpreterFrame_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/interpreterFrame_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -39,12 +39,10 @@
 // |  ...               |
 
 class InterpreterFrame : public ZeroFrame {
-  friend class ZeroStackPrinter;
   friend class AbstractInterpreter;
 
  private:
-  InterpreterFrame() : ZeroFrame()
-  {
+  InterpreterFrame() : ZeroFrame() {
     ShouldNotCallThis();
   }
 
@@ -63,9 +61,15 @@
   static InterpreterFrame *build(ZeroStack* stack, int size);
 
  public:
-  interpreterState interpreter_state() const
-  {
+  interpreterState interpreter_state() const {
     return (interpreterState) addr_of_word(istate_off);
   }
+
+ public:
+  void identify_word(int   frame_index,
+                     int   offset,
+                     char* fieldbuf,
+                     char* valuebuf,
+                     int   buflen) const;
 };
 #endif // CC_INTERP
--- a/src/cpu/zero/vm/interpreterGenerator_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/interpreterGenerator_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -23,7 +23,6 @@
  *
  */
 
-
   // Generation of Interpreter
   //
   friend class AbstractInterpreterGenerator;
--- a/src/cpu/zero/vm/interpreterRT_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/interpreterRT_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,38 +26,32 @@
 #include "incls/_precompiled.incl"
 #include "incls/_interpreterRT_zero.cpp.incl"
 
-void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_int()
-{
+void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_int() {
   push(T_INT);
   _cif->nargs++;
 }
 
-void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_long()
-{
+void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_long() {
   push(T_LONG);
   _cif->nargs++;
 }
 
-void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_float()
-{
+void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_float() {
   push(T_FLOAT);
   _cif->nargs++;
 }
 
-void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_double()
-{
+void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_double() {
   push(T_DOUBLE);
   _cif->nargs++;
 }
 
-void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_object()
-{
+void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_object() {
   push(T_OBJECT);
   _cif->nargs++;
 }
 
-void InterpreterRuntime::SignatureHandlerGeneratorBase::push(BasicType type)
-{
+void InterpreterRuntime::SignatureHandlerGeneratorBase::push(BasicType type) {
   ffi_type *ftype;
   switch (type) {
   case T_VOID:
@@ -75,7 +69,7 @@
   case T_BYTE:
     ftype = &ffi_type_sint8;
     break;
-    
+
   case T_SHORT:
     ftype = &ffi_type_sint16;
     break;
@@ -91,7 +85,7 @@
   case T_FLOAT:
     ftype = &ffi_type_float;
     break;
-    
+
   case T_DOUBLE:
     ftype = &ffi_type_double;
     break;
@@ -125,8 +119,7 @@
   push(method()->result_type());
 }
 
-void InterpreterRuntime::SignatureHandler::finalize()
-{
+void InterpreterRuntime::SignatureHandler::finalize() {
   ffi_status status =
     ffi_prep_cif(cif(),
                  FFI_DEFAULT_ABI,
@@ -161,10 +154,9 @@
   return (address) handler;
 IRT_END
 
-void SignatureHandlerLibrary::pd_set_handler(address handlerAddr)
-{
+void SignatureHandlerLibrary::pd_set_handler(address handlerAddr) {
   InterpreterRuntime::SignatureHandler *handler =
-    InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr);  
+    InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr);
 
   handler->finalize();
 }
--- a/src/cpu/zero/vm/interpreterRT_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/interpreterRT_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -23,37 +23,30 @@
  *
  */
 
-class SignatureHandler
-{
+class SignatureHandler {
  public:
-  static SignatureHandler *from_handlerAddr(address handlerAddr)
-  {
+  static SignatureHandler *from_handlerAddr(address handlerAddr) {
     return (SignatureHandler *) handlerAddr;
   }
 
  public:
-  ffi_cif* cif() const
-  {
+  ffi_cif* cif() const {
     return (ffi_cif *) this;
   }
 
-  int argument_count() const
-  {
+  int argument_count() const {
     return cif()->nargs;
   }
-  
-  ffi_type** argument_types() const
-  {
+
+  ffi_type** argument_types() const {
     return (ffi_type**) (cif() + 1);
   }
 
-  ffi_type* argument_type(int i) const
-  {
+  ffi_type* argument_type(int i) const {
     return argument_types()[i];
   }
 
-  ffi_type* result_type() const
-  {
+  ffi_type* result_type() const {
     return *(argument_types() + argument_count());
   }
 
@@ -64,20 +57,17 @@
   void finalize();
 };
 
-class SignatureHandlerGeneratorBase : public NativeSignatureIterator
-{
+class SignatureHandlerGeneratorBase : public NativeSignatureIterator {
  private:
   ffi_cif* _cif;
 
  protected:
   SignatureHandlerGeneratorBase(methodHandle method, ffi_cif *cif)
-    : NativeSignatureIterator(method), _cif(cif)
-  {
+    : NativeSignatureIterator(method), _cif(cif) {
     _cif->nargs = 0;
   }
 
-  ffi_cif *cif() const
-  {
+  ffi_cif *cif() const {
     return _cif;
   }
 
@@ -96,49 +86,42 @@
   virtual void push(intptr_t value) = 0;
 };
 
-class SignatureHandlerGenerator : public SignatureHandlerGeneratorBase
-{
+class SignatureHandlerGenerator : public SignatureHandlerGeneratorBase {
  private:
   CodeBuffer* _cb;
 
  public:
   SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer)
     : SignatureHandlerGeneratorBase(method, (ffi_cif *) buffer->code_end()),
-      _cb(buffer)
-  {
+      _cb(buffer) {
     _cb->set_code_end((address) (cif() + 1));
   }
 
  private:
-  void push(intptr_t value)
-  {
+  void push(intptr_t value) {
     intptr_t *dst = (intptr_t *) _cb->code_end();
     _cb->set_code_end((address) (dst + 1));
     *dst = value;
   }
 };
 
-class SlowSignatureHandlerGenerator : public SignatureHandlerGeneratorBase
-{
+class SlowSignatureHandlerGenerator : public SignatureHandlerGeneratorBase {
  private:
   intptr_t *_dst;
 
  public:
   SlowSignatureHandlerGenerator(methodHandle method, intptr_t* buf)
-    : SignatureHandlerGeneratorBase(method, (ffi_cif *) buf)
-  {
+    : SignatureHandlerGeneratorBase(method, (ffi_cif *) buf) {
     _dst = (intptr_t *) (cif() + 1);
   }
 
  private:
-  void push(intptr_t value)
-  {
+  void push(intptr_t value) {
     *(_dst++) = value;
   }
 
  public:
-  SignatureHandler *handler() const
-  {
+  SignatureHandler *handler() const {
     return (SignatureHandler *) cif();
   }
 };
--- a/src/cpu/zero/vm/interpreter_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/interpreter_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,29 +26,25 @@
 #include "incls/_precompiled.incl"
 #include "incls/_interpreter_zero.cpp.incl"
 
-address AbstractInterpreterGenerator::generate_slow_signature_handler()
-{
+address AbstractInterpreterGenerator::generate_slow_signature_handler() {
   _masm->advance(1);
   return (address) InterpreterRuntime::slow_signature_handler;
 }
 
 address InterpreterGenerator::generate_math_entry(
-    AbstractInterpreter::MethodKind kind)
-{
+    AbstractInterpreter::MethodKind kind) {
   if (!InlineIntrinsics)
     return NULL;
 
   Unimplemented();
 }
 
-address InterpreterGenerator::generate_abstract_entry()
-{
-  return UnimplementedEntry();
+address InterpreterGenerator::generate_abstract_entry() {
+  return ShouldNotCallThisEntry();
 }
 
-address InterpreterGenerator::generate_method_handle_entry()
-{
-  return UnimplementedEntry();
+address InterpreterGenerator::generate_method_handle_entry() {
+  return ShouldNotCallThisEntry();
 }
 
 int AbstractInterpreter::size_activation(methodOop method,
@@ -57,9 +53,8 @@
                                          int moncount,
                                          int callee_param_count,
                                          int callee_locals,
-                                         bool is_top_frame)
-{
-  return layout_activation(method, 
+                                         bool is_top_frame) {
+  return layout_activation(method,
                            tempcount,
                            popframe_extra_args,
                            moncount,
@@ -71,6 +66,5 @@
 }
 
 void Deoptimization::unwind_callee_save_values(frame* f,
-                                               vframeArray* vframe_array)
-{
+                                               vframeArray* vframe_array) {
 }
--- a/src/cpu/zero/vm/interpreter_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/interpreter_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -24,39 +24,38 @@
  */
 
  public:
-  static void invoke_method(methodOop method, address entry_point, TRAPS)
-  {
+  static void invoke_method(methodOop method, address entry_point, TRAPS) {
     ((ZeroEntry *) entry_point)->invoke(method, THREAD);
   }
+  static void invoke_osr(methodOop method,
+                         address   entry_point,
+                         address   osr_buf,
+                         TRAPS) {
+    ((ZeroEntry *) entry_point)->invoke_osr(method, osr_buf, THREAD);
+  }
 
  public:
-  static int expr_index_at(int i)
-  {
+  static int expr_index_at(int i) {
     return stackElementWords() * i;
   }
-  static int expr_tag_index_at(int i)
-  {
+  static int expr_tag_index_at(int i) {
     assert(TaggedStackInterpreter, "should not call this");
     Unimplemented();
   }
 
-  static int expr_offset_in_bytes(int i)
-  {
+  static int expr_offset_in_bytes(int i) {
     return stackElementSize() * i;
   }
-  static int expr_tag_offset_in_bytes(int i)
-  {
+  static int expr_tag_offset_in_bytes(int i) {
     assert(TaggedStackInterpreter, "should not call this");
     Unimplemented();
   }
 
-  static int local_index_at(int i)
-  {
+  static int local_index_at(int i) {
     assert(i <= 0, "local direction already negated");
     return stackElementWords() * i + (value_offset_in_bytes() / wordSize);
   }
-  static int local_tag_index_at(int i)
-  {
+  static int local_tag_index_at(int i) {
     assert(TaggedStackInterpreter, "should not call this");
     Unimplemented();
   }
--- a/src/cpu/zero/vm/javaFrameAnchor_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/javaFrameAnchor_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -23,23 +23,21 @@
  *
  */
 
-public:
+ public:
   // Each arch must define reset, save, restore
   // These are used by objects that only care about:
   //  1 - initializing a new state (thread creation, javaCalls)
   //  2 - saving a current state (javaCalls)
   //  3 - restoring an old state (javaCalls)
 
-  void clear()
-  {
+  void clear() {
     // clearing _last_Java_sp must be first
     _last_Java_sp = NULL;
     // fence?
     _last_Java_pc = NULL;
   }
 
-  void copy(JavaFrameAnchor* src)
-  {
+  void copy(JavaFrameAnchor* src) {
     // In order to make sure the transition state is valid for "this"
     // We must clear _last_Java_sp before copying the rest of the new
     // data
@@ -57,22 +55,18 @@
     _last_Java_sp = src->_last_Java_sp;
   }
 
-  bool walkable()
-  {
+  bool walkable() {
     return true;
   }
 
-  void make_walkable(JavaThread* thread)
-  {
+  void make_walkable(JavaThread* thread) {
     // nothing to do
   }
 
-  intptr_t* last_Java_sp() const
-  {
+  intptr_t* last_Java_sp() const {
     return _last_Java_sp;
   }
 
-  void set_last_Java_sp(intptr_t* sp)
-  {
+  void set_last_Java_sp(intptr_t* sp) {
     _last_Java_sp = sp;
   }
--- a/src/cpu/zero/vm/jniFastGetField_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/jniFastGetField_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,42 +26,34 @@
 #include "incls/_precompiled.incl"
 #include "incls/_jniFastGetField_zero.cpp.incl"
 
-address JNI_FastGetField::generate_fast_get_boolean_field()
-{
+address JNI_FastGetField::generate_fast_get_boolean_field() {
   return (address) -1;
 }
 
-address JNI_FastGetField::generate_fast_get_byte_field()
-{
+address JNI_FastGetField::generate_fast_get_byte_field() {
   return (address) -1;
 }
 
-address JNI_FastGetField::generate_fast_get_char_field()
-{
+address JNI_FastGetField::generate_fast_get_char_field() {
   return (address) -1;
 }
 
-address JNI_FastGetField::generate_fast_get_short_field()
-{
+address JNI_FastGetField::generate_fast_get_short_field() {
   return (address) -1;
 }
 
-address JNI_FastGetField::generate_fast_get_int_field()
-{
+address JNI_FastGetField::generate_fast_get_int_field() {
   return (address) -1;
 }
 
-address JNI_FastGetField::generate_fast_get_long_field()
-{
+address JNI_FastGetField::generate_fast_get_long_field() {
   return (address) -1;
 }
 
-address JNI_FastGetField::generate_fast_get_float_field()
-{
+address JNI_FastGetField::generate_fast_get_float_field() {
   return (address) -1;
 }
 
-address JNI_FastGetField::generate_fast_get_double_field()
-{
+address JNI_FastGetField::generate_fast_get_double_field() {
   return (address) -1;
 }
--- a/src/cpu/zero/vm/jni_zero.h	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/jni_zero.h	Mon Sep 28 23:50:43 2009 +0100
@@ -1,5 +1,6 @@
 /*
  * Copyright 1997-2004 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
--- a/src/cpu/zero/vm/methodHandles_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/methodHandles_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright 1997-2009 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
  * Copyright 2009 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -23,5 +23,4 @@
  *
  */
 
-#include "incls/_precompiled.incl"
-#include "incls/_methodHandles_zero.cpp.incl"
+// This file is intentionally empty
--- a/src/cpu/zero/vm/nativeInst_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/nativeInst_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -38,13 +38,13 @@
 
 void NativeJump::patch_verified_entry(address entry,
                                       address verified_entry,
-                                      address dest)
-{
+                                      address dest) {
   assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "should be");
 
 #ifdef CC_INTERP
-  ((ZeroEntry*) verified_entry)->set_entry_point(CppInterpreter::normal_entry);
+  ((ZeroEntry*) verified_entry)->set_entry_point(
+    (address) CppInterpreter::normal_entry);
 #else
   Unimplemented();
-#endif // CC_INTERP  
+#endif // CC_INTERP
 }
--- a/src/cpu/zero/vm/nativeInst_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/nativeInst_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -38,151 +38,122 @@
 // The base class for different kinds of native instruction abstractions.
 // Provides the primitive operations to manipulate code relative to this.
 
-class NativeInstruction VALUE_OBJ_CLASS_SPEC
-{
+class NativeInstruction VALUE_OBJ_CLASS_SPEC {
  public:
-  bool is_jump()
-  {
-    Unimplemented();
+  bool is_jump() {
+    ShouldNotCallThis();
   }
 
-  bool is_safepoint_poll()
-  {
-    Unimplemented();
+  bool is_safepoint_poll() {
+    ShouldNotCallThis();
   }
 };
 
-inline NativeInstruction* nativeInstruction_at(address address)
-{
-  Unimplemented();
+inline NativeInstruction* nativeInstruction_at(address address) {
+  ShouldNotCallThis();
 }
 
-class NativeCall : public NativeInstruction
-{
+class NativeCall : public NativeInstruction {
  public:
   enum zero_specific_constants {
     instruction_size = 0 // not used within the interpreter
   };
 
-  address instruction_address() const
-  {
-    Unimplemented();
+  address instruction_address() const {
+    ShouldNotCallThis();
   }
 
-  address next_instruction_address() const
-  {
-    Unimplemented();
+  address next_instruction_address() const {
+    ShouldNotCallThis();
   }
 
-  address return_address() const
-  {
-    Unimplemented();
+  address return_address() const {
+    ShouldNotCallThis();
   }
 
-  address destination() const
-  {
-    Unimplemented();
+  address destination() const {
+    ShouldNotCallThis();
   }
 
-  void set_destination_mt_safe(address dest)
-  {
-    Unimplemented();
+  void set_destination_mt_safe(address dest) {
+    ShouldNotCallThis();
   }
 
-  void verify_alignment()
-  {
-    Unimplemented();
+  void verify_alignment() {
+    ShouldNotCallThis();
   }
 
-  void verify()
-  {
-    Unimplemented();
+  void verify() {
+    ShouldNotCallThis();
   }
 
-  static bool is_call_before(address return_address)
-  {
-    Unimplemented();
+  static bool is_call_before(address return_address) {
+    ShouldNotCallThis();
   }
 };
 
-inline NativeCall* nativeCall_before(address return_address)
-{
-  Unimplemented();
+inline NativeCall* nativeCall_before(address return_address) {
+  ShouldNotCallThis();
 }
 
-inline NativeCall* nativeCall_at(address address)
-{
-  Unimplemented();
+inline NativeCall* nativeCall_at(address address) {
+  ShouldNotCallThis();
 }
 
-class NativeMovConstReg : public NativeInstruction
-{
+class NativeMovConstReg : public NativeInstruction {
  public:
-  address next_instruction_address() const
-  {
-    Unimplemented();
+  address next_instruction_address() const {
+    ShouldNotCallThis();
   }
 
-  intptr_t data() const
-  {
-    Unimplemented();
+  intptr_t data() const {
+    ShouldNotCallThis();
   }
 
-  void set_data(intptr_t x)
-  {
-    Unimplemented();
+  void set_data(intptr_t x) {
+    ShouldNotCallThis();
   }
 };
 
-inline NativeMovConstReg* nativeMovConstReg_at(address address)
-{
-  Unimplemented();
+inline NativeMovConstReg* nativeMovConstReg_at(address address) {
+  ShouldNotCallThis();
 }
 
-class NativeMovRegMem : public NativeInstruction
-{
+class NativeMovRegMem : public NativeInstruction {
  public:
-  int offset() const
-  {
-    Unimplemented();
+  int offset() const {
+    ShouldNotCallThis();
   }
 
-  void set_offset(intptr_t x)
-  {
-    Unimplemented();
+  void set_offset(intptr_t x) {
+    ShouldNotCallThis();
   }
 
-  void add_offset_in_bytes(int add_offset)
-  {
-    Unimplemented();
+  void add_offset_in_bytes(int add_offset) {
+    ShouldNotCallThis();
   }
 };
 
-inline NativeMovRegMem* nativeMovRegMem_at(address address)
-{
-  Unimplemented();
+inline NativeMovRegMem* nativeMovRegMem_at(address address) {
+  ShouldNotCallThis();
 }
 
-class NativeJump : public NativeInstruction
-{
+class NativeJump : public NativeInstruction {
  public:
   enum zero_specific_constants {
     instruction_size = 0 // not used within the interpreter
   };
 
-  address jump_destination() const
-  {
-    Unimplemented();
+  address jump_destination() const {
+    ShouldNotCallThis();
   }
 
-  void set_jump_destination(address dest)
-  {
-    Unimplemented();
+  void set_jump_destination(address dest) {
+    ShouldNotCallThis();
   }
 
   static void check_verified_entry_alignment(address entry,
-                                             address verified_entry) 
-  {
+                                             address verified_entry) {
   }
 
   static void patch_verified_entry(address entry,
@@ -190,31 +161,25 @@
                                    address dest);
 };
 
-inline NativeJump* nativeJump_at(address address)
-{
-  Unimplemented();
+inline NativeJump* nativeJump_at(address address) {
+  ShouldNotCallThis();
 }
 
-class NativeGeneralJump : public NativeInstruction
-{
+class NativeGeneralJump : public NativeInstruction {
  public:
-  address jump_destination() const
-  {
-    Unimplemented();
+  address jump_destination() const {
+    ShouldNotCallThis();
   }
 
-  static void insert_unconditional(address code_pos, address entry)
-  {
-    Unimplemented();
+  static void insert_unconditional(address code_pos, address entry) {
+    ShouldNotCallThis();
   }
 
-  static void replace_mt_safe(address instr_addr, address code_buffer)
-  {
-    Unimplemented();
+  static void replace_mt_safe(address instr_addr, address code_buffer) {
+    ShouldNotCallThis();
   }
 };
 
-inline NativeGeneralJump* nativeGeneralJump_at(address address)
-{
-  Unimplemented();
+inline NativeGeneralJump* nativeGeneralJump_at(address address) {
+  ShouldNotCallThis();
 }
--- a/src/cpu/zero/vm/registerMap_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/registerMap_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -31,7 +31,7 @@
   // Since there is none, we just return NULL.
   // See registerMap_sparc.hpp for an example of grabbing registers
   // from register save areas of a standard layout.
-  address pd_location(VMReg reg) const {return NULL;}
+  address pd_location(VMReg reg) const { return NULL; }
 
   // no PD state to clear or copy:
   void pd_clear() {}
--- a/src/cpu/zero/vm/register_definitions_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/register_definitions_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/register_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/register_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -31,9 +31,9 @@
   ConcreteRegisterImpl::max_gpr + FloatRegisterImpl::number_of_registers;
 
 const char* RegisterImpl::name() const {
-  Unimplemented();
+  ShouldNotCallThis();
 }
 
 const char* FloatRegisterImpl::name() const {
-  Unimplemented();
+  ShouldNotCallThis();
 }
--- a/src/cpu/zero/vm/register_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/register_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -46,19 +46,16 @@
   VMReg as_VMReg();
 
   // derived registers, offsets, and addresses
-  Register successor() const
-  {
+  Register successor() const {
     return as_Register(encoding() + 1);
   }
 
   // accessors
-  int encoding() const
-  {
+  int encoding() const {
     assert(is_valid(), "invalid register");
     return (intptr_t)this;
   }
-  bool is_valid() const
-  {
+  bool is_valid() const {
     return 0 <= (intptr_t) this && (intptr_t)this < number_of_registers;
   }
   const char* name() const;
@@ -84,19 +81,16 @@
   VMReg as_VMReg();
 
   // derived registers, offsets, and addresses
-  FloatRegister successor() const
-  {
+  FloatRegister successor() const {
     return as_FloatRegister(encoding() + 1);
   }
 
   // accessors
-  int encoding() const
-  {
+  int encoding() const {
     assert(is_valid(), "invalid register");
     return (intptr_t)this;
   }
-  bool is_valid() const
-  {
+  bool is_valid() const {
     return 0 <= (intptr_t) this && (intptr_t)this < number_of_registers;
   }
   const char* name() const;
--- a/src/cpu/zero/vm/relocInfo_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/relocInfo_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,52 +26,49 @@
 #include "incls/_precompiled.incl"
 #include "incls/_relocInfo_zero.cpp.incl"
 
-void Relocation::pd_set_data_value(address x, intptr_t o)
-{
-  Unimplemented();
+void Relocation::pd_set_data_value(address x, intptr_t o) {
+  ShouldNotCallThis();
 }
 
-address Relocation::pd_call_destination(address orig_addr)
-{
-  Unimplemented();
+address Relocation::pd_call_destination(address orig_addr) {
+  ShouldNotCallThis();
 }
 
-void Relocation::pd_set_call_destination(address x)
-{
-  Unimplemented();
+void Relocation::pd_set_call_destination(address x) {
+  ShouldNotCallThis();
 }
 
-address Relocation::pd_get_address_from_code()
-{
-  Unimplemented();
+address Relocation::pd_get_address_from_code() {
+  ShouldNotCallThis();
 }
 
-address* Relocation::pd_address_in_code()
-{
+address* Relocation::pd_address_in_code() {
   // Relocations in Shark are just stored directly
   return (address *) addr();
 }
 
-int Relocation::pd_breakpoint_size()
-{
-  Unimplemented();
+int Relocation::pd_breakpoint_size() {
+  ShouldNotCallThis();
 }
 
-void Relocation::pd_swap_in_breakpoint(address x, short* instrs,
-                                       int instrlen)
-{
-  Unimplemented();
+void Relocation::pd_swap_in_breakpoint(address x,
+                                       short*  instrs,
+                                       int     instrlen) {
+  ShouldNotCallThis();
 }
 
-void Relocation::pd_swap_out_breakpoint(address x, short* instrs, int instrlen)
-{
-  Unimplemented();
+void Relocation::pd_swap_out_breakpoint(address x,
+                                        short*  instrs,
+                                        int     instrlen) {
+  ShouldNotCallThis();
 }
 
-void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer *dest) {
-  Unimplemented();
+void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src,
+                                                CodeBuffer*       dst) {
+  ShouldNotCallThis();
 }
 
-void poll_return_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
-  Unimplemented();
+void poll_return_Relocation::fix_relocation_after_move(const CodeBuffer* src,
+                                                       CodeBuffer*       dst) {
+  ShouldNotCallThis();
 }
--- a/src/cpu/zero/vm/relocInfo_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/relocInfo_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -25,8 +25,7 @@
 
   // machine-dependent parts of class relocInfo
  private:
-  enum
-  {
+  enum {
     // these constants mean nothing without an assembler
     offset_unit  =  1,
     format_width =  1
--- a/src/cpu/zero/vm/sharedRuntime_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/sharedRuntime_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -38,8 +38,7 @@
 int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
                                            VMRegPair *regs,
                                            int total_args_passed,
-                                           int is_outgoing)
-{
+                                           int is_outgoing) {
   return 0;
 }
 
@@ -48,12 +47,11 @@
                         int total_args_passed,
                         int comp_args_on_stack,
                         const BasicType *sig_bt,
-                        const VMRegPair *regs)
-{
-  address i2c_entry = UnimplementedStub();
-  address c2i_entry = UnimplementedStub();
-  address c2i_unverified_entry = UnimplementedStub();
-  return new AdapterHandlerEntry(i2c_entry, c2i_entry, c2i_unverified_entry);
+                        const VMRegPair *regs) {
+  return new AdapterHandlerEntry(
+    ShouldNotCallThisStub(),
+    ShouldNotCallThisStub(),
+    ShouldNotCallThisStub());
 }
 
 nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
@@ -62,35 +60,30 @@
                                                 int comp_args_on_stack,
                                                 BasicType *in_sig_bt,
                                                 VMRegPair *in_regs,
-                                                BasicType ret_type)
-{
-  Unimplemented();
+                                                BasicType ret_type) {
+  ShouldNotCallThis();
 }
 
-int Deoptimization::last_frame_adjust(int callee_parameters, int callee_locals)
-{
+int Deoptimization::last_frame_adjust(int callee_parameters,
+                                      int callee_locals) {
   return 0;
 }
 
-uint SharedRuntime::out_preserve_stack_slots()
-{
-  Unimplemented();
+uint SharedRuntime::out_preserve_stack_slots() {
+  ShouldNotCallThis();
 }
 
-static RuntimeStub* generate_empty_runtime_stub(const char* name)
-{
+static RuntimeStub* generate_empty_runtime_stub(const char* name) {
   CodeBuffer buffer(name, 0, 0);
   return RuntimeStub::new_runtime_stub(name, &buffer, 0, 0, NULL, false);
 }
 
-static SafepointBlob* generate_empty_safepoint_blob()
-{
+static SafepointBlob* generate_empty_safepoint_blob() {
   CodeBuffer buffer("handler_blob", 0, 0);
   return SafepointBlob::create(&buffer, NULL, 0);
 }
 
-void SharedRuntime::generate_stubs()
-{
+void SharedRuntime::generate_stubs() {
   _wrong_method_blob =
     generate_empty_runtime_stub("wrong_method_stub");
   _ic_miss_blob =
@@ -110,7 +103,6 @@
 
 int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
                                          VMRegPair *regs,
-                                         int total_args_passed)
-{
-  Unimplemented();
+                                         int total_args_passed) {
+  ShouldNotCallThis();
 }
--- a/src/cpu/zero/vm/sharkFrame_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/sharkFrame_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -41,12 +41,10 @@
 // |  ...               |
 
 class SharkFrame : public ZeroFrame {
-  friend class ZeroStackPrinter;
   friend class SharkFunction;
 
  private:
-  SharkFrame() : ZeroFrame()
-  {
+  SharkFrame() : ZeroFrame() {
     ShouldNotCallThis();
   }
 
@@ -60,18 +58,22 @@
   };
 
  public:
-  address pc() const
-  {
+  address pc() const {
     return (address) value_of_word(pc_off);
   }
 
-  intptr_t* unextended_sp() const
-  {
+  intptr_t* unextended_sp() const {
     return (intptr_t *) value_of_word(unextended_sp_off);
   }
 
-  methodOop method() const
-  {
+  methodOop method() const {
     return (methodOop) value_of_word(method_off);
   }
+
+ public:
+  void identify_word(int   frame_index,
+                     int   offset,
+                     char* fieldbuf,
+                     char* valuebuf,
+                     int   buflen) const;
 };
--- a/src/cpu/zero/vm/stackPrinter_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-/*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2008, 2009 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-#include <interpreterRuntime.hpp>
-#include <scopeDesc.hpp>
-
-class ZeroStackPrinter {
- private:
-  outputStream* _st;
-  char*         _buf;
-  int           _buflen;
-
- public:
-  ZeroStackPrinter(outputStream *st, char *buf, int buflen)
-    : _st(st), _buf(buf), _buflen(buflen) {}
-
-  void print(JavaThread *thread)
-  {
-    intptr_t *lo_addr = thread->zero_stack()->sp();
-    if (!lo_addr) {
-      _st->print_cr(" stack not set up");
-      return;
-    }
-
-    intptr_t *hi_addr = (intptr_t *) thread->top_zero_frame();
-    if (!hi_addr) {
-      _st->print_cr("no frames pushed"); 
-      return;
-    }
-    assert(hi_addr >= lo_addr, "corrupted stack");
-
-    bool top_frame = true;
-    while (hi_addr) {
-      if (!top_frame)
-        _st->cr();      
-      ZeroFrame *frame = (ZeroFrame *) hi_addr;
-      for (intptr_t *addr = lo_addr; addr <= hi_addr; addr++)
-        print_word(frame, addr, top_frame);
-      lo_addr = hi_addr + 1;
-      hi_addr = *(intptr_t **) hi_addr;
-      top_frame = false;
-    }
-  }
-
- private:
-  void print_word(ZeroFrame *frame, intptr_t *addr, bool top_frame)
-  {
-    const char *field = NULL;
-    const char *value = NULL;
-
-    int word = (intptr_t *) frame - addr;
-    switch (word) {
-    case ZeroFrame::next_frame_off:
-      field = "next_frame";
-      break;
-    case ZeroFrame::frame_type_off:
-      field = "frame_type";
-      switch (*addr) {
-      case ZeroFrame::ENTRY_FRAME:
-        value = "ENTRY_FRAME";
-        break;
-      case ZeroFrame::INTERPRETER_FRAME:
-        value = "INTERPRETER_FRAME";
-        break;
-      case ZeroFrame::SHARK_FRAME:
-        value = "SHARK_FRAME";
-        break;
-      case ZeroFrame::DEOPTIMIZER_FRAME:
-        value = "DEOPTIMIZER_FRAME";
-        break;
-      }
-      break;
-    }
-
-    if (!field) {
-      if (frame->is_entry_frame()) {
-        if (word == EntryFrame::call_wrapper_off) {
-          field = "call_wrapper";
-        }
-        else {
-          snprintf(_buf, _buflen, "local[%d]", word - 3);
-          field = _buf;
-        }
-      }
-      if (frame->is_interpreter_frame()) {
-        interpreterState istate =
-          ((InterpreterFrame *) frame)->interpreter_state();
-        bool is_valid = istate->self_link() == istate;
-        
-        if (addr >= (intptr_t *) istate) {
-          field = istate->name_of_field_at_address((address) addr);
-          if (field) {
-            if (is_valid && !strcmp(field, "_method")) {
-              value = istate->method()->name_and_sig_as_C_string(_buf,_buflen);
-              field = "istate->_method";
-            }
-            else if (is_valid && !strcmp(field, "_bcp") && istate->bcp()) {
-              snprintf(_buf, _buflen, "%p (bci %d)", istate->bcp(),
-                       istate->method()->bci_from(istate->bcp()));
-              value = _buf;
-              field = "istate->_bcp";
-            }
-            else {
-              snprintf(_buf, _buflen, "%sistate->%s",
-                       field[strlen(field) - 1] == ')' ? "(": "", field);
-              field = _buf;
-            }
-          }
-          else if (addr == (intptr_t *) istate) {
-            field = "(vtable for istate)";
-          }
-        }
-        else if (is_valid) {
-          intptr_t *monitor_base = (intptr_t *) istate->monitor_base();
-          if (addr >= istate->stack_base() && addr < monitor_base) {
-            int monitor_size = frame::interpreter_frame_monitor_size();
-            int last_index =
-              (monitor_base - istate->stack_base()) / monitor_size - 1;
-            int index =
-              last_index - (addr - istate->stack_base()) / monitor_size;
-            intptr_t monitor = (intptr_t) (istate->monitor_base() - 1 - index);
-            intptr_t offset = (intptr_t) addr - monitor;
-            
-            if (offset == BasicObjectLock::obj_offset_in_bytes()) {
-              snprintf(_buf, _buflen, "monitor[%d]->_obj", index);
-              field = _buf;
-            }
-            else if (offset ==  BasicObjectLock::lock_offset_in_bytes()) {
-              snprintf(_buf, _buflen, "monitor[%d]->_lock", index);
-              field = _buf;
-            }
-          }
-          else if (addr < istate->stack_base()) {
-            if (istate->method()->is_native()) {
-              address hA = istate->method()->signature_handler();
-              if (hA != NULL) {
-                if (hA != (address)InterpreterRuntime::slow_signature_handler){
-                  InterpreterRuntime::SignatureHandler *handler =
-                    InterpreterRuntime::SignatureHandler::from_handlerAddr(hA);
-  
-                  intptr_t *params =
-                    istate->stack_base() - handler->argument_count();
-  
-                  if (addr >= params) {
-                    int param = addr - params;
-                    const char *desc = "";
-                    if (param == 0)
-                      desc = " (JNIEnv)";
-                    else if (param == 1) {
-                      if (istate->method()->is_static())
-                        desc = " (mirror)";
-                      else
-                        desc = " (this)";
-                    }
-                    snprintf(_buf, _buflen, "parameter[%d]%s", param, desc);
-                    field = _buf;
-                  }
-                  else {
-                    for (int i = 0; i < handler->argument_count(); i++) {
-                      if (params[i] == (intptr_t) addr) {
-                        snprintf(_buf, _buflen, "unboxed parameter[%d]", i);
-                        field = _buf;
-                        break;
-                      }
-                    } 
-                  }
-                }
-              }
-            }
-            else {
-              snprintf(_buf, _buflen, "%s[" INTPTR_FORMAT "]",
-                       top_frame ? "stack_word" : "local",
-                       istate->stack_base() - addr - 1);
-              field = _buf;
-            }
-          }
-        }
-      }
-      if (frame->is_shark_frame()) {
-        SharkFrame *sf = frame->as_shark_frame();
-        methodOop method = sf->method();
-          
-        if (word == SharkFrame::pc_off) {
-          field = "pc";
-          if (method->is_oop()) {
-            nmethod *code = method->code();
-            address pc = sf->pc();
-            if (code->pc_desc_at(pc)) {
-              SimpleScopeDesc ssd(code, pc);
-              snprintf(_buf, _buflen, "%p (bci %d)", pc, ssd.bci());
-              value = _buf;
-            }
-          }
-        }
-        else if (word == SharkFrame::unextended_sp_off) {
-          field = "unextended_sp";
-        }
-        else if (word == SharkFrame::method_off) {
-          field = "method";
-          if (method->is_oop())
-            value = method->name_and_sig_as_C_string(_buf, _buflen);
-        }
-        else if (word == SharkFrame::oop_tmp_off) {
-          field = "oop_tmp";
-        }
-        else {
-          SharkFrame *sf = (SharkFrame *) frame;
-          intptr_t *monitor_base =
-            (intptr_t *) frame - SharkFrame::header_words + 1;
-          intptr_t *stack_base =
-            sf->unextended_sp() + sf->method()->max_stack();
-
-          if (addr >= stack_base && addr < monitor_base) {
-            int monitor_size = frame::interpreter_frame_monitor_size();
-            int last_index = (monitor_base - stack_base) / monitor_size - 1;
-            int index = last_index - (addr - stack_base) / monitor_size;
-            intptr_t monitor =
-              (intptr_t) ((BasicObjectLock *) monitor_base - 1 - index);
-            intptr_t offset = (intptr_t) addr - monitor;
-
-            if (offset == BasicObjectLock::obj_offset_in_bytes()) {
-              snprintf(_buf, _buflen, "monitor[%d]->_obj", index);
-              field = _buf;
-            }
-            else if (offset ==  BasicObjectLock::lock_offset_in_bytes()) {
-              snprintf(_buf, _buflen, "monitor[%d]->_lock", index);
-              field = _buf;
-            }
-          }
-          else {
-            snprintf(_buf, _buflen, "%s[" INTPTR_FORMAT "]",
-                     top_frame ? "stack_word" : "local",
-                     stack_base - addr - 1);
-            field = _buf;
-          }
-        }
-      }
-    }
-      
-    if (!field) {
-      snprintf(_buf, _buflen, "word[%d]", word);
-      field = _buf;
-    }
-    _st->print(" %p: %-21s = ", addr, field);
-    if (value)
-      _st->print_cr("%s", value);
-    else
-      _st->print_cr(PTR_FORMAT, *addr);    
-  }
-};
-
-#ifndef PRODUCT
-extern "C" {
-  void print_zero_threads() {
-    char buf[O_BUFLEN];
-    ZeroStackPrinter zsp(tty, buf, sizeof(buf));
-
-    for (JavaThread *t = Threads::first(); t; t = t->next()) {
-      tty->print(PTR_FORMAT, t);
-      tty->print(" ");
-      t->print_on_error(tty, buf, sizeof(buf));
-      tty->cr();
-      tty->cr();
-
-      zsp.print(t);
-      if (t->next())
-        tty->cr();
-    }
-  }
-}
-#endif // !PRODUCT
--- a/src/cpu/zero/vm/stack_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/stack_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -33,13 +33,11 @@
   ZeroStack()
     : _base(NULL), _top(NULL), _sp(NULL) {}
 
-  bool needs_setup() const
-  {
+  bool needs_setup() const {
     return _base == NULL;
   }
 
-  void setup(void *mem, size_t size)
-  {
+  void setup(void *mem, size_t size) {
     assert(needs_setup(), "already set up");
     assert(!(size & WordAlignmentMask), "unaligned");
 
@@ -47,9 +45,7 @@
     _top  = _base + (size >> LogBytesPerWord);
     _sp   = _top;
   }
-
-  void teardown()
-  {
+  void teardown() {
     assert(!needs_setup(), "not set up");
     assert(_sp == _top, "stuff on stack at teardown");
 
@@ -58,56 +54,43 @@
     _sp   = NULL;
   }
 
-  intptr_t *sp() const
-  {
+  intptr_t *sp() const {
     return _sp;
   }
-
-  void set_sp(intptr_t *new_sp)
-  {
+  void set_sp(intptr_t *new_sp) {
     assert(_top >= new_sp && new_sp >= _base, "bad stack pointer");
     _sp = new_sp;
   }
 
-  int available_words() const
-  {
+  int available_words() const {
     return _sp - _base;
   }
 
-  void push(intptr_t value)
-  {
+  void push(intptr_t value) {
     assert(_sp > _base, "stack overflow");
     *(--_sp) = value;
   }
-
-  intptr_t pop()
-  {
+  intptr_t pop() {
     assert(_sp < _top, "stack underflow");
     return *(_sp++);
   }
 
-  void *alloc(size_t size)
-  {
+  void *alloc(size_t size) {
     int count = align_size_up(size, wordSize) >> LogBytesPerWord;
     assert(count <= available_words(), "stack overflow");
     return _sp -= count;
   }
 
  public:
-  static ByteSize base_offset()
-  {
+  static ByteSize base_offset() {
     return byte_offset_of(ZeroStack, _base);
   }
-
-  static ByteSize top_offset()
-  {
+  static ByteSize top_offset() {
     return byte_offset_of(ZeroStack, _top);
   }
-
-  static ByteSize sp_offset()
-  {
+  static ByteSize sp_offset() {
     return byte_offset_of(ZeroStack, _sp);
-  } 
+  }
 };
 
 
@@ -116,7 +99,7 @@
 class SharkFrame;
 class DeoptimizerFrame;
 
-// 
+//
 // |  ...               |
 // +--------------------+  ------------------
 // |  ...               |       low addresses
@@ -130,8 +113,7 @@
   friend class ZeroStackPrinter;
 
  protected:
-  ZeroFrame()
-  {
+  ZeroFrame() {
     ShouldNotCallThis();
   }
 
@@ -149,71 +131,67 @@
   };
 
  protected:
-  intptr_t *addr_of_word(int offset) const
-  {
+  intptr_t *addr_of_word(int offset) const {
     return (intptr_t *) this - offset;
   }
-
-  intptr_t value_of_word(int offset) const
-  {
+  intptr_t value_of_word(int offset) const {
     return *addr_of_word(offset);
   }
-  
+
  public:
-  ZeroFrame *next() const
-  {
+  ZeroFrame *next() const {
     return (ZeroFrame *) value_of_word(next_frame_off);
   }
 
  protected:
-  FrameType type() const
-  {
+  FrameType type() const {
     return (FrameType) value_of_word(frame_type_off);
   }
 
  public:
-  bool is_entry_frame() const
-  {
+  bool is_entry_frame() const {
     return type() == ENTRY_FRAME;
   }
-
-  bool is_interpreter_frame() const
-  {
+  bool is_interpreter_frame() const {
     return type() == INTERPRETER_FRAME;
   }
-
-  bool is_shark_frame() const
-  {
+  bool is_shark_frame() const {
     return type() == SHARK_FRAME;
   }
-
-  bool is_deoptimizer_frame() const
-  {
+  bool is_deoptimizer_frame() const {
     return type() == DEOPTIMIZER_FRAME;
   }
 
  public:
-  EntryFrame *as_entry_frame() const
-  {
+  EntryFrame *as_entry_frame() const {
     assert(is_entry_frame(), "should be");
     return (EntryFrame *) this;
   }
-
-  InterpreterFrame *as_interpreter_frame() const
-  {
+  InterpreterFrame *as_interpreter_frame() const {
     assert(is_interpreter_frame(), "should be");
     return (InterpreterFrame *) this;
   }
-
-  SharkFrame *as_shark_frame() const
-  {
+  SharkFrame *as_shark_frame() const {
     assert(is_shark_frame(), "should be");
     return (SharkFrame *) this;
   }
-
-  DeoptimizerFrame *as_deoptimizer_frame() const
-  {
+  DeoptimizerFrame *as_deoptimizer_frame() const {
     assert(is_deoptimizer_frame(), "should be");
     return (DeoptimizerFrame *) this;
   }
+
+ public:
+  void identify_word(int   frame_index,
+                     int   offset,
+                     char* fieldbuf,
+                     char* valuebuf,
+                     int   buflen) const;
+
+ protected:
+  void identify_vp_word(int       frame_index,
+                        intptr_t* addr,
+                        intptr_t* monitor_base,
+                        intptr_t* stack_base,
+                        char*     fieldbuf,
+                        int       buflen) const;
 };
--- a/src/cpu/zero/vm/stubGenerator_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/stubGenerator_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -30,8 +30,7 @@
 // For a more detailed description of the stub routine structure
 // see the comment in stubRoutines.hpp
 
-class StubGenerator: public StubCodeGenerator
-{
+class StubGenerator: public StubCodeGenerator {
  private:
   // The call stub is used to call Java from C
   static void call_stub(
@@ -42,8 +41,7 @@
     address          entry_point,
     intptr_t*        parameters,
     int              parameter_words,
-    TRAPS)
-  {
+    TRAPS) {
     JavaThread *thread = (JavaThread *) THREAD;
     ZeroStack *stack = thread->zero_stack();
 
@@ -102,13 +100,11 @@
   // These stubs get called from some dumb test routine.
   // I'll write them properly when they're called from
   // something that's actually doing something.
-  static void fake_arraycopy_stub(address src, address dst, int count)
-  {
+  static void fake_arraycopy_stub(address src, address dst, int count) {
     assert(count == 0, "huh?");
   }
 
-  void generate_arraycopy_stubs()
-  {
+  void generate_arraycopy_stubs() {
     // Call the conjoint generation methods immediately after
     // the disjoint ones so that short branches from the former
     // to the latter can be generated.
@@ -124,12 +120,12 @@
     StubRoutines::_jlong_disjoint_arraycopy  = (address) fake_arraycopy_stub;
     StubRoutines::_jlong_arraycopy           = (address) fake_arraycopy_stub;
 
-    StubRoutines::_oop_disjoint_arraycopy    = UnimplementedStub();
-    StubRoutines::_oop_arraycopy             = UnimplementedStub();
+    StubRoutines::_oop_disjoint_arraycopy    = ShouldNotCallThisStub();
+    StubRoutines::_oop_arraycopy             = ShouldNotCallThisStub();
 
-    StubRoutines::_checkcast_arraycopy       = UnimplementedStub();
-    StubRoutines::_unsafe_arraycopy          = UnimplementedStub();
-    StubRoutines::_generic_arraycopy         = UnimplementedStub();
+    StubRoutines::_checkcast_arraycopy       = ShouldNotCallThisStub();
+    StubRoutines::_unsafe_arraycopy          = ShouldNotCallThisStub();
+    StubRoutines::_generic_arraycopy         = ShouldNotCallThisStub();
 
     // We don't generate specialized code for HeapWord-aligned source
     // arrays, so just use the code we've already generated
@@ -159,8 +155,7 @@
       StubRoutines::_oop_arraycopy;
   }
 
-  void generate_initial()
-  {
+  void generate_initial() {
     // Generates all stubs and initializes the entry points
 
     // entry points that exist in all platforms Note: This is code
@@ -169,58 +164,56 @@
     // much more complicated generator structure. See also comment in
     // stubRoutines.hpp.
 
-    StubRoutines::_forward_exception_entry   = UnimplementedStub();
+    StubRoutines::_forward_exception_entry   = ShouldNotCallThisStub();
     StubRoutines::_call_stub_entry           = (address) call_stub;
-    StubRoutines::_catch_exception_entry     = UnimplementedStub();
+    StubRoutines::_catch_exception_entry     = ShouldNotCallThisStub();
 
     // atomic calls
-    StubRoutines::_atomic_xchg_entry         = UnimplementedStub();
-    StubRoutines::_atomic_xchg_ptr_entry     = UnimplementedStub();
-    StubRoutines::_atomic_cmpxchg_entry      = UnimplementedStub();
-    StubRoutines::_atomic_cmpxchg_ptr_entry  = UnimplementedStub();
-    StubRoutines::_atomic_cmpxchg_long_entry = UnimplementedStub();
-    StubRoutines::_atomic_add_entry          = UnimplementedStub();
-    StubRoutines::_atomic_add_ptr_entry      = UnimplementedStub();
-    StubRoutines::_fence_entry               = UnimplementedStub();
+    StubRoutines::_atomic_xchg_entry         = ShouldNotCallThisStub();
+    StubRoutines::_atomic_xchg_ptr_entry     = ShouldNotCallThisStub();
+    StubRoutines::_atomic_cmpxchg_entry      = ShouldNotCallThisStub();
+    StubRoutines::_atomic_cmpxchg_ptr_entry  = ShouldNotCallThisStub();
+    StubRoutines::_atomic_cmpxchg_long_entry = ShouldNotCallThisStub();
+    StubRoutines::_atomic_add_entry          = ShouldNotCallThisStub();
+    StubRoutines::_atomic_add_ptr_entry      = ShouldNotCallThisStub();
+    StubRoutines::_fence_entry               = ShouldNotCallThisStub();
 
     // amd64 does this here, sparc does it in generate_all()
     StubRoutines::_handler_for_unsafe_access_entry =
-      UnimplementedStub();
+      ShouldNotCallThisStub();
   }
 
-  void generate_all()
-  {
+  void generate_all() {
     // Generates all stubs and initializes the entry points
 
     // These entry points require SharedInfo::stack0 to be set up in
     // non-core builds and need to be relocatable, so they each
     // fabricate a RuntimeStub internally.
     StubRoutines::_throw_AbstractMethodError_entry =
-      UnimplementedStub();
+      ShouldNotCallThisStub();
 
     StubRoutines::_throw_ArithmeticException_entry =
-      UnimplementedStub();
+      ShouldNotCallThisStub();
 
     StubRoutines::_throw_NullPointerException_entry =
-      UnimplementedStub();
+      ShouldNotCallThisStub();
 
     StubRoutines::_throw_NullPointerException_at_call_entry =
-      UnimplementedStub();
+      ShouldNotCallThisStub();
 
     StubRoutines::_throw_StackOverflowError_entry =
-      UnimplementedStub();
+      ShouldNotCallThisStub();
 
     // support for verify_oop (must happen after universe_init)
     StubRoutines::_verify_oop_subroutine_entry =
-      UnimplementedStub();
+      ShouldNotCallThisStub();
 
     // arraycopy stubs used by compilers
     generate_arraycopy_stubs();
   }
 
  public:
-  StubGenerator(CodeBuffer* code, bool all) : StubCodeGenerator(code)
-  {
+  StubGenerator(CodeBuffer* code, bool all) : StubCodeGenerator(code) {
     if (all) {
       generate_all();
     } else {
@@ -229,16 +222,14 @@
   }
 };
 
-void StubGenerator_generate(CodeBuffer* code, bool all)
-{
+void StubGenerator_generate(CodeBuffer* code, bool all) {
   StubGenerator g(code, all);
 }
 
 EntryFrame *EntryFrame::build(ZeroStack*       stack,
                               const intptr_t*  parameters,
                               int              parameter_words,
-                              JavaCallWrapper* call_wrapper)
-{
+                              JavaCallWrapper* call_wrapper) {
   if (header_words + parameter_words > stack->available_words()) {
     Unimplemented();
   }
--- a/src/cpu/zero/vm/stubRoutines_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/stubRoutines_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -28,25 +28,21 @@
   // extend it.
 
  public:
-  static address call_stub_return_pc()
-  {
+  static address call_stub_return_pc() {
     return (address) -1;
   }
- 
-  static bool returns_to_call_stub(address return_pc)
-  {
+
+  static bool returns_to_call_stub(address return_pc) {
     return return_pc == call_stub_return_pc();
   }
 
-  enum platform_dependent_constants
-  {
+  enum platform_dependent_constants {
     code_size1 = 0,      // The assembler will fail with a guarantee
     code_size2 = 0       // if these are too small.  Simply increase
   };                     // them if that happens.
 
 #ifdef IA32
-  class x86
-  {
+  class x86 {
     friend class VMStructs;
 
    private:
--- a/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/templateInterpreter_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/templateInterpreter_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/templateInterpreter_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/templateInterpreter_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/templateTable_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/templateTable_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/templateTable_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/templateTable_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/vm_version_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/vm_version_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/cpu/zero/vm/vm_version_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/vm_version_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -25,8 +25,7 @@
 
 class VM_Version : public Abstract_VM_Version {
  public:
-  static const char* cpu_features()
-  {
+  static const char* cpu_features() {
     return "";
   }
 };
--- a/src/cpu/zero/vm/vmreg_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/vmreg_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,8 +26,7 @@
 #include "incls/_precompiled.incl"
 #include "incls/_vmreg_zero.cpp.incl"
 
-void VMRegImpl::set_regName()
-{
+void VMRegImpl::set_regName() {
   int i = 0;
   Register reg = ::as_Register(0);
   for ( ; i < ConcreteRegisterImpl::max_gpr ; ) {
@@ -42,26 +41,22 @@
   assert(i == ConcreteRegisterImpl::number_of_registers, "fix this");
 }
 
-bool VMRegImpl::is_Register()
-{
+bool VMRegImpl::is_Register() {
   return value() >= 0 &&
          value() < ConcreteRegisterImpl::max_gpr;
 }
 
-bool VMRegImpl::is_FloatRegister()
-{
+bool VMRegImpl::is_FloatRegister() {
   return value() >= ConcreteRegisterImpl::max_gpr &&
          value() < ConcreteRegisterImpl::max_fpr;
 }
 
-Register VMRegImpl::as_Register()
-{
+Register VMRegImpl::as_Register() {
   assert(is_Register(), "must be");
   return ::as_Register(value());
 }
 
-FloatRegister VMRegImpl::as_FloatRegister()
-{
+FloatRegister VMRegImpl::as_FloatRegister() {
   assert(is_FloatRegister(), "must be" );
   return ::as_FloatRegister(value() - ConcreteRegisterImpl::max_gpr);
 }
--- a/src/cpu/zero/vm/vmreg_zero.inline.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/vmreg_zero.inline.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,11 +22,11 @@
  * have any questions.
  *
  */
-inline VMReg RegisterImpl::as_VMReg()
-{
+
+inline VMReg RegisterImpl::as_VMReg() {
   return VMRegImpl::as_VMReg(encoding());
 }
-inline VMReg FloatRegisterImpl::as_VMReg()
-{
+
+inline VMReg FloatRegisterImpl::as_VMReg() {
   return VMRegImpl::as_VMReg(encoding() + ConcreteRegisterImpl::max_gpr);
 }
--- a/src/cpu/zero/vm/vtableStubs_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/cpu/zero/vm/vtableStubs_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,22 +26,18 @@
 #include "incls/_precompiled.incl"
 #include "incls/_vtableStubs_zero.cpp.incl"
 
-VtableStub* VtableStubs::create_vtable_stub(int vtable_index)
-{
-  Unimplemented();
+VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
+  ShouldNotCallThis();
 }
 
-VtableStub* VtableStubs::create_itable_stub(int vtable_index)
-{
-  Unimplemented();
+VtableStub* VtableStubs::create_itable_stub(int vtable_index) {
+  ShouldNotCallThis();
 }
 
-int VtableStub::pd_code_size_limit(bool is_vtable_stub)
-{
-  Unimplemented();
+int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
+  ShouldNotCallThis();
 }
 
-int VtableStub::pd_code_alignment()
-{
-  Unimplemented();
+int VtableStub::pd_code_alignment() {
+  ShouldNotCallThis();
 }
--- a/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -31,18 +31,17 @@
  * __m68k_cmpxchg
  *
  * Atomically store newval in *ptr if *ptr is equal to oldval for user space.
- * Returns newval on success and oldval if no exchange happened. 
- * This implementation is processor specific and works on 
+ * Returns newval on success and oldval if no exchange happened.
+ * This implementation is processor specific and works on
  * 68020 68030 68040 and 68060.
  *
  * It will not work on ColdFire, 68000 and 68010 since they lack the CAS
- * instruction. 
+ * instruction.
  * Using a kernelhelper would be better for arch complete implementation.
  *
  */
- 
-static inline int __m68k_cmpxchg(int oldval, int newval, volatile int *ptr)
-{ 
+
+static inline int __m68k_cmpxchg(int oldval, int newval, volatile int *ptr) {
   int ret;
   __asm __volatile ("cas%.l %0,%2,%1"
                    : "=d" (ret), "+m" (*(ptr))
@@ -55,47 +54,41 @@
    `*PTR' before the operation.*/
 static inline int m68k_compare_and_swap(volatile int *ptr,
                                         int oldval,
-                                        int newval) 
-{
-  for (;;)
-    {
+                                        int newval) {
+  for (;;) {
       int prev = *ptr;
       if (prev != oldval)
-	return prev;
+        return prev;
 
       if (__m68k_cmpxchg (prev, newval, ptr) == newval)
-	// Success.
-	return prev;
+        // Success.
+        return prev;
 
       // We failed even though prev == oldval.  Try again.
     }
 }
 
 /* Atomically add an int to memory.  */
-static inline int m68k_add_and_fetch(volatile int *ptr, int add_value)
-{
-  for (;;)
-    {
+static inline int m68k_add_and_fetch(volatile int *ptr, int add_value) {
+  for (;;) {
       // Loop until success.
 
       int prev = *ptr;
 
       if (__m68k_cmpxchg (prev, prev + add_value, ptr) == prev + add_value)
-	return prev + add_value;
+        return prev + add_value;
     }
 }
 
 /* Atomically write VALUE into `*PTR' and returns the previous
    contents of `*PTR'.  */
-static inline int m68k_lock_test_and_set(volatile int *ptr, int newval)
-{
-  for (;;)
-    {
+static inline int m68k_lock_test_and_set(volatile int *ptr, int newval) {
+  for (;;) {
       // Loop until success.
       int prev = *ptr;
 
       if (__m68k_cmpxchg (prev, newval, ptr) == prev)
-	return prev;
+        return prev;
     }
 }
 #endif // M68K
@@ -122,63 +115,54 @@
    `*PTR' before the operation.*/
 static inline int arm_compare_and_swap(volatile int *ptr,
                                        int oldval,
-                                       int newval) 
-{
-  for (;;)
-    {
+                                       int newval) {
+  for (;;) {
       int prev = *ptr;
       if (prev != oldval)
-	return prev;
+        return prev;
 
       if (__kernel_cmpxchg (prev, newval, ptr) == 0)
-	// Success.
-	return prev;
+        // Success.
+        return prev;
 
       // We failed even though prev == oldval.  Try again.
     }
 }
 
 /* Atomically add an int to memory.  */
-static inline int arm_add_and_fetch(volatile int *ptr, int add_value)
-{
-  for (;;)
-    {
+static inline int arm_add_and_fetch(volatile int *ptr, int add_value) {
+  for (;;) {
       // Loop until a __kernel_cmpxchg succeeds.
 
       int prev = *ptr;
 
       if (__kernel_cmpxchg (prev, prev + add_value, ptr) == 0)
-	return prev + add_value;
+        return prev + add_value;
     }
 }
 
 /* Atomically write VALUE into `*PTR' and returns the previous
    contents of `*PTR'.  */
-static inline int arm_lock_test_and_set(volatile int *ptr, int newval)
-{
-  for (;;)
-    {
+static inline int arm_lock_test_and_set(volatile int *ptr, int newval) {
+  for (;;) {
       // Loop until a __kernel_cmpxchg succeeds.
       int prev = *ptr;
 
       if (__kernel_cmpxchg (prev, newval, ptr) == 0)
-	return prev;
+        return prev;
     }
 }
 #endif // ARM
 
-inline void Atomic::store(jint store_value, volatile jint* dest)
-{
+inline void Atomic::store(jint store_value, volatile jint* dest) {
   *dest = store_value;
 }
 
-inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest)
-{
+inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) {
   *dest = store_value;
 }
 
-inline jint Atomic::add(jint add_value, volatile jint* dest)
-{
+inline jint Atomic::add(jint add_value, volatile jint* dest) {
 #ifdef ARM
   return arm_add_and_fetch(dest, add_value);
 #else
@@ -190,8 +174,7 @@
 #endif // ARM
 }
 
-inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest)
-{
+inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) {
 #ifdef ARM
   return arm_add_and_fetch(dest, add_value);
 #else
@@ -203,43 +186,35 @@
 #endif // ARM
 }
 
-inline void* Atomic::add_ptr(intptr_t add_value, volatile void* dest)
-{
+inline void* Atomic::add_ptr(intptr_t add_value, volatile void* dest) {
   return (void *) add_ptr(add_value, (volatile intptr_t *) dest);
 }
 
-inline void Atomic::inc(volatile jint* dest)
-{
+inline void Atomic::inc(volatile jint* dest) {
   add(1, dest);
 }
 
-inline void Atomic::inc_ptr(volatile intptr_t* dest)
-{
+inline void Atomic::inc_ptr(volatile intptr_t* dest) {
   add_ptr(1, dest);
 }
 
-inline void Atomic::inc_ptr(volatile void* dest)
-{
+inline void Atomic::inc_ptr(volatile void* dest) {
   add_ptr(1, dest);
 }
 
-inline void Atomic::dec(volatile jint* dest)
-{
+inline void Atomic::dec(volatile jint* dest) {
   add(-1, dest);
 }
 
-inline void Atomic::dec_ptr(volatile intptr_t* dest)
-{
+inline void Atomic::dec_ptr(volatile intptr_t* dest) {
   add_ptr(-1, dest);
 }
 
-inline void Atomic::dec_ptr(volatile void* dest)
-{
+inline void Atomic::dec_ptr(volatile void* dest) {
   add_ptr(-1, dest);
 }
 
-inline jint Atomic::xchg(jint exchange_value, volatile jint* dest)
-{
+inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) {
 #ifdef ARM
   return arm_lock_test_and_set(dest, exchange_value);
 #else
@@ -268,8 +243,7 @@
 #endif // ARM
 }
 
-inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest)
-{
+inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) {
   return (void *) xchg_ptr((intptr_t) exchange_value,
                            (volatile intptr_t*) dest);
 }
--- a/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/bytes_linux_zero.inline.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -27,17 +27,14 @@
 
 #include <byteswap.h>
 
-inline u2 Bytes::swap_u2(u2 x)
-{
+inline u2 Bytes::swap_u2(u2 x) {
   return bswap_16(x);
 }
 
-inline u4 Bytes::swap_u4(u4 x)
-{
+inline u4 Bytes::swap_u4(u4 x) {
   return bswap_32(x);
 }
 
-inline u8 Bytes::swap_u8(u8 x)
-{
+inline u8 Bytes::swap_u8(u8 x) {
   return bswap_64(x);
 }
--- a/src/os_cpu/linux_zero/vm/interp_masm_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright 2003-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2007 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-// This file specializes the assember with interpreter-specific macros
-
-class InterpreterMacroAssembler : public MacroAssembler {
- public:
-  InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {}
-  RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset)
-  {
-    Unimplemented();
-  }
-};
--- a/src/os_cpu/linux_zero/vm/interpreterGenerator_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
- * Copyright 2007 Red Hat, Inc.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- */
-
-
-  // Generation of Interpreter
-  //
-  friend class AbstractInterpreterGenerator;
-
- private:
-  address generate_normal_entry(bool synchronized);
-  address generate_native_entry(bool synchronized);
-  address generate_abstract_entry();
-  address generate_math_entry(AbstractInterpreter::MethodKind kind);
-  address generate_empty_entry();
-  address generate_accessor_entry();
-  address generate_method_handle_entry();
--- a/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/orderAccess_linux_zero.inline.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -25,11 +25,11 @@
 
 #ifdef ARM
 
-/* 
- * ARM Kernel helper for memory barrier. 
+/*
+ * ARM Kernel helper for memory barrier.
  * Using __asm __volatile ("":::"memory") does not work reliable on ARM
  * and gcc __sync_synchronize(); implementation does not use the kernel
- * helper for all gcc versions so it is unreliable to use as well. 
+ * helper for all gcc versions so it is unreliable to use as well.
  */
 typedef void (__kernel_dmb_t) (void);
 #define __kernel_dmb (*(__kernel_dmb_t *) 0xffff0fa0)
@@ -66,26 +66,22 @@
 inline void OrderAccess::loadstore()  { acquire(); }
 inline void OrderAccess::storeload()  { fence(); }
 
-inline void OrderAccess::acquire()
-{
+inline void OrderAccess::acquire() {
   READ_MEM_BARRIER;
 }
 
-inline void OrderAccess::release()
-{
+inline void OrderAccess::release() {
   WRITE_MEM_BARRIER;
 }
 
-inline void OrderAccess::fence()
-{
+inline void OrderAccess::fence() {
   FULL_MEM_BARRIER;
 }
 
 inline jbyte    OrderAccess::load_acquire(volatile jbyte*   p) { jbyte data = *p; acquire(); return data; }
 inline jshort   OrderAccess::load_acquire(volatile jshort*  p) { jshort data = *p; acquire(); return data; }
 inline jint     OrderAccess::load_acquire(volatile jint*    p) { jint data = *p; acquire(); return data; }
-inline jlong    OrderAccess::load_acquire(volatile jlong*   p)
-{
+inline jlong    OrderAccess::load_acquire(volatile jlong*   p) {
   jlong tmp;
   os::atomic_copy64(p, &tmp);
   acquire();
@@ -94,45 +90,40 @@
 inline jubyte    OrderAccess::load_acquire(volatile jubyte*   p) { jubyte data = *p; acquire(); return data; }
 inline jushort   OrderAccess::load_acquire(volatile jushort*  p) { jushort data = *p; acquire(); return data; }
 inline juint     OrderAccess::load_acquire(volatile juint*    p) { juint data = *p; acquire(); return data; }
-inline julong   OrderAccess::load_acquire(volatile julong*  p)
-{
+inline julong   OrderAccess::load_acquire(volatile julong*  p) {
   julong tmp;
   os::atomic_copy64(p, &tmp);
   acquire();
   return tmp;
 }
 inline jfloat   OrderAccess::load_acquire(volatile jfloat*  p) { jfloat data = *p; acquire(); return data; }
-inline jdouble  OrderAccess::load_acquire(volatile jdouble* p)
-{
+inline jdouble  OrderAccess::load_acquire(volatile jdouble* p) {
   jdouble tmp;
   os::atomic_copy64(p, &tmp);
   acquire();
   return tmp;
 }
 
-inline intptr_t OrderAccess::load_ptr_acquire(volatile intptr_t*   p) 
-{ 
-  intptr_t data = *p; 
+inline intptr_t OrderAccess::load_ptr_acquire(volatile intptr_t*   p) {
+  intptr_t data = *p;
   acquire();
-  return data; 
+  return data;
 }
-inline void*    OrderAccess::load_ptr_acquire(volatile void*       p) 
-{ 
+inline void*    OrderAccess::load_ptr_acquire(volatile void*       p) {
   void *data = *(void* volatile *)p;
   acquire();
-  return data; 
+  return data;
 }
-inline void*    OrderAccess::load_ptr_acquire(const volatile void* p) 
-{
-  void *data = *(void* const volatile *)p; 
-  acquire(); 
+inline void*    OrderAccess::load_ptr_acquire(const volatile void* p) {
+  void *data = *(void* const volatile *)p;
+  acquire();
   return data;
 }
 
 inline void     OrderAccess::release_store(volatile jbyte*   p, jbyte   v) { release(); *p = v; }
 inline void     OrderAccess::release_store(volatile jshort*  p, jshort  v) { release(); *p = v; }
 inline void     OrderAccess::release_store(volatile jint*    p, jint    v) { release(); *p = v; }
-inline void     OrderAccess::release_store(volatile jlong*   p, jlong   v) 
+inline void     OrderAccess::release_store(volatile jlong*   p, jlong   v)
 { release(); os::atomic_copy64(&v, p); }
 inline void     OrderAccess::release_store(volatile jubyte*  p, jubyte  v) { release(); *p = v; }
 inline void     OrderAccess::release_store(volatile jushort* p, jushort v) { release(); *p = v; }
--- a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,24 +26,31 @@
 // do not include precompiled header file
 #include "incls/_os_linux_zero.cpp.incl"
 
-address os::current_stack_pointer()
-{
+address os::current_stack_pointer() {
   address dummy = (address) &dummy;
   return dummy;
 }
 
-frame os::get_sender_for_C_frame(frame* fr)
-{
-  Unimplemented();
+frame os::get_sender_for_C_frame(frame* fr) {
+  ShouldNotCallThis();
 }
 
-frame os::current_frame()
-{
-  Unimplemented();
+frame os::current_frame() {
+  // The only thing that calls this is the stack printing code in
+  // VMError::report:
+  //   - Step 110 (printing stack bounds) uses the sp in the frame
+  //     to determine the amount of free space on the stack.  We
+  //     set the sp to a close approximation of the real value in
+  //     order to allow this step to complete.
+  //   - Step 120 (printing native stack) tries to walk the stack.
+  //     The frame we create has a NULL pc, which is ignored as an
+  //     invalid frame.
+  frame dummy = frame();
+  dummy.set_sp((intptr_t *) current_stack_pointer());
+  return dummy;
 }
 
-char* os::non_memory_address_word()
-{
+char* os::non_memory_address_word() {
   // Must never look like an address returned by reserve_memory,
   // even in its subfields (as defined by the CPU immediate fields,
   // if the CPU splits constants across multiple instructions).
@@ -57,33 +64,29 @@
 #endif // SPARC
 }
 
-void os::initialize_thread()
-{
+void os::initialize_thread() {
   // Nothing to do.
 }
 
-address os::Linux::ucontext_get_pc(ucontext_t* uc)
-{
-  Unimplemented();
+address os::Linux::ucontext_get_pc(ucontext_t* uc) {
+  ShouldNotCallThis();
 }
 
 ExtendedPC os::fetch_frame_from_context(void* ucVoid,
                                         intptr_t** ret_sp,
                                         intptr_t** ret_fp) {
-  Unimplemented();
+  ShouldNotCallThis();
 }
 
-frame os::fetch_frame_from_context(void* ucVoid)
-{
-  Unimplemented();
+frame os::fetch_frame_from_context(void* ucVoid) {
+  ShouldNotCallThis();
 }
 
 extern "C" int
 JVM_handle_linux_signal(int sig,
                         siginfo_t* info,
                         void* ucVoid,
-                        int abort_if_unrecognized)
-{
+                        int abort_if_unrecognized) {
   ucontext_t* uc = (ucontext_t*) ucVoid;
 
   Thread* t = ThreadLocalStorage::get_thread_slow();
@@ -136,11 +139,11 @@
         // stack overflow
         if (thread->in_stack_yellow_zone(addr)) {
           thread->disable_stack_yellow_zone();
-          Unimplemented();
+          ShouldNotCallThis();
         }
         else if (thread->in_stack_red_zone(addr)) {
           thread->disable_stack_red_zone();
-          Unimplemented();
+          ShouldNotCallThis();
         }
         else {
           // Accessing stack address below sp may cause SEGV if
@@ -159,16 +162,16 @@
           else {
             fatal("recursive segv. expanding stack.");
           }
-        } 
+        }
       }
     }
 
     /*if (thread->thread_state() == _thread_in_Java) {
-      Unimplemented();
+      ShouldNotCallThis();
     }
     else*/ if (thread->thread_state() == _thread_in_vm &&
                sig == SIGBUS && thread->doing_unsafe_access()) {
-      Unimplemented();
+      ShouldNotCallThis();
     }
 
     // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC
@@ -215,7 +218,7 @@
           "\n#    OOO        c_c_(___)");
   }
 #endif // !PRODUCT
-  
+
   const char *fmt = "caught unhandled signal %d";
   char buf[64];
 
@@ -223,24 +226,20 @@
   fatal(buf);
 }
 
-void os::Linux::init_thread_fpu_state(void)
-{
+void os::Linux::init_thread_fpu_state(void) {
   // Nothing to do
 }
 
-int os::Linux::get_fpu_control_word()
-{
-  Unimplemented();
+int os::Linux::get_fpu_control_word() {
+  ShouldNotCallThis();
 }
 
-void os::Linux::set_fpu_control_word(int fpu)
-{
-  Unimplemented();
+void os::Linux::set_fpu_control_word(int fpu) {
+  ShouldNotCallThis();
 }
 
-bool os::is_allocatable(size_t bytes)
-{
-  Unimplemented();
+bool os::is_allocatable(size_t bytes) {
+  ShouldNotCallThis();
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -248,13 +247,11 @@
 
 size_t os::Linux::min_stack_allowed = 64 * K;
 
-bool os::Linux::supports_variable_stack_size()
-{
+bool os::Linux::supports_variable_stack_size() {
   return true;
 }
 
-size_t os::Linux::default_stack_size(os::ThreadType thr_type)
-{
+size_t os::Linux::default_stack_size(os::ThreadType thr_type) {
 #ifdef _LP64
   size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
 #else
@@ -263,15 +260,13 @@
   return s;
 }
 
-size_t os::Linux::default_guard_size(os::ThreadType thr_type)
-{
+size_t os::Linux::default_guard_size(os::ThreadType thr_type) {
   // Only enable glibc guard pages for non-Java threads
   // (Java threads have HotSpot guard pages)
   return (thr_type == java_thread ? 0 : page_size());
 }
 
-static void current_stack_region(address *bottom, size_t *size)
-{
+static void current_stack_region(address *bottom, size_t *size) {
   pthread_attr_t attr;
   int res = pthread_getattr_np(pthread_self(), &attr);
   if (res != 0) {
@@ -339,16 +334,14 @@
   *size = stack_top - stack_bottom;
 }
 
-address os::current_stack_base()
-{
+address os::current_stack_base() {
   address bottom;
   size_t size;
   current_stack_region(&bottom, &size);
   return bottom + size;
 }
 
-size_t os::current_stack_size()
-{
+size_t os::current_stack_size() {
   // stack size includes normal stack and HotSpot guard pages
   address bottom;
   size_t size;
@@ -359,9 +352,8 @@
 /////////////////////////////////////////////////////////////////////////////
 // helper functions for fatal error handler
 
-void os::print_context(outputStream* st, void* context)
-{
-  Unimplemented();
+void os::print_context(outputStream* st, void* context) {
+  ShouldNotCallThis();
 }
 
 /////////////////////////////////////////////////////////////////////////////
@@ -369,25 +361,21 @@
 // You probably want to disassemble these monkeys to check they're ok.
 
 extern "C" {
-  int SpinPause()
-  {
+  int SpinPause() {
   }
 
-  int SafeFetch32(int *adr, int errValue)
-  {
+  int SafeFetch32(int *adr, int errValue) {
     int value = errValue;
     value = *adr;
     return value;
   }
-  intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue)
-  {
+  intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue) {
     intptr_t value = errValue;
     value = *adr;
     return value;
   }
 
-  void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count)
-  {
+  void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
     if (from > to) {
       jshort *end = from + count;
       while (from < end)
@@ -401,8 +389,7 @@
         *(to--) = *(from--);
     }
   }
-  void _Copy_conjoint_jints_atomic(jint* from, jint* to, size_t count)
-  {
+  void _Copy_conjoint_jints_atomic(jint* from, jint* to, size_t count) {
     if (from > to) {
       jint *end = from + count;
       while (from < end)
@@ -416,8 +403,7 @@
         *(to--) = *(from--);
     }
   }
-  void _Copy_conjoint_jlongs_atomic(jlong* from, jlong* to, size_t count)
-  {
+  void _Copy_conjoint_jlongs_atomic(jlong* from, jlong* to, size_t count) {
     if (from > to) {
       jlong *end = from + count;
       while (from < end)
@@ -432,21 +418,25 @@
     }
   }
 
-  void _Copy_arrayof_conjoint_bytes(HeapWord* from, HeapWord* to, size_t count)
-  {
-    Unimplemented();
+  void _Copy_arrayof_conjoint_bytes(HeapWord* from,
+                                    HeapWord* to,
+                                    size_t    count) {
+    ShouldNotCallThis();
   }
-  void _Copy_arrayof_conjoint_jshorts(HeapWord* from, HeapWord* to,
-                                      size_t count) {
-    Unimplemented();
+  void _Copy_arrayof_conjoint_jshorts(HeapWord* from,
+                                      HeapWord* to,
+                                      size_t    count) {
+    ShouldNotCallThis();
   }
-  void _Copy_arrayof_conjoint_jints(HeapWord* from, HeapWord* to, size_t count)
-  {
-    Unimplemented();
+  void _Copy_arrayof_conjoint_jints(HeapWord* from,
+                                    HeapWord* to,
+                                    size_t    count) {
+    ShouldNotCallThis();
   }
-  void _Copy_arrayof_conjoint_jlongs(HeapWord* from, HeapWord* to,
-                                     size_t count) {
-    Unimplemented();
+  void _Copy_arrayof_conjoint_jlongs(HeapWord* from,
+                                     HeapWord* to,
+                                     size_t    count) {
+    ShouldNotCallThis();
   }
 };
 
@@ -459,9 +449,8 @@
   long long unsigned int __sync_val_compare_and_swap_8(
     volatile void *ptr,
     long long unsigned int oldval,
-    long long unsigned int newval)
-  {
-    Unimplemented();
+    long long unsigned int newval) {
+    ShouldNotCallThis();
   }
 };
 #endif // !_LP64
--- a/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/os_linux_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -32,8 +32,7 @@
   static bool register_code_area(char *low, char *high) { return true; }
 
   // Atomically copy 64 bits of data
-  static void atomic_copy64(volatile void *src, volatile void *dst)
-  {
+  static void atomic_copy64(volatile void *src, volatile void *dst) {
 #if defined(PPC) && !defined(_LP64)
     double tmp;
     asm volatile ("lfd  %0, 0(%1)\n"
--- a/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/prefetch_linux_zero.inline.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -23,10 +23,8 @@
  *
  */
 
-inline void Prefetch::read(void* loc, intx interval)
-{
+inline void Prefetch::read(void* loc, intx interval) {
 }
 
-inline void Prefetch::write(void* loc, intx interval)
-{
+inline void Prefetch::write(void* loc, intx interval) {
 }
--- a/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/threadLS_linux_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -26,17 +26,14 @@
 #include "incls/_precompiled.incl"
 #include "incls/_threadLS_linux_zero.cpp.incl"
 
-void ThreadLocalStorage::generate_code_for_get_thread()
-{
+void ThreadLocalStorage::generate_code_for_get_thread() {
   // nothing to do
 }
 
-void ThreadLocalStorage::pd_init()
-{
+void ThreadLocalStorage::pd_init() {
   // nothing to do
 }
 
-void ThreadLocalStorage::pd_set_thread(Thread* thread)
-{
+void ThreadLocalStorage::pd_set_thread(Thread* thread) {
   os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread);
 }
--- a/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/threadLS_linux_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -24,9 +24,7 @@
 
 // Processor dependent parts of ThreadLocalStorage
 
-public:
-
-  static Thread* thread()
-  {
+ public:
+  static Thread* thread() {
     return (Thread*) os::thread_local_storage_at(thread_index());
   }
--- a/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -27,88 +27,74 @@
   ZeroStack  _zero_stack;
   ZeroFrame* _top_zero_frame;
 
-  void pd_initialize()
-  {
+  void pd_initialize() {
     _top_zero_frame = NULL;
   }
 
  public:
-  ZeroStack *zero_stack()
-  {
+  ZeroStack *zero_stack() {
     return &_zero_stack;
   }
 
  public:
-  ZeroFrame *top_zero_frame()
-  {
+  ZeroFrame *top_zero_frame() {
     return _top_zero_frame;
   }
-  void push_zero_frame(ZeroFrame *frame)
-  {
+  void push_zero_frame(ZeroFrame *frame) {
     *(ZeroFrame **) frame = _top_zero_frame;
     _top_zero_frame = frame;
   }
-  void pop_zero_frame()
-  {
-    _zero_stack.set_sp((intptr_t *) _top_zero_frame + 1);
+  void pop_zero_frame() {
+    zero_stack()->set_sp((intptr_t *) _top_zero_frame + 1);
     _top_zero_frame = *(ZeroFrame **) _top_zero_frame;
   }
 
  public:
-  static ByteSize zero_stack_offset()
-  {
+  static ByteSize zero_stack_offset() {
     return byte_offset_of(JavaThread, _zero_stack);
   }
-  static ByteSize top_zero_frame_offset()
-  {
+  static ByteSize top_zero_frame_offset() {
     return byte_offset_of(JavaThread, _top_zero_frame);
   }
 
  public:
-  void record_base_of_stack_pointer()
-  {
+  void record_base_of_stack_pointer() {
     assert(top_zero_frame() == NULL, "junk on stack prior to Java call");
   }
-  void set_base_of_stack_pointer(intptr_t* base_sp)
-  {
+  void set_base_of_stack_pointer(intptr_t* base_sp) {
     assert(base_sp == NULL, "should be");
     assert(top_zero_frame() == NULL, "junk on stack after Java call");
   }
 
  public:
-  void set_last_Java_frame()
-  {
+  void set_last_Java_frame() {
     JavaFrameAnchor *jfa = frame_anchor();
     jfa->set_last_Java_sp((intptr_t *) top_zero_frame());
   }
-  void reset_last_Java_frame()
-  {
+  void reset_last_Java_frame() {
     JavaFrameAnchor *jfa = frame_anchor();
     jfa->set_last_Java_sp(NULL);
   }
 
  private:
-  frame pd_last_frame()
-  {
+  frame pd_last_frame() {
     assert(has_last_Java_frame(), "must have last_Java_sp() when suspended");
-    return frame(last_Java_sp());
+    return frame(last_Java_sp(), zero_stack()->sp());
   }
 
  public:
   // Check for pending suspend requests and pending asynchronous
   // exceptions.  There are separate accessors for these, but
   // _suspend_flags is volatile so using them would be unsafe.
-  bool has_special_condition_for_native_trans()
-  {
+  bool has_special_condition_for_native_trans() {
     return _suspend_flags != 0;
   }
 
  public:
   bool pd_get_top_frame_for_signal_handler(frame* fr_addr,
                                            void* ucontext,
-                                           bool isInJava)
-  {
-    Unimplemented();
+                                           bool isInJava) {
+    ShouldNotCallThis();
   }
 
   // These routines are only used on cpu architectures that
--- a/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -22,3 +22,5 @@
  * have any questions.
  *
  */
+
+// This file is intentionally empty
--- a/src/share/vm/includeDB_core	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/share/vm/includeDB_core	Mon Sep 28 23:50:43 2009 +0100
@@ -1655,12 +1655,14 @@
 frame_<arch>.cpp                        frame.inline.hpp
 frame_<arch>.cpp                        handles.inline.hpp
 frame_<arch>.cpp                        interpreter.hpp
+frame_<arch>.cpp                        interpreterRuntime.hpp
 frame_<arch>.cpp                        javaCalls.hpp
 frame_<arch>.cpp                        markOop.hpp
 frame_<arch>.cpp                        methodOop.hpp
 frame_<arch>.cpp                        monitorChunk.hpp
 frame_<arch>.cpp                        oop.inline.hpp
 frame_<arch>.cpp                        resourceArea.hpp
+frame_<arch>.cpp                        scopeDesc.hpp
 frame_<arch>.cpp                        signature.hpp
 frame_<arch>.cpp                        stubCodeGenerator.hpp
 frame_<arch>.cpp                        stubRoutines.hpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/includeDB_zero	Mon Sep 28 23:50:43 2009 +0100
@@ -0,0 +1,52 @@
+//
+// Copyright 2001-2009 Sun Microsystems, Inc.  All Rights Reserved.
+// Copyright 2009 Red Hat, Inc.
+// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+//
+// This code is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License version 2 only, as
+// published by the Free Software Foundation.
+//
+// This code is distributed in the hope that it will be useful, but WITHOUT
+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+// version 2 for more details (a copy is included in the LICENSE file that
+// accompanied this code).
+//
+// You should have received a copy of the GNU General Public License version
+// 2 along with this work; if not, write to the Free Software Foundation,
+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+// CA 95054 USA or visit www.sun.com if you need additional information or
+// have any questions.
+//  
+//
+
+// NOTE: DO NOT CHANGE THIS COPYRIGHT TO NEW STYLE - IT WILL BREAK makeDeps!
+
+deoptimizerFrame_<arch>.hpp             stack_<arch>.hpp
+
+entryFrame_<arch>.hpp                   javaCalls.hpp
+entryFrame_<arch>.hpp                   stack_<arch>.hpp
+
+frame.hpp                               stack_<arch>.hpp
+
+frame.inline.hpp                        deoptimizerFrame_<arch>.hpp
+frame.inline.hpp                        entryFrame_<arch>.hpp
+frame.inline.hpp                        interpreterFrame_<arch>.hpp
+frame.inline.hpp                        sharkFrame_<arch>.hpp
+
+interpreter.hpp                         entry_<arch>.hpp
+
+interpreterFrame_<arch>.hpp             bytecodeInterpreter.hpp
+interpreterFrame_<arch>.hpp             methodOop.hpp
+interpreterFrame_<arch>.hpp             stack_<arch>.hpp
+interpreterFrame_<arch>.hpp             thread.hpp
+
+sharkFrame_<arch>.hpp                   methodOop.hpp
+sharkFrame_<arch>.hpp                   stack_<arch>.hpp
+
+stack_<arch>.hpp                        sizes.hpp
+
+thread.hpp                              stack_<arch>.hpp
--- a/src/share/vm/runtime/arguments.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/share/vm/runtime/arguments.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -1229,6 +1229,7 @@
     }
   }
 
+#ifndef ZERO
 #ifdef _LP64
   // Check that UseCompressedOops can be set with the max heap size allocated
   // by ergonomics.
@@ -1254,6 +1255,7 @@
   // Also checks that certain machines are slower with compressed oops
   // in vm_version initialization code.
 #endif // _LP64
+#endif // !ZERO
 }
 
 void Arguments::set_parallel_gc_flags() {
--- a/src/share/vm/runtime/icache.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/share/vm/runtime/icache.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -78,7 +78,6 @@
 }
 
 void AbstractICache::invalidate_range(address start, int nbytes) {
-#ifndef ZERO
   static bool firstTime = true;
   if (firstTime) {
     guarantee(start == CAST_FROM_FN_PTR(address, _flush_icache_stub),
@@ -98,7 +97,6 @@
   }
   call_flush_stub(start, round_to(nbytes, ICache::line_size) >>
                          ICache::log2_line_size);
-#endif // ZERO
 }
 
 // For init.cpp
--- a/src/share/vm/runtime/jniHandles.hpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/share/vm/runtime/jniHandles.hpp	Mon Sep 28 23:50:43 2009 +0100
@@ -99,6 +99,8 @@
 
 class JNIHandleBlock : public CHeapObj {
   friend class VMStructs;
+  friend class CppInterpreter;
+
  private:
   enum SomeConstants {
     block_size_in_oops  = 32                    // Number of handles per handle block
@@ -126,17 +128,11 @@
   // Fill block with bad_handle values
   void zap();
 
-#ifdef ZERO
  protected:
-  friend class CppInterpreter;
-#endif // ZERO
-
   // No more handles in the both the current and following blocks
   void clear() { _top = 0; }
 
-#ifdef ZERO
  private:
-#endif // ZERO
   // Free list computation
   void rebuild_free_list();
 
--- a/src/share/vm/runtime/vm_version.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/share/vm/runtime/vm_version.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -93,17 +93,13 @@
 #else // KERNEL
 #ifdef TIERED
   #define VMTYPE "Server"
-#else
-#if defined(COMPILER1) || defined(COMPILER2)
+#else // TIERED
+#ifdef ZERO
+  #define VMTYPE "Zero"
+#else // ZERO
    #define VMTYPE COMPILER1_PRESENT("Client")   \
                   COMPILER2_PRESENT("Server")
-#else
-#ifdef ZERO
-  #define VMTYPE "Zero"
-#else
-  #define VMTYPE "Core"
 #endif // ZERO
-#endif // COMPILER1 || COMPILER2
 #endif // TIERED
 #endif // KERNEL
 
--- a/src/share/vm/utilities/vmError.cpp	Tue Sep 22 18:49:40 2009 +0100
+++ b/src/share/vm/utilities/vmError.cpp	Mon Sep 28 23:50:43 2009 +0100
@@ -25,10 +25,6 @@
 # include "incls/_precompiled.incl"
 # include "incls/_vmError.cpp.incl"
 
-# ifdef ZERO
-# include <stackPrinter_zero.hpp>
-# endif // ZERO
-
 // List of environment variables that should be reported in error log file.
 const char *env_list[] = {
   // All platforms
@@ -400,7 +396,6 @@
        st->cr();
      }
 
-#ifndef ZERO
   STEP(110, "(printing stack bounds)" )
 
      if (_verbose) {
@@ -458,15 +453,44 @@
           st->cr();
        }
      }
-#endif // !ZERO
 
   STEP(130, "(printing Java stack)" )
 
      if (_verbose && _thread && _thread->is_Java_thread()) {
        JavaThread* jt = (JavaThread*)_thread;
 #ifdef ZERO
-       st->print_cr("Java stack:");
-       ZeroStackPrinter(st, buf, sizeof(buf)).print(jt);
+       if (jt->zero_stack()->sp() && jt->top_zero_frame()) {
+         // StackFrameStream uses the frame anchor, which may not have
+         // been set up.  This can be done at any time in Zero, however,
+         // so if it hasn't been set up then we just set it up now and
+         // clear it again when we're done.
+         bool has_last_Java_frame = jt->has_last_Java_frame();
+         if (!has_last_Java_frame)
+           jt->set_last_Java_frame();
+         st->print("Java frames:");
+  
+         // If the top frame is a Shark frame and the frame anchor isn't
+         // set up then it's possible that the information in the frame
+         // is garbage: it could be from a previous decache, or it could
+         // simply have never been written.  So we print a warning...
+         StackFrameStream sfs(jt);
+         if (!has_last_Java_frame && !sfs.is_done()) {
+           if (sfs.current()->zeroframe()->is_shark_frame()) {
+             st->print(" (TOP FRAME MAY BE JUNK)");
+           }
+         }
+         st->cr();
+  
+         // Print the frames
+         for(int i = 0; !sfs.is_done(); sfs.next(), i++) {
+           sfs.current()->zero_print_on_error(i, st, buf, sizeof(buf));
+           st->cr();
+         }
+  
+         // Reset the frame anchor if necessary
+         if (!has_last_Java_frame)
+           jt->reset_last_Java_frame();
+       }
 #else
        if (jt->has_last_Java_frame()) {
          st->print_cr("Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)");
@@ -487,14 +511,6 @@
           op->print_on_error(st);
           st->cr();
           st->cr();
-#ifdef ZERO
-          if (op->calling_thread()->is_Java_thread()) {
-            st->print_cr("Calling thread's Java stack:");
-            ZeroStackPrinter(st, buf, sizeof(buf)).print(
-              (JavaThread *) op->calling_thread());
-            st->cr();
-          }
-#endif // ZERO
         }
      }