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: 9dc5c59a5d23
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ec50bf1660ab
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jan 7, 2016

  1. Fix for method name change

    enebo committed Jan 7, 2016
    Copy the full SHA
    76fb590 View commit details
  2. Remove singly used private method and rename another private method t…

    …o be more meaningful
    enebo committed Jan 7, 2016
    Copy the full SHA
    ec50bf1 View commit details
Showing with 3 additions and 8 deletions.
  1. +2 −7 core/src/main/java/org/jruby/ir/instructions/CallBase.java
  2. +1 −1 spec/compiler/general_spec.rb
9 changes: 2 additions & 7 deletions core/src/main/java/org/jruby/ir/instructions/CallBase.java
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ public abstract class CallBase extends NOperandInstr implements ClosureAccepting

protected CallBase(Operation op, CallType callType, String name, Operand receiver, Operand[] args, Operand closure,
boolean potentiallyRefined) {
super(op, getOperands(receiver, args, closure));
super(op, arrayifyOperands(receiver, args, closure));

this.callSiteId = callSiteCounter++;
argsCount = args.length;
@@ -81,10 +81,6 @@ private int calculateArity() {
return hasClosure ? -1*(argsCount + 1) : argsCount;
}

private static Operand[] getOperands(Operand receiver, Operand[] arguments, Operand closure) {
return buildAllArgs(receiver, arguments, closure);
}

public String getName() {
return name;
}
@@ -392,12 +388,11 @@ public static boolean containsArgSplat(Operand[] arguments) {
}

private final static int REQUIRED_OPERANDS = 1;
private static Operand[] buildAllArgs(Operand receiver, Operand[] callArgs, Operand closure) {
private static Operand[] arrayifyOperands(Operand receiver, Operand[] callArgs, Operand closure) {
Operand[] allArgs = new Operand[callArgs.length + REQUIRED_OPERANDS + (closure != null ? 1 : 0)];

assert receiver != null : "RECEIVER is null";


allArgs[0] = receiver;
for (int i = 0; i < callArgs.length; i++) {
assert callArgs[i] != null : "ARG " + i + " is null";
2 changes: 1 addition & 1 deletion spec/compiler/general_spec.rb
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ def compile_to_method(src, filename, lineno)
end

method = oj.ir.IRBuilder.build_root(JRuby.runtime.getIRManager(), node).scope
method.prepareForInitialCompilation
method.prepareForCompilation

compiler = oj.ir.targets.JVMVisitor.new
compiled = compiler.compile(method, oj.util.OneShotClassLoader.new(JRuby.runtime.getJRubyClassLoader()))