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

Commits on Apr 30, 2015

  1. Cleaned up some interfaces.

    nirvdrum committed Apr 30, 2015
    Copy the full SHA
    79c6553 View commit details
  2. Copy the full SHA
    18cd2fb View commit details
Showing with 105 additions and 111 deletions.
  1. +3 −5 core/src/main/java/org/jruby/util/ByteListHolder.java
  2. +8 −8 core/src/main/java/org/jruby/util/CodeRangeable.java
  3. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/conversion/ToSymbolNode.java
  4. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/BasicObjectNodes.java
  5. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/ExceptionNodes.java
  6. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/InteroplatedRegexpNode.java
  7. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/InterpolatedStringNode.java
  8. +4 −4 truffle/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
  9. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/MatchDataNodes.java
  10. +3 −3 truffle/src/main/java/org/jruby/truffle/nodes/core/ModuleNodes.java
  11. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/RegexpNodes.java
  12. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/StringGuards.java
  13. +41 −41 truffle/src/main/java/org/jruby/truffle/nodes/core/StringNodes.java
  14. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java
  15. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/dispatch/CachedDispatchNode.java
  16. +4 −4 truffle/src/main/java/org/jruby/truffle/nodes/interop/InteropNode.java
  17. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/ByteArrayNodes.java
  18. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/EncodingPrimitiveNodes.java
  19. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/RegexpPrimitiveNodes.java
  20. +11 −11 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/StringPrimitiveNodes.java
  21. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/TimePrimitiveNodes.java
  22. +1 −1 truffle/src/main/java/org/jruby/truffle/runtime/RubyContext.java
  23. +13 −13 truffle/src/main/java/org/jruby/truffle/runtime/core/RubyRegexp.java
  24. +0 −4 truffle/src/main/java/org/jruby/truffle/runtime/core/RubyString.java
8 changes: 3 additions & 5 deletions core/src/main/java/org/jruby/util/ByteListHolder.java
Original file line number Diff line number Diff line change
@@ -26,10 +26,8 @@

package org.jruby.util;

import org.jcodings.Encoding;

public interface ByteListHolder {
public ByteList getByteList();
public void modify();
public void modify(int length);
ByteList getByteList();
void modify();
void modify(int length);
}
16 changes: 8 additions & 8 deletions core/src/main/java/org/jruby/util/CodeRangeable.java
Original file line number Diff line number Diff line change
@@ -29,12 +29,12 @@
import org.jcodings.Encoding;

