Also, to make it happen, this versionizes Proc::Method#inspect.
We didn't have caching for constant lookup for nested constants, such as Rubinius::VariableScope. This means that when a constants was referenced in that way, it would not cache the VariableScope constant. This commit introduces a constant cache very similar to not nested constants. It also stores the scope it was used under, so we can properly validate the have the correct constant. Also specialization is added to the JIT to have a fast path for these cached constants if they are still valid.
This ensures that classes loaded in kernel/common such as Binding also properly track the ivars for attr_* methods. Before Binding didn't get the proper optimized memory layout, significantly affecting performance of create a binding.
This can use the fast path if the instance variable is a packed ivar and is writter with an attr_writer. This also uses the typed check for slots like set_ivar does so it properly fails when a wrong type is set.