| 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 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 else | 1373 else |
| 1374 PrintName(var->raw_name()); | 1374 PrintName(var->raw_name()); |
| 1375 PrintF("; // "); | 1375 PrintF("; // "); |
| 1376 PrintLocation(var); | 1376 PrintLocation(var); |
| 1377 bool comma = !var->IsUnallocated(); | 1377 bool comma = !var->IsUnallocated(); |
| 1378 if (var->has_forced_context_allocation()) { | 1378 if (var->has_forced_context_allocation()) { |
| 1379 if (comma) PrintF(", "); | 1379 if (comma) PrintF(", "); |
| 1380 PrintF("forced context allocation"); | 1380 PrintF("forced context allocation"); |
| 1381 comma = true; | 1381 comma = true; |
| 1382 } | 1382 } |
| 1383 if (var->maybe_assigned() == kMaybeAssigned) { | 1383 if (var->maybe_assigned() == kNotAssigned) { |
| 1384 if (comma) PrintF(", "); | 1384 if (comma) PrintF(", "); |
| 1385 PrintF("maybe assigned"); | 1385 PrintF("never assigned"); |
| 1386 } | 1386 } |
| 1387 PrintF("\n"); | 1387 PrintF("\n"); |
| 1388 } | 1388 } |
| 1389 } | 1389 } |
| 1390 | 1390 |
| 1391 static void PrintMap(int indent, VariableMap* map, bool locals) { | 1391 static void PrintMap(int indent, VariableMap* map, bool locals) { |
| 1392 for (VariableMap::Entry* p = map->Start(); p != nullptr; p = map->Next(p)) { | 1392 for (VariableMap::Entry* p = map->Start(); p != nullptr; p = map->Next(p)) { |
| 1393 Variable* var = reinterpret_cast<Variable*>(p->value); | 1393 Variable* var = reinterpret_cast<Variable*>(p->value); |
| 1394 bool local = !IsDynamicVariableMode(var->mode()); | 1394 bool local = !IsDynamicVariableMode(var->mode()); |
| 1395 if (locals ? local : !local) { | 1395 if (locals ? local : !local) { |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2027 Variable* function = | 2027 Variable* function = |
| 2028 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; | 2028 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; |
| 2029 bool is_function_var_in_context = | 2029 bool is_function_var_in_context = |
| 2030 function != nullptr && function->IsContextSlot(); | 2030 function != nullptr && function->IsContextSlot(); |
| 2031 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 2031 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
| 2032 (is_function_var_in_context ? 1 : 0); | 2032 (is_function_var_in_context ? 1 : 0); |
| 2033 } | 2033 } |
| 2034 | 2034 |
| 2035 } // namespace internal | 2035 } // namespace internal |
| 2036 } // namespace v8 | 2036 } // namespace v8 |
| OLD | NEW |