class CodeTools::AST::CallCustom

Handles Rubinius.call_custom

Public Class Methods

match?(line, receiver, name, arguments, privately) click to toggle source
# File lib/rubinius/code/ast/transforms.rb, line 128
def self.match?(line, receiver, name, arguments, privately)
  match_send? receiver, :Rubinius, name, :call_custom
end

Public Instance Methods

bytecode(g) click to toggle source
# File lib/rubinius/code/ast/transforms.rb, line 132
def bytecode(g)
  if @arguments.splat?
    raise CompileError, "splat argument passed to call_custom"
  elsif @block
    raise CompileError, "block passed to call_custom"
  end

  pos(g)
  rec = @arguments.array.shift
  rec.bytecode(g)

  selector = @arguments.array.shift
  @arguments.bytecode(g)
  g.call_custom selector.value, @arguments.size
end