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

Unified Diff: src/scopeinfo.cc

Issue 1250413002: [stubs] Further optimize Load/StoreGlobalViaContext stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 5 years, 5 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
Index: src/scopeinfo.cc
diff --git a/src/scopeinfo.cc b/src/scopeinfo.cc
index a621083f9679afe6dc9ca61b5b8f22322a8ce33f..fda3b1bd38978c68a3618981ed4728393958e2a1 100644
--- a/src/scopeinfo.cc
+++ b/src/scopeinfo.cc
@@ -340,7 +340,7 @@ int ScopeInfo::ContextLength() {
scope_type() == MODULE_SCOPE;
if (has_context) {
- return Context::MIN_CONTEXT_SLOTS + context_locals + 2 * context_globals +
+ return Context::MIN_CONTEXT_SLOTS + context_locals + context_globals +
(function_name_context_slot ? 1 : 0);
}
}
@@ -553,7 +553,7 @@ int ScopeInfo::ContextSlotIndex(Handle<ScopeInfo> scope_info,
var -= scope_info->ContextLocalCount();
*location = VariableLocation::GLOBAL;
result = Context::MIN_CONTEXT_SLOTS +
- scope_info->ContextLocalCount() + 2 * var;
+ scope_info->ContextLocalCount() + var;
}
context_slot_cache->Update(scope_info, name, *mode, *location,
@@ -572,6 +572,14 @@ int ScopeInfo::ContextSlotIndex(Handle<ScopeInfo> scope_info,
}
+String* ScopeInfo::ContextSlotName(int slot_index) {
+ int const var = slot_index - Context::MIN_CONTEXT_SLOTS;
+ DCHECK_LE(0, var);
+ DCHECK_LT(var, ContextLocalCount() + ContextGlobalCount());
+ return ContextLocalName(var);
+}
+
+
int ScopeInfo::ParameterIndex(String* name) {
DCHECK(name->IsInternalizedString());
if (length() > 0) {
« src/flag-definitions.h ('K') | « src/runtime/runtime-object.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698