Index: src/heap.h |
=================================================================== |
--- src/heap.h (revision 3428) |
+++ src/heap.h (working copy) |
@@ -1293,19 +1293,35 @@ |
// Clear the cache. |
static void Clear(); |
+ |
+ static const int kLength = 64; |
Erik Corry
2009/12/09 10:43:40
On a related note we should run a few performance
Mads Ager (chromium)
2009/12/10 09:18:18
Makes sense, yes.
|
+ static const int kCapacityMask = kLength - 1; |
+ static const int kMapHashShift = 2; |
+ |
private: |
static inline int Hash(Map* map, String* name); |
- static const int kLength = 64; |
+ |
+ // Get the address of the keys and field_offsets arrays. Used in |
+ // generated code to perform cache lookups. |
+ static Address keys_address() { |
+ return reinterpret_cast<Address>(&keys_); |
+ } |
+ |
+ static Address field_offsets_address() { |
+ return reinterpret_cast<Address>(&field_offsets_); |
+ } |
+ |
struct Key { |
Map* map; |
String* name; |
}; |
static Key keys_[kLength]; |
static int field_offsets_[kLength]; |
+ |
+ friend class ExternalReference; |
}; |
- |
// Cache for mapping (array, property name) into descriptor index. |
// The cache contains both positive and negative results. |
// Descriptor index equals kNotFound means the property is absent. |