[llvm-commits] CVS: llvm-java/runtime/runtime.c

Alkis Evlogimenos alkis at cs.uiuc.edu
Sat Apr 2 01:14:37 PST 2005



Changes in directory llvm-java/runtime:

runtime.c updated: 1.27 -> 1.28
---
Log message:

Add the name of the class in the typeinfo struct inside the class
record.


---
Diffs of the changes:  (+14 -4)

 runtime.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)


Index: llvm-java/runtime/runtime.c
diff -u llvm-java/runtime/runtime.c:1.27 llvm-java/runtime/runtime.c:1.28
--- llvm-java/runtime/runtime.c:1.27	Fri Apr  1 21:06:35 2005
+++ llvm-java/runtime/runtime.c	Sat Apr  2 03:14:24 2005
@@ -4,7 +4,7 @@
 
 struct llvm_java_object_base;
 struct llvm_java_object_header;
-struct llvm_java_object_vtable;
+struct llvm_java_object_class_record;
 struct llvm_java_object_typeinfo;
 
 struct llvm_java_object_header {
@@ -19,7 +19,7 @@
 
 struct llvm_java_object_typeinfo {
   /* The name of this class */
-  const char** name;
+  const char* name;
 
   /* The number of super classes to java.lang.Object. */
   jint depth;
@@ -31,7 +31,6 @@
    * index implemented by this class. */
   jint interfaceIndex;
 
-
   /* The interface class records this class implements. */
   struct llvm_java_object_class_record** interfaces;
 
@@ -122,6 +121,17 @@
 
 /* The implementation of JNI functions */
 
+extern const struct llvm_java_object_class_record* llvm_java_class_records;
+
+static jclass llvm_java_find_class(JNIEnv* env, const char* name) {
+  const struct llvm_java_object_class_record** clazz = &llvm_java_class_records;
+  while (*clazz)
+    if (strcmp((*clazz)->typeinfo.name, name) == 0)
+      return (jclass) clazz;
+
+  return NULL;
+}
+
 #define HANDLE_TYPE(TYPE) \
   struct llvm_java_##TYPE##array { \
     struct llvm_java_object_base object_base; \
@@ -170,7 +180,7 @@
   NULL,
   NULL,
   NULL,
-  NULL,
+  &llvm_java_find_class,
   NULL,
   NULL,
   NULL,






More information about the llvm-commits mailing list