OLD | NEW |
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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 | 637 |
638 { GCTracer tracer(this, gc_reason, collector_reason); | 638 { GCTracer tracer(this, gc_reason, collector_reason); |
639 GarbageCollectionPrologue(); | 639 GarbageCollectionPrologue(); |
640 // The GC count was incremented in the prologue. Tell the tracer about | 640 // The GC count was incremented in the prologue. Tell the tracer about |
641 // it. | 641 // it. |
642 tracer.set_gc_count(gc_count_); | 642 tracer.set_gc_count(gc_count_); |
643 | 643 |
644 // Tell the tracer which collector we've selected. | 644 // Tell the tracer which collector we've selected. |
645 tracer.set_collector(collector); | 645 tracer.set_collector(collector); |
646 | 646 |
647 HistogramTimer* rate = (collector == SCAVENGER) | 647 { |
648 ? isolate_->counters()->gc_scavenger() | 648 HistogramTimerScope histogram_timer_scope( |
649 : isolate_->counters()->gc_compactor(); | 649 (collector == SCAVENGER) ? isolate_->counters()->gc_scavenger() |
650 rate->Start(); | 650 : isolate_->counters()->gc_compactor()); |
651 next_gc_likely_to_collect_more = | 651 next_gc_likely_to_collect_more = |
652 PerformGarbageCollection(collector, &tracer); | 652 PerformGarbageCollection(collector, &tracer); |
653 rate->Stop(); | 653 } |
654 | 654 |
655 ASSERT(collector == SCAVENGER || incremental_marking()->IsStopped()); | 655 ASSERT(collector == SCAVENGER || incremental_marking()->IsStopped()); |
656 | 656 |
657 // This can do debug callbacks and restart incremental marking. | 657 // This can do debug callbacks and restart incremental marking. |
658 GarbageCollectionEpilogue(); | 658 GarbageCollectionEpilogue(); |
659 } | 659 } |
660 | 660 |
661 if (incremental_marking()->IsStopped()) { | 661 if (incremental_marking()->IsStopped()) { |
662 if (incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull()) { | 662 if (incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull()) { |
663 incremental_marking()->Start(); | 663 incremental_marking()->Start(); |
(...skipping 6841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7505 static_cast<int>(object_sizes_last_time_[index])); | 7505 static_cast<int>(object_sizes_last_time_[index])); |
7506 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7506 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7507 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7507 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7508 | 7508 |
7509 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7509 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7510 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7510 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7511 ClearObjectStats(); | 7511 ClearObjectStats(); |
7512 } | 7512 } |
7513 | 7513 |
7514 } } // namespace v8::internal | 7514 } } // namespace v8::internal |
OLD | NEW |