OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
887 class IndexedReferencesExtractor : public ObjectVisitor { | 887 class IndexedReferencesExtractor : public ObjectVisitor { |
888 public: | 888 public: |
889 IndexedReferencesExtractor(V8HeapExplorer* generator, | 889 IndexedReferencesExtractor(V8HeapExplorer* generator, |
890 HeapObject* parent_obj, | 890 HeapObject* parent_obj, |
891 int parent) | 891 int parent) |
892 : generator_(generator), | 892 : generator_(generator), |
893 parent_obj_(parent_obj), | 893 parent_obj_(parent_obj), |
894 parent_(parent), | 894 parent_(parent), |
895 next_index_(1) { | 895 next_index_(1) { |
896 } | 896 } |
897 void VisitCodeEntry(Address entry_address) { | |
898 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); | |
yurys
2013/07/16 18:26:10
Can we have a test for this?
alph
2013/07/17 10:08:22
Sure.
| |
899 generator_->SetInternalReference(parent_obj_, parent_, "code", code); | |
900 generator_->TagObject(code, "(code)"); | |
901 } | |
897 void VisitPointers(Object** start, Object** end) { | 902 void VisitPointers(Object** start, Object** end) { |
898 for (Object** p = start; p < end; p++) { | 903 for (Object** p = start; p < end; p++) { |
899 if (CheckVisitedAndUnmark(p)) continue; | 904 if (CheckVisitedAndUnmark(p)) continue; |
900 generator_->SetHiddenReference(parent_obj_, parent_, next_index_++, *p); | 905 generator_->SetHiddenReference(parent_obj_, parent_, next_index_++, *p); |
901 } | 906 } |
902 } | 907 } |
903 static void MarkVisitedField(HeapObject* obj, int offset) { | 908 static void MarkVisitedField(HeapObject* obj, int offset) { |
904 if (offset < 0) return; | 909 if (offset < 0) return; |
905 Address field = obj->address() + offset; | 910 Address field = obj->address() + offset; |
906 ASSERT(!Memory::Object_at(field)->IsFailure()); | 911 ASSERT(!Memory::Object_at(field)->IsFailure()); |
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2679 | 2684 |
2680 | 2685 |
2681 void HeapSnapshotJSONSerializer::SortHashMap( | 2686 void HeapSnapshotJSONSerializer::SortHashMap( |
2682 HashMap* map, List<HashMap::Entry*>* sorted_entries) { | 2687 HashMap* map, List<HashMap::Entry*>* sorted_entries) { |
2683 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) | 2688 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) |
2684 sorted_entries->Add(p); | 2689 sorted_entries->Add(p); |
2685 sorted_entries->Sort(SortUsingEntryValue); | 2690 sorted_entries->Sort(SortUsingEntryValue); |
2686 } | 2691 } |
2687 | 2692 |
2688 } } // namespace v8::internal | 2693 } } // namespace v8::internal |
OLD | NEW |