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

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

Issue 2715713005: Verify that a new heap page isn't also marked as being off heap. (Closed)
Patch Set: switch to CHECK() Created 3 years, 10 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 | « third_party/WebKit/Source/platform/heap/ThreadState.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) 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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 #if DCHECK_IS_ON() 1079 #if DCHECK_IS_ON()
1080 BasePage* ThreadState::findPageFromAddress(Address address) { 1080 BasePage* ThreadState::findPageFromAddress(Address address) {
1081 for (int i = 0; i < BlinkGC::NumberOfArenas; ++i) { 1081 for (int i = 0; i < BlinkGC::NumberOfArenas; ++i) {
1082 if (BasePage* page = m_arenas[i]->findPageFromAddress(address)) 1082 if (BasePage* page = m_arenas[i]->findPageFromAddress(address))
1083 return page; 1083 return page;
1084 } 1084 }
1085 return nullptr; 1085 return nullptr;
1086 } 1086 }
1087 #endif 1087 #endif
1088 1088
1089 bool ThreadState::isAddressInHeapDoesNotContainCache(Address address) {
1090 // If the cache has been marked as invalidated, it's cleared prior
1091 // to performing the next GC. Hence, consider the cache as being
1092 // effectively empty.
1093 if (m_shouldFlushHeapDoesNotContainCache)
1094 return false;
1095 return heap().m_heapDoesNotContainCache->lookup(address);
1096 }
1097
1089 size_t ThreadState::objectPayloadSizeForTesting() { 1098 size_t ThreadState::objectPayloadSizeForTesting() {
1090 size_t objectPayloadSize = 0; 1099 size_t objectPayloadSize = 0;
1091 for (int i = 0; i < BlinkGC::NumberOfArenas; ++i) 1100 for (int i = 0; i < BlinkGC::NumberOfArenas; ++i)
1092 objectPayloadSize += m_arenas[i]->objectPayloadSizeForTesting(); 1101 objectPayloadSize += m_arenas[i]->objectPayloadSizeForTesting();
1093 return objectPayloadSize; 1102 return objectPayloadSize;
1094 } 1103 }
1095 1104
1096 void ThreadState::safePoint(BlinkGC::StackState stackState) { 1105 void ThreadState::safePoint(BlinkGC::StackState stackState) {
1097 ASSERT(checkThread()); 1106 ASSERT(checkThread());
1098 ThreadHeap::reportMemoryUsageForTracing(); 1107 ThreadHeap::reportMemoryUsageForTracing();
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, 1558 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep,
1550 BlinkGC::ForcedGC); 1559 BlinkGC::ForcedGC);
1551 size_t liveObjects = heap().heapStats().markedObjectSize(); 1560 size_t liveObjects = heap().heapStats().markedObjectSize();
1552 if (liveObjects == previousLiveObjects) 1561 if (liveObjects == previousLiveObjects)
1553 break; 1562 break;
1554 previousLiveObjects = liveObjects; 1563 previousLiveObjects = liveObjects;
1555 } 1564 }
1556 } 1565 }
1557 1566
1558 } // namespace blink 1567 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698