Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: src/profile-generator.cc

Issue 10021052: Hide internal references pointing to the empty array in heap profiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor change. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 } 2512 }
2513 } 2513 }
2514 2514
2515 2515
2516 void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj, 2516 void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj,
2517 HeapEntry* parent_entry, 2517 HeapEntry* parent_entry,
2518 const char* reference_name, 2518 const char* reference_name,
2519 Object* child_obj, 2519 Object* child_obj,
2520 int field_offset) { 2520 int field_offset) {
2521 HeapEntry* child_entry = GetEntry(child_obj); 2521 HeapEntry* child_entry = GetEntry(child_obj);
2522 if (child_entry != NULL) { 2522 if (child_entry == NULL) return;
2523 // We have to use raw_unchecked_* version because when the
2524 // empty_fixed_array itself is being processed all its inline properties
2525 // are invalid and the check in empty_fixed_array() function fails.
2526 if (child_obj != heap_->raw_unchecked_empty_fixed_array()) {
2523 filler_->SetNamedReference(HeapGraphEdge::kInternal, 2527 filler_->SetNamedReference(HeapGraphEdge::kInternal,
2524 parent_obj, 2528 parent_obj, parent_entry,
2525 parent_entry,
2526 reference_name, 2529 reference_name,
2527 child_obj, 2530 child_obj, child_entry);
2528 child_entry);
2529 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset);
2530 } 2531 }
2532 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset);
2531 } 2533 }
2532 2534
2533 2535
2534 void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj, 2536 void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj,
2535 HeapEntry* parent_entry, 2537 HeapEntry* parent_entry,
2536 int index, 2538 int index,
2537 Object* child_obj, 2539 Object* child_obj,
2538 int field_offset) { 2540 int field_offset) {
2539 HeapEntry* child_entry = GetEntry(child_obj); 2541 HeapEntry* child_entry = GetEntry(child_obj);
2540 if (child_entry != NULL) { 2542 if (child_entry == NULL) return;
2543 // See the comment regarding raw_unchecked_* above.
2544 if (child_obj != heap_->raw_unchecked_empty_fixed_array()) {
2541 filler_->SetNamedReference(HeapGraphEdge::kInternal, 2545 filler_->SetNamedReference(HeapGraphEdge::kInternal,
2542 parent_obj, 2546 parent_obj, parent_entry,
2543 parent_entry,
2544 collection_->names()->GetName(index), 2547 collection_->names()->GetName(index),
2545 child_obj, 2548 child_obj, child_entry);
2546 child_entry);
2547 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset);
2548 } 2549 }
2550 IndexedReferencesExtractor::MarkVisitedField(parent_obj, field_offset);
2549 } 2551 }
2550 2552
2551 2553
2552 void V8HeapExplorer::SetHiddenReference(HeapObject* parent_obj, 2554 void V8HeapExplorer::SetHiddenReference(HeapObject* parent_obj,
2553 HeapEntry* parent_entry, 2555 HeapEntry* parent_entry,
2554 int index, 2556 int index,
2555 Object* child_obj) { 2557 Object* child_obj) {
2556 HeapEntry* child_entry = GetEntry(child_obj); 2558 HeapEntry* child_entry = GetEntry(child_obj);
2557 if (child_entry != NULL) { 2559 if (child_entry != NULL) {
2558 filler_->SetIndexedReference(HeapGraphEdge::kHidden, 2560 filler_->SetIndexedReference(HeapGraphEdge::kHidden,
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
3903 3905
3904 3906
3905 void HeapSnapshotJSONSerializer::SortHashMap( 3907 void HeapSnapshotJSONSerializer::SortHashMap(
3906 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 3908 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
3907 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 3909 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
3908 sorted_entries->Add(p); 3910 sorted_entries->Add(p);
3909 sorted_entries->Sort(SortUsingEntryValue); 3911 sorted_entries->Sort(SortUsingEntryValue);
3910 } 3912 }
3911 3913
3912 } } // namespace v8::internal 3914 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698