| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
| 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
| (...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1749 } | 1749 } |
| 1750 | 1750 |
| 1751 | 1751 |
| 1752 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { | 1752 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
| 1753 Register result = ToRegister(instr->result()); | 1753 Register result = ToRegister(instr->result()); |
| 1754 Register map = ToRegister(instr->value()); | 1754 Register map = ToRegister(instr->value()); |
| 1755 __ EnumLength(result, map); | 1755 __ EnumLength(result, map); |
| 1756 } | 1756 } |
| 1757 | 1757 |
| 1758 | 1758 |
| 1759 void LCodeGen::DoDateField(LDateField* instr) { | |
| 1760 Register object = ToRegister(instr->date()); | |
| 1761 Register result = ToRegister(instr->result()); | |
| 1762 Register scratch = ToRegister(instr->temp()); | |
| 1763 Smi* index = instr->index(); | |
| 1764 DCHECK(object.is(a0)); | |
| 1765 DCHECK(result.is(v0)); | |
| 1766 DCHECK(!scratch.is(scratch0())); | |
| 1767 DCHECK(!scratch.is(object)); | |
| 1768 | |
| 1769 if (index->value() == 0) { | |
| 1770 __ ld(result, FieldMemOperand(object, JSDate::kValueOffset)); | |
| 1771 } else { | |
| 1772 Label runtime, done; | |
| 1773 if (index->value() < JSDate::kFirstUncachedField) { | |
| 1774 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | |
| 1775 __ li(scratch, Operand(stamp)); | |
| 1776 __ ld(scratch, MemOperand(scratch)); | |
| 1777 __ ld(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); | |
| 1778 __ Branch(&runtime, ne, scratch, Operand(scratch0())); | |
| 1779 __ ld(result, FieldMemOperand(object, JSDate::kValueOffset + | |
| 1780 kPointerSize * index->value())); | |
| 1781 __ jmp(&done); | |
| 1782 } | |
| 1783 __ bind(&runtime); | |
| 1784 __ PrepareCallCFunction(2, scratch); | |
| 1785 __ li(a1, Operand(index)); | |
| 1786 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); | |
| 1787 __ bind(&done); | |
| 1788 } | |
| 1789 } | |
| 1790 | |
| 1791 | |
| 1792 MemOperand LCodeGen::BuildSeqStringOperand(Register string, | 1759 MemOperand LCodeGen::BuildSeqStringOperand(Register string, |
| 1793 LOperand* index, | 1760 LOperand* index, |
| 1794 String::Encoding encoding) { | 1761 String::Encoding encoding) { |
| 1795 if (index->IsConstantOperand()) { | 1762 if (index->IsConstantOperand()) { |
| 1796 int offset = ToInteger32(LConstantOperand::cast(index)); | 1763 int offset = ToInteger32(LConstantOperand::cast(index)); |
| 1797 if (encoding == String::TWO_BYTE_ENCODING) { | 1764 if (encoding == String::TWO_BYTE_ENCODING) { |
| 1798 offset *= kUC16Size; | 1765 offset *= kUC16Size; |
| 1799 } | 1766 } |
| 1800 STATIC_ASSERT(kCharSize == 1); | 1767 STATIC_ASSERT(kCharSize == 1); |
| 1801 return FieldMemOperand(string, SeqString::kHeaderSize + offset); | 1768 return FieldMemOperand(string, SeqString::kHeaderSize + offset); |
| (...skipping 4064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5866 __ Push(at, ToRegister(instr->function())); | 5833 __ Push(at, ToRegister(instr->function())); |
| 5867 CallRuntime(Runtime::kPushBlockContext, instr); | 5834 CallRuntime(Runtime::kPushBlockContext, instr); |
| 5868 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5835 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5869 } | 5836 } |
| 5870 | 5837 |
| 5871 | 5838 |
| 5872 #undef __ | 5839 #undef __ |
| 5873 | 5840 |
| 5874 } // namespace internal | 5841 } // namespace internal |
| 5875 } // namespace v8 | 5842 } // namespace v8 |
| OLD | NEW |