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 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2102 int context_locals = scope_info->ContextLocalCount(); | 2102 int context_locals = scope_info->ContextLocalCount(); |
2103 for (int i = 0; i < context_locals; ++i) { | 2103 for (int i = 0; i < context_locals; ++i) { |
2104 String* local_name = scope_info->ContextLocalName(i); | 2104 String* local_name = scope_info->ContextLocalName(i); |
2105 int idx = Context::MIN_CONTEXT_SLOTS + i; | 2105 int idx = Context::MIN_CONTEXT_SLOTS + i; |
2106 SetClosureReference(js_obj, entry, local_name, context->get(idx)); | 2106 SetClosureReference(js_obj, entry, local_name, context->get(idx)); |
2107 } | 2107 } |
2108 | 2108 |
2109 // Add function variable. | 2109 // Add function variable. |
2110 if (scope_info->HasFunctionName()) { | 2110 if (scope_info->HasFunctionName()) { |
2111 String* name = scope_info->FunctionName(); | 2111 String* name = scope_info->FunctionName(); |
2112 int idx = Context::MIN_CONTEXT_SLOTS + context_locals; | |
2113 #ifdef DEBUG | |
2114 VariableMode mode; | 2112 VariableMode mode; |
2115 ASSERT(idx == scope_info->FunctionContextSlotIndex(name, &mode)); | 2113 int idx = scope_info->FunctionContextSlotIndex(name, &mode); |
2116 #endif | 2114 if (idx >= 0) { |
2117 SetClosureReference(js_obj, entry, name, context->get(idx)); | 2115 SetClosureReference(js_obj, entry, name, context->get(idx)); |
| 2116 } |
2118 } | 2117 } |
2119 } | 2118 } |
2120 } | 2119 } |
2121 | 2120 |
2122 | 2121 |
2123 void V8HeapExplorer::ExtractPropertyReferences(JSObject* js_obj, | 2122 void V8HeapExplorer::ExtractPropertyReferences(JSObject* js_obj, |
2124 HeapEntry* entry) { | 2123 HeapEntry* entry) { |
2125 if (js_obj->HasFastProperties()) { | 2124 if (js_obj->HasFastProperties()) { |
2126 DescriptorArray* descs = js_obj->map()->instance_descriptors(); | 2125 DescriptorArray* descs = js_obj->map()->instance_descriptors(); |
2127 for (int i = 0; i < descs->number_of_descriptors(); i++) { | 2126 for (int i = 0; i < descs->number_of_descriptors(); i++) { |
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3756 | 3755 |
3757 | 3756 |
3758 void HeapSnapshotJSONSerializer::SortHashMap( | 3757 void HeapSnapshotJSONSerializer::SortHashMap( |
3759 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 3758 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
3760 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 3759 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
3761 sorted_entries->Add(p); | 3760 sorted_entries->Add(p); |
3762 sorted_entries->Sort(SortUsingEntryValue); | 3761 sorted_entries->Sort(SortUsingEntryValue); |
3763 } | 3762 } |
3764 | 3763 |
3765 } } // namespace v8::internal | 3764 } } // namespace v8::internal |
OLD | NEW |