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

Unified Diff: src/scopeinfo.cc

Issue 253263003: ScopeInfo::ContextSlotIndex() handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopeinfo.cc
diff --git a/src/scopeinfo.cc b/src/scopeinfo.cc
index 7f8549214e214129b900a7798376c423d02fe853..a44ac613aa5a83da88ffdb8837c5a26394bfd3a8 100644
--- a/src/scopeinfo.cc
+++ b/src/scopeinfo.cc
@@ -281,35 +281,41 @@ int ScopeInfo::StackSlotIndex(String* name) {
}
-int ScopeInfo::ContextSlotIndex(String* name,
+int ScopeInfo::ContextSlotIndex(Handle<ScopeInfo> scope_info,
+ Handle<String> name,
VariableMode* mode,
InitializationFlag* init_flag) {
ASSERT(name->IsInternalizedString());
ASSERT(mode != NULL);
ASSERT(init_flag != NULL);
- if (length() > 0) {
- ContextSlotCache* context_slot_cache = GetIsolate()->context_slot_cache();
- int result = context_slot_cache->Lookup(this, name, mode, init_flag);
+ if (scope_info->length() > 0) {
+ ContextSlotCache* context_slot_cache =
+ scope_info->GetIsolate()->context_slot_cache();
+ int result =
+ context_slot_cache->Lookup(*scope_info, *name, mode, init_flag);
if (result != ContextSlotCache::kNotFound) {
- ASSERT(result < ContextLength());
+ ASSERT(result < scope_info->ContextLength());
return result;
}
- int start = ContextLocalNameEntriesIndex();
- int end = ContextLocalNameEntriesIndex() + ContextLocalCount();
+ int start = scope_info->ContextLocalNameEntriesIndex();
+ int end = scope_info->ContextLocalNameEntriesIndex() +
+ scope_info->ContextLocalCount();
for (int i = start; i < end; ++i) {
- if (name == get(i)) {
+ if (*name == scope_info->get(i)) {
int var = i - start;
- *mode = ContextLocalMode(var);
- *init_flag = ContextLocalInitFlag(var);
+ *mode = scope_info->ContextLocalMode(var);
+ *init_flag = scope_info->ContextLocalInitFlag(var);
result = Context::MIN_CONTEXT_SLOTS + var;
- context_slot_cache->Update(this, name, *mode, *init_flag, result);
- ASSERT(result < ContextLength());
+ context_slot_cache->Update(
+ *scope_info, *name, *mode, *init_flag, result);
+ ASSERT(result < scope_info->ContextLength());
return result;
}
}
// Cache as not found. Mode and init flag don't matter.
- context_slot_cache->Update(this, name, INTERNAL, kNeedsInitialization, -1);
+ context_slot_cache->Update(
+ *scope_info, *name, INTERNAL, kNeedsInitialization, -1);
}
return -1;
}
« no previous file with comments | « src/runtime.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698