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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 j(not_zero, &short_loop); | 1761 j(not_zero, &short_loop); |
1762 | 1762 |
1763 bind(&done); | 1763 bind(&done); |
1764 } | 1764 } |
1765 | 1765 |
1766 | 1766 |
1767 void MacroAssembler::InitializeFieldsWithFiller(Register current_address, | 1767 void MacroAssembler::InitializeFieldsWithFiller(Register current_address, |
1768 Register end_address, | 1768 Register end_address, |
1769 Register filler) { | 1769 Register filler) { |
1770 Label loop, entry; | 1770 Label loop, entry; |
1771 jmp(&entry); | 1771 jmp(&entry, Label::kNear); |
1772 bind(&loop); | 1772 bind(&loop); |
1773 mov(Operand(current_address, 0), filler); | 1773 mov(Operand(current_address, 0), filler); |
1774 add(current_address, Immediate(kPointerSize)); | 1774 add(current_address, Immediate(kPointerSize)); |
1775 bind(&entry); | 1775 bind(&entry); |
1776 cmp(current_address, end_address); | 1776 cmp(current_address, end_address); |
1777 j(below, &loop); | 1777 j(below, &loop, Label::kNear); |
1778 } | 1778 } |
1779 | 1779 |
1780 | 1780 |
1781 void MacroAssembler::BooleanBitTest(Register object, | 1781 void MacroAssembler::BooleanBitTest(Register object, |
1782 int field_offset, | 1782 int field_offset, |
1783 int bit_index) { | 1783 int bit_index) { |
1784 bit_index += kSmiTagSize + kSmiShiftSize; | 1784 bit_index += kSmiTagSize + kSmiShiftSize; |
1785 DCHECK(base::bits::IsPowerOfTwo32(kBitsPerByte)); | 1785 DCHECK(base::bits::IsPowerOfTwo32(kBitsPerByte)); |
1786 int byte_index = bit_index / kBitsPerByte; | 1786 int byte_index = bit_index / kBitsPerByte; |
1787 int byte_bit_index = bit_index & (kBitsPerByte - 1); | 1787 int byte_bit_index = bit_index & (kBitsPerByte - 1); |
1788 test_b(FieldOperand(object, field_offset + byte_index), | 1788 test_b(FieldOperand(object, field_offset + byte_index), |
1789 static_cast<byte>(1 << byte_bit_index)); | 1789 static_cast<byte>(1 << byte_bit_index)); |
1790 } | 1790 } |
1791 | 1791 |
1792 | 1792 |
1793 | 1793 |
1794 void MacroAssembler::NegativeZeroTest(Register result, | 1794 void MacroAssembler::NegativeZeroTest(Register result, |
1795 Register op, | 1795 Register op, |
1796 Label* then_label) { | 1796 Label* then_label) { |
1797 Label ok; | 1797 Label ok; |
1798 test(result, result); | 1798 test(result, result); |
1799 j(not_zero, &ok); | 1799 j(not_zero, &ok, Label::kNear); |
1800 test(op, op); | 1800 test(op, op); |
1801 j(sign, then_label); | 1801 j(sign, then_label, Label::kNear); |
1802 bind(&ok); | 1802 bind(&ok); |
1803 } | 1803 } |
1804 | 1804 |
1805 | 1805 |
1806 void MacroAssembler::NegativeZeroTest(Register result, | 1806 void MacroAssembler::NegativeZeroTest(Register result, |
1807 Register op1, | 1807 Register op1, |
1808 Register op2, | 1808 Register op2, |
1809 Register scratch, | 1809 Register scratch, |
1810 Label* then_label) { | 1810 Label* then_label) { |
1811 Label ok; | 1811 Label ok; |
1812 test(result, result); | 1812 test(result, result); |
1813 j(not_zero, &ok); | 1813 j(not_zero, &ok, Label::kNear); |
1814 mov(scratch, op1); | 1814 mov(scratch, op1); |
1815 or_(scratch, op2); | 1815 or_(scratch, op2); |
1816 j(sign, then_label); | 1816 j(sign, then_label, Label::kNear); |
1817 bind(&ok); | 1817 bind(&ok); |
1818 } | 1818 } |
1819 | 1819 |
1820 | 1820 |
1821 void MacroAssembler::GetMapConstructor(Register result, Register map, | 1821 void MacroAssembler::GetMapConstructor(Register result, Register map, |
1822 Register temp) { | 1822 Register temp) { |
1823 Label done, loop; | 1823 Label done, loop; |
1824 mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); | 1824 mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); |
1825 bind(&loop); | 1825 bind(&loop); |
1826 JumpIfSmi(result, &done, Label::kNear); | 1826 JumpIfSmi(result, &done, Label::kNear); |
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3104 mov(eax, dividend); | 3104 mov(eax, dividend); |
3105 shr(eax, 31); | 3105 shr(eax, 31); |
3106 add(edx, eax); | 3106 add(edx, eax); |
3107 } | 3107 } |
3108 | 3108 |
3109 | 3109 |
3110 } // namespace internal | 3110 } // namespace internal |
3111 } // namespace v8 | 3111 } // namespace v8 |
3112 | 3112 |
3113 #endif // V8_TARGET_ARCH_IA32 | 3113 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |