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

Side by Side Diff: Source/platform/heap/ThreadState.h

Issue 646833003: Oilpan: Mark the NodeList hierarchy MainThreadOnly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // 77 //
78 // FIXME: We should evaluate the performance gain. Having 78 // FIXME: We should evaluate the performance gain. Having
79 // ThreadAffinity is complicating the implementation and we should get 79 // ThreadAffinity is complicating the implementation and we should get
80 // rid of it if it is fast enough to go through thread-local storage 80 // rid of it if it is fast enough to go through thread-local storage
81 // always. 81 // always.
82 enum ThreadAffinity { 82 enum ThreadAffinity {
83 AnyThread, 83 AnyThread,
84 MainThreadOnly, 84 MainThreadOnly,
85 }; 85 };
86 86
87 // FIXME: These forward declarations violate dependency rules. Remove them.
88 // Ideally we want to provide a USED_IN_MAIN_THREAD_ONLY(T) macro, which
89 // indicates that classes in T's hierarchy are used only by the main thread.
haraken 2014/10/15 01:12:56 I'm planning to address the FIXME by introducing G
tkent 2014/10/15 03:34:39 The GarbageCollectedOnMainThread approach sounds g
87 class Node; 90 class Node;
88 class CSSValue; 91 class NodeList;
89 92
90 template<typename T, bool derivesNode = WTF::IsSubclass<typename WTF::RemoveCons t<T>::Type, Node>::value> struct DefaultThreadingTrait; 93 template<typename T,
94 bool derivesNode = WTF::IsSubclass<typename WTF::RemoveConst<T>::Type, Node> ::value
tkent 2014/10/15 03:34:39 Now derivesNode is a wrong name. It will be remov
haraken 2014/10/15 03:38:59 Renamed it to mainThreadOnly.
95 || WTF::IsSubclass<typename WTF::RemoveConst<T>::Type, NodeList>::value> struct DefaultThreadingTrait;
91 96
92 template<typename T> 97 template<typename T>
93 struct DefaultThreadingTrait<T, false> { 98 struct DefaultThreadingTrait<T, false> {
94 static const ThreadAffinity Affinity = AnyThread; 99 static const ThreadAffinity Affinity = AnyThread;
95 }; 100 };
96 101
97 template<typename T> 102 template<typename T>
98 struct DefaultThreadingTrait<T, true> { 103 struct DefaultThreadingTrait<T, true> {
99 static const ThreadAffinity Affinity = MainThreadOnly; 104 static const ThreadAffinity Affinity = MainThreadOnly;
100 }; 105 };
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 // whether the page is part of a terminting thread or 920 // whether the page is part of a terminting thread or
916 // if the page is traced after being terminated (orphaned). 921 // if the page is traced after being terminated (orphaned).
917 uintptr_t m_terminating : 1; 922 uintptr_t m_terminating : 1;
918 uintptr_t m_tracedAfterOrphaned : 1; 923 uintptr_t m_tracedAfterOrphaned : 1;
919 uintptr_t m_promptlyFreedSize : 17; // == blinkPageSizeLog2 924 uintptr_t m_promptlyFreedSize : 17; // == blinkPageSizeLog2
920 }; 925 };
921 926
922 } 927 }
923 928
924 #endif // ThreadState_h 929 #endif // ThreadState_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698