[kaffe] CVS kaffe (dalibor): Replaced macro by static inline function

Kaffe CVS Kaffe Mailing List <kaffe@kaffe.org>
Mon Feb 16 13:07:03 2004


PatchSet 4437 
Date: 2004/02/16 21:04:50
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Replaced macro by static inline function


2004-02-16  Dalibor Topic <robilad@kaffe.org>

        * kaffe/kaffevm/verify.c
        (opstackPopBlind): New static inline function.
        (OPSTACK_POP_BLIND) Removed.
        Replaced use of OPSTACK_POP_BLIND by opstackPopBlind.

Members: 
	ChangeLog:1.2020->1.2021 
	kaffe/kaffevm/verify.c:1.53->1.54 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2020 kaffe/ChangeLog:1.2021
--- kaffe/ChangeLog:1.2020	Mon Feb 16 20:33:45 2004
+++ kaffe/ChangeLog	Mon Feb 16 21:04:50 2004
@@ -1,6 +1,13 @@
 2004-02-16  Dalibor Topic <robilad@kaffe.org>
 
         * kaffe/kaffevm/verify.c
+        (opstackPopBlind): New static inline function.
+        (OPSTACK_POP_BLIND) Removed.
+        Replaced use of OPSTACK_POP_BLIND by opstackPopBlind.
+
+2004-02-16  Dalibor Topic <robilad@kaffe.org>
+
+        * kaffe/kaffevm/verify.c
         (opstackPeekTBlindErrorInVerifyBasicBlock): New static inline function.
         (OPSTACK_PEEK_T_BLIND) Use opstackPeekTBlindErrorInVerifyBasicBlock.
 
Index: kaffe/kaffe/kaffevm/verify.c
diff -u kaffe/kaffe/kaffevm/verify.c:1.53 kaffe/kaffe/kaffevm/verify.c:1.54
--- kaffe/kaffe/kaffevm/verify.c:1.53	Mon Feb 16 20:33:46 2004
+++ kaffe/kaffe/kaffevm/verify.c	Mon Feb 16 21:04:52 2004
@@ -2639,6 +2639,17 @@
 }
 
 /*
+ * Helper function for opstack access in verifyBasicBlock.
+ */
+static inline
+void
+opstackPopBlind(BlockInfo* block)
+{
+	block->stacksz--;
+	block->opstack[block->stacksz] = *TUNSTABLE;
+}
+
+/*
  * Helper function for error reporting in OPSTACK_PEEK_T_BLIND macro in verifyBasicBlock.
  */
 static inline
@@ -2772,30 +2783,24 @@
 	ENSURE_OPSTACK_SIZE(2); \
 	OPSTACK_WPEEK_T_BLIND(_TINFO)
 	
-	
-	
-#define OPSTACK_POP_BLIND \
-	block->stacksz--; \
-	block->opstack[block->stacksz] = *TUNSTABLE
-	
 #define OPSTACK_POP \
         ENSURE_OPSTACK_SIZE(1); \
-	OPSTACK_POP_BLIND
+	opstackPopBlind(block)
 
 	/* pop a type off the stack and typecheck it */
 #define OPSTACK_POP_T_BLIND(_TINFO) \
 	OPSTACK_PEEK_T_BLIND(_TINFO); \
-	OPSTACK_POP_BLIND
+	opstackPopBlind(block)
 
 #define OPSTACK_POP_T(_TINFO) \
 	OPSTACK_PEEK_T(_TINFO); \
-        OPSTACK_POP_BLIND
+        opstackPopBlind(block)
 
 
 
 #define OPSTACK_WPOP_BLIND \
-	OPSTACK_POP_BLIND; \
-	OPSTACK_POP_BLIND
+	opstackPopBlind(block); \
+	opstackPopBlind(block)
 
 #define OPSTACK_WPOP \
 	ENSURE_OPSTACK_SIZE(2); \
