| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 static const int deadlineCheckInterval = 10; | 333 static const int deadlineCheckInterval = 10; |
| 333 | 334 |
| 334 RELEASE_ASSERT(threadState()->isSweepingInProgress()); | 335 RELEASE_ASSERT(threadState()->isSweepingInProgress()); |
| 335 ASSERT(threadState()->sweepForbidden()); | 336 ASSERT(threadState()->sweepForbidden()); |
| 336 ASSERT(!threadState()->isMainThread() || ScriptForbiddenScope::isScriptForbi
dden()); | 337 ASSERT(!threadState()->isMainThread() || ScriptForbiddenScope::isScriptForbi
dden()); |
| 337 | 338 |
| 338 int pageCount = 1; | 339 int pageCount = 1; |
| 339 while (m_firstUnsweptPage) { | 340 while (m_firstUnsweptPage) { |
| 340 sweepUnsweptPage(); | 341 sweepUnsweptPage(); |
| 341 if (pageCount % deadlineCheckInterval == 0) { | 342 if (pageCount % deadlineCheckInterval == 0) { |
| 342 if (deadlineSeconds <= Platform::current()->monotonicallyIncreasingT
imeSeconds()) { | 343 if (deadlineSeconds <= monotonicallyIncreasingTime()) { |
| 343 // Deadline has come. | 344 // Deadline has come. |
| 344 Heap::reportMemoryUsageForTracing(); | 345 Heap::reportMemoryUsageForTracing(); |
| 345 return !m_firstUnsweptPage; | 346 return !m_firstUnsweptPage; |
| 346 } | 347 } |
| 347 } | 348 } |
| 348 pageCount++; | 349 pageCount++; |
| 349 } | 350 } |
| 350 Heap::reportMemoryUsageForTracing(); | 351 Heap::reportMemoryUsageForTracing(); |
| 351 return true; | 352 return true; |
| 352 } | 353 } |
| (...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1574 | 1575 |
| 1575 m_hasEntries = true; | 1576 m_hasEntries = true; |
| 1576 size_t index = hash(address); | 1577 size_t index = hash(address); |
| 1577 ASSERT(!(index & 1)); | 1578 ASSERT(!(index & 1)); |
| 1578 Address cachePage = roundToBlinkPageStart(address); | 1579 Address cachePage = roundToBlinkPageStart(address); |
| 1579 m_entries[index + 1] = m_entries[index]; | 1580 m_entries[index + 1] = m_entries[index]; |
| 1580 m_entries[index] = cachePage; | 1581 m_entries[index] = cachePage; |
| 1581 } | 1582 } |
| 1582 | 1583 |
| 1583 } // namespace blink | 1584 } // namespace blink |
| OLD | NEW |