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

Commits on Aug 25, 2015

  1. Removes trailing whitespace

    benlovell committed Aug 25, 2015
    Copy the full SHA
    e996bcf View commit details
  2. Copy the full SHA
    6266fc0 View commit details
  3. Remove unused mock visitor

    benlovell committed Aug 25, 2015
    Copy the full SHA
    825284e View commit details
  4. Refactor to lets

    Places reference data in `let`s and tidies up some of the general
    logic, clarifying the intent of the spec.
    benlovell committed Aug 25, 2015
    Copy the full SHA
    4805efd View commit details
  5. Merge pull request #3284 from benlovell/spec-improvements

    Spec improvements
    enebo committed Aug 25, 2015
    Copy the full SHA
    b4e2ef3 View commit details
Showing with 13 additions and 30 deletions.
  1. +13 −30 spec/compiler/skinnymethodadapter_spec.rb
43 changes: 13 additions & 30 deletions spec/compiler/skinnymethodadapter_spec.rb
Original file line number Diff line number Diff line change
@@ -10,54 +10,38 @@
import "org.jruby.org.objectweb.asm.Opcodes"
end

class MockMethodVisitor
attr_accessor :calls

def initialize
@calls = []
end

def method_missing(name, *args)
@calls << [name, args]
end
end

describe "SkinnyMethodAdapter" do
it "supports all JVM opcodes" do
describe "SkinnyMethodAdapter" do
let(:instance_methods) { SkinnyMethodAdapter.instance_methods.map(&:to_s) }
let(:insn_opcodes) do
insn_opcodes = Opcodes.constants.select do |c|
case c.to_s # for 1.9's symbols

when /ACC_/, # access modifiers
/V1_/, # version identifiers
/T_/, # type identifiers
/F_/, # framing hints
/H_/, # method handles
/ASM/ # ASM version stuff
false

when "DOUBLE", "FLOAT", "INTEGER", "LONG", "NULL", "TOP", "UNINITIALIZED_THIS"
false

when "GOTO", "RETURN", "INSTANCEOF", "NEW"
false

when "INVOKEDYNAMIC_OWNER"
false

else
true
end
end

end.map(&:to_s).map(&:downcase)
# 1.9 makes them symbols, so to_s the lot
insn_opcodes = insn_opcodes.map(&:to_s)
instance_methods = SkinnyMethodAdapter.instance_methods.map(&:to_s)

insn_opcodes.each do |opcode|
opcode = opcode.downcase
expect(instance_methods).to include(opcode)
end

end

it "supports all JVM opcodes" do
expect(instance_methods).to include(*insn_opcodes)
expect(instance_methods).to include(
"go_to",
"voidreturn",
@@ -66,4 +50,3 @@ def method_missing(name, *args)
)
end
end