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 3621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3632 // Live registers: | 3632 // Live registers: |
3633 // string_length: Sum of string lengths, as a smi. | 3633 // string_length: Sum of string lengths, as a smi. |
3634 // elements: FixedArray of strings. | 3634 // elements: FixedArray of strings. |
3635 | 3635 |
3636 // Check that the separator is a flat ASCII string. | 3636 // Check that the separator is a flat ASCII string. |
3637 __ mov(string, separator_operand); | 3637 __ mov(string, separator_operand); |
3638 __ JumpIfSmi(string, &bailout); | 3638 __ JumpIfSmi(string, &bailout); |
3639 __ mov(scratch, FieldOperand(string, HeapObject::kMapOffset)); | 3639 __ mov(scratch, FieldOperand(string, HeapObject::kMapOffset)); |
3640 __ movzx_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset)); | 3640 __ movzx_b(scratch, FieldOperand(scratch, Map::kInstanceTypeOffset)); |
3641 __ and_(scratch, Immediate( | 3641 __ and_(scratch, Immediate( |
3642 kIsNotStringMask | kStringEncodingMask | kAsciiDataHintMask | | 3642 kIsNotStringMask | kStringEncodingMask | kStringRepresentationMask)); |
3643 kStringRepresentationMask)); | |
3644 __ cmp(scratch, ASCII_STRING_TYPE); | 3643 __ cmp(scratch, ASCII_STRING_TYPE); |
3645 __ j(not_equal, &bailout); | 3644 __ j(not_equal, &bailout); |
3646 | 3645 |
3647 // Add (separator length times array_length) - separator length | 3646 // Add (separator length times array_length) - separator length |
3648 // to string_length. | 3647 // to string_length. |
3649 __ mov(scratch, separator_operand); | 3648 __ mov(scratch, separator_operand); |
3650 __ mov(scratch, FieldOperand(scratch, SeqOneByteString::kLengthOffset)); | 3649 __ mov(scratch, FieldOperand(scratch, SeqOneByteString::kLengthOffset)); |
3651 __ sub(string_length, scratch); // May be negative, temporarily. | 3650 __ sub(string_length, scratch); // May be negative, temporarily. |
3652 __ imul(scratch, array_length_operand); | 3651 __ imul(scratch, array_length_operand); |
3653 __ j(overflow, &bailout); | 3652 __ j(overflow, &bailout); |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4528 *stack_depth = 0; | 4527 *stack_depth = 0; |
4529 *context_length = 0; | 4528 *context_length = 0; |
4530 return previous_; | 4529 return previous_; |
4531 } | 4530 } |
4532 | 4531 |
4533 #undef __ | 4532 #undef __ |
4534 | 4533 |
4535 } } // namespace v8::internal | 4534 } } // namespace v8::internal |
4536 | 4535 |
4537 #endif // V8_TARGET_ARCH_IA32 | 4536 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |