| 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 4553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4564 BuildSeqStringOperand(string, temp, instr->index(), encoding); | 4564 BuildSeqStringOperand(string, temp, instr->index(), encoding); |
| 4565 if (encoding == String::ONE_BYTE_ENCODING) { | 4565 if (encoding == String::ONE_BYTE_ENCODING) { |
| 4566 __ Ldrb(result, operand); | 4566 __ Ldrb(result, operand); |
| 4567 } else { | 4567 } else { |
| 4568 __ Ldrh(result, operand); | 4568 __ Ldrh(result, operand); |
| 4569 } | 4569 } |
| 4570 } | 4570 } |
| 4571 | 4571 |
| 4572 | 4572 |
| 4573 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { | 4573 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { |
| 4574 // TODO(all): Port ARM optimizations from r16707. | |
| 4575 | |
| 4576 String::Encoding encoding = instr->encoding(); | 4574 String::Encoding encoding = instr->encoding(); |
| 4577 Register string = ToRegister(instr->string()); | 4575 Register string = ToRegister(instr->string()); |
| 4578 Register index = ToRegister(instr->index()); | |
| 4579 Register value = ToRegister(instr->value()); | 4576 Register value = ToRegister(instr->value()); |
| 4580 Register temp = ToRegister(instr->temp()); | 4577 Register temp = ToRegister(instr->temp()); |
| 4581 | 4578 |
| 4582 if (FLAG_debug_code) { | 4579 if (FLAG_debug_code) { |
| 4583 if (encoding == String::ONE_BYTE_ENCODING) { | 4580 Register index = ToRegister(instr->index()); |
| 4584 __ EmitSeqStringSetCharCheck( | 4581 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; |
| 4585 string, index, kSeqStringTag | kOneByteStringTag); | 4582 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; |
| 4586 } else { | 4583 int encoding_mask = |
| 4587 ASSERT(encoding == String::TWO_BYTE_ENCODING); | 4584 instr->hydrogen()->encoding() == String::ONE_BYTE_ENCODING |
| 4588 __ EmitSeqStringSetCharCheck( | 4585 ? one_byte_seq_type : two_byte_seq_type; |
| 4589 string, index, kSeqStringTag | kTwoByteStringTag); | 4586 __ EmitSeqStringSetCharCheck(string, index, temp, encoding_mask); |
| 4590 } | |
| 4591 } | 4587 } |
| 4592 | 4588 MemOperand operand = |
| 4593 __ Add(temp, string, SeqString::kHeaderSize - kHeapObjectTag); | 4589 BuildSeqStringOperand(string, temp, instr->index(), encoding); |
| 4594 if (encoding == String::ONE_BYTE_ENCODING) { | 4590 if (encoding == String::ONE_BYTE_ENCODING) { |
| 4595 __ Strb(value, MemOperand(temp, index)); | 4591 __ Strb(value, operand); |
| 4596 } else { | 4592 } else { |
| 4597 __ Strh(value, MemOperand(temp, index, LSL, 1)); | 4593 __ Strh(value, operand); |
| 4598 } | 4594 } |
| 4599 } | 4595 } |
| 4600 | 4596 |
| 4601 | 4597 |
| 4602 void LCodeGen::DoSmiTag(LSmiTag* instr) { | 4598 void LCodeGen::DoSmiTag(LSmiTag* instr) { |
| 4603 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); | 4599 ASSERT(!instr->hydrogen_value()->CheckFlag(HValue::kCanOverflow)); |
| 4604 __ SmiTag(ToRegister(instr->result()), ToRegister(instr->value())); | 4600 __ SmiTag(ToRegister(instr->result()), ToRegister(instr->value())); |
| 4605 } | 4601 } |
| 4606 | 4602 |
| 4607 | 4603 |
| (...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5736 __ Bind(&out_of_object); | 5732 __ Bind(&out_of_object); |
| 5737 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 5733 __ Ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 5738 // Index is equal to negated out of object property index plus 1. | 5734 // Index is equal to negated out of object property index plus 1. |
| 5739 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); | 5735 __ Sub(result, result, Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
| 5740 __ Ldr(result, FieldMemOperand(result, | 5736 __ Ldr(result, FieldMemOperand(result, |
| 5741 FixedArray::kHeaderSize - kPointerSize)); | 5737 FixedArray::kHeaderSize - kPointerSize)); |
| 5742 __ Bind(&done); | 5738 __ Bind(&done); |
| 5743 } | 5739 } |
| 5744 | 5740 |
| 5745 } } // namespace v8::internal | 5741 } } // namespace v8::internal |
| OLD | NEW |