OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 public: | 1804 public: |
1805 // [properties]: Backing storage for properties. | 1805 // [properties]: Backing storage for properties. |
1806 // properties is a FixedArray in the fast case and a Dictionary in the | 1806 // properties is a FixedArray in the fast case and a Dictionary in the |
1807 // slow case. | 1807 // slow case. |
1808 DECL_ACCESSORS(properties, FixedArray) // Get and set fast properties. | 1808 DECL_ACCESSORS(properties, FixedArray) // Get and set fast properties. |
1809 inline void initialize_properties(); | 1809 inline void initialize_properties(); |
1810 inline bool HasFastProperties(); | 1810 inline bool HasFastProperties(); |
1811 // Gets slow properties for non-global objects. | 1811 // Gets slow properties for non-global objects. |
1812 inline NameDictionary* property_dictionary(); | 1812 inline NameDictionary* property_dictionary(); |
1813 | 1813 |
| 1814 // Deletes an existing named property in a normalized object. |
| 1815 static void DeleteNormalizedProperty(Handle<JSReceiver> object, |
| 1816 Handle<Name> name, int entry); |
| 1817 |
1814 DECLARE_CAST(JSReceiver) | 1818 DECLARE_CAST(JSReceiver) |
1815 | 1819 |
1816 // ES6 section 7.1.1 ToPrimitive | 1820 // ES6 section 7.1.1 ToPrimitive |
1817 MUST_USE_RESULT static MaybeHandle<Object> ToPrimitive( | 1821 MUST_USE_RESULT static MaybeHandle<Object> ToPrimitive( |
1818 Handle<JSReceiver> receiver, | 1822 Handle<JSReceiver> receiver, |
1819 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); | 1823 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); |
1820 MUST_USE_RESULT static MaybeHandle<Object> OrdinaryToPrimitive( | 1824 MUST_USE_RESULT static MaybeHandle<Object> OrdinaryToPrimitive( |
1821 Handle<JSReceiver> receiver, OrdinaryToPrimitiveHint hint); | 1825 Handle<JSReceiver> receiver, OrdinaryToPrimitiveHint hint); |
1822 | 1826 |
1823 static MaybeHandle<Context> GetFunctionRealm(Handle<JSReceiver> receiver); | 1827 static MaybeHandle<Context> GetFunctionRealm(Handle<JSReceiver> receiver); |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2487 typedef FlexibleBodyDescriptor<JSReceiver::kPropertiesOffset> BodyDescriptor; | 2491 typedef FlexibleBodyDescriptor<JSReceiver::kPropertiesOffset> BodyDescriptor; |
2488 | 2492 |
2489 // Enqueue change record for Object.observe. May cause GC. | 2493 // Enqueue change record for Object.observe. May cause GC. |
2490 MUST_USE_RESULT static MaybeHandle<Object> EnqueueChangeRecord( | 2494 MUST_USE_RESULT static MaybeHandle<Object> EnqueueChangeRecord( |
2491 Handle<JSObject> object, const char* type, Handle<Name> name, | 2495 Handle<JSObject> object, const char* type, Handle<Name> name, |
2492 Handle<Object> old_value); | 2496 Handle<Object> old_value); |
2493 | 2497 |
2494 // Gets the number of currently used elements. | 2498 // Gets the number of currently used elements. |
2495 int GetFastElementsUsage(); | 2499 int GetFastElementsUsage(); |
2496 | 2500 |
2497 // Deletes an existing named property in a normalized object. | |
2498 static void DeleteNormalizedProperty(Handle<JSObject> object, | |
2499 Handle<Name> name, int entry); | |
2500 | |
2501 static bool AllCanRead(LookupIterator* it); | 2501 static bool AllCanRead(LookupIterator* it); |
2502 static bool AllCanWrite(LookupIterator* it); | 2502 static bool AllCanWrite(LookupIterator* it); |
2503 | 2503 |
2504 private: | 2504 private: |
2505 friend class JSReceiver; | 2505 friend class JSReceiver; |
2506 friend class Object; | 2506 friend class Object; |
2507 | 2507 |
2508 static void MigrateFastToFast(Handle<JSObject> object, Handle<Map> new_map); | 2508 static void MigrateFastToFast(Handle<JSObject> object, Handle<Map> new_map); |
2509 static void MigrateFastToSlow(Handle<JSObject> object, | 2509 static void MigrateFastToSlow(Handle<JSObject> object, |
2510 Handle<Map> new_map, | 2510 Handle<Map> new_map, |
(...skipping 7131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9642 static const int kSize = kHashOffset + kPointerSize; | 9642 static const int kSize = kHashOffset + kPointerSize; |
9643 | 9643 |
9644 typedef FixedBodyDescriptor<JSReceiver::kPropertiesOffset, kSize, kSize> | 9644 typedef FixedBodyDescriptor<JSReceiver::kPropertiesOffset, kSize, kSize> |
9645 BodyDescriptor; | 9645 BodyDescriptor; |
9646 | 9646 |
9647 MUST_USE_RESULT Object* GetIdentityHash(); | 9647 MUST_USE_RESULT Object* GetIdentityHash(); |
9648 | 9648 |
9649 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSProxy> proxy); | 9649 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSProxy> proxy); |
9650 | 9650 |
9651 private: | 9651 private: |
| 9652 static Maybe<bool> AddPrivateProperty(Isolate* isolate, Handle<JSProxy> proxy, |
| 9653 Handle<Symbol> private_name, |
| 9654 PropertyDescriptor* desc, |
| 9655 ShouldThrow should_throw); |
| 9656 |
9652 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); | 9657 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); |
9653 }; | 9658 }; |
9654 | 9659 |
9655 | 9660 |
9656 class JSCollection : public JSObject { | 9661 class JSCollection : public JSObject { |
9657 public: | 9662 public: |
9658 // [table]: the backing hash table | 9663 // [table]: the backing hash table |
9659 DECL_ACCESSORS(table, Object) | 9664 DECL_ACCESSORS(table, Object) |
9660 | 9665 |
9661 static const int kTableOffset = JSObject::kHeaderSize; | 9666 static const int kTableOffset = JSObject::kHeaderSize; |
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10750 } | 10755 } |
10751 return value; | 10756 return value; |
10752 } | 10757 } |
10753 }; | 10758 }; |
10754 | 10759 |
10755 | 10760 |
10756 } // NOLINT, false-positive due to second-order macros. | 10761 } // NOLINT, false-positive due to second-order macros. |
10757 } // NOLINT, false-positive due to second-order macros. | 10762 } // NOLINT, false-positive due to second-order macros. |
10758 | 10763 |
10759 #endif // V8_OBJECTS_H_ | 10764 #endif // V8_OBJECTS_H_ |
OLD | NEW |