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

Commits on Jul 7, 2016

  1. Copy the full SHA
    28cbe40 View commit details
  2. Copy the full SHA
    b532390 View commit details
Original file line number Diff line number Diff line change
@@ -3256,7 +3256,7 @@ public static abstract class StringToFPrimitiveNode extends PrimitiveArrayArgume

@TruffleBoundary
@Specialization
public Object stringToF(DynamicObject string) {
public Object stringToF(DynamicObject string, boolean strict) {
try {
return Double.parseDouble(string.toString());
} catch (NumberFormatException e) {
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
import org.joni.NameEntry;
import org.joni.Regex;
import org.joni.Syntax;
import org.jruby.ast.Node;
import org.jruby.ast.SideEffectFree;
import org.jruby.ast.visitor.NodeVisitor;
import org.jruby.common.IRubyWarnings;
@@ -165,7 +166,6 @@
import org.jruby.truffle.platform.graal.AssertNotCompiledNodeGen;
import org.jruby.util.ByteList;
import org.jruby.util.KeyValuePair;

import java.io.File;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
@@ -566,10 +566,6 @@ private RubyNode translateRubiniusPrimitive(SourceSection sourceSection, org.jru
*
* CallPrimitiveNode(FooNode(arg1, arg2, ..., argN))
*
* or
*
* (<#Method ModuleDefinedIn#foo>).call(arg1, arg2, ..., argN)
*
* Where the arguments are the same arguments as the method. It looks like this is only exercised with simple
* arguments so we're not worrying too much about what happens when they're more complicated (rest,
* keywords etc).
@@ -595,28 +591,28 @@ private RubyNode translateRubiniusInvokePrimitive(SourceSection sourceSection, o
* into
*
* InvokePrimitiveNode(FooNode(arg1, arg2, ..., argN))
*
* or
*
* (<#Method ModuleDefinedIn#foo>).call(arg1, arg2, ..., argN)
*/

if (node.getArgsNode().childNodes().size() < 1 || !(node.getArgsNode().childNodes().get(0) instanceof org.jruby.ast.SymbolNode)) {
final List<Node> args = node.getArgsNode().childNodes();

if (args.size() < 1 || !(args.get(0) instanceof org.jruby.ast.SymbolNode)) {
throw new UnsupportedOperationException("Truffle.invoke_primitive must have at least an initial literal symbol argument");
}

final String primitiveName = ((org.jruby.ast.SymbolNode) node.getArgsNode().childNodes().get(0)).getName();
final String primitiveName = ((org.jruby.ast.SymbolNode) args.get(0)).getName();

final PrimitiveNodeConstructor primitive = context.getPrimitiveManager().getPrimitive(primitiveName);

final List<RubyNode> arguments = new ArrayList<>();

// The first argument was the symbol so we ignore it
for (int n = 1; n < node.getArgsNode().childNodes().size(); n++) {
RubyNode readArgumentNode = node.getArgsNode().childNodes().get(n).accept(this);
for (int n = 1; n < args.size(); n++) {
RubyNode readArgumentNode = args.get(n).accept(this);
arguments.add(readArgumentNode);
}

assert arguments.size() == primitive.getPrimitiveArity() : sourceSection.getShortDescription();

return primitive.createInvokePrimitiveNode(context, sourceSection, arguments.toArray(new RubyNode[arguments.size()]));
}