diff -aruN shujit-0.3.10/ChangeLog shujit/ChangeLog --- shujit-0.3.10/ChangeLog Fri Sep 10 14:08:33 1999 +++ shujit/ChangeLog Fri Oct 1 13:41:58 1999 @@ -1,5 +1,22 @@ $Id$ +[19990925] + +JDK のインタプリタが assembly code 版か C 言語版かを、 +compiler.h 中で決め打つのではなく、configure で識別するようにした。 +JDK for FreeBSD が、1.1.8 V99-9-22 版から assembly code 版を使い始めたため。 +(configure.in, config.h.in, compiler.h) + +0.3.11 リリース。 + +[19990922] + +processAnOpcode() (compile.c) にてクラスのロード +(ResolveClassConstantFromClass2()) に失敗した場合、 +コンパイルをあきらめるのではなく、NoClassDefFoundError を throw するコードを +生成するようにした。 +(compiler.h, code.c, compile.c) + [19990910] 0.3.10 リリース。 diff -aruN shujit-0.3.10/README shujit/README --- shujit-0.3.10/README Fri Sep 10 14:28:08 1999 +++ shujit/README Fri Oct 1 13:42:38 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-7-19), gcc 2.95.1, FreeBSD 3.2R + - JDK 1.1.8 (ELF, V99-9-22), gcc 2.95.1, FreeBSD 3.2R * Installation diff -aruN shujit-0.3.10/code.c shujit/code.c --- shujit-0.3.10/code.c Thu Sep 9 04:36:37 1999 +++ shujit/code.c Wed Sep 22 16:08:28 1999 @@ -548,6 +548,18 @@ CODE_ILLEGALACCESS(3); CODE_ILLEGALACCESS(4); + /* throw NoClassDefFoundError */ +#define CODE_NOCLASSDEF(STATE) \ + CODE(opc_throw_noclassdef, throw_noclassdef, ST##STATE, ST0, OPC_THROW) {\ + SIGNAL_ERROR0(NoClassDefFoundError, STATE);\ + } + + CODE_NOCLASSDEF(0); + CODE_NOCLASSDEF(1); + CODE_NOCLASSDEF(2); + CODE_NOCLASSDEF(3); + CODE_NOCLASSDEF(4); + /* nop */ CODE(opc_nop, nop, STANY, STSTA, 0) {} diff -aruN shujit-0.3.10/compile.c shujit/compile.c --- shujit-0.3.10/compile.c Fri Sep 10 04:23:40 1999 +++ shujit/compile.c Wed Sep 22 16:50:10 1999 @@ -622,14 +622,19 @@ if (!CONSTANT_POOL_TYPE_TABLE_IS_RESOLVED(type_table, index)) {\ if (!ResolveClassConstantFromClass2(\ fieldclass(&mb->fb), index,\ - cc->ee, 1 << CONSTANT_Fieldref, FALSE))\ - return 1;\ + cc->ee, 1 << CONSTANT_Fieldref, FALSE)) {\ + code_opcode = opc_throw_noclassdef;\ + exceptionClear(cc->ee);\ + }\ }\ - fb = constant_pool[index].fb;\ - sig = fieldsig(fb);\ - code_opcode =\ - ((sig[0] == SIGNATURE_LONG) || (sig[0] == SIGNATURE_DOUBLE)) ?\ + \ + if (code_opcode != opc_throw_noclassdef) {\ + fb = constant_pool[index].fb;\ + sig = fieldsig(fb);\ + code_opcode =\ + ((sig[0] == SIGNATURE_LONG) || (sig[0] == SIGNATURE_DOUBLE)) ?\ opc_##vop##2 : opc_##vop;\ + }\ }\ break @@ -670,6 +675,24 @@ case opc_invokeinterface_quick: code_opcode = opc_invokeinterface; break; + case opc_new: + case opc_anewarray: + code_opcode = opcode; + { /* check whether the class exists or not */ + unsigned index; + index = GET_UINT16(bytepc + 1); + + if (!CONSTANT_POOL_TYPE_TABLE_IS_RESOLVED(type_table, index)) { + if (!ResolveClassConstantFromClass2( + fieldclass(&mb->fb), index, + cc->ee, 1 << CONSTANT_Class, FALSE)) { + code_opcode = opc_throw_noclassdef; + exceptionClear(cc->ee); + } + } + } + break; + case opc_anewarray_quick: code_opcode = opc_anewarray; break; case opc_multianewarray_quick: @@ -735,29 +758,34 @@ index = GET_UINT16(bytepc + 1); if (!CONSTANT_POOL_TYPE_TABLE_IS_RESOLVED(type_table, index)) { if (!ResolveClassConstantFromClass2(fieldclass(&mb->fb), - index, cc->ee, 1 << CONSTANT_Methodref, FALSE)) - return 1; + index, cc->ee, 1 << CONSTANT_Methodref, FALSE)) { + code_opcode = opc_throw_noclassdef; + exceptionClear(cc->ee); + } } - method = constant_pool[index].mb; - if (!strcmp(cbName(fieldclass(&method->fb)), "java/lang/Math")) { - char *mname = method->fb.name; + if (code_opcode != opc_throw_noclassdef) { + method = constant_pool[index].mb; + + if (!strcmp(cbName(fieldclass(&method->fb)), "java/lang/Math")) { + char *mname = method->fb.name; # ifdef COMPILE_DEBUG - if (compile_debug) { - printf(" invocation of a method of java.lang.Math#%s.\n", mname); - } + if (compile_debug) { + printf(" invocation of a method of java.lang.Math#%s.\n", mname); + } # endif - if (!strcmp(mname, "sqrt")) code_opcode = opc_sqrt; - else if (!strcmp(mname, "sin")) code_opcode = opc_sin; - else if (!strcmp(mname, "cos")) code_opcode = opc_cos; - else if (!strcmp(mname, "tan")) code_opcode = opc_tan; - else if (!strcmp(mname, "atan2")) code_opcode = opc_atan2; - else if (!strcmp(mname, "atan")) code_opcode = opc_atan; - else if (!strcmp(mname, "exp")) code_opcode = opc_exp; - else if (!strcmp(mname, "log")) code_opcode = opc_log; - else if (!strcmp(mname, "floor")) code_opcode = opc_floor; - else if (!strcmp(mname, "ceil")) code_opcode = opc_ceil; - } + if (!strcmp(mname, "sqrt")) code_opcode = opc_sqrt; + else if (!strcmp(mname, "sin")) code_opcode = opc_sin; + else if (!strcmp(mname, "cos")) code_opcode = opc_cos; + else if (!strcmp(mname, "tan")) code_opcode = opc_tan; + else if (!strcmp(mname, "atan2")) code_opcode = opc_atan2; + else if (!strcmp(mname, "atan")) code_opcode = opc_atan; + else if (!strcmp(mname, "exp")) code_opcode = opc_exp; + else if (!strcmp(mname, "log")) code_opcode = opc_log; + else if (!strcmp(mname, "floor")) code_opcode = opc_floor; + else if (!strcmp(mname, "ceil")) code_opcode = opc_ceil; + } + } /* if (code_opcode != opc_throw_noclassdef) */ } #endif /* SPECIAL_INLINING */ @@ -790,18 +818,24 @@ fflush(stdout); } #endif - if (!res_result) return 1; + if (!res_result) { + code_opcode = opc_throw_noclassdef; + exceptionClear(cc->ee); + } } - method = constant_pool[index].mb; - if (method->fb.access & (ACC_PRIVATE | ACC_FINAL)) { + if (code_opcode != opc_throw_noclassdef) { + method = constant_pool[index].mb; + + if (method->fb.access & (ACC_PRIVATE | ACC_FINAL)) { #ifdef COMPILE_DEBUG - if (compile_debug) { - printf(" adjust invokevirtual private method to invokespecial.\n"); - } + if (compile_debug) { + printf(" adjust invokevirtual private method to invokespecial.\n"); + } #endif - code_opcode = opc_invokespecial; - } + code_opcode = opc_invokespecial; + } + } /* if (code_opcode != opc_throw_noclassdef) */ } #endif /* #if 0 or 1 */ @@ -837,36 +871,42 @@ fflush(stdout); } #endif - if (!res_result) return 1; + if (!res_result) { + code_opcode = opc_throw_noclassdef; + exceptionClear(cc->ee); + } } - method = constant_pool[index].mb; - if (!(method->fb.access & (ACC_NATIVE | ACC_ABSTRACT)) && - (method->code[0] == opc_return)) { - int toCheck = ((method->fb.access & ACC_STATIC) == 0); + if (code_opcode != opc_throw_noclassdef) { + method = constant_pool[index].mb; + + if (!(method->fb.access & (ACC_NATIVE | ACC_ABSTRACT)) && + (method->code[0] == opc_return)) { + int toCheck = ((method->fb.access & ACC_STATIC) == 0); #ifdef NO_CHECK - bytepc[0] = code_opcode = opc_invokeignored_static; + bytepc[0] = code_opcode = opc_invokeignored_static; #else # if JDK_VER >= 12 - CODE_LOCK(EE2SysThread(cc->ee)); + CODE_LOCK(EE2SysThread(cc->ee)); # else - BINCLASS_LOCK(); + BINCLASS_LOCK(); # endif /* JDK_VER */ - if (toCheck) { - bytepc[0] = code_opcode = opc_invokeignored_quick; - bytepc[1] = method->args_size; - bytepc[2] = (unsigned char)toCheck; + if (toCheck) { + bytepc[0] = code_opcode = opc_invokeignored_quick; + bytepc[1] = method->args_size; + bytepc[2] = (unsigned char)toCheck; /* indicates whether to be checked or not */ - } - else - bytepc[0] = code_opcode = opc_invokeignored_static; + } + else + bytepc[0] = code_opcode = opc_invokeignored_static; # if JDK_VER >= 12 - CODE_UNLOCK(EE2SysThread(cc->ee)); + CODE_UNLOCK(EE2SysThread(cc->ee)); # else - BINCLASS_UNLOCK(); + BINCLASS_UNLOCK(); # endif /* JDK_VER */ #endif /* NO_CHECK */ - } + } + } /* if (code_opcode != opc_throw_noclassdef) */ } #endif /* #if 0 or 1 */ diff -aruN shujit-0.3.10/compiler.h shujit/compiler.h --- shujit-0.3.10/compiler.h Thu Sep 9 04:26:39 1999 +++ shujit/compiler.h Fri Oct 1 12:54:16 1999 @@ -50,49 +50,50 @@ #define opc_fppc_ext 267 #define opc_throw_illegalaccess 268 +#define opc_throw_noclassdef 269 -#define opc_fill_cache 269 /* 0x10d */ -#define opc_array_check 270 +#define opc_fill_cache 270 /* 0x10e */ +#define opc_array_check 271 -#define opc_invokeignored_static 271 /* 0x10f */ +#define opc_invokeignored_static 272 /* 0x110 */ -#define opc_fmul_strict 272 /* 0x110 */ -#define opc_dmul_strict 273 -#define opc_fdiv_strict 274 -#define opc_ddiv_strict 275 - -#define opc_getstatic2 276 /* 0x114 */ -#define opc_putstatic2 277 -#define opc_getfield2 278 -#define opc_putfield2 279 - -#define opc_iastore1 280 /* 0x118 */ -#define opc_lastore1 281 - -#define opc_stateto0 282 /* 0x11a */ -#define opc_stateto1 283 -#define opc_stateto2 284 -#define opc_stateto3 285 -#define opc_stateto4 286 - -#define opc_goto_st0 287 /* 0x11f */ -#define opc_goto_st1 288 -#define opc_goto_st2 289 -#define opc_goto_st3 290 -#define opc_goto_st4 291 - -#define opc_sqrt 292 /* 0x122 */ -#define opc_sin 293 -#define opc_cos 294 -#define opc_tan 295 -#define opc_atan2 296 -#define opc_atan 297 -#define opc_exp 298 -#define opc_log 299 -#define opc_floor 300 -#define opc_ceil 301 +#define opc_fmul_strict 273 /* 0x111 */ +#define opc_dmul_strict 274 +#define opc_fdiv_strict 275 +#define opc_ddiv_strict 276 + +#define opc_getstatic2 277 /* 0x115 */ +#define opc_putstatic2 278 +#define opc_getfield2 279 +#define opc_putfield2 280 + +#define opc_iastore1 281 /* 0x119 */ +#define opc_lastore1 282 + +#define opc_stateto0 283 /* 0x11b */ +#define opc_stateto1 284 +#define opc_stateto2 285 +#define opc_stateto3 286 +#define opc_stateto4 287 + +#define opc_goto_st0 288 /* 0x120 */ +#define opc_goto_st1 289 +#define opc_goto_st2 290 +#define opc_goto_st3 291 +#define opc_goto_st4 292 + +#define opc_sqrt 293 /* 0x123 */ +#define opc_sin 294 +#define opc_cos 295 +#define opc_tan 296 +#define opc_atan2 297 +#define opc_atan 298 +#define opc_exp 299 +#define opc_log 300 +#define opc_floor 301 +#define opc_ceil 302 -#define NOPCODES 302 /* 0x12e */ +#define NOPCODES 303 /* 0x12f */ /* offerred by Sun */ @@ -164,15 +165,12 @@ /* OS dependent macros */ #if defined(linux) -# define EXECUTEJAVA_IN_ASM # define SEARCH_SIGCONTEXT # define LIBS_ADDDLSEG NULL #elif defined(__FreeBSD__) -# undef EXECUTEJAVA_IN_ASM # undef SEARCH_SIGCONTEXT # define LIBS_ADDDLSEG "/usr/lib/libc.so.3|/usr/lib/libc.so.3.1|/usr/lib/libc.so.3.0,/usr/lib/libm.so.2|/usr/lib/libm.so.2.0" #else -# undef EXECUTEJAVA_IN_ASM # undef SEARCH_SIGCONTEXT # define LIBS_ADDDLSEG NULL #endif diff -aruN shujit-0.3.10/config.h.in shujit/config.h.in --- shujit-0.3.10/config.h.in Sun Jul 11 17:39:38 1999 +++ shujit/config.h.in Fri Oct 1 13:19:13 1999 @@ -12,6 +12,9 @@ /* type of an argument of monitor{Enter,Exit}{,2} */ #undef MONITOR_T +/* assembly code or C, which version of interpreter is used */ +#undef EXECUTEJAVA_IN_ASM + /* defined if the code DB function is enabled */ #undef CODE_DB /* defined if DB library for code DB is gdbm */ diff -aruN shujit-0.3.10/configure shujit/configure --- shujit-0.3.10/configure Sat Aug 28 13:48:30 1999 +++ shujit/configure Fri Oct 1 13:09:55 1999 @@ -20,6 +20,8 @@ --enable-metavm enable MetaVM " ac_help="$ac_help --with-jdk path where JDK installed to " +ac_help="$ac_help + --enable-c-interpreter the JDK uses C version of interpreter " # Initialize some variables set by options. # The variables have the same names as the options, with @@ -553,13 +555,34 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +# Do some error checking and defaulting for the host and target type. +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD NONOPT +# +# The rules are: +# 1. You are not allowed to specify --host, --target, and nonopt at the +# same time. +# 2. Host defaults to nonopt. +# 3. If nonopt is not specified, then host defaults to the current host, +# as determined by config.guess. +# 4. Target and build default to nonopt. +# 5. If nonopt is not specified, then target and build default to host. + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +case $host---$target---$nonopt in +NONE---*---* | *---NONE---* | *---*---NONE) ;; +*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +esac + + # Make sure we can run config.sub. if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:563: checking host system type" >&5 +echo "configure:586: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -579,6 +602,47 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:607: checking target system type" >&5 + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$target" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:625: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + # Check whether --enable-codedb or --disable-codedb was given. @@ -590,7 +654,7 @@ # Extract the first word of "libgdbm.so", so it can be a program name with args. set dummy libgdbm.so; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:594: checking for $ac_word" >&5 +echo "configure:658: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ac_libgdbm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -627,7 +691,7 @@ # Extract the first word of "libndbm.so", so it can be a program name with args. set dummy libndbm.so; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:631: checking for $ac_word" >&5 +echo "configure:695: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_ac_libndbm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -710,7 +774,7 @@ echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:714: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:778: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -737,7 +801,7 @@ fi echo $ac_n "checking C compiler""... $ac_c" 1>&6 -echo "configure:741: checking C compiler" >&5 +echo "configure:805: checking C compiler" >&5 ac_cc=no if test -n "$CC"; then if test -f "$CC"; then @@ -746,7 +810,7 @@ # Extract the first word of "$CC", so it can be a program name with args. set dummy $CC; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:750: checking for $ac_word" >&5 +echo "configure:814: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_cc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -787,7 +851,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:791: checking for $ac_word" >&5 +echo "configure:855: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_cc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -841,7 +905,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:845: checking for $ac_word" >&5 +echo "configure:909: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_objdump'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -884,7 +948,7 @@ # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:888: checking for $ac_word" >&5 +echo "configure:952: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_ruby'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -924,7 +988,7 @@ # Extract the first word of "ci", so it can be a program name with args. set dummy ci; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:928: checking for $ac_word" >&5 +echo "configure:992: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_ci'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -961,7 +1025,7 @@ # Extract the first word of "co", so it can be a program name with args. set dummy co; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:965: checking for $ac_word" >&5 +echo "configure:1029: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_co'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -998,7 +1062,7 @@ # Extract the first word of "mv", so it can be a program name with args. set dummy mv; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1002: checking for $ac_word" >&5 +echo "configure:1066: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_mv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1035,7 +1099,7 @@ # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1039: checking for $ac_word" >&5 +echo "configure:1103: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_rm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1072,7 +1136,7 @@ # Extract the first word of "wc", so it can be a program name with args. set dummy wc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1076: checking for $ac_word" >&5 +echo "configure:1140: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_wc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1109,7 +1173,7 @@ # Extract the first word of "etags", so it can be a program name with args. set dummy etags; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1113: checking for $ac_word" >&5 +echo "configure:1177: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_etags'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1147,7 +1211,7 @@ # Extract the first word of "which", so it can be a program name with args. set dummy which; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1151: checking for $ac_word" >&5 +echo "configure:1215: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_which'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1185,7 +1249,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1189: checking for $ac_word" >&5 +echo "configure:1253: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_grep'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1224,7 +1288,7 @@ # Extract the first word of "sed", so it can be a program name with args. set dummy sed; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1228: checking for $ac_word" >&5 +echo "configure:1292: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_sed'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1262,7 +1326,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1266: checking for $ac_word" >&5 +echo "configure:1330: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1294,7 +1358,7 @@ echo $ac_n "checking version of gcc""... $ac_c" 1>&6 -echo "configure:1298: checking version of gcc" >&5 +echo "configure:1362: checking version of gcc" >&5 ac_ccver_string=`$ac_cc -v 2>&1 | $ac_grep 'gcc version' | $AWK '{print $3}'` case "$ac_ccver_string" in 3-9*|2.9*) @@ -1321,7 +1385,7 @@ echo $ac_n "checking install path of JDK""... $ac_c" 1>&6 -echo "configure:1325: checking install path of JDK" >&5 +echo "configure:1389: checking install path of JDK" >&5 # Check whether --with-jdk or --without-jdk was given. if test "${with_jdk+set}" = set; then withval="$with_jdk" @@ -1339,7 +1403,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1343: checking for $ac_word" >&5 +echo "configure:1407: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_java'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1379,7 +1443,7 @@ # Extract the first word of "javac", so it can be a program name with args. set dummy javac; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1383: checking for $ac_word" >&5 +echo "configure:1447: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_javac'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1416,7 +1480,7 @@ # Extract the first word of "javah", so it can be a program name with args. set dummy javah; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1420: checking for $ac_word" >&5 +echo "configure:1484: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_javah'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1453,7 +1517,7 @@ # Extract the first word of "jar", so it can be a program name with args. set dummy jar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1457: checking for $ac_word" >&5 +echo "configure:1521: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_jar'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1490,7 +1554,7 @@ # Extract the first word of "javadoc", so it can be a program name with args. set dummy javadoc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1494: checking for $ac_word" >&5 +echo "configure:1558: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_ac_javadoc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1526,8 +1590,8 @@ echo $ac_n "checking version of JDK""... $ac_c" 1>&6 -echo "configure:1530: checking version of JDK" >&5 -ac_jver_string=`$ac_java -version 2>&1` +echo "configure:1594: checking version of JDK" >&5 +ac_jver_string=`$ac_java -green -Djava.compiler= -version 2>&1` case "$ac_jver_string" in *\"1.1*) ac_jver=11 @@ -1554,12 +1618,47 @@ fi +echo $ac_n "checking asm or C, which version of interpreter is used""... $ac_c" 1>&6 +echo "configure:1623: 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" + + ac_executejava_in_asm=no + +else + + ac_executejava_in_asm=yes + case "$host_os" in + freebsd*) + ac_jver_string=`$ac_java -green -Djava.compiler= -fullversion 2>&1` + ac_jver_string=`echo $ac_jver_string | sed 's+.*:\(0-9*\)/\(0-9*\)/.*+\1/\2+'` + echo -n "(date: $ac_jver_string) " + case "$ac_jver_string" in + 1998/*|1999/3|1999/4|1999/6|1999/7) + ac_executejava_in_asm=no + esac + ;; + esac + +fi + +if test "$ac_executejava_in_asm" = "yes"; then + echo "$ac_t""recognized: assembly code version" 1>&6 + cat >> confdefs.h <<\EOF +#define EXECUTEJAVA_IN_ASM 1 +EOF + +else + echo "$ac_t""recognized: C version" 1>&6 +fi + echo $ac_n "checking version of libc""... $ac_c" 1>&6 -echo "configure:1561: checking version of libc" >&5 +echo "configure:1660: checking version of libc" >&5 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1563: checking how to run the C preprocessor" >&5 +echo "configure:1662: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1574,13 +1673,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1683: \"$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 : @@ -1591,13 +1690,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1700: \"$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 : @@ -1608,13 +1707,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1717: \"$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 : @@ -1639,7 +1738,7 @@ echo "$ac_t""$CPP" 1>&6 cat > conftest.$ac_ext < @@ -1665,7 +1764,7 @@ echo $ac_n "checking type of an argument of monitorEnter()""... $ac_c" 1>&6 -echo "configure:1669: checking type of an argument of monitorEnter()" >&5 +echo "configure:1768: 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 "$ac_t""$ac_monitor_t" 1>&6 cat >> confdefs.h <&1` +ac_jver_string=`$ac_java -green -Djava.compiler= -version 2>&1` case "$ac_jver_string" in *\"1.1*) ac_jver=11 @@ -170,6 +171,33 @@ ac_jincdir="$ac_jhome/include-old" fi AC_SUBST(ac_jincdir) + +AC_MSG_CHECKING([asm or C, which version of interpreter is used]) +AC_ARG_ENABLE(c-interpreter, + [ --enable-c-interpreter the JDK uses C version of interpreter ], + [ + ac_executejava_in_asm=no + ], + [ + ac_executejava_in_asm=yes + case "$host_os" in + freebsd*) + ac_jver_string=`$ac_java -green -Djava.compiler= -fullversion 2>&1` + ac_jver_string=`echo $ac_jver_string | sed 's+.*:\([0-9]*\)/\([0-9]*\)/.*+\1/\2+'` + echo -n "(date: $ac_jver_string) " + case "$ac_jver_string" in + 1998/*|1999/3|1999/4|1999/6|1999/7) + ac_executejava_in_asm=no + esac + ;; + esac + ]) +if test "$ac_executejava_in_asm" = "yes"; then + AC_MSG_RESULT(recognized: assembly code version) + AC_DEFINE(EXECUTEJAVA_IN_ASM) +else + AC_MSG_RESULT(recognized: C version) +fi dnl Checks for libraries. diff -aruN shujit-0.3.10/gentable.rb shujit/gentable.rb --- shujit-0.3.10/gentable.rb Mon Aug 30 13:04:18 1999 +++ shujit/gentable.rb Wed Sep 22 13:42:56 1999 @@ -4,7 +4,7 @@ CONST_C_FNAME = 'constants.c' CONST_H_FNAME = 'constants.h' -NOPCODES = 302 +NOPCODES = 303 NSTATES = 5 STANY = 5 STSTA = 5 diff -aruN shujit-0.3.10/invoker.c shujit/invoker.c --- shujit-0.3.10/invoker.c Fri Sep 10 03:35:20 1999 +++ shujit/invoker.c Fri Oct 1 13:18:29 1999 @@ -528,7 +528,7 @@ else if ((!strcmp(cbName(mb->fb.clazz), "com/sun/media/protocol/file/DataSource")) && (!strcmp(mb->fb.name, "connect"))) runtime_debug = 1; -#if 0 +#if 1 else if (!strcmp(mb->fb.name, "main")) runtime_debug = 1; else if (!strcmp(mb->fb.name, "start")) diff -aruN shujit-0.3.10/txt/memo shujit/txt/memo --- shujit-0.3.10/txt/memo Tue Sep 7 23:17:12 1999 +++ shujit/txt/memo Fri Oct 1 14:10:21 1999 @@ -1,4 +1,6 @@ Todo + - java.lang.Math#exp を inlining しないように戻す。 + x86 FPU と JDK 1.2 のインタプリタで結果が微妙に異なるので。 - 特定メソッドの inlining。 profiling (javac, Linpack 等) に基づいて。 System#arraycopy, Object#getClass, Object#hashCode @@ -95,6 +97,8 @@ javac の、フックをかけられる箇所を探す。-> Jikes を改造? Done + - クラスが存在しなかった場合に、JIT コンパイルが失敗するのではなく、 + ClassNotFoundException, NoClassDefFoundError を発生するコードを生成する。 - final フィールドへの putfield, putstatic で IllegalAccessError が発生するようにする。 本来は bytecode verifier がはねるべき?