Skip to content

Commit 088e62c

Browse files
committed
Use objectid as part of the hash since object_build_id is per owning module
1 parent d7196b6 commit 088e62c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/execution.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,17 @@ function cached_compilation(cache::AbstractDict{<:Any,V},
126126
end
127127

128128
@noinline function cache_file(ci::CodeInstance, cfg::CompilerConfig)
129+
h = hash(Base.objectid(ci))
129130
@static if isdefined(Base, :object_build_id)
130-
id = Base.object_build_id(ci)
131-
if id === nothing # CI is from a runtime compilation, not worth caching on disk
131+
bid = Base.object_build_id(ci)
132+
if bid === nothing # CI is from a runtime compilation, not worth caching on disk
132133
return nothing
133134
else
134-
id = id % UInt64 # The upper 64bit are a checksum, unavailable during precompilation
135+
bid = bid % UInt64 # The upper 64bit are a checksum, unavailable during precompilation
135136
end
136-
else
137-
id = Base.objectid(ci)
137+
h = hash(bid, h)
138138
end
139+
h = hash(cfg, h)
139140

140141
gpucompiler_buildid = Base.module_build_id(@__MODULE__)
141142
if (gpucompiler_buildid >> 64) % UInt64 == 0xffffffffffffffff
@@ -146,7 +147,7 @@ end
146147
cache_path(),
147148
# bifurcate the cache by build id of GPUCompiler
148149
string(gpucompiler_buildid),
149-
string(hash(cfg, hash(id)), ".jls"))
150+
string(h, ".jls"))
150151
end
151152

152153
@noinline function actual_compilation(cache::AbstractDict, src::MethodInstance, world::UInt,

0 commit comments

Comments
 (0)