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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 tracer.set_collector(collector); | 612 tracer.set_collector(collector); |
613 | 613 |
614 HistogramTimer* rate = (collector == SCAVENGER) | 614 HistogramTimer* rate = (collector == SCAVENGER) |
615 ? isolate_->counters()->gc_scavenger() | 615 ? isolate_->counters()->gc_scavenger() |
616 : isolate_->counters()->gc_compactor(); | 616 : isolate_->counters()->gc_compactor(); |
617 rate->Start(); | 617 rate->Start(); |
618 next_gc_likely_to_collect_more = | 618 next_gc_likely_to_collect_more = |
619 PerformGarbageCollection(collector, &tracer); | 619 PerformGarbageCollection(collector, &tracer); |
620 rate->Stop(); | 620 rate->Stop(); |
621 | 621 |
| 622 ASSERT(collector == SCAVENGER || incremental_marking()->IsStopped()); |
| 623 |
| 624 // This can do debug callbacks and restart incremental marking. |
622 GarbageCollectionEpilogue(); | 625 GarbageCollectionEpilogue(); |
623 } | 626 } |
624 | 627 |
625 ASSERT(collector == SCAVENGER || incremental_marking()->IsStopped()); | |
626 if (incremental_marking()->IsStopped()) { | 628 if (incremental_marking()->IsStopped()) { |
627 if (incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull()) { | 629 if (incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull()) { |
628 incremental_marking()->Start(); | 630 incremental_marking()->Start(); |
629 } | 631 } |
630 } | 632 } |
631 | 633 |
632 return next_gc_likely_to_collect_more; | 634 return next_gc_likely_to_collect_more; |
633 } | 635 } |
634 | 636 |
635 | 637 |
(...skipping 6682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7318 static_cast<int>(object_sizes_last_time_[index])); | 7320 static_cast<int>(object_sizes_last_time_[index])); |
7319 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7321 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7320 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7322 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7321 | 7323 |
7322 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7324 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7323 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7325 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7324 ClearObjectStats(); | 7326 ClearObjectStats(); |
7325 } | 7327 } |
7326 | 7328 |
7327 } } // namespace v8::internal | 7329 } } // namespace v8::internal |
OLD | NEW |