-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Labels
easyinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
_REPLACE_WITH_TRUE
is not currently in the tier 2 optimizer's known list, resulting in some missed opportunities.
To add it, here are the following steps:
- Add a new bytecode definition
_REPLACE_WITH_TRUE
inPython/optimizer_bytecodes.c
, with the same header as the one inPython/bytecodes.c
. - The body of the instruction in
optimizer_bytecodes.c
should sayres = sym_new_const(ctx, Py_True);
. Meaning that the new value is a new symbolic constant of the value "True". - Run
make regen-cases
on *nix. - You can add a test in
Lib/test/test_capi/test_opt.py
. This is optional, you can choose not to as well.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
Eclips4
Metadata
Metadata
Assignees
Labels
easyinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement