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 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1791 ASSERT(bytes_left >= 0); | 1791 ASSERT(bytes_left >= 0); |
1792 | 1792 |
1793 int old_linear_size = static_cast<int>(owner_->limit() - owner_->top()); | 1793 int old_linear_size = static_cast<int>(owner_->limit() - owner_->top()); |
1794 // Mark the old linear allocation area with a free space map so it can be | 1794 // Mark the old linear allocation area with a free space map so it can be |
1795 // skipped when scanning the heap. This also puts it back in the free list | 1795 // skipped when scanning the heap. This also puts it back in the free list |
1796 // if it is big enough. | 1796 // if it is big enough. |
1797 owner_->Free(owner_->top(), old_linear_size); | 1797 owner_->Free(owner_->top(), old_linear_size); |
1798 owner_->heap()->incremental_marking()->OldSpaceStep( | 1798 owner_->heap()->incremental_marking()->OldSpaceStep( |
1799 size_in_bytes - old_linear_size); | 1799 size_in_bytes - old_linear_size); |
1800 | 1800 |
| 1801 // The old-space-step might have finished sweeping and restarted marking. |
| 1802 // Verify that it did not turn the page of the new node into an evacuation |
| 1803 // candidate. |
| 1804 ASSERT(!MarkCompactCollector::IsOnEvacuationCandidate(new_node)); |
| 1805 |
1801 const int kThreshold = IncrementalMarking::kAllocatedThreshold; | 1806 const int kThreshold = IncrementalMarking::kAllocatedThreshold; |
1802 | 1807 |
1803 // Memory in the linear allocation area is counted as allocated. We may free | 1808 // Memory in the linear allocation area is counted as allocated. We may free |
1804 // a little of this again immediately - see below. | 1809 // a little of this again immediately - see below. |
1805 owner_->Allocate(new_node_size); | 1810 owner_->Allocate(new_node_size); |
1806 | 1811 |
1807 if (bytes_left > kThreshold && | 1812 if (bytes_left > kThreshold && |
1808 owner_->heap()->incremental_marking()->IsMarkingIncomplete() && | 1813 owner_->heap()->incremental_marking()->IsMarkingIncomplete() && |
1809 FLAG_incremental_marking_steps) { | 1814 FLAG_incremental_marking_steps) { |
1810 int linear_size = owner_->RoundSizeDownToObjectAlignment(kThreshold); | 1815 int linear_size = owner_->RoundSizeDownToObjectAlignment(kThreshold); |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2518 object->ShortPrint(); | 2523 object->ShortPrint(); |
2519 PrintF("\n"); | 2524 PrintF("\n"); |
2520 } | 2525 } |
2521 printf(" --------------------------------------\n"); | 2526 printf(" --------------------------------------\n"); |
2522 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 2527 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
2523 } | 2528 } |
2524 | 2529 |
2525 #endif // DEBUG | 2530 #endif // DEBUG |
2526 | 2531 |
2527 } } // namespace v8::internal | 2532 } } // namespace v8::internal |
OLD | NEW |