Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix BINARY_SUBSCR_GETITEM stats#93903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
Fix BINARY_SUBSCR stats
  • Loading branch information
@Fidget-Spinner
Fidget-Spinner committedJun 16, 2022
commitba7af14f16cdc6063f008823ab572b08bfc151dd
10 changes: 5 additions & 5 deletionsPython/ceval.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2242,14 +2242,14 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
PyCodeObject *code = (PyCodeObject *)getitem->func_code;
size_t size = code->co_nlocalsplus + code->co_stacksize + FRAME_SPECIALS_SIZE;
assert(code->co_argcount == 2);
_PyInterpreterFrame *new_frame = _PyThreadState_BumpFramePointer(tstate, size);
STAT_INC(BINARY_SUBSCR, hit);

Py_INCREF(getitem);
_PyInterpreterFrame *new_frame = _PyFrame_Push(tstate, getitem);
if (new_frame == NULL) {
goto error;
}
CALL_STAT_INC(frames_pushed);
Py_INCREF(getitem);
_PyFrame_InitializeSpecials(new_frame, getitem,
NULL, code->co_nlocalsplus);
CALL_STAT_INC(inlined_py_calls);
STACK_SHRINK(2);
new_frame->localsplus[0] = container;
new_frame->localsplus[1] = sub;
Expand Down
3 changes: 2 additions & 1 deletionPython/specialize.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1212,7 +1212,8 @@ _Py_Specialize_BinarySubscr(
write_u32(cache->type_version, cls->tp_version_tag);
int version = _PyFunction_GetVersionForCurrentState(func);
if (version == 0 || version != (uint16_t)version) {
SPECIALIZATION_FAIL(BINARY_SUBSCR, SPEC_FAIL_OUT_OF_VERSIONS);
SPECIALIZATION_FAIL(BINARY_SUBSCR, version == 0 ?
SPEC_FAIL_OUT_OF_VERSIONS: SPEC_FAIL_OUT_OF_RANGE);
goto fail;
}
cache->func_version = version;
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp