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

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

Issue 1964023002: [heap] Fine-grained JSArrayBuffer tracking (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: back to std::map Created 4 years, 7 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
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 #include "src/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 gc_state_ = SCAVENGE; 1619 gc_state_ = SCAVENGE;
1620 1620
1621 // Implements Cheney's copying algorithm 1621 // Implements Cheney's copying algorithm
1622 LOG(isolate_, ResourceEvent("scavenge", "begin")); 1622 LOG(isolate_, ResourceEvent("scavenge", "begin"));
1623 1623
1624 // Used for updating survived_since_last_expansion_ at function end. 1624 // Used for updating survived_since_last_expansion_ at function end.
1625 intptr_t survived_watermark = PromotedSpaceSizeOfObjects(); 1625 intptr_t survived_watermark = PromotedSpaceSizeOfObjects();
1626 1626
1627 scavenge_collector_->SelectScavengingVisitorsTable(); 1627 scavenge_collector_->SelectScavengingVisitorsTable();
1628 1628
1629 array_buffer_tracker()->PrepareDiscoveryInNewSpace();
1630
1631 // Flip the semispaces. After flipping, to space is empty, from space has 1629 // Flip the semispaces. After flipping, to space is empty, from space has
1632 // live objects. 1630 // live objects.
1633 new_space_.Flip(); 1631 new_space_.Flip();
1634 new_space_.ResetAllocationInfo(); 1632 new_space_.ResetAllocationInfo();
1635 1633
1636 // We need to sweep newly copied objects which can be either in the 1634 // We need to sweep newly copied objects which can be either in the
1637 // to space or promoted to the old generation. For to-space 1635 // to space or promoted to the old generation. For to-space
1638 // objects, we treat the bottom of the to space as a queue. Newly 1636 // objects, we treat the bottom of the to space as a queue. Newly
1639 // copied and unswept objects lie between a 'front' mark and the 1637 // copied and unswept objects lie between a 'front' mark and the
1640 // allocation pointer. 1638 // allocation pointer.
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 incremental_marking()->UpdateMarkingDequeAfterScavenge(); 1726 incremental_marking()->UpdateMarkingDequeAfterScavenge();
1729 1727
1730 ScavengeWeakObjectRetainer weak_object_retainer(this); 1728 ScavengeWeakObjectRetainer weak_object_retainer(this);
1731 ProcessYoungWeakReferences(&weak_object_retainer); 1729 ProcessYoungWeakReferences(&weak_object_retainer);
1732 1730
1733 DCHECK(new_space_front == new_space_.top()); 1731 DCHECK(new_space_front == new_space_.top());
1734 1732
1735 // Set age mark. 1733 // Set age mark.
1736 new_space_.set_age_mark(new_space_.top()); 1734 new_space_.set_age_mark(new_space_.top());
1737 1735
1738 array_buffer_tracker()->FreeDead(true); 1736 array_buffer_tracker()->FreeDeadInNewSpace();
1739 1737
1740 // Update how much has survived scavenge. 1738 // Update how much has survived scavenge.
1741 IncrementYoungSurvivorsCounter(static_cast<int>( 1739 IncrementYoungSurvivorsCounter(static_cast<int>(
1742 (PromotedSpaceSizeOfObjects() - survived_watermark) + new_space_.Size())); 1740 (PromotedSpaceSizeOfObjects() - survived_watermark) + new_space_.Size()));
1743 1741
1744 LOG(isolate_, ResourceEvent("scavenge", "end")); 1742 LOG(isolate_, ResourceEvent("scavenge", "end"));
1745 1743
1746 gc_state_ = NOT_IN_GC; 1744 gc_state_ = NOT_IN_GC;
1747 } 1745 }
1748 1746
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
2008 return object; 2006 return object;
2009 } 2007 }
2010 2008
2011 2009
2012 HeapObject* Heap::DoubleAlignForDeserialization(HeapObject* object, int size) { 2010 HeapObject* Heap::DoubleAlignForDeserialization(HeapObject* object, int size) {
2013 return AlignWithFiller(object, size - kPointerSize, size, kDoubleAligned); 2011 return AlignWithFiller(object, size - kPointerSize, size, kDoubleAligned);
2014 } 2012 }
2015 2013
2016 2014
2017 void Heap::RegisterNewArrayBuffer(JSArrayBuffer* buffer) { 2015 void Heap::RegisterNewArrayBuffer(JSArrayBuffer* buffer) {
2018 return array_buffer_tracker()->RegisterNew(buffer); 2016 const bool track_live =
2017 Page::FromAddress(buffer->address())->IsFlagSet(Page::BLACK_PAGE);
Hannes Payer (out of office) 2016/05/20 12:21:17 Instead of checking for black page, it would be be
Michael Lippautz 2016/05/23 08:41:00 Done.
2018 return array_buffer_tracker()->RegisterNew(buffer, track_live);
2019 } 2019 }
2020 2020
2021 2021
2022 void Heap::UnregisterArrayBuffer(JSArrayBuffer* buffer) { 2022 void Heap::UnregisterArrayBuffer(JSArrayBuffer* buffer) {
2023 return array_buffer_tracker()->Unregister(buffer); 2023 return array_buffer_tracker()->Unregister(buffer);
2024 } 2024 }
2025 2025
2026 2026
2027 void Heap::ConfigureInitialOldGenerationSize() { 2027 void Heap::ConfigureInitialOldGenerationSize() {
2028 if (!old_generation_size_configured_ && tracer()->SurvivalEventsRecorded()) { 2028 if (!old_generation_size_configured_ && tracer()->SurvivalEventsRecorded()) {
(...skipping 4333 matching lines...) Expand 10 before | Expand all | Expand 10 after
6362 } 6362 }
6363 6363
6364 6364
6365 // static 6365 // static
6366 int Heap::GetStaticVisitorIdForMap(Map* map) { 6366 int Heap::GetStaticVisitorIdForMap(Map* map) {
6367 return StaticVisitorBase::GetVisitorId(map); 6367 return StaticVisitorBase::GetVisitorId(map);
6368 } 6368 }
6369 6369
6370 } // namespace internal 6370 } // namespace internal
6371 } // namespace v8 6371 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698