16 #ifndef UNDO_LOG_HPP__
17 #define UNDO_LOG_HPP__
19 #include <stm/config.h>
45 : addr(addr), val(val)
64 inline bool filter(
void** lower,
void** upper)
66 return (
addr >= lower &&
addr + 1 < upper);
103 if (mask == ~(uintptr_t)0x0) {
119 uint8_t bytes[
sizeof(
void*)];
124 uint8_t bytes[
sizeof(uintptr_t)];
132 for (
unsigned i = 0; i <
sizeof(
void*); ++i)
133 if (umask.bytes[i] == 0xFF)
134 uaddr.bytes[i] = uval.bytes[i];
143 inline bool filter(
void** lower,
void** upper)
146 return (
addr + 1 < lower ||
addr >= upper)
164 #if defined(STM_WS_WORDLOG)
165 typedef WordLoggingUndoLogEntry UndoLogEntry;
166 #define STM_UNDO_LOG_ENTRY(addr, val, mask) addr, val
167 #define STM_DO_MASKED_WRITE(addr, val, mask) *addr = val
168 #elif defined(STM_WS_BYTELOG)
169 typedef ByteLoggingUndoLogEntry UndoLogEntry;
170 #define STM_UNDO_LOG_ENTRY(addr, val, mask) addr, val, mask
171 #define STM_DO_MASKED_WRITE(addr, val, mask) \
172 stm::ByteLoggingUndoLogEntry::DoMaskedWrite(addr, val, mask)
174 # error Configuration logic error.
189 #if !defined(STM_PROTECT_STACK) && !defined(STM_ABORT_ON_THROW)
191 # define STM_UNDO(log, stack, except, len) log.undo()
192 #elif defined(STM_PROTECT_STACK) && !defined(STM_ABORT_ON_THROW)
193 void undo(
void** upper_stack_bound);
194 # define STM_UNDO(log, stack, except, len) log.undo(stack)
195 #elif !defined(STM_PROTECT_STACK) && defined(STM_ABORT_ON_THROW)
196 void undo(
void** except,
size_t len);
197 # define STM_UNDO(log, stack, except, len) log.undo(except, len)
198 #elif defined(STM_PROTECT_STACK) && defined(STM_ABORT_ON_THROW)
199 void undo(
void** upper_stack_bound,
void** exception,
size_t len);
200 # define STM_UNDO(log, stack, except, len) log.undo(stack, except, len)
202 # error if/else logic error
206 #endif // UNDO_LOG_HPP__
Definition: stm_fraser.c:61
void ** addr
Definition: UndoLog.hpp:76
bool filter(void **lower, void **upper)
Definition: UndoLog.hpp:64
Definition: UndoLog.hpp:39
void ** addr
Definition: UndoLog.hpp:41
uint8_t byte_val[sizeof(void *)]
Definition: UndoLog.hpp:82
void undo() const
Definition: UndoLog.hpp:49
static void DoMaskedWrite(void **addr, void *val, uintptr_t mask)
Definition: UndoLog.hpp:100
Definition: UndoLog.hpp:177
uintptr_t mask
Definition: UndoLog.hpp:86
UndoLog(const uintptr_t cap)
Definition: UndoLog.hpp:180
Definition: MiniVector.hpp:30
void undo() const
Definition: UndoLog.hpp:137
bool filterSlow(void **, void **)
Definition: types.cpp:259
void * val
Definition: UndoLog.hpp:42
bool filter(void **lower, void **upper)
Definition: UndoLog.hpp:143
void undo()
Definition: types.cpp:184
WordLoggingUndoLogEntry(void **addr, void *val)
Definition: UndoLog.hpp:44
ByteLoggingUndoLogEntry(void **paddr, void *pval, uintptr_t pmask)
Definition: UndoLog.hpp:91
uint8_t byte_mask[sizeof(uintptr_t)]
Definition: UndoLog.hpp:87
Definition: UndoLog.hpp:71
void * val
Definition: UndoLog.hpp:81
uint8_t * byte_addr
Definition: UndoLog.hpp:77