| 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 3433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3444 } | 3444 } |
| 3445 | 3445 |
| 3446 | 3446 |
| 3447 bool Heap::CanMoveObjectStart(HeapObject* object) { | 3447 bool Heap::CanMoveObjectStart(HeapObject* object) { |
| 3448 Address address = object->address(); | 3448 Address address = object->address(); |
| 3449 bool is_in_old_pointer_space = InOldPointerSpace(address); | 3449 bool is_in_old_pointer_space = InOldPointerSpace(address); |
| 3450 bool is_in_old_data_space = InOldDataSpace(address); | 3450 bool is_in_old_data_space = InOldDataSpace(address); |
| 3451 | 3451 |
| 3452 if (lo_space()->Contains(object)) return false; | 3452 if (lo_space()->Contains(object)) return false; |
| 3453 | 3453 |
| 3454 // We cannot move the object start if the given old space page is | 3454 Page* page = Page::FromAddress(address); |
| 3455 // concurrently swept. | 3455 // We can move the object start if: |
| 3456 // (1) the object is not in old pointer or old data space, |
| 3457 // (2) the page of the object was already swept, |
| 3458 // (3) the page was already concurrently swept. This case is an optimization |
| 3459 // for concurrent sweeping. The WasSwept predicate for concurrently swept |
| 3460 // pages is set after sweeping all pages. |
| 3456 return (!is_in_old_pointer_space && !is_in_old_data_space) || | 3461 return (!is_in_old_pointer_space && !is_in_old_data_space) || |
| 3457 Page::FromAddress(address)->parallel_sweeping() <= | 3462 page->WasSwept() || |
| 3458 MemoryChunk::PARALLEL_SWEEPING_FINALIZE; | 3463 (mark_compact_collector()->AreSweeperThreadsActivated() && |
| 3464 page->parallel_sweeping() <= |
| 3465 MemoryChunk::PARALLEL_SWEEPING_FINALIZE); |
| 3459 } | 3466 } |
| 3460 | 3467 |
| 3461 | 3468 |
| 3462 void Heap::AdjustLiveBytes(Address address, int by, InvocationMode mode) { | 3469 void Heap::AdjustLiveBytes(Address address, int by, InvocationMode mode) { |
| 3463 if (incremental_marking()->IsMarking() && | 3470 if (incremental_marking()->IsMarking() && |
| 3464 Marking::IsBlack(Marking::MarkBitFrom(address))) { | 3471 Marking::IsBlack(Marking::MarkBitFrom(address))) { |
| 3465 if (mode == FROM_GC) { | 3472 if (mode == FROM_GC) { |
| 3466 MemoryChunk::IncrementLiveBytesFromGC(address, by); | 3473 MemoryChunk::IncrementLiveBytesFromGC(address, by); |
| 3467 } else { | 3474 } else { |
| 3468 MemoryChunk::IncrementLiveBytesFromMutator(address, by); | 3475 MemoryChunk::IncrementLiveBytesFromMutator(address, by); |
| (...skipping 3268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6737 static_cast<int>(object_sizes_last_time_[index])); | 6744 static_cast<int>(object_sizes_last_time_[index])); |
| 6738 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6745 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6739 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6746 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6740 | 6747 |
| 6741 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6748 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6742 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6749 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6743 ClearObjectStats(); | 6750 ClearObjectStats(); |
| 6744 } | 6751 } |
| 6745 | 6752 |
| 6746 } } // namespace v8::internal | 6753 } } // namespace v8::internal |
| OLD | NEW |