Re: [Sablevm-developer] using a Soot-transformed classpath
Brought to you by:
egagnon
From: Chris P. <chr...@ma...> - 2004-03-08 02:56:43
|
Etienne Gagnon wrote: > On Fri, Mar 05, 2004 at 11:45:07PM -0500, Chris Pickett wrote: > >>>I want to make SableVM use Soot-transformed versions of the non-native >>>portion of Classpath. I have the output from Soot in the application >>>directory where I try to run SableVM, but the classes aren't getting >>>loaded even with '-c .' specified as an option. > > > How about compiling a version of SableVM with > --enable-debugging-features and then launching sablevm like this: > > sablevm -v --property sablevm.verbose.methods=true ... i use vm->verbose_methods and vm->verbose_instructions all the time :( i should have reported more details at first; i was just wondering if somebody knew off the top of their head why it fails. anyway, to make it quick: i followed it through with gdb and it dies loading java.lang.Object because apparently java.lang.Object has a superclass (relevant code follows). if i just replace java.lang.Object with the orignal, then it dies whenever it tries to load Spmt.class (which can be deferred by copying over more non-transformed classes). i found that if i keep the original Object.class, VMClass.class, and Class.class files, and also put Spmt.class in the root of classpath, then it works fine. anything less is insufficient. however, i would really like to have my special instructions inserted around every method call -- i want to gather statistics on the number of calls we can successfully predict when the whole of classpath is transformed. is this a soot bug? generating code for java.lang.Object that declares java.lang.Object as a superclass? or is there something particular to what i'm doing that forces java.lang.Object as a superclass (i don't see it ...) i checked the jasmin disassembly of the transformed java.lang.Object classfile and it does indeed declare '.super java/lang/Object' cheers, chris ========================================== static jint _svmf_bootcl_resolve_super_class (_svmt_JNIEnv *env, _svmt_class_info *class) { _svmt_JavaVM *vm = env->vm; _svmt_CONSTANT_Class_info **cp_super_class = class->super_class; assert (class->class_loader_info->class_loader == NULL); /* no super class -> we're done */ if (CANNOT_DREF (cp_super_class)) { /* this must be "java/lang/Object" */ /* and it must be a public non-abstract non-final class */ if (strcmp (class->name, "java/lang/Object") != 0 || class->class_loader_info->class_loader != NULL || (!_svmf_is_set_flag (class->access_flags, SVM_ACC_PUBLIC)) || _svmf_is_set_flag (class->access_flags, SVM_ACC_FINAL) || _svmf_is_set_flag (class->access_flags, SVM_ACC_INTERFACE) || _svmf_is_set_flag (class->access_flags, SVM_ACC_ABSTRACT)) { _svmf_error_VerifyError (env); return JNI_ERR; } return JNI_OK; } if (DREF (cp_super_class, tag) != SVM_CONSTANT_Class || CANNOT_DREF (DREF (cp_super_class, name)) || DREF (DREF (cp_super_class, name), tag) != SVM_CONSTANT_Utf8 || DREF (DREF (cp_super_class, name), value)[0] == '[') { _svmf_error_ClassFormatError (env); return JNI_ERR; } { _svmt_type_node type = { NULL, NULL, NULL, NULL, NULL }; type.name = DREF (DREF (cp_super_class, name), value); if (_svmm_tree_find_type (vm->class_loading.boot_loader.partially_derived_type_tree, &type) != NULL) { => _svmf_error_ClassCircularityError (env); return JNI_ERR; } } |