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 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 Condition MacroAssembler::IsObjectNameType(Register heap_object, | 745 Condition MacroAssembler::IsObjectNameType(Register heap_object, |
746 Register map, | 746 Register map, |
747 Register instance_type) { | 747 Register instance_type) { |
748 mov(map, FieldOperand(heap_object, HeapObject::kMapOffset)); | 748 mov(map, FieldOperand(heap_object, HeapObject::kMapOffset)); |
749 movzx_b(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); | 749 movzx_b(instance_type, FieldOperand(map, Map::kInstanceTypeOffset)); |
750 cmpb(instance_type, static_cast<uint8_t>(LAST_NAME_TYPE)); | 750 cmpb(instance_type, static_cast<uint8_t>(LAST_NAME_TYPE)); |
751 return below_equal; | 751 return below_equal; |
752 } | 752 } |
753 | 753 |
754 | 754 |
| 755 void MacroAssembler::IsObjectJSObjectType(Register heap_object, |
| 756 Register map, |
| 757 Register scratch, |
| 758 Label* fail) { |
| 759 mov(map, FieldOperand(heap_object, HeapObject::kMapOffset)); |
| 760 IsInstanceJSObjectType(map, scratch, fail); |
| 761 } |
| 762 |
| 763 |
| 764 void MacroAssembler::IsInstanceJSObjectType(Register map, |
| 765 Register scratch, |
| 766 Label* fail) { |
| 767 movzx_b(scratch, FieldOperand(map, Map::kInstanceTypeOffset)); |
| 768 sub(scratch, Immediate(FIRST_NONCALLABLE_SPEC_OBJECT_TYPE)); |
| 769 cmp(scratch, |
| 770 LAST_NONCALLABLE_SPEC_OBJECT_TYPE - FIRST_NONCALLABLE_SPEC_OBJECT_TYPE); |
| 771 j(above, fail); |
| 772 } |
| 773 |
| 774 |
755 void MacroAssembler::FCmp() { | 775 void MacroAssembler::FCmp() { |
756 fucomip(); | 776 fucomip(); |
757 fstp(0); | 777 fstp(0); |
758 } | 778 } |
759 | 779 |
760 | 780 |
761 void MacroAssembler::AssertNumber(Register object) { | 781 void MacroAssembler::AssertNumber(Register object) { |
762 if (emit_debug_code()) { | 782 if (emit_debug_code()) { |
763 Label ok; | 783 Label ok; |
764 JumpIfSmi(object, &ok); | 784 JumpIfSmi(object, &ok); |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1757 j(sign, then_label); | 1777 j(sign, then_label); |
1758 bind(&ok); | 1778 bind(&ok); |
1759 } | 1779 } |
1760 | 1780 |
1761 | 1781 |
1762 void MacroAssembler::GetMapConstructor(Register result, Register map, | 1782 void MacroAssembler::GetMapConstructor(Register result, Register map, |
1763 Register temp) { | 1783 Register temp) { |
1764 Label done, loop; | 1784 Label done, loop; |
1765 mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); | 1785 mov(result, FieldOperand(map, Map::kConstructorOrBackPointerOffset)); |
1766 bind(&loop); | 1786 bind(&loop); |
1767 JumpIfSmi(result, &done, Label::kNear); | 1787 JumpIfSmi(result, &done); |
1768 CmpObjectType(result, MAP_TYPE, temp); | 1788 CmpObjectType(result, MAP_TYPE, temp); |
1769 j(not_equal, &done, Label::kNear); | 1789 j(not_equal, &done); |
1770 mov(result, FieldOperand(result, Map::kConstructorOrBackPointerOffset)); | 1790 mov(result, FieldOperand(result, Map::kConstructorOrBackPointerOffset)); |
1771 jmp(&loop); | 1791 jmp(&loop); |
1772 bind(&done); | 1792 bind(&done); |
1773 } | 1793 } |
1774 | 1794 |
1775 | 1795 |
1776 void MacroAssembler::TryGetFunctionPrototype(Register function, Register result, | 1796 void MacroAssembler::TryGetFunctionPrototype(Register function, Register result, |
1777 Register scratch, Label* miss) { | 1797 Register scratch, Label* miss) { |
1778 // Get the prototype or initial map from the function. | 1798 // Get the prototype or initial map from the function. |
1779 mov(result, | 1799 mov(result, |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3163 mov(eax, dividend); | 3183 mov(eax, dividend); |
3164 shr(eax, 31); | 3184 shr(eax, 31); |
3165 add(edx, eax); | 3185 add(edx, eax); |
3166 } | 3186 } |
3167 | 3187 |
3168 | 3188 |
3169 } // namespace internal | 3189 } // namespace internal |
3170 } // namespace v8 | 3190 } // namespace v8 |
3171 | 3191 |
3172 #endif // V8_TARGET_ARCH_IA32 | 3192 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |