Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Issue 661603005: Oilpan: Introduce class MainThreadOnly (Closed)

Created:
6 years, 2 months ago by haraken
Modified:
5 years, 8 months ago
CC:
blink-reviews, kouhei+heap_chromium.org, Mads Ager (chromium), mkwst+moarreviews_chromium.org
Project:
blink
Visibility:
Public.

Description

Oilpan: Introduce class MainThreadOnly In order to avoid listing up DOM classes used only by the main thread in ThreadState.h, this CL introduces class MainThreadOnly. If a class X is used only by the main thread, you can make X inherit from MainThreadOnly. MainThreadOnly is just a hint for performance optimization. There is no problem in not specifying MainThreadOnly. Currently only Node and NodeList inhert from MainThreadOnly. This CL removes USED_FROM_MULTIPLE_THREADS macros. BUG=420515

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -50 lines) Patch
M Source/platform/heap/Handle.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/heap/Heap.h View 3 chunks +8 lines, -8 lines 0 comments Download
M Source/platform/heap/Heap.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/platform/heap/HeapTest.cpp View 1 2 2 chunks +1 line, -3 lines 0 comments Download
M Source/platform/heap/ThreadState.h View 4 chunks +8 lines, -36 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
haraken
PTAL
6 years, 2 months ago (2014-10-16 11:29:01 UTC) #2
Vyacheslav Egorov (Google)
DBC (historical) This potentially has issue with circular dependencies. If WTF::IsSubclass<T, MainThreadOnly> is instantiated *before* ...
6 years, 2 months ago (2014-10-16 11:40:24 UTC) #4
haraken
6 years, 2 months ago (2014-10-16 11:55:00 UTC) #5
On 2014/10/16 11:40:24, Vyacheslav Egorov (Google) wrote:
> DBC (historical)
> 
> This potentially has issue with circular dependencies.
> 
>  If WTF::IsSubclass<T, MainThreadOnly> is instantiated *before* class
definition
> for T is seen then WTF::IsSubclass<T, MainThreadOnly>::value will just be
> `false` silently without any indication/failure. 
> 
> Furthermore if after this compiler sees class definition for T saying that T
is
> subclass of MainThreadOnly it will still evaluate WTF::IsSubclass<T,
> MainThreadOnly>::value to false, because that instantiation already happened. 
> 
> This will not lead to crashes but this might potentially lead to
inconsistencies
> in performance. 
> 
> This is the reason why we did not use inheritance for this Trait - it simply
> does not work as reliably.

Thanks for the background! That sounds like a valid reason for not doing this...

Powered by Google App Engine
This is Rietveld 408576698