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

Unified Diff: src/contexts.cc

Issue 1335633002: Do not look for the slot in the ScopeInfo's global range when it's not necessary. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Cleanup Created 5 years, 3 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/contexts.h ('k') | src/debug/debug-evaluate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index ade019a703aedff4fb40a7b70c3b12636d54bd65..a008d49ac37ebfdf9e47cdcb995eac2fba591918 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -44,10 +44,10 @@ bool ScriptContextTable::Lookup(Handle<ScriptContextTable> table,
DCHECK(context->IsScriptContext());
Handle<ScopeInfo> scope_info(context->scope_info());
int slot_index = ScopeInfo::ContextSlotIndex(
- scope_info, name, &result->mode, &result->location, &result->init_flag,
+ scope_info, name, &result->mode, &result->init_flag,
&result->maybe_assigned_flag);
- if (slot_index >= 0 && result->location == VariableLocation::CONTEXT) {
+ if (slot_index >= 0) {
result->context_index = i;
result->slot_index = slot_index;
return true;
@@ -333,15 +333,14 @@ Handle<Object> Context::Lookup(Handle<String> name,
? context->closure()->shared()->scope_info()
: context->scope_info());
VariableMode mode;
- VariableLocation location;
InitializationFlag init_flag;
// TODO(sigurds) Figure out whether maybe_assigned_flag should
// be used to compute binding_flags.
MaybeAssignedFlag maybe_assigned_flag;
int slot_index = ScopeInfo::ContextSlotIndex(
- scope_info, name, &mode, &location, &init_flag, &maybe_assigned_flag);
+ scope_info, name, &mode, &init_flag, &maybe_assigned_flag);
DCHECK(slot_index < 0 || slot_index >= MIN_CONTEXT_SLOTS);
- if (slot_index >= 0 && location == VariableLocation::CONTEXT) {
+ if (slot_index >= 0) {
if (FLAG_trace_contexts) {
PrintF("=> found local in context slot %d (mode = %d)\n",
slot_index, mode);
« no previous file with comments | « src/contexts.h ('k') | src/debug/debug-evaluate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698