|
76 | 76 | import com.oracle.graal.python.builtins.objects.tuple.PTuple;
|
77 | 77 | import com.oracle.graal.python.nodes.ErrorMessages;
|
78 | 78 | import com.oracle.graal.python.nodes.PGuards;
|
79 |
| -import com.oracle.graal.python.nodes.SpecialMethodNames; |
80 |
| -import com.oracle.graal.python.nodes.call.special.LookupAndCallUnaryNode.LookupAndCallUnaryDynamicNode; |
81 | 79 | import com.oracle.graal.python.nodes.classes.IsSubtypeNode;
|
82 | 80 | import com.oracle.graal.python.nodes.object.IsBuiltinClassProfile;
|
83 | 81 | import com.oracle.graal.python.runtime.PythonContext;
|
@@ -949,12 +947,12 @@ private static int intValue(Number rc) {
|
949 | 947 | static ParserState doPredicate(ParserState state, Object kwds, @SuppressWarnings("unused") char c, @SuppressWarnings("unused") char[] format, @SuppressWarnings("unused") int format_idx,
|
950 | 948 | Object kwdnames, Object varargs,
|
951 | 949 | @Shared("getArgNode") @Cached GetArgNode getArgNode,
|
952 |
| - @Shared("writeOutVarNode") @Cached WriteOutVarNode writeOutVarNode) throws InteropException, ParseArgumentsException { |
| 950 | + @Shared("writeOutVarNode") @Cached WriteOutVarNode writeOutVarNode, |
| 951 | + @CachedLibrary(limit = "3") PythonObjectLibrary lib) throws InteropException, ParseArgumentsException { |
953 | 952 |
|
954 | 953 | Object arg = getArgNode.execute(state, kwds, kwdnames, state.restKeywordsOnly);
|
955 | 954 | if (!skipOptionalArg(arg, state.restOptional)) {
|
956 |
| - // TODO(fa) refactor 'CastToBooleanNode' to provide uncached version and use it |
957 |
| - writeOutVarNode.writeInt32(varargs, state.outIndex, LookupAndCallUnaryDynamicNode.getUncached().executeObject(arg, SpecialMethodNames.__BOOL__)); |
| 955 | + writeOutVarNode.writeInt32(varargs, state.outIndex, lib.isTrue(arg) ? 1 : 0); |
958 | 956 | }
|
959 | 957 | return state.incrementOutIndex();
|
960 | 958 | }
|
|
0 commit comments