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
Instance Attribute Summary collapse
-
#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, #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
Constructor Details
#initialize(parent) ⇒ YieldNode
Returns a new instance of YieldNode.
2057 2058 2059 2060 2061 |
# File 'lib/ytljit/vm.rb', line 2057 def initialize(parent) super(parent) @name = "block yield" @frame_info = search_frame_info end |
Instance Attribute Details
#frame_info ⇒ Object (readonly)
Returns the value of attribute frame_info.
2064 2065 2066 |
# File 'lib/ytljit/vm.rb', line 2064 def frame_info @frame_info end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
2063 2064 2065 |
# File 'lib/ytljit/vm.rb', line 2063 def name @name end |
Instance Method Details
#calling_convention(context) ⇒ Object
2075 2076 2077 |
# File 'lib/ytljit/vm.rb', line 2075 def calling_convention(context) :ytl end |
#collect_candidate_type(context) ⇒ Object
2071 2072 2073 |
# File 'lib/ytljit/vm.rb', line 2071 def collect_candidate_type(context) context end |
#collect_info(context) ⇒ Object
2066 2067 2068 2069 |
# File 'lib/ytljit/vm.rb', line 2066 def collect_info(context) context.yield_node.last.push @parent context end |
#compile(context) ⇒ Object
2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 |
# File 'lib/ytljit/vm.rb', line 2083 def compile(context) context = super(context) asm = context.assembler # You can crash when you use yield in block. # You can fix this bug for traversing PTMPR for method top. # But is is little troublesome. So it is not supported. prevenv = @frame_info.offset_arg(0, BPR) # 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) asm.mov(PTMPR, slfarg) end context.ret_reg2 = PTMPR context.ret_reg = @frame_info.offset_arg(1, BPR) context.ret_node = self context.set_reg_content(context.ret_reg, self) context end |
#method_top_node(ctop, slf) ⇒ Object
2079 2080 2081 |
# File 'lib/ytljit/vm.rb', line 2079 def method_top_node(ctop, slf) nil end |