gh-115816: Improve internal symbols API in optimizer (#116028)

- Any `sym_set_...` call that attempts to set conflicting information
  cause the symbol to become `bottom` (contradiction).
- All `sym_is...` and similar calls return false or NULL for `bottom`.
- Everything's tested.
- The tests still pass with `PYTHONUOPSOPTIMIZE=1`.
This commit is contained in:
Guido van Rossum 2024-02-28 09:55:56 -08:00 committed by GitHub
parent f58f8cef74
commit e2a3e4b748
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 190 additions and 66 deletions

View file

@ -294,7 +294,9 @@ remove_globals(_PyInterpreterFrame *frame, _PyUOpInstruction *buffer,
#define sym_new_null _Py_uop_sym_new_null
#define sym_matches_type _Py_uop_sym_matches_type
#define sym_set_null _Py_uop_sym_set_null
#define sym_set_non_null _Py_uop_sym_set_non_null
#define sym_set_type _Py_uop_sym_set_type
#define sym_set_const _Py_uop_sym_set_const
#define frame_new _Py_uop_frame_new
#define frame_pop _Py_uop_frame_pop