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 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 Handle<Object> attributes); | 1880 Handle<Object> attributes); |
1881 MUST_USE_RESULT static Object* DefineProperties(Isolate* isolate, | 1881 MUST_USE_RESULT static Object* DefineProperties(Isolate* isolate, |
1882 Handle<Object> object, | 1882 Handle<Object> object, |
1883 Handle<Object> properties); | 1883 Handle<Object> properties); |
1884 | 1884 |
1885 // "virtual" dispatcher to the correct [[DefineOwnProperty]] implementation. | 1885 // "virtual" dispatcher to the correct [[DefineOwnProperty]] implementation. |
1886 static bool DefineOwnProperty(Isolate* isolate, Handle<JSReceiver> object, | 1886 static bool DefineOwnProperty(Isolate* isolate, Handle<JSReceiver> object, |
1887 Handle<Object> key, PropertyDescriptor* desc, | 1887 Handle<Object> key, PropertyDescriptor* desc, |
1888 ShouldThrow should_throw); | 1888 ShouldThrow should_throw); |
1889 | 1889 |
| 1890 // "virtual" dispatcher to the correct [[CreateDataProperty]] implementation. |
| 1891 MUST_USE_RESULT static Maybe<bool> CreateDataProperty(LookupIterator* it, |
| 1892 Handle<Object> value); |
| 1893 |
1890 static bool OrdinaryDefineOwnProperty(Isolate* isolate, | 1894 static bool OrdinaryDefineOwnProperty(Isolate* isolate, |
1891 Handle<JSObject> object, | 1895 Handle<JSObject> object, |
1892 Handle<Object> key, | 1896 Handle<Object> key, |
1893 PropertyDescriptor* desc, | 1897 PropertyDescriptor* desc, |
1894 ShouldThrow should_throw); | 1898 ShouldThrow should_throw); |
1895 static bool OrdinaryDefineOwnProperty(LookupIterator* it, | 1899 static bool OrdinaryDefineOwnProperty(LookupIterator* it, |
1896 PropertyDescriptor* desc, | 1900 PropertyDescriptor* desc, |
1897 ShouldThrow should_throw); | 1901 ShouldThrow should_throw); |
1898 | 1902 |
1899 static bool GetOwnPropertyDescriptor(Isolate* isolate, | 1903 static bool GetOwnPropertyDescriptor(Isolate* isolate, |
(...skipping 11 matching lines...) Expand all Loading... |
1911 // Tests for the fast common case for property enumeration. | 1915 // Tests for the fast common case for property enumeration. |
1912 bool IsSimpleEnum(); | 1916 bool IsSimpleEnum(); |
1913 | 1917 |
1914 // Returns the class name ([[Class]] property in the specification). | 1918 // Returns the class name ([[Class]] property in the specification). |
1915 String* class_name(); | 1919 String* class_name(); |
1916 | 1920 |
1917 // Returns the constructor name (the name (possibly, inferred name) of the | 1921 // Returns the constructor name (the name (possibly, inferred name) of the |
1918 // function that was used to instantiate the object). | 1922 // function that was used to instantiate the object). |
1919 String* constructor_name(); | 1923 String* constructor_name(); |
1920 | 1924 |
| 1925 Context* GetCreationContext(); |
| 1926 |
1921 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetPropertyAttributes( | 1927 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetPropertyAttributes( |
1922 Handle<JSReceiver> object, Handle<Name> name); | 1928 Handle<JSReceiver> object, Handle<Name> name); |
1923 MUST_USE_RESULT static inline Maybe<PropertyAttributes> | 1929 MUST_USE_RESULT static inline Maybe<PropertyAttributes> |
1924 GetOwnPropertyAttributes(Handle<JSReceiver> object, Handle<Name> name); | 1930 GetOwnPropertyAttributes(Handle<JSReceiver> object, Handle<Name> name); |
1925 | 1931 |
1926 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetElementAttributes( | 1932 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetElementAttributes( |
1927 Handle<JSReceiver> object, uint32_t index); | 1933 Handle<JSReceiver> object, uint32_t index); |
1928 MUST_USE_RESULT static inline Maybe<PropertyAttributes> | 1934 MUST_USE_RESULT static inline Maybe<PropertyAttributes> |
1929 GetOwnElementAttributes(Handle<JSReceiver> object, uint32_t index); | 1935 GetOwnElementAttributes(Handle<JSReceiver> object, uint32_t index); |
1930 | 1936 |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2495 | 2501 |
2496 // Layout description. | 2502 // Layout description. |
2497 static const int kPropertiesOffset = HeapObject::kHeaderSize; | 2503 static const int kPropertiesOffset = HeapObject::kHeaderSize; |
2498 static const int kElementsOffset = kPropertiesOffset + kPointerSize; | 2504 static const int kElementsOffset = kPropertiesOffset + kPointerSize; |
2499 static const int kHeaderSize = kElementsOffset + kPointerSize; | 2505 static const int kHeaderSize = kElementsOffset + kPointerSize; |
2500 | 2506 |
2501 STATIC_ASSERT(kHeaderSize == Internals::kJSObjectHeaderSize); | 2507 STATIC_ASSERT(kHeaderSize == Internals::kJSObjectHeaderSize); |
2502 | 2508 |
2503 typedef FlexibleBodyDescriptor<kPropertiesOffset> BodyDescriptor; | 2509 typedef FlexibleBodyDescriptor<kPropertiesOffset> BodyDescriptor; |
2504 | 2510 |
2505 Context* GetCreationContext(); | |
2506 | |
2507 // Enqueue change record for Object.observe. May cause GC. | 2511 // Enqueue change record for Object.observe. May cause GC. |
2508 MUST_USE_RESULT static MaybeHandle<Object> EnqueueChangeRecord( | 2512 MUST_USE_RESULT static MaybeHandle<Object> EnqueueChangeRecord( |
2509 Handle<JSObject> object, const char* type, Handle<Name> name, | 2513 Handle<JSObject> object, const char* type, Handle<Name> name, |
2510 Handle<Object> old_value); | 2514 Handle<Object> old_value); |
2511 | 2515 |
2512 // Gets the number of currently used elements. | 2516 // Gets the number of currently used elements. |
2513 int GetFastElementsUsage(); | 2517 int GetFastElementsUsage(); |
2514 | 2518 |
2515 // Deletes an existing named property in a normalized object. | 2519 // Deletes an existing named property in a normalized object. |
2516 static void DeleteNormalizedProperty(Handle<JSObject> object, | 2520 static void DeleteNormalizedProperty(Handle<JSObject> object, |
(...skipping 8243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10760 } | 10764 } |
10761 return value; | 10765 return value; |
10762 } | 10766 } |
10763 }; | 10767 }; |
10764 | 10768 |
10765 | 10769 |
10766 } // NOLINT, false-positive due to second-order macros. | 10770 } // NOLINT, false-positive due to second-order macros. |
10767 } // NOLINT, false-positive due to second-order macros. | 10771 } // NOLINT, false-positive due to second-order macros. |
10768 | 10772 |
10769 #endif // V8_OBJECTS_H_ | 10773 #endif // V8_OBJECTS_H_ |
OLD | NEW |