diff -aruN shujit-0.3.6/ChangeLog shujit/ChangeLog --- shujit-0.3.6/ChangeLog Fri Aug 20 17:27:03 1999 +++ shujit/ChangeLog Sat Aug 21 18:38:18 1999 @@ -1,5 +1,24 @@ $Id$ +[19990821] + +構造体 pcentry のメンバ byteoff の型を uint32_t から int32_t に修整。 +pctableGet() (computil.c) 中の比較で -1 が 2^32-1 として扱われて +FreeBSD で Swing を使用した場合に問題が起きていた。 +(compiler.h) + +compiled code から invocationHelper() (runtime.c) を呼び出す際に +%esi, %ebx を保存、復帰するようにした。 +invocationHelper() 中で invokeJITCompiledCode() ヘジャンプするため、 +invocationHelper() による %esi などの復帰を期待できないため。 +(code.c) + +オプション frcstrictfp を用意。 +すべての Java メソッドに strictfp のセマンティクスを強制する。 +(compiler.h, compiler.c, compile.c) + +0.3.7 リリース。 + [19990820] make 時に config.h が存在しない場合、./configure を実行するのを止め、 diff -aruN shujit-0.3.6/GNUmakefile shujit/GNUmakefile --- shujit-0.3.6/GNUmakefile Fri Aug 20 17:25:31 1999 +++ shujit/GNUmakefile Sat Aug 21 18:32:51 1999 @@ -49,7 +49,7 @@ INCDIR = -I${J_INCDIR} -I${J_INCDIR}/genunix -I${J_INCDIR}/linux -I${J_INCDIR}/freebsd -I/usr/local/include OPTFLAGS = -O2 -CDEBUGFLAGS =# -g -DCOMPILE_DEBUG -DRUNTIME_DEBUG# -DNO_CHECK +CDEBUGFLAGS =# -g -DRUNTIME_DEBUG# -DCOMPILE_DEBUG# -DNO_CHECK NOOPTCFLAGS = -pipe -fPIC ${CDEBUGFLAGS} ${INCDIR} CFLAGS = ${OPTFLAGS} ${NOOPTCFLAGS} LIBS = diff -aruN shujit-0.3.6/GNUmakefile.in shujit/GNUmakefile.in --- shujit-0.3.6/GNUmakefile.in Fri Aug 20 17:24:56 1999 +++ shujit/GNUmakefile.in Sat Aug 21 16:53:10 1999 @@ -49,7 +49,7 @@ INCDIR = -I${J_INCDIR} -I${J_INCDIR}/genunix -I${J_INCDIR}/linux -I${J_INCDIR}/freebsd -I/usr/local/include OPTFLAGS = -O2 -CDEBUGFLAGS =# -g -DCOMPILE_DEBUG -DRUNTIME_DEBUG# -DNO_CHECK +CDEBUGFLAGS =# -g -DRUNTIME_DEBUG# -DCOMPILE_DEBUG# -DNO_CHECK NOOPTCFLAGS = -pipe -fPIC ${CDEBUGFLAGS} ${INCDIR} CFLAGS = ${OPTFLAGS} ${NOOPTCFLAGS} LIBS = diff -aruN shujit-0.3.6/README shujit/README --- shujit-0.3.6/README Sun Aug 15 22:08:12 1999 +++ shujit/README Sat Aug 21 18:25:32 1999 @@ -18,7 +18,7 @@ - JDK 1.1.7v1a, egcs 1.1.2, libc5.4.38 and Linux 2.0.35 - FreeBSD - - JDK 1.1.8 (ELF, V99-6-3), egcs 1.1.2, FreeBSD 3.2R + - JDK 1.1.8 (ELF, V99-7-19), egcs 1.1.2, FreeBSD 3.2R * Installation diff -aruN shujit-0.3.6/code.c shujit/code.c --- shujit-0.3.6/code.c Thu Aug 19 03:10:59 1999 +++ shujit/code.c Sat Aug 21 16:47:22 1999 @@ -4009,6 +4009,9 @@ asm("leal -4(%edi,%ecx,4),%edi"); /* base of native stack */\ /* edi = original esp + 4 * (args_size - 1) */\ \ + /* save registers */\ + asm("pushl %esi\n\tpushl %ebx");\ + \ /* push args of invocationHelper() */\ INVOKE_ST0_PUSH_DEBUG_FLAG; /* push runtime_debug */\ asm("pushl $" STR(CONST)); /* push retsize */\ @@ -4035,6 +4038,9 @@ asm("movl 20(%esp),%edx"); /* edx = retsize */\ \ asm("addl $" INVOKE_ST0_ARG_SIZE ",%esp");\ + /* restore registers */\ + asm("popl %ebx\n\tpopl %esi");\ + \ CALL_INVOKEHELPER_DEBUG1;\ \ asm("popl %edi"); /* restore */\ diff -aruN shujit-0.3.6/code.h shujit/code.h --- shujit-0.3.6/code.h Wed Aug 18 00:59:16 1999 +++ shujit/code.h Sat Aug 21 16:47:46 1999 @@ -249,8 +249,12 @@ "andl $31,%edi\n\t"\ "cmpl $" STR(T_NORMAL_OBJECT) ",%edi\n\t"\ "je " LABEL "_mtdone");\ +/*\ asm("movl %0,%" #DST : : "m" (classJavaLangObject)\ : "eax","ecx","edx","esi"); /* force to use %edi */\ + asm("movl classJavaLangObject@GOT(%ebx),%edi\n\t"\ + "movl (%edi)," #DST);\ + \ CB_METHODTABLE(DST, DST);\ asm(LABEL "_mtdone:") /* destroy %edi, DST can't be %edi */ diff -aruN shujit-0.3.6/compile.c shujit/compile.c --- shujit-0.3.6/compile.c Thu Aug 19 03:39:48 1999 +++ shujit/compile.c Sat Aug 21 18:23:18 1999 @@ -327,8 +327,9 @@ if (processAnOpcode(cc, opc_methodhead, &state, &dummy_byteoff)) return 1; - if (!is_fpupc_double && !OPT_SETQ(OPT_IGNSTRICTFP) && - (mb->fb.access & ACC_STRICT)) { + if (!is_fpupc_double && + (OPT_SETQ(OPT_FRCSTRICTFP) || + (!OPT_SETQ(OPT_IGNSTRICTFP) && (mb->fb.access & ACC_STRICT)))) { if (processAnOpcode(cc, opc_strictenter, &state, &dummy_byteoff)) return 1; if (processAnOpcode(cc, opc_fppc_double, &state, &dummy_byteoff)) @@ -424,8 +425,9 @@ if (processAnOpcode(cc, opc_syncexit, &state, &dummy_byteoff)) return 1; - if (!is_fpupc_double && !OPT_SETQ(OPT_IGNSTRICTFP) && - (mb->fb.access & ACC_STRICT)) { + if (!is_fpupc_double && + (OPT_SETQ(OPT_FRCSTRICTFP) || + (!OPT_SETQ(OPT_IGNSTRICTFP) && (mb->fb.access & ACC_STRICT)))) { if (processAnOpcode(cc, opc_strictexit, &state, &dummy_byteoff)) return 1; } @@ -645,7 +647,8 @@ } /* switch (opcode) */ - if (!OPT_SETQ(OPT_IGNSTRICTFP) && (mb->fb.access & ACC_STRICT)) { + if (OPT_SETQ(OPT_FRCSTRICTFP) || + (!OPT_SETQ(OPT_IGNSTRICTFP) && (mb->fb.access & ACC_STRICT))) { switch (code_opcode) { case opc_fmul: code_opcode = opc_fmul_strict; break; diff -aruN shujit-0.3.6/compiler.c shujit/compiler.c --- shujit-0.3.6/compiler.c Thu Aug 19 03:48:02 1999 +++ shujit/compiler.c Sat Aug 21 18:20:49 1999 @@ -91,6 +91,7 @@ #endif /* CODE_DB */ {"cmplatload", OPT_CMPLATLOAD}, {"ignstrictfp", OPT_IGNSTRICTFP}, + {"frcstrictfp", OPT_FRCSTRICTFP}, {NULL, -1} }; int options = 0; diff -aruN shujit-0.3.6/compiler.h shujit/compiler.h --- shujit-0.3.6/compiler.h Thu Aug 19 03:14:33 1999 +++ shujit/compiler.h Sat Aug 21 18:23:32 1999 @@ -345,7 +345,7 @@ typedef struct pcentry { uint16_t opcode; uint16_t state; - uint32_t byteoff; + int32_t byteoff; /* must be able to be less than 0, so not unsigned */ uint32_t nativeoff; } pcentry; @@ -456,8 +456,10 @@ #endif /* CODE_DB */ OPT_CMPLATLOAD, /* compile the whole class when the class is loaded */ - OPT_IGNSTRICTFP + OPT_IGNSTRICTFP, /* ignore `strictfp' method modifier */ + OPT_FRCSTRICTFP + /* force `strictfp' semantics on every method */ }; extern int options; extern int opt_cmplthreshold; diff -aruN shujit-0.3.6/computil.c shujit/computil.c --- shujit-0.3.6/computil.c Sun Aug 15 16:25:23 1999 +++ shujit/computil.c Sat Aug 21 18:01:51 1999 @@ -355,7 +355,9 @@ return cc->pctable + index; } - if (l == h) return NULL; /* not found */ + if (l == h) { /* not found */ + return NULL; + } if (entryp->byteoff < byteoff) l = index + 1; diff -aruN shujit-0.3.6/invoker.c shujit/invoker.c --- shujit-0.3.6/invoker.c Sun Aug 15 17:08:21 1999 +++ shujit/invoker.c Sat Aug 21 18:02:41 1999 @@ -504,27 +504,15 @@ # if 0 runtime_debug = 1; # else - if ((!strcmp(cbName(mb->fb.clazz), "javax/swing/UIManager")) - && (!strcmp(mb->fb.name, "maybeInitialize"))) - runtime_debug = 1; - else if ((!strcmp(cbName(mb->fb.clazz), "sun/tools/java/Constants")) + if ((!strcmp(cbName(mb->fb.clazz), "sun/tools/java/Constants")) && (!strcmp(mb->fb.name, ""))) runtime_debug = 1; - else if ((!strcmp(cbName(mb->fb.clazz), "sun/awt/motif/MComponentPeer")) - && (!strcmp(mb->fb.name, "handleEvent"))) - runtime_debug = 1; - else if ((!strcmp(cbName(mb->fb.clazz), "sun/awt/Container")) - && (!strcmp(mb->fb.name, "validate"))) - runtime_debug = 1; - else if ((!strcmp(cbName(mb->fb.clazz), "sun/awt/motif/MComponentPeer")) - && (!strcmp(mb->fb.name, "drawScrollbar"))) - runtime_debug = 1; - else if ((!strcmp(cbName(mb->fb.clazz), "java/awt/Component")) - && (!strcmp(mb->fb.name, "show"))) +#if 0 + else if ((!strcmp(cbName(mb->fb.clazz), "javax/swing/UIManager")) + && (!strcmp(mb->fb.name, "maybeInitialize"))) runtime_debug = 1; -#if 0 else if ((!strcmp(cbName(mb->fb.clazz), "sun/applet/AppletViewer")) && (!strcmp(mb->fb.name, ""))) runtime_debug = 1;