| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |