| 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 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2150 obj->Iterate(&refs_extractor); | 2150 obj->Iterate(&refs_extractor); |
| 2151 } | 2151 } |
| 2152 } | 2152 } |
| 2153 | 2153 |
| 2154 | 2154 |
| 2155 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, | 2155 void V8HeapExplorer::ExtractClosureReferences(JSObject* js_obj, |
| 2156 HeapEntry* entry) { | 2156 HeapEntry* entry) { |
| 2157 if (!js_obj->IsJSFunction()) return; | 2157 if (!js_obj->IsJSFunction()) return; |
| 2158 | 2158 |
| 2159 JSFunction* func = JSFunction::cast(js_obj); | 2159 JSFunction* func = JSFunction::cast(js_obj); |
| 2160 Context* context = func->context(); | 2160 Context* context = func->context()->declaration_context(); |
| 2161 ScopeInfo* scope_info = context->closure()->shared()->scope_info(); | 2161 ScopeInfo* scope_info = context->closure()->shared()->scope_info(); |
| 2162 | 2162 |
| 2163 if (func->shared()->bound()) { | 2163 if (func->shared()->bound()) { |
| 2164 FixedArray* bindings = func->function_bindings(); | 2164 FixedArray* bindings = func->function_bindings(); |
| 2165 SetNativeBindReference(js_obj, entry, "bound_this", | 2165 SetNativeBindReference(js_obj, entry, "bound_this", |
| 2166 bindings->get(JSFunction::kBoundThisIndex)); | 2166 bindings->get(JSFunction::kBoundThisIndex)); |
| 2167 SetNativeBindReference(js_obj, entry, "bound_function", | 2167 SetNativeBindReference(js_obj, entry, "bound_function", |
| 2168 bindings->get(JSFunction::kBoundFunctionIndex)); | 2168 bindings->get(JSFunction::kBoundFunctionIndex)); |
| 2169 for (int i = JSFunction::kBoundArgumentsStartIndex; | 2169 for (int i = JSFunction::kBoundArgumentsStartIndex; |
| 2170 i < bindings->length(); i++) { | 2170 i < bindings->length(); i++) { |
| (...skipping 1728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3899 | 3899 |
| 3900 | 3900 |
| 3901 void HeapSnapshotJSONSerializer::SortHashMap( | 3901 void HeapSnapshotJSONSerializer::SortHashMap( |
| 3902 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 3902 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
| 3903 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 3903 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
| 3904 sorted_entries->Add(p); | 3904 sorted_entries->Add(p); |
| 3905 sorted_entries->Sort(SortUsingEntryValue); | 3905 sorted_entries->Sort(SortUsingEntryValue); |
| 3906 } | 3906 } |
| 3907 | 3907 |
| 3908 } } // namespace v8::internal | 3908 } } // namespace v8::internal |
| OLD | NEW |