Commit 62c8197
committed
Fix issues found in code review.
* Fix locking for `STORE_ATTR_INSTANCE_VALUE`. Create
`_GUARD_TYPE_VERSION_AND_LOCK` so that object stays locked and
`tp_version_tag` cannot change. Fix inverted logic bug that caused
erroneous deopt.
* Fix locking for `_STORE_ATTR_WITH_HINT`. Double check that
`_PyObject_GetManagedDict()` hasn't disappeared since we locked the
dict.
- Pass `tp_version_tag` to `specialize_dict_access()`, ensuring
the version we store on the cache is the correct one (in case of
it changing during the specalize analysis).
- Split `analyze_descriptor` into `analyze_descriptor_load` and
`analyze_descriptor_store` since those don't share much logic.
Add `descriptor_is_class` helper function.
- In `specialize_dict_access`, double check `_PyObject_GetManagedDict()`
in case we race and dict was materialized before the lock.1 parent 083cbe9 commit 62c8197
File tree
9 files changed
+264
-208
lines changed- Include/internal
- Lib/test
- Python
9 files changed
+264
-208
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1388 | 1388 | | |
1389 | 1389 | | |
1390 | 1390 | | |
1391 | | - | |
1392 | | - | |
1393 | 1391 | | |
1394 | 1392 | | |
1395 | 1393 | | |
| |||
0 commit comments