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

Side by Side Diff: src/heap/spaces.cc

Issue 1416003003: Cleanup FreeSpace: Remove getter for address of next pointer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/objects.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 #include "src/heap/spaces.h" 5 #include "src/heap/spaces.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/full-codegen/full-codegen.h" 9 #include "src/full-codegen/full-codegen.h"
10 #include "src/heap/slots-buffer.h" 10 #include "src/heap/slots-buffer.h"
(...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after
2228 return false; 2228 return false;
2229 } 2229 }
2230 2230
2231 2231
2232 FreeSpace* FreeListCategory::PickNodeFromList(int* node_size) { 2232 FreeSpace* FreeListCategory::PickNodeFromList(int* node_size) {
2233 FreeSpace* node = top(); 2233 FreeSpace* node = top();
2234 if (node == nullptr) return nullptr; 2234 if (node == nullptr) return nullptr;
2235 2235
2236 Page* page = Page::FromAddress(node->address()); 2236 Page* page = Page::FromAddress(node->address());
2237 while ((node != nullptr) && page->IsEvacuationCandidate()) { 2237 while ((node != nullptr) && page->IsEvacuationCandidate()) {
2238 available_ -= node->Size(); 2238 available_ -= node->size();
2239 page->add_available_in_free_list(type_, -(node->Size())); 2239 page->add_available_in_free_list(type_, -(node->Size()));
2240 node = node->next(); 2240 node = node->next();
2241 } 2241 }
2242 2242
2243 if (node != nullptr) { 2243 if (node != nullptr) {
2244 set_top(node->next()); 2244 set_top(node->next());
2245 *node_size = node->Size(); 2245 *node_size = node->Size();
2246 available_ -= *node_size; 2246 available_ -= *node_size;
2247 } else { 2247 } else {
2248 set_top(nullptr); 2248 set_top(nullptr);
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
3267 object->ShortPrint(); 3267 object->ShortPrint();
3268 PrintF("\n"); 3268 PrintF("\n");
3269 } 3269 }
3270 printf(" --------------------------------------\n"); 3270 printf(" --------------------------------------\n");
3271 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3271 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3272 } 3272 }
3273 3273
3274 #endif // DEBUG 3274 #endif // DEBUG
3275 } // namespace internal 3275 } // namespace internal
3276 } // namespace v8 3276 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698