| 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 3388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3399 ASSERT(0 <= type && type <= LAST_TYPE); | 3399 ASSERT(0 <= type && type <= LAST_TYPE); |
| 3400 info[type].increment_number(1); | 3400 info[type].increment_number(1); |
| 3401 info[type].increment_bytes(obj->Size()); | 3401 info[type].increment_bytes(obj->Size()); |
| 3402 } | 3402 } |
| 3403 #endif | 3403 #endif |
| 3404 | 3404 |
| 3405 | 3405 |
| 3406 #ifdef ENABLE_LOGGING_AND_PROFILING | 3406 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 3407 void HeapProfiler::WriteSample() { | 3407 void HeapProfiler::WriteSample() { |
| 3408 LOG(HeapSampleBeginEvent("Heap", "allocated")); | 3408 LOG(HeapSampleBeginEvent("Heap", "allocated")); |
| 3409 LOG(HeapSampleStats( |
| 3410 "Heap", "allocated", Heap::Capacity(), Heap::SizeOfObjects())); |
| 3409 | 3411 |
| 3410 HistogramInfo info[LAST_TYPE+1]; | 3412 HistogramInfo info[LAST_TYPE+1]; |
| 3411 #define DEF_TYPE_NAME(name) info[name].set_name(#name); | 3413 #define DEF_TYPE_NAME(name) info[name].set_name(#name); |
| 3412 INSTANCE_TYPE_LIST(DEF_TYPE_NAME) | 3414 INSTANCE_TYPE_LIST(DEF_TYPE_NAME) |
| 3413 #undef DEF_TYPE_NAME | 3415 #undef DEF_TYPE_NAME |
| 3414 | 3416 |
| 3415 HeapIterator iterator; | 3417 HeapIterator iterator; |
| 3416 while (iterator.has_next()) { | 3418 while (iterator.has_next()) { |
| 3417 CollectStats(iterator.next(), info); | 3419 CollectStats(iterator.next(), info); |
| 3418 } | 3420 } |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3715 #ifdef DEBUG | 3717 #ifdef DEBUG |
| 3716 bool Heap::GarbageCollectionGreedyCheck() { | 3718 bool Heap::GarbageCollectionGreedyCheck() { |
| 3717 ASSERT(FLAG_gc_greedy); | 3719 ASSERT(FLAG_gc_greedy); |
| 3718 if (Bootstrapper::IsActive()) return true; | 3720 if (Bootstrapper::IsActive()) return true; |
| 3719 if (disallow_allocation_failure()) return true; | 3721 if (disallow_allocation_failure()) return true; |
| 3720 return CollectGarbage(0, NEW_SPACE); | 3722 return CollectGarbage(0, NEW_SPACE); |
| 3721 } | 3723 } |
| 3722 #endif | 3724 #endif |
| 3723 | 3725 |
| 3724 } } // namespace v8::internal | 3726 } } // namespace v8::internal |
| OLD | NEW |