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 2425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2436 heap_->IterateRoots(&extractor, VISIT_ONLY_STRONG); | 2436 heap_->IterateRoots(&extractor, VISIT_ONLY_STRONG); |
2437 extractor.SetCollectingAllReferences(); | 2437 extractor.SetCollectingAllReferences(); |
2438 heap_->IterateRoots(&extractor, VISIT_ALL); | 2438 heap_->IterateRoots(&extractor, VISIT_ALL); |
2439 extractor.FillReferences(this); | 2439 extractor.FillReferences(this); |
2440 filler_ = NULL; | 2440 filler_ = NULL; |
2441 return progress_->ProgressReport(true); | 2441 return progress_->ProgressReport(true); |
2442 } | 2442 } |
2443 | 2443 |
2444 | 2444 |
2445 bool V8HeapExplorer::IsEssentialObject(Object* object) { | 2445 bool V8HeapExplorer::IsEssentialObject(Object* object) { |
2446 // We have to use raw_unchecked_* versions because checked versions | |
2447 // would fail during iteration over object properties. | |
2448 return object->IsHeapObject() | 2446 return object->IsHeapObject() |
2449 && !object->IsOddball() | 2447 && !object->IsOddball() |
2450 && object != heap_->raw_unchecked_empty_byte_array() | 2448 && object != heap_->empty_byte_array() |
2451 && object != heap_->raw_unchecked_empty_fixed_array() | 2449 && object != heap_->empty_fixed_array() |
2452 && object != heap_->raw_unchecked_empty_descriptor_array() | 2450 && object != heap_->empty_descriptor_array() |
2453 && object != heap_->raw_unchecked_fixed_array_map() | 2451 && object != heap_->fixed_array_map() |
2454 && object != heap_->raw_unchecked_global_property_cell_map() | 2452 && object != heap_->global_property_cell_map() |
2455 && object != heap_->raw_unchecked_shared_function_info_map() | 2453 && object != heap_->shared_function_info_map() |
2456 && object != heap_->raw_unchecked_free_space_map() | 2454 && object != heap_->free_space_map() |
2457 && object != heap_->raw_unchecked_one_pointer_filler_map() | 2455 && object != heap_->one_pointer_filler_map() |
2458 && object != heap_->raw_unchecked_two_pointer_filler_map(); | 2456 && object != heap_->two_pointer_filler_map(); |
2459 } | 2457 } |
2460 | 2458 |
2461 | 2459 |
2462 void V8HeapExplorer::SetClosureReference(HeapObject* parent_obj, | 2460 void V8HeapExplorer::SetClosureReference(HeapObject* parent_obj, |
2463 int parent_entry, | 2461 int parent_entry, |
2464 String* reference_name, | 2462 String* reference_name, |
2465 Object* child_obj) { | 2463 Object* child_obj) { |
2466 HeapEntry* child_entry = GetEntry(child_obj); | 2464 HeapEntry* child_entry = GetEntry(child_obj); |
2467 if (child_entry != NULL) { | 2465 if (child_entry != NULL) { |
2468 filler_->SetNamedReference(HeapGraphEdge::kContextVariable, | 2466 filler_->SetNamedReference(HeapGraphEdge::kContextVariable, |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3579 | 3577 |
3580 | 3578 |
3581 void HeapSnapshotJSONSerializer::SortHashMap( | 3579 void HeapSnapshotJSONSerializer::SortHashMap( |
3582 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 3580 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
3583 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 3581 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
3584 sorted_entries->Add(p); | 3582 sorted_entries->Add(p); |
3585 sorted_entries->Sort(SortUsingEntryValue); | 3583 sorted_entries->Sort(SortUsingEntryValue); |
3586 } | 3584 } |
3587 | 3585 |
3588 } } // namespace v8::internal | 3586 } } // namespace v8::internal |
OLD | NEW |