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

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

Issue 1670463002: [Oilpan] Unify memory usage reporters of Oilpan (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "platform/heap/HeapPage.h" 31 #include "platform/heap/HeapPage.h"
32 32
33 #include "platform/MemoryUsageProvider.h"
33 #include "platform/ScriptForbiddenScope.h" 34 #include "platform/ScriptForbiddenScope.h"
34 #include "platform/Task.h" 35 #include "platform/Task.h"
35 #include "platform/TraceEvent.h" 36 #include "platform/TraceEvent.h"
36 #include "platform/heap/BlinkGCMemoryDumpProvider.h" 37 #include "platform/heap/BlinkGCMemoryDumpProvider.h"
37 #include "platform/heap/CallbackStack.h" 38 #include "platform/heap/CallbackStack.h"
38 #include "platform/heap/Heap.h" 39 #include "platform/heap/Heap.h"
39 #include "platform/heap/MarkingVisitor.h" 40 #include "platform/heap/MarkingVisitor.h"
40 #include "platform/heap/PageMemory.h" 41 #include "platform/heap/PageMemory.h"
41 #include "platform/heap/PagePool.h" 42 #include "platform/heap/PagePool.h"
42 #include "platform/heap/SafePoint.h" 43 #include "platform/heap/SafePoint.h"
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 updateRemainingAllocationSize(); 695 updateRemainingAllocationSize();
695 m_currentAllocationPoint = point; 696 m_currentAllocationPoint = point;
696 m_lastRemainingAllocationSize = m_remainingAllocationSize = size; 697 m_lastRemainingAllocationSize = m_remainingAllocationSize = size;
697 } 698 }
698 699
699 Address NormalPageHeap::outOfLineAllocate(size_t allocationSize, size_t gcInfoIn dex) 700 Address NormalPageHeap::outOfLineAllocate(size_t allocationSize, size_t gcInfoIn dex)
700 { 701 {
701 ASSERT(allocationSize > remainingAllocationSize()); 702 ASSERT(allocationSize > remainingAllocationSize());
702 ASSERT(allocationSize >= allocationGranularity); 703 ASSERT(allocationSize >= allocationGranularity);
703 704
705 MemoryUsageProvider::instance()->adjustAmountOfAllocatedMemory();
peria 2016/02/04 08:33:51 Currently this is the only entry point to report m
706
704 // 1. If this allocation is big enough, allocate a large object. 707 // 1. If this allocation is big enough, allocate a large object.
705 if (allocationSize >= largeObjectSizeThreshold) { 708 if (allocationSize >= largeObjectSizeThreshold) {
706 // TODO(sof): support eagerly finalized large objects, if ever needed. 709 // TODO(sof): support eagerly finalized large objects, if ever needed.
707 RELEASE_ASSERT(heapIndex() != BlinkGC::EagerSweepHeapIndex); 710 RELEASE_ASSERT(heapIndex() != BlinkGC::EagerSweepHeapIndex);
708 LargeObjectHeap* largeObjectHeap = static_cast<LargeObjectHeap*>(threadS tate()->heap(BlinkGC::LargeObjectHeapIndex)); 711 LargeObjectHeap* largeObjectHeap = static_cast<LargeObjectHeap*>(threadS tate()->heap(BlinkGC::LargeObjectHeapIndex));
709 Address largeObject = largeObjectHeap->allocateLargeObjectPage(allocatio nSize, gcInfoIndex); 712 Address largeObject = largeObjectHeap->allocateLargeObjectPage(allocatio nSize, gcInfoIndex);
710 ASAN_MARK_LARGE_VECTOR_CONTAINER(this, largeObject); 713 ASAN_MARK_LARGE_VECTOR_CONTAINER(this, largeObject);
711 return largeObject; 714 return largeObject;
712 } 715 }
713 716
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 1577
1575 m_hasEntries = true; 1578 m_hasEntries = true;
1576 size_t index = hash(address); 1579 size_t index = hash(address);
1577 ASSERT(!(index & 1)); 1580 ASSERT(!(index & 1));
1578 Address cachePage = roundToBlinkPageStart(address); 1581 Address cachePage = roundToBlinkPageStart(address);
1579 m_entries[index + 1] = m_entries[index]; 1582 m_entries[index + 1] = m_entries[index];
1580 m_entries[index] = cachePage; 1583 m_entries[index] = cachePage;
1581 } 1584 }
1582 1585
1583 } // namespace blink 1586 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698