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 4895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4906 __ movq(FieldOperand(rcx, ConsString::kLengthOffset), rbx); | 4906 __ movq(FieldOperand(rcx, ConsString::kLengthOffset), rbx); |
4907 __ movq(FieldOperand(rcx, ConsString::kHashFieldOffset), | 4907 __ movq(FieldOperand(rcx, ConsString::kHashFieldOffset), |
4908 Immediate(String::kEmptyHashField)); | 4908 Immediate(String::kEmptyHashField)); |
4909 __ movq(FieldOperand(rcx, ConsString::kFirstOffset), rax); | 4909 __ movq(FieldOperand(rcx, ConsString::kFirstOffset), rax); |
4910 __ movq(FieldOperand(rcx, ConsString::kSecondOffset), rdx); | 4910 __ movq(FieldOperand(rcx, ConsString::kSecondOffset), rdx); |
4911 __ movq(rax, rcx); | 4911 __ movq(rax, rcx); |
4912 __ IncrementCounter(counters->string_add_native(), 1); | 4912 __ IncrementCounter(counters->string_add_native(), 1); |
4913 __ ret(2 * kPointerSize); | 4913 __ ret(2 * kPointerSize); |
4914 __ bind(&non_ascii); | 4914 __ bind(&non_ascii); |
4915 // At least one of the strings is two-byte. Check whether it happens | 4915 // At least one of the strings is two-byte. Check whether it happens |
4916 // to contain only ASCII characters. | 4916 // to contain only one byte characters. |
4917 // rcx: first instance type AND second instance type. | 4917 // rcx: first instance type AND second instance type. |
4918 // r8: first instance type. | 4918 // r8: first instance type. |
4919 // r9: second instance type. | 4919 // r9: second instance type. |
4920 __ testb(rcx, Immediate(kAsciiDataHintMask)); | 4920 __ testb(rcx, Immediate(kOneByteDataHintMask)); |
4921 __ j(not_zero, &ascii_data); | 4921 __ j(not_zero, &ascii_data); |
4922 __ xor_(r8, r9); | 4922 __ xor_(r8, r9); |
4923 STATIC_ASSERT(kOneByteStringTag != 0 && kAsciiDataHintTag != 0); | 4923 STATIC_ASSERT(kOneByteStringTag != 0 && kOneByteDataHintTag != 0); |
4924 __ andb(r8, Immediate(kOneByteStringTag | kAsciiDataHintTag)); | 4924 __ andb(r8, Immediate(kOneByteStringTag | kOneByteDataHintTag)); |
4925 __ cmpb(r8, Immediate(kOneByteStringTag | kAsciiDataHintTag)); | 4925 __ cmpb(r8, Immediate(kOneByteStringTag | kOneByteDataHintTag)); |
4926 __ j(equal, &ascii_data); | 4926 __ j(equal, &ascii_data); |
4927 // Allocate a two byte cons string. | 4927 // Allocate a two byte cons string. |
4928 __ AllocateTwoByteConsString(rcx, rdi, no_reg, &call_runtime); | 4928 __ AllocateTwoByteConsString(rcx, rdi, no_reg, &call_runtime); |
4929 __ jmp(&allocated); | 4929 __ jmp(&allocated); |
4930 | 4930 |
4931 // We cannot encounter sliced strings or cons strings here since: | 4931 // We cannot encounter sliced strings or cons strings here since: |
4932 STATIC_ASSERT(SlicedString::kMinLength >= ConsString::kMinLength); | 4932 STATIC_ASSERT(SlicedString::kMinLength >= ConsString::kMinLength); |
4933 // Handle creating a flat result from either external or sequential strings. | 4933 // Handle creating a flat result from either external or sequential strings. |
4934 // Locate the first characters' locations. | 4934 // Locate the first characters' locations. |
4935 // rax: first string | 4935 // rax: first string |
(...skipping 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6949 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 6949 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
6950 } | 6950 } |
6951 } | 6951 } |
6952 | 6952 |
6953 | 6953 |
6954 #undef __ | 6954 #undef __ |
6955 | 6955 |
6956 } } // namespace v8::internal | 6956 } } // namespace v8::internal |
6957 | 6957 |
6958 #endif // V8_TARGET_ARCH_X64 | 6958 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |