OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1787 Register map = ToRegister(instr->value()); | 1787 Register map = ToRegister(instr->value()); |
1788 __ EnumLength(result, map); | 1788 __ EnumLength(result, map); |
1789 } | 1789 } |
1790 | 1790 |
1791 | 1791 |
1792 void LCodeGen::DoDateField(LDateField* instr) { | 1792 void LCodeGen::DoDateField(LDateField* instr) { |
1793 Register object = ToRegister(instr->date()); | 1793 Register object = ToRegister(instr->date()); |
1794 Register result = ToRegister(instr->result()); | 1794 Register result = ToRegister(instr->result()); |
1795 Register scratch = ToRegister(instr->temp()); | 1795 Register scratch = ToRegister(instr->temp()); |
1796 Smi* index = instr->index(); | 1796 Smi* index = instr->index(); |
1797 Label runtime, done; | |
1798 DCHECK(object.is(a0)); | 1797 DCHECK(object.is(a0)); |
1799 DCHECK(result.is(v0)); | 1798 DCHECK(result.is(v0)); |
1800 DCHECK(!scratch.is(scratch0())); | 1799 DCHECK(!scratch.is(scratch0())); |
1801 DCHECK(!scratch.is(object)); | 1800 DCHECK(!scratch.is(object)); |
1802 | 1801 |
1803 __ SmiTst(object, at); | |
1804 DeoptimizeIf(eq, instr, Deoptimizer::kSmi, at, Operand(zero_reg)); | |
1805 __ GetObjectType(object, scratch, scratch); | |
1806 DeoptimizeIf(ne, instr, Deoptimizer::kNotADateObject, scratch, | |
1807 Operand(JS_DATE_TYPE)); | |
1808 | |
1809 if (index->value() == 0) { | 1802 if (index->value() == 0) { |
1810 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset)); | 1803 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset)); |
1811 } else { | 1804 } else { |
| 1805 Label runtime, done; |
1812 if (index->value() < JSDate::kFirstUncachedField) { | 1806 if (index->value() < JSDate::kFirstUncachedField) { |
1813 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); | 1807 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
1814 __ li(scratch, Operand(stamp)); | 1808 __ li(scratch, Operand(stamp)); |
1815 __ lw(scratch, MemOperand(scratch)); | 1809 __ lw(scratch, MemOperand(scratch)); |
1816 __ lw(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); | 1810 __ lw(scratch0(), FieldMemOperand(object, JSDate::kCacheStampOffset)); |
1817 __ Branch(&runtime, ne, scratch, Operand(scratch0())); | 1811 __ Branch(&runtime, ne, scratch, Operand(scratch0())); |
1818 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset + | 1812 __ lw(result, FieldMemOperand(object, JSDate::kValueOffset + |
1819 kPointerSize * index->value())); | 1813 kPointerSize * index->value())); |
1820 __ jmp(&done); | 1814 __ jmp(&done); |
1821 } | 1815 } |
(...skipping 4240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6062 __ Push(at, ToRegister(instr->function())); | 6056 __ Push(at, ToRegister(instr->function())); |
6063 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6057 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6064 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6058 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6065 } | 6059 } |
6066 | 6060 |
6067 | 6061 |
6068 #undef __ | 6062 #undef __ |
6069 | 6063 |
6070 } // namespace internal | 6064 } // namespace internal |
6071 } // namespace v8 | 6065 } // namespace v8 |
OLD | NEW |