[kaffe] CVS kaffe (robilad): Cross-compilation fix for libkaffevm

Kaffe CVS cvs-commits at kaffe.org
Sun Mar 13 10:20:47 PST 2005


PatchSet 5550 
Date: 2005/03/13 18:14:26
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Cross-compilation fix for libkaffevm


2005-03-13  Dalibor Topic  <robilad at kaffe.org>

* kaffe/kaffevm/baseClasses.h
(getStringClass): New function.
(ClassClass) Made static.

* kaffe/kaffevm/baseClasses.h
(getStringClass): New prototype.
(ClassClass) Removed.

* kaffe/kaffevm/classMethod.c (lookupArray),
kaffe/kaffevm/itypes.c (finishTypes),
kaffe/kaffevm/object.c (newClass):
Replaced use of ClassClass by getClassClass.

Members: 
	ChangeLog:1.3724->1.3725 
	kaffe/kaffevm/baseClasses.c:1.60->1.61 
	kaffe/kaffevm/baseClasses.h:1.19->1.20 
	kaffe/kaffevm/classMethod.c:1.137->1.138 
	kaffe/kaffevm/itypes.c:1.34->1.35 
	kaffe/kaffevm/object.c:1.32->1.33 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3724 kaffe/ChangeLog:1.3725
--- kaffe/ChangeLog:1.3724	Sun Mar 13 17:19:59 2005
+++ kaffe/ChangeLog	Sun Mar 13 18:14:26 2005
@@ -1,5 +1,20 @@
 2005-03-13  Dalibor Topic  <robilad at kaffe.org>
 
+	* kaffe/kaffevm/baseClasses.h
+	(getStringClass): New function.
+	(ClassClass) Made static.
+	
+	* kaffe/kaffevm/baseClasses.h 
+	(getStringClass): New prototype.
+	(ClassClass) Removed.
+	
+	* kaffe/kaffevm/classMethod.c (lookupArray),
+	kaffe/kaffevm/itypes.c (finishTypes),
+	kaffe/kaffevm/object.c (newClass): 
+	Replaced use of ClassClass by getClassClass.
+	
+2005-03-13  Dalibor Topic  <robilad at kaffe.org>
+
 	* kaffe/kaffevm/verifier/verify-type.c
 	(TWIDE): Made static. 
 	(getTWIDE) Added.
Index: kaffe/kaffe/kaffevm/baseClasses.c
diff -u kaffe/kaffe/kaffevm/baseClasses.c:1.60 kaffe/kaffe/kaffevm/baseClasses.c:1.61
--- kaffe/kaffe/kaffevm/baseClasses.c:1.60	Fri Mar 11 16:41:52 2005
+++ kaffe/kaffe/kaffevm/baseClasses.c	Sun Mar 13 18:14:29 2005
@@ -56,7 +56,7 @@
 Utf8Const* InnerClasses_name;
 
 static Hjava_lang_Class dummyClassClass;
-Hjava_lang_Class* ClassClass = &dummyClassClass;
+static Hjava_lang_Class* ClassClass = &dummyClassClass;
 Hjava_lang_Class* StringClass;
 Hjava_lang_Class* ObjectClass;
 Hjava_lang_Class* SystemClass;
@@ -107,6 +107,24 @@
 void initClasspath(void);
 void initNative(void);
 
