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