diff -aruN shujit-0.7.3/ChangeLog shujit/ChangeLog
--- shujit-0.7.3/ChangeLog	Thu Jul 12 13:25:32 2001
+++ shujit/ChangeLog	Wed Sep  5 15:45:09 2001
@@ -1,5 +1,98 @@
 $Id$
 
+[20010905]
+
+0.7.4 リリース。
+
+[20010903]
+
+GNUMakefile.in を改造。
+% make debug とすると、-g -DDEBUG -DJCOV オプション付きでコンパイルを行って
+libshujit_g.so が作られるようにした。
+(GNUMakefile.in)
+
+[20010901]
+
+マクロ DEBUG が #define されている場合は、
+マクロ EXECUTEJAVA_IN_ASM を#define しないようにした。
+つまり、アセンブリコード版ではなく C 版のインタプリタに対応した
+コンパイルを行うようにした。
+(config.h)
+
+symbolInSystemClassLoader() で 共有ライブラリを
+ロードする際、マクロ DEBUG が #define されている場合は、
+ロードするライブラリ名に "_g" を付けるようにした。
+(linker.c)
+
+[20010808]
+
+JIT 用の例外表 (throwentry 型) を、writeCode() (compile.c) の末尾で
+realloc(3) して、実際のサイズまで shrink するようにした。
+消費メモリ量削減のため。
+(compile.c)
+
+[20010807]
+
+JIT 用の例外表 (throwentry 型) のサイズを減らした。
+最初から 8 要素分の領域を確保していたところ、これを 0 として、
+8, 16, 32 と拡張していっていたところ、0, 1, 2, 4, 8 と拡張するようにした。
+(computil.c, compiler.h)
+
+[20010802]
+
+SSE2 命令対応によってバイトコード命令 frem, drem がきちんと
+動作しなくなっていたのを修整。
+l2f, l2d 命令と同様に、内部命令 fst, dst の処理を frem, drem に含めた。
+(see [20010626])
+(code.c, compile.c)
+
+[20010731]
+
+ひとつのメソッドに対して複数の CompilerContext (compiler.h) が得られてしまう
+という問題を解消した。あるスレッドがコンパイル中に別スレッドがコンパイルを
+始めた場合に、別の CompilerContext が得られて問題が起きていた。
+ひとつのメソッドに対しては単一の CompilerContext が得られるようにして、
+参照カウントで GC するようにして解決。
+(computil.c)
+
+[20010729]
+
+Blackdown JDK 1.3.1 でコンパイルできるように、
+gcc に渡す -I オプションを追加した。
+(configure.in, GNUmakefile.in)
+
+[20010725]
+
+コード自己書き換えの方法を INT $3 を使う方法に変更し終えた。
+生成コード中に NOP を用意しておいて JMP で上書きする方法から、
+INT $3 を生成しておいてシグナルハンドラで必要な処理を行い、
+INT $3 (0xcc) の上にパッチを当てる方法に変更した。
+この方法は生成コードの保存 (オプション codedb) と両立しない！ことに注意。
+シグナルハンドラの中から直接 once_*() を呼んでしまうと
+その先の生成コードでまたシグナルが発生してデッドロックしてしまうので、
+トランポリンコードを用意 (CodeInfo.trampoline) して、シグナルハンドラからは
+そこに戻るようにした。この問題は demo/jfc/Java2D/Java2Demo.jar で発覚。
+(compiler.h, code.c, signal.c, compile.c, computil.c, runtime.c, codedb.c)
+
+[20010715]
+
+内部命令 getstatic2, putstatic2, getstatic2_quick, putstatic2_quick の処理を
+変更。これまでは putstatic2 の場合
+  movl  %reg0,(定数)
+  movl  %reg1,(定数)
+としていたところ
+  movl  $定数,%edi
+  movl  %reg0,(%edi)
+  movl  %reg1,4(%edi)
+と変更した。コード量は 12 バイトから 10 バイトに。
+(code.c, compile.c)
+
+throwentry 型 (compiler.h) に、uint8_t patched_code というメンバを設けた。
+コードにパッチ (int $3, 0xcc) を当てた際に元のコードを保存する場所。
+これに伴い、メンバ len を uint16_t から uint8_t に変更した。
+getable.rb は、len が 255 を超えた場合には異常終了するようにした。
+(compiler.h, computil.c, codedb.c)
+
 [20010712]
 
 0.7.3 リリース。
diff -aruN shujit-0.7.3/GNUmakefile shujit/GNUmakefile
--- shujit-0.7.3/GNUmakefile	Sun Jul  8 00:21:11 2001
+++ shujit/GNUmakefile	Wed Sep  5 17:06:47 2001
@@ -11,7 +11,9 @@
 # environment
 
 JDK_VER = 12
-J_INCDIR = /usr/local/java/include-old
+J_INCDIR1 = /usr/local/java/include-old
+J_INCDIR2 = /usr/local/java/include
+J_INCDIR_MD = linux
 
 GCC27 = 
 
@@ -46,34 +48,45 @@
 GENCONST = gentable.rb
 POSTPROC = postcmpl.rb
 
-INCDIR = -I${J_INCDIR} -I${J_INCDIR}/genunix -I${J_INCDIR}/linux -I${J_INCDIR}/freebsd -I${J_INCDIR}/netbsd -I/usr/local/include
+INCDIR = -I${J_INCDIR1} -I${J_INCDIR1}/${J_INCDIR_MD} -I${J_INCDIR2} -I${J_INCDIR2}/${J_INCDIR_MD} -I${OBJDIR} -I/usr/local/include
 
-OPTFLAGS = -O2
-CDEBUGFLAGS =# -g -DDEBUG -DCOMPILE_DEBUG# -DRUNTIME_DEBUG
-NOOPTCFLAGS = -pipe -fPIC ${CDEBUGFLAGS} ${INCDIR}
-CFLAGS = ${OPTFLAGS} ${NOOPTCFLAGS}
+CFLAGS_COMMON =# -g -DCOMPILE_DEBUG# -DRUNTIME_DEBUG
+COPTFLAGS = -O2
+CFLAGS_OPT =
+CFLAGS_DBG = -g -DDEBUG -DJCOV
+NOOPTCFLAGS = -pipe -fPIC ${CFLAGS_${VARIANT}} ${CFLAGS_COMMON} ${INCDIR}
+CFLAGS = ${COPTFLAGS} ${NOOPTCFLAGS}
 LIBS =
 
 ifeq (${METAVM}, yes)
-TARGET = libmetavm.so
+TARGET_OPT = libmetavm.so
+TARGET_DBG = libmetavm_g.so
 else
-TARGET = libshujit.so
+TARGET_OPT = libshujit.so
+TARGET_DBG = libshujit_g.so
 endif
-GENEDHDR = constants.h
-GENEDOBJ = constants.o
+ifeq (${VARIANT}, DBG)
+OBJDIR = obj_g
+else
+OBJDIR = obj
+endif
+GENEDHDR = ${OBJDIR}/constants.h
+GENEDOBJ = ${OBJDIR}/constants.o
 TOOLS = codedbinfo
 TOOLSOBJ = codedbinfo.o
 # source code
 HDR = compiler.h opcodes_internal.h code.h
-OBJ = code.o compiler.o signal.o invoker.o computil.o opcodes.o compile.o\
-	runtime.o optimize.o stack.o x86tsc.o
+OBJ = ${OBJDIR}/code.o ${OBJDIR}/compiler.o ${OBJDIR}/signal.o \
+	${OBJDIR}/invoker.o ${OBJDIR}/computil.o ${OBJDIR}/opcodes.o \
+	${OBJDIR}/compile.o ${OBJDIR}/runtime.o ${OBJDIR}/optimize.o \
+	${OBJDIR}/stack.o ${OBJDIR}/x86tsc.o
 ifneq (${JDK_VER}, 11)
-	OBJ += linker.o
+	OBJ += ${OBJDIR}/linker.o
 endif
 
 ifeq (${CODE_DB}, yes)
-	OBJ += codedb.o
-	CFLAGS += -I/usr/local/include
+	OBJ += ${OBJDIR}/codedb.o
+#	CFLAGS += -I/usr/local/include
 #	LIBS += -L/usr/local/lib
 ifeq (${GDBM}, yes)
 	DBLIBS = -lgdbm
@@ -98,9 +111,17 @@
 # rules
 #
 
-all: ${TARGET}
+.PHONY: all optimized debug do_config make_objdir subdir tool jar distclean clean subdirclean tag wc
+
+all: optimized
+
+optimized:
+	${MAKE} ${TARGET_OPT} VARIANT=OPT
+
+debug:
+	${MAKE} ${TARGET_DBG} VARIANT=DBG
 
-${TARGET}: do_config subdir ${OBJ} ${GENEDOBJ}
+${TARGET_${VARIANT}}: do_config make_objdir subdir ${OBJ} ${GENEDOBJ}
 	${LD_DYNAMIC} -o $@ ${OBJ} ${GENEDOBJ} ${LIBS}
 
 do_config:
@@ -108,6 +129,11 @@
 		(echo 'Type ./configure then make.'; false) \
 	fi
 
+make_objdir:
+	@if [ ! -d ${OBJDIR} ]; then \
+		mkdir -p ${OBJDIR}; \
+	fi
+
 subdir:
 ifdef SUBDIR
 	@for subdir in ${SUBDIR}; do \
