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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 | 595 |
596 | 596 |
597 void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) { | 597 void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) { |
598 ASSERT(space->identity() == OLD_POINTER_SPACE || | 598 ASSERT(space->identity() == OLD_POINTER_SPACE || |
599 space->identity() == OLD_DATA_SPACE || | 599 space->identity() == OLD_DATA_SPACE || |
600 space->identity() == CODE_SPACE); | 600 space->identity() == CODE_SPACE); |
601 | 601 |
602 static const int kMaxMaxEvacuationCandidates = 1000; | 602 static const int kMaxMaxEvacuationCandidates = 1000; |
603 int number_of_pages = space->CountTotalPages(); | 603 int number_of_pages = space->CountTotalPages(); |
604 int max_evacuation_candidates = | 604 int max_evacuation_candidates = |
605 static_cast<int>(sqrt(static_cast<double>(number_of_pages / 2)) + 1); | 605 static_cast<int>(sqrt(number_of_pages / 2.0) + 1); |
606 | 606 |
607 if (FLAG_stress_compaction || FLAG_always_compact) { | 607 if (FLAG_stress_compaction || FLAG_always_compact) { |
608 max_evacuation_candidates = kMaxMaxEvacuationCandidates; | 608 max_evacuation_candidates = kMaxMaxEvacuationCandidates; |
609 } | 609 } |
610 | 610 |
611 class Candidate { | 611 class Candidate { |
612 public: | 612 public: |
613 Candidate() : fragmentation_(0), page_(NULL) { } | 613 Candidate() : fragmentation_(0), page_(NULL) { } |
614 Candidate(int f, Page* p) : fragmentation_(f), page_(p) { } | 614 Candidate(int f, Page* p) : fragmentation_(f), page_(p) { } |
615 | 615 |
(...skipping 3632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4248 while (buffer != NULL) { | 4248 while (buffer != NULL) { |
4249 SlotsBuffer* next_buffer = buffer->next(); | 4249 SlotsBuffer* next_buffer = buffer->next(); |
4250 DeallocateBuffer(buffer); | 4250 DeallocateBuffer(buffer); |
4251 buffer = next_buffer; | 4251 buffer = next_buffer; |
4252 } | 4252 } |
4253 *buffer_address = NULL; | 4253 *buffer_address = NULL; |
4254 } | 4254 } |
4255 | 4255 |
4256 | 4256 |
4257 } } // namespace v8::internal | 4257 } } // namespace v8::internal |
OLD | NEW |