Skip to content

Commit

Permalink
missing compile
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Jan 9, 2015
1 parent 66d12ef commit a9bbe0a
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 @@ -1671,6 +1671,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 @@ -1693,6 +1694,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 @@ -1714,18 +1716,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 a9bbe0a

Please sign in to comment.