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

Side by Side Diff: src/heap-profiler.cc

Issue 306001: Heap profiler: skip byte arrays that represent free list blocks when counting allocated objects. (Closed)
Patch Set: added the third type to check Created 11 years, 2 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
« no previous file with comments | « no previous file | src/spaces.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 DebugPrintStats(&printer); 569 DebugPrintStats(&printer);
570 } 570 }
571 571
572 572
573 // 573 //
574 // HeapProfiler class implementation. 574 // HeapProfiler class implementation.
575 // 575 //
576 void HeapProfiler::CollectStats(HeapObject* obj, HistogramInfo* info) { 576 void HeapProfiler::CollectStats(HeapObject* obj, HistogramInfo* info) {
577 InstanceType type = obj->map()->instance_type(); 577 InstanceType type = obj->map()->instance_type();
578 ASSERT(0 <= type && type <= LAST_TYPE); 578 ASSERT(0 <= type && type <= LAST_TYPE);
579 info[type].increment_number(1); 579 if (!FreeListNode::IsFreeListNode(obj)) {
580 info[type].increment_bytes(obj->Size()); 580 info[type].increment_number(1);
581 info[type].increment_bytes(obj->Size());
582 }
581 } 583 }
582 584
583 585
584 static void StackWeakReferenceCallback(Persistent<Value> object, 586 static void StackWeakReferenceCallback(Persistent<Value> object,
585 void* trace) { 587 void* trace) {
586 DeleteArray(static_cast<Address*>(trace)); 588 DeleteArray(static_cast<Address*>(trace));
587 object.Dispose(); 589 object.Dispose();
588 } 590 }
589 591
590 592
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 GlobalHandles::MakeWeak(handle.location(), 673 GlobalHandles::MakeWeak(handle.location(),
672 static_cast<void*>(stack.start()), 674 static_cast<void*>(stack.start()),
673 StackWeakReferenceCallback); 675 StackWeakReferenceCallback);
674 } 676 }
675 677
676 678
677 #endif // ENABLE_LOGGING_AND_PROFILING 679 #endif // ENABLE_LOGGING_AND_PROFILING
678 680
679 681
680 } } // namespace v8::internal 682 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698