Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/spaces.cc

Issue 8595008: Remove more superfluous write barriers. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« src/objects.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« src/objects.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698