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/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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
9 #include "src/messages.h" | 10 #include "src/messages.h" |
10 #include "src/parser.h" | 11 #include "src/parsing/parser.h" // for ParseInfo |
11 #include "src/scopeinfo.h" | |
12 | 12 |
13 namespace v8 { | 13 namespace v8 { |
14 namespace internal { | 14 namespace internal { |
15 | 15 |
16 // ---------------------------------------------------------------------------- | 16 // ---------------------------------------------------------------------------- |
17 // Implementation of LocalsMap | 17 // Implementation of LocalsMap |
18 // | 18 // |
19 // Note: We are storing the handle locations as key values in the hash map. | 19 // Note: We are storing the handle locations as key values in the hash map. |
20 // When inserting a new variable via Declare(), we rely on the fact that | 20 // When inserting a new variable via Declare(), we rely on the fact that |
21 // the handle location remains alive for the duration of that variable | 21 // the handle location remains alive for the duration of that variable |
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1665 function_ != NULL && function_->proxy()->var()->IsContextSlot(); | 1665 function_ != NULL && function_->proxy()->var()->IsContextSlot(); |
1666 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - | 1666 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - num_global_slots() - |
1667 (is_function_var_in_context ? 1 : 0); | 1667 (is_function_var_in_context ? 1 : 0); |
1668 } | 1668 } |
1669 | 1669 |
1670 | 1670 |
1671 int Scope::ContextGlobalCount() const { return num_global_slots(); } | 1671 int Scope::ContextGlobalCount() const { return num_global_slots(); } |
1672 | 1672 |
1673 } // namespace internal | 1673 } // namespace internal |
1674 } // namespace v8 | 1674 } // namespace v8 |
OLD | NEW |