Skip to content

Commit

Permalink
missing compile
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Feb 21, 2015
1 parent e726434 commit 95d69c4
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,7 @@ DLLEXPORT jl_value_t *jl_gf_invoke_lookup(jl_function_t *gf, jl_tuple_t *types)
return (jl_value_t*)m;
}

// tt has to be a leaf type.
jl_function_t*
jl_gf_invoke_get_specialization(jl_function_t *gf, jl_tuple_t *types,
jl_tuple_t *tt)
Expand All @@ -1755,6 +1756,7 @@ jl_gf_invoke_get_specialization(jl_function_t *gf, jl_tuple_t *types,
mfunc = jl_method_table_assoc_exact_by_type(m->invokes, tt);
}
if (mfunc != jl_bottom_func) {
jl_compile(mfunc);
return mfunc;
}

Expand All @@ -1776,18 +1778,14 @@ jl_gf_invoke_get_specialization(jl_function_t *gf, jl_tuple_t *types,
assert(ti != (jl_value_t*)jl_bottom_type);
(void)ti;
// don't bother computing this if no arguments are tuples
size_t i;
for (i = 0;i < jl_tuple_len(tt);i++) {
if (jl_is_tuple(jl_tupleref(tt,i))) {
for (size_t i = 0;i < jl_tuple_len(tt);i++) {
if (jl_is_tuple(jl_tupleref(tt, i))) {
newsig = (jl_tuple_t*)jl_instantiate_type_with(
(jl_value_t*)m->sig, &jl_tupleref(tpenv, 0),
jl_tuple_len(tpenv) / 2);
break;
}
}
if (i < jl_tuple_len(tt)) {
newsig =
(jl_tuple_t*)jl_instantiate_type_with((jl_value_t*)m->sig,
&jl_tupleref(tpenv, 0),
jl_tuple_len(tpenv) / 2);
}
}
mfunc = cache_method(m->invokes, tt, m->func, newsig, tpenv);
JL_GC_POP();
Expand Down

0 comments on commit 95d69c4

Please sign in to comment.