OLD | NEW |
---|---|
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 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1174 if (size < 128) | 1174 if (size < 128) |
1175 return NormalPage3HeapIndex; | 1175 return NormalPage3HeapIndex; |
1176 return NormalPage4HeapIndex; | 1176 return NormalPage4HeapIndex; |
1177 } | 1177 } |
1178 | 1178 |
1179 inline bool Heap::isNormalHeapIndex(int index) | 1179 inline bool Heap::isNormalHeapIndex(int index) |
1180 { | 1180 { |
1181 return index >= NormalPage1HeapIndex && index <= NormalPage4HeapIndex; | 1181 return index >= NormalPage1HeapIndex && index <= NormalPage4HeapIndex; |
1182 } | 1182 } |
1183 | 1183 |
1184 #if ENABLE(LAZY_SWEEPING) | |
1185 #define DECLARE_EAGER_FINALIZATION_OPERATOR_NEW() \ | 1184 #define DECLARE_EAGER_FINALIZATION_OPERATOR_NEW() \ |
1186 public: \ | 1185 public: \ |
1187 GC_PLUGIN_IGNORE("491488") \ | 1186 GC_PLUGIN_IGNORE("491488") \ |
1188 void* operator new(size_t size) \ | 1187 void* operator new(size_t size) \ |
1189 { \ | 1188 { \ |
1190 return allocateObject(size, true); \ | 1189 return allocateObject(size, true); \ |
1191 } | 1190 } |
1192 #define EAGERLY_FINALIZE_WILL_BE_REMOVED() | 1191 #define EAGERLY_FINALIZE_WILL_BE_REMOVED() |
1193 #if ENABLE(ASSERT) && ENABLE(OILPAN) | 1192 #if ENABLE(ASSERT) && ENABLE(OILPAN) |
1194 class VerifyEagerFinalization { | 1193 class VerifyEagerFinalization { |
(...skipping 12 matching lines...) Expand all Loading... | |
1207 } | 1206 } |
1208 }; | 1207 }; |
1209 #define EAGERLY_FINALIZE() \ | 1208 #define EAGERLY_FINALIZE() \ |
1210 private: \ | 1209 private: \ |
1211 VerifyEagerFinalization m_verifyEagerFinalization; \ | 1210 VerifyEagerFinalization m_verifyEagerFinalization; \ |
1212 public: \ | 1211 public: \ |
1213 typedef int IsEagerlyFinalizedMarker | 1212 typedef int IsEagerlyFinalizedMarker |
1214 #else | 1213 #else |
1215 #define EAGERLY_FINALIZE() typedef int IsEagerlyFinalizedMarker | 1214 #define EAGERLY_FINALIZE() typedef int IsEagerlyFinalizedMarker |
1216 #endif | 1215 #endif |
1217 #else | |
1218 #define DECLARE_EAGER_FINALIZATION_OPERATOR_NEW() | |
1219 #define EAGERLY_FINALIZE() | |
1220 // TODO(Oilpan): define in terms of Oilpan's EAGERLY_FINALIZE() once lazy | |
1221 // sweeping is enabled non-Oilpan. | |
1222 #define EAGERLY_FINALIZE_WILL_BE_REMOVED() | |
sof
2015/06/09 13:58:51
This strikes me as wrong; we need to eagerly final
sof
2015/06/09 14:48:10
I think the analysis from
https://groups.google
| |
1223 #endif | |
1224 | 1216 |
1225 NO_SANITIZE_ADDRESS inline | 1217 NO_SANITIZE_ADDRESS inline |
1226 size_t HeapObjectHeader::size() const | 1218 size_t HeapObjectHeader::size() const |
1227 { | 1219 { |
1228 size_t result = m_encoded & headerSizeMask; | 1220 size_t result = m_encoded & headerSizeMask; |
1229 // Large objects should not refer to header->size(). | 1221 // Large objects should not refer to header->size(). |
1230 // The actual size of a large object is stored in | 1222 // The actual size of a large object is stored in |
1231 // LargeObjectPage::m_payloadSize. | 1223 // LargeObjectPage::m_payloadSize. |
1232 ASSERT(result != largeObjectSizeInHeader); | 1224 ASSERT(result != largeObjectSizeInHeader); |
1233 ASSERT(!pageFromObject(this)->isLargeObjectPage()); | 1225 ASSERT(!pageFromObject(this)->isLargeObjectPage()); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1390 size_t copySize = previousHeader->payloadSize(); | 1382 size_t copySize = previousHeader->payloadSize(); |
1391 if (copySize > size) | 1383 if (copySize > size) |
1392 copySize = size; | 1384 copySize = size; |
1393 memcpy(address, previous, copySize); | 1385 memcpy(address, previous, copySize); |
1394 return address; | 1386 return address; |
1395 } | 1387 } |
1396 | 1388 |
1397 } // namespace blink | 1389 } // namespace blink |
1398 | 1390 |
1399 #endif // Heap_h | 1391 #endif // Heap_h |
OLD | NEW |