Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: deabe675c687
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5e6fe27e8538
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Dec 28, 2015

  1. Copy the full SHA
    79e6247 View commit details
  2. Copy the full SHA
    5e6fe27 View commit details
Showing with 184 additions and 176 deletions.
  1. +1 −1 rakelib/gems.rake
  2. +1 −1 rakelib/preinstall_gems.rb
  3. +71 −69 spec/jit/call_site_spec.rb
  4. +107 −105 spec/jit/method_spec.rb
  5. +4 −0 spec/rbx.2.1.mspec
2 changes: 1 addition & 1 deletion rakelib/gems.rake
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ namespace :gems do
unless BUILD_CONFIG[:darwin] and
`which brew`.chomp.size > 0 and
$?.success? and
(openssl = `brew --prefix openssl`.chomp).size > 0
(openssl = `brew --prefix #{ENV["RBX_OPENSSL"] || "openssl"}`.chomp).size > 0
openssl = false
end

2 changes: 1 addition & 1 deletion rakelib/preinstall_gems.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
unless BUILD_CONFIG[:darwin] and
`which brew`.chomp.size > 0 and
$?.success? and
(openssl = `brew --prefix openssl`.chomp).size > 0
(openssl = `brew --prefix #{ENV["RBX_OPENSSL"] || "openssl"}`.chomp).size > 0
openssl = false
end

140 changes: 71 additions & 69 deletions spec/jit/call_site_spec.rb
Original file line number Diff line number Diff line change
@@ -1,100 +1,102 @@
require File.expand_path("../spec_helper", __FILE__)

describe "JIT compiling a call site" do
context "to m()" do
before :each do
klass = Class.new do
def m() :m end
def call() m() end
with_feature :jit do
describe "JIT compiling a call site" do
context "to m()" do
before :each do
klass = Class.new do
def m() :m end
def call() m() end
end

@o = klass.new

jit(@o, :call) { @o.call }
end

@o = klass.new
it "compiles" do
@o.method(:call).executable.jitted?.should be_true
end

jit(@o, :call) { @o.call }
it "returns the result of calling the method" do
@o.call.should equal(:m)
end
end

it "compiles" do
@o.method(:call).executable.jitted?.should be_true
end
context "to m() defined in an included module" do
before :each do
mod = Module.new do
def m() :m end
end
klass = Class.new do
def call() m() end
include mod
end

it "returns the result of calling the method" do
@o.call.should equal(:m)
end
end
@o = klass.new

context "to m() defined in an included module" do
before :each do
mod = Module.new do
def m() :m end
end
klass = Class.new do
def call() m() end
include mod
jit(@o, :call) { @o.call }
end

@o = klass.new
it "compiles" do
@o.method(:call).executable.jitted?.should be_true
end

jit(@o, :call) { @o.call }
it "returns the result of calling the included method" do
@o.call.should equal(:m)
end
end

it "compiles" do
@o.method(:call).executable.jitted?.should be_true
end
context "to m() defined in a prepended module" do
before :each do

it "returns the result of calling the included method" do
@o.call.should equal(:m)
end
end
mod = Module.new do
def m() :m end
end
klass = Class.new do
def m() :shadowed end
def call() m() end
prepend mod
end

context "to m() defined in a prepended module" do
before :each do
o = @o = klass.new

mod = Module.new do
def m() :m end
end
klass = Class.new do
def m() :shadowed end
def call() m() end
prepend mod
jit(o, :call) { o.call }
end

o = @o = klass.new
it "compiles" do
@o.method(:call).executable.jitted?.should be_true
end

jit(o, :call) { o.call }
it "returns the result of calling the prepended method" do
@o.call.should equal(:m)
end
end

it "compiles" do
@o.method(:call).executable.jitted?.should be_true
end
context "to m() that calls super defined in a prepended module" do
before :each do

it "returns the result of calling the prepended method" do
@o.call.should equal(:m)
end
end
mod = Module.new do
def m() super; :m end
end
klass = Class.new do
def m() :shadowed end
def call() m() end
prepend mod
end

context "to m() that calls super defined in a prepended module" do
before :each do
o = @o = klass.new

mod = Module.new do
def m() super; :m end
end
klass = Class.new do
def m() :shadowed end
def call() m() end
prepend mod
jit(o, :call) { o.call }
end

o = @o = klass.new

jit(o, :call) { o.call }
end

it "compiles" do
@o.method(:call).executable.jitted?.should be_true
end
it "compiles" do
@o.method(:call).executable.jitted?.should be_true
end

it "returns the result of calling the prepended method" do
@o.call.should equal(:m)
it "returns the result of calling the prepended method" do
@o.call.should equal(:m)
end
end
end
end
Loading