@@ -680,11 +680,6 @@ private static class Flags {
680
680
@ CompilationFinal private PythonBuiltinClassType base ;
681
681
@ CompilationFinal private int weaklistoffset ;
682
682
683
- /**
684
- * @see #redefinesSlot(SpecialMethodSlot)
685
- */
686
- private SpecialMethodSlot [] redefinedSlots ;
687
-
688
683
/**
689
684
* Lookup cache for special slots defined in {@link SpecialMethodSlot}. Use
690
685
* {@link SpecialMethodSlot} to access the values. Unlike the cache in
@@ -857,25 +852,6 @@ public int getWeaklistoffset() {
857
852
return weaklistoffset ;
858
853
}
859
854
860
- /**
861
- * Returns {@code true} if this method slot is redefined in Python code during initialization.
862
- * Values of such slots cannot be cached in {@link #specialMethodSlots}, because they are not
863
- * context independent.
864
- */
865
- public boolean redefinesSlot (SpecialMethodSlot slot ) {
866
- if (redefinedSlots != null ) {
867
- for (SpecialMethodSlot redefSlot : redefinedSlots ) {
868
- if (redefSlot == slot ) {
869
- return true ;
870
- }
871
- }
872
- }
873
- if (base != null ) {
874
- return base .redefinesSlot (slot );
875
- }
876
- return false ;
877
- }
878
-
879
855
@ Override
880
856
public String toString () {
881
857
CompilerAsserts .neverPartOfCompilation ();
@@ -889,29 +865,7 @@ public final Shape getInstanceShape(PythonLanguage lang) {
889
865
@ CompilationFinal (dimensions = 1 ) public static final PythonBuiltinClassType [] VALUES = Arrays .copyOf (values (), values ().length - 1 );
890
866
891
867
static {
892
- // fill the overridden slots
893
- SpecialMethodSlot [] newSlot = new SpecialMethodSlot []{SpecialMethodSlot .New };
894
-
895
- PStructUnpackIterator .redefinedSlots = new SpecialMethodSlot []{SpecialMethodSlot .LengthHint };
896
-
897
- // These slots actually contain context independent values, but they are initialized in
898
- // StructSequence to artificial PBuiltinFunctions with artificial builtin node factories,
899
- // which are different for each context. We'd have to turn those factories into singletons
900
- // to guarantee their identity across contexts. For the sake of simplicity, we just ignore
901
- // those slots for now.
902
868
PStruct .type = PythonClass ;
903
- PStructRusage .redefinedSlots = newSlot ;
904
- PStructPasswd .redefinedSlots = newSlot ;
905
- PUnameResult .redefinedSlots = newSlot ;
906
- PUnraisableHookArgs .redefinedSlots = newSlot ;
907
- PIntInfo .redefinedSlots = newSlot ;
908
- PHashInfo .redefinedSlots = newSlot ;
909
- PStructTime .redefinedSlots = newSlot ;
910
- PProfilerEntry .redefinedSlots = newSlot ;
911
- PProfilerSubentry .redefinedSlots = newSlot ;
912
- PThreadInfo .redefinedSlots = newSlot ;
913
- PFloatInfo .redefinedSlots = newSlot ;
914
- PTerminalSize .redefinedSlots = newSlot ;
915
869
916
870
PythonObject .type = PythonClass ;
917
871
PythonObject .base = null ;
0 commit comments