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 3533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3544 __ bind(&loop); | 3544 __ bind(&loop); |
3545 __ movq(string, FieldOperand(elements, | 3545 __ movq(string, FieldOperand(elements, |
3546 index, | 3546 index, |
3547 times_pointer_size, | 3547 times_pointer_size, |
3548 FixedArray::kHeaderSize)); | 3548 FixedArray::kHeaderSize)); |
3549 __ JumpIfSmi(string, &bailout); | 3549 __ JumpIfSmi(string, &bailout); |
3550 __ movq(scratch, FieldOperand(string, HeapObject::kMapOffset)); | 3550 __ movq(scratch, FieldOperand(string, HeapObject::kMapOffset)); |
3551 __ movzxbl(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset)); | 3551 __ movzxbl(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset)); |
3552 __ andb(scratch, Immediate( | 3552 __ andb(scratch, Immediate( |
3553 kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask)); | 3553 kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask)); |
3554 __ cmpb(scratch, Immediate(kStringTag | kAsciiStringTag | kSeqStringTag)); | 3554 __ cmpb(scratch, Immediate(kStringTag | kOneByteStringTag | kSeqStringTag)); |
3555 __ j(not_equal, &bailout); | 3555 __ j(not_equal, &bailout); |
3556 __ AddSmiField(string_length, | 3556 __ AddSmiField(string_length, |
3557 FieldOperand(string, SeqAsciiString::kLengthOffset)); | 3557 FieldOperand(string, SeqAsciiString::kLengthOffset)); |
3558 __ j(overflow, &bailout); | 3558 __ j(overflow, &bailout); |
3559 __ incl(index); | 3559 __ incl(index); |
3560 __ cmpl(index, array_length); | 3560 __ cmpl(index, array_length); |
3561 __ j(less, &loop); | 3561 __ j(less, &loop); |
3562 | 3562 |
3563 // Live registers: | 3563 // Live registers: |
3564 // string_length: Sum of string lengths. | 3564 // string_length: Sum of string lengths. |
(...skipping 18 matching lines...) Expand all Loading... |
3583 // elements: FixedArray of strings. | 3583 // elements: FixedArray of strings. |
3584 // index: Array length. | 3584 // index: Array length. |
3585 | 3585 |
3586 // Check that the separator is a sequential ASCII string. | 3586 // Check that the separator is a sequential ASCII string. |
3587 __ movq(string, separator_operand); | 3587 __ movq(string, separator_operand); |
3588 __ JumpIfSmi(string, &bailout); | 3588 __ JumpIfSmi(string, &bailout); |
3589 __ movq(scratch, FieldOperand(string, HeapObject::kMapOffset)); | 3589 __ movq(scratch, FieldOperand(string, HeapObject::kMapOffset)); |
3590 __ movzxbl(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset)); | 3590 __ movzxbl(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset)); |
3591 __ andb(scratch, Immediate( | 3591 __ andb(scratch, Immediate( |
3592 kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask)); | 3592 kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask)); |
3593 __ cmpb(scratch, Immediate(kStringTag | kAsciiStringTag | kSeqStringTag)); | 3593 __ cmpb(scratch, Immediate(kStringTag | kOneByteStringTag | kSeqStringTag)); |
3594 __ j(not_equal, &bailout); | 3594 __ j(not_equal, &bailout); |
3595 | 3595 |
3596 // Live registers: | 3596 // Live registers: |
3597 // string_length: Sum of string lengths. | 3597 // string_length: Sum of string lengths. |
3598 // elements: FixedArray of strings. | 3598 // elements: FixedArray of strings. |
3599 // index: Array length. | 3599 // index: Array length. |
3600 // string: Separator string. | 3600 // string: Separator string. |
3601 | 3601 |
3602 // Add (separator length times (array_length - 1)) to string_length. | 3602 // Add (separator length times (array_length - 1)) to string_length. |
3603 __ SmiToInteger32(scratch, | 3603 __ SmiToInteger32(scratch, |
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4514 *context_length = 0; | 4514 *context_length = 0; |
4515 return previous_; | 4515 return previous_; |
4516 } | 4516 } |
4517 | 4517 |
4518 | 4518 |
4519 #undef __ | 4519 #undef __ |
4520 | 4520 |
4521 } } // namespace v8::internal | 4521 } } // namespace v8::internal |
4522 | 4522 |
4523 #endif // V8_TARGET_ARCH_X64 | 4523 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |