From liuqi at loongson.cn Mon Nov 1 06:13:46 2010 From: liuqi at loongson.cn (LIU Qi) Date: Mon, 1 Nov 2010 21:13:46 +0800 Subject: [liuqi@icedtea.classpath.org: /hg/openjdk6-mips: 3 new changesets] Message-ID: <20101101131345.GA20305@loongson.cn> ----- Forwarded message from liuqi at icedtea.classpath.org ----- Date: Mon, 01 Nov 2010 13:11:58 +0000 From: liuqi at icedtea.classpath.org To: distro-pkg-dev at openjdk.java.net Subject: /hg/openjdk6-mips: 3 new changesets changeset 142b74086f40 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=142b74086f40 author: Ao Qi date: Fri Oct 29 09:44:58 2010 +0800 Removed unimplemented parts in Makefile, so a relatively complete JRE can be built. changeset 7a9f890eafef in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=7a9f890eafef author: YANG Yongqiang date: Mon Nov 01 17:41:18 2010 +0800 Fix 2 bugs which are related to patching. NativeGeneralJump represents both long and short jump instructions, so they must be dealed respectively in patching. Otherwise patching produces wrong results. changeset d0a60cd6d61c in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=d0a60cd6d61c author: LIN Chuanwen date: Mon Nov 01 17:45:37 2010 +0800 Fix a bug caused by the MIPS ABI. When passing arguments, the stack adjusting is not according to the MIPS ABI. Fixed it. diffstat: 31 files changed, 202 insertions(+), 268 deletions(-) corba/make/common/Defs-linux.gmk | 4 env_debug.sh | 18 - env_product.sh | 7 hotspot/agent/make/saenv.sh | 4 hotspot/agent/src/os/linux/LinuxDebuggerLocal.c | 46 +++ hotspot/agent/src/os/linux/Makefile | 6 hotspot/agent/src/os/linux/libproc.h | 11 hotspot/make/Makefile | 7 hotspot/make/defs.make | 6 hotspot/make/linux/makefiles/buildtree.make | 2 hotspot/make/linux/makefiles/debug.make | 2 hotspot/make/linux/makefiles/defs.make | 20 + hotspot/make/linux/makefiles/gcc.make | 2 hotspot/make/linux/makefiles/launcher.make | 7 hotspot/make/linux/makefiles/sa.make | 3 hotspot/make/linux/makefiles/vm.make | 2 hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp | 9 hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp | 8 hotspot/src/cpu/mips/vm/nativeInst_mips.cpp | 210 +----------------- hotspot/src/cpu/mips/vm/templateInterpreter_mips.cpp | 5 hotspot/src/share/vm/c1/c1_Runtime1.cpp | 1 hotspot/src/share/vm/runtime/reflection.cpp | 1 jdk/make/common/Defs-linux.gmk | 9 jdk/make/common/Program.gmk | 3 jdk/make/common/shared/Compiler-gcc.gmk | 8 jdk/make/common/shared/Platform.gmk | 5 jdk/make/java/instrument/Makefile | 3 jdk/make/java/redist/Makefile | 54 ++-- jdk/make/javax/sound/SoundDefs.gmk | 4 jdk/src/share/native/com/sun/media/sound/SoundDefs.h | 1 make/hotspot-rules.gmk | 2 diffs (truncated from 996 to 500 lines): diff -r d2a6a000ff33 -r d0a60cd6d61c corba/make/common/Defs-linux.gmk --- a/corba/make/common/Defs-linux.gmk Sat Oct 30 17:47:17 2010 +0800 +++ b/corba/make/common/Defs-linux.gmk Mon Nov 01 17:45:37 2010 +0800 @@ -197,6 +197,10 @@ EXTRA_LIBS += -lc EXTRA_LIBS += -lc LDFLAGS_DEFS_OPTION = -z defs +ifeq ($(ARCH), mips64) +# MIPS do not know this defs option + LDFLAGS_DEFS_OPTION = +endif LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION) # diff -r d2a6a000ff33 -r d0a60cd6d61c env_debug.sh --- a/env_debug.sh Sat Oct 30 17:47:17 2010 +0800 +++ b/env_debug.sh Mon Nov 01 17:45:37 2010 +0800 @@ -1,27 +1,27 @@ export LANG=C export LANG=C export LC_ALL=C -export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk/bin export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk #export ALT_BOOTDIR=/home/loongson/java/j2sdk-gs2 export ALT_BINARY_PLUGS_PATH=/opt/java/openjdk-binary-plugs -export ALT_JDK_IMPORT_PATH=/usr/lib/jvm/java-6-openjdk -#export ALT_SLASH_JAVA=/yangyongqiang +#export ALT_JDK_IMPORT_PATH=/usr/lib/jvm/java-6-openjdk export ARCH_DATA_MODEL=32 +#The default hotspot-build is all_product. Setting DEBUG_NAME would change the target. export DEBUG_NAME=debug -#The default hotspot-build is all_product. Setting DEBUG_NAME would change the target. -export BUILD_LANGTOOLS=fasle +# If want to build entire JDK, set all envs below true. +export BUILD_LANGTOOLS=false export BUILD_CORBA=false export BUILD_JAXP=false export BUILD_JAXWS=false +# When building jaxp, it seems a bug that jdk6-jaxp-2009_10_13.zip cannot be downloaded. +# The workaround is to download it by "wget ", and set ALT_DROPS_DIR to the dir where the zip is. +#export ALT_DROPS_DIR=~/zip_dir + export BUILD_MOTIF=false export BUILD_JDK=false export BUILD_DEPLOY=false -export CLIENT_ONLY=true - - unset CLASSPATH unset JAVA_HOME - diff -r d2a6a000ff33 -r d0a60cd6d61c env_product.sh --- a/env_product.sh Sat Oct 30 17:47:17 2010 +0800 +++ b/env_product.sh Mon Nov 01 17:45:37 2010 +0800 @@ -1,15 +1,20 @@ export LC_ALL=C export LC_ALL=C -export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk/bin export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk export ALT_BINARY_PLUGS_PATH=/opt/java/openjdk-binary-plugs export ARCH_DATA_MODEL=32 #The default hotspot-build is all_product. Setting DEBUG_NAME would change the target. +# If want to build entire JDK, set all envs below true. export BUILD_LANGTOOLS=false export BUILD_CORBA=false export BUILD_JAXP=false export BUILD_JAXWS=false +# When building jaxp, it seems a bug that jdk6-jaxp-2009_10_13.zip cannot be downloaded. +# The workaround is to download it by "wget ", and set ALT_DROPS_DIR to the dir where the zip is. +#export ALT_DROPS_DIR=~/zip_dir + export BUILD_MOTIF=false export BUILD_JDK=false export BUILD_DEPLOY=false diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/agent/make/saenv.sh --- a/hotspot/agent/make/saenv.sh Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/agent/make/saenv.sh Mon Nov 01 17:45:37 2010 +0800 @@ -42,6 +42,10 @@ if [ "$OS" = "Linux" ]; then SA_LIBPATH=$STARTDIR/../src/os/linux/amd64:$STARTDIR/linux/amd64 OPTIONS="-Dsa.library.path=$SA_LIBPATH" CPU=amd64 + elif [ "$ARCH" = "mips64" ] ; then + SA_LIBPATH=$STARTDIR/../src/os/linux/mips:$STARTDIR/linux/mips + OPTIONS="-Dsa.library.path=$SA_LIBPATH" + CPU=mips else SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386 OPTIONS="-Dsa.library.path=$SA_LIBPATH" diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/agent/src/os/linux/LinuxDebuggerLocal.c --- a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c Mon Nov 01 17:45:37 2010 +0800 @@ -39,6 +39,10 @@ #if defined(sparc) || defined(sparcv9) #include "sun_jvm_hotspot_debugger_sparc_SPARCThreadContext.h" +#endif + +#if defined(mipsel) || defined(mips) +#include "sun_jvm_hotspot_debugger_mips_MIPSThreadContext.h" #endif static jfieldID p_ps_prochandle_ID = 0; @@ -307,6 +311,9 @@ JNIEXPORT jlongArray JNICALL Java_sun_jv #if defined(sparc) || defined(sparcv9) #define NPRGREG sun_jvm_hotspot_debugger_sparc_SPARCThreadContext_NPRGREG #endif +#if defined(mips) || defined(mipsel) +#define NPRGREG sun_jvm_hotspot_debugger_mips_MIPSThreadContext_NPRGREG +#endif array = (*env)->NewLongArray(env, NPRGREG); CHECK_EXCEPTION_(0); @@ -406,6 +413,45 @@ JNIEXPORT jlongArray JNICALL Java_sun_jv regs[REG_INDEX(R_O7)] = gregs.u_regs[14]; #endif /* sparc */ +#if defined(mips) || defined(mipsel) + +#define REG_INDEX(reg) sun_jvm_hotspot_debugger_mips_MIPSThreadContext_##reg + + regs[REG_INDEX(ZERO)] = gregs.regs[0]; + regs[REG_INDEX(AT)] = gregs.regs[1]; + regs[REG_INDEX(V0)] = gregs.regs[2]; + regs[REG_INDEX(V1)] = gregs.regs[3]; + regs[REG_INDEX(A0)] = gregs.regs[4]; + regs[REG_INDEX(A1)] = gregs.regs[5]; + regs[REG_INDEX(A2)] = gregs.regs[6]; + regs[REG_INDEX(A3)] = gregs.regs[7]; + regs[REG_INDEX(T0)] = gregs.regs[8]; + regs[REG_INDEX(T1)] = gregs.regs[9]; + regs[REG_INDEX(T2)] = gregs.regs[10]; + regs[REG_INDEX(T3)] = gregs.regs[11]; + regs[REG_INDEX(T4)] = gregs.regs[12]; + regs[REG_INDEX(T5)] = gregs.regs[13]; + regs[REG_INDEX(T6)] = gregs.regs[14]; + regs[REG_INDEX(T7)] = gregs.regs[15]; + regs[REG_INDEX(S0)] = gregs.regs[16]; + regs[REG_INDEX(S1)] = gregs.regs[17]; + regs[REG_INDEX(S2)] = gregs.regs[18]; + regs[REG_INDEX(S3)] = gregs.regs[19]; + regs[REG_INDEX(S4)] = gregs.regs[20]; + regs[REG_INDEX(S5)] = gregs.regs[21]; + regs[REG_INDEX(S6)] = gregs.regs[22]; + regs[REG_INDEX(S7)] = gregs.regs[23]; + regs[REG_INDEX(T8)] = gregs.regs[24]; + regs[REG_INDEX(T9)] = gregs.regs[25]; + regs[REG_INDEX(K0)] = gregs.regs[26]; + regs[REG_INDEX(K1)] = gregs.regs[27]; + regs[REG_INDEX(GP)] = gregs.regs[28]; + regs[REG_INDEX(SP)] = gregs.regs[29]; + regs[REG_INDEX(FP)] = gregs.regs[30]; + regs[REG_INDEX(S8)] = gregs.regs[30]; + regs[REG_INDEX(RA)] = gregs.regs[31]; +#endif /* mips */ + (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT); return array; diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/agent/src/os/linux/Makefile --- a/hotspot/agent/src/os/linux/Makefile Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/agent/src/os/linux/Makefile Mon Nov 01 17:45:37 2010 +0800 @@ -22,7 +22,11 @@ # # -ARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi ) +ARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; \ + elif ([ `uname -m` = "x86_64" ]) ; then echo amd64 ; \ + elif ([ `uname -m` = "sparc64" ]) ; then echo sparc ; \ + elif ([ `uname -m` = "mips64" ]) ; then echo mips ; \ + else echo i386 ; fi ) GCC = gcc JAVAH = ${JAVA_HOME}/bin/javah diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/agent/src/os/linux/libproc.h --- a/hotspot/agent/src/os/linux/libproc.h Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/agent/src/os/linux/libproc.h Mon Nov 01 17:45:37 2010 +0800 @@ -43,6 +43,11 @@ #endif //sparc or sparcv9 +#if defined(mips) || defined(mipsel) || defined(mips64) || defined(mips64el) +#include +void abc(); +#endif + /************************************************************************************ 0. This is very minimal subset of Solaris libproc just enough for current application. @@ -83,7 +88,11 @@ unsigned long regs[IA64_REG_COUNT]; }; #endif -#if defined(sparc) || defined(sparcv9) +#if defined(sparc) || defined(sparcv9) +#define user_regs_struct pt_regs +#endif + +#if defined(mips) || defined(mipsel) || defined(mips64) || defined(mips64el) #define user_regs_struct pt_regs #endif diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/make/Makefile --- a/hotspot/make/Makefile Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/make/Makefile Mon Nov 01 17:45:37 2010 +0800 @@ -89,7 +89,8 @@ JDK_DIRS=bin include jre lib demo JDK_DIRS=bin include jre lib demo all: all_product all_fastdebug -all_product: product product1 productkernel docs export_product +all_product: product1 productkernel docs export_product +#all_product: product product1 productkernel docs export_product all_fastdebug: fastdebug fastdebug1 fastdebugkernel docs export_fastdebug all_debug: jvmg1 jvmgkernel docs export_debug #all_debug: jvmg jvmg1 jvmgkernel docs export_debug @@ -303,7 +304,9 @@ endif $(install-file) # Xusage file -$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE) +# FIXME: EXPORT_SERVER_DIR is null now. aoqi +#$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE) +$(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE) $(prep-target) $(RM) $@.temp $(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/make/defs.make --- a/hotspot/make/defs.make Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/make/defs.make Mon Nov 01 17:45:37 2010 +0800 @@ -218,6 +218,8 @@ ifneq ($(OSNAME),windows) endif endif ifeq ($(BUILDARCH), mips) + # FIXME: Simply set BUILDARCH mipsel, because loongson is mipsel. aoqi + BUILDARCH = mipsel ifdef LP64 BUILDARCH = mips64 endif @@ -232,8 +234,10 @@ ifneq ($(OSNAME),windows) LIBARCH/ia64 = ia64 LIBARCH/mips = mips LIBARCH/mips64 = mips64 + LIBARCH/mipsel = mipsel + LIBARCH/mips64el= mips64el - LP64_ARCH = sparcv9 amd64 ia64 mips64 + LP64_ARCH = sparcv9 amd64 ia64 mips64 mips64el endif # Required make macro settings for all platforms diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/make/linux/makefiles/buildtree.make --- a/hotspot/make/linux/makefiles/buildtree.make Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/make/linux/makefiles/buildtree.make Mon Nov 01 17:45:37 2010 +0800 @@ -114,7 +114,7 @@ BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_F BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \ - env.sh env.csh .dbxrc #test_gamma + env.sh env.csh .dbxrc test_gamma BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/make/linux/makefiles/debug.make --- a/hotspot/make/linux/makefiles/debug.make Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/make/linux/makefiles/debug.make Mon Nov 01 17:45:37 2010 +0800 @@ -40,5 +40,5 @@ _JUNK_ := $(shell echo -e >&2 ""\ G_SUFFIX = VERSION = debug -SYSDEFS += -DASSERT -DDEBUG -DLOONGSONDEBUG +SYSDEFS += -DASSERT -DDEBUG PICFLAGS = DEFAULT diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/make/linux/makefiles/defs.make --- a/hotspot/make/linux/makefiles/defs.make Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/make/linux/makefiles/defs.make Mon Nov 01 17:45:37 2010 +0800 @@ -87,22 +87,32 @@ ifeq ($(ARCH), i686) HS_ARCH = x86 endif +# mips +ifeq ($(ARCH), mips64) + ARCH_DATA_MODEL = 32 + PLATFORM = linux-mipsel + VM_PLATFORM = linux_mipsel + HS_ARCH = mips +endif + JDK_INCLUDE_SUBDIR=linux # FIXUP: The subdirectory for a debug build is NOT the same on all platforms VM_DEBUG=jvmg EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html -EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server -EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt -EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjsig.so -EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so +#server cannot work now. FIXME aoqi +#EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server +#EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt +#EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjsig.so +#EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so ifeq ($(ARCH_DATA_MODEL), 32) EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjsig.so EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so - EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so +#libsaproc.so is not generated yet, its build is in saproc.make. FIXME aoqi +# EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar else ifeq ($(ARCH),ia64) diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/make/linux/makefiles/gcc.make --- a/hotspot/make/linux/makefiles/gcc.make Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/make/linux/makefiles/gcc.make Mon Nov 01 17:45:37 2010 +0800 @@ -83,7 +83,7 @@ endif endif # Compiler warnings are treated as errors -WARNINGS_ARE_ERRORS = +WARNINGS_ARE_ERRORS = # Except for a few acceptable ones # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/make/linux/makefiles/launcher.make --- a/hotspot/make/linux/makefiles/launcher.make Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/make/linux/makefiles/launcher.make Mon Nov 01 17:45:37 2010 +0800 @@ -31,10 +31,15 @@ LAUNCHERFLAGS = $(ARCHFLAG) \ LAUNCHERFLAGS = $(ARCHFLAG) \ -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \ -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \ - -DARCH=\"$(LIBARCH)\" \ -DGAMMA \ -DLAUNCHER_TYPE=\"gamma\" \ -DLINK_INTO_$(LINK_INTO) + +ifeq ($(LIBARCH),mips) + LAUNCHERFLAGS += -DARCH=\"mipsel\" +else + LAUNCHERFLAGS += -DARCH=\"$(LIBARCH)\" +endif ifeq ($(LINK_INTO),AOUT) LAUNCHER.o = launcher.o $(JVM_OBJ_FILES) diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/make/linux/makefiles/sa.make --- a/hotspot/make/linux/makefiles/sa.make Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/make/linux/makefiles/sa.make Mon Nov 01 17:45:37 2010 +0800 @@ -42,6 +42,7 @@ SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/too # gnumake 3.78.1 does not accept the *s that # are in AGENT_FILES1 and AGENT_FILES2, so use the shell to expand them +# see sa.files AGENT_FILES1 := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_FILES1)) AGENT_FILES2 := $(shell /usr/bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_FILES2)) @@ -91,6 +92,8 @@ all: $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext +#*.java of MIPS in hotspot/agent/src/share/classes/sun has not been implemented yet. FIXME aoqi +#$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.mips.MIPSThreadContext clean: rm -rf $(SA_CLASSDIR) diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/make/linux/makefiles/vm.make --- a/hotspot/make/linux/makefiles/vm.make Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/make/linux/makefiles/vm.make Mon Nov 01 17:45:37 2010 +0800 @@ -221,7 +221,7 @@ include $(MAKEFILES_DIR)/saproc.make #---------------------------------------------------------------------- -#TODO aoqi +#FIXME aoqi, libsaproc[_g].so(serviceability agent) of mips has not been implemented yet. #build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) checkAndBuildSA build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp Mon Nov 01 17:45:37 2010 +0800 @@ -373,14 +373,11 @@ void PatchingStub::emit_code(LIR_Assembl } if (CommentedAssembly) { - __ block_comment("patch data encoded as movl"); + __ block_comment("patch data"); } // Now emit the patch record telling the runtime how to find the - // pieces of the patch. We only need 3 bytes but for readability of - // the disassembly we make the data look like a movl reg, imm32, - // which requires 5 bytes - //int sizeof_patch_record = 5; - //for mips, I use a move instruction instead @jerome, 12/29, 06 + // pieces of the patch. We only need 3 bytes but for alignment, we + // need 4 bytes int sizeof_patch_record = 4; bytes_to_skip += sizeof_patch_record; diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Mon Nov 01 17:45:37 2010 +0800 @@ -2479,13 +2479,14 @@ void LIR_Assembler::emit_opTypeCheck(LIR jobject2reg(k->encoding(),k_RInfo); } assert(obj != k_RInfo, "must be different"); + int the_pc; if (op->profiled_method() != NULL) { ciMethod* method = op->profiled_method(); int bci = op->profiled_bci(); Label profile_done; // __ jcc(Assembler::notEqual, profile_done); - __ bne(obj, ZERO, done); + __ bne(obj, ZERO, profile_done); __ delayed()->nop(); // Object is null; update methodDataOop @@ -2498,15 +2499,11 @@ void LIR_Assembler::emit_opTypeCheck(LIR assert(data != NULL, "need data for checkcast"); assert(data->is_BitData(), "need BitData for checkcast"); Register mdo = klass_RInfo; - // __ movl(mdo, md->encoding()); - //__ move(mdo, md->encoding()); int oop_index = __ oop_recorder()->find_index(md->encoding()); RelocationHolder rspec = oop_Relocation::spec(oop_index); __ relocate(rspec); __ lui(mdo, Assembler::split_high((int)md->encoding())); __ addiu(mdo, mdo, Assembler::split_low((int)md->encoding())); - - Address data_addr(mdo, md->byte_offset_of_slot(data, DataLayout::header_offset())); //FIXME, it very ineffictive to replace orl with 3 mips instruction @jerome, 12/27,06 @@ -2521,7 +2518,6 @@ void LIR_Assembler::emit_opTypeCheck(LIR } else { __ beq(obj, ZERO, done); __ delayed()->nop(); - } __ verify_oop(obj); diff -r d2a6a000ff33 -r d0a60cd6d61c hotspot/src/cpu/mips/vm/nativeInst_mips.cpp --- a/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp Sat Oct 30 17:47:17 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp Mon Nov 01 17:45:37 2010 +0800 @@ -37,15 +37,6 @@ void NativeInstruction::set_long_at(int } void NativeCall::verify() { -/* - // Make sure code pattern is actually a call imm32 instruction. - int inst = ubyte_at(0); - if (inst != instruction_code) { - tty->print_cr("Addr: " INTPTR_FORMAT " Code: 0x%x", instruction_address(), - inst); - fatal("not a call disp32"); - } -*/ // make sure code pattern is actually a call instruction if ( !is_op(Assembler::lui_op) || !is_op(long_at(4), Assembler::addiu_op) || @@ -145,136 +136,9 @@ void NativeCall::insert(address code_pos // selfs (spinlock). Then patches the last byte, and then atomicly replaces // the jmp's with the first 4 byte of the new instruction. void NativeCall::replace_mt_safe(address instr_addr, address code_buffer) { -/* - assert(Patching_lock->is_locked() || - SafepointSynchronize::is_at_safepoint(), "concurrent code patching"); - assert (instr_addr != NULL, "illegal address for code patching"); - - NativeCall* n_call = nativeCall_at (instr_addr); // checking that it is a call - if (os::is_MP()) { - guarantee((intptr_t)instr_addr % BytesPerWord == 0, "must be aligned"); - } - - // First patch dummy jmp in place - unsigned char patch[4]; - assert(sizeof(patch)==sizeof(jint), "sanity check"); - patch[0] = 0xEB; // jmp rel8 - patch[1] = 0xFE; // jmp to self - patch[2] = 0xEB; - patch[3] = 0xFE; - - // First patch dummy jmp in place - *(jint*)instr_addr = *(jint *)patch; - - // Invalidate. Opteron requires a flush after every write. - n_call->wrote(0); - - // Patch 4th byte - instr_addr[4] = code_buffer[4]; - - n_call->wrote(4); - - // Patch bytes 0-3 - *(jint*)instr_addr = *(jint *)code_buffer; ----- End forwarded message ----- -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Tue Nov 2 04:38:49 2010 From: liuqi at loongson.cn (LIU Qi) Date: Tue, 2 Nov 2010 19:38:49 +0800 Subject: [liuqi@icedtea.classpath.org: /hg/openjdk6-mips: Added some missing files.] Message-ID: <20101102113849.GD14421@loongson.cn> ----- Forwarded message from liuqi at icedtea.classpath.org ----- Date: Tue, 02 Nov 2010 04:07:09 +0000 From: liuqi at icedtea.classpath.org To: distro-pkg-dev at openjdk.java.net Subject: /hg/openjdk6-mips: Added some missing files. changeset a7a1c6bde40a in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=a7a1c6bde40a author: Ao Qi date: Tue Nov 02 10:34:12 2010 +0800 Added some missing files. These files are omitted in the previous commit to fix the building complete JRE problem. diffstat: 14 files changed, 800 insertions(+) hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/mips/DbxMIPSThread.java | 86 +++++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/mips/DbxMIPSThreadContext.java | 46 +++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/mips/DbxMIPSThreadFactory.java | 44 +++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips/LinuxMIPSCFrame.java | 75 ++++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips/LinuxMIPSThreadContext.java | 46 +++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips/MIPSThreadContext.java | 118 ++++++++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips/ProcMIPSThread.java | 91 +++++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips/ProcMIPSThreadContext.java | 46 +++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips/ProcMIPSThreadFactory.java | 44 +++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips/RemoteMIPSThread.java | 53 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips/RemoteMIPSThreadContext.java | 50 ++++ hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips/RemoteMIPSThreadFactory.java | 44 +++ hotspot/make/linux/makefiles/mipsel.make | 42 +++ hotspot/make/linux/platform_mipsel | 15 + diffs (truncated from 856 to 500 lines): diff -r d0a60cd6d61c -r a7a1c6bde40a hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/mips/DbxMIPSThread.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/mips/DbxMIPSThread.java Tue Nov 02 10:34:12 2010 +0800 @@ -0,0 +1,86 @@ +/* + * Copyright 2010 Lemote, Inc. All Rights Reserved. + * 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. + * + */ + +package sun.jvm.hotspot.debugger.dbx.mips; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.mips.*; +import sun.jvm.hotspot.debugger.dbx.*; +import sun.jvm.hotspot.utilities.*; + +public class DbxMIPSThread implements ThreadProxy { + private DbxDebugger debugger; + private int id; + + public DbxMIPSThread(DbxDebugger debugger, Address addr) { + this.debugger = debugger; + + // FIXME: the size here should be configurable. However, making it + // so would produce a dependency on the "types" package from the + // debugger package, which is not desired. + this.id = (int) addr.getCIntegerAt(0, 4, true); + } + + public DbxMIPSThread(DbxDebugger debugger, long id) { + this.debugger = debugger; + this.id = (int) id; + } + + public boolean equals(Object obj) { + if ((obj == null) || !(obj instanceof DbxMIPSThread)) { + return false; + } + + return (((DbxMIPSThread) obj).id == id); + } + + public int hashCode() { + return id; + } + + public ThreadContext getContext() throws IllegalThreadStateException { + DbxMIPSThreadContext context = new DbxMIPSThreadContext(debugger); + long[] regs = debugger.getThreadIntegerRegisterSet(id); + if (Assert.ASSERTS_ENABLED) { + Assert.that(regs.length == 19, "unknown size of register set -- adjust this code"); + } + for (int i = 0; i < regs.length; i++) { + context.setRegister(i, regs[i]); + } + return context; + } + + public boolean canSetContext() throws DebuggerException { + return false; + } + + public void setContext(ThreadContext context) + throws IllegalThreadStateException, DebuggerException { + throw new DebuggerException("Unimplemented"); + } + + public String toString() { + return "t@" + id; + } +} diff -r d0a60cd6d61c -r a7a1c6bde40a hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/mips/DbxMIPSThreadContext.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/mips/DbxMIPSThreadContext.java Tue Nov 02 10:34:12 2010 +0800 @@ -0,0 +1,46 @@ +/* + * Copyright 2010 Lemote, Inc. All Rights Reserved. + * 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. + * + */ + +package sun.jvm.hotspot.debugger.dbx.mips; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.mips.*; +import sun.jvm.hotspot.debugger.dbx.*; + +public class DbxMIPSThreadContext extends MIPSThreadContext { + private DbxDebugger debugger; + + public DbxMIPSThreadContext(DbxDebugger debugger) { + super(); + this.debugger = debugger; + } + + public void setRegisterAsAddress(int index, Address value) { + setRegister(index, debugger.getAddressValue(value)); + } + + public Address getRegisterAsAddress(int index) { + return debugger.newAddress(getRegister(index)); + } +} diff -r d0a60cd6d61c -r a7a1c6bde40a hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/mips/DbxMIPSThreadFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/mips/DbxMIPSThreadFactory.java Tue Nov 02 10:34:12 2010 +0800 @@ -0,0 +1,44 @@ +/* + * Copyright 2010 Lemote, Inc. All Rights Reserved. + * 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. + * + */ + +package sun.jvm.hotspot.debugger.dbx.mips; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.dbx.*; + +public class DbxMIPSThreadFactory implements DbxThreadFactory { + private DbxDebugger debugger; + + public DbxMIPSThreadFactory(DbxDebugger debugger) { + this.debugger = debugger; + } + + public ThreadProxy createThreadWrapper(Address threadIdentifierAddr) { + return new DbxMIPSThread(debugger, threadIdentifierAddr); + } + + public ThreadProxy createThreadWrapper(long id) { + return new DbxMIPSThread(debugger, id); + } +} diff -r d0a60cd6d61c -r a7a1c6bde40a hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips/LinuxMIPSCFrame.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips/LinuxMIPSCFrame.java Tue Nov 02 10:34:12 2010 +0800 @@ -0,0 +1,75 @@ +/* + * Copyright 2010 Lemote, Inc. All Rights Reserved. + * 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. + * + */ + +package sun.jvm.hotspot.debugger.linux.mips; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.linux.*; +import sun.jvm.hotspot.debugger.cdbg.*; +import sun.jvm.hotspot.debugger.cdbg.basic.*; + +final public class LinuxMIPSCFrame extends BasicCFrame { + // package/class internals only + public LinuxMIPSCFrame(LinuxDebugger dbg, Address ebp, Address pc) { + super(dbg.getCDebugger()); + this.ebp = ebp; + this.pc = pc; + this.dbg = dbg; + } + + // override base class impl to avoid ELF parsing + public ClosestSymbol closestSymbolToPC() { + // try native lookup in debugger. + return dbg.lookup(dbg.getAddressValue(pc())); + } + + public Address pc() { + return pc; + } + + public Address localVariableBase() { + return ebp; + } + + public CFrame sender() { + if (ebp == null) { + return null; + } + + Address nextEBP = ebp.getAddressAt( 0 * ADDRESS_SIZE); + if (nextEBP == null) { + return null; + } + Address nextPC = ebp.getAddressAt( 1 * ADDRESS_SIZE); + if (nextPC == null) { + return null; + } + return new LinuxMIPSCFrame(dbg, nextEBP, nextPC); + } + + private static final int ADDRESS_SIZE = 4; + private Address pc; + private Address ebp; + private LinuxDebugger dbg; +} diff -r d0a60cd6d61c -r a7a1c6bde40a hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips/LinuxMIPSThreadContext.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips/LinuxMIPSThreadContext.java Tue Nov 02 10:34:12 2010 +0800 @@ -0,0 +1,46 @@ +/* + * Copyright 2010 Lemote, Inc. All Rights Reserved. + * 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. + * + */ + +package sun.jvm.hotspot.debugger.linux.mips; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.mips.*; +import sun.jvm.hotspot.debugger.linux.*; + +public class LinuxMIPSThreadContext extends MIPSThreadContext { + private LinuxDebugger debugger; + + public LinuxMIPSThreadContext(LinuxDebugger debugger) { + super(); + this.debugger = debugger; + } + + public void setRegisterAsAddress(int index, Address value) { + setRegister(index, debugger.getAddressValue(value)); + } + + public Address getRegisterAsAddress(int index) { + return debugger.newAddress(getRegister(index)); + } +} diff -r d0a60cd6d61c -r a7a1c6bde40a hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips/MIPSThreadContext.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips/MIPSThreadContext.java Tue Nov 02 10:34:12 2010 +0800 @@ -0,0 +1,118 @@ +/* + * Copyright 2010 Lemote, Inc. All Rights Reserved. + * 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. + * + */ + +package sun.jvm.hotspot.debugger.mips; + +import sun.jvm.hotspot.debugger.*; + +/** Specifies the thread context on x86 platforms; only a sub-portion + of the context is guaranteed to be present on all operating + systems. */ + +public abstract class MIPSThreadContext implements ThreadContext { + // Taken from /usr/include/ia32/sys/reg.h on Solaris/x86 + + // NOTE: the indices for the various registers must be maintained as + // listed across various operating systems. However, only a small + // subset of the registers' values are guaranteed to be present (and + // must be present for the SA's stack walking to work): EAX, EBX, + // ECX, EDX, ESI, EDI, EBP, ESP, and EIP. + + public static final int ZERO = 0; + public static final int AT = 1; + public static final int V0 = 2; + public static final int V1 = 3; + public static final int A0 = 4; + public static final int A1 = 5; + public static final int A2 = 6; + public static final int A3 = 7; + public static final int T0 = 8; + public static final int T1 = 9; + public static final int T2 = 10; + public static final int T3 = 11; + public static final int T4 = 12; + public static final int T5 = 13; + public static final int T6 = 14; + public static final int T7 = 15; + public static final int S0 = 16; + public static final int S1 = 17; + public static final int S2 = 18; + public static final int S3 = 19; + public static final int S4 = 20; + public static final int S5 = 21; + public static final int S6 = 22; + public static final int S7 = 23; + public static final int T8 = 24; + public static final int T9 = 25; + public static final int K0 = 26; + public static final int K1 = 27; + public static final int GP = 28; + public static final int SP = 29; + public static final int FP = 30; + public static final int RA = 31; + + + + private static final String[] regNames = { + "ZERO", "AT", "V0", "V1", + "A0", "A1", "A2", "A3", + "T0", "T1", "T2", "T3", + "T4", "T5", "T6", "T7", + "S0", "S1", "S2", "S3", + "S4", "S5", "S6", "S7", + "T8", "T9", "K0", "K1" + "GP", "SP", "FP", "RA" + }; + + // Ought to be int on x86 but we're stuck + private long[] data; + + public MIPSThreadContext() { + data = new long[NPRGREG]; + } + + public int getNumRegisters() { + return NPRGREG; + } + + public String getRegisterName(int index) { + return regNames[index]; + } + + public void setRegister(int index, long value) { + data[index] = value; + } + + public long getRegister(int index) { + return data[index]; + } + + /** This can't be implemented in this class since we would have to + tie the implementation to, for example, the debugging system */ + public abstract void setRegisterAsAddress(int index, Address value); + + /** This can't be implemented in this class since we would have to + tie the implementation to, for example, the debugging system */ + public abstract Address getRegisterAsAddress(int index); +} diff -r d0a60cd6d61c -r a7a1c6bde40a hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips/ProcMIPSThread.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips/ProcMIPSThread.java Tue Nov 02 10:34:12 2010 +0800 @@ -0,0 +1,91 @@ +/* + * Copyright 2010 Lemote, Inc. All Rights Reserved. + * 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. + * + */ + +package sun.jvm.hotspot.debugger.proc.mips; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.mips.*; +import sun.jvm.hotspot.debugger.proc.*; +import sun.jvm.hotspot.utilities.*; + +public class ProcMIPSThread implements ThreadProxy { + private ProcDebugger debugger; + private int id; + + public ProcMIPSThread(ProcDebugger debugger, Address addr) { + this.debugger = debugger; + + // FIXME: the size here should be configurable. However, making it + // so would produce a dependency on the "types" package from the + // debugger package, which is not desired. + this.id = (int) addr.getCIntegerAt(0, 4, true); + } + + public ProcMIPSThread(ProcDebugger debugger, long id) { + this.debugger = debugger; + this.id = (int) id; + } + + public ThreadContext getContext() throws IllegalThreadStateException { + ProcMIPSThreadContext context = new ProcMIPSThreadContext(debugger); + long[] regs = debugger.getThreadIntegerRegisterSet(id); + /* + _NGREG in reg.h is defined to be 19. Because we have included + debug registers MIPSThreadContext.NPRGREG is 25. + */ + ----- End forwarded message ----- -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Thu Nov 4 02:58:47 2010 From: liuqi at loongson.cn (LIU Qi) Date: Thu, 4 Nov 2010 17:58:47 +0800 Subject: [liuqi@icedtea.classpath.org: /hg/openjdk6-mips: Fix 2 bugs related to patching and make some ...] Message-ID: <20101104095847.GA15070@loongson.cn> ----- Forwarded message from liuqi at icedtea.classpath.org ----- Date: Thu, 04 Nov 2010 05:46:05 +0000 From: liuqi at icedtea.classpath.org To: distro-pkg-dev at openjdk.java.net Subject: /hg/openjdk6-mips: Fix 2 bugs related to patching and make some ... changeset 388ae1bd0bdd in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=388ae1bd0bdd author: YANG Yongqiang date: Thu Nov 04 11:15:53 2010 +0800 Fix 2 bugs related to patching and make some codes more readable. 1. In MIPS, oops-table used by relocating must be updated accordingly when patching. 2. Allocate enough space for patching. 3. Make NativeInstructions more readable. NativeCall's size is 16 bytes instead of 12. If 12 is used, we must fix it by adding 4 explicitly. diffstat: 7 files changed, 112 insertions(+), 81 deletions(-) hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp | 20 +++++-- hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp | 24 +------- hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp | 61 +++++++++++++++++----- hotspot/src/cpu/mips/vm/nativeInst_mips.cpp | 39 ++++---------- hotspot/src/cpu/mips/vm/nativeInst_mips.hpp | 21 ++++--- hotspot/src/share/vm/c1/c1_LIRAssembler.cpp | 3 - hotspot/src/share/vm/c1/c1_Runtime1.cpp | 25 ++++++++- diffs (truncated from 502 to 500 lines): diff -r a7a1c6bde40a -r 388ae1bd0bdd hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp Tue Nov 02 10:34:12 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_CodeStubs_mips.cpp Thu Nov 04 11:15:53 2010 +0800 @@ -273,7 +273,7 @@ void MonitorExitStub::emit_code(LIR_Asse // - in runtime: after initializing class, restore original code, reexecute instruction //int PatchingStub::_patch_info_offset = -NativeGeneralJump::instruction_size; -int PatchingStub::_patch_info_offset = -(NativeCall::instruction_size + 4); +int PatchingStub::_patch_info_offset = -NativeCall::instruction_size; void PatchingStub::align_patch_site(MacroAssembler* masm) { // We're patching a 5-7 byte instruction on intel and we need to @@ -289,7 +289,7 @@ void PatchingStub::align_patch_site(Macr } void PatchingStub::emit_code(LIR_Assembler* ce) { -// assert(NativeCall::instruction_size <= _bytes_to_copy && _bytes_to_copy <= 0xFF, "not enough room for call"); + assert(NativeCall::instruction_size <= _bytes_to_copy && _bytes_to_copy <= 0xFF, "not enough room for call"); assert(_bytes_to_copy <= 0xFF, "not enough room for call"); Label call_patch; @@ -311,6 +311,9 @@ void PatchingStub::emit_code(LIR_Assembl __ relocate(rspec); __ lui(_obj, Assembler::split_high((int)o)); __ addiu(_obj, _obj, Assembler::split_low((int)o)); + while ((intx)__ pc() - (intx)start < NativeCall::instruction_size) { + __ nop(); + } #ifdef ASSERT for (int i = 0; i < _bytes_to_copy; i++) { address ptr = (address)(_pc_start + i); @@ -322,11 +325,15 @@ void PatchingStub::emit_code(LIR_Assembl // make a copy the code which is going to be patched. assert((_bytes_to_copy&3)==0, "change this code"); + address start = __ pc(); for ( int i = 0; i < _bytes_to_copy; i+=4) { __ a_long (*(int*)(_pc_start + i)); //make the site look like a nop, @jerome *(int*)(_pc_start + i)=0; } + while ((intx)__ pc() - (intx)start < NativeCall::instruction_size) { + __ nop(); + } } address end_of_patch = __ pc(); @@ -393,7 +400,7 @@ void PatchingStub::emit_code(LIR_Assembl assert(patch_info_pc - end_of_patch == bytes_to_skip, "incorrect patch info"); address entry = __ pc(); - NativeGeneralJump::insert_unconditional((address)_pc_start, entry); + NativeGeneralJump::insert_unconditional((address)_pc_start, entry); address target = NULL; switch (_id) { case access_field_id: target = Runtime1::entry_for(Runtime1::access_field_patching_id); break; @@ -418,13 +425,14 @@ void PatchingStub::emit_code(LIR_Assembl __ delayed()->nop(); // Add enough nops so deoptimization can overwrite the jmp above with a call // and not destroy the world. - for (int j = __ offset() ; j < jmp_off + NativeCall::instruction_size + 4 ; j+=4 ) { + for (int j = __ offset(); j < jmp_off + NativeCall::instruction_size; j += 4 ) { __ nop(); } if (_id == load_klass_id) { CodeSection* cs = __ code_section(); - RelocIterator iter(cs, (address)_pc_start, (address)(_pc_start + 1)); - relocInfo::change_reloc_info_for_address(&iter, (address) _pc_start, relocInfo::oop_type, relocInfo::none); + address pc = (address)_pc_start; + RelocIterator iter(cs, pc, pc + 1); + relocInfo::change_reloc_info_for_address(&iter, pc, relocInfo::oop_type, relocInfo::none); } } diff -r a7a1c6bde40a -r 388ae1bd0bdd hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Tue Nov 02 10:34:12 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Thu Nov 04 11:15:53 2010 +0800 @@ -546,8 +546,8 @@ void LIR_Assembler::swap_reg(Register a, void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_code, CodeEmitInfo* info) { assert(src->is_constant(), "should not call otherwise"); - assert(dest->is_register(), "should not call otherwise"); - LIR_Const* c = src->as_constant_ptr(); + assert(dest->is_register(), "should not call otherwise"); + LIR_Const* c = src->as_constant_ptr(); switch (c->type()) { case T_INT: { @@ -585,21 +585,7 @@ void LIR_Assembler::const2reg(LIR_Opr sr case T_OBJECT: { if (patch_code == lir_patch_none) { - if (c->as_jobject() == NULL) { - NEEDS_CLEANUP - int oop_index = __ oop_recorder()->allocate_index(c->as_jobject()); - RelocationHolder rspec = oop_Relocation::spec(oop_index); - __ relocate(rspec); - __ lui(dest->as_register(), Assembler::split_high((int) c->as_jobject() )); - __ addiu( dest->as_register() , dest->as_register() , - Assembler::split_low((int) c->as_jobject())); - } else { - int oop_index = __ oop_recorder()->find_index(c->as_jobject()); - RelocationHolder rspec = oop_Relocation::spec(oop_index); - __ relocate(rspec); - __ lui(dest->as_register(), Assembler::split_high((int)c->as_jobject())); - __ addiu(dest->as_register(), dest->as_register(), Assembler::split_low((int)c->as_jobject())); - } + jobject2reg(c->as_jobject(), dest->as_register()); } else { jobject2reg_with_patching(dest->as_register(), info); } @@ -4188,10 +4174,6 @@ void LIR_Assembler::jobject2reg(jobject // This seems wrong as we do not emit relocInfo // for classes that are not loaded yet, i.e., they will be // never GC'd - NEEDS_CLEANUP - int oop_index = __ oop_recorder()->allocate_index(o); - RelocationHolder rspec = oop_Relocation::spec(oop_index); - __ relocate(rspec); __ lui(reg, Assembler::split_high((int)o)); __ addiu(reg, reg, Assembler::split_low((int)o)); } else { diff -r a7a1c6bde40a -r 388ae1bd0bdd hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp Tue Nov 02 10:34:12 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp Thu Nov 04 11:15:53 2010 +0800 @@ -220,21 +220,19 @@ const int float_regs_as_doubles_size_in_ // account. // enum reg_save_layout { - //F0_off = 0, - //F31_off = F0_off + 31, - //T0_off = F31_off + 1, T0_off = 0, -// T8_off = T0_off + 8, -// T9_off, S0_off = T0_off + 8, FP_off = S0_off + 8, + T8_off, + T9_off, SP_off, V0_off, V1_off, -/* A0_off, + A0_off, A1_off, A2_off, - A3_off,*/ + A3_off, + GP_off, //temp_2_off, temp_1_off, saved_fp_off, @@ -279,6 +277,14 @@ static OopMap* generate_oop_map(StubAsse for (Register r = S0; r != S7->successor(); r = r->successor() ) { map->set_callee_saved(VMRegImpl::stack2reg(S0_off + num_rt_args + i++), r->as_VMReg()); } + map->set_callee_saved(VMRegImpl::stack2reg(FP_off + num_rt_args), FP->as_VMReg()); + map->set_callee_saved(VMRegImpl::stack2reg(GP_off + num_rt_args), GP->as_VMReg()); + map->set_callee_saved(VMRegImpl::stack2reg(T8_off + num_rt_args), T8->as_VMReg()); + map->set_callee_saved(VMRegImpl::stack2reg(T9_off + num_rt_args), T9->as_VMReg()); + map->set_callee_saved(VMRegImpl::stack2reg(A0_off + num_rt_args), A0->as_VMReg()); + map->set_callee_saved(VMRegImpl::stack2reg(A1_off + num_rt_args), A1->as_VMReg()); + map->set_callee_saved(VMRegImpl::stack2reg(A2_off + num_rt_args), A2->as_VMReg()); + map->set_callee_saved(VMRegImpl::stack2reg(A3_off + num_rt_args), A3->as_VMReg()); return map; } @@ -298,9 +304,17 @@ static OopMap* save_live_registers(StubA for (Register r = S0; r != S7->successor(); r = r->successor() ) { __ sw(r, SP, (r->encoding() - S0->encoding() + S0_off) * wordSize); } + __ sw(FP, SP, FP_off * wordSize); + __ sw(GP, SP, GP_off * wordSize); + __ sw(T8, SP, T8_off * wordSize); + __ sw(T9, SP, T9_off * wordSize); + __ sw(A0, SP, A0_off * wordSize); + __ sw(A1, SP, A1_off * wordSize); + __ sw(A2, SP, A2_off * wordSize); + __ sw(A3, SP, A3_off * wordSize); __ sw(V0, SP, V0_off * wordSize); __ sw(V1, SP, V1_off * wordSize); - + return generate_oop_map(sasm, num_rt_args, save_fpu_registers, describe_fpu_registers); } @@ -312,6 +326,16 @@ static void restore_fpu(StubAssembler* s for (Register r = S0; r != S7->successor(); r = r->successor() ) { __ lw(r, SP, (r->encoding() - S0->encoding() + S0_off) * wordSize); } + __ lw(FP, SP, FP_off * wordSize); + __ lw(GP, SP, GP_off * wordSize); + + __ lw(T8, SP, T8_off * wordSize); + __ lw(T9, SP, T9_off * wordSize); + __ lw(A0, SP, A0_off * wordSize); + __ lw(A1, SP, A1_off * wordSize); + __ lw(A2, SP, A2_off * wordSize); + __ lw(A3, SP, A3_off * wordSize); + __ lw(V0, SP, V0_off * wordSize); __ lw(V1, SP, V1_off * wordSize); __ addiu(SP, SP, (reg_save_frame_size - 2) * wordSize); @@ -332,6 +356,15 @@ static void restore_live_registers_excep for (Register r = S0; r != S7->successor(); r = r->successor() ) { __ lw(r, SP, (r->encoding() - S0->encoding() + S0_off) * wordSize); } + __ lw(FP, SP, FP_off * wordSize); + __ lw(GP, SP, GP_off * wordSize); + + __ lw(T8, SP, T8_off * wordSize); + __ lw(T9, SP, T9_off * wordSize); + __ lw(A0, SP, A0_off * wordSize); + __ lw(A1, SP, A1_off * wordSize); + __ lw(A2, SP, A2_off * wordSize); + __ lw(A3, SP, A3_off * wordSize); __ lw(V1, SP, V1_off * wordSize); __ addiu(SP, SP, (reg_save_frame_size - 2)* wordSize); @@ -561,10 +594,9 @@ OopMapSet* Runtime1::generate_patching(S // distinguish each RT-Call. // Note: This number affects also the RT-Call in generate_handle_exception because // the oop-map is shared for all calls. - //FIXME,for mips, I do not think it is need - const int num_rt_args = 1; // thread - // const int num_rt_args = 2; // for x86 version, thread + dummy ,push (eax) + + DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob(); assert(deopt_blob != NULL, "deoptimization blob must have been created"); @@ -582,6 +614,7 @@ OopMapSet* Runtime1::generate_patching(S #endif __ move(A0, thread); + /* * NOTE: this frame should be compiled frame, but at this point, the pc in frame-anchor * is contained in interpreter. It should be wrong, and should be cleared but is not. @@ -589,7 +622,7 @@ OopMapSet* Runtime1::generate_patching(S * is not right. It depends on that the caller pc is stored in *(sp - 1) but it's not the case */ __ set_last_Java_frame(thread, NOREG, FP, NULL); - __ addi(SP, SP, (-1) * wordSize); + __ addiu(SP, SP, (-1) * wordSize); __ move(AT, -8); __ andr(SP, SP, AT); __ relocate(relocInfo::internal_pc_type); @@ -681,7 +714,6 @@ OopMapSet* Runtime1::generate_patching(S __ bind(L); } - // Runtime will return true if the nmethod has been deoptimized during // the patching process. In that case we must do a deopt reexecute instead. @@ -693,12 +725,14 @@ OopMapSet* Runtime1::generate_patching(S // Will reexecute. Proper return address is already on the stack we just restore // registers, pop all of our frame but the return address and jump to the deopt blob restore_live_registers(sasm); + __ leave(); __ jmp(deopt_blob->unpack_with_reexecution(), relocInfo::runtime_call_type); __ delayed()->nop(); __ bind(cont); restore_live_registers(sasm); + __ leave(); __ jr(RA); __ delayed()->nop(); @@ -1216,6 +1250,7 @@ OopMapSet* Runtime1::generate_code_for(S StubFrame f(sasm, "access_field_patching", dont_gc_arguments); // we should set up register map oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching)); + } break; diff -r a7a1c6bde40a -r 388ae1bd0bdd hotspot/src/cpu/mips/vm/nativeInst_mips.cpp --- a/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp Tue Nov 02 10:34:12 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp Thu Nov 04 11:15:53 2010 +0800 @@ -125,6 +125,7 @@ void NativeCall::insert(address code_pos __ lui(T9, Assembler::split_high((int)entry)); __ addiu(T9, T9, Assembler::split_low((int)entry)); __ jalr (); + __ delayed()->nop(); #undef __ ICache::invalidate_range(call->addr_at(0), instruction_size); @@ -153,11 +154,7 @@ void NativeMovConstReg::print() { } void NativeMovConstReg::set_data(int x) { - set_long_at(0, (long_at(0) & 0xffff0000) | (Assembler::split_high(x) & 0xffff)); - set_long_at(4, (long_at(4) & 0xffff0000) | (Assembler::split_low(x) & 0xffff)); - ICache::invalidate_range(addr_at(0), 8); - // ICache::invalidate_all(); #ifndef CORE // also store the value into an oop_Relocation cell, if any CodeBlob* nm = CodeCache::find_blob(instruction_address()); @@ -172,12 +169,15 @@ void NativeMovConstReg::set_data(int x) *oop_addr = (oop)x; } else { assert(oop_addr == r->oop_addr(), "must be only one set-oop here"); - } } + } } } +#endif -#endif + set_long_at(0, (long_at(0) & 0xffff0000) | (Assembler::split_high(x) & 0xffff)); + set_long_at(4, (long_at(4) & 0xffff0000) | (Assembler::split_low(x) & 0xffff)); + ICache::invalidate_range(addr_at(0), 8); } //------------------------------------------------------------------- @@ -272,18 +272,14 @@ void NativeGeneralJump::set_jump_destin // we now use b to do this. be careful when using this method // by yjl 9/16/2005 void NativeGeneralJump::insert_unconditional(address code_pos, address entry) { - CodeBuffer cb(code_pos, instruction_size + 4); + CodeBuffer cb(code_pos, instruction_size); MacroAssembler masm(&cb); #define __ masm. -// __ lui(AT, Assembler::split_high((int)entry)); -// __ addiu(AT, AT, Assembler::split_low((int)entry)); -// __ jr (AT); -// __ delayed()->nop(); __ b(entry); __ delayed()->nop(); #undef __ - ICache::invalidate_range(code_pos, instruction_size + 4); + ICache::invalidate_range(code_pos, instruction_size); } @@ -293,20 +289,9 @@ void NativeGeneralJump::insert_unconditi // the jmp's with the first 4 byte of the new instruction. void NativeGeneralJump::replace_mt_safe(address instr_addr, address code_buffer) { NativeGeneralJump* h_jump = nativeGeneralJump_at (instr_addr); - int i0, i1 , i2; - if(!h_jump->is_short()) { - i2 = ((int*)code_buffer)[2]; - h_jump->set_long_at(2 * BytesPerInstWord, i2); - } - - i1 = ((int*)code_buffer)[1]; - h_jump->set_long_at(1 * BytesPerInstWord, i1); - i0 = ((int*)code_buffer)[0]; - h_jump->set_long_at(0 * BytesPerInstWord, i0); - - // beq ZERO, ZERO, -1 - // 0001 0000 0000 0000 1111 1111 1111 1111 - + assert(NativeGeneralJump::instruction_size == NativeCall::instruction_size, + "note::Runtime1::patch_code uses NativeCall::instruction_size"); + memcpy(instr_addr, code_buffer, NativeCall::instruction_size); ICache::invalidate_range(h_jump->addr_at(0), instruction_size); } @@ -341,7 +326,7 @@ void NativeGeneralJump::patch_verified_e *(unsigned int *)(verified_entry + 8) = code_buffer[2]; *(unsigned int *)(verified_entry + 12) = code_buffer[3]; - ICache::invalidate_range(verified_entry, instruction_size + 4); + ICache::invalidate_range(verified_entry, instruction_size); //ICache::invalidate_all(); } diff -r a7a1c6bde40a -r 388ae1bd0bdd hotspot/src/cpu/mips/vm/nativeInst_mips.hpp --- a/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp Tue Nov 02 10:34:12 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp Thu Nov 04 11:15:53 2010 +0800 @@ -135,7 +135,7 @@ class NativeCall: public NativeInstructi enum mips_specific_constants { //instruction_code = 0xE8, instruction_offset = 0, - instruction_size = 12, + instruction_size = 16, return_address_offset = 16, displacement_offset = 0 }; @@ -347,23 +347,25 @@ class NativeMovRegMemPatching: public Na // lui reg, split_high(addr) // addiu reg, split_low(addr) // jr reg +// nop // or // beq ZERO, ZERO, offset +// nop class NativeGeneralJump: public NativeInstruction { public: enum mips_specific_constants { instruction_offset = 0, beq_opcode = 0x10000000,//000100|00000|00000|offset b_mask = 0xffff0000, - short_size = 4, - instruction_size = 12 + short_size = 8, + instruction_size = 16 }; bool is_short() const { return (long_at(instruction_offset) & b_mask) == beq_opcode; } address instruction_address() const { return addr_at(instruction_offset); } address jump_destination() const { if ( is_short() ) { - return addr_at(short_size) + Assembler::imm_off(long_at(instruction_offset)) * 4; + return addr_at(4) + Assembler::imm_off(long_at(instruction_offset)) * 4; } return (address)Assembler::merge(long_at(4)&0xffff, long_at(instruction_offset)&0xffff); } @@ -416,12 +418,14 @@ public: }; // return instruction that does not pop values of the stack +// jr RA +// delay slot class NativeReturn: public NativeInstruction { public: - enum Intel_specific_constants { - instruction_size = 4, + enum mips_specific_constants { + instruction_size = 8, instruction_offset = 0, - next_instruction_offset = 4 + next_instruction_offset = 8 }; }; @@ -477,8 +481,7 @@ inline bool NativeInstruction::is_jump() return ((long_at(0) & NativeGeneralJump::b_mask) == NativeGeneralJump::beq_opcode) || (is_op(long_at(0), Assembler::lui_op) && is_op(long_at(4), Assembler::addiu_op) && - is_special_op(long_at(8), Assembler::jr_op) && - !is_rs(long_at(8), RA) ); + is_special_op(long_at(8), Assembler::jr_op)); } inline bool NativeInstruction::is_cond_jump() { return is_int_branch() || is_float_branch(); } diff -r a7a1c6bde40a -r 388ae1bd0bdd hotspot/src/share/vm/c1/c1_LIRAssembler.cpp --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp Tue Nov 02 10:34:12 2010 +0800 +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp Thu Nov 04 11:15:53 2010 +0800 @@ -28,12 +28,9 @@ void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) { // we must have enough patching space so that call can be inserted -#ifndef MIPS32 while ((intx) _masm->pc() - (intx) patch->pc_start() < NativeCall::instruction_size) { _masm->nop(); } -#endif - patch->install(_masm, patch_code, obj, info); append_patching_stub(patch); diff -r a7a1c6bde40a -r 388ae1bd0bdd hotspot/src/share/vm/c1/c1_Runtime1.cpp --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp Tue Nov 02 10:34:12 2010 +0800 +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp Thu Nov 04 11:15:53 2010 +0800 @@ -874,7 +874,7 @@ JRT_ENTRY(void, Runtime1::patch_code(Jav NativeGeneralJump* jump = nativeGeneralJump_at(caller_frame.pc()); address instr_pc = jump->jump_destination(); NativeInstruction* ni = nativeInstruction_at(instr_pc); - if (ni->is_jump() ) { + if (ni->is_jump()) { // the jump has not been patched yet // The jump destination is slow case and therefore not part of the stubs // (stubs are only for StaticCalls) @@ -993,7 +993,28 @@ JRT_ENTRY(void, Runtime1::patch_code(Jav RelocIterator iter(nm, (address)instr_pc, (address)(instr_pc + 1)); relocInfo::change_reloc_info_for_address(&iter, (address) instr_pc, relocInfo::none, relocInfo::oop_type); -#if defined(SPARC) +#ifdef MIPS32 + // Update the oop location in the nmethod with the proper + // oop. When the code was generated, a NULL was stuffed + // in the oop table and that table needs to be update to + // have the right value. On intel the value is kept + // directly in the instruction instead of in the oop + // table, so set_data above effectively updated the value. + RelocIterator oops(nm, instr_pc, instr_pc + 1); + bool found = false; + while (oops.next() && !found) { + if (oops.type() == relocInfo::oop_type) { + oop_Relocation* r = oops.oop_reloc(); + oop* oop_adr = r->oop_addr(); + *oop_adr = load_klass(); + r->fix_oop_relocation(); + found = true; + } + } + assert(found, "the oop must exist!"); +#endif + +#if defined(SPARC) // Sparc takes two relocations for an oop so update the second one. ----- End forwarded message ----- -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Sat Nov 6 05:03:14 2010 From: liuqi at loongson.cn (LIU Qi) Date: Sat, 6 Nov 2010 20:03:14 +0800 Subject: [liuqi@icedtea.classpath.org: /hg/openjdk6-mips: Fix a bug in the register allocator.] Message-ID: <20101106120314.GA7217@loongson.cn> ----- Forwarded message from liuqi at icedtea.classpath.org ----- Date: Sat, 06 Nov 2010 09:36:56 +0000 From: liuqi at icedtea.classpath.org To: distro-pkg-dev at openjdk.java.net Subject: /hg/openjdk6-mips: Fix a bug in the register allocator. changeset da31f361800f in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=da31f361800f author: YANG Yongqiang date: Fri Nov 05 17:36:30 2010 +0800 Fix a bug in the register allocator. In MIPS, float registers containing double-precision operands must be both adjacent physically and aligned. A single-precision operand takes up two float registers temporarily. Thus, one of them is wasted. diffstat: 3 files changed, 67 insertions(+), 143 deletions(-) hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp | 132 +++++++++++----------- hotspot/src/cpu/mips/vm/c1_LinearScan_mips.hpp | 77 ------------ hotspot/src/share/vm/runtime/reflection.cpp | 1 diffs (244 lines): diff -r 388ae1bd0bdd -r da31f361800f hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Thu Nov 04 11:15:53 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Fri Nov 05 17:36:30 2010 +0800 @@ -2367,72 +2367,72 @@ void LIR_Assembler::emit_opTypeCheck(LIR void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { LIR_Code code = op->code(); if (code == lir_store_check) { - Register value = op->object()->as_register(); - Register array = op->array()->as_register(); - Register k_RInfo = op->tmp1()->as_register(); - Register klass_RInfo = op->tmp2()->as_register(); - - CodeStub* stub = op->stub(); - Label done; - - __ beq(value, ZERO, done); - __ delayed()->nop(); - add_debug_info_for_null_check_here(op->info_for_exception()); - - __ lw(k_RInfo, array, oopDesc::klass_offset_in_bytes()); - __ lw(klass_RInfo, value, oopDesc::klass_offset_in_bytes()); - - __ lw(k_RInfo, k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc)); - // get super_check_offset - //for SIGBUS, FIXME, Jerome - __ nop(); - __ nop(); - __ lw(T9, k_RInfo, sizeof(oopDesc) + Klass::super_check_offset_offset_in_bytes()); - - // See if we get an immediate positive hit - __ add(AT, klass_RInfo, T9); - __ lw(AT, AT, 0); - __ beq(k_RInfo, AT, done); - __ delayed()->nop(); - - // check for immediate negative hit - __ move(AT, sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes()); - __ bne(T9, AT, *stub->entry()); // fail - __ delayed()->nop(); - - // check for self - __ beq(klass_RInfo, k_RInfo, done); - __ delayed()->nop(); - - // super type array - __ lw(T8, klass_RInfo, sizeof(oopDesc) + Klass::secondary_supers_offset_in_bytes()); - // length - __ lw(T9, T8, arrayOopDesc::length_offset_in_bytes()); - - // base - __ addi(T8, T8, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); - - Label miss, hit, loop; - // T9:count, T8:base, k_RInfo: super klass - __ bind(loop); - __ beq(T9, ZERO, miss); - __ delayed()->lw(AT, T8, 0); - __ beq(AT, k_RInfo, hit); - __ delayed(); - __ addiu(T9, T9, -1); - __ b(loop); - __ delayed(); - __ addi(T8, T8, 1 * wordSize); - - __ bind(miss); - __ b(*stub->entry()); - __ delayed()->nop(); - - __ bind(hit); - __ sw(k_RInfo, klass_RInfo, sizeof(oopDesc) - + Klass::secondary_super_cache_offset_in_bytes()); - - __ bind(done); + Register value = op->object()->as_register(); + Register array = op->array()->as_register(); + Register k_RInfo = op->tmp1()->as_register(); + Register klass_RInfo = op->tmp2()->as_register(); + + CodeStub* stub = op->stub(); + Label done; + + __ beq(value, ZERO, done); + __ delayed()->nop(); + add_debug_info_for_null_check_here(op->info_for_exception()); + + __ lw(k_RInfo, array, oopDesc::klass_offset_in_bytes()); + __ lw(klass_RInfo, value, oopDesc::klass_offset_in_bytes()); + + __ lw(k_RInfo, k_RInfo, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc)); + // get super_check_offset + //for SIGBUS, FIXME, Jerome + __ nop(); + __ nop(); + __ lw(T9, k_RInfo, sizeof(oopDesc) + Klass::super_check_offset_offset_in_bytes()); + + // See if we get an immediate positive hit + __ add(AT, klass_RInfo, T9); + __ lw(AT, AT, 0); + __ beq(k_RInfo, AT, done); + __ delayed()->nop(); + + // check for immediate negative hit + __ move(AT, sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes()); + __ bne(T9, AT, *stub->entry()); // fail + __ delayed()->nop(); + + // check for self + __ beq(klass_RInfo, k_RInfo, done); + __ delayed()->nop(); + + // super type array + __ lw(T8, klass_RInfo, sizeof(oopDesc) + Klass::secondary_supers_offset_in_bytes()); + // length + __ lw(T9, T8, arrayOopDesc::length_offset_in_bytes()); + + // base + __ addi(T8, T8, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); + + Label miss, hit, loop; + // T9:count, T8:base, k_RInfo: super klass + __ bind(loop); + __ beq(T9, ZERO, miss); + __ delayed()->lw(AT, T8, 0); + __ beq(AT, k_RInfo, hit); + __ delayed(); + __ addiu(T9, T9, -1); + __ b(loop); + __ delayed(); + __ addi(T8, T8, 1 * wordSize); + + __ bind(miss); + __ b(*stub->entry()); + __ delayed()->nop(); + + __ bind(hit); + __ sw(k_RInfo, klass_RInfo, sizeof(oopDesc) + + Klass::secondary_super_cache_offset_in_bytes()); + + __ bind(done); } else if (op->code() == lir_checkcast) { // we always need a stub for the failure case. CodeStub* stub = op->stub(); diff -r 388ae1bd0bdd -r da31f361800f hotspot/src/cpu/mips/vm/c1_LinearScan_mips.hpp --- a/hotspot/src/cpu/mips/vm/c1_LinearScan_mips.hpp Thu Nov 04 11:15:53 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LinearScan_mips.hpp Fri Nov 05 17:36:30 2010 +0800 @@ -36,7 +36,7 @@ inline int LinearScan::num_physical_regs inline bool LinearScan::requires_adjacent_regs(BasicType type) { - return false; + return type == T_FLOAT || type == T_DOUBLE; } inline bool LinearScan::is_caller_save(int assigned_reg) { @@ -68,78 +68,3 @@ inline bool LinearScanWalker::pd_init_re } return false; } - -/* -class FpuStackAllocator VALUE_OBJ_CLASS_SPEC { - private: - Compilation* _compilation; - LinearScan* _allocator; - - LIR_OpVisitState visitor; - - LIR_List* _lir; - int _pos; - FpuStackSim _sim; - FpuStackSim _temp_sim; - - bool _debug_information_computed; - - LinearScan* allocator() { return _allocator; } - Compilation* compilation() const { return _compilation; } - - // unified bailout support - void bailout(const char* msg) const { compilation()->bailout(msg); } - bool bailed_out() const { return compilation()->bailed_out(); } - - int pos() { return _pos; } - void set_pos(int pos) { _pos = pos; } - LIR_Op* cur_op() { return lir()->instructions_list()->at(pos()); } - LIR_List* lir() { return _lir; } - void set_lir(LIR_List* lir) { _lir = lir; } - FpuStackSim* sim() { return &_sim; } - FpuStackSim* temp_sim() { return &_temp_sim; } - - int fpu_num(LIR_Opr opr); - int tos_offset(LIR_Opr opr); - LIR_Opr to_fpu_stack_top(LIR_Opr opr, bool dont_check_offset = false); - - // Helper functions for handling operations - void insert_op(LIR_Op* op); - void insert_exchange(int offset); - void insert_exchange(LIR_Opr opr); - void insert_free(int offset); - void insert_free_if_dead(LIR_Opr opr); - void insert_free_if_dead(LIR_Opr opr, LIR_Opr ignore); - void insert_copy(LIR_Opr from, LIR_Opr to); - void do_rename(LIR_Opr from, LIR_Opr to); - void do_push(LIR_Opr opr); - void pop_if_last_use(LIR_Op* op, LIR_Opr opr); - void pop_always(LIR_Op* op, LIR_Opr opr); - void clear_fpu_stack(LIR_Opr preserve); - void handle_op1(LIR_Op1* op1); - void handle_op2(LIR_Op2* op2); - void handle_opCall(LIR_OpCall* opCall); - void compute_debug_information(LIR_Op* op); - void allocate_exception_handler(XHandler* xhandler); - void allocate_block(BlockBegin* block); - -#ifndef PRODUCT - void check_invalid_lir_op(LIR_Op* op); -#endif - - // Helper functions for merging of fpu stacks - void merge_insert_add(LIR_List* instrs, FpuStackSim* cur_sim, int reg); - void merge_insert_xchg(LIR_List* instrs, FpuStackSim* cur_sim, int slot); - void merge_insert_pop(LIR_List* instrs, FpuStackSim* cur_sim); - bool merge_rename(FpuStackSim* cur_sim, FpuStackSim* sux_sim, int start_slot, int change_slot); - void merge_fpu_stack(LIR_List* instrs, FpuStackSim* cur_sim, FpuStackSim* sux_sim); - void merge_cleanup_fpu_stack(LIR_List* instrs, FpuStackSim* cur_sim, BitMap& live_fpu_regs); - bool merge_fpu_stack_with_successors(BlockBegin* block); - - public: - LIR_Opr to_fpu_stack(LIR_Opr opr); // used by LinearScan for creation of debug information - - FpuStackAllocator(Compilation* compilation, LinearScan* allocator); - void allocate(); -}; -*/ diff -r 388ae1bd0bdd -r da31f361800f hotspot/src/share/vm/runtime/reflection.cpp --- a/hotspot/src/share/vm/runtime/reflection.cpp Thu Nov 04 11:15:53 2010 +0800 +++ b/hotspot/src/share/vm/runtime/reflection.cpp Fri Nov 05 17:36:30 2010 +0800 @@ -862,7 +862,6 @@ oop Reflection::invoke(instanceKlassHand // resolve based on the receiver if (instanceKlass::cast(reflected_method->method_holder())->is_interface()) { // resolve interface call - tty->print_cr("resolve interface call"); if (ReflectionWrapResolutionErrors) { // new default: 6531596 // Match resolution errors with those thrown due to reflection inlining ----- End forwarded message ----- -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Sat Nov 6 05:12:17 2010 From: liuqi at loongson.cn (LIU Qi) Date: Sat, 6 Nov 2010 20:12:17 +0800 Subject: OpenJDK MIPS port releases the init document Message-ID: <20101106121216.GA7549@loongson.cn> Hi guys, We have written up some OpenJDK MIPS port related information on this wiki page: http://icedtea.classpath.org/wiki/MIPSPort We will update and rich the information continuously. Any comments and suggestions are welcomed. Regards, Qi -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Mon Nov 8 06:12:42 2010 From: liuqi at loongson.cn (LIU Qi) Date: Mon, 8 Nov 2010 22:12:42 +0800 Subject: [liuqi@icedtea.classpath.org: /hg/openjdk6-mips: Fix bug related to the unsafe ops.] Message-ID: <20101108141241.GA2249@loongson.cn> FYI. ----- Forwarded message from liuqi at icedtea.classpath.org ----- Date: Mon, 08 Nov 2010 12:35:05 +0000 From: liuqi at icedtea.classpath.org To: distro-pkg-dev at openjdk.java.net Subject: /hg/openjdk6-mips: Fix bug related to the unsafe ops. changeset 8ef762f87d0e in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=8ef762f87d0e author: YANG Yongqiang date: Mon Nov 08 19:53:05 2010 +0800 Fix bug related to the unsafe ops. diffstat: 2 files changed, 17 insertions(+), 12 deletions(-) hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp | 17 +++++++++++------ hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp | 12 ++++++------ diffs (117 lines): diff -r da31f361800f -r 8ef762f87d0e hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Fri Nov 05 17:36:30 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Mon Nov 08 19:53:05 2010 +0800 @@ -2371,6 +2371,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR Register array = op->array()->as_register(); Register k_RInfo = op->tmp1()->as_register(); Register klass_RInfo = op->tmp2()->as_register(); + Register tmp = op->tmp3()->as_register(); CodeStub* stub = op->stub(); Label done; @@ -2387,27 +2388,29 @@ void LIR_Assembler::emit_opTypeCheck(LIR //for SIGBUS, FIXME, Jerome __ nop(); __ nop(); - __ lw(T9, k_RInfo, sizeof(oopDesc) + Klass::super_check_offset_offset_in_bytes()); + __ lw(tmp, k_RInfo, sizeof(oopDesc) + Klass::super_check_offset_offset_in_bytes()); // See if we get an immediate positive hit - __ add(AT, klass_RInfo, T9); + __ add(AT, klass_RInfo, tmp); + __ lw(AT, AT, 0); __ beq(k_RInfo, AT, done); __ delayed()->nop(); // check for immediate negative hit __ move(AT, sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes()); - __ bne(T9, AT, *stub->entry()); // fail + __ bne(tmp, AT, *stub->entry()); // fail __ delayed()->nop(); // check for self __ beq(klass_RInfo, k_RInfo, done); __ delayed()->nop(); + __ push(T8); // super type array __ lw(T8, klass_RInfo, sizeof(oopDesc) + Klass::secondary_supers_offset_in_bytes()); // length - __ lw(T9, T8, arrayOopDesc::length_offset_in_bytes()); + __ lw(tmp, T8, arrayOopDesc::length_offset_in_bytes()); // base __ addi(T8, T8, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); @@ -2415,22 +2418,24 @@ void LIR_Assembler::emit_opTypeCheck(LIR Label miss, hit, loop; // T9:count, T8:base, k_RInfo: super klass __ bind(loop); - __ beq(T9, ZERO, miss); + __ beq(tmp, ZERO, miss); __ delayed()->lw(AT, T8, 0); __ beq(AT, k_RInfo, hit); __ delayed(); - __ addiu(T9, T9, -1); + __ addiu(tmp, tmp, -1); __ b(loop); __ delayed(); __ addi(T8, T8, 1 * wordSize); __ bind(miss); + __ pop(T8); __ b(*stub->entry()); __ delayed()->nop(); __ bind(hit); __ sw(k_RInfo, klass_RInfo, sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes()); + __ pop(T8); __ bind(done); } else if (op->code() == lir_checkcast) { diff -r da31f361800f -r 8ef762f87d0e hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp Fri Nov 05 17:36:30 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp Mon Nov 08 19:53:05 2010 +0800 @@ -1269,9 +1269,9 @@ void LIRGenerator::volatile_field_load(L void LIRGenerator::get_Object_unsafe(LIR_Opr dst, LIR_Opr src, LIR_Opr offset, BasicType type, bool is_volatile) { - __ add(src, src, offset); + __ add(src, offset, offset); if (is_volatile && type == T_LONG) { - LIR_Address* addr = new LIR_Address(src, 0, T_DOUBLE); + LIR_Address* addr = new LIR_Address(offset, 0, T_DOUBLE); LIR_Opr tmp = new_register(T_DOUBLE); __ load(addr, tmp); LIR_Opr spill = new_register(T_LONG); @@ -1279,7 +1279,7 @@ void LIRGenerator::get_Object_unsafe(LIR __ move(tmp, spill); __ move(spill, dst); } else { - LIR_Address* addr = new LIR_Address(src, 0, type); + LIR_Address* addr = new LIR_Address(offset, 0, type); __ load(addr, dst); } } @@ -1287,9 +1287,9 @@ void LIRGenerator::get_Object_unsafe(LIR void LIRGenerator::put_Object_unsafe(LIR_Opr src, LIR_Opr offset, LIR_Opr data, BasicType type, bool is_volatile) { - __ add(src, src, offset); + __ add(src, offset, offset); if (is_volatile && type == T_LONG) { - LIR_Address* addr = new LIR_Address(src, 0, T_DOUBLE); + LIR_Address* addr = new LIR_Address(offset, 0, T_DOUBLE); LIR_Opr tmp = new_register(T_DOUBLE); LIR_Opr spill = new_register(T_DOUBLE); set_vreg_flag(spill, must_start_in_memory); @@ -1298,7 +1298,7 @@ void LIRGenerator::put_Object_unsafe(LIR __ move(tmp, addr); } else { - LIR_Address* addr = new LIR_Address(src, 0, type); + LIR_Address* addr = new LIR_Address(offset, 0, type); bool is_obj = (type == T_ARRAY || type == T_OBJECT); if (is_obj) { // Do the pre-write barrier, if any. ----- End forwarded message ----- -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Mon Nov 8 22:58:22 2010 From: liuqi at loongson.cn (LIU Qi) Date: Tue, 9 Nov 2010 14:58:22 +0800 Subject: [liuqi@icedtea.classpath.org: /hg/openjdk6-mips: Add information in README and env.sh; added a...] Message-ID: <20101109065822.GA14910@loongson.cn> ----- Forwarded message from liuqi at icedtea.classpath.org ----- Date: Tue, 09 Nov 2010 06:30:03 +0000 From: liuqi at icedtea.classpath.org To: distro-pkg-dev at openjdk.java.net Subject: /hg/openjdk6-mips: Add information in README and env.sh; added a... changeset 82bf91673f25 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=82bf91673f25 author: Ao Qi date: Tue Nov 09 13:21:20 2010 +0800 Add information in README and env.sh; added a missing file to make the completed build. diffstat: 5 files changed, 91 insertions(+), 52 deletions(-) README | 32 ++++++++++++++++++++++++++++-- env.sh | 23 +++++++++++++++++++++ env_debug.sh | 27 ------------------------- env_product.sh | 23 --------------------- jdk/src/solaris/bin/mips64/jvm.cfg | 38 ++++++++++++++++++++++++++++++++++++ diffs (181 lines): diff -r 8ef762f87d0e -r 82bf91673f25 README --- a/README Mon Nov 08 19:53:05 2010 +0800 +++ b/README Tue Nov 09 13:21:20 2010 +0800 @@ -6,20 +6,48 @@ README: "corba", "jaxws" and "jaxp". See http://openjdk.java.net/ for more information about the OpenJDK. + See http://icedtea.classpath.org/wiki/MIPSPort for more information about the OpenJDK MIPS Port. Simple Build Instructions: 1. Download and install a JDK 6 from http://java.sun.com/javase/downloads/index.jsp Set the environment variable ALT_BOOTDIR to the location of this JDK 6. + If using Debian: + apt-get install openjdk-6-jdk + export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk - 2. Check the sanity of doing a build with the current machine: + 2. Download Binary Plugs, go to the OpenJDK site and select the "Bundles(6)" link and download + the binaryplugs. The file downloaded is a jar file that must be extracted by running the jar + file with: + java -jar jdk-6-ea-plug-bnn-os-arch-dd_month_year.jar + Set the environment variable ALT_BINARY_PLUGS_PATH to the root of this installation. + + 3. Set other environment variables. If using Debian: + source env.sh + Check the sanity of doing a build with the current machine: gnumake sanity See README-builds.html if you run into problems. - 3. Do a complete build of the jdk: + 4. Do a complete build of the jdk: gnumake all + When building jaxp, it seems a bug that jdk6-jaxp-2009_10_13.zip cannot be downloaded. + The workaround is to download it by "wget ", and set ALT_DROPS_DIR to the dir where the zip is: + export ALT_DROPS_DIR=~/zip_dir The resulting JDK image should be found in build/*/j2sdk-image + + 5. By setting the environment variables below, components can be built separately. + For example: + export BUILD_HOTSPOT=true + export BUILD_LANGTOOLS=false + export BUILD_CORBA=false + export BUILD_JAXP=false + export BUILD_JAXWS=false + export BUILD_JDK=false + export BUILD_DEPLOY=false + + 6. The default hotspot-build is all_product. Set DEBUG_NAME would change the target: + export DEBUG_NAME=debug where gnumake is GNU make 3.78.1 or newer, /usr/bin/make on Linux and /usr/sfw/bin/gmake or /opt/sfw/bin/gmake on Solaris. diff -r 8ef762f87d0e -r 82bf91673f25 env.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/env.sh Tue Nov 09 13:21:20 2010 +0800 @@ -0,0 +1,23 @@ +export LANG=C +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk/bin +export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk +export ALT_BINARY_PLUGS_PATH=~/openjdk-binary-plugs +export ARCH_DATA_MODEL=32 + +unset CLASSPATH +unset JAVA_HOME + +#The default hotspot-build is all_product. Setting DEBUG_NAME would change the target. +#export DEBUG_NAME=debug + +# By setting the environment variables below, components can be built separately. +#export BUILD_LANGTOOLS=false +#export BUILD_CORBA=false +#export BUILD_JAXP=false +#export BUILD_JAXWS=false +#export BUILD_JDK=false +#export BUILD_DEPLOY=false + +# When building jaxp, it seems a bug that jdk6-jaxp-2009_10_13.zip cannot be downloaded. +# The workaround is to download it by "wget ", and set ALT_DROPS_DIR to the dir where the zip is. +#export ALT_DROPS_DIR=~/zip_dir diff -r 8ef762f87d0e -r 82bf91673f25 env_debug.sh --- a/env_debug.sh Mon Nov 08 19:53:05 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -export LANG=C -export LC_ALL=C -export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk/bin -export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk -#export ALT_BOOTDIR=/home/loongson/java/j2sdk-gs2 -export ALT_BINARY_PLUGS_PATH=/opt/java/openjdk-binary-plugs -#export ALT_JDK_IMPORT_PATH=/usr/lib/jvm/java-6-openjdk -export ARCH_DATA_MODEL=32 - -#The default hotspot-build is all_product. Setting DEBUG_NAME would change the target. -export DEBUG_NAME=debug - -# If want to build entire JDK, set all envs below true. -export BUILD_LANGTOOLS=false -export BUILD_CORBA=false -export BUILD_JAXP=false -export BUILD_JAXWS=false -# When building jaxp, it seems a bug that jdk6-jaxp-2009_10_13.zip cannot be downloaded. -# The workaround is to download it by "wget ", and set ALT_DROPS_DIR to the dir where the zip is. -#export ALT_DROPS_DIR=~/zip_dir - -export BUILD_MOTIF=false -export BUILD_JDK=false -export BUILD_DEPLOY=false - -unset CLASSPATH -unset JAVA_HOME diff -r 8ef762f87d0e -r 82bf91673f25 env_product.sh --- a/env_product.sh Mon Nov 08 19:53:05 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -export LC_ALL=C -export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk/bin -export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk -export ALT_BINARY_PLUGS_PATH=/opt/java/openjdk-binary-plugs -export ARCH_DATA_MODEL=32 - -#The default hotspot-build is all_product. Setting DEBUG_NAME would change the target. - -# If want to build entire JDK, set all envs below true. -export BUILD_LANGTOOLS=false -export BUILD_CORBA=false -export BUILD_JAXP=false -export BUILD_JAXWS=false -# When building jaxp, it seems a bug that jdk6-jaxp-2009_10_13.zip cannot be downloaded. -# The workaround is to download it by "wget ", and set ALT_DROPS_DIR to the dir where the zip is. -#export ALT_DROPS_DIR=~/zip_dir - -export BUILD_MOTIF=false -export BUILD_JDK=false -export BUILD_DEPLOY=false - -unset CLASSPATH -unset JAVA_HOME diff -r 8ef762f87d0e -r 82bf91673f25 jdk/src/solaris/bin/mips64/jvm.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/src/solaris/bin/mips64/jvm.cfg Tue Nov 09 13:21:20 2010 +0800 @@ -0,0 +1,38 @@ +# Copyright 2001-2003 Sun Microsystems, Inc. All Rights Reserved. +# 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. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# 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. +# +# List of JVMs that can be used as an option to java, javac, etc. +# Order is important -- first in this list is the default JVM. +# NOTE that this both this file and its format are UNSUPPORTED and +# WILL GO AWAY in a future release. +# +# You may also select a JVM in an arbitrary location with the +# "-XXaltjvm=" option, but that too is unsupported +# and may not be available in a future release. +# +-client IF_SERVER_CLASS -server +-server KNOWN +-hotspot ALIASED_TO -client +-classic WARN +-native ERROR +-green ERROR ----- End forwarded message ----- -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Thu Nov 11 05:07:46 2010 From: liuqi at loongson.cn (LIU Qi) Date: Thu, 11 Nov 2010 21:07:46 +0800 Subject: [liuqi@icedtea.classpath.org: /hg/openjdk6-mips: 2 new changesets] Message-ID: <20101111130746.GA10652@loongson.cn> ----- Forwarded message from liuqi at icedtea.classpath.org ----- Date: Thu, 11 Nov 2010 13:03:57 +0000 From: liuqi at icedtea.classpath.org To: distro-pkg-dev at openjdk.java.net Subject: /hg/openjdk6-mips: 2 new changesets changeset b7ec29b378c9 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=b7ec29b378c9 author: Ao Qi date: Thu Nov 11 19:59:55 2010 +0800 Update codes to support deoptimization. changeset f4c60f770c45 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=f4c60f770c45 author: Ao Qi date: Thu Nov 11 19:35:44 2010 +0800 Update README and env.sh to remove the binary plugins information. diffstat: 10 files changed, 179 insertions(+), 184 deletions(-) README | 10 env.sh | 1 hotspot/src/cpu/mips/vm/assembler_mips.cpp | 41 +++ hotspot/src/cpu/mips/vm/assembler_mips.hpp | 3 hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp | 7 hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.hpp | 2 hotspot/src/cpu/mips/vm/frame_mips.cpp | 25 +- hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp | 270 ++++++++-------------- hotspot/src/share/vm/runtime/deoptimization.cpp | 2 hotspot/src/share/vm/runtime/sharedRuntime.cpp | 2 diffs (truncated from 639 to 500 lines): diff -r 82bf91673f25 -r f4c60f770c45 README --- a/README Tue Nov 09 13:21:20 2010 +0800 +++ b/README Thu Nov 11 19:35:44 2010 +0800 @@ -17,19 +17,13 @@ Simple Build Instructions: apt-get install openjdk-6-jdk export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk - 2. Download Binary Plugs, go to the OpenJDK site and select the "Bundles(6)" link and download - the binaryplugs. The file downloaded is a jar file that must be extracted by running the jar - file with: - java -jar jdk-6-ea-plug-bnn-os-arch-dd_month_year.jar - Set the environment variable ALT_BINARY_PLUGS_PATH to the root of this installation. - - 3. Set other environment variables. If using Debian: + 2. Set other environment variables. If using Debian: source env.sh Check the sanity of doing a build with the current machine: gnumake sanity See README-builds.html if you run into problems. - 4. Do a complete build of the jdk: + 3. Do a complete build of the jdk: gnumake all When building jaxp, it seems a bug that jdk6-jaxp-2009_10_13.zip cannot be downloaded. The workaround is to download it by "wget ", and set ALT_DROPS_DIR to the dir where the zip is: diff -r 82bf91673f25 -r f4c60f770c45 env.sh --- a/env.sh Tue Nov 09 13:21:20 2010 +0800 +++ b/env.sh Thu Nov 11 19:35:44 2010 +0800 @@ -1,7 +1,6 @@ export LANG=C export LANG=C export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-openjdk/bin export ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk -export ALT_BINARY_PLUGS_PATH=~/openjdk-binary-plugs export ARCH_DATA_MODEL=32 unset CLASSPATH diff -r 82bf91673f25 -r f4c60f770c45 hotspot/src/cpu/mips/vm/assembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/assembler_mips.cpp Tue Nov 09 13:21:20 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/assembler_mips.cpp Thu Nov 11 19:35:44 2010 +0800 @@ -1063,7 +1063,9 @@ void MacroAssembler::warn(const char* ms pop_CPU_state(); */ - save_registers(this); + //save_registers(this); + pushad(); + addi(SP, SP, -4); sw(A0, SP, -1 * wordSize); move(A0, (int)msg); addi(SP, SP, -1 * wordSize); @@ -1071,8 +1073,43 @@ void MacroAssembler::warn(const char* ms delayed()->nop(); addi(SP, SP, 1 * wordSize); lw(A0, SP, -1 * wordSize); - restore_registers(this); + addi(SP, SP, 4); + popad(); + //restore_registers(this); } + +#ifndef PRODUCT +//FIXME cannot print sp +void MacroAssembler::print_reg(Register reg) { + pushad(); + push(FP); + char* a = new char[50]; + sprintf(a, "%s: 0x",reg->name()); + move(A0, (int)a); + call(CAST_FROM_FN_PTR(address, SharedRuntime::print_str),relocInfo::runtime_call_type); + delayed()->nop(); + pop(FP); + popad(); + + pushad(); + push(FP); + move(A0, reg); + call(CAST_FROM_FN_PTR(address, SharedRuntime::print_int),relocInfo::runtime_call_type); + delayed()->nop(); + pop(FP); + popad(); + + pushad(); + push(FP); + char* b = new char[50]; + sprintf(b, " pc: %p\n",pc()); + move(A0, (int)b); + call(CAST_FROM_FN_PTR(address, SharedRuntime::print_str),relocInfo::runtime_call_type); + delayed()->nop(); + pop(FP); + popad(); +} +#endif void MacroAssembler::increment(Register reg, int imm) { if (!imm) return; diff -r 82bf91673f25 -r f4c60f770c45 hotspot/src/cpu/mips/vm/assembler_mips.hpp --- a/hotspot/src/cpu/mips/vm/assembler_mips.hpp Tue Nov 09 13:21:20 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/assembler_mips.hpp Thu Nov 11 19:35:44 2010 +0800 @@ -1365,6 +1365,9 @@ static void restore_registers(MacroAssem static void debug32(int rdi, int rsi, int rbp, int rsp, int rbx, int rdx, int rcx, int rax, int eip, char* msg); static void debug64(char* msg, int64_t pc, int64_t regs[]); +#ifndef PRODUCT + void print_reg(Register reg); +#endif //void os_breakpoint(); void untested() { stop("untested"); } diff -r 82bf91673f25 -r f4c60f770c45 hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Tue Nov 09 13:21:20 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Thu Nov 11 19:35:44 2010 +0800 @@ -433,10 +433,9 @@ void LIR_Assembler::emit_deopt_handler() compilation()->offsets()->set_value(CodeOffsets::Deopt, code_offset()); - InternalAddress here(__ pc()); - //FIXE:: may be wrong, Address_Literal - __ lw(AT, __ as_Address(here) ); - __ push(AT); + __ jmp(SharedRuntime::deopt_blob()->unpack()); + __ delayed()->nop(); + assert(code_offset() - offset <= deopt_handler_size, "overflow"); __ end_a_stub(); diff -r 82bf91673f25 -r f4c60f770c45 hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.hpp --- a/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.hpp Tue Nov 09 13:21:20 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.hpp Thu Nov 11 19:35:44 2010 +0800 @@ -51,5 +51,5 @@ public: enum { call_stub_size = NOT_LP64(24) LP64_ONLY(28), exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(175), - deopt_handler_size = NOT_LP64(12) LP64_ONLY(17) + deopt_handler_size = NOT_LP64(16) LP64_ONLY(17) }; diff -r 82bf91673f25 -r f4c60f770c45 hotspot/src/cpu/mips/vm/frame_mips.cpp --- a/hotspot/src/cpu/mips/vm/frame_mips.cpp Tue Nov 09 13:21:20 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/frame_mips.cpp Thu Nov 11 19:35:44 2010 +0800 @@ -82,7 +82,30 @@ void frame::patch_pc(Thread* thread, add if (TracePcPatching) { tty->print_cr("patch_pc at address 0x%x [0x%x -> 0x%x] ", &((address *)_sp)[-1], ((address *)_sp)[-1], pc); } - ((address *)_sp)[-1] = _pc = pc; + + RegisterMap map((JavaThread *)thread, false); + frame check = ((JavaThread *)thread)->last_frame(); + if (id() != check.id()) + { + while (id() != check.sender(&map).id()) { + check = check.sender(&map); + } + if (check.is_interpreted_frame()) + *(check.fp() + 1) = (int)pc; + else + ((address *)_sp)[-1] = pc; + } + + _cb = CodeCache::find_blob(pc); + if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { + address orig = (((nmethod*)_cb)->get_original_pc(this)); + assert(orig == _pc, "expected original to be stored before patching"); + _deopt_state = is_deoptimized; + // leave _pc as is + } else { + _deopt_state = not_deoptimized; + _pc = pc; + } } bool frame::is_interpreted_frame() const { diff -r 82bf91673f25 -r f4c60f770c45 hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp --- a/hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp Tue Nov 09 13:21:20 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp Thu Nov 11 19:35:44 2010 +0800 @@ -3212,64 +3212,59 @@ void SharedRuntime::generate_deopt_blob( // allocate space for the code ResourceMark rm; // setup code generation tools - //int pad = VerifyThread ? 512 : 0;// Extra slop space for more verify code - // CodeBuffer* buffer = new CodeBuffer(2048+pad, 512, 0, 0, 0, false); CodeBuffer buffer ("deopt_blob", 2048, 2048); MacroAssembler* masm = new MacroAssembler( & buffer); -//int frame_size, exception_offset, reexecute_offset; int frame_size_in_words; OopMap* map = NULL; - // Account for the extra args we place on the stack - // by the time we call fetch_unroll_info - const int additional_words = 2; // deopt kind, thread - OopMapSet *oop_maps = new OopMapSet(); + // Account for the extra args we place on the stack + // by the time we call fetch_unroll_info + const int additional_words = 2; // deopt kind, thread + + OopMapSet *oop_maps = new OopMapSet(); + address start = __ pc(); Label cont; - // we use S3 for DeOpt reason register - Register reason = S3; - // use S1 for thread register - Register thread = TREG; - // use S7 for fetch_unroll_info returned UnrollBlock - Register unroll = S7; + // we use S3 for DeOpt reason register + Register reason = S3; + // use S1 for thread register + Register thread = TREG; + // use S7 for fetch_unroll_info returned UnrollBlock + Register unroll = S7; // Prolog for non exception case! - // Correct the return address we were given. - //FIXME, return address is on the tos or Ra? - __ addi(RA, RA, - (NativeCall::return_address_offset)); -// Save everything in sight. + // Correct the return address we were given. + //FIXME, return address is on the tos or Ra? + __ lw(RA, FP, (-1) * wordSize); + // Save everything in sight. map = RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words); - __ move(AT, Deoptimization::Unpack_deopt); - __ push(AT); + // Normal deoptimization + __ move(reason, Deoptimization::Unpack_deopt); __ b(cont); __ delayed()->nop(); int reexecute_offset = __ pc() - start; + // Reexecute case // return address is the pc describes what bci to do re-execute at + // No need to update map as each call to save_live_registers will produce identical oopmap - (void) RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words); - // __ pushl(Deoptimization::Unpack_reexecute); - // __ jmp(cont); - __ move(AT, Deoptimization::Unpack_reexecute); - __ push(AT); - __ b(cont); - __ delayed()->nop(); - -int exception_offset = __ pc() - start; - // Prolog for exception case + __ move(reason, Deoptimization::Unpack_reexecute); + __ b(cont); + __ delayed()->nop(); + + int exception_offset = __ pc() - start; + // Prolog for exception case // all registers are dead at this entry point, except for eax and // edx which contain the exception oop and exception pc // respectively. Set them in TLS and fall thru to the // unpack_with_exception_in_tls entry point. - //__ get_thread(edi); + __ get_thread(thread); - //__ movl(Address(edi, JavaThread::exception_pc_offset()), edx); __ sw(V1, thread, in_bytes(JavaThread::exception_pc_offset())); - // __ movl(Address(edi, JavaThread::exception_oop_offset()), eax); __ sw(V0, thread, in_bytes(JavaThread::exception_oop_offset())); int exception_in_tls_offset = __ pc() - start; -// new implementation because exception oop is now passed in JavaThread + // new implementation because exception oop is now passed in JavaThread // Prolog for exception case // All registers must be preserved because they might be used by LinearScan @@ -3281,47 +3276,36 @@ int exception_offset = __ pc() - start // It will be patched later with the throwing pc. The correct value is not // available now because loading it from memory would destroy registers. //__ pushl(0); - //It is no need here, because in save_live_register, we saved the return address(RA) - //FIXME here, do mips need patch the return address on stack? - // __ push(ZERO); - // Save everything in sight. + //It is no need here, because in save_live_register, we saved the return address(RA) + //FIXME here, do mips need patch the return address on stack? + // __ push(ZERO); + // Save everything in sight. // No need to update map as each call to save_live_registers will produce identical oopmap (void) RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words); // Now it is safe to overwrite any register // store the correct deoptimization type - // __ pushl(Deoptimization::Unpack_exception); - __ move(AT, Deoptimization::Unpack_exception); - __ push(AT); - // load throwing pc from JavaThread and patch it as the return address + __ move(reason, Deoptimization::Unpack_exception); + // load throwing pc from JavaThread and patch it as the return address // of the current frame. Then clear the field in JavaThread - // __ get_thread(edi); __ get_thread(thread); -// __ movl(edx, Address(edi, JavaThread::exception_pc_offset())); __ lw(V1, thread, in_bytes(JavaThread::exception_pc_offset())); -//we should save on the stack or register? - // __ movl(Address(ebp, wordSize), edx); - __ move(RA, V1); - // __ movl(Address(edi, JavaThread::exception_pc_offset()), NULL_WORD); - __ sw(ZERO, thread, in_bytes(JavaThread::exception_pc_offset())); + //we should save on the stack or register? + __ move(RA, V1); + __ sw(ZERO, thread, in_bytes(JavaThread::exception_pc_offset())); - + #ifdef ASSERT // verify that there is really an exception oop in JavaThread - // __ movl(eax, Address(edi, JavaThread::exception_oop_offset())); - __ lw(AT, thread, in_bytes(JavaThread::exception_oop_offset())); - //__ verify_oop(eax); - __ verify_oop(AT); + __ lw(AT, thread, in_bytes(JavaThread::exception_oop_offset())); + __ verify_oop(AT); // verify that there is no pending exception Label no_pending_exception; -// __ movl(eax, Address(edi, Thread::pending_exception_offset())); __ lw(AT, thread, in_bytes(Thread::pending_exception_offset())); - //__ testl(eax, eax); - //__ jcc(Assembler::zero, no_pending_exception); - __ beq(AT, ZERO, no_pending_exception); - __ delayed()->nop(); - __ stop("must not have pending exception here"); - __ bind(no_pending_exception); + __ beq(AT, ZERO, no_pending_exception); + __ delayed()->nop(); + __ stop("must not have pending exception here"); + __ bind(no_pending_exception); #endif __ bind(cont); // Compiled code leaves the floating point stack dirty, empty it. @@ -3330,28 +3314,17 @@ int exception_offset = __ pc() - start // Call C code. Need thread and this frame, but NOT official VM entry // crud. We cannot block on this call, no GC can happen. - - - - // All callee save registers or return value registers are saved at this poin - // Compiled code may leave the floating point stack dirty, empty it. +#ifndef OPT_THREAD + __ get_thread(thread); +#endif + __ move(A0, thread); + __ addiu(SP, SP, -2 * wordSize); + + __ set_last_Java_frame(thread, NOREG, NOREG, NULL); // Call fetch_unroll_info(). Need thread and this frame, but NOT official VM entry - cannot block on // this call, no GC can happen. Call should capture return values. -#ifndef OPT_THREAD - __ get_thread(thread); -#endif - __ set_last_Java_frame(thread, NOREG, NOREG, NULL); - - __ sw(SP, thread, in_bytes(JavaThread::last_Java_sp_offset())); - // push the one argument (relative to the oopmap) - // __ addiu(SP, SP, - 2*wordSize); - __ addiu(SP, SP, - wordSize); - __ move(AT, -8); - __ andr(SP, SP, AT); - __ move(A0, thread); - __ relocate(relocInfo::internal_pc_type); { int save_pc = (int)__ pc() + 12 + NativeCall::return_address_offset; @@ -3365,20 +3338,19 @@ int exception_offset = __ pc() - start __ jalr(T9); __ delayed()->nop(); oop_maps->add_gc_map(__ pc() - start, map); - // pop the arg so now frame offsets (slots) don't include any arg. - __ lw(SP, thread, in_bytes(JavaThread::last_Java_sp_offset())); + __ addiu(SP, SP, 2 * wordSize); + __ get_thread(thread); __ reset_last_Java_frame(thread, false, true); // Load UnrollBlock into S7 __ move(unroll, V0); - // Store frame locals in registers or memory // Move the unpack kind to a safe place in the UnrollBlock because // we are very short of registers Address unpack_kind(unroll, Deoptimization::UnrollBlock::unpack_kind_offset_in_bytes()); - __ pop(reason); + //__ pop(reason); __ sw(reason, unpack_kind); // save the unpack_kind value // Retrieve the possible live values (return values) @@ -3397,35 +3369,29 @@ int exception_offset = __ pc() - start __ verify_oop(V0); // Overwrite the result registers with the exception results. - //__ movl(Address(esp, RegisterSaver::eaxOffset()*wordSize), eax); __ sw(V0, SP, RegisterSaver::v0Offset()*wordSize); -// __ movl(Address(esp, RegisterSaver::edxOffset()*wordSize), edx); __ sw(V1, SP, RegisterSaver::v1Offset()*wordSize); __ bind(noException); -// __ lw(V0, SP, V0_off * wordSize); -// __ lw(V1, SP, V1_off * wordSize); - //__ lwc1(F0, SP, F0_off * wordSize); - //__ lwc1(F1, SP, (F0_off + 1) * wordSize); // Stack is back to only having register save data on the stack. // Now restore the result registers. Everything else is either dead or captured // in the vframeArray. RegisterSaver::restore_result_registers(masm); - // All of the register save area has been popped of the stack. Only the + // All of the register save area has been popped of the stack. Only the // return address remains. // Pop all the frames we must move/replace. - // Frame picture (youngest to oldest) + // Frame picture (youngest to oldest) // 1: self-frame (no frame link) // 2: deopting frame (no frame link) // 3: caller of deopting frame (could be compiled/interpreted). - // + // // Note: by leaving the return address of self-frame on the stack // and using the size of frame 2 to adjust the stack // when we are done the return to frame 3 will still be on the stack. - + // register for the sender's sp Register sender_sp = T5; // register for frame pcs @@ -3436,66 +3402,56 @@ int exception_offset = __ pc() - start Register count = T3; // Pop deoptimized frame - //__ addl(esp,Address(edi,Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset_in_bytes())); __ lw(AT, unroll, Deoptimization::UnrollBlock::size_of_deoptimized_frame_offset_in_bytes()); __ add(SP, SP, AT); // sp should be pointing at the return address to the caller (3) - // Load array of frame pcs into ECX - //__ movl(ecx,Address(edi,Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes())); - // Load array of frame pcs into T5 + + // Load array of frame pcs into T4 __ lw(pcs, unroll, Deoptimization::UnrollBlock::frame_pcs_offset_in_bytes()); - //__ popl(esi); // trash the old pc - //FIXME , do mips need trach the old pc - __ addi(SP, SP, wordSize); - // Load array of frame sizes into ESI -// __ movl(esi,Address(edi,Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes())); - // Load array of frame sizes into T6 + __ addi(SP, SP, wordSize); // trash the old pc + // Load array of frame sizes into T6 __ lw(sizes, unroll, Deoptimization::UnrollBlock::frame_sizes_offset_in_bytes()); - - Address counter(unroll, Deoptimization::UnrollBlock::counter_temp_offset_in_bytes()); - //__ movl(ebx, Address(edi, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes())); - //__ movl(counter, ebx); - // Load count of frams into T3 + + // Load count of frams into T3 __ lw(count, unroll, Deoptimization::UnrollBlock::number_of_frames_offset_in_bytes()); - __ sw(count, counter); // Pick up the initial fp we should save - // __ movl(ebp, Address(edi, Deoptimization::UnrollBlock::initial_fp_offset_in_bytes())); __ lw(FP, unroll, Deoptimization::UnrollBlock::initial_fp_offset_in_bytes()); // Now adjust the caller's stack to make up for the extra locals // but record the original sp so that we can save it in the skeletal interpreter // frame and the stack walking of interpreter_sender will get the unextended sp // value and not the "real" sp value. - __ move(sender_sp, SP); + __ move(sender_sp, SP); __ lw(AT, unroll, Deoptimization::UnrollBlock::caller_adjustment_offset_in_bytes()); __ sub(SP, SP, AT); - + // Push interpreter frames in a loop Label loop; - __ bind(loop); - __ lw(T2, sizes, 0); // Load frame size - __ lw(AT, pcs, 0); // save return address - __ sw(AT, SP, (-1) * wordSize); - __ sw(FP, SP, (-2) * wordSize); - __ addi(FP, SP, (-2) * wordSize); // save old & set new FP - __ sub(SP, SP, T2); // Prolog! + __ bind(loop); + __ lw(T2, sizes, 0); // Load frame size + __ lw(AT, pcs, 0); // save return address + __ addi(T2, T2, -2*wordSize); // we'll push pc and rbp, by hand + __ push2(AT, FP); + __ move(FP, SP); + __ sub(SP, SP, T2); // Prolog! // This value is corrected by layout_activation_impl - __ sw(ZERO, FP, frame::interpreter_frame_last_sp_offset * wordSize); - __ sw(sender_sp, FP, frame::interpreter_frame_sender_sp_offset * wordSize);// Make it walkable - __ move(sender_sp, SP); // pass to next frame - __ addi(count, count, -1); // decrement counter - __ addi(sizes, sizes, 4); // Bump array pointer (sizes) - __ bne(count, ZERO, loop); ----- End forwarded message ----- -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Fri Nov 12 22:31:42 2010 From: liuqi at loongson.cn (LIU Qi) Date: Sat, 13 Nov 2010 14:31:42 +0800 Subject: [liuqi@icedtea.classpath.org: /hg/openjdk6-mips: Fix the bug related to SP adjusting in genera...] Message-ID: <20101113063142.GA4645@loongson.cn> ----- Forwarded message from liuqi at icedtea.classpath.org ----- Date: Fri, 12 Nov 2010 08:30:36 +0000 From: liuqi at icedtea.classpath.org To: distro-pkg-dev at openjdk.java.net Subject: /hg/openjdk6-mips: Fix the bug related to SP adjusting in genera... changeset 87db8957684e in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=87db8957684e author: LIN Chuanwen date: Fri Nov 12 15:27:30 2010 +0800 Fix the bug related to SP adjusting in generate_deopt_blob. Before jump to interpreter, the SP must be adjusted to the end of the interpreter frame. diffstat: 1 file changed, 1 insertion(+), 4 deletions(-) hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp | 5 +---- diffs (15 lines): diff -r f4c60f770c45 -r 87db8957684e hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp --- a/hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp Thu Nov 11 19:35:44 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp Fri Nov 12 15:27:30 2010 +0800 @@ -3497,10 +3497,7 @@ void SharedRuntime::generate_deopt_blob( __ empty_FPU_stack(); //FIXME, we should consider about float and double // Push a float or double return value if necessary. - //__ leave(); - __ move(SP, FP); - __ lw(RA, SP, 1 * wordSize); - __ lw(FP, SP, 0 * wordSize); + __ leave(); // Jump to interpreter __ jr(RA); ----- End forwarded message ----- -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Mon Nov 22 05:56:48 2010 From: liuqi at loongson.cn (LIU Qi) Date: Mon, 22 Nov 2010 21:56:48 +0800 Subject: [liuqi@icedtea.classpath.org: /hg/openjdk6-mips: 3 new changesets] Message-ID: <20101122135648.GA26163@loongson.cn> ----- Forwarded message from liuqi at icedtea.classpath.org ----- Date: Mon, 22 Nov 2010 13:53:09 +0000 From: liuqi at icedtea.classpath.org To: distro-pkg-dev at openjdk.java.net Subject: /hg/openjdk6-mips: 3 new changesets changeset 1f91cc15cd21 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=1f91cc15cd21 author: YANG Yongqiang date: Wed Nov 17 17:46:08 2010 +0800 A wrong instruction(slt) was used. changeset 202786aed583 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=202786aed583 author: YANG Yongqiang date: Wed Nov 17 17:52:29 2010 +0800 Remove useless codes. changeset ab0d284dc313 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=ab0d284dc313 author: LIN Chuanwen date: Thu Nov 18 16:19:42 2010 +0800 Fix the bug when the C1 compiler dealing with CAS. In C1 compiler, the CAS operations(cas_int, cas_long and cas_obj) use AT as the result register. However, the CAS operation does not define the result operand. diffstat: 5 files changed, 60 insertions(+), 12 deletions(-) hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp | 10 ++-- hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp | 4 - hotspot/src/cpu/mips/vm/templateInterpreter_mips.cpp | 1 hotspot/src/share/vm/c1/c1_LIR.cpp | 38 +++++++++++++++++- hotspot/src/share/vm/c1/c1_LIR.hpp | 19 +++++++-- diffs (168 lines): diff -r 87db8957684e -r ab0d284dc313 hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp Fri Nov 12 15:27:30 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRGenerator_mips.cpp Thu Nov 18 16:19:42 2010 +0800 @@ -707,7 +707,7 @@ void LIRGenerator::do_AttemptUpdate(Intr __ add(addr, LIR_OprFact::intConst(value_offset), addr); LIR_Opr t1 = LIR_OprFact::illegalOpr; // no temp needed LIR_Opr t2 = LIR_OprFact::illegalOpr; // no temp needed - __ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2); + __ cas_long(addr, cmp_value.result(), new_value.result(), t1, t2, FrameMap::_at_opr); // generate conditional move of boolean result LIR_Opr result = rlock_result(x); @@ -749,17 +749,17 @@ void LIRGenerator::do_CompareAndSwap(Int } else { ShouldNotReachHere(); } - LIR_Opr addr = new_register(T_OBJECT); + LIR_Opr addr = new_pointer_register(); __ move(obj.result(), addr); __ add(addr, offset.result(), addr); LIR_Opr ill = LIR_OprFact::illegalOpr; // for convenience if (type == objectType) - __ cas_obj(addr, cmp.result(), val.result(), ill, ill); + __ cas_obj(addr, cmp.result(), val.result(), ill, ill, FrameMap::_at_opr); else if (type == intType) - __ cas_int(addr, cmp.result(), val.result(), ill, ill); + __ cas_int(addr, cmp.result(), val.result(), ill, ill, FrameMap::_at_opr); else if (type == longType) - __ cas_long(addr, cmp.result(), val.result(), ill, ill); + __ cas_long(addr, cmp.result(), val.result(), ill, ill, FrameMap::_at_opr); else { ShouldNotReachHere(); } diff -r 87db8957684e -r ab0d284dc313 hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp Fri Nov 12 15:27:30 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_Runtime1_mips.cpp Thu Nov 18 16:19:42 2010 +0800 @@ -916,7 +916,7 @@ OopMapSet* Runtime1::generate_code_for(S } else { __ set_info("new_object_array", dont_gc_arguments); } - + if (UseTLAB && FastTLABRefill) { Register arr_size = T0; Register t1 = T1; @@ -926,7 +926,7 @@ OopMapSet* Runtime1::generate_code_for(S // check that array length is small enough for fast path __ move(AT, C1_MacroAssembler::max_array_allocation_length); - __ slt(AT, AT, length); + __ sltu(AT, AT, length); __ bne(AT, ZERO, slow_path); __ delayed()->nop(); diff -r 87db8957684e -r ab0d284dc313 hotspot/src/cpu/mips/vm/templateInterpreter_mips.cpp --- a/hotspot/src/cpu/mips/vm/templateInterpreter_mips.cpp Fri Nov 12 15:27:30 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/templateInterpreter_mips.cpp Thu Nov 18 16:19:42 2010 +0800 @@ -1920,7 +1920,6 @@ int AbstractInterpreter::layout_activati //set last sp; intptr_t* esp = (intptr_t*) monbot - tempcount*Interpreter::stackElementWords() - popframe_extra_args; - printf("last sp is %x\n", esp); interpreter_frame->interpreter_frame_set_last_sp(esp); // All frames but the initial interpreter frame we fill in have a // value for sender_sp that allows walking the stack but isn't diff -r 87db8957684e -r ab0d284dc313 hotspot/src/share/vm/c1/c1_LIR.cpp --- a/hotspot/src/share/vm/c1/c1_LIR.cpp Fri Nov 12 15:27:30 2010 +0800 +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp Thu Nov 18 16:19:42 2010 +0800 @@ -1507,7 +1507,7 @@ void LIR_List::store_check(LIR_Opr objec 0)); } - +#ifndef MIPS32 void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2) { // Compare and swap produces condition code "zero" if contents_of(addr) == cmp_value, // implying successful swap of new_value into addr @@ -1540,7 +1540,43 @@ void LIR_List::cas_int(LIR_Opr addr, LIR t1, t2)); } +#else +void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2, LIR_Opr result) { + // Compare and swap produces condition code "zero" if contents_of(addr) == cmp_value, + // implying successful swap of new_value into addr + append(new LIR_OpCompareAndSwap(lir_cas_long, + addr, + cmp_value, + new_value, + t1, + t2, + result)); +} +void LIR_List::cas_obj(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2, LIR_Opr result) { + // Compare and swap produces condition code "zero" if contents_of(addr) == cmp_value, + // implying successful swap of new_value into addr + append(new LIR_OpCompareAndSwap(lir_cas_obj, + addr, + cmp_value, + new_value, + t1, + t2, + result)); +} + +void LIR_List::cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2, LIR_Opr result) { + // Compare and swap produces condition code "zero" if contents_of(addr) == cmp_value, + // implying successful swap of new_value into addr + append(new LIR_OpCompareAndSwap(lir_cas_int, + addr, + cmp_value, + new_value, + t1, + t2, + result)); +} +#endif #ifdef PRODUCT diff -r 87db8957684e -r ab0d284dc313 hotspot/src/share/vm/c1/c1_LIR.hpp --- a/hotspot/src/share/vm/c1/c1_LIR.hpp Fri Nov 12 15:27:30 2010 +0800 +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp Thu Nov 18 16:19:42 2010 +0800 @@ -1868,6 +1868,7 @@ class LIR_OpCompareAndSwap : public LIR_ LIR_Opr _tmp2; public: +#ifndef MIPS32 LIR_OpCompareAndSwap(LIR_Code code, LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2) : LIR_Op(code, LIR_OprFact::illegalOpr, NULL) // no result, no info , _addr(addr) @@ -1875,7 +1876,15 @@ class LIR_OpCompareAndSwap : public LIR_ , _new_value(new_value) , _tmp1(t1) , _tmp2(t2) { } - +#else + LIR_OpCompareAndSwap(LIR_Code code, LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2, LIR_Opr result) + : LIR_Op(code, result, NULL) // no result, no info + , _addr(addr) + , _cmp_value(cmp_value) + , _new_value(new_value) + , _tmp1(t1) + , _tmp2(t2) { } +#endif LIR_Opr addr() const { return _addr; } LIR_Opr cmp_value() const { return _cmp_value; } LIR_Opr new_value() const { return _new_value; } @@ -2105,11 +2114,15 @@ class LIR_List: public CompilationResour } #endif - +#ifndef MIPS32 void cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2); void cas_obj(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2); void cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2); - +#else + void cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2, LIR_Opr result); + void cas_obj(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2, LIR_Opr result); + void cas_int(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2, LIR_Opr result); +#endif void abs (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_abs , from, tmp, to)); } void sqrt(LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_sqrt, from, tmp, to)); } void log (LIR_Opr from, LIR_Opr to, LIR_Opr tmp) { append(new LIR_Op2(lir_log, from, tmp, to)); } ----- End forwarded message ----- -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F From liuqi at loongson.cn Sun Nov 28 23:32:55 2010 From: liuqi at loongson.cn (LIU Qi) Date: Mon, 29 Nov 2010 15:32:55 +0800 Subject: [liuqi@icedtea.classpath.org: /hg/openjdk6-mips: Fix the deoptimization bug.] Message-ID: <20101129073255.GA30270@loongson.cn> ----- Forwarded message from liuqi at icedtea.classpath.org ----- Date: Mon, 29 Nov 2010 07:27:22 +0000 From: liuqi at icedtea.classpath.org To: distro-pkg-dev at openjdk.java.net Subject: /hg/openjdk6-mips: Fix the deoptimization bug. changeset 9fdc8715b0a2 in /hg/openjdk6-mips details: http://icedtea.classpath.org/hg/openjdk6-mips?cmd=changeset;node=9fdc8715b0a2 author: Ao Qi date: Fri Nov 26 12:00:58 2010 +0800 Fix the deoptimization bug. Original PC of the deopt_frame may not be always in (fp - 1). Therefore, set RA to the deop_pc, which is the entry address of deopt_handler, and the frame::frame will handle it. diffstat: 2 files changed, 2 insertions(+), 2 deletions(-) hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp | 2 +- hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp | 2 +- diffs (24 lines): diff -r ab0d284dc313 -r 9fdc8715b0a2 hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp --- a/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Thu Nov 18 16:19:42 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/c1_LIRAssembler_mips.cpp Fri Nov 26 12:00:58 2010 +0800 @@ -433,7 +433,7 @@ void LIR_Assembler::emit_deopt_handler() compilation()->offsets()->set_value(CodeOffsets::Deopt, code_offset()); - __ jmp(SharedRuntime::deopt_blob()->unpack()); + __ call(SharedRuntime::deopt_blob()->unpack()); __ delayed()->nop(); assert(code_offset() - offset <= deopt_handler_size, "overflow"); diff -r ab0d284dc313 -r 9fdc8715b0a2 hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp --- a/hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp Thu Nov 18 16:19:42 2010 +0800 +++ b/hotspot/src/cpu/mips/vm/sharedRuntime_mips.cpp Fri Nov 26 12:00:58 2010 +0800 @@ -3233,7 +3233,7 @@ void SharedRuntime::generate_deopt_blob( // Prolog for non exception case! // Correct the return address we were given. //FIXME, return address is on the tos or Ra? - __ lw(RA, FP, (-1) * wordSize); + __ addi(RA, RA, - (NativeCall::return_address_offset)); // Save everything in sight. map = RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words); // Normal deoptimization ----- End forwarded message ----- -- LIU Qi liuqi at loongson.cn liuqi82 at gmail.com Loongson Technology Co. Ltd. PGP Key fingerprint: 3D29 FDFD AFB3 225D B744 7FAB 51C7 4820 63BA 272F