Class: CastOff::Compiler::SimpleIR::Variable

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

Direct Known Subclasses

Argument, LocalVariable, Pointer, Self, TmpBuffer, TmpVariable

Constant Summary

Constants inherited from TypeContainer

TypeContainer::FixnumWrapper, TypeContainer::FloatWrapper

Instance Attribute Summary

Attributes inherited from TypeContainer

#state, #types

Instance Method Summary collapse

Methods inherited from TypeContainer

#box, #boxed?, #boxed_form, #can_unbox?, #declare, #declare_class, #dynamic?, #is_also, #is_also?, #is_annotated, #is_dynamic, #is_just?, #is_negative_cond_value, #is_not, #is_static, #not_initialized, #static?, #to_debug_string, #to_name, #to_s, #unboxed?, #undefined?, #union

Methods included from Util

#bug, #dlog, #todo, #vlog

Constructor Details

#initializeVariable

Returns a new instance of Variable.



542
543
544
545
# File 'lib/cast_off/compile/ir/operand.rb', line 542

def initialize()
  super()
  @isclassexact = false
end

Instance Method Details

#class_exact?Boolean

Returns:

  • (Boolean)


547
548
549
# File 'lib/cast_off/compile/ir/operand.rb', line 547

def class_exact?
  @isclassexact
end

#declare?Boolean

Returns:

  • (Boolean)


560
561
562
# File 'lib/cast_off/compile/ir/operand.rb', line 560

def declare?
  self.is_a?(LocalVariable) || self.is_a?(TmpVariable) || self.is_a?(Pointer)
end

#has_undefined_pathObject



556
557
558
# File 'lib/cast_off/compile/ir/operand.rb', line 556

def has_undefined_path()
  # nothing to do
end

#is_class_exactObject



551
552
553
554
# File 'lib/cast_off/compile/ir/operand.rb', line 551

def is_class_exact()
  bug() if @isclassexact
  @isclassexact = true
end

#resetObject



564
565
566
567
568
569
570
571
572
573
574
575
576
577
# File 'lib/cast_off/compile/ir/operand.rb', line 564

def reset()
  @ignore.clear()
  case @state
  when :undefined
    bug()
  when :initialized, :dynamic
    @types = []
    @state = :undefined
  when :static
    # nothing to do
  else
    bug()
  end
end