[llvm-commits] CVS: llvm-java/docs/object-layout.txt
Alkis Evlogimenos
alkis at cs.uiuc.edu
Thu Apr 15 16:01:24 PDT 2004
Changes in directory llvm-java/docs:
object-layout.txt added (r1.1)
---
Log message:
Initial checking of the llvm java-frontend. This contains a skeleton and a preliminary ClassFile parsing library
---
Diffs of the changes: (+59 -0)
Index: llvm-java/docs/object-layout.txt
diff -c /dev/null llvm-java/docs/object-layout.txt:1.1
*** /dev/null Thu Apr 15 16:01:00 2004
--- llvm-java/docs/object-layout.txt Thu Apr 15 16:00:49 2004
***************
*** 0 ****
--- 1,59 ----
+ Object layout for Java objects and array objects
+ ------------------------------------------------
+
+ 1) objects
+
+ Need extensible header for the use of:
+
+ a) VM: locking, hashing, dynamic type checking, virtual function
+ invocation.
+
+ b) GC: garbage collection (can be the reference count for a
+ reference counting garbage collector)
+
+ obj_t : { <header_t>, <field_t1>, <field_t2>, ..., <field_tN> }
+
+ +--------+ <-- pointer to object
+ | header |
+ +--------+
+ | field1 |
+ +--------+
+ | field2 |
+ +--------+
+ | ...... |
+ +--------+
+ | fieldN |
+ +--------+
+
+ 2) arrays
+
+ +--------+ <-- pointer to array object
+ | len |
+ +--------+
+ | header |
+ +--------+
+ | obj_t* |
+ +--------+
+ | ...... |
+ +--------+
+ | ...... |
+ +--------+
+
+ array_object_t : { uint, <header_t>, [ 0 x <obj_t>* ] }
+
+
+ Type information for java objects
+ ---------------------------------
+
+ VM_Class object for each class. This object needs at least the
+ following fields:
+
+ a) pointer to VM_Class object of its super class
+ b) list of interfaces implemented
+ c) list of field descriptors
+ d) list of methods (static, constructor, virtual, finalizer)
+ e) list of attributes (constant value, code, exceptions, inner
+ classes, synthetic, source file, line number table, local variable
+ table, deprecated)
+
+ We would most likely need a method dispatch table as well (vtable).
More information about the llvm-commits
mailing list