| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 int scope_info_length = 0; | 848 int scope_info_length = 0; |
| 849 | 849 |
| 850 // Saves some description of scope. It stores name and indexes of | 850 // Saves some description of scope. It stores name and indexes of |
| 851 // variables in the whole scope chain. Null-named slots delimit | 851 // variables in the whole scope chain. Null-named slots delimit |
| 852 // scopes of this chain. | 852 // scopes of this chain. |
| 853 Scope* outer_scope = scope->outer_scope(); | 853 Scope* outer_scope = scope->outer_scope(); |
| 854 if (outer_scope == NULL) { | 854 if (outer_scope == NULL) { |
| 855 return HEAP->undefined_value(); | 855 return HEAP->undefined_value(); |
| 856 } | 856 } |
| 857 do { | 857 do { |
| 858 ZoneList<Variable*> list(10); | 858 ZoneList<Variable*> list(ZONE, 10); |
| 859 outer_scope->CollectUsedVariables(&list); | 859 outer_scope->CollectUsedVariables(&list); |
| 860 int j = 0; | 860 int j = 0; |
| 861 for (int i = 0; i < list.length(); i++) { | 861 for (int i = 0; i < list.length(); i++) { |
| 862 Variable* var1 = list[i]; | 862 Variable* var1 = list[i]; |
| 863 Slot* slot = var1->AsSlot(); | 863 Slot* slot = var1->AsSlot(); |
| 864 if (slot != NULL && slot->type() == Slot::CONTEXT) { | 864 if (slot != NULL && slot->type() == Slot::CONTEXT) { |
| 865 if (j != i) { | 865 if (j != i) { |
| 866 list[j] = var1; | 866 list[j] = var1; |
| 867 } | 867 } |
| 868 j++; | 868 j++; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 } | 938 } |
| 939 } | 939 } |
| 940 | 940 |
| 941 | 941 |
| 942 // Visitor that collects all references to a particular code object, | 942 // Visitor that collects all references to a particular code object, |
| 943 // including "CODE_TARGET" references in other code objects. | 943 // including "CODE_TARGET" references in other code objects. |
| 944 // It works in context of ZoneScope. | 944 // It works in context of ZoneScope. |
| 945 class ReferenceCollectorVisitor : public ObjectVisitor { | 945 class ReferenceCollectorVisitor : public ObjectVisitor { |
| 946 public: | 946 public: |
| 947 explicit ReferenceCollectorVisitor(Code* original) | 947 explicit ReferenceCollectorVisitor(Code* original) |
| 948 : original_(original), rvalues_(10), reloc_infos_(10), code_entries_(10) { | 948 : original_(original), |
| 949 rvalues_(ZONE, 10), |
| 950 reloc_infos_(ZONE, 10), |
| 951 code_entries_(ZONE, 10) { |
| 949 } | 952 } |
| 950 | 953 |
| 951 virtual void VisitPointers(Object** start, Object** end) { | 954 virtual void VisitPointers(Object** start, Object** end) { |
| 952 for (Object** p = start; p < end; p++) { | 955 for (Object** p = start; p < end; p++) { |
| 953 if (*p == original_) { | 956 if (*p == original_) { |
| 954 rvalues_.Add(p); | 957 rvalues_.Add(p); |
| 955 } | 958 } |
| 956 } | 959 } |
| 957 } | 960 } |
| 958 | 961 |
| (...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1778 | 1781 |
| 1779 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 1782 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
| 1780 return false; | 1783 return false; |
| 1781 } | 1784 } |
| 1782 | 1785 |
| 1783 #endif // ENABLE_DEBUGGER_SUPPORT | 1786 #endif // ENABLE_DEBUGGER_SUPPORT |
| 1784 | 1787 |
| 1785 | 1788 |
| 1786 | 1789 |
| 1787 } } // namespace v8::internal | 1790 } } // namespace v8::internal |
| OLD | NEW |