[llvm-commits] [vmkit] r51861 - /vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll

Nicolas Geoffray nicolas.geoffray at lip6.fr
Sun Jun 1 15:48:12 PDT 2008


Author: geoffray
Date: Sun Jun  1 17:48:12 2008
New Revision: 51861

URL: http://llvm.org/viewvc/llvm-project?rev=51861&view=rev
Log:
Add runtime type check functions.


Modified:
    vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll

Modified: vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll?rev=51861&r1=51860&r2=51861&view=diff

==============================================================================
--- vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll (original)
+++ vmkit/trunk/lib/JnJVM/LLVMRuntime/runtime-default.ll Sun Jun  1 17:48:12 2008
@@ -6,11 +6,13 @@
 %VT = type i32**
 
 ;;; The type of internal classes. This is not complete, but we only need
-;;; the two first fields for now. 
+;;; the first fields for now. 
 ;;; Field 1 - The VT of a class C++ object.
 ;;; Field 2 - The size of instances of this class.
 ;;; Field 3 - The VT of instances of this class.
-%JavaClass = type { %VT, i32, %VT }
+;;; Field 4 - The list of super classes of this class.
+;;; Field 5 - The depth of the class in its super hierarchy
+%JavaClass = type { %VT, i32, %VT ,%JavaClass**, i32}
 
 ;;; The root of all Java Objects: a VT, a class and a lock.
 %JavaObject = type { %VT, %JavaClass*, i8* }
@@ -61,6 +63,16 @@
 ;;; representation.
 declare i32 @getObjectSizeFromClass(%JavaClass*) readnone 
 
+;;; getDisplay - Get the display array of this class.
+declare %JavaClass** @getDisplay(%JavaClass*) readnone 
+
+;;; getClassInDisplay - Get the super class at the given offset.
+declare %JavaClass* @getClassInDisplay(%JavaClass**, i32) readnone 
+
+;;; getDepth - Get the depth of the class.
+declare i32 @getDepth(%JavaClass*) readnone 
+
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;; Generic Runtime methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -100,8 +112,17 @@
 ;;; block or method.
 declare void @JavaObjectRelease(%JavaObject*)
 
-;;; JavaObjectInstanceOf - Returns if a Java object implements the given class.
-declare i32 @JavaObjectInstanceOf(%JavaObject*, %JavaClass*) readnone 
+;;; isAssignableFrom - Returns if the objet's class implements the given class.
+declare i1 @instanceOf(%JavaObject*, %JavaClass*) readnone 
+
+;;; isAssignableFrom - Returns if the class implements the given class.
+declare i1 @isAssignableFrom(%JavaClass*, %JavaClass*) readnone 
+
+;;; implements - Returns if the class implements the given interface.
+declare i1 @implements(%JavaClass*, %JavaClass*) readnone 
+
+;;; instantiationOfArray - Returns if the class implements the given array.
+declare i1 @instantiationOfArray(%JavaClass*, %JavaClass*) readnone 
 
 ;;; getClassDelegatee - Returns the java/lang/Class representation of the
 ;;; class.





More information about the llvm-commits mailing list