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

Commits on Jul 31, 2015

  1. 1
    Copy the full SHA
    f168d3c View commit details
  2. Copy the full SHA
    2babe92 View commit details
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
import org.jruby.truffle.runtime.RubyContext;

/**
* Read a post-optional argument.
* Read a post argument.
*/
public class ReadPostArgumentNode extends RubyNode {

@@ -29,7 +29,7 @@ public ReadPostArgumentNode(RubyContext context, SourceSection sourceSection, in

@Override
public Object execute(VirtualFrame frame) {
int count = RubyArguments.getUserArgumentsCount(frame.getArguments());
final int count = RubyArguments.getUserArgumentsCount(frame.getArguments());
final int effectiveIndex = count + negativeIndex;
assert effectiveIndex < count;
return RubyArguments.getUserArgument(frame.getArguments(), effectiveIndex);
Original file line number Diff line number Diff line change
@@ -186,7 +186,7 @@ private static RubyRootNode makeGenericMethod(RubyContext context, MethodDetails
if (method.argumentsAsArray()) {
argumentsNodes.add(new ReadAllArgumentsNode(context, sourceSection));
} else {
for (int n = 0; n < arity.getRequired() + arity.getOptional(); n++) {
for (int n = 0; n < arity.getPreRequired() + arity.getOptional(); n++) {
RubyNode readArgumentNode = new ReadPreArgumentNode(context, sourceSection, n, MissingArgumentBehaviour.UNDEFINED);

if (ArrayUtils.contains(method.lowerFixnumParameters(), n)) {
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ public RubiniusPrimitiveCallConstructor(RubyBasicObject method) {

@Override
public int getPrimitiveArity() {
return MethodNodes.getMethod(method).getSharedMethodInfo().getArity().getRequired();
return MethodNodes.getMethod(method).getSharedMethodInfo().getArity().getPreRequired();
}

@Override
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ public RubyNode compileFunctionNode(SourceSection sourceSection, String methodNa
*/

if (isBlock && argsNode.childNodes().size() == 2 && argsNode.getRestArgNode() instanceof org.jruby.ast.UnnamedRestArgNode) {
arityForCheck = new Arity(arity.getRequired(), 0, false);
arityForCheck = new Arity(arity.getPreRequired(), 0, false);
} else {
arityForCheck = arity;
}