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

Commits on Mar 10, 2016

  1. Copy the full SHA
    a786a8b View commit details
  2. Copy the full SHA
    6b5b77e View commit details
Original file line number Diff line number Diff line change
@@ -214,16 +214,15 @@ public StringAwkSplitPrimitiveNode(RubyContext context, SourceSection sourceSect
public DynamicObject stringAwkSplit(DynamicObject string, int lim) {
final List<DynamicObject> ret = new ArrayList<>();
final Rope rope = rope(string);
final ByteList value = rope.getUnsafeByteList();
final boolean limit = lim > 0;
int i = lim > 0 ? 1 : 0;

byte[]bytes = value.getUnsafeBytes();
int p = value.getBegin();
byte[]bytes = rope.getBytes();
int p = rope.getBegin();
int ptr = p;
int len = value.getRealSize();
int len = rope.getRealSize();
int end = p + len;
Encoding enc = value.getEncoding();
Encoding enc = rope.getEncoding();
boolean skip = true;

int e = 0, b = 0;
Original file line number Diff line number Diff line change
@@ -2002,31 +2002,6 @@ public static boolean zeroArgs(Object[] args) {
}
}

@CoreMethod(names = "succ", taintFromSelf = true)
public abstract static class SuccNode extends CoreMethodArrayArgumentsNode {

@Child private AllocateObjectNode allocateObjectNode;

public SuccNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
allocateObjectNode = AllocateObjectNodeGen.create(context, sourceSection, null, null);
}

@TruffleBoundary
@Specialization
public DynamicObject succ(DynamicObject string) {
final Rope rope = rope(string);

if (rope.isEmpty()) {
return allocateObjectNode.allocate(Layouts.BASIC_OBJECT.getLogicalClass(string), RopeOperations.withEncoding(EMPTY_UTF8_ROPE, rope.getEncoding()), null);
} else {
final ByteList succByteList = StringSupport.succCommon(getContext().getJRubyRuntime(), StringOperations.getByteListReadOnly(string));

return allocateObjectNode.allocate(Layouts.BASIC_OBJECT.getLogicalClass(string), StringOperations.ropeFromByteList(succByteList, rope.getCodeRange()), null);
}
}
}

@CoreMethod(names = "succ!", raiseIfFrozenSelf = true)
public abstract static class SuccBangNode extends CoreMethodArrayArgumentsNode {