public interface CodeRangeable extends ByteListHolder {
public int getCodeRange();
public int scanForCodeRange();
public boolean isCodeRangeValid();
public void setCodeRange(int codeRange);
public void clearCodeRange();
public void keepCodeRange();
public void modifyAndKeepCodeRange();
public Encoding checkEncoding(CodeRangeable other);
int getCodeRange();
int scanForCodeRange();
boolean isCodeRangeValid();
void setCodeRange(int codeRange);
void clearCodeRange();
void keepCodeRange();
void modifyAndKeepCodeRange();
Encoding checkEncoding(CodeRangeable other);
}
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ protected RubySymbol toSymbol(RubySymbol symbol) {

@Specialization
protected RubySymbol toSymbol(RubyString string) {
return getContext().getSymbol(string.getBytes());
return getContext().getSymbol(string.getByteList());
}

@Specialization
Original file line number Diff line number Diff line change
@@ -183,7 +183,7 @@ public InstanceEvalNode(RubyContext context, SourceSection sourceSection) {
public Object instanceEval(VirtualFrame frame, Object receiver, RubyString string, UndefinedPlaceholder block) {
notDesignedForCompilation();

return getContext().instanceEval(string.getBytes(), receiver, this);
return getContext().instanceEval(string.getByteList(), receiver, this);
}

@Specialization
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ public RubyString toS(RubyException exception) {
if (exception.getMessage().length() == 0) {
return getContext().makeString(exception.getLogicalClass().getName());
} else {
return getContext().makeString(exception.getMessage().getBytes());
return getContext().makeString(exception.getMessage().getByteList());
}
}

Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ public RubyRegexp executeRubyRegexp(VirtualFrame frame) {

for (int n = 0; n < children.length; n++) {
final Object child = children[n].execute(frame);
strings[n] = org.jruby.RubyString.newString(getContext().getRuntime(), ((RubyString) toS.call(frame, child, "to_s", null)).getBytes());
strings[n] = org.jruby.RubyString.newString(getContext().getRuntime(), ((RubyString) toS.call(frame, child, "to_s", null)).getByteList());
}

// TODO 27-APR=2015 BJF Adding workaround to temporarily fix CGI error until Regex overhaul https://github.com/jruby/jruby/issues/2802
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ private RubyString concat(RubyString[] strings) {
try {
builder.append19(getContext().toJRuby(string));
} catch (org.jruby.exceptions.RaiseException e) {
throw new RaiseException(getContext().getCoreLibrary().encodingCompatibilityErrorIncompatible(builder.getEncoding().getCharsetName(), string.getBytes().getEncoding().getCharsetName(), this));
throw new RaiseException(getContext().getCoreLibrary().encodingCompatibilityErrorIncompatible(builder.getEncoding().getCharsetName(), string.getByteList().getEncoding().getCharsetName(), this));
}
}
}
Original file line number Diff line number Diff line change
@@ -466,7 +466,7 @@ protected RubyBinding getCallerBinding(VirtualFrame frame) {
public Object eval(VirtualFrame frame, RubyString source, UndefinedPlaceholder binding, UndefinedPlaceholder filename, UndefinedPlaceholder lineNumber) {
notDesignedForCompilation();

return getContext().eval(source.getBytes(), getCallerBinding(frame), true, this);
return getContext().eval(source.getByteList(), getCallerBinding(frame), true, this);
}

@Specialization
@@ -481,21 +481,21 @@ public Object eval(VirtualFrame frame, RubyString source, RubyNilClass noBinding
public Object eval(RubyString source, RubyBinding binding, UndefinedPlaceholder filename, UndefinedPlaceholder lineNumber) {
notDesignedForCompilation();

return getContext().eval(source.getBytes(), binding, false, this);
return getContext().eval(source.getByteList(), binding, false, this);
}

@Specialization
public Object eval(RubyString source, RubyBinding binding, RubyString filename, UndefinedPlaceholder lineNumber) {
notDesignedForCompilation();

return getContext().eval(source.getBytes(), binding, false, filename.toString(), this);
return getContext().eval(source.getByteList(), binding, false, filename.toString(), this);
}

@Specialization
public Object eval(RubyString source, RubyBinding binding, RubyString filename, int lineNumber) {
notDesignedForCompilation();

return getContext().eval(source.getBytes(), binding, false, filename.toString(), this);
return getContext().eval(source.getByteList(), binding, false, filename.toString(), this);
}

@Specialization(guards = "!isRubyBinding(badBinding)")
Original file line number Diff line number Diff line change
@@ -245,7 +245,7 @@ public ToSNode(RubyContext context, SourceSection sourceSection) {
public RubyString toS(RubyMatchData matchData) {
notDesignedForCompilation();

final ByteList bytes = matchData.getGlobal().getBytes().dup();
final ByteList bytes = matchData.getGlobal().getByteList().dup();
return getContext().makeString(bytes);
}
}
Original file line number Diff line number Diff line change
@@ -577,23 +577,23 @@ public Object classEval(VirtualFrame frame, RubyModule module, RubyString code,
notDesignedForCompilation();

final Source source = Source.fromText(code.toString(), "(eval)");
return classEvalSource(frame, module, source, code.getBytes().getEncoding());
return classEvalSource(frame, module, source, code.getByteList().getEncoding());
}

@Specialization
public Object classEval(VirtualFrame frame, RubyModule module, RubyString code, RubyString file, UndefinedPlaceholder line, UndefinedPlaceholder block) {
notDesignedForCompilation();

final Source source = Source.asPseudoFile(code.toString(), file.toString());
return classEvalSource(frame, module, source, code.getBytes().getEncoding());
return classEvalSource(frame, module, source, code.getByteList().getEncoding());
}

@Specialization
public Object classEval(VirtualFrame frame, RubyModule module, RubyString code, RubyString file, int line, UndefinedPlaceholder block) {
notDesignedForCompilation();

final Source source = Source.asPseudoFile(code.toString(), file.toString());
return classEvalSource(frame, module, source, code.getBytes().getEncoding());
return classEvalSource(frame, module, source, code.getByteList().getEncoding());
}

private Object classEvalSource(VirtualFrame frame, RubyModule module, Source source, Encoding encoding) {
Original file line number Diff line number Diff line change
@@ -128,7 +128,7 @@ public EscapeNode(RubyContext context, SourceSection sourceSection) {
public RubyString escape(RubyString pattern) {
notDesignedForCompilation();

return getContext().makeString(org.jruby.RubyRegexp.quote19(new ByteList(pattern.getBytes()), true).toString());
return getContext().makeString(org.jruby.RubyRegexp.quote19(new ByteList(pattern.getByteList()), true).toString());
}

}
@@ -240,7 +240,7 @@ public RubyString quote(RubyString raw) {

boolean isAsciiOnly = raw.getByteList().getEncoding().isAsciiCompatible() && raw.scanForCodeRange() == CR_7BIT;

return getContext().makeString(org.jruby.RubyRegexp.quote19(raw.getBytes(), isAsciiOnly));
return getContext().makeString(org.jruby.RubyRegexp.quote19(raw.getByteList(), isAsciiOnly));
}

@Specialization
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
public class StringGuards {

public static boolean isSingleByteOptimizable(RubyString string) {
return StringSupport.isSingleByteOptimizable(string, string.getBytes().getEncoding());
return StringSupport.isSingleByteOptimizable(string, string.getByteList().getEncoding());
}

public static boolean isAsciiCompatible(RubyString string) {
Loading