Hi,
as I've written ASAP here's the promised patch!
Please consider: this is a quite _fresh_ piece of
software, perhaps not enough tested.
I am very _interested_ in your _feedback_.
Any kind of success story is very appreciated ;)
I want to say THANK YOU to all users who have informed me
about problems.
Without YOUR feedback this work would not be possible.
(At last: a SORRY to all who have subscribed this list,
but are not interested in TYA.)
Cheers,
Albrecht
diff -u tya1.1/ChangeLog tya1.1v2/ChangeLog
--- tya1.1/ChangeLog Fri Oct 9 21:27:21 1998
+++ tya1.1v2/ChangeLog Thu Oct 15 21:33:20 1998
@@ -1,3 +1,40 @@
+Thu Oct 15 21:23:39 1998 Albrecht Kleine <[EMAIL PROTECTED]>
+ -tyarecode.c
+ fixed athrow bug: more independence of EXCEPTION_BY_SIGNALS
+ by CompTriggerNullPointerException2
+ [tnx bugreport to
+ Kazuyuki Shudo <[EMAIL PROTECTED]>]
+
+ -tyarecode.c
+ -tya.c
+ rejected a patch from #184 (as quick workaround
+ for jdk1.1.6v5)
+ [``different approach for getting signal context'']
+
+Sun Oct 11 17:18:25 1998 Albrecht Kleine <[EMAIL PROTECTED]>
+ -tya.c
+ rewrote method return value recognition in
+ InvokeCompiledMethod_Hook() misusing ACC_DOCED flag:
+ marked ``FIXME'' == subject of change
+
+ file #201 / patch mailed on blackdown list
+-----------------------------------------------------------------
+Sun Oct 11 11:32:25 1998 Albrecht Kleine <[EMAIL PROTECTED]>
+ -tya.c,tyarecode.c
+ changed the conditions for possible method inlining
+
+Sat Oct 10 17:50:04 1998 Ondrej Popp <[EMAIL PROTECTED]>
+Sat Oct 10 17:50:04 1998 Alexander Davydenko <[EMAIL PROTECTED]>
+ -tya.c
+ avoid a incompatible types in assignment
+ compiler error
+
+Sat Oct 10 17:50:04 1998 Albrecht Kleine <[EMAIL PROTECTED]>
+ -tya.c
+ changed my typo from ``long'' to ``long long''
+
+ file #200A
+-----------------------------------------------------------------
Fri Oct 9 20:25:46 1998 Albrecht Kleine <[EMAIL PROTECTED]>
******************************
***** released TYA 1.1 *****
diff -u tya1.1/acconfig.h tya1.1v2/acconfig.h
--- tya1.1/acconfig.h Fri Oct 9 21:27:21 1998
+++ tya1.1v2/acconfig.h Thu Oct 15 22:07:53 1998
@@ -80,4 +80,4 @@
#define EASYEX
#endif
-#define TYAVER "1.1" // release version
+#define TYAVER "1.1v2" // release version
diff -u tya1.1/config.h.in tya1.1v2/config.h.in
--- tya1.1/config.h.in Fri Oct 9 21:27:21 1998
+++ tya1.1v2/config.h.in Thu Oct 15 22:08:10 1998
@@ -79,4 +79,4 @@
#define EASYEX
#endif
-#define TYAVER "1.1" // release version
+#define TYAVER "1.1v2" // release version
Common subdirectories: tya1.1/demo and tya1.1v2/demo
diff -u tya1.1/tya.c tya1.1v2/tya.c
--- tya1.1/tya.c Fri Oct 9 21:27:21 1998
+++ tya1.1v2/tya.c Thu Oct 15 20:56:58 1998
@@ -486,15 +486,20 @@
// invoke.....
if (mb->fb.access & ACC_XXUNUSED3) // pseudo result type 64bit
{
- *(long long *)(&ee->current_frame->optop[0])=((long(*)(void))
mb->CompiledCode)();
+ *(long long *)(&ee->current_frame->optop[0])=((long long(*)(void))
+mb->CompiledCode)();
ee->current_frame->optop+=2;
}
else
{
- ee->current_frame->optop[0]=((int(*)(void)) mb->CompiledCode)();
- ee->current_frame->optop++;
+ if (mb->fb.access & ACC_DOCED) // void result
+ ((void(*)(void))mb->CompiledCode)();
+ else
+ {
+// *(int *) (&ee->current_frame->optop[0])=((int(*)(void))mb->CompiledCode)();
+ ee->current_frame->optop[0].i=((int(*)(void)) mb->CompiledCode)();
+ ee->current_frame->optop++;
+ }
}
-
ee->current_frame->vars=oldvar; // reset to old variable
ee->current_frame->current_method=mbcaller;
#ifdef DEBUG
@@ -580,7 +585,7 @@
#else
struct execenv * ee = EE();
TYA_SIGCONTEXT * context=NULL;
-#if 0
+#if 1
// at all FIXME: unknown uc pointer
#define MAXSEARCH 100
int *ptr=(int*)uc-MAXSEARCH;
@@ -588,7 +593,7 @@
#endif
asm ("pushl %esp");
asm ("popl anOldsp");
-#if 0
+#if 1
//lprintf("TYA: %x\n",oldesp);
// grep for a sigcontext_struct
if ( sig == SIGSEGV || sig == SIGFPE )
@@ -644,7 +649,7 @@
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 ?
@@ -894,7 +899,9 @@
cinfo->ipcnt = 0;
cinfo->backcnt = 0;
cinfo->wide = FALSE;
- cinfo->inlineerr = FALSE;
+ cinfo->inlineerr = mb->exception_table_length!=0;
+ // don't inline if there are catchframes on caller side
+
if (!ProcessExceptionTab(mb ,cinfo))
{
@@ -1190,20 +1197,24 @@
// store a copy of original invoker
klass->methods[i].invoker=MYInvokeCompiledMethod;
-// j=klass->methods[i].fb.signature[
-// strlen(klass->methods[i].fb.signature) -1];
-
+ // some shortcuts for result type: faster but not neccessary
+ // using ACC_DOCED here is a temp. misuse / FIXME FIXME FIXME FIXME
m=0;
while (klass->methods[i].fb.signature[m]!=SIGNATURE_ENDFUNC)
m++;
m++;
j=klass->methods[i].fb.signature[ m ];
- if (j=='D' && j=='J')
+ if (j=='D' || j=='J')
klass->methods[i].fb.access |= ACC_XXUNUSED3; // pseudo result
type 64bit
else
+ {
+ if (j=='V')
+ klass->methods[i].fb.access |= ACC_DOCED; // void result
+ else
+ klass->methods[i].fb.access &= ((short)~ACC_DOCED);
klass->methods[i].fb.access &= ((short)~ACC_XXUNUSED3);
-
+ }
}
dprintf(stderr,"---------------END CompileClass_Hook-----------------------\n");
return 1;
diff -u tya1.1/tyarecode.c tya1.1v2/tyarecode.c
--- tya1.1/tyarecode.c Fri Oct 9 21:27:21 1998
+++ tya1.1v2/tyarecode.c Tue Oct 13 20:03:41 1998
@@ -1389,10 +1389,10 @@
CL(stac - SIS4);
}
}
- }
#ifndef EXCEPTIONS_BY_SIGNALS
CompTriggerNullPointerException(cinfo, EAX);
-#endif
+#endif
+ }
//
// 3A. =================== try to inline ===================
//
@@ -1406,7 +1406,7 @@
// this test is independend EXCEPTIONS_BY_SIGNALS
if (VIRTUAL_INV(code))
CompTriggerNullPointerException2(cinfo,EAX);
-#endif
+#endif
#ifdef INLINING
if (mbp->CompiledCodeInfo == invokeJavaMethod) // no synchron, no
native
if (!cinfo->isinline) // no recursive inlining
@@ -1862,7 +1862,8 @@
break;
case 0xBF: // athrow
- CompTriggerNullPointerException(cinfo,EAX);
+ // this test is independend EXCEPTIONS_BY_SIGNALS
+ CompTriggerNullPointerException2(cinfo,EAX);
CompTriggerAthrowException(cinfo);
dprintf(stderr,"athrow athrow athrow\n");
break;
@@ -1947,7 +1948,7 @@
// If we ever write own monitorEnter/Exit we could pass directly EAX instead of
// stack
case 0xC2:
- CompTriggerNullPointerException(cinfo,EAX);
+ CompTriggerNullPointerException2(cinfo,EAX);
CB(PUSHAX);
CB(MOV_BX);
CL(monitorEnter);
@@ -1957,6 +1958,7 @@
break;
case 0xC3:
+ CompTriggerNullPointerException2(cinfo,EAX);
CB(PUSHAX);
CB(MOV_BX);
CL(monitorExit);
@@ -1993,6 +1995,7 @@
CB(PUSHAX);CB(PUSHBX);CB(PUSHCX);CB(PUSHDX);break;
default:lprintf("TYA: Too much dimensions: %d in opcode %x\n",m,code);
return -1;
+ // no problem: this method should run interpreted
}
//
// calling MultiArrayAlloc(int dimensions, ClassClass *, stack_item *sizes)
diff -u tya1.1/tyaruntime.c tya1.1v2/tyaruntime.c
--- tya1.1/tyaruntime.c Fri Oct 9 21:27:21 1998
+++ tya1.1v2/tyaruntime.c Tue Oct 13 20:48:56 1998
@@ -124,7 +124,9 @@
//
HObject *MyObjAlloc(ClassClass *dcb)
{
- HObject *o=ObjAlloc(dcb,0);
+ HObject *o;
+ dprintf(stderr,"MyObjAlloc %p\n",dcb);
+ o=ObjAlloc(dcb,0);
if (o)
memset(unhand(o),0,unha11(dcb)->instance_size);
return o;