| 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 Candidate* least = NULL; | 570 Candidate* least = NULL; |
| 571 | 571 |
| 572 PageIterator it(space); | 572 PageIterator it(space); |
| 573 if (it.has_next()) it.next(); // Never compact the first page. | 573 if (it.has_next()) it.next(); // Never compact the first page. |
| 574 | 574 |
| 575 while (it.has_next()) { | 575 while (it.has_next()) { |
| 576 Page* p = it.next(); | 576 Page* p = it.next(); |
| 577 p->ClearEvacuationCandidate(); | 577 p->ClearEvacuationCandidate(); |
| 578 | 578 |
| 579 if (FLAG_stress_compaction) { | 579 if (FLAG_stress_compaction) { |
| 580 int counter = space->heap()->ms_count(); | 580 unsigned int counter = space->heap()->ms_count(); |
| 581 uintptr_t page_number = reinterpret_cast<uintptr_t>(p) >> kPageSizeBits; | 581 uintptr_t page_number = reinterpret_cast<uintptr_t>(p) >> kPageSizeBits; |
| 582 if ((counter & 1) == (page_number & 1)) fragmentation = 1; | 582 if ((counter & 1) == (page_number & 1)) fragmentation = 1; |
| 583 } else if (mode == REDUCE_MEMORY_FOOTPRINT) { | 583 } else if (mode == REDUCE_MEMORY_FOOTPRINT) { |
| 584 // Don't try to release too many pages. | 584 // Don't try to release too many pages. |
| 585 if (estimated_release >= ((over_reserved * 3) / 4)) { | 585 if (estimated_release >= ((over_reserved * 3) / 4)) { |
| 586 continue; | 586 continue; |
| 587 } | 587 } |
| 588 | 588 |
| 589 intptr_t free_bytes = 0; | 589 intptr_t free_bytes = 0; |
| 590 | 590 |
| (...skipping 3558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4149 while (buffer != NULL) { | 4149 while (buffer != NULL) { |
| 4150 SlotsBuffer* next_buffer = buffer->next(); | 4150 SlotsBuffer* next_buffer = buffer->next(); |
| 4151 DeallocateBuffer(buffer); | 4151 DeallocateBuffer(buffer); |
| 4152 buffer = next_buffer; | 4152 buffer = next_buffer; |
| 4153 } | 4153 } |
| 4154 *buffer_address = NULL; | 4154 *buffer_address = NULL; |
| 4155 } | 4155 } |
| 4156 | 4156 |
| 4157 | 4157 |
| 4158 } } // namespace v8::internal | 4158 } } // namespace v8::internal |
| OLD | NEW |