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: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 38ac7919ede2
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: de5b1c0faa84
Choose a head ref
  • 4 commits
  • 1 file changed
  • 2 contributors

Commits on Aug 23, 2015

  1. Removes trailing whitespace

    benlovell committed Aug 23, 2015
    Copy the full SHA
    9316865 View commit details
  2. Copy the full SHA
    8f8a448 View commit details
  3. Silences noisy constant reassignment warnings

    Given these specs run in 'interpreter' and 'JIT' spec contexts, certain
    constants are reassigned during the test runs. These warnings are of no
    use to us and should be deemed surplus to requirement. They have been
    removed with or-equals assignment where it made sense and
    `silence_warnings` elsewhere.
    benlovell committed Aug 23, 2015
    Copy the full SHA
    304d699 View commit details

Commits on Aug 24, 2015

  1. Merge pull request #3277 from benlovell/spec-improvements

    Spec improvements
    enebo committed Aug 24, 2015
    Copy the full SHA
    de5b1c0 View commit details
Showing with 16 additions and 12 deletions.
  1. +16 −12 spec/compiler/general_spec.rb
28 changes: 16 additions & 12 deletions spec/compiler/general_spec.rb
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ module JITSpecUtils
def run_in_method(src, filename = caller_locations[0].path, line = caller_locations[0].lineno)
run( "def __temp; #{src}; end; __temp", filename, line)
end

def run(src, filename = caller_locations[0].path, line = caller_locations[0].lineno)
yield compile_run(src, filename, line) unless (ENV['COMPILER_TEST'] == 'false')
end
@@ -68,8 +68,8 @@ def compile_to_method(src, filename, lineno)
oj.runtime.builtin.IRubyObject[].java_class,
oj.runtime.Block.java_class,
oj.RubyModule.java_class,
java.lang.String.java_class);
handle = java.lang.invoke.MethodHandles.publicLookup().unreflect(scriptMethod);
java.lang.String.java_class)
handle = java.lang.invoke.MethodHandles.publicLookup().unreflect(scriptMethod)

return oj.internal.runtime.methods.CompiledIRMethod.new(
handle,
@@ -408,7 +408,7 @@ def self.bar

it "compiles constant access" do
const_code = <<-EOS
A = 'a'; module X; B = 'b'; end; module Y; def self.go; [A, X::B, ::A]; end; end; Y.go
A ||= 'a'; module X; B ||= 'b'; end; module Y; def self.go; [A, X::B, ::A]; end; end; Y.go
EOS
run(const_code) {|result| expect(result).to eq(["a", "b", "a"]) }
end
@@ -603,7 +603,7 @@ def self.remove; remove_method :gh1239; end

it "prevents reopening or extending non-modules" do
# ensure that invalid classes and modules raise errors
AFixnum = 1;
AFixnum ||= 1
expect { run("class AFixnum; end")}.to raise_error(TypeError)
expect { run("class B < AFixnum; end")}.to raise_error(TypeError)
expect { run("module AFixnum; end")}.to raise_error(TypeError)
@@ -671,7 +671,9 @@ def self.remove; remove_method :gh1239; end

it "resolves Foo::Bar style constants" do
# JRUBY-1388, Foo::Bar broke in the compiler
run("module Foo2; end; Foo2::Foo3 = 5; Foo2::Foo3") {|result| expect(result).to eq 5 }
silence_warnings do
run("module Foo2; end; Foo2::Foo3 = 5; Foo2::Foo3") {|result| expect(result).to eq 5 }
end
end

it "re-runs enclosing block when redo is called from ensure" do
@@ -849,11 +851,13 @@ def initialize(x, y, *z)
class JRUBY4925
end

run 'JRUBY4925::BLAH, a = 1, 2' do |x|
expect(JRUBY4925::BLAH).to eq 1
end
run '::JRUBY4925_BLAH, a = 1, 2' do |x|
expect(JRUBY4925_BLAH).to eq 1
silence_warnings do
run 'JRUBY4925::BLAH, a = 1, 2' do |x|
expect(JRUBY4925::BLAH).to eq 1
end
run '::JRUBY4925_BLAH, a = 1, 2' do |x|
expect(JRUBY4925_BLAH).to eq 1
end
end
end

@@ -963,7 +967,7 @@ def foo(str: "bar", num: 45, **opts)
[C.new.foo, D.new.foo, D.new.foo(str: "d", num:75, a:1, b:2)]
' do |x|

expect(x).to eq [
["foo", 42, {}],
["bar", 45, {}],