Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust to upcoming julia#54341 #1511

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/compiler/interface2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,13 @@ if VERSION >= v"1.10.0-DEV.873"

function _pullback_generator(world::UInt, source, self, ctx, f, args)
ret = _generate_pullback(ctx, world, f, args...)
ret isa Core.CodeInfo && return ret
if ret isa Core.CodeInfo
if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
ret.nargs = 4
ret.isva = true
end
return ret
end

stub = Core.GeneratedFunctionStub(identity, Core.svec(:methodinstance, :ctx, :f, :args), Core.svec())
stub(world, source, ret)
Expand All @@ -85,7 +91,13 @@ end

function _callable_pullback_generator(world::UInt, source, self, Δ)
ret = _generate_callable_pullback(self, world, Δ)
ret isa Core.CodeInfo && return ret
if ret isa Core.CodeInfo
if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
ret.nargs = 2
ret.isva = false
end
return ret
end

stub = Core.GeneratedFunctionStub(identity, Core.svec(:methodinstance, :Δ), Core.svec())
stub(world, source, ret)
Expand Down
5 changes: 5 additions & 0 deletions src/lib/literal_getproperty.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ function _generate_literal_getproperty(ctx, world, x, ::Type{Val{f}}) where f
ci.edges = Core.MethodInstance[mi, mi_pb_getproperty, mi_getproperty, mi_rrule]
# XXX: on 1.10, we should also set metadata like min-world and max-world

if isdefined(Base, :__has_internal_change) && Base.__has_internal_change(v"1.12-alpha", :codeinfonargs)
ci.nargs = 5
ci.isva = false
end

return ci
else
# nothing to optimize here, need to recurse into `getproperty`
Expand Down
Loading