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 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 __ bind(&runtime); | 1593 __ bind(&runtime); |
1594 __ PrepareCallCFunction(2, scratch); | 1594 __ PrepareCallCFunction(2, scratch); |
1595 __ li(a1, Operand(index)); | 1595 __ li(a1, Operand(index)); |
1596 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); | 1596 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); |
1597 __ bind(&done); | 1597 __ bind(&done); |
1598 } | 1598 } |
1599 } | 1599 } |
1600 | 1600 |
1601 | 1601 |
1602 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { | 1602 void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { |
1603 SeqStringSetCharGenerator::Generate(masm(), | 1603 Register string = ToRegister(instr->string()); |
1604 instr->encoding(), | 1604 Register index = ToRegister(instr->index()); |
1605 ToRegister(instr->string()), | 1605 Register value = ToRegister(instr->value()); |
1606 ToRegister(instr->index()), | 1606 Register scratch = scratch0(); |
1607 ToRegister(instr->value())); | 1607 String::Encoding encoding = instr->encoding(); |
| 1608 |
| 1609 if (FLAG_debug_code) { |
| 1610 __ lw(at, FieldMemOperand(string, HeapObject::kMapOffset)); |
| 1611 __ lbu(at, FieldMemOperand(at, Map::kInstanceTypeOffset)); |
| 1612 |
| 1613 __ And(at, at, Operand(kStringRepresentationMask | kStringEncodingMask)); |
| 1614 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; |
| 1615 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; |
| 1616 __ Subu(at, at, Operand(encoding == String::ONE_BYTE_ENCODING |
| 1617 ? one_byte_seq_type : two_byte_seq_type)); |
| 1618 __ Check(eq, "Unexpected string type", at, Operand(zero_reg)); |
| 1619 } |
| 1620 |
| 1621 __ Addu(scratch, |
| 1622 string, |
| 1623 Operand(SeqString::kHeaderSize - kHeapObjectTag)); |
| 1624 if (encoding == String::ONE_BYTE_ENCODING) { |
| 1625 __ Addu(at, scratch, index); |
| 1626 __ sb(value, MemOperand(at)); |
| 1627 } else { |
| 1628 __ sll(at, index, 1); |
| 1629 __ Addu(at, scratch, at); |
| 1630 __ sh(value, MemOperand(at)); |
| 1631 } |
1608 } | 1632 } |
1609 | 1633 |
1610 | 1634 |
1611 void LCodeGen::DoBitNotI(LBitNotI* instr) { | 1635 void LCodeGen::DoBitNotI(LBitNotI* instr) { |
1612 Register input = ToRegister(instr->value()); | 1636 Register input = ToRegister(instr->value()); |
1613 Register result = ToRegister(instr->result()); | 1637 Register result = ToRegister(instr->result()); |
1614 __ Nor(result, zero_reg, Operand(input)); | 1638 __ Nor(result, zero_reg, Operand(input)); |
1615 } | 1639 } |
1616 | 1640 |
1617 | 1641 |
(...skipping 4055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5673 __ Subu(scratch, result, scratch); | 5697 __ Subu(scratch, result, scratch); |
5674 __ lw(result, FieldMemOperand(scratch, | 5698 __ lw(result, FieldMemOperand(scratch, |
5675 FixedArray::kHeaderSize - kPointerSize)); | 5699 FixedArray::kHeaderSize - kPointerSize)); |
5676 __ bind(&done); | 5700 __ bind(&done); |
5677 } | 5701 } |
5678 | 5702 |
5679 | 5703 |
5680 #undef __ | 5704 #undef __ |
5681 | 5705 |
5682 } } // namespace v8::internal | 5706 } } // namespace v8::internal |
OLD | NEW |