The Ruby+OMR Preview
Ruby C C++ Yacc Makefile Emacs Lisp Other
Clone or download
Pull request Compare This branch is 59 commits ahead, 6508 commits behind ruby:trunk.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
basictest basictest: --run-opt option Oct 19, 2016
benchmark get rid of ambiguous parentheses warnings Nov 29, 2016
bin * bin/erb: $SAFE=3 is obsolete. Jun 18, 2015
bootstraptest `\s` includes `\t` Oct 11, 2016
ccan ccan/list/list.h: suppress unused argument warnings Sep 6, 2015
coverage fix a typo [ci skip] Sep 12, 2014
cygwin rubystub Aug 20, 2016
defs option for linux [ci skip] Oct 18, 2016
doc doc/standard_library.rdoc: Tk is removed from stdlib Dec 18, 2016
enc Merge Onigmo 6.0.0 Dec 10, 2016
ext Disable tailcall optimization in forwardable, if JIT exists. Dec 27, 2016
gems Update xmlrpc-0.2.1 for Ruby 2.4.0 release. Dec 22, 2016
include Add constant redefinition tracepoint. Mar 3, 2017
lib require "irb/output-method" for StdioOutputMethod Dec 13, 2016
man Remove Ns before puctuation Sep 26, 2016
misc ruby-additional.el: unquoted code block Nov 16, 2016
missing rubystub Aug 20, 2016
nacl Fix PNaCl configure/link errors. Oct 22, 2014
omr @ 67fc69e Add a preliminary ruby hot optimization strategy. Jan 26, 2017
rbjitglue Merge pull request #98 from mgaudet/Issue97.SplitTables Apr 20, 2017
sample get rid of ambiguous parentheses warnings Nov 29, 2016
spec default.mspec: end of options Nov 9, 2016
template Preliminary 2.4 Ruby+OMR JIT support. Dec 27, 2016
test Add constant redefinition tracepoint. Mar 3, 2017
tool Call into a specialized JIT helper for ivar get. Jan 24, 2017
win32 * win32/win32.c (winnt_stat): use `numberof` macro instead of constant. Dec 21, 2016
.document * .document: [DOC] add rbconfig. [ci skip] Sep 14, 2016
.editorconfig Add config for *.yml [ci skip] Oct 30, 2016
.gdbinit Use rb_mod_name instead of classname Nov 15, 2016
.gitattributes add .gitattributes Nov 19, 2015
.gitignore Preliminary 2.4 Ruby+OMR JIT support. Dec 27, 2016
.gitmodules Inline rbjitglue into Ruby repository Dec 27, 2016 * added for ruby-style. Mar 11, 2010
.travis.yml Add travis build support for OS/X. Jan 9, 2017
BSDL * BSDL: update copyright notice for 2013. Feb 9, 2013 [DOC] Please see _the_ official issue tracker... [ci skip] Jun 13, 2014
COPYING * ChangeLog: Remove trailing-whitespaces. May 11, 2016
COPYING.ja Change encoding from EUC-JP to UTF-8. [Feature #5128] Sep 4, 2011
GPL * GPL: update text of GPLv2. [ruby-core:44488] [Bug #6328] Jun 3, 2012
KNOWNBUGS.rb KNOWNBUGS.rb: Fixed typo, made more explicit [ci skip] Dec 13, 2015
LEGAL Use https instead of http in some URLs Sep 11, 2016 Modify Makefile to force VM to build dependencies. Jan 4, 2017
NEWS compile.c: toplevel return Dec 21, 2016
README.EXT README.EXT: add redirect [ruby-core:68631] Mar 25, 2015
README.EXT.ja README.EXT.ja: add redirect [ruby-core:68631] Mar 30, 2015 README{,.ja}.md: Drop support for BeOS now that Haiku is stable since… Sep 13, 2016 Add links to the Ruby+OMR blog posts Apr 5, 2017
acinclude.m4 acinclude.m4: rename Jan 3, 2016
aclocal.m4 aclocal.m4: add Jan 3, 2016
addr2line.c addr2line.c: boundary checks Oct 18, 2016
addr2line.h * addr2line.c (fill_lines): loop reverse order not to overwrite Mar 26, 2014
appveyor.yml Use environment variable for system ruby detection on appveyor. Nov 10, 2016
array.c array.c: do not resize to less than 0 Dec 20, 2016
bignum.c ruby.h: rb_big_sign Nov 19, 2016
class.c class.c: missing unknown_keyword_error Dec 4, 2016 Correct OMR build issues Dec 27, 2016
compar.c Comparable#clamp Aug 11, 2016
compile.c compile.c: toplevel return Dec 21, 2016
complex.c complex.c: optimize f_gt_p some cases Nov 22, 2016 Preliminary 2.4 Ruby+OMR JIT support. Dec 27, 2016
constant.h use id_table for constant tables Dec 29, 2015
cont.c Add volatile to a suppress warning. Dec 7, 2016
debug.c * debug.c (ruby_debug_printf): use rb_raw_obj_info() Jul 25, 2016
dir.c dir.c: merge rb_glob2 into rb_glob Nov 5, 2016
dln.c dln.c: raise LoadError Nov 19, 2016
dln.h dln.c: extra arguments Jun 30, 2013
dln_find.c dln_find.c: MAXPATHLEN is not used already Jun 2, 2016
dmydln.c * add -Wsuggest-attribute=noreturn and suppress warnings. May 8, 2016
dmyenc.c load.c: tweak the return value Dec 3, 2014
dmyext.c dmyenc.c: separate Nov 27, 2014
encindex.h revert r52336 (commit miss) Oct 29, 2015
encoding.c encoding.c: handle needmore error from rb_enc_precise_mbclen() Dec 14, 2016
enum.c array.c, enum.c: change sum algorithm Dec 6, 2016
enumerator.c Enumerator::Lazy#chunk_while defined. Nov 5, 2016
error.c error.c: redefined backtrace Nov 13, 2016
eval.c Add JIT command line option. Dec 30, 2016
eval_error.c Add clang volatile fixes from FreeBSD and NetBSD. Dec 7, 2016
eval_intern.h eval_intern.h: make TH_PUSH_TAG() initialize rb_vm_tag::tag with Qundef Sep 26, 2016
eval_jump.c eval_jump.c: restore previous error info Apr 22, 2016
file.c file.c: cygwin behavior Dec 7, 2016
gc.c * vm_trace.c (tracepoint_attr_callee_id, rb_tracearg_callee_id): Nov 5, 2016
gc.h * gc.h, gc.c: introduce new debug function rb_obj_info_dump(VALUE obj) Oct 6, 2015
gem_prelude.rb Reduce system calls by activating the `did_you_mean` gem. Feb 25, 2016
golf_prelude.rb * golf_prelude.rb: syntax formatting for whitespace [Fixes GH-425] Nov 7, 2013
goruby.c goruby.c: call Init_golf [ci skip] Aug 23, 2016
hash.c Updated documentation examples for Hash#value? Dec 10, 2016
ia64.s * removed trailing spaces. Jun 9, 2012
id_table.c id_table.c: extend, don't shrink Aug 14, 2016
id_table.h id_table.h: dummy sentinel Aug 6, 2016
inits.c Enable RubyVM::JIT again Dec 27, 2016
insns.def Preliminary 2.4 Ruby+OMR JIT support. Dec 27, 2016
internal.h Preliminary 2.4 Ruby+OMR JIT support. Dec 27, 2016
io.c io.c: [DOC] update outdated documentation of ARGF.close Dec 22, 2016
iseq.c Preliminary 2.4 Ruby+OMR JIT support. Dec 27, 2016
iseq.h * iseq.h (struct iseq_compile_data): use struct rb_id_table May 14, 2016
jit.h Merge pull request #98 from mgaudet/Issue97.SplitTables Apr 20, 2017
lex.c.blt parse.y: symbol literals for alias/undef Mar 16, 2016
load.c Adjust indent [ci skip] Dec 9, 2016
loadpath.c * loadpath.c (RUBY_REVISION): Defined to suppress revision.h Jun 17, 2013
localeinit.c * remove trailing spaces. Jun 19, 2016
main.c * include/ruby/debug.h: introdudced. Nov 20, 2012
marshal.c marshal.c: fix infinite recursion Nov 24, 2016
math.c math.c: unused_obj Nov 19, 2016
method.h * eval.c, method.h, proc.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_meth… Nov 5, 2016
miniinit.c miniinit.c: built-in encoding aliases Dec 26, 2015
no_jit.c Preliminary 2.4 Ruby+OMR JIT support. Dec 27, 2016
node.c node.c: flatten NODE_BLOCK [ci skip] Oct 5, 2016
node.h * compile.c: fix typos. Dec 14, 2015
numeric.c numeric.c: remove not used lines Dec 21, 2016
object.c object.c: no TypeError at special const Nov 29, 2016
omr_jit.c Remove -Xjit: prefix requirement from external interface Jan 13, 2017
pack.c Remove unused variable Dec 1, 2016
parse.y fix r57089 Dec 16, 2016
prelude.rb fix typo in `IO#write_nonblock` example [ci skip] Dec 7, 2016
probes.d change lingering dtrace probe documentation from function- to method- May 30, 2015
probes_helper.h vm.c: ruby_th_dtrace_setup Oct 29, 2015
proc.c proc.c: assume rb_iseq_location_t::first_lineno is always a Fixnum Dec 20, 2016
process.c process.c: PATH env in spawn Nov 6, 2016
random.c random.c: pack hash seeds Dec 6, 2016
range.c range.c: check loading Nov 11, 2016
rational.c round-down Nov 25, 2016
re.c re.c: consider the case of RMatch::regexp is nil Dec 20, 2016
regcomp.c regcomp.c: Fix compile error with old version of fcc on Solaris Dec 21, 2016
regenc.c Merge Onigmo 6.0.0 Dec 10, 2016
regenc.h Merge Onigmo 6.0.0 Dec 10, 2016
regerror.c Merge Onigmo 6.0.0 Dec 10, 2016
regexec.c Merge Onigmo 6.0.0 Dec 10, 2016
regint.h Merge Onigmo 6.0.0 Dec 10, 2016
regparse.c Merge Onigmo 6.0.0 Dec 10, 2016
regparse.h Merge Onigmo 6.0.0 Dec 10, 2016
regsyntax.c Merge Onigmo 6.0.0 Dec 10, 2016
ruby-runner.c ruby-runner.h Apr 14, 2016
ruby.c Add JIT command line option. Dec 30, 2016
ruby_assert.h fix build with VM_CHECK_MODE > 0 Jan 25, 2016
ruby_atomic.h Revert r52995 Dec 9, 2015
rubystub.c rubystub.c: sys/param.h for MAXPATHLEN Aug 20, 2016
safe.c * safe.c: removed needless doc related $SAFE=2 Jun 18, 2015
signal.c signal.c: improve stack overflow check Nov 27, 2016
siphash.c UNALIGNED_WORD_ACCESS on ppc64 Jul 23, 2014
siphash.h * siphash.h: check configure macros before include newer headers. Nov 9, 2012
sparc.c * sparc.c: Use __asm__ instead of asm for gcc. Apr 27, 2013
sprintf.c sprintf.c: fix width underflow Dec 17, 2016
st.c st.c: suppress a warning Dec 21, 2016
strftime.c strftime.c: limit result size Jun 14, 2016
string.c string.c: suppress a warning Dec 22, 2016
struct.c replace fixnum by integer in documents. Sep 8, 2016
symbol.c * symbol.c (is_identchar): use ISDIGIT instead of rb_enc_isalnum. May 26, 2016
symbol.h Use HAVE_BUILTIN___BUILTIN_CONSTANT_P May 20, 2016
thread.c proc.c: assume rb_iseq_location_t::first_lineno is always a Fixnum Dec 20, 2016
thread_pthread.c [DOC] replace Fixnum with Integer [ci skip] Oct 26, 2016
thread_pthread.h * thread_pthread.c (register_ubf_list): renamed from Nov 30, 2015
thread_sync.c thread_sync.c: Document exception types Sep 29, 2016
thread_win32.c Use PRIuSIZE format specifier for size_t values Sep 13, 2016
thread_win32.h * ext/openssl/depend: remove dependency from internal headers. May 14, 2014
time.c time.c: inquire suspicious values Dec 23, 2016
timev.h, win32/Makefile.sub: PACKED_STRUCT with VC Feb 25, 2014
transcode.c * lib/net/http/header.rb: Fix typo. [ci skip][fix GH-1407] Aug 16, 2016
transcode_data.h transcode_data.h: missing cast Aug 8, 2015
util.c util.c: round to even Nov 4, 2016
variable.c Add constant redefinition tracepoint. Mar 3, 2017
version.c version.c: no exit in ruby_show_copyright Jan 7, 2016
version.h * 2016-12-24 Dec 23, 2016
vm.c Migrate parts compilation logic to JIT DLL. Apr 10, 2017
vm_args.c vm_args.c: cache procs Oct 15, 2016
vm_backtrace.c * vm_trace.c (tracepoint_attr_callee_id, rb_tracearg_callee_id): Nov 5, 2016
vm_core.h Document some of the compilation control parts Apr 6, 2017
vm_debug.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} Apr 5, 2013
vm_dump.c Add JIT crash handler. Dec 27, 2016
vm_eval.c Add clang volatile fixes from FreeBSD and NetBSD. Dec 7, 2016
vm_exec.c * vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_.... Nov 5, 2016
vm_exec.h Preliminary 2.4 Ruby+OMR JIT support. Dec 27, 2016
vm_insnhelper.c Move more control logic into JIT DLL Apr 10, 2017
vm_insnhelper.h Preliminary 2.4 Ruby+OMR JIT support. Dec 27, 2016
vm_jit.c Merge pull request #98 from mgaudet/Issue97.SplitTables Apr 20, 2017
vm_method.c proc.c: assume rb_iseq_location_t::first_lineno is always a Fixnum Dec 20, 2016
vm_opts.h iseq.h: rename member Nov 25, 2015
vm_trace.c Add constant redefinition tracepoint. Mar 3, 2017
vsnprintf.c * internal.h (WARN_UNUSED_RESULT): moved to, to Sep 16, 2016


This branch contains a modified version of the Ruby VM that has been altered to interact with the Eclipse OMR compiler technolgy in order to add a Just-In-Time compiler to Ruby.

To read more about this project and its future, please see the following blog posts that introduce the tecnhnology and discuss its future.


As of today, this branch has only been tested on Linux x86-64. When run with


Which attempts to compile methods before invoking them even once, in some sense a stress test mode, the current status is make test passes, however, make test-all fails.

Building Ruby + OMR

Simplified steps to build Ruby + OMR. See more detailed instructions below to modify the install location, etc.

$ git clone --branch ruby_2_4_omr --recursive 
$ cd ruby
$ autoconf
$ ./configure SPEC=<specname> --with-omr-jit
$ make
$ make install

Since the Ruby + OMR code has only been tested on Linux x86-64, Linux PPC-LE-64, Linux PPC-BE-64 and Linux 390-64 the acceptable values for <specname> are:

1. linux_x86-64
2. linux_ppc-64_le_gcc
3. linux_ppc-64
4. linux_390-64

Running with the JIT compiler

The ruby interpreter takes a new command like option -J to pass JIT options.

Use the environment variable OMR_JIT_OPTIONS to pass options;

Some options of interest:

option Description
count=N. How many times a method needs to be invoked before it is compiled.
verbose Outputs compilation decisions to stdout
vlog=file Redirect compilation decision output to file
tracefull,log=file Produce a compilation log at file, suffixed with PID

Running without installing

If you haven't run make install, the dynamic loader will complain. Tell it where to find librbjit by pointing LD_LIBRARY_PATH to this directory.

So, running make test without installing:


What's Ruby

Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, and extensible.

Features of Ruby

  • Simple Syntax
  • Normal Object-oriented Features (e.g. class, method calls)
  • Advanced Object-oriented Features (e.g. Mix-in, Singleton-method)
  • Operator Overloading
  • Exception Handling
  • Iterators and Closures
  • Garbage Collection
  • Dynamic Loading of Object Files (on some architectures)
  • Highly Portable (works on many Unix-like/POSIX compatible platforms as well as Windows, Mac OS X, Haiku, etc.) cf.

How to get Ruby

For a complete list of ways to install Ruby, including using third-party tools like rvm, see:

The Ruby distribution files can be found on the following FTP site:

The trunk of the Ruby source tree can be checked out with the following command:

$ svn co ruby

Or if you are using git then use the following command:

$ git clone git://

There are some other branches under development. Try the following command to see the list of branches:

$ svn ls

Or if you are using git then use the following command:

$ git ls-remote git://

Ruby home page

The URL of the Ruby home page is:

Mailing list

There is a mailing list to talk about Ruby. To subscribe to this list, please send the following phrase:


in the mail body (not subject) to the address

How to compile and install

This is what you need to do to compile and install Ruby:

  1. If you want to use Microsoft Visual C++ to compile ruby, read win32/README.win32 instead of this document.

  2. If ./configure does not exist or is older than, run autoconf to (re)generate configure.

  3. Run ./configure, which will generate config.h and Makefile.

    Some C compiler flags may be added by default depending on your environment. Specify optflags=.. and warnflags=.. as necessary to override them.

  4. Edit defines.h if you need. Usually this step will not be needed.

  5. Remove comment mark(#) before the module names from ext/Setup (or add module names if not present), if you want to link modules statically.

    If you don't want to compile non static extension modules (probably on architectures which do not allow dynamic loading), remove comment mark from the line "#option nodynamic" in ext/Setup.

    Usually this step will not be needed.

  6. Run make.

  7. Optionally, run 'make check' to check whether the compiled Ruby interpreter works well. If you see the message "check succeeded", your ruby works as it should (hopefully).

  8. Run 'make install'

    This command will create the following directories and install files into them.

    • ${DESTDIR}${prefix}/bin
    • ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}
    • ${DESTDIR}${prefix}/include/ruby-${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
    • ${DESTDIR}${prefix}/lib
    • ${DESTDIR}${prefix}/lib/ruby
    • ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}
    • ${DESTDIR}${prefix}/lib/ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
    • ${DESTDIR}${prefix}/lib/ruby/site_ruby
    • ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}
    • ${DESTDIR}${prefix}/lib/ruby/site_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
    • ${DESTDIR}${prefix}/lib/ruby/vendor_ruby
    • ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}
    • ${DESTDIR}${prefix}/lib/ruby/vendor_ruby/${MAJOR}.${MINOR}.${TEENY}/${PLATFORM}
    • ${DESTDIR}${prefix}/lib/ruby/gems/${MAJOR}.${MINOR}.${TEENY}
    • ${DESTDIR}${prefix}/share/man/man1
    • ${DESTDIR}${prefix}/share/ri/${MAJOR}.${MINOR}.${TEENY}/system

    If Ruby's API version is 'x.y.z', the ${MAJOR} is 'x', the ${MINOR} is 'y', and the ${TEENY} is 'z'.

    NOTE: teeny of the API version may be different from one of Ruby's program version

    You may have to be a super user to install ruby.

If you fail to compile ruby, please send the detailed error report with the error log and machine/OS type, to help others.

Some extension libraries may not get compiled because of lack of necessary external libraries and/or headers, then you will need to run 'make distclean-ext' to remove old configuration after installing them in such case.


See the file COPYING.


Questions about the Ruby language can be asked on the Ruby-Talk mailing list ( or on websites like (

Bug reports should be filed at Read HowToReport for more information.


See the file

The Author

Ruby was originally designed and developed by Yukihiro Matsumoto (Matz) in 1995.