Class: RubyVM::Instruction

Inherits:
Object
  • Object
show all
Includes:
Internal::ByteDecoder
Defined in:
lib/decompiler/vm/bytedecoder.rb

Defined Under Namespace

Classes: CONCATARRAY, CONCATSTRINGS, DEFINED, DUP, GETCONSTANT, GETDYNAMIC, GETINLINECACHE, GETLOCAL, GETSPECIAL, LEAVE, NEWARRAY, NEWHASH, NOP, POP, PUTOBJECT, PUTSELF, SEND, SETCONSTANT, SETDYNAMIC, SETINLINECACHE, SETLOCAL, SETN, THROW, TOPN, TOREGEXP, TOSTRING, TRACE

Constant Summary collapse

INFIX_OPCODES =
{
  OPT_PLUS  => '+'.intern,
  OPT_MINUS => '-'.intern,
  OPT_MULT  => :*,
  OPT_DIV   => :/,
  OPT_MOD   => :%,
  OPT_LTLT  => :<<,
  # OPT_GTGT  => :>>,
  OPT_EQ    => :==,
  OPT_NEQ   => :!=,
  OPT_GT    => :>,
  OPT_GE    => :>=,
  OPT_LT    => :<,
  OPT_LE    => :<=,
}
INFIX_OPERATORS =
INFIX_OPCODES.values + [ :===, :>> ]
PREFIX_OPCODES =
{
  OPT_NOT   => :!,
}
PREFIX_OPERATORS =
PREFIX_OPCODES.values + [ :~, :+@, :-@ ]
LITERAL_OPCODES =
[
  PUTNIL,
  DUPARRAY,
  PUTSTRING,
]
GET_VARIABLE_OPCODES =
[
  GETCLASSVARIABLE,
  GETINSTANCEVARIABLE,
  GETGLOBAL,
]
SET_VARIABLE_OPCODES =
[
  SETCLASSVARIABLE,
  SETINSTANCEVARIABLE,
  SETGLOBAL,
]