Exemple #1
0
def equal_hash_ref_loop(data, idx, key, env, cont):
    from pycket.interpreter import return_value
    from pycket.prims.equal import equal_func_unroll_n, EqualInfo
    if idx >= len(data):
        return return_value(w_missing, env, cont)
    k, v = data[idx]
    info = EqualInfo.BASIC_SINGLETON
    cont = catch_ref_is_equal_cont(data, idx, key, v, env, cont)
    return equal_func_unroll_n(k, key, info, env, cont, 5)
Exemple #2
0
def equal_hash_ref_loop(data, idx, key, env, cont):
    from pycket.interpreter import return_value
    from pycket.prims.equal import equal_func_unroll_n, EqualInfo
    if idx >= len(data):
        return return_value(w_missing, env, cont)
    k, v = data[idx]
    info = EqualInfo.BASIC_SINGLETON
    cont = catch_ref_is_equal_cont(data, idx, key, v, env, cont)
    return equal_func_unroll_n(k, key, info, env, cont, 5)
Exemple #3
0
def check_chaperone_results_loop(vals, args, idx, env, cont):
    from pycket.interpreter import return_multi_vals
    from pycket.prims.equal import equal_func_unroll_n, EqualInfo
    while idx < len(args) and vals.get_value(idx) is None and args[idx] is None:
        idx += 1
    if idx >= len(args):
        return return_multi_vals(vals, env, cont)
    info = EqualInfo.CHAPERONE_SINGLETON
    # XXX it would be best to store the parameter on the toplevel env and make
    # it changeable via a cmdline parameter to pycket-c
    unroll_n_times = 2 # XXX needs tuning
    return equal_func_unroll_n(vals.get_value(idx), args[idx], info, env,
            catch_equal_cont(vals, args, idx, env, cont), unroll_n_times)
Exemple #4
0
def check_chaperone_results_loop(vals, args, idx, env, cont):
    from pycket.interpreter import return_multi_vals
    from pycket.prims.equal import equal_func_unroll_n, EqualInfo
    while idx < len(args) and vals.get_value(idx) is None and args[idx] is None:
        idx += 1
    if idx >= len(args):
        return return_multi_vals(vals, env, cont)
    info = EqualInfo.CHAPERONE_SINGLETON
    # XXX it would be best to store the parameter on the toplevel env and make
    # it changeable via a cmdline parameter to pycket-c
    unroll_n_times = 2 # XXX needs tuning
    return equal_func_unroll_n(vals.get_value(idx), args[idx], info, env,
            catch_equal_cont(vals, args, idx, env, cont), unroll_n_times)
Exemple #5
0
def impersonator_of(a, b, env, cont):
    info = EqualInfo.IMPERSONATOR_SINGLETON
    return equal_func_unroll_n(a, b, info, env, cont, n=5)
Exemple #6
0
def chaperone_of(a, b, env, cont):
    info = EqualInfo.CHAPERONE_SINGLETON
    return equal_func_unroll_n(a, b, info, env, cont, n=5)
Exemple #7
0
def impersonator_of(a, b, env, cont):
    info = EqualInfo.IMPERSONATOR_SINGLETON
    return equal_func_unroll_n(a, b, info, env, cont, n=5)
Exemple #8
0
def chaperone_of(a, b, env, cont):
    info = EqualInfo.CHAPERONE_SINGLETON
    return equal_func_unroll_n(a, b, info, env, cont, n=5)