[kaffe] CVS kaffe (dalibor): Replaced macro by static inline function
Kaffe CVS
Kaffe Mailing List <kaffe@kaffe.org>
Wed Feb 11 10:23:02 2004
PatchSet 4415
Date: 2004/02/11 18:05:57
Author: dalibor
Branch: HEAD
Tag: (none)
Log:
Replaced macro by static inline function
2004-02-11 Dalibor Topic <robilad@kaffe.org>
* kaffe/kaffevm/verify.c
(isWide): New static inline function.
(IS_WIDE) Removed.
Replaced use of IS_WIDE by isWide.
Members:
ChangeLog:1.1998->1.1999
kaffe/kaffevm/verify.c:1.32->1.33
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1998 kaffe/ChangeLog:1.1999
--- kaffe/ChangeLog:1.1998 Wed Feb 11 17:46:04 2004
+++ kaffe/ChangeLog Wed Feb 11 18:05:57 2004
@@ -1,6 +1,13 @@
2004-02-11 Dalibor Topic <robilad@kaffe.org>
* kaffe/kaffevm/verify.c
+ (isWide): New static inline function.
+ (IS_WIDE) Removed.
+ Replaced use of IS_WIDE by isWide.
+
+2004-02-11 Dalibor Topic <robilad@kaffe.org>
+
+ * kaffe/kaffevm/verify.c
(abstractMethodError): New static inline function.
(ABSTRACT_METHOD_ERROR) Removed.
(checkAbstractMethod) Use abstractMethodError instead of
Index: kaffe/kaffe/kaffevm/verify.c
diff -u kaffe/kaffe/kaffevm/verify.c:1.32 kaffe/kaffe/kaffevm/verify.c:1.33
--- kaffe/kaffe/kaffevm/verify.c:1.32 Wed Feb 11 17:46:05 2004
+++ kaffe/kaffe/kaffevm/verify.c Wed Feb 11 18:05:59 2004
@@ -941,9 +941,13 @@
*/
static Type _WIDE;
static Type* TWIDE = &_WIDE;
-#define IS_WIDE(_TINFO) ((_TINFO)->data.class == TWIDE->data.class)
-
+static inline
+bool
+isWide(const Type * tinfo)
+{
+ return (tinfo->data.class == TWIDE->data.class);
+}
static Type verify_NULL;
static Type* TNULL = &verify_NULL;
@@ -3425,7 +3429,7 @@
case PUTFIELD:
- if (IS_WIDE(OPSTACK_TOP)) n = 3;
+ if (isWide(OPSTACK_TOP)) n = 3;
else n = 2;
ENSURE_OPSTACK_SIZE(n);
@@ -3681,7 +3685,7 @@
case DUP:
ENSURE_OPSTACK_SIZE(1);
- if (IS_WIDE(OPSTACK_TOP)) {
+ if (isWide(OPSTACK_TOP)) {
VERIFY_ERROR("dup: on a long or double");
}
@@ -3690,7 +3694,7 @@
case DUP_X1:
ENSURE_OPSTACK_SIZE(2);
- if (IS_WIDE(OPSTACK_TOP) || IS_WIDE(OPSTACK_WTOP)) {
+ if (isWide(OPSTACK_TOP) || isWide(OPSTACK_WTOP)) {
VERIFY_ERROR("dup_x1: splits up a double or long");
}
@@ -3702,7 +3706,7 @@
case DUP_X2:
ENSURE_OPSTACK_SIZE(3);
- if (IS_WIDE(OPSTACK_TOP)) {
+ if (isWide(OPSTACK_TOP)) {
VERIFY_ERROR("cannot dup_x2 when top item on operand stack is a two byte item");
}
@@ -3722,7 +3726,7 @@
case DUP2_X1:
ENSURE_OPSTACK_SIZE(2);
- if (IS_WIDE(OPSTACK_ITEM(2))) {
+ if (isWide(OPSTACK_ITEM(2))) {
VERIFY_ERROR("dup_x1 requires top 2 bytes on operand stack to be single bytes items");
}
CHECK_STACK_OVERFLOW(2);
@@ -3737,7 +3741,7 @@
case DUP2_X2:
ENSURE_OPSTACK_SIZE(4);
- if (IS_WIDE(OPSTACK_ITEM(2)) || IS_WIDE(OPSTACK_ITEM(4))) {
+ if (isWide(OPSTACK_ITEM(2)) || isWide(OPSTACK_ITEM(4))) {
VERIFY_ERROR("dup2_x2 where either 2nd or 4th byte is 2nd half of a 2 byte item");
}
CHECK_STACK_OVERFLOW(2);
@@ -3754,7 +3758,7 @@
case SWAP:
ENSURE_OPSTACK_SIZE(2);
- if (IS_WIDE(OPSTACK_TOP) || IS_WIDE(OPSTACK_WTOP)) {
+ if (isWide(OPSTACK_TOP) || isWide(OPSTACK_WTOP)) {
VERIFY_ERROR("cannot swap 2 bytes of a long or double");
}
@@ -4070,7 +4074,7 @@
case 'J':
if (binfo->opstack[paramIndex].data.class != TLONG->data.class ||
- !IS_WIDE(&binfo->opstack[paramIndex + 1])) {
+ !isWide(&binfo->opstack[paramIndex + 1])) {
TYPE_ERROR;
}
@@ -4081,7 +4085,7 @@
case 'D':
if (binfo->opstack[paramIndex].data.class != TDOUBLE->data.class ||
- !IS_WIDE(&binfo->opstack[paramIndex + 1])) {
+ !isWide(&binfo->opstack[paramIndex + 1])) {
TYPE_ERROR;
}
@@ -5226,7 +5230,7 @@
if (type == TUNSTABLE->data.class) {
dprintf("TUNSTABLE");
}
- else if (IS_WIDE(t)) {
+ else if (isWide(t)) {
dprintf("TWIDE");
}
else {