| 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 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 // Property access. | 966 // Property access. |
| 967 MUST_USE_RESULT inline MaybeObject* GetProperty(String* key); | 967 MUST_USE_RESULT inline MaybeObject* GetProperty(String* key); |
| 968 MUST_USE_RESULT inline MaybeObject* GetProperty( | 968 MUST_USE_RESULT inline MaybeObject* GetProperty( |
| 969 String* key, | 969 String* key, |
| 970 PropertyAttributes* attributes); | 970 PropertyAttributes* attributes); |
| 971 MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver( | 971 MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver( |
| 972 Object* receiver, | 972 Object* receiver, |
| 973 String* key, | 973 String* key, |
| 974 PropertyAttributes* attributes); | 974 PropertyAttributes* attributes); |
| 975 | 975 |
| 976 static Handle<Object> GetProperty(Handle<Object> object, Handle<String> key); |
| 976 static Handle<Object> GetProperty(Handle<Object> object, | 977 static Handle<Object> GetProperty(Handle<Object> object, |
| 977 Handle<Object> receiver, | 978 Handle<Object> receiver, |
| 978 LookupResult* result, | 979 LookupResult* result, |
| 979 Handle<String> key, | 980 Handle<String> key, |
| 980 PropertyAttributes* attributes); | 981 PropertyAttributes* attributes); |
| 981 | 982 |
| 982 MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver, | 983 MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver, |
| 983 LookupResult* result, | 984 LookupResult* result, |
| 984 String* key, | 985 String* key, |
| 985 PropertyAttributes* attributes); | 986 PropertyAttributes* attributes); |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1839 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements); | 1840 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements); |
| 1840 | 1841 |
| 1841 // Computes the new capacity when expanding the elements of a JSObject. | 1842 // Computes the new capacity when expanding the elements of a JSObject. |
| 1842 static int NewElementsCapacity(int old_capacity) { | 1843 static int NewElementsCapacity(int old_capacity) { |
| 1843 // (old_capacity + 50%) + 16 | 1844 // (old_capacity + 50%) + 16 |
| 1844 return old_capacity + (old_capacity >> 1) + 16; | 1845 return old_capacity + (old_capacity >> 1) + 16; |
| 1845 } | 1846 } |
| 1846 | 1847 |
| 1847 PropertyType GetLocalPropertyType(String* name); | 1848 PropertyType GetLocalPropertyType(String* name); |
| 1848 PropertyType GetLocalElementType(uint32_t index); | 1849 PropertyType GetLocalElementType(uint32_t index); |
| 1850 |
| 1851 // These methods do not perform access checks! |
| 1849 AccessorPair* GetLocalPropertyAccessorPair(String* name); | 1852 AccessorPair* GetLocalPropertyAccessorPair(String* name); |
| 1850 AccessorPair* GetLocalElementAccessorPair(uint32_t index); | 1853 AccessorPair* GetLocalElementAccessorPair(uint32_t index); |
| 1851 | 1854 |
| 1852 // Tells whether the index'th element is present and how it is stored. | |
| 1853 enum LocalElementKind { | |
| 1854 // There is no element with given index. | |
| 1855 UNDEFINED_ELEMENT, | |
| 1856 | |
| 1857 // Element with given index is handled by interceptor. | |
| 1858 INTERCEPTED_ELEMENT, | |
| 1859 | |
| 1860 // Element with given index is character in string. | |
| 1861 STRING_CHARACTER_ELEMENT, | |
| 1862 | |
| 1863 // Element with given index is stored in fast backing store. | |
| 1864 FAST_ELEMENT, | |
| 1865 | |
| 1866 // Element with given index is stored in slow backing store. | |
| 1867 DICTIONARY_ELEMENT | |
| 1868 }; | |
| 1869 | |
| 1870 LocalElementKind GetLocalElementKind(uint32_t index); | |
| 1871 | |
| 1872 MUST_USE_RESULT MaybeObject* SetFastElement(uint32_t index, | 1855 MUST_USE_RESULT MaybeObject* SetFastElement(uint32_t index, |
| 1873 Object* value, | 1856 Object* value, |
| 1874 StrictModeFlag strict_mode, | 1857 StrictModeFlag strict_mode, |
| 1875 bool check_prototype); | 1858 bool check_prototype); |
| 1876 | 1859 |
| 1877 MUST_USE_RESULT MaybeObject* SetDictionaryElement( | 1860 MUST_USE_RESULT MaybeObject* SetDictionaryElement( |
| 1878 uint32_t index, | 1861 uint32_t index, |
| 1879 Object* value, | 1862 Object* value, |
| 1880 PropertyAttributes attributes, | 1863 PropertyAttributes attributes, |
| 1881 StrictModeFlag strict_mode, | 1864 StrictModeFlag strict_mode, |
| (...skipping 7136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9018 } else { | 9001 } else { |
| 9019 value &= ~(1 << bit_position); | 9002 value &= ~(1 << bit_position); |
| 9020 } | 9003 } |
| 9021 return value; | 9004 return value; |
| 9022 } | 9005 } |
| 9023 }; | 9006 }; |
| 9024 | 9007 |
| 9025 } } // namespace v8::internal | 9008 } } // namespace v8::internal |
| 9026 | 9009 |
| 9027 #endif // V8_OBJECTS_H_ | 9010 #endif // V8_OBJECTS_H_ |
| OLD | NEW |