java_vm = JSJ_callbacks->get_java_vm(jEnv);
if (JSJ_callbacks && JSJ_callbacks->get_java_vm) java_vm = JSJ_callbacks->get_java_vm(jEnv);
jsj_MapJavaThreadToJSJavaThreadState(JNIEnv *jEnv, char **errp){    JSJavaThreadState *jsj_env;    SystemJavaVM *java_vm;    JSJavaVM *jsjava_vm;    /* If we found an existing thread state, just return it. */    jsj_env = find_jsjava_thread(jEnv);    if (jsj_env)        return jsj_env;    /* No one set up a LiveConnect thread state for a given Java thread.       Invoke the callback to create one on-the-fly. */    /* First, figure out which Java VM is calling us */    java_vm = JSJ_callbacks->get_java_vm(jEnv);    if (java_vm == NULL)        return NULL;    /* Get our private JavaVM data */    jsjava_vm = map_java_vm_to_jsjava_vm(java_vm);    if (!jsjava_vm) {        *errp = JS_smprintf("Total weirdness:   No JSJavaVM wrapper ever created "                            "for JavaVM 0x%08x", java_vm);        return NULL;    }    jsj_env = new_jsjava_thread_state(jsjava_vm, NULL, jEnv);    if (!jsj_env)        return NULL;    return jsj_env;}