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

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

Issue 1883933003: [heap] Optimize NewSpace::AllocatedSinceLastGC (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix offset computation Created 4 years, 8 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/spaces.h ('k') | src/heap/spaces-inl.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/slot-set.h" 10 #include "src/heap/slot-set.h"
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 1475
1476 // Clear remainder of current page. 1476 // Clear remainder of current page.
1477 Address limit = NewSpacePage::FromLimit(top)->area_end(); 1477 Address limit = NewSpacePage::FromLimit(top)->area_end();
1478 if (heap()->gc_state() == Heap::SCAVENGE) { 1478 if (heap()->gc_state() == Heap::SCAVENGE) {
1479 heap()->promotion_queue()->SetNewLimit(limit); 1479 heap()->promotion_queue()->SetNewLimit(limit);
1480 } 1480 }
1481 1481
1482 int remaining_in_page = static_cast<int>(limit - top); 1482 int remaining_in_page = static_cast<int>(limit - top);
1483 heap()->CreateFillerObjectAt(top, remaining_in_page, ClearRecordedSlots::kNo); 1483 heap()->CreateFillerObjectAt(top, remaining_in_page, ClearRecordedSlots::kNo);
1484 pages_used_++; 1484 pages_used_++;
1485 allocated_since_last_gc_ += NewSpacePage::kAllocatableMemory;
1485 UpdateAllocationInfo(); 1486 UpdateAllocationInfo();
1486 1487
1487 return true; 1488 return true;
1488 } 1489 }
1489 1490
1490 1491
1491 bool NewSpace::AddFreshPageSynchronized() { 1492 bool NewSpace::AddFreshPageSynchronized() {
1492 base::LockGuard<base::Mutex> guard(&mutex_); 1493 base::LockGuard<base::Mutex> guard(&mutex_);
1493 return AddFreshPage(); 1494 return AddFreshPage();
1494 } 1495 }
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after
3127 object->ShortPrint(); 3128 object->ShortPrint();
3128 PrintF("\n"); 3129 PrintF("\n");
3129 } 3130 }
3130 printf(" --------------------------------------\n"); 3131 printf(" --------------------------------------\n");
3131 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3132 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3132 } 3133 }
3133 3134
3134 #endif // DEBUG 3135 #endif // DEBUG
3135 } // namespace internal 3136 } // namespace internal
3136 } // namespace v8 3137 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/spaces.h ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698