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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/objects.h
===================================================================
--- src/objects.h (revision 556)
+++ src/objects.h (working copy)
@@ -58,6 +58,9 @@
// - HashTable
// - Dictionary
// - SymbolTable
+// - CompilationCacheTable
+// - MapCache
+// - LookupCache
// - Context
// - GlobalContext
// - String
@@ -626,6 +629,7 @@
inline bool IsSymbolTable();
inline bool IsCompilationCacheTable();
inline bool IsMapCache();
+ inline bool IsLookupCache();
inline bool IsPrimitive();
inline bool IsGlobalObject();
inline bool IsJSGlobalObject();
@@ -1870,6 +1874,24 @@
};
+// LookupCache.
+//
+// Maps a key consisting of a map and a name to an index within a
+// fast-case properties array.
+//
+// LookupCaches are used to avoid repeatedly searching instance
+// descriptors.
+class LookupCache: public HashTable<0, 2> {
+ public:
+ int Lookup(Map* map, String* name);
+ Object* Put(Map* map, String* name, int offset);
+ static inline LookupCache* cast(Object* obj);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(LookupCache);
+};
+
+
// Dictionary for keeping properties and elements in slow case.
//
// One element in the prefix is used for storing non-element

Powered by Google App Engine
This is Rietveld 408576698