Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: src/objects.h

Issue 7879: Introduce a lookup cache class in the runtime system and use it for... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // _ JSGlobalProxy 51 // _ JSGlobalProxy
52 // - JSValue 52 // - JSValue
53 // - Script 53 // - Script
54 // - Array 54 // - Array
55 // - ByteArray 55 // - ByteArray
56 // - FixedArray 56 // - FixedArray
57 // - DescriptorArray 57 // - DescriptorArray
58 // - HashTable 58 // - HashTable
59 // - Dictionary 59 // - Dictionary
60 // - SymbolTable 60 // - SymbolTable
61 // - CompilationCacheTable
62 // - MapCache
63 // - LookupCache
61 // - Context 64 // - Context
62 // - GlobalContext 65 // - GlobalContext
63 // - String 66 // - String
64 // - SeqString 67 // - SeqString
65 // - SeqAsciiString 68 // - SeqAsciiString
66 // - SeqTwoByteString 69 // - SeqTwoByteString
67 // - ConsString 70 // - ConsString
68 // - SlicedString 71 // - SlicedString
69 // - ExternalString 72 // - ExternalString
70 // - ExternalAsciiString 73 // - ExternalAsciiString
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 inline bool IsJSValue(); 622 inline bool IsJSValue();
620 inline bool IsProxy(); 623 inline bool IsProxy();
621 inline bool IsBoolean(); 624 inline bool IsBoolean();
622 inline bool IsJSArray(); 625 inline bool IsJSArray();
623 inline bool IsJSRegExp(); 626 inline bool IsJSRegExp();
624 inline bool IsHashTable(); 627 inline bool IsHashTable();
625 inline bool IsDictionary(); 628 inline bool IsDictionary();
626 inline bool IsSymbolTable(); 629 inline bool IsSymbolTable();
627 inline bool IsCompilationCacheTable(); 630 inline bool IsCompilationCacheTable();
628 inline bool IsMapCache(); 631 inline bool IsMapCache();
632 inline bool IsLookupCache();
629 inline bool IsPrimitive(); 633 inline bool IsPrimitive();
630 inline bool IsGlobalObject(); 634 inline bool IsGlobalObject();
631 inline bool IsJSGlobalObject(); 635 inline bool IsJSGlobalObject();
632 inline bool IsJSBuiltinsObject(); 636 inline bool IsJSBuiltinsObject();
633 inline bool IsJSGlobalProxy(); 637 inline bool IsJSGlobalProxy();
634 inline bool IsUndetectableObject(); 638 inline bool IsUndetectableObject();
635 inline bool IsAccessCheckNeeded(); 639 inline bool IsAccessCheckNeeded();
636 640
637 // Returns true if this object is an instance of the specified 641 // Returns true if this object is an instance of the specified
638 // function template. 642 // function template.
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1863 // Find cached value for a string key, otherwise return null. 1867 // Find cached value for a string key, otherwise return null.
1864 Object* Lookup(FixedArray* key); 1868 Object* Lookup(FixedArray* key);
1865 Object* Put(FixedArray* key, Map* value); 1869 Object* Put(FixedArray* key, Map* value);
1866 static inline MapCache* cast(Object* obj); 1870 static inline MapCache* cast(Object* obj);
1867 1871
1868 private: 1872 private:
1869 DISALLOW_IMPLICIT_CONSTRUCTORS(MapCache); 1873 DISALLOW_IMPLICIT_CONSTRUCTORS(MapCache);
1870 }; 1874 };
1871 1875
1872 1876
1877 // LookupCache.
1878 //
1879 // Maps a key consisting of a map and a name to an index within a
1880 // fast-case properties array.
1881 //
1882 // LookupCaches are used to avoid repeatedly searching instance
1883 // descriptors.
1884 class LookupCache: public HashTable<0, 2> {
1885 public:
1886 int Lookup(Map* map, String* name);
1887 Object* Put(Map* map, String* name, int offset);
1888 static inline LookupCache* cast(Object* obj);
1889
1890 private:
1891 DISALLOW_IMPLICIT_CONSTRUCTORS(LookupCache);
1892 };
1893
1894
1873 // Dictionary for keeping properties and elements in slow case. 1895 // Dictionary for keeping properties and elements in slow case.
1874 // 1896 //
1875 // One element in the prefix is used for storing non-element 1897 // One element in the prefix is used for storing non-element
1876 // information about the dictionary. 1898 // information about the dictionary.
1877 // 1899 //
1878 // The rest of the array embeds triples of (key, value, details). 1900 // The rest of the array embeds triples of (key, value, details).
1879 // if key == undefined the triple is empty. 1901 // if key == undefined the triple is empty.
1880 // if key == null the triple has been deleted. 1902 // if key == null the triple has been deleted.
1881 // otherwise key contains the name of a property. 1903 // otherwise key contains the name of a property.
1882 class DictionaryBase: public HashTable<2, 3> {}; 1904 class DictionaryBase: public HashTable<2, 3> {};
(...skipping 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after
4051 } else { 4073 } else {
4052 value &= ~(1 << bit_position); 4074 value &= ~(1 << bit_position);
4053 } 4075 }
4054 return value; 4076 return value;
4055 } 4077 }
4056 }; 4078 };
4057 4079
4058 } } // namespace v8::internal 4080 } } // namespace v8::internal
4059 4081
4060 #endif // V8_OBJECTS_H_ 4082 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698