|
62 | 62 | import com.oracle.graal.python.builtins.objects.common.IndexNodes.NormalizeIndexNode;
|
63 | 63 | import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes;
|
64 | 64 | import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes.ListGeneralizationNode;
|
| 65 | +import com.oracle.graal.python.builtins.objects.function.PArguments; |
65 | 66 | import com.oracle.graal.python.builtins.objects.ints.PInt;
|
66 | 67 | import com.oracle.graal.python.builtins.objects.iterator.PDoubleSequenceIterator;
|
67 | 68 | import com.oracle.graal.python.builtins.objects.iterator.PIntegerSequenceIterator;
|
68 | 69 | import com.oracle.graal.python.builtins.objects.iterator.PLongSequenceIterator;
|
69 | 70 | import com.oracle.graal.python.builtins.objects.iterator.PSequenceIterator;
|
70 | 71 | import com.oracle.graal.python.builtins.objects.list.ListBuiltinsFactory.ListReverseNodeFactory;
|
| 72 | +import com.oracle.graal.python.builtins.objects.object.PythonObjectLibrary; |
71 | 73 | import com.oracle.graal.python.builtins.objects.range.PRange;
|
72 | 74 | import com.oracle.graal.python.builtins.objects.str.PString;
|
73 | 75 | import com.oracle.graal.python.builtins.objects.tuple.PTuple;
|
|
80 | 82 | import com.oracle.graal.python.nodes.call.special.LookupAndCallUnaryNode;
|
81 | 83 | import com.oracle.graal.python.nodes.control.GetIteratorExpressionNode.GetIteratorNode;
|
82 | 84 | import com.oracle.graal.python.nodes.expression.BinaryComparisonNode;
|
83 |
| -import com.oracle.graal.python.nodes.expression.CastToBooleanNode; |
84 | 85 | import com.oracle.graal.python.nodes.function.PythonBuiltinBaseNode;
|
85 | 86 | import com.oracle.graal.python.nodes.function.PythonBuiltinNode;
|
86 | 87 | import com.oracle.graal.python.nodes.function.builtins.PythonBinaryBuiltinNode;
|
|
105 | 106 | import com.oracle.truffle.api.dsl.Specialization;
|
106 | 107 | import com.oracle.truffle.api.dsl.TypeSystemReference;
|
107 | 108 | import com.oracle.truffle.api.frame.VirtualFrame;
|
| 109 | +import com.oracle.truffle.api.library.CachedLibrary; |
108 | 110 | import com.oracle.truffle.api.profiles.ConditionProfile;
|
109 | 111 |
|
110 | 112 | @CoreFunctions(extendClasses = PythonBuiltinClassType.PList)
|
@@ -478,13 +480,13 @@ PNone remove(VirtualFrame frame, PList list, Object value,
|
478 | 480 | @Cached("createNotNormalized()") SequenceStorageNodes.GetItemNode getItemNode,
|
479 | 481 | @Cached("create()") SequenceStorageNodes.DeleteNode deleteNode,
|
480 | 482 | @Cached("create()") SequenceStorageNodes.LenNode lenNode,
|
481 |
| - @Cached("createIfTrueNode()") CastToBooleanNode castToBooleanNode, |
| 483 | + @CachedLibrary(limit = "getCallSiteInlineCacheMaxDepth()") PythonObjectLibrary lib, |
482 | 484 | @Cached("create(__EQ__, __EQ__, __EQ__)") BinaryComparisonNode eqNode) {
|
483 | 485 | SequenceStorage listStore = list.getSequenceStorage();
|
484 | 486 | int len = lenNode.execute(listStore);
|
485 | 487 | for (int i = 0; i < len; i++) {
|
486 | 488 | Object object = getItemNode.execute(frame, listStore, i);
|
487 |
| - if (castToBooleanNode.executeBoolean(frame, eqNode.executeWith(frame, object, value))) { |
| 489 | + if (lib.isTrueWithState(eqNode.executeWith(frame, object, value), PArguments.getThreadState(frame))) { |
488 | 490 | deleteNode.execute(frame, listStore, i);
|
489 | 491 | return PNone.NONE;
|
490 | 492 | }
|
|
0 commit comments