ITM will sometimes want to log a thread-local value, but instead of using stack-space and well-known control flow, it will ask the library to perform the logging on its behalf. We could simply use existing transactional metadata structures to log them, but these logged values do not need conflict detection, and we don't expect them to be common. For this reason, we do simple logging in the shim, and undo the logged values during rollback.
We log in word-sized maximum chunks. These are not assumed to have any specific alignment.
void Scope::LoggedWord::clip |
( |
void ** |
lower, |
|
|
void ** |
upper |
|
) |
| |
|
inlineprivate |
The clip routine is used to protect against undoing to both thrown objects and the protected stack. We aren't capable of undoing to a discontinuous range (i.e., if the logged value is larger than the range, and the range is completely contained withing the logged address range, and there is some "left-over" space on each side).
The range is [lower, upper)