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, #element_node_list, #id, #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.



2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
# File 'lib/ytljit/vm.rb', line 2459

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



2477
2478
2479
# File 'lib/ytljit/vm.rb', line 2477

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

#compile(context) ⇒ Object



2485
2486
2487
# File 'lib/ytljit/vm.rb', line 2485

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

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

Yields:



2473
2474
2475
# File 'lib/ytljit/vm.rb', line 2473

def traverse_childlen
  yield @body
end

#typeObject



2481
2482
2483
# File 'lib/ytljit/vm.rb', line 2481

def type
  @value.type
end