| OLD | NEW |
| 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 Loading... |
| 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 | |
| 435 void Heap::RecordFixedArrayElements(FixedArray* array, int offset, int length) { | 429 void Heap::RecordFixedArrayElements(FixedArray* array, int offset, int length) { |
| 436 if (InNewSpace(array)) return; | 430 if (InNewSpace(array)) return; |
| 437 Page* page = Page::FromAddress(reinterpret_cast<Address>(array)); | 431 Page* page = Page::FromAddress(reinterpret_cast<Address>(array)); |
| 438 for (int i = 0; i < length; i++) { | 432 for (int i = 0; i < length; i++) { |
| 439 if (!InNewSpace(array->get(offset + i))) continue; | 433 if (!InNewSpace(array->get(offset + i))) continue; |
| 440 RememberedSet<OLD_TO_NEW>::Insert( | 434 RememberedSet<OLD_TO_NEW>::Insert( |
| 441 page, | 435 page, |
| 442 reinterpret_cast<Address>(array->RawFieldOfElementAt(offset + i))); | 436 reinterpret_cast<Address>(array->RawFieldOfElementAt(offset + i))); |
| 443 } | 437 } |
| 444 } | 438 } |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 | 786 |
| 793 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { | 787 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { |
| 794 for (Object** current = start; current < end; current++) { | 788 for (Object** current = start; current < end; current++) { |
| 795 CHECK((*current)->IsSmi()); | 789 CHECK((*current)->IsSmi()); |
| 796 } | 790 } |
| 797 } | 791 } |
| 798 } // namespace internal | 792 } // namespace internal |
| 799 } // namespace v8 | 793 } // namespace v8 |
| 800 | 794 |
| 801 #endif // V8_HEAP_HEAP_INL_H_ | 795 #endif // V8_HEAP_HEAP_INL_H_ |
| OLD | NEW |