FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-144991: Use runtime JIT threshold in _testinternalcapi by corona10 · Pull Request #145496 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) .h  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion Include/internal/pycore_interp_structs.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ struct _py_func_state {

/* For now we hard-code this to a value for which we are confident
all the static builtin types will fit (for all builds). */
#define _Py_MAX_MANAGED_STATIC_BUILTIN_TYPES 201
#define _Py_MAX_MANAGED_STATIC_BUILTIN_TYPES 202

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why was this changed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Because a new static type was added recently, and JIT tests crash or fail with an assertion error without this change: #145496 (comment)

#define _Py_MAX_MANAGED_STATIC_EXT_TYPES 10
#define _Py_MAX_MANAGED_STATIC_TYPES \
(_Py_MAX_MANAGED_STATIC_BUILTIN_TYPES + _Py_MAX_MANAGED_STATIC_EXT_TYPES)
Expand Down
7 changes: 5 additions & 2 deletions Modules/_testinternalcapi.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2966,6 +2966,8 @@ static PyMethodDef module_functions[] = {
static int
module_exec(PyObject *module)
{
PyInterpreterState *interp = PyInterpreterState_Get();

if (_PyTestInternalCapi_Init_Lock(module) < 0) {
return 1;
}
Expand Down Expand Up @@ -3007,9 +3009,10 @@ module_exec(PyObject *module)
return 1;
}

// + 1 more due to one loop spent on tracing.
unsigned long threshold = interp->opt_config.jump_backward_initial_value + 2;
if (PyModule_Add(module, "TIER2_THRESHOLD",
// + 1 more due to one loop spent on tracing.
PyLong_FromLong(JUMP_BACKWARD_INITIAL_VALUE + 2)) < 0) {
PyLong_FromUnsignedLong(threshold)) < 0) {
return 1;
}

Expand Down
Loading

Back | FazBrowse Home | New Git URL