Class: CastOff::Compiler::SimpleIR::TmpBuffer

Inherits:
Variable show all
Defined in:
lib/cast_off/compile/ir/operand.rb

Constant Summary

Constants inherited from TypeContainer

CastOff::Compiler::SimpleIR::TypeContainer::FixnumWrapper, CastOff::Compiler::SimpleIR::TypeContainer::FloatWrapper

Instance Attribute Summary collapse

Attributes inherited from TypeContainer

#state, #types

Instance Method Summary collapse

Methods inherited from Variable

#class_exact?, #declare?, #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

#bug, #dlog, #todo, #vlog

Constructor Details

#initialize(index) ⇒ TmpBuffer

Returns a new instance of TmpBuffer.



912
913
914
915
# File 'lib/cast_off/compile/ir/operand.rb', line 912

def initialize(index)
  super()
  @index = index
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



910
911
912
# File 'lib/cast_off/compile/ir/operand.rb', line 910

def index
  @index
end

Instance Method Details

#==(v) ⇒ Object



930
931
932
# File 'lib/cast_off/compile/ir/operand.rb', line 930

def ==(v)
  eql?(v)
end

#eql?(v) ⇒ Boolean

Returns:

  • (Boolean)


925
926
927
928
# File 'lib/cast_off/compile/ir/operand.rb', line 925

def eql?(v)
  return false unless v.is_a?(TmpBuffer)
  @index == v.index
end

#hashObject



934
935
936
# File 'lib/cast_off/compile/ir/operand.rb', line 934

def hash
  self.to_name.hash
end

#sourceObject



921
922
923
# File 'lib/cast_off/compile/ir/operand.rb', line 921

def source
  bug()
end

#to_nameObject



917
918
919
# File 'lib/cast_off/compile/ir/operand.rb', line 917

def to_name
  "cast_off_argv[#{@index}]"
end