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



1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
# File 'lib/ytljit/vm.rb', line 1046

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



1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'lib/ytljit/vm.rb', line 1036

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



1058
1059
1060
1061
1062
1063
1064
1065
# File 'lib/ytljit/vm.rb', line 1058

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