|
33 | 33 | import com.oracle.truffle.api.object.DynamicObjectLibrary;
|
34 | 34 | import com.oracle.truffle.api.source.Source;
|
35 | 35 | import com.oracle.truffle.api.source.SourceSection;
|
| 36 | +import com.oracle.truffle.api.strings.AbstractTruffleString; |
36 | 37 | import com.oracle.truffle.api.strings.TruffleString;
|
37 | 38 | import org.graalvm.collections.Pair;
|
38 | 39 | import org.truffleruby.Layouts;
|
@@ -300,17 +301,16 @@ protected Object parse(Object code,
|
300 | 301 | public abstract static class YARPExecuteNode extends CoreMethodArrayArgumentsNode {
|
301 | 302 | @Specialization(guards = "strings.isRubyString(code)", limit = "1")
|
302 | 303 | protected Object yarpExecute(VirtualFrame frame, Object code,
|
303 |
| - @Cached RubyStringLibrary strings, |
304 |
| - @Cached TruffleString.CopyToByteArrayNode copyToByteArrayNode) { |
| 304 | + @Cached RubyStringLibrary strings) { |
305 | 305 | var tstring = strings.getTString(code);
|
306 | 306 | var encoding = strings.getEncoding(code);
|
307 |
| - String sourceString = TStringUtils.toJavaStringOrThrow(tstring, encoding); |
308 | 307 |
|
309 |
| - return doExecute(sourceString, RubyArguments.getMethod(frame)); |
| 308 | + return doExecute(tstring, encoding, RubyArguments.getMethod(frame)); |
310 | 309 | }
|
311 | 310 |
|
312 | 311 | @TruffleBoundary
|
313 |
| - private Object doExecute(String sourceString, InternalMethod method) { |
| 312 | + private Object doExecute(AbstractTruffleString tstring, RubyEncoding encoding, InternalMethod method) { |
| 313 | + String sourceString = TStringUtils.toJavaStringOrThrow(tstring, encoding); |
314 | 314 | Source source = Source.newBuilder("ruby", sourceString, "<parse_ast>").build();
|
315 | 315 | TranslatorEnvironment.resetTemporaryVariablesIndex();
|
316 | 316 |
|
|
0 commit comments