| 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 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2260 // pre_allocated_value and the rest with filler_value. | 2260 // pre_allocated_value and the rest with filler_value. |
| 2261 // Note: this call does not update write barrier, the caller is responsible | 2261 // Note: this call does not update write barrier, the caller is responsible |
| 2262 // to ensure that |filler_value| can be collected without WB here. | 2262 // to ensure that |filler_value| can be collected without WB here. |
| 2263 inline void InitializeBody(Map* map, | 2263 inline void InitializeBody(Map* map, |
| 2264 Object* pre_allocated_value, | 2264 Object* pre_allocated_value, |
| 2265 Object* filler_value); | 2265 Object* filler_value); |
| 2266 | 2266 |
| 2267 // Check whether this object references another object | 2267 // Check whether this object references another object |
| 2268 bool ReferencesObject(Object* obj); | 2268 bool ReferencesObject(Object* obj); |
| 2269 | 2269 |
| 2270 // Disalow further properties to be added to the oject. | 2270 // Disallow further properties to be added to the oject. |
| 2271 MUST_USE_RESULT static Maybe<bool> PreventExtensionsInternal( |
| 2272 Handle<JSObject> object); // ES [[PreventExtensions]] |
| 2271 MUST_USE_RESULT static MaybeHandle<Object> PreventExtensions( | 2273 MUST_USE_RESULT static MaybeHandle<Object> PreventExtensions( |
| 2272 Handle<JSObject> object); | 2274 Handle<JSObject> object); // ES Object.preventExtensions |
| 2273 | 2275 |
| 2274 static bool IsExtensible(Handle<JSObject> object); | 2276 static bool IsExtensible(Handle<JSObject> object); |
| 2275 | 2277 |
| 2276 // ES5 Object.seal | 2278 // ES5 Object.seal |
| 2277 MUST_USE_RESULT static MaybeHandle<Object> Seal(Handle<JSObject> object); | 2279 MUST_USE_RESULT static MaybeHandle<Object> Seal(Handle<JSObject> object); |
| 2278 | 2280 |
| 2279 // ES5 Object.freeze | 2281 // ES5 Object.freeze |
| 2280 MUST_USE_RESULT static MaybeHandle<Object> Freeze(Handle<JSObject> object); | 2282 MUST_USE_RESULT static MaybeHandle<Object> Freeze(Handle<JSObject> object); |
| 2281 | 2283 |
| 2282 // Called the first time an object is observed with ES7 Object.observe. | 2284 // Called the first time an object is observed with ES7 Object.observe. |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2454 MUST_USE_RESULT Object* GetIdentityHash(); | 2456 MUST_USE_RESULT Object* GetIdentityHash(); |
| 2455 | 2457 |
| 2456 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSObject> object); | 2458 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSObject> object); |
| 2457 | 2459 |
| 2458 static Handle<SeededNumberDictionary> GetNormalizedElementDictionary( | 2460 static Handle<SeededNumberDictionary> GetNormalizedElementDictionary( |
| 2459 Handle<JSObject> object, Handle<FixedArrayBase> elements); | 2461 Handle<JSObject> object, Handle<FixedArrayBase> elements); |
| 2460 | 2462 |
| 2461 // Helper for fast versions of preventExtensions, seal, and freeze. | 2463 // Helper for fast versions of preventExtensions, seal, and freeze. |
| 2462 // attrs is one of NONE, SEALED, or FROZEN (depending on the operation). | 2464 // attrs is one of NONE, SEALED, or FROZEN (depending on the operation). |
| 2463 template <PropertyAttributes attrs> | 2465 template <PropertyAttributes attrs> |
| 2464 MUST_USE_RESULT static MaybeHandle<Object> PreventExtensionsWithTransition( | 2466 MUST_USE_RESULT static Maybe<bool> PreventExtensionsWithTransition( |
| 2465 Handle<JSObject> object); | 2467 Handle<JSObject> object); |
| 2466 | 2468 |
| 2467 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); | 2469 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); |
| 2468 }; | 2470 }; |
| 2469 | 2471 |
| 2470 | 2472 |
| 2471 // Common superclass for FixedArrays that allow implementations to share | 2473 // Common superclass for FixedArrays that allow implementations to share |
| 2472 // common accessors and some code paths. | 2474 // common accessors and some code paths. |
| 2473 class FixedArrayBase: public HeapObject { | 2475 class FixedArrayBase: public HeapObject { |
| 2474 public: | 2476 public: |
| (...skipping 8187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10662 Handle<FixedArray> keys_; | 10664 Handle<FixedArray> keys_; |
| 10663 Handle<OrderedHashSet> set_; | 10665 Handle<OrderedHashSet> set_; |
| 10664 int length_; | 10666 int length_; |
| 10665 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); | 10667 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
| 10666 }; | 10668 }; |
| 10667 | 10669 |
| 10668 } // NOLINT, false-positive due to second-order macros. | 10670 } // NOLINT, false-positive due to second-order macros. |
| 10669 } // NOLINT, false-positive due to second-order macros. | 10671 } // NOLINT, false-positive due to second-order macros. |
| 10670 | 10672 |
| 10671 #endif // V8_OBJECTS_H_ | 10673 #endif // V8_OBJECTS_H_ |
| OLD | NEW |