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 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 3833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3844 int* entry_out = nullptr); | 3844 int* entry_out = nullptr); |
3845 | 3845 |
3846 // Returns iteration indices array for the |dictionary|. | 3846 // Returns iteration indices array for the |dictionary|. |
3847 // Values are direct indices in the |HashTable| array. | 3847 // Values are direct indices in the |HashTable| array. |
3848 static Handle<FixedArray> BuildIterationIndicesArray( | 3848 static Handle<FixedArray> BuildIterationIndicesArray( |
3849 Handle<Derived> dictionary); | 3849 Handle<Derived> dictionary); |
3850 | 3850 |
3851 static const int kMaxNumberKeyIndex = DerivedHashTable::kPrefixStartIndex; | 3851 static const int kMaxNumberKeyIndex = DerivedHashTable::kPrefixStartIndex; |
3852 static const int kNextEnumerationIndexIndex = kMaxNumberKeyIndex + 1; | 3852 static const int kNextEnumerationIndexIndex = kMaxNumberKeyIndex + 1; |
3853 | 3853 |
| 3854 static const bool kIsEnumerable = Shape::kIsEnumerable; |
| 3855 |
3854 protected: | 3856 protected: |
3855 // Generic at put operation. | 3857 // Generic at put operation. |
3856 MUST_USE_RESULT static Handle<Derived> AtPut( | 3858 MUST_USE_RESULT static Handle<Derived> AtPut( |
3857 Handle<Derived> dictionary, | 3859 Handle<Derived> dictionary, |
3858 Key key, | 3860 Key key, |
3859 Handle<Object> value); | 3861 Handle<Object> value); |
3860 // Add entry to dictionary. Returns entry value. | 3862 // Add entry to dictionary. Returns entry value. |
3861 static int AddEntry(Handle<Derived> dictionary, Key key, Handle<Object> value, | 3863 static int AddEntry(Handle<Derived> dictionary, Key key, Handle<Object> value, |
3862 PropertyDetails details, uint32_t hash); | 3864 PropertyDetails details, uint32_t hash); |
3863 // Generate new enumeration indices to avoid enumeration index overflow. | 3865 // Generate new enumeration indices to avoid enumeration index overflow. |
(...skipping 5724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9588 | 9590 |
9589 // Dispatched behavior. | 9591 // Dispatched behavior. |
9590 DECLARE_PRINTER(Symbol) | 9592 DECLARE_PRINTER(Symbol) |
9591 DECLARE_VERIFIER(Symbol) | 9593 DECLARE_VERIFIER(Symbol) |
9592 | 9594 |
9593 // Layout description. | 9595 // Layout description. |
9594 static const int kNameOffset = Name::kSize; | 9596 static const int kNameOffset = Name::kSize; |
9595 static const int kFlagsOffset = kNameOffset + kPointerSize; | 9597 static const int kFlagsOffset = kNameOffset + kPointerSize; |
9596 static const int kSize = kFlagsOffset + kPointerSize; | 9598 static const int kSize = kFlagsOffset + kPointerSize; |
9597 | 9599 |
| 9600 // Flags layout. |
| 9601 static const int kPrivateBit = 0; |
| 9602 static const int kWellKnownSymbolBit = 1; |
| 9603 |
9598 typedef FixedBodyDescriptor<kNameOffset, kFlagsOffset, kSize> BodyDescriptor; | 9604 typedef FixedBodyDescriptor<kNameOffset, kFlagsOffset, kSize> BodyDescriptor; |
9599 | 9605 |
9600 void SymbolShortPrint(std::ostream& os); | 9606 void SymbolShortPrint(std::ostream& os); |
9601 | 9607 |
9602 private: | 9608 private: |
9603 static const int kPrivateBit = 0; | |
9604 static const int kWellKnownSymbolBit = 1; | |
9605 | |
9606 const char* PrivateSymbolToName() const; | 9609 const char* PrivateSymbolToName() const; |
9607 | 9610 |
9608 #if TRACE_MAPS | 9611 #if TRACE_MAPS |
9609 friend class Name; // For PrivateSymbolToName. | 9612 friend class Name; // For PrivateSymbolToName. |
9610 #endif | 9613 #endif |
9611 | 9614 |
9612 DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol); | 9615 DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol); |
9613 }; | 9616 }; |
9614 | 9617 |
9615 | 9618 |
(...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11878 } | 11881 } |
11879 return value; | 11882 return value; |
11880 } | 11883 } |
11881 }; | 11884 }; |
11882 | 11885 |
11883 | 11886 |
11884 } // NOLINT, false-positive due to second-order macros. | 11887 } // NOLINT, false-positive due to second-order macros. |
11885 } // NOLINT, false-positive due to second-order macros. | 11888 } // NOLINT, false-positive due to second-order macros. |
11886 | 11889 |
11887 #endif // V8_OBJECTS_H_ | 11890 #endif // V8_OBJECTS_H_ |
OLD | NEW |