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

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: Really should concentrate more 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 | « src/heap/heap-inl.h ('k') | src/heap/scavenger.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 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 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 space_to_allocate_(NEW_SPACE), 1717 space_to_allocate_(NEW_SPACE),
1718 promoted_size_(0), 1718 promoted_size_(0),
1719 semispace_copied_size_(0), 1719 semispace_copied_size_(0),
1720 local_pretenuring_feedback_(local_pretenuring_feedback) {} 1720 local_pretenuring_feedback_(local_pretenuring_feedback) {}
1721 1721
1722 inline bool Visit(HeapObject* object) override { 1722 inline bool Visit(HeapObject* object) override {
1723 heap_->UpdateAllocationSite<Heap::kCached>(object, 1723 heap_->UpdateAllocationSite<Heap::kCached>(object,
1724 local_pretenuring_feedback_); 1724 local_pretenuring_feedback_);
1725 int size = object->Size(); 1725 int size = object->Size();
1726 HeapObject* target_object = nullptr; 1726 HeapObject* target_object = nullptr;
1727 if (heap_->ShouldBePromoted(object->address(), size) && 1727 if (heap_->ShouldBePromoted<DEFAULT_PROMOTION>(object->address(), size) &&
1728 TryEvacuateObject(compaction_spaces_->Get(OLD_SPACE), object, 1728 TryEvacuateObject(compaction_spaces_->Get(OLD_SPACE), object,
1729 &target_object)) { 1729 &target_object)) {
1730 // If we end up needing more special cases, we should factor this out. 1730 // If we end up needing more special cases, we should factor this out.
1731 if (V8_UNLIKELY(target_object->IsJSArrayBuffer())) { 1731 if (V8_UNLIKELY(target_object->IsJSArrayBuffer())) {
1732 heap_->array_buffer_tracker()->Promote( 1732 heap_->array_buffer_tracker()->Promote(
1733 JSArrayBuffer::cast(target_object)); 1733 JSArrayBuffer::cast(target_object));
1734 } 1734 }
1735 promoted_size_ += size; 1735 promoted_size_ += size;
1736 return true; 1736 return true;
1737 } 1737 }
(...skipping 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after
3943 MarkBit mark_bit = Marking::MarkBitFrom(host); 3943 MarkBit mark_bit = Marking::MarkBitFrom(host);
3944 if (Marking::IsBlack(mark_bit)) { 3944 if (Marking::IsBlack(mark_bit)) {
3945 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host); 3945 RelocInfo rinfo(isolate(), pc, RelocInfo::CODE_TARGET, 0, host);
3946 RecordRelocSlot(host, &rinfo, target); 3946 RecordRelocSlot(host, &rinfo, target);
3947 } 3947 }
3948 } 3948 }
3949 } 3949 }
3950 3950
3951 } // namespace internal 3951 } // namespace internal
3952 } // namespace v8 3952 } // namespace v8
OLDNEW
« no previous file with comments | « 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