|
65 | 65 | import com.oracle.graal.python.nodes.function.builtins.PythonBinaryBuiltinNode;
|
66 | 66 | import com.oracle.graal.python.nodes.function.builtins.PythonTernaryBuiltinNode;
|
67 | 67 | import com.oracle.graal.python.nodes.function.builtins.PythonUnaryBuiltinNode;
|
| 68 | +import com.oracle.graal.python.nodes.util.CastToIndexNode; |
68 | 69 | import com.oracle.graal.python.runtime.exception.PythonErrorType;
|
69 | 70 | import com.oracle.graal.python.runtime.sequence.storage.ByteSequenceStorage;
|
70 | 71 | import com.oracle.graal.python.runtime.sequence.storage.SequenceStorage;
|
@@ -292,16 +293,10 @@ public Object mul(PBytes self, int times,
|
292 | 293 | }
|
293 | 294 |
|
294 | 295 | @Specialization
|
295 |
| - public Object mul(PBytes self, double times, |
296 |
| - @Cached("create()") SequenceStorageNodes.RepeatNode repeatNode) { |
297 |
| - SequenceStorage res = repeatNode.execute(self.getSequenceStorage(), (int) times); |
298 |
| - return factory().createBytes(res); |
299 |
| - } |
300 |
| - |
301 |
| - @Specialization |
302 |
| - public Object mul(PBytes self, long times, |
303 |
| - @Cached("create()") SequenceStorageNodes.RepeatNode repeatNode) { |
304 |
| - SequenceStorage res = repeatNode.execute(self.getSequenceStorage(), (int) times); |
| 296 | + public Object mul(PBytes self, Object times, |
| 297 | + @Cached("create()") SequenceStorageNodes.RepeatNode repeatNode, |
| 298 | + @Cached("create()") CastToIndexNode castToInt) { |
| 299 | + SequenceStorage res = repeatNode.execute(self.getSequenceStorage(), castToInt.execute(times)); |
305 | 300 | return factory().createBytes(res);
|
306 | 301 | }
|
307 | 302 |
|
|
0 commit comments