OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
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 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1825 // Allocate heap number in new space. | 1825 // Allocate heap number in new space. |
1826 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, | 1826 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, |
1827 TAG_OBJECT); | 1827 TAG_OBJECT); |
1828 | 1828 |
1829 // Set the map. | 1829 // Set the map. |
1830 mov(FieldOperand(result, HeapObject::kMapOffset), | 1830 mov(FieldOperand(result, HeapObject::kMapOffset), |
1831 Immediate(isolate()->factory()->heap_number_map())); | 1831 Immediate(isolate()->factory()->heap_number_map())); |
1832 } | 1832 } |
1833 | 1833 |
1834 | 1834 |
| 1835 void MacroAssembler::AllocateMutableHeapNumber(Register result, |
| 1836 Register scratch1, |
| 1837 Register scratch2, |
| 1838 Label* gc_required) { |
| 1839 // Allocate heap number in new space. |
| 1840 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, |
| 1841 TAG_OBJECT); |
| 1842 |
| 1843 // Set the map. |
| 1844 mov(FieldOperand(result, HeapObject::kMapOffset), |
| 1845 Immediate(isolate()->factory()->mutable_heap_number_map())); |
| 1846 } |
| 1847 |
| 1848 |
1835 void MacroAssembler::AllocateTwoByteString(Register result, | 1849 void MacroAssembler::AllocateTwoByteString(Register result, |
1836 Register length, | 1850 Register length, |
1837 Register scratch1, | 1851 Register scratch1, |
1838 Register scratch2, | 1852 Register scratch2, |
1839 Register scratch3, | 1853 Register scratch3, |
1840 Label* gc_required) { | 1854 Label* gc_required) { |
1841 // Calculate the number of bytes needed for the characters in the string while | 1855 // Calculate the number of bytes needed for the characters in the string while |
1842 // observing object alignment. | 1856 // observing object alignment. |
1843 ASSERT((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); | 1857 ASSERT((SeqTwoByteString::kHeaderSize & kObjectAlignmentMask) == 0); |
1844 ASSERT(kShortSize == 2); | 1858 ASSERT(kShortSize == 2); |
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3646 if (ms.shift() > 0) sar(edx, ms.shift()); | 3660 if (ms.shift() > 0) sar(edx, ms.shift()); |
3647 mov(eax, dividend); | 3661 mov(eax, dividend); |
3648 shr(eax, 31); | 3662 shr(eax, 31); |
3649 add(edx, eax); | 3663 add(edx, eax); |
3650 } | 3664 } |
3651 | 3665 |
3652 | 3666 |
3653 } } // namespace v8::internal | 3667 } } // namespace v8::internal |
3654 | 3668 |
3655 #endif // V8_TARGET_ARCH_IA32 | 3669 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |