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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(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 if (var1->IsContextSlot()) { |
864 if (slot != NULL && slot->type() == Slot::CONTEXT) { | |
865 if (j != i) { | 864 if (j != i) { |
866 list[j] = var1; | 865 list[j] = var1; |
867 } | 866 } |
868 j++; | 867 j++; |
869 } | 868 } |
870 } | 869 } |
871 | 870 |
872 // Sort it. | 871 // Sort it. |
873 for (int k = 1; k < j; k++) { | 872 for (int k = 1; k < j; k++) { |
874 int l = k; | 873 int l = k; |
875 for (int m = k + 1; m < j; m++) { | 874 for (int m = k + 1; m < j; m++) { |
876 if (list[l]->AsSlot()->index() > list[m]->AsSlot()->index()) { | 875 if (list[l]->index() > list[m]->index()) { |
877 l = m; | 876 l = m; |
878 } | 877 } |
879 } | 878 } |
880 list[k] = list[l]; | 879 list[k] = list[l]; |
881 } | 880 } |
882 for (int i = 0; i < j; i++) { | 881 for (int i = 0; i < j; i++) { |
883 SetElementNonStrict(scope_info_list, | 882 SetElementNonStrict(scope_info_list, |
884 scope_info_length, | 883 scope_info_length, |
885 list[i]->name()); | 884 list[i]->name()); |
886 scope_info_length++; | 885 scope_info_length++; |
887 SetElementNonStrict( | 886 SetElementNonStrict( |
888 scope_info_list, | 887 scope_info_list, |
889 scope_info_length, | 888 scope_info_length, |
890 Handle<Smi>(Smi::FromInt(list[i]->AsSlot()->index()))); | 889 Handle<Smi>(Smi::FromInt(list[i]->index()))); |
891 scope_info_length++; | 890 scope_info_length++; |
892 } | 891 } |
893 SetElementNonStrict(scope_info_list, | 892 SetElementNonStrict(scope_info_list, |
894 scope_info_length, | 893 scope_info_length, |
895 Handle<Object>(HEAP->null_value())); | 894 Handle<Object>(HEAP->null_value())); |
896 scope_info_length++; | 895 scope_info_length++; |
897 | 896 |
898 outer_scope = outer_scope->outer_scope(); | 897 outer_scope = outer_scope->outer_scope(); |
899 } while (outer_scope != NULL); | 898 } while (outer_scope != NULL); |
900 | 899 |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1778 | 1777 |
1779 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { | 1778 bool LiveEditFunctionTracker::IsActive(Isolate* isolate) { |
1780 return false; | 1779 return false; |
1781 } | 1780 } |
1782 | 1781 |
1783 #endif // ENABLE_DEBUGGER_SUPPORT | 1782 #endif // ENABLE_DEBUGGER_SUPPORT |
1784 | 1783 |
1785 | 1784 |
1786 | 1785 |
1787 } } // namespace v8::internal | 1786 } } // namespace v8::internal |
OLD | NEW |