|
44 | 44 | import java.util.Iterator;
|
45 | 45 |
|
46 | 46 | import com.oracle.graal.python.builtins.objects.PNone;
|
| 47 | +import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes; |
47 | 48 | import com.oracle.graal.python.builtins.objects.dict.PDict;
|
48 | 49 | import com.oracle.graal.python.builtins.objects.list.PList;
|
49 | 50 | import com.oracle.graal.python.builtins.objects.set.PSet;
|
@@ -81,13 +82,9 @@ static Object[] starargs(PTuple starargs) {
|
81 | 82 | }
|
82 | 83 |
|
83 | 84 | @Specialization
|
84 |
| - static Object[] starargs(PList starargs) { |
85 |
| - int length = starargs.getSequenceStorage().length(); |
86 |
| - Object[] internalArray = starargs.getSequenceStorage().getInternalArray(); |
87 |
| - if (internalArray.length != length) { |
88 |
| - return starargs.getSequenceStorage().getCopyOfInternalArray(); |
89 |
| - } |
90 |
| - return internalArray; |
| 85 | + static Object[] starargs(PList starargs, |
| 86 | + @Cached SequenceStorageNodes.ToArrayNode toArray) { |
| 87 | + return toArray.execute(starargs.getSequenceStorage()); |
91 | 88 | }
|
92 | 89 |
|
93 | 90 | @Specialization
|
@@ -170,7 +167,12 @@ static Object[] starargs(PTuple starargs) {
|
170 | 167 |
|
171 | 168 | @Specialization
|
172 | 169 | static Object[] starargs(PList starargs) {
|
173 |
| - return ExecutePositionalStarargsNode.starargs(starargs); |
| 170 | + int length = starargs.getSequenceStorage().length(); |
| 171 | + Object[] internalArray = starargs.getSequenceStorage().getInternalArray(); |
| 172 | + if (internalArray.length != length) { |
| 173 | + return starargs.getSequenceStorage().getCopyOfInternalArray(); |
| 174 | + } |
| 175 | + return internalArray; |
174 | 176 | }
|
175 | 177 |
|
176 | 178 | @Specialization
|
|
0 commit comments