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 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1832 if (double_array->is_the_hole(i)) { | 1832 if (double_array->is_the_hole(i)) { |
1833 TransitionElementsKind(object, FAST_HOLEY_DOUBLE_ELEMENTS); | 1833 TransitionElementsKind(object, FAST_HOLEY_DOUBLE_ELEMENTS); |
1834 return; | 1834 return; |
1835 } | 1835 } |
1836 } | 1836 } |
1837 TransitionElementsKind(object, FAST_DOUBLE_ELEMENTS); | 1837 TransitionElementsKind(object, FAST_DOUBLE_ELEMENTS); |
1838 } | 1838 } |
1839 } | 1839 } |
1840 | 1840 |
1841 | 1841 |
1842 bool JSObject::WouldConvertToSlowElements(Handle<Object> key) { | |
1843 uint32_t index; | |
1844 return key->ToArrayIndex(&index) && WouldConvertToSlowElements(index); | |
1845 } | |
1846 | |
1847 | |
1848 void JSObject::SetMapAndElements(Handle<JSObject> object, | 1842 void JSObject::SetMapAndElements(Handle<JSObject> object, |
1849 Handle<Map> new_map, | 1843 Handle<Map> new_map, |
1850 Handle<FixedArrayBase> value) { | 1844 Handle<FixedArrayBase> value) { |
1851 JSObject::MigrateToMap(object, new_map); | 1845 JSObject::MigrateToMap(object, new_map); |
1852 DCHECK((object->map()->has_fast_smi_or_object_elements() || | 1846 DCHECK((object->map()->has_fast_smi_or_object_elements() || |
1853 (*value == object->GetHeap()->empty_fixed_array())) == | 1847 (*value == object->GetHeap()->empty_fixed_array())) == |
1854 (value->map() == object->GetHeap()->fixed_array_map() || | 1848 (value->map() == object->GetHeap()->fixed_array_map() || |
1855 value->map() == object->GetHeap()->fixed_cow_array_map())); | 1849 value->map() == object->GetHeap()->fixed_cow_array_map())); |
1856 DCHECK((*value == object->GetHeap()->empty_fixed_array()) || | 1850 DCHECK((*value == object->GetHeap()->empty_fixed_array()) || |
1857 (object->map()->has_fast_double_elements() == | 1851 (object->map()->has_fast_double_elements() == |
(...skipping 5573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7431 #undef READ_SHORT_FIELD | 7425 #undef READ_SHORT_FIELD |
7432 #undef WRITE_SHORT_FIELD | 7426 #undef WRITE_SHORT_FIELD |
7433 #undef READ_BYTE_FIELD | 7427 #undef READ_BYTE_FIELD |
7434 #undef WRITE_BYTE_FIELD | 7428 #undef WRITE_BYTE_FIELD |
7435 #undef NOBARRIER_READ_BYTE_FIELD | 7429 #undef NOBARRIER_READ_BYTE_FIELD |
7436 #undef NOBARRIER_WRITE_BYTE_FIELD | 7430 #undef NOBARRIER_WRITE_BYTE_FIELD |
7437 | 7431 |
7438 } } // namespace v8::internal | 7432 } } // namespace v8::internal |
7439 | 7433 |
7440 #endif // V8_OBJECTS_INL_H_ | 7434 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |