[llvm-commits] CVS: llvm-java/runtime/runtime.h runtime.c
Alkis Evlogimenos
alkis at cs.uiuc.edu
Sun Apr 3 16:05:18 PDT 2005
Changes in directory llvm-java/runtime:
runtime.h updated: 1.4 -> 1.5
runtime.c updated: 1.35 -> 1.36
---
Log message:
Implement get superclass in the runtime.
---
Diffs of the changes: (+17 -7)
runtime.c | 11 ++++++++++-
runtime.h | 13 +++++++------
2 files changed, 17 insertions(+), 7 deletions(-)
Index: llvm-java/runtime/runtime.h
diff -u llvm-java/runtime/runtime.h:1.4 llvm-java/runtime/runtime.h:1.5
--- llvm-java/runtime/runtime.h:1.4 Sat Apr 2 20:49:44 2005
+++ llvm-java/runtime/runtime.h Sun Apr 3 18:05:07 2005
@@ -82,9 +82,10 @@
struct llvm_java_class_record* llvm_java_find_class_record(const char* name);
struct llvm_java_class_record* llvm_java_get_class_record(jobject obj);
void llvm_java_set_class_record(jobject obj, struct llvm_java_class_record* cr);
-jboolean
-llvm_java_is_instance_of(jobject obj, struct llvm_java_class_record* cr);
-jboolean
-llvm_java_is_assignable_from(struct llvm_java_class_record* cr,
- struct llvm_java_class_record* from);
-jint llvm_java_throw(jobject obj);
+jboolean llvm_java_is_instance_of(jobject obj,
+ struct llvm_java_class_record* cr);
+struct llvm_java_class_record* llvm_java_get_superclass_record(
+ struct llvm_java_class_record* cr);
+jboolean llvm_java_is_assignable_from(struct llvm_java_class_record* cr,
+ struct llvm_java_class_record* from);
+jint llvm_java_throw(jthrowable obj);
Index: llvm-java/runtime/runtime.c
diff -u llvm-java/runtime/runtime.c:1.35 llvm-java/runtime/runtime.c:1.36
--- llvm-java/runtime/runtime.c:1.35 Sat Apr 2 18:37:08 2005
+++ llvm-java/runtime/runtime.c Sun Apr 3 18:05:07 2005
@@ -26,6 +26,15 @@
obj->classRecord = cr;
}
+struct llvm_java_class_record*
+llvm_java_get_superclass_record(struct llvm_java_class_record* cr) {
+ /* If this is an interface or java/lang/Object return NULL. */
+ if (llvm_java_is_interface_class(cr) || cr->typeinfo.depth == 0)
+ return NULL;
+
+ return cr->typeinfo.superclasses[0];
+}
+
jboolean llvm_java_is_assignable_from(struct llvm_java_class_record* cr,
struct llvm_java_class_record* from) {
/* trivial case: class records are the same */
@@ -70,7 +79,7 @@
return llvm_java_is_assignable_from(obj->classRecord, cr);
}
-jint llvm_java_throw(jobject obj) {
+jint llvm_java_throw(jthrowable obj) {
abort();
}
More information about the llvm-commits
mailing list