[kaffe] CVS kaffe (stack): Fix infinite recursion in some jitter methods

Kaffe CVS cvs-commits at kaffe.org
Wed Mar 10 10:07:02 PST 2004


PatchSet 4503 
Date: 2004/03/10 17:48:01
Author: stack
Branch: HEAD
Tag: (none) 
Log:
Fix infinite recursion in some jitter methods

Members: 
	ChangeLog:1.2082->1.2083 
	kaffe/kaffevm/jit3/icode.c:1.35->1.36 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2082 kaffe/ChangeLog:1.2083
--- kaffe/ChangeLog:1.2082	Wed Mar 10 17:24:44 2004
+++ kaffe/ChangeLog	Wed Mar 10 17:48:01 2004
@@ -1,3 +1,9 @@
+2004-03-10  Casey Marshall <rsdio at metastatic.org>
+	
+        * kaffe/kaffevm/jit3/icode.c:
+	(sub_int, mul_int, div_int) Fix infinite loop between the generic
+	version of a function and the const version.
+	
 2004-03-10  Norbert Frese <postfach at nfrese.net>
 
 	* libraries/javalib/gnu/java/rmi/server/UnicastConnection.java
Index: kaffe/kaffe/kaffevm/jit3/icode.c
diff -u kaffe/kaffe/kaffevm/jit3/icode.c:1.35 kaffe/kaffe/kaffevm/jit3/icode.c:1.36
--- kaffe/kaffe/kaffevm/jit3/icode.c:1.35	Tue Mar  9 21:00:48 2004
+++ kaffe/kaffe/kaffevm/jit3/icode.c	Wed Mar 10 17:48:03 2004
@@ -1146,6 +1146,13 @@
 }
 #endif
 
+#if defined(HAVE_sub_int)
+void
+_sub_int(SlotInfo* dst, SlotInfo* src, SlotInfo* src2)
+{
+	slot_slot_slot(dst, src, src2, HAVE_sub_int, Tcomplex);
+}
+
 void
 sub_int_const(SlotInfo* dst, SlotInfo* src, jint val)
 {
@@ -1159,12 +1166,11 @@
 		SlotInfo* tmp;
 		slot_alloctmp(tmp);
 		move_int_const(tmp, val);
-		sub_int(dst, src, tmp);
+		_sub_int(dst, src, tmp);
 		slot_freetmp(tmp);
 	}
 }
 
-#if defined(HAVE_sub_int)
 void
 sub_int(SlotInfo* dst, SlotInfo* src, SlotInfo* src2)
 {
@@ -1174,7 +1180,7 @@
 	}
 	else
 #endif
-	slot_slot_slot(dst, src, src2, HAVE_sub_int, Tcomplex);
+	_sub_int(dst, src, src2);
 }
 #endif
 
@@ -1285,6 +1291,27 @@
 }
 
 void
+_mul_int(SlotInfo* dst, SlotInfo* src, SlotInfo* src2)
+{
+#if defined(HAVE_mul_int)
+	slot_slot_slot(dst, src, src2, HAVE_mul_int, Tcomplex);
+#else
+	begin_func_sync();
+#  if defined(PUSHARG_FORWARDS)
+	pusharg_int(src, 0);
+	pusharg_int(src2, 1);
+#  else
+	pusharg_int(src2, 1);
+	pusharg_int(src, 0);
+#  endif
+	call_soft(soft_mul);
+	popargs();
+	end_func_sync();
+	return_int(dst);
+#endif
+}
+
+void
 mul_int_const(SlotInfo* dst, SlotInfo* src, jint val)
 {
 	if (mul_int_const_optimize(dst, src, val) != 0) {
@@ -1300,7 +1327,7 @@
 		SlotInfo* tmp;
 		slot_alloctmp(tmp);
 		move_int_const(tmp, val);
-		mul_int(dst, src, tmp);
+		_mul_int(dst, src, tmp);
 		slot_freetmp(tmp);
 	}
 }
@@ -1313,8 +1340,7 @@
 			return;
 		}
 	}
-#if defined(HAVE_mul_int)
-#if defined(HAVE_mul_int_const)
+#if defined(HAVE_mul_int) && defined(HAVE_mul_int_const)
 	if (slot_type(src) == Tconst) {
 		mul_int_const(dst, src2, slot_value(src).i);
 	}
@@ -1323,21 +1349,7 @@
 	}
 	else
 #endif
-	slot_slot_slot(dst, src, src2, HAVE_mul_int, Tcomplex);
-#else
-	begin_func_sync();
-#if defined(PUSHARG_FORWARDS)
-	pusharg_int(src, 0);
-	pusharg_int(src2, 1);
-#else
-	pusharg_int(src2, 1);
-	pusharg_int(src, 0);
-#endif
-	call_soft(soft_mul);
-	popargs();
-	end_func_sync();
-	return_int(dst);
-#endif
+	_mul_int(dst, src, src2);
 }
 
 void
@@ -1462,6 +1474,27 @@
 }
 
 void
+_div_int(SlotInfo* dst, SlotInfo* src, SlotInfo* src2)
+{
+#if defined(HAVE_div_int)
+	slot_slot_slot(dst, src, src2, HAVE_div_int, Tcomplex);
+#else
+	begin_func_sync();
+#  if defined(PUSHARG_FORWARDS)
+	pusharg_int(src, 0);
+	pusharg_int(src2, 1);
+#  else
+	pusharg_int(src2, 1);
+	pusharg_int(src, 0);
+#  endif
+	call_soft(soft_div);
+	popargs();
+	end_func_sync();
+	return_int(dst);
+#endif
+}
+
+void
 div_int_const(SlotInfo* dst, SlotInfo* src, jint val)
 {
 	if (div_int_const_optimize(dst, src, val) != 0) {
@@ -1477,7 +1510,7 @@
 		SlotInfo* tmp;
 		slot_alloctmp(tmp);
 		move_int_const(tmp, val);
-		div_int(dst, src, tmp);
+		_div_int(dst, src, tmp);
 		slot_freetmp(tmp);
 	}
 }
@@ -1490,22 +1523,7 @@
 			return;
 		}
 	}
-#if defined(HAVE_div_int)
-	slot_slot_slot(dst, src, src2, HAVE_div_int, Tcomplex);
-#else
-	begin_func_sync();
-#if defined(PUSHARG_FORWARDS)
-	pusharg_int(src, 0);
-	pusharg_int(src2, 1);
-#else
-	pusharg_int(src2, 1);
-	pusharg_int(src, 0);
-#endif
-	call_soft(soft_div);
-	popargs();
-	end_func_sync();
-	return_int(dst);
-#endif
+	_div_int(dst, src, src2);
 }
 
 void




More information about the kaffe mailing list