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 5580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5591 // strings are ascii the result is an ascii cons string. | 5591 // strings are ascii the result is an ascii cons string. |
5592 Label non_ascii, allocated, ascii_data; | 5592 Label non_ascii, allocated, ascii_data; |
5593 __ mov(edi, FieldOperand(eax, HeapObject::kMapOffset)); | 5593 __ mov(edi, FieldOperand(eax, HeapObject::kMapOffset)); |
5594 __ movzx_b(ecx, FieldOperand(edi, Map::kInstanceTypeOffset)); | 5594 __ movzx_b(ecx, FieldOperand(edi, Map::kInstanceTypeOffset)); |
5595 __ mov(edi, FieldOperand(edx, HeapObject::kMapOffset)); | 5595 __ mov(edi, FieldOperand(edx, HeapObject::kMapOffset)); |
5596 __ movzx_b(edi, FieldOperand(edi, Map::kInstanceTypeOffset)); | 5596 __ movzx_b(edi, FieldOperand(edi, Map::kInstanceTypeOffset)); |
5597 __ and_(ecx, edi); | 5597 __ and_(ecx, edi); |
5598 STATIC_ASSERT((kStringEncodingMask & kAsciiStringTag) != 0); | 5598 STATIC_ASSERT((kStringEncodingMask & kAsciiStringTag) != 0); |
5599 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); | 5599 STATIC_ASSERT((kStringEncodingMask & kTwoByteStringTag) == 0); |
5600 __ test(ecx, Immediate(kStringEncodingMask)); | 5600 __ test(ecx, Immediate(kStringEncodingMask)); |
5601 __ j(zero, &non_ascii, Label::kNear); | 5601 __ j(zero, &non_ascii); |
5602 __ bind(&ascii_data); | 5602 __ bind(&ascii_data); |
5603 // Allocate an acsii cons string. | 5603 // Allocate an acsii cons string. |
5604 __ AllocateAsciiConsString(ecx, edi, no_reg, &call_runtime); | 5604 __ AllocateAsciiConsString(ecx, edi, no_reg, &call_runtime); |
5605 __ bind(&allocated); | 5605 __ bind(&allocated); |
5606 // Fill the fields of the cons string. | 5606 // Fill the fields of the cons string. |
5607 if (FLAG_debug_code) __ AbortIfNotSmi(ebx); | 5607 if (FLAG_debug_code) __ AbortIfNotSmi(ebx); |
5608 __ mov(FieldOperand(ecx, ConsString::kLengthOffset), ebx); | 5608 __ mov(FieldOperand(ecx, ConsString::kLengthOffset), ebx); |
5609 __ mov(FieldOperand(ecx, ConsString::kHashFieldOffset), | 5609 __ mov(FieldOperand(ecx, ConsString::kHashFieldOffset), |
5610 Immediate(String::kEmptyHashField)); | 5610 Immediate(String::kEmptyHashField)); |
5611 __ mov(FieldOperand(ecx, ConsString::kFirstOffset), eax); | 5611 __ mov(FieldOperand(ecx, ConsString::kFirstOffset), eax); |
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7335 false); | 7335 false); |
7336 __ pop(edx); | 7336 __ pop(edx); |
7337 __ ret(0); | 7337 __ ret(0); |
7338 } | 7338 } |
7339 | 7339 |
7340 #undef __ | 7340 #undef __ |
7341 | 7341 |
7342 } } // namespace v8::internal | 7342 } } // namespace v8::internal |
7343 | 7343 |
7344 #endif // V8_TARGET_ARCH_IA32 | 7344 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |