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

Side by Side Diff: src/heap/mark-compact-inl.h

Issue 1596343004: [heap] Sort sweep pages list by free memory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adressed final comment Created 4 years, 11 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 | « src/heap/mark-compact.cc ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HEAP_MARK_COMPACT_INL_H_ 5 #ifndef V8_HEAP_MARK_COMPACT_INL_H_
6 #define V8_HEAP_MARK_COMPACT_INL_H_ 6 #define V8_HEAP_MARK_COMPACT_INL_H_
7 7
8 #include "src/heap/mark-compact.h" 8 #include "src/heap/mark-compact.h"
9 #include "src/heap/slots-buffer.h" 9 #include "src/heap/slots-buffer.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 inline std::vector<Page*>& MarkCompactCollector::sweeping_list(Space* space) {
16 if (space == heap()->old_space()) {
17 return sweeping_list_old_space_;
18 } else if (space == heap()->code_space()) {
19 return sweeping_list_code_space_;
20 }
21 DCHECK_EQ(space, heap()->map_space());
22 return sweeping_list_map_space_;
23 }
24
25
15 void MarkCompactCollector::PushBlack(HeapObject* obj) { 26 void MarkCompactCollector::PushBlack(HeapObject* obj) {
16 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj))); 27 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(obj)));
17 if (marking_deque_.Push(obj)) { 28 if (marking_deque_.Push(obj)) {
18 MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size()); 29 MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size());
19 } else { 30 } else {
20 Marking::BlackToGrey(obj); 31 Marking::BlackToGrey(obj);
21 } 32 }
22 } 33 }
23 34
24 35
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 197 }
187 if (object != nullptr) return object; 198 if (object != nullptr) return object;
188 } 199 }
189 return nullptr; 200 return nullptr;
190 } 201 }
191 202
192 } // namespace internal 203 } // namespace internal
193 } // namespace v8 204 } // namespace v8
194 205
195 #endif // V8_HEAP_MARK_COMPACT_INL_H_ 206 #endif // V8_HEAP_MARK_COMPACT_INL_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698