+/**
+ * get the java.lang.Class class.
+ * Load it if it is not loaded.
+ */
+Hjava_lang_Class* 
+getClassClass(void)
+{
+  if (ClassClass == NULL) {
+    loadStaticClass(&ClassClass, CLASSCLASS);
+  }
+
+  return ClassClass;
+}
+
+/**
+ * get the java.lang.String class.
+ * Load it if it is not loaded.
+ */
 Hjava_lang_Class* 
 getStringClass(void)
 {
Index: kaffe/kaffe/kaffevm/baseClasses.h
diff -u kaffe/kaffe/kaffevm/baseClasses.h:1.19 kaffe/kaffe/kaffevm/baseClasses.h:1.20
--- kaffe/kaffe/kaffevm/baseClasses.h:1.19	Sun Jan 30 12:42:40 2005
+++ kaffe/kaffe/kaffevm/baseClasses.h	Sun Mar 13 18:14:29 2005
@@ -28,7 +28,6 @@
 void initBaseClasses(void);
 void initialiseKaffe(void);
 
-extern struct Hjava_lang_Class*	ClassClass;
 extern struct Hjava_lang_Class*	ObjectClass;
 extern struct Hjava_lang_Class*	StringClass;
 extern struct Hjava_lang_Class*	SystemClass;
@@ -66,6 +65,7 @@
 
 extern struct Hjava_lang_ClassLoader *appClassLoader;
 
+extern Hjava_lang_Class* getClassClass(void);
 extern Hjava_lang_Class* getStringClass(void);
 
 #endif
Index: kaffe/kaffe/kaffevm/classMethod.c
diff -u kaffe/kaffe/kaffevm/classMethod.c:1.137 kaffe/kaffe/kaffevm/classMethod.c:1.138
--- kaffe/kaffe/kaffevm/classMethod.c:1.137	Sun Mar 13 11:31:49 2005
+++ kaffe/kaffe/kaffevm/classMethod.c	Sun Mar 13 18:14:29 2005
@@ -2864,7 +2864,7 @@
 	addInterfaces(arr_class, 2, arr_interfaces);
 
 	arr_class->total_interface_len = arr_class->interface_len;
-	arr_class->head.vtable = ClassClass->vtable;
+	arr_class->head.vtable = getClassClass()->vtable;
 	arr_class->state = CSTATE_COMPLETE;
 	arr_class->centry = centry;
 
Index: kaffe/kaffe/kaffevm/itypes.c
diff -u kaffe/kaffe/kaffevm/itypes.c:1.34 kaffe/kaffe/kaffevm/itypes.c:1.35
--- kaffe/kaffe/kaffevm/itypes.c:1.34	Tue Dec 21 05:49:59 2004
+++ kaffe/kaffe/kaffevm/itypes.c	Sun Mar 13 18:14:29 2005
@@ -137,15 +137,15 @@
 {
 	DBG(INIT, dprintf("finishTypes()\n"); );
 
-	byteClass->head.vtable = ClassClass->vtable;
-	shortClass->head.vtable = ClassClass->vtable;
-	intClass->head.vtable = ClassClass->vtable;
-	longClass->head.vtable = ClassClass->vtable;
-	booleanClass->head.vtable = ClassClass->vtable;
-	charClass->head.vtable = ClassClass->vtable;
-	floatClass->head.vtable = ClassClass->vtable;
-	doubleClass->head.vtable = ClassClass->vtable;
-	voidClass->head.vtable = ClassClass->vtable;
+	byteClass->head.vtable = getClassClass()->vtable;
+	shortClass->head.vtable = getClassClass()->vtable;
+	intClass->head.vtable = getClassClass()->vtable;
+	longClass->head.vtable = getClassClass()->vtable;
+	booleanClass->head.vtable = getClassClass()->vtable;
+	charClass->head.vtable = getClassClass()->vtable;
+	floatClass->head.vtable = getClassClass()->vtable;
+	doubleClass->head.vtable = getClassClass()->vtable;
+	voidClass->head.vtable = getClassClass()->vtable;
 
 	DBG(INIT, dprintf("finishTypes() done\n"); );
 }
Index: kaffe/kaffe/kaffevm/object.c
diff -u kaffe/kaffe/kaffevm/object.c:1.32 kaffe/kaffe/kaffevm/object.c:1.33
--- kaffe/kaffe/kaffevm/object.c:1.32	Sun Jan 30 12:42:41 2005
+++ kaffe/kaffe/kaffevm/object.c	Sun Mar 13 18:14:29 2005
@@ -116,7 +116,7 @@
 
         /* Fill in object information */
 	KaffeVM_setFinalizer(cls, KGC_DEFAULT_FINALIZER);
-	cls->head.vtable = ClassClass->vtable;
+	cls->head.vtable = getClassClass()->vtable;
 done:
 DBG(NEWOBJECT,
 	dprintf("newClass @%p\n", cls);




More information about the kaffe mailing list