@@ -2815,7 +2820,7 @@
 	/* pop _N things off the stack off the stack */
 #define OPSTACK_POP_N_BLIND(_N) \
 	for (n = 0; n < _N; n++) { \
-		OPSTACK_POP_BLIND; \
+		opstackPopBlind(block); \
 	}
 	
 #define OPSTACK_POP_N(_N) \
@@ -2961,7 +2966,7 @@
 			}
 			
 			block->locals[idx] = *type;
-			OPSTACK_POP_BLIND;
+			opstackPopBlind(block);
 			break;
 			
 			
@@ -3126,7 +3131,7 @@
 			if (getOpstackTop(block)->data.class != TINT->data.class) {
 				return verifyErrorInVerifyBasicBlock(einfo, method, this, "aaload: item on top of stack is not an integer");
 			}
-			OPSTACK_POP_BLIND;
+			opstackPopBlind(block);
 			
 			type = getOpstackTop(block);
 			if (!isArray(type)) {
@@ -3168,7 +3173,7 @@
                                 return verifyErrorInVerifyBasicBlock(einfo, method, this, "top of opstack does not have desired type");
 			}
 
-			OPSTACK_POP_BLIND;
+			opstackPopBlind(block);
 			OPSTACK_PUSH(TINT);
 			break;
 
@@ -3253,7 +3258,7 @@
 				    dprintf(" vs. what's we wanted: TBYTEARR or TBOOLARR"); )
 				return verifyErrorInVerifyBasicBlock(einfo, method, this, "top of opstack does not have desired type");
 			}
-			OPSTACK_POP_BLIND;
+			opstackPopBlind(block);
 			break;			
 			
 			
@@ -3413,7 +3418,7 @@
 			
 		case CHECKCAST:
 			ENSURE_OPSTACK_SIZE(1);
-			OPSTACK_POP_BLIND;
+			opstackPopBlind(block);
 			goto NEW_COMMON;
 			
 		case MULTIANEWARRAY:
@@ -3423,7 +3428,7 @@
 				if (getOpstackTop(block)->data.class != TINT->data.class) {
 					return verifyErrorInVerifyBasicBlock(einfo, method, this, "multinewarray: first <n> things on opstack must be integers");
 				}
-				OPSTACK_POP_BLIND;
+				opstackPopBlind(block);
 				n--;
 			}
 			goto NEW_COMMON;
@@ -3694,8 +3699,8 @@
 			    !isReference(getOpstackWTop(block))) {
 				return verifyErrorInVerifyBasicBlock(einfo, method, this, "if_acmp* when item on top of stack is not a reference type");
 			}
-			OPSTACK_POP_BLIND;
-			OPSTACK_POP_BLIND;
+			opstackPopBlind(block);
+			opstackPopBlind(block);
 			break;
 			
 		case IF_ICMPEQ:
@@ -3720,7 +3725,7 @@
 			if (!isReference(getOpstackItem(block, 1))) {
 				return verifyErrorInVerifyBasicBlock(einfo, method, this, "if[non]null: thing on top of stack is not a reference");
 			}
-			OPSTACK_POP_BLIND;
+			opstackPopBlind(block);
 			break;
 			
 		case LOOKUPSWITCH:
@@ -3833,7 +3838,7 @@
 			if(!isReference(getOpstackTop(block))) {
 				return verifyErrorInVerifyBasicBlock(einfo, method, this, "monitor*: top of stack is not an object reference");
 			}
-			OPSTACK_POP_BLIND;
+			opstackPopBlind(block);
 			break;
 			
 			
@@ -3958,7 +3963,6 @@
 #undef OPSTACK_POP_T
 #undef OPSTACK_POP_T_BLIND
 #undef OPSTACK_POP
-#undef OPSTACK_POP_BLIND
 
 #undef OPSTACK_WPEEK_T
 #undef OPSTACK_WPEEK_T_BLIND