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

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

Methods inherited from BaseType

#abnormal?, from_object, from_ruby_class, related_ruby_class, #ruby_type_raw, type_tab

Constructor Details

#initializeDefaultType0

Returns a new instance of DefaultType0.



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

def initialize
  super(Object)
end

Instance Method Details

#==(other) ⇒ Object



274
275
276
277
278
279
280
281
# File 'lib/ytljit/vm_type.rb', line 274

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

#boxedObject



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

def boxed
  true
end

#to_boxObject



270
271
272
# File 'lib/ytljit/vm_type.rb', line 270

def to_box
  @@boxed_type_tab[ruby_type].instance
end

#to_unboxObject



266
267
268
# File 'lib/ytljit/vm_type.rb', line 266

def to_unbox
  @@unboxed_type_tab[ruby_type].instance
end