diff -aruN shujit-0.7.14/ChangeLog shujit/ChangeLog --- shujit-0.7.14/ChangeLog 2003-01-20 10:22:54.000000000 +0900 +++ shujit/ChangeLog 2005-08-08 22:33:08.000000000 +0900 @@ -1,5 +1,98 @@ $Id$ +[20050808] + +0.8 リリース。 + +[20050625] + +gcc 4.0 でコンパイルしてもきちんと動作するようにした。 +(code.c) + +[20050622] + +gcc 4.0 でコンパイルが通るようにした。 +(code.c, code.h, compile.c, runtime.c, signal.c, x86tsc.c, gentable.rb) + +[20041006] + +gcc 3.4.2 はブロックの末尾にラベル (◯◯:) を許さないので、 +ブロック末尾のラベルの後に空ブロック "{}" を加えた。 +(compile.c) + +INT 3 の asm 文がシグナルハンドラを指すポインタを参照していると宣言した。 +宣言しておかないと、INT 3 を挟んでいるシグナルハンドラへの +2ヶ所の代入のうち最初のものを gcc 3.4.2 が eliminate してしまうため。 +(compiler.c) + +[20031029] + +exceptionHandler() にて signal_name (char * 型の配列) を %edi に入れる際に +gcc 3.3.2 は %ecx を使ってしまうので、 +%eax, %esi に加えて %ecx, %edx も使わないように指示を加えた。 +(code.c) + +各バイトコード命令の pre-assembled code を区切るための +未定義命令を 0xf1 から 0xd2 に変更した。 +binutils (の objdump -d) が、2.13.2 から 2.14 の間に、 +0xf1 (see [19990109]) を icebp とディスアセンブルするように変更されたため。 +(code.h) + +[20031001] + +Win32 か否かを判定するためのマクロを WIN32 から _WIN32 に変更した。 +(code.c, code.h, compile.c, compiler.h, invoker.c, linker.c, runtime.c, + stack.c) + +[20030922] + +Win32 の場合、ネイティブメソッド (JNI, NMI) からの返り値が +8 bit, 16 bit 整数 (boolean, byte, short, char) だった場合に、 +32 bit 符号つき整数に変換するようにした。 +変換のために、マクロ CAST_*_TO_INT32() (compiler.h) を用意した。 +(runtime.c, compiler.h) + +Win32 の場合、JDK の is_instance_of(), is_subclass_of() の返り値を +8 bit 非負整数と見なして、and 0xff するようにした。 +変換には、マクロ CAST_UINT8_TO_INT32() を使う。 +(code.c) + +関数名を export する .globl 疑似命令を出力する際、 +Win32 の場合は Win32 に応じた周辺の擬似命令を出力できるようにした。 +.globl を出力する DECL_GLOBAL_FUNC() マクロを用意した。 +(code.h, code.c, invoker.c) + +Win32 用に、GCC が存在を仮定する _alloca() を用意した。 +即、Visual C++ の _chkstk() にジャンプする。 +(invoker.c) + +[20030917] + +Win32 では、64 bit 整数の除算、剰余算のために、__divdi3, __moddi3 ではなく +_alldiv, _allrem を使うようにした。 +(code.c, gentable.rb) + +[20030912] + +オプション fpextended と fpsingle を用意した。 +それぞれ、x87 FPU の丸め精度を extended と single に設定する。 +これに伴い、マクロ FORCE_DOUBLE_PRECISION (see [20000422]) を廃止した。 +上記オプションの設定がない場合は、無条件で double に設定するようにした。 +(compiler.h, compiler.c, compile.c, code.c) + +[20030428] + +環境変数が ja_JP.eucJP の場合に定数表作成スクリプト gentable.rb が +うまく働かなかった。修整。 +(gentable.rb) + +[20030320] + +Win32 への対応作業を始めた。 +シンボルの生成方法など、基本的な作業を終えた。 +(compiler.h, code.c, code.h, compile.c, linker.c, runtime.c, stack.c, + gentable.rb, configure.in, GNUmakefile.in) + [20030120] gcc 3.2 の dead code elimination が diff -aruN shujit-0.7.14/GNUmakefile shujit/GNUmakefile --- shujit-0.7.14/GNUmakefile 2003-01-20 10:28:43.000000000 +0900 +++ shujit/GNUmakefile 2005-06-25 21:05:41.000000000 +0900 @@ -5,12 +5,14 @@ CODE_DB = yes GDBM = yes +XBOX = + METAVM = METAVM_NO_ARRAY = # environment -JDK_VER = 12 +JDK_VER = 13 J_INCDIR1 = /usr/local/java/include-old J_INCDIR2 = /usr/local/java/include J_INCDIR_MD = linux @@ -31,7 +33,7 @@ CO = /usr/bin/co RM = /bin/rm WC = /usr/bin/wc -ETAGS = no +ETAGS = /usr/bin/etags JAVA = /usr/local/java/bin/java JAVAC = /usr/local/java/bin/javac JAVAH = /usr/local/java/bin/javah @@ -55,7 +57,7 @@ COPTFLAGS = -O2 CFLAGS_OPT = CFLAGS_DBG = -g -DDEBUG -DJCOV -NOOPTCFLAGS = -pipe -fPIC ${CFLAGS_${VARIANT}} ${CFLAGS_COMMON} ${INCDIR} +NOOPTCFLAGS = -fPIC -pipe ${CFLAGS_${VARIANT}} ${CFLAGS_COMMON} ${INCDIR} CFLAGS = ${COPTFLAGS} ${NOOPTCFLAGS} LIBS = @@ -98,6 +100,12 @@ # subdirectories SUBDIR = +# for Xbox + +ifeq (${XBOX}, yes) + OBJ += ${OBJDIR}/support-xbox.o +endif + # for MetaVM ifeq (${METAVM}, yes) SUBDIR += NET/shudo/metavm metavm diff -aruN shujit-0.7.14/GNUmakefile.in shujit/GNUmakefile.in --- shujit-0.7.14/GNUmakefile.in 2002-01-18 23:07:58.000000000 +0900 +++ shujit/GNUmakefile.in 2003-09-16 22:43:29.000000000 +0900 @@ -5,6 +5,8 @@ CODE_DB = @ac_codedb@ GDBM = @ac_libgdbm@ +XBOX = @ac_xbox@ + METAVM = @ac_metavm@ METAVM_NO_ARRAY = @ac_metavm_no_array@ @@ -55,16 +57,16 @@ COPTFLAGS = -O2 CFLAGS_OPT = CFLAGS_DBG = -g -DDEBUG -DJCOV -NOOPTCFLAGS = -pipe -fPIC ${CFLAGS_${VARIANT}} ${CFLAGS_COMMON} ${INCDIR} +NOOPTCFLAGS = @ac_cflags@ -pipe ${CFLAGS_${VARIANT}} ${CFLAGS_COMMON} ${INCDIR} CFLAGS = ${COPTFLAGS} ${NOOPTCFLAGS} LIBS = ifeq (${METAVM}, yes) -TARGET_OPT = libmetavm.so -TARGET_DBG = libmetavm_g.so +TARGET_OPT = @ac_target_metavm@ +TARGET_DBG = @ac_target_metavm_g@ else -TARGET_OPT = libshujit.so -TARGET_DBG = libshujit_g.so +TARGET_OPT = @ac_target_shujit@ +TARGET_DBG = @ac_target_shujit_g@ endif ifeq (${VARIANT}, DBG) OBJDIR = obj_g @@ -98,6 +100,12 @@ # subdirectories SUBDIR = +# for Xbox + +ifeq (${XBOX}, yes) + OBJ += ${OBJDIR}/support-xbox.o +endif + # for MetaVM ifeq (${METAVM}, yes) SUBDIR += NET/shudo/metavm metavm diff -aruN shujit-0.7.14/README shujit/README --- shujit-0.7.14/README 2003-01-19 23:33:06.000000000 +0900 +++ shujit/README 2003-10-30 00:30:01.000000000 +0900 @@ -13,12 +13,13 @@ Working on the following platforms is confirmed. - FreeBSD - - JDK 1.3.1 patchlevel 7, GCC 2.95.4 and FreeBSD 4.6-STABLE - - JDK 1.1.8 (ELF, V1999-11-9), GCC 2.95.4 and FreeBSD 4.6-STABLE + - JDK 1.3.1 patchlevel 8, GCC 2.95.4 and FreeBSD 4.9-STABLE + - JDK 1.1.8 (ELF, V1999-11-9), GCC 2.95.4 and FreeBSD 4.9-STABLE - Linux - - Blackdown JDK 1.3.1_02b, GCC 3.2 20020903, glibc 2.2.93, Linux 2.4.21-pre3 - - JDK 1.1.8v3, GCC 3.2 20020903, glibc 2.2.93 and Linux 2.4.21-pre3 + - Blackdown JDK 1.3.1_02b, GCC 3.3.2 20031022, glibc 2.3.2 + and Linux 2.6.0-test9 + - JDK 1.1.8v3, GCC 3.3.2 20031022, glibc 2.3.2 and Linux 2.6.0-test9 - JDK 1.1.7v1a, egcs 1.1.2, libc 5.4.38 and Linux 2.0.35 * Installation @@ -92,6 +93,7 @@ Jun'ya Kato (preparation of FreeBSD) Fuyuhiko Maruyama (discussion and code) Toshihiko Shimokawa (preparetion of FreeBSD) +Keizo Maeda (porting) and my wife Mari. diff -aruN shujit-0.7.14/code.c shujit/code.c --- shujit-0.7.14/code.c 2003-01-20 10:20:12.000000000 +0900 +++ shujit/code.c 2005-06-25 20:42:47.000000000 +0900 @@ -2,7 +2,7 @@ This file is part of shuJIT, Just In Time compiler for Sun Java Virtual Machine. - Copyright (C) 1998,1999,2000,2001,2002,2003 Kazuyuki Shudo + Copyright (C) 1998,1999,2000,2001,2002,2003,2005 Kazuyuki Shudo This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -37,7 +37,7 @@ // // an array of signal names -char *signal_name[] = { // EXCID +static const char *signal_name[] = { // EXCID #define EXCID_NullPointerException 0 JAVAPKG "NullPointerException", #define EXCID_OutOfMemoryError 1 @@ -108,7 +108,7 @@ JHandle *o /* 8(%ebp) */ , struct methodblock *mb /* 12(%ebp) */, int args_size, ExecEnv *ee, stack_item *var_base #ifdef RUNTIME_DEBUG - , int runtime_debug + , int runtime_debug /* 1c(%ebp) */ #endif ) { // int32_t bytepcoff; // -4(%ebp) @@ -126,48 +126,58 @@ // #ifdef RUNTIME_DEBUG # define CLAZZ_DEBUG(CB) \ - if (runtime_debug) {\ - DEBUG_IN;\ - CB_NAME(CB, %eax); asm("pushl %eax");\ - PUSH_CONSTSTR(" clazz: %s\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("pushl %eax");\ + if (runtime_debug) {\ + DEBUG_IN;\ + CB_NAME(CB, %eax); asm("pushl %eax");\ + PUSH_CONSTSTR(" clazz: %s\n");\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $8,%esp");\ - FFLUSH;\ - DEBUG_OUT;\ - } + FFLUSH;\ + DEBUG_OUT;\ + }\ + asm("popl %eax") # define METHOD_DEBUG(MB, LABEL) \ - if (runtime_debug) {\ - DEBUG_IN;\ - asm("movl " METHOD_NAME(MB) ",%edi\n\t"\ - "testl %edi,%edi\n\t"\ - "jz " LABEL "_done\n\t"\ - "pushl %edi");\ - asm("movl " METHOD_CLAZZ(MB) ",%edi");\ - CB_NAME(%edi, %edi);\ - asm("pushl %edi");\ - PUSH_CONSTSTR(" %s#%s\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ - "addl $12,%esp");\ - FFLUSH;\ - asm(LABEL "_done:");\ - DEBUG_OUT;\ - } + asm("pushl %eax");\ + if (runtime_debug) { /* break eax */ \ + asm("movl (%esp),%eax"); /* restore */ \ + DEBUG_IN;\ + asm("movl " METHOD_NAME(MB) ",%edi\n\t"\ + "testl %edi,%edi\n\t"\ + "jz " LABEL "_done\n\t"\ + "pushl %edi");\ + asm("movl " METHOD_CLAZZ(MB) ",%edi");\ + CB_NAME(%edi, %edi);\ + asm("pushl %edi");\ + PUSH_CONSTSTR(" %s#%s\n");\ + asm("call " FUNCTION(printf) "\n\t"\ + "addl $12,%esp");\ + FFLUSH;\ + asm(LABEL "_done:");\ + DEBUG_OUT;\ + }\ + asm("popl %eax") # define OBJ_DEBUG(OBJ) \ - if (runtime_debug) {\ - DEBUG_IN;\ - OBJ_METHODTABLE(OBJ, %edi);\ - /*MT_CLASSDESCRIPTOR(%edi, %edi);*/\ - /*CB_NAME(%edi, %edi);*/\ - asm("pushl %edi");\ - asm("pushl " #OBJ);\ - PUSH_CONSTSTR(" obj: 0x%08x mt: 0x%08x\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("pushl %eax");\ + if (runtime_debug) { /* break eax */ \ + asm("movl (%esp),%eax"); /* restore */ \ + DEBUG_IN;\ + OBJ_METHODTABLE(OBJ, %edi);\ + /*MT_CLASSDESCRIPTOR(%edi, %edi);*/\ + /*CB_NAME(%edi, %edi);*/\ + asm("pushl %edi");\ + asm("pushl " #OBJ);\ + PUSH_CONSTSTR(" obj: 0x%08x mt: 0x%08x\n");\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ - FFLUSH;\ - DEBUG_OUT;\ - } + FFLUSH;\ + DEBUG_OUT;\ + }\ + asm("popl %eax") # define VALUE_DEBUG(REG) \ - if (runtime_debug) {\ + asm("pushl %eax");\ + if (runtime_debug) { /* break eax */ \ + asm("movl (%esp),%eax"); /* restore */ \ DEBUG_IN;\ asm("pushl " #REG "\n\t"\ "flds (%esp)\n\t"\ @@ -176,12 +186,14 @@ "pushl " #REG "\n\t"\ "pushl " #REG);\ PUSH_CONSTSTR(" 0x%08x %d %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $20,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") # define VALUE64_DEBUG(LREG, HREG) \ + asm("pushl %eax");\ if (runtime_debug) {\ DEBUG_IN;\ asm("pushl " #HREG "\n\tpushl " #LREG "\n\t"\ @@ -189,11 +201,12 @@ "pushl " #HREG "\n\tpushl " #LREG "\n\t"\ "pushl " #HREG "\n\tpushl " #LREG);\ PUSH_CONSTSTR(" 0x%016llx %lld %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $28,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") #else # define CLAZZ_DEBUG(CB) # define METHOD_DEBUG(MB, LABEL) @@ -206,6 +219,7 @@ // fill_cache #ifdef RUNTIME_DEBUG # define FILL_CACHE_DEBUG1(OPTOP1_REG, OPTOP2_REG) \ + asm("pushl %eax");\ if (runtime_debug) {\ DEBUG_IN;\ asm("pushl " #OPTOP2_REG "\n\tflds (%esp)\n\t"\ @@ -215,11 +229,12 @@ "subl $4,%esp\n\tfstpl (%esp)\n\t"\ "pushl " #OPTOP1_REG "\n\tpushl " #OPTOP1_REG);\ PUSH_CONSTSTR(" optop[-1]: 0x%08x %d %g, optop[-2]: 0x%08x %d %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $36,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") #else # define FILL_CACHE_DEBUG1(OPTOP1_REG, OPTOP2_REG) #endif @@ -401,6 +416,7 @@ "pushl %esi"); #ifdef RUNTIME_DEBUG + asm("pushl %eax"); if (runtime_debug) { // class and method name DEBUG_IN; @@ -415,7 +431,7 @@ CB_NAME(%eax, %eax); // break %edi asm("pushl %eax"); PUSH_CONSTSTR(" %s#%s\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $12,%esp"); FFLUSH; asm("methodhead_name_done:"); @@ -424,7 +440,7 @@ asm("pushl %esi\n\t" "pushl %ebp"); PUSH_CONSTSTR(" ebp: %x\n old var base: %x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $12,%esp"); FFLUSH; @@ -435,26 +451,29 @@ asm("movsbl " EE_EXCEPTIONKIND(%edi) ",%edi\n\t" "pushl %edi"); PUSH_CONSTSTR(" excKind: %d\n remote addr: 0x%x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $12,%esp"); FFLUSH; # endif DEBUG_OUT; } + asm("popl %eax"); #endif // RUNTIME_DEBUG // esi = var_base asm("movl 24(%ebp),%esi"); #ifdef RUNTIME_DEBUG + asm("pushl %eax"); if (runtime_debug) { DEBUG_IN; asm("pushl %esi"); PUSH_CONSTSTR(" var base: 0x%08x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $8,%esp"); FFLUSH; DEBUG_OUT; } + asm("popl %eax"); #endif #ifdef DIRECT_INVOCATION @@ -507,7 +526,7 @@ // exception handler // now, eax,edx may be ename,DetailMessage CODE(opc_exc_handler, exc_handler, STANY, STSTA, OPC_NONE) { - asm("call " SYMBOL(exceptionHandler) "@PLT"); + asm("call " FUNCTION(exceptionHandler)); } @@ -524,7 +543,7 @@ asm("movl %0,%%edi\n\t" /* edi = ee */\ "pushl %%edi" : : "m" (ee)); /* push edi */\ \ - asm("call " SYMBOL(METAVM_FUNCNAME) "@PLT\n\t"\ + asm("call " FUNCTION(METAVM_FUNCNAME) "\n\t"\ "popl %edi\n\t" /* edi = ee */\ "addl $4,%esp");\ \ @@ -533,7 +552,7 @@ JUMP_IF_EXC_HASNT_OCCURRED(%edi /* is ee */, LABEL "_done");\ DEBUG_IN;\ PUSH_CONSTSTR("METAVM_MONITOR exc. occurred.\n");\ -asm("call " SYMBOL(printf) "@PLT\n\t"\ +asm("call " FUNCTION(printf) "\n\t"\ "addl $4,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -547,28 +566,34 @@ # define CALL_MONITOR(MON, FUNCNAME) \ asm("pushl " #MON);\ asm("pushl %0" : : "m" (ee)); /* ee */\ - asm("call " SYMBOL(FUNCNAME) "2@PLT\n\t"\ + asm("call " FUNCTION(FUNCNAME) "\n\t"\ "addl $8,%esp") +# define CALL_MONITORENTER(MON) CALL_MONITOR(MON, monitorEnter2) +# define CALL_MONITOREXIT(MON) CALL_MONITOR(MON, monitorExit2) #else # define CALL_MONITOR(MON, FUNCNAME) \ asm("pushl " #MON "\n\t"\ - "call " SYMBOL(FUNCNAME) "@PLT\n\t"\ + "call " FUNCTION(monitorEnter) "\n\t"\ "addl $4,%esp") +# define CALL_MONITORENTER(MON) CALL_MONITOR(MON, monitorEnter) +# define CALL_MONITOREXIT(MON) CALL_MONITOR(MON, monitorExit) #endif // JDK_VER CODE(opc_sync_obj_enter, sync_obj_enter, STANY, STSTA, OPC_THROW) { // monitorEnter(obj_monitor(o)); asm("movl (%esi),%eax"); // eax = the 1st argument #ifdef RUNTIME_DEBUG + asm("pushl %eax"); if (runtime_debug) { DEBUG_IN; asm("pushl %esi\n\tpushl %eax"); PUSH_CONSTSTR(" obj: 0x%x @ 0x%x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $12,%esp"); FFLUSH; DEBUG_OUT; } + asm("popl %eax"); #endif #ifdef SET_FRAME_MONITOR // frame->monitor = (struct sys_mon *)o @@ -578,7 +603,7 @@ #endif METAVM_MONITOR(%eax, proxy_monitorenter, "sync_obj_enter", 0); OBJ_MONITOR(%eax); - CALL_MONITOR(%eax, monitorEnter); + CALL_MONITORENTER(%eax); asm("sync_obj_enter_done:"); } @@ -586,7 +611,7 @@ // const: clazz CODE(opc_sync_static_enter, sync_static_enter, STANY, STSTA, OPC_NONE) { // monitorEnter(obj_monitor(clazz)); - asm("movl $" STR(CONST) ",%eax"); // eax = clazz + asm("movl $" STR(SLOT_CONST) ",%eax"); // eax = clazz #ifdef SET_FRAME_MONITOR // frame->monitor = (struct sys_mon *)o asm("movl %0,%%edi" : : "m" (ee)); // edi = ee @@ -594,7 +619,7 @@ asm("movl %eax," FRAME_MONITOR(%edi)); #endif OBJ_MONITOR(%eax); - CALL_MONITOR(%eax, monitorEnter); + CALL_MONITORENTER(%eax); } @@ -605,19 +630,21 @@ // monitorExit(obj_monitor(o)) asm("movl (%esi),%eax"); // eax = the 1st argument #ifdef RUNTIME_DEBUG + asm("pushl %eax"); if (runtime_debug) { DEBUG_IN; asm("pushl %esi\n\tpushl %eax"); PUSH_CONSTSTR(" obj: 0x%x @ 0x%x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $12,%esp"); FFLUSH; DEBUG_OUT; } + asm("popl %eax"); #endif METAVM_MONITOR(%eax, proxy_monitorexit, "sync_obj_exit", 0); OBJ_MONITOR(%eax); - CALL_MONITOR(%eax, monitorExit); + CALL_MONITOREXIT(%eax); asm("sync_obj_exit_done:"); FUNCCALL_OUT(2); @@ -629,9 +656,9 @@ FUNCCALL_IN(2); // monitorExit(obj_monitor(o)) - asm("movl $" STR(CONST) ",%eax"); // eax = clazz + asm("movl $" STR(SLOT_CONST) ",%eax"); // eax = clazz OBJ_MONITOR(%eax); - CALL_MONITOR(%eax, monitorExit); + CALL_MONITOREXIT(%eax); FUNCCALL_OUT(2); } @@ -644,7 +671,7 @@ DEBUG_IN; asm("pushl %edi"); PUSH_CONSTSTR(" ee: 0x%x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $8,%esp"); FFLUSH; DEBUG_OUT; @@ -687,7 +714,6 @@ # endif // STRICT_PRELOAD } -# ifndef FORCE_DOUBLE_PRECISION // save FPU rounding precision CODE(opc_fppc_save, fppc_save, STANY, STSTA, OPC_NONE) { // save FPU control word @@ -712,7 +738,6 @@ CODE_FPPC(single, "andl $0xfcff,%eax"); CODE_FPPC(double, "andl $0xfcff,%eax\n\torl $0x0200,%eax"); CODE_FPPC(extended, "orl $0x0300,%eax"); -# endif // !FORCE_DOUBLE_PRECISION #endif // !USE_SSE2 @@ -749,7 +774,7 @@ asm("movl %0,%%edi" : : "m" (ee)); // edi = ee EE_EXCEPTIONKIND_EAX(%edi); asm("testl %eax,%eax\n\t" - ".short 0x850f\n\t.long " STR(ADDR_EXC)); // jnz + ".short 0x850f\n\t.long " STR(SLOT_ADDR_EXC)); // jnz } #endif // EXC_CHECK_IN_LOOP @@ -964,25 +989,25 @@ // bipush // const: value CODE(opc_bipush, a_const, ST0, ST1, OPC_NONE) { - asm("movl $" STR(CONST) ",%edx"); + asm("movl $" STR(SLOT_CONST) ",%edx"); VALUE_DEBUG(%edx); } CODE(opc_bipush, a_const, ST1, ST2, OPC_NONE) { - asm("movl $" STR(CONST) ",%ecx"); + asm("movl $" STR(SLOT_CONST) ",%ecx"); VALUE_DEBUG(%ecx); } CODE(opc_bipush, a_const, ST2, ST4, OPC_NONE) { asm("pushl %edx\n\t" - "movl $" STR(CONST) ",%edx"); + "movl $" STR(SLOT_CONST) ",%edx"); VALUE_DEBUG(%edx); } CODE(opc_bipush, a_const, ST3, ST4, OPC_NONE) { - asm("movl $" STR(CONST) ",%edx"); + asm("movl $" STR(SLOT_CONST) ",%edx"); VALUE_DEBUG(%edx); } CODE(opc_bipush, a_const, ST4, ST2, OPC_NONE) { asm("pushl %ecx\n\t" - "movl $" STR(CONST) ",%ecx"); + "movl $" STR(SLOT_CONST) ",%ecx"); VALUE_DEBUG(%ecx); } @@ -990,34 +1015,34 @@ // ldc2_w // const: val[32:63], val[0:31] CODE(opc_ldc2_w, ldc2_w, ST0, ST2, OPC_NONE) { - asm("movl $" STR(CONST) ",%edx\n\t" - "movl $" STR(CONST) ",%ecx"); + asm("movl $" STR(SLOT_CONST) ",%edx\n\t" + "movl $" STR(SLOT_CONST) ",%ecx"); VALUE64_DEBUG(%ecx, %edx); } CODE(opc_ldc2_w, ldc2_w, ST1, ST4, OPC_NONE) { asm("pushl %edx\n\t" - "movl $" STR(CONST) ",%ecx\n\t" - "movl $" STR(CONST) ",%edx"); + "movl $" STR(SLOT_CONST) ",%ecx\n\t" + "movl $" STR(SLOT_CONST) ",%edx"); VALUE64_DEBUG(%edx, %ecx); } CODE(opc_ldc2_w, ldc2_w, ST2, ST2, OPC_NONE) { asm("pushl %edx\n\t" "pushl %ecx\n\t" - "movl $" STR(CONST) ",%edx\n\t" - "movl $" STR(CONST) ",%ecx"); + "movl $" STR(SLOT_CONST) ",%edx\n\t" + "movl $" STR(SLOT_CONST) ",%ecx"); VALUE64_DEBUG(%ecx, %edx); } CODE(opc_ldc2_w, ldc2_w, ST3, ST2, OPC_NONE) { asm("pushl %ecx\n\t" - "movl $" STR(CONST) ",%edx\n\t" - "movl $" STR(CONST) ",%ecx"); + "movl $" STR(SLOT_CONST) ",%edx\n\t" + "movl $" STR(SLOT_CONST) ",%ecx"); VALUE64_DEBUG(%ecx, %edx); } CODE(opc_ldc2_w, ldc2_w, ST4, ST4, OPC_NONE) { asm("pushl %ecx\n\t" "pushl %edx\n\t" - "movl $" STR(CONST) ",%ecx\n\t" - "movl $" STR(CONST) ",%edx"); + "movl $" STR(SLOT_CONST) ",%ecx\n\t" + "movl $" STR(SLOT_CONST) ",%edx"); VALUE64_DEBUG(%edx, %ecx); } @@ -1026,6 +1051,7 @@ // const: index * 4 #ifdef RUNTIME_DEBUG # define ILOAD_DEBUG1(VAL) \ + asm("pushl %eax");\ if (runtime_debug) {\ DEBUG_IN;\ asm("pushl " #VAL "\n\t"\ @@ -1034,36 +1060,37 @@ "fstpl (%esp)\n\t"\ "pushl " #VAL "\n\t"\ "pushl " #VAL "\n\t"\ - "pushl $" STR(CONST));\ + "pushl $" STR(SLOT_CONST));\ PUSH_CONSTSTR(" [%d] 0x%08x %d %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $24,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") #else # define ILOAD_DEBUG1(VAL) #endif CODE(opc_iload, [ifa]load, ST0, ST1, OPC_NONE) { - asm("movl " STR(CONST) "(%esi),%edx"); + asm("movl " STR(SLOT_CONST) "(%esi),%edx"); ILOAD_DEBUG1(%edx); } CODE(opc_iload, [ifa]load, ST1, ST2, OPC_NONE) { - asm("movl " STR(CONST) "(%esi),%ecx"); + asm("movl " STR(SLOT_CONST) "(%esi),%ecx"); ILOAD_DEBUG1(%ecx); } CODE(opc_iload, [ifa]load, ST2, ST4, OPC_NONE) { asm("pushl %edx\n\t" - "movl " STR(CONST) "(%esi),%edx"); + "movl " STR(SLOT_CONST) "(%esi),%edx"); ILOAD_DEBUG1(%edx); } CODE(opc_iload, [ifa]load, ST3, ST4, OPC_NONE) { - asm("movl " STR(CONST) "(%esi),%edx"); + asm("movl " STR(SLOT_CONST) "(%esi),%edx"); ILOAD_DEBUG1(%edx); } CODE(opc_iload, [ifa]load, ST4, ST2, OPC_NONE) { asm("pushl %ecx\n\t" - "movl " STR(CONST) "(%esi),%ecx"); + "movl " STR(SLOT_CONST) "(%esi),%ecx"); ILOAD_DEBUG1(%ecx); } @@ -1071,9 +1098,9 @@ CODE(opc_fload_fld, fload_fld, ST0, STSTA, OPC_NONE) { asm("subl $4,%esp\n\t"); // to simulate the true value of %esp # ifdef USE_SSE2 - asm("movss " STR(CONST) "(%esi),%xmm0"); + asm("movss " STR(SLOT_CONST) "(%esi),%xmm0"); # else - asm("flds " STR(CONST) "(%esi)"); + asm("flds " STR(SLOT_CONST) "(%esi)"); # endif #ifdef RUNTIME_DEBUG @@ -1082,7 +1109,7 @@ asm("subl $8,%esp\n\t" "fstl (%esp)"); PUSH_CONSTSTR(" %g\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $12,%esp"); FFLUSH; DEBUG_OUT; @@ -1101,10 +1128,10 @@ asm("pushl " #OPTOP2_REG "\n\tpushl " #OPTOP1_REG "\n\t"\ "pushl " #OPTOP2_REG "\n\tpushl " #OPTOP1_REG "\n\t"\ "pushl " #OPTOP2_REG "\n\tpushl " #OPTOP1_REG "\n\t"\ - "movl $" STR(CONST) ",%eax\n\t"\ + "movl $" STR(SLOT_CONST) ",%eax\n\t"\ "pushl %eax");\ PUSH_CONSTSTR(" var[%d]: 0x%016llx, %lld, %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $32,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -1114,12 +1141,12 @@ #endif #define LLOAD_ST02 \ - asm("movl " STR(CONST) "(%esi),%ecx\n\t"\ - "movl " STR(CONST) "(%esi),%edx");\ + asm("movl " STR(SLOT_CONST) "(%esi),%ecx\n\t"\ + "movl " STR(SLOT_CONST) "(%esi),%edx");\ LLOAD_DEBUG1(%ecx, %edx) #define LLOAD_ST04 \ - asm("movl " STR(CONST) "(%esi),%edx\n\t"\ - "movl " STR(CONST) "(%esi),%ecx");\ + asm("movl " STR(SLOT_CONST) "(%esi),%edx\n\t"\ + "movl " STR(SLOT_CONST) "(%esi),%ecx");\ LLOAD_DEBUG1(%edx, %ecx) CODE(opc_lload, [ld]load, ST0, ST2, OPC_NONE) { @@ -1148,9 +1175,9 @@ CODE(opc_dload_dld, dload_dld, ST0, STSTA, OPC_NONE) { asm("subl $8,%esp\n\t"); // to simulate the true value of %esp # ifdef USE_SSE2 - asm("movsd " STR(CONST) "(%esi),%xmm0"); + asm("movsd " STR(SLOT_CONST) "(%esi),%xmm0"); # else - asm("fldl " STR(CONST) "(%esi)"); + asm("fldl " STR(SLOT_CONST) "(%esi)"); # endif #ifdef RUNTIME_DEBUG @@ -1159,7 +1186,7 @@ asm("subl $8,%esp\n\t" "fstl (%esp)"); PUSH_CONSTSTR(" %g\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $12,%esp"); FFLUSH; DEBUG_OUT; @@ -1186,25 +1213,29 @@ #ifdef RUNTIME_DEBUG # define ARRAY_CHECK_DEBUG1(INDEX) \ + asm("pushl %eax");\ if (runtime_debug) {\ DEBUG_IN;\ asm("pushl " #INDEX);\ PUSH_CONSTSTR(" index: %d\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $8,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") # define ARRAY_CHECK_DEBUG2(LEN) \ + asm("pushl %eax");\ if (runtime_debug) {\ DEBUG_IN;\ asm("pushl " #LEN);\ PUSH_CONSTSTR(" length: %d\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $8,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") #else # define ARRAY_CHECK_DEBUG1(INDEX) # define ARRAY_CHECK_DEBUG2(INDEX) @@ -1274,13 +1305,13 @@ "pushl " #HANDLE); /* obj (Proxy) */\ asm("pushl %0" : : "m" (ee)); /* ee */\ \ - asm("movl $" STR(CONST) ",%edi");\ + asm("movl $" STR(SLOT_CONST) ",%edi");\ asm("testl %edi,%edi\n\t"\ "jnz " LABEL "_obj\n\t"\ - "call " SYMBOL(FUNC32) "@PLT\n\t"\ + "call " FUNCTION(FUNC32) "\n\t"\ "jmp " LABEL "_remoteget_done\n\t"\ LABEL "_obj:\n\t"\ - "call " SYMBOL(FUNCOBJ) "@PLT\n\t"\ + "call " FUNCTION(FUNCOBJ) "\n\t"\ LABEL "_remoteget_done:");\ asm("popl %edi\n\t" /* edi = ee */\ "addl $8,%esp");\ @@ -1292,7 +1323,7 @@ JUMP_IF_EXC_HASNT_OCCURRED(%edi /* is ee */, LABEL "_done");\ DEBUG_IN;\ PUSH_CONSTSTR("METAVM_READ exc. occurred.\n");\ -asm("call " SYMBOL(printf) "@PLT\n\t"\ +asm("call " FUNCTION(printf) "\n\t"\ "addl $4,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -1365,7 +1396,7 @@ "pushl " #HANDLE); /* obj (Proxy) */\ asm("pushl %0" : : "m" (ee)); /* ee */\ \ - asm("call " SYMBOL(FUNC) "@PLT\n\t"\ + asm("call " FUNCTION(FUNC) "\n\t"\ "movl %edx," #TGT_HIGH "\n\t"\ "popl %edi\n\t" /* edi = ee */\ "movl %eax," #TGT_LOW "\n\t"\ @@ -1374,7 +1405,7 @@ JUMP_IF_EXC_HASNT_OCCURRED(%edi /* is ee */, LABEL "_done");\ DEBUG_IN;\ PUSH_CONSTSTR("METAVM_READ2 exc. occurred.\n");\ -asm("call " SYMBOL(printf) "@PLT\n\t"\ +asm("call " FUNCTION(printf) "\n\t"\ "addl $4,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -1499,23 +1530,23 @@ #define CODE_ISTORE(VOP, ST_A, ST_B, ST_C, ST_D, ST_E) \ CODE(opc_##VOP, VOP, ST0, ST_A, OPC_NONE) {\ asm("popl %edx\n\t"\ - "movl %edx," STR(CONST) "(%esi)");\ + "movl %edx," STR(SLOT_CONST) "(%esi)");\ ILOAD_DEBUG1(%edx);\ }\ CODE(opc_##VOP, VOP, ST1, ST_B, OPC_NONE) {\ - asm("movl %edx," STR(CONST) "(%esi)");\ + asm("movl %edx," STR(SLOT_CONST) "(%esi)");\ ILOAD_DEBUG1(%edx);\ }\ CODE(opc_##VOP, VOP, ST2, ST_C, OPC_NONE) {\ - asm("movl %ecx," STR(CONST) "(%esi)");\ + asm("movl %ecx," STR(SLOT_CONST) "(%esi)");\ ILOAD_DEBUG1(%ecx);\ }\ CODE(opc_##VOP, VOP, ST3, ST_D, OPC_NONE) {\ - asm("movl %ecx," STR(CONST) "(%esi)");\ + asm("movl %ecx," STR(SLOT_CONST) "(%esi)");\ ILOAD_DEBUG1(%ecx);\ }\ CODE(opc_##VOP, VOP, ST4, ST_E, OPC_NONE) {\ - asm("movl %edx," STR(CONST) "(%esi)");\ + asm("movl %edx," STR(SLOT_CONST) "(%esi)");\ ILOAD_DEBUG1(%edx);\ } @@ -1528,9 +1559,9 @@ CODE(opc_fst_fstore, fst_fstore, ST0, ST0, OPC_NONE) { asm("addl $4,%esp"); # ifdef USE_SSE2 - asm("movss %xmm0," STR(CONST) "(%esi)"); + asm("movss %xmm0," STR(SLOT_CONST) "(%esi)"); # else - asm("fstps " STR(CONST) "(%esi)"); + asm("fstps " STR(SLOT_CONST) "(%esi)"); # endif } #endif @@ -1541,13 +1572,13 @@ // compile: fill_cache, lstore #define CODE_LSTORE(VOP, ST_A, ST_B) \ CODE(opc_##VOP, VOP, ST2, ST_A, OPC_NONE) {\ - asm("movl %ecx," STR(CONST) "(%esi)\n\t"\ - "movl %edx," STR(CONST) "(%esi)");\ + asm("movl %ecx," STR(SLOT_CONST) "(%esi)\n\t"\ + "movl %edx," STR(SLOT_CONST) "(%esi)");\ LLOAD_DEBUG1(%ecx, %edx);\ }\ CODE(opc_##VOP, VOP, ST4, ST_B, OPC_NONE) {\ - asm("movl %edx," STR(CONST) "(%esi)\n\t"\ - "movl %ecx," STR(CONST) "(%esi)");\ + asm("movl %edx," STR(SLOT_CONST) "(%esi)\n\t"\ + "movl %ecx," STR(SLOT_CONST) "(%esi)");\ LLOAD_DEBUG1(%edx, %ecx);\ } @@ -1560,9 +1591,9 @@ CODE(opc_dst_dstore, dst_dstore, ST0, ST0, OPC_NONE) { asm("addl $8,%esp"); // substitution for fill_cache # ifdef USE_SSE2 - asm("movsd %xmm0," STR(CONST) "(%esi)"); + asm("movsd %xmm0," STR(SLOT_CONST) "(%esi)"); # else - asm("fstpl " STR(CONST) "(%esi)"); + asm("fstpl " STR(SLOT_CONST) "(%esi)"); # endif } #endif @@ -1604,13 +1635,13 @@ "pushl " #HANDLE); /* obj (Proxy) */\ asm("pushl %0" : : "m" (ee)); /* ee */\ \ - asm("movl $" STR(CONST) ",%edi");\ + asm("movl $" STR(SLOT_CONST) ",%edi");\ asm("testl %edi,%edi\n\t"\ "jnz " LABEL "_obj\n\t"\ - "call " SYMBOL(FUNC32) "@PLT\n\t"\ + "call " FUNCTION(FUNC32) "\n\t"\ "jmp " LABEL "_return\n\t"\ LABEL "_obj:\n\t"\ - "call " SYMBOL(FUNCOBJ) "@PLT");\ + "call " FUNCTION(FUNCOBJ));\ asm(LABEL "_return:\n\t"\ "popl %edi\n\t" /* edi = ee */\ "addl $12,%esp");\ @@ -1620,7 +1651,7 @@ JUMP_IF_EXC_HASNT_OCCURRED(%edi /* is ee */, LABEL "_done");\ DEBUG_IN;\ PUSH_CONSTSTR("METAVM_WRITE exc. occurred.\n");\ -asm("call " SYMBOL(printf) "@PLT\n\t"\ +asm("call " FUNCTION(printf) "\n\t"\ "addl $4,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -1676,15 +1707,17 @@ // #ifdef RUNTIME_DEBUG # define AASTORE_TEST_DEBUG \ + asm("pushl %eax");\ if (runtime_debug) {\ DEBUG_IN;\ asm("pushl %edi\n\tpushl %ecx\n\tpushl %edx");\ PUSH_CONSTSTR(" edx: 0x%08x, ecx: 0x%08x, edi: 0x%08x\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $16,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") #else # define AASTORE_TEST_DEBUG #endif @@ -1707,8 +1740,9 @@ /* push array->body[obj_length(..)] */\ "pushl %eax\n\t" /* push value */\ /* call is_instance_of(value, array->body[eax], ee) */\ - "call " SYMBOL(is_instance_of) "@PLT\n\t"\ - "addl $12,%esp");\ + "call " FUNCTION(is_instance_of));\ + CAST_UINT8_TO_INT32(%eax);\ + asm("addl $12,%esp");\ /* if (eax) goto ... */\ asm("testl %eax,%eax");\ FUNCCALL_OUT(2);\ @@ -1757,7 +1791,7 @@ "pushl " #HANDLE); /* obj (Proxy) */\ asm("pushl %0" : : "m" (ee)); /* ee */\ \ - asm("call " SYMBOL(FUNC) "@PLT\n\t"\ + asm("call " FUNCTION(FUNC) "\n\t"\ "popl %edi\n\t" /* edi = ee */\ "addl $16,%esp");\ \ @@ -1766,7 +1800,7 @@ JUMP_IF_EXC_HASNT_OCCURRED(%edi /* is ee */, LABEL "_done");\ DEBUG_IN;\ PUSH_CONSTSTR("METAVM_WRITE2 exc. occurred.\n");\ -asm("call " SYMBOL(printf) "@PLT\n\t"\ +asm("call " FUNCTION(printf) "\n\t"\ "addl $4,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -2102,16 +2136,19 @@ // iadd, isub, imul, iand, ior, ixor #ifdef RUNTIME_DEBUG # define ARITH_INT_DEBUG1(VAL1, VAL2, SYM) \ - if (runtime_debug) {\ + asm("pushl %eax");\ + if (runtime_debug) { /* break eax */ \ + asm("movl (%esp),%eax"); /* restore */ \ DEBUG_IN;\ asm("pushl " #VAL2 "\n\t"\ "pushl " #VAL1);\ PUSH_CONSTSTR(" %d " SYM " %d\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") #else # define ARITH_INT_DEBUG1(VAL1, VAL2, SYM) #endif @@ -2226,18 +2263,21 @@ // ladd, lsub, land, lor, lxor #ifdef RUNTIME_DEBUG # define ARITH_LONG_DEBUG1(VAL1_LOW, VAL1_HIGH, VAL2_LOW, VAL2_HIGH, SYM) \ - if (runtime_debug) {\ + asm("pushl %eax");\ + if (runtime_debug) { /* break eax */ \ + asm("movl (%esp),%eax"); /* restore */ \ DEBUG_IN;\ asm("pushl " #VAL2_HIGH "\n\tpushl " #VAL2_LOW "\n\t"\ "pushl " #VAL2_HIGH "\n\tpushl " #VAL2_LOW "\n\t"\ "pushl " #VAL1_HIGH "\n\tpushl " #VAL1_LOW "\n\t"\ "pushl " #VAL1_HIGH "\n\tpushl " #VAL1_LOW);\ PUSH_CONSTSTR(" %lld(0x%016llx) " SYM " %lld(0x%016llx)\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $36,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") #else # define ARITH_LONG_DEBUG1(VAL1_LOW, VAL1_HIGH, VAL2_LOW, VAL2_HIGH, SYM) #endif @@ -2314,8 +2354,8 @@ // lmul #ifdef RUNTIME_DEBUG # define ARITH_LONG_CALL_DEBUG1(OPTOP1_REG, OPTOP2_REG, SYM) \ + asm("pushl %eax\n\tpushl %edi");\ if (runtime_debug) {\ - asm("pushl %eax\n\tpushl %edi");\ asm("movl 8(%esp),%eax\n\t"\ "movl 12(%esp),%edi");\ DEBUG_IN;\ @@ -2323,12 +2363,12 @@ "pushl " #OPTOP1_REG "\n\t"\ "pushl %edi\n\tpushl %eax");\ PUSH_CONSTSTR(" %lld " SYM " %lld\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $20,%esp");\ FFLUSH;\ DEBUG_OUT;\ - asm("popl %edi\n\tpopl %eax");\ - } + }\ + asm("popl %edi\n\tpopl %eax") #else # define ARITH_LONG_CALL_DEBUG1(OPTOP1_REG, OPTOP2_REG, SYM) #endif @@ -2387,7 +2427,7 @@ "pushl " #OPTOP1_REG "\n\t" /* push v2[0:31] */\ "pushl %edi\n\t" /* push v1[32:63] */\ "pushl %eax\n\t" /* push v1[0:31] */\ - "call " ROP "@PLT\n\t"\ + "call " ROP "\n\t"\ "addl $28,%esp");\ asm(/* movl %edx,%edx */\ "movl %eax,%ecx");\ @@ -2433,8 +2473,13 @@ ARITH_LONG_CALL_ST24(ROP, %edx, %ecx, SYM);\ } - CODE_ARITH_LONG_TEST(div, SYMBOL(__divdi3), "/"); - CODE_ARITH_LONG_TEST(rem, SYMBOL(__moddi3), "mod"); +#ifdef _WIN32 + CODE_ARITH_LONG_TEST(div, FUNCTION(_alldiv), "/"); + CODE_ARITH_LONG_TEST(rem, FUNCTION(_allrem), "mod"); +#else + CODE_ARITH_LONG_TEST(div, FUNCTION(__divdi3), "/"); + CODE_ARITH_LONG_TEST(rem, FUNCTION(__moddi3), "mod"); +#endif // fadd, fsub, fmul, fdiv @@ -2451,7 +2496,7 @@ "fstpl 8(%esp)\n\t"\ "fstpl (%esp)");\ PUSH_CONSTSTR(" %g, %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $20,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -2463,7 +2508,7 @@ asm("subl $8,%esp\n\t"\ "fstpl (%esp)");\ PUSH_CONSTSTR(" %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -2624,7 +2669,7 @@ asm("pushl 4(%edi)\n\tpushl (%edi)\n\t"\ "pushl 12(%edi)\n\tpushl 8(%edi)");\ PUSH_CONSTSTR(" %g, %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $20,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -2636,7 +2681,7 @@ DEBUG_IN;\ asm("pushl %eax\n\tpushl %edi");\ PUSH_CONSTSTR(" %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -2793,7 +2838,7 @@ asm("subl $16,%esp"); asm("fstpl (%esp)\n\t" // stack top = optop[-2] (value1) "fstpl 8(%esp)\n\t" // stack top-1 = optop[-1] (value2) - "call " SYMBOL(fmod) "@PLT\n\t" + "call " FUNCTION(fmod) "\n\t" "addl $16,%esp"); FUNCCALL_OUT(0); asm("addl $4,%esp"); @@ -2814,7 +2859,7 @@ "pushl " #OPTOP1_REG "\n\t" /* push v2[0:31] */\ "pushl %edi\n\t" /* push v1[32:63] */\ "pushl %eax\n\t" /* push v1[0:31] */\ - "call " SYMBOL(fmod) "@PLT\n\t"\ + "call " FUNCTION(fmod) "\n\t"\ "addl $16,%esp");\ FUNCCALL_OUT(0);\ asm("subl $8,%esp"); @@ -3029,10 +3074,10 @@ # define IINC_DEBUG1 \ if (runtime_debug) {\ DEBUG_IN;\ - asm("pushl " STR(CONST) "(%esi)\n\t"\ - "pushl $" STR(CONST));\ + asm("pushl " STR(SLOT_CONST) "(%esi)\n\t"\ + "pushl $" STR(SLOT_CONST));\ PUSH_CONSTSTR(" var[%d] %d");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -3041,10 +3086,10 @@ # define IINC_DEBUG2 \ if (runtime_debug) {\ DEBUG_IN;\ - asm("pushl " STR(CONST) "(%esi)\n\t"\ - "pushl $" STR(CONST));\ + asm("pushl " STR(SLOT_CONST) "(%esi)\n\t"\ + "pushl $" STR(SLOT_CONST));\ PUSH_CONSTSTR(" + %d = %d\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -3056,7 +3101,7 @@ CODE(opc_iinc, iinc, STANY, STSTA, OPC_NONE) { IINC_DEBUG1; - asm("addl $" STR(CONST) "," STR(CONST) "(%esi)"); + asm("addl $" STR(SLOT_CONST) "," STR(SLOT_CONST) "(%esi)"); IINC_DEBUG2; } @@ -3154,7 +3199,7 @@ asm("subl $8,%esp\n\t"\ "fstl (%esp)");\ PUSH_CONSTSTR(" %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ DEBUG_OUT;\ } @@ -3164,7 +3209,7 @@ asm("pushl $0\n"\ "fstcw (%esp)");\ PUSH_CONSTSTR(" FPU cw: 0x%x\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $8,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -3385,7 +3430,7 @@ "fstpl 8(%esp)\n\t"\ "fstpl (%esp)");\ PUSH_CONSTSTR(" %g %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $20,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -3400,7 +3445,7 @@ asm("pushl %eax\n\tpushl %edi\n\t"\ "pushl %edx\n\tpushl %ecx");\ PUSH_CONSTSTR(" %g %g\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $20,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -3484,7 +3529,7 @@ #define IF(OPTOP1_REG, JP_ROP) \ VALUE_DEBUG(OPTOP1_REG);\ asm("testl " #OPTOP1_REG "," #OPTOP1_REG) - // jump: #JP_ROP STR(ADDR_JP) + // jump: #JP_ROP STR(SLOT_ADDR_JP) #define CODE_IF(VOP, JP_ROP) \ CODE(opc_if##VOP, if##VOP, ST0, ST0, OPC_JUMP) {\ @@ -3520,7 +3565,7 @@ asm("pushl " #OPTOP1_REG "\n\t"\ "pushl " #OPTOP2_REG);\ PUSH_CONSTSTR(" %d %d\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -3532,7 +3577,7 @@ #define IF_ICMP_ST24(OPTOP1_REG, OPTOP2_REG, JP_ROP) \ IF_ICMP_DEBUG(OPTOP1_REG, OPTOP2_REG);\ asm("cmpl " #OPTOP1_REG "," #OPTOP2_REG) - // jump: #JP_ROP STR(ADDR_JP) + // jump: #JP_ROP STR(SLOT_ADDR_JP) // now state 0 #define CODE_IF_ICMP(VOP, JP_ROP) \ @@ -3566,7 +3611,7 @@ // goto CODE(opc_goto, goto, STANY, STSTA, OPC_JUMP) { - // jump: "jmp " STR(ADDR_JP) + // jump: "jmp " STR(SLOT_ADDR_JP) } @@ -3578,7 +3623,7 @@ DEBUG_IN;\ asm("pushl " #REG);\ PUSH_CONSTSTR(" push 0x%08x\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $8,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -3588,9 +3633,9 @@ #endif #define JSR(REG) \ - asm("movl $" STR(CONST) "," #REG);\ + asm("movl $" STR(SLOT_CONST) "," #REG);\ JSR_DEBUG1(REG) - // jump: "jmp " STR(ADDR_JP) + // jump: "jmp " STR(SLOT_ADDR_JP) CODE(opc_jsr, jsr, ST0, ST1, OPC_JUMP) { JSR(%edx); @@ -3614,7 +3659,7 @@ // ret // const: index * 4 CODE(opc_ret, ret, STANY, STSTA, OPC_JUMP) { - asm("movl " STR(CONST) "(%esi),%eax"); // eax = vars[index] + asm("movl " STR(SLOT_CONST) "(%esi),%eax"); // eax = vars[index] ILOAD_DEBUG1(%eax); COMPILEDCODE(%edi); // edi = mb->CompiledCode asm("addl %edi,%eax"); @@ -3632,32 +3677,37 @@ // default, offset(low), offset(low+1), ..., offset(high) #ifdef RUNTIME_DEBUG # define TBLSW_DEBUG1(INDEX) \ - if (runtime_debug) {\ + asm("pushl %eax");\ + if (runtime_debug) { /* break eax */ \ + asm("movl (%esp),%eax"); /* restore */ \ DEBUG_IN;\ asm("pushl %eax\n\tpushl %edi\n\tpushl " #INDEX);\ PUSH_CONSTSTR(" index: %d [%d:%d]\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $16,%esp");\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") # define TBLSW_DEBUG2(OFF) \ + asm("pushl %eax");\ if (runtime_debug) {\ DEBUG_IN;\ asm("pushl " #OFF "\n\tpushl " #OFF);\ PUSH_CONSTSTR(" native off: 0x%08x(%d)\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") #else # define TBLSW_DEBUG1(INDEX) # define TBLSW_DEBUG2(OFF) #endif #define TBLSW(INDEX, LABEL) \ - asm("movl $" STR(CONST) ",%edi\n\t" /* low */\ - "movl $" STR(CONST) ",%eax"); /* high */\ + asm("movl $" STR(SLOT_CONST) ",%edi\n\t" /* low */\ + "movl $" STR(SLOT_CONST) ",%eax"); /* high */\ TBLSW_DEBUG1(INDEX);\ asm("subl %edi," #INDEX "\n\t" /* index -= low */\ "subl %edi,%eax"); /* high -= low */\ @@ -3665,7 +3715,7 @@ COMPILEDCODE(%edi); /* edi = mb->CompiledCode */\ asm("pushl %edi"); /* push mb->CompiledCode */\ \ - asm("addl $" STR(CONST) ",%edi"); /* edi += offset of the table */\ + asm("addl $" STR(SLOT_CONST) ",%edi"); /* edi += offset of the table */\ /* edi = addr. of the table */\ asm("cmpl " #INDEX ",%eax\n\t" /* test high - index */\ "jb " LABEL "_default\n\t"\ @@ -3707,14 +3757,16 @@ // element(1), element(2), ..., element(npairs), element(default) #ifdef RUNTIME_DEBUG # define LUSW_DEBUG1(KEY) \ + asm("pushl %eax");\ if (runtime_debug) {\ DEBUG_IN;\ asm("pushl %eax\n\tpushl " #KEY);\ PUSH_CONSTSTR(" key: %d, npairs: %d\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") # define LUSW_DEBUG2 \ if (runtime_debug) {\ DEBUG_IN;\ @@ -3722,7 +3774,7 @@ "pushl 4(%edi)\n\tpushl 4(%edi)\n\t"\ "pushl (%edi)");\ PUSH_CONSTSTR(" match: %d, target offset: 0x%08x(%d), trampoline code: 0x%08x\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $20,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -3736,8 +3788,8 @@ COMPILEDCODE(%edi);\ asm("pushl %edi"); /* push mb->CompiledCode */\ \ - asm("movl $" STR(CONST) ",%eax"); /* npairs */\ - asm("addl $" STR(CONST) ",%edi"); /* offset of the table */\ + asm("movl $" STR(SLOT_CONST) ",%eax"); /* npairs */\ + asm("addl $" STR(SLOT_CONST) ",%edi"); /* offset of the table */\ /* edi = addr. of the table */\ LUSW_DEBUG1(KEY);\ asm(\ @@ -3786,7 +3838,7 @@ CODE(opc_return, return, STANY, STATE_AFTER_RETURN, OPC_NONE) { VALUE_DEBUG(%edx); VALUE_DEBUG(%ecx); - asm(".byte 0xe9\n\t.long " STR(CONST)); // jmp + asm(".byte 0xe9\n\t.long " STR(SLOT_CONST)); // jmp } @@ -3806,29 +3858,29 @@ #define CODE_GETSTATIC(vop, THROW_EXC) \ CODE(opc_##vop, vop, ST0, ST1, THROW_EXC) {\ INITCLASS_GETSTATIC(#vop "_st0");\ - asm("movl (" STR(CONST) "),%edx");\ + asm("movl (" STR(SLOT_CONST) "),%edx");\ VALUE_DEBUG(%edx);\ }\ CODE(opc_##vop, vop, ST1, ST2, THROW_EXC) {\ INITCLASS_GETSTATIC(#vop "_st1");\ - asm("movl (" STR(CONST) "),%ecx");\ + asm("movl (" STR(SLOT_CONST) "),%ecx");\ VALUE_DEBUG(%ecx);\ }\ CODE(opc_##vop, vop, ST2, ST4, THROW_EXC) {\ INITCLASS_GETSTATIC(#vop "_st2");\ asm("pushl %edx\n\t" /* now state 3 */\ - "movl (" STR(CONST) "),%edx");\ + "movl (" STR(SLOT_CONST) "),%edx");\ VALUE_DEBUG(%edx);\ }\ CODE(opc_##vop, vop, ST3, ST4, THROW_EXC) {\ INITCLASS_GETSTATIC(#vop "_st3");\ - asm("movl (" STR(CONST) "),%edx");\ + asm("movl (" STR(SLOT_CONST) "),%edx");\ VALUE_DEBUG(%edx);\ }\ CODE(opc_##vop, vop, ST4, ST2, THROW_EXC) {\ INITCLASS_GETSTATIC(#vop "_st4");\ asm("pushl %ecx\n\t" /* now state 1 */\ - "movl (" STR(CONST) "),%ecx");\ + "movl (" STR(SLOT_CONST) "),%ecx");\ VALUE_DEBUG(%ecx);\ } @@ -3836,32 +3888,32 @@ CODE(opc_##vop, vop, ST0, ST0, THROW_EXC) {\ INITCLASS_GETSTATIC(#vop "_st0");\ asm("popl %edx\n\t" /* now state 1 */\ - "movl %edx,(" STR(CONST) ")");\ + "movl %edx,(" STR(SLOT_CONST) ")");\ VALUE_DEBUG(%edx);\ }\ CODE(opc_##vop, vop, ST1, ST0, THROW_EXC) {\ INITCLASS_GETSTATIC(#vop "_st1");\ - asm("movl %edx,(" STR(CONST) ")");\ + asm("movl %edx,(" STR(SLOT_CONST) ")");\ VALUE_DEBUG(%edx);\ }\ CODE(opc_##vop, vop, ST2, ST1, THROW_EXC) {\ INITCLASS_GETSTATIC(#vop "_st2");\ - asm("movl %ecx,(" STR(CONST) ")");\ + asm("movl %ecx,(" STR(SLOT_CONST) ")");\ VALUE_DEBUG(%ecx);\ }\ CODE(opc_##vop, vop, ST3, ST0, THROW_EXC) {\ INITCLASS_GETSTATIC(#vop "_st3");\ - asm("movl %ecx,(" STR(CONST) ")");\ + asm("movl %ecx,(" STR(SLOT_CONST) ")");\ VALUE_DEBUG(%ecx);\ }\ CODE(opc_##vop, vop, ST4, ST3, THROW_EXC) {\ INITCLASS_GETSTATIC(#vop "_st4");\ - asm("movl %edx,(" STR(CONST) ")");\ + asm("movl %edx,(" STR(SLOT_CONST) ")");\ VALUE_DEBUG(%edx);\ } #define GETSTATIC2_ST0(LOW_REG, HIGH_REG) \ - asm("movl $" STR(CONST) ",%edi\n\t"\ + asm("movl $" STR(SLOT_CONST) ",%edi\n\t"\ "movl (%edi)," #LOW_REG "\n\t"\ "movl 4(%edi)," #HIGH_REG) #define CODE_GETSTATIC2(vop, THROW_EXC) \ @@ -3893,7 +3945,7 @@ } #define PUTSTATIC2(OPTOP1_REG, OPTOP2_REG) \ - asm("movl $" STR(CONST) ",%edi\n\t"\ + asm("movl $" STR(SLOT_CONST) ",%edi\n\t"\ "movl " #OPTOP1_REG ",(%edi)\n\t"\ "movl " #OPTOP2_REG ",4(%edi)\n\t") // now state 0 @@ -3943,12 +3995,12 @@ # define INITCLASS_GETSTATIC(LABEL) \ asm(".short 0x9090");\ \ - asm("movl $" STR(CONST) ",%edi"); /* edi = cb */\ + asm("movl $" STR(SLOT_CONST) ",%edi"); /* edi = cb */\ \ asm("pushl %edx\n\tpushl %ecx"); /* save */\ asm("pushl %edi");\ asm("pushl %0" : : "m" (ee));\ - asm("call " SYMBOL(once_InitClass) "@PLT\n\t"\ + asm("call " FUNCTION(once_InitClass) "\n\t"\ "addl $8,%esp");\ asm("popl %ecx\n\tpopl %edx"); /* restore */\ \ @@ -3979,12 +4031,12 @@ // const: slot #ifndef NO_NULL_AND_ARRAY_CHECK # define FIELD_ACC(HANDLE, VOP, STATE) \ - asm("movl $" STR(CONST) ",%eax");\ + asm("movl $" STR(SLOT_CONST) ",%eax");\ /* slot: fb->u.offset / sizeof(OBJECT) */\ NULL_TEST(HANDLE, #VOP "_st" #STATE "_1") #else # define FIELD_ACC(HANDLE, VOP, STATE) \ - asm("movl $" STR(CONST) ",%eax") + asm("movl $" STR(SLOT_CONST) ",%eax") // fb->u.offset / sizeof(OBJECT) #endif // NO_NULL_AND_ARRAY_CHECK // eax = index @@ -4155,7 +4207,7 @@ asm("pushl %eax\n\tpushl %ecx"); /* save */\ asm("pushl %edx");\ asm("pushl %0" : : "m" (ee)); /* ee */\ - asm("call " SYMBOL(once_InitClass) "@PLT\n\t"\ + asm("call " FUNCTION(once_InitClass) "\n\t"\ "addl $4,%esp");\ asm("popl %edx\n\tpopl %ecx"); /* restore */\ \ @@ -4182,10 +4234,10 @@ // const: args_size CODE(opc_inv_head, inv_head, STANY, STSTA, OPC_NONE) { - asm("movl $" STR(CONST) ",%ecx"); // ecx = args_size + asm("movl $" STR(SLOT_CONST) ",%ecx"); // ecx = args_size - // bytepcoff = BYTEPCOFF - asm("movl $" STR(BYTEPCOFF) ",-4(%ebp)"); + // bytepcoff = SLOT_BYTEPCOFF + asm("movl $" STR(SLOT_BYTEPCOFF) ",-4(%ebp)"); #ifdef RUNTIME_DEBUG if (runtime_debug) { @@ -4193,7 +4245,7 @@ asm("movl -4(%ebp),%eax"); // eax = bytepcoff asm("pushl %eax\n\tpushl %eax"); PUSH_CONSTSTR(" pc: %d(0x%x)\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $12,%esp"); FFLUSH; DEBUG_OUT; @@ -4235,7 +4287,7 @@ asm("jmp inv_core_invoke_done");\ \ asm("inv_core_invoke_normal:");\ - asm("call " SYMBOL(invocationHelper) "@PLT");\ + asm("call " FUNCTION(invocationHelper));\ asm("inv_core_invoke_done:") #else // DIRECT_INVOCATION # define INVCORE_INVOKE \ @@ -4245,21 +4297,24 @@ asm("addl -4(%ebp),%ecx"); /* ecx = bytepcoff */\ asm("movl %ecx," FRAME_LASTPC(%edi));\ \ - asm("call " SYMBOL(invocationHelper) "@PLT") + asm("call " FUNCTION(invocationHelper)) #endif // DIRECT_INVOCATION #ifdef RUNTIME_DEBUG # define INVOKE_CORE_DEBUG1 \ - if (runtime_debug) {\ + asm("pushl %eax");\ + if (runtime_debug) { /* break eax */ \ + asm("movl (%esp),%eax"); /* restore */ \ DEBUG_IN;\ asm("pushl %eax");\ PUSH_CONSTSTR(" invocationHelper() returns: %d\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $8,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") #else # define INVOKE_CORE_DEBUG1 #endif @@ -4284,8 +4339,7 @@ #define INVOKE_CORE(VOP, CORE_TYPE) \ CODE_WITHOUT_DEBUG(opc_##VOP, VOP, STANY, ST0, OPC_SIGNAL) {\ /* CAUSE_STACKOVERFLOW needs OPC_SIGNAL */\ - asm(".globl " #VOP "\n\t.type " #VOP ",@function");\ - asm(#VOP ":");\ + DECL_GLOBAL_FUNC(SYMBOL(VOP));\ \ CODE_DEBUG(#VOP);\ \ @@ -4317,19 +4371,18 @@ asm("popl %eax"); /* restore */\ asm("addl %eax,%esp"); /* free local var space */\ \ - asm(".globl " #VOP "_done\n\t.type " #VOP "_done,@function");\ - asm(#VOP "_done:");\ + DECL_GLOBAL_FUNC(SYMBOL(VOP) "_done");\ /* invoke_core_done or invoke_core_compiled_done */\ \ /* adjust optop */\ - asm("movl $" STR(CONST) ",%eax"); /* eax = args_size */\ + asm("movl $" STR(SLOT_CONST) ",%eax"); /* eax = args_size */\ asm("leal (%esp,%eax,4),%esp"); /* esp += (args_size * 4) */\ \ /* eax = !exceptionOccurred(ee) */\ asm("movl %0,%%edi" : : "m" (ee)); /* edi = ee */\ EE_EXCEPTIONKIND_EAX(%edi);\ asm("testl %eax,%eax\n\t"\ - ".short 0x850f\n\t.long " STR(ADDR_EXC)); /* jnz */\ + ".short 0x850f\n\t.long " STR(SLOT_ADDR_EXC)); /* jnz */\ } INVOKE_CORE(invoke_core, INVOKE); @@ -4364,7 +4417,7 @@ OBJ_ARRAY_METHODTABLE_TO_EAX(%edx, "invokevir"); // may cause SIGSEGV METAVM_INVOKEVIRTUAL("invvir"); - asm("movl $" STR(CONST) ",%edi"); // edi = slot + asm("movl $" STR(SLOT_CONST) ",%edi"); // edi = slot MT_SLOT(%eax, %edi, %eax); // eax = method METHOD_DEBUG(%eax, "invokevirtual"); } @@ -4373,7 +4426,7 @@ OBJ_METHODTABLE(%edx, %eax); // may cause SIGSEGV METAVM_INVOKEVIRTUAL("invvir_obj"); - asm("movl $" STR(CONST) ",%edi"); // edi = slot + asm("movl $" STR(SLOT_CONST) ",%edi"); // edi = slot MT_SLOT(%eax, %edi, %eax); // eax = method METHOD_DEBUG(%eax, "invokevirtual_obj"); } @@ -4420,10 +4473,10 @@ "pushl %eax\n\t" // methodblock "pushl %edx"); // obj (Proxy) asm("pushl %0" : : "m" (ee)); // ee - asm("call " SYMBOL(proxy_invoke) "@PLT\n\t" + asm("call " FUNCTION(proxy_invoke) "\n\t" "addl $16,%esp"); - asm(".byte 0xe9\n\t.long " STR(CONST)); // jump to invoke_core_done + asm(".byte 0xe9\n\t.long " STR(SLOT_CONST)); // jump to invoke_core_done asm("inv_metavm_inv_local:"); } @@ -4439,13 +4492,13 @@ // const: method CODE(opc_invokespecial, invokespecial, STANY, STSTA, OPC_NONE) { - asm("movl $" STR(CONST) ",%eax"); + asm("movl $" STR(SLOT_CONST) ",%eax"); METHOD_DEBUG(%eax, "invokespecial"); } // const: local_var_space CODE(opc_inv_spe_varspace, inv_spe_varspace, STANY, STSTA, OPC_NONE) { - asm("movl $" STR(CONST) ",%edi"); + asm("movl $" STR(SLOT_CONST) ",%edi"); } CODE(opc_inv_stq_obj, inv_stq_obj, STANY, STSTA, OPC_NONE) { @@ -4455,14 +4508,14 @@ // const: method CODE(opc_invokestatic_quick, invokestatic_quick, STANY, STSTA, OPC_NONE) { // edx = cbHandle(method->fb.clazz) - asm("movl $" STR(CONST) ",%eax\n\t" + asm("movl $" STR(SLOT_CONST) ",%eax\n\t" "movl " METHOD_CLAZZ(%eax) ",%edx"); METHOD_DEBUG(%eax, "invokestatic_quick"); } // const: local_var_space CODE(opc_inv_stq_varspace, inv_stq_varspace, STANY, STSTA, OPC_NONE) { - asm("movl $" STR(CONST) ",%edi"); + asm("movl $" STR(SLOT_CONST) ",%edi"); } // inv_sta_obj is same as inv_stq_obj @@ -4470,7 +4523,7 @@ // const: method CODE(opc_invokestatic, invokestatic, STANY, STSTA, OPC_THROW) { // edx = cbHandle(method->fb.clazz) - asm("movl $" STR(CONST) ",%eax\n\t" + asm("movl $" STR(SLOT_CONST) ",%eax\n\t" "movl " METHOD_CLAZZ(%eax) ",%edx"); METHOD_DEBUG(%eax, "invokestatic"); @@ -4523,11 +4576,11 @@ #ifdef INVINTF_INLINE_CACHE asm("pushl %edi"); // for inlined cache #endif - asm("pushl $" STR(CONST) "\n\t" // guessptr - "pushl $" STR(CONST) "\n\t" // imethod + asm("pushl $" STR(SLOT_CONST) "\n\t" // guessptr + "pushl $" STR(SLOT_CONST) "\n\t" // imethod "pushl %0\n\t" // ee "pushl %%edx" : : "m" (ee)); // obj, save - asm("call " SYMBOL(getInterfaceMethod) "@PLT\n\t" + asm("call " FUNCTION(getInterfaceMethod) "\n\t" // here code is patched with `INT 3' if PATCH_WITH_SIGTRAP is defined "popl %edx\n\t" // restore #ifdef INVINTF_INLINE_CACHE @@ -4565,7 +4618,7 @@ #ifdef ELIMINATE_TAIL_RECURSION // const: args_size CODE(opc_invoke_recursive, invoke_recursive, ST0, ST0, OPC_JUMP) { - asm("movl $" STR(CONST) ",%ecx"); // ecx = args_size + asm("movl $" STR(SLOT_CONST) ",%ecx"); // ecx = args_size asm("movl %esi,%edx\n\t" // save esi "movl %esi,%edi\n\t" // target addr. @@ -4575,14 +4628,14 @@ ".short 0xa5f3\n\t" // "rep movsl (%esi),(%edi)\n\t" "leal (%esp,%eax,4),%esp\n\t" // esp += 4 * args_size "movl %edx,%esi"); // restore esi - asm(".byte 0xe9\n\t.long " STR(CONST)); // jmp + asm(".byte 0xe9\n\t.long " STR(SLOT_CONST)); // jmp } CODE(opc_invoke_recursive_1, invoke_recursive_1, ST0, ST0, OPC_JUMP) { asm("movl (%esp),%eax\n\t" "addl $4,%esp\n\t" "movl %eax,(%esi)\n\t" - ".byte 0xe9\n\t.long " STR(CONST)); // jmp + ".byte 0xe9\n\t.long " STR(SLOT_CONST)); // jmp } CODE(opc_invoke_recursive_2, invoke_recursive_2, ST0, ST0, OPC_JUMP) { @@ -4591,7 +4644,7 @@ "addl $8,%esp\n\t" "movl %eax,-4(%esi)\n\t" "movl %edi,(%esi)\n\t" - ".byte 0xe9\n\t.long " STR(CONST)); // jmp + ".byte 0xe9\n\t.long " STR(SLOT_CONST)); // jmp } CODE(opc_invoke_recursive_3, invoke_recursive_3, ST0, ST0, OPC_JUMP) { @@ -4602,7 +4655,7 @@ "movl %eax,-8(%esi)\n\t" "movl %edi,-4(%esi)\n\t" "movl %ecx,(%esi)\n\t" - ".byte 0xe9\n\t.long " STR(CONST)); // jmp + ".byte 0xe9\n\t.long " STR(SLOT_CONST)); // jmp } #endif // ELIMINATE_TAIL_RECURSION @@ -4611,8 +4664,8 @@ // adjust esp and esi (var_base) for the inlined method // const: 4 * (args_size - 1), -4 * (nlocals - 1) CODE(opc_inlined_enter, inlined_enter, ST0, ST0, OPC_NONE) { - asm("leal " STR(CONST) "(%esp),%eax\n\t" // eax = base of variables - "leal " STR(CONST) "(%eax),%esp"); // esp = eax - 4 * (nlocals -1) + asm("leal " STR(SLOT_CONST) "(%esp),%edi\n\t" // eax = base of variables + "leal " STR(SLOT_CONST) "(%edi),%esp"); // esp = eax - 4 * (nlocals -1) // esi: original esp + 4 * (args_size - 1) // esp: esi - 4 * (nlocals - 1) # ifdef RUNTIME_DEBUG @@ -4620,19 +4673,19 @@ DEBUG_IN; asm("pushl %esi"); PUSH_CONSTSTR(" saved var base: %x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $8,%esp"); DEBUG_OUT; } # endif asm("pushl %esi\n\t" // save esi - "movl %eax,%esi"); + "movl %edi,%esi"); } // const: -4 * (nlocals - 1 + <# of saved values>) CODE(opc_inlined_exit, inlined_exit, STANY, STSTA, OPC_NONE) { asm("movl %esi,%eax\n\t" - "leal " STR(CONST) "(%esi),%esp\n\t" + "leal " STR(SLOT_CONST) "(%esi),%esp\n\t" "popl %esi\n\t" "leal 4(%eax),%esp"); # ifdef RUNTIME_DEBUG @@ -4640,7 +4693,7 @@ DEBUG_IN; asm("pushl %esi"); PUSH_CONSTSTR(" restored var base: %x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $8,%esp"); DEBUG_OUT; } @@ -4677,7 +4730,7 @@ FUNCCALL_IN(STATE);\ asm("pushl " #CB_REG "\n\t"\ "pushl %edi\n\t"\ - "call " SYMBOL(isByValue) "@PLT");\ + "call " FUNCTION(isByValue));\ asm("popl %edi\n\t"\ "popl " #CB_REG);\ FUNCCALL_OUT(STATE);\ @@ -4694,7 +4747,7 @@ "pushl %eax\n\t"\ /* ee->current_frame->current_method->fb.clazz */\ "pushl %edi\n\t" /* ee */\ - "call " SYMBOL(proxy_new) "@PLT\n\t"\ + "call " FUNCTION(proxy_new) "\n\t"\ "popl %edi\n\t" /* edi = ee */\ "addl $12,%esp");\ FUNCCALL_OUT(STATE);\ @@ -4702,7 +4755,7 @@ JUMP_IF_EXC_HASNT_OCCURRED(%edi /* is ee */, LABEL "_done");\ DEBUG_IN;\ PUSH_CONSTSTR("METAVM_NEW exc. occurred.\n");\ -asm("call " SYMBOL(printf) "@PLT\n\t"\ +asm("call " FUNCTION(printf) "\n\t"\ "addl $4,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -4730,7 +4783,7 @@ "pushl %%edi" : : "m" (mb)); /* mb->fb.clazz */\ asm("pushl " #CB_REG);\ asm("pushl %0" : : "m" (ee));\ - asm("call " SYMBOL(once_InitClass) "@PLT\n\t"\ + asm("call " FUNCTION(once_InitClass) "\n\t"\ "addl $12,%esp");\ \ asm("popl %ecx\n\tpopl %edx"); /* restore CB_REG */\ @@ -4753,7 +4806,7 @@ #endif #define NEW(CB_REG, DST_REG, LABEL, STATE) \ - asm("movl $" STR(CONST) "," #CB_REG); /* cb */\ + asm("movl $" STR(SLOT_CONST) "," #CB_REG); /* cb */\ \ NEW_PATCH(CB_REG, LABEL, STATE);\ \ @@ -4766,7 +4819,7 @@ asm("pushl %0" : : "m" (ee)); /* ee */\ asm("pushl $0\n\t" /* pc */\ "pushl " #CB_REG "\n\t"\ - "call " SYMBOL(newobject) "@PLT\n\t"\ + "call " FUNCTION(newobject) "\n\t"\ "addl $12,%esp");\ FUNCCALL_OUT(STATE);\ OBJ_DEBUG(%eax);\ @@ -4807,15 +4860,17 @@ #ifdef RUNTIME_DEBUG # define NEWARRAY_DEBUG1(TYPE, COUNT) \ + asm("pushl %eax");\ if (runtime_debug) {\ DEBUG_IN;\ asm("pushl " #COUNT "\n\tpushl " #TYPE);\ PUSH_CONSTSTR(" type: 0x%x, count: %d\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") #else # define NEWARRAY_DEBUG1(TYPE, COUNT) #endif @@ -4841,7 +4896,7 @@ "pushl %eax\n\t"\ /* ee->current_frame->current_method->fb.clazz */\ "pushl %edi\n\t" /* ee */\ - "call " SYMBOL(proxy_newarray) "@PLT\n\t"\ + "call " FUNCTION(proxy_newarray) "\n\t"\ "popl %edi\n\t" /* edi = ee */\ "addl $16,%esp");\ FUNCCALL_OUT(STATE);\ @@ -4849,7 +4904,7 @@ JUMP_IF_EXC_HASNT_OCCURRED(%edi /* is ee */, LABEL "_done");\ DEBUG_IN;\ PUSH_CONSTSTR("METAVM_NEWARRAY exc. occurred.\n");\ -asm("call " SYMBOL(printf) "@PLT\n\t"\ +asm("call " FUNCTION(printf) "\n\t"\ "addl $4,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -4865,7 +4920,7 @@ #endif // METAVM_NO_ARRAY #define NEWARRAY(OPTOP1_REG, LABEL, STATE) \ - asm("movl $" STR(CONST) ",%eax"); /* eax = type */\ + asm("movl $" STR(SLOT_CONST) ",%eax"); /* eax = type */\ NEWARRAY_DEBUG1(%eax, OPTOP1_REG);\ \ NEWARRAY_TEST(OPTOP1_REG, LABEL);\ @@ -4915,7 +4970,7 @@ /* call proxy_anewarray() */\ FUNCCALL_IN(STATE);\ asm("pushl " #COUNT "\n\t" /* count */\ - "pushl $" STR(CONST) "\n\t" /* clazz of elements */\ + "pushl $" STR(SLOT_CONST) "\n\t" /* clazz of elements */\ "pushl %eax\n\t" /* addr */\ "movl " EE_CURRENTFRAME(%edi) ",%eax\n\t"\ "movl " FRAME_CURRENTMETHOD(%eax) ",%eax\n\t"\ @@ -4923,7 +4978,7 @@ "pushl %eax\n\t"\ /* ee->current_frame->current_method->fb.clazz */\ "pushl %edi\n\t" /* ee */\ - "call " SYMBOL(proxy_anewarray) "@PLT\n\t"\ + "call " FUNCTION(proxy_anewarray) "\n\t"\ "popl %edi\n\t" /* edi = ee */\ "addl $16,%esp");\ FUNCCALL_OUT(STATE);\ @@ -4931,7 +4986,7 @@ JUMP_IF_EXC_HASNT_OCCURRED(%edi /* is ee */, LABEL "_done");\ DEBUG_IN;\ PUSH_CONSTSTR("METAVM_ANEWARRAY exc. occurred.\n");\ -asm("call " SYMBOL(printf) "@PLT\n\t"\ +asm("call " FUNCTION(printf) "\n\t"\ "addl $4,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -4956,7 +5011,7 @@ asm(LABEL "_2:");\ \ UNHAND(%eax, %edi);\ - asm("movl $" STR(CONST) ",(%edi," #OPTOP1_REG ",4)");\ + asm("movl $" STR(SLOT_CONST) ",(%edi," #OPTOP1_REG ",4)");\ /* unhand(array)->body[count] = clazz of elements */\ asm(LABEL "_done:\n\t"\ "movl %eax," #OPTOP1_REG) /* store to dst. */ @@ -4988,7 +5043,7 @@ FUNCCALL_IN(STATE);\ asm("pushl " #HANDLE);\ asm("pushl %0" : : "m" (ee)); /* ee */\ - asm("call " SYMBOL(proxy_arraylength) "@PLT\n\t"\ + asm("call " FUNCTION(proxy_arraylength) "\n\t"\ "movl %eax," #DST "\n\t"\ "addl $8,%esp");\ FUNCCALL_OUT(STATE);\ @@ -5050,8 +5105,9 @@ cur_ee->exception.exc = obj;\ }\ \ - asm("movl $" STR(BYTEPCOFF) ",-4(%ebp)"); /* bytepcoff = BYTEPCOFF */\ - asm(".byte 0xe9\n\t.long " STR(ADDR_EXC)) + asm("movl $" STR(SLOT_BYTEPCOFF) ",-4(%ebp)");\ + /* bytepcoff = SLOT_BYTEPCOFF */\ + asm(".byte 0xe9\n\t.long " STR(SLOT_ADDR_EXC)) // jmp CODE(opc_athrow, athrow, ST0, ST1, OPC_SIGNAL) { @@ -5078,7 +5134,7 @@ # define METAVM_CHECKCAST(OPTOP1_REG, LABEL, STATE) \ FUNCCALL_IN(STATE);\ asm("pushl %eax\n\t" /* cb */\ - "call " SYMBOL(isCheckPassType) "@PLT\n\t"\ + "call " FUNCTION(isCheckPassType) "\n\t"\ "testl %eax,%eax\n\t"\ "popl %eax");\ FUNCCALL_OUT(STATE);\ @@ -5098,8 +5154,9 @@ asm("pushl %0" : : "m" (ee)); /* ee */\ asm("pushl %eax\n\t" /* cb */\ "pushl %edi\n\t"\ - "call " SYMBOL(is_subclass_of) "@PLT\n\t"\ - "addl $12,%esp");\ + "call " FUNCTION(is_subclass_of));\ + CAST_UINT8_TO_INT32(%eax);\ + asm("addl $12,%esp");\ FUNCCALL_OUT(STATE);\ \ asm("testl %eax,%eax\n\t"\ @@ -5112,7 +5169,9 @@ #ifdef RUNTIME_DEBUG # define CHECKCAST_DEBUG(HANDLE, CB, LABEL) \ - if (runtime_debug) {\ + asm("pushl %eax");\ + if (runtime_debug) { /* break eax */ \ + asm("movl (%esp),%eax"); /* restore */ \ DEBUG_IN;\ CB_NAME(CB, %edi);\ asm("pushl %edi");\ @@ -5121,7 +5180,7 @@ asm("testl %eax,%eax\n\t"\ "jnz " LABEL "_cc_debug_not_null");\ PUSH_CONSTSTR(" methodtable is null\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $8,%esp\n\t"\ "jmp " LABEL "_cc_debug_done");\ \ @@ -5130,14 +5189,15 @@ CB_NAME(%eax, %eax);\ asm("pushl %eax");\ PUSH_CONSTSTR(" %s instanceof %s\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $12,%esp");\ \ asm(LABEL "_cc_debug_done:");\ \ FFLUSH;\ DEBUG_OUT;\ - } + }\ + asm("popl %eax") #else # define CHECKCAST_DEBUG(HANDLE, CB, LABEL) #endif @@ -5147,7 +5207,7 @@ asm("testl " #HANDLE "," #HANDLE "\n\t"\ "jz " LABEL "_done");\ \ - asm("movl $" STR(CONST) ",%eax"); /* cb */\ + asm("movl $" STR(SLOT_CONST) ",%eax"); /* cb */\ METAVM_CHECKCAST(HANDLE, LABEL, STATE);\ CHECKCAST_DEBUG(HANDLE, %eax, LABEL);\ \ @@ -5163,8 +5223,9 @@ asm("pushl %0" : : "m" (ee)); /* ee */\ asm("pushl %eax\n\t" /* cb */\ "pushl " #HANDLE "\n\t"\ - "call " SYMBOL(is_instance_of) "@PLT\n\t"\ - "popl " #HANDLE "\n\t"\ + "call " FUNCTION(is_instance_of));\ + CAST_UINT8_TO_INT32(%eax);\ + asm("popl " #HANDLE "\n\t"\ "addl $8,%esp");\ FUNCCALL_OUT(STATE);\ \ @@ -5178,7 +5239,7 @@ asm("testl " #HANDLE "," #HANDLE "\n\t"\ "jz " LABEL "_done");\ \ - asm("movl $" STR(CONST) ",%eax"); /* cb */\ + asm("movl $" STR(SLOT_CONST) ",%eax"); /* cb */\ METAVM_CHECKCAST(HANDLE, LABEL, STATE);\ CHECKCAST_DEBUG(HANDLE, %eax, LABEL);\ \ @@ -5186,8 +5247,9 @@ asm("pushl %0" : : "m" (ee)); /* ee */\ asm("pushl %eax\n\t" /* cb */\ "pushl " #HANDLE "\n\t"\ - "call " SYMBOL(is_instance_of) "@PLT\n\t"\ - "popl " #HANDLE "\n\t"\ + "call " FUNCTION(is_instance_of));\ + CAST_UINT8_TO_INT32(%eax);\ + asm("popl " #HANDLE "\n\t"\ "addl $8,%esp");\ FUNCCALL_OUT(STATE);\ \ @@ -5222,7 +5284,7 @@ # define METAVM_INSTANCEOF(OPTOP1_REG, LABEL, STATE) \ FUNCCALL_IN(STATE);\ asm("pushl %eax\n\t" /* cb */\ - "call " SYMBOL(isCheckPassType) "@PLT\n\t"\ + "call " FUNCTION(isCheckPassType) "\n\t"\ "testl %eax,%eax\n\t"\ "popl %eax");\ FUNCCALL_OUT(STATE);\ @@ -5242,8 +5304,9 @@ asm("pushl %0" : : "m" (ee)); /* ee */\ asm("pushl %eax\n\t" /* cb */\ "pushl %edi\n\t"\ - "call " SYMBOL(is_subclass_of) "@PLT\n\t"\ - "addl $12,%esp");\ + "call " FUNCTION(is_subclass_of));\ + CAST_UINT8_TO_INT32(%eax);\ + asm("addl $12,%esp");\ FUNCCALL_OUT(STATE);\ \ asm("testl %eax,%eax\n\t"\ @@ -5263,15 +5326,16 @@ asm("testl " #OPTOP1_REG "," #OPTOP1_REG "\n\t"\ "jz " LABEL "_done");\ \ - asm("movl $" STR(CONST) ",%eax"); /* cb */\ + asm("movl $" STR(SLOT_CONST) ",%eax"); /* cb */\ METAVM_INSTANCEOF(OPTOP1_REG, LABEL, STATE);\ CHECKCAST_DEBUG(OPTOP1_REG, %eax, LABEL);\ FUNCCALL_IN(STATE);\ asm("pushl %0" : : "m" (ee)); /* ee */\ asm("pushl %eax\n\t" /* cb */\ "pushl " #OPTOP1_REG "\n\t"\ - "call " SYMBOL(is_instance_of) "@PLT\n\t"\ - "addl $12,%esp");\ + "call " FUNCTION(is_instance_of));\ + CAST_UINT8_TO_INT32(%eax);\ + asm("addl $12,%esp");\ asm("movl %eax," #OPTOP1_REG);\ FUNCCALL_OUT(STATE);\ asm(LABEL "_done:") @@ -5300,7 +5364,7 @@ if (runtime_debug) {\ DEBUG_IN;\ PUSH_CONSTSTR(" monitor*() done.\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ + asm("call " FUNCTION(printf) "\n\t"\ "addl $4,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -5344,8 +5408,8 @@ } #if JDK_VER >= 12 - CODE_MONITOR(monitorenter, monitorEnter, proxy_monitorenter); - CODE_MONITOR(monitorexit, monitorExit, proxy_monitorexit); + CODE_MONITOR(monitorenter, monitorEnter2, proxy_monitorenter); + CODE_MONITOR(monitorexit, monitorExit2, proxy_monitorexit); #else CODE_MONITOR(monitorenter, monitorEnter, proxy_monitorenter); CODE_MONITOR(monitorexit, monitorExit, proxy_monitorexit); @@ -5367,11 +5431,11 @@ #ifdef RUNTIME_DEBUG # define MULTIANEWARRAY_FUNC \ asm("pushl %0" : : "m" (runtime_debug));\ - asm("call " SYMBOL(multianewarray) "@PLT\n\t"\ + asm("call " FUNCTION(multianewarray) "\n\t"\ "addl $20,%esp") #else # define MULTIANEWARRAY_FUNC \ - asm("call " SYMBOL(multianewarray) "@PLT\n\t"\ + asm("call " FUNCTION(multianewarray) "\n\t"\ "addl $16,%esp") #endif @@ -5391,7 +5455,7 @@ \ asm("pushl " #STACKPOINTER "\n\t" /* stackpointer */\ "pushl " #DIM "\n\t" /* dim */\ - "pushl $" STR(CONST) "\n\t" /* arrayclazz */\ + "pushl $" STR(SLOT_CONST) "\n\t" /* arrayclazz */\ "pushl %eax\n\t" /* addr */\ "movl " EE_CURRENTFRAME(%edi) ",%eax\n\t"\ "movl " FRAME_CURRENTMETHOD(%eax) ",%eax\n\t"\ @@ -5399,7 +5463,7 @@ "pushl %eax\n\t"\ /* ee->current_frame->current_method->fb.clazz */\ "pushl %edi\n\t" /* ee */\ - "call " SYMBOL(proxy_multianewarray) "@PLT\n\t"\ + "call " FUNCTION(proxy_multianewarray) "\n\t"\ "popl %edi\n\t" /* edi = ee */\ "addl $20,%esp");\ \ @@ -5409,7 +5473,7 @@ JUMP_IF_EXC_HASNT_OCCURRED(%edi /* is ee */, LABEL "_done");\ DEBUG_IN;\ PUSH_CONSTSTR("METAVM_MULTIANEWARRAY exc. occurred.\n");\ -asm("call " SYMBOL(printf) "@PLT\n\t"\ +asm("call " FUNCTION(printf) "\n\t"\ "addl $4,%esp");\ FFLUSH;\ DEBUG_OUT;\ @@ -5420,7 +5484,7 @@ #endif // METAVM_NO_ARRAY #define MULTIANEWARRAY_ST0(DST_REG, LABEL, STATE) \ - asm("movl $" STR(CONST) ",%edx"); /* dimensions */\ + asm("movl $" STR(SLOT_CONST) ",%edx"); /* dimensions */\ \ asm("movl %esp,%ecx"); /* stackpointer */\ \ @@ -5430,7 +5494,7 @@ asm("pushl %edx"); /* save */\ \ asm("pushl %ecx\n\t" /* stackpointer */\ - "pushl $" STR(CONST) "\n\t" /* arrayclazz */\ + "pushl $" STR(SLOT_CONST) "\n\t" /* arrayclazz */\ "pushl %edx"); /* dimensions */\ asm("pushl %0" : : "m" (ee)); /* ee */\ MULTIANEWARRAY_FUNC;\ @@ -5470,7 +5534,7 @@ // invokeignored_quick // const: args_size #define INVOKEIGNORED_QUICK_ST0(STATE) \ - asm("movl $" STR(CONST) ",%edi\n\t"\ + asm("movl $" STR(SLOT_CONST) ",%edi\n\t"\ "movl -4(%esp,%edi,4),%eax\n\t"\ "leal (%esp,%edi,4),%esp");\ NULL_TEST(%eax, "invign_st" #STATE);\ @@ -5478,12 +5542,12 @@ // may cause SIGSEGV #define INVOKEIGNORED_STATIC_QUICK_ST0(STATE) \ - asm("movl $" STR(CONST) ",%edi\n\t"\ + asm("movl $" STR(SLOT_CONST) ",%edi\n\t"\ "leal (%esp,%edi,4),%esp") #define INVOKEIGNORED_STATIC_ST0(STATE) \ INITCLASS_GETSTATIC("invign_nocheck_st" #STATE);\ - /* includes STR(CONST) */\ + /* includes STR(SLOT_CONST) */\ INVOKEIGNORED_STATIC_QUICK_ST0(STATE); #define CODE_INVOKEIGNORED(suffix, SUFFIX, EXC_TH) \ @@ -5520,8 +5584,8 @@ FUNCCALL_IN(STATE);\ asm("pushl %0" : : "m" (ee)); /* ee */\ asm("pushl $0\n\t" /* pc */\ - "pushl $" STR(CONST) "\n\t"\ - "call " SYMBOL(newobject) "@PLT\n\t"\ + "pushl $" STR(SLOT_CONST) "\n\t"\ + "call " FUNCTION(newobject) "\n\t"\ "addl $12,%esp");\ FUNCCALL_OUT(STATE);\ asm("movl %eax," #DST_REG) @@ -5569,7 +5633,7 @@ #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"\ + asm("call " FUNCTION(FUNC) "\n\t"\ "fstpl (%esp)") #ifdef USE_SSE2 @@ -5834,19 +5898,19 @@ // int32_t bytepcoff; // -4(%ebp) // for handling exceptions - asm(".globl exceptionHandler\n\t" - ".type exceptionHandler,@function\n\t" - "exceptionHandler:"); + DECL_GLOBAL_FUNC(SYMBOL(exceptionHandler)); #ifdef RUNTIME_DEBUG + asm("pushl %eax"); if (runtime_debug) { DEBUG_IN; PUSH_CONSTSTR("exceptionHandler called.\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $4,%esp"); FFLUSH; DEBUG_OUT; } + asm("popl %eax"); #endif // instantiate an exception @@ -5858,25 +5922,30 @@ // if (exceptionOccurred(ee)) asm("pushl %edx"); // edx should be (char *) DetailMessage - asm("movl %0,%%edi\n\t" - "andl $0xff,%%eax" // al contains EXCID - : : "m" (signal_name) : "eax","esi"); + + asm("movl %0,%%edi" : : "D" (signal_name) : "eax","esi","edx","ecx"); + // "m" is desirable but gcc 4.0 does not allow + + asm("andl $0xff,%eax"); // al contains EXCID #ifdef RUNTIME_DEBUG - if (runtime_debug) { + asm("pushl %eax"); + if (runtime_debug) { // break eax + asm("movl (%esp),%eax"); // restore DEBUG_IN; asm("pushl %eax"); PUSH_CONSTSTR("exc ID: %d\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $8,%esp"); FFLUSH; DEBUG_OUT; } + asm("popl %eax"); #endif asm("movl (%edi,%eax,4),%eax"); // eax = signal_name[eax] asm("pushl %%eax\n\t" // eax should be (char *) ename "pushl %0\n\t" - "call " SYMBOL(SignalError) "@PLT\n\t" + "call " FUNCTION(SignalError) "\n\t" "addl $12,%%esp" : : "m" (ee)); asm("exc_new_done:"); @@ -5897,7 +5966,7 @@ "pushl %0\n\t" "pushl %1" : : "m" (mb), "m" (ee)); - asm("call " SYMBOL(searchCatchFrame) "@PLT"); + asm("call " FUNCTION(searchCatchFrame)); #ifdef RUNTIME_DEBUG asm("addl $16,%esp"); #else @@ -5932,15 +6001,17 @@ asm("movswl " CATCHFRAME_COMPILED_STATE(%eax) ",%ecx"); // handler_state = cf->state; #ifdef RUNTIME_DEBUG + asm("pushl %eax"); if (runtime_debug) { DEBUG_IN; asm("pushl %ecx"); PUSH_CONSTSTR(" exc handler state: %d\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $8,%esp"); FFLUSH; DEBUG_OUT; } + asm("popl %eax"); #endif // shift to the state which handler assumes @@ -5951,14 +6022,16 @@ "jne exc_handler_shift_2\n\t" "popl %edx"); #ifdef RUNTIME_DEBUG + asm("pushl %eax"); if (runtime_debug) { DEBUG_IN; asm("pushl %edx"); PUSH_CONSTSTR(" st1 edx: %x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $8,%esp"); DEBUG_OUT; } + asm("popl %eax"); #endif asm("jmp exc_handler_shift_done\n\t" "exc_handler_shift_2:\n\t" @@ -5966,15 +6039,17 @@ "jne exc_handler_shift_3\n\t" "popl %ecx"); #ifdef RUNTIME_DEBUG + asm("pushl %eax"); if (runtime_debug) { DEBUG_IN; asm("pushl %ecx"); PUSH_CONSTSTR(" st3 ecx: %x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $8,%esp"); FFLUSH; DEBUG_OUT; } + asm("popl %eax"); #endif asm("jmp exc_handler_shift_done\n\t" "exc_handler_shift_3:\n\t" @@ -5983,15 +6058,17 @@ "popl %ecx\n\t" "xorl %edx,%edx"); #ifdef RUNTIME_DEBUG + asm("pushl %eax"); if (runtime_debug) { DEBUG_IN; asm("pushl %ecx"); PUSH_CONSTSTR(" st2 ecx: %x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $8,%esp"); FFLUSH; DEBUG_OUT; } + asm("popl %eax"); #endif asm("jmp exc_handler_shift_done\n\t" "exc_handler_shift_4:\n\t" @@ -6000,15 +6077,17 @@ "popl %edx\n\t" "xorl %ecx,%ecx"); #ifdef RUNTIME_DEBUG + asm("pushl %eax"); if (runtime_debug) { DEBUG_IN; asm("pushl %edx"); PUSH_CONSTSTR(" st4 edx: %x\n"); - asm("call " SYMBOL(printf) "@PLT\n\t" + asm("call " FUNCTION(printf) "\n\t" "addl $8,%esp"); FFLUSH; DEBUG_OUT; } + asm("popl %eax"); #endif asm("exc_handler_shift_done:"); diff -aruN shujit-0.7.14/code.h shujit/code.h --- shujit-0.7.14/code.h 2003-01-20 09:58:38.000000000 +0900 +++ shujit/code.h 2005-06-22 18:31:55.000000000 +0900 @@ -2,7 +2,7 @@ This file is part of shuJIT, Just In Time compiler for Sun Java Virtual Machine. - Copyright (C) 1998,1999,2000,2001,2002 Kazuyuki Shudo + Copyright (C) 1998,1999,2000,2001,2002,2003,2005 Kazuyuki Shudo This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -69,27 +69,18 @@ // -// OS dependence -// - -#ifndef WIN32 -# define _drem SYMBOL(fmod) -#endif - - -// // space filled by compiler // // constant -#define CONST 0x606060 +#define SLOT_CONST 0x606060 // for exception handler -#define BYTEPCOFF 0x626262 -#define ADDR_EXC 0x707010 +#define SLOT_BYTEPCOFF 0x626262 +#define SLOT_ADDR_EXC 0x707010 // for jump instructions -#define ADDR_JP 0x727210 +#define SLOT_ADDR_JP 0x727210 // for *return instructions -#define ADDR_FIN 0x747410 +#define SLOT_ADDR_FIN 0x747410 // @@ -99,7 +90,11 @@ #if GCC_VER <= 270 #define PUSH_CONSTSTR(STR) asm("PUSH %0" : : "m" (STR)) #else -#define PUSH_CONSTSTR(STR) asm("pushl %0" : : "m" (STR) : "esi") +#define PUSH_CONSTSTR(STR) \ + {\ + static char *msg = STR;\ + asm("pushl %0" : : "m" (msg) : "esi");\ + } #endif // This code must not use %esi which is the base of local variables @@ -127,7 +122,7 @@ #define FFLUSH \ PUSH_STDOUT;\ - asm("call " SYMBOL(fflush) "@PLT\n\t"\ + asm("call " FUNCTION(fflush) "\n\t"\ "addl $4,%esp") #if 0 @@ -165,9 +160,26 @@ #define STATETO40 asm("pushl %ecx\n\tpushl %edx") +#ifndef _WIN32 +# define DECL_GLOBAL_FUNC(FUNCNAME_STR) \ + asm(".globl " FUNCNAME_STR "\n"\ + ".type " FUNCNAME_STR ",@function\n"\ + FUNCNAME_STR ":"); +#else +# define DECL_GLOBAL_FUNC(FUNCNAME_STR) \ + asm(".globl " FUNCNAME_STR "\n"\ + ".def " FUNCNAME_STR ";\n\t"\ + ".scl 2;\n\t"\ + ".type 32;\n"\ + ".enddef\n"\ + FUNCNAME_STR ":"); +#endif + + #define SIGNAL_ERROR_JUMP() \ - asm("movl $" STR(BYTEPCOFF) ",-4(%ebp)"); /* bytepcoff = BYTEPCOFF */\ - asm(".byte 0xe9\n\t.long " STR(ADDR_EXC)) + asm("movl $" STR(SLOT_BYTEPCOFF) ",-4(%ebp)");\ + /* bytepcoff = SLOT_BYTEPCOFF */\ + asm(".byte 0xe9\n\t.long " STR(SLOT_ADDR_EXC)) #define SIGNAL_ERROR_CORE(EXCID) \ asm("movb $" #EXCID ",%al");\ @@ -178,8 +190,12 @@ SIGNAL_ERROR_CORE(EXCID) #define SIGNAL_ERROR1(EXCID, MSG) \ - asm("movl %0,%%edx" : : "m" (MSG)); /* char *DetailMessage */\ - SIGNAL_ERROR_CORE(EXCID) + {\ + static char *errmsg = MSG;\ + asm("movl %0,%%edx" : : "m" (errmsg)); /* char *DetailMessage */\ + SIGNAL_ERROR_CORE(EXCID);\ + } + #if !defined(NO_NULL_AND_ARRAY_CHECK) && !defined(NULLEXC_BY_SIGNAL) @@ -197,7 +213,7 @@ * code header * for each opcode of JVM. * - * 0xf1 (0x82, 0xd6, 0xf1 is not defined in x86 insn. set) + * 0xd6 (0x82, 0xd6, 0xf1 is not defined in x86 insn. set) * 0xe9, opcode(2 byte), initial state(4 bit), last state(4 bit) */ @@ -214,13 +230,14 @@ asm("pushl %eax\n\t"\ "leal 4(%esp),%eax");\ DEBUG_IN;\ + asm("pushl %eax");\ if (runtime_debug) {\ - asm("pushl %eax");\ PUSH_CONSTSTR(">" LABEL " %x\n");\ - asm("call " SYMBOL(printf) "@PLT\n\t"\ - "addl $8,%esp");\ + asm("call " FUNCTION(printf) "\n\t"\ + "addl $4,%esp");\ FFLUSH;\ }\ + asm("addl $4,%esp");\ DEBUG_OUT;\ asm("popl %eax") #else @@ -235,12 +252,12 @@ #define CODE_WITHOUT_DEBUG(OPCODE, LABEL, STATE, NEXTST, THROW_EXC) \ _CODE_WITHOUT_DEBUG(OPCODE, LABEL, STATE, NEXTST, THROW_EXC) #define _CODE_WITHOUT_DEBUG(OPCODE, LABEL, STATE, NEXTST, THROW_EXC) \ - asm(".byte 0xf1\n\t"\ + asm(".byte 0xd6\n\t"\ ".byte 0xe9\n\t"\ ".short " #OPCODE "\n\t"\ ".byte (" #STATE "<<4)|" #NEXTST "," #THROW_EXC); -#define CODEEND asm(".byte 0xf1,0xf1") +#define CODEEND asm(".byte 0xd6,0xd6") // @@ -347,13 +364,13 @@ asm("pushl " #LEN "\n\t"\ "pushl " TYPE);\ asm("pushl %0" : : "m" (ee));\ - asm("call " SYMBOL(allocArray) "@PLT\n\t"\ + asm("call " FUNCTION(allocArray) "\n\t"\ "addl $12,%esp"); #else # define ALLOC_ARRAY(TYPE, LEN) \ asm("pushl " #LEN "\n\t"\ "pushl " TYPE "\n\t"\ - "call " SYMBOL(ArrayAlloc) "@PLT\n\t"\ + "call " FUNCTION(ArrayAlloc) "\n\t"\ "addl $8,%esp"); #endif diff -aruN shujit-0.7.14/compile.c shujit/compile.c --- shujit-0.7.14/compile.c 2003-01-06 20:15:21.000000000 +0900 +++ shujit/compile.c 2005-06-22 18:32:02.000000000 +0900 @@ -2,7 +2,7 @@ This file is part of shuJIT, Just In Time compiler for Sun Java Virtual Machine. - Copyright (C) 1998,1999,2000,2001,2002,2003 Kazuyuki Shudo + Copyright (C) 1998,1999,2000,2001,2002,2003,2004,2005 Kazuyuki Shudo This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -26,7 +26,12 @@ #if defined(__FreeBSD__) || defined(__NetBSD__) # include // for a type u_long #endif -#include // for ntohl(), htonl() +#include // for INT_MAX +#ifdef _WIN32 +# include +#else +# include // for ntohl() +#endif #include "compiler.h" #include "constants.h" @@ -40,6 +45,13 @@ #include +#ifdef _WIN32 +# include +// undefine the ntohl macro defined by JDK +# ifdef ntohl +# undef ntohl +# endif +#endif // @@ -92,7 +104,7 @@ // needless to compile #ifdef COMPILE_DEBUG if (compile_debug) { - printf(" needless to compile: %s#%s\n", + printf(" needless to compile: %s#%s %s\n", cbName(fieldclass(&mb->fb)), mb->fb.name, mb->fb.signature); fflush(stdout); } @@ -383,7 +395,8 @@ FILE *codefp; char funcname[256]; char fname[256]; - unsigned char *p; + char *p; + unsigned char *u; int i; snprintf(funcname, 256, "%s_%s%s", @@ -406,15 +419,19 @@ perror("fopen"); goto code_open_failed; } +#if defined(_WIN32) || ((defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(__ELF__)) + fprintf(codefp, ".globl _%s\n", funcname); +#else fprintf(codefp, ".globl %s\n", funcname); +#endif #ifdef linux fprintf(codefp, ".align 16,0x90\n"); #endif fprintf(codefp, "%s:", funcname); fprintf(codefp, ".byte "); - p = (unsigned char *)mb->CompiledCode; - fprintf(codefp, "%d", p[0]); - for (i = 1; i < info->code_size; i++) fprintf(codefp, ",%d", p[i]); + u = (unsigned char *)mb->CompiledCode; + fprintf(codefp, "%d", u[0]); + for (i = 1; i < info->code_size; i++) fprintf(codefp, ",%d", u[i]); fprintf(codefp, "\n"); fclose(codefp); @@ -530,12 +547,10 @@ #ifndef USE_SSE2 if (((mb->fb.access & ACC_STRICT) && !OPT_SETQ(OPT_IGNSTRICTFP)) || OPT_SETQ(OPT_FRCSTRICTFP)) { -# ifndef FORCE_DOUBLE_PRECISION if (!is_fpupc_double) { processAnOpcode(cc, opc_fppc_save, -1); processAnOpcode(cc, opc_fppc_double, -1); } -# endif // !FORCE_DOUBLE_PRECISION processAnOpcode(cc, opc_strict_enter, -1); } @@ -1219,11 +1234,9 @@ #ifndef USE_SSE2 if (((mb->fb.access & ACC_STRICT) && !OPT_SETQ(OPT_IGNSTRICTFP)) || OPT_SETQ(OPT_FRCSTRICTFP)) { -# ifndef FORCE_DOUBLE_PRECISION if (!is_fpupc_double) { processAnOpcode(cc, opc_fppc_restore, INT_MAX); } -# endif // ! FORCE_DOUBLE_PRECISION processAnOpcode(cc, opc_strict_exit, INT_MAX); } @@ -1860,8 +1873,8 @@ case opc_tableswitch: { int32_t *argp = (int32_t *)ALIGNUP32(bytepc + 1); - int32_t l = (int32_t)ntohl((unsigned long)argp[1]); - int32_t h = (int32_t)ntohl((unsigned long)argp[2]); + int32_t l = (int32_t)ntohl((uint32_t)argp[1]); + int32_t h = (int32_t)ntohl((uint32_t)argp[2]); argp += 3 + (h - l + 1); byteinc = ((unsigned char *)argp) - bytepc; @@ -1870,7 +1883,7 @@ case opc_lookupswitch: { int32_t *argp = (int32_t *)ALIGNUP32(bytepc + 1); - int32_t npairs = (int32_t)ntohl((unsigned long)argp[1]); + int32_t npairs = (int32_t)ntohl((uint32_t)argp[1]); argp += 2 + (npairs * 2); byteinc = ((unsigned char *)argp) - bytepc; @@ -1965,6 +1978,7 @@ entry->byteoff, -1/* state */, -1/* native off */); i++; exc_check_done: + {} #endif // EXC_CHECK_IN_LOOP } } @@ -1981,9 +1995,9 @@ } else if (opcode == opc_tableswitch) { // tableswitch int32_t *argp = (int32_t *)ALIGNUP32(bytepc + 1); - int32_t defoff = (int32_t)ntohl((unsigned long)argp[0]); - int32_t l = (int32_t)ntohl((unsigned long)argp[1]); - int32_t h = (int32_t)ntohl((unsigned long)argp[2]); + int32_t defoff = (int32_t)ntohl((uint32_t)argp[0]); + int32_t l = (int32_t)ntohl((uint32_t)argp[1]); + int32_t h = (int32_t)ntohl((uint32_t)argp[2]); #ifdef COMPILE_DEBUG if (compile_debug) { printf(" tableswitch at 0x%x(%d):\n", entry->byteoff, entry->byteoff); @@ -2004,7 +2018,7 @@ argp += 3; // skip default, low, and high for (j = 0; j < (h - l + 1); j++) { - int32_t off = (int32_t)ntohl((unsigned long)argp[j]); + int32_t off = (int32_t)ntohl((uint32_t)argp[j]); loopp = (off < 0) ? TRUE : FALSE; off += entry->byteoff; #ifdef COMPILE_DEBUG @@ -2024,8 +2038,8 @@ } else if (opcode == opc_lookupswitch) { // lookupswitch int32_t *argp = (int32_t *)ALIGNUP32(bytepc + 1); - int32_t defoff = (int32_t)ntohl((unsigned long)argp[0]); - int32_t npairs = (int32_t)ntohl((unsigned long)argp[1]); + int32_t defoff = (int32_t)ntohl((uint32_t)argp[0]); + int32_t npairs = (int32_t)ntohl((uint32_t)argp[1]); #ifdef COMPILE_DEBUG if (compile_debug) { printf(" lookupswitch at 0x%x(%d):\n", entry->byteoff, entry->byteoff); @@ -2046,7 +2060,7 @@ argp += 2; // skip default and npairs for (j = 0; j < npairs; j++) { - int32_t off = ntohl((unsigned long)argp[1]); + int32_t off = (int32_t)ntohl((uint32_t)argp[1]); loopp = (off < 0) ? TRUE : FALSE; off += entry->byteoff; #ifdef COMPILE_DEBUG @@ -2810,8 +2824,8 @@ case opc_tableswitch: { int32_t *argp = (int32_t *)ALIGNUP32(bytepc + 1); - int32_t l = (int32_t)ntohl((unsigned long)argp[1]); - int32_t h = (int32_t)ntohl((unsigned long)argp[2]); + int32_t l = (int32_t)ntohl((uint32_t)argp[1]); + int32_t h = (int32_t)ntohl((uint32_t)argp[2]); #ifdef COMPILE_DEBUG if (compile_debug) { printf(" low: %d, high: %d\n", l, h); fflush(stdout); @@ -2825,7 +2839,7 @@ case opc_lookupswitch: { int32_t *argp = (int32_t *)ALIGNUP32(bytepc + 1); - int32_t npairs = (int32_t)ntohl((unsigned long)argp[1]); + int32_t npairs = (int32_t)ntohl((uint32_t)argp[1]); #ifdef COMPILE_DEBUG if (compile_debug) { printf(" npairs: %d\n", npairs); fflush(stdout); @@ -3451,9 +3465,9 @@ CodeTable *codep; int32_t *argp = (int32_t *)ALIGNUP32(cc->mb->code + byteoff + 1); - int32_t defoff = (int32_t)ntohl((unsigned long)argp[0]); - int32_t l = (int32_t)ntohl((unsigned long)argp[1]); - int32_t h = (int32_t)ntohl((unsigned long)argp[2]); + int32_t defoff = (int32_t)ntohl((uint32_t)argp[0]); + int32_t l = (int32_t)ntohl((uint32_t)argp[1]); + int32_t h = (int32_t)ntohl((uint32_t)argp[2]); int32_t *tblp; int last_state = code_table[opcode][state].last_state; int i; @@ -3497,7 +3511,7 @@ argp += 3; // skit default, low, and high for (i = 0; i < (h - l + 1); i++) { - int32_t off = (int32_t)ntohl((unsigned long)argp[i]); + int32_t off = (int32_t)ntohl((uint32_t)argp[i]); tgttable = pctableGetByPC(cc, byteoff + off); sysAssert(tgttable != NULL); tblp[0] = tgttable->nativeoff; @@ -3526,8 +3540,8 @@ CodeTable *codep; int32_t *argp = (int32_t *)ALIGNUP32(cc->mb->code + byteoff + 1); - int32_t defoff = (int32_t)ntohl((unsigned long)argp[0]); - int32_t npairs = (int32_t)ntohl((unsigned long)argp[1]); + int32_t defoff = (int32_t)ntohl((uint32_t)argp[0]); + int32_t npairs = (int32_t)ntohl((uint32_t)argp[1]); int32_t *tblp; int last_state = code_table[opcode][state].last_state; @@ -3557,8 +3571,8 @@ // (int32_t)match and (int32_t)jump offset while (npairs-- > 0) { - int32_t match = (int32_t)ntohl((unsigned long)argp[0]); - int32_t off = (int32_t)ntohl((unsigned long)argp[1]); + int32_t match = (int32_t)ntohl((uint32_t)argp[0]); + int32_t off = (int32_t)ntohl((uint32_t)argp[1]); tblp[0] = match; tgttable = pctableGetByPC(cc, byteoff + off); @@ -3695,8 +3709,8 @@ case opc_tableswitch: { int32_t *argp = (int32_t *)ALIGNUP32(bytepc + 1); - int32_t l = (int32_t)ntohl((unsigned long)argp[1]); - int32_t h = (int32_t)ntohl((unsigned long)argp[2]); + int32_t l = (int32_t)ntohl((uint32_t)argp[1]); + int32_t h = (int32_t)ntohl((uint32_t)argp[2]); int32_t *tblp = (int32_t *)(mb->CompiledCode + entry->operand); @@ -3712,7 +3726,7 @@ case opc_lookupswitch: { int32_t *argp = (int32_t *)ALIGNUP32(bytepc + 1); - int32_t npairs = (int32_t)ntohl((unsigned long)argp[1]); + int32_t npairs = (int32_t)ntohl((uint32_t)argp[1]); int32_t *tblp = (int32_t *)(mb->CompiledCode + entry->operand); @@ -4184,8 +4198,8 @@ funcp = func_table[opcode][state]; while (funcp->offset >= 0) { - char *argoff; - char *funcptr; + unsigned char *argoff; + unsigned char *funcptr; int32_t arg; funcptr = funcp->address; diff -aruN shujit-0.7.14/compiler.c shujit/compiler.c --- shujit-0.7.14/compiler.c 2002-08-14 19:39:55.000000000 +0900 +++ shujit/compiler.c 2004-10-06 22:04:38.000000000 +0900 @@ -2,7 +2,7 @@ This file is part of shuJIT, Just In Time compiler for Sun Java Virtual Machine. - Copyright (C) 1998,1999,2000,2001,2002 Kazuyuki Shudo + Copyright (C) 1998,1999,2000,2001,2002,2003,2004 Kazuyuki Shudo This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -96,6 +96,8 @@ {"cmplclinit", OPT_CMPLCLINIT}, {"ignstrictfp", OPT_IGNSTRICTFP}, {"frcstrictfp", OPT_FRCSTRICTFP}, + {"fpsingle", OPT_FPSINGLE}, + {"fpextended", OPT_FPEXTENDED}, #ifdef HAVE_POSIX_SCHED {"sched_fifo", OPT_SCHED_FIFO}, {"sched_rr", OPT_SCHED_RR}, @@ -371,15 +373,19 @@ } -#ifdef FORCE_DOUBLE_PRECISION - // set rounding precision as double + // set rounding precision { unsigned short cw; asm("fnstcw %0" : "=m"(cw)); - cw = (cw & ~0x0300) | 0x0200; + cw &= ~0x0300; + + if (OPT_SETQ(OPT_FPEXTENDED)) + cw |= 0x0300; + else if (!OPT_SETQ(OPT_FPSINGLE)) + cw |= 0x0200; + asm("fldcw %0" : : "m"(cw)); } -#endif // FORCE_DOUBLE_PRECISION // prohibit generating lossy opcodes @@ -546,9 +552,17 @@ examineSigcontextNestCount; # endif - asm(".globl exam_nest\n\t" + asm(".globl " SYMBOL(exam_nest) "\n\t" "int $3\n\t" - "exam_nest:"); + SYMBOL(exam_nest) ":" +# if JDK_VER < 12 + : : "m" (*(char **)vector[3]) +# else + : : "m" (*((JITInterface6 *)jitinterface)->p_CompiledCodeSignalHandler) +# endif + // prevent elimination of the above assignment of the signal handler + // gcc 3.4.2 eliminate it if there is no reference to the pointer + ); # if JDK_VER < 12 *(char **)vector[3] = NULL; diff -aruN shujit-0.7.14/compiler.h shujit/compiler.h --- shujit-0.7.14/compiler.h 2003-01-06 19:15:11.000000000 +0900 +++ shujit/compiler.h 2005-08-08 22:33:19.000000000 +0900 @@ -2,7 +2,7 @@ This file is part of shuJIT, Just In Time compiler for Sun Java Virtual Machine. - Copyright (C) 1996,1997,1998,1999,2000,2001,2002 Kazuyuki Shudo + Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003 Kazuyuki Shudo This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,7 @@ #define _COMPILER_H_ -#define VERSION "0.7.14" +#define VERSION "0.8.0" #include "config.h" @@ -60,7 +60,7 @@ // Additional type definition -#if !(defined(_ILP32) || defined(_LP64) || defined(_SYS_INTTYPES_H_) /* for FreeBSD */) +#if !(defined(_ILP32) || defined(_LP64) || defined(_STDINT_H) || defined(_SYS_INTTYPES_H_) /* for FreeBSD */) # ifndef _UINT16_T # define _UINT16_T typedef unsigned short uint16_t; @@ -111,7 +111,6 @@ #define SPECIAL_INLINING #define DIRECT_INV_NATIVE #define ALIGN_JUMP_TARGET -#define FORCE_DOUBLE_PRECISION #define OMIT_SCALING_SINGLE_PRECISION // ignore invocation of java.lang.Compiler#disable() #undef IGNORE_DISABLE @@ -125,6 +124,18 @@ #undef COUNT_TSC +#ifdef _WIN32 +# undef PATCH_WITH_SIGTRAP +# define PATCH_ON_JUMP + +# undef GET_SIGCONTEXT +# undef NULLEXC_BY_SIGNAL +# undef ARITHEXC_BY_SIGNAL + +# undef ALIGN_JUMP_TARGET +#endif + + #define LAZY_COMPILATION_THRESHOLD_FOR_SYS 10 #define LAZY_COMPILATION_THRESHOLD_FOR_USER 1 @@ -253,6 +264,10 @@ # ifndef HAVE_GREENTHR_HEADER # define NATIVE // for Linux/JDK 1.1.8v1 # endif +# ifdef _WIN32 +# define _JAVASOFT_WIN32_TIMEVAL_H_ // avoid redefinition of timercmp() +# define _JAVASOFT_WIN32_IO_MD_H_ // avoid redefinition of S_IS*() +# endif # include "sys_api.h" # undef NATIVE #else @@ -330,7 +345,12 @@ # define COMPILER_VERSION 6 #endif // JDK_VER -#define CODESIZE_FNAME "jit_codesize" +#ifdef XBOX +# define CODESIZE_FNAME "Z:\\tmp\\jit_codesize" +#else +# define CODESIZE_FNAME "jit_codesize" +#endif + // STR(macro) is permuted to "value of the macro" #define _STR(T) #T @@ -338,8 +358,26 @@ #if (defined(__FreeBSD__) || defined(__NetBSD__)) && !defined(__ELF__) # define SYMBOL(SYM) "_" STR(SYM) +# define FUNCTION(SYM) SYMBOL(SYM) "@PLT" +#elif defined(_WIN32) +# define SYMBOL(SYM) "_" STR(SYM) +# define FUNCTION(SYM) SYMBOL(SYM) #else # define SYMBOL(SYM) STR(SYM) +# define FUNCTION(SYM) SYMBOL(SYM) "@PLT" +#endif + + +#ifdef _WIN32 +# define CAST_INT8_TO_INT32(REG) asm("shll $24," #REG "\n\tsarl $24," #REG); +# define CAST_UINT8_TO_INT32(REG) asm("andl $0xff," #REG); +# define CAST_INT16_TO_INT32(REG) asm("shll $16," #REG "\n\tsarl $16," #REG); +# define CAST_UINT16_TO_INT32(REG) asm("andl $0xffff," #REG); +#else +# define CAST_INT8_TO_INT32(REG) +# define CAST_UINT8_TO_INT32(REG) +# define CAST_INT16_TO_INT32(REG) +# define CAST_UINT16_TO_INT32(REG) #endif @@ -573,6 +611,10 @@ // ignore `strictfp' method modifier OPT_FRCSTRICTFP, // force `strictfp' semantics on every method + OPT_FPSINGLE, + // set rounding precision of FP arithmetics as `single precision' + OPT_FPEXTENDED, + // set rounding precision of FP arithmetics as `extended precision' #ifdef HAVE_POSIX_SCHED OPT_SCHED_FIFO, // choose first in-first out scheduler diff -aruN shujit-0.7.14/config.h.in shujit/config.h.in --- shujit-0.7.14/config.h.in 2002-03-13 07:15:48.000000000 +0900 +++ shujit/config.h.in 2003-06-01 23:41:56.000000000 +0900 @@ -32,6 +32,9 @@ // whether POSIX.1b Scheduler Interface is supported #undef HAVE_POSIX_SCHED +// defined if compiled for Xbox game console +#undef XBOX + // defined if the code DB function is enabled #undef CODE_DB // defined if DB library for code DB is gdbm diff -aruN shujit-0.7.14/configure shujit/configure --- shujit-0.7.14/configure 2002-07-17 17:51:24.000000000 +0900 +++ shujit/configure 2003-06-15 00:24:59.000000000 +0900 @@ -1,43 +1,310 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.53. # +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -# Defaults: -ac_help= +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + + +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# NLS nuisances. +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + +# Name of the executable. +as_me=`(basename "$0") 2>/dev/null || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --disable-codedb disable code DB " -ac_help="$ac_help - --enable-sse2 - use SSE2 instructions instead of x87 " -ac_help="$ac_help - --enable-moba - support thread migration " -ac_help="$ac_help - --enable-metavm-no-array - enable MetaVM and arrays are passed by value " -ac_help="$ac_help - --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 " +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="compiler.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -46,10 +313,15 @@ silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -63,17 +335,9 @@ infodir='${prefix}/info' mandir='${prefix}/man' -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - ac_prev= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" @@ -81,59 +345,59 @@ continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) - datadir="$ac_optarg" ;; + datadir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -142,95 +406,47 @@ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; -host | --host | --hos | --ho) - ac_prev=host ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; + libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ @@ -239,19 +455,19 @@ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -265,26 +481,26 @@ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; + program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; + program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -301,7 +517,7 @@ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -311,7 +527,7 @@ ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -322,58 +538,57 @@ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "with_${ac_package}='$ac_optarg'" ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -384,99 +599,110 @@ ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; + x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -exec 5>./config.log -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac done -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=compiler.c # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. @@ -486,13 +712,384 @@ fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-xbox compile for Xbox with Cygwin (static link) + --disable-codedb disable code DB + --enable-sse2 use SSE2 instructions instead of x87 + --enable-moba support thread migration + --enable-metavm-no-array + enable MetaVM and arrays are passed by value + --enable-metavm enable MetaVM + --enable-c-interpreter the JDK uses C version of interpreter + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-jdk path where JDK installed to + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory +