Skip to content

Commit

Permalink
Merge branch 'master' into hydra
Browse files Browse the repository at this point in the history
Conflicts:
	vm/agent_components.cpp
	vm/builtin/channel.cpp
	vm/builtin/nativefunction.cpp
	vm/builtin/system.cpp
	vm/capi/capi.cpp
	vm/capi/thread.cpp
	vm/gc/baker.cpp
	vm/gc/walker.cpp
	vm/global_lock.cpp
	vm/global_lock.hpp
	vm/llvm/jit_util.cpp
	vm/native_thread.cpp
	vm/native_thread.hpp
	vm/objectmemory.cpp
	vm/shared_state.cpp
	vm/shared_state.hpp
	vm/test/test.hpp
	vm/vm.cpp
  • Loading branch information
Evan Phoenix committed Sep 24, 2010
2 parents 7381c21 + aee1b9b commit adad191
Show file tree
Hide file tree
Showing 425 changed files with 40,273 additions and 19,276 deletions.
23 changes: 13 additions & 10 deletions README
Expand Up @@ -3,7 +3,10 @@
Rubinius is an implementation of the Ruby programming language. Rubinius
includes a bytecode virtual machine, parser, bytecode compiler, garbage
collector, JIT native machine code compiler, and Ruby core and standard
libraries. Rubinius currently implements Ruby version 1.8.7.
libraries.

Rubinius currently is compatible with Ruby version 1.8.7. Support for Ruby
version 1.9.2 is coming soon.


2. License
Expand All @@ -13,8 +16,8 @@ Rubinius uses the BSD license. See LICENSE for details.

3. Installing Rubinius

Rubinius runs on many *nix operating systems. Rubinius does not yet run on
Microsoft Windows.
Rubinius runs on Mac OS X and many Unix/Linux operating systems. Support for
Microsoft Windows is coming soon.

To install Rubinius, use the following steps. For more information about
building and running Rubinius, see doc/getting_started.txt.
Expand All @@ -25,20 +28,18 @@ and git installed.
1. git clone git://github.com/evanphx/rubinius.git
2. cd rubinius
3. ./configure --prefix=/path/to/install/dir
OR if you have LLVM installed
./configure --skip-system --prefix=/path/to/install/dir
4. rake install
5. Add /path/to/install/dir/bin to your PATH
6. Run rbx some_script.rb or just rbx to launch irb.
6. Run 'rbx some_script.rb' or just 'rbx' to launch IRB.


4. Version 1.0
4. Version 1.1

Rubinius has been under development as a public open-source project since
November 2006. Rubinius development is sponsored by Engine Yard, Inc. and
assisted by the generous work of over 100 contributors.

At version 1.0, Rubinius is significantly feature-complete. It is expected
At version 1.1, Rubinius is significantly feature-complete. It is expected
that your Ruby code will run correctly. Additionally, many MRI C extensions
are expected to work, as long as they do not depend on MRI-specific object
internals or the MRI interpreter internals.
Expand Down Expand Up @@ -67,9 +68,11 @@ improves, overall performance of your code under Rubinius will improve.
6. Tickets

Please file tickets for bugs or problems that you encounter. The issue tracker
is: http://github.com/evanphx/rubinius/issues. See doc/howto/write_a_ticket.txt
is: http://github.com/evanphx/rubinius/issues. For more documentation, build
Rubinius and run the 'rbx docs' command.


7. Contributing

The Rubinius team welcomes contributions. See doc/contributing.txt.
The Rubinius team welcomes contributions. Run 'rbx docs' and see the
"Contributing" page.
14 changes: 12 additions & 2 deletions Rakefile
Expand Up @@ -22,7 +22,7 @@ end
require config_rb
BUILD_CONFIG = Rubinius::BUILD_CONFIG

unless BUILD_CONFIG[:config_version] == 13
unless BUILD_CONFIG[:config_version] == 15
STDERR.puts "Your configuration is outdated, please run ./configure first"
exit 1
end
Expand All @@ -33,7 +33,17 @@ unless BUILD_CONFIG[:which_ruby] == :ruby or BUILD_CONFIG[:which_ruby] == :rbx
exit 1
end

