| 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 5797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5808 __ jmp(&return_r0); | 5808 __ jmp(&return_r0); |
| 5809 | 5809 |
| 5810 if (FLAG_string_slices) { | 5810 if (FLAG_string_slices) { |
| 5811 __ bind(&create_slice); | 5811 __ bind(&create_slice); |
| 5812 // r0: original string | 5812 // r0: original string |
| 5813 // r1: instance type | 5813 // r1: instance type |
| 5814 // r2: length | 5814 // r2: length |
| 5815 // r3: from index (untagged smi) | 5815 // r3: from index (untagged smi) |
| 5816 // r6 (a.k.a. to): to (smi) | 5816 // r6 (a.k.a. to): to (smi) |
| 5817 // r7 (a.k.a. from): from offset (smi) | 5817 // r7 (a.k.a. from): from offset (smi) |
| 5818 Label allocate_slice, sliced_string, seq_string; | 5818 Label allocate_slice, sliced_string, seq_or_external_string; |
| 5819 STATIC_ASSERT(kSeqStringTag == 0); | |
| 5820 __ tst(r1, Operand(kStringRepresentationMask)); | |
| 5821 __ b(eq, &seq_string); | |
| 5822 STATIC_ASSERT(kIsIndirectStringMask == (kSlicedStringTag & kConsStringTag)); | 5819 STATIC_ASSERT(kIsIndirectStringMask == (kSlicedStringTag & kConsStringTag)); |
| 5823 STATIC_ASSERT(kIsIndirectStringMask != 0); | 5820 STATIC_ASSERT(kIsIndirectStringMask != 0); |
| 5824 __ tst(r1, Operand(kIsIndirectStringMask)); | 5821 __ tst(r1, Operand(kIsIndirectStringMask)); |
| 5825 // External string. Jump to runtime. | 5822 __ b(eq, &seq_or_external_string); |
| 5826 __ b(eq, &runtime); | |
| 5827 | 5823 |
| 5828 __ tst(r1, Operand(kSlicedNotConsMask)); | 5824 __ tst(r1, Operand(kSlicedNotConsMask)); |
| 5829 __ b(ne, &sliced_string); | 5825 __ b(ne, &sliced_string); |
| 5830 // Cons string. Check whether it is flat, then fetch first part. | 5826 // Cons string. Check whether it is flat, then fetch first part. |
| 5831 __ ldr(r5, FieldMemOperand(r0, ConsString::kSecondOffset)); | 5827 __ ldr(r5, FieldMemOperand(r0, ConsString::kSecondOffset)); |
| 5832 __ LoadRoot(r9, Heap::kEmptyStringRootIndex); | 5828 __ LoadRoot(r9, Heap::kEmptyStringRootIndex); |
| 5833 __ cmp(r5, r9); | 5829 __ cmp(r5, r9); |
| 5834 __ b(ne, &runtime); | 5830 __ b(ne, &runtime); |
| 5835 __ ldr(r5, FieldMemOperand(r0, ConsString::kFirstOffset)); | 5831 __ ldr(r5, FieldMemOperand(r0, ConsString::kFirstOffset)); |
| 5836 __ jmp(&allocate_slice); | 5832 __ jmp(&allocate_slice); |
| 5837 | 5833 |
| 5838 __ bind(&sliced_string); | 5834 __ bind(&sliced_string); |
| 5839 // Sliced string. Fetch parent and correct start index by offset. | 5835 // Sliced string. Fetch parent and correct start index by offset. |
| 5840 __ ldr(r5, FieldMemOperand(r0, SlicedString::kOffsetOffset)); | 5836 __ ldr(r5, FieldMemOperand(r0, SlicedString::kOffsetOffset)); |
| 5841 __ add(r7, r7, r5); | 5837 __ add(r7, r7, r5); |
| 5842 __ ldr(r5, FieldMemOperand(r0, SlicedString::kParentOffset)); | 5838 __ ldr(r5, FieldMemOperand(r0, SlicedString::kParentOffset)); |
| 5843 __ jmp(&allocate_slice); | 5839 __ jmp(&allocate_slice); |
| 5844 | 5840 |
| 5845 __ bind(&seq_string); | 5841 __ bind(&seq_or_external_string); |
| 5846 // Sequential string. Just move string to the right register. | 5842 // Sequential or external string. Just move string to the correct register. |
| 5847 __ mov(r5, r0); | 5843 __ mov(r5, r0); |
| 5848 | 5844 |
| 5849 __ bind(&allocate_slice); | 5845 __ bind(&allocate_slice); |
| 5850 // r1: instance type of original string | 5846 // r1: instance type of original string |
| 5851 // r2: length | 5847 // r2: length |
| 5852 // r5: underlying subject string | 5848 // r5: underlying subject string |
| 5853 // r7 (a.k.a. from): from offset (smi) | 5849 // r7 (a.k.a. from): from offset (smi) |
| 5854 // Allocate new sliced string. At this point we do not reload the instance | 5850 // Allocate new sliced string. At this point we do not reload the instance |
| 5855 // type including the string encoding because we simply rely on the info | 5851 // type including the string encoding because we simply rely on the info |
| 5856 // provided by the original string. It does not matter if the original | 5852 // provided by the original string. It does not matter if the original |
| (...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7182 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10, | 7178 __ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10, |
| 7183 &slow_elements); | 7179 &slow_elements); |
| 7184 __ Ret(); | 7180 __ Ret(); |
| 7185 } | 7181 } |
| 7186 | 7182 |
| 7187 #undef __ | 7183 #undef __ |
| 7188 | 7184 |
| 7189 } } // namespace v8::internal | 7185 } } // namespace v8::internal |
| 7190 | 7186 |
| 7191 #endif // V8_TARGET_ARCH_ARM | 7187 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |