OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 7 #if V8_TARGET_ARCH_X64 |
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 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1769 Register result = ToRegister(instr->result()); | 1769 Register result = ToRegister(instr->result()); |
1770 Register map = ToRegister(instr->value()); | 1770 Register map = ToRegister(instr->value()); |
1771 __ EnumLength(result, map); | 1771 __ EnumLength(result, map); |
1772 } | 1772 } |
1773 | 1773 |
1774 | 1774 |
1775 void LCodeGen::DoDateField(LDateField* instr) { | 1775 void LCodeGen::DoDateField(LDateField* instr) { |
1776 Register object = ToRegister(instr->date()); | 1776 Register object = ToRegister(instr->date()); |
1777 Register result = ToRegister(instr->result()); | 1777 Register result = ToRegister(instr->result()); |
1778 Smi* index = instr->index(); | 1778 Smi* index = instr->index(); |
1779 Label runtime, done, not_date_object; | |
1780 DCHECK(object.is(result)); | 1779 DCHECK(object.is(result)); |
1781 DCHECK(object.is(rax)); | 1780 DCHECK(object.is(rax)); |
1782 | 1781 |
1783 Condition cc = masm()->CheckSmi(object); | 1782 if (FLAG_debug_code) { |
1784 DeoptimizeIf(cc, instr, Deoptimizer::kSmi); | 1783 __ AssertNotSmi(object); |
1785 __ CmpObjectType(object, JS_DATE_TYPE, kScratchRegister); | 1784 __ CmpObjectType(object, JS_DATE_TYPE, kScratchRegister); |
1786 DeoptimizeIf(not_equal, instr, Deoptimizer::kNotADateObject); | 1785 __ Check(equal, kOperandIsNotADate); |
| 1786 } |
1787 | 1787 |
1788 if (index->value() == 0) { | 1788 if (index->value() == 0) { |
1789 __ movp(result, FieldOperand(object, JSDate::kValueOffset)); | 1789 __ movp(result, FieldOperand(object, JSDate::kValueOffset)); |
1790 } else { | 1790 } else { |
| 1791 Label runtime, done; |
1791 if (index->value() < JSDate::kFirstUncachedField) { | 1792 if (index->value() < JSDate::kFirstUncachedField) { |
1792 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | 1793 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
1793 Operand stamp_operand = __ ExternalOperand(stamp); | 1794 Operand stamp_operand = __ ExternalOperand(stamp); |
1794 __ movp(kScratchRegister, stamp_operand); | 1795 __ movp(kScratchRegister, stamp_operand); |
1795 __ cmpp(kScratchRegister, FieldOperand(object, | 1796 __ cmpp(kScratchRegister, FieldOperand(object, |
1796 JSDate::kCacheStampOffset)); | 1797 JSDate::kCacheStampOffset)); |
1797 __ j(not_equal, &runtime, Label::kNear); | 1798 __ j(not_equal, &runtime, Label::kNear); |
1798 __ movp(result, FieldOperand(object, JSDate::kValueOffset + | 1799 __ movp(result, FieldOperand(object, JSDate::kValueOffset + |
1799 kPointerSize * index->value())); | 1800 kPointerSize * index->value())); |
1800 __ jmp(&done, Label::kNear); | 1801 __ jmp(&done, Label::kNear); |
(...skipping 4225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6026 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6027 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6027 } | 6028 } |
6028 | 6029 |
6029 | 6030 |
6030 #undef __ | 6031 #undef __ |
6031 | 6032 |
6032 } // namespace internal | 6033 } // namespace internal |
6033 } // namespace v8 | 6034 } // namespace v8 |
6034 | 6035 |
6035 #endif // V8_TARGET_ARCH_X64 | 6036 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |