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/arm/lithium-codegen-arm.h" | 5 #include "src/crankshaft/arm/lithium-codegen-arm.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" | 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" |
(...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 } | 1803 } |
1804 | 1804 |
1805 | 1805 |
1806 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { | 1806 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
1807 Register result = ToRegister(instr->result()); | 1807 Register result = ToRegister(instr->result()); |
1808 Register map = ToRegister(instr->value()); | 1808 Register map = ToRegister(instr->value()); |
1809 __ EnumLength(result, map); | 1809 __ EnumLength(result, map); |
1810 } | 1810 } |
1811 | 1811 |
1812 | 1812 |
1813 void LCodeGen::DoDateField(LDateField* instr) { | |
1814 Register object = ToRegister(instr->date()); | |
1815 Register result = ToRegister(instr->result()); | |
1816 Register scratch = ToRegister(instr->temp()); | |
1817 Smi* index = instr->index(); | |
1818 DCHECK(object.is(result)); | |
1819 DCHECK(object.is(r0)); | |
1820 DCHECK(!scratch.is(scratch0())); | |
1821 DCHECK(!scratch.is(object)); | |
1822 | |
1823 if (index->value() == 0) { | |
1824 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset)); | |
1825 } else { | |
1826 Label runtime, done; | |
1827 if (index->value() < JSDate::kFirstUncachedField) { | |
1828 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | |
1829 __ mov(scratch, Operand(stamp)); | |
1830 __ ldr(scratch, MemOperand(scratch)); | |
1831 __ ldr(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); | |
1832 __ cmp(scratch, scratch0()); | |
1833 __ b(ne, &runtime); | |
1834 __ ldr(result, FieldMemOperand(object, JSDate::kValueOffset + | |
1835 kPointerSize * index->value())); | |
1836 __ jmp(&done); | |
1837 } | |
1838 __ bind(&runtime); | |
1839 __ PrepareCallCFunction(2, scratch); | |
1840 __ mov(r1, Operand(index)); | |
1841 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); | |
1842 __ bind(&done); | |
1843 } | |
1844 } | |
1845 | |
1846 | |
1847 MemOperand LCodeGen::BuildSeqStringOperand(Register string, | 1813 MemOperand LCodeGen::BuildSeqStringOperand(Register string, |
1848 LOperand* index, | 1814 LOperand* index, |
1849 String::Encoding encoding) { | 1815 String::Encoding encoding) { |
1850 if (index->IsConstantOperand()) { | 1816 if (index->IsConstantOperand()) { |
1851 int offset = ToInteger32(LConstantOperand::cast(index)); | 1817 int offset = ToInteger32(LConstantOperand::cast(index)); |
1852 if (encoding == String::TWO_BYTE_ENCODING) { | 1818 if (encoding == String::TWO_BYTE_ENCODING) { |
1853 offset *= kUC16Size; | 1819 offset *= kUC16Size; |
1854 } | 1820 } |
1855 STATIC_ASSERT(kCharSize == 1); | 1821 STATIC_ASSERT(kCharSize == 1); |
1856 return FieldMemOperand(string, SeqString::kHeaderSize + offset); | 1822 return FieldMemOperand(string, SeqString::kHeaderSize + offset); |
(...skipping 3775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5632 __ push(ToRegister(instr->function())); | 5598 __ push(ToRegister(instr->function())); |
5633 CallRuntime(Runtime::kPushBlockContext, instr); | 5599 CallRuntime(Runtime::kPushBlockContext, instr); |
5634 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5600 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5635 } | 5601 } |
5636 | 5602 |
5637 | 5603 |
5638 #undef __ | 5604 #undef __ |
5639 | 5605 |
5640 } // namespace internal | 5606 } // namespace internal |
5641 } // namespace v8 | 5607 } // namespace v8 |
OLD | NEW |