OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1652 } | 1652 } |
1653 | 1653 |
1654 | 1654 |
1655 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { | 1655 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
1656 Register result = ToRegister(instr->result()); | 1656 Register result = ToRegister(instr->result()); |
1657 Register map = ToRegister(instr->value()); | 1657 Register map = ToRegister(instr->value()); |
1658 __ EnumLength(result, map); | 1658 __ EnumLength(result, map); |
1659 } | 1659 } |
1660 | 1660 |
1661 | 1661 |
| 1662 void LCodeGen::DoDateField(LDateField* instr) { |
| 1663 Register object = ToRegister(instr->date()); |
| 1664 Register result = ToRegister(instr->result()); |
| 1665 Register scratch = ToRegister(instr->temp()); |
| 1666 Smi* index = instr->index(); |
| 1667 DCHECK(object.is(a0)); |
| 1668 DCHECK(result.is(v0)); |
| 1669 DCHECK(!scratch.is(scratch0())); |
| 1670 DCHECK(!scratch.is(object)); |
| 1671 |
| 1672 if (index->value() == 0) { |
| 1673 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset)); |
| 1674 } else { |
| 1675 Label runtime, done; |
| 1676 if (index->value() < JSDate::kFirstUncachedField) { |
| 1677 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
| 1678 __ li(scratch, Operand(stamp)); |
| 1679 __ lw(scratch, MemOperand(scratch)); |
| 1680 __ lw(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); |
| 1681 __ Branch(&runtime, ne, scratch, Operand(scratch0())); |
| 1682 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset + |
| 1683 kPointerSize * index->value())); |
| 1684 __ jmp(&done); |
| 1685 } |
| 1686 __ bind(&runtime); |
| 1687 __ PrepareCallCFunction(2, scratch); |
| 1688 __ li(a1, Operand(index)); |
| 1689 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); |
| 1690 __ bind(&done); |
| 1691 } |
| 1692 } |
| 1693 |
| 1694 |
1662 MemOperand LCodeGen::BuildSeqStringOperand(Register string, | 1695 MemOperand LCodeGen::BuildSeqStringOperand(Register string, |
1663 LOperand* index, | 1696 LOperand* index, |
1664 String::Encoding encoding) { | 1697 String::Encoding encoding) { |
1665 if (index->IsConstantOperand()) { | 1698 if (index->IsConstantOperand()) { |
1666 int offset = ToInteger32(LConstantOperand::cast(index)); | 1699 int offset = ToInteger32(LConstantOperand::cast(index)); |
1667 if (encoding == String::TWO_BYTE_ENCODING) { | 1700 if (encoding == String::TWO_BYTE_ENCODING) { |
1668 offset *= kUC16Size; | 1701 offset *= kUC16Size; |
1669 } | 1702 } |
1670 STATIC_ASSERT(kCharSize == 1); | 1703 STATIC_ASSERT(kCharSize == 1); |
1671 return FieldMemOperand(string, SeqString::kHeaderSize + offset); | 1704 return FieldMemOperand(string, SeqString::kHeaderSize + offset); |
(...skipping 3956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5628 __ Push(at, ToRegister(instr->function())); | 5661 __ Push(at, ToRegister(instr->function())); |
5629 CallRuntime(Runtime::kPushBlockContext, instr); | 5662 CallRuntime(Runtime::kPushBlockContext, instr); |
5630 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5663 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5631 } | 5664 } |
5632 | 5665 |
5633 | 5666 |
5634 #undef __ | 5667 #undef __ |
5635 | 5668 |
5636 } // namespace internal | 5669 } // namespace internal |
5637 } // namespace v8 | 5670 } // namespace v8 |
OLD | NEW |