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

Side by Side Diff: src/heap/heap-inl.h

Issue 1683653002: Add a generic remembered set class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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.cc ('k') | src/heap/mark-compact.cc » ('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 #ifndef V8_HEAP_HEAP_INL_H_ 5 #ifndef V8_HEAP_HEAP_INL_H_
6 #define V8_HEAP_HEAP_INL_H_ 6 #define V8_HEAP_HEAP_INL_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 NewSpacePage* page = NewSpacePage::FromAddress(old_address); 388 NewSpacePage* page = NewSpacePage::FromAddress(old_address);
389 Address age_mark = new_space_.age_mark(); 389 Address age_mark = new_space_.age_mark();
390 return page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) && 390 return page->IsFlagSet(MemoryChunk::NEW_SPACE_BELOW_AGE_MARK) &&
391 (!page->ContainsLimit(age_mark) || old_address < age_mark); 391 (!page->ContainsLimit(age_mark) || old_address < age_mark);
392 } 392 }
393 393
394 void Heap::RecordWrite(Object* object, int offset, Object* o) { 394 void Heap::RecordWrite(Object* object, int offset, Object* o) {
395 if (!InNewSpace(o) || !object->IsHeapObject() || InNewSpace(object)) { 395 if (!InNewSpace(o) || !object->IsHeapObject() || InNewSpace(object)) {
396 return; 396 return;
397 } 397 }
398 store_buffer_.Mark(HeapObject::cast(object)->address() + offset); 398 Page* page = Page::FromAddress(reinterpret_cast<Address>(object));
399 Address slot = HeapObject::cast(object)->address() + offset;
400 RememberedSet<OLD_TO_NEW>::Insert(page, slot);
399 } 401 }
400 402
401 403
402 bool Heap::AllowedToBeMigrated(HeapObject* obj, AllocationSpace dst) { 404 bool Heap::AllowedToBeMigrated(HeapObject* obj, AllocationSpace dst) {
403 // Object migration is governed by the following rules: 405 // Object migration is governed by the following rules:
404 // 406 //
405 // 1) Objects in new-space can be migrated to the old space 407 // 1) Objects in new-space can be migrated to the old space
406 // that matches their target space or they stay in new-space. 408 // that matches their target space or they stay in new-space.
407 // 2) Objects in old-space stay in the same space when migrating. 409 // 2) Objects in old-space stay in the same space when migrating.
408 // 3) Fillers (two or more words) can migrate due to left-trimming of 410 // 3) Fillers (two or more words) can migrate due to left-trimming of
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 727
726 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { 728 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) {
727 for (Object** current = start; current < end; current++) { 729 for (Object** current = start; current < end; current++) {
728 CHECK((*current)->IsSmi()); 730 CHECK((*current)->IsSmi());
729 } 731 }
730 } 732 }
731 } // namespace internal 733 } // namespace internal
732 } // namespace v8 734 } // namespace v8
733 735
734 #endif // V8_HEAP_HEAP_INL_H_ 736 #endif // V8_HEAP_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698