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 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |