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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1676 cmp(object, Operand::StaticVariable(new_space_allocation_top)); | 1676 cmp(object, Operand::StaticVariable(new_space_allocation_top)); |
1677 Check(below, kUndoAllocationOfNonAllocatedMemory); | 1677 Check(below, kUndoAllocationOfNonAllocatedMemory); |
1678 #endif | 1678 #endif |
1679 mov(Operand::StaticVariable(new_space_allocation_top), object); | 1679 mov(Operand::StaticVariable(new_space_allocation_top), object); |
1680 } | 1680 } |
1681 | 1681 |
1682 | 1682 |
1683 void MacroAssembler::AllocateHeapNumber(Register result, | 1683 void MacroAssembler::AllocateHeapNumber(Register result, |
1684 Register scratch1, | 1684 Register scratch1, |
1685 Register scratch2, | 1685 Register scratch2, |
1686 Label* gc_required, | 1686 Label* gc_required) { |
1687 MutableMode mode) { | |
1688 // Allocate heap number in new space. | 1687 // Allocate heap number in new space. |
1689 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, | 1688 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, |
1690 TAG_OBJECT); | 1689 TAG_OBJECT); |
1691 | 1690 |
1692 Handle<Map> map = mode == MUTABLE | |
1693 ? isolate()->factory()->mutable_heap_number_map() | |
1694 : isolate()->factory()->heap_number_map(); | |
1695 | |
1696 // Set the map. | 1691 // Set the map. |
1697 mov(FieldOperand(result, HeapObject::kMapOffset), Immediate(map)); | 1692 mov(FieldOperand(result, HeapObject::kMapOffset), |
| 1693 Immediate(isolate()->factory()->heap_number_map())); |
1698 } | 1694 } |
1699 | 1695 |
1700 | 1696 |
1701 void MacroAssembler::AllocateTwoByteString(Register result, | 1697 void MacroAssembler::AllocateTwoByteString(Register result, |
1702 Register length, | 1698 Register length, |
1703 Register scratch1, | 1699 Register scratch1, |
1704 Register scratch2, | 1700 Register scratch2, |
1705 Register scratch3, | 1701 Register scratch3, |
1706 Label* gc_required) { | 1702 Label* gc_required) { |
1707 // Calculate the number of bytes needed for the characters in the string while | 1703 // Calculate the number of bytes needed for the characters in the string while |
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3409 if (ms.shift() > 0) sar(edx, ms.shift()); | 3405 if (ms.shift() > 0) sar(edx, ms.shift()); |
3410 mov(eax, dividend); | 3406 mov(eax, dividend); |
3411 shr(eax, 31); | 3407 shr(eax, 31); |
3412 add(edx, eax); | 3408 add(edx, eax); |
3413 } | 3409 } |
3414 | 3410 |
3415 | 3411 |
3416 } } // namespace v8::internal | 3412 } } // namespace v8::internal |
3417 | 3413 |
3418 #endif // V8_TARGET_ARCH_IA32 | 3414 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |