Skip to content

Commit

Permalink
update pystats
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Jan 29, 2025
1 parent fa072fd commit b9bbd06
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ dummy_func(
assert(code->co_argcount == 2);
DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize));
getitem = PyStackRef_FromPyObjectNew(getitem_o);
STAT_INC(BINARY_SUBSCR, hit);
STAT_INC(BINARY_OP, hit);
}

op(_BINARY_OP_SUBSCR_INIT_CALL, (container, sub, getitem -- new_frame: _PyInterpreterFrame* )) {
Expand Down
2 changes: 1 addition & 1 deletion Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ _Py_GetSpecializationStats(void) {
err += add_stat_dict(stats, LOAD_SUPER_ATTR, "load_super_attr");
err += add_stat_dict(stats, LOAD_ATTR, "load_attr");
err += add_stat_dict(stats, LOAD_GLOBAL, "load_global");
err += add_stat_dict(stats, BINARY_SUBSCR, "binary_subscr");
err += add_stat_dict(stats, STORE_SUBSCR, "store_subscr");
err += add_stat_dict(stats, STORE_ATTR, "store_attr");
err += add_stat_dict(stats, CALL, "call");
Expand Down Expand Up @@ -1847,7 +1846,7 @@ binop_subscr_list_int_guard(PyObject *container, PyObject *sub)
static PyObject*
binop_subscr_list_int_action(PyObject *container, PyObject *sub)
{
STAT_INC(BINARY_SUBSCR, hit);
STAT_INC(BINARY_OP, hit);
Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
PyListObject* list = (PyListObject*)container;
#ifdef Py_GIL_DISABLED
Expand Down Expand Up @@ -1882,7 +1881,7 @@ binop_subscr_tuple_int_guard(PyObject *container, PyObject *sub)
static PyObject*
binop_subscr_tuple_int_action(PyObject *container, PyObject *sub)
{
STAT_INC(BINARY_SUBSCR, hit);
STAT_INC(BINARY_OP, hit);
assert(PyTuple_CheckExact(container));
assert(PyLong_CheckExact(sub));
assert(_PyLong_IsNonNegativeCompact((PyLongObject *)sub));
Expand Down Expand Up @@ -1921,7 +1920,7 @@ binop_subscr_str_int_guard(PyObject *container, PyObject *sub)
static PyObject*
binop_subscr_str_int_action(PyObject *container, PyObject *sub)
{
STAT_INC(BINARY_SUBSCR, hit);
STAT_INC(BINARY_OP, hit);
Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
Py_UCS4 c = PyUnicode_READ_CHAR((PyUnicodeObject*)container, index);
return (PyObject*)&_Py_SINGLETON(strings).ascii[c];
Expand All @@ -1936,7 +1935,7 @@ binop_subscr_dict_guard(PyObject *container, PyObject *sub)
static PyObject*
binop_subscr_dict_action(PyObject *container, PyObject *sub)
{
STAT_INC(BINARY_SUBSCR, hit);
STAT_INC(BINARY_OP, hit);
PyObject *res_o;
int rc = PyDict_GetItemRef(container, sub, &res_o);
if (rc == 0) {
Expand Down

0 comments on commit b9bbd06

Please sign in to comment.