Class: YTLJit::VM::CollectInfoContext
- Defined in:
- lib/ytljit/vm_codegen.rb
Instance Attribute Summary collapse
-
#modified_global_var ⇒ Object
Returns the value of attribute modified_global_var.
-
#modified_instance_var ⇒ Object
Returns the value of attribute modified_instance_var.
-
#modified_local_var ⇒ Object
Returns the value of attribute modified_local_var.
-
#options ⇒ Object
Returns the value of attribute options.
-
#top_node ⇒ Object
readonly
Returns the value of attribute top_node.
-
#yield_node ⇒ Object
Returns the value of attribute yield_node.
Instance Method Summary collapse
-
#initialize(tnode) ⇒ CollectInfoContext
constructor
A new instance of CollectInfoContext.
- #marge_local_var(lvlist) ⇒ Object
Constructor Details
#initialize(tnode) ⇒ CollectInfoContext
Returns a new instance of CollectInfoContext.
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/ytljit/vm_codegen.rb', line 77 def initialize(tnode) @top_node = tnode @modified_local_var = [] @modified_instance_var = Hash.new @modified_global_var = Hash.new @yield_node = [] # Options from user @options = {} end |
Instance Attribute Details
#modified_global_var ⇒ Object
Returns the value of attribute modified_global_var.
91 92 93 |
# File 'lib/ytljit/vm_codegen.rb', line 91 def modified_global_var @modified_global_var end |
#modified_instance_var ⇒ Object
Returns the value of attribute modified_instance_var.
90 91 92 |
# File 'lib/ytljit/vm_codegen.rb', line 90 def modified_instance_var @modified_instance_var end |
#modified_local_var ⇒ Object
Returns the value of attribute modified_local_var.
89 90 91 |
# File 'lib/ytljit/vm_codegen.rb', line 89 def modified_local_var @modified_local_var end |
#options ⇒ Object
Returns the value of attribute options.
93 94 95 |
# File 'lib/ytljit/vm_codegen.rb', line 93 def @options end |
#top_node ⇒ Object (readonly)
Returns the value of attribute top_node.
88 89 90 |
# File 'lib/ytljit/vm_codegen.rb', line 88 def top_node @top_node end |
#yield_node ⇒ Object
Returns the value of attribute yield_node.
92 93 94 |
# File 'lib/ytljit/vm_codegen.rb', line 92 def yield_node @yield_node end |
Instance Method Details
#marge_local_var(lvlist) ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/ytljit/vm_codegen.rb', line 95 def marge_local_var(lvlist) res = nil lvlist.each do |lvs| if res then lvs.each_with_index do |lvt, i| dst = res[i] lvt.each do |idx, vall| dst[idx] = dst[idx] | vall end end else res = lvs.map {|lvt| lvt.dup} end end @modified_local_var[-1] = res end |