| Index: src/scopeinfo.h
|
| diff --git a/src/scopeinfo.h b/src/scopeinfo.h
|
| index 927ac66fc4bee432d801537c7aaf8f83494e6a70..da89166a54a4d4aeb855dd5d3fa57945cbfcd10b 100644
|
| --- a/src/scopeinfo.h
|
| +++ b/src/scopeinfo.h
|
| @@ -172,28 +172,31 @@ class ContextSlotCache {
|
| public:
|
| // Lookup context slot index for (code, name).
|
| // If absent, kNotFound is returned.
|
| - static int Lookup(Code* code,
|
| - String* name,
|
| - Variable::Mode* mode);
|
| + int Lookup(Code* code, String* name, Variable::Mode* mode);
|
|
|
| // Update an element in the cache.
|
| - static void Update(Code* code,
|
| - String* name,
|
| - Variable::Mode mode,
|
| - int slot_index);
|
| + void Update(Code* code, String* name, Variable::Mode mode, int slot_index);
|
|
|
| // Clear the cache.
|
| - static void Clear();
|
| + void Clear();
|
|
|
| static const int kNotFound = -2;
|
| private:
|
| + ContextSlotCache() {
|
| + for (int i = 0; i < kLength; ++i) {
|
| + keys_[i].code = NULL;
|
| + keys_[i].name = NULL;
|
| + values_[i] = kNotFound;
|
| + }
|
| + }
|
| +
|
| inline static int Hash(Code* code, String* name);
|
|
|
| #ifdef DEBUG
|
| - static void ValidateEntry(Code* code,
|
| - String* name,
|
| - Variable::Mode mode,
|
| - int slot_index);
|
| + void ValidateEntry(Code* code,
|
| + String* name,
|
| + Variable::Mode mode,
|
| + int slot_index);
|
| #endif
|
|
|
| static const int kLength = 256;
|
| @@ -227,8 +230,11 @@ class ContextSlotCache {
|
| uint32_t value_;
|
| };
|
|
|
| - static Key keys_[kLength];
|
| - static uint32_t values_[kLength];
|
| + Key keys_[kLength];
|
| + uint32_t values_[kLength];
|
| +
|
| + friend class Isolate;
|
| + DISALLOW_COPY_AND_ASSIGN(ContextSlotCache);
|
| };
|
|
|
|
|
|
|