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 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1715 set_native_contexts_list(head); | 1715 set_native_contexts_list(head); |
1716 } | 1716 } |
1717 | 1717 |
1718 | 1718 |
1719 void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer, | 1719 void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer, |
1720 bool stop_after_young) { | 1720 bool stop_after_young) { |
1721 Object* array_buffer_obj = VisitWeakList<JSArrayBuffer>( | 1721 Object* array_buffer_obj = VisitWeakList<JSArrayBuffer>( |
1722 this, array_buffers_list(), retainer, stop_after_young); | 1722 this, array_buffers_list(), retainer, stop_after_young); |
1723 set_array_buffers_list(array_buffer_obj); | 1723 set_array_buffers_list(array_buffer_obj); |
1724 | 1724 |
1725 #ifdef DEBUG | |
1726 // Verify invariant that young array buffers come before old array buffers | 1725 // Verify invariant that young array buffers come before old array buffers |
1727 // in array buffers list if there was no promotion failure. | 1726 // in array buffers list if there was no promotion failure. |
1728 Object* undefined = undefined_value(); | 1727 Object* undefined = undefined_value(); |
1729 Object* next = array_buffers_list(); | 1728 Object* next = array_buffers_list(); |
1730 bool old_objects_recorded = false; | 1729 bool old_objects_recorded = false; |
1731 if (migration_failure()) return; | 1730 if (migration_failure()) return; |
1732 while (next != undefined) { | 1731 while (next != undefined) { |
1733 if (!old_objects_recorded) { | 1732 if (!old_objects_recorded) { |
1734 old_objects_recorded = !InNewSpace(next); | 1733 old_objects_recorded = !InNewSpace(next); |
1735 } | 1734 } |
1736 DCHECK((InNewSpace(next) && !old_objects_recorded) || !InNewSpace(next)); | 1735 CHECK((InNewSpace(next) && !old_objects_recorded) || !InNewSpace(next)); |
1737 next = JSArrayBuffer::cast(next)->weak_next(); | 1736 next = JSArrayBuffer::cast(next)->weak_next(); |
1738 } | 1737 } |
1739 #endif | |
1740 } | 1738 } |
1741 | 1739 |
1742 | 1740 |
1743 void Heap::ProcessNewArrayBufferViews(WeakObjectRetainer* retainer) { | 1741 void Heap::ProcessNewArrayBufferViews(WeakObjectRetainer* retainer) { |
1744 // Retain the list of new space views. | 1742 // Retain the list of new space views. |
1745 Object* typed_array_obj = VisitWeakList<JSArrayBufferView>( | 1743 Object* typed_array_obj = VisitWeakList<JSArrayBufferView>( |
1746 this, new_array_buffer_views_list_, retainer, false); | 1744 this, new_array_buffer_views_list_, retainer, false); |
1747 set_new_array_buffer_views_list(typed_array_obj); | 1745 set_new_array_buffer_views_list(typed_array_obj); |
1748 | 1746 |
1749 // Some objects in the list may be in old space now. Find them | 1747 // Some objects in the list may be in old space now. Find them |
(...skipping 4615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6365 static_cast<int>(object_sizes_last_time_[index])); | 6363 static_cast<int>(object_sizes_last_time_[index])); |
6366 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6364 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6367 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6365 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6368 | 6366 |
6369 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6367 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6370 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6368 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6371 ClearObjectStats(); | 6369 ClearObjectStats(); |
6372 } | 6370 } |
6373 } | 6371 } |
6374 } // namespace v8::internal | 6372 } // namespace v8::internal |
OLD | NEW |