Skip to content

Commit

Permalink
Showing 4 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions j/sysimg.j
Original file line number Diff line number Diff line change
@@ -86,5 +86,16 @@ add(FDSet(),0)
has(FDSet(),0)
isequal(2,2)
compile_hint(getcwd, ())
compile_hint(fdio, (Int32,))
compile_hint(ProcessGroup, (Int32, Array{Any,1}, Array{Any,1}))
compile_hint(select_read, (FDSet, Int32))
compile_hint(next, (HashTable{Any,Any}, Int32))
compile_hint(perform_work, ())
compile_hint(isempty, (Array{Any,1},))
compile_hint(ref, (HashTable{Any,Any}, Int32))
compile_hint(event_loop, (Bool,))
compile_hint(start_client, ())
ccall(:jl_save_system_image, Void, (Ptr{Uint8},Ptr{Uint8}),
cstring("sys.ji"), cstring("j/start_image.j"))
8 changes: 8 additions & 0 deletions src/boot.j
Original file line number Diff line number Diff line change
@@ -259,3 +259,11 @@ Array{T}(::Type{T}, m::Size,n::Size,o::Size,p::Size) = Array(T, (m,n,o,p))

Array{N}(T, d::NTuple{N,Size}) = Array{T,N}(d)
Array(T, d::Size...) = Array(T, d)

function compile_hint(f, args::Tuple)
if !isgeneric(f)
return
end
ccall(:jl_get_specialization, Any, (Any, Any), f, args)
nothing
end
1 change: 1 addition & 0 deletions src/gf.c
Original file line number Diff line number Diff line change
@@ -923,6 +923,7 @@ jl_function_t *jl_method_lookup(jl_methtable_t *mt, jl_value_t **args, size_t na
}

// compile-time method lookup
DLLEXPORT
jl_function_t *jl_get_specialization(jl_function_t *f, jl_tuple_t *types)
{
assert(jl_is_gf(f));
1 change: 1 addition & 0 deletions src/julia.expmap
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@
jl_set_memio_func;
jl_symbol_n;
jl_matching_methods;
jl_get_specialization;
jl_is_builtin;
jl_is_genericfunc;
jl_genericfunc_name;

0 comments on commit bd40f4b

Please sign in to comment.