/* * Create a classblock to represent a primitive type. * NOTE: We don't add it to the builtin class table, so this should be * called only once per primitive type. * See FindPrimitiveClass(). */ ClassClass * createPrimitiveClass(char *name, char sig, unsigned char typecode, unsigned char slotsize, unsigned char elementsize) { ClassClass *cb = allocClassClass(); Classjava_lang_Class *ucb = unhand(cb); ucb->major_version = JAVA_VERSION; ucb->minor_version = JAVA_MINOR_VERSION; ucb->name = strdup(name); ucb->super_name = JAVAPKG "Object"; ucb->constantpool = NULL; ucb->constantpool_count = 0; ucb->loader = NULL; ucb->access = ACC_FINAL | ACC_ABSTRACT | ACC_PUBLIC; CCSet(cb, Primitive); cbTypeSig(cb) = sig; cbTypeCode(cb) = typecode; cbSlotSize(cb) = slotsize; cbElementSize(cb) = elementsize; MakeClassSticky(cb); return cb; }
native_netscape_javascript_JSObject_initClass( JRIEnv* env, struct java_lang_Class* myClazz) { #ifdef JAVA struct java_lang_Class* clazz; /* this is to initialize the field lookup indices, and protect * the classes from gc. */ clazz = use_netscape_javascript_JSObject(env); MakeClassSticky((struct Hjava_lang_Class*)clazz); clazz = use_netscape_javascript_JSException(env); MakeClassSticky((struct Hjava_lang_Class*)clazz); /* this does nothing if somebody else has already set * stuff up (i.e. client or server) */ JSJ_InitStandalone(); #endif }