RESOLVED FIXED 186954
We need to have a getDirectConcurrently for use in the compilers
https://bugs.webkit.org/show_bug.cgi?id=186954
Summary We need to have a getDirectConcurrently for use in the compilers
Keith Miller
Reported 2018-06-22 17:47:23 PDT
ObjectPropertyCondition and Graph::tryGetConstantProperty should lock the structure before calling getDirect
Attachments
Patch (5.46 KB, patch)
2018-06-22 17:52 PDT, Keith Miller
no flags
Patch (8.41 KB, patch)
2018-06-22 18:37 PDT, Keith Miller
no flags
Patch (8.37 KB, patch)
2018-06-22 18:37 PDT, Keith Miller
mark.lam: review+
Keith Miller
Comment 1 2018-06-22 17:52:40 PDT
Saam Barati
Comment 2 2018-06-22 17:54:36 PDT
Comment on attachment 343405 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343405&action=review > Source/JavaScriptCore/bytecode/PropertyCondition.cpp:400 > + // If we are flattening the structure at this time we might shrink the butterfly and read garbage. > + ConcurrentJSLocker locker(structure->lock()); > + if (!structure->isValidOffset(offset())) > + return PropertyCondition(); > + value = base->getDirect(offset()); Don't we know if we're doing this concurrently or not? Maybe just lock in that scenario?
Keith Miller
Comment 3 2018-06-22 17:55:34 PDT
Comment on attachment 343405 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343405&action=review >> Source/JavaScriptCore/bytecode/PropertyCondition.cpp:400 >> + value = base->getDirect(offset()); > > Don't we know if we're doing this concurrently or not? Maybe just lock in that scenario? Fair point, I'll make that change.
Keith Miller
Comment 4 2018-06-22 18:08:14 PDT
Comment on attachment 343405 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343405&action=review >>> Source/JavaScriptCore/bytecode/PropertyCondition.cpp:400 >>> + value = base->getDirect(offset()); >> >> Don't we know if we're doing this concurrently or not? Maybe just lock in that scenario? > > Fair point, I'll make that change. Actually, we do a lot of things using the concurrent versions of methods inside PropertyCondition when we are on the mutator. We should fix all of them in a more consistent way. I'm just gonna file a bug.
Keith Miller
Comment 5 2018-06-22 18:37:00 PDT
Keith Miller
Comment 6 2018-06-22 18:37:48 PDT
Keith Miller
Comment 7 2018-06-22 18:38:32 PDT
Mark Lam
Comment 8 2018-06-22 23:15:47 PDT
Comment on attachment 343411 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343411&action=review r=me. If you haven't already done so, I think you should also remove the "if (!value)" check I added in PropertyCondition::isValidValueForAttributes() due to https://bugs.webkit.org/show_bug.cgi?id=186943. Your changes in attemptToMakeEquivalenceWithoutBarrier() makes that unnecessary. > Source/JavaScriptCore/dfg/DFGGraph.cpp:1268 > + // object pointer such that the inlinecaches told us that the object had a structure that it missing space between "inline" and "caches". > Source/JavaScriptCore/dfg/DFGGraph.cpp:1270 > + // caches had alraedy seen. And then the processor reordered the stores. Seems unlikely and /alraedy/already/.
Keith Miller
Comment 9 2018-06-23 03:46:12 PDT
Comment on attachment 343411 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=343411&action=review >> Source/JavaScriptCore/dfg/DFGGraph.cpp:1268 >> + // object pointer such that the inlinecaches told us that the object had a structure that it > > missing space between "inline" and "caches". Fixed >> Source/JavaScriptCore/dfg/DFGGraph.cpp:1270 >> + // caches had alraedy seen. And then the processor reordered the stores. Seems unlikely and > > /alraedy/already/. Fixed
Keith Miller
Comment 10 2018-06-23 03:47:11 PDT
(In reply to Mark Lam from comment #8) > r=me. If you haven't already done so, I think you should also remove the > "if (!value)" check I added in > PropertyCondition::isValidValueForAttributes() due to > https://bugs.webkit.org/show_bug.cgi?id=186943. Your changes in > attemptToMakeEquivalenceWithoutBarrier() makes that unnecessary. I think I'm just going to undo my change to attemptToMakeEquivalenceWithoutBarrier() instead. That check makes more sense in isValidValueForAttributes().
Keith Miller
Comment 11 2018-06-23 03:48:07 PDT
Note You need to log in before you can comment on or make changes to this bug.