diff -aruN shujit-0.6.9/ChangeLog shujit/ChangeLog --- shujit-0.6.9/ChangeLog Wed Dec 13 17:37:44 2000 +++ shujit/ChangeLog Sat Jan 6 16:13:11 2001 @@ -1,5 +1,34 @@ $Id$ +[20010106] + +strictfp が指定されたメソッドは、lazy compilation 時も +初めての呼び出し時にコンパイルしてしまうようにした。 +現在のインタプリタは strictfp 対応していないので、 +strictfp のセマンティクスに従うためには JIT コンパイルしてしまう必要がある。 +(invoker.c) + +0.6.10 リリース。 + +[20010105] + +writeCode() (compile.c) にて、内部命令 inlined_{enter,exit} に遭遇した場合、 +struct methodblock *mb だけでなく CodeInfo *info も更新してしまっていた。 +java.text.StringCharacterIterator クラスで問題が起きていた。 +info は更新しないように修整。 +(compile.c) + +java.lang.Math#{sin,cos,tan}() に対応するネイティブコード +(pre-assembled code) を変更した。 +これまでは単に、それぞれ fsin 命令, fcos 命令, fptan + ffreep %st(0) 命令を +呼んでいた。しかし、これらの命令はオペランドが 0 から π * 2^62 の範囲内で +なければならず、これまでこの範囲チェックをしていなかった。 +libm の関数 sin(), cos(), tan() を呼ぶように変更した。 +本来は、JDK 1.2 以降では fdlibm 中の jsin, jcos, jtan を呼ぶべきだが、 +これらのシンボルは libshujit.so ロード時には解決できないため、 +暫定処置として sin, cos, tan を呼ぶようにした。 +(code.c) + [20001213] 0.6.9 リリース。 diff -aruN shujit-0.6.9/README shujit/README --- shujit-0.6.9/README Wed Dec 13 20:26:16 2000 +++ shujit/README Sat Jan 6 16:39:43 2001 @@ -13,9 +13,9 @@ Working on the following platforms is confirmed. - Linux - - Blackdown JDK 1.2.2 FCS, pgcc 2.95.3, glibc 2.2 - and Linux 2.4.0-test12 - - JDK 1.1.8v3, pgcc 2.95.3, glibc 2.2 and Linux 2.4.0-test12 + - Blackdown JDK 1.2.2 FCS, gcc 2.95.2, glibc 2.2 + and Linux 2.4.0-ac2 + - JDK 1.1.8v3, gcc 2.95.2, glibc 2.2 and Linux 2.4.0-ac2 - JDK 1.1.7v1a, egcs 1.1.2, libc 5.4.38 and Linux 2.0.35 - FreeBSD diff -aruN shujit-0.6.9/code.c shujit/code.c --- shujit-0.6.9/code.c Sun Dec 10 16:59:55 2000 +++ shujit/code.c Fri Jan 5 23:01:30 2001 @@ -5276,19 +5276,28 @@ #ifdef SPECIAL_INLINING // inlined mathematical functions -#define JMATH_SIMPLE_FUNC_ST0(ROP) \ - asm("fldl (%esp)\n\t" ROP "\n\tfstpl (%esp)") +#define JMATH_DIRECT_ST0(ROP) \ + asm("fldl (%esp)\n\t" ROP "\n\tfstpl (%esp)") +#define JMATH_FUNCCALL_ST0(FUNC) \ + asm("call " SYMBOL(FUNC) "@PLT\n\t"\ + "fstpl (%esp)") -#define JMATH_SQRT_ST0 JMATH_SIMPLE_FUNC_ST0("fsqrt") -#define JMATH_SIN_ST0 JMATH_SIMPLE_FUNC_ST0("fsin") -#define JMATH_COS_ST0 JMATH_SIMPLE_FUNC_ST0("fcos") -#define JMATH_TAN_ST0 JMATH_SIMPLE_FUNC_ST0("fptan\n\tffreep %st(0)") +#define JMATH_SQRT_ST0 JMATH_DIRECT_ST0("fsqrt") +#if 0 +#define JMATH_SIN_ST0 JMATH_DIRECT_ST0("fsin") +#define JMATH_COS_ST0 JMATH_DIRECT_ST0("fcos") +#define JMATH_TAN_ST0 JMATH_DIRECT_ST0("fptan\n\tffreep %st(0)") +#else +#define JMATH_SIN_ST0 JMATH_FUNCCALL_ST0(sin) +#define JMATH_COS_ST0 JMATH_FUNCCALL_ST0(cos) +#define JMATH_TAN_ST0 JMATH_FUNCCALL_ST0(tan) +#endif #define JMATH_ATAN2_ST0 \ asm("fldl 8(%esp)\n\tfldl (%esp)\n\t"\ "addl $8,%esp\n\t"\ "fpatan\n\t"\ "fstpl (%esp)") -#define JMATH_ATAN_ST0 JMATH_SIMPLE_FUNC_ST0("fld1\n\tfpatan") +#define JMATH_ATAN_ST0 JMATH_DIRECT_ST0("fld1\n\tfpatan") #define JMATH_EXP_ST0 \ asm("fldl (%esp)\n\t"\ "fldl2e\n\t"\ @@ -5303,7 +5312,7 @@ "fscale\n\t"\ "fstpl (%esp)\n\t"\ "ffreep %st(0)") -#define JMATH_LOG_ST0 JMATH_SIMPLE_FUNC_ST0("fldln2\n\tfxch %st(1)\n\tfyl2x") +#define JMATH_LOG_ST0 JMATH_DIRECT_ST0("fldln2\n\tfxch %st(1)\n\tfyl2x") #define JMATH_FLOOR_CEIL_ST0(ROP) \ asm("fldl (%esp)\n\t"\ "subl $4,%esp\n\t"\ diff -aruN shujit-0.6.9/compile.c shujit/compile.c --- shujit-0.6.9/compile.c Fri Dec 8 02:19:41 2000 +++ shujit/compile.c Fri Jan 5 20:58:36 2001 @@ -2779,7 +2779,7 @@ // maintain methodblock pushToStack(stack, (long)mb); mb = method; - info = (CodeInfo *)(mb->CompiledCodeInfo); + // info must not be maintained constant_pool = cbConstantPool(fieldclass(&mb->fb)); type_table = constant_pool[CONSTANT_POOL_TYPE_TABLE_INDEX].type; } @@ -2792,7 +2792,7 @@ // maintain methodblock mb = (struct methodblock *)popFromStack(stack); - info = (CodeInfo *)(mb->CompiledCodeInfo); + // info must not be maintained constant_pool = cbConstantPool(fieldclass(&mb->fb)); type_table = constant_pool[CONSTANT_POOL_TYPE_TABLE_INDEX].type; diff -aruN shujit-0.6.9/compiler.h shujit/compiler.h --- shujit-0.6.9/compiler.h Tue Dec 12 21:57:11 2000 +++ shujit/compiler.h Tue Dec 26 16:19:05 2000 @@ -130,6 +130,8 @@ #ifdef METAVM # undef METHOD_INLINING +# undef LAZY_COMPILATION_THRESHOLD +# define LAZY_COMPILATION_THRESHOLD 1 #endif #ifndef DIRECT_INVOCATION diff -aruN shujit-0.6.9/gentable.rb shujit/gentable.rb --- shujit-0.6.9/gentable.rb Sun Nov 26 14:46:21 2000 +++ shujit/gentable.rb Sat Jan 6 03:03:45 2001 @@ -400,7 +400,14 @@ #if JDK_VER >= 12 extern sys_mon_t * monitorEnter2(struct execenv *, uintptr_t); extern int monitorExit2(struct execenv *, uintptr_t); + +extern double jsin(double); +extern double jcos(double); +extern double jtan(double); #endif +extern double sin(double); +extern double cos(double); +extern double tan(double); EOF if max_code_offset < 65536 && max_code_len < 256 diff -aruN shujit-0.6.9/invoker.c shujit/invoker.c --- shujit-0.6.9/invoker.c Tue Dec 12 23:12:12 2000 +++ shujit/invoker.c Sat Jan 6 03:10:49 2001 @@ -50,7 +50,7 @@ int access; int compilation_result; int invocation_count; -#ifdef RUNTIME_DEBUG +#if defined(RUNTIME_DEBUG) || defined(COMPILE_DEBUG) int runtime_debug = 0; #if 1 @@ -107,7 +107,8 @@ goto compilation_done; } else if ((invoker != sym_compileAndInvokeMethod) // being compiled - || (invocation_count < opt_cmplthreshold) + || ((invocation_count < opt_cmplthreshold) + && !(mb->fb.access & ACC_STRICT)) #ifndef IGNORE_DISABLE || (!compiler_enabled) // compiler is disabled #endif // IGNORE_DISABLE diff -aruN shujit-0.6.9/txt/benchmark-X20 shujit/txt/benchmark-X20 --- shujit-0.6.9/txt/benchmark-X20 Sat Nov 25 20:43:50 2000 +++ shujit/txt/benchmark-X20 Thu Dec 14 22:54:30 2000 @@ -2,7 +2,7 @@ Mobile Pentium III / 600MHz -[JDK の版] +[JVM の版] * Sun JDK 1.3, Server VM java version "1.3.0" @@ -15,9 +15,11 @@ * IBM JDK 1.3 java version "1.3.0" Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0) - Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cx130-20001025 (JIT enabled: jitc)) + Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cx130-20001124 (JIT enabled: jitc)) * IBM JDK 1.1.8 java full version "JDK 1.1.8 IBM build l118-20000713 (JIT enabled: jitc)" +* ORP 1.0.2 (2000年 12月 13日) + [設定] @@ -31,14 +33,16 @@ 500 x 500 -ORP (O3) 38.193 2.19 -IBM JDK 1.3.0 37.712 2.22 +ORP 2000-12-13 (O3) 38.368 2.19 +ORP 2000-11-21 (O3) 38.193 2.19 +IBM JDK 1.3.0 37.865 2.21 IBM JDK 1.1.8 35.949 2.33 Client VM, Blackdown 27.043 3.1 Client VM, Sun 27.043 3.1 Server VM, Sun 26.076 3.22 Server VM, Sun 26.027 3.22 -ORP (O1) 25.843 3.24 +ORP 2000-11-21 (O1) 25.843 3.24 +ORP 2000-12-13 (O1) 25.811 3.25 GCJ (O2, class) 25.739 3.26 GCJ (O2, java) 23.114 3.63 OpenJIT 1.1.15, JDK118 21.629 3.88 @@ -54,15 +58,17 @@ GCJ (O2, java) 49.048 0.01 GCJ (O2, class) 45.778 0.01 -ORP (O1) 40.392 0.02 +ORP 2000-12-13 (O1) 40.392 0.02 +ORP 2000-11-21 (O1) 40.392 0.02 Client VM, Blackdown 29.855 0.02 Client VM, Sun 29.855 0.02 IBM JDK 1.1.8 27.467 0.03 shuJIT 0.6.8, JDK118 27.467 0.03 shuJIT 0.6.8, JDK122 26.41 0.03 OpenJIT 1.1.15, JDK122 23.678 0.03 +ORP 2000-12-13 (O3) 22.889 0.03 GCJ (O0, java) 22.889 0.03 -ORP (O3) 21.458 0.03 +ORP 2000-11-21 (O3) 21.458 0.03 Inprise 1.2.15, JDK122 21.458 0.03 TYA 1.7v2, JDK122 20.808 0.03 GCJ (O0, class) 17.167 0.04