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

Commits on Jul 27, 2016

  1. [Truffle] Added a wrapper around String.format to simplify TruffleBou…

    …ndary.
    
    String.format is too complex to compile and guarding each call to the method is tedious. This wrapper makes it easier to use something that looks like String.format without jumping through hoops to place it behind a boundary.
    nirvdrum committed Jul 27, 2016
    1
    Copy the full SHA
    c7c54cf View commit details
  2. 3
    Copy the full SHA
    4116919 View commit details
  3. [Truffle] Fixed incomplete character range checking in the `string_fr…

    …om_codepoint' primitive.
    nirvdrum committed Jul 27, 2016
    6
    Copy the full SHA
    6f11922 View commit details
  4. [Truffle] Fixed potentially bad substring index when searching for si…

    …ngle-byte optimizable child rope to index into.
    nirvdrum committed Jul 27, 2016
    Copy the full SHA
    67c010b View commit details
  5. Copy the full SHA
    75b925c View commit details
Showing with 252 additions and 152 deletions.
  1. +0 −1 spec/truffle/tags/core/integer/chr_tags.txt
  2. +3 −1 truffle/src/main/java/org/jruby/truffle/builtins/CoreMethodNodeManager.java
  3. +3 −2 truffle/src/main/java/org/jruby/truffle/core/CoreLibrary.java
  4. +4 −1 truffle/src/main/java/org/jruby/truffle/core/basicobject/BasicObjectNodes.java
  5. +2 −1 truffle/src/main/java/org/jruby/truffle/core/cast/ArrayAttributeCastNode.java
  6. +2 −1 truffle/src/main/java/org/jruby/truffle/core/cast/CmpIntNode.java
  7. +2 −1 truffle/src/main/java/org/jruby/truffle/core/encoding/EncodingConverterNodes.java
  8. +57 −50 truffle/src/main/java/org/jruby/truffle/core/exception/CoreExceptions.java
  9. +3 −1 truffle/src/main/java/org/jruby/truffle/core/format/DescriptionTruncater.java
  10. +2 −1 truffle/src/main/java/org/jruby/truffle/core/format/format/FormatCharacterNode.java
  11. +3 −2 truffle/src/main/java/org/jruby/truffle/core/format/format/FormatFloatNode.java
  12. +2 −1 truffle/src/main/java/org/jruby/truffle/core/format/read/bytes/ReadUTF8CharacterNode.java
  13. +2 −1 truffle/src/main/java/org/jruby/truffle/core/hash/HashOperations.java
  14. +4 −1 truffle/src/main/java/org/jruby/truffle/core/kernel/KernelNodes.java
  15. +2 −1 truffle/src/main/java/org/jruby/truffle/core/klass/ClassNodes.java
  16. +5 −3 truffle/src/main/java/org/jruby/truffle/core/module/ModuleNodes.java
  17. +3 −2 truffle/src/main/java/org/jruby/truffle/core/module/ModuleOperations.java
  18. +6 −5 truffle/src/main/java/org/jruby/truffle/core/numeric/FloatNodes.java
  19. +2 −1 truffle/src/main/java/org/jruby/truffle/core/objectspace/ObjectSpaceNodes.java
  20. +5 −4 truffle/src/main/java/org/jruby/truffle/core/regexp/MatchDataNodes.java
  21. +3 −2 truffle/src/main/java/org/jruby/truffle/core/regexp/RegexpNodes.java
  22. +8 −6 truffle/src/main/java/org/jruby/truffle/core/rope/RopeNodes.java
  23. +2 −1 truffle/src/main/java/org/jruby/truffle/core/rope/RopeOperations.java
  24. +9 −4 truffle/src/main/java/org/jruby/truffle/core/rope/SubstringRope.java
  25. +2 −1 truffle/src/main/java/org/jruby/truffle/core/rope/TruffleRopesNodes.java
  26. +2 −1 truffle/src/main/java/org/jruby/truffle/core/rubinius/RegexpPrimitiveNodes.java
  27. +41 −38 truffle/src/main/java/org/jruby/truffle/core/string/StringNodes.java
  28. +2 −1 truffle/src/main/java/org/jruby/truffle/core/string/StringOperations.java
  29. +3 −2 truffle/src/main/java/org/jruby/truffle/core/string/TruffleStringNodes.java
  30. +3 −2 truffle/src/main/java/org/jruby/truffle/core/time/TimeNodes.java
  31. +2 −1 truffle/src/main/java/org/jruby/truffle/language/RubyObjectType.java
  32. +3 −1 truffle/src/main/java/org/jruby/truffle/language/backtrace/BacktraceFormatter.java
  33. +3 −1 truffle/src/main/java/org/jruby/truffle/language/backtrace/BacktraceInterleaver.java
  34. +2 −1 truffle/src/main/java/org/jruby/truffle/language/constants/GetConstantNode.java
  35. +2 −1 truffle/src/main/java/org/jruby/truffle/language/dispatch/CachedBoxedDispatchNode.java
  36. +2 −1 truffle/src/main/java/org/jruby/truffle/language/dispatch/CachedSingletonDispatchNode.java
  37. +2 −1 truffle/src/main/java/org/jruby/truffle/language/loader/SourceLoader.java
  38. +2 −1 truffle/src/main/java/org/jruby/truffle/language/objects/SingletonClassNode.java
  39. +3 −2 truffle/src/main/java/org/jruby/truffle/language/parser/jruby/BodyTranslator.java
  40. +2 −1 truffle/src/main/java/org/jruby/truffle/platform/posix/FDSet.java
  41. +2 −1 truffle/src/main/java/org/jruby/truffle/tools/InstrumentationServerManager.java
  42. +2 −1 truffle/src/main/java/org/jruby/truffle/tools/simpleshell/SimpleShell.java
  43. +38 −0 truffle/src/main/java/org/jruby/truffle/util/StringUtils.java
1 change: 0 additions & 1 deletion spec/truffle/tags/core/integer/chr_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -43,6 +43,8 @@
import org.jruby.truffle.language.objects.SingletonClassNode;
import org.jruby.truffle.language.parser.jruby.Translator;
import org.jruby.truffle.platform.UnsafeGroup;
import org.jruby.truffle.util.StringUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -85,7 +87,7 @@ private DynamicObject getModule(String fullName) {
final RubyConstant constant = ModuleOperations.lookupConstant(context, module, moduleName);

if (constant == null) {
throw new RuntimeException(String.format("Module %s not found when adding core library", moduleName));
throw new RuntimeException(StringUtils.format("Module %s not found when adding core library", moduleName));
}

module = (DynamicObject) constant.getValue();
5 changes: 3 additions & 2 deletions truffle/src/main/java/org/jruby/truffle/core/CoreLibrary.java
Original file line number Diff line number Diff line change
@@ -130,6 +130,7 @@
import org.jruby.truffle.stdlib.psych.PsychEmitterNodesFactory;
import org.jruby.truffle.stdlib.psych.PsychParserNodesFactory;
import org.jruby.truffle.stdlib.psych.YAMLEncoding;
import org.jruby.truffle.util.StringUtils;
import org.jruby.util.cli.OutputStrings;
import java.io.File;
import java.io.IOException;
@@ -1082,7 +1083,7 @@ public DynamicObject getMetaClass(Object object) {
} else if (object == null) {
throw new RuntimeException("Can't get metaclass for null");
} else {
throw new UnsupportedOperationException(String.format("Don't know how to get the metaclass for %s", object.getClass()));
throw new UnsupportedOperationException(StringUtils.format("Don't know how to get the metaclass for %s", object.getClass()));
}
}

@@ -1111,7 +1112,7 @@ public DynamicObject getLogicalClass(Object object) {
} else if (object == null) {
throw new RuntimeException();
} else {
throw new UnsupportedOperationException(String.format("Don't know how to get the logical class for %s", object.getClass()));
throw new UnsupportedOperationException(StringUtils.format("Don't know how to get the logical class for %s", object.getClass()));
}
}

Original file line number Diff line number Diff line change
@@ -51,6 +51,8 @@
import org.jruby.truffle.language.parser.ParserContext;
import org.jruby.truffle.language.supercall.SuperCallNode;
import org.jruby.truffle.language.yield.YieldNode;
import org.jruby.truffle.util.StringUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -200,7 +202,8 @@ public Object instanceEval(VirtualFrame frame, Object receiver, NotProvided stri

@TruffleBoundary
private String getSpace(int line) {
return new String(new char[Math.max(line - 1, 0)]).replace("\0", "\n");
final String s = new String(new char[Math.max(line - 1, 0)]);
return StringUtils.replace(s, "\0", "\n");
}

}
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@
import org.jruby.truffle.language.NotProvided;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.util.StringUtils;

/**
* Array indices and lengths must be in 32-bit ranges. This class handle various data types and lowers to a 32-bit int
@@ -92,7 +93,7 @@ public int doBasicObject(Object object) {

@TruffleBoundary
private String formatOutOfRangeErrorMessage() {
return String.format("%s out of int range", indexName);
return StringUtils.format("%s out of int range", indexName);
}

protected static boolean inBounds(long value) {
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.language.dispatch.CallDispatchHeadNode;
import org.jruby.truffle.language.dispatch.DispatchHeadNodeFactory;
import org.jruby.truffle.util.StringUtils;

/**
* This is a port of MRI's rb_cmpint, as taken from RubyComparable and broken out into specialized nodes.
@@ -93,7 +94,7 @@ public int cmpNil(Object nil, Object receiver, Object other) {

@TruffleBoundary
private String formatMessage(Object receiver, Object other) {
return String.format("comparison of %s with %s failed",
return StringUtils.format("comparison of %s with %s failed",
Layouts.MODULE.getFields(coreLibrary().getLogicalClass(receiver)).getName(),
Layouts.MODULE.getFields(coreLibrary().getLogicalClass(other)).getName());
}
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.language.dispatch.CallDispatchHeadNode;
import org.jruby.truffle.language.dispatch.DispatchHeadNodeFactory;
import org.jruby.truffle.util.StringUtils;
import org.jruby.util.ByteList;
import org.jruby.util.io.EncodingUtils;

@@ -415,7 +416,7 @@ private DynamicObject eConvResultToSymbol(EConvResult result) {
case IncompleteInput: return getSymbol("incomplete_input");
}

throw new UnsupportedOperationException(String.format("Unknown EConv result: %s", result));
throw new UnsupportedOperationException(StringUtils.format("Unknown EConv result: %s", result));
}

}
Loading