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

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

Issue 1180383002: Introduce (Heap)Vector trait covering zero'ed memory for unused slots. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sof-hittestcache
Patch Set: rebased Created 5 years, 6 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
« no previous file with comments | « Source/core/layout/HitTestResult.h ('k') | Source/platform/heap/HeapAllocator.h » ('j') | 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 1074 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 Member<T> m_object; 1085 Member<T> m_object;
1086 }; 1086 };
1087 1087
1088 } // namespace blink 1088 } // namespace blink
1089 1089
1090 namespace WTF { 1090 namespace WTF {
1091 1091
1092 template <typename T> struct VectorTraits<blink::Member<T>> : VectorTraitsBase<b link::Member<T>> { 1092 template <typename T> struct VectorTraits<blink::Member<T>> : VectorTraitsBase<b link::Member<T>> {
1093 static const bool needsDestruction = false; 1093 static const bool needsDestruction = false;
1094 static const bool canInitializeWithMemset = true; 1094 static const bool canInitializeWithMemset = true;
1095 static const bool canClearUnusedSlotsWithMemset = true;
1095 static const bool canMoveWithMemcpy = true; 1096 static const bool canMoveWithMemcpy = true;
1096 }; 1097 };
1097 1098
1098 template <typename T> struct VectorTraits<blink::WeakMember<T>> : VectorTraitsBa se<blink::WeakMember<T>> { 1099 template <typename T> struct VectorTraits<blink::WeakMember<T>> : VectorTraitsBa se<blink::WeakMember<T>> {
1099 static const bool needsDestruction = false; 1100 static const bool needsDestruction = false;
1100 static const bool canInitializeWithMemset = true; 1101 static const bool canInitializeWithMemset = true;
1102 static const bool canClearUnusedSlotsWithMemset = true;
1101 static const bool canMoveWithMemcpy = true; 1103 static const bool canMoveWithMemcpy = true;
1102 }; 1104 };
1103 1105
1104 template <typename T> struct VectorTraits<blink::HeapVector<T, 0>> : VectorTrait sBase<blink::HeapVector<T, 0>> { 1106 template <typename T> struct VectorTraits<blink::HeapVector<T, 0>> : VectorTrait sBase<blink::HeapVector<T, 0>> {
1105 static const bool needsDestruction = false; 1107 static const bool needsDestruction = false;
1106 static const bool canInitializeWithMemset = true; 1108 static const bool canInitializeWithMemset = true;
1109 static const bool canClearUnusedSlotsWithMemset = true;
1107 static const bool canMoveWithMemcpy = true; 1110 static const bool canMoveWithMemcpy = true;
1108 }; 1111 };
1109 1112
1110 template <typename T> struct VectorTraits<blink::HeapDeque<T, 0>> : VectorTraits Base<blink::HeapDeque<T, 0>> { 1113 template <typename T> struct VectorTraits<blink::HeapDeque<T, 0>> : VectorTraits Base<blink::HeapDeque<T, 0>> {
1111 static const bool needsDestruction = false; 1114 static const bool needsDestruction = false;
1112 static const bool canInitializeWithMemset = true; 1115 static const bool canInitializeWithMemset = true;
1116 static const bool canClearUnusedSlotsWithMemset = true;
1113 static const bool canMoveWithMemcpy = true; 1117 static const bool canMoveWithMemcpy = true;
1114 }; 1118 };
1115 1119
1116 template <typename T, size_t inlineCapacity> struct VectorTraits<blink::HeapVect or<T, inlineCapacity>> : VectorTraitsBase<blink::HeapVector<T, inlineCapacity>> { 1120 template <typename T, size_t inlineCapacity> struct VectorTraits<blink::HeapVect or<T, inlineCapacity>> : VectorTraitsBase<blink::HeapVector<T, inlineCapacity>> {
1117 static const bool needsDestruction = VectorTraits<T>::needsDestruction; 1121 static const bool needsDestruction = VectorTraits<T>::needsDestruction;
1118 static const bool canInitializeWithMemset = VectorTraits<T>::canInitializeWi thMemset; 1122 static const bool canInitializeWithMemset = VectorTraits<T>::canInitializeWi thMemset;
1123 static const bool canClearUnusedSlotsWithMemset = VectorTraits<T>::canClearU nusedSlotsWithMemset;
1119 static const bool canMoveWithMemcpy = VectorTraits<T>::canMoveWithMemcpy; 1124 static const bool canMoveWithMemcpy = VectorTraits<T>::canMoveWithMemcpy;
1120 }; 1125 };
1121 1126
1122 template <typename T, size_t inlineCapacity> struct VectorTraits<blink::HeapDequ e<T, inlineCapacity>> : VectorTraitsBase<blink::HeapDeque<T, inlineCapacity>> { 1127 template <typename T, size_t inlineCapacity> struct VectorTraits<blink::HeapDequ e<T, inlineCapacity>> : VectorTraitsBase<blink::HeapDeque<T, inlineCapacity>> {
1123 static const bool needsDestruction = VectorTraits<T>::needsDestruction; 1128 static const bool needsDestruction = VectorTraits<T>::needsDestruction;
1124 static const bool canInitializeWithMemset = VectorTraits<T>::canInitializeWi thMemset; 1129 static const bool canInitializeWithMemset = VectorTraits<T>::canInitializeWi thMemset;
1130 static const bool canClearUnusedSlotsWithMemset = VectorTraits<T>::canClearU nusedSlotsWithMemset;
1125 static const bool canMoveWithMemcpy = VectorTraits<T>::canMoveWithMemcpy; 1131 static const bool canMoveWithMemcpy = VectorTraits<T>::canMoveWithMemcpy;
1126 }; 1132 };
1127 1133
1128 template<typename T> struct HashTraits<blink::Member<T>> : SimpleClassHashTraits <blink::Member<T>> { 1134 template<typename T> struct HashTraits<blink::Member<T>> : SimpleClassHashTraits <blink::Member<T>> {
1129 // FIXME: The distinction between PeekInType and PassInType is there for 1135 // FIXME: The distinction between PeekInType and PassInType is there for
1130 // the sake of the reference counting handles. When they are gone the two 1136 // the sake of the reference counting handles. When they are gone the two
1131 // types can be merged into PassInType. 1137 // types can be merged into PassInType.
1132 // FIXME: Implement proper const'ness for iterator types. Requires support 1138 // FIXME: Implement proper const'ness for iterator types. Requires support
1133 // in the marking Visitor. 1139 // in the marking Visitor.
1134 using PeekInType = RawPtr<T>; 1140 using PeekInType = RawPtr<T>;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin k::IsGarbageCollectedType<T>::value> { 1287 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin k::IsGarbageCollectedType<T>::value> {
1282 static_assert(sizeof(T), "T must be fully defined"); 1288 static_assert(sizeof(T), "T must be fully defined");
1283 }; 1289 };
1284 1290
1285 template<typename T> 1291 template<typename T>
1286 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; 1292 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete;
1287 1293
1288 } // namespace WTF 1294 } // namespace WTF
1289 1295
1290 #endif 1296 #endif
OLDNEW
« no previous file with comments | « Source/core/layout/HitTestResult.h ('k') | Source/platform/heap/HeapAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698