Code Review: NewSingletons3

tfpt review “/shelveset:NewSingletons3;REDMOND\tomat”

Initial work to improve singletons.

  • Improves reflection cache generator - it searches IronRuby.dll for
    all types marked by [ReflectionCache] attribute and generates ref-cache
    entries for all their methods and properties marked with [Emitted]
    attribute.
  • Merges RubyModule.Subclass into RubyModule, i.e. RubyModule now
    implements IRubyObject.
  • IRubyObjects now hold on their immediate class (not nominal class)
    and that reference might change once from a non-singleton to a singleton
    class.
    This change allows IRubyObject singletons (including modules and
    classes when used in static method calls) to have the same rules as
    non-singleton objects. The rule no longer needs to hold on such objects.
  • Implements module freezing: methods, constants, instance and class
    variables, mixins cannot be modified on a frozen module. Besides, if an
    object is frozen its singleton class is (recursively) frozen as well.
  • Fixes object freezing: instance variables cannot be modified on a
    frozen object (we allowed it).

Tomas

Looks good.