Chromium Code Reviews| 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 3641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3652 scratch2, | 3652 scratch2, |
| 3653 gc_required, | 3653 gc_required, |
| 3654 TAG_OBJECT); | 3654 TAG_OBJECT); |
| 3655 | 3655 |
| 3656 // Set the map. The other fields are left uninitialized. | 3656 // Set the map. The other fields are left uninitialized. |
| 3657 LoadRoot(kScratchRegister, Heap::kConsAsciiStringMapRootIndex); | 3657 LoadRoot(kScratchRegister, Heap::kConsAsciiStringMapRootIndex); |
| 3658 movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); | 3658 movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); |
| 3659 } | 3659 } |
| 3660 | 3660 |
| 3661 | 3661 |
| 3662 void MacroAssembler::AllocateSlicedString(Register result, | |
|
William Hesse
2011/09/01 08:26:02
I would call this "AllocateTwoByteSlicedString".
Yang
2011/09/01 11:27:02
Done. Also changed for ia32.
| |
| 3663 Register scratch1, | |
| 3664 Register scratch2, | |
| 3665 Label* gc_required) { | |
| 3666 // Allocate heap number in new space. | |
| 3667 AllocateInNewSpace(SlicedString::kSize, | |
| 3668 result, | |
| 3669 scratch1, | |
| 3670 scratch2, | |
| 3671 gc_required, | |
| 3672 TAG_OBJECT); | |
| 3673 | |
| 3674 // Set the map. The other fields are left uninitialized. | |
| 3675 LoadRoot(kScratchRegister, Heap::kSlicedStringMapRootIndex); | |
| 3676 movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); | |
| 3677 } | |
| 3678 | |
| 3679 | |
| 3680 void MacroAssembler::AllocateAsciiSlicedString(Register result, | |
| 3681 Register scratch1, | |
| 3682 Register scratch2, | |
| 3683 Label* gc_required) { | |
| 3684 // Allocate heap number in new space. | |
| 3685 AllocateInNewSpace(SlicedString::kSize, | |
| 3686 result, | |
| 3687 scratch1, | |
| 3688 scratch2, | |
| 3689 gc_required, | |
| 3690 TAG_OBJECT); | |
| 3691 | |
| 3692 // Set the map. The other fields are left uninitialized. | |
| 3693 LoadRoot(kScratchRegister, Heap::kSlicedAsciiStringMapRootIndex); | |
| 3694 movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); | |
| 3695 } | |
| 3696 | |
| 3697 | |
| 3662 // Copy memory, byte-by-byte, from source to destination. Not optimized for | 3698 // Copy memory, byte-by-byte, from source to destination. Not optimized for |
| 3663 // long or aligned copies. The contents of scratch and length are destroyed. | 3699 // long or aligned copies. The contents of scratch and length are destroyed. |
| 3664 // Destination is incremented by length, source, length and scratch are | 3700 // Destination is incremented by length, source, length and scratch are |
| 3665 // clobbered. | 3701 // clobbered. |
| 3666 // A simpler loop is faster on small copies, but slower on large ones. | 3702 // A simpler loop is faster on small copies, but slower on large ones. |
| 3667 // The cld() instruction must have been emitted, to set the direction flag(), | 3703 // The cld() instruction must have been emitted, to set the direction flag(), |
| 3668 // before calling this function. | 3704 // before calling this function. |
| 3669 void MacroAssembler::CopyBytes(Register destination, | 3705 void MacroAssembler::CopyBytes(Register destination, |
| 3670 Register source, | 3706 Register source, |
| 3671 Register length, | 3707 Register length, |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3852 CPU::FlushICache(address_, size_); | 3888 CPU::FlushICache(address_, size_); |
| 3853 | 3889 |
| 3854 // Check that the code was patched as expected. | 3890 // Check that the code was patched as expected. |
| 3855 ASSERT(masm_.pc_ == address_ + size_); | 3891 ASSERT(masm_.pc_ == address_ + size_); |
| 3856 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); | 3892 ASSERT(masm_.reloc_info_writer.pos() == address_ + size_ + Assembler::kGap); |
| 3857 } | 3893 } |
| 3858 | 3894 |
| 3859 } } // namespace v8::internal | 3895 } } // namespace v8::internal |
| 3860 | 3896 |
| 3861 #endif // V8_TARGET_ARCH_X64 | 3897 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |