begin_method(CALLBACK_NEW_INSTANCE);
begin_method(NEW_INSTANCE);
    private void generateFactory() throws Exception {        int[] keys = getCallbackKeys();        // Factory.callback(int)        begin_method(GET_CALLBACK);        load_this();        load_arg(0);        process_switch(keys, new ProcessSwitchCallback() {                public void processCase(int key, Label end) throws Exception {                    getfield(getCallbackField(key));                    goTo(end);                }                public void processDefault() throws Exception {                    pop(); // stack height                    aconst_null();                }            });        return_value();        end_method();        // Factory.callback(int, Callback)        begin_method(SET_CALLBACK);        load_this();        load_arg(1);        load_arg(0);        process_switch(keys, new ProcessSwitchCallback() {                public void processCase(int key, Label end) throws Exception {                    putfield(getCallbackField(key));                    goTo(end);                }                public void processDefault() {                    pop2(); // stack height                }            });        return_value();        end_method();                // Factory.callbacks(Callbacks);        begin_method(SET_CALLBACKS);        load_this();        load_arg(0);        generateSetCallbacks();        return_value();        end_method();        // Factory.newInstance(Callbacks)        begin_method(CALLBACK_NEW_INSTANCE);        load_arg(0);        invoke_static_this(SET_THREAD_CALLBACKS, Void.TYPE, new Class[]{ Callbacks.class });        new_instance_this();        dup();        invoke_constructor_this();        dup();        load_arg(0);        generateSetCallbacks();        return_value();        end_method();        // Factory.newInstance(Class[], Object[], Callbacks)        Label skipSetCallbacks = make_label();        Label fail = make_label();        declare_field(PRIVATE_FINAL_STATIC, Map.class, CONSTRUCTOR_PROXY_MAP);         begin_method(CALLBACK_MULTIARG_NEW_INSTANCE);        load_arg(2);        invoke_static_this(SET_THREAD_CALLBACKS, Void.TYPE, new Class[]{ Callbacks.class });        getfield(CONSTRUCTOR_PROXY_MAP);        load_arg(0); // Class[] types        invoke(NEW_CLASS_KEY); // key        invoke(MethodConstants.MAP_GET); // PROXY_MAP.get(key(types))        checkcast(ConstructorProxy.class);        dup();        ifnull(fail);        load_arg(1);        invoke(PROXY_NEW_INSTANCE);        checkcast_this();        load_arg(2);        ifnull(skipSetCallbacks);        dup();        load_arg(2);        generateSetCallbacks();                mark(skipSetCallbacks);        return_value();        mark(fail);        throw_exception(IllegalArgumentException.class, "Constructor not found");        end_method();    }