OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1828 // represented in a FixedDoubleArray and has at least one value that can only | 1828 // represented in a FixedDoubleArray and has at least one value that can only |
1829 // be represented as a double and not a Smi. | 1829 // be represented as a double and not a Smi. |
1830 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements); | 1830 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements); |
1831 | 1831 |
1832 // Computes the new capacity when expanding the elements of a JSObject. | 1832 // Computes the new capacity when expanding the elements of a JSObject. |
1833 static int NewElementsCapacity(int old_capacity) { | 1833 static int NewElementsCapacity(int old_capacity) { |
1834 // (old_capacity + 50%) + 16 | 1834 // (old_capacity + 50%) + 16 |
1835 return old_capacity + (old_capacity >> 1) + 16; | 1835 return old_capacity + (old_capacity >> 1) + 16; |
1836 } | 1836 } |
1837 | 1837 |
1838 PropertyType GetLocalPropertyType(String* name); | |
1839 PropertyType GetLocalElementType(uint32_t index); | |
1840 AccessorPair* GetLocalPropertyAccessorPair(String* name); | |
1841 AccessorPair* GetLocalElementAccessorPair(uint32_t index); | |
1842 | |
1838 // Tells whether the index'th element is present and how it is stored. | 1843 // Tells whether the index'th element is present and how it is stored. |
1839 enum LocalElementType { | 1844 enum LocalElementKind { |
Michael Starzinger
2012/11/14 17:30:39
As discussed offline, we should try to get rid of
| |
1840 // There is no element with given index. | 1845 // There is no element with given index. |
1841 UNDEFINED_ELEMENT, | 1846 UNDEFINED_ELEMENT, |
1842 | 1847 |
1843 // Element with given index is handled by interceptor. | 1848 // Element with given index is handled by interceptor. |
1844 INTERCEPTED_ELEMENT, | 1849 INTERCEPTED_ELEMENT, |
1845 | 1850 |
1846 // Element with given index is character in string. | 1851 // Element with given index is character in string. |
1847 STRING_CHARACTER_ELEMENT, | 1852 STRING_CHARACTER_ELEMENT, |
1848 | 1853 |
1849 // Element with given index is stored in fast backing store. | 1854 // Element with given index is stored in fast backing store. |
1850 FAST_ELEMENT, | 1855 FAST_ELEMENT, |
1851 | 1856 |
1852 // Element with given index is stored in slow backing store. | 1857 // Element with given index is stored in slow backing store. |
1853 DICTIONARY_ELEMENT | 1858 DICTIONARY_ELEMENT |
1854 }; | 1859 }; |
1855 | 1860 |
1856 LocalElementType GetLocalElementType(uint32_t index); | 1861 LocalElementKind GetLocalElementKind(uint32_t index); |
1857 | 1862 |
1858 MUST_USE_RESULT MaybeObject* SetFastElement(uint32_t index, | 1863 MUST_USE_RESULT MaybeObject* SetFastElement(uint32_t index, |
1859 Object* value, | 1864 Object* value, |
1860 StrictModeFlag strict_mode, | 1865 StrictModeFlag strict_mode, |
1861 bool check_prototype); | 1866 bool check_prototype); |
1862 | 1867 |
1863 MUST_USE_RESULT MaybeObject* SetDictionaryElement( | 1868 MUST_USE_RESULT MaybeObject* SetDictionaryElement( |
1864 uint32_t index, | 1869 uint32_t index, |
1865 Object* value, | 1870 Object* value, |
1866 PropertyAttributes attributes, | 1871 PropertyAttributes attributes, |
(...skipping 7169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9036 } else { | 9041 } else { |
9037 value &= ~(1 << bit_position); | 9042 value &= ~(1 << bit_position); |
9038 } | 9043 } |
9039 return value; | 9044 return value; |
9040 } | 9045 } |
9041 }; | 9046 }; |
9042 | 9047 |
9043 } } // namespace v8::internal | 9048 } } // namespace v8::internal |
9044 | 9049 |
9045 #endif // V8_OBJECTS_H_ | 9050 #endif // V8_OBJECTS_H_ |
OLD | NEW |