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

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


PatchSet 4426 
Date: 2004/02/15 18:23:21
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Replaced part of macro by static inline function

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

        * kaffe/kaffevm/verify.c
        (ensureLocalTypeErrorInVerifyBasicBlock): New static inline function.
        (ENSURE_LOCAL_TYPE) Use ensureLocalTypeErrorInVerifyBasicBlock.
        Removed unnecessary undef for VERIFY_ERROR.

Members: 
	ChangeLog:1.2009->1.2010 
	kaffe/kaffevm/verify.c:1.42->1.43 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2009 kaffe/ChangeLog:1.2010
--- kaffe/ChangeLog:1.2009	Sun Feb 15 16:40:44 2004
+++ kaffe/ChangeLog	Sun Feb 15 18:23:21 2004
@@ -1,6 +1,13 @@
 2004-02-15  Dalibor Topic <robilad at kaffe.org>
 
         * kaffe/kaffevm/verify.c
+        (ensureLocalTypeErrorInVerifyBasicBlock): New static inline function.
+        (ENSURE_LOCAL_TYPE) Use ensureLocalTypeErrorInVerifyBasicBlock.
+	Removed unnecessary undef for VERIFY_ERROR.
+
+2004-02-15  Dalibor Topic <robilad at kaffe.org>
+
+        * kaffe/kaffevm/verify.c
         (verifyErrorInVerifyBasicBlock): New static inline function.
         (VERIFY_ERROR) Removed.
         Replaced use of VERIFY_ERROR by verifyErrorInVerifyBasicBlock.
Index: kaffe/kaffe/kaffevm/verify.c
diff -u kaffe/kaffe/kaffevm/verify.c:1.42 kaffe/kaffe/kaffevm/verify.c:1.43
--- kaffe/kaffe/kaffevm/verify.c:1.42	Sun Feb 15 16:40:45 2004
+++ kaffe/kaffe/kaffevm/verify.c	Sun Feb 15 18:23:23 2004
@@ -2014,7 +2014,6 @@
 #undef GET_WIDX
 #undef CHECK_POOL_IDX
 #undef ENSURE_NON_WIDE
-#undef VERIFY_ERROR
 }
 
 
@@ -2492,6 +2491,24 @@
 }
 
 /*
+ * Helper function for error reporting in ENSURE_LOCAL_TYPE macro in verifyBasicBlock.
+ */
+static inline
+bool
+ensureLocalTypeErrorInVerifyBasicBlock(errorInfo* einfo,
+				       const Method* method,
+				       BlockInfo* block,
+				       Hjava_lang_Class* this,
+				       unsigned int n)
+{
+	if (block->locals[n].data.class == TUNSTABLE->data.class) {
+		return verifyErrorInVerifyBasicBlock(einfo, method, this, "attempt to access an unstable local variable");
+	} else {
+		return verifyErrorInVerifyBasicBlock(einfo, method, this, "attempt to access a local variable not of the correct type");
+	}
+}
+
+/*
  * verifyBasicBlock()
  *   Simulates execution of a basic block by modifying its simulated operand stack and local variable array.
  */
@@ -2547,11 +2564,7 @@
 	/* checks whether the specified local variable is of the specified type. */
 #define ENSURE_LOCAL_TYPE(_N, _TINFO) \
 	if (!typecheck(einfo, this, (_TINFO), &block->locals[_N])) { \
-		if (block->locals[_N].data.class == TUNSTABLE->data.class) { \
-			return verifyErrorInVerifyBasicBlock(einfo, method, this, "attempt to access an unstable local variable"); \
-		} else { \
-			return verifyErrorInVerifyBasicBlock(einfo, method, this, "attempt to access a local variable not of the correct type"); \
-		} \
+		return ensureLocalTypeErrorInVerifyBasicBlock(einfo, method, block, this, _N); \
 	} 
 	
 	/* only use with TLONG and TDOUBLE */




More information about the kaffe mailing list