@@ -122,44 +148,48 @@
 	${JAR} cvf ${JARFILE} NET/shudo/metavm/*.class
 
 
+${OBJDIR}/%.o: %.c
+	${COMPILE.c} -o $@ $<
+
+
 # generate code.o
 ifeq (${GCC27}, yes)
-tmp.s: code.c ${POSTPROC}
-	${CC} -S -fno-omit-frame-pointer ${NOOPTCFLAGS} -o tmp.s $<
-code.s: tmp.s
+${OBJDIR}/tmp.s: code.c ${POSTPROC}
+	${CC} -S -fno-omit-frame-pointer ${NOOPTCFLAGS} -o $@ $<
+${OBJDIR}/code.s: ${OBJDIR}/tmp.s
 	${RUBY} ${POSTPROC} < $< > $@
 #	${RM} -f $<
-code.o: code.s
+${OBJDIR}/code.o: ${OBJDIR}/code.s
 else
-code.o: code.c
-	${CC} -fno-omit-frame-pointer ${NOOPTCFLAGS} -c $<
-code.s: code.c code.h
-	${CC} -S -fno-omit-frame-pointer ${NOOPTCFLAGS} $<
+${OBJDIR}/code.o: code.c
+	${CC} -fno-omit-frame-pointer ${NOOPTCFLAGS} -c -o $@ $<
+${OBJDIR}/code.s: code.c code.h
+	${CC} -S -fno-omit-frame-pointer ${NOOPTCFLAGS} -o $@ $<
 endif
 
 
-${GENEDHDR}: code.o ${GENCONST}
-	${OBJDUMP} -dx $< | ${RUBY} ${GENCONST}
-${GENEDOBJ:.o=.c}: code.o ${GENCONST}
-	${OBJDUMP} -dx $< | ${RUBY} ${GENCONST}
-
-compile.o: compiler.h ${GENEDHDR} ${GENEDOBJ:.o=.c}
-compiler.o: compiler.c compiler.h
-runtime.o: runtime.c compiler.h
-computil.o: compiler.h
-optimize.o: compiler.h
-codedb.o: compiler.h
+${GENEDHDR}: ${OBJDIR}/code.o ${GENCONST}
+	(cd ${OBJDIR} && ${OBJDUMP} -dx code.o | ${RUBY} ../${GENCONST})
+${GENEDOBJ:.o=.c}: ${OBJDIR}/code.o ${GENCONST}
+	(cd ${OBJDIR} && ${OBJDUMP} -dx code.o | ${RUBY} ../${GENCONST})
+
+${OBJDIR}/compile.o: compiler.h ${GENEDHDR} ${GENEDOBJ:.o=.c}
+${OBJDIR}/compiler.o: compiler.c compiler.h
+${OBJDIR}/runtime.o: runtime.c compiler.h
+${OBJDIR}/computil.o: compiler.h
+${OBJDIR}/optimize.o: compiler.h
+${OBJDIR}/codedb.o: compiler.h
 
 codedbinfo.o: compiler.h
 codedbinfo: codedbinfo.o
 	${CC} -o $@ $< ${DBLIBS}
 
 # for JDK 1.2
-linker.o: java_util_Vector.h java_lang_ClassLoader_NativeLibrary.h
-java_util_Vector.h:
-	$(JAVAH_OLD) java.util.Vector
-java_lang_ClassLoader_NativeLibrary.h:
-	$(JAVAH_OLD) java.lang.ClassLoader\$$NativeLibrary
+${OBJDIR}/linker.o: ${OBJDIR}/java_util_Vector.h ${OBJDIR}/java_lang_ClassLoader_NativeLibrary.h
+${OBJDIR}/java_util_Vector.h:
+	$(JAVAH_OLD) -d ${OBJDIR} java.util.Vector
+${OBJDIR}/java_lang_ClassLoader_NativeLibrary.h:
+	$(JAVAH_OLD) -d ${OBJDIR} java.lang.ClassLoader\$$NativeLibrary
 
 
 distclean: clean
@@ -167,8 +197,10 @@
 	${RM} -f metavm/GNUmakefile NET/shudo/metavm/GNUmakefile
 
 clean: subdirclean
+	${RM} -f TAGS *~
 	${RM} -f config.cache confdefs.h
-	${RM} -f TAGS *~ ${TARGET} *.o ${GENEDHDR} ${GENEDOBJ} ${GENEDOBJ:.o=.c} *.s ${TOOLS} ${TOOLSOBJ} java_*.h
+	${RM} -f ${TARGET_OPT} ${TARGET_DBG} ${TOOLS} ${TOOLSOBJ}
+	${RM} -rf obj obj_g
 ifeq (${METAVM}, yes)
 	${RM} -f ${JARFILE}
 endif
@@ -180,14 +212,11 @@
 	done
 endif
 
-objclean:
-	${RM} -f `${FIND} . -name '*.o' -print`
-
 tag:
 	${ETAGS} *.[hc]
 
 wc:
-	${WC} ${OBJ:.o=.c} ${HDR} ${GENCONST} ${TOOLSOBJ:.o=.c}
+	${WC} *.[hc] ${GENCONST}
 
 .c.s:
 	${CC} $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $<
diff -aruN shujit-0.7.3/GNUmakefile.in shujit/GNUmakefile.in
--- shujit-0.7.3/GNUmakefile.in	Fri Jan 12 19:26:15 2001
+++ shujit/GNUmakefile.in	Mon Sep  3 21:45:14 2001
@@ -11,7 +11,9 @@
 # environment
 
 JDK_VER = @ac_jver@
-J_INCDIR = @ac_jincdir@
+J_INCDIR1 = @ac_jincdir1@
+J_INCDIR2 = @ac_jincdir2@
+J_INCDIR_MD = @ac_jincdir_md@
 
 GCC27 = @ac_gcc27@
 
@@ -46,34 +48,45 @@
 GENCONST = gentable.rb
 POSTPROC = postcmpl.rb
 
-INCDIR = -I${J_INCDIR} -I${J_INCDIR}/genunix -I${J_INCDIR}/linux -I${J_INCDIR}/freebsd -I${J_INCDIR}/netbsd -I/usr/local/include
+INCDIR = -I${J_INCDIR1} -I${J_INCDIR1}/${J_INCDIR_MD} -I${J_INCDIR2} -I${J_INCDIR2}/${J_INCDIR_MD} -I${OBJDIR} -I/usr/local/include
 
-OPTFLAGS = -O2
-CDEBUGFLAGS =# -g -DDEBUG -DCOMPILE_DEBUG# -DRUNTIME_DEBUG
-NOOPTCFLAGS = -pipe -fPIC ${CDEBUGFLAGS} ${INCDIR}
-CFLAGS = ${OPTFLAGS} ${NOOPTCFLAGS}
+CFLAGS_COMMON =# -g -DCOMPILE_DEBUG# -DRUNTIME_DEBUG
+COPTFLAGS = -O2
+CFLAGS_OPT =
+CFLAGS_DBG = -g -DDEBUG -DJCOV
+NOOPTCFLAGS = -pipe -fPIC ${CFLAGS_${VARIANT}} ${CFLAGS_COMMON} ${INCDIR}
+CFLAGS = ${COPTFLAGS} ${NOOPTCFLAGS}
 LIBS =
 
 ifeq (${METAVM}, yes)
-TARGET = libmetavm.so
+TARGET_OPT = libmetavm.so
+TARGET_DBG = libmetavm_g.so
 else
-TARGET = libshujit.so
+TARGET_OPT = libshujit.so
+TARGET_DBG = libshujit_g.so
 endif
-GENEDHDR = constants.h
-GENEDOBJ = constants.o
+ifeq (${VARIANT}, DBG)
+OBJDIR = obj_g
+else
+OBJDIR = obj
+endif
+GENEDHDR = ${OBJDIR}/constants.h
+GENEDOBJ = ${OBJDIR}/constants.o
 TOOLS = codedbinfo
 TOOLSOBJ = codedbinfo.o
 # source code
 HDR = compiler.h opcodes_internal.h code.h
-OBJ = code.o compiler.o signal.o invoker.o computil.o opcodes.o compile.o\
-	runtime.o optimize.o stack.o x86tsc.o
+OBJ = ${OBJDIR}/code.o ${OBJDIR}/compiler.o ${OBJDIR}/signal.o \
+	${OBJDIR}/invoker.o ${OBJDIR}/computil.o ${OBJDIR}/opcodes.o \
+	${OBJDIR}/compile.o ${OBJDIR}/runtime.o ${OBJDIR}/optimize.o \
+	${OBJDIR}/stack.o ${OBJDIR}/x86tsc.o
 ifneq (${JDK_VER}, 11)
-	OBJ += linker.o
+	OBJ += ${OBJDIR}/linker.o
 endif
 
 ifeq (${CODE_DB}, yes)
-	OBJ += codedb.o
-	CFLAGS += -I/usr/local/include
+	OBJ += ${OBJDIR}/codedb.o
+#	CFLAGS += -I/usr/local/include
 #	LIBS += -L/usr/local/lib
 ifeq (${GDBM}, yes)
 	DBLIBS = -lgdbm
@@ -98,9 +111,17 @@
 # rules
 #
 
-all: ${TARGET}
+.PHONY: all optimized debug do_config make_objdir subdir tool jar distclean clean subdirclean tag wc
+
+all: optimized
+
+optimized:
+	${MAKE} ${TARGET_OPT} VARIANT=OPT
+
+debug:
+	${MAKE} ${TARGET_DBG} VARIANT=DBG
 
-${TARGET}: do_config subdir ${OBJ} ${GENEDOBJ}
+${TARGET_${VARIANT}}: do_config make_objdir subdir ${OBJ} ${GENEDOBJ}
 	${LD_DYNAMIC} -o $@ ${OBJ} ${GENEDOBJ} ${LIBS}
 
 do_config:
@@ -108,6 +129,11 @@
 		(echo 'Type ./configure then make.'; false) \
 	fi
 
+make_objdir:
+	@if [ ! -d ${OBJDIR} ]; then \
+		mkdir -p ${OBJDIR}; \
+	fi
+
 subdir:
 ifdef SUBDIR
 	@for subdir in ${SUBDIR}; do \
@@ -122,44 +148,48 @@
 	${JAR} cvf ${JARFILE} NET/shudo/metavm/*.class
 
 
+${OBJDIR}/%.o: %.c
+	${COMPILE.c} -o $@ $<
+
+
 # generate code.o
 ifeq (${GCC27}, yes)
-tmp.s: code.c ${POSTPROC}
-	${CC} -S -fno-omit-frame-pointer ${NOOPTCFLAGS} -o tmp.s $<
-code.s: tmp.s
+${OBJDIR}/tmp.s: code.c ${POSTPROC}
+	${CC} -S -fno-omit-frame-pointer ${NOOPTCFLAGS} -o $@ $<
+${OBJDIR}/code.s: ${OBJDIR}/tmp.s
 	${RUBY} ${POSTPROC} < $< > $@
 #	${RM} -f $<
-code.o: code.s
+${OBJDIR}/code.o: ${OBJDIR}/code.s
 else
-code.o: code.c
-	${CC} -fno-omit-frame-pointer ${NOOPTCFLAGS} -c $<
-code.s: code.c code.h
-	${CC} -S -fno-omit-frame-pointer ${NOOPTCFLAGS} $<
+${OBJDIR}/code.o: code.c
+	${CC} -fno-omit-frame-pointer ${NOOPTCFLAGS} -c -o $@ $<
+${OBJDIR}/code.s: code.c code.h
+	${CC} -S -fno-omit-frame-pointer ${NOOPTCFLAGS} -o $@ $<
 endif
 
 
-${GENEDHDR}: code.o ${GENCONST}
-	${OBJDUMP} -dx $< | ${RUBY} ${GENCONST}
-${GENEDOBJ:.o=.c}: code.o ${GENCONST}
-	${OBJDUMP} -dx $< | ${RUBY} ${GENCONST}
-
-compile.o: compiler.h ${GENEDHDR} ${GENEDOBJ:.o=.c}
-compiler.o: compiler.c compiler.h
-runtime.o: runtime.c compiler.h
-computil.o: compiler.h
-optimize.o: compiler.h
-codedb.o: compiler.h
+${GENEDHDR}: ${OBJDIR}/code.o ${GENCONST}
+	(cd ${OBJDIR} && ${OBJDUMP} -dx code.o | ${RUBY} ../${GENCONST})
+${GENEDOBJ:.o=.c}: ${OBJDIR}/code.o ${GENCONST}
+	(cd ${OBJDIR} && ${OBJDUMP} -dx code.o | ${RUBY} ../${GENCONST})
+
+${OBJDIR}/compile.o: compiler.h ${GENEDHDR} ${GENEDOBJ:.o=.c}
+${OBJDIR}/compiler.o: compiler.c compiler.h
+${OBJDIR}/runtime.o: runtime.c compiler.h
+${OBJDIR}/computil.o: compiler.h
+${OBJDIR}/optimize.o: compiler.h
+${OBJDIR}/codedb.o: compiler.h
 
 codedbinfo.o: compiler.h
 codedbinfo: codedbinfo.o
 	${CC} -o $@ $< ${DBLIBS}
 
 # for JDK 1.2
-linker.o: java_util_Vector.h java_lang_ClassLoader_NativeLibrary.h
-java_util_Vector.h:
-	$(JAVAH_OLD) java.util.Vector
-java_lang_ClassLoader_NativeLibrary.h:
-	$(JAVAH_OLD) java.lang.ClassLoader\$$NativeLibrary
+${OBJDIR}/linker.o: ${OBJDIR}/java_util_Vector.h ${OBJDIR}/java_lang_ClassLoader_NativeLibrary.h
+${OBJDIR}/java_util_Vector.h:
+	$(JAVAH_OLD) -d ${OBJDIR} java.util.Vector
+${OBJDIR}/java_lang_ClassLoader_NativeLibrary.h:
+	$(JAVAH_OLD) -d ${OBJDIR} java.lang.ClassLoader\$$NativeLibrary
 
 
 distclean: clean
@@ -167,8 +197,10 @@
 	${RM} -f metavm/GNUmakefile NET/shudo/metavm/GNUmakefile
 
 clean: subdirclean
+	${RM} -f TAGS *~
 	${RM} -f config.cache confdefs.h
-	${RM} -f TAGS *~ ${TARGET} *.o ${GENEDHDR} ${GENEDOBJ} ${GENEDOBJ:.o=.c} *.s ${TOOLS} ${TOOLSOBJ} java_*.h
+	${RM} -f ${TARGET_OPT} ${TARGET_DBG} ${TOOLS} ${TOOLSOBJ}
+	${RM} -rf obj obj_g
 ifeq (${METAVM}, yes)
 	${RM} -f ${JARFILE}
 endif
@@ -180,14 +212,11 @@
 	done
 endif
 
-objclean:
-	${RM} -f `${FIND} . -name '*.o' -print`
-
 tag:
 	${ETAGS} *.[hc]
 
 wc:
-	${WC} ${OBJ:.o=.c} ${HDR} ${GENCONST} ${TOOLSOBJ:.o=.c}
+	${WC} *.[hc] ${GENCONST}
 
 .c.s:
 	${CC} $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -S $<
diff -aruN shujit-0.7.3/README shujit/README
--- shujit-0.7.3/README	Thu Jul 12 13:23:54 2001
+++ shujit/README	Wed Sep  5 16:32:00 2001
@@ -1,4 +1,4 @@
-shuJIT - JIT compiler for Sun JVM/x86
+shuJIT - JIT compiler for x86
 	http://www.shudo.net/jit/
 	Kazuyuki Shudo <shudoh@computer.org>
 
@@ -13,19 +13,18 @@
 Working on the following platforms is confirmed.
 
 - Linux
-  - Blackdown JDK 1.2.2 FCS, gcc 2.95.2, glibc 2.2.3
-    and Linux 2.4.6-ac2
-  - JDK 1.1.8v3, gcc 2.95.2, glibc 2.2.3 and Linux 2.4.6-ac2
+  - Blackdown JDK 1.3.1 FCS, gcc 2.95.2, glibc 2.2.4 and Linux 2.4.9-ac7
+  - Blackdown JDK 1.2.2 FCS, gcc 2.95.2, glibc 2.2.4 and Linux 2.4.9-ac7
+  - JDK 1.1.8v3, gcc 2.95.2, glibc 2.2.4 and Linux 2.4.9-ac7
   - JDK 1.1.7v1a, egcs 1.1.2, libc 5.4.38 and Linux 2.0.35
 
 - FreeBSD
   - JDK 1.2.2 patch10, gcc 2.95.2 and FreeBSD 5.0-CURRENT
-  - JDK 1.1.8 (ELF, V1999-11-9), gcc 2.95.2 and FreeBSD 5.0-CURRENT
-  - JDK 1.1.8 (ELF, V1999-11-9), gcc 2.95.2 and FreeBSD 4.2-STABLE
+  - JDK 1.1.8 (ELF, V1999-11-9), gcc 2.95.2 and FreeBSD 4.3-STABLE
 
 * Installation
 
-With JDK 1.2, you have to place the libshujit.so on
+With Java 2, you have to place the libshujit.so on
 jdk1.2.2/jre/lib/i386/ or make a symbolic link in the
 directory.
 
@@ -49,13 +48,13 @@
 
 You need the following tools to compile this JIT.
 
-- JDK 1.1.X or 1.2.X (or 1.3 classic VM)
-  shuJIT can work with Sun's classic VM included in JDK.
+- JDK 1.1.X or 1.2.X (or 1.3 Classic VM)
+  shuJIT can work with Sun's Classic VM included in JDK.
   Other JVMs, i.e. IBM JDK and HotSpot VM, are not supported.
 - gcc 2.95.X or EGCS
   You can examine the version number of your GCC with -v option.
     % gcc -v
-  gcc 2.96, which is a snapshot for developers, and gcc 2.7.X
+  gcc 2.96, which is a snapshot for developers and gcc 2.7.X
   cause problems. You cannot use those versions to compile shuJIT.
 - objdump (in GNU binutils)
   Most Linux distributions and ELF FreeBSD systems have it.
@@ -70,10 +69,11 @@
      % make
      Or, on FreeBSD systems
      % gmake
+     Type `make debug' to obtain libshujit_g.so, which is for debugging.
 
 * Bugs and Problems
 
-Any comments and bug reports are welcome. Please write to me.
+Any comments and bug reports are welcome. Please feel easy to write to me.
 
 * Copying
 
@@ -98,5 +98,5 @@
 and my wife Mari.
 
 
-SHUDO Kazuyuki/首藤一幸   私をたばねないで あらせいとうの花のように
-  shudoh@computer.org
+Kazuyuki Shudo/首藤一幸   私をたばねないで あらせいとうの花のように
+  shudo@computer.org   http://www.shudo.net/
diff -aruN shujit-0.7.3/code.c shujit/code.c
--- shujit-0.7.3/code.c	Fri Jun 29 16:45:15 2001
+++ shujit/code.c	Thu Aug  2 19:16:33 2001
@@ -2735,6 +2735,9 @@
     FUNCCALL_OUT(0);
     asm("addl  $4,%esp");
 	// now state 0
+#ifdef USE_SSE2
+    asm("fstps (%esp)");	// opc_fst (!USE_SSE2)
+#endif
   }
 
 
@@ -2756,9 +2759,15 @@
 
   CODE(opc_drem, drem, ST2, ST0, OPC_NONE) {
     DREM_ST24(%ecx, %edx);
+#ifdef USE_SSE2
+    asm("fstpl (%esp)");	// opc_dst (!USE_SSE2)
+#endif
   }
   CODE(opc_drem, drem, ST4, ST0, OPC_NONE) {
     DREM_ST24(%edx, %ecx);
+#ifdef USE_SSE2
+    asm("fstpl (%esp)");	// opc_dst (!USE_SSE2)
+#endif
   }
 
 
@@ -3789,8 +3798,9 @@
   }
 
 #define GETSTATIC2_ST0(LOW_REG, HIGH_REG) \
-    asm("movl  (" STR(CONST) ")," #LOW_REG "\n\t"\
-	"movl  (" STR(CONST) ")," #HIGH_REG)
+    asm("movl  $" STR(CONST) ",%edi\n\t"\
+	"movl  (%edi)," #LOW_REG "\n\t"\
+	"movl  4(%edi)," #HIGH_REG)
 #define CODE_GETSTATIC2(vop, THROW_EXC) \
   CODE(opc_##vop, vop, ST0, ST2, THROW_EXC) {\
     INITCLASS_GETSTATIC(#vop "_st0");\
@@ -3820,8 +3830,9 @@
   }
 
 #define PUTSTATIC2(OPTOP1_REG, OPTOP2_REG) \
-    asm("movl  " #OPTOP1_REG ",(" STR(CONST) ")\n\t"\
-	"movl  " #OPTOP2_REG ",(" STR(CONST) ")")
+    asm("movl  $" STR(CONST) ",%edi\n\t"\
+	"movl  " #OPTOP1_REG ",(%edi)\n\t"\
+	"movl  " #OPTOP2_REG ",4(%edi)\n\t")
 	// now state 0
 #define CODE_PUTSTATIC2(vop, THROW_EXC) \
   CODE(opc_##vop, vop, ST0, ST0, THROW_EXC) {\
@@ -3852,18 +3863,18 @@
 #define INITCLASS_GETSTATIC(LABEL)
 	// empty
 
-  CODE_GETSTATIC(getstatic_quick, 0);
-  CODE_PUTSTATIC(putstatic_quick, 0);
-  CODE_GETSTATIC2(getstatic2_quick, 0);
-  CODE_PUTSTATIC2(putstatic2_quick, 0);
+  CODE_GETSTATIC(getstatic_quick, OPC_NONE);
+  CODE_PUTSTATIC(putstatic_quick, OPC_NONE);
+  CODE_GETSTATIC2(getstatic2_quick, OPC_NONE);
+  CODE_PUTSTATIC2(putstatic2_quick, OPC_NONE);
 
 // stuff to rewrite code for opc_{get,put}static
 #define GETSTATIC_PATCH_OFFSET	"0x2c"
-#define GETSTATIC_PATCH_DATA		"0x33"
+#define GETSTATIC_PATCH_DATA	"0x33"
 
 #undef INITCLASS_GETSTATIC
 	// redefine INITCLASS_GETSTATIC
-#if defined(INITCLASS_IN_COMPILATION) || defined(NO_PATCH)
+#if (defined(INITCLASS_IN_COMPILATION) && !defined(PATCH_ON_JUMP)) || defined(PATCH_WITH_SIGTRAP)
 #  define INITCLASS_GETSTATIC(LABEL)
 #else
 #  define INITCLASS_GETSTATIC(LABEL) \
@@ -3892,7 +3903,7 @@
       "movw  $" GETSTATIC_PATCH_DATA "eb,(%edi)");	/* jmp XX */\
   \
   asm(LABEL "_initclass_done:")
