@@ -194,11 +194,6 @@ public interface GenNodeSupplier {
194194 GeneralizationNode getUncached ();
195195 }
196196
197- public interface ContainerFactory {
198-
199- Object apply (SequenceStorage s , PythonObjectFactory factory );
200- }
201-
202197 @ GenerateUncached
203198 public abstract static class IsAssignCompatibleNode extends Node {
204199
@@ -598,63 +593,60 @@ public static GetItemNode create(NormalizeIndexNode normalizeIndexNode, BiFuncti
598593 @ ImportStatic (PGuards .class )
599594 public abstract static class GetItemDynamicNode extends Node {
600595
601- public abstract Object execute ( ContainerFactory factoryMethod , SequenceStorage s , Object key );
596+ public abstract Object executeObject ( SequenceStorage s , Object key );
602597
603598 public final Object execute (SequenceStorage s , int key ) {
604- return execute ( null , s , key );
599+ return executeObject ( s , key );
605600 }
606601
607602 public final Object execute (SequenceStorage s , long key ) {
608- return execute ( null , s , key );
603+ return executeObject ( s , key );
609604 }
610605
611606 public final Object execute (SequenceStorage s , PInt key ) {
612- return execute ( null , s , key );
607+ return executeObject ( s , key );
613608 }
614609
615610 @ Specialization
616- protected static Object doScalarInt (@ SuppressWarnings ( "unused" ) ContainerFactory factoryMethod , SequenceStorage storage , int idx ,
611+ protected static Object doScalarInt (SequenceStorage storage , int idx ,
617612 @ Shared ("getItemScalarNode" ) @ Cached GetItemScalarNode getItemScalarNode ,
618613 @ Shared ("normalizeIndexNode" ) @ Cached NormalizeIndexCustomMessageNode normalizeIndexNode ,
619614 @ Shared ("lenNode" ) @ Cached LenNode lenNode ) {
620615 return getItemScalarNode .execute (storage , normalizeIndexNode .execute (idx , lenNode .execute (storage ), ErrorMessages .INDEX_OUT_OF_RANGE ));
621616 }
622617
623618 @ Specialization
624- protected static Object doScalarLong (@ SuppressWarnings ( "unused" ) ContainerFactory factoryMethod , SequenceStorage storage , long idx ,
619+ protected static Object doScalarLong (SequenceStorage storage , long idx ,
625620 @ Shared ("getItemScalarNode" ) @ Cached GetItemScalarNode getItemScalarNode ,
626621 @ Shared ("normalizeIndexNode" ) @ Cached NormalizeIndexCustomMessageNode normalizeIndexNode ,
627622 @ Shared ("lenNode" ) @ Cached LenNode lenNode ) {
628623 return getItemScalarNode .execute (storage , normalizeIndexNode .execute (idx , lenNode .execute (storage ), ErrorMessages .INDEX_OUT_OF_RANGE ));
629624 }
630625
631626 @ Specialization
632- protected static Object doScalarPInt (@ SuppressWarnings ( "unused" ) ContainerFactory factoryMethod , SequenceStorage storage , PInt idx ,
627+ protected static Object doScalarPInt (SequenceStorage storage , PInt idx ,
633628 @ Shared ("getItemScalarNode" ) @ Cached GetItemScalarNode getItemScalarNode ,
634629 @ Shared ("normalizeIndexNode" ) @ Cached NormalizeIndexCustomMessageNode normalizeIndexNode ,
635630 @ Shared ("lenNode" ) @ Cached LenNode lenNode ) {
636631 return getItemScalarNode .execute (storage , normalizeIndexNode .execute (idx , lenNode .execute (storage ), ErrorMessages .INDEX_OUT_OF_RANGE ));
637632 }
638633
639634 @ Specialization (guards = "!isPSlice(idx)" )
640- protected static Object doScalarGeneric (@ SuppressWarnings ( "unused" ) ContainerFactory factoryMethod , SequenceStorage storage , Object idx ,
635+ protected static Object doScalarGeneric (SequenceStorage storage , Object idx ,
641636 @ Shared ("getItemScalarNode" ) @ Cached GetItemScalarNode getItemScalarNode ,
642637 @ Shared ("normalizeIndexNode" ) @ Cached NormalizeIndexCustomMessageNode normalizeIndexNode ,
643638 @ Shared ("lenNode" ) @ Cached LenNode lenNode ) {
644639 return getItemScalarNode .execute (storage , normalizeIndexNode .execute (idx , lenNode .execute (storage ), ErrorMessages .INDEX_OUT_OF_RANGE ));
645640 }
646641
647642 @ Specialization
648- protected static Object doSlice (ContainerFactory factoryMethod , SequenceStorage storage , PSlice slice ,
643+ @ SuppressWarnings ("unused" )
644+ protected static Object doSlice (SequenceStorage storage , PSlice slice ,
649645 @ Cached GetItemSliceNode getItemSliceNode ,
650646 @ Cached PythonObjectFactory factory ,
651647 @ Cached CoerceToIntSlice sliceCast ,
652648 @ Cached ComputeIndices compute ,
653649 @ Cached LenOfRangeNode sliceLen ) {
654- SliceInfo info = compute .execute (sliceCast .execute (slice ), storage .length ());
655- if (factoryMethod != null ) {
656- return factoryMethod .apply (getItemSliceNode .execute (storage , info .start , info .stop , info .step , sliceLen .len (info )), factory );
657- }
658650 CompilerDirectives .transferToInterpreterAndInvalidate ();
659651 throw new IllegalStateException ();
660652 }
0 commit comments