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

Includes:
AbsArch, CommonCodeGen, ArrayTypeCommonCodeGen
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

Attributes included from ArrayTypeCommonCodeGen

#element_type

Instance Method Summary collapse

Methods included from ArrayTypeCommonCodeGen

#==, #have_element?, #init, #inspect

Methods included from CommonCodeGen

#dump_context, #gen_alloca, #gen_call, #gen_save_thepr

Instance Method Details

#copy_typeObject



245
246
247
248
249
250
# File 'lib/ytljit/vm_type_gen.rb', line 245

def copy_type
  dao = self.class.from_ruby_class(@ruby_type)
  dao = dao.to_box
  dao.element_type = @element_type
  dao
end

#gen_copy(context) ⇒ Object



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# File 'lib/ytljit/vm_type_gen.rb', line 222

def gen_copy(context)
  asm = context.assembler
  val = context.ret_reg
  vnode = context.ret_node
  context.start_arg_reg
  addr = lambda {
    a = address_of("rb_ary_dup")
    $symbol_table[a] = "rb_ary_dup"
    a
  }
  rbarydup = OpVarMemAddress.new(addr)
  asm.with_retry do
    asm.mov(FUNC_ARG[0], val)
  end
  context.set_reg_content(FUNC_ARG[0].dst_opecode, vnode)
  context = gen_save_thepr(context)
  context = gen_call(context, rbarydup, 1, vnode)
  context.end_arg_reg
  context.ret_reg = RETR

  context
end

#instanceObject



215
216
217
218
219
220
# File 'lib/ytljit/vm_type_gen.rb', line 215

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