Hi,
here's another TYA patch for you.

Now the Netbeans program does startup much better. But consider
you need a lot of mem - that is exactly what someone (Peter Mehlitz?)
wrote here about Swing+JITs (all that stuff) last week.... 
At all I can't say anything about Netbeans, because I am no user - did 
only _click_ ``Here, There And Everywhere'' (**) for TYA testing purpose.

(**) A Beatles song from 1966 ;)

To use this patch at first you need apply the last week patch!!!
This work is _not_ yet available at TYA's ftp site (but should be:
at all a matter of time....)

Cheers,
Albrecht
------------patch starts here-------------------
diff -u tya1.1v2/ChangeLog tya1.1v3/ChangeLog
--- tya1.1v2/ChangeLog  Thu Oct 15 21:33:20 1998
+++ tya1.1v3/ChangeLog  Tue Oct 20 19:27:09 1998
@@ -1,4 +1,17 @@
-Thu Oct 15 21:23:39 1998 Albrecht Kleine  <[EMAIL PROTECTED]>
+Sun Oct 18 21:18:02 1998  Albrecht Kleine  <[EMAIL PROTECTED]>
+       -tyarecode.c
+        Changed conditions for compiling call of FastInvNoCheckXX,
+        this makes Netb startup better; cmp line 2 in build #187
+       -tyarechelp.c
+        fixed NAN conversion bug (temp)
+        [tnx bugreport to
+         Kazuyuki Shudo <[EMAIL PROTECTED]>]
+       -tyaexc.c
+        added MakeClassSticky call for StOvExc-class
+
+       file #202
+-----------------------------------------------------------------
+Thu Oct 15 21:23:39 1998  Albrecht Kleine  <[EMAIL PROTECTED]>
        -tyarecode.c
         fixed athrow bug: more independence of EXCEPTION_BY_SIGNALS 
         by CompTriggerNullPointerException2
diff -u tya1.1v2/README tya1.1v3/README
--- tya1.1v2/README     Fri Oct  9 21:27:21 1998
+++ tya1.1v3/README     Tue Oct 20 19:31:41 1998
@@ -1,4 +1,4 @@
------ The TYA 1.1 Readme written by Albrecht Kleine -----
+----- The TYA 1.1v3 Readme written by Albrecht Kleine -----
 
 0. CONTENTS
 ===========
@@ -51,12 +51,7 @@
 ====================
 
 Important:
- -You need a 586-pc running Linux port of the JDK 1.1.6
-  by Steve Byrne.
-  (Of course it is possible that TYA will run very well 
-   together with older ports by S.Byrne [or ports 
-   by S.Nikitin or somebody else], but it is impossible for me 
-   to care much about.)
+ -You need a 586-pc running Linux port of the JDK 1.1.6.
  -You have to read and understand file COPYRIGHT for legal stuff.
  -Read this file carefully.
 
@@ -66,17 +61,8 @@
 
 Current TYA releases should run most applets and programs 
 out there including swing, beans, browsers, servers etc.
-You'll find a lot of interesting test stuff if you follow 
-the links on the blackdown.org site. Unfortunately I have 
-no time to test them all. So reports are welcome.
 
