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 3570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3581 Address block_address = p->area_start(); | 3581 Address block_address = p->area_start(); |
3582 | 3582 |
3583 // Skip over all the dead objects at the start of the page and mark them free. | 3583 // Skip over all the dead objects at the start of the page and mark them free. |
3584 for (; | 3584 for (; |
3585 cell_index < last_cell_index; | 3585 cell_index < last_cell_index; |
3586 cell_index++, block_address += 32 * kPointerSize) { | 3586 cell_index++, block_address += 32 * kPointerSize) { |
3587 if (cells[cell_index] != 0) break; | 3587 if (cells[cell_index] != 0) break; |
3588 } | 3588 } |
3589 size_t size = block_address - p->area_start(); | 3589 size_t size = block_address - p->area_start(); |
3590 if (cell_index == last_cell_index) { | 3590 if (cell_index == last_cell_index) { |
3591 freed_bytes += Free<mode>(space, free_list, p->area_start(), size); | 3591 freed_bytes += Free<mode>(space, free_list, p->area_start(), |
3592 static_cast<int>(size)); | |
3592 ASSERT_EQ(0, p->LiveBytes()); | 3593 ASSERT_EQ(0, p->LiveBytes()); |
3593 return freed_bytes; | 3594 return freed_bytes; |
3594 } | 3595 } |
3595 // Grow the size of the start-of-page free space a little to get up to the | 3596 // Grow the size of the start-of-page free space a little to get up to the |
3596 // first live object. | 3597 // first live object. |
3597 Address free_end = StartOfLiveObject(block_address, cells[cell_index]); | 3598 Address free_end = StartOfLiveObject(block_address, cells[cell_index]); |
3598 // Free the first free space. | 3599 // Free the first free space. |
3599 size = free_end - p->area_start(); | 3600 size = static_cast<int>(free_end - p->area_start()); |
Michael Starzinger
2013/01/30 12:40:44
This won't resolve the problem, because "size" is
Hannes Payer (out of office)
2013/01/30 12:45:31
uuups, fixed.
On 2013/01/30 12:40:44, Michael Sta
| |
3600 freed_bytes += Free<mode>(space, free_list, p->area_start(), size); | 3601 freed_bytes += Free<mode>(space, free_list, p->area_start(),size); |
3601 | 3602 |
3602 // The start of the current free area is represented in undigested form by | 3603 // The start of the current free area is represented in undigested form by |
3603 // the address of the last 32-word section that contained a live object and | 3604 // the address of the last 32-word section that contained a live object and |
3604 // the marking bitmap for that cell, which describes where the live object | 3605 // the marking bitmap for that cell, which describes where the live object |
3605 // started. Unless we find a large free space in the bitmap we will not | 3606 // started. Unless we find a large free space in the bitmap we will not |
3606 // digest this pair into a real address. We start the iteration here at the | 3607 // digest this pair into a real address. We start the iteration here at the |
3607 // first word in the marking bit map that indicates a live object. | 3608 // first word in the marking bit map that indicates a live object. |
3608 Address free_start = block_address; | 3609 Address free_start = block_address; |
3609 uint32_t free_start_cell = cells[cell_index]; | 3610 uint32_t free_start_cell = cells[cell_index]; |
3610 | 3611 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4015 while (buffer != NULL) { | 4016 while (buffer != NULL) { |
4016 SlotsBuffer* next_buffer = buffer->next(); | 4017 SlotsBuffer* next_buffer = buffer->next(); |
4017 DeallocateBuffer(buffer); | 4018 DeallocateBuffer(buffer); |
4018 buffer = next_buffer; | 4019 buffer = next_buffer; |
4019 } | 4020 } |
4020 *buffer_address = NULL; | 4021 *buffer_address = NULL; |
4021 } | 4022 } |
4022 | 4023 |
4023 | 4024 |
4024 } } // namespace v8::internal | 4025 } } // namespace v8::internal |
OLD | NEW |