KNIEXPORT jboolean KNI_IsInstanceOf(jobject objectHandle, jclass classHandle) { // Create handle for objectHandle Oop::Raw object = kni_read_handle(objectHandle); if (object.is_null()) { return KNI_TRUE; } JavaClass::Raw object_class = object.blueprint(); // Create handle for classHandle JavaClassObj::Raw mirror = kni_read_handle(classHandle); GUARANTEE(mirror.not_null(), "null argument to KNI_IsInstanceOf"); JavaClass::Raw other_class = mirror().java_class(); // Do subtype check return CAST_TO_JBOOLEAN(object_class().is_subtype_of(&other_class)); }
void InstanceClass::set_initialized() { TaskMirror::Raw tm; tm = task_mirror_desc(); GUARANTEE(tm.not_null(), "task mirror must not be null"); if (TaskMirrorDesc::is_being_initialized_mirror((TaskMirrorDesc*)tm.obj())){ tm = TaskMirror::clinit_list_lookup(this); GUARANTEE(tm.not_null(), "task mirror must not be null"); tm = TaskMirror::clinit_list_remove(this); } GUARANTEE(tm.not_null(), "task mirror must not be null"); JavaClassObj::Raw mirror = tm().real_java_mirror(); GUARANTEE(mirror.not_null(), "mirror must not be null"); if (mirror().status() == JavaClassObj::ERROR_FLAG) { return; } mirror().set_initialized(); set_task_mirror(&tm); }