OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 __ movzxwl(result, operand); | 1725 __ movzxwl(result, operand); |
1726 } | 1726 } |
1727 } | 1727 } |
1728 | 1728 |
1729 | 1729 |
1730 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { | 1730 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { |
1731 String::Encoding encoding = instr->hydrogen()->encoding(); | 1731 String::Encoding encoding = instr->hydrogen()->encoding(); |
1732 Register string = ToRegister(instr->string()); | 1732 Register string = ToRegister(instr->string()); |
1733 | 1733 |
1734 if (FLAG_debug_code) { | 1734 if (FLAG_debug_code) { |
1735 __ push(string); | 1735 Register value = ToRegister(instr->value()); |
1736 __ movq(string, FieldOperand(string, HeapObject::kMapOffset)); | 1736 Register index = ToRegister(instr->index()); |
1737 __ movzxbq(string, FieldOperand(string, Map::kInstanceTypeOffset)); | |
1738 | |
1739 __ andb(string, Immediate(kStringRepresentationMask | kStringEncodingMask)); | |
1740 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; | 1737 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; |
1741 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; | 1738 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; |
1742 __ cmpq(string, Immediate(encoding == String::ONE_BYTE_ENCODING | 1739 int encoding_mask = |
1743 ? one_byte_seq_type : two_byte_seq_type)); | 1740 instr->hydrogen()->encoding() == String::ONE_BYTE_ENCODING |
1744 __ Check(equal, kUnexpectedStringType); | 1741 ? one_byte_seq_type : two_byte_seq_type; |
1745 __ pop(string); | 1742 __ EmitSeqStringSetCharCheck(string, index, value, encoding_mask); |
1746 } | 1743 } |
1747 | 1744 |
1748 Operand operand = BuildSeqStringOperand(string, instr->index(), encoding); | 1745 Operand operand = BuildSeqStringOperand(string, instr->index(), encoding); |
1749 if (instr->value()->IsConstantOperand()) { | 1746 if (instr->value()->IsConstantOperand()) { |
1750 int value = ToInteger32(LConstantOperand::cast(instr->value())); | 1747 int value = ToInteger32(LConstantOperand::cast(instr->value())); |
1751 ASSERT_LE(0, value); | 1748 ASSERT_LE(0, value); |
1752 if (encoding == String::ONE_BYTE_ENCODING) { | 1749 if (encoding == String::ONE_BYTE_ENCODING) { |
1753 ASSERT_LE(value, String::kMaxOneByteCharCode); | 1750 ASSERT_LE(value, String::kMaxOneByteCharCode); |
1754 __ movb(operand, Immediate(value)); | 1751 __ movb(operand, Immediate(value)); |
1755 } else { | 1752 } else { |
(...skipping 3941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5697 FixedArray::kHeaderSize - kPointerSize)); | 5694 FixedArray::kHeaderSize - kPointerSize)); |
5698 __ bind(&done); | 5695 __ bind(&done); |
5699 } | 5696 } |
5700 | 5697 |
5701 | 5698 |
5702 #undef __ | 5699 #undef __ |
5703 | 5700 |
5704 } } // namespace v8::internal | 5701 } } // namespace v8::internal |
5705 | 5702 |
5706 #endif // V8_TARGET_ARCH_X64 | 5703 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |