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

Side by Side Diff: third_party/WebKit/Source/platform/heap/HeapPage.cpp

Issue 1842803003: Introduce ProcessHeap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 // that memory on the freelist is zero filled. 1133 // that memory on the freelist is zero filled.
1134 SET_MEMORY_INACCESSIBLE(headerAddress, size); 1134 SET_MEMORY_INACCESSIBLE(headerAddress, size);
1135 headerAddress += size; 1135 headerAddress += size;
1136 continue; 1136 continue;
1137 } 1137 }
1138 if (startOfGap != headerAddress) { 1138 if (startOfGap != headerAddress) {
1139 pageArena->addToFreeList(startOfGap, headerAddress - startOfGap); 1139 pageArena->addToFreeList(startOfGap, headerAddress - startOfGap);
1140 #if !ENABLE(ASSERT) && !defined(LEAK_SANITIZER) && !defined(ADDRESS_SANITIZER) 1140 #if !ENABLE(ASSERT) && !defined(LEAK_SANITIZER) && !defined(ADDRESS_SANITIZER)
1141 // Discarding pages increases page faults and may regress performanc e. 1141 // Discarding pages increases page faults and may regress performanc e.
1142 // So we enable this only on low-RAM devices. 1142 // So we enable this only on low-RAM devices.
1143 if (Heap::isLowEndDevice()) 1143 if (ProcessHeap::isLowEndDevice())
1144 discardPages(startOfGap + sizeof(FreeListEntry), headerAddress); 1144 discardPages(startOfGap + sizeof(FreeListEntry), headerAddress);
1145 #endif 1145 #endif
1146 } 1146 }
1147 header->unmark(); 1147 header->unmark();
1148 headerAddress += size; 1148 headerAddress += size;
1149 markedObjectSize += size; 1149 markedObjectSize += size;
1150 startOfGap = headerAddress; 1150 startOfGap = headerAddress;
1151 } 1151 }
1152 if (startOfGap != payloadEnd()) { 1152 if (startOfGap != payloadEnd()) {
1153 pageArena->addToFreeList(startOfGap, payloadEnd() - startOfGap); 1153 pageArena->addToFreeList(startOfGap, payloadEnd() - startOfGap);
1154 #if !ENABLE(ASSERT) && !defined(LEAK_SANITIZER) && !defined(ADDRESS_SANITIZER) 1154 #if !ENABLE(ASSERT) && !defined(LEAK_SANITIZER) && !defined(ADDRESS_SANITIZER)
1155 if (Heap::isLowEndDevice()) 1155 if (ProcessHeap::isLowEndDevice())
1156 discardPages(startOfGap + sizeof(FreeListEntry), payloadEnd()); 1156 discardPages(startOfGap + sizeof(FreeListEntry), payloadEnd());
1157 #endif 1157 #endif
1158 } 1158 }
1159 1159
1160 if (markedObjectSize) 1160 if (markedObjectSize)
1161 pageArena->getThreadState()->increaseMarkedObjectSize(markedObjectSize); 1161 pageArena->getThreadState()->increaseMarkedObjectSize(markedObjectSize);
1162 } 1162 }
1163 1163
1164 void NormalPage::makeConsistentForGC() 1164 void NormalPage::makeConsistentForGC()
1165 { 1165 {
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1561 1561
1562 m_hasEntries = true; 1562 m_hasEntries = true;
1563 size_t index = hash(address); 1563 size_t index = hash(address);
1564 ASSERT(!(index & 1)); 1564 ASSERT(!(index & 1));
1565 Address cachePage = roundToBlinkPageStart(address); 1565 Address cachePage = roundToBlinkPageStart(address);
1566 m_entries[index + 1] = m_entries[index]; 1566 m_entries[index + 1] = m_entries[index];
1567 m_entries[index] = cachePage; 1567 m_entries[index] = cachePage;
1568 } 1568 }
1569 1569
1570 } // namespace blink 1570 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.cpp ('k') | third_party/WebKit/Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698