[kaffe] picky patch

gonzo Robert.N.Gonzalez at williams.edu
Tue Feb 4 09:25:01 PST 2003


Hi all.

in code-analyze.[ch], the methods are currently entitles "verifyMethod",
"verifyBasicBlock", "tidyVerifyMethod", etc., and these are called from
intrp/machine.c, jit/machine.c, and jit3/machine.c to perform code
analysis before compilation (from intrp i think they are actually expected
to verify the soundness of the bytecode, which will be totally unecessary
once a full link-time verifier is added).  the methods that are called for
actual link-time verification are verify2 and verify3 in verify.c.

to avoid confusing the compiler, in my working copy of kaffe i've renamed
the methods in code-analyze.[ch] analyzeMethod, analyzeBasicBlock, etc.,
and every time i upgrade to a newer version of CVS i have to patch the
names.

so, if anyone has the heart to check in this patch that simply renames the
methods in question (to more appropriate names, IMHO), it would make my
life easier and make the method names a little more meaningful :)


cheers,
~rob
-------------- next part --------------
--- kaffe/kaffevm/code-analyse.ORIG.h	2003-02-04 11:24:09.000000000 -0500
+++ kaffe/kaffevm/code-analyse.h	2003-02-04 11:24:49.000000000 -0500
@@ -161,7 +161,7 @@
 		FRAME(pc) = ALLOCFRAME();			\
 		if (!FRAME(pc)) {				\
 			meth->accflags &= ~ACC_VERIFIED;	\
-			tidyVerifyMethod(&codeInfo);		\
+			tidyAnalyzeMethod(&codeInfo);		\
 			postOutOfMemory(einfo);			\
 			return false;				\
 		}						\
@@ -252,8 +252,8 @@
 					LCL(L).used = 1
 
 struct _methods;
-bool verifyMethod(struct _methods*, codeinfo**, errorInfo*);
-void tidyVerifyMethod(codeinfo**);
+bool analyzeMethod(struct _methods*, codeinfo**, errorInfo*);
+void tidyAnalyzeMethod(codeinfo**);
 
 extern const uint8 insnLen[];
 
--- kaffe/kaffevm/code-analyse.ORIG.c	2003-02-03 22:34:50.000000000 -0500
+++ kaffe/kaffevm/code-analyse.c	2003-02-04 11:21:40.000000000 -0500
@@ -53,12 +53,12 @@
 };
 
 static void mergeFrame(codeinfo*, int, int, frameElement*, Method*);
-static bool verifyBasicBlock(codeinfo*, Method*, int32, errorInfo*);
+static bool analyzeBasicBlock(codeinfo*, Method*, int32, errorInfo*);
 static void updateLocals(codeinfo*, int32, frameElement*);
-static bool verifyCatchClause(jexceptionEntry*, Hjava_lang_Class*, errorInfo*);
+static bool analyzeCatchClause(jexceptionEntry*, Hjava_lang_Class*, errorInfo*);
 
 bool
-verifyMethod(Method* meth, codeinfo **pcodeinfo, errorInfo *einfo)
+analyzeMethod(Method* meth, codeinfo **pcodeinfo, errorInfo *einfo)
 {
 	int32 pc;
 	int32 tabpc;
@@ -268,7 +268,7 @@
 			entry = &(meth->exception_table->entry[lcl]);
 			
 			/* Verify catch clause exception has valid type. */
-			succ = verifyCatchClause(entry, meth->class, einfo);
+			succ = analyzeCatchClause(entry, meth->class, einfo);
 			if (succ == false) {
 				return false;
 			}
@@ -340,11 +340,11 @@
 		for (bcurr = bhead; bcurr != NULL; bcurr = bcurr->nextBB) {
 			pc = bcurr - codeInfo->perPC;
 			if (IS_NEEDVERIFY(pc)) {
-				failed = verifyBasicBlock(codeInfo, meth, 
+				failed = analyzeBasicBlock(codeInfo, meth, 
 							    pc, einfo);
 
 				if (failed) {
-					tidyVerifyMethod(pcodeinfo);
+					tidyAnalyzeMethod(pcodeinfo);
 					return (false);
 				}
 				rerun = true;
@@ -368,7 +368,7 @@
 
 static
 bool
-verifyBasicBlock(codeinfo* codeInfo, Method* meth, int32 pc, errorInfo *einfo)
+analyzeBasicBlock(codeinfo* codeInfo, Method* meth, int32 pc, errorInfo *einfo)
 {
 	int32 tabpc;
 	int32 idx;
@@ -2035,7 +2035,7 @@
  * Tidy up after verfication data has been finished with.
  */
 void
-tidyVerifyMethod(codeinfo** codeInfo)
+tidyAnalyzeMethod(codeinfo** codeInfo)
 {
 	int pc;
 
@@ -2100,7 +2100,7 @@
  * (e.g. a stack overflow).
  */
 static bool
-verifyCatchClause(jexceptionEntry* eptr, Hjava_lang_Class* class, errorInfo *einfo)
+analyzeCatchClause(jexceptionEntry* eptr, Hjava_lang_Class* class, errorInfo *einfo)
 {
 	if( eptr->catch_idx == 0 ) {
 		/* A finally clause... */
--- kaffe/kaffevm/intrp/machine.ORIG.c	2003-02-04 11:40:47.000000000 -0500
+++ kaffe/kaffevm/intrp/machine.c	2003-02-04 11:41:16.000000000 -0500
@@ -141,11 +141,11 @@
 		return;
 	}
 
-	/* Verify method if required */
+	/* Analyze method if required */
 	if ((methaccflags & ACC_VERIFIED) == 0) {
 		codeinfo* codeInfo;
-		bool success = verifyMethod(meth, &codeInfo, &einfo);
-		tidyVerifyMethod(&codeInfo);
+		bool success = analyzeMethod(meth, &codeInfo, &einfo);
+		tidyAnalyzeMethod(&codeInfo);
 		if (success == false) {
 			throwError(&einfo);
 		}
--- kaffe/kaffevm/jit/machine.ORIG.c	2003-02-04 11:41:50.000000000 -0500
+++ kaffe/kaffevm/jit/machine.c	2003-02-04 11:42:02.000000000 -0500
@@ -241,7 +241,7 @@
 	}
 
 	/* Scan the code and determine the basic blocks */
-	success = verifyMethod(meth, &codeInfo, einfo);
+	success = analyzeMethod(meth, &codeInfo, einfo);
 	if (success == false) {
 		goto done3;
 	}
@@ -395,7 +395,7 @@
 	installMethodCode(codeInfo, meth, &ncode);
 
 done:
-	tidyVerifyMethod(&codeInfo);
+	tidyAnalyzeMethod(&codeInfo);
 
 DBG(JIT,
 	dprintf("Translated %s.%s%s (%s) %p\n", meth->class->name->data, 
--- kaffe/kaffevm/jit3/machine.ORIG.c	2003-02-04 11:42:18.000000000 -0500
+++ kaffe/kaffevm/jit3/machine.c	2003-02-04 11:42:29.000000000 -0500
@@ -161,7 +161,7 @@
 	}
 
 	/* Scan the code and determine the basic blocks */
-	success = verifyMethod(xmeth, &mycodeInfo, einfo);
+	success = analyzeMethod(xmeth, &mycodeInfo, einfo);
 	if (success == false) {
 		goto done3;
 	}
@@ -360,7 +360,7 @@
 	installMethodCode(0, xmeth, &ncode);
 
 done:;
-	tidyVerifyMethod(&codeInfo);
+	tidyAnalyzeMethod(&codeInfo);
 
 	reinvoke = false;
 


More information about the kaffe mailing list