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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" |
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 1657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1668 } | 1668 } |
1669 | 1669 |
1670 | 1670 |
1671 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { | 1671 void LCodeGen::DoMapEnumLength(LMapEnumLength* instr) { |
1672 Register result = ToRegister(instr->result()); | 1672 Register result = ToRegister(instr->result()); |
1673 Register map = ToRegister(instr->value()); | 1673 Register map = ToRegister(instr->value()); |
1674 __ EnumLength(result, map); | 1674 __ EnumLength(result, map); |
1675 } | 1675 } |
1676 | 1676 |
1677 | 1677 |
| 1678 void LCodeGen::DoDateField(LDateField* instr) { |
| 1679 Register object = ToRegister(instr->date()); |
| 1680 Register result = ToRegister(instr->result()); |
| 1681 Register scratch = ToRegister(instr->temp()); |
| 1682 Smi* index = instr->index(); |
| 1683 DCHECK(object.is(result)); |
| 1684 DCHECK(object.is(eax)); |
| 1685 |
| 1686 if (index->value() == 0) { |
| 1687 __ mov(result, FieldOperand(object, JSDate::kValueOffset)); |
| 1688 } else { |
| 1689 Label runtime, done; |
| 1690 if (index->value() < JSDate::kFirstUncachedField) { |
| 1691 ExternalReference stamp = ExternalReference::date_cache_stamp(isolate()); |
| 1692 __ mov(scratch, Operand::StaticVariable(stamp)); |
| 1693 __ cmp(scratch, FieldOperand(object, JSDate::kCacheStampOffset)); |
| 1694 __ j(not_equal, &runtime, Label::kNear); |
| 1695 __ mov(result, FieldOperand(object, JSDate::kValueOffset + |
| 1696 kPointerSize * index->value())); |
| 1697 __ jmp(&done, Label::kNear); |
| 1698 } |
| 1699 __ bind(&runtime); |
| 1700 __ PrepareCallCFunction(2, scratch); |
| 1701 __ mov(Operand(esp, 0), object); |
| 1702 __ mov(Operand(esp, 1 * kPointerSize), Immediate(index)); |
| 1703 __ CallCFunction(ExternalReference::get_date_field_function(isolate()), 2); |
| 1704 __ bind(&done); |
| 1705 } |
| 1706 } |
| 1707 |
| 1708 |
1678 Operand LCodeGen::BuildSeqStringOperand(Register string, | 1709 Operand LCodeGen::BuildSeqStringOperand(Register string, |
1679 LOperand* index, | 1710 LOperand* index, |
1680 String::Encoding encoding) { | 1711 String::Encoding encoding) { |
1681 if (index->IsConstantOperand()) { | 1712 if (index->IsConstantOperand()) { |
1682 int offset = ToRepresentation(LConstantOperand::cast(index), | 1713 int offset = ToRepresentation(LConstantOperand::cast(index), |
1683 Representation::Integer32()); | 1714 Representation::Integer32()); |
1684 if (encoding == String::TWO_BYTE_ENCODING) { | 1715 if (encoding == String::TWO_BYTE_ENCODING) { |
1685 offset *= kUC16Size; | 1716 offset *= kUC16Size; |
1686 } | 1717 } |
1687 STATIC_ASSERT(kCharSize == 1); | 1718 STATIC_ASSERT(kCharSize == 1); |
(...skipping 3780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5468 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5499 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5469 } | 5500 } |
5470 | 5501 |
5471 | 5502 |
5472 #undef __ | 5503 #undef __ |
5473 | 5504 |
5474 } // namespace internal | 5505 } // namespace internal |
5475 } // namespace v8 | 5506 } // namespace v8 |
5476 | 5507 |
5477 #endif // V8_TARGET_ARCH_IA32 | 5508 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |