Class: YTLJit::VM::Node::LocalVarRefNode

Inherits:
LocalVarRefCommonNode show all
Defined in:
lib/ytljit/vm.rb

Direct Known Subclasses

SelfRefNode

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

Constants included from SSE

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

Instance Attribute Summary

Attributes inherited from LocalVarRefCommonNode

#current_frame_info, #frame_info

Attributes inherited from BaseNode

#code_space, #element_node_list, #id, #parent, #type

Instance Method Summary collapse

Methods included from NodeUtil

#search_class_top, #search_end, #search_frame_info, #search_top

Methods included from LocalVarNodeCodeGen

#gen_pursue_parent_function

Methods inherited from BaseNode

#add_element_node, #add_type, #decide_type, #decide_type_core, #decide_type_once, #gen_type_inference_proc, #inference_type, #merge_type, #same_type, #set_type_list, #ti_add_observer, #ti_changed, #ti_update, #type_list

Methods included from Inspect

#inspect_by_graph

Constructor Details

#initialize(parent, offset, depth) ⇒ LocalVarRefNode

Returns a new instance of LocalVarRefNode.



1458
1459
1460
1461
# File 'lib/ytljit/vm.rb', line 1458

def initialize(parent, offset, depth)
  super
  @var_type_info = nil
end

Instance Method Details

#collect_candidate_type(context) ⇒ Object



1475
1476
1477
1478
1479
1480
1481
# File 'lib/ytljit/vm.rb', line 1475

def collect_candidate_type(context)
  @var_type_info.each do |src|
    same_type(self, src, 
              context.to_key, context.to_key, context)
  end
  context
end

#collect_info(context) ⇒ Object



1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
# File 'lib/ytljit/vm.rb', line 1463

def collect_info(context)
  vti = context.modified_local_var[@depth][@offset]
  if vti then
    @var_type_info = vti.dup
  else
    roff = @current_frame_info.real_offset(@offset)
    @var_type_info = [@current_frame_info.frame_layout[roff]]
  end

  context
end

#compile(context) ⇒ Object



1483
1484
1485
1486
1487
1488
1489
1490
1491
# File 'lib/ytljit/vm.rb', line 1483

def compile(context)
  context = super(context)
  context = gen_pursue_parent_function(context, @depth)
  base = context.ret_reg
  offarg = @current_frame_info.offset_arg(@offset, base)
  context.ret_node = self
  context.ret_reg = offarg
  context
end