Module: YTLJit::VM::Node::MultipleCodeSpaceUtil

Included in:
ExceptionTopNode, LocalLabel, TopNode
Defined in:
lib/ytljit/vm.rb

Instance Method Summary collapse

Instance Method Details

#add_cs_for_signature(sig) ⇒ Object



945
946
947
948
949
950
951
952
953
954
955
# File 'lib/ytljit/vm.rb', line 945

def add_cs_for_signature(sig)
  cs = find_cs_by_signature(sig)
  if cs then
    return nil

  else
    cs = CodeSpace.new
    @code_spaces.push [sig, cs]
    return cs
  end
end

#find_cs_by_signature(sig) ⇒ Object



935
936
937
938
939
940
941
942
943
# File 'lib/ytljit/vm.rb', line 935

def find_cs_by_signature(sig)
  @code_spaces.each do |csig, val|
    if csig == sig then
      return val
    end
  end

  nil
end

#get_code_space(sig) ⇒ Object



957
958
959
960
961
962
963
964
# File 'lib/ytljit/vm.rb', line 957

def get_code_space(sig)
  cs = find_cs_by_signature(sig)
  if cs == nil then
    cs = CodeSpace.new
    @code_spaces.push [sig, cs]
  end
  cs
end