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 1907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1918 Handle<JSReceiver> object, ShouldThrow should_throw); | 1918 Handle<JSReceiver> object, ShouldThrow should_throw); |
1919 | 1919 |
1920 // Tests for the fast common case for property enumeration. | 1920 // Tests for the fast common case for property enumeration. |
1921 bool IsSimpleEnum(); | 1921 bool IsSimpleEnum(); |
1922 | 1922 |
1923 // Returns the class name ([[Class]] property in the specification). | 1923 // Returns the class name ([[Class]] property in the specification). |
1924 String* class_name(); | 1924 String* class_name(); |
1925 | 1925 |
1926 // Returns the constructor name (the name (possibly, inferred name) of the | 1926 // Returns the constructor name (the name (possibly, inferred name) of the |
1927 // function that was used to instantiate the object). | 1927 // function that was used to instantiate the object). |
1928 String* constructor_name(); | 1928 static Handle<String> GetConstructorName(Handle<JSReceiver> receiver); |
1929 | 1929 |
1930 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetPropertyAttributes( | 1930 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetPropertyAttributes( |
1931 Handle<JSReceiver> object, Handle<Name> name); | 1931 Handle<JSReceiver> object, Handle<Name> name); |
1932 MUST_USE_RESULT static inline Maybe<PropertyAttributes> | 1932 MUST_USE_RESULT static inline Maybe<PropertyAttributes> |
1933 GetOwnPropertyAttributes(Handle<JSReceiver> object, Handle<Name> name); | 1933 GetOwnPropertyAttributes(Handle<JSReceiver> object, Handle<Name> name); |
1934 | 1934 |
1935 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetElementAttributes( | 1935 MUST_USE_RESULT static inline Maybe<PropertyAttributes> GetElementAttributes( |
1936 Handle<JSReceiver> object, uint32_t index); | 1936 Handle<JSReceiver> object, uint32_t index); |
1937 MUST_USE_RESULT static inline Maybe<PropertyAttributes> | 1937 MUST_USE_RESULT static inline Maybe<PropertyAttributes> |
1938 GetOwnElementAttributes(Handle<JSReceiver> object, uint32_t index); | 1938 GetOwnElementAttributes(Handle<JSReceiver> object, uint32_t index); |
(...skipping 3782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5721 Handle<Map> map, int modify_index, StoreMode store_mode, | 5721 Handle<Map> map, int modify_index, StoreMode store_mode, |
5722 PropertyKind kind, PropertyAttributes attributes, const char* reason); | 5722 PropertyKind kind, PropertyAttributes attributes, const char* reason); |
5723 | 5723 |
5724 static Handle<Map> PrepareForDataProperty(Handle<Map> old_map, | 5724 static Handle<Map> PrepareForDataProperty(Handle<Map> old_map, |
5725 int descriptor_number, | 5725 int descriptor_number, |
5726 Handle<Object> value); | 5726 Handle<Object> value); |
5727 | 5727 |
5728 static Handle<Map> Normalize(Handle<Map> map, PropertyNormalizationMode mode, | 5728 static Handle<Map> Normalize(Handle<Map> map, PropertyNormalizationMode mode, |
5729 const char* reason); | 5729 const char* reason); |
5730 | 5730 |
5731 // Returns the constructor name (the name (possibly, inferred name) of the | |
5732 // function that was used to instantiate the object). | |
5733 String* constructor_name(); | |
5734 | |
5735 // Tells whether the map is used for JSObjects in dictionary mode (ie | 5731 // Tells whether the map is used for JSObjects in dictionary mode (ie |
5736 // normalized objects, ie objects for which HasFastProperties returns false). | 5732 // normalized objects, ie objects for which HasFastProperties returns false). |
5737 // A map can never be used for both dictionary mode and fast mode JSObjects. | 5733 // A map can never be used for both dictionary mode and fast mode JSObjects. |
5738 // False by default and for HeapObjects that are not JSObjects. | 5734 // False by default and for HeapObjects that are not JSObjects. |
5739 inline void set_dictionary_map(bool value); | 5735 inline void set_dictionary_map(bool value); |
5740 inline bool is_dictionary_map(); | 5736 inline bool is_dictionary_map(); |
5741 | 5737 |
5742 // Tells whether the instance needs security checks when accessing its | 5738 // Tells whether the instance needs security checks when accessing its |
5743 // properties. | 5739 // properties. |
5744 inline void set_is_access_check_needed(bool access_check_needed); | 5740 inline void set_is_access_check_needed(bool access_check_needed); |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6228 // is stored. Returns UNREGISTERED if this prototype has not been registered. | 6224 // is stored. Returns UNREGISTERED if this prototype has not been registered. |
6229 inline int registry_slot() const; | 6225 inline int registry_slot() const; |
6230 inline void set_registry_slot(int slot); | 6226 inline void set_registry_slot(int slot); |
6231 // [validity_cell]: Cell containing the validity bit for prototype chains | 6227 // [validity_cell]: Cell containing the validity bit for prototype chains |
6232 // going through this object, or Smi(0) if uninitialized. | 6228 // going through this object, or Smi(0) if uninitialized. |
6233 // When a prototype object changes its map, then both its own validity cell | 6229 // When a prototype object changes its map, then both its own validity cell |
6234 // and those of all "downstream" prototypes are invalidated; handlers for a | 6230 // and those of all "downstream" prototypes are invalidated; handlers for a |
6235 // given receiver embed the currently valid cell for that receiver's prototype | 6231 // given receiver embed the currently valid cell for that receiver's prototype |
6236 // during their compilation and check it on execution. | 6232 // during their compilation and check it on execution. |
6237 DECL_ACCESSORS(validity_cell, Object) | 6233 DECL_ACCESSORS(validity_cell, Object) |
6238 // [constructor_name]: User-friendly name of the original constructor. | |
6239 DECL_ACCESSORS(constructor_name, Object) | |
6240 | 6234 |
6241 DECLARE_CAST(PrototypeInfo) | 6235 DECLARE_CAST(PrototypeInfo) |
6242 | 6236 |
6243 // Dispatched behavior. | 6237 // Dispatched behavior. |
6244 DECLARE_PRINTER(PrototypeInfo) | 6238 DECLARE_PRINTER(PrototypeInfo) |
6245 DECLARE_VERIFIER(PrototypeInfo) | 6239 DECLARE_VERIFIER(PrototypeInfo) |
6246 | 6240 |
6247 static const int kPrototypeUsersOffset = HeapObject::kHeaderSize; | 6241 static const int kPrototypeUsersOffset = HeapObject::kHeaderSize; |
6248 static const int kRegistrySlotOffset = kPrototypeUsersOffset + kPointerSize; | 6242 static const int kRegistrySlotOffset = kPrototypeUsersOffset + kPointerSize; |
6249 static const int kValidityCellOffset = kRegistrySlotOffset + kPointerSize; | 6243 static const int kValidityCellOffset = kRegistrySlotOffset + kPointerSize; |
(...skipping 4538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10788 } | 10782 } |
10789 return value; | 10783 return value; |
10790 } | 10784 } |
10791 }; | 10785 }; |
10792 | 10786 |
10793 | 10787 |
10794 } // NOLINT, false-positive due to second-order macros. | 10788 } // NOLINT, false-positive due to second-order macros. |
10795 } // NOLINT, false-positive due to second-order macros. | 10789 } // NOLINT, false-positive due to second-order macros. |
10796 | 10790 |
10797 #endif // V8_OBJECTS_H_ | 10791 #endif // V8_OBJECTS_H_ |
OLD | NEW |