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 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 TransitionElementsKind(object, FAST_ELEMENTS); | 1772 TransitionElementsKind(object, FAST_ELEMENTS); |
1773 } | 1773 } |
1774 } | 1774 } |
1775 } | 1775 } |
1776 | 1776 |
1777 | 1777 |
1778 void JSObject::EnsureCanContainElements(Handle<JSObject> object, | 1778 void JSObject::EnsureCanContainElements(Handle<JSObject> object, |
1779 Object** objects, | 1779 Object** objects, |
1780 uint32_t count, | 1780 uint32_t count, |
1781 EnsureElementsMode mode) { | 1781 EnsureElementsMode mode) { |
1782 ElementsKind current_kind = object->map()->elements_kind(); | 1782 ElementsKind current_kind = object->GetElementsKind(); |
1783 ElementsKind target_kind = current_kind; | 1783 ElementsKind target_kind = current_kind; |
1784 { | 1784 { |
1785 DisallowHeapAllocation no_allocation; | 1785 DisallowHeapAllocation no_allocation; |
1786 DCHECK(mode != ALLOW_COPIED_DOUBLE_ELEMENTS); | 1786 DCHECK(mode != ALLOW_COPIED_DOUBLE_ELEMENTS); |
1787 bool is_holey = IsFastHoleyElementsKind(current_kind); | 1787 bool is_holey = IsFastHoleyElementsKind(current_kind); |
1788 if (current_kind == FAST_HOLEY_ELEMENTS) return; | 1788 if (current_kind == FAST_HOLEY_ELEMENTS) return; |
1789 Heap* heap = object->GetHeap(); | 1789 Heap* heap = object->GetHeap(); |
1790 Object* the_hole = heap->the_hole_value(); | 1790 Object* the_hole = heap->the_hole_value(); |
1791 for (uint32_t i = 0; i < count; ++i) { | 1791 for (uint32_t i = 0; i < count; ++i) { |
1792 Object* current = *objects++; | 1792 Object* current = *objects++; |
(...skipping 6009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7802 #undef WRITE_INT64_FIELD | 7802 #undef WRITE_INT64_FIELD |
7803 #undef READ_BYTE_FIELD | 7803 #undef READ_BYTE_FIELD |
7804 #undef WRITE_BYTE_FIELD | 7804 #undef WRITE_BYTE_FIELD |
7805 #undef NOBARRIER_READ_BYTE_FIELD | 7805 #undef NOBARRIER_READ_BYTE_FIELD |
7806 #undef NOBARRIER_WRITE_BYTE_FIELD | 7806 #undef NOBARRIER_WRITE_BYTE_FIELD |
7807 | 7807 |
7808 } // namespace internal | 7808 } // namespace internal |
7809 } // namespace v8 | 7809 } // namespace v8 |
7810 | 7810 |
7811 #endif // V8_OBJECTS_INL_H_ | 7811 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |