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

Side by Side Diff: Source/platform/heap/Heap.cpp

Issue 1085023002: patch from issue 1063083002 at patchset 20001 (http://crrev.com/1063083002#ps20001) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2650 } 2650 }
2651 delete current; 2651 delete current;
2652 } 2652 }
2653 2653
2654 void Heap::resetHeapCounters() 2654 void Heap::resetHeapCounters()
2655 { 2655 {
2656 ASSERT(ThreadState::current()->isInGC()); 2656 ASSERT(ThreadState::current()->isInGC());
2657 2657
2658 s_allocatedObjectSize = 0; 2658 s_allocatedObjectSize = 0;
2659 s_markedObjectSize = 0; 2659 s_markedObjectSize = 0;
2660
2661 // Similarly, reset the amount of externally allocated memory.
2662 s_externallyAllocatedBytes = 0;
2663 s_externallyAllocatedBytesAlive = 0;
2664
2665 s_requestedUrgentGC = false;
2666 }
2667
2668 void Heap::requestUrgentGC()
2669 {
2670 // The urgent-gc flag will be considered the next time an out-of-line
2671 // allocation is made. Bump allocations from the current block will
2672 // go ahead until it can no longer service an allocation request.
2673 //
2674 // FIXME: if that delays urgently needed GCs for too long, consider
2675 // flushing out per-heap "allocation points" to trigger the GC
2676 // right away.
2677 releaseStore(&s_requestedUrgentGC, 1);
2678 } 2660 }
2679 2661
2680 Visitor* Heap::s_markingVisitor; 2662 Visitor* Heap::s_markingVisitor;
2681 CallbackStack* Heap::s_markingStack; 2663 CallbackStack* Heap::s_markingStack;
2682 CallbackStack* Heap::s_postMarkingCallbackStack; 2664 CallbackStack* Heap::s_postMarkingCallbackStack;
2683 CallbackStack* Heap::s_weakCallbackStack; 2665 CallbackStack* Heap::s_weakCallbackStack;
2684 CallbackStack* Heap::s_ephemeronStack; 2666 CallbackStack* Heap::s_ephemeronStack;
2685 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache; 2667 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache;
2686 bool Heap::s_shutdownCalled = false; 2668 bool Heap::s_shutdownCalled = false;
2687 bool Heap::s_lastGCWasConservative = false; 2669 bool Heap::s_lastGCWasConservative = false;
2688 FreePagePool* Heap::s_freePagePool; 2670 FreePagePool* Heap::s_freePagePool;
2689 OrphanedPagePool* Heap::s_orphanedPagePool; 2671 OrphanedPagePool* Heap::s_orphanedPagePool;
2690 Heap::RegionTree* Heap::s_regionTree = nullptr; 2672 Heap::RegionTree* Heap::s_regionTree = nullptr;
2691 size_t Heap::s_allocatedObjectSize = 0; 2673 size_t Heap::s_allocatedObjectSize = 0;
2692 size_t Heap::s_allocatedSpace = 0; 2674 size_t Heap::s_allocatedSpace = 0;
2693 size_t Heap::s_markedObjectSize = 0; 2675 size_t Heap::s_markedObjectSize = 0;
2694 // We don't want to use 0 KB for the initial value because it may end up 2676 // We don't want to use 0 KB for the initial value because it may end up
2695 // triggering the first GC of some thread too prematurely. 2677 // triggering the first GC of some thread too prematurely.
2696 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024; 2678 size_t Heap::s_estimatedLiveObjectSize = 512 * 1024;
2697 2679 size_t Heap::s_externalObjectSizeAtLastGC = 0;
2698 size_t Heap::s_externallyAllocatedBytes = 0;
2699 size_t Heap::s_externallyAllocatedBytesAlive = 0;
2700 unsigned Heap::s_requestedUrgentGC = false;
2701 double Heap::s_estimatedMarkingTimePerByte = 0.0; 2680 double Heap::s_estimatedMarkingTimePerByte = 0.0;
2702 2681
2703 } // namespace blink 2682 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698