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

Side by Side Diff: sky/engine/wtf/VectorTraits.h

Issue 729733002: Remove more bits of the Oilpan tracing system (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/wtf/Vector.h ('k') | 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 23 matching lines...) Expand all
34 34
35 template<typename T> 35 template<typename T>
36 struct VectorTraitsBase 36 struct VectorTraitsBase
37 { 37 {
38 static const bool needsDestruction = !IsPod<T>::value; 38 static const bool needsDestruction = !IsPod<T>::value;
39 static const bool canInitializeWithMemset = IsPod<T>::value; 39 static const bool canInitializeWithMemset = IsPod<T>::value;
40 static const bool canMoveWithMemcpy = IsPod<T>::value; 40 static const bool canMoveWithMemcpy = IsPod<T>::value;
41 static const bool canCopyWithMemcpy = IsPod<T>::value; 41 static const bool canCopyWithMemcpy = IsPod<T>::value;
42 static const bool canFillWithMemset = IsPod<T>::value && (sizeof(T) == s izeof(char)); 42 static const bool canFillWithMemset = IsPod<T>::value && (sizeof(T) == s izeof(char));
43 static const bool canCompareWithMemcmp = IsPod<T>::value; 43 static const bool canCompareWithMemcmp = IsPod<T>::value;
44 template<typename U = void>
45 struct NeedsTracingLazily {
46 static const bool value = NeedsTracing<T>::value;
47 };
48 static const WeakHandlingFlag weakHandlingFlag = NoWeakHandlingInCollect ions; // We don't support weak handling in vectors. 44 static const WeakHandlingFlag weakHandlingFlag = NoWeakHandlingInCollect ions; // We don't support weak handling in vectors.
49 }; 45 };
50 46
51 template<typename T> 47 template<typename T>
52 struct VectorTraits : VectorTraitsBase<T> { }; 48 struct VectorTraits : VectorTraitsBase<T> { };
53 49
54 // Classes marked with SimpleVectorTraits will use memmov, memcpy, memcmp 50 // Classes marked with SimpleVectorTraits will use memmov, memcpy, memcmp
55 // instead of constructors, copy operators, etc for initialization, move 51 // instead of constructors, copy operators, etc for initialization, move
56 // and comparison. 52 // and comparison.
57 template<typename T> 53 template<typename T>
(...skipping 18 matching lines...) Expand all
76 { 72 {
77 typedef VectorTraits<First> FirstTraits; 73 typedef VectorTraits<First> FirstTraits;
78 typedef VectorTraits<Second> SecondTraits; 74 typedef VectorTraits<Second> SecondTraits;
79 75
80 static const bool needsDestruction = FirstTraits::needsDestruction || Se condTraits::needsDestruction; 76 static const bool needsDestruction = FirstTraits::needsDestruction || Se condTraits::needsDestruction;
81 static const bool canInitializeWithMemset = FirstTraits::canInitializeWi thMemset && SecondTraits::canInitializeWithMemset; 77 static const bool canInitializeWithMemset = FirstTraits::canInitializeWi thMemset && SecondTraits::canInitializeWithMemset;
82 static const bool canMoveWithMemcpy = FirstTraits::canMoveWithMemcpy && SecondTraits::canMoveWithMemcpy; 78 static const bool canMoveWithMemcpy = FirstTraits::canMoveWithMemcpy && SecondTraits::canMoveWithMemcpy;
83 static const bool canCopyWithMemcpy = FirstTraits::canCopyWithMemcpy && SecondTraits::canCopyWithMemcpy; 79 static const bool canCopyWithMemcpy = FirstTraits::canCopyWithMemcpy && SecondTraits::canCopyWithMemcpy;
84 static const bool canFillWithMemset = false; 80 static const bool canFillWithMemset = false;
85 static const bool canCompareWithMemcmp = FirstTraits::canCompareWithMemc mp && SecondTraits::canCompareWithMemcmp; 81 static const bool canCompareWithMemcmp = FirstTraits::canCompareWithMemc mp && SecondTraits::canCompareWithMemcmp;
86 template <typename U = void>
87 struct NeedsTracingLazily {
88 static const bool value = ShouldBeTraced<FirstTraits>::value || Shou ldBeTraced<SecondTraits>::value;
89 };
90 static const WeakHandlingFlag weakHandlingFlag = NoWeakHandlingInCollect ions; // We don't support weak handling in vectors. 82 static const WeakHandlingFlag weakHandlingFlag = NoWeakHandlingInCollect ions; // We don't support weak handling in vectors.
91 }; 83 };
92 84
93 } // namespace WTF 85 } // namespace WTF
94 86
95 #define WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(ClassName) \ 87 #define WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(ClassName) \
96 namespace WTF { \ 88 namespace WTF { \
97 template<> \ 89 template<> \
98 struct VectorTraits<ClassName> : SimpleClassVectorTraits<ClassName> { }; \ 90 struct VectorTraits<ClassName> : SimpleClassVectorTraits<ClassName> { }; \
99 } 91 }
(...skipping 14 matching lines...) Expand all
114 struct VectorTraits<ClassName> : VectorTraitsBase<ClassName> \ 106 struct VectorTraits<ClassName> : VectorTraitsBase<ClassName> \
115 { \ 107 { \
116 static const bool canInitializeWithMemset = true; \ 108 static const bool canInitializeWithMemset = true; \
117 }; \ 109 }; \
118 } 110 }
119 111
120 using WTF::VectorTraits; 112 using WTF::VectorTraits;
121 using WTF::SimpleClassVectorTraits; 113 using WTF::SimpleClassVectorTraits;
122 114
123 #endif // WTF_VectorTraits_h 115 #endif // WTF_VectorTraits_h
OLDNEW
« no previous file with comments | « sky/engine/wtf/Vector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698