-
Notifications
You must be signed in to change notification settings - Fork 2
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phase 3: Py_CHECKWRITE
-> write barrier todo list
#10
Comments
Based on looking through I think we might want PY_REGIONCHECKINSERT(src, newtgt);
PY_REGIONCHECKREMOVE(src, oldtgt);
PY_REGIONCHECKREPLACE(src, oldtgt, newtgt);
PY_REGIONCHECKREPLACEUNKNOWN(src, newtgt); // Used when we lose precision There are places I have found that only add or remove, e.g. clearing the dictionary only performs remove. |
Tiny nit: I think by convention the y in I assume with |
Yeah, I had changed to Yes, lose precision, is the region is dirty, and might not satisfy the invariant. I also after trying to use these macros for a few minutes think they need to change. I think we need variandic macros: With the macros above, if we want to support backing out a failure, then we would need to write something like: if (!Py_REGIONCHECKINSERT(mp, key)) {
goto Fail;
}
if (!Py_REGIONCHECKINSERT(mp, value)) {
Py_REGIONCHECKREMOVE(mp, key);
goto Fail;
} If we had a variadic insert, we could write if (!Py_REGIONCHECKINSERT(mp, key, value)) {
goto Fail;
} So, I am trying my changes with this kind of alternative now, which would internally do the back tracking (or at least could be made to). |
Maybe relevant for the fail: I'm currently creating a draft/dummy These checks should usually leave the system in a valid state, but cleaning might fail and have invalid references remain afterwards |
An extract of all
Py_CHECKWRITE()
calls which need to be adjusted for the write barrier. (From the phase3 branch)Objects/abstract.c (owner @TobiasWrigstad)
Python/generated_cases.c.h
Objects/setobject.c
Objects/listobject.c
Objects/dictobject.c (@mjp41 owner)
Objects/object.c (@TobiasWrigstad owner -- see #26)
Objects/tupleobject.c (@TobiasWrigstad owner -- see #46)
Objects/cellobject.c (@xFrednet owner)
Python/bytecodes.c (@xFrednet owner)
Include/cpython/listobject.h
cc: @mjp41 @TobiasWrigstad
The text was updated successfully, but these errors were encountered: