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

GH-131798: Narrow types more aggressively in the JIT#134373

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
brandtbucher merged 7 commits intopython:mainfrombrandtbucher:check-attr-class
May 20, 2025
Merged
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
PrevPrevious commit
NextNext commit
Feedback from code review
  • Loading branch information
@brandtbucher
brandtbucher committedMay 20, 2025
commitd097c860adec35ecbbfe6e329a4f325b22e17aad
18 changes: 14 additions & 4 deletionsPython/optimizer_symbols.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -275,11 +275,21 @@ _Py_uop_sym_set_const(JitOptContext *ctx, JitOptSymbol *sym, PyObject *const_val
}
return;
case JIT_SYM_TUPLE_TAG:
if (Py_TYPE(const_val) != &PyTuple_Type) {
sym_set_bottom(ctx, sym);
return;
// TODO: We should do something smarter here. It's not as simple
// as sym_set_const, though, since we need to sym_set_bottom if
// the length doesn't match, or one of the symbolic types within
// the tuple contradicts its constant counterpart:
if (PyTuple_CheckExact(const_val)) {
Py_ssize_t len = PyTuple_GET_SIZE(const_val);
if (len == sym->tuple.length) {
for (Py_ssize_t i = 0; i < len; i++) {
JitOptSymbol *item = allocation_base(ctx) + sym->tuple.items[i];
PyObject *item_const = PyTuple_GET_ITEM(const_val, i);
_Py_uop_sym_set_const(ctx, item, item_const);
}
}
}
make_const(sym, const_val);
sym_set_bottom(ctx, sym);
return;
case JIT_SYM_TYPE_VERSION_TAG:
if (sym->version.version != Py_TYPE(const_val)->tp_version_tag) {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp