[kaffe] CVS kaffe (robilad): Cross-compilation fix for jit

Kaffe CVS cvs-commits at kaffe.org
Sun Mar 13 13:21:38 PST 2005


PatchSet 5555 
Date: 2005/03/13 21:17:18
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Cross-compilation fix for jit

2005-03-13  Dalibor Topic  <robilad at kaffe.org>

* config/i386/jit-i386.def,
kaffe/kaffevm/jit/machine.c:
Replace use of reginfo by KaffeVM_jitGetRegInfo.

* kaffe/kaffevm/jit/registers.c:
(reginfo) Made static.
(KaffeVM_jitGetRegInfo) New function.

* kaffe/kaffevm/jit/registers.h:
(reginfo) Removed prototype.
(KaffeVM_jitGetRegInfo) New prototype.

Members: 
	ChangeLog:1.3729->1.3730 
	config/i386/jit-i386.def:1.19->1.20 
	kaffe/kaffevm/jit/machine.c:1.77->1.78 
	kaffe/kaffevm/jit/registers.c:1.6->1.7 
	kaffe/kaffevm/jit/registers.h:1.5->1.6 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3729 kaffe/ChangeLog:1.3730
--- kaffe/ChangeLog:1.3729	Sun Mar 13 20:46:15 2005
+++ kaffe/ChangeLog	Sun Mar 13 21:17:18 2005
@@ -1,4 +1,18 @@
 2005-03-13  Dalibor Topic  <robilad at kaffe.org>
+	
+	* config/i386/jit-i386.def,
+	kaffe/kaffevm/jit/machine.c:
+	Replace use of reginfo by KaffeVM_jitGetRegInfo.
+	
+	* kaffe/kaffevm/jit/registers.c:
+	(reginfo) Made static.
+	(KaffeVM_jitGetRegInfo) New function.
+	
+	* kaffe/kaffevm/jit/registers.h:
+	(reginfo) Removed prototype.
+	(KaffeVM_jitGetRegInfo) New prototype.
+
+2005-03-13  Dalibor Topic  <robilad at kaffe.org>
 
 	* kaffe/kaffevm/jit/registers.c,
 	kaffe/kaffevm/jit3/registers.c:
Index: kaffe/config/i386/jit-i386.def
diff -u kaffe/config/i386/jit-i386.def:1.19 kaffe/config/i386/jit-i386.def:1.20
--- kaffe/config/i386/jit-i386.def:1.19	Mon Dec 27 16:09:45 2004
+++ kaffe/config/i386/jit-i386.def	Sun Mar 13 21:17:21 2005
@@ -1698,8 +1698,8 @@
 DBG(REGFORCE,
     dprintf ("kill_readonce_register(%s)\n", regname(s->regno));
     );
