Skip to content

Commit

Permalink
do type-inference using a work queue
Browse files Browse the repository at this point in the history
note: directly inferring linfo in pure_eval_call is unnecessary since abstract_call_gf_by_type would add this edge anyways
and it can be harmful since there was no logic here to prevent unbounded recursion in the type signature

fixes #9770
  • Loading branch information
vtjnash committed Mar 2, 2016
1 parent 0b6cab6 commit 8f4238a
Show file tree
Hide file tree
Showing 15 changed files with 783 additions and 628 deletions.
3 changes: 3 additions & 0 deletions base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ unsafe_convert{T}(::Type{T}, x::T) = x
(::Type{Array{T}}){T}(m::Int, n::Int) = Array{T,2}(m, n)
(::Type{Array{T}}){T}(m::Int, n::Int, o::Int) = Array{T,3}(m, n, o)

(::Type{Array{T,1}}){T}() = Array{T,1}(0)
(::Type{Array{T,2}}){T}() = Array{T,2}(0, 0)

# TODO: possibly turn these into deprecations
Array{T,N}(::Type{T}, d::NTuple{N,Int}) = Array{T}(d)
Array{T}(::Type{T}, d::Int...) = Array{T}(d)
Expand Down
15 changes: 1 addition & 14 deletions base/coreimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ include("operators.jl")
include("pointer.jl")
const checked_add = +
const checked_sub = -
(::Type{T}){T}(arg) = convert(T, arg)::T

# core array operations
include("abstractarray.jl")
Expand Down Expand Up @@ -71,19 +72,5 @@ include("iterator.jl")
# compiler
include("inference.jl")

precompile(CallStack, (Expr, Module, Tuple{Void}, EmptyCallStack))
precompile(_ieval, (Symbol,))
precompile(abstract_eval, (LambdaInfo, ObjectIdDict, VarInfo))
precompile(abstract_interpret, (Bool, ObjectIdDict, VarInfo))
precompile(delete_var!, (Expr, Symbol))
precompile(eval_annotate, (LambdaInfo, ObjectIdDict, VarInfo, ObjectIdDict, Array{Any,1}))
precompile(is_var_assigned, (Expr, Symbol))
precompile(isconstantfunc, (SymbolNode, VarInfo))
precompile(occurs_more, (Bool, Function, Int))
precompile(occurs_more, (UInt8, Function, Int))
precompile(occurs_undef, (Symbol, Expr))
precompile(sym_replace, (UInt8, Array{Any,1}, Array{Any,1}, Array{Any,1}, Array{Any,1}))
precompile(symequal, (Symbol, Symbol))

end # baremodule Inference
))
Loading

0 comments on commit 8f4238a

Please sign in to comment.