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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 } | 584 } |
585 sweeping_pending_ = false; | 585 sweeping_pending_ = false; |
586 RefillFreeLists(heap()->paged_space(OLD_DATA_SPACE)); | 586 RefillFreeLists(heap()->paged_space(OLD_DATA_SPACE)); |
587 RefillFreeLists(heap()->paged_space(OLD_POINTER_SPACE)); | 587 RefillFreeLists(heap()->paged_space(OLD_POINTER_SPACE)); |
588 heap()->paged_space(OLD_DATA_SPACE)->ResetUnsweptFreeBytes(); | 588 heap()->paged_space(OLD_DATA_SPACE)->ResetUnsweptFreeBytes(); |
589 heap()->paged_space(OLD_POINTER_SPACE)->ResetUnsweptFreeBytes(); | 589 heap()->paged_space(OLD_POINTER_SPACE)->ResetUnsweptFreeBytes(); |
590 } | 590 } |
591 | 591 |
592 | 592 |
593 intptr_t MarkCompactCollector::RefillFreeLists(PagedSpace* space) { | 593 intptr_t MarkCompactCollector::RefillFreeLists(PagedSpace* space) { |
594 FreeList* free_list = space == heap()->old_pointer_space() | 594 FreeList* free_list; |
595 ? free_list_old_pointer_space_.get() | 595 |
596 : free_list_old_data_space_.get(); | 596 if (space == heap()->old_pointer_space()) { |
| 597 free_list = free_list_old_pointer_space_.get(); |
| 598 } else if (space == heap()->old_data_space()) { |
| 599 free_list = free_list_old_data_space_.get(); |
| 600 } else { |
| 601 // Any PagedSpace might invoke RefillFreeLists, so we need to make sure |
| 602 // to only refill them for old data and pointer spaces. |
| 603 return 0; |
| 604 } |
| 605 |
597 intptr_t freed_bytes = space->free_list()->Concatenate(free_list); | 606 intptr_t freed_bytes = space->free_list()->Concatenate(free_list); |
598 space->AddToAccountingStats(freed_bytes); | 607 space->AddToAccountingStats(freed_bytes); |
599 space->DecrementUnsweptFreeBytes(freed_bytes); | 608 space->DecrementUnsweptFreeBytes(freed_bytes); |
600 return freed_bytes; | 609 return freed_bytes; |
601 } | 610 } |
602 | 611 |
603 | 612 |
604 bool MarkCompactCollector::AreSweeperThreadsActivated() { | 613 bool MarkCompactCollector::AreSweeperThreadsActivated() { |
605 return isolate()->sweeper_threads() != NULL; | 614 return isolate()->sweeper_threads() != NULL; |
606 } | 615 } |
(...skipping 3768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4375 while (buffer != NULL) { | 4384 while (buffer != NULL) { |
4376 SlotsBuffer* next_buffer = buffer->next(); | 4385 SlotsBuffer* next_buffer = buffer->next(); |
4377 DeallocateBuffer(buffer); | 4386 DeallocateBuffer(buffer); |
4378 buffer = next_buffer; | 4387 buffer = next_buffer; |
4379 } | 4388 } |
4380 *buffer_address = NULL; | 4389 *buffer_address = NULL; |
4381 } | 4390 } |
4382 | 4391 |
4383 | 4392 |
4384 } } // namespace v8::internal | 4393 } } // namespace v8::internal |
OLD | NEW |