Chromium Code Reviews| Index: src/x64/macro-assembler-x64.cc |
| diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
| index b51d531eb46236b66e76494b13d91a669432420b..c06dc515f3bf1d9dc517d72ce00474998842d8e3 100644 |
| --- a/src/x64/macro-assembler-x64.cc |
| +++ b/src/x64/macro-assembler-x64.cc |
| @@ -3659,6 +3659,42 @@ void MacroAssembler::AllocateAsciiConsString(Register result, |
| } |
| +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.
|
| + Register scratch1, |
| + Register scratch2, |
| + Label* gc_required) { |
| + // Allocate heap number in new space. |
| + AllocateInNewSpace(SlicedString::kSize, |
| + result, |
| + scratch1, |
| + scratch2, |
| + gc_required, |
| + TAG_OBJECT); |
| + |
| + // Set the map. The other fields are left uninitialized. |
| + LoadRoot(kScratchRegister, Heap::kSlicedStringMapRootIndex); |
| + movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); |
| +} |
| + |
| + |
| +void MacroAssembler::AllocateAsciiSlicedString(Register result, |
| + Register scratch1, |
| + Register scratch2, |
| + Label* gc_required) { |
| + // Allocate heap number in new space. |
| + AllocateInNewSpace(SlicedString::kSize, |
| + result, |
| + scratch1, |
| + scratch2, |
| + gc_required, |
| + TAG_OBJECT); |
| + |
| + // Set the map. The other fields are left uninitialized. |
| + LoadRoot(kScratchRegister, Heap::kSlicedAsciiStringMapRootIndex); |
| + movq(FieldOperand(result, HeapObject::kMapOffset), kScratchRegister); |
| +} |
| + |
| + |
| // Copy memory, byte-by-byte, from source to destination. Not optimized for |
| // long or aligned copies. The contents of scratch and length are destroyed. |
| // Destination is incremented by length, source, length and scratch are |