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/ast/ast.h" | 10 #include "src/ast/ast.h" |
(...skipping 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 } | 1562 } |
1563 | 1563 |
1564 // Print parameters, if any. | 1564 // Print parameters, if any. |
1565 Variable* function = nullptr; | 1565 Variable* function = nullptr; |
1566 if (is_function_scope()) { | 1566 if (is_function_scope()) { |
1567 AsDeclarationScope()->PrintParameters(); | 1567 AsDeclarationScope()->PrintParameters(); |
1568 function = AsDeclarationScope()->function_var(); | 1568 function = AsDeclarationScope()->function_var(); |
1569 } | 1569 } |
1570 | 1570 |
1571 PrintF(" { // (%d, %d)\n", start_position(), end_position()); | 1571 PrintF(" { // (%d, %d)\n", start_position(), end_position()); |
| 1572 if (is_hidden()) { |
| 1573 Indent(n1, "// is hidden\n"); |
| 1574 } |
1572 | 1575 |
1573 // Function name, if any (named function literals, only). | 1576 // Function name, if any (named function literals, only). |
1574 if (function != nullptr) { | 1577 if (function != nullptr) { |
1575 Indent(n1, "// (local) function name: "); | 1578 Indent(n1, "// (local) function name: "); |
1576 PrintName(function->raw_name()); | 1579 PrintName(function->raw_name()); |
1577 PrintF("\n"); | 1580 PrintF("\n"); |
1578 } | 1581 } |
1579 | 1582 |
1580 // Scope info. | 1583 // Scope info. |
1581 if (is_strict(language_mode())) { | 1584 if (is_strict(language_mode())) { |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2222 Variable* function = | 2225 Variable* function = |
2223 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; | 2226 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; |
2224 bool is_function_var_in_context = | 2227 bool is_function_var_in_context = |
2225 function != nullptr && function->IsContextSlot(); | 2228 function != nullptr && function->IsContextSlot(); |
2226 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 2229 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
2227 (is_function_var_in_context ? 1 : 0); | 2230 (is_function_var_in_context ? 1 : 0); |
2228 } | 2231 } |
2229 | 2232 |
2230 } // namespace internal | 2233 } // namespace internal |
2231 } // namespace v8 | 2234 } // namespace v8 |
OLD | NEW |