[kaffe] CVS kaffe (dalibor): Replaced macro by static inline function
Kaffe CVS
cvs-commits at kaffe.org
Mon Feb 23 12:32:02 PST 2004
PatchSet 4449
Date: 2004/02/23 20:00:41
Author: dalibor
Branch: HEAD
Tag: (none)
Log:
Replaced macro by static inline function
2004-02-23 Dalibor Topic <robilad at kaffe.org>
* kaffe/kaffevm/verify.c
(typeErrorInCheckMethodCall): New static inline function.
(TYPE_ERROR) Removed.
Replaced use of TYPE_ERROR by typeErrorInCheckMethodCall.
Members:
ChangeLog:1.2029->1.2030
kaffe/kaffevm/verify.c:1.58->1.59
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2029 kaffe/ChangeLog:1.2030
--- kaffe/ChangeLog:1.2029 Sun Feb 22 08:33:09 2004
+++ kaffe/ChangeLog Mon Feb 23 20:00:41 2004
@@ -1,3 +1,10 @@
+2004-02-23 Dalibor Topic <robilad at kaffe.org>
+
+ * kaffe/kaffevm/verify.c
+ (typeErrorInCheckMethodCall): New static inline function.
+ (TYPE_ERROR) Removed.
+ Replaced use of TYPE_ERROR by typeErrorInCheckMethodCall.
+
2004-02-22 Guilhem Lavaux <guilhem at kaffe.org>
* libraries/javalib/java/io/ObjectInputStream.java
Index: kaffe/kaffe/kaffevm/verify.c
diff -u kaffe/kaffe/kaffevm/verify.c:1.58 kaffe/kaffe/kaffevm/verify.c:1.59
--- kaffe/kaffe/kaffevm/verify.c:1.58 Mon Feb 16 23:22:49 2004
+++ kaffe/kaffe/kaffevm/verify.c Mon Feb 23 20:00:44 2004
@@ -4082,6 +4082,29 @@
return(false);
}
+/*
+ * Helper function for error reporting in checkMethodCall.
+ */
+static inline
+bool
+typeErrorInCheckMethodCall(errorInfo* einfo,
+ const Method* method,
+ char* argbuf,
+ uint32 pc,
+ const uint32 idx,
+ const constants* pool,
+ const char* methSig)
+{
+ return verifyErrorInCheckMethodCall(einfo,
+ method,
+ argbuf,
+ pc,
+ idx,
+ pool,
+ methSig,
+ "parameters fail type checking in method invocation");
+}
+
/*
* checkMethodCall()
* verify an invoke instruction. this includes making sure that the types
@@ -4101,8 +4124,6 @@
BlockInfo* binfo, uint32 pc,
SigStack** sigs, UninitializedType** uninits)
{
-#define TYPE_ERROR return verifyErrorInCheckMethodCall(einfo, method, argbuf, pc, idx, pool, methSig, "parameters fail type checking in method invocation")
-
const unsigned char* code = METHOD_BYTECODE_CODE(method);
const uint32 opcode = code[pc];
@@ -4226,7 +4247,7 @@
t->data.sig = argbuf;
if (!typecheck(einfo, method->class, t, &binfo->opstack[paramIndex])) {
- TYPE_ERROR;
+ return typeErrorInCheckMethodCall(einfo, method, argbuf, pc, idx, pool, methSig);
}
binfo->opstack[paramIndex] = *TUNSTABLE;
@@ -4236,7 +4257,7 @@
case 'Z': case 'S': case 'B': case 'C':
case 'I':
if (binfo->opstack[paramIndex].data.class != TINT->data.class) {
- TYPE_ERROR;
+ return typeErrorInCheckMethodCall(einfo, method, argbuf, pc, idx, pool, methSig);
}
binfo->opstack[paramIndex] = *TUNSTABLE;
@@ -4245,7 +4266,7 @@
case 'F':
if (binfo->opstack[paramIndex].data.class != TFLOAT->data.class) {
- TYPE_ERROR;
+ return typeErrorInCheckMethodCall(einfo, method, argbuf, pc, idx, pool, methSig);
}
binfo->opstack[paramIndex] = *TUNSTABLE;
@@ -4255,7 +4276,7 @@
case 'J':
if (binfo->opstack[paramIndex].data.class != TLONG->data.class ||
!isWide(&binfo->opstack[paramIndex + 1])) {
- TYPE_ERROR;
+ return typeErrorInCheckMethodCall(einfo, method, argbuf, pc, idx, pool, methSig);
}
binfo->opstack[paramIndex] = *TUNSTABLE;
@@ -4266,7 +4287,7 @@
case 'D':
if (binfo->opstack[paramIndex].data.class != TDOUBLE->data.class ||
!isWide(&binfo->opstack[paramIndex + 1])) {
- TYPE_ERROR;
+ return typeErrorInCheckMethodCall(einfo, method, argbuf, pc, idx, pool, methSig);
}
binfo->opstack[paramIndex] = *TUNSTABLE;
@@ -4275,7 +4296,7 @@
break;
default:
- TYPE_ERROR;
+ return typeErrorInCheckMethodCall(einfo, method, argbuf, pc, idx, pool, methSig);
}
}
binfo->stacksz -= nargs;
@@ -4352,8 +4373,6 @@
KFREE(argbuf);
return(true);
-#undef TYPE_ERROR
-#undef VERIFY_ERROR
}
More information about the kaffe
mailing list