OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4775 __ IncrementCounter(counters->string_add_native(), 1); | 4775 __ IncrementCounter(counters->string_add_native(), 1); |
4776 __ ret(2 * kPointerSize); | 4776 __ ret(2 * kPointerSize); |
4777 __ bind(&non_ascii); | 4777 __ bind(&non_ascii); |
4778 // At least one of the strings is two-byte. Check whether it happens | 4778 // At least one of the strings is two-byte. Check whether it happens |
4779 // to contain only ASCII characters. | 4779 // to contain only ASCII characters. |
4780 // rcx: first instance type AND second instance type. | 4780 // rcx: first instance type AND second instance type. |
4781 // r8: first instance type. | 4781 // r8: first instance type. |
4782 // r9: second instance type. | 4782 // r9: second instance type. |
4783 __ testb(rcx, Immediate(kAsciiDataHintMask)); | 4783 __ testb(rcx, Immediate(kAsciiDataHintMask)); |
4784 __ j(not_zero, &ascii_data); | 4784 __ j(not_zero, &ascii_data); |
| 4785 __ xor_(r8, r9); |
| 4786 STATIC_ASSERT(kOneByteStringTag != 0 && kAsciiDataHintTag != 0); |
| 4787 __ andb(r8, Immediate(kOneByteStringTag | kAsciiDataHintTag)); |
| 4788 __ cmpb(r8, Immediate(kOneByteStringTag | kAsciiDataHintTag)); |
| 4789 __ j(equal, &ascii_data); |
4785 // Allocate a two byte cons string. | 4790 // Allocate a two byte cons string. |
4786 __ AllocateTwoByteConsString(rcx, rdi, no_reg, &call_runtime); | 4791 __ AllocateTwoByteConsString(rcx, rdi, no_reg, &call_runtime); |
4787 __ jmp(&allocated); | 4792 __ jmp(&allocated); |
4788 | 4793 |
4789 // We cannot encounter sliced strings or cons strings here since: | 4794 // We cannot encounter sliced strings or cons strings here since: |
4790 STATIC_ASSERT(SlicedString::kMinLength >= ConsString::kMinLength); | 4795 STATIC_ASSERT(SlicedString::kMinLength >= ConsString::kMinLength); |
4791 // Handle creating a flat result from either external or sequential strings. | 4796 // Handle creating a flat result from either external or sequential strings. |
4792 // Locate the first characters' locations. | 4797 // Locate the first characters' locations. |
4793 // rax: first string | 4798 // rax: first string |
4794 // rbx: length of resulting flat string as smi | 4799 // rbx: length of resulting flat string as smi |
(...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6542 #endif | 6547 #endif |
6543 | 6548 |
6544 __ Ret(); | 6549 __ Ret(); |
6545 } | 6550 } |
6546 | 6551 |
6547 #undef __ | 6552 #undef __ |
6548 | 6553 |
6549 } } // namespace v8::internal | 6554 } } // namespace v8::internal |
6550 | 6555 |
6551 #endif // V8_TARGET_ARCH_X64 | 6556 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |