Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8214006
Add insertion order bit-vector to dict values to allow dicts to share…
markshannon Sep 21, 2021
45c9814
Add NEWS
markshannon Sep 23, 2021
c3de09e
Never change types' cached keys. It could invalidate inline attribute…
markshannon Sep 23, 2021
58dd2a0
Lazily create object dictionaries. Work in progress.
markshannon Sep 23, 2021
769183a
Restore specialization for inline attributes.
markshannon Sep 30, 2021
1e6cd1f
Turn on stats
markshannon Sep 30, 2021
a8fbb34
Fix specialization of LOAD/STORE_ATTR.
markshannon Oct 1, 2021
37d8cc6
Turn off stats.
markshannon Oct 1, 2021
0e022f9
Don't update shared keys version for deletion of value.
markshannon Oct 4, 2021
ddd2e2c
Merge main into inline-attributes-with-opt
markshannon Oct 6, 2021
e979575
Fix refrence leak.
markshannon Oct 6, 2021
42361ad
Change 'InlineAttribute' to 'InstanceAttribute' as they are not inlin…
markshannon Oct 6, 2021
e9b09d5
Merge branch 'main' into inline-attributes-with-opt
markshannon Oct 6, 2021
70dc34f
Update gdb support to handle instance values.
markshannon Oct 7, 2021
022f2c5
Rename SPLIT_KEYS opcodes to INSTANCE_VALUE.
markshannon Oct 7, 2021
4ec5f11
Tidy test_gc
markshannon Oct 7, 2021
1818a5a
Don't lose errors.
markshannon Oct 7, 2021
bfc7be0
Make sure order is updated when deleting from values array.
markshannon Oct 7, 2021
62a3a59
Update test_dict.
markshannon Oct 7, 2021
7978220
Add NEWS
markshannon Oct 8, 2021
b25b1d9
Merge branch 'main' into inline-attributes-with-opt
markshannon Oct 12, 2021
7b2efa4
Merge branch 'main' into inline-attributes-with-opt
markshannon Oct 12, 2021
459e29e
Make sure that instance dicts are GC tracked when necessary.
markshannon Oct 12, 2021
83b90c5
Support older versions of Python in gdb.
markshannon Oct 12, 2021
8c894f3
Rename function and move to internal header.
markshannon Oct 12, 2021
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
Prev Previous commit
Next Next commit
Merge branch 'main' into inline-attributes-with-opt
  • Loading branch information
markshannon committed Oct 6, 2021
commit e9b09d5f49b7b17ad6dfa11d83c7ef98d05724e2
17 changes: 9 additions & 8 deletions Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,11 @@ static PyDictValues empty_values_struct = { 0, { NULL }};
#endif

static inline int
get_index_from_order(PyDictObject *mp, int i)
get_index_from_order(PyDictObject *mp, Py_ssize_t i)
{
int shift = (mp->ma_used-1-i)*4;
return (mp->ma_values->mv_order >> shift) & 15;
assert(mp->ma_used <= 16);
int shift = (int)(mp->ma_used-1-i)*4;
return (int)(mp->ma_values->mv_order >> shift) & 15;
}

int
Expand Down Expand Up @@ -530,7 +531,7 @@ _PyDict_CheckConsistency(PyObject *op, int check_content)
CHECK(mp->ma_used <= SHARED_KEYS_MAX_SIZE);
/* splitted table */
int duplicate_check = 0;
for (i=0; i < mp->ma_used; i++) {
for (Py_ssize_t i=0; i < mp->ma_used; i++) {
int index = get_index_from_order(mp, i);
CHECK((duplicate_check & (1<<index)) == 0);
duplicate_check |= (1<<index);
Expand Down Expand Up @@ -1078,7 +1079,7 @@ insertdict(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject *value)
ep->me_key = key;
ep->me_hash = hash;
if (mp->ma_values) {
int index = mp->ma_keys->dk_nentries;
Py_ssize_t index = mp->ma_keys->dk_nentries;
assert(index < SHARED_KEYS_MAX_SIZE);
assert((mp->ma_values->mv_order >> 60) == 0);
mp->ma_values->mv_order = (mp->ma_values->mv_order)<<4 | index;
Expand Down Expand Up @@ -1226,7 +1227,7 @@ dictresize(PyDictObject *mp, uint8_t log2_newsize)
* Note that values of split table is always dense.
*/
for (Py_ssize_t i = 0; i < numentries; i++) {
int index = oldvalues->mv_order >> ((numentries-1-i)*4)&15;
int index = oldvalues->mv_order >> ((numentries-1-i)*4) & 15;
assert(oldvalues->values[index] != NULL);
PyDictKeyEntry *ep = &oldentries[index];
PyObject *key = ep->me_key;
Expand Down Expand Up @@ -1591,7 +1592,7 @@ delitem_common(PyDictObject *mp, Py_hash_t hash, Py_ssize_t ix,
if (((mp->ma_values->mv_order >> i) & 15) == (uint64_t)ix) {
/* Remove 4 bits at ith position */
uint64_t order = mp->ma_values->mv_order;
uint64_t high = order >> i >> 4 << i;
uint64_t high = ((order>>i)>>4)<<i;
uint64_t low = order & ((((uint64_t)1)<<i)-1);
mp->ma_values->mv_order = high | low;
break;
Expand Down Expand Up @@ -2988,7 +2989,7 @@ PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *defaultobj)
ep->me_key = key;
ep->me_hash = hash;
if (_PyDict_HasSplitTable(mp)) {
int index = mp->ma_keys->dk_nentries;
int index = (int)mp->ma_keys->dk_nentries;
assert(index < SHARED_KEYS_MAX_SIZE);
assert(mp->ma_values->values[index] == NULL);
mp->ma_values->values[index] = value;
Expand Down
1 change: 1 addition & 0 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -4065,6 +4065,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
}

TARGET(JUMP_ABSOLUTE_QUICK) {
assert(oparg < INSTR_OFFSET());
JUMPTO(oparg);
CHECK_EVAL_BREAKER();
DISPATCH();
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.