-	if (((reginfo[s->regno].ctype & Rdouble) && (s->regno == REG_dbl0)) ||
-	    ((reginfo[s->regno].ctype & Rfloat) && (s->regno == REG_flt0))) {
+	if (((KaffeVM_jitGetRegInfo()[s->regno].ctype & Rdouble) && (s->regno == REG_dbl0)) ||
+	    ((KaffeVM_jitGetRegInfo()[s->regno].ctype & Rfloat) && (s->regno == REG_flt0))) {
 	    	OUT(0xDD);
 		OUT(0xD8);
 
Index: kaffe/kaffe/kaffevm/jit/machine.c
diff -u kaffe/kaffe/kaffevm/jit/machine.c:1.77 kaffe/kaffe/kaffevm/jit/machine.c:1.78
--- kaffe/kaffe/kaffevm/jit/machine.c:1.77	Sat Mar 12 15:36:07 2005
+++ kaffe/kaffe/kaffevm/jit/machine.c	Sun Mar 13 21:17:21 2005
@@ -717,7 +717,7 @@
 	 * flush them - we do not want to do that even if they are dirty.
 	 */
 	for (i = maxslot - 1; i >= 0; i--) {
-		if (slotinfo[i].regno != NOREG && (reginfo[slotinfo[i].regno].flags & Rnosaveoncall) == 0) {
+		if (slotinfo[i].regno != NOREG && (KaffeVM_jitGetRegInfo()[slotinfo[i].regno].flags & Rnosaveoncall) == 0) {
 			register_invalidate(slotinfo[i].regno);
 			slot_invalidate(&slotinfo[i]);
 		}
@@ -797,7 +797,7 @@
 
 	/* Spill locals */
 	for (i = 0; i < maxLocal; i++) {
-		if ((localinfo[i].modified & rwrite) != 0 && localinfo[i].regno != NOREG && (reginfo[localinfo[i].regno].flags & Rnosaveoncall) == 0) {
+		if ((localinfo[i].modified & rwrite) != 0 && localinfo[i].regno != NOREG && (KaffeVM_jitGetRegInfo()[localinfo[i].regno].flags & Rnosaveoncall) == 0) {
 			spill(&localinfo[i]);
 			localinfo[i].modified = 0;
 		}
@@ -806,7 +806,7 @@
 	/* Spill stack */
 	stkno = const_int(1);
 	for (i = stkno; i < maxStack+maxLocal; i++) {
-		if ((localinfo[i].modified & rwrite) != 0 && localinfo[i].regno != NOREG && (reginfo[localinfo[i].regno].flags & Rnosaveoncall) == 0) {
+		if ((localinfo[i].modified & rwrite) != 0 && localinfo[i].regno != NOREG && (KaffeVM_jitGetRegInfo()[localinfo[i].regno].flags & Rnosaveoncall) == 0) {
 			spill(&localinfo[i]);
 			localinfo[i].modified = 0;
 		}
@@ -815,7 +815,7 @@
 	/* Spill temps currently in use */
 	tmpslot = const_int(2);
 	for (i = 0; i < tmpslot; i++) {
-		if ((tempinfo[i].modified & rwrite) != 0 && tempinfo[i].regno != NOREG && (reginfo[tempinfo[i].regno].flags & Rnosaveoncall) == 0) {
+		if ((tempinfo[i].modified & rwrite) != 0 && tempinfo[i].regno != NOREG && (KaffeVM_jitGetRegInfo()[tempinfo[i].regno].flags & Rnosaveoncall) == 0) {
 			spill(&tempinfo[i]);
 			tempinfo[i].modified = 0;
 		}
@@ -838,7 +838,7 @@
 
 	/* Spill locals */
 	for (i = 0; i < maxLocal; i++) {
-		if ((localinfo[i].modified & rwrite) != 0 && localinfo[i].regno != NOREG && (reginfo[localinfo[i].regno].flags & Rnosaveoncall) == 0) {
+		if ((localinfo[i].modified & rwrite) != 0 && localinfo[i].regno != NOREG && (KaffeVM_jitGetRegInfo()[localinfo[i].regno].flags & Rnosaveoncall) == 0) {
 			spill(&localinfo[i]);
 		}
 	}
@@ -846,7 +846,7 @@
 	/* Spill stack */
 	stkno = const_int(1);
 	for (i = stkno; i < maxLocal+maxStack; i++) {
-		if ((localinfo[i].modified & rwrite) != 0 && localinfo[i].regno != NOREG && (reginfo[localinfo[i].regno].flags & Rnosaveoncall) == 0) {
+		if ((localinfo[i].modified & rwrite) != 0 && localinfo[i].regno != NOREG && (KaffeVM_jitGetRegInfo()[localinfo[i].regno].flags & Rnosaveoncall) == 0) {
 			spill(&localinfo[i]);
 		}
 	}
@@ -854,7 +854,7 @@
 	/* Spill temps currently in use */
 	tmpslot = const_int(2);
 	for (i = 0; i < tmpslot; i++) {
-		if ((tempinfo[i].modified & rwrite) != 0 && tempinfo[i].regno != NOREG && (reginfo[tempinfo[i].regno].flags & Rnosaveoncall) == 0) {
+		if ((tempinfo[i].modified & rwrite) != 0 && tempinfo[i].regno != NOREG && (KaffeVM_jitGetRegInfo()[tempinfo[i].regno].flags & Rnosaveoncall) == 0) {
 			spill(&tempinfo[i]);
 		}
 	}
Index: kaffe/kaffe/kaffevm/jit/registers.c
diff -u kaffe/kaffe/kaffevm/jit/registers.c:1.6 kaffe/kaffe/kaffevm/jit/registers.c:1.7
--- kaffe/kaffe/kaffevm/jit/registers.c:1.6	Sun Mar 13 20:46:17 2005
+++ kaffe/kaffe/kaffevm/jit/registers.c	Sun Mar 13 21:17:21 2005
@@ -25,10 +25,19 @@
 /*
  * Define the registers.
  */
-kregs reginfo[MAXREG+1] = {
-	REGISTER_SET
-	{ /* BAD */	NULL, 0, 0, 0, 0, 0 }
+static kregs reginfo[MAXREG+1] = {
+  REGISTER_SET
+  { /* BAD */	NULL, 0, 0, 0, 0, 0 }
 };
+
+/**
+ * Get the registers.
+ */
+kregs* 
+KaffeVM_jitGetRegInfo(void)
+{
+  return reginfo;
+}
 
 /* This is horrible but necessary at the moment.  Sometime we need to
  * make transient changes to the registers which we will forget in 
Index: kaffe/kaffe/kaffevm/jit/registers.h
diff -u kaffe/kaffe/kaffevm/jit/registers.h:1.5 kaffe/kaffe/kaffevm/jit/registers.h:1.6
--- kaffe/kaffe/kaffevm/jit/registers.h:1.5	Sun Mar 13 20:46:17 2005
+++ kaffe/kaffe/kaffevm/jit/registers.h	Sun Mar 13 21:17:21 2005
@@ -40,13 +40,13 @@
 	uint8			regno;
 } kregs;
 
-extern kregs reginfo[];
+extern kregs* KaffeVM_jitGetRegInfo(void);
 
-#define	register_invalidate(r)	reginfo[r].slot = NOSLOT
+#define	register_invalidate(r)	KaffeVM_jitGetRegInfo()[r].slot = NOSLOT
 
 /* reserve a register */
-#define        register_reserve(r)     (reginfo[r].type |= Reserved)
-#define        register_unreserve(r)   (reginfo[r].type &= ~Reserved)
+#define        register_reserve(r)     (KaffeVM_jitGetRegInfo()[r].type |= Reserved)
+#define        register_unreserve(r)   (KaffeVM_jitGetRegInfo()[r].type &= ~Reserved)
 
 #define	MAXREG			NR_REGISTERS
 #define	NOREG			MAXREG
@@ -80,7 +80,7 @@
 #define	rnowriteback		4
 
 #define _slotInRegister(_s, _t)					\
-	((reginfo[(_s)->regno].type & (_t)) == (_t))
+	((KaffeVM_jitGetRegInfo()[(_s)->regno].type & (_t)) == (_t))
 
 #define slotInRegister(_i, _t)					\
 	_slotInRegister(seq_slot(s, _i), _t)




More information about the kaffe mailing list