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

Commits on Feb 19, 2016

  1. Copy the full SHA
    d8c0889 View commit details
  2. [Truffle] When flattening a sequence, don't strip out explicit nil no…

    …des, as they could have a breakpoint etc.
    chrisseaton committed Feb 19, 2016
    Copy the full SHA
    d0b855b View commit details
  3. Copy the full SHA
    3e17055 View commit details
  4. Copy the full SHA
    9739367 View commit details
  5. Copy the full SHA
    d2925d2 View commit details
  6. Copy the full SHA
    d177fe5 View commit details
Original file line number Diff line number Diff line change
@@ -11,16 +11,16 @@

import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.numeric.FixnumLiteralNode;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.literal.IntegerFixnumLiteralNode;

public abstract class PrimitiveArrayNodeFactory {

/**
* Create a node to read from an array with a constant denormalized index.
*/
public static RubyNode read(RubyContext context, SourceSection sourceSection, RubyNode array, int index) {
final RubyNode literalIndex = new FixnumLiteralNode.IntegerFixnumLiteralNode(context, sourceSection, index);
final RubyNode literalIndex = new IntegerFixnumLiteralNode(context, sourceSection, index);

if (index >= 0) {
return ArrayReadNormalizedNodeGen.create(context, sourceSection, array, literalIndex);
@@ -33,8 +33,8 @@ public static RubyNode read(RubyContext context, SourceSection sourceSection, Ru
* Create a node to read a slice from an array with a constant denormalized start and exclusive end.
*/
public static RubyNode readSlice(RubyContext context, SourceSection sourceSection, RubyNode array, int start, int exclusiveEnd) {
final RubyNode literalStart = new FixnumLiteralNode.IntegerFixnumLiteralNode(context, sourceSection, start);
final RubyNode literalExclusiveEnd = new FixnumLiteralNode.IntegerFixnumLiteralNode(context, sourceSection, exclusiveEnd);
final RubyNode literalStart = new IntegerFixnumLiteralNode(context, sourceSection, start);
final RubyNode literalExclusiveEnd = new IntegerFixnumLiteralNode(context, sourceSection, exclusiveEnd);

if (start >= 0 && exclusiveEnd >= 0) {
return ArrayReadSliceNormalizedNodeGen.create(context, sourceSection, array, literalStart, literalExclusiveEnd);
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.language.literal.LiteralNode;
import org.jruby.truffle.language.literal.ObjectLiteralNode;
import org.jruby.truffle.language.methods.InternalMethod;
import org.jruby.truffle.language.objects.IsFrozenNodeGen;
import org.jruby.truffle.language.objects.ObjectGraphNode;
@@ -165,7 +165,7 @@ public void checkFrozen(RubyContext context, Node currentNode) {

// TODO CS 20-Aug-15 this needs to go
public static boolean verySlowIsFrozen(RubyContext context, Object object) {
final RubyNode node = IsFrozenNodeGen.create(context, null, new LiteralNode(context, null, object));
final RubyNode node = IsFrozenNodeGen.create(context, null, new ObjectLiteralNode(context, null, object));
new Node() {
@Child RubyNode child = node;
}.adoptChildren();

This file was deleted.

Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
import org.jruby.truffle.language.arguments.ReadAllArgumentsNode;
import org.jruby.truffle.language.arguments.ReadBlockNode;
import org.jruby.truffle.language.control.ReturnID;
import org.jruby.truffle.language.literal.LiteralNode;
import org.jruby.truffle.language.literal.ObjectLiteralNode;

public class RubiniusPrimitiveCallConstructor implements RubiniusPrimitiveConstructor {

@@ -41,7 +41,7 @@ public int getPrimitiveArity() {
public RubyNode createCallPrimitiveNode(RubyContext context, SourceSection sourceSection, ReturnID returnID) {
return new CallRubiniusPrimitiveNode(context, sourceSection,
MethodNodesFactory.CallNodeFactory.create(context, sourceSection, new RubyNode[] {
new LiteralNode(context, sourceSection, method),
new ObjectLiteralNode(context, sourceSection, method),
new ReadAllArgumentsNode(context, sourceSection),
new ReadBlockNode(context, sourceSection, NotProvided.INSTANCE)
}), returnID);
@@ -50,7 +50,7 @@ public RubyNode createCallPrimitiveNode(RubyContext context, SourceSection sourc
@Override
public RubyNode createInvokePrimitiveNode(RubyContext context, SourceSection sourceSection, RubyNode[] arguments) {
return MethodNodesFactory.CallNodeFactory.create(context, sourceSection, new RubyNode[] {
new LiteralNode(context, sourceSection, method),
new ObjectLiteralNode(context, sourceSection, method),
new NodeArrayToObjectArrayNode(context, sourceSection, arguments),
new ReadBlockNode(context, sourceSection, NotProvided.INSTANCE)
});
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
import org.jruby.truffle.language.constants.ReadLiteralConstantNode;
import org.jruby.truffle.language.dispatch.CallDispatchHeadNode;
import org.jruby.truffle.language.dispatch.DispatchHeadNodeFactory;
import org.jruby.truffle.language.literal.LiteralNode;
import org.jruby.truffle.language.literal.ObjectLiteralNode;

public class ReadTimeZoneNode extends RubyNode {

@@ -40,7 +40,7 @@ public ReadTimeZoneNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
hashNode = DispatchHeadNodeFactory.createMethodCall(context);
envNode = new ReadLiteralConstantNode(context, sourceSection,
new LiteralNode(context, sourceSection, getContext().getCoreLibrary().getObjectClass()), "ENV");
new ObjectLiteralNode(context, sourceSection, getContext().getCoreLibrary().getObjectClass()), "ENV");
TZ = create7BitString("TZ", UTF8Encoding.INSTANCE);
}

Original file line number Diff line number Diff line change
@@ -18,15 +18,15 @@
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.language.literal.LiteralNode;
import org.jruby.truffle.language.literal.ObjectLiteralNode;

public class ReadLiteralConstantNode extends RubyNode {

@Child private ReadConstantNode readConstantNode;

public ReadLiteralConstantNode(RubyContext context, SourceSection sourceSection, RubyNode moduleNode, String name) {
super(context, sourceSection);
RubyNode nameNode = new LiteralNode(context, sourceSection, name);
RubyNode nameNode = new ObjectLiteralNode(context, sourceSection, name);
this.readConstantNode = new ReadConstantNode(context, sourceSection, false, false, moduleNode, nameNode);
}

Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.language.RubyNode;

// For isDefined() and convenience
@NodeInfo(cost = NodeCost.NONE)
public class BooleanLiteralNode extends RubyNode {

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved. This
* code is released under a tri EPL/GPL/LGPL license. You can use it,
* redistribute it and/or modify it under the terms of the:
*
* Eclipse Public License version 1.0
* GNU General Public License version 2
* GNU Lesser General Public License version 2.1
*/
package org.jruby.truffle.language.literal;

import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.nodes.NodeInfo;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.language.RubyNode;

@NodeInfo(cost = NodeCost.NONE)
public class IntegerFixnumLiteralNode extends RubyNode {

private final int value;

public IntegerFixnumLiteralNode(RubyContext context, SourceSection sourceSection, int value) {
super(context, sourceSection);
this.value = value;
}

@Override
public Object execute(VirtualFrame frame) {
return executeInteger(frame);
}

@Override
public int executeInteger(VirtualFrame frame) {
return value;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved. This
* code is released under a tri EPL/GPL/LGPL license. You can use it,
* redistribute it and/or modify it under the terms of the:
*
* Eclipse Public License version 1.0
* GNU General Public License version 2
* GNU Lesser General Public License version 2.1
*/
package org.jruby.truffle.language.literal;

import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.nodes.NodeInfo;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.language.RubyNode;

@NodeInfo(cost = NodeCost.NONE)
public class LongFixnumLiteralNode extends RubyNode {

private final long value;

public LongFixnumLiteralNode(RubyContext context, SourceSection sourceSection, long value) {
super(context, sourceSection);
this.value = value;
}

@Override
public Object execute(VirtualFrame frame) {
return executeLong(frame);
}

@Override
public long executeLong(VirtualFrame frame) {
return value;
}

}
Original file line number Diff line number Diff line change
@@ -17,12 +17,14 @@
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.language.RubyNode;

// For isDefined() and convenience
@NodeInfo(cost = NodeCost.NONE)
public class NilNode extends RubyNode {
public class NilLiteralNode extends RubyNode {

public NilNode(RubyContext context, SourceSection sourceSection) {
private final boolean isImplicit;

public NilLiteralNode(RubyContext context, SourceSection sourceSection, boolean isImplicit) {
super(context, sourceSection);
this.isImplicit = isImplicit;
}

@Override
@@ -35,4 +37,8 @@ public Object isDefined(VirtualFrame frame) {
return create7BitString("nil", UTF8Encoding.INSTANCE);
}

public boolean isImplicit() {
return isImplicit;
}

}
Original file line number Diff line number Diff line change
@@ -17,11 +17,11 @@
import org.jruby.truffle.language.RubyNode;

@NodeInfo(cost = NodeCost.NONE)
public class LiteralNode extends RubyNode {
public class ObjectLiteralNode extends RubyNode {

private final Object object;

public LiteralNode(RubyContext context, SourceSection sourceSection, Object object) {
public ObjectLiteralNode(RubyContext context, SourceSection sourceSection, Object object) {
super(context, sourceSection);
this.object = object;
}
@@ -34,4 +34,5 @@ public Object execute(VirtualFrame frame) {
public Object getObject() {
return object;
}

}
Original file line number Diff line number Diff line change
@@ -35,10 +35,9 @@ public class StringLiteralNode extends RubyNode {

@Child private AllocateObjectNode allocateObjectNode;

public StringLiteralNode(RubyContext context, SourceSection sourceSection, ByteList byteList, int codeRange) {
public StringLiteralNode(RubyContext context, SourceSection sourceSection, Rope rope) {
super(context, sourceSection);
assert byteList != null;
this.rope = context.getRopeTable().getRope(byteList.bytes(), byteList.getEncoding(), CodeRange.fromInt(codeRange));
this.rope = rope;
allocateObjectNode = AllocateObjectNodeGen.create(context, sourceSection, false, null, null);
}

Loading