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 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 } else { | 1655 } else { |
1656 if (!logging_and_profiling) { | 1656 if (!logging_and_profiling) { |
1657 scavenging_visitors_table_.CopyFrom( | 1657 scavenging_visitors_table_.CopyFrom( |
1658 ScavengingVisitor<TRANSFER_MARKS, | 1658 ScavengingVisitor<TRANSFER_MARKS, |
1659 LOGGING_AND_PROFILING_DISABLED>::GetTable()); | 1659 LOGGING_AND_PROFILING_DISABLED>::GetTable()); |
1660 } else { | 1660 } else { |
1661 scavenging_visitors_table_.CopyFrom( | 1661 scavenging_visitors_table_.CopyFrom( |
1662 ScavengingVisitor<TRANSFER_MARKS, | 1662 ScavengingVisitor<TRANSFER_MARKS, |
1663 LOGGING_AND_PROFILING_ENABLED>::GetTable()); | 1663 LOGGING_AND_PROFILING_ENABLED>::GetTable()); |
1664 } | 1664 } |
| 1665 |
| 1666 if (incremental_marking()->IsCompacting()) { |
| 1667 // When compacting forbid short-circuiting of cons-strings. |
| 1668 // Scavenging code relies on the fact that new space object |
| 1669 // can't be evacuated into evacuation candidate but |
| 1670 // short-circuiting violates this assumption. |
| 1671 scavenging_visitors_table_.Register( |
| 1672 StaticVisitorBase::kVisitShortcutCandidate, |
| 1673 scavenging_visitors_table_.GetVisitorById( |
| 1674 StaticVisitorBase::kVisitConsString)); |
| 1675 } |
1665 } | 1676 } |
1666 } | 1677 } |
1667 | 1678 |
1668 | 1679 |
1669 void Heap::ScavengeObjectSlow(HeapObject** p, HeapObject* object) { | 1680 void Heap::ScavengeObjectSlow(HeapObject** p, HeapObject* object) { |
1670 ASSERT(HEAP->InFromSpace(object)); | 1681 ASSERT(HEAP->InFromSpace(object)); |
1671 MapWord first_word = object->map_word(); | 1682 MapWord first_word = object->map_word(); |
1672 ASSERT(!first_word.IsForwardingAddress()); | 1683 ASSERT(!first_word.IsForwardingAddress()); |
1673 Map* map = first_word.ToMap(); | 1684 Map* map = first_word.ToMap(); |
1674 map->GetHeap()->DoScavengeObject(map, p, object); | 1685 map->GetHeap()->DoScavengeObject(map, p, object); |
(...skipping 4718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6393 isolate_->heap()->store_buffer()->Compact(); | 6404 isolate_->heap()->store_buffer()->Compact(); |
6394 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); | 6405 isolate_->heap()->store_buffer()->Filter(MemoryChunk::ABOUT_TO_BE_FREED); |
6395 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { | 6406 for (chunk = chunks_queued_for_free_; chunk != NULL; chunk = next) { |
6396 next = chunk->next_chunk(); | 6407 next = chunk->next_chunk(); |
6397 isolate_->memory_allocator()->Free(chunk); | 6408 isolate_->memory_allocator()->Free(chunk); |
6398 } | 6409 } |
6399 chunks_queued_for_free_ = NULL; | 6410 chunks_queued_for_free_ = NULL; |
6400 } | 6411 } |
6401 | 6412 |
6402 } } // namespace v8::internal | 6413 } } // namespace v8::internal |
OLD | NEW |