Class

The RubyVM module only exists on MRI. RubyVM is not defined in other Ruby implementations such as JRuby and TruffleRuby.

The RubyVM module provides some access to MRI internals. This module is for very limited purposes, such as debugging, prototyping, and research. Normal users must not use it. This module is not portable between Ruby implementations.

Constants

::RubyVM::OPTS An Array of VM build options. This constant is MRI specific.

::RubyVM::INSTRUCTION_NAMES A list of bytecode instruction names in MRI. This constant is MRI specific.

::RubyVM::DEFAULT_PARAMS This constant exposes the VM’s default parameters. Note that changing these values does not affect VM execution. Specification is not stable and you should not depend on this value. Of course, this constant is MRI specific.

Class Methods

Return current keep_script_lines status. Now it only returns true of false, but it can return other objects in future.

Note that this is an API for ruby internal use, debugging, and research. Do not use this for any other purpose. The compatibility is not guaranteed.

It set keep_script_lines flag. If the flag is set, all loaded scripts are recorded in a interpreter process.

Note that this is an API for ruby internal use, debugging, and research. Do not use this for any other purpose. The compatibility is not guaranteed.

Returns a Hash containing implementation-dependent counters inside the VM.

This hash includes information about method/constant caches:

{
  :constant_cache_invalidations=>2,
  :constant_cache_misses=>14,
  :global_cvar_state=>27
}

If USE_DEBUG_COUNTER is enabled, debug counters will be included.

The contents of the hash are implementation specific and may be changed in the future.

This method is only expected to work on C Ruby.