|
49 | 49 | import com.oracle.graal.python.builtins.objects.ints.PInt; |
50 | 50 | import com.oracle.graal.python.builtins.objects.list.ListBuiltins.ListAppendNode; |
51 | 51 | import com.oracle.graal.python.builtins.objects.list.PList; |
| 52 | +import com.oracle.graal.python.nodes.argument.ReadArgumentNode; |
52 | 53 | import com.oracle.graal.python.nodes.function.PythonBuiltinBaseNode; |
53 | 54 | import com.oracle.graal.python.nodes.function.PythonBuiltinNode; |
54 | 55 | import com.oracle.graal.python.nodes.function.builtins.PythonBinaryBuiltinNode; |
@@ -318,6 +319,10 @@ protected List<byte[]> splitDelimiter(byte[] bytes, byte[] sep, int maxsplit) { |
318 | 319 | throw new RuntimeException(); |
319 | 320 | } |
320 | 321 |
|
| 322 | + protected AbstractSplitNode createRecursiveNode() { |
| 323 | + throw new RuntimeException(); |
| 324 | + } |
| 325 | + |
321 | 326 | @CompilationFinal private ConditionProfile isEmptySepProfile; |
322 | 327 | @CompilationFinal private ConditionProfile overflowProfile; |
323 | 328 |
|
@@ -348,10 +353,6 @@ protected List<byte[]> splitDelimiter(byte[] bytes, byte[] sep, int maxsplit) { |
348 | 353 | } |
349 | 354 | } |
350 | 355 |
|
351 | | - public static AbstractSplitNode create() { |
352 | | - return AbstractBytesBuiltinsFactory.AbstractSplitNodeGen.create(); |
353 | | - } |
354 | | - |
355 | 356 | private ConditionProfile getIsEmptyProfile() { |
356 | 357 | if (isEmptySepProfile == null) { |
357 | 358 | CompilerDirectives.transferToInterpreterAndInvalidate(); |
@@ -403,7 +404,7 @@ private CastToIntegerFromIndexNode getCastIntNode() { |
403 | 404 | private AbstractSplitNode getRecursiveNode() { |
404 | 405 | if (recursiveNode == null) { |
405 | 406 | CompilerDirectives.transferToInterpreterAndInvalidate(); |
406 | | - recursiveNode = insert(AbstractSplitNode.create()); |
| 407 | + recursiveNode = insert(createRecursiveNode()); |
407 | 408 | } |
408 | 409 | return recursiveNode; |
409 | 410 | } |
@@ -661,6 +662,11 @@ protected List<byte[]> splitDelimiter(byte[] bytes, byte[] sep, int maxsplit) { |
661 | 662 | } |
662 | 663 | return result; |
663 | 664 | } |
| 665 | + |
| 666 | + @Override |
| 667 | + protected AbstractSplitNode createRecursiveNode() { |
| 668 | + return AbstractBytesBuiltinsFactory.SplitNodeFactory.create(new ReadArgumentNode[]{}); |
| 669 | + } |
664 | 670 | } |
665 | 671 |
|
666 | 672 | @Builtin(name = "rsplit", minNumOfPositionalArgs = 1, maxNumOfPositionalArgs = 3, keywordArguments = {"sep", "maxsplit"}) |
@@ -763,5 +769,10 @@ protected List<byte[]> splitDelimiter(byte[] bytes, byte[] sep, int maxsplit) { |
763 | 769 | } |
764 | 770 | return result; |
765 | 771 | } |
| 772 | + |
| 773 | + @Override |
| 774 | + protected AbstractSplitNode createRecursiveNode() { |
| 775 | + return AbstractBytesBuiltinsFactory.RSplitNodeFactory.create(new ReadArgumentNode[]{}); |
| 776 | + } |
766 | 777 | } |
767 | 778 | } |
0 commit comments