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 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 | 719 |
720 | 720 |
721 void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) { | 721 void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) { |
722 ASSERT(space->identity() == OLD_POINTER_SPACE || | 722 ASSERT(space->identity() == OLD_POINTER_SPACE || |
723 space->identity() == OLD_DATA_SPACE || | 723 space->identity() == OLD_DATA_SPACE || |
724 space->identity() == CODE_SPACE); | 724 space->identity() == CODE_SPACE); |
725 | 725 |
726 static const int kMaxMaxEvacuationCandidates = 1000; | 726 static const int kMaxMaxEvacuationCandidates = 1000; |
727 int number_of_pages = space->CountTotalPages(); | 727 int number_of_pages = space->CountTotalPages(); |
728 int max_evacuation_candidates = | 728 int max_evacuation_candidates = |
729 static_cast<int>(sqrt(number_of_pages / 2.0) + 1); | 729 static_cast<int>(std::sqrt(number_of_pages / 2.0) + 1); |
730 | 730 |
731 if (FLAG_stress_compaction || FLAG_always_compact) { | 731 if (FLAG_stress_compaction || FLAG_always_compact) { |
732 max_evacuation_candidates = kMaxMaxEvacuationCandidates; | 732 max_evacuation_candidates = kMaxMaxEvacuationCandidates; |
733 } | 733 } |
734 | 734 |
735 class Candidate { | 735 class Candidate { |
736 public: | 736 public: |
737 Candidate() : fragmentation_(0), page_(NULL) { } | 737 Candidate() : fragmentation_(0), page_(NULL) { } |
738 Candidate(int f, Page* p) : fragmentation_(f), page_(p) { } | 738 Candidate(int f, Page* p) : fragmentation_(f), page_(p) { } |
739 | 739 |
(...skipping 3611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4351 while (buffer != NULL) { | 4351 while (buffer != NULL) { |
4352 SlotsBuffer* next_buffer = buffer->next(); | 4352 SlotsBuffer* next_buffer = buffer->next(); |
4353 DeallocateBuffer(buffer); | 4353 DeallocateBuffer(buffer); |
4354 buffer = next_buffer; | 4354 buffer = next_buffer; |
4355 } | 4355 } |
4356 *buffer_address = NULL; | 4356 *buffer_address = NULL; |
4357 } | 4357 } |
4358 | 4358 |
4359 | 4359 |
4360 } } // namespace v8::internal | 4360 } } // namespace v8::internal |
OLD | NEW |