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

Unified Diff: src/objects.h

Issue 688853007: Implement aging of maps embedded in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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
diff --git a/src/objects.h b/src/objects.h
index d025b2482339da3cef73acefe2b4d2507be05a5e..04657af4ad570676b750272a28d9cedbd4f046b3 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -994,6 +994,7 @@ template <class C> inline bool Is(Object* obj);
V(WeakCell) \
V(ObjectHashTable) \
V(WeakHashTable) \
+ V(EmbeddedMapCache) \
V(OrderedHashTable)
// Object is the abstract superclass for all classes in the
@@ -3996,7 +3997,7 @@ class OrderedHashMap:public OrderedHashTable<
template <int entrysize>
-class WeakHashTableShape : public BaseShape<Handle<Object> > {
+class HeapPointerShape : public BaseShape<Handle<Object> > {
Hannes Payer (out of office) 2014/11/17 17:34:33 Why is that a good name?
public:
static inline bool IsMatch(Handle<Object> key, Object* other);
static inline uint32_t Hash(Handle<Object> key);
@@ -4010,11 +4011,11 @@ class WeakHashTableShape : public BaseShape<Handle<Object> > {
// WeakHashTable maps keys that are arbitrary objects to object values.
// It is used for the global weak hash table that maps objects
// embedded in optimized code to dependent code lists.
-class WeakHashTable: public HashTable<WeakHashTable,
- WeakHashTableShape<2>,
- Handle<Object> > {
- typedef HashTable<
- WeakHashTable, WeakHashTableShape<2>, Handle<Object> > DerivedHashTable;
+class WeakHashTable
+ : public HashTable<WeakHashTable, HeapPointerShape<2>, Handle<Object> > {
+ typedef HashTable<WeakHashTable, HeapPointerShape<2>, Handle<Object> >
+ DerivedHashTable;
+
public:
DECLARE_CAST(WeakHashTable)
@@ -4049,6 +4050,33 @@ class WeakHashTable: public HashTable<WeakHashTable,
};
Hannes Payer (out of office) 2014/11/17 17:34:33 Please add a detailed description about what the E
+class EmbeddedMapCache
+ : public HashTable<EmbeddedMapCache, HeapPointerShape<2>, Handle<Object> > {
+ typedef HashTable<EmbeddedMapCache, HeapPointerShape<2>, Handle<Object> >
+ DerivedHashTable;
+
+ public:
+ DECLARE_CAST(EmbeddedMapCache)
+
+ MUST_USE_RESULT static Handle<EmbeddedMapCache> Put(
+ Handle<EmbeddedMapCache> table, Handle<Map> key);
+
+ void Age();
+
+ private:
+ static const int kMaxAge = 5;
+
+ friend class MarkCompactCollector;
+
+ void AddEntry(int entry, Handle<Object> key, Handle<Object> value);
+
+ // Returns the index to the value of an entry.
+ static inline int EntryToValueIndex(int entry) {
+ return EntryToIndex(entry) + 1;
+ }
+};
+
+
// JSFunctionResultCache caches results of some JSFunction invocation.
// It is a fixed array with fixed structure:
// [0]: factory function

Powered by Google App Engine
This is Rietveld 408576698