Re: [Jamvm-general] Jenkins does not start on ARM+OpenJDK+JamVM
Brought to you by:
rlougher
From: Xerxes R. <xe...@za...> - 2011-08-17 14:22:34
|
ons 2011-08-17 klockan 12:45 +0100 skrev Robert Lougher: > On 17 August 2011 11:33, Robert Lougher <rob...@gm...> wrote: > > Hi Xerxes, > > > > On 17 August 2011 08:32, Xerxes Rånby <xe...@za...> wrote: > >> Hi JamVM team! > >> > >> Forwarding a bug from ubuntu: > >> https://bugs.launchpad.net/ubuntu/+source/jenkins-xstream/+bug/827463 > >> Jenkins fails to start becaused the OpenJDK bindings have missing > >> implementation for java.lang.Class.getEnclosingClass(). > >> > > > > No, it's implemented. Reflection support is somewhat more complicated > > in OpenJDK than GNU Classpath, as responsibility is split between the > > VM and the classlib (in GNU Classpath it's the VMs responsibility). > > > > java.lang.Class.getEnclosingClass() eventually maps down to > > JVM_GetEnclosingMethodInfo(), which returns a 3 element array > > (enclosing class, method name and method type). > > > > There must be a bug somewhere. I'll try and look at it tonight. > > > > There's a bug in enclosingMethodInfo() (classlib/openjdk/reflect.c). > It should still return the enclosing class (in element 0 of the array) > even if there's no enclosing method. > > Here's a fixed version (see below). It should work, but I'm unable to > check if it even compiles until tonight... > > Rob. > > Object *enclosingMethodInfo(Class *class) { > ClassBlock *cb = CLASS_CB(class); > Object *info = NULL; > > if(cb->enclosing_class) { > Class *enc_class = resolveClass(class, cb->enclosing_class, > TRUE, FALSE); > > if(enc_class != NULL) { > Class *ary_class = findArrayClass(SYMBOL(array_java_lang_Object)); > > if(ary_class != NULL) { > info = allocArray(ary_class, 3, sizeof(Object*)); > > if(info != NULL) { > ARRAY_DATA(info, Object*)[0] = enc_class; > > if(cb->enclosing_method) { > ConstantPool *cp = &cb->constant_pool; > char *methodname = CP_UTF8(cp, CP_NAME_TYPE_NAME(cp, > cb->enclosing_method)); > char *methodtype = CP_UTF8(cp, CP_NAME_TYPE_TYPE(cp, > cb->enclosing_method)); > Object *name = createString(methodname); > Object *type = createString(methodtype); > > if(name == NULL || type == NULL) > return NULL; > > ARRAY_DATA(info, Object*)[1] = name; > ARRAY_DATA(info, Object*)[2] = type; > } > } > } > } > } > > return info; > } > > > Rob. I want to confirm that this fix makes Jenkins work under JamVM! Cheers Xerxes |