Bug 1502207 Part 1 - Specify the address of atomic values when recording ordered atomic accesses, r=froydnj.
authorBrian Hackett <bhackett1024@gmail.com>
Thu, 25 Oct 2018 11:41:04 -1000
changeset 443263 9a3d3ccfdd50276320d819e5be9174ba7859a13a
parent 443262 89697dbd654a76380a910b5dc4c6c0f3afbaddc6
child 443264 c7ed95dcc001cb73dd7f0fceb2335929909e771f
push id109332
push userbhackett@mozilla.com
push dateSun, 28 Oct 2018 22:24:50 +0000
treeherdermozilla-inbound@b31239e8fbe3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1502207
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1502207 Part 1 - Specify the address of atomic values when recording ordered atomic accesses, r=froydnj.
mfbt/RecordReplay.cpp
mfbt/RecordReplay.h
--- a/mfbt/RecordReplay.cpp
+++ b/mfbt/RecordReplay.cpp
@@ -37,17 +37,17 @@ namespace recordreplay {
   Macro(InternalThingIndex, size_t, (void* aThing), (aThing))   \
   Macro(InternalVirtualThingName, const char*, (void* aThing), (aThing)) \
   Macro(ExecutionProgressCounter, ProgressCounter*, (), ())     \
   Macro(NewTimeWarpTarget, ProgressCounter, (), ())             \
   Macro(IsInternalScript, bool, (const char* aURL), (aURL))     \
   Macro(DefineRecordReplayControlObject, bool, (JSContext* aCx, JSObject* aObj), (aCx, aObj))
 
 #define FOR_EACH_INTERFACE_VOID(Macro)                          \
-  Macro(InternalBeginOrderedAtomicAccess, (), ())               \
+  Macro(InternalBeginOrderedAtomicAccess, (const void* aValue), (aValue)) \
   Macro(InternalEndOrderedAtomicAccess, (), ())                 \
   Macro(InternalBeginPassThroughThreadEvents, (), ())           \
   Macro(InternalEndPassThroughThreadEvents, (), ())             \
   Macro(InternalBeginDisallowThreadEvents, (), ())              \
   Macro(InternalEndDisallowThreadEvents, (), ())                \
   Macro(InternalRecordReplayBytes,                              \
         (void* aData, size_t aSize), (aData, aSize))            \
   Macro(NotifyUnrecordedWait,                                   \
--- a/mfbt/RecordReplay.h
+++ b/mfbt/RecordReplay.h
@@ -98,25 +98,26 @@ static inline bool IsRecordingOrReplayin
 static inline bool IsRecording() { return false; }
 static inline bool IsReplaying() { return false; }
 static inline bool IsMiddleman() { return false; }
 
 #endif // XP_MACOSX && NIGHTLY_BUILD
 
 // Mark a region which occurs atomically wrt the recording. No two threads can
 // be in an atomic region at once, and the order in which atomic sections are
-// executed by the various threads will be the same in the replay as in the
-// recording. These calls have no effect when not recording/replaying.
-static inline void BeginOrderedAtomicAccess();
+// executed by the various threads for the same aValue will be the same in the
+// replay as in the recording. These calls have no effect when not recording or
+// replaying.
+static inline void BeginOrderedAtomicAccess(const void* aValue);
 static inline void EndOrderedAtomicAccess();
 
 // RAII class for an atomic access.
 struct MOZ_RAII AutoOrderedAtomicAccess
 {
-  AutoOrderedAtomicAccess() { BeginOrderedAtomicAccess(); }
+  explicit AutoOrderedAtomicAccess(const void* aValue) { BeginOrderedAtomicAccess(aValue); }
   ~AutoOrderedAtomicAccess() { EndOrderedAtomicAccess(); }
 };
 
 // Mark a region where thread events are passed through the record/replay
 // system. While recording, no information from system calls or other events
 // will be recorded for the thread. While replaying, system calls and other
 // events are performed normally.
 static inline void BeginPassThroughThreadEvents();
@@ -425,17 +426,17 @@ NoteContentParse16(const void* aToken,
 #define MOZ_MakeRecordReplayWrapperVoid(aName, aFormals, aActuals)      \
   static inline void aName aFormals {}
 
 #define MOZ_MakeRecordReplayWrapper(aName, aReturnType, aDefaultValue, aFormals, aActuals) \
   static inline aReturnType aName aFormals { return aDefaultValue; }
 
 #endif
 
-MOZ_MakeRecordReplayWrapperVoid(BeginOrderedAtomicAccess, (), ())
+MOZ_MakeRecordReplayWrapperVoid(BeginOrderedAtomicAccess, (const void* aValue), (aValue))
 MOZ_MakeRecordReplayWrapperVoid(EndOrderedAtomicAccess, (), ())
 MOZ_MakeRecordReplayWrapperVoid(BeginPassThroughThreadEvents, (), ())
 MOZ_MakeRecordReplayWrapperVoid(EndPassThroughThreadEvents, (), ())
 MOZ_MakeRecordReplayWrapper(AreThreadEventsPassedThrough, bool, false, (), ())
 MOZ_MakeRecordReplayWrapperVoid(BeginDisallowThreadEvents, (), ())
 MOZ_MakeRecordReplayWrapperVoid(EndDisallowThreadEvents, (), ())
 MOZ_MakeRecordReplayWrapper(AreThreadEventsDisallowed, bool, false, (), ())
 MOZ_MakeRecordReplayWrapper(RecordReplayValue, size_t, aValue, (size_t aValue), (aValue))