diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-09-24 15:09:50 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-09-24 15:09:50 +0200 |
commit | 759de8623923d17eaca373dcec14899681a52df4 (patch) | |
tree | 58a0a53e205828bb65c9ac6037f414c05e1465e5 /tools/codegen-anyvals | |
parent | b403c1d7524ccdfc3455b5bc5d5363fdd9c82bec (diff) | |
download | scala-759de8623923d17eaca373dcec14899681a52df4.tar.gz scala-759de8623923d17eaca373dcec14899681a52df4.tar.bz2 scala-759de8623923d17eaca373dcec14899681a52df4.zip |
fixes mirrorThatLoaded in JavaMirrors
`mirrorThatLoaded(sym: Symbol): Mirror` in JavaMirrors used to iterate over
`lazy val mirrors = new WeakHashMap[ClassLoader, WeakReference[JavaMirror]]()`
to find out what mirror has loaded a certain symbol.
It worked okay until yesterday when I noticed failing tests, which crashed
when weak references in mirrors were dereferenced with get.get. Apparently
some mirrors were collected, and the logic in JavaMirror didn't account for
that possibility.
When fixing this bug, I noticed that mirrors can become unreachable even
if there are still reachable symbols created by those mirrors. That doesn't
make sense, therefore I fixed this bug as well by introducing a strong ref
from root symbols to the enclosing mirror. Therefore, any active symbol
will have a strong reference to the enclosing mirror by the virtue of the
owner chain.
Diffstat (limited to 'tools/codegen-anyvals')
0 files changed, 0 insertions, 0 deletions