Class: CastOff::Compiler::SimpleIR::DynamicVariable
- Inherits:
-
Pointer
- Object
- TypeContainer
- Variable
- Pointer
- CastOff::Compiler::SimpleIR::DynamicVariable
- Defined in:
- lib/cast_off/compile/ir/operand.rb
Constant Summary
Constants inherited from TypeContainer
TypeContainer::FixnumWrapper, TypeContainer::FloatWrapper
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
Attributes inherited from TypeContainer
Instance Method Summary collapse
- #==(v) ⇒ Object
- #declare? ⇒ Boolean
- #eql?(v) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(name, idx, op_idx, lv, types) ⇒ DynamicVariable
constructor
A new instance of DynamicVariable.
- #source ⇒ Object
- #to_name ⇒ Object
Methods inherited from Variable
#class_exact?, #has_undefined_path, #is_class_exact, #reset
Methods inherited from TypeContainer
#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
Constructor Details
#initialize(name, idx, op_idx, lv, types) ⇒ DynamicVariable
Returns a new instance of DynamicVariable.
789 790 791 792 793 794 795 796 797 798 799 800 |
# File 'lib/cast_off/compile/ir/operand.rb', line 789 def initialize(name, idx, op_idx, lv, types) super() @name = name @index = idx @op_idx = op_idx @level = lv if types bug() unless types.is_a?(Array) is_annotated(types) end end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
787 788 789 |
# File 'lib/cast_off/compile/ir/operand.rb', line 787 def index @index end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
787 788 789 |
# File 'lib/cast_off/compile/ir/operand.rb', line 787 def level @level end |
Instance Method Details
#==(v) ⇒ Object
815 816 817 |
# File 'lib/cast_off/compile/ir/operand.rb', line 815 def ==(v) eql?(v) end |
#declare? ⇒ Boolean
823 824 825 |
# File 'lib/cast_off/compile/ir/operand.rb', line 823 def declare? false end |
#eql?(v) ⇒ Boolean
810 811 812 813 |
# File 'lib/cast_off/compile/ir/operand.rb', line 810 def eql?(v) return false unless v.is_a?(DynamicVariable) @index == v.index && @level == v.level end |
#hash ⇒ Object
819 820 821 |
# File 'lib/cast_off/compile/ir/operand.rb', line 819 def hash self.to_name.hash end |
#source ⇒ Object
806 807 808 |
# File 'lib/cast_off/compile/ir/operand.rb', line 806 def source @name.to_s end |
#to_name ⇒ Object
802 803 804 |
# File 'lib/cast_off/compile/ir/operand.rb', line 802 def to_name "dfp#{@level}[#{@op_idx}]" end |