Message258206
| Author |
yselivanov |
| Recipients |
benjamin.peterson, brett.cannon, gvanrossum, ncoghlan, vstinner, yselivanov |
| Date |
2016年01月14日.17:51:32 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1452793893.16.0.702583695864.issue26110@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> If you prefer to limit the number of opcodes, you can pass a flag in arguments. For example, use 2 bytes for 2 arguments instead of only 1?
I tried two approaches:
1. Push one more leading NULL to the stack in LOAD_METHOD (which makes it push 3 vals). Then, in CALL_FUNCTION, detect when the callable is NULL and to the stuff that CALL_METHOD does.
2. Use a bitflag on oparg for CALL_FUNCTION and CALL_* opcodes. This adds EXTENDED_ARG opcode overhead.
Long story short, the only option would be to add dedicated opcodes to work with LOAD_METHOD. However, I'd prefer to first merge this patch, as it's relatively small and easy to review, and then focus on improving other things (keyword/*arg calls, C methods, etc). This is just a first step. |
|