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 5810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5821 __ mov(FieldOperand(ecx, ConsString::kLengthOffset), ebx); | 5821 __ mov(FieldOperand(ecx, ConsString::kLengthOffset), ebx); |
5822 __ mov(FieldOperand(ecx, ConsString::kHashFieldOffset), | 5822 __ mov(FieldOperand(ecx, ConsString::kHashFieldOffset), |
5823 Immediate(String::kEmptyHashField)); | 5823 Immediate(String::kEmptyHashField)); |
5824 __ mov(FieldOperand(ecx, ConsString::kFirstOffset), eax); | 5824 __ mov(FieldOperand(ecx, ConsString::kFirstOffset), eax); |
5825 __ mov(FieldOperand(ecx, ConsString::kSecondOffset), edx); | 5825 __ mov(FieldOperand(ecx, ConsString::kSecondOffset), edx); |
5826 __ mov(eax, ecx); | 5826 __ mov(eax, ecx); |
5827 __ IncrementCounter(counters->string_add_native(), 1); | 5827 __ IncrementCounter(counters->string_add_native(), 1); |
5828 __ ret(2 * kPointerSize); | 5828 __ ret(2 * kPointerSize); |
5829 __ bind(&non_ascii); | 5829 __ bind(&non_ascii); |
5830 // At least one of the strings is two-byte. Check whether it happens | 5830 // At least one of the strings is two-byte. Check whether it happens |
5831 // to contain only ASCII characters. | 5831 // to contain only one byte characters. |
5832 // ecx: first instance type AND second instance type. | 5832 // ecx: first instance type AND second instance type. |
5833 // edi: second instance type. | 5833 // edi: second instance type. |
5834 __ test(ecx, Immediate(kAsciiDataHintMask)); | 5834 __ test(ecx, Immediate(kOneByteDataHintMask)); |
5835 __ j(not_zero, &ascii_data); | 5835 __ j(not_zero, &ascii_data); |
5836 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); | 5836 __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset)); |
5837 __ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset)); | 5837 __ movzx_b(ecx, FieldOperand(ecx, Map::kInstanceTypeOffset)); |
5838 __ xor_(edi, ecx); | 5838 __ xor_(edi, ecx); |
5839 STATIC_ASSERT(kOneByteStringTag != 0 && kAsciiDataHintTag != 0); | 5839 STATIC_ASSERT(kOneByteStringTag != 0 && kOneByteDataHintTag != 0); |
5840 __ and_(edi, kOneByteStringTag | kAsciiDataHintTag); | 5840 __ and_(edi, kOneByteStringTag | kOneByteDataHintTag); |
5841 __ cmp(edi, kOneByteStringTag | kAsciiDataHintTag); | 5841 __ cmp(edi, kOneByteStringTag | kOneByteDataHintTag); |
5842 __ j(equal, &ascii_data); | 5842 __ j(equal, &ascii_data); |
5843 // Allocate a two byte cons string. | 5843 // Allocate a two byte cons string. |
5844 __ AllocateTwoByteConsString(ecx, edi, no_reg, &call_runtime); | 5844 __ AllocateTwoByteConsString(ecx, edi, no_reg, &call_runtime); |
5845 __ jmp(&allocated); | 5845 __ jmp(&allocated); |
5846 | 5846 |
5847 // We cannot encounter sliced strings or cons strings here since: | 5847 // We cannot encounter sliced strings or cons strings here since: |
5848 STATIC_ASSERT(SlicedString::kMinLength >= ConsString::kMinLength); | 5848 STATIC_ASSERT(SlicedString::kMinLength >= ConsString::kMinLength); |
5849 // Handle creating a flat result from either external or sequential strings. | 5849 // Handle creating a flat result from either external or sequential strings. |
5850 // Locate the first characters' locations. | 5850 // Locate the first characters' locations. |
5851 // eax: first string | 5851 // eax: first string |
(...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7926 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 7926 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
7927 } | 7927 } |
7928 } | 7928 } |
7929 | 7929 |
7930 | 7930 |
7931 #undef __ | 7931 #undef __ |
7932 | 7932 |
7933 } } // namespace v8::internal | 7933 } } // namespace v8::internal |
7934 | 7934 |
7935 #endif // V8_TARGET_ARCH_IA32 | 7935 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |