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

Side by Side Diff: src/contexts.cc

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback, rebase and "git cl format" Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/contexts.h ('k') | src/data-flow.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/debug.h" 8 #include "src/debug.h"
9 #include "src/scopeinfo.h" 9 #include "src/scopeinfo.h"
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 Handle<ScopeInfo> scope_info; 133 Handle<ScopeInfo> scope_info;
134 if (context->IsFunctionContext()) { 134 if (context->IsFunctionContext()) {
135 scope_info = Handle<ScopeInfo>( 135 scope_info = Handle<ScopeInfo>(
136 context->closure()->shared()->scope_info(), isolate); 136 context->closure()->shared()->scope_info(), isolate);
137 } else { 137 } else {
138 scope_info = Handle<ScopeInfo>( 138 scope_info = Handle<ScopeInfo>(
139 ScopeInfo::cast(context->extension()), isolate); 139 ScopeInfo::cast(context->extension()), isolate);
140 } 140 }
141 VariableMode mode; 141 VariableMode mode;
142 InitializationFlag init_flag; 142 InitializationFlag init_flag;
143 int slot_index = 143 // TODO(sigurds) Figure out whether maybe_assigned_flag should
144 ScopeInfo::ContextSlotIndex(scope_info, name, &mode, &init_flag); 144 // be used to compute binding_flags.
145 MaybeAssignedFlag maybe_assigned_flag;
146 int slot_index = ScopeInfo::ContextSlotIndex(
147 scope_info, name, &mode, &init_flag, &maybe_assigned_flag);
145 ASSERT(slot_index < 0 || slot_index >= MIN_CONTEXT_SLOTS); 148 ASSERT(slot_index < 0 || slot_index >= MIN_CONTEXT_SLOTS);
146 if (slot_index >= 0) { 149 if (slot_index >= 0) {
147 if (FLAG_trace_contexts) { 150 if (FLAG_trace_contexts) {
148 PrintF("=> found local in context slot %d (mode = %d)\n", 151 PrintF("=> found local in context slot %d (mode = %d)\n",
149 slot_index, mode); 152 slot_index, mode);
150 } 153 }
151 *index = slot_index; 154 *index = slot_index;
152 // Note: Fixed context slots are statically allocated by the compiler. 155 // Note: Fixed context slots are statically allocated by the compiler.
153 // Statically allocated variables always have a statically known mode, 156 // Statically allocated variables always have a statically known mode,
154 // which is the mode with which they were declared when added to the 157 // which is the mode with which they were declared when added to the
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) { 373 bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) {
371 // During bootstrapping we allow all objects to pass as global 374 // During bootstrapping we allow all objects to pass as global
372 // objects. This is necessary to fix circular dependencies. 375 // objects. This is necessary to fix circular dependencies.
373 return isolate->heap()->gc_state() != Heap::NOT_IN_GC || 376 return isolate->heap()->gc_state() != Heap::NOT_IN_GC ||
374 isolate->bootstrapper()->IsActive() || 377 isolate->bootstrapper()->IsActive() ||
375 object->IsGlobalObject(); 378 object->IsGlobalObject();
376 } 379 }
377 #endif 380 #endif
378 381
379 } } // namespace v8::internal 382 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/contexts.h ('k') | src/data-flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698