-
Notifications
You must be signed in to change notification settings - Fork 607
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin' into 1.8.7
Conflicts: Gemfile.lock kernel/common/module.rb spec/ruby/core/module/const_defined_spec.rb spec/ruby/core/module/prepend_spec.rb vm/symbol_table.cpp vm/symbol_table.hpp
- Loading branch information
Showing
7 changed files
with
108 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
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 | ||
end | ||
|
||
@o = klass.new | ||
|
||
jit(@o, :call) { @o.call } | ||
end | ||
|
||
it "compiles" do | ||
@o.method(:call).executable.jitted?.should be_true | ||
end | ||
|
||
it "returns the result of calling the method" do | ||
@o.call.should equal(:m) | ||
end | ||
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 | ||
|
||
@o = klass.new | ||
|
||
jit(@o, :call) { @o.call } | ||
end | ||
|
||
it "compiles" do | ||
@o.method(:call).executable.jitted?.should be_true | ||
end | ||
|
||
it "returns the result of calling the included method" do | ||
@o.call.should equal(:m) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters