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 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 Register map = ToRegister(instr->value()); | 1783 Register map = ToRegister(instr->value()); |
1784 __ EnumLength(result, map); | 1784 __ EnumLength(result, map); |
1785 } | 1785 } |
1786 | 1786 |
1787 | 1787 |
1788 void LCodeGen::DoDateField(LDateField* instr) { | 1788 void LCodeGen::DoDateField(LDateField* instr) { |
1789 Register object = ToRegister(instr->date()); | 1789 Register object = ToRegister(instr->date()); |
1790 Register result = ToRegister(instr->result()); | 1790 Register result = ToRegister(instr->result()); |
1791 Register scratch = ToRegister(instr->temp()); | 1791 Register scratch = ToRegister(instr->temp()); |
1792 Smi* index = instr->index(); | 1792 Smi* index = instr->index(); |
1793 Label runtime, done; | |
1794 DCHECK(object.is(result)); | 1793 DCHECK(object.is(result)); |
1795 DCHECK(object.is(eax)); | 1794 DCHECK(object.is(eax)); |
1796 | 1795 |
1797 __ test(object, Immediate(kSmiTagMask)); | |
1798 DeoptimizeIf(zero, instr, Deoptimizer::kSmi); | |
1799 __ CmpObjectType(object, JS_DATE_TYPE, scratch); | |
1800 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotADateObject); | |
1801 | |
1802 if (index->value() == 0) { | 1796 if (index->value() == 0) { |
1803 __ mov(result, FieldOperand(object, JSDate::kValueOffset)); | 1797 __ mov(result, FieldOperand(object, JSDate::kValueOffset)); |
1804 } else { | 1798 } else { |
| 1799 Label runtime, done; |
1805 if (index->value() < JSDate::kFirstUncachedField) { | 1800 if (index->value() < JSDate::kFirstUncachedField) { |
1806 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | 1801 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
1807 __ mov(scratch, Operand::StaticVariable(stamp)); | 1802 __ mov(scratch, Operand::StaticVariable(stamp)); |
1808 __ cmp(scratch, FieldOperand(object, JSDate::kCacheStampOffset)); | 1803 __ cmp(scratch, FieldOperand(object, JSDate::kCacheStampOffset)); |
1809 __ j(not_equal, &runtime, Label::kNear); | 1804 __ j(not_equal, &runtime, Label::kNear); |
1810 __ mov(result, FieldOperand(object, JSDate::kValueOffset + | 1805 __ mov(result, FieldOperand(object, JSDate::kValueOffset + |
1811 kPointerSize * index->value())); | 1806 kPointerSize * index->value())); |
1812 __ jmp(&done, Label::kNear); | 1807 __ jmp(&done, Label::kNear); |
1813 } | 1808 } |
1814 __ bind(&runtime); | 1809 __ bind(&runtime); |
(...skipping 4018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5833 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5828 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5834 } | 5829 } |
5835 | 5830 |
5836 | 5831 |
5837 #undef __ | 5832 #undef __ |
5838 | 5833 |
5839 } // namespace internal | 5834 } // namespace internal |
5840 } // namespace v8 | 5835 } // namespace v8 |
5841 | 5836 |
5842 #endif // V8_TARGET_ARCH_IA32 | 5837 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |