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 5697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5708 // If coming from the make_two_character_string path, the string | 5708 // If coming from the make_two_character_string path, the string |
5709 // is too short to be sliced anyways. | 5709 // is too short to be sliced anyways. |
5710 STATIC_ASSERT(2 < SlicedString::kMinLength); | 5710 STATIC_ASSERT(2 < SlicedString::kMinLength); |
5711 __ jmp(©_routine); | 5711 __ jmp(©_routine); |
5712 __ bind(&result_longer_than_two); | 5712 __ bind(&result_longer_than_two); |
5713 | 5713 |
5714 // eax: string | 5714 // eax: string |
5715 // ebx: instance type | 5715 // ebx: instance type |
5716 // ecx: sub string length | 5716 // ecx: sub string length |
5717 // edx: from index (smi) | 5717 // edx: from index (smi) |
5718 Label allocate_slice, sliced_string, seq_string; | 5718 Label allocate_slice, sliced_string, seq_string; |
5719 __ cmp(ecx, SlicedString::kMinLength); | 5719 __ cmp(ecx, SlicedString::kMinLength); |
5720 // Short slice. Copy instead of slicing. | 5720 // Short slice. Copy instead of slicing. |
5721 __ j(less, ©_routine); | 5721 __ j(less, ©_routine); |
5722 STATIC_ASSERT(kSeqStringTag == 0); | 5722 STATIC_ASSERT(kSeqStringTag == 0); |
5723 __ test(ebx, Immediate(kStringRepresentationMask)); | 5723 __ test(ebx, Immediate(kStringRepresentationMask)); |
5724 __ j(zero, &seq_string, Label::kNear); | 5724 __ j(zero, &seq_string, Label::kNear); |
5725 STATIC_ASSERT(kIsIndirectStringMask == (kSlicedStringTag & kConsStringTag)); | 5725 STATIC_ASSERT(kIsIndirectStringMask == (kSlicedStringTag & kConsStringTag)); |
5726 STATIC_ASSERT(kIsIndirectStringMask != 0); | 5726 STATIC_ASSERT(kIsIndirectStringMask != 0); |
5727 __ test(ebx, Immediate(kIsIndirectStringMask)); | 5727 __ test(ebx, Immediate(kIsIndirectStringMask)); |
5728 // External string. Jump to runtime. | 5728 // External string. Jump to runtime. |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6487 __ Drop(1); | 6487 __ Drop(1); |
6488 __ ret(2 * kPointerSize); | 6488 __ ret(2 * kPointerSize); |
6489 } | 6489 } |
6490 | 6490 |
6491 | 6491 |
6492 #undef __ | 6492 #undef __ |
6493 | 6493 |
6494 } } // namespace v8::internal | 6494 } } // namespace v8::internal |
6495 | 6495 |
6496 #endif // V8_TARGET_ARCH_IA32 | 6496 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |