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

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: Created 3 years, 9 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 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 } 1077 }
1078 1078
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
1088 bool ThreadState::isAddressInHeapDoesNotContainCache(Address address) {
1089 // If the cache has been marked as invalidated, it's cleared prior
1090 // to performing the next GC. Hence, consider the cache as being
1091 // effectively empty.
1092 if (m_shouldFlushHeapDoesNotContainCache)
1093 return false;
1094 return heap().m_heapDoesNotContainCache->lookup(address);
1095 }
1087 #endif 1096 #endif
1088 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) {
(...skipping 452 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

Powered by Google App Engine
This is Rietveld 408576698