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

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

Issue 2097023002: Reland [heap] Avoid the use of cells to point from code to new-space objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase. Created 4 years, 5 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 419
420 void Heap::RecordWrite(Object* object, int offset, Object* o) { 420 void Heap::RecordWrite(Object* object, int offset, Object* o) {
421 if (!InNewSpace(o) || !object->IsHeapObject() || InNewSpace(object)) { 421 if (!InNewSpace(o) || !object->IsHeapObject() || InNewSpace(object)) {
422 return; 422 return;
423 } 423 }
424 RememberedSet<OLD_TO_NEW>::Insert( 424 RememberedSet<OLD_TO_NEW>::Insert(
425 Page::FromAddress(reinterpret_cast<Address>(object)), 425 Page::FromAddress(reinterpret_cast<Address>(object)),
426 HeapObject::cast(object)->address() + offset); 426 HeapObject::cast(object)->address() + offset);
427 } 427 }
428 428
429 void Heap::RecordWriteIntoCode(Code* host, RelocInfo* rinfo, Object* value) {
430 if (InNewSpace(value)) {
431 RecordWriteIntoCodeSlow(host, rinfo, value);
432 }
433 }
434
429 void Heap::RecordFixedArrayElements(FixedArray* array, int offset, int length) { 435 void Heap::RecordFixedArrayElements(FixedArray* array, int offset, int length) {
430 if (InNewSpace(array)) return; 436 if (InNewSpace(array)) return;
431 Page* page = Page::FromAddress(reinterpret_cast<Address>(array)); 437 Page* page = Page::FromAddress(reinterpret_cast<Address>(array));
432 for (int i = 0; i < length; i++) { 438 for (int i = 0; i < length; i++) {
433 if (!InNewSpace(array->get(offset + i))) continue; 439 if (!InNewSpace(array->get(offset + i))) continue;
434 RememberedSet<OLD_TO_NEW>::Insert( 440 RememberedSet<OLD_TO_NEW>::Insert(
435 page, 441 page,
436 reinterpret_cast<Address>(array->RawFieldOfElementAt(offset + i))); 442 reinterpret_cast<Address>(array->RawFieldOfElementAt(offset + i)));
437 } 443 }
438 } 444 }
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 792
787 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { 793 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) {
788 for (Object** current = start; current < end; current++) { 794 for (Object** current = start; current < end; current++) {
789 CHECK((*current)->IsSmi()); 795 CHECK((*current)->IsSmi());
790 } 796 }
791 } 797 }
792 } // namespace internal 798 } // namespace internal
793 } // namespace v8 799 } // namespace v8
794 800
795 #endif // V8_HEAP_HEAP_INL_H_ 801 #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