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

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

Issue 2019333009: [heap] Do not use the high memory watermark for committed memory accounting in large object space. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | 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/base/platform/semaphore.h" 9 #include "src/base/platform/semaphore.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 2970 matching lines...) Expand 10 before | Expand all | Expand 10 after
2981 reinterpret_cast<Object**>(object->address())[1] = Smi::FromInt(0); 2981 reinterpret_cast<Object**>(object->address())[1] = Smi::FromInt(0);
2982 } 2982 }
2983 2983
2984 heap()->incremental_marking()->OldSpaceStep(object_size); 2984 heap()->incremental_marking()->OldSpaceStep(object_size);
2985 AllocationStep(object->address(), object_size); 2985 AllocationStep(object->address(), object_size);
2986 return object; 2986 return object;
2987 } 2987 }
2988 2988
2989 2989
2990 size_t LargeObjectSpace::CommittedPhysicalMemory() { 2990 size_t LargeObjectSpace::CommittedPhysicalMemory() {
2991 if (!base::VirtualMemory::HasLazyCommits()) return CommittedMemory(); 2991 // On a platform that provides lazy committing of memory, we over-account
2992 size_t size = 0; 2992 // the actually committed memory. There is no easy way right now to support
2993 LargePage* current = first_page_; 2993 // precise accounting of committed memory in large object space.
2994 while (current != NULL) { 2994 return CommittedMemory();
2995 size += current->CommittedPhysicalMemory();
2996 current = current->next_page();
2997 }
2998 return size;
2999 } 2995 }
3000 2996
3001 2997
3002 // GC support 2998 // GC support
3003 Object* LargeObjectSpace::FindObject(Address a) { 2999 Object* LargeObjectSpace::FindObject(Address a) {
3004 LargePage* page = FindPage(a); 3000 LargePage* page = FindPage(a);
3005 if (page != NULL) { 3001 if (page != NULL) {
3006 return page->GetObject(); 3002 return page->GetObject();
3007 } 3003 }
3008 return Smi::FromInt(0); // Signaling not found. 3004 return Smi::FromInt(0); // Signaling not found.
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
3202 object->ShortPrint(); 3198 object->ShortPrint();
3203 PrintF("\n"); 3199 PrintF("\n");
3204 } 3200 }
3205 printf(" --------------------------------------\n"); 3201 printf(" --------------------------------------\n");
3206 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3202 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3207 } 3203 }
3208 3204
3209 #endif // DEBUG 3205 #endif // DEBUG
3210 } // namespace internal 3206 } // namespace internal
3211 } // namespace v8 3207 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698