This introduces some minor behavior changes:
- The "java type" of variables set via the RedBridge API is no longer stored.
Thus a variable that has been set to `String[]` will now come back as a
`RubyArray` object which can be used as a `List<String>`. The undocumented
previous behavior was to convert the value back to the same type it was
originally.
- BiVariableMap no longer holds a copy of all variables; it only actually
stores local varibles. All other types of variable are simply retrieved
from either the runtime's global state, or from the given receiver object,
if and when the variable is accessed.
- As a corollary, variables can now change value between the evaluation and
the moment when they are accessed via BiVariableMap, if some other threads
modifies them concurrently. This mostly affects LocalContextProvider that
use the global runtime, i.e. ConcurrentLocalContextProvider and obviously
SingletonLocalContextProvider. Such usage has always been race-y, but the
detail on what constitutes the critical section has changed.
This is an attempt at refactoring the BiVariableMap interface so it no longer keeps a copy of every single Ruby variable. It does still have to store all local variables, but for everything else it can retrieve them from either the specified receiver object or the Ruby runtime's global state.
This means instance varibles are no longer stored in BiVariableMap, thus they can no longer cause the #8527 memory leak. It should also improve performance somewhat because it avoids a lot of copying before and after every evaluation.
It does however introduce 2 minor behavior changes: