OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.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/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 } | 1806 } |
1807 | 1807 |
1808 | 1808 |
1809 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { | 1809 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
1810 Register result = ToRegister(instr->result()); | 1810 Register result = ToRegister(instr->result()); |
1811 Register map = ToRegister(instr->value()); | 1811 Register map = ToRegister(instr->value()); |
1812 __ EnumLength(result, map); | 1812 __ EnumLength(result, map); |
1813 } | 1813 } |
1814 | 1814 |
1815 | 1815 |
| 1816 void LCodeGen::DoDateField(LDateField* instr) { |
| 1817 Register object = ToRegister(instr->date()); |
| 1818 Register result = ToRegister(instr->result()); |
| 1819 Register scratch = ToRegister(instr->temp()); |
| 1820 Smi* index = instr->index(); |
| 1821 DCHECK(object.is(result)); |
| 1822 DCHECK(object.is(r3)); |
| 1823 DCHECK(!scratch.is(scratch0())); |
| 1824 DCHECK(!scratch.is(object)); |
| 1825 |
| 1826 if (index->value() == 0) { |
| 1827 __ LoadP(result, FieldMemOperand(object, JSDate::kValueOffset)); |
| 1828 } else { |
| 1829 Label runtime, done; |
| 1830 if (index->value() < JSDate::kFirstUncachedField) { |
| 1831 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
| 1832 __ mov(scratch, Operand(stamp)); |
| 1833 __ LoadP(scratch, MemOperand(scratch)); |
| 1834 __ LoadP(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); |
| 1835 __ cmp(scratch, scratch0()); |
| 1836 __ bne(&runtime); |
| 1837 __ LoadP(result, |
| 1838 FieldMemOperand(object, JSDate::kValueOffset + |
| 1839 kPointerSize * index->value())); |
| 1840 __ b(&done); |
| 1841 } |
| 1842 __ bind(&runtime); |
| 1843 __ PrepareCallCFunction(2, scratch); |
| 1844 __ LoadSmiLiteral(r4, index); |
| 1845 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); |
| 1846 __ bind(&done); |
| 1847 } |
| 1848 } |
| 1849 |
| 1850 |
1816 MemOperand LCodeGen::BuildSeqStringOperand(Register string, LOperand* index, | 1851 MemOperand LCodeGen::BuildSeqStringOperand(Register string, LOperand* index, |
1817 String::Encoding encoding) { | 1852 String::Encoding encoding) { |
1818 if (index->IsConstantOperand()) { | 1853 if (index->IsConstantOperand()) { |
1819 int offset = ToInteger32(LConstantOperand::cast(index)); | 1854 int offset = ToInteger32(LConstantOperand::cast(index)); |
1820 if (encoding == String::TWO_BYTE_ENCODING) { | 1855 if (encoding == String::TWO_BYTE_ENCODING) { |
1821 offset *= kUC16Size; | 1856 offset *= kUC16Size; |
1822 } | 1857 } |
1823 STATIC_ASSERT(kCharSize == 1); | 1858 STATIC_ASSERT(kCharSize == 1); |
1824 return FieldMemOperand(string, SeqString::kHeaderSize + offset); | 1859 return FieldMemOperand(string, SeqString::kHeaderSize + offset); |
1825 } | 1860 } |
(...skipping 4041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5867 __ Push(scope_info); | 5902 __ Push(scope_info); |
5868 __ push(ToRegister(instr->function())); | 5903 __ push(ToRegister(instr->function())); |
5869 CallRuntime(Runtime::kPushBlockContext, instr); | 5904 CallRuntime(Runtime::kPushBlockContext, instr); |
5870 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5905 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5871 } | 5906 } |
5872 | 5907 |
5873 | 5908 |
5874 #undef __ | 5909 #undef __ |
5875 } // namespace internal | 5910 } // namespace internal |
5876 } // namespace v8 | 5911 } // namespace v8 |
OLD | NEW |