@@ -194,11 +194,6 @@ public interface GenNodeSupplier {
194
194
GeneralizationNode getUncached ();
195
195
}
196
196
197
- public interface ContainerFactory {
198
-
199
- Object apply (SequenceStorage s , PythonObjectFactory factory );
200
- }
201
-
202
197
@ GenerateUncached
203
198
public abstract static class IsAssignCompatibleNode extends Node {
204
199
@@ -598,63 +593,60 @@ public static GetItemNode create(NormalizeIndexNode normalizeIndexNode, BiFuncti
598
593
@ ImportStatic (PGuards .class )
599
594
public abstract static class GetItemDynamicNode extends Node {
600
595
601
- public abstract Object execute ( ContainerFactory factoryMethod , SequenceStorage s , Object key );
596
+ public abstract Object executeObject ( SequenceStorage s , Object key );
602
597
603
598
public final Object execute (SequenceStorage s , int key ) {
604
- return execute ( null , s , key );
599
+ return executeObject ( s , key );
605
600
}
606
601
607
602
public final Object execute (SequenceStorage s , long key ) {
608
- return execute ( null , s , key );
603
+ return executeObject ( s , key );
609
604
}
610
605
611
606
public final Object execute (SequenceStorage s , PInt key ) {
612
- return execute ( null , s , key );
607
+ return executeObject ( s , key );
613
608
}
614
609
615
610
@ Specialization
616
- protected static Object doScalarInt (@ SuppressWarnings ( "unused" ) ContainerFactory factoryMethod , SequenceStorage storage , int idx ,
611
+ protected static Object doScalarInt (SequenceStorage storage , int idx ,
617
612
@ Shared ("getItemScalarNode" ) @ Cached GetItemScalarNode getItemScalarNode ,
618
613
@ Shared ("normalizeIndexNode" ) @ Cached NormalizeIndexCustomMessageNode normalizeIndexNode ,
619
614
@ Shared ("lenNode" ) @ Cached LenNode lenNode ) {
620
615
return getItemScalarNode .execute (storage , normalizeIndexNode .execute (idx , lenNode .execute (storage ), ErrorMessages .INDEX_OUT_OF_RANGE ));
621
616
}
622
617
623
618
@ Specialization
624
- protected static Object doScalarLong (@ SuppressWarnings ( "unused" ) ContainerFactory factoryMethod , SequenceStorage storage , long idx ,
619
+ protected static Object doScalarLong (SequenceStorage storage , long idx ,
625
620
@ Shared ("getItemScalarNode" ) @ Cached GetItemScalarNode getItemScalarNode ,
626
621
@ Shared ("normalizeIndexNode" ) @ Cached NormalizeIndexCustomMessageNode normalizeIndexNode ,
627
622
@ Shared ("lenNode" ) @ Cached LenNode lenNode ) {
628
623
return getItemScalarNode .execute (storage , normalizeIndexNode .execute (idx , lenNode .execute (storage ), ErrorMessages .INDEX_OUT_OF_RANGE ));
629
624
}
630
625
631
626
@ Specialization
632
- protected static Object doScalarPInt (@ SuppressWarnings ( "unused" ) ContainerFactory factoryMethod , SequenceStorage storage , PInt idx ,
627
+ protected static Object doScalarPInt (SequenceStorage storage , PInt idx ,
633
628
@ Shared ("getItemScalarNode" ) @ Cached GetItemScalarNode getItemScalarNode ,
634
629
@ Shared ("normalizeIndexNode" ) @ Cached NormalizeIndexCustomMessageNode normalizeIndexNode ,
635
630
@ Shared ("lenNode" ) @ Cached LenNode lenNode ) {
636
631
return getItemScalarNode .execute (storage , normalizeIndexNode .execute (idx , lenNode .execute (storage ), ErrorMessages .INDEX_OUT_OF_RANGE ));
637
632
}
638
633
639
634
@ 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 ,
641
636
@ Shared ("getItemScalarNode" ) @ Cached GetItemScalarNode getItemScalarNode ,
642
637
@ Shared ("normalizeIndexNode" ) @ Cached NormalizeIndexCustomMessageNode normalizeIndexNode ,
643
638
@ Shared ("lenNode" ) @ Cached LenNode lenNode ) {
644
639
return getItemScalarNode .execute (storage , normalizeIndexNode .execute (idx , lenNode .execute (storage ), ErrorMessages .INDEX_OUT_OF_RANGE ));
645
640
}
646
641
647
642
@ Specialization
648
- protected static Object doSlice (ContainerFactory factoryMethod , SequenceStorage storage , PSlice slice ,
643
+ @ SuppressWarnings ("unused" )
644
+ protected static Object doSlice (SequenceStorage storage , PSlice slice ,
649
645
@ Cached GetItemSliceNode getItemSliceNode ,
650
646
@ Cached PythonObjectFactory factory ,
651
647
@ Cached CoerceToIntSlice sliceCast ,
652
648
@ Cached ComputeIndices compute ,
653
649
@ 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
- }
658
650
CompilerDirectives .transferToInterpreterAndInvalidate ();
659
651
throw new IllegalStateException ();
660
652
}
0 commit comments