From: Godmar Back (gback@cs.utah.edu)
Date: Thu Dec 10 1998 - 18:49:24 EST
Just to give you an impression what the fixes for jit/ are.
The fixes to code-analyse.c are equally nobrainers, and I've now gotten
rid of the verifier lock! Also, I believe the run-time impact should be
really small.
Here's other changes I'll check in:
* kaffe/kaffevm/intrp/machine.c: fix handling of synchronized
methods so that locks are unlocked when exception is thrown.
* kaffe/kaffevm/locks.c, kaffe/kaffevm/systems/unix-jthreads/jthread.c:
improved debugging.
* kaffe/kaffevm/jni.c: use exitThread instead of stopThread
* kaffe/kaffevm/thread.c: fixes for stopThread. Use JNI to invoke
uncaughtException.
* libraries/clib/native/Thread.c: added null pointer check to stop.
* libraries/javalib/java/lang/ThreadGroup.java: fixed uncaughtException
* libraries/javalib/java/lang/ClassLoader.java,
kaffe/kaffevm/classMethod.c: removed ClassLoader.loadClassVM,
fixed loadClass to use JNI, handle errors and handle thread dying
in loadClass.
* kaffe/kaffevm/soft.c: fixed long remainder prob for FreeBSD.
* kaffe/test/regression/TestScript: adapted to handle deprecated and
sorted tests. New tests for all the bug fixes:
CLTestConc.java, CLTestConc_run.java, LostFrame.java, TestUnlock.java,
UncaughtException.java
- Godmar
cvs server: Diffing .
Index: labels.c
===================================================================
RCS file: /home/cvspublic/kaffe/kaffe/kaffevm/jit/labels.c,v
retrieving revision 1.2
diff -u -r1.2 labels.c
--- labels.c 1998/08/26 21:44:18 1.2
+++ labels.c 1998/12/11 00:48:28
@@ -44,7 +44,7 @@
* fragment into the program.
*/
void
-linkLabels(uintp codebase)
+linkLabels(codeinfo *codeInfo, uintp codebase)
{
long dest = 0;
int* place;
Index: labels.h
===================================================================
RCS file: /home/cvspublic/kaffe/kaffe/kaffevm/jit/labels.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 labels.h
--- labels.h 1998/03/31 19:10:54 1.1.1.1
+++ labels.h 1998/12/11 00:48:28
@@ -47,7 +47,8 @@
#define ALLOCLABELNR 1024
-void linkLabels(uintp);
+struct codeinfo;
+void linkLabels(struct codeinfo*, uintp);
label* newLabel(void);
void resetLabels(void);
Index: machine.c
===================================================================
RCS file: /home/cvspublic/kaffe/kaffe/kaffevm/jit/machine.c,v
retrieving revision 1.11
diff -u -r1.11 machine.c
--- machine.c 1998/12/07 07:31:05 1.11
+++ machine.c 1998/12/11 00:48:28
@@ -108,7 +108,7 @@
extern int enable_readonce;
-static void generateInsnSequence(void);
+static void generateInsnSequence(codeinfo* codeInfo);
static void checkCaughtExceptions(Method* meth, int pc);
void endBlock(sequence*);
@@ -178,6 +178,7 @@
bool success = true;
nativeCodeInfo ncode;
+ codeinfo* codeInfo;
int64 tms = 0;
int64 tme;
@@ -235,7 +236,7 @@
len = meth->c.bcode.codelen;
/* Scan the code and determine the basic blocks */
- success = verifyMethod(meth, einfo);
+ success = verifyMethod(meth, &codeInfo, einfo);
if (success == false) {
goto done;
}
@@ -315,18 +316,18 @@
stackno = STACKPOINTER(npc);
}
- generateInsnSequence();
+ generateInsnSequence(codeInfo);
}
finish_function();
assert(maxTemp < MAXTEMPS);
- finishInsnSequence(&ncode);
- installMethodCode(meth, &ncode);
+ finishInsnSequence(codeInfo, &ncode);
+ installMethodCode(codeInfo, meth, &ncode);
done:
- tidyVerifyMethod();
+ tidyVerifyMethod(codeInfo);
DBG(JIT,
dprintf("Translated %s.%s%s (%s) %p\n", meth->class->name->data,
@@ -354,14 +355,14 @@
* Generate the code.
*/
void
-finishInsnSequence(nativeCodeInfo* code)
+finishInsnSequence(codeinfo* codeInfo, nativeCodeInfo* code)
{
uint32 constlen;
nativecode* methblock;
nativecode* codebase;
/* Emit pending instructions */
- generateInsnSequence();
+ generateInsnSequence(codeInfo);
/* Okay, put this into malloc'ed memory */
constlen = nConst * sizeof(union _constpoolval);
@@ -374,7 +375,7 @@
establishConstants(methblock);
/* Link it */
- linkLabels((uintp)codebase);
+ linkLabels(codeInfo, (uintp)codebase);
/* Note info on the compiled code for later installation */
code->mem = methblock;
@@ -387,7 +388,7 @@
* Install the compiled code in the method.
*/
void
-installMethodCode(Method* meth, nativeCodeInfo* code)
+installMethodCode(codeinfo* codeInfo, Method* meth, nativeCodeInfo* code)
{
int i;
jexceptionEntry* e;
@@ -459,7 +460,7 @@
*/
static
void
-generateInsnSequence(void)
+generateInsnSequence(codeinfo* codeInfo)
{
sequence* t;
@@ -472,7 +473,7 @@
}
/* Generate sequences */
- (*(t->func))(t);
+ (*(void (*)(sequence*, codeinfo*))(t->func))(t, codeInfo);
}
/* Reset */
@@ -483,7 +484,7 @@
* Start a new instruction.
*/
void
-startInsn(sequence* s)
+startInsn(sequence* s, codeinfo* codeInfo)
{
SET_INSNPC(const_int(2), CODEPC);
}
Index: machine.h
===================================================================
RCS file: /home/cvspublic/kaffe/kaffe/kaffevm/jit/machine.h,v
retrieving revision 1.6
diff -u -r1.6 machine.h
--- machine.h 1998/12/02 22:58:35 1.6
+++ machine.h 1998/12/11 00:48:28
@@ -110,9 +110,10 @@
int codelen;
} nativeCodeInfo;
+struct codeinfo;
void initInsnSequence(int, int, int);
-void finishInsnSequence(nativeCodeInfo*);
-void installMethodCode(Method*, nativeCodeInfo*);
+void finishInsnSequence(struct codeinfo*, nativeCodeInfo*);
+void installMethodCode(struct codeinfo*, Method*, nativeCodeInfo*);
typedef struct {
bool BADARRAYINDEX;
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:11 EDT