$dlext = Config::CONFIG["DLEXT"]
bin = RbConfig::CONFIG["RUBY_INSTALL_NAME"] || RbConfig::CONFIG["ruby_install_name"]
bin << (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
build_ruby = File.join(RbConfig::CONFIG['bindir'], bin)

unless BUILD_CONFIG[:build_ruby] == build_ruby
STDERR.puts "Sorry, but you need to build with the same Ruby version it was configured with"
STDERR.puts "Please run ./configure again"
exit 1
end

$dlext = RbConfig::CONFIG["DLEXT"]

task :default => %w[build vm:test] do
unless File.directory? BUILD_CONFIG[:runtime]
Expand Down
1 change: 1 addition & 0 deletions benchmark/rubinius/pack/bm_AaZ.rb
@@ -1,3 +1,4 @@
# -*- encoding: ascii-8bit -*-
require 'benchmark'

total = (ENV['TOTAL'] || 50_000).to_i
Expand Down
Expand Up @@ -83,4 +83,41 @@
x.report("[X].pack('C*')") do
total.times { X.pack("C*") }
end

# U
x.report("[S].pack('U')") do
total.times { S.pack('U') }
end

x.report("[M].pack('U')") do
total.times { M.pack('U') }
end

x.report("[L].pack('U')") do
total.times { L.pack('U') }
end

x.report("[S].pack('U10')") do
total.times { S.pack('U10') }
end

x.report("[M].pack('U20')") do
total.times { M.pack('U20') }
end

x.report("[L].pack('U40')") do
total.times { L.pack('U40') }
end

x.report("[S].pack('U*')") do
total.times { S.pack('U*') }
end

x.report("[M].pack('U*')") do
total.times { M.pack('U*') }
end

x.report("[L].pack('U*')") do
total.times { L.pack('U*') }
end
end
@@ -1,3 +1,4 @@
# -*- encoding: ascii-8bit -*-
require 'benchmark'

total = (ENV['TOTAL'] || 80_000).to_i
Expand Down Expand Up @@ -34,4 +35,54 @@
x.report("[L].pack('M40')") do
total.times { L.pack('M40') }
end

# m
x.report("[S].pack('m')") do
total.times { S.pack('m') }
end

x.report("[M].pack('m')") do
total.times { M.pack('m') }
end

x.report("[L].pack('m')") do
total.times { L.pack('m') }
end

x.report("[S].pack('m40')") do
total.times { S.pack('m40') }
end

x.report("[M].pack('m40')") do
total.times { M.pack('m40') }
end

x.report("[L].pack('m40')") do
total.times { L.pack('m40') }
end

# u
x.report("[S].pack('u')") do
total.times { S.pack('u') }
end

x.report("[M].pack('u')") do
total.times { M.pack('u') }
end

x.report("[L].pack('u')") do
total.times { L.pack('u') }
end

x.report("[S].pack('u40')") do
total.times { S.pack('u40') }
end

x.report("[M].pack('u40')") do
total.times { M.pack('u40') }
end

x.report("[L].pack('u40')") do
total.times { L.pack('u40') }
end
end
62 changes: 62 additions & 0 deletions benchmark/rubinius/unpack/bm_BbHh.rb
@@ -0,0 +1,62 @@
# -*- encoding: ascii-8bit -*-
require 'benchmark'

total = (ENV['TOTAL'] || 500_000).to_i

S = "\207jN\353L\335\257\214\272\313\315\257\300\245\360\032\246\361\325\257\276\252\353\240\357\240"
M = "@\202\325-\001\e\252\361\312\330l\257c\310?:Q\020n\334\377\"\036\024\303j\335\032\b\354qohoc\335\r5\372\211\314\333\030\253\n\233\3744\376\315\240"
L = "H\272!\361\237A\336+0xG9J\356I\203'\321\365U\314) \273\217\254\334\a#\302m\263\032\334\333\226\003\\\022\260\365+\037\273\004\230\317\006\275\304F\317\377\276\366\375\325L\320.L\315\351\255\325\331\271\254.\016\323\227\364=\277 *\317\360\217}\302\230\267\354\333=N\363\r\377\331Np:,\r\332\341\276\306\214\017s\276\035\374\0053>\262\\\336\277\345\275\317\246\302\315\021\314\313\331\2256\302@"

Benchmark.bmbm do |x|
x.report("loop") do
total.times { 1 }
end

x.report("S.unpack('B')") do
total.times { S.unpack('B') }
end

x.report("S.unpack('b')") do
total.times { S.unpack('b') }
end

x.report("S.unpack('H')") do
total.times { S.unpack('H') }
end

x.report("S.unpack('h')") do
total.times { S.unpack('h') }
end

x.report("M.unpack('B20')") do
total.times { M.unpack('B20') }
end

x.report("M.unpack('b20')") do
total.times { M.unpack('b20') }
end

x.report("M.unpack('H5')") do
total.times { M.unpack('H5') }
end

x.report("M.unpack('h5')") do
total.times { M.unpack('h5') }
end

x.report("L.unpack('B*')") do
total.times { L.unpack('B*') }
end

x.report("L.unpack('b*')") do
total.times { L.unpack('b*') }
end

x.report("L.unpack('H*')") do
total.times { L.unpack('H*') }
end

x.report("L.unpack('h*')") do
total.times { L.unpack('h*') }
end
end
83 changes: 83 additions & 0 deletions benchmark/rubinius/unpack/bm_DEFG.rb
@@ -0,0 +1,83 @@
# -*- encoding: ascii-8bit -*-
require 'benchmark'

total = (ENV['TOTAL'] || 50_000).to_i

# Single-precision encoding
S = "\237+\003 _\240\002B\333\251\3155;A\217@n?\316P\036\210\303@?\337;\027\320\022cA\000=\221`\344X\341C\000=\221`\344X\341CR\236\363K\251\227\370?\000=\221`\344X\341Cn\335f\177\366G\217@\000\310Ngm\301\253C\000\001@\345\2340\242B\350\352\004 _\240\002B\324\032\004 _\240\002BZ\207\177\022PW%@\366\000\000\242\224\032mB7\311\000\350vH7B\325\320\251\346\245\320\373?\000\000\000\242\224\032mB\342\222\231\353\260\021\374?\000\240\330\205W4vC\000\0004&\365k\fC\000=\221`\344X\341C\000\0004&\365k\fC\000\000\220\036\304\274\326B\325\370\006 _\240\002Bf\001@\345\2340\242B-2\000 _\240\002B\000\200\3407y\303AC\361\360\233\034\341\306%@&\307y\000e\315\315A\240\365-\331\016j\370@\000=\221`\344X\341C\035\270\004 _\240\002Bd\e\000\350vH7B3\372\221\017\320\022cA_$\244\276W$Y@@\000\220\036\304\274\326B\3645\353\002\204\327\227A\000\200\3407y\303AC%A\323\372Ta\363?\000=\221`\344X\341C\000\200\3407y\303AC\020tt\001\320\022cApR\r\3733x%@\000\0004&\365k\fC\000\240\330\205W4vC\004V\a _\240\002B\006;\017\005\320\022cA\024\005\n\000e\315\315A7\2616\021\320\022cA"

# Double-precision encoding
D = "\237+\003 _\240\002B\333\251\3155;A\217@n?\316P\036\210\303@?\337;\027\320\022cA\000=\221`\344X\341C\000=\221`\344X\341CR\236\363K\251\227\370?\000=\221`\344X\341Cn\335f\177\366G\217@\000\310Ngm\301\253C\000\001@\345\2340\242B\350\352\004 _\240\002B\324\032\004 _\240\002BZ\207\177\022PW%@\366\000\000\242\224\032mB7\311\000\350vH7B\325\320\251\346\245\320\373?\000\000\000\242\224\032mB\342\222\231\353\260\021\374?\000\240\330\205W4vC\000\0004&\365k\fC\000=\221`\344X\341C\000\0004&\365k\fC\000\000\220\036\304\274\326B\325\370\006 _\240\002Bf\001@\345\2340\242B-2\000 _\240\002B\000\200\3407y\303AC\361\360\233\034\341\306%@&\307y\000e\315\315A\240\365-\331\016j\370@\000=\221`\344X\341C\035\270\004 _\240\002Bd\e\000\350vH7B3\372\221\017\320\022cA_$\244\276W$Y@@\000\220\036\304\274\326B\3645\353\002\204\327\227A\000\200\3407y\303AC%A\323\372Ta\363?\000=\221`\344X\341C\000\200\3407y\303AC\020tt\001\320\022cApR\r\3733x%@\000\0004&\365k\fC\000\240\330\205W4vC\004V\a _\240\002B\006;\017\005\320\022cA\024\005\n\000e\315\315A7\2616\021\320\022cA"


Benchmark.bmbm do |x|
x.report("loop") do
total.times { 1 }
end

# Single-precision
x.report("[S].unpack('F')") do
total.times { S.unpack("F") }
end

x.report("[S].unpack('f')") do
total.times { S.unpack("f") }
end

x.report("[S].unpack('e')") do
total.times { S.unpack("e") }
end

x.report("[S].unpack('g')") do
total.times { S.unpack("g") }
end

x.report("[S].unpack('F*')") do
total.times { S.unpack("F*") }
end

x.report("[S].unpack('f*')") do
total.times { S.unpack("f*") }
end

x.report("[S].unpack('e*')") do
total.times { S.unpack("e*") }
end

x.report("[S].unpack('g*')") do
total.times { S.unpack("g*") }
end

# Double-precision
x.report("[D].unpack('D')") do
total.times { D.unpack("D") }
end

x.report("[D].unpack('d')") do
total.times { D.unpack("d") }
end

x.report("[D].unpack('E')") do
total.times { D.unpack("E") }
end

x.report("[D].unpack('G')") do
total.times { D.unpack("G") }
end

x.report("[D].unpack('D*')") do
total.times { D.unpack("D*") }
end

x.report("[D].unpack('d*')") do
total.times { D.unpack("d*") }
end

x.report("[D].unpack('E*')") do
total.times { D.unpack("E*") }
end

x.report("[D].unpack('G*')") do
total.times { D.unpack("G*") }
end
end
4 changes: 2 additions & 2 deletions benchmark/yarv/report.rb
Expand Up @@ -25,8 +25,8 @@ def exec_command type, file, w

def benchmark cmd
rubybin = ENV['RUBY'] || File.join(
Config::CONFIG["bindir"],
Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"])
RbConfig::CONFIG["bindir"],
RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"])

IO.popen(rubybin, 'r+'){|io|
io.write cmd
Expand Down
4 changes: 2 additions & 2 deletions benchmark/yarv/runc.rb
Expand Up @@ -6,8 +6,8 @@
require 'rbconfig'

$rubybin = ENV['RUBY'] || File.join(
Config::CONFIG["bindir"],
Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"])
RbConfig::CONFIG["bindir"],
RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"])

def runfile file
puts file
Expand Down

0 comments on commit adad191

Please sign in to comment.