public Function createFunctionObject(Context cx, Scriptable scope,
                                         Object bytecode,
                                         Object staticSecurityDomain)
    {
        Class cl = defineClass(bytecode, staticSecurityDomain);

        NativeFunction f;
        try {
            Constructor ctor = cl.getConstructors()[0];
            Object[] initArgs = { scope, cx, new Integer(0) };
            f = (NativeFunction)ctor.newInstance(initArgs);
        } catch (Exception ex) {
            throw new RuntimeException
                ("Unable to instantiate compiled class:"+ex.toString());
        }
        return f;
    }