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 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1687 Handle<JSReceiver> object, | 1687 Handle<JSReceiver> object, |
1688 KeyCollectionType type); | 1688 KeyCollectionType type); |
1689 | 1689 |
1690 private: | 1690 private: |
1691 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); | 1691 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); |
1692 }; | 1692 }; |
1693 | 1693 |
1694 // Forward declaration for JSObject::GetOrCreateHiddenPropertiesHashTable. | 1694 // Forward declaration for JSObject::GetOrCreateHiddenPropertiesHashTable. |
1695 class ObjectHashTable; | 1695 class ObjectHashTable; |
1696 | 1696 |
1697 // Forward declaration for JSObject::Copy. | |
1698 class AllocationSite; | |
1699 | |
1700 | 1697 |
1701 // The JSObject describes real heap allocated JavaScript objects with | 1698 // The JSObject describes real heap allocated JavaScript objects with |
1702 // properties. | 1699 // properties. |
1703 // Note that the map of JSObject changes during execution to enable inline | 1700 // Note that the map of JSObject changes during execution to enable inline |
1704 // caching. | 1701 // caching. |
1705 class JSObject: public JSReceiver { | 1702 class JSObject: public JSReceiver { |
1706 public: | 1703 public: |
1707 // [properties]: Backing storage for properties. | 1704 // [properties]: Backing storage for properties. |
1708 // properties is a FixedArray in the fast case and a Dictionary in the | 1705 // properties is a FixedArray in the fast case and a Dictionary in the |
1709 // slow case. | 1706 // slow case. |
(...skipping 16 matching lines...) Expand all Loading... | |
1726 // the elements array may be shared by a few objects and so before | 1723 // the elements array may be shared by a few objects and so before |
1727 // writing to any element the array must be copied. Use | 1724 // writing to any element the array must be copied. Use |
1728 // EnsureWritableFastElements in this case. | 1725 // EnsureWritableFastElements in this case. |
1729 // | 1726 // |
1730 // In the slow mode the elements is either a NumberDictionary, an | 1727 // In the slow mode the elements is either a NumberDictionary, an |
1731 // ExternalArray, or a FixedArray parameter map for a (sloppy) | 1728 // ExternalArray, or a FixedArray parameter map for a (sloppy) |
1732 // arguments object. | 1729 // arguments object. |
1733 DECL_ACCESSORS(elements, FixedArrayBase) | 1730 DECL_ACCESSORS(elements, FixedArrayBase) |
1734 inline void initialize_elements(); | 1731 inline void initialize_elements(); |
1735 static void ResetElements(Handle<JSObject> object); | 1732 static void ResetElements(Handle<JSObject> object); |
1733 static void ResetProperties(Handle<JSObject> object); | |
Jakob Kummerow
2015/05/11 15:25:26
I see no implementation and no callers of this.
| |
1736 static inline void SetMapAndElements(Handle<JSObject> object, | 1734 static inline void SetMapAndElements(Handle<JSObject> object, |
1737 Handle<Map> map, | 1735 Handle<Map> map, |
1738 Handle<FixedArrayBase> elements); | 1736 Handle<FixedArrayBase> elements); |
1739 inline ElementsKind GetElementsKind(); | 1737 inline ElementsKind GetElementsKind(); |
1740 inline ElementsAccessor* GetElementsAccessor(); | 1738 inline ElementsAccessor* GetElementsAccessor(); |
1741 // Returns true if an object has elements of FAST_SMI_ELEMENTS ElementsKind. | 1739 // Returns true if an object has elements of FAST_SMI_ELEMENTS ElementsKind. |
1742 inline bool HasFastSmiElements(); | 1740 inline bool HasFastSmiElements(); |
1743 // Returns true if an object has elements of FAST_ELEMENTS ElementsKind. | 1741 // Returns true if an object has elements of FAST_ELEMENTS ElementsKind. |
1744 inline bool HasFastObjectElements(); | 1742 inline bool HasFastObjectElements(); |
1745 // Returns true if an object has elements of FAST_ELEMENTS or | 1743 // Returns true if an object has elements of FAST_ELEMENTS or |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2150 | 2148 |
2151 // ES5 Object.freeze | 2149 // ES5 Object.freeze |
2152 MUST_USE_RESULT static MaybeHandle<Object> Freeze(Handle<JSObject> object); | 2150 MUST_USE_RESULT static MaybeHandle<Object> Freeze(Handle<JSObject> object); |
2153 | 2151 |
2154 // Called the first time an object is observed with ES7 Object.observe. | 2152 // Called the first time an object is observed with ES7 Object.observe. |
2155 static void SetObserved(Handle<JSObject> object); | 2153 static void SetObserved(Handle<JSObject> object); |
2156 | 2154 |
2157 // Copy object. | 2155 // Copy object. |
2158 enum DeepCopyHints { kNoHints = 0, kObjectIsShallow = 1 }; | 2156 enum DeepCopyHints { kNoHints = 0, kObjectIsShallow = 1 }; |
2159 | 2157 |
2160 static Handle<JSObject> Copy(Handle<JSObject> object); | |
2161 MUST_USE_RESULT static MaybeHandle<JSObject> DeepCopy( | 2158 MUST_USE_RESULT static MaybeHandle<JSObject> DeepCopy( |
2162 Handle<JSObject> object, | 2159 Handle<JSObject> object, |
2163 AllocationSiteUsageContext* site_context, | 2160 AllocationSiteUsageContext* site_context, |
2164 DeepCopyHints hints = kNoHints); | 2161 DeepCopyHints hints = kNoHints); |
2165 MUST_USE_RESULT static MaybeHandle<JSObject> DeepWalk( | 2162 MUST_USE_RESULT static MaybeHandle<JSObject> DeepWalk( |
2166 Handle<JSObject> object, | 2163 Handle<JSObject> object, |
2167 AllocationSiteCreationContext* site_context); | 2164 AllocationSiteCreationContext* site_context); |
2168 | 2165 |
2169 static Handle<Object> GetDataProperty(Handle<JSObject> object, | 2166 static Handle<Object> GetDataProperty(Handle<JSObject> object, |
2170 Handle<Name> key); | 2167 Handle<Name> key); |
(...skipping 8930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11101 } else { | 11098 } else { |
11102 value &= ~(1 << bit_position); | 11099 value &= ~(1 << bit_position); |
11103 } | 11100 } |
11104 return value; | 11101 return value; |
11105 } | 11102 } |
11106 }; | 11103 }; |
11107 | 11104 |
11108 } } // namespace v8::internal | 11105 } } // namespace v8::internal |
11109 | 11106 |
11110 #endif // V8_OBJECTS_H_ | 11107 #endif // V8_OBJECTS_H_ |
OLD | NEW |