-#endif	// INITCLASS_IN_COMPILATION || NO_PATCH
+#endif	// (INITCLASS_IN_COMPILATION && !PATCH_ON_JUMP) || PATCH_WITH_SIGTRAP
 
   CODE_GETSTATIC(getstatic, OPC_THROW);
   CODE_PUTSTATIC(putstatic, OPC_THROW);
@@ -4066,14 +4077,14 @@
   // invokeinterface
 	// const: args_size, guessptr, imethod, retsize
 
-// stuff to rewrite code for opc_invoke*
-#  define INVOKE_PATCH_OFFSET	"0x28"
-#  define INVOKE_PATCH_DATA	"0x2f"
+// stuff to rewrite code for opc_invokestatic
+#  define INVOKESTATIC_PATCH_OFFSET	"0x28"
+#  define INVOKESTATIC_PATCH_DATA	"0x2f"
 
-#if defined(INITCLASS_IN_COMPILATION) || defined(NO_PATCH)
-#  define INITCLASS_INVOKE(LABEL)
+#if (defined(INITCLASS_IN_COMPILATION) && !defined(PATCH_ON_JUMP)) || defined(PATCH_WITH_SIGTRAP)
+#  define INITCLASS_INVOKESTATIC(LABEL)
 #else
-#  define INITCLASS_INVOKE(LABEL) \
+#  define INITCLASS_INVOKESTATIC(LABEL) \
 	/* edx is clazz */\
     asm(".short 0x9090");\
     \
@@ -4095,11 +4106,11 @@
     /* rewrite */\
     asm(".byte 0xe8\n\t.long 0\n\t"	/* call */\
 	"popl  %edi");\
-    asm("subl  $" INVOKE_PATCH_OFFSET ",%edi\n\t"\
-	"movw  $" INVOKE_PATCH_DATA "eb,(%edi)");	/* jmp XX */\
+    asm("subl  $" INVOKESTATIC_PATCH_OFFSET ",%edi\n\t"\
+	"movw  $" INVOKESTATIC_PATCH_DATA "eb,(%edi)");	/* jmp XX */\
     \
     asm(LABEL "_initclass_done:")
-#endif	// INITCLASS_IN_COMPILATION || NO_PATCH
+#endif	// INITCLASS_IN_COMPILATION || !PATCH_ON_JUMP || PATCH_WITH_SIGTRAP
 
 
 	// const: args_size
@@ -4391,13 +4402,13 @@
   // inv_sta_obj is same as inv_stq_obj
 
 	// const: method
-  CODE(opc_invokestatic, invokestatic, STANY, STSTA, OPC_NONE) {
+  CODE(opc_invokestatic, invokestatic, STANY, STSTA, OPC_THROW) {
     // edx = cbHandle(method->fb.clazz)
     asm("movl  $" STR(CONST) ",%eax\n\t"
 	"movl  " METHOD_CLAZZ(%eax) ",%edx");
     METHOD_DEBUG(%eax, "invokestatic");
 
-    INITCLASS_INVOKE("invokesta");
+    INITCLASS_INVOKESTATIC("invokesta");
   }
 
   // inv_sta_varspace is same as inv_stq_varspace
@@ -4429,7 +4440,7 @@
 	"movw  $" INVINTF_PATCH_DATA "eb,(%edi)")	/* jmp XX */
 
 	// const: guessptr, imethod
