Skip to content

Commit

Permalink
Remove unused node.
Browse files Browse the repository at this point in the history
The `raw_bytes` node was used to get a Java `byte[]` out of a Rope as a polyglot object for hooking into Truffle Regex. Since the Truffle Regex interop is now done in Java, there's no need for this node.
  • Loading branch information
nirvdrum committed Jun 25, 2021
1 parent 791a777 commit e11975b
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/main/java/org/truffleruby/core/string/TruffleStringNodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
import org.truffleruby.core.rope.Rope;
import org.truffleruby.core.rope.RopeNodes;
import org.truffleruby.language.control.RaiseException;
import org.truffleruby.language.library.RubyStringLibrary;

import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.library.CachedLibrary;

@CoreModule("Truffle::StringOperations")
public class TruffleStringNodes {
Expand Down Expand Up @@ -71,15 +69,4 @@ private String formatTooLongError(int count, final Rope rope) {
}

}

@CoreMethod(names = "raw_bytes", onSingleton = true, required = 1)
public abstract static class RawBytesNode extends CoreMethodArrayArgumentsNode {
@Specialization(guards = "libString.isRubyString(string)")
protected Object rawBytes(Object string,
@CachedLibrary(limit = "2") RubyStringLibrary libString,
@Cached RopeNodes.BytesNode bytesNode) {
byte[] bytes = bytesNode.execute(libString.getRope(string));
return getContext().getEnv().asGuestValue(bytes);
}
}
}

0 comments on commit e11975b

Please sign in to comment.