| 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 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1842 if (double_array->is_the_hole(i)) { | 1842 if (double_array->is_the_hole(i)) { |
| 1843 TransitionElementsKind(object, FAST_HOLEY_DOUBLE_ELEMENTS); | 1843 TransitionElementsKind(object, FAST_HOLEY_DOUBLE_ELEMENTS); |
| 1844 return; | 1844 return; |
| 1845 } | 1845 } |
| 1846 } | 1846 } |
| 1847 TransitionElementsKind(object, FAST_DOUBLE_ELEMENTS); | 1847 TransitionElementsKind(object, FAST_DOUBLE_ELEMENTS); |
| 1848 } | 1848 } |
| 1849 } | 1849 } |
| 1850 | 1850 |
| 1851 | 1851 |
| 1852 bool JSObject::WouldConvertToSlowElements(Handle<Object> key) { |
| 1853 uint32_t index; |
| 1854 return key->ToArrayIndex(&index) && WouldConvertToSlowElements(index); |
| 1855 } |
| 1856 |
| 1857 |
| 1852 void JSObject::SetMapAndElements(Handle<JSObject> object, | 1858 void JSObject::SetMapAndElements(Handle<JSObject> object, |
| 1853 Handle<Map> new_map, | 1859 Handle<Map> new_map, |
| 1854 Handle<FixedArrayBase> value) { | 1860 Handle<FixedArrayBase> value) { |
| 1855 JSObject::MigrateToMap(object, new_map); | 1861 JSObject::MigrateToMap(object, new_map); |
| 1856 DCHECK((object->map()->has_fast_smi_or_object_elements() || | 1862 DCHECK((object->map()->has_fast_smi_or_object_elements() || |
| 1857 (*value == object->GetHeap()->empty_fixed_array())) == | 1863 (*value == object->GetHeap()->empty_fixed_array())) == |
| 1858 (value->map() == object->GetHeap()->fixed_array_map() || | 1864 (value->map() == object->GetHeap()->fixed_array_map() || |
| 1859 value->map() == object->GetHeap()->fixed_cow_array_map())); | 1865 value->map() == object->GetHeap()->fixed_cow_array_map())); |
| 1860 DCHECK((*value == object->GetHeap()->empty_fixed_array()) || | 1866 DCHECK((*value == object->GetHeap()->empty_fixed_array()) || |
| 1861 (object->map()->has_fast_double_elements() == | 1867 (object->map()->has_fast_double_elements() == |
| (...skipping 5743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7605 #undef READ_SHORT_FIELD | 7611 #undef READ_SHORT_FIELD |
| 7606 #undef WRITE_SHORT_FIELD | 7612 #undef WRITE_SHORT_FIELD |
| 7607 #undef READ_BYTE_FIELD | 7613 #undef READ_BYTE_FIELD |
| 7608 #undef WRITE_BYTE_FIELD | 7614 #undef WRITE_BYTE_FIELD |
| 7609 #undef NOBARRIER_READ_BYTE_FIELD | 7615 #undef NOBARRIER_READ_BYTE_FIELD |
| 7610 #undef NOBARRIER_WRITE_BYTE_FIELD | 7616 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7611 | 7617 |
| 7612 } } // namespace v8::internal | 7618 } } // namespace v8::internal |
| 7613 | 7619 |
| 7614 #endif // V8_OBJECTS_INL_H_ | 7620 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |