IOT Trap bugfix

Tim Wilkinson tim at tjwassoc.demon.co.uk
Thu Mar 6 11:35:47 PST 1997


Dave,

The problem is caused by incorrect analysis of GET/PUT-FIELD/STATIC.
New fix included.

Tim
--
  Tim Wilkinson                         Tel/Fax: +44 181 440 0658
  T. J. Wilkinson & Associates,         Mobile:  +44 370 621006
  London, UK.                           Email:   tim at tjwassoc.demon.co.uk
-------------- next part --------------
--- versions/kaffe-0.8.2/kaffe/kaffevm/jit/code-analyse.c	Mon Mar  3 14:04:51 1997
+++ kaffe-0.8.3/kaffe/kaffevm/jit/code-analyse.c	Thu Mar  6 19:31:52 1997
@@ -1224,7 +1224,11 @@
 
 			case GETSTATIC:
 				field = getField(lclw, true, meth, &class);
-				switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
+				if (FIELD_ISREF(field)) {
+					STKPUSH(1);
+					STACKOUT(1, TOBJ);
+				}
+				else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))){
 				case 'I':
 				case 'Z':
 				case 'S':
@@ -1248,9 +1252,7 @@
 					STACKOUT(1, TVOID);
 					break;
 				default:
-					assert(FIELD_ISREF(field));
-					STKPUSH(1);
-					STACKOUT(1, TOBJ);
+					abort();
 					break;
 				}
 				INCPC(3);
@@ -1258,7 +1260,11 @@
 
 			case PUTSTATIC:
 				field = getField(lclw, true, meth, &class);
-				switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
+				if (FIELD_ISREF(field)) {
+					STACKIN(0, TOBJ);
+					STKPOP(1);
+				}
+				else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))){
 				case 'I':
 				case 'Z':
 				case 'S':
@@ -1282,9 +1288,7 @@
 					STKPOP(2);
 					break;
 				default:
-					assert(FIELD_ISREF(field));
-					STACKIN(0, TOBJ);
-					STKPOP(1);
+					abort();
 					break;
 				}
 				INCPC(3);
@@ -1293,7 +1297,10 @@
 			case GETFIELD:
 				field = getField(lclw, false, meth, &class);
 				STACKIN(0, TOBJ);
-				switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
+				if (FIELD_ISREF(field)) {
+					STACKOUT(1, TOBJ);
+				}
+				else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))){
 				case 'I':
 				case 'Z':
 				case 'S':
@@ -1315,8 +1322,7 @@
 					STACKOUT(1, TVOID);
 					break;
 				default:
-					assert(FIELD_ISREF(field));
-					STACKOUT(1, TOBJ);
+					abort();
 					break;
 				}
 				INCPC(3);
@@ -1325,7 +1331,11 @@
 			case PUTFIELD:
 				field = getField(lclw, false, meth, &class);
 				STACKIN(0, TANY);
-				switch (CLASS_PRIM_SIG(FIELD_TYPE(field))) {
+				if (FIELD_ISREF(field)) {
+					STACKIN(0, TOBJ);
+					STKPOP(2);
+				}
+				else switch (CLASS_PRIM_SIG(FIELD_TYPE(field))){
 				case 'I':
 				case 'Z':
 				case 'S':
@@ -1349,9 +1359,7 @@
 					STKPOP(3);
 					break;
 				default:
-					assert(FIELD_ISREF(field));
-					STACKIN(0, TOBJ);
-					STKPOP(2);
+					abort();
 					break;
 				}
 				INCPC(3);


More information about the kaffe mailing list