OLD | NEW |
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 <set> | 7 #include <set> |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
11 #include "src/messages.h" | 11 #include "src/messages.h" |
12 #include "src/parsing/parser.h" // for ParseInfo | 12 #include "src/parsing/parse-info.h" |
13 | 13 |
14 namespace v8 { | 14 namespace v8 { |
15 namespace internal { | 15 namespace internal { |
16 | 16 |
17 // ---------------------------------------------------------------------------- | 17 // ---------------------------------------------------------------------------- |
18 // Implementation of LocalsMap | 18 // Implementation of LocalsMap |
19 // | 19 // |
20 // Note: We are storing the handle locations as key values in the hash map. | 20 // Note: We are storing the handle locations as key values in the hash map. |
21 // When inserting a new variable via Declare(), we rely on the fact that | 21 // When inserting a new variable via Declare(), we rely on the fact that |
22 // the handle location remains alive for the duration of that variable | 22 // the handle location remains alive for the duration of that variable |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1786 function != nullptr && function->IsContextSlot(); | 1786 function != nullptr && function->IsContextSlot(); |
1787 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - | 1787 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - |
1788 (is_function_var_in_context ? 1 : 0); | 1788 (is_function_var_in_context ? 1 : 0); |
1789 } | 1789 } |
1790 | 1790 |
1791 | 1791 |
1792 int Scope::ContextGlobalCount() const { return num_global_slots(); } | 1792 int Scope::ContextGlobalCount() const { return num_global_slots(); } |
1793 | 1793 |
1794 } // namespace internal | 1794 } // namespace internal |
1795 } // namespace v8 | 1795 } // namespace v8 |
OLD | NEW |