| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 if (outer_scope_calls_non_strict_eval_) { | 900 if (outer_scope_calls_non_strict_eval_) { |
| 901 Indent(n1, "// outer scope calls 'eval' in non-strict context\n"); | 901 Indent(n1, "// outer scope calls 'eval' in non-strict context\n"); |
| 902 } | 902 } |
| 903 if (inner_scope_calls_eval_) Indent(n1, "// inner scope calls 'eval'\n"); | 903 if (inner_scope_calls_eval_) Indent(n1, "// inner scope calls 'eval'\n"); |
| 904 if (num_stack_slots_ > 0) { Indent(n1, "// "); | 904 if (num_stack_slots_ > 0) { Indent(n1, "// "); |
| 905 PrintF("%d stack slots\n", num_stack_slots_); } | 905 PrintF("%d stack slots\n", num_stack_slots_); } |
| 906 if (num_heap_slots_ > 0) { Indent(n1, "// "); | 906 if (num_heap_slots_ > 0) { Indent(n1, "// "); |
| 907 PrintF("%d heap slots\n", num_heap_slots_); } | 907 PrintF("%d heap slots\n", num_heap_slots_); } |
| 908 | 908 |
| 909 // Print locals. | 909 // Print locals. |
| 910 Indent(n1, "// function var\n"); |
| 910 if (function_ != NULL) { | 911 if (function_ != NULL) { |
| 911 Indent(n1, "// function var:\n"); | |
| 912 PrintVar(n1, function_->proxy()->var()); | 912 PrintVar(n1, function_->proxy()->var()); |
| 913 } | 913 } |
| 914 | 914 |
| 915 if (temps_.length() > 0) { | 915 Indent(n1, "// temporary vars\n"); |
| 916 Indent(n1, "// temporary vars:\n"); | 916 for (int i = 0; i < temps_.length(); i++) { |
| 917 for (int i = 0; i < temps_.length(); i++) { | 917 PrintVar(n1, temps_[i]); |
| 918 PrintVar(n1, temps_[i]); | |
| 919 } | |
| 920 } | 918 } |
| 921 | 919 |
| 922 if (internals_.length() > 0) { | 920 Indent(n1, "// internal vars\n"); |
| 923 Indent(n1, "// internal vars:\n"); | 921 for (int i = 0; i < internals_.length(); i++) { |
| 924 for (int i = 0; i < internals_.length(); i++) { | 922 PrintVar(n1, internals_[i]); |
| 925 PrintVar(n1, internals_[i]); | |
| 926 } | |
| 927 } | 923 } |
| 928 | 924 |
| 929 if (variables_.Start() != NULL) { | 925 Indent(n1, "// local vars\n"); |
| 930 Indent(n1, "// local vars:\n"); | 926 PrintMap(n1, &variables_); |
| 931 PrintMap(n1, &variables_); | |
| 932 } | |
| 933 | 927 |
| 928 Indent(n1, "// dynamic vars\n"); |
| 934 if (dynamics_ != NULL) { | 929 if (dynamics_ != NULL) { |
| 935 Indent(n1, "// dynamic vars:\n"); | |
| 936 PrintMap(n1, dynamics_->GetMap(DYNAMIC)); | 930 PrintMap(n1, dynamics_->GetMap(DYNAMIC)); |
| 937 PrintMap(n1, dynamics_->GetMap(DYNAMIC_LOCAL)); | 931 PrintMap(n1, dynamics_->GetMap(DYNAMIC_LOCAL)); |
| 938 PrintMap(n1, dynamics_->GetMap(DYNAMIC_GLOBAL)); | 932 PrintMap(n1, dynamics_->GetMap(DYNAMIC_GLOBAL)); |
| 939 } | 933 } |
| 940 | 934 |
| 941 // Print inner scopes (disable by providing negative n). | 935 // Print inner scopes (disable by providing negative n). |
| 942 if (n >= 0) { | 936 if (n >= 0) { |
| 943 for (int i = 0; i < inner_scopes_.length(); i++) { | 937 for (int i = 0; i < inner_scopes_.length(); i++) { |
| 944 PrintF("\n"); | 938 PrintF("\n"); |
| 945 inner_scopes_[i]->Print(n1); | 939 inner_scopes_[i]->Print(n1); |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1407 } | 1401 } |
| 1408 | 1402 |
| 1409 | 1403 |
| 1410 int Scope::ContextLocalCount() const { | 1404 int Scope::ContextLocalCount() const { |
| 1411 if (num_heap_slots() == 0) return 0; | 1405 if (num_heap_slots() == 0) return 0; |
| 1412 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1406 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
| 1413 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); | 1407 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); |
| 1414 } | 1408 } |
| 1415 | 1409 |
| 1416 } } // namespace v8::internal | 1410 } } // namespace v8::internal |
| OLD | NEW |