| 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 28 matching lines...) Expand all Loading... |
| 39 #include "platform/heap/MarkingVisitor.h" | 39 #include "platform/heap/MarkingVisitor.h" |
| 40 #include "platform/heap/PageMemory.h" | 40 #include "platform/heap/PageMemory.h" |
| 41 #include "platform/heap/PagePool.h" | 41 #include "platform/heap/PagePool.h" |
| 42 #include "platform/heap/SafePoint.h" | 42 #include "platform/heap/SafePoint.h" |
| 43 #include "platform/heap/ThreadState.h" | 43 #include "platform/heap/ThreadState.h" |
| 44 #include "public/platform/Platform.h" | 44 #include "public/platform/Platform.h" |
| 45 #include "public/platform/WebMemoryAllocatorDump.h" | 45 #include "public/platform/WebMemoryAllocatorDump.h" |
| 46 #include "public/platform/WebProcessMemoryDump.h" | 46 #include "public/platform/WebProcessMemoryDump.h" |
| 47 #include "wtf/Assertions.h" | 47 #include "wtf/Assertions.h" |
| 48 #include "wtf/ContainerAnnotations.h" | 48 #include "wtf/ContainerAnnotations.h" |
| 49 #include "wtf/CurrentTime.h" |
| 49 #include "wtf/LeakAnnotations.h" | 50 #include "wtf/LeakAnnotations.h" |
| 50 #include "wtf/MainThread.h" | 51 #include "wtf/MainThread.h" |
| 51 #include "wtf/PageAllocator.h" | 52 #include "wtf/PageAllocator.h" |
| 52 #include "wtf/Partitions.h" | 53 #include "wtf/Partitions.h" |
| 53 #include "wtf/PassOwnPtr.h" | 54 #include "wtf/PassOwnPtr.h" |
| 54 | 55 |
| 55 #ifdef ANNOTATE_CONTIGUOUS_CONTAINER | 56 #ifdef ANNOTATE_CONTIGUOUS_CONTAINER |
| 56 // FIXME: have ContainerAnnotations.h define an ENABLE_-style name instead. | 57 // FIXME: have ContainerAnnotations.h define an ENABLE_-style name instead. |
| 57 #define ENABLE_ASAN_CONTAINER_ANNOTATIONS 1 | 58 #define ENABLE_ASAN_CONTAINER_ANNOTATIONS 1 |
| 58 | 59 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 static const int deadlineCheckInterval = 10; | 331 static const int deadlineCheckInterval = 10; |
| 331 | 332 |
| 332 RELEASE_ASSERT(threadState()->isSweepingInProgress()); | 333 RELEASE_ASSERT(threadState()->isSweepingInProgress()); |
| 333 ASSERT(threadState()->sweepForbidden()); | 334 ASSERT(threadState()->sweepForbidden()); |
| 334 ASSERT(!threadState()->isMainThread() || ScriptForbiddenScope::isScriptForbi
dden()); | 335 ASSERT(!threadState()->isMainThread() || ScriptForbiddenScope::isScriptForbi
dden()); |
| 335 | 336 |
| 336 int pageCount = 1; | 337 int pageCount = 1; |
| 337 while (m_firstUnsweptPage) { | 338 while (m_firstUnsweptPage) { |
| 338 sweepUnsweptPage(); | 339 sweepUnsweptPage(); |
| 339 if (pageCount % deadlineCheckInterval == 0) { | 340 if (pageCount % deadlineCheckInterval == 0) { |
| 340 if (deadlineSeconds <= Platform::current()->monotonicallyIncreasingT
imeSeconds()) { | 341 if (deadlineSeconds <= monotonicallyIncreasingTime()) { |
| 341 // Deadline has come. | 342 // Deadline has come. |
| 342 Heap::reportMemoryUsageForTracing(); | 343 Heap::reportMemoryUsageForTracing(); |
| 343 return !m_firstUnsweptPage; | 344 return !m_firstUnsweptPage; |
| 344 } | 345 } |
| 345 } | 346 } |
| 346 pageCount++; | 347 pageCount++; |
| 347 } | 348 } |
| 348 Heap::reportMemoryUsageForTracing(); | 349 Heap::reportMemoryUsageForTracing(); |
| 349 return true; | 350 return true; |
| 350 } | 351 } |
| (...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1594 | 1595 |
| 1595 m_hasEntries = true; | 1596 m_hasEntries = true; |
| 1596 size_t index = hash(address); | 1597 size_t index = hash(address); |
| 1597 ASSERT(!(index & 1)); | 1598 ASSERT(!(index & 1)); |
| 1598 Address cachePage = roundToBlinkPageStart(address); | 1599 Address cachePage = roundToBlinkPageStart(address); |
| 1599 m_entries[index + 1] = m_entries[index]; | 1600 m_entries[index + 1] = m_entries[index]; |
| 1600 m_entries[index] = cachePage; | 1601 m_entries[index] = cachePage; |
| 1601 } | 1602 } |
| 1602 | 1603 |
| 1603 } // namespace blink | 1604 } // namespace blink |
| OLD | NEW |