Class: CastOff::Compiler::SimpleIR::InstanceVariable
Constant Summary
TypeContainer::FixnumWrapper, TypeContainer::FloatWrapper
Instance Attribute Summary collapse
#state, #types
Instance Method Summary
collapse
Methods inherited from Variable
#class_exact?, #declare?, #has_undefined_path, #is_class_exact, #reset
#box, #boxed?, #boxed_form, #can_unbox?, #class_exact?, #declare, #declare_class, #dynamic?, #is_also, #is_also?, #is_annotated, #is_class_exact, #is_dynamic, #is_just?, #is_negative_cond_value, #is_not, #is_static, #not_initialized, #reset, #static?, #to_debug_string, #to_s, #unboxed?, #undefined?, #union
Methods included from Util
#bug, #dlog, #todo, #vlog
Constructor Details
680
681
682
683
684
685
686
687
688
689
|
# File 'lib/cast_off/compile/ir/operand.rb', line 680
def initialize(id, types)
super()
@id = id
@name = id.slice(1, id.size - 1)
if types
bug() unless types.is_a?(Array)
is_annotated(types)
end
end
|
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
678
679
680
|
# File 'lib/cast_off/compile/ir/operand.rb', line 678
def id
@id
end
|
Instance Method Details
#==(v) ⇒ Object
704
705
706
|
# File 'lib/cast_off/compile/ir/operand.rb', line 704
def ==(v)
eql?(v)
end
|
#eql?(v) ⇒ Boolean
699
700
701
702
|
# File 'lib/cast_off/compile/ir/operand.rb', line 699
def eql?(v)
return false unless v.is_a?(InstanceVariable)
@id == v.id
end
|
#hash ⇒ Object
708
709
710
|
# File 'lib/cast_off/compile/ir/operand.rb', line 708
def hash
self.to_name.hash
end
|
#source ⇒ Object
695
696
697
|
# File 'lib/cast_off/compile/ir/operand.rb', line 695
def source
@id.to_s
end
|
#to_name ⇒ Object
691
692
693
|
# File 'lib/cast_off/compile/ir/operand.rb', line 691
def to_name
"instance_#{@name}"
end
|