| 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1826 Handle<Object> attributes); | 1826 Handle<Object> attributes); |
| 1827 MUST_USE_RESULT static Object* DefineProperties(Isolate* isolate, | 1827 MUST_USE_RESULT static Object* DefineProperties(Isolate* isolate, |
| 1828 Handle<Object> object, | 1828 Handle<Object> object, |
| 1829 Handle<Object> properties); | 1829 Handle<Object> properties); |
| 1830 | 1830 |
| 1831 // "virtual" dispatcher to the correct [[DefineOwnProperty]] implementation. | 1831 // "virtual" dispatcher to the correct [[DefineOwnProperty]] implementation. |
| 1832 static bool DefineOwnProperty(Isolate* isolate, Handle<JSReceiver> object, | 1832 static bool DefineOwnProperty(Isolate* isolate, Handle<JSReceiver> object, |
| 1833 Handle<Object> key, PropertyDescriptor* desc, | 1833 Handle<Object> key, PropertyDescriptor* desc, |
| 1834 ShouldThrow should_throw); | 1834 ShouldThrow should_throw); |
| 1835 | 1835 |
| 1836 // "virtual" dispatcher to the correct [[CreateDataProperty]] implementation. |
| 1837 MUST_USE_RESULT static Maybe<bool> CreateDataProperty(LookupIterator* it, |
| 1838 Handle<Object> value); |
| 1839 |
| 1836 // ES6 9.1.6.1 | 1840 // ES6 9.1.6.1 |
| 1837 static bool OrdinaryDefineOwnProperty(Isolate* isolate, | 1841 static bool OrdinaryDefineOwnProperty(Isolate* isolate, |
| 1838 Handle<JSObject> object, | 1842 Handle<JSObject> object, |
| 1839 Handle<Object> key, | 1843 Handle<Object> key, |
| 1840 PropertyDescriptor* desc, | 1844 PropertyDescriptor* desc, |
| 1841 ShouldThrow should_throw); | 1845 ShouldThrow should_throw); |
| 1842 static bool OrdinaryDefineOwnProperty(LookupIterator* it, | 1846 static bool OrdinaryDefineOwnProperty(LookupIterator* it, |
| 1843 PropertyDescriptor* desc, | 1847 PropertyDescriptor* desc, |
| 1844 ShouldThrow should_throw); | 1848 ShouldThrow should_throw); |
| 1845 // ES6 9.1.6.2 | 1849 // ES6 9.1.6.2 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1872 // Tests for the fast common case for property enumeration. | 1876 // Tests for the fast common case for property enumeration. |
| 1873 bool IsSimpleEnum(); | 1877 bool IsSimpleEnum(); |
| 1874 | 1878 |
| 1875 // Returns the class name ([[Class]] property in the specification). | 1879 // Returns the class name ([[Class]] property in the specification). |
| 1876 String* class_name(); | 1880 String* class_name(); |
| 1877 | 1881 |
| 1878 // Returns the constructor name (the name (possibly, inferred name) of the | 1882 // Returns the constructor name (the name (possibly, inferred name) of the |
| 1879 // function that was used to instantiate the object). | 1883 // function that was used to instantiate the object). |
| 1880 String* constructor_name(); | 1884 String* constructor_name(); |
| 1881 | 1885 |
| 1886 Context* GetCreationContext(); |
| 1887 |
| 1882 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetPropertyAttributes( | 1888 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetPropertyAttributes( |
| 1883 Handle<JSReceiver> object, Handle<Name> name); | 1889 Handle<JSReceiver> object, Handle<Name> name); |
| 1884 MUST_USE_RESULT static inline Maybe<PropertyAttributes> | 1890 MUST_USE_RESULT static inline Maybe<PropertyAttributes> |
| 1885 GetOwnPropertyAttributes(Handle<JSReceiver> object, Handle<Name> name); | 1891 GetOwnPropertyAttributes(Handle<JSReceiver> object, Handle<Name> name); |
| 1886 | 1892 |
| 1887 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetElementAttributes( | 1893 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetElementAttributes( |
| 1888 Handle<JSReceiver> object, uint32_t index); | 1894 Handle<JSReceiver> object, uint32_t index); |
| 1889 MUST_USE_RESULT static inline Maybe<PropertyAttributes> | 1895 MUST_USE_RESULT static inline Maybe<PropertyAttributes> |
| 1890 GetOwnElementAttributes(Handle<JSReceiver> object, uint32_t index); | 1896 GetOwnElementAttributes(Handle<JSReceiver> object, uint32_t index); |
| 1891 | 1897 |
| (...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2456 | 2462 |
| 2457 // Layout description. | 2463 // Layout description. |
| 2458 static const int kPropertiesOffset = HeapObject::kHeaderSize; | 2464 static const int kPropertiesOffset = HeapObject::kHeaderSize; |
| 2459 static const int kElementsOffset = kPropertiesOffset + kPointerSize; | 2465 static const int kElementsOffset = kPropertiesOffset + kPointerSize; |
| 2460 static const int kHeaderSize = kElementsOffset + kPointerSize; | 2466 static const int kHeaderSize = kElementsOffset + kPointerSize; |
| 2461 | 2467 |
| 2462 STATIC_ASSERT(kHeaderSize == Internals::kJSObjectHeaderSize); | 2468 STATIC_ASSERT(kHeaderSize == Internals::kJSObjectHeaderSize); |
| 2463 | 2469 |
| 2464 typedef FlexibleBodyDescriptor<kPropertiesOffset> BodyDescriptor; | 2470 typedef FlexibleBodyDescriptor<kPropertiesOffset> BodyDescriptor; |
| 2465 | 2471 |
| 2466 Context* GetCreationContext(); | |
| 2467 | |
| 2468 // Enqueue change record for Object.observe. May cause GC. | 2472 // Enqueue change record for Object.observe. May cause GC. |
| 2469 MUST_USE_RESULT static MaybeHandle<Object> EnqueueChangeRecord( | 2473 MUST_USE_RESULT static MaybeHandle<Object> EnqueueChangeRecord( |
| 2470 Handle<JSObject> object, const char* type, Handle<Name> name, | 2474 Handle<JSObject> object, const char* type, Handle<Name> name, |
| 2471 Handle<Object> old_value); | 2475 Handle<Object> old_value); |
| 2472 | 2476 |
| 2473 // Gets the number of currently used elements. | 2477 // Gets the number of currently used elements. |
| 2474 int GetFastElementsUsage(); | 2478 int GetFastElementsUsage(); |
| 2475 | 2479 |
| 2476 // Deletes an existing named property in a normalized object. | 2480 // Deletes an existing named property in a normalized object. |
| 2477 static void DeleteNormalizedProperty(Handle<JSObject> object, | 2481 static void DeleteNormalizedProperty(Handle<JSObject> object, |
| (...skipping 8224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10702 } | 10706 } |
| 10703 return value; | 10707 return value; |
| 10704 } | 10708 } |
| 10705 }; | 10709 }; |
| 10706 | 10710 |
| 10707 | 10711 |
| 10708 } // NOLINT, false-positive due to second-order macros. | 10712 } // NOLINT, false-positive due to second-order macros. |
| 10709 } // NOLINT, false-positive due to second-order macros. | 10713 } // NOLINT, false-positive due to second-order macros. |
| 10710 | 10714 |
| 10711 #endif // V8_OBJECTS_H_ | 10715 #endif // V8_OBJECTS_H_ |
| OLD | NEW |