@@ -1787,26 +1787,21 @@ public Object newList(VirtualFrame frame, long size,
1787
1787
return raiseNativeNode .raise (frame , getNativeNullNode .execute (), SystemError , BAD_ARG_TO_INTERNAL_FUNC_S , size );
1788
1788
}
1789
1789
1790
- @ SuppressWarnings ("unused" )
1791
- @ Specialization (guards = "size == 0" )
1792
- public Object newEmptyList (int size ) {
1793
- return factory ().createList (PythonUtils .EMPTY_OBJECT_ARRAY );
1794
- }
1795
-
1796
1790
@ SuppressWarnings ("unused" )
1797
1791
@ Specialization (guards = "size == 0" )
1798
1792
public Object newEmptyList (long size ) {
1799
1793
return factory ().createList (PythonUtils .EMPTY_OBJECT_ARRAY );
1800
1794
}
1801
1795
1802
1796
@ Specialization (guards = "size > 0" )
1803
- public Object newList (int size ) {
1804
- return factory ().createList (new Object [ size ] );
1797
+ public Object newList (long size ) {
1798
+ return factory ().createList (array ( size ) );
1805
1799
}
1806
1800
1807
- @ Specialization (guards = "size > 0" )
1808
- public Object newList (long size ) {
1809
- return factory ().createList (new Object [(int ) size ]);
1801
+ private static Object [] array (long size ) {
1802
+ Object [] a = new Object [(int ) size ];
1803
+ Arrays .fill (a , PNone .NO_VALUE );
1804
+ return a ;
1810
1805
}
1811
1806
}
1812
1807
@@ -1963,7 +1958,7 @@ Object getSlice(VirtualFrame frame, PList list, long iLow, long iHigh,
1963
1958
return getNativeNullNode .execute ();
1964
1959
}
1965
1960
}
1966
-
1961
+
1967
1962
@ Specialization
1968
1963
Object getSlice (VirtualFrame frame , PList list , Object iLow , Object iHigh ,
1969
1964
@ Cached com .oracle .graal .python .builtins .objects .list .ListBuiltins .GetItemNode getItemNode ,
@@ -2025,7 +2020,7 @@ Object getSlice(VirtualFrame frame, PList list, long iLow, long iHigh, Object s,
2025
2020
return -1 ;
2026
2021
}
2027
2022
}
2028
-
2023
+
2029
2024
@ Specialization
2030
2025
Object getSlice (VirtualFrame frame , PList list , Object iLow , Object iHigh , Object s ,
2031
2026
@ Cached com .oracle .graal .python .builtins .objects .list .ListBuiltins .SetItemNode setItemNode ,
0 commit comments