diff --git a/docs/Manifest.toml b/docs/Manifest.toml index d5430728ce5149..fad80f8fc18cc1 100644 --- a/docs/Manifest.toml +++ b/docs/Manifest.toml @@ -1,159 +1,119 @@ # This file is machine-generated - editing it directly is not advised -[[ArgTools]] -uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +julia_version = "1.8.2" +manifest_format = "2.0" +project_hash = "f8f17ea8030e6083899e9cc89b9b04cd28b94813" -[[Artifacts]] -uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" +[[deps.ANSIColoredPrinters]] +git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c" +uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9" +version = "0.0.1" -[[Base64]] +[[deps.Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" -[[CodeTracking]] +[[deps.CodeTracking]] deps = ["InteractiveUtils", "UUIDs"] -git-tree-sha1 = "8ad457cfeb0bca98732c97958ef81000a543e73e" +git-tree-sha1 = "cc4bd91eba9cdbbb4df4746124c22c0832a460d6" uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2" -version = "1.0.5" +version = "1.1.1" -[[Dates]] +[[deps.Dates]] deps = ["Printf"] uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" -[[DocStringExtensions]] -deps = ["LibGit2", "Markdown", "Pkg", "Test"] -git-tree-sha1 = "9d4f64f79012636741cf01133158a54b24924c32" +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "c36550cb29cbe373e95b3f40486b9a4148f89ffd" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" -version = "0.8.4" +version = "0.9.2" -[[Documenter]] -deps = ["Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] -git-tree-sha1 = "3ebb967819b284dc1e3c0422229b58a40a255649" +[[deps.Documenter]] +deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"] +git-tree-sha1 = "6030186b00a38e9d0434518627426570aac2ef95" uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -version = "0.26.3" +version = "0.27.23" -[[Downloads]] -deps = ["ArgTools", "LibCURL", "NetworkOptions"] -uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" - -[[IOCapture]] -deps = ["Logging"] -git-tree-sha1 = "377252859f740c217b936cebcd918a44f9b53b59" +[[deps.IOCapture]] +deps = ["Logging", "Random"] +git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a" uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" -version = "0.1.1" +version = "0.2.2" -[[InteractiveUtils]] +[[deps.InteractiveUtils]] deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" -[[JSON]] +[[deps.JSON]] deps = ["Dates", "Mmap", "Parsers", "Unicode"] -git-tree-sha1 = "81690084b6198a2e1da36fcfda16eeca9f9f24e4" +git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" -version = "0.21.1" +version = "0.21.3" -[[JuliaInterpreter]] +[[deps.JuliaInterpreter]] deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"] path = ".." uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a" -version = "0.8.11" - -[[LibCURL]] -deps = ["LibCURL_jll", "MozillaCACerts_jll"] -uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.9.15" -[[LibCURL_jll]] -deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] -uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" - -[[LibGit2]] +[[deps.LibGit2]] deps = ["Base64", "NetworkOptions", "Printf", "SHA"] uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" -[[LibSSH2_jll]] -deps = ["Artifacts", "Libdl", "MbedTLS_jll"] -uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" - -[[Libdl]] -uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" - -[[Logging]] +[[deps.Logging]] uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" -[[Markdown]] +[[deps.Markdown]] deps = ["Base64"] uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" -[[MbedTLS_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" - -[[Mmap]] +[[deps.Mmap]] uuid = "a63ad114-7e13-5084-954f-fe012c677804" -[[MozillaCACerts_jll]] -uuid = "14a3606d-f60d-562e-9121-12d972cd8159" - -[[NetworkOptions]] +[[deps.NetworkOptions]] uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" -[[Parsers]] -deps = ["Dates"] -git-tree-sha1 = "c8abc88faa3f7a3950832ac5d6e690881590d6dc" +[[deps.Parsers]] +deps = ["Dates", "SnoopPrecompile"] +git-tree-sha1 = "cceb0257b662528ecdf0b4b4302eb00e767b38e7" uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" -version = "1.1.0" +version = "2.5.0" -[[Pkg]] -deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] -uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" - -[[Printf]] +[[deps.Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" -[[REPL]] +[[deps.REPL]] deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" -[[Random]] -deps = ["Serialization"] +[[deps.Random]] +deps = ["SHA", "Serialization"] uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" -[[SHA]] +[[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" -[[Serialization]] +[[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" -[[Sockets]] -uuid = "6462fe0b-24de-5631-8697-dd941f90decc" - -[[TOML]] -deps = ["Dates"] -uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +[[deps.SnoopPrecompile]] +git-tree-sha1 = "f604441450a3c0569830946e5b33b78c928e1a85" +uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c" +version = "1.0.1" -[[Tar]] -deps = ["ArgTools", "SHA"] -uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" -[[Test]] +[[deps.Test]] deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" -[[UUIDs]] +[[deps.UUIDs]] deps = ["Random", "SHA"] uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" -[[Unicode]] +[[deps.Unicode]] uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" - -[[Zlib_jll]] -deps = ["Libdl"] -uuid = "83775a58-1f1d-513f-b197-d71354ab007a" - -[[nghttp2_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" - -[[p7zip_jll]] -deps = ["Artifacts", "Libdl"] -uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" diff --git a/docs/src/index.md b/docs/src/index.md index 71e8b27fa4966c..0b67a0466a6315 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -114,13 +114,13 @@ before error 2* 3 │ f_inner() 3 4 │ %3 = Base.println("after error") 4 4 └── return %3 -callee: f_inner() in Main at none:1, breakpoint(error(s::AbstractString) in Base at error.jl:33, line 33, ErrorException("inner error"))) +callee: f_inner() in Main at none:1, breakpoint(error(s::AbstractString) in Base at error.jl:35, line 35, ErrorException("inner error"))) julia> leaf(fr) -Frame for error(s::AbstractString) in Base at error.jl:33 - 1 33 1 ─ %1 = ($(QuoteNode(ErrorException)))(s) - 2* 33 │ %2 = Core.throw(%1) - 3 33 └── return %2 +Frame for error(s::AbstractString) in Base at error.jl:35 + 1 35 1 ─ %1 = ($(QuoteNode(ErrorException)))(s) + 2* 35 │ %2 = Core.throw(%1) + 3 35 └── return %2 s = "inner error" caller: f_inner() in Main at none:1 diff --git a/docs/src/internals.md b/docs/src/internals.md index c6926bdd513c7a..32a84732d499b5 100644 --- a/docs/src/internals.md +++ b/docs/src/internals.md @@ -160,8 +160,6 @@ JuliaInterpreter.finish_and_return!(frame) # output Test Passed - Expression: x + y == 3 - Evaluated: 3 == 3 ``` ## Toplevel code and world age diff --git a/src/optimize.jl b/src/optimize.jl index 8eeb5737546f86..0e87f0dee06b6e 100644 --- a/src/optimize.jl +++ b/src/optimize.jl @@ -133,6 +133,16 @@ function lookup_global_refs!(ex::Expr) return nothing end +function lookup_getproperties(a::Expr) + if a.head === :call && length(a.args) == 3 && + a.args[1] isa QuoteNode && a.args[1].value === Base.getproperty && + a.args[2] isa QuoteNode && a.args[2].value isa Module && + a.args[3] isa QuoteNode && a.args[3].value isa Symbol + return lookup_global_ref(Core.GlobalRef(a.args[2].value, a.args[3].value)) + end + return a +end + """ optimize!(code::CodeInfo, mod::Module) @@ -161,6 +171,7 @@ function optimize!(code::CodeInfo, scope) continue else lookup_global_refs!(stmt) + code.code[i] = lookup_getproperties(stmt) end end end diff --git a/test/interpret.jl b/test/interpret.jl index 2f3794aef175f8..52bb16c1edd2ef 100644 --- a/test/interpret.jl +++ b/test/interpret.jl @@ -845,6 +845,17 @@ end @interpret FunctionWrapper{Int,Tuple{}}(()->42) end +@testset "issue #550" begin + using FunctionWrappers:FunctionWrapper + f = (obs) -> (obs[1] = obs[3] * obs[4]; obs) + Tout = Vector{Int} + Tin = Tuple{Vector{Int}} + fw = FunctionWrapper{Tout, Tin}(f) + + obs = [0,2,3,4] + @test @interpret(fw(obs)) == fw(obs) +end + @testset "TypedSlots" begin function foo(x, y) z = x + y