-  CODE(opc_invokeinterface, invokeinterface, STANY, STSTA, OPC_NONE) {
+  CODE(opc_invokeinterface, invokeinterface, STANY, STSTA, OPC_THROW) {
     // get methodblock: call getInterfaceMethod()
 
     asm("pushl %ecx\n\tpushl  %edx");	// save
@@ -4445,6 +4456,7 @@
 
     asm("popl  %edx\n\tpopl  %ecx");	// restore
 
+#ifndef PATCH_WITH_SIGTRAP
     INVINTF_PATCH1();
     asm("testl %eax,%eax\n\t"
 	"jnz   invokeint_getintf_success");
@@ -4452,6 +4464,7 @@
 
     asm("invokeint_getintf_success:");
     INVINTF_PATCH2();
+#endif
 
     asm("invokeint_getintf_done:");
   }
@@ -4605,7 +4618,7 @@
 #define NEW_PATCH_OFFSET	"0x2d"
 #define NEW_PATCH_DATA	"0x34"
 
-#ifdef NO_PATCH
+#if !defined(PATCH_ON_JUMP) || defined(PATCH_WITH_SIGTRAP)
 #  define NEW_PATCH(CB_REG, LABEL, STATE)
 #else
 #  define NEW_PATCH(CB_REG, LABEL, STATE) \
diff -aruN shujit-0.7.3/codedb.c shujit/codedb.c
--- shujit-0.7.3/codedb.c	Sun Mar 11 16:10:32 2001
+++ shujit/codedb.c	Wed Jul 25 23:12:22 2001
@@ -111,8 +111,13 @@
     len = info->throwtablelen;
     for (i = 0; i < len; i++) {
       write(fd, &tentry->start, 4);
-      write(fd, &tentry->len, 2);
       write(fd, &tentry->byteoff, 2);
+      write(fd, &tentry->len, 1);
+#  ifdef PATCH_WITH_SIGTRAP
+      write(fd, &tentry->patched_code, 1);
+      write(fd, &tentry->cb, 4);
+      write(fd, &tentry->opcode, 2);
+#  endif
       tentry++;
     }
 #endif	// EXC_BY_SIGNAL
@@ -237,8 +242,13 @@
     len = info->throwtablelen;
     for (i = 0; i < len; i++) {
       read(fd, &tentry->start, 4);
-      read(fd, &tentry->len, 2);
       read(fd, &tentry->byteoff, 2);
+      read(fd, &tentry->len, 1);
+#  ifdef PATCH_WITH_SIGTRAP
+      read(fd, &tentry->patched_code, 1);
+      read(fd, &tentry->cb, 4);
+      read(fd, &tentry->opcode, 2);
+#  endif
       tentry++;
     }
 #endif	// EXC_BY_SIGNAL
diff -aruN shujit-0.7.3/compile.c shujit/compile.c
--- shujit-0.7.3/compile.c	Tue Jun 26 19:28:25 2001
+++ shujit/compile.c	Mon Sep  3 20:08:21 2001
@@ -44,14 +44,6 @@
 #endif
 
 
-#define ALIGNUP32(n)	( ((unsigned int)(n) + 3) & ~((unsigned int)3) )
-
-#define GET_UINT16(p)	((((unsigned char *)(p))[0] << 8) | (p)[1])
-#define GET_INT16(p)	((((signed char *)(p))[0] << 8) | (p)[1])
-#define GET_INT32(p)\
- ((int)((unsigned char *)(p))[0] << 24| ((int)((unsigned char *)(p))[1] << 16) | ((int)((unsigned char *)(p))[2] << 8) | ((int)((unsigned char *)(p))[3]))
-
-
 #include <string.h>
 
 
@@ -145,9 +137,9 @@
     int acc = mb->fb.access;
 
     printf("\n");
-    printf("cmplMtd(%d) called.\n  %s#%s %s\n",
-	target_stage,
+    printf("cmplMtd() called.\n  %s#%s %s\n",
 	cbName(fieldclass(&mb->fb)), mb->fb.name, mb->fb.signature);
+    printf("  cur stage: %d, target stage: %d\n", cc->stage, target_stage);
 
     showCompilerContext(cc, "  ");
 
@@ -176,6 +168,15 @@
 
 
   mon = info->monitor;
+#ifdef COMPILE_DEBUG
+  if (compile_debug) {
+    printf("  monitor: 0x%x\n", mon);
+#if JDK_VER >= 12
+    printf("  thread:  0x%x\n", self);
+#endif
+    fflush(stdout);
+  }
+#endif
   SYS_MONITOR_ENTER(self, mon);		// lock
 
 
@@ -340,18 +341,23 @@
 	goto codesize_open_failed;
       }
 
-      fprintf(sizefp, "# num_of_byte_code_inst"
-		" size_of_byte_code"
-		" size_of_native_code"
+      fprintf(sizefp, "# num_bytecode"
+		" size_bytecode"
+		" size_native_code"
+#ifdef EXC_BY_SIGNAL
+		" num_throw_entry"
+		" size_throw_entry"
+#endif
 		" class_name#method_name signature\n");
     }
 
     fprintf(sizefp, "%d", cc->ninsn);
-	// # of byte code inst
     fprintf(sizefp, "\t%lu", mb->code_length);
-	// size of byte code of the method
     fprintf(sizefp, "\t%d", info->code_size);
-	// size of generated native code
+#ifdef EXC_BY_SIGNAL
+    fprintf(sizefp, "\t%d", info->throwtablelen);
+    fprintf(sizefp, "\t%d", info->throwtablelen * sizeof(throwentry));
+#endif
     fprintf(sizefp, "\t%s#%s %s",
 		cbName(fieldclass(&mb->fb)), mb->fb.name, mb->fb.signature);
 	// class name, method name, signature
@@ -648,8 +654,9 @@
       }
       break;
 
-    case opc_i2f:  case opc_frem:
+    case opc_i2f:
 #ifndef USE_SSE2
+    case opc_frem:
     case opc_l2f:
 #endif
       processAnOpcode(cc, opc_flush_cache, byteoff);
@@ -661,7 +668,9 @@
     case opc_drem:
       processAnOpcode(cc, opc_fill_cache, byteoff);
       byteinc = processAnOpcode(cc, opcode, byteoff);
+#ifndef USE_SSE2
       processAnOpcode(cc, opc_dst, byteoff);
+#endif
       byteoff += byteinc;
       break;
 
@@ -676,6 +685,7 @@
       break;
 
 #ifdef USE_SSE2
+    case opc_frem:
     case opc_l2f:
     case opc_l2d:
       processAnOpcode(cc, opc_flush_cache, byteoff);
@@ -1045,7 +1055,10 @@
 	      processAnOpcode(cc, opc_stateto0, byteoff);
 	      processAnOpcode(cc, opc_inv_head, byteoff);
 	      processAnOpcode(cc, opc_inv_stq_obj, byteoff);
-	      if (OPT_SETQ(OPT_CODEDB) ||
+	      if (
+#ifdef CODEDB
+		  OPT_SETQ(OPT_CODEDB) ||
+#endif
 		 !CB_INITIALIZED(fieldclass(&(constant_pool[operand].mb->fb))))
 		processAnOpcode(cc, opc_invokestatic, byteoff);
 	      else
@@ -1462,16 +1475,20 @@
     break;
   case opc_getstatic_quick:
   case opc_putstatic_quick:
+#ifdef CODEDB
     if (OPT_SETQ(OPT_CODEDB)) {
       code_opcode += (opc_getstatic - opc_getstatic_quick);
     }
+#endif
     operand = GET_UINT16(bytepc + 1);
     break;
   case opc_getstatic2_quick:
   case opc_putstatic2_quick:
+#ifdef CODEDB
     if (OPT_SETQ(OPT_CODEDB)) {
       code_opcode += (opc_getstatic2 - opc_getstatic2_quick);
     }
+#endif
     operand = GET_UINT16(bytepc + 1);
     break;
 
@@ -2191,18 +2208,106 @@
       // treat throw table
       if (nativecode[-1] & OPC_SIGNAL_MASK) {
 	// these native code may send SIGSEGV or SIGFPE
-	throwtableAdd(info, nativeoff, (uint16_t)codep->length,
+	throwtableAdd(cc, info,
+		nativeoff, (uint16_t)codep->length,
+		(uint16_t)pctable->increasing_byteoff);
+      }
+#endif	// EXC_BY_SIGNAL
+    }
+
+
+#ifdef PATCH_WITH_SIGTRAP
+    {
+      unsigned char *nativep = cc->buffer + nativeoff;
+      throwentry *tentry;
+
+      switch (opcode) {	// internal opcode
+      case opc_getstatic:  case opc_getstatic2:
+      case opc_putstatic:  case opc_putstatic2:
+      case opc_invokestatic:
+      case opc_invokeignored_static:
+      case opc_new:
+#  ifdef METHOD_INLINING
+      case opc_inlined_enter:
+#  endif
+	{
+	  ClassClass *cb;
+
+	  // refuse _quick instructions
+#  ifdef METHOD_INLINING
+	  if (opcode == opc_inlined_enter) {
+	    if (*bytepc != opc_invokestatic)
+	      break;
+	  }
+	  else
+#  endif
+	  if ((*bytepc == opc_new_quick) ||
+	      ((*bytepc >= opc_getstatic_quick) &&
+	       (*bytepc <= opc_putstatic2_quick)) ||
+	      (*bytepc == opc_invokeignored_quick))
+	    break;
+
+	  if (opcode == opc_new) {
+	    cb = constant_pool[operand].clazz;
+	  }
+	  else {
+	    struct methodblock *invoke_mb;
+
+	    invoke_mb = constant_pool[operand].mb;
+	    cb = fieldclass(&invoke_mb->fb);
+
+	    // cannot omit invocation of once_in_new() if operand is opc_new
+	    if (CB_INITIALIZED(cb))
+	      break;
+	  }
+	  sysAssert(cb != NULL);
+
+	  tentry = throwtableAdd(cc, info,
+		nativeoff, (uint16_t)codep->length,
+		(uint16_t)pctable->increasing_byteoff);
+	  // patch
+	  tentry->opcode = (uint16_t)opcode;
+	  tentry->cb = cb;
+	  tentry->patched_code = nativep[0];
+	  nativep[0] = 0xcc;	// int $3
+	}
+
+#ifdef COMPILE_DEBUG
+	if (compile_debug) {
+	  printf("  patch on 0x%02x(%d)\n", opcode, opcode);
+	  fflush(stdout);
+	}
+#endif
+	break;
+
+      case opc_invokeinterface:
+	// refuse invokeinterface_quick
+	if (*bytepc == opc_invokeinterface_quick)  break;
+
+	tentry = throwtableAdd(cc, info,
+		nativeoff, (uint16_t)codep->length,
 		(uint16_t)pctable->increasing_byteoff);
+
+	// patch
+#ifdef RUNTIME_DEBUG
+#  define INVINTF_PATCH_OFFSET	0x4c
+#else
+#  define INVINTF_PATCH_OFFSET	0x18
+#endif
+	tentry->opcode = (uint16_t)opcode;
+	tentry->patched_code = nativep[INVINTF_PATCH_OFFSET];
+	nativep[INVINTF_PATCH_OFFSET] = 0xcc;	// int $3
 #ifdef COMPILE_DEBUG
 	if (compile_debug) {
-	  printf("throwtableAdd(): opc %x, byte 0x%x, native 0x%x - 0x%x\n",
-	       opcode, pctable->byteoff, nativeoff, nativeoff + codep->length);
+	  printf("  patch on 0x%02x(%d)\n", opcode, opcode);
 	  fflush(stdout);
 	}
 #endif
+	break;
       }
-#endif	// EXC_BY_SIGNAL
     }
+#endif	// PATCH_WITH_SIGTRAP
+
 
     nextoff = nativeoff + codep->length;
 
@@ -2878,7 +2983,7 @@
 	  fflush(stdout);
 	}
 #endif
-#if defined(INITCLASS_IN_COMPILATION) || defined(NO_PATCH)
+#if (defined(INITCLASS_IN_COMPILATION) && !defined(PATCH_ON_JUMP)) || defined(PATCH_WITH_SIGTRAP)
 	memcpy(bufp + constant_table[opcode][state][0], &args_size, 4);
 #else
 	if (opcode == opc_invokeignored_static)
@@ -2953,6 +3058,19 @@
   freeStack(stack);
 #endif
 
