Class: YTLJit::VM::Node::SendAddressNode

Inherits:
SendNode
  • Object
show all
Includes:
InternalRubyType
Defined in:
lib/ytl/accmem.rb

Instance Method Summary collapse

Methods inherited from SendNode

#to_ruby

Instance Method Details

#collect_candidate_type_regident(context, slf) ⇒ Object



267
268
269
270
271
272
273
274
275
276
# File 'lib/ytl/accmem.rb', line 267

def collect_candidate_type_regident(context, slf)
  if slf.ruby_type == Runtime::Arena then
    tt = RubyType::BaseType.from_ruby_class(Fixnum)
    add_type(context.to_signature, tt)

    return context
  end

  super
end

#compile(context) ⇒ Object



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/ytl/accmem.rb', line 278

def compile(context)
  context = @arguments[2].compile(context)
  @arguments[2].decide_type_once(context.to_signature)
  rtype = @arguments[2].type
  rrtype = rtype.ruby_type
  if rrtype == Runtime::Arena then
    asm = context.assembler
    rsdata = TypedData.new(RData, context.ret_reg)
    asm.with_retry do
      dmy, arena = asm.mov(TMPR, rsdata[:data])
      asm.mov(TMPR, arena[0][:body])
    end
    context.ret_reg = TMPR
    context.ret_node = self
    context
  else
    super
  end
end