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 2361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2372 SetInternalReference(js_obj, entry, "hidden_properties", value); | 2372 SetInternalReference(js_obj, entry, "hidden_properties", value); |
2373 } | 2373 } |
2374 } | 2374 } |
2375 } | 2375 } |
2376 } | 2376 } |
2377 } | 2377 } |
2378 | 2378 |
2379 | 2379 |
2380 void V8HeapExplorer::ExtractElementReferences(JSObject* js_obj, | 2380 void V8HeapExplorer::ExtractElementReferences(JSObject* js_obj, |
2381 HeapEntry* entry) { | 2381 HeapEntry* entry) { |
2382 if (js_obj->HasFastElements()) { | 2382 if (js_obj->HasFastObjectElements()) { |
2383 FixedArray* elements = FixedArray::cast(js_obj->elements()); | 2383 FixedArray* elements = FixedArray::cast(js_obj->elements()); |
2384 int length = js_obj->IsJSArray() ? | 2384 int length = js_obj->IsJSArray() ? |
2385 Smi::cast(JSArray::cast(js_obj)->length())->value() : | 2385 Smi::cast(JSArray::cast(js_obj)->length())->value() : |
2386 elements->length(); | 2386 elements->length(); |
2387 for (int i = 0; i < length; ++i) { | 2387 for (int i = 0; i < length; ++i) { |
2388 if (!elements->get(i)->IsTheHole()) { | 2388 if (!elements->get(i)->IsTheHole()) { |
2389 SetElementReference(js_obj, entry, i, elements->get(i)); | 2389 SetElementReference(js_obj, entry, i, elements->get(i)); |
2390 } | 2390 } |
2391 } | 2391 } |
2392 } else if (js_obj->HasDictionaryElements()) { | 2392 } else if (js_obj->HasDictionaryElements()) { |
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4045 | 4045 |
4046 | 4046 |
4047 void HeapSnapshotJSONSerializer::SortHashMap( | 4047 void HeapSnapshotJSONSerializer::SortHashMap( |
4048 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 4048 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
4049 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 4049 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
4050 sorted_entries->Add(p); | 4050 sorted_entries->Add(p); |
4051 sorted_entries->Sort(SortUsingEntryValue); | 4051 sorted_entries->Sort(SortUsingEntryValue); |
4052 } | 4052 } |
4053 | 4053 |
4054 } } // namespace v8::internal | 4054 } } // namespace v8::internal |
OLD | NEW |