+#ifdef EXC_BY_SIGNAL
+  if (info->throwtablelen == 0) {
+    if (info->throwtable != NULL)  sysFree(info->throwtable);
+    info->throwtablesize = 0;
+  }
+  else if (info->throwtablelen < info->throwtablesize) {	// not equal
+    // copy throwtable to shrink it
+    info->throwtable = (throwentry *)sysRealloc(info->throwtable,
+			sizeof(throwentry) * info->throwtablelen);
+    info->throwtablesize = info->throwtablelen;
+  }
+#endif	// EXC_BY_SIGNAL
+
 #ifdef COMPILE_DEBUG
   if (compile_debug) {
     printf("writeCode done%s: %s#%s %s.\n",
@@ -3468,16 +3586,20 @@
 #endif
 	{
 	  ClassClass *cb = fieldclass(fb);
-#if defined(INITCLASS_IN_COMPILATION) || defined(NO_PATCH)
+#ifdef PATCH_WITH_SIGTRAP
 #  define RC_STATIC_OFFSET 0
-	  if (!CB_INITIALIZED(cb))  InitClass(cb);
-#else
+#elif defined(PATCH_ON_JUMP)
 #  define RC_STATIC_OFFSET 1
 	  memcpy(bufp + constant_table[opcode][state][0], &cb, 4);
+#elif defined(INITCLASS_IN_COMPILATION)
+#  define RC_STATIC_OFFSET 0
+	  if (!CB_INITIALIZED(cb))  InitClass(cb);
+#else
+#  define RC_STATIC_OFFSET 0
 #endif
 	}
 	addr = (OBJECT *)normal_static_address(fb);
-	memcpy(bufp + constant_table[opcode][state][RC_STATIC_OFFSET + 0],
+	memcpy(bufp + constant_table[opcode][state][RC_STATIC_OFFSET],
 		&addr, 4);
       }
       break;
@@ -3489,6 +3611,7 @@
 	OBJECT *addr;
 	sysAssert(operand != -1);
 
+#ifdef CODEDB
 	if (OPT_SETQ(OPT_CODEDB) &&
 		!CONSTANT_POOL_TYPE_TABLE_IS_RESOLVED(type_table, operand)) {
 	  if (!ResolveClassConstantFromClass2(
@@ -3498,6 +3621,7 @@
 	    goto resolvedyn_done;
 	  }
 	}
+#endif	// CODEDB
 	fb = constant_pool[operand].fb;
 #ifdef COMPILE_DEBUG
 	if (compile_debug) {
@@ -3537,19 +3661,20 @@
 #endif
 	{
 	  ClassClass *cb = fb->clazz;
-#if defined(INITCLASS_IN_COMPILATION) || defined(NO_PATCH)
+#ifdef PATCH_WITH_SIGTRAP
 #  define RC_STATIC2_OFFSET 0
-	  if (!CB_INITIALIZED(cb))  InitClass(cb);
-#else
+#elif defined(PATCH_ON_JUMP)
 #  define RC_STATIC2_OFFSET 1
 	  memcpy(bufp + constant_table[opcode][state][0], &cb, 4);
+#elif defined(INITCLASS_IN_COMPILATION)
+#  define RC_STATIC2_OFFSET 0
+	  if (!CB_INITIALIZED(cb))  InitClass(cb);
+#else
+#  define RC_STATIC2_OFFSET 0
 #endif
 	}
 	addr = (stack_item *)twoword_static_address(fb);
-	memcpy(bufp + constant_table[opcode][state][RC_STATIC2_OFFSET + 0],
-		&addr, 4);
-	addr++;
-	memcpy(bufp + constant_table[opcode][state][RC_STATIC2_OFFSET + 1],
+	memcpy(bufp + constant_table[opcode][state][RC_STATIC2_OFFSET],
 		&addr, 4);
       }
       break;
@@ -3561,6 +3686,7 @@
 	stack_item *addr;
 	sysAssert(operand != -1);
 
+#ifdef CODEDB
 	if (OPT_SETQ(OPT_CODEDB) &&
 		!CONSTANT_POOL_TYPE_TABLE_IS_RESOLVED(type_table, operand)) {
 	  if (!ResolveClassConstantFromClass2(
@@ -3570,6 +3696,7 @@
 	    goto resolvedyn_done;
 	  }
 	}
+#endif	// CODEDB
 	fb = constant_pool[operand].fb;
 #ifdef COMPILE_DEBUG
 	if (compile_debug) {
@@ -3579,8 +3706,6 @@
 #endif
 	addr = (stack_item *)twoword_static_address(fb);
 	memcpy(bufp + constant_table[opcode][state][0], &addr, 4);
-	addr++;
-	memcpy(bufp + constant_table[opcode][state][1], &addr, 4);
       }
       break;
 
@@ -3613,7 +3738,7 @@
 	}
 #endif
 
-#if defined(INITCLASS_IN_COMPILATION) || defined(NO_PATCH)
+#if defined(INITCLASS_IN_COMPILATION) && !defined(PATCH_ON_JUMP) && !defined(PATCH_WITH_SIGTRAP)
 	{
 	  ClassClass *cb = fieldclass(&method->fb);
 	  if (!CB_INITIALIZED(cb))  InitClass(cb);
@@ -3651,7 +3776,7 @@
 #  define CONST_NEW_DEBUG2
 #endif
 
-#if defined(INITCLASS_IN_COMPILATION) || defined(NO_PATCH)
+#if defined(INITCLASS_IN_COMPILATION) && !defined(PATCH_ON_JUMP) && !defined(PATCH_WITH_SIGTRAP)
 #  define CALL_INITCLASS_NEW \
 	if (!CB_INITIALIZED(cb))  InitClass(cb);
 #else
@@ -3761,7 +3886,7 @@
       }
       break;
 
-#if defined(INITCLASS_IN_COMPILATION) || defined(NO_PATCH)
+#if (defined(INITCLASS_IN_COMPILATION) && !defined(PATCH_ON_JUMP)) || defined(PATCH_WITH_SIGTRAP)
 #else
     case opc_invokeignored_static:
     // invokeignored_static_quick doesn't need this process
@@ -3769,6 +3894,7 @@
 	ClassClass *cb;
 	sysAssert(operand != -1);
 
+#ifdef CODEDB
 	if (OPT_SETQ(OPT_CODEDB) &&
 		!CONSTANT_POOL_TYPE_TABLE_IS_RESOLVED(type_table, operand)) {
 	  if (!ResolveClassConstantFromClass2(fieldclass(&mb->fb),
@@ -3777,6 +3903,7 @@
 	    goto resolvedyn_done;
 	  }
 	}
+#endif	// CODEDB
 
 	cb = fieldclass(&(constant_pool[operand].mb->fb));
 
diff -aruN shujit-0.7.3/compiler.c shujit/compiler.c
--- shujit-0.7.3/compiler.c	Fri Jul  6 09:15:19 2001
+++ shujit/compiler.c	Sun Jul 29 12:44:23 2001
@@ -461,7 +461,8 @@
 #  endif
 
   asm(".globl exam_nest\n\t"
-      "exam_nest: int $0x10");
+      "int $3\n\t"
+      "exam_nest:");
 
 #  if JDK_VER < 12
   *(char **)vector[3] = NULL;
diff -aruN shujit-0.7.3/compiler.h shujit/compiler.h
--- shujit-0.7.3/compiler.h	Wed Jul  4 20:28:50 2001
+++ shujit/compiler.h	Wed Sep  5 17:09:47 2001
@@ -26,6 +26,13 @@
 
 #include "config.h"
 
+// for {,u}int{8,16,32}_t types
+#ifdef HAVE_STDINT_H
+#  include <stdint.h>
+#else
+typedef unsigned char uint8_t;
+#endif
+
 #include "x86tsc.h"
 #include "opcodes.h"
 #include "opcodes_internal.h"
@@ -83,6 +90,10 @@
 
 // feature control
 
+#define PATCH_WITH_SIGTRAP
+#undef PATCH_ON_JUMP
+#undef INITCLASS_IN_COMPILATION
+
 #define METHOD_INLINING
 #define DIRECT_INVOCATION
 #define EAGER_COMPILATION
@@ -97,8 +108,6 @@
 #define DIRECT_INV_NATIVE
 #define ALIGN_JUMP_TARGET
 #define FORCE_DOUBLE_PRECISION
-#undef NO_PATCH
-#undef INITCLASS_IN_COMPILATION
 #undef IGNORE_DISABLE
 #undef NO_CHECK
 #undef COUNT_TSC
@@ -127,7 +136,14 @@
 #  endif
 #endif
 
-#if defined(NULLEXC_BY_SIGNAL) || defined(ARITHEXC_BY_SIGNAL)
+#ifdef PATCH_WITH_SIGTRAP
+#  undef PATCH_ON_JUMP
+#  undef INITCLASS_IN_COMPILATION
+#elif defined(PATCH_ON_JUMP)
+#  undef INITCLASS_IN_COMPILATION
+#endif
+
+#if defined(NULLEXC_BY_SIGNAL) || defined(ARITHEXC_BY_SIGNAL) || defined(PATCH_WITH_SIGTRAP)
 #  define EXC_BY_SIGNAL
 #endif
 
@@ -359,6 +375,7 @@
 typedef struct compiler_context {
   ExecEnv *ee;
   struct methodblock *mb;
+  int ref_count;
 
   CompilationStage stage;
   bool_t may_throw;	// the method may throw exceptions
@@ -399,9 +416,14 @@
 
 #if defined(EXC_BY_SIGNAL) || defined(GET_SIGCONTEXT)
 typedef struct throw_entry {
-  uint32_t start;
-  uint16_t len;
+  uint32_t start;	// on generated native code
   uint16_t byteoff;
+  uint8_t len;		// assume the length of native code <= 255
+#  ifdef PATCH_WITH_SIGTRAP
+  uint8_t patched_code;
+  ClassClass *cb;
+  uint16_t opcode;	// need 2 byte, because this is internal opcode
+#  endif
 } throwentry;
 #endif	// EXC_BY_SIGNAL
 
@@ -423,10 +445,7 @@
 
   sys_mon_t *monitor;
 
-#ifdef EAGER_COMPILATION
-  // for eager compilation
   CompilerContext *cc;
-#endif
 
 #ifdef METHOD_INLINING
   // for inlining
@@ -443,11 +462,15 @@
   uint32_t finish_return_nativeoff;
 
 #ifdef EXC_BY_SIGNAL
-#define DEFAULT_THROWTABLE_SIZE	8
+#define INITIAL_THROWTABLE_SIZE	8
   throwentry *throwtable;
   uint32_t throwtablelen;
   uint32_t throwtablesize;
 #endif	// EXC_BY_SIGNAL
+
+#ifdef PATCH_WITH_SIGTRAP
+  uint8_t *trampoline;
+#endif	// PATCH_WITH_SIGTRAP
 } CodeInfo;
 
 
@@ -529,10 +552,8 @@
   OPT_SCHED_RR,
 	// choose round robin scheduler
 #endif
-#ifdef CODE_DB
   OPT_CODEDB,
 	// save and re-use generated native code
-#endif	// CODE_DB
   OPT_IGNLOCK
 	// do not handle monitor
 };
@@ -663,8 +684,8 @@
 #ifdef CODE_DB
 extern void throwtableExtend(CodeInfo *info, uint32_t size);
 #endif	// CODE_DB
-extern void throwtableAdd(CodeInfo *info,
-	uint32_t start, uint16_t len, uint16_t byteoff);
+extern throwentry *throwtableAdd(CompilerContext *cc, CodeInfo *info,
+	uint32_t start, uint8_t len, uint16_t byteoff);
 extern throwentry *throwtableGet(CodeInfo *info, uint32_t nativeoff);
 #endif	// EXC_BY_SIGNAL
 
@@ -683,6 +704,13 @@
 extern int compileMethod(struct methodblock *mb,
 				CompilationStage target_stage);
 extern void freeMethod(struct methodblock *mb);
+
+#define ALIGNUP32(n)	( ((unsigned int)(n) + 3) & ~((unsigned int)3) )
+
+#define GET_UINT16(p)	((((unsigned char *)(p))[0] << 8) | (p)[1])
+#define GET_INT16(p)	((((signed char *)(p))[0] << 8) | (p)[1])
+#define GET_INT32(p)\
+ ((int)((unsigned char *)(p))[0] << 24| ((int)((unsigned char *)(p))[1] << 16) | ((int)((unsigned char *)(p))[2] << 8) | ((int)((unsigned char *)(p))[3]))
 
 // in optimize.c
 extern void peepholeOptimization(CompilerContext *cc);
diff -aruN shujit-0.7.3/computil.c shujit/computil.c
--- shujit-0.7.3/computil.c	Sun Mar 11 16:11:33 2001
+++ shujit/computil.c	Wed Aug  8 22:49:40 2001
@@ -2,7 +2,7 @@
   This file is part of shuJIT,
   Just In Time compiler for Sun Java Virtual Machine.
 
-  Copyright (C) 1998,1999,2000 Kazuyuki Shudo
+  Copyright (C) 1998,1999,2000,2001 Kazuyuki Shudo
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -101,39 +101,37 @@
 
 CompilerContext *getCompilerContext(struct methodblock *mb) {
   ExecEnv *ee = EE();	// for monitor{Enter,Exit}2()
-  CompilerContext *ret;
+  CompilerContext *cc;
   CodeInfo *info;
   MONITOR_T key = obj_monitor((JHandle *)fieldclass(&mb->fb));
 
   monitorEnter2(ee, key);
 
-#ifdef EAGER_COMPILATION
   // examine whether already created
   info = (CodeInfo *)mb->CompiledCodeInfo;
-  if (info != NULL) {
-    if (info->cc != NULL) {
-      ret = info->cc;
-      goto getcc_done;
-    }
+  if (info == NULL) {
+    info = prepareCompiledCodeInfo(ee, mb);
   }
-#endif
 
-  // prepare new cc
-  if (cc_pool) {
-    ret = cc_pool;
-    cc_pool = cc_pool->next;
+  cc = info->cc;
+  if (cc == NULL) {
+    // prepare new cc
+    if (cc_pool) {
+      cc = cc_pool;
+      cc_pool = cc_pool->next;
 
-    resetCompilerContext(ret, mb);
-  }
-  else {
-    ret = newCompilerContext(mb);
+      resetCompilerContext(cc, mb);
+    }
+    else {
+      cc = newCompilerContext(mb);
+    }
   }
 
-getcc_done:
-  ret->ee = ee;	// set ExecEnv
+  cc->ee = ee;	// set ExecEnv
+  cc->ref_count++;
 
   monitorExit2(ee, key);
-  return ret;
+  return cc;
 }
 
 
@@ -146,15 +144,17 @@
 
   monitorEnter2(ee, key);
 
-#ifdef EAGER_COMPILATION
-  info = (CodeInfo *)cc->mb->CompiledCodeInfo;
-  if (info != NULL) {
-    info->cc = NULL;
-  }
-#endif
+  cc->ref_count--;
+  if (cc->ref_count <= 0) {
+    // release
+    info = (CodeInfo *)cc->mb->CompiledCodeInfo;
+    if (info != NULL) {
+      info->cc = NULL;
+    }
 
-  cc->next = cc_pool;
-  cc_pool = cc;
+    cc->next = cc_pool;
+    cc_pool = cc;
+  }
 
   monitorExit2(ee, key);
 }
@@ -183,6 +183,7 @@
 
   cc->ee = EE();
   cc->mb = mb;
+  cc->ref_count = 0;
 
   cc->stage = STAGE_START;
   cc->may_throw = FALSE;
@@ -643,12 +644,48 @@
   }
 
 #ifdef EXC_BY_SIGNAL
-  info->throwtablesize = DEFAULT_THROWTABLE_SIZE;
   info->throwtablelen = 0;
+#  if 1
+  info->throwtablesize = 0;
+  info->throwtable = NULL;
+#  else
+  info->throwtablesize = INITIAL_THROWTABLE_SIZE;
   info->throwtable =
-	(throwentry *)sysMalloc(sizeof(throwentry) * DEFAULT_THROWTABLE_SIZE);
+	(throwentry *)sysMalloc(sizeof(throwentry) * INITIAL_THROWTABLE_SIZE);
+#  endif
 #endif	// EXC_BY_SIGNAL
 
+#ifdef PATCH_WITH_SIGTRAP
+  info->trampoline = sysMalloc(43);
+  *((uint32_t *)info->trampoline) = 0x00685152;
+  info->trampoline[7] = (uint8_t)0x68;
+  info->trampoline[12] = (uint8_t)0x68;
+  info->trampoline[17] = (uint8_t)0x68;
+  info->trampoline[22] = (uint8_t)0xe8;
+  info->trampoline[27] = (uint8_t)0x83;
+  *((uint32_t *)(info->trampoline + 28)) = 0xc0850cc4;
+  *((uint32_t *)(info->trampoline + 32)) = 0x0f5a5958;
+  info->trampoline[36] = (uint8_t)0x85;
+  *((uint16_t *)(info->trampoline + 41)) = (uint16_t)0xe0ff;
+
+  /*
+    pushl  %edx		(0)  52
+    pushl  %ecx		(1)  51
+    pushl  <orig. PC>	(2)  68 XX XX XX XX
+    pushl  cur_cb	(7)  68 XX XX XX XX
+    pushl  cb		(12) 68 XX XX XX XX
+    pushl  ee		(17) 68 XX XX XX XX
+    call   <function>	(22) e8 XX XX XX XX
+    addl   $12,%esp	(27) 83 c4 0c
+    testl  %eax,%eax	(30) 85 c0
+    popl   %eax		(32) 58
+    popl   %ecx		(33) 59
+    popl   %edx		(34) 5a
+    jnz   <exc handler>	(35) 0f 85 XX XX XX XX
+    jmp    *%eax	(41) ff e0
+  */
+#endif	// PATCH_WITH_SIGTRAP
+
 prepare_done:
   return info;
 }
@@ -665,6 +702,9 @@
 #endif	// EXC_BY_SIGNAL
     if (info->argsizes)  sysFree(info->argsizes);
     if (info->terse_sig)  sysFree(info->terse_sig);
+#ifdef PATCH_WITH_SIGTRAP
+    if (info->trampoline)  sysFree(info->trampoline);
+#endif	// PATCH_WITH_SIGTRAP
     sysFree(info);
   }
 }
