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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 REDUCE_MEMORY_FOOTPRINT | 527 REDUCE_MEMORY_FOOTPRINT |
528 }; | 528 }; |
529 | 529 |
530 CompactionMode mode = COMPACT_FREE_LISTS; | 530 CompactionMode mode = COMPACT_FREE_LISTS; |
531 | 531 |
532 intptr_t reserved = number_of_pages * space->AreaSize(); | 532 intptr_t reserved = number_of_pages * space->AreaSize(); |
533 intptr_t over_reserved = reserved - space->SizeOfObjects(); | 533 intptr_t over_reserved = reserved - space->SizeOfObjects(); |
534 static const intptr_t kFreenessThreshold = 50; | 534 static const intptr_t kFreenessThreshold = 50; |
535 | 535 |
536 if (over_reserved >= 2 * space->AreaSize()) { | 536 if (over_reserved >= 2 * space->AreaSize()) { |
537 | |
538 // If reduction of memory footprint was requested, we are aggressive | 537 // If reduction of memory footprint was requested, we are aggressive |
539 // about choosing pages to free. We expect that half-empty pages | 538 // about choosing pages to free. We expect that half-empty pages |
540 // are easier to compact so slightly bump the limit. | 539 // are easier to compact so slightly bump the limit. |
541 if (reduce_memory_footprint_) { | 540 if (reduce_memory_footprint_) { |
542 mode = REDUCE_MEMORY_FOOTPRINT; | 541 mode = REDUCE_MEMORY_FOOTPRINT; |
543 max_evacuation_candidates += 2; | 542 max_evacuation_candidates += 2; |
544 } | 543 } |
545 | 544 |
546 // If over-usage is very high (more than a third of the space), we | 545 // If over-usage is very high (more than a third of the space), we |
547 // try to free all mostly empty pages. We expect that almost empty | 546 // try to free all mostly empty pages. We expect that almost empty |
(...skipping 3583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4131 while (buffer != NULL) { | 4130 while (buffer != NULL) { |
4132 SlotsBuffer* next_buffer = buffer->next(); | 4131 SlotsBuffer* next_buffer = buffer->next(); |
4133 DeallocateBuffer(buffer); | 4132 DeallocateBuffer(buffer); |
4134 buffer = next_buffer; | 4133 buffer = next_buffer; |
4135 } | 4134 } |
4136 *buffer_address = NULL; | 4135 *buffer_address = NULL; |
4137 } | 4136 } |
4138 | 4137 |
4139 | 4138 |
4140 } } // namespace v8::internal | 4139 } } // namespace v8::internal |
OLD | NEW |