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

Side by Side Diff: src/heap/mark-compact.cc

Issue 2005173003: Immediatelly promote marked objects (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Do not compute current promotion mode on every iteration 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/mark-compact.h" 5 #include "src/heap/mark-compact.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/base/sys-info.h" 9 #include "src/base/sys-info.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1721 space_to_allocate_(NEW_SPACE), 1721 space_to_allocate_(NEW_SPACE),
1722 promoted_size_(0), 1722 promoted_size_(0),
1723 semispace_copied_size_(0), 1723 semispace_copied_size_(0),
1724 local_pretenuring_feedback_(local_pretenuring_feedback) {} 1724 local_pretenuring_feedback_(local_pretenuring_feedback) {}
1725 1725
1726 inline bool Visit(HeapObject* object) override { 1726 inline bool Visit(HeapObject* object) override {
1727 heap_->UpdateAllocationSite<Heap::kCached>(object, 1727 heap_->UpdateAllocationSite<Heap::kCached>(object,
1728 local_pretenuring_feedback_); 1728 local_pretenuring_feedback_);
1729 int size = object->Size(); 1729 int size = object->Size();
1730 HeapObject* target_object = nullptr; 1730 HeapObject* target_object = nullptr;
1731 if (heap_->ShouldBePromoted(object->address(), size) && 1731 if (heap_->ShouldBePromoted(object->address(), size, DEFAULT_PROMOTION) &&
1732 TryEvacuateObject(compaction_spaces_->Get(OLD_SPACE), object, 1732 TryEvacuateObject(compaction_spaces_->Get(OLD_SPACE), object,
1733 &target_object)) { 1733 &target_object)) {
1734 promoted_size_ += size; 1734 promoted_size_ += size;
1735 return true; 1735 return true;
1736 } 1736 }
1737 HeapObject* target = nullptr; 1737 HeapObject* target = nullptr;
1738 AllocationSpace space = AllocateTargetObject(object, &target); 1738 AllocationSpace space = AllocateTargetObject(object, &target);
1739 MigrateObject(HeapObject::cast(target), object, size, space); 1739 MigrateObject(HeapObject::cast(target), object, size, space);
1740 semispace_copied_size_ += size; 1740 semispace_copied_size_ += size;
1741 return true; 1741 return true;
(...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after
3936 MarkBit mark_bit = Marking::MarkBitFrom(host); 3936 MarkBit mark_bit = Marking::MarkBitFrom(host);
3937 if (Marking::IsBlack(mark_bit)) { 3937 if (Marking::IsBlack(mark_bit)) {
3938 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); 3938 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host);
3939 RecordRelocSlot(host, &rinfo, target); 3939 RecordRelocSlot(host, &rinfo, target);
3940 } 3940 }
3941 } 3941 }
3942 } 3942 }
3943 3943
3944 } // namespace internal 3944 } // namespace internal
3945 } // namespace v8 3945 } // namespace v8
OLDNEW
« src/heap/heap-inl.h ('K') | « src/heap/heap-inl.h ('k') | src/heap/scavenger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698