@@ -673,35 +713,58 @@
 #ifdef EXC_BY_SIGNAL
 #ifdef CODE_DB
 void throwtableExtend(CodeInfo *info, uint32_t size) {
-  if (size < info->throwtablesize)  return;
+  if (size <= info->throwtablesize)  return;
 
-  info->throwtable =
+  if (info->throwtable != NULL) {
+    info->throwtable =
 	(throwentry *)sysRealloc(info->throwtable, sizeof(throwentry) * size);
+  }
+  else {
+    info->throwtable =
+	(throwentry *)sysMalloc(sizeof(throwentry) * size);
+  }
+
   info->throwtablesize = size;
 }
 #endif	// CODE_DB
 
 
-void throwtableAdd(CodeInfo *info,
-	uint32_t start, uint16_t len, uint16_t byteoff) {
+throwentry *throwtableAdd(CompilerContext *cc, CodeInfo *info,
+	uint32_t start, uint8_t len, uint16_t byteoff) {
   throwentry *entryp;
-
   sysAssert(info != NULL);
 
   if (info->throwtablelen >= info->throwtablesize) {	// extend table size
-    do
-      info->throwtablesize <<= 1;
-    while (info->throwtablelen >= info->throwtablesize);
-    info->throwtable = (throwentry *)sysRealloc(info->throwtable,
-				sizeof(throwentry) * info->throwtablesize);
+    int size = info->throwtablesize;
+    if (size <= 0)
+      size = INITIAL_THROWTABLE_SIZE;
+
+    while (size <= info->throwtablelen)
+      size <<= 1;
+
+    throwtableExtend(info, size);
   }
+#ifdef COMPILE_DEBUG
+  if (cc->compile_debug) {
+    printf("throwtableAdd(): byte 0x%x, native 0x%x - 0x%x\n",
+	byteoff, start, start + len);
+    fflush(stdout);
+  }
+#endif
 
   entryp = info->throwtable + info->throwtablelen;
   entryp->start = start;
-  entryp->len = len;
   entryp->byteoff = byteoff;
+  entryp->len = len;
+#ifdef PATCH_WITH_SIGTRAP
+  entryp->patched_code = 0x90;	// nop
+  entryp->opcode = 0;
+  entryp->cb = NULL;
+#endif
 
   (info->throwtablelen)++;
+
+  return entryp;
 }
 
 
@@ -711,7 +774,7 @@
   int index;
   throwentry *entryp;
 
-  while (1) {
+  while (1) {	// binary search
     index = l + ((h - l) >> 1);
 
     entryp = info->throwtable + index;
diff -aruN shujit-0.7.3/config.h.in shujit/config.h.in
--- shujit-0.7.3/config.h.in	Wed Jul  4 20:40:01 2001
+++ shujit/config.h.in	Wed Sep  5 17:03:07 2001
@@ -13,7 +13,12 @@
 #undef MONITOR_T
 
 // assembly code or C, which version of interpreter is used
+#ifndef DEBUG
 #undef EXECUTEJAVA_IN_ASM
+#endif
+
+// whether the <stdint.h> exists
+#undef HAVE_STDINT_H
 
 // whether the <asm/ucontext.h> exists
 #undef HAVE_UCONTEXT_H
diff -aruN shujit-0.7.3/configure shujit/configure
--- shujit-0.7.3/configure	Thu Jul 12 13:26:31 2001
+++ shujit/configure	Wed Sep  5 17:06:43 2001
@@ -1650,15 +1650,34 @@
 EOF
 
 
+ac_jincdir2="$ac_jhome/include"
 if test "$ac_jver" = "11"; then
-	ac_jincdir="$ac_jhome/include"
+	ac_jincdir1="$ac_jhome/include"
 else
-	ac_jincdir="$ac_jhome/include-old"
+	ac_jincdir1="$ac_jhome/include-old"
 fi
 
 
+
+case "$host_os" in
+	netbsd*)
+		ac_jincdir_md=netbsd
+	;;
+	freebsd*)
+		ac_jincdir_md=freebsd
+	;;
+	linux*)
+		if test "$ac_jver" = "11"; then
+			ac_jincdir_md=genunix
+		else
+			ac_jincdir_md=linux
+		fi
+	;;
+esac
+
+
 echo $ac_n "checking asm or C, which version of interpreter is used""... $ac_c" 1>&6
-echo "configure:1662: checking asm or C, which version of interpreter is used" >&5
+echo "configure:1681: checking asm or C, which version of interpreter is used" >&5
 # Check whether --enable-c-interpreter or --disable-c-interpreter was given.
 if test "${enable_c_interpreter+set}" = set; then
   enableval="$enable_c_interpreter"
@@ -1698,9 +1717,9 @@
 
 
 echo $ac_n "checking version of libc""... $ac_c" 1>&6
-echo "configure:1702: checking version of libc" >&5
+echo "configure:1721: checking version of libc" >&5
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1704: checking how to run the C preprocessor" >&5
+echo "configure:1723: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1715,13 +1734,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1719 "configure"
+#line 1738 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1732,13 +1751,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1736 "configure"
+#line 1755 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1749,13 +1768,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1753 "configure"
+#line 1772 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1780,7 +1799,7 @@
 echo "$ac_t""$CPP" 1>&6
 
 cat > conftest.$ac_ext <<EOF
-#line 1784 "configure"
+#line 1803 "configure"
 #include "confdefs.h"
 
 		#include <stdio.h>
@@ -1805,21 +1824,21 @@
 fi
 
 echo $ac_n "checking POSIX.1b Scheduling Interface""... $ac_c" 1>&6
-echo "configure:1809: checking POSIX.1b Scheduling Interface" >&5
+echo "configure:1828: checking POSIX.1b Scheduling Interface" >&5
 ac_posix_sched=
 ac_safe=`echo "sched.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sched.h""... $ac_c" 1>&6
-echo "configure:1813: checking for sched.h" >&5
+echo "configure:1832: checking for sched.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1818 "configure"
+#line 1837 "configure"
 #include "confdefs.h"
 #include <sched.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1837,12 +1856,12 @@
   echo "$ac_t""yes" 1>&6
   
 		echo $ac_n "checking for sched_setscheduler""... $ac_c" 1>&6
-echo "configure:1841: checking for sched_setscheduler" >&5
+echo "configure:1860: checking for sched_setscheduler" >&5
 if eval "test \"`echo '$''{'ac_cv_func_sched_setscheduler'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1846 "configure"
