[PATCH] Interpreter fix for Kaffe 0.9.1

Tim Wilkinson tim at tjwassoc.co.uk
Sun Jun 29 06:22:38 PDT 1997


All,

Some bugs "crept" into the interpreter in the latest release.  Find a
fix attached to cure these.

Cheers
Tim
--
  Tim Wilkinson                         Tel/Fax: +44 181 446 1309
  T. J. Wilkinson & Associates,         Mobile:  +44 370 621006
  London, UK.                           Email:   tim at tjwassoc.co.uk
-------------- next part --------------
Index: kaffe/kaffe/kaffevm/Makefile.in
diff -c kaffe/kaffe/kaffevm/Makefile.in:1.1.1.1.2.1.2.2.2.1 kaffe/kaffe/kaffevm/Makefile.in:1.1.1.1.2.1.2.2.2.1.2.1
*** kaffe/kaffe/kaffevm/Makefile.in:1.1.1.1.2.1.2.2.2.1	Thu Jun 12 14:11:46 1997
--- kaffe/kaffe/kaffevm/Makefile.in	Sun Jun 29 14:15:28 1997
***************
*** 90,96 ****
  		rm -f $(LIB) $(LLIB) $(OBJECT) lib.exp
  
  distclean:	clean
! 		rm -f md.c jit.def icode.h
  		rm -f thread-native.h locks-native.h
  		rm -f Makefile
  
--- 90,96 ----
  		rm -f $(LIB) $(LLIB) $(OBJECT) lib.exp
  
  distclean:	clean
! 		rm -f md.c jit.def icode.h trampoline.c
  		rm -f thread-native.h locks-native.h
  		rm -f Makefile
  
Index: kaffe/kaffe/kaffevm/intrp/machine.c
diff -c kaffe/kaffe/kaffevm/intrp/machine.c:1.1.1.1.2.1.4.2 kaffe/kaffe/kaffevm/intrp/machine.c:1.1.1.1.2.1.4.2.2.1
*** kaffe/kaffe/kaffevm/intrp/machine.c:1.1.1.1.2.1.4.2	Thu Jun 26 16:25:07 1997
--- kaffe/kaffe/kaffevm/intrp/machine.c	Sun Jun 29 14:15:30 1997
***************
*** 74,79 ****
--- 74,80 ----
  	Hjava_lang_Object* mobj;
  	vmException mjbuf;
  	accessFlags methaccflags;
+ 	char* str;
  
  	/* If these can be kept in registers then things will go much
  	 * better.
***************
*** 138,144 ****
  		mjbuf.prev = TCTX(currentThread)->exceptPtr;
  		TCTX(currentThread)->exceptPtr = &mjbuf;
  	}
! 	if (meth->exception_table_len > 0 || (methaccflags & ACC_SYNCHRONISED)) {
  		if (setjmp(mjbuf.jbuf) != 0) {
  			assert(TCTX(currentThread)->exceptPtr == &mjbuf);
  			npc = mjbuf.pc;
--- 139,145 ----
  		mjbuf.prev = TCTX(currentThread)->exceptPtr;
  		TCTX(currentThread)->exceptPtr = &mjbuf;
  	}
! 	if (meth->exception_table != 0 || (methaccflags & ACC_SYNCHRONISED)) {
  		if (setjmp(mjbuf.jbuf) != 0) {
  			assert(TCTX(currentThread)->exceptPtr == &mjbuf);
  			npc = mjbuf.pc;
***************
*** 149,155 ****
  	}
  
  	/* Calculate number of arguments */
! 	idx = meth->ins + (methaccflags & ACC_STATIC ? 0 : 1);
  
  DBG(	printf("Call to method %s.%s%s.\n", meth->class->name->data, meth->name->data, meth->signature->data); fflush(stdout); )
  
--- 150,157 ----
  	}
  
  	/* Calculate number of arguments */
! 	str = meth->signature->data;
! 	idx = sizeofSig(&str, false) + (methaccflags & ACC_STATIC ? 0 : 1);
  
  DBG(	printf("Call to method %s.%s%s.\n", meth->class->name->data, meth->name->data, meth->signature->data); fflush(stdout); )
  
***************
*** 175,185 ****
  
  	restart:
  	wide = 0;
! 	code = (bytecode*)meth->code;
  
  	/* Finally we get to actually execute the machine */
  	for (;;) {
! 		assert(npc < meth->codelen);
  		pc = npc;
  		mjbuf.pc = pc;
  		npc = pc + insnLen[code[pc]];
--- 177,187 ----
  
  	restart:
  	wide = 0;
! 	code = (bytecode*)meth->c.bcode.code;
  
  	/* Finally we get to actually execute the machine */
  	for (;;) {
! 		assert(npc < meth->c.bcode.codelen);
  		pc = npc;
  		mjbuf.pc = pc;
  		npc = pc + insnLen[code[pc]];


More information about the kaffe mailing list