| 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 > Array::kHeaderSize) { | 1268 if (size_in_bytes > ByteArray::kHeaderSize) { |
| 1269 set_map(Heap::byte_array_map()); | 1269 set_map(Heap::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::one_word_filler_map()); | 1272 set_map(Heap::one_word_filler_map()); |
| 1273 } else if (size_in_bytes == 2 * kPointerSize) { | 1273 } else if (size_in_bytes == 2 * kPointerSize) { |
| 1274 set_map(Heap::two_word_filler_map()); | 1274 set_map(Heap::two_word_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 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2629 reinterpret_cast<Object**>(object->address() | 2629 reinterpret_cast<Object**>(object->address() |
| 2630 + Page::kObjectAreaSize), | 2630 + Page::kObjectAreaSize), |
| 2631 allocation_top); | 2631 allocation_top); |
| 2632 PrintF("\n"); | 2632 PrintF("\n"); |
| 2633 } | 2633 } |
| 2634 } | 2634 } |
| 2635 } | 2635 } |
| 2636 #endif // DEBUG | 2636 #endif // DEBUG |
| 2637 | 2637 |
| 2638 } } // namespace v8::internal | 2638 } } // namespace v8::internal |
| OLD | NEW |