Module: YTLJit::RubyType

Defined in:
lib/ytljit/vm_type.rb

Defined Under Namespace

Classes: BaseType, DefaultType0, RubyTypeBoxed, RubyTypeUnboxed

Class Method Summary collapse

Class Method Details

.define_wraped_class(klass, base = RubyTypeBoxed) ⇒ Object



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# File 'lib/ytljit/vm_type.rb', line 159

def self.define_wraped_class(klass, base = RubyTypeBoxed)
  cn = nil
  if klass.name then
    cn = klass.name.to_sym
  else
    cns = klass.inspect
    if /([a-zA-Z:]+)/ =~ cns then
      cn = $1.to_sym
    else
      raise "Unexcepcted class format #{cns}"
    end
  end
  basett, boxtt, unboxtt = BaseType.type_tab
  if boxtt[cn] == nil then
    BaseType.related_ruby_class(klass, base)
  end

  boxobj = boxtt[cn]
  unboxobj = unboxtt[cn]
  [boxobj, unboxobj]
end