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/v8.h" | 5 #include "src/v8.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/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1776 Register map = ToRegister(instr->value()); | 1776 Register map = ToRegister(instr->value()); |
1777 __ EnumLength(result, map); | 1777 __ EnumLength(result, map); |
1778 } | 1778 } |
1779 | 1779 |
1780 | 1780 |
1781 void LCodeGen::DoDateField(LDateField* instr) { | 1781 void LCodeGen::DoDateField(LDateField* instr) { |
1782 Register object = ToRegister(instr->date()); | 1782 Register object = ToRegister(instr->date()); |
1783 Register result = ToRegister(instr->result()); | 1783 Register result = ToRegister(instr->result()); |
1784 Register scratch = ToRegister(instr->temp()); | 1784 Register scratch = ToRegister(instr->temp()); |
1785 Smi* index = instr->index(); | 1785 Smi* index = instr->index(); |
1786 Label runtime, done; | |
1787 DCHECK(object.is(a0)); | 1786 DCHECK(object.is(a0)); |
1788 DCHECK(result.is(v0)); | 1787 DCHECK(result.is(v0)); |
1789 DCHECK(!scratch.is(scratch0())); | 1788 DCHECK(!scratch.is(scratch0())); |
1790 DCHECK(!scratch.is(object)); | 1789 DCHECK(!scratch.is(object)); |
1791 | 1790 |
1792 __ SmiTst(object, at); | |
1793 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, at, Operand(zero_reg)); | |
1794 __ GetObjectType(object, scratch, scratch); | |
1795 DeoptimizeIf(ne, instr, Deoptimizer::kNotADateObject, scratch, | |
1796 Operand(JS_DATE_TYPE)); | |
1797 | |
1798 if (index->value() == 0) { | 1791 if (index->value() == 0) { |
1799 __ ld(result, FieldMemOperand(object, JSDate::kValueOffset)); | 1792 __ ld(result, FieldMemOperand(object, JSDate::kValueOffset)); |
1800 } else { | 1793 } else { |
| 1794 Label runtime, done; |
1801 if (index->value() < JSDate::kFirstUncachedField) { | 1795 if (index->value() < JSDate::kFirstUncachedField) { |
1802 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | 1796 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
1803 __ li(scratch, Operand(stamp)); | 1797 __ li(scratch, Operand(stamp)); |
1804 __ ld(scratch, MemOperand(scratch)); | 1798 __ ld(scratch, MemOperand(scratch)); |
1805 __ ld(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); | 1799 __ ld(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); |
1806 __ Branch(&runtime, ne, scratch, Operand(scratch0())); | 1800 __ Branch(&runtime, ne, scratch, Operand(scratch0())); |
1807 __ ld(result, FieldMemOperand(object, JSDate::kValueOffset + | 1801 __ ld(result, FieldMemOperand(object, JSDate::kValueOffset + |
1808 kPointerSize * index->value())); | 1802 kPointerSize * index->value())); |
1809 __ jmp(&done); | 1803 __ jmp(&done); |
1810 } | 1804 } |
(...skipping 4312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6123 __ Push(at, ToRegister(instr->function())); | 6117 __ Push(at, ToRegister(instr->function())); |
6124 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6118 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6125 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6119 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6126 } | 6120 } |
6127 | 6121 |
6128 | 6122 |
6129 #undef __ | 6123 #undef __ |
6130 | 6124 |
6131 } // namespace internal | 6125 } // namespace internal |
6132 } // namespace v8 | 6126 } // namespace v8 |
OLD | NEW |