-TYA 1.1 is the 11th release of this software.
-
-In this release you find the generated code is up to 10% smaller
-and sometimes some percent faster. Once again I've fixed 
-some bugs .... and hopefully did not introduce too much new ;)
-
-For details look into Changelog file. 
+For details (WHAT's NEW) look into Changelog file. 
 
 
 
@@ -324,8 +310,6 @@
 
 Some quick_opcodes are NOT yet implemented, but
 it seems they are not used.
-The wide opcode prefix is not completely handled.
-A bug is reported in running a program called ``netbeans''
 
 Remember: use this software AT YOUR OWN RISK.
 
diff -u tya1.1v2/acconfig.h tya1.1v3/acconfig.h
--- tya1.1v2/acconfig.h Thu Oct 15 22:07:53 1998
+++ tya1.1v3/acconfig.h Tue Oct 20 19:32:02 1998
@@ -80,4 +80,4 @@
  #define EASYEX
 #endif
 
-#define TYAVER "1.1v2" // release version
+#define TYAVER "1.1v3" // release version
diff -u tya1.1v2/config.h.in tya1.1v3/config.h.in
--- tya1.1v2/config.h.in        Thu Oct 15 22:08:10 1998
+++ tya1.1v3/config.h.in        Tue Oct 20 19:32:21 1998
@@ -79,4 +79,4 @@
  #define EASYEX
 #endif
 
-#define TYAVER "1.1v2" // release version
+#define TYAVER "1.1v3" // release version
Common subdirectories: tya1.1v2/demo and tya1.1v3/demo
diff -u tya1.1v2/tya.c tya1.1v3/tya.c
--- tya1.1v2/tya.c      Thu Oct 15 20:56:58 1998
+++ tya1.1v3/tya.c      Mon Oct 19 19:22:17 1998
@@ -1,6 +1,6 @@
 // Copyright (c) 1997,1998 Albrecht Kleine    All rights reserved
 // Copyright (c) 1998 Artur Biesiadowski
-// file version #200
+// file version #202
 
 #include "tyaconfig.h"
 #include <stdio.h>
@@ -574,6 +574,13 @@
 unsigned long  jumpTo asm("aJumpTo");
 #endif EXCEPTIONS_BY_SIGNALS
 
+#define NEWGETCONTEXT
+#define OFF116v5 4     // 0 for 114v4a
+// at all it is impossible to estimate the correct jdk 
+// sub version,  so this is undefined since build #201
+#undef NEWGETCONTEXT   
+
+
 void CompiledCodeSignalHandler_hook(int sig,void *info,void *uc)
 {
 #ifdef EXCEPTIONS_BY_SIGNALS
@@ -585,7 +592,7 @@
 #else   
    struct execenv * ee = EE();
    TYA_SIGCONTEXT * context=NULL;
-#if 1
+#ifndef NEWGETCONTEXT
    // at all FIXME: unknown uc pointer
    #define MAXSEARCH 100
    int *ptr=(int*)uc-MAXSEARCH;
@@ -593,7 +600,7 @@
 #endif   
    asm ("pushl %esp");
    asm ("popl anOldsp");
-#if 1
+#ifndef NEWGETCONTEXT
    //lprintf("TYA: %x\n",oldesp);
    // grep for a sigcontext_struct
    if ( sig == SIGSEGV  ||  sig == SIGFPE )
@@ -608,14 +615,14 @@
             lprintf(msg);panic(msg);
        }
    context=(void*)&ptr[i];
-   lprintf("TYA:CompiledCodeSignalHandler_hook--context at offset =%d  %p 
%p\n",100-i,context,info);
-   lprintf("TYA:context at offset = entry_esp + 
0x%xh\n",(void*)context-(void*)oldesp);      
+//   lprintf("TYA:CompiledCodeSignalHandler_hook--context at offset =%d  %p 
+%p\n",100-i,context,info);
+//   lprintf("TYA:context at offset = entry_esp + 
+0x%xh\n",(void*)context-(void*)oldesp);      
     
 //   {  int z; for (z=0;z<50;z++)
   //    lprintf("context %p %d.  %x\n",&((int*)oldesp)[z],z,((int*)oldesp)[z]);}   
    }
 #else
-   context=(TYA_SIGCONTEXT *)(oldesp+64);
+   context=(TYA_SIGCONTEXT *)(oldesp+64 + OFF116v5);
    lprintf("TYA:CompiledCodeSignalHandler_hook--context at %p \n",context);
    if (!(context->gs==USER_DS && context->fs==USER_DS && 
          context->ds==USER_DS && context->ds==USER_DS))
@@ -640,7 +647,7 @@
         lprintf("TYA: Signal %d, returning to default handler;\n",sig);
         return;
      }
-   lprintf("Signal caught by TYA: hook for %d\n",sig);
+   lprintf("TYA:Signal %d in %s\n",sig,ee->current_frame->current_method->fb.name);
 #ifdef DEBUG
    dumpSigcontext(context);
    dprintf(stderr, "info = %8.8lX\n", (unsigned long) info);
@@ -649,10 +656,8 @@
    dprintf(stderr, "current_method =%p\n",ee->current_frame->current_method);
    dprintf(stderr, "CompiledCode = %p\n",startOfCode);
 #endif
-   fprintf(stderr, "current_method =%s\n",ee->current_frame->current_method->fb.name);
  // all this global variables could be locals, but how can I reference locals
  // in AT&T asm ?
-
 
    // registers at the moment of exception
    oldeip=context->eip;
diff -u tya1.1v2/tyaexc.c tya1.1v3/tyaexc.c
--- tya1.1v2/tyaexc.c   Fri Oct  9 21:27:21 1998
+++ tya1.1v3/tyaexc.c   Mon Oct 19 19:22:05 1998
@@ -1,5 +1,5 @@
 // Copyright (c) 1997,1998 Albrecht Kleine    All rights reserved
-// file version #200
+// file version #202
 
 #include "tyaconfig.h"
 #include <stdio.h>
@@ -538,8 +538,8 @@
          
 void PrepareExceptions()
 {
- StOvExc = execute_java_constructor(NULL,(char*)jlStackOvErr,NULL,(char*)jlVoidSig,0);
- // FIXME make sticky?
+  StOvExc = 
+execute_java_constructor(NULL,(char*)jlStackOvErr,NULL,(char*)jlVoidSig,0);
+  MakeClassSticky(obj_classblock(StOvExc));
 }
 
 #if 0
diff -u tya1.1v2/tyarechelp.c tya1.1v3/tyarechelp.c
--- tya1.1v2/tyarechelp.c       Fri Oct  9 21:27:21 1998
+++ tya1.1v3/tyarechelp.c       Sun Oct 18 21:16:26 1998
@@ -87,47 +87,135 @@
 // for truncate
 // uses a helper place for temporary storing the x87-control-word
 // (compute 1000.89 to 1000 ,  not 1001)
-// FIXME: avoid FLDCW_MBP coding
+// FIXME: avoid slow FLDCW_MBP coding
+// FIXME: should use own NPU stack in general
 //
 void Comp87ToInteger(unsigned char code,struct CINFO* cinfo)
 {
-   CB(PUSHAX);
-   CW(FSTCW_MBP);
-   CB(LOCSTART-4 );
-   CW(MOV_AX_MBP_8);
-   CB(LOCSTART-4);
-   CW(OR_MBP_8_BYTE);
-   CB(LOCSTART-4 +1);
-   CB(0xC);
-   CW(FLDCW_MBP);
-   CB(LOCSTART-4);
-   // FYI: do not use eax inside switch{ }
    switch (code)
      {
       case 0x8b:       // f2i
-       CW(FLDW_MSP);CB(SP_ADDR_BYTE3); // fld dword [esp]
-       CW(FISTP_MSP);CB(SP_ADDR_BYTE3);// put Int32 result on stack
+       CW(MOV_BXAX);
+       CB(AND_AX_LONG);
+       CL(0x7FC00000);
+       CB(CMP_AX);
+       CL(0x7FC00000);                 // FIXME perhaps easier recognition of nan
+       CB(JNE);
+       CB(4);
+       CW(XOR_AXAX);
+       CB(JMPS);
+       CB(14+6+7);                     // jmp nan_label
+       
+       CB(PUSHBX);                     // 1
+       CW(FSTCW_MBP);                  // 3
+       CB(LOCSTART-4 );                // 4
+       CW(MOV_AX_MBP_8);               // 6
+       CB(LOCSTART-4);                 // 7
+       CW(OR_MBP_8_BYTE);              // 9
+       CB(LOCSTART-4 +1);              // 10
+       CB(0xC);                        // 11
+       CW(FLDCW_MBP);                  // 13
+       CB(LOCSTART-4);                 // 14
+       
+       CW(FLDW_MSP);CB(SP_ADDR_BYTE3); // 17   fld dword [esp]
+       CW(FISTP_MSP);CB(SP_ADDR_BYTE3);// 20   put Int32 result on stack
        break;
       case 0x8c:       // f2l
+       CW(MOV_BXAX);
+       CB(AND_AX_LONG);
+       CL(0x7FC00000);
+       CB(CMP_AX);
+       CL(0x7FC00000);                 // nan check FIXME
+       CB(JNE);
+       CB(5);
+       CW(XOR_AXAX);
+       CB(PUSHAX);
+       CB(JMPS);
+       CB(14+6+1+7);                   // jmp nan_label
+       
+       CB(PUSHBX);                     // 1
+       CW(FSTCW_MBP);                  // 3
+       CB(LOCSTART-4 );                // 4
+       CW(MOV_AX_MBP_8);               // 6
+       CB(LOCSTART-4);                 // 7
+       CW(OR_MBP_8_BYTE);              // 9
+       CB(LOCSTART-4 +1);              // 10
+       CB(0xC);                        // 11
+       CW(FLDCW_MBP);                  // 13
+       CB(LOCSTART-4);                 // 14
+
        CW(FLDW_MSP);CB(SP_ADDR_BYTE3); 
        CB(PUSHBX);                     // get 32bit space on stack
        CW(FISTPQ_MSP);CB(SP_ADDR_BYTE3);       
        break;
       case 0x8e:       // d2i
+       CW(MOV_BXAX);
+       CB(POPAX);
+       CB(PUSHAX);
+       CB(AND_AX_LONG);
+       CL(0x7FF80000);
+       CB(CMP_AX);
+       CL(0x7FF80000);                 // nan check FIXME
+       CB(JNE);
+       CB(4);
+       CW(XOR_AXAX);
+       CB(JMPS);
+       CB(14+6+1+7);                   // jmp nan_label
+       
+       CB(PUSHBX);                     // 1
+       
+       CW(FSTCW_MBP);                  // 3
+       CB(LOCSTART-4 );                // 4
+       CW(MOV_AX_MBP_8);               // 6
+       CB(LOCSTART-4);                 // 7
+       CW(OR_MBP_8_BYTE);              // 9
+       CB(LOCSTART-4 +1);              // 10
+       CB(0xC);                        // 11
+       CW(FLDCW_MBP);                  // 13
+       CB(LOCSTART-4);                 // 14
+
        CW(FLDQW_MSP);CB(SP_ADDR_BYTE3);        
        CB(POPBX);
        CW(FISTP_MSP);CB(SP_ADDR_BYTE3);
        break;
       case 0x8f:       // d2l
-       CW(FLDQW_MSP);CB(SP_ADDR_BYTE3);        
-       CW(FISTPQ_MSP);CB(SP_ADDR_BYTE3);
+       CW(MOV_BXAX);
+       CB(POPAX);
+       CB(PUSHAX);
+       CB(AND_AX_LONG);
+       CL(0x7FF80000);
+       CB(CMP_AX);
+       CL(0x7FF80000);                 // nan check FIXME
+
+       CB(JNE);
+       CB(5);
+       CW(XOR_AXAX);
+       CB(PUSHAX);
+       CB(JMPS);
+       CB(14+6+7);                     // jmp nan_label
+
+       CB(PUSHBX);                     // 1
+       
+       CW(FSTCW_MBP);                  // 3
+       CB(LOCSTART-4 );                // 4
+       CW(MOV_AX_MBP_8);               // 6
+       CB(LOCSTART-4);                 // 7
+       CW(OR_MBP_8_BYTE);              // 9
+       CB(LOCSTART-4 +1);              // 10
+       CB(0xC);                        // 11
+       CW(FLDCW_MBP);                  // 13
+       CB(LOCSTART-4);                 // 14
+       
+       CW(FLDQW_MSP);CB(SP_ADDR_BYTE3);
+       CW(FISTPQ_MSP);CB(SP_ADDR_BYTE3);// 6
        break;
      }
-   CW(MOV_MBP_8_AX);
-   CB(LOCSTART-4);
-   CW(FLDCW_MBP);
-   CB(LOCSTART-4);
-   CB(POPAX);
+   CW(MOV_MBP_8_AX);   //2
+   CB(LOCSTART-4);     //3
+   CW(FLDCW_MBP);      //5
+   CB(LOCSTART-4);     //6
+   CB(POPAX);          //7
+   // nan_label:
 }
 
 //-------------------------- local variables ---------------------------------
diff -u tya1.1v2/tyarecode.c tya1.1v3/tyarecode.c
--- tya1.1v2/tyarecode.c        Tue Oct 13 20:03:41 1998
+++ tya1.1v3/tyarecode.c        Mon Oct 19 19:20:26 1998
@@ -1,6 +1,6 @@
 // Copyright (c) 1997,1998 Albrecht Kleine    All rights reserved
 // Copyright (c) 1998 Artur Biesiadowski
-// file version #200
+// file version #202
 
 #include "tyaconfig.h"
 #include <stdio.h>
@@ -51,7 +51,6 @@
    iprintf("--------- OPCODE=%02x ",code);
    decode_bytecode(cinfo->bptr+j-1);
    iprintf(" %p ---------\n",cinfo->cptr);
-
 #endif   
    // did not use any #defines like "#define NOP 0" etc,
    // because it's important for you to get a feeling 
@@ -1208,8 +1207,7 @@
          
          if ( fbp->access & ACC_FINAL  && strcmp("<clinit>", cinfo->mb->fb.name))
          {
-//      printf("Final static %s:%s\n", unhand(fbp->clazz)->name, fbp->name );
-//         fflush(stdout);
+               dprintf(stderr,"Final static %s:%s\n", unhand(fbp->clazz)->name, 
+fbp->name );
                if (*fbp->signature==SIGNATURE_DOUBLE || 
*fbp->signature==SIGNATURE_LONG)
                  {                      
                         CB(PUSHLONG);
@@ -1653,7 +1651,7 @@
        //         
          /* important: FastInvCheck has to preserve ebx !*/
          CB(MOV_CX);
-         if ( compileLOCALspace!=-1 && (mbp->CompiledCode || mbp==cinfo->mb) )
+         if ( compileLOCALspace!=-1 && mbp->CompiledCode )
          {
           if (etype ==SIGNATURE_LONG || etype ==SIGNATURE_DOUBLE)           
             CL(FastInvNoCheck64);

Reply via email to