Chromium Code Reviews| Index: src/profile-generator.cc |
| diff --git a/src/profile-generator.cc b/src/profile-generator.cc |
| index 256136d9f19923d08f145e5091d463714b6fd83c..fb0af91afddcb4756974c390a57c576c5fe05d3f 100644 |
| --- a/src/profile-generator.cc |
| +++ b/src/profile-generator.cc |
| @@ -2461,6 +2461,21 @@ void V8HeapExplorer::SetObjectName(HeapObject* object) { |
| } |
| +bool V8HeapExplorer::IsEssentialObject(Object* object) { |
| + // We have to use raw_unchecked_* version because when the |
| + // empty_*_array object itself is being processed all its inline properties |
|
yurys
2012/04/20 13:08:40
The comment needs update.
alexeif
2012/04/20 13:33:50
Done.
|
| + // are invalid and the check in empty_*_array() function would fail. |
| + return object->IsHeapObject() |
| + && !object->IsOddball() |
| + && object != heap_->raw_unchecked_empty_byte_array() |
| + && object != heap_->raw_unchecked_empty_fixed_array() |
| + && object != heap_->raw_unchecked_empty_descriptor_array() |
| + && object != heap_->raw_unchecked_fixed_array_map() |
| + && object != heap_->raw_unchecked_global_property_cell_map() |
| + && object != heap_->raw_unchecked_shared_function_info_map(); |
| +} |
| + |
| + |
| void V8HeapExplorer::SetClosureReference(HeapObject* parent_obj, |
| HeapEntry* parent_entry, |
| String* reference_name, |
| @@ -2516,10 +2531,7 @@ void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj, |
| int field_offset) { |
| HeapEntry* child_entry = GetEntry(child_obj); |
| if (child_entry == NULL) return; |
| - // We have to use raw_unchecked_* version because when the |
| - // empty_fixed_array itself is being processed all its inline properties |
| - // are invalid and the check in empty_fixed_array() function fails. |
| - if (child_obj != heap_->raw_unchecked_empty_fixed_array()) { |
| + if (IsEssentialObject(child_obj)) { |
| filler_->SetNamedReference(HeapGraphEdge::kInternal, |
| parent_obj, parent_entry, |
| reference_name, |
| @@ -2536,8 +2548,7 @@ void V8HeapExplorer::SetInternalReference(HeapObject* parent_obj, |
| int field_offset) { |
| HeapEntry* child_entry = GetEntry(child_obj); |
| if (child_entry == NULL) return; |
| - // See the comment regarding raw_unchecked_* above. |
| - if (child_obj != heap_->raw_unchecked_empty_fixed_array()) { |
| + if (IsEssentialObject(child_obj)) { |
| filler_->SetNamedReference(HeapGraphEdge::kInternal, |
| parent_obj, parent_entry, |
| collection_->names()->GetName(index), |
| @@ -2552,7 +2563,7 @@ void V8HeapExplorer::SetHiddenReference(HeapObject* parent_obj, |
| int index, |
| Object* child_obj) { |
| HeapEntry* child_entry = GetEntry(child_obj); |
| - if (child_entry != NULL) { |
| + if (child_entry != NULL && IsEssentialObject(child_obj)) { |
| filler_->SetIndexedReference(HeapGraphEdge::kHidden, |
| parent_obj, |
| parent_entry, |
| @@ -2692,11 +2703,7 @@ const char* V8HeapExplorer::GetStrongGcSubrootName(Object* object) { |
| void V8HeapExplorer::TagObject(Object* obj, const char* tag) { |
| - if (obj->IsHeapObject() && |
| - !obj->IsOddball() && |
| - obj != heap_->raw_unchecked_empty_byte_array() && |
| - obj != heap_->raw_unchecked_empty_fixed_array() && |
| - obj != heap_->raw_unchecked_empty_descriptor_array()) { |
| + if (IsEssentialObject(obj)) { |
| objects_tags_.SetTag(obj, tag); |
| } |
| } |