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 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1814 cmp(object, Operand::StaticVariable(new_space_allocation_top)); | 1814 cmp(object, Operand::StaticVariable(new_space_allocation_top)); |
1815 Check(below, kUndoAllocationOfNonAllocatedMemory); | 1815 Check(below, kUndoAllocationOfNonAllocatedMemory); |
1816 #endif | 1816 #endif |
1817 mov(Operand::StaticVariable(new_space_allocation_top), object); | 1817 mov(Operand::StaticVariable(new_space_allocation_top), object); |
1818 } | 1818 } |
1819 | 1819 |
1820 | 1820 |
1821 void MacroAssembler::AllocateHeapNumber(Register result, | 1821 void MacroAssembler::AllocateHeapNumber(Register result, |
1822 Register scratch1, | 1822 Register scratch1, |
1823 Register scratch2, | 1823 Register scratch2, |
1824 Label* gc_required) { | 1824 Label* gc_required, |
| 1825 MutableMode mode) { |
1825 // Allocate heap number in new space. | 1826 // Allocate heap number in new space. |
1826 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, | 1827 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, |
1827 TAG_OBJECT); | 1828 TAG_OBJECT); |
1828 | 1829 |
| 1830 Handle<Map> map = mode == MUTABLE |
| 1831 ? isolate()->factory()->mutable_heap_number_map() |
| 1832 : isolate()->factory()->heap_number_map(); |
| 1833 |
1829 // Set the map. | 1834 // Set the map. |
1830 mov(FieldOperand(result, HeapObject::kMapOffset), | 1835 mov(FieldOperand(result, HeapObject::kMapOffset), Immediate(map)); |
1831 Immediate(isolate()->factory()->heap_number_map())); | |
1832 } | 1836 } |
1833 | 1837 |
1834 | 1838 |
1835 void MacroAssembler::AllocateTwoByteString(Register result, | 1839 void MacroAssembler::AllocateTwoByteString(Register result, |
1836 Register length, | 1840 Register length, |
1837 Register scratch1, | 1841 Register scratch1, |
1838 Register scratch2, | 1842 Register scratch2, |
1839 Register scratch3, | 1843 Register scratch3, |
1840 Label* gc_required) { | 1844 Label* gc_required) { |
1841 // Calculate the number of bytes needed for the characters in the string while | 1845 // Calculate the number of bytes needed for the characters in the string while |
(...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3646 if (ms.shift() > 0) sar(edx, ms.shift()); | 3650 if (ms.shift() > 0) sar(edx, ms.shift()); |
3647 mov(eax, dividend); | 3651 mov(eax, dividend); |
3648 shr(eax, 31); | 3652 shr(eax, 31); |
3649 add(edx, eax); | 3653 add(edx, eax); |
3650 } | 3654 } |
3651 | 3655 |
3652 | 3656 |
3653 } } // namespace v8::internal | 3657 } } // namespace v8::internal |
3654 | 3658 |
3655 #endif // V8_TARGET_ARCH_IA32 | 3659 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |