WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 62164
Remove "multi-threaded" logic in V8 DOMData, DOMDataStore and friends
https://bugs.webkit.org/show_bug.cgi?id=62164
Summary
Remove "multi-threaded" logic in V8 DOMData, DOMDataStore and friends
Dmitry Lomov
Reported
2011-06-06 16:05:09 PDT
This functionality is untested and unused.
Attachments
Removing multithreaded logic
(8.00 KB, patch)
2011-06-06 16:18 PDT
,
Dmitry Lomov
dimich
: review-
Details
Formatted Diff
Diff
CR feedback - more context in ChangeLog
(8.39 KB, patch)
2011-06-06 17:27 PDT
,
Dmitry Lomov
dimich
: review-
Details
Formatted Diff
Diff
More cleanup + renames
(25.93 KB, patch)
2011-06-06 20:31 PDT
,
Dmitry Lomov
dslomov
: review-
dslomov
: commit-queue-
Details
Formatted Diff
Diff
Updated threading comment in DOMDataStore.cpp
(27.57 KB, patch)
2011-06-06 20:40 PDT
,
Dmitry Lomov
no flags
Details
Formatted Diff
Diff
Fixing the chromium tests and chromium debug build issues
(26.57 KB, patch)
2011-06-07 17:39 PDT
,
Dmitry Lomov
no flags
Details
Formatted Diff
Diff
Rebased patch
(26.52 KB, patch)
2011-06-07 19:51 PDT
,
Dmitry Lomov
no flags
Details
Formatted Diff
Diff
Removes one more WTF::isMainThread assertion
(26.48 KB, patch)
2011-06-07 20:30 PDT
,
Dmitry Lomov
no flags
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Dmitry Lomov
Comment 1
2011-06-06 16:18:46 PDT
Created
attachment 96147
[details]
Removing multithreaded logic
David Levin
Comment 2
2011-06-06 16:30:22 PDT
Adam, I'm hoping you'll review this!
Dmitry Titov
Comment 3
2011-06-06 17:03:23 PDT
I can totally review this, I know this code.
Dmitry Titov
Comment 4
2011-06-06 17:21:13 PDT
Comment on
attachment 96147
[details]
Removing multithreaded logic Great patch, since you want to use commit-queue, lets make it perfect: could you please add a sentence to ChangeLog explaining that this is an old code from Lockers-based implementation of WebWorkers in V8 bindings, to make sure that DOM objects are released on the right thread even though GC could have happened on any thread. It is currently unused (since current model is one worker per process) and is being removed because new implementation will be using V8 isolates and does not need the DOMStores per thread. Just to give it more context...
Dmitry Lomov
Comment 5
2011-06-06 17:27:04 PDT
Created
attachment 96159
[details]
CR feedback - more context in ChangeLog
Adam Barth
Comment 6
2011-06-06 17:35:24 PDT
Comment on
attachment 96159
[details]
CR feedback - more context in ChangeLog View in context:
https://bugs.webkit.org/attachment.cgi?id=96159&action=review
Remove this lock probably removes the need for the visitor pattern, but maybe it's worth keeping anyway.
> Source/WebCore/bindings/v8/DOMData.cpp:-55 > - DEFINE_STATIC_LOCAL(WTF::ThreadSpecific<ChildThreadDOMData>, childThreadDOMData, ());
Can we just remove ChildThreadDOMData at this point?
Adam Barth
Comment 7
2011-06-06 17:35:44 PDT
I'll let dimich review the updated patch.
Dmitry Lomov
Comment 8
2011-06-06 17:40:37 PDT
Comment on
attachment 96159
[details]
CR feedback - more context in ChangeLog View in context:
https://bugs.webkit.org/attachment.cgi?id=96159&action=review
>> Source/WebCore/bindings/v8/DOMData.cpp:-55 >> - DEFINE_STATIC_LOCAL(WTF::ThreadSpecific<ChildThreadDOMData>, childThreadDOMData, ()); > > Can we just remove ChildThreadDOMData at this point?
Good point.
Dmitry Titov
Comment 9
2011-06-06 17:53:31 PDT
Comment on
attachment 96159
[details]
CR feedback - more context in ChangeLog Adam has inspired me to do a better review :-) Lets indeed remove all pieces that are not needed anymore: - Comment in DOMDataStore.cpp, that explains threading considerations should be updated. - in V8DOMMap.*, lets rename methods like 'visitActiveDOMObjectsInCurrentThread' to 'visitActiveDOMObjects', since they are not looking at thread anymore. - As Adam noted, ChildThreadDOMData can go away - but at the same time MainThreadDOMData can go away as well, so there is only single DOMData class.
Dmitry Lomov
Comment 10
2011-06-06 20:31:31 PDT
Created
attachment 96188
[details]
More cleanup + renames
WebKit Review Bot
Comment 11
2011-06-06 20:33:40 PDT
Attachment 96188
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/bindings/v8/DOMData.cpp:63: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Dmitry Lomov
Comment 12
2011-06-06 20:40:07 PDT
Created
attachment 96189
[details]
Updated threading comment in DOMDataStore.cpp This patch generates bogus style error (comparison with 0 inside UNLIKELY)
WebKit Review Bot
Comment 13
2011-06-06 20:41:31 PDT
Attachment 96189
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/bindings/v8/DOMData.cpp:63: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
David Levin
Comment 14
2011-06-06 22:05:39 PDT
(In reply to
comment #12
)
> Created an attachment (id=96189) [details] > Updated threading comment in DOMDataStore.cpp > > This patch generates bogus style error (comparison with 0 inside UNLIKELY)
1. You could use !!a instead of a != 0. 2. More importantly, UNLIKELY only appears to be defined for GCC. I think you can get the same result by reversing the if. if (!context) return m_defaultStore; return *context->world()->domDataStore(); (You could still add LIKELY here if it was useful.)
Adam Barth
Comment 15
2011-06-06 22:21:46 PDT
Comment on
attachment 96189
[details]
Updated threading comment in DOMDataStore.cpp View in context:
https://bugs.webkit.org/attachment.cgi?id=96189&action=review
This looks great. There's probably another round of cleanup we can do here, but we can do that in a subsequent patch.
> Source/WebCore/bindings/v8/DOMData.cpp:74 > + > +
This diff seem unneeded.
> Source/WebCore/bindings/v8/DOMData.h:54 > - virtual DOMDataStore& getStore() = 0; > + DOMDataStore& getStore() { return getMainThreadStore(); }
Now that this function isn't virtual, it seems like we don't need to separate these calls, right?
> Source/WebCore/bindings/v8/DOMData.h:62 > - ThreadIdentifier owningThread() const { return m_owningThread; } > + static DOMDataStore& getCurrentMainThreadStore() { return getCurrent()->getMainThreadStore(); }
Do we still need the concept of "MainThreadStore" or can we remove all mentions of that too now?
WebKit Commit Bot
Comment 16
2011-06-06 23:19:22 PDT
Comment on
attachment 96189
[details]
Updated threading comment in DOMDataStore.cpp Clearing flags on attachment: 96189 Committed
r88221
: <
http://trac.webkit.org/changeset/88221
>
WebKit Commit Bot
Comment 17
2011-06-06 23:19:28 PDT
All reviewed patches have been landed. Closing bug.
Andras Becsi
Comment 18
2011-06-07 01:28:33 PDT
Build fix landed in
http://trac.webkit.org/changeset/88224
.
anton muhin
Comment 19
2011-06-07 06:44:21 PDT
Comment on
attachment 96189
[details]
Updated threading comment in DOMDataStore.cpp Nice!
Dmitry Lomov
Comment 20
2011-06-07 08:02:43 PDT
(In reply to
comment #15
)
> (From update of
attachment 96189
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=96189&action=review
> > This looks great. There's probably another round of cleanup we can do here, but we can do that in a subsequent patch. > > > Source/WebCore/bindings/v8/DOMData.cpp:74 > > + > > + > > This diff seem unneeded. > > > Source/WebCore/bindings/v8/DOMData.h:54 > > - virtual DOMDataStore& getStore() = 0; > > + DOMDataStore& getStore() { return getMainThreadStore(); } > > Now that this function isn't virtual, it seems like we don't need to separate these calls, right? > > > Source/WebCore/bindings/v8/DOMData.h:62 > > - ThreadIdentifier owningThread() const { return m_owningThread; } > > + static DOMDataStore& getCurrentMainThreadStore() { return getCurrent()->getMainThreadStore(); } > > Do we still need the concept of "MainThreadStore" or can we remove all mentions of that too now?
All this is going to change soon when we will have one isolate per V8IsolatedWorld.
Dmitry Lomov
Comment 21
2011-06-07 08:03:42 PDT
(In reply to
comment #14
)
> (In reply to
comment #12
) > > Created an attachment (id=96189) [details] [details] > > Updated threading comment in DOMDataStore.cpp > > > > This patch generates bogus style error (comparison with 0 inside UNLIKELY) > > 1. You could use !!a instead of a != 0. > 2. More importantly, UNLIKELY only appears to be defined for GCC. > > I think you can get the same result by reversing the if. > > if (!context) > return m_defaultStore; > return *context->world()->domDataStore(); > > (You could still add LIKELY here if it was useful.)
I think we should change the style tool to be aware of LIKELY and UNLIKELY.
Andras Becsi
Comment 22
2011-06-07 08:07:26 PDT
(In reply to
comment #18
)
> Build fix landed in
http://trac.webkit.org/changeset/88224
.
Another build fix for the debug build landed in:
http://trac.webkit.org/changeset/88231
Eric Seidel (no email)
Comment 23
2011-06-07 08:42:05 PDT
(In reply to
comment #21
)
> > (You could still add LIKELY here if it was useful.) > > I think we should change the style tool to be aware of LIKELY and UNLIKELY.
Please file a bug and CC dave levin. Hacking cpp_style.py is quite easy.
Dmitry Lomov
Comment 24
2011-06-07 15:39:26 PDT
Patch has broken chromium debug tests
Dmitry Lomov
Comment 25
2011-06-07 17:39:43 PDT
Created
attachment 96342
[details]
Fixing the chromium tests and chromium debug build issues This patch removes all ASSERT(WTF::isMainThread()), since chromium worker processes do not execute worker scripts on the WTF main thread. I am not asking for commit queue because I want to push this patch through Chromium trybots as well, but will appreciate the review
Dmitry Lomov
Comment 26
2011-06-07 19:51:17 PDT
Created
attachment 96363
[details]
Rebased patch
Dmitry Lomov
Comment 27
2011-06-07 19:51:48 PDT
Comment on
attachment 96363
[details]
Rebased patch This patch passes chromium trybots
Dmitry Lomov
Comment 28
2011-06-07 20:30:55 PDT
Created
attachment 96367
[details]
Removes one more WTF::isMainThread assertion
WebKit Review Bot
Comment 29
2011-06-08 10:31:15 PDT
Comment on
attachment 96367
[details]
Removes one more WTF::isMainThread assertion Clearing flags on attachment: 96367 Committed
r88357
: <
http://trac.webkit.org/changeset/88357
>
WebKit Review Bot
Comment 30
2011-06-08 10:31:22 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug