| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 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 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1727 j(not_zero, &short_loop); | 1727 j(not_zero, &short_loop); |
| 1728 | 1728 |
| 1729 bind(&done); | 1729 bind(&done); |
| 1730 } | 1730 } |
| 1731 | 1731 |
| 1732 | 1732 |
| 1733 void MacroAssembler::InitializeFieldsWithFiller(Register current_address, | 1733 void MacroAssembler::InitializeFieldsWithFiller(Register current_address, |
| 1734 Register end_address, | 1734 Register end_address, |
| 1735 Register filler) { | 1735 Register filler) { |
| 1736 Label loop, entry; | 1736 Label loop, entry; |
| 1737 jmp(&entry); | 1737 jmp(&entry, Label::kNear); |
| 1738 bind(&loop); | 1738 bind(&loop); |
| 1739 mov(Operand(current_address, 0), filler); | 1739 mov(Operand(current_address, 0), filler); |
| 1740 add(current_address, Immediate(kPointerSize)); | 1740 add(current_address, Immediate(kPointerSize)); |
| 1741 bind(&entry); | 1741 bind(&entry); |
| 1742 cmp(current_address, end_address); | 1742 cmp(current_address, end_address); |
| 1743 j(below, &loop); | 1743 j(below, &loop, Label::kNear); |
| 1744 } | 1744 } |
| 1745 | 1745 |
| 1746 | 1746 |
| 1747 void MacroAssembler::BooleanBitTest(Register object, | 1747 void MacroAssembler::BooleanBitTest(Register object, |
| 1748 int field_offset, | 1748 int field_offset, |
| 1749 int bit_index) { | 1749 int bit_index) { |
| 1750 bit_index += kSmiTagSize + kSmiShiftSize; | 1750 bit_index += kSmiTagSize + kSmiShiftSize; |
| 1751 DCHECK(base::bits::IsPowerOfTwo32(kBitsPerByte)); | 1751 DCHECK(base::bits::IsPowerOfTwo32(kBitsPerByte)); |
| 1752 int byte_index = bit_index / kBitsPerByte; | 1752 int byte_index = bit_index / kBitsPerByte; |
| 1753 int byte_bit_index = bit_index & (kBitsPerByte - 1); | 1753 int byte_bit_index = bit_index & (kBitsPerByte - 1); |
| 1754 test_b(FieldOperand(object, field_offset + byte_index), | 1754 test_b(FieldOperand(object, field_offset + byte_index), |
| 1755 static_cast<byte>(1 << byte_bit_index)); | 1755 static_cast<byte>(1 << byte_bit_index)); |
| 1756 } | 1756 } |
| 1757 | 1757 |
| 1758 | 1758 |
| 1759 | 1759 |
| 1760 void MacroAssembler::NegativeZeroTest(Register result, | 1760 void MacroAssembler::NegativeZeroTest(Register result, |
| 1761 Register op, | 1761 Register op, |
| 1762 Label* then_label) { | 1762 Label* then_label) { |
| 1763 Label ok; | 1763 Label ok; |
| 1764 test(result, result); | 1764 test(result, result); |
| 1765 j(not_zero, &ok); | 1765 j(not_zero, &ok, Label::kNear); |
| 1766 test(op, op); | 1766 test(op, op); |
| 1767 j(sign, then_label); | 1767 j(sign, then_label, Label::kNear); |
| 1768 bind(&ok); | 1768 bind(&ok); |
| 1769 } | 1769 } |
| 1770 | 1770 |
| 1771 | 1771 |
| 1772 void MacroAssembler::NegativeZeroTest(Register result, | 1772 void MacroAssembler::NegativeZeroTest(Register result, |
| 1773 Register op1, | 1773 Register op1, |
| 1774 Register op2, | 1774 Register op2, |
| 1775 Register scratch, | 1775 Register scratch, |
| 1776 Label* then_label) { | 1776 Label* then_label) { |
| 1777 Label ok; | 1777 Label ok; |
| 1778 test(result, result); | 1778 test(result, result); |
| 1779 j(not_zero, &ok); | 1779 j(not_zero, &ok, Label::kNear); |
| 1780 mov(scratch, op1); | 1780 mov(scratch, op1); |
| 1781 or_(scratch, op2); | 1781 or_(scratch, op2); |
| 1782 j(sign, then_label); | 1782 j(sign, then_label, Label::kNear); |
| 1783 bind(&ok); | 1783 bind(&ok); |
| 1784 } | 1784 } |
| 1785 | 1785 |
| 1786 | 1786 |
| 1787 void MacroAssembler::GetMapConstructor(Register result, Register map, | 1787 void MacroAssembler::GetMapConstructor(Register result, Register map, |
| 1788 Register temp) { | 1788 Register temp) { |
| 1789 Label done, loop; | 1789 Label done, loop; |
| 1790 mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); | 1790 mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); |
| 1791 bind(&loop); | 1791 bind(&loop); |
| 1792 JumpIfSmi(result, &done, Label::kNear); | 1792 JumpIfSmi(result, &done, Label::kNear); |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2976 mov(eax, dividend); | 2976 mov(eax, dividend); |
| 2977 shr(eax, 31); | 2977 shr(eax, 31); |
| 2978 add(edx, eax); | 2978 add(edx, eax); |
| 2979 } | 2979 } |
| 2980 | 2980 |
| 2981 | 2981 |
| 2982 } // namespace internal | 2982 } // namespace internal |
| 2983 } // namespace v8 | 2983 } // namespace v8 |
| 2984 | 2984 |
| 2985 #endif // V8_TARGET_ARCH_X87 | 2985 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |