mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Mirco-optimizations to reduce register spills and reloads observed on CLANG and GCC.
This commit is contained in:
parent
54576da2b4
commit
438f9134cf
1 changed files with 4 additions and 2 deletions
|
@ -84,8 +84,9 @@ set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
|
||||||
return set_lookkey(so, key, hash);
|
return set_lookkey(so, key, hash);
|
||||||
if (cmp > 0) /* likely */
|
if (cmp > 0) /* likely */
|
||||||
return entry;
|
return entry;
|
||||||
|
mask = so->mask; /* help avoid a register spill */
|
||||||
}
|
}
|
||||||
if (entry->key == dummy && freeslot == NULL)
|
if (entry->hash == -1 && freeslot == NULL)
|
||||||
freeslot = entry;
|
freeslot = entry;
|
||||||
|
|
||||||
if (i + LINEAR_PROBES <= mask) {
|
if (i + LINEAR_PROBES <= mask) {
|
||||||
|
@ -111,8 +112,9 @@ set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
|
||||||
return set_lookkey(so, key, hash);
|
return set_lookkey(so, key, hash);
|
||||||
if (cmp > 0)
|
if (cmp > 0)
|
||||||
return entry;
|
return entry;
|
||||||
|
mask = so->mask;
|
||||||
}
|
}
|
||||||
if (entry->key == dummy && freeslot == NULL)
|
if (entry->hash == -1 && freeslot == NULL)
|
||||||
freeslot = entry;
|
freeslot = entry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue