| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 ASSERT(space->identity() == OLD_POINTER_SPACE || | 417 ASSERT(space->identity() == OLD_POINTER_SPACE || |
| 418 space->identity() == OLD_DATA_SPACE || | 418 space->identity() == OLD_DATA_SPACE || |
| 419 space->identity() == CODE_SPACE); | 419 space->identity() == CODE_SPACE); |
| 420 | 420 |
| 421 int number_of_pages = space->CountTotalPages(); | 421 int number_of_pages = space->CountTotalPages(); |
| 422 | 422 |
| 423 PageIterator it(space); | 423 PageIterator it(space); |
| 424 const int kMaxMaxEvacuationCandidates = 1000; | 424 const int kMaxMaxEvacuationCandidates = 1000; |
| 425 int max_evacuation_candidates = Min( | 425 int max_evacuation_candidates = Min( |
| 426 kMaxMaxEvacuationCandidates, | 426 kMaxMaxEvacuationCandidates, |
| 427 static_cast<int>(sqrt(number_of_pages / 2) + 1)); | 427 static_cast<int>(sqrt(static_cast<double)(number_of_pages / 2)) + 1)); |
| 428 | 428 |
| 429 if (FLAG_stress_compaction || FLAG_always_compact) { | 429 if (FLAG_stress_compaction || FLAG_always_compact) { |
| 430 max_evacuation_candidates = kMaxMaxEvacuationCandidates; | 430 max_evacuation_candidates = kMaxMaxEvacuationCandidates; |
| 431 } | 431 } |
| 432 | 432 |
| 433 class Candidate { | 433 class Candidate { |
| 434 public: | 434 public: |
| 435 Candidate() : fragmentation_(0), page_(NULL) { } | 435 Candidate() : fragmentation_(0), page_(NULL) { } |
| 436 Candidate(int f, Page* p) : fragmentation_(f), page_(p) { } | 436 Candidate(int f, Page* p) : fragmentation_(f), page_(p) { } |
| 437 | 437 |
| (...skipping 3424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3862 while (buffer != NULL) { | 3862 while (buffer != NULL) { |
| 3863 SlotsBuffer* next_buffer = buffer->next(); | 3863 SlotsBuffer* next_buffer = buffer->next(); |
| 3864 DeallocateBuffer(buffer); | 3864 DeallocateBuffer(buffer); |
| 3865 buffer = next_buffer; | 3865 buffer = next_buffer; |
| 3866 } | 3866 } |
| 3867 *buffer_address = NULL; | 3867 *buffer_address = NULL; |
| 3868 } | 3868 } |
| 3869 | 3869 |
| 3870 | 3870 |
| 3871 } } // namespace v8::internal | 3871 } } // namespace v8::internal |
| OLD | NEW |