| 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 2209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2220 | 2220 |
| 2221 // These methods do not perform access checks! | 2221 // These methods do not perform access checks! |
| 2222 static void UpdateAllocationSite(Handle<JSObject> object, | 2222 static void UpdateAllocationSite(Handle<JSObject> object, |
| 2223 ElementsKind to_kind); | 2223 ElementsKind to_kind); |
| 2224 | 2224 |
| 2225 // Lookup interceptors are used for handling properties controlled by host | 2225 // Lookup interceptors are used for handling properties controlled by host |
| 2226 // objects. | 2226 // objects. |
| 2227 inline bool HasNamedInterceptor(); | 2227 inline bool HasNamedInterceptor(); |
| 2228 inline bool HasIndexedInterceptor(); | 2228 inline bool HasIndexedInterceptor(); |
| 2229 | 2229 |
| 2230 // Computes the enumerable keys from interceptors. Used for debug mirrors and | |
| 2231 // by JSReceiver::GetKeys. | |
| 2232 MUST_USE_RESULT static MaybeHandle<JSObject> GetKeysForNamedInterceptor( | |
| 2233 Handle<JSObject> object, | |
| 2234 Handle<JSReceiver> receiver); | |
| 2235 MUST_USE_RESULT static MaybeHandle<JSObject> GetKeysForIndexedInterceptor( | |
| 2236 Handle<JSObject> object, | |
| 2237 Handle<JSReceiver> receiver); | |
| 2238 | |
| 2239 // Support functions for v8 api (needed for correct interceptor behavior). | 2230 // Support functions for v8 api (needed for correct interceptor behavior). |
| 2240 MUST_USE_RESULT static Maybe<bool> HasRealNamedProperty( | 2231 MUST_USE_RESULT static Maybe<bool> HasRealNamedProperty( |
| 2241 Handle<JSObject> object, Handle<Name> name); | 2232 Handle<JSObject> object, Handle<Name> name); |
| 2242 MUST_USE_RESULT static Maybe<bool> HasRealElementProperty( | 2233 MUST_USE_RESULT static Maybe<bool> HasRealElementProperty( |
| 2243 Handle<JSObject> object, uint32_t index); | 2234 Handle<JSObject> object, uint32_t index); |
| 2244 MUST_USE_RESULT static Maybe<bool> HasRealNamedCallbackProperty( | 2235 MUST_USE_RESULT static Maybe<bool> HasRealNamedCallbackProperty( |
| 2245 Handle<JSObject> object, Handle<Name> name); | 2236 Handle<JSObject> object, Handle<Name> name); |
| 2246 | 2237 |
| 2247 // Get the header size for a JSObject. Used to compute the index of | 2238 // Get the header size for a JSObject. Used to compute the index of |
| 2248 // internal fields as well as the number of internal fields. | 2239 // internal fields as well as the number of internal fields. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 2270 // with the specified attributes (ignoring interceptors). | 2261 // with the specified attributes (ignoring interceptors). |
| 2271 int NumberOfOwnElements(PropertyFilter filter); | 2262 int NumberOfOwnElements(PropertyFilter filter); |
| 2272 // Returns the number of enumerable elements (ignoring interceptors). | 2263 // Returns the number of enumerable elements (ignoring interceptors). |
| 2273 int NumberOfEnumElements(); | 2264 int NumberOfEnumElements(); |
| 2274 // Returns the number of elements on this object filtering out elements | 2265 // Returns the number of elements on this object filtering out elements |
| 2275 // with the specified attributes (ignoring interceptors). | 2266 // with the specified attributes (ignoring interceptors). |
| 2276 int GetOwnElementKeys(FixedArray* storage, PropertyFilter filter); | 2267 int GetOwnElementKeys(FixedArray* storage, PropertyFilter filter); |
| 2277 static void CollectOwnElementKeys(Handle<JSObject> object, | 2268 static void CollectOwnElementKeys(Handle<JSObject> object, |
| 2278 KeyAccumulator* keys, | 2269 KeyAccumulator* keys, |
| 2279 PropertyFilter filter); | 2270 PropertyFilter filter); |
| 2280 // Count and fill in the enumerable elements into storage. | |
| 2281 // (storage->length() == NumberOfEnumElements()). | |
| 2282 // If storage is NULL, will count the elements without adding | |
| 2283 // them to any storage. | |
| 2284 // Returns the number of enumerable elements. | |
| 2285 int GetEnumElementKeys(FixedArray* storage); | |
| 2286 | 2271 |
| 2287 static Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object, | 2272 static Handle<FixedArray> GetEnumPropertyKeys(Handle<JSObject> object, |
| 2288 bool cache_result); | 2273 bool cache_result); |
| 2289 | 2274 |
| 2290 // Returns a new map with all transitions dropped from the object's current | 2275 // Returns a new map with all transitions dropped from the object's current |
| 2291 // map and the ElementsKind set. | 2276 // map and the ElementsKind set. |
| 2292 static Handle<Map> GetElementsTransitionMap(Handle<JSObject> object, | 2277 static Handle<Map> GetElementsTransitionMap(Handle<JSObject> object, |
| 2293 ElementsKind to_kind); | 2278 ElementsKind to_kind); |
| 2294 static void TransitionElementsKind(Handle<JSObject> object, | 2279 static void TransitionElementsKind(Handle<JSObject> object, |
| 2295 ElementsKind to_kind); | 2280 ElementsKind to_kind); |
| (...skipping 8421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10717 } | 10702 } |
| 10718 return value; | 10703 return value; |
| 10719 } | 10704 } |
| 10720 }; | 10705 }; |
| 10721 | 10706 |
| 10722 | 10707 |
| 10723 } // NOLINT, false-positive due to second-order macros. | 10708 } // NOLINT, false-positive due to second-order macros. |
| 10724 } // NOLINT, false-positive due to second-order macros. | 10709 } // NOLINT, false-positive due to second-order macros. |
| 10725 | 10710 |
| 10726 #endif // V8_OBJECTS_H_ | 10711 #endif // V8_OBJECTS_H_ |
| OLD | NEW |