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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 359 |
360 | 360 |
361 void Heap::CopyBlock(Address dst, Address src, int byte_size) { | 361 void Heap::CopyBlock(Address dst, Address src, int byte_size) { |
362 ASSERT(IsAligned(byte_size, kPointerSize)); | 362 ASSERT(IsAligned(byte_size, kPointerSize)); |
363 CopyWords(reinterpret_cast<Object**>(dst), | 363 CopyWords(reinterpret_cast<Object**>(dst), |
364 reinterpret_cast<Object**>(src), | 364 reinterpret_cast<Object**>(src), |
365 byte_size / kPointerSize); | 365 byte_size / kPointerSize); |
366 } | 366 } |
367 | 367 |
368 | 368 |
369 void Heap::CopyBlockToOldSpaceAndUpdateWriteBarrier(Address dst, | |
370 Address src, | |
371 int byte_size) { | |
372 ASSERT(IsAligned(byte_size, kPointerSize)); | |
373 | |
374 for (int remaining = byte_size / kPointerSize; | |
375 remaining > 0; | |
376 remaining--) { | |
377 Memory::Object_at(dst) = Memory::Object_at(src); | |
378 | |
379 if (InNewSpace(Memory::Object_at(dst))) { | |
380 store_buffer_.Mark(dst); | |
381 } | |
382 | |
383 dst += kPointerSize; | |
384 src += kPointerSize; | |
385 } | |
386 } | |
387 | |
388 | |
389 void Heap::MoveBlock(Address dst, Address src, int byte_size) { | 369 void Heap::MoveBlock(Address dst, Address src, int byte_size) { |
390 ASSERT(IsAligned(byte_size, kPointerSize)); | 370 ASSERT(IsAligned(byte_size, kPointerSize)); |
391 | 371 |
392 int size_in_words = byte_size / kPointerSize; | 372 int size_in_words = byte_size / kPointerSize; |
393 | 373 |
394 if ((dst < src) || (dst >= (src + size_in_words))) { | 374 if ((dst < src) || (dst >= (src + size_in_words))) { |
395 ASSERT((dst >= (src + size_in_words)) || | 375 ASSERT((dst >= (src + size_in_words)) || |
396 ((OffsetFrom(reinterpret_cast<Address>(src)) - | 376 ((OffsetFrom(reinterpret_cast<Address>(src)) - |
397 OffsetFrom(reinterpret_cast<Address>(dst))) >= kPointerSize)); | 377 OffsetFrom(reinterpret_cast<Address>(dst))) >= kPointerSize)); |
398 | 378 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 | 681 |
702 | 682 |
703 Heap* _inline_get_heap_() { | 683 Heap* _inline_get_heap_() { |
704 return HEAP; | 684 return HEAP; |
705 } | 685 } |
706 | 686 |
707 | 687 |
708 } } // namespace v8::internal | 688 } } // namespace v8::internal |
709 | 689 |
710 #endif // V8_HEAP_INL_H_ | 690 #endif // V8_HEAP_INL_H_ |
OLD | NEW |