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

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

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/CallbackStack.h ('k') | Source/platform/heap/Heap.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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 const size_t sizeMask = ~heapObjectAgeMask & ~static_cast<size_t>(7); 87 const size_t sizeMask = ~heapObjectAgeMask & ~static_cast<size_t>(7);
88 #else 88 #else
89 const size_t sizeMask = ~static_cast<size_t>(7); 89 const size_t sizeMask = ~static_cast<size_t>(7);
90 #endif 90 #endif
91 const uint8_t freelistZapValue = 42; 91 const uint8_t freelistZapValue = 42;
92 const uint8_t finalizedZapValue = 24; 92 const uint8_t finalizedZapValue = 24;
93 // The orphaned zap value must be zero in the lowest bits to allow for using 93 // The orphaned zap value must be zero in the lowest bits to allow for using
94 // the mark bit when tracing. 94 // the mark bit when tracing.
95 const uint8_t orphanedZapValue = 240; 95 const uint8_t orphanedZapValue = 240;
96 96
97 const int numberOfMarkingThreads = 2; 97 const int maxNumberOfMarkingThreads = 4;
98 98
99 const int numberOfPagesToConsiderForCoalescing = 100; 99 const int numberOfPagesToConsiderForCoalescing = 100;
100 100
101 enum CallbackInvocationMode { 101 enum CallbackInvocationMode {
102 GlobalMarking, 102 GlobalMarking,
103 ThreadLocalMarking, 103 ThreadLocalMarking,
104 }; 104 };
105 105
106 class CallbackStack; 106 class CallbackStack;
107 class HeapStats; 107 class HeapStats;
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 952
953 template<typename T, typename HeapTraits> static Address allocate(size_t); 953 template<typename T, typename HeapTraits> static Address allocate(size_t);
954 // FIXME: remove this once c++11 is allowed everywhere: 954 // FIXME: remove this once c++11 is allowed everywhere:
955 template<typename T> static Address allocate(size_t); 955 template<typename T> static Address allocate(size_t);
956 956
957 template<typename T> static Address reallocate(void* previous, size_t); 957 template<typename T> static Address reallocate(void* previous, size_t);
958 958
959 static void collectGarbage(ThreadState::StackState, ThreadState::CauseOfGC = ThreadState::NormalGC); 959 static void collectGarbage(ThreadState::StackState, ThreadState::CauseOfGC = ThreadState::NormalGC);
960 static void collectGarbageForTerminatingThread(ThreadState*); 960 static void collectGarbageForTerminatingThread(ThreadState*);
961 static void collectAllGarbage(); 961 static void collectAllGarbage();
962 static void processMarkingStackEntries(int* numberOfMarkingThreads); 962 static void processMarkingStackEntries(int*);
963 static void processMarkingStackOnMultipleThreads(); 963 static void processMarkingStackOnMultipleThreads();
964 static void processMarkingStackInParallel(); 964 static void processMarkingStackInParallel();
965 template<CallbackInvocationMode Mode> static void processMarkingStack(); 965 template<CallbackInvocationMode Mode> static void processMarkingStack();
966 static void postMarkingProcessing(); 966 static void postMarkingProcessing();
967 static void globalWeakProcessing(); 967 static void globalWeakProcessing();
968 static void setForcePreciseGCForTesting(); 968 static void setForcePreciseGCForTesting();
969 969
970 static void prepareForGC(); 970 static void prepareForGC();
971 971
972 // Conservatively checks whether an address is a pointer in any of the threa d 972 // Conservatively checks whether an address is a pointer in any of the threa d
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
2450 }; 2450 };
2451 2451
2452 template<typename T> 2452 template<typename T>
2453 struct IfWeakMember<WeakMember<T> > { 2453 struct IfWeakMember<WeakMember<T> > {
2454 static bool isDead(Visitor* visitor, const WeakMember<T>& t) { return !visit or->isAlive(t.get()); } 2454 static bool isDead(Visitor* visitor, const WeakMember<T>& t) { return !visit or->isAlive(t.get()); }
2455 }; 2455 };
2456 2456
2457 } 2457 }
2458 2458
2459 #endif // Heap_h 2459 #endif // Heap_h
OLDNEW
« no previous file with comments | « Source/platform/heap/CallbackStack.h ('k') | Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698