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

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

Issue 648633002: Oilpan: Scale up the number of marking threads according to available processors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« 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 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2134 s_markingStack = new CallbackStack(); 2134 s_markingStack = new CallbackStack();
2135 s_postMarkingCallbackStack = new CallbackStack(); 2135 s_postMarkingCallbackStack = new CallbackStack();
2136 s_weakCallbackStack = new CallbackStack(); 2136 s_weakCallbackStack = new CallbackStack();
2137 s_ephemeronStack = new CallbackStack(); 2137 s_ephemeronStack = new CallbackStack();
2138 s_heapDoesNotContainCache = new HeapDoesNotContainCache(); 2138 s_heapDoesNotContainCache = new HeapDoesNotContainCache();
2139 s_markingVisitor = new MarkingVisitor(s_markingStack); 2139 s_markingVisitor = new MarkingVisitor(s_markingStack);
2140 s_freePagePool = new FreePagePool(); 2140 s_freePagePool = new FreePagePool();
2141 s_orphanedPagePool = new OrphanedPagePool(); 2141 s_orphanedPagePool = new OrphanedPagePool();
2142 s_markingThreads = new Vector<OwnPtr<blink::WebThread> >(); 2142 s_markingThreads = new Vector<OwnPtr<blink::WebThread> >();
2143 if (blink::Platform::current()) { 2143 if (blink::Platform::current()) {
2144 // FIXME: We should let the amount of threads scale with the 2144 int processors = blink::Platform::current()->numberOfProcessors();
2145 // amount of processors in the system instead of hardcoding 2145 int numberOfMarkingThreads = std::min(processors, maxNumberOfMarkingThre ads);
2146 // it.
2147 for (int i = 0; i < numberOfMarkingThreads; i++) 2146 for (int i = 0; i < numberOfMarkingThreads; i++)
2148 s_markingThreads->append(adoptPtr(blink::Platform::current()->create Thread("Blink Heap Marker Thread"))); 2147 s_markingThreads->append(adoptPtr(blink::Platform::current()->create Thread("Blink GC Marking Thread")));
2149 } 2148 }
2150 } 2149 }
2151 2150
2152 void Heap::shutdown() 2151 void Heap::shutdown()
2153 { 2152 {
2154 s_shutdownCalled = true; 2153 s_shutdownCalled = true;
2155 ThreadState::shutdownHeapIfNecessary(); 2154 ThreadState::shutdownHeapIfNecessary();
2156 } 2155 }
2157 2156
2158 void Heap::doShutdown() 2157 void Heap::doShutdown()
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
2893 CallbackStack* Heap::s_weakCallbackStack; 2892 CallbackStack* Heap::s_weakCallbackStack;
2894 CallbackStack* Heap::s_ephemeronStack; 2893 CallbackStack* Heap::s_ephemeronStack;
2895 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache; 2894 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache;
2896 bool Heap::s_shutdownCalled = false; 2895 bool Heap::s_shutdownCalled = false;
2897 bool Heap::s_lastGCWasConservative = false; 2896 bool Heap::s_lastGCWasConservative = false;
2898 FreePagePool* Heap::s_freePagePool; 2897 FreePagePool* Heap::s_freePagePool;
2899 OrphanedPagePool* Heap::s_orphanedPagePool; 2898 OrphanedPagePool* Heap::s_orphanedPagePool;
2900 Heap::RegionTree* Heap::s_regionTree = 0; 2899 Heap::RegionTree* Heap::s_regionTree = 0;
2901 2900
2902 } 2901 }
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