Class: YTLJit::VM::Node::ConstantAssignNode

Inherits:
VariableRefCommonNode show all
Includes:
HaveChildlenMixin, NodeUtil
Defined in:
lib/ytljit/vm.rb

Constant Summary

Constants included from AbsArch

AbsArch::AL, AbsArch::BL, AbsArch::CL, AbsArch::DL, AbsArch::FUNC_ARG, AbsArch::FUNC_ARG_YTL, AbsArch::FUNC_FLOAT_ARG, AbsArch::FUNC_FLOAT_ARG_YTL, AbsArch::INDIRECT_BPR, AbsArch::INDIRECT_RETR, AbsArch::INDIRECT_SPR, AbsArch::INDIRECT_TMPR, AbsArch::INDIRECT_TMPR2, AbsArch::INDIRECT_TMPR3

Constants included from SSE

SSE::XMM0, SSE::XMM1, SSE::XMM2, SSE::XMM3, SSE::XMM4, SSE::XMM5, SSE::XMM6, SSE::XMM7

Instance Attribute Summary

Attributes included from HaveChildlenMixin

#body

Attributes inherited from BaseNode

#code_space, #debug_info, #element_node_list, #id, #is_escape, #parent, #ti_observee, #ti_observer

Instance Method Summary collapse

Methods included from NodeUtil

#search_class_top, #search_end, #search_frame_info, #search_top

Methods inherited from BaseNode

#add_element_node, #collect_info, #decide_type, #decide_type_core, #decide_type_once, #gen_type_inference_proc, #get_constant_value, #inference_type, #merge_type, #same_type, #ti_add_observer, #ti_changed, #ti_del_link, #ti_reset, #ti_update

Methods included from TypeListWithSignature

#add_type, #set_type_list, #type_list, #type_list_initvar

Methods included from Inspect

#inspect_by_graph

Constructor Details

#initialize(parent, klass, name, value) ⇒ ConstantAssignNode

Returns a new instance of ConstantAssignNode.



2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
# File 'lib/ytljit/vm.rb', line 2788

def initialize(parent, klass, name, value)
  super(parent)
  @name = name
  @class_top = klass # .search_class_top
  @value = value

  if klass.is_a?(ClassTopNode) then
    klass.constant_tab[@name] = @value
  else
    pp klass.class
    raise "Not Implemented yet for set constant for dynamic class"
  end
end

Instance Method Details

#collect_candidate_type(context) ⇒ Object



2806
2807
2808
# File 'lib/ytljit/vm.rb', line 2806

def collect_candidate_type(context)
  @body.collect_candidate_type(context)
end

#compile(context) ⇒ Object



2814
2815
2816
# File 'lib/ytljit/vm.rb', line 2814

def compile(context)
  @body.compile(context)
end

#traverse_childlen {|@body| ... } ⇒ Object

Yields:



2802
2803
2804
# File 'lib/ytljit/vm.rb', line 2802

def traverse_childlen
  yield @body
end

#typeObject



2810
2811
2812
# File 'lib/ytljit/vm.rb', line 2810

def type
  @value.type
end