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 2266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2277 static inline int GetHeaderSize(InstanceType instance_type); | 2277 static inline int GetHeaderSize(InstanceType instance_type); |
2278 inline int GetHeaderSize(); | 2278 inline int GetHeaderSize(); |
2279 | 2279 |
2280 static inline int GetInternalFieldCount(Map* map); | 2280 static inline int GetInternalFieldCount(Map* map); |
2281 inline int GetInternalFieldCount(); | 2281 inline int GetInternalFieldCount(); |
2282 inline int GetInternalFieldOffset(int index); | 2282 inline int GetInternalFieldOffset(int index); |
2283 inline Object* GetInternalField(int index); | 2283 inline Object* GetInternalField(int index); |
2284 inline void SetInternalField(int index, Object* value); | 2284 inline void SetInternalField(int index, Object* value); |
2285 inline void SetInternalField(int index, Smi* value); | 2285 inline void SetInternalField(int index, Smi* value); |
2286 | 2286 |
| 2287 void CollectOwnPropertyNames(KeyAccumulator* keys, |
| 2288 PropertyFilter filter = ALL_PROPERTIES); |
| 2289 |
2287 // Returns the number of properties on this object filtering out properties | 2290 // Returns the number of properties on this object filtering out properties |
2288 // with the specified attributes (ignoring interceptors). | 2291 // with the specified attributes (ignoring interceptors). |
2289 // TODO(jkummerow): Deprecated, only used by Object.observe. | 2292 // TODO(jkummerow): Deprecated, only used by Object.observe. |
2290 int NumberOfOwnElements(PropertyFilter filter); | 2293 int NumberOfOwnElements(PropertyFilter filter); |
2291 // Returns the number of elements on this object filtering out elements | 2294 // Returns the number of elements on this object filtering out elements |
2292 // with the specified attributes (ignoring interceptors). | 2295 // with the specified attributes (ignoring interceptors). |
2293 // TODO(jkummerow): Deprecated, only used by Object.observe. | 2296 // TODO(jkummerow): Deprecated, only used by Object.observe. |
2294 int GetOwnElementKeys(FixedArray* storage, PropertyFilter filter); | 2297 int GetOwnElementKeys(FixedArray* storage, PropertyFilter filter); |
2295 | 2298 |
2296 void CollectOwnPropertyKeys( | |
2297 KeyAccumulator* keys, PropertyFilter filter = ALL_PROPERTIES, | |
2298 JSReceiver::KeyCollectionType type = JSReceiver::OWN_ONLY); | |
2299 | |
2300 static void CollectOwnElementKeys(Handle<JSObject> object, | 2299 static void CollectOwnElementKeys(Handle<JSObject> object, |
2301 KeyAccumulator* keys, | 2300 KeyAccumulator* keys, |
2302 PropertyFilter filter); | 2301 PropertyFilter filter); |
2303 static Handle<FixedArray> GetOwnEnumPropertyKeys(Handle<JSObject> object, | 2302 |
2304 bool cache_result); | 2303 static Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object, |
| 2304 bool cache_result); |
2305 | 2305 |
2306 // Returns a new map with all transitions dropped from the object's current | 2306 // Returns a new map with all transitions dropped from the object's current |
2307 // map and the ElementsKind set. | 2307 // map and the ElementsKind set. |
2308 static Handle<Map> GetElementsTransitionMap(Handle<JSObject> object, | 2308 static Handle<Map> GetElementsTransitionMap(Handle<JSObject> object, |
2309 ElementsKind to_kind); | 2309 ElementsKind to_kind); |
2310 static void TransitionElementsKind(Handle<JSObject> object, | 2310 static void TransitionElementsKind(Handle<JSObject> object, |
2311 ElementsKind to_kind); | 2311 ElementsKind to_kind); |
2312 | 2312 |
2313 // Always use this to migrate an object to a new map. | 2313 // Always use this to migrate an object to a new map. |
2314 // |expected_additional_properties| is only used for fast-to-slow transitions | 2314 // |expected_additional_properties| is only used for fast-to-slow transitions |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 // Helper for fast versions of preventExtensions, seal, and freeze. | 2548 // Helper for fast versions of preventExtensions, seal, and freeze. |
2549 // attrs is one of NONE, SEALED, or FROZEN (depending on the operation). | 2549 // attrs is one of NONE, SEALED, or FROZEN (depending on the operation). |
2550 template <PropertyAttributes attrs> | 2550 template <PropertyAttributes attrs> |
2551 MUST_USE_RESULT static Maybe<bool> PreventExtensionsWithTransition( | 2551 MUST_USE_RESULT static Maybe<bool> PreventExtensionsWithTransition( |
2552 Handle<JSObject> object, ShouldThrow should_throw); | 2552 Handle<JSObject> object, ShouldThrow should_throw); |
2553 | 2553 |
2554 MUST_USE_RESULT static Maybe<bool> SetPrototypeUnobserved( | 2554 MUST_USE_RESULT static Maybe<bool> SetPrototypeUnobserved( |
2555 Handle<JSObject> object, Handle<Object> value, bool from_javascript, | 2555 Handle<JSObject> object, Handle<Object> value, bool from_javascript, |
2556 ShouldThrow should_throw); | 2556 ShouldThrow should_throw); |
2557 | 2557 |
2558 void CollectFastPropertyKeysTo(KeyAccumulator* keys, PropertyFilter filter, | |
2559 JSReceiver::KeyCollectionType type); | |
2560 | |
2561 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); | 2558 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); |
2562 }; | 2559 }; |
2563 | 2560 |
2564 | 2561 |
2565 // Common superclass for FixedArrays that allow implementations to share | 2562 // Common superclass for FixedArrays that allow implementations to share |
2566 // common accessors and some code paths. | 2563 // common accessors and some code paths. |
2567 class FixedArrayBase: public HeapObject { | 2564 class FixedArrayBase: public HeapObject { |
2568 public: | 2565 public: |
2569 // [length]: length of the array. | 2566 // [length]: length of the array. |
2570 inline int length() const; | 2567 inline int length() const; |
(...skipping 8162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10733 } | 10730 } |
10734 return value; | 10731 return value; |
10735 } | 10732 } |
10736 }; | 10733 }; |
10737 | 10734 |
10738 | 10735 |
10739 } // NOLINT, false-positive due to second-order macros. | 10736 } // NOLINT, false-positive due to second-order macros. |
10740 } // NOLINT, false-positive due to second-order macros. | 10737 } // NOLINT, false-positive due to second-order macros. |
10741 | 10738 |
10742 #endif // V8_OBJECTS_H_ | 10739 #endif // V8_OBJECTS_H_ |
OLD | NEW |