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

Kaffe CVS cvs-commits at kaffe.org
Sun Feb 15 08:09:02 PST 2004


PatchSet 4424 
Date: 2004/02/15 15:50:50
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Replaced macro by static inline function

2004-02-15  Dalibor Topic <robilad at kaffe.org>

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

Members: 
	ChangeLog:1.2007->1.2008 
	kaffe/kaffevm/verify.c:1.40->1.41 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2007 kaffe/ChangeLog:1.2008
--- kaffe/ChangeLog:1.2007	Sun Feb 15 14:48:52 2004
+++ kaffe/ChangeLog	Sun Feb 15 15:50:50 2004
@@ -1,6 +1,13 @@
 2004-02-15  Dalibor Topic <robilad at kaffe.org>
 
         * kaffe/kaffevm/verify.c
+        (verifyErrorInMerge): New static inline function.
+        (VERIFY_ERROR) Removed.
+        Replaced use of VERIFY_ERROR by verifyErrorInMerge.
+
+2004-02-15  Dalibor Topic <robilad at kaffe.org>
+
+        * kaffe/kaffevm/verify.c
 	Removed undef for unused macro RETURN_3b.
 
 2004-02-15  Dalibor Topic <robilad at kaffe.org>
Index: kaffe/kaffe/kaffevm/verify.c
diff -u kaffe/kaffe/kaffevm/verify.c:1.40 kaffe/kaffe/kaffevm/verify.c:1.41
--- kaffe/kaffe/kaffevm/verify.c:1.40	Sun Feb 15 14:48:54 2004
+++ kaffe/kaffe/kaffevm/verify.c	Sun Feb 15 15:50:52 2004
@@ -2344,6 +2344,24 @@
 
 
 /*
+ * Helper function for error reporting in merge.
+ */
+static inline
+bool
+verifyErrorInMerge(errorInfo* einfo,
+		   const Method* method,
+		   const char * msg)
+{
+        if (einfo->type == 0) {
+        	postExceptionMessage(einfo, JAVA_LANG(VerifyError),
+				     "in method \"%s.%s\": %s",
+				     CLASS_CNAME(method->class), METHOD_NAMED(method), msg);
+	}
+	return(false);
+}
+
+
+/*
  * merges two operand stacks.  just to repeat what the JVML 2 spec says about this:
  *   Merge the state of the operand stack and local variable array at the end of the
  *   execution of the current instruction into each of the successor instructions.  In
@@ -2379,15 +2397,6 @@
       BlockInfo* fromBlock,
       BlockInfo* toBlock)
 {
-#define VERIFY_ERROR(_MSG) \
-        if (einfo->type == 0) { \
-        	postExceptionMessage(einfo, JAVA_LANG(VerifyError), \
-				     "in method \"%s.%s\": %s", \
-				     CLASS_CNAME(method->class), METHOD_NAMED(method), _MSG); \
-	} \
-	return(false)
-	
-	
 	uint32 n;
 	
 	
@@ -2397,12 +2406,12 @@
 	if (toBlock->startAddr < fromBlock->startAddr) {
 		for (n = 0; n < method->localsz; n++) {
 			if (fromBlock->locals[n].tinfo & TINFO_UNINIT) {
-				VERIFY_ERROR("uninitialized object reference in a local variable during a backwards branch");
+				return verifyErrorInMerge(einfo, method, "uninitialized object reference in a local variable during a backwards branch");
 			}
 		}
 		for (n = 0; n < fromBlock->stacksz; n++) {
 			if (fromBlock->opstack[n].tinfo & TINFO_UNINIT) {
-				VERIFY_ERROR("uninitialized object reference on operand stack during a backwards branch");
+				return verifyErrorInMerge(einfo, method, "uninitialized object reference on operand stack during a backwards branch");
 			}
 		}
 	}
@@ -2462,7 +2471,6 @@
 	
 	
 	return(true);
-#undef VERIFY_ERROR
 }
 
 




More information about the kaffe mailing list