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 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1651 ASSERT(IsAligned(size_in_bytes, kPointerSize)); | 1651 ASSERT(IsAligned(size_in_bytes, kPointerSize)); |
1652 | 1652 |
1653 // We write a map and possibly size information to the block. If the block | 1653 // We write a map and possibly size information to the block. If the block |
1654 // is big enough to be a FreeSpace with at least one extra word (the next | 1654 // is big enough to be a FreeSpace with at least one extra word (the next |
1655 // pointer), we set its map to be the free space map and its size to an | 1655 // pointer), we set its map to be the free space map and its size to an |
1656 // appropriate array length for the desired size from HeapObject::Size(). | 1656 // appropriate array length for the desired size from HeapObject::Size(). |
1657 // If the block is too small (eg, one or two words), to hold both a size | 1657 // If the block is too small (eg, one or two words), to hold both a size |
1658 // field and a next pointer, we give it a filler map that gives it the | 1658 // field and a next pointer, we give it a filler map that gives it the |
1659 // correct size. | 1659 // correct size. |
1660 if (size_in_bytes > FreeSpace::kHeaderSize) { | 1660 if (size_in_bytes > FreeSpace::kHeaderSize) { |
1661 set_map(heap->raw_unchecked_free_space_map()); | 1661 set_map_unsafe(heap->raw_unchecked_free_space_map()); |
1662 // Can't use FreeSpace::cast because it fails during deserialization. | 1662 // Can't use FreeSpace::cast because it fails during deserialization. |
1663 FreeSpace* this_as_free_space = reinterpret_cast<FreeSpace*>(this); | 1663 FreeSpace* this_as_free_space = reinterpret_cast<FreeSpace*>(this); |
1664 this_as_free_space->set_size(size_in_bytes); | 1664 this_as_free_space->set_size(size_in_bytes); |
1665 } else if (size_in_bytes == kPointerSize) { | 1665 } else if (size_in_bytes == kPointerSize) { |
1666 set_map(heap->raw_unchecked_one_pointer_filler_map()); | 1666 set_map_unsafe(heap->raw_unchecked_one_pointer_filler_map()); |
1667 } else if (size_in_bytes == 2 * kPointerSize) { | 1667 } else if (size_in_bytes == 2 * kPointerSize) { |
1668 set_map(heap->raw_unchecked_two_pointer_filler_map()); | 1668 set_map_unsafe(heap->raw_unchecked_two_pointer_filler_map()); |
1669 } else { | 1669 } else { |
1670 UNREACHABLE(); | 1670 UNREACHABLE(); |
1671 } | 1671 } |
1672 // We would like to ASSERT(Size() == size_in_bytes) but this would fail during | 1672 // We would like to ASSERT(Size() == size_in_bytes) but this would fail during |
1673 // deserialization because the free space map is not done yet. | 1673 // deserialization because the free space map is not done yet. |
1674 } | 1674 } |
1675 | 1675 |
1676 | 1676 |
1677 FreeListNode* FreeListNode::next() { | 1677 FreeListNode* FreeListNode::next() { |
1678 ASSERT(IsFreeListNode(this)); | 1678 ASSERT(IsFreeListNode(this)); |
(...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2636 object->ShortPrint(); | 2636 object->ShortPrint(); |
2637 PrintF("\n"); | 2637 PrintF("\n"); |
2638 } | 2638 } |
2639 printf(" --------------------------------------\n"); | 2639 printf(" --------------------------------------\n"); |
2640 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 2640 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
2641 } | 2641 } |
2642 | 2642 |
2643 #endif // DEBUG | 2643 #endif // DEBUG |
2644 | 2644 |
2645 } } // namespace v8::internal | 2645 } } // namespace v8::internal |
OLD | NEW |