| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/debug/debug-scopes.h" | 5 #include "src/debug/debug-scopes.h" |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
| 9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
| 10 #include "src/globals.h" | 10 #include "src/globals.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 nested_scope_chain_.Add(ExtendedScopeInfo(scope_info, | 75 nested_scope_chain_.Add(ExtendedScopeInfo(scope_info, |
| 76 shared_info->start_position(), | 76 shared_info->start_position(), |
| 77 shared_info->end_position())); | 77 shared_info->end_position())); |
| 78 } | 78 } |
| 79 if (!collect_non_locals) return; | 79 if (!collect_non_locals) return; |
| 80 } | 80 } |
| 81 | 81 |
| 82 // Reparse the code and analyze the scopes. | 82 // Reparse the code and analyze the scopes. |
| 83 Scope* scope = NULL; | 83 Scope* scope = NULL; |
| 84 // Check whether we are in global, eval or function code. | 84 // Check whether we are in global, eval or function code. |
| 85 Zone zone; | 85 Zone zone(isolate->allocator()); |
| 86 if (scope_info->scope_type() != FUNCTION_SCOPE) { | 86 if (scope_info->scope_type() != FUNCTION_SCOPE) { |
| 87 // Global or eval code. | 87 // Global or eval code. |
| 88 Handle<Script> script(Script::cast(shared_info->script())); | 88 Handle<Script> script(Script::cast(shared_info->script())); |
| 89 ParseInfo info(&zone, script); | 89 ParseInfo info(&zone, script); |
| 90 if (scope_info->scope_type() == SCRIPT_SCOPE) { | 90 if (scope_info->scope_type() == SCRIPT_SCOPE) { |
| 91 info.set_global(); | 91 info.set_global(); |
| 92 } else { | 92 } else { |
| 93 DCHECK(scope_info->scope_type() == EVAL_SCOPE); | 93 DCHECK(scope_info->scope_type() == EVAL_SCOPE); |
| 94 info.set_eval(); | 94 info.set_eval(); |
| 95 info.set_context(Handle<Context>(function->context())); | 95 info.set_context(Handle<Context>(function->context())); |
| (...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 DCHECK(beg_pos >= 0 && end_pos >= 0); | 831 DCHECK(beg_pos >= 0 && end_pos >= 0); |
| 832 if (beg_pos <= position && position < end_pos) { | 832 if (beg_pos <= position && position < end_pos) { |
| 833 GetNestedScopeChain(isolate, inner_scope, position); | 833 GetNestedScopeChain(isolate, inner_scope, position); |
| 834 return; | 834 return; |
| 835 } | 835 } |
| 836 } | 836 } |
| 837 } | 837 } |
| 838 | 838 |
| 839 } // namespace internal | 839 } // namespace internal |
| 840 } // namespace v8 | 840 } // namespace v8 |
| OLD | NEW |