Class: YTLJit::VM::Node::YieldNode
- Defined in:
- lib/ytljit/vm.rb
Overview
yield(invokeblock)
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
Constants inherited from BaseNode
Instance Attribute Summary collapse
-
#depth ⇒ Object
Returns the value of attribute depth.
-
#frame_info ⇒ Object
readonly
Returns the value of attribute frame_info.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from BaseNode
#code_space, #debug_info, #element_node_list, #id, #is_escape, #parent, #ti_observee, #ti_observer, #type
Instance Method Summary collapse
- #calling_convention(context) ⇒ Object
- #collect_candidate_type(context) ⇒ Object
- #collect_info(context) ⇒ Object
- #compile(context) ⇒ Object
-
#initialize(parent) ⇒ YieldNode
constructor
A new instance of YieldNode.
- #method_top_node(ctop, slf) ⇒ Object
Methods included from SendUtil
#compile_c_fixarg, #compile_c_fixarg_raw, #compile_c_vararg, #compile_ytl, #gen_eval_self, #signature
Methods included from NodeUtil
#search_class_top, #search_end, #search_frame_info, #search_top
Methods inherited from BaseNode
#add_element_node, #add_element_node_backward, #add_element_node_backward_aux, #decide_type, #decide_type_core, #decide_type_once, #gen_type_inference_proc, #get_constant_value, #inference_type, #marge_element_node, #marge_type, #same_type, #search_valid_signature, #set_escape_node, #set_escape_node_backward, #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
Constructor Details
#initialize(parent) ⇒ YieldNode
Returns a new instance of YieldNode.
2880 2881 2882 2883 2884 2885 |
# File 'lib/ytljit/vm.rb', line 2880 def initialize(parent) super(parent) @name = "block yield" @frame_info = search_frame_info @depth = 0 end |
Instance Attribute Details
#depth ⇒ Object
Returns the value of attribute depth.
2889 2890 2891 |
# File 'lib/ytljit/vm.rb', line 2889 def depth @depth end |
#frame_info ⇒ Object (readonly)
Returns the value of attribute frame_info.
2888 2889 2890 |
# File 'lib/ytljit/vm.rb', line 2888 def frame_info @frame_info end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2887 2888 2889 |
# File 'lib/ytljit/vm.rb', line 2887 def name @name end |
Instance Method Details
#calling_convention(context) ⇒ Object
2900 2901 2902 |
# File 'lib/ytljit/vm.rb', line 2900 def calling_convention(context) :ytl end |
#collect_candidate_type(context) ⇒ Object
2896 2897 2898 |
# File 'lib/ytljit/vm.rb', line 2896 def collect_candidate_type(context) context end |
#collect_info(context) ⇒ Object
2891 2892 2893 2894 |
# File 'lib/ytljit/vm.rb', line 2891 def collect_info(context) context.yield_node.last.push @parent context end |
#compile(context) ⇒ Object
2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 |
# File 'lib/ytljit/vm.rb', line 2908 def compile(context) context = super(context) asm = context.assembler prevenv = @frame_info.offset_arg(0, BPR) prevenv2 = @frame_info.offset_arg(0, TMPR2) # offset of self is common, so it no nessery traverse prev frame # for @frame_info. slfarg = @frame_info.offset_arg(2, PTMPR) asm.with_retry do asm.mov(PTMPR, prevenv) end @depth.times do asm.with_retry do asm.mov(PTMPR, prevenv) end end asm.with_retry do asm.mov(PTMPR, slfarg) end context.set_reg_content(PTMPR, :self_of_block) context.ret_reg2 = PTMPR if @depth == 0 then context.ret_reg = @frame_info.offset_arg(1, BPR) else context.start_using_reg(TMPR2) asm.with_retry do asm.mov(TMPR2, prevenv) end (@depth - 1).times do asm.with_retry do asm.mov(TMPR2, prevenv2) end end asm.with_retry do asm.mov(TMPR2, @frame_info.offset_arg(1, TMPR2)) end context.ret_reg = TMPR2 end context.ret_node = self context.set_reg_content(context.ret_reg, self) context end |
#method_top_node(ctop, slf) ⇒ Object
2904 2905 2906 |
# File 'lib/ytljit/vm.rb', line 2904 def method_top_node(ctop, slf) nil end |