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 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1772 | 1772 |
1773 // Indicator for one component of an AccessorPair. | 1773 // Indicator for one component of an AccessorPair. |
1774 enum AccessorComponent { | 1774 enum AccessorComponent { |
1775 ACCESSOR_GETTER, | 1775 ACCESSOR_GETTER, |
1776 ACCESSOR_SETTER | 1776 ACCESSOR_SETTER |
1777 }; | 1777 }; |
1778 | 1778 |
1779 | 1779 |
1780 enum KeyFilter { SKIP_SYMBOLS, INCLUDE_SYMBOLS }; | 1780 enum KeyFilter { SKIP_SYMBOLS, INCLUDE_SYMBOLS }; |
1781 | 1781 |
| 1782 enum Enumerability { RESPECT_ENUMERABILITY, IGNORE_ENUMERABILITY }; |
1782 | 1783 |
1783 enum GetKeysConversion { KEEP_NUMBERS, CONVERT_TO_STRING }; | 1784 enum GetKeysConversion { KEEP_NUMBERS, CONVERT_TO_STRING }; |
1784 | 1785 |
1785 | 1786 |
1786 // JSReceiver includes types on which properties can be defined, i.e., | 1787 // JSReceiver includes types on which properties can be defined, i.e., |
1787 // JSObject and JSProxy. | 1788 // JSObject and JSProxy. |
1788 class JSReceiver: public HeapObject { | 1789 class JSReceiver: public HeapObject { |
1789 public: | 1790 public: |
1790 DECLARE_CAST(JSReceiver) | 1791 DECLARE_CAST(JSReceiver) |
1791 | 1792 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1919 inline static Handle<Smi> GetOrCreateIdentityHash( | 1920 inline static Handle<Smi> GetOrCreateIdentityHash( |
1920 Handle<JSReceiver> object); | 1921 Handle<JSReceiver> object); |
1921 | 1922 |
1922 enum KeyCollectionType { OWN_ONLY, INCLUDE_PROTOS }; | 1923 enum KeyCollectionType { OWN_ONLY, INCLUDE_PROTOS }; |
1923 | 1924 |
1924 // Computes the enumerable keys for a JSObject. Used for implementing | 1925 // Computes the enumerable keys for a JSObject. Used for implementing |
1925 // "for (n in object) { }". | 1926 // "for (n in object) { }". |
1926 MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys( | 1927 MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys( |
1927 Handle<JSReceiver> object, KeyCollectionType type, | 1928 Handle<JSReceiver> object, KeyCollectionType type, |
1928 KeyFilter filter = SKIP_SYMBOLS, | 1929 KeyFilter filter = SKIP_SYMBOLS, |
1929 GetKeysConversion getConversion = KEEP_NUMBERS); | 1930 GetKeysConversion getConversion = KEEP_NUMBERS, |
| 1931 Enumerability enum_policy = RESPECT_ENUMERABILITY); |
1930 | 1932 |
1931 private: | 1933 private: |
1932 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); | 1934 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); |
1933 }; | 1935 }; |
1934 | 1936 |
1935 | 1937 |
1936 // The JSObject describes real heap allocated JavaScript objects with | 1938 // The JSObject describes real heap allocated JavaScript objects with |
1937 // properties. | 1939 // properties. |
1938 // Note that the map of JSObject changes during execution to enable inline | 1940 // Note that the map of JSObject changes during execution to enable inline |
1939 // caching. | 1941 // caching. |
(...skipping 8766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10706 } | 10708 } |
10707 return value; | 10709 return value; |
10708 } | 10710 } |
10709 }; | 10711 }; |
10710 | 10712 |
10711 | 10713 |
10712 } // NOLINT, false-positive due to second-order macros. | 10714 } // NOLINT, false-positive due to second-order macros. |
10713 } // NOLINT, false-positive due to second-order macros. | 10715 } // NOLINT, false-positive due to second-order macros. |
10714 | 10716 |
10715 #endif // V8_OBJECTS_H_ | 10717 #endif // V8_OBJECTS_H_ |
OLD | NEW |