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/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 1915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1926 ShouldThrow should_throw); | 1926 ShouldThrow should_throw); |
1927 | 1927 |
1928 | 1928 |
1929 static Handle<Object> GetDataProperty(Handle<JSReceiver> object, | 1929 static Handle<Object> GetDataProperty(Handle<JSReceiver> object, |
1930 Handle<Name> name); | 1930 Handle<Name> name); |
1931 static Handle<Object> GetDataProperty(LookupIterator* it); | 1931 static Handle<Object> GetDataProperty(LookupIterator* it); |
1932 | 1932 |
1933 | 1933 |
1934 // Retrieves a permanent object identity hash code. The undefined value might | 1934 // Retrieves a permanent object identity hash code. The undefined value might |
1935 // be returned in case no hash was created yet. | 1935 // be returned in case no hash was created yet. |
1936 inline Object* GetIdentityHash(); | 1936 static inline Handle<Object> GetIdentityHash(Isolate* isolate, |
| 1937 Handle<JSReceiver> object); |
1937 | 1938 |
1938 // Retrieves a permanent object identity hash code. May create and store a | 1939 // Retrieves a permanent object identity hash code. May create and store a |
1939 // hash code if needed and none exists. | 1940 // hash code if needed and none exists. |
1940 inline static Handle<Smi> GetOrCreateIdentityHash( | 1941 inline static Handle<Smi> GetOrCreateIdentityHash( |
1941 Handle<JSReceiver> object); | 1942 Handle<JSReceiver> object); |
1942 | 1943 |
1943 // ES6 [[OwnPropertyKeys]] (modulo return type) | 1944 // ES6 [[OwnPropertyKeys]] (modulo return type) |
1944 MUST_USE_RESULT static MaybeHandle<FixedArray> OwnPropertyKeys( | 1945 MUST_USE_RESULT static MaybeHandle<FixedArray> OwnPropertyKeys( |
1945 Handle<JSReceiver> object) { | 1946 Handle<JSReceiver> object) { |
1946 return GetKeys(object, OWN_ONLY, ALL_PROPERTIES, CONVERT_TO_STRING); | 1947 return GetKeys(object, OWN_ONLY, ALL_PROPERTIES, CONVERT_TO_STRING); |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2519 // backing store, allocate one. | 2520 // backing store, allocate one. |
2520 static Handle<ObjectHashTable> GetOrCreateHiddenPropertiesHashtable( | 2521 static Handle<ObjectHashTable> GetOrCreateHiddenPropertiesHashtable( |
2521 Handle<JSObject> object); | 2522 Handle<JSObject> object); |
2522 | 2523 |
2523 // Set the hidden property backing store to either a hash table or | 2524 // Set the hidden property backing store to either a hash table or |
2524 // the inline-stored identity hash. | 2525 // the inline-stored identity hash. |
2525 static Handle<Object> SetHiddenPropertiesHashTable( | 2526 static Handle<Object> SetHiddenPropertiesHashTable( |
2526 Handle<JSObject> object, | 2527 Handle<JSObject> object, |
2527 Handle<Object> value); | 2528 Handle<Object> value); |
2528 | 2529 |
2529 MUST_USE_RESULT Object* GetIdentityHash(); | 2530 static Handle<Object> GetIdentityHash(Isolate* isolate, |
| 2531 Handle<JSObject> object); |
2530 | 2532 |
2531 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSObject> object); | 2533 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSObject> object); |
2532 | 2534 |
2533 static Handle<SeededNumberDictionary> GetNormalizedElementDictionary( | 2535 static Handle<SeededNumberDictionary> GetNormalizedElementDictionary( |
2534 Handle<JSObject> object, Handle<FixedArrayBase> elements); | 2536 Handle<JSObject> object, Handle<FixedArrayBase> elements); |
2535 | 2537 |
2536 // Helper for fast versions of preventExtensions, seal, and freeze. | 2538 // Helper for fast versions of preventExtensions, seal, and freeze. |
2537 // attrs is one of NONE, SEALED, or FROZEN (depending on the operation). | 2539 // attrs is one of NONE, SEALED, or FROZEN (depending on the operation). |
2538 template <PropertyAttributes attrs> | 2540 template <PropertyAttributes attrs> |
2539 MUST_USE_RESULT static Maybe<bool> PreventExtensionsWithTransition( | 2541 MUST_USE_RESULT static Maybe<bool> PreventExtensionsWithTransition( |
(...skipping 7254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9794 | 9796 |
9795 // Layout description. | 9797 // Layout description. |
9796 static const int kTargetOffset = JSReceiver::kHeaderSize; | 9798 static const int kTargetOffset = JSReceiver::kHeaderSize; |
9797 static const int kHandlerOffset = kTargetOffset + kPointerSize; | 9799 static const int kHandlerOffset = kTargetOffset + kPointerSize; |
9798 static const int kHashOffset = kHandlerOffset + kPointerSize; | 9800 static const int kHashOffset = kHandlerOffset + kPointerSize; |
9799 static const int kSize = kHashOffset + kPointerSize; | 9801 static const int kSize = kHashOffset + kPointerSize; |
9800 | 9802 |
9801 typedef FixedBodyDescriptor<JSReceiver::kPropertiesOffset, kSize, kSize> | 9803 typedef FixedBodyDescriptor<JSReceiver::kPropertiesOffset, kSize, kSize> |
9802 BodyDescriptor; | 9804 BodyDescriptor; |
9803 | 9805 |
9804 MUST_USE_RESULT Object* GetIdentityHash(); | 9806 static Handle<Object> GetIdentityHash(Isolate* isolate, |
| 9807 Handle<JSProxy> receiver); |
9805 | 9808 |
9806 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSProxy> proxy); | 9809 static Handle<Smi> GetOrCreateIdentityHash(Handle<JSProxy> proxy); |
9807 | 9810 |
9808 static Maybe<bool> SetPrivateProperty(Isolate* isolate, Handle<JSProxy> proxy, | 9811 static Maybe<bool> SetPrivateProperty(Isolate* isolate, Handle<JSProxy> proxy, |
9809 Handle<Symbol> private_name, | 9812 Handle<Symbol> private_name, |
9810 PropertyDescriptor* desc, | 9813 PropertyDescriptor* desc, |
9811 ShouldThrow should_throw); | 9814 ShouldThrow should_throw); |
9812 | 9815 |
9813 private: | 9816 private: |
9814 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); | 9817 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); |
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10868 } | 10871 } |
10869 return value; | 10872 return value; |
10870 } | 10873 } |
10871 }; | 10874 }; |
10872 | 10875 |
10873 | 10876 |
10874 } // NOLINT, false-positive due to second-order macros. | 10877 } // NOLINT, false-positive due to second-order macros. |
10875 } // NOLINT, false-positive due to second-order macros. | 10878 } // NOLINT, false-positive due to second-order macros. |
10876 | 10879 |
10877 #endif // V8_OBJECTS_H_ | 10880 #endif // V8_OBJECTS_H_ |
OLD | NEW |