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

Commits on Feb 9, 2016

  1. Copy the full SHA
    0144f54 View commit details
  2. Copy the full SHA
    f5c96e4 View commit details
Showing with 4 additions and 9 deletions.
  1. +4 −9 truffle/src/main/java/org/jruby/truffle/core/regexp/MatchDataNodes.java
Original file line number Diff line number Diff line change
@@ -215,8 +215,8 @@ public Object getIndexSymbol(DynamicObject matchData, DynamicObject index, NotPr
@Specialization(guards = "isRubyString(index)")
public Object getIndexString(DynamicObject matchData, DynamicObject index, NotProvided length) {
try {
ByteList value = StringOperations.getByteListReadOnly(index);
final int i = Layouts.REGEXP.getRegex(Layouts.MATCH_DATA.getRegexp(matchData)).nameToBackrefNumber(value.getUnsafeBytes(), value.getBegin(), value.getBegin() + value.getRealSize(), Layouts.MATCH_DATA.getRegion(matchData));
final Rope value = StringOperations.rope(index);
final int i = Layouts.REGEXP.getRegex(Layouts.MATCH_DATA.getRegexp(matchData)).nameToBackrefNumber(value.getBytes(), value.getBegin(), value.getBegin() + value.getRealSize(), Layouts.MATCH_DATA.getRegion(matchData));

return getIndex(matchData, i, NotProvided.INSTANCE);
}
@@ -373,7 +373,6 @@ public PreMatchNode(RubyContext context, SourceSection sourceSection) {
taintResultNode = new TaintResultNode(getContext(), getSourceSection());
}

@CompilerDirectives.TruffleBoundary
@Specialization
public Object preMatch(DynamicObject matchData) {
return taintResultNode.maybeTaint(Layouts.MATCH_DATA.getSource(matchData), Layouts.MATCH_DATA.getPre(matchData));
@@ -391,7 +390,6 @@ public PostMatchNode(RubyContext context, SourceSection sourceSection) {
taintResultNode = new TaintResultNode(getContext(), getSourceSection());
}

@CompilerDirectives.TruffleBoundary
@Specialization
public Object postMatch(DynamicObject matchData) {
return taintResultNode.maybeTaint(Layouts.MATCH_DATA.getSource(matchData), Layouts.MATCH_DATA.getPost(matchData));
@@ -420,11 +418,10 @@ public ToSNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@Specialization
public DynamicObject toS(DynamicObject matchData) {
final ByteList bytes = StringOperations.getByteListReadOnly(Layouts.MATCH_DATA.getGlobal(matchData)).dup();
return createString(bytes);
final Rope rope = StringOperations.rope(Layouts.MATCH_DATA.getGlobal(matchData));
return createString(rope);
}
}

@@ -435,7 +432,6 @@ public RegexpNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@Specialization
public DynamicObject regexp(DynamicObject matchData) {
return Layouts.MATCH_DATA.getRegexp(matchData);
@@ -466,7 +462,6 @@ public RubiniusSourceNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@CompilerDirectives.TruffleBoundary
@Specialization
public DynamicObject rubiniusSource(DynamicObject matchData) {
return Layouts.MATCH_DATA.getSource(matchData);