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

Unified Diff: src/scopeinfo.h

Issue 2816006: [Isolates] KeyedLookupCache / DescriptorLookupCache / ContextSlotCache moved to Isolate. (Closed)
Patch Set: Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.cc ('k') | src/scopeinfo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « src/runtime.cc ('k') | src/scopeinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698