Re: [Sablevm-developer] using a Soot-transformed classpath
Brought to you by:
egagnon
From: Clark V. <cl...@CS...> - 2004-03-08 12:11:13
|
> 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' The super_class field of the classfile for java.lang.Object should be 0 (ie invalid constant-pool ref), so that sounds like a soot bug. -- ttfn, clark cl...@cs... On Sun, 7 Mar 2004, Chris Pickett wrote: > 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; > } > } > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Sablevm-developer mailing list > Sab...@li... > https://lists.sourceforge.net/lists/listinfo/sablevm-developer > > |