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 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1968 // be returned in case no hash was created yet. | 1968 // be returned in case no hash was created yet. |
1969 static inline Handle<Object> GetIdentityHash(Isolate* isolate, | 1969 static inline Handle<Object> GetIdentityHash(Isolate* isolate, |
1970 Handle<JSReceiver> object); | 1970 Handle<JSReceiver> object); |
1971 | 1971 |
1972 // Retrieves a permanent object identity hash code. May create and store a | 1972 // Retrieves a permanent object identity hash code. May create and store a |
1973 // hash code if needed and none exists. | 1973 // hash code if needed and none exists. |
1974 inline static Handle<Smi> GetOrCreateIdentityHash( | 1974 inline static Handle<Smi> GetOrCreateIdentityHash( |
1975 Handle<JSReceiver> object); | 1975 Handle<JSReceiver> object); |
1976 | 1976 |
1977 // ES6 [[OwnPropertyKeys]] (modulo return type) | 1977 // ES6 [[OwnPropertyKeys]] (modulo return type) |
1978 MUST_USE_RESULT static inline MaybeHandle<FixedArray> OwnPropertyKeys( | 1978 MUST_USE_RESULT static MaybeHandle<FixedArray> OwnPropertyKeys( |
1979 Handle<JSReceiver> object); | 1979 Handle<JSReceiver> object) { |
| 1980 return GetKeys(object, OWN_ONLY, ALL_PROPERTIES, CONVERT_TO_STRING); |
| 1981 } |
| 1982 |
| 1983 // Computes the enumerable keys for a JSObject. Used for implementing |
| 1984 // "for (n in object) { }". |
| 1985 MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys( |
| 1986 Handle<JSReceiver> object, KeyCollectionType type, PropertyFilter filter, |
| 1987 GetKeysConversion keys_conversion = KEEP_NUMBERS, |
| 1988 bool filter_proxy_keys_ = true); |
1980 | 1989 |
1981 MUST_USE_RESULT static MaybeHandle<FixedArray> GetOwnValues( | 1990 MUST_USE_RESULT static MaybeHandle<FixedArray> GetOwnValues( |
1982 Handle<JSReceiver> object, PropertyFilter filter); | 1991 Handle<JSReceiver> object, PropertyFilter filter); |
1983 | 1992 |
1984 MUST_USE_RESULT static MaybeHandle<FixedArray> GetOwnEntries( | 1993 MUST_USE_RESULT static MaybeHandle<FixedArray> GetOwnEntries( |
1985 Handle<JSReceiver> object, PropertyFilter filter); | 1994 Handle<JSReceiver> object, PropertyFilter filter); |
1986 | 1995 |
1987 // Layout description. | 1996 // Layout description. |
1988 static const int kPropertiesOffset = HeapObject::kHeaderSize; | 1997 static const int kPropertiesOffset = HeapObject::kHeaderSize; |
1989 static const int kHeaderSize = HeapObject::kHeaderSize + kPointerSize; | 1998 static const int kHeaderSize = HeapObject::kHeaderSize + kPointerSize; |
(...skipping 1974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3964 class JSSetIterator; | 3973 class JSSetIterator; |
3965 | 3974 |
3966 | 3975 |
3967 class OrderedHashSet: public OrderedHashTable< | 3976 class OrderedHashSet: public OrderedHashTable< |
3968 OrderedHashSet, JSSetIterator, 1> { | 3977 OrderedHashSet, JSSetIterator, 1> { |
3969 public: | 3978 public: |
3970 DECLARE_CAST(OrderedHashSet) | 3979 DECLARE_CAST(OrderedHashSet) |
3971 | 3980 |
3972 static Handle<OrderedHashSet> Add(Handle<OrderedHashSet> table, | 3981 static Handle<OrderedHashSet> Add(Handle<OrderedHashSet> table, |
3973 Handle<Object> value); | 3982 Handle<Object> value); |
3974 static Handle<FixedArray> ConvertToKeysArray(Handle<OrderedHashSet> table, | |
3975 GetKeysConversion convert); | |
3976 }; | 3983 }; |
3977 | 3984 |
3978 | 3985 |
3979 class JSMapIterator; | 3986 class JSMapIterator; |
3980 | 3987 |
3981 | 3988 |
3982 class OrderedHashMap | 3989 class OrderedHashMap |
3983 : public OrderedHashTable<OrderedHashMap, JSMapIterator, 2> { | 3990 : public OrderedHashTable<OrderedHashMap, JSMapIterator, 2> { |
3984 public: | 3991 public: |
3985 DECLARE_CAST(OrderedHashMap) | 3992 DECLARE_CAST(OrderedHashMap) |
(...skipping 6777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10763 } | 10770 } |
10764 return value; | 10771 return value; |
10765 } | 10772 } |
10766 }; | 10773 }; |
10767 | 10774 |
10768 | 10775 |
10769 } // NOLINT, false-positive due to second-order macros. | 10776 } // NOLINT, false-positive due to second-order macros. |
10770 } // NOLINT, false-positive due to second-order macros. | 10777 } // NOLINT, false-positive due to second-order macros. |
10771 | 10778 |
10772 #endif // V8_OBJECTS_H_ | 10779 #endif // V8_OBJECTS_H_ |
OLD | NEW |