Module: YTLJit::OpVarValueMixin

Included in:
OpVarImmidiate32, OpVarImmidiate64, OpVarMem32, OpVarMem64
Defined in:
lib/ytljit/instruction.rb

Constant Summary collapse

@@instances =
[]

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instancesObject



62
63
64
# File 'lib/ytljit/instruction.rb', line 62

def self.instances
  @@instances
end

Instance Method Details

#add_refer(stfunc) ⇒ Object



54
55
56
# File 'lib/ytljit/instruction.rb', line 54

def add_refer(stfunc)
  @refer.push stfunc
end

#initialize(var) ⇒ Object



40
41
42
43
44
# File 'lib/ytljit/instruction.rb', line 40

def initialize(var)
  @var = var
  @refer = []
  @@instances.push self
end

#referObject



46
47
48
# File 'lib/ytljit/instruction.rb', line 46

def refer
  @refer
end

#to_immidiate(klass = OpVarImmidiateAddress) ⇒ Object



58
59
60
# File 'lib/ytljit/instruction.rb', line 58

def to_immidiate(klass = OpVarImmidiateAddress)
  klass.new(@var)
end

#valueObject



50
51
52
# File 'lib/ytljit/instruction.rb', line 50

def value
  @var.call
end