Chromium Code Reviews| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 1849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1860 Object* object = *p; | 1860 Object* object = *p; |
| 1861 if (!heap->InNewSpace(object)) return; | 1861 if (!heap->InNewSpace(object)) return; |
| 1862 Heap::ScavengeObject(reinterpret_cast<HeapObject**>(p), | 1862 Heap::ScavengeObject(reinterpret_cast<HeapObject**>(p), |
| 1863 reinterpret_cast<HeapObject*>(object)); | 1863 reinterpret_cast<HeapObject*>(object)); |
| 1864 } | 1864 } |
| 1865 }; | 1865 }; |
| 1866 | 1866 |
| 1867 | 1867 |
| 1868 Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor, | 1868 Address Heap::DoScavenge(ObjectVisitor* scavenge_visitor, |
| 1869 Address new_space_front) { | 1869 Address new_space_front) { |
| 1870 // There are soft limits in the allocation code, designed trigger a mark | |
| 1871 // sweep collection by failing allocations. There is no sense in trying to | |
|
Hannes Payer (out of office)
2015/03/20 12:29:27
designed to...
For scavenges allocation should alw
| |
| 1872 // trigger one in during scavenge. | |
| 1873 AlwaysAllocateScope scope(isolate()); | |
| 1870 do { | 1874 do { |
| 1871 SemiSpace::AssertValidRange(new_space_front, new_space_.top()); | 1875 SemiSpace::AssertValidRange(new_space_front, new_space_.top()); |
| 1872 // The addresses new_space_front and new_space_.top() define a | 1876 // The addresses new_space_front and new_space_.top() define a |
| 1873 // queue of unprocessed copied objects. Process them until the | 1877 // queue of unprocessed copied objects. Process them until the |
| 1874 // queue is empty. | 1878 // queue is empty. |
| 1875 while (new_space_front != new_space_.top()) { | 1879 while (new_space_front != new_space_.top()) { |
| 1876 if (!NewSpacePage::IsAtEnd(new_space_front)) { | 1880 if (!NewSpacePage::IsAtEnd(new_space_front)) { |
| 1877 HeapObject* object = HeapObject::FromAddress(new_space_front); | 1881 HeapObject* object = HeapObject::FromAddress(new_space_front); |
| 1878 new_space_front += | 1882 new_space_front += |
| 1879 NewSpaceScavenger::IterateBody(object->map(), object); | 1883 NewSpaceScavenger::IterateBody(object->map(), object); |
| (...skipping 4504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6384 static_cast<int>(object_sizes_last_time_[index])); | 6388 static_cast<int>(object_sizes_last_time_[index])); |
| 6385 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6389 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6386 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6390 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6387 | 6391 |
| 6388 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6392 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6389 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6393 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6390 ClearObjectStats(); | 6394 ClearObjectStats(); |
| 6391 } | 6395 } |
| 6392 } | 6396 } |
| 6393 } // namespace v8::internal | 6397 } // namespace v8::internal |
| OLD | NEW |