Module: YTLJit::VM::TypeCodeGen::ArrayTypeBoxedCodeGen

Includes:
AbsArch, CommonCodeGen
Defined in:
lib/ytljit/vm_type_gen.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 collapse

Instance Method Summary collapse

Methods included from CommonCodeGen

#dump_context, #gen_alloca, #gen_call

Instance Attribute Details

#element_typeObject

Returns the value of attribute element_type.



153
154
155
# File 'lib/ytljit/vm_type_gen.rb', line 153

def element_type
  @element_type
end

Instance Method Details

#==(other) ⇒ Object



178
179
180
181
182
183
184
185
186
187
# File 'lib/ytljit/vm_type_gen.rb', line 178

def ==(other)
  if other then
    oc = other.ruby_type
    sc = self.ruby_type
    sc == oc and
      @element_type == other.element_type
  else
    false
  end
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


189
190
191
192
# File 'lib/ytljit/vm_type_gen.rb', line 189

def eql?(other)
  self.class == other.class and
  @element_type == other.element_type
end

#gen_copy(context) ⇒ Object



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/ytljit/vm_type_gen.rb', line 159

def gen_copy(context)
  asm = context.assembler
  val = context.ret_reg
  vnode = context.ret_node
  context.start_using_reg(TMPR3)
  context.start_arg_reg
  rbarydup = OpMemAddress.new(address_of("rb_ary_dup"))
  asm.with_retry do
    asm.mov(FUNC_ARG[0], val)
  end
  context.set_reg_content(FUNC_ARG[0].dst_opecode, vnode)
  context = gen_call(context, rbarydup, 1, vnode)
  context.end_arg_reg
  context.end_using_reg(TMPR3)
  context.ret_reg = RETR

  context
end

#have_element?Boolean

Returns:

  • (Boolean)


155
156
157
# File 'lib/ytljit/vm_type_gen.rb', line 155

def have_element?
  true
end

#initObject



149
150
151
# File 'lib/ytljit/vm_type_gen.rb', line 149

def init
  @element_type = nil
end

#instanceObject



142
143
144
145
146
147
# File 'lib/ytljit/vm_type_gen.rb', line 142

def instance
  ni = self.dup
  ni.instance_eval { extend ArrayTypeBoxedCodeGen }
  ni.init
  ni
end