Skip to content

Commit

Permalink
Don't interpret methods calling iolock_begin (#335)
Browse files Browse the repository at this point in the history
This is a temporary workaround for #330
  • Loading branch information
timholy authored Sep 8, 2019
1 parent 1608864 commit 3692e88
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/construct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ function prepare_framecode(method::Method, @nospecialize(argtypes); enter_genera
end
# Currenly, our strategy to deal with llvmcall can't handle parametric functions
# (the "mini interpreter" runs in module scope, not method scope)
if !isempty(lenv) && (hasarg(isequal(:llvmcall), code.code) || hasarg(a->is_global_ref(a, Base, :llvmcall), code.code))
if (!isempty(lenv) && (hasarg(isequal(:llvmcall), code.code) ||
hasarg(a->is_global_ref(a, Base, :llvmcall), code.code))) ||
hasarg(isequal(:iolock_begin), code.code)
return Compiled()
end
framecode = FrameCode(method, code; generator=generator)
Expand Down
2 changes: 2 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ function hasarg(predicate, args)
hasarg(predicate, a.args) && return true
elseif isa(a, QuoteNode)
predicate(a.value) && return true
elseif isa(a, GlobalRef)
predicate(a.name) && return true
end
end
return false
Expand Down
3 changes: 3 additions & 0 deletions test/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -585,3 +585,6 @@ module DataFramesTest
end
@test @interpret(df_debug1()) == df_debug1()
end

# issue #330
@test @interpret(Base.PipeEndpoint()) isa Base.PipeEndpoint

0 comments on commit 3692e88

Please sign in to comment.