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

Side by Side Diff: src/ast/scopes.cc

Issue 1834633003: [debugger] allow debug-evaluate to change stack and context values. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | src/contexts.h » ('j') | src/factory.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/ast/scopes.h" 5 #include "src/ast/scopes.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/ast/scopeinfo.h" 8 #include "src/ast/scopeinfo.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 201 }
202 } 202 }
203 203
204 204
205 Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone, 205 Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone,
206 Context* context, Scope* script_scope) { 206 Context* context, Scope* script_scope) {
207 // Reconstruct the outer scope chain from a closure's context chain. 207 // Reconstruct the outer scope chain from a closure's context chain.
208 Scope* current_scope = NULL; 208 Scope* current_scope = NULL;
209 Scope* innermost_scope = NULL; 209 Scope* innermost_scope = NULL;
210 while (!context->IsNativeContext()) { 210 while (!context->IsNativeContext()) {
211 if (context->IsWithContext()) { 211 if (context->IsWithContext() || context->IsDebugEvaluateContext()) {
212 // For scope analysis, debug-evaluate is equivalent to a with scope.
212 Scope* with_scope = new (zone) 213 Scope* with_scope = new (zone)
213 Scope(zone, current_scope, WITH_SCOPE, Handle<ScopeInfo>::null(), 214 Scope(zone, current_scope, WITH_SCOPE, Handle<ScopeInfo>::null(),
214 script_scope->ast_value_factory_); 215 script_scope->ast_value_factory_);
215 current_scope = with_scope; 216 current_scope = with_scope;
216 // All the inner scopes are inside a with. 217 // All the inner scopes are inside a with.
217 for (Scope* s = innermost_scope; s != NULL; s = s->outer_scope()) { 218 for (Scope* s = innermost_scope; s != NULL; s = s->outer_scope()) {
218 s->scope_inside_with_ = true; 219 s->scope_inside_with_ = true;
219 } 220 }
220 } else if (context->IsScriptContext()) { 221 } else if (context->IsScriptContext()) {
221 ScopeInfo* scope_info = context->scope_info(); 222 ScopeInfo* scope_info = context->scope_info();
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 function_ != NULL && function_->proxy()->var()->IsContextSlot(); 1501 function_ != NULL && function_->proxy()->var()->IsContextSlot();
1501 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - 1502 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() -
1502 (is_function_var_in_context ? 1 : 0); 1503 (is_function_var_in_context ? 1 : 0);
1503 } 1504 }
1504 1505
1505 1506
1506 int Scope::ContextGlobalCount() const { return num_global_slots(); } 1507 int Scope::ContextGlobalCount() const { return num_global_slots(); }
1507 1508
1508 } // namespace internal 1509 } // namespace internal
1509 } // namespace v8 1510 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/contexts.h » ('j') | src/factory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698