Skip to content

Commit 70055d5

Browse files
committed
Small tidy up.
1 parent 4598218 commit 70055d5

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/main/java/org/truffleruby/cext/DataHolder.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@
1212
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
1313
import com.oracle.truffle.api.interop.InteropLibrary;
1414
import com.oracle.truffle.api.interop.TruffleObject;
15-
import com.oracle.truffle.api.interop.UnsupportedMessageException;
1615
import com.oracle.truffle.api.library.ExportLibrary;
1716
import com.oracle.truffle.api.library.ExportMessage;
1817

1918
import org.truffleruby.RubyLanguage;
20-
import org.truffleruby.interop.TranslateInteropExceptionNode;
2119

22-
/** This object represents a VALUE in C which wraps the raw Ruby object. This allows foreign access methods to be set up
23-
* which convert these value wrappers to native pointers without affecting the semantics of the wrapped objects. */
20+
/** This object represents a struct pointer in C held by a Ruby object. */
2421
@ExportLibrary(InteropLibrary.class)
2522
public final class DataHolder implements TruffleObject {
2623

@@ -58,10 +55,6 @@ public String toString() {
5855
@ExportMessage
5956
protected String toDisplayString(boolean allowSideEffects) {
6057
final InteropLibrary interop = InteropLibrary.getUncached();
61-
try {
62-
return "DATA_HOLDER: " + interop.asString(address);
63-
} catch (UnsupportedMessageException e) {
64-
throw TranslateInteropExceptionNode.getUncached().execute(e);
65-
}
58+
return "DATA_HOLDER: " + interop.toDisplayString(address, allowSideEffects);
6659
}
6760
}

src/main/java/org/truffleruby/core/rope/NativeRope.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import com.oracle.truffle.api.profiles.ConditionProfile;
1313
import org.jcodings.Encoding;
1414
import org.jcodings.specific.ASCIIEncoding;
15-
import org.truffleruby.RubyContext;
1615
import org.truffleruby.RubyLanguage;
1716
import org.truffleruby.core.string.StringAttributes;
1817
import org.truffleruby.core.string.StringSupport;

src/main/java/org/truffleruby/core/string/ImmutableRubyString.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public synchronized NativeRope getNativeRope(RubyLanguage language) {
6767

6868
@TruffleBoundary
6969
private NativeRope createNativeRope(RubyLanguage language) {
70-
return new NativeRope(rope.getBytes(), rope.getEncoding(), rope.characterLength(), rope.getCodeRange(), language);
70+
return new NativeRope(rope.getBytes(), rope.getEncoding(), rope.characterLength(), rope.getCodeRange(),
71+
language);
7172
}
7273

7374
// region RubyStringLibrary messages

0 commit comments

Comments
 (0)