| Index: src/objects.h
|
| ===================================================================
|
| --- src/objects.h (revision 5141)
|
| +++ src/objects.h (working copy)
|
| @@ -631,6 +631,7 @@
|
| inline bool IsDictionary();
|
| inline bool IsSymbolTable();
|
| inline bool IsJSFunctionResultCache();
|
| + inline bool IsNormalizedMapCache();
|
| inline bool IsCompilationCacheTable();
|
| inline bool IsCodeCacheHashTable();
|
| inline bool IsMapCache();
|
| @@ -2387,6 +2388,31 @@
|
| };
|
|
|
|
|
| +// The cache for maps used by normalized (dictionary mode) objects.
|
| +// Such maps do not have property descriptors, so a typical program
|
| +// needs very limited number of distinct normalized maps.
|
| +class NormalizedMapCache: public FixedArray {
|
| + public:
|
| + static const int kEntries = 256;
|
| +
|
| + Object* Get(Map* fast, PropertyNormalizationMode mode);
|
| +
|
| + void Clear();
|
| +
|
| + // Casting
|
| + static inline NormalizedMapCache* cast(Object* obj);
|
| +
|
| +#ifdef DEBUG
|
| + void NormalizedMapCacheVerify();
|
| +#endif
|
| +
|
| + private:
|
| + static int Hash(Map* fast);
|
| +
|
| + static bool CheckHit(Map* slow, Map* fast, PropertyNormalizationMode mode);
|
| +};
|
| +
|
| +
|
| // ByteArray represents fixed sized byte arrays. Used by the outside world,
|
| // such as PCRE, and also by the memory allocator and garbage collector to
|
| // fill in free blocks in the heap.
|
| @@ -3030,6 +3056,8 @@
|
|
|
| Object* CopyDropDescriptors();
|
|
|
| + Object* CopyNormalized(PropertyNormalizationMode mode);
|
| +
|
| // Returns a copy of the map, with all transitions dropped from the
|
| // instance descriptors.
|
| Object* CopyDropTransitions();
|
| @@ -3093,6 +3121,7 @@
|
| #ifdef DEBUG
|
| void MapPrint();
|
| void MapVerify();
|
| + void NormalizedMapVerify();
|
| #endif
|
|
|
| inline Scavenger scavenger();
|
| @@ -3131,6 +3160,8 @@
|
| static const int kPreAllocatedPropertyFieldsOffset =
|
| kInstanceSizesOffset + kPreAllocatedPropertyFieldsByte;
|
| // The byte at position 3 is not in use at the moment.
|
| + static const int kUnusedByte = 3;
|
| + static const int kUnusedOffset = kInstanceSizesOffset + kUnusedByte;
|
|
|
| // Byte offsets within kInstanceAttributesOffset attributes.
|
| static const int kInstanceTypeOffset = kInstanceAttributesOffset + 0;
|
|
|