Module: YTLJit::VM::TypeCodeGen::FloatTypeUnboxedCodeGen

Includes:
AbsArch, CommonCodeGen, TypeUtil
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 Method Summary collapse

Methods included from CommonCodeGen

#dump_context, #gen_alloca, #gen_call, #gen_save_thepr

Methods included from TypeUtil

#gen_copy_common

Instance Method Details

#gen_boxing(context) ⇒ Object



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/ytljit/vm_type_gen.rb', line 238

def gen_boxing(context)
  asm = context.assembler
  val = context.ret_reg
  vnode = context.ret_node
  context.start_using_reg(TMPR2)
  context.start_arg_reg(FUNC_FLOAT_ARG)
  context.start_arg_reg
  addr = lambda {
    a = address_of("rb_float_new")
    $symbol_table[a] = "rb_float_new"
    a
  }
  rbfloatnew = OpVarMemAddress.new(addr)
=begin
  # This is sample of backtrace
  sh = OpMemAddress.new(address_of("ytl_step_handler"))
  context = gen_save_thepr(context)
  context = gen_call(context, sh, 0, vnode)
=end
  asm.with_retry do
    asm.mov(FUNC_FLOAT_ARG[0], val)
  end
  context.set_reg_content(FUNC_FLOAT_ARG[0].dst_opecode, vnode)
  context = gen_save_thepr(context)
  context = gen_call(context, rbfloatnew, 1, vnode)
  context.end_arg_reg
  context.end_arg_reg(FUNC_FLOAT_ARG)
#          context.end_using_reg(TMPR3)
  context.end_using_reg(TMPR2)
  context.ret_reg = RETR
  context
end

#gen_copy(context) ⇒ Object



279
280
281
# File 'lib/ytljit/vm_type_gen.rb', line 279

def gen_copy(context)
  context
end

#gen_unboxing(context) ⇒ Object



275
276
277
# File 'lib/ytljit/vm_type_gen.rb', line 275

def gen_unboxing(context)
  context
end

#include_nil?Boolean

Returns:

  • (Boolean)


271
272
273
# File 'lib/ytljit/vm_type_gen.rb', line 271

def include_nil?
  false
end