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 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 | 843 |
844 #define DECLARE_CAST(type) \ | 844 #define DECLARE_CAST(type) \ |
845 INLINE(static type* cast(Object* object)); \ | 845 INLINE(static type* cast(Object* object)); \ |
846 INLINE(static const type* cast(const Object* object)); | 846 INLINE(static const type* cast(const Object* object)); |
847 | 847 |
848 | 848 |
849 class AccessorPair; | 849 class AccessorPair; |
850 class AllocationSite; | 850 class AllocationSite; |
851 class AllocationSiteCreationContext; | 851 class AllocationSiteCreationContext; |
852 class AllocationSiteUsageContext; | 852 class AllocationSiteUsageContext; |
| 853 class ConsString; |
853 class DictionaryElementsAccessor; | 854 class DictionaryElementsAccessor; |
854 class ElementsAccessor; | 855 class ElementsAccessor; |
855 class FixedArrayBase; | 856 class FixedArrayBase; |
856 class GlobalObject; | 857 class GlobalObject; |
857 class LayoutDescriptor; | 858 class LayoutDescriptor; |
858 class LookupIterator; | 859 class LookupIterator; |
859 class ObjectVisitor; | 860 class ObjectVisitor; |
860 class StringStream; | 861 class StringStream; |
861 class TypeFeedbackVector; | 862 class TypeFeedbackVector; |
862 class WeakCell; | 863 class WeakCell; |
(...skipping 7654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8517 | 8518 |
8518 class IteratingStringHasher : public StringHasher { | 8519 class IteratingStringHasher : public StringHasher { |
8519 public: | 8520 public: |
8520 static inline uint32_t Hash(String* string, uint32_t seed); | 8521 static inline uint32_t Hash(String* string, uint32_t seed); |
8521 inline void VisitOneByteString(const uint8_t* chars, int length); | 8522 inline void VisitOneByteString(const uint8_t* chars, int length); |
8522 inline void VisitTwoByteString(const uint16_t* chars, int length); | 8523 inline void VisitTwoByteString(const uint16_t* chars, int length); |
8523 | 8524 |
8524 private: | 8525 private: |
8525 inline IteratingStringHasher(int len, uint32_t seed) | 8526 inline IteratingStringHasher(int len, uint32_t seed) |
8526 : StringHasher(len, seed) {} | 8527 : StringHasher(len, seed) {} |
| 8528 void VisitConsString(ConsString* cons_string); |
8527 DISALLOW_COPY_AND_ASSIGN(IteratingStringHasher); | 8529 DISALLOW_COPY_AND_ASSIGN(IteratingStringHasher); |
8528 }; | 8530 }; |
8529 | 8531 |
8530 | 8532 |
8531 // The characteristics of a string are stored in its map. Retrieving these | 8533 // The characteristics of a string are stored in its map. Retrieving these |
8532 // few bits of information is moderately expensive, involving two memory | 8534 // few bits of information is moderately expensive, involving two memory |
8533 // loads where the second is dependent on the first. To improve efficiency | 8535 // loads where the second is dependent on the first. To improve efficiency |
8534 // the shape of the string is given its own class so that it can be retrieved | 8536 // the shape of the string is given its own class so that it can be retrieved |
8535 // once and used for several string operations. A StringShape is small enough | 8537 // once and used for several string operations. A StringShape is small enough |
8536 // to be passed by value and is immutable, but be aware that flattening a | 8538 // to be passed by value and is immutable, but be aware that flattening a |
(...skipping 2438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10975 } else { | 10977 } else { |
10976 value &= ~(1 << bit_position); | 10978 value &= ~(1 << bit_position); |
10977 } | 10979 } |
10978 return value; | 10980 return value; |
10979 } | 10981 } |
10980 }; | 10982 }; |
10981 | 10983 |
10982 } } // namespace v8::internal | 10984 } } // namespace v8::internal |
10983 | 10985 |
10984 #endif // V8_OBJECTS_H_ | 10986 #endif // V8_OBJECTS_H_ |
OLD | NEW |