It points to the struct vm_class of class represented by a java.lang.Class instance. It's needed to implement VMClass natives.
Signed-off-by: Tomek Grabiec <tgrab...@gmail.com> --- include/vm/object.h | 4 ++++ vm/class.c | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/include/vm/object.h b/include/vm/object.h index a8fe9bf..27ae579 100644 --- a/include/vm/object.h +++ b/include/vm/object.h @@ -16,6 +16,10 @@ struct vm_object { * this points to the (artificial) class named "[I". */ struct vm_class *class; + /* For instances of java.lang.Class this points to the class + represented by this java.lang.Class instance. */ + struct vm_class *java_lang_Class_class; + pthread_mutex_t mutex; unsigned int array_length; diff --git a/vm/class.c b/vm/class.c index dcad2f0..ec76c69 100644 --- a/vm/class.c +++ b/vm/class.c @@ -276,6 +276,8 @@ int vm_class_init(struct vm_class *vmc) return -1; } + vmc->object->java_lang_Class_class = vmc; + if (vmc->class) { /* XXX: Make sure there's at most one of these. */ for (uint16_t i = 0; i < vmc->class->methods_count; ++i) { -- 1.6.0.6 ------------------------------------------------------------------------------ _______________________________________________ Jatovm-devel mailing list Jatovm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jatovm-devel