mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Update test__opcode and _Py_GetSpecializationStats with recent specialization stat changes (GH-27728)
This commit is contained in:
parent
08caf2d5d4
commit
64a7812c17
2 changed files with 5 additions and 2 deletions
|
@ -82,10 +82,12 @@ class SpecializationStatsTests(unittest.TestCase):
|
||||||
self.assertCountEqual(stats.keys(), specialized_opcodes)
|
self.assertCountEqual(stats.keys(), specialized_opcodes)
|
||||||
self.assertCountEqual(
|
self.assertCountEqual(
|
||||||
stats['load_attr'].keys(),
|
stats['load_attr'].keys(),
|
||||||
stat_names + ['fails'])
|
stat_names + ['specialization_failure_kinds'])
|
||||||
for sn in stat_names:
|
for sn in stat_names:
|
||||||
self.assertIsInstance(stats['load_attr'][sn], int)
|
self.assertIsInstance(stats['load_attr'][sn], int)
|
||||||
self.assertIsInstance(stats['load_attr']['specialization_failure_kinds'], tuple)
|
self.assertIsInstance(
|
||||||
|
stats['load_attr']['specialization_failure_kinds'],
|
||||||
|
tuple)
|
||||||
for v in stats['load_attr']['specialization_failure_kinds']:
|
for v in stats['load_attr']['specialization_failure_kinds']:
|
||||||
self.assertIsInstance(v, int)
|
self.assertIsInstance(v, int)
|
||||||
|
|
||||||
|
|
|
@ -122,6 +122,7 @@ _Py_GetSpecializationStats(void) {
|
||||||
err += add_stat_dict(stats, LOAD_ATTR, "load_attr");
|
err += add_stat_dict(stats, LOAD_ATTR, "load_attr");
|
||||||
err += add_stat_dict(stats, LOAD_GLOBAL, "load_global");
|
err += add_stat_dict(stats, LOAD_GLOBAL, "load_global");
|
||||||
err += add_stat_dict(stats, BINARY_SUBSCR, "binary_subscr");
|
err += add_stat_dict(stats, BINARY_SUBSCR, "binary_subscr");
|
||||||
|
err += add_stat_dict(stats, STORE_ATTR, "store_attr");
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
Py_DECREF(stats);
|
Py_DECREF(stats);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue