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

Side by Side Diff: src/objects.h

Issue 126262: Reimplemented the KeyedLookupCache to speed up access. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 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
« no previous file with comments | « src/heap-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // - JSValue 52 // - JSValue
53 // - Array 53 // - Array
54 // - ByteArray 54 // - ByteArray
55 // - FixedArray 55 // - FixedArray
56 // - DescriptorArray 56 // - DescriptorArray
57 // - HashTable 57 // - HashTable
58 // - Dictionary 58 // - Dictionary
59 // - SymbolTable 59 // - SymbolTable
60 // - CompilationCacheTable 60 // - CompilationCacheTable
61 // - MapCache 61 // - MapCache
62 // - LookupCache
63 // - Context 62 // - Context
64 // - GlobalContext 63 // - GlobalContext
65 // - String 64 // - String
66 // - SeqString 65 // - SeqString
67 // - SeqAsciiString 66 // - SeqAsciiString
68 // - SeqTwoByteString 67 // - SeqTwoByteString
69 // - ConsString 68 // - ConsString
70 // - SlicedString 69 // - SlicedString
71 // - ExternalString 70 // - ExternalString
72 // - ExternalAsciiString 71 // - ExternalAsciiString
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 inline bool IsStringWrapper(); 670 inline bool IsStringWrapper();
672 inline bool IsProxy(); 671 inline bool IsProxy();
673 inline bool IsBoolean(); 672 inline bool IsBoolean();
674 inline bool IsJSArray(); 673 inline bool IsJSArray();
675 inline bool IsJSRegExp(); 674 inline bool IsJSRegExp();
676 inline bool IsHashTable(); 675 inline bool IsHashTable();
677 inline bool IsDictionary(); 676 inline bool IsDictionary();
678 inline bool IsSymbolTable(); 677 inline bool IsSymbolTable();
679 inline bool IsCompilationCacheTable(); 678 inline bool IsCompilationCacheTable();
680 inline bool IsMapCache(); 679 inline bool IsMapCache();
681 inline bool IsLookupCache();
682 inline bool IsPrimitive(); 680 inline bool IsPrimitive();
683 inline bool IsGlobalObject(); 681 inline bool IsGlobalObject();
684 inline bool IsJSGlobalObject(); 682 inline bool IsJSGlobalObject();
685 inline bool IsJSBuiltinsObject(); 683 inline bool IsJSBuiltinsObject();
686 inline bool IsJSGlobalProxy(); 684 inline bool IsJSGlobalProxy();
687 inline bool IsUndetectableObject(); 685 inline bool IsUndetectableObject();
688 inline bool IsAccessCheckNeeded(); 686 inline bool IsAccessCheckNeeded();
689 687
690 // Returns true if this object is an instance of the specified 688 // Returns true if this object is an instance of the specified
691 // function template. 689 // function template.
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 // Find cached value for a string key, otherwise return null. 2003 // Find cached value for a string key, otherwise return null.
2006 Object* Lookup(FixedArray* key); 2004 Object* Lookup(FixedArray* key);
2007 Object* Put(FixedArray* key, Map* value); 2005 Object* Put(FixedArray* key, Map* value);
2008 static inline MapCache* cast(Object* obj); 2006 static inline MapCache* cast(Object* obj);
2009 2007
2010 private: 2008 private:
2011 DISALLOW_IMPLICIT_CONSTRUCTORS(MapCache); 2009 DISALLOW_IMPLICIT_CONSTRUCTORS(MapCache);
2012 }; 2010 };
2013 2011
2014 2012
2015 // LookupCache.
2016 //
2017 // Maps a key consisting of a map and a name to an index within a
2018 // fast-case properties array.
2019 //
2020 // LookupCaches are used to avoid repeatedly searching instance
2021 // descriptors.
2022 class LookupCache: public HashTable<0, 2> {
2023 public:
2024 int Lookup(Map* map, String* name);
2025 Object* Put(Map* map, String* name, int offset);
2026 static inline LookupCache* cast(Object* obj);
2027
2028 // Constant returned by Lookup when the key was not found.
2029 static const int kNotFound = -1;
2030
2031 private:
2032 DISALLOW_IMPLICIT_CONSTRUCTORS(LookupCache);
2033 };
2034
2035
2036 // Dictionary for keeping properties and elements in slow case. 2013 // Dictionary for keeping properties and elements in slow case.
2037 // 2014 //
2038 // One element in the prefix is used for storing non-element 2015 // One element in the prefix is used for storing non-element
2039 // information about the dictionary. 2016 // information about the dictionary.
2040 // 2017 //
2041 // The rest of the array embeds triples of (key, value, details). 2018 // The rest of the array embeds triples of (key, value, details).
2042 // if key == undefined the triple is empty. 2019 // if key == undefined the triple is empty.
2043 // if key == null the triple has been deleted. 2020 // if key == null the triple has been deleted.
2044 // otherwise key contains the name of a property. 2021 // otherwise key contains the name of a property.
2045 class DictionaryBase: public HashTable<2, 3> {}; 2022 class DictionaryBase: public HashTable<2, 3> {};
(...skipping 2421 matching lines...) Expand 10 before | Expand all | Expand 10 after
4467 } else { 4444 } else {
4468 value &= ~(1 << bit_position); 4445 value &= ~(1 << bit_position);
4469 } 4446 }
4470 return value; 4447 return value;
4471 } 4448 }
4472 }; 4449 };
4473 4450
4474 } } // namespace v8::internal 4451 } } // namespace v8::internal
4475 4452
4476 #endif // V8_OBJECTS_H_ 4453 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/heap-inl.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698