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 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1194 header->finalize(payload, payloadSize); | 1194 header->finalize(payload, payloadSize); |
1195 // This memory will be added to the freelist. Maintain the invariant | 1195 // This memory will be added to the freelist. Maintain the invariant |
1196 // that memory on the freelist is zero filled. | 1196 // that memory on the freelist is zero filled. |
1197 SET_MEMORY_INACCESSIBLE(headerAddress, size); | 1197 SET_MEMORY_INACCESSIBLE(headerAddress, size); |
1198 headerAddress += size; | 1198 headerAddress += size; |
1199 continue; | 1199 continue; |
1200 } | 1200 } |
1201 if (startOfGap != headerAddress) { | 1201 if (startOfGap != headerAddress) { |
1202 pageArena->addToFreeList(startOfGap, headerAddress - startOfGap); | 1202 pageArena->addToFreeList(startOfGap, headerAddress - startOfGap); |
1203 #if !ENABLE(ASSERT) && !defined(LEAK_SANITIZER) && !defined(ADDRESS_SANITIZER) | 1203 #if !ENABLE(ASSERT) && !defined(LEAK_SANITIZER) && !defined(ADDRESS_SANITIZER) |
1204 // Discarding pages increases page faults and may regress performanc e. | 1204 discardPages(startOfGap + sizeof(FreeListEntry), headerAddress); |
sof
2016/07/07 09:35:19
Why drop the check for low-end devices?
tasak
2016/07/08 03:56:45
To reduce resident_set_bytes, pss, or private_dirt
sof
2016/07/08 07:14:29
That would be better; what's here now will serious
tasak
2016/07/19 08:22:51
I think, I need, Oilpan::discardUnusedPages or som
haraken
2016/07/19 20:20:22
This makes sense.
Currently discardPages() is cal
| |
1205 // So we enable this only on low-RAM devices. | |
1206 if (ProcessHeap::isLowEndDevice()) | |
1207 discardPages(startOfGap + sizeof(FreeListEntry), headerAddress); | |
1208 #endif | 1205 #endif |
1209 } | 1206 } |
1210 header->unmark(); | 1207 header->unmark(); |
1211 headerAddress += size; | 1208 headerAddress += size; |
1212 markedObjectSize += size; | 1209 markedObjectSize += size; |
1213 startOfGap = headerAddress; | 1210 startOfGap = headerAddress; |
1214 } | 1211 } |
1215 if (startOfGap != payloadEnd()) { | 1212 if (startOfGap != payloadEnd()) { |
1216 pageArena->addToFreeList(startOfGap, payloadEnd() - startOfGap); | 1213 pageArena->addToFreeList(startOfGap, payloadEnd() - startOfGap); |
1217 #if !ENABLE(ASSERT) && !defined(LEAK_SANITIZER) && !defined(ADDRESS_SANITIZER) | 1214 #if !ENABLE(ASSERT) && !defined(LEAK_SANITIZER) && !defined(ADDRESS_SANITIZER) |
1218 if (ProcessHeap::isLowEndDevice()) | 1215 discardPages(startOfGap + sizeof(FreeListEntry), payloadEnd()); |
1219 discardPages(startOfGap + sizeof(FreeListEntry), payloadEnd()); | |
1220 #endif | 1216 #endif |
1221 } | 1217 } |
1222 | 1218 |
1223 if (markedObjectSize) | 1219 if (markedObjectSize) |
1224 pageArena->getThreadState()->increaseMarkedObjectSize(markedObjectSize); | 1220 pageArena->getThreadState()->increaseMarkedObjectSize(markedObjectSize); |
1225 } | 1221 } |
1226 | 1222 |
1227 void NormalPage::makeConsistentForGC() | 1223 void NormalPage::makeConsistentForGC() |
1228 { | 1224 { |
1229 size_t markedObjectSize = 0; | 1225 size_t markedObjectSize = 0; |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1616 | 1612 |
1617 m_hasEntries = true; | 1613 m_hasEntries = true; |
1618 size_t index = hash(address); | 1614 size_t index = hash(address); |
1619 ASSERT(!(index & 1)); | 1615 ASSERT(!(index & 1)); |
1620 Address cachePage = roundToBlinkPageStart(address); | 1616 Address cachePage = roundToBlinkPageStart(address); |
1621 m_entries[index + 1] = m_entries[index]; | 1617 m_entries[index + 1] = m_entries[index]; |
1622 m_entries[index] = cachePage; | 1618 m_entries[index] = cachePage; |
1623 } | 1619 } |
1624 | 1620 |
1625 } // namespace blink | 1621 } // namespace blink |
OLD | NEW |