You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This transformation should identify Scala symbol
invocations in the tree and replace them with
references to a static member. Also, whenever
a class has at least a single symbol invocation
somewhere in its methods, a new static member
should be created and initialized for that symbol.
[...]
The reasoning behind this transformation is the
following. Symbols get interned - they are stored
in a global map which is protected with a lock.
The reason for this is making equality checks
quicker. But calling Symbol.apply, although it
does return a unique symbol, accesses a locked
object, making symbol access slow. To solve this,
the unique symbol from the global symbol map
in Symbol is accessed only once during class
loading, and after that, the unique symbol is in
the static member. Hence, it is cheap to both
reach the unique symbol and do equality
checks on it.
It seems like this transformation was never executed because the pattern did never match, and if it had, it would have broken horribly due bugs in the implementation.
The text was updated successfully, but these errors were encountered:
The comment in CleanUp says:
It seems like this transformation was never executed because the pattern did never match, and if it had, it would have broken horribly due bugs in the implementation.
The text was updated successfully, but these errors were encountered: