Class: YTLJit::RubyType::DefaultType0

Inherits:
BaseType show all
Includes:
VM::TypeCodeGen::DefaultTypeCodeGen
Defined in:
lib/ytljit/vm_type.rb

Overview

Same as VALUE type in MRI Type0 makes you can define “Defalut” class

Instance Attribute Summary

Attributes inherited from BaseType

#asm_type, #ruby_type

Instance Method Summary collapse

Methods included from VM::TypeCodeGen::DefaultTypeCodeGen

#gen_boxing, #gen_copy, #gen_unboxing, #have_element?, #init_type, #inspect, #instance

Methods inherited from BaseType

from_object, from_ruby_class, related_ruby_class, type_tab

Constructor Details

#initializeDefaultType0

Returns a new instance of DefaultType0.



250
251
252
# File 'lib/ytljit/vm_type.rb', line 250

def initialize
  super(Object)
end

Instance Method Details

#==(other) ⇒ Object



266
267
268
269
270
271
272
273
# File 'lib/ytljit/vm_type.rb', line 266

def ==(other)
  if other then
    self.ruby_type == other.ruby_type and 
      boxed == other.boxed
  else
    nil
  end
end

#boxedObject



254
255
256
# File 'lib/ytljit/vm_type.rb', line 254

def boxed
  true
end

#to_boxObject



262
263
264
# File 'lib/ytljit/vm_type.rb', line 262

def to_box
  @@boxed_type_tab[ruby_type].instance
end

#to_unboxObject



258
259
260
# File 'lib/ytljit/vm_type.rb', line 258

def to_unbox
  @@unboxed_type_tab[ruby_type].instance
end