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

Commits on Feb 14, 2016

  1. Copy the full SHA
    a7c3c41 View commit details
  2. 1
    Copy the full SHA
    a68080f View commit details
Showing with 1 addition and 9 deletions.
  1. +1 −9 truffle/src/main/java/org/jruby/truffle/interop/JRubyInterop.java
Original file line number Diff line number Diff line change
@@ -38,20 +38,14 @@ public IRubyObject toJRuby(Object object) {
} else if (object instanceof Boolean) {
return context.getJRubyRuntime().newBoolean((boolean) object);
} else if (RubyGuards.isRubyString(object)) {
return toJRubyString((DynamicObject) object);
return context.getJRubyRuntime().newString(StringOperations.rope((DynamicObject) object).toByteListCopy());
} else if (RubyGuards.isRubyEncoding(object)) {
return context.getJRubyRuntime().getEncodingService().rubyEncodingFromObject(context.getJRubyRuntime().newString(Layouts.ENCODING.getName((DynamicObject) object)));
} else {
throw new UnsupportedOperationException();
}
}

@CompilerDirectives.TruffleBoundary
public org.jruby.RubyString toJRubyString(DynamicObject string) {
assert RubyGuards.isRubyString(string);
return context.getJRubyRuntime().newString(StringOperations.rope(string).toByteListCopy());
}

@CompilerDirectives.TruffleBoundary
public Object toTruffle(IRubyObject object) {
if (object instanceof org.jruby.RubyFixnum) {
@@ -77,8 +71,6 @@ public DynamicObject toTruffle(org.jruby.RubyException jrubyException, RubyNode
switch (jrubyException.getMetaClass().getName()) {
case "ArgumentError":
return context.getCoreLibrary().argumentError(jrubyException.getMessage().toString(), currentNode);
case "Encoding::CompatibilityError":
return context.getCoreLibrary().encodingCompatibilityError(jrubyException.getMessage().toString(), currentNode);
case "RegexpError":
return context.getCoreLibrary().regexpError(jrubyException.getMessage().toString(), currentNode);
}