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

Unified Diff: src/scopeinfo.cc

Issue 1259963002: [stubs] Don't pass name to Load/StoreGlobalViaContext stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix 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
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/x64/code-stubs-x64.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 a621083f9679afe6dc9ca61b5b8f22322a8ce33f..c79a98060cccb039999c811e0e5ac626bb10a2e4 100644
--- a/src/scopeinfo.cc
+++ b/src/scopeinfo.cc
@@ -572,6 +572,19 @@ int ScopeInfo::ContextSlotIndex(Handle<ScopeInfo> scope_info,
}
+String* ScopeInfo::ContextSlotName(int slot_index) {
+ // TODO(bmeurer): Simplify this once we have only a single slot for both reads
+ // and writes to context globals; currently we have 2 slots per context
+ // global, and these are located after the common context slots (of which we
+ // always have Context::MIN_CONTEXT_SLOTS) and the context locals.
+ int const var =
+ slot_index - (Context::MIN_CONTEXT_SLOTS + ContextLocalCount());
+ DCHECK_LE(0, var);
+ DCHECK_LT(var, 2 * ContextGlobalCount());
+ return ContextLocalName(ContextLocalCount() + var / 2);
+}
+
+
int ScopeInfo::ParameterIndex(String* name) {
DCHECK(name->IsInternalizedString());
if (length() > 0) {
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698