Class: Rubinius::AST::SendInstructionMethod

Inherits:
SendWithArguments show all
Defined in:
lib/compiler/ast/transforms.rb

Overview

Maps various methods to VM instructions

Constant Summary collapse

Methods =
{
  :__kind_of__     => :kind_of,
  :__instance_of__ => :instance_of,
  :__nil__         => :is_nil,
}
Arguments =
{
  :__kind_of__     => 1,
  :__instance_of__ => 1,
  :__nil__         => 0,
}

Instance Attribute Summary

Attributes inherited from SendWithArguments

#arguments

Attributes inherited from Send

#block, #check_for_local, #name, #privately, #receiver, #variable

Attributes inherited from Node

#line

Class Method Summary collapse

Methods inherited from SendWithArguments

#arguments_sexp, #initialize

Methods inherited from Send

#arguments_sexp, #check_local_reference, #initialize, #receiver_sexp, #sexp_name, #to_sexp

Methods inherited from Node

#ascii_graph, #attributes, #children, #initialize, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, #to_sexp, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk

Constructor Details

This class inherits a constructor from Rubinius::AST::SendWithArguments

Class Method Details

.match?(line, receiver, name, arguments, privately) ⇒ Boolean

Returns:

  • (Boolean)


256
257
258
259
260
261
# File 'lib/compiler/ast/transforms.rb', line 256

def self.match?(line, receiver, name, arguments, privately)
  return false unless rename = Methods[name]
  if match_arguments? arguments, Arguments[name]
    new line, receiver, rename, arguments, privately
  end
end