OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 ASSERT(size_in_bytes > 0); | 1258 ASSERT(size_in_bytes > 0); |
1259 ASSERT(IsAligned(size_in_bytes, kPointerSize)); | 1259 ASSERT(IsAligned(size_in_bytes, kPointerSize)); |
1260 | 1260 |
1261 // We write a map and possibly size information to the block. If the block | 1261 // We write a map and possibly size information to the block. If the block |
1262 // is big enough to be a ByteArray with at least one extra word (the next | 1262 // is big enough to be a ByteArray with at least one extra word (the next |
1263 // pointer), we set its map to be the byte array map and its size to an | 1263 // pointer), we set its map to be the byte array map and its size to an |
1264 // appropriate array length for the desired size from HeapObject::Size(). | 1264 // appropriate array length for the desired size from HeapObject::Size(). |
1265 // If the block is too small (eg, one or two words), to hold both a size | 1265 // If the block is too small (eg, one or two words), to hold both a size |
1266 // field and a next pointer, we give it a filler map that gives it the | 1266 // field and a next pointer, we give it a filler map that gives it the |
1267 // correct size. | 1267 // correct size. |
1268 if (size_in_bytes > ByteArray::kHeaderSize) { | 1268 if (size_in_bytes > ByteArray::kAlignedSize) { |
1269 set_map(Heap::raw_unchecked_byte_array_map()); | 1269 set_map(Heap::raw_unchecked_byte_array_map()); |
1270 ByteArray::cast(this)->set_length(ByteArray::LengthFor(size_in_bytes)); | 1270 ByteArray::cast(this)->set_length(ByteArray::LengthFor(size_in_bytes)); |
1271 } else if (size_in_bytes == kPointerSize) { | 1271 } else if (size_in_bytes == kPointerSize) { |
1272 set_map(Heap::raw_unchecked_one_pointer_filler_map()); | 1272 set_map(Heap::raw_unchecked_one_pointer_filler_map()); |
1273 } else if (size_in_bytes == 2 * kPointerSize) { | 1273 } else if (size_in_bytes == 2 * kPointerSize) { |
1274 set_map(Heap::raw_unchecked_two_pointer_filler_map()); | 1274 set_map(Heap::raw_unchecked_two_pointer_filler_map()); |
1275 } else { | 1275 } else { |
1276 UNREACHABLE(); | 1276 UNREACHABLE(); |
1277 } | 1277 } |
1278 ASSERT(Size() == size_in_bytes); | 1278 ASSERT(Size() == size_in_bytes); |
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2653 reinterpret_cast<Object**>(object->address() | 2653 reinterpret_cast<Object**>(object->address() |
2654 + Page::kObjectAreaSize), | 2654 + Page::kObjectAreaSize), |
2655 allocation_top); | 2655 allocation_top); |
2656 PrintF("\n"); | 2656 PrintF("\n"); |
2657 } | 2657 } |
2658 } | 2658 } |
2659 } | 2659 } |
2660 #endif // DEBUG | 2660 #endif // DEBUG |
2661 | 2661 |
2662 } } // namespace v8::internal | 2662 } } // namespace v8::internal |
OLD | NEW |