+#line 1865 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char sched_setscheduler(); below.  */
@@ -1865,7 +1884,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_sched_setscheduler=yes"
 else
@@ -1898,9 +1917,50 @@
  
 
 
+echo $ac_n "checking whether the <stdint.h> header exists""... $ac_c" 1>&6
+echo "configure:1922: checking whether the <stdint.h> header exists" >&5
+ac_safe=`echo "stdint.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for stdint.h""... $ac_c" 1>&6
+echo "configure:1925: checking for stdint.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1930 "configure"
+#include "confdefs.h"
+#include <stdint.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+		cat >> confdefs.h <<\EOF
+#define HAVE_STDINT_H 1
+EOF
+
+	
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
 echo $ac_n "checking type of an argument of monitorEnter()""... $ac_c" 1>&6
-echo "configure:1903: checking type of an argument of monitorEnter()" >&5
-ac_monitor_t=`$ac_grep monitorEnter $ac_jincdir/monitor.h | $ac_sed 's/(/ /' | $ac_sed "s/.* \(.*\));.*/\1/"`
+echo "configure:1963: checking type of an argument of monitorEnter()" >&5
+ac_monitor_t=`$ac_grep monitorEnter $ac_jincdir1/monitor.h | $ac_sed 's/(/ /' | $ac_sed "s/.* \(.*\));.*/\1/"`
 echo "$ac_t""$ac_monitor_t" 1>&6
 cat >> confdefs.h <<EOF
 #define MONITOR_T $ac_monitor_t
@@ -1908,7 +1968,7 @@
 
 
 echo $ac_n "checking whether the <asm/ucontext.h> header exists""... $ac_c" 1>&6
-echo "configure:1912: checking whether the <asm/ucontext.h> header exists" >&5
+echo "configure:1972: checking whether the <asm/ucontext.h> header exists" >&5
 if test -f "/usr/include/asm/ucontext.h"; then
 	echo "$ac_t""exists" 1>&6
 	cat >> confdefs.h <<\EOF
@@ -1920,8 +1980,8 @@
 fi
 
 echo $ac_n "checking whether the JDK_HOME/include/green_threads directory exists""... $ac_c" 1>&6
-echo "configure:1924: checking whether the JDK_HOME/include/green_threads directory exists" >&5
-if test -d "$ac_jincdir/green_threads"; then
+echo "configure:1984: checking whether the JDK_HOME/include/green_threads directory exists" >&5
+if test -d "$ac_jincdir1/green_threads"; then
 	echo "$ac_t""exists" 1>&6
 	cat >> confdefs.h <<\EOF
 #define HAVE_GREENTHR_HEADER 1
@@ -2110,7 +2170,9 @@
 s%@ac_jar@%$ac_jar%g
 s%@ac_javadoc@%$ac_javadoc%g
 s%@ac_jver@%$ac_jver%g
-s%@ac_jincdir@%$ac_jincdir%g
+s%@ac_jincdir1@%$ac_jincdir1%g
+s%@ac_jincdir2@%$ac_jincdir2%g
+s%@ac_jincdir_md@%$ac_jincdir_md%g
 s%@CPP@%$CPP%g
 
 CEOF
diff -aruN shujit-0.7.3/configure.in shujit/configure.in
--- shujit-0.7.3/configure.in	Wed Jul  4 20:41:48 2001
+++ shujit/configure.in	Wed Sep  5 17:06:39 2001
@@ -197,12 +197,31 @@
 AC_SUBST(ac_jver)
 AC_DEFINE_UNQUOTED(JDK_VER, $ac_jver)
 
+ac_jincdir2="$ac_jhome/include"
 if test "$ac_jver" = "11"; then
-	ac_jincdir="$ac_jhome/include"
+	ac_jincdir1="$ac_jhome/include"
 else
-	ac_jincdir="$ac_jhome/include-old"
+	ac_jincdir1="$ac_jhome/include-old"
 fi
-AC_SUBST(ac_jincdir)
+AC_SUBST(ac_jincdir1)
+AC_SUBST(ac_jincdir2)
+
+case "$host_os" in
+	netbsd*)
+		ac_jincdir_md=netbsd
+	;;
+	freebsd*)
+		ac_jincdir_md=freebsd
+	;;
+	linux*)
+		if test "$ac_jver" = "11"; then
+			ac_jincdir_md=genunix
+		else
+			ac_jincdir_md=linux
+		fi
+	;;
+esac
+AC_SUBST(ac_jincdir_md)
 
 AC_MSG_CHECKING([asm or C, which version of interpreter is used])
 AC_ARG_ENABLE(c-interpreter,
@@ -267,8 +286,14 @@
 
 dnl Checks for header files.
 
+AC_MSG_CHECKING(whether the <stdint.h> header exists)
+AC_CHECK_HEADER(stdint.h,
+	[
+		AC_DEFINE(HAVE_STDINT_H)
+	])
+
 AC_MSG_CHECKING(type of an argument of monitorEnter())
-ac_monitor_t=`$ac_grep monitorEnter $ac_jincdir/monitor.h | $ac_sed 's/(/ /' | $ac_sed "s/.* \(.*\));.*/\1/"`
+ac_monitor_t=`$ac_grep monitorEnter $ac_jincdir1/monitor.h | $ac_sed 's/(/ /' | $ac_sed "s/.* \(.*\));.*/\1/"`
 AC_MSG_RESULT($ac_monitor_t)
 AC_DEFINE_UNQUOTED(MONITOR_T, $ac_monitor_t)
 
@@ -281,7 +306,7 @@
 fi
 
 AC_MSG_CHECKING(whether the JDK_HOME/include/green_threads directory exists)
-if test -d "$ac_jincdir/green_threads"; then
+if test -d "$ac_jincdir1/green_threads"; then
 	AC_MSG_RESULT(exists)
 	AC_DEFINE(HAVE_GREENTHR_HEADER)
 else
diff -aruN shujit-0.7.3/gentable.rb shujit/gentable.rb
--- shujit-0.7.3/gentable.rb	Sat Jan  6 03:03:45 2001
+++ shujit/gentable.rb	Mon Sep  3 18:51:45 2001
@@ -321,6 +321,13 @@
 end
 
 
+if max_code_len > 255
+  print "FATAL: max code length exceeds 255 !!!\n"
+	# throwentry (compiler.h) assumes the length of native code <= 255
+  exit 1
+end
+
+
 open(CONST_C_FNAME, "w") do |f|
   f.print "\#include \"#{CONST_H_FNAME}\"\n\n"
 
@@ -391,7 +398,7 @@
 
 open(CONST_H_FNAME, "w") do |f|
   f.print <<EOF
-#include "compiler.h"
+#include "../compiler.h"
 
 extern long long int __divdi3(long long int x, long long int y);
 extern long long int __moddi3(long long int x, long long int y);
diff -aruN shujit-0.7.3/linker.c shujit/linker.c
--- shujit-0.7.3/linker.c	Sun Mar 11 16:11:47 2001
+++ shujit/linker.c	Sat Sep  1 23:10:21 2001
@@ -83,10 +83,16 @@
     char buf[MAXPATHLEN];
     char load_error[STK_BUF_LEN*2];
 
+#ifdef DEBUG
+#  define LIB_SUFFIX	"_g.so"
+#else
+#  define LIB_SUFFIX	".so"
+#endif
+
 #define SEARCH_LIB(LIB_NAME, DIR_NAME, VAR_NAME) \
     if (!VAR_NAME) {\
       /* sysBuildLibName(buf, sizeof(buf), java_dll_dir, LIB_NAME); */\
-      snprintf(buf, sizeof(buf), "%s/%slib%s.so",\
+      snprintf(buf, sizeof(buf), "%s/%slib%s" LIB_SUFFIX,\
 		java_dll_dir, DIR_NAME, LIB_NAME);\
       VAR_NAME = sysLoadLibrary(buf, load_error, sizeof(load_error));\
       if (!VAR_NAME) {\
diff -aruN shujit-0.7.3/opcodes_internal.h shujit/opcodes_internal.h
--- shujit-0.7.3/opcodes_internal.h	Sun Mar 11 16:11:56 2001
+++ shujit/opcodes_internal.h	Mon Jul 16 01:08:53 2001
@@ -24,10 +24,6 @@
 //
 // Internal Opcodes
 //
-#define	opc_impdep1	254	// 0xfe
-#define	opc_impdep2	255	// 0xff
-
-
 #define	opc_methodhead	230	// 0xe6
 #define opc_start	231
 #define opc_end		232
@@ -57,6 +53,9 @@
 #define	opc_invokeignored_static	251	// 0xfb
 #define	opc_invokeignored_static_quick	252
 
+// 254 and 255 are reserved for VM specific instructions
+#define	opc_impdep1	254	// 0xfe
+#define	opc_impdep2	255	// 0xff
 
 #define	opc_fill_cache	256	// 0x100
 #define	opc_flush_cache	257
diff -aruN shujit-0.7.3/rate_codesize.rb shujit/rate_codesize.rb
--- shujit-0.7.3/rate_codesize.rb	Wed Jan 17 15:47:48 2001
+++ shujit/rate_codesize.rb	Tue Aug  7 22:56:26 2001
@@ -14,6 +14,7 @@
 ninst = 0
 byte_size = 0
 native_size = 0
+tentry_size = 0
 
 if $*[0]
   filename = $*[0]
@@ -28,22 +29,31 @@
 
 while gets()
   next if /^#/
-  chomp!()
-  elems = split()
+  chomp!
+  elems = split
+
   nmethod += 1
-  ninst += elems[0].to_i()
-  byte_size += elems[1].to_i()
-  native_size += elems[2].to_i()
+  ninst += elems[0].to_i
+  byte_size += elems[1].to_i
+  native_size += elems[2].to_i
+  tentry_size += elems[4].to_i
 end
 
 if f then
   f.close
 end
 
-print "num of compiled method:  #{nmethod}\n"
-print "num of byte code inst:   #{ninst}\n"
-print "byte code size (byte):   #{byte_size}\n"
-print "native code size (byte): #{native_size}\n"
+print "num compiled method: #{nmethod}\n"
+print "num bytecode:        #{ninst}\n"
+print "size bytecode:       #{byte_size}\n"
+print "size native code:    #{native_size}\n"
+
+print "size native code / num bytecode:  #{native_size.to_f / ninst}\n"
+print "size native code / size bytecode: #{native_size.to_f / byte_size}\n"
+
+print "size throw entry:    #{tentry_size}\n"
+
+print "all generated:       #{native_size + tentry_size}\n"
 
-print "native code size / num of inst:    #{native_size.to_f() / ninst}\n"
-print "native code size / byte code size: #{native_size.to_f() / byte_size}\n"
+print "all generated / num bytecode:     #{(native_size + tentry_size).to_f / ninst}\n"
+print "all generated / size bytecode:    #{(native_size + tentry_size).to_f / byte_size}\n"
diff -aruN shujit-0.7.3/runtime.c shujit/runtime.c
--- shujit-0.7.3/runtime.c	Tue Jun 26 16:42:13 2001
+++ shujit/runtime.c	Mon Jul 30 15:47:59 2001
@@ -51,6 +51,7 @@
 #ifdef RUNTIME_DEBUG
   if (!info) {
     printf("WARNING: CompiledCodeInfo is NULL. (invocationHelper())\n");
+    fflush(stdout);
     printf("  %s#%s %s\n", cbName(fieldclass(&method->fb)),
 		method->fb.name, method->fb.signature);
     fflush(stdout);
@@ -1002,8 +1003,10 @@
 }
 
 
-#if !defined(INITCLASS_IN_COMPILATION) && !defined(NO_PATCH)
+#if defined(PATCH_ON_JUMP) || defined(PATCH_WITH_SIGTRAP)
 int once_InitClass(ExecEnv *ee, ClassClass *cb) {
+  sysAssert(cb != NULL);
+
   if (!CB_INITIALIZED(cb))  InitClass(cb);
 
   return exceptionOccurred(ee);
@@ -1011,15 +1014,17 @@
 #endif
 
 
-#ifndef NO_PATCH
+#if defined(PATCH_ON_JUMP) || defined(PATCH_WITH_SIGTRAP)
 	// cannot omit if INITCLASS_IN_COMPILATION is defined.
 int once_in_new(ExecEnv *ee, ClassClass *cb, ClassClass *cur_cb) {
   unsigned short access;
 
+  sysAssert(cb != NULL);
+
   access = cbAccess(cb);
   if (access & (ACC_INTERFACE | ACC_ABSTRACT)) {
     SignalError(ee, JAVAPKG "InstantiationError", 0);
-    return 1;
+    return TRUE;
   }
 
   // access authority check
@@ -1027,18 +1032,18 @@
 	// cur_mb may be not correct if METHOD_INLINING is defined
   if (!VerifyClassAccess(cur_cb, cb, TRUE)) {
     SignalError(ee, JAVAPKG "IllegalAccessError", 0);
-    return 1;
+    return TRUE;
   }
 #  endif	// NO_CHECK
 
   // class initialization
-#  if !defined(INITCLASS_IN_COMPILATION) && !defined(NO_PATCH)
+#  if !defined(INITCLASS_IN_COMPILATION) && (defined(PATCH_ON_JUMP) || defined(PATCH_WITH_SIGTRAP))
   if (!CB_INITIALIZED(cb))  InitClass(cb);
 #  endif
 
-  return 0;
+  return exceptionOccurred(ee);
 }
-#endif	// !NO_PATCH
+#endif	// PATCH_ON_JUMP || PATCH_WITH_SIGTRAP
 
 
 #if (JDK_VER < 12)
diff -aruN shujit-0.7.3/signal.c shujit/signal.c
--- shujit-0.7.3/signal.c	Fri Jun 29 17:55:21 2001
+++ shujit/signal.c	Mon Jul 30 15:45:49 2001
@@ -2,7 +2,7 @@
   This file is part of shuJIT,
   Just In Time compiler for Sun Java Virtual Machine.
 
-  Copyright (C) 1998,1999,2000 Kazuyuki Shudo
+  Copyright (C) 1998,1999,2000,2001 Kazuyuki Shudo
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -163,8 +163,6 @@
   showSigcontext(found_sc);
 #endif
 
-#define INT_INSN_SIZE	2	// size of the instruction int $0x10
-  SIGCONTEXT(found_sc, eip) += INT_INSN_SIZE;
   SIGRETURN(found_sc, found_ebp);
 }
 #endif	// (EXC_BY_SIGNAL || GET_SIGCONTEXT) && SEARCH_SIGCONTEXT
@@ -207,6 +205,9 @@
 #endif
 
 
+  //
+  // obtain sigcontext
+  //
 #if defined(EXC_BY_SIGNAL) || defined(GET_SIGCONTEXT)
 #ifndef SEARCH_SIGCONTEXT
 #  if defined(__FreeBSD__) || defined(__NetBSD__)
@@ -238,8 +239,13 @@
 
 
 #if defined(EXC_BY_SIGNAL) || defined(GET_SIGCONTEXT)
-  if ((sig != SIGSEGV) && (sig != SIGFPE))  return FALSE;
+  if ((sig != SIGSEGV) && (sig != SIGFPE) && (sig != SIGTRAP))
+    return FALSE;
+
 
+  //
+  // calculate offset in compiled code
+  //
   mb = ee->current_frame->current_method;
   if (!mb)  return FALSE;
 #if defined(RUNTIME_DEBUG) || defined(COMPILE_DEBUG)
@@ -258,11 +264,17 @@
 #ifndef EXC_BY_SIGNAL
   return FALSE;
 #else
+
+
+  //
+  // obtain (throwentry *)tentry
+  //
   codeinfo = (CodeInfo *)(mb->CompiledCodeInfo);
   tentry = throwtableGet(codeinfo, native_off);
 
   if (tentry) {
     opcode = *(mb->code + tentry->byteoff);
+	// not internal opcode
   }
   else if (!tentry) {	// search EIP in native code
     uint32_t *ebp;
@@ -312,8 +324,13 @@
   fflush(stdout);
 #endif	// RUNTIME_DEBUG || COMPILE_DEBUG
 
+
+  //
+  // manage the observed signal
+  //
+  switch (sig) {
 #ifdef NULLEXC_BY_SIGNAL
-  if (sig == SIGSEGV) {
+  case SIGSEGV:
     if (!exceptionOccurred(ee)) {
 #  ifdef CAUSE_STACKOVERFLOW
       unsigned char *pc = (unsigned char *)SIGCONTEXT(sc, eip);
@@ -329,13 +346,11 @@
 	SignalError(NULL, JAVAPKG "NullPointerException", 0);
       }
     }
-  }
-#endif	//NULLEXC_BY_SIGNAL
-#if defined(NULLEXC_BY_SIGNAL) && defined(ARITHEXC_BY_SIGNAL)
-  else
-#endif
+    break;
+#endif	// NULLEXC_BY_SIGNAL
+
 #ifdef ARITHEXC_BY_SIGNAL
-  if (sig == SIGFPE) {
+  case SIGFPE:
     if ((opcode == opc_idiv) || (opcode == opc_irem)) {
       if (SIGCONTEXT(sc, ecx) /* divisor */ == 0) {
 	// ArithmeticException occurred
@@ -394,12 +409,127 @@
 
       goto signal_handler_error;
     }
-  }	// if (sig == SIGFPE)
+    break;
 #endif	// ARITHEXC_BY_SIGNAL
-#if defined(NULLEXC_BY_SIGNAL) || defined(ARITHEXC_BY_SIGNAL)
-  else
+
+#ifdef PATCH_WITH_SIGTRAP
+  case SIGTRAP:
+    {
+      cp_item_type *constant_pool = cbConstantPool(fieldclass(&mb->fb));
+      uint8_t *trampoline = codeinfo->trampoline;
+      uint8_t *once_function = NULL;
+
+      switch (tentry->opcode) {
+		// not an opcode variable.
+		// tentry->opcode is the exact internal opcode even if inlined.
+      case opc_getstatic:  case opc_getstatic2:
+      case opc_putstatic:  case opc_putstatic2:
+#  ifdef METHOD_INLINING
+      case opc_inlined_enter:
+#  endif
+	{
+	  ClassClass *cb = tentry->cb;
+	  sysAssert(cb != NULL);
+#ifdef RUNTIME_DEBUG
+	  printf("once_InitClass(%s)\n", cbName(cb));
+	  fflush(stdout);
 #endif
-  {
+
+	  // arguments for once_InitClass();
+	  *((uint32_t *)(trampoline + 13)) = (uint32_t)cb;
+	  once_function = (char *)once_InitClass;
+	}
+	break;
+
+      case opc_invokestatic:
+      case opc_invokeignored_static:
+	{
+	  ClassClass *cb = tentry->cb;
+	  sysAssert(cb != NULL);
+#ifdef RUNTIME_DEBUG
+	  printf("once_InitClass(%s)\n", cbName(cb));
+	  fflush(stdout);
+#endif
+
+	  // arguments for once_InitClass();
+	  *((uint32_t *)(trampoline + 13)) = (uint32_t)cb;
+	  once_function = (char *)once_InitClass;
+	}
+	break;
+
+      case opc_invokeinterface:
+	((uint8_t *)SIGCONTEXT(sc, eip))--;
+		// adjust PC
+	*((uint8_t *)SIGCONTEXT(sc, eip)) = tentry->patched_code;
+		// patch
+
+	if (SIGCONTEXT(sc, eax) != 0) {
+	  SIGRETURN(sc, ebp);
+	}
+	else
+	  goto sigtrap_exc;
+
+	// NOT REACHED
+	break;
+
+      case opc_new:
+	{
+	  ClassClass *cb, *cur_cb;
+	  cb = tentry->cb;
+	  cur_cb = fieldclass(&mb->fb);
+#ifdef RUNTIME_DEBUG
+	  printf("once_in_new(%s, %s)\n", cbName(cb), cbName(cur_cb));
+	  fflush(stdout);
+#endif
+
+	  // arguments for once_in_new();
+	  *((uint32_t *)(trampoline + 13)) = (uint32_t)cb;
+	  *((uint32_t *)(trampoline + 8)) = (uint32_t)cur_cb;
+	  once_function = (char *)once_in_new;
+	}
+	break;
+
+      default:
+	return FALSE;
+      }
+
+      // make a trampoline and jump to it
+      {
+	uint8_t *target_pc;
+
+	// ExecEnv
+	*((uint32_t *)(trampoline + 18)) = (uint32_t)ee;
+
+	// original PC
+	target_pc = ((uint8_t *)SIGCONTEXT(sc, eip)) - 1;
+	*target_pc = tentry->patched_code;	// patch
+	*((uint32_t *)(trampoline + 3)) = (uint32_t)target_pc;
+
+	// exc handler
+	target_pc = mb->CompiledCode + codeinfo->exc_handler_nativeoff;
+#if 1
+	*((uint32_t *)(trampoline + 37)) =
+		(uint32_t)(target_pc - (trampoline + 41));
+#else
+	*((uint32_t *)(trampoline + 37)) =
+		(uint32_t)0;
+#endif
+
+	// function once_*()
+	*((uint32_t *)(trampoline + 23)) =
+		(uint32_t)(once_function - (trampoline + 27));
+
+	SIGCONTEXT(sc, eip) = (uint32_t)trampoline;
+
+	SIGRETURN(sc, ebp);
+      }
+    }
+
+  sigtrap_exc:
+    break;
+#endif	// PATCH_WITH_SIGTRAP
+
+  default:
     return FALSE;
   }
 
@@ -418,8 +548,9 @@
 #endif
 
 
+  //
   // jump to exc_new or exc_handler in compiled code
-
+  //
 #if 0
   // re-initialize signal handler
   // associated with raised signal
@@ -440,7 +571,7 @@
 #endif	// 0
 
 
-  // set (int32_t)bytepcoff (local variable in assembledCode)
+  // set (int32_t)bytepcoff (local variable in assembledCode())
   *(((int32_t *)SIGCONTEXT(sc, ebp)) - 1) = tentry->byteoff;
 
 
diff -aruN shujit-0.7.3/txt/memo shujit/txt/memo
--- shujit-0.7.3/txt/memo	Mon Jul  2 15:20:35 2001
+++ shujit/txt/memo	Wed Sep  5 16:06:35 2001
@@ -139,8 +139,8 @@
 	single: 23, double: 52, extended: 64
     exponent のbit 数
 	single:  8, double: 11, extended: 15
-  - 丸め精度を倍精度にして単精度の除算を行った場合、丸めは 2度起こり得るか？
-    JGFNW の推奨する技法で、
+  - 丸め精度を倍精度にして単精度の除算を行っても、2度丸めの問題は起こり得ない。
+    実験結果: JGFNW の推奨する技法で、
     0 〜 0x00ffffff / 0x3f800001 (1.0 + e) and 0x3f7fffff (1.0 - e) では、
     丸め精度が single でも double でも差は出ない。
   - strictfp。
@@ -152,7 +152,7 @@
     overflow, underflow およびそれに起因する 2度丸め。
   - クラスが strictfp だった場合、コンストラクタが strictfp になるか確認。
   - javac の strictfp 対応。
-    Java 2 SDK 1.3 RC1 付属の javac (in tools.jar) でも対応していない。
+    Java 2 SDK 1.3.1 の javac でも対応していない。
   - C, Fortran などで strictfp。
   - 参考文献。
     - Proving the IEEE Correctness of Iterative
@@ -193,6 +193,7 @@
 JVM, JIT compiler のテスト
   - JDK の regression test: javasrc/test/
   - Kaffe のもの
+  - libgcj のもの
   - Mauve プロジェクト
 
 known bugs
