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_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1569 cmp(object, Operand::StaticVariable(new_space_allocation_top)); | 1569 cmp(object, Operand::StaticVariable(new_space_allocation_top)); |
1570 Check(below, kUndoAllocationOfNonAllocatedMemory); | 1570 Check(below, kUndoAllocationOfNonAllocatedMemory); |
1571 #endif | 1571 #endif |
1572 mov(Operand::StaticVariable(new_space_allocation_top), object); | 1572 mov(Operand::StaticVariable(new_space_allocation_top), object); |
1573 } | 1573 } |
1574 | 1574 |
1575 | 1575 |
1576 void MacroAssembler::AllocateHeapNumber(Register result, | 1576 void MacroAssembler::AllocateHeapNumber(Register result, |
1577 Register scratch1, | 1577 Register scratch1, |
1578 Register scratch2, | 1578 Register scratch2, |
1579 Label* gc_required) { | 1579 Label* gc_required, |
| 1580 MutableMode mode) { |
1580 // Allocate heap number in new space. | 1581 // Allocate heap number in new space. |
1581 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, | 1582 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, |
1582 TAG_OBJECT); | 1583 TAG_OBJECT); |
1583 | 1584 |
| 1585 Handle<Map> map = mode == MUTABLE |
| 1586 ? isolate()->factory()->mutable_heap_number_map() |
| 1587 : isolate()->factory()->heap_number_map(); |
| 1588 |
1584 // Set the map. | 1589 // Set the map. |
1585 mov(FieldOperand(result, HeapObject::kMapOffset), | 1590 mov(FieldOperand(result, HeapObject::kMapOffset), Immediate(map)); |
1586 Immediate(isolate()->factory()->heap_number_map())); | |
1587 } | 1591 } |
1588 | 1592 |
1589 | 1593 |
1590 void MacroAssembler::AllocateTwoByteString(Register result, | 1594 void MacroAssembler::AllocateTwoByteString(Register result, |
1591 Register length, | 1595 Register length, |
1592 Register scratch1, | 1596 Register scratch1, |
1593 Register scratch2, | 1597 Register scratch2, |
1594 Register scratch3, | 1598 Register scratch3, |
1595 Label* gc_required) { | 1599 Label* gc_required) { |
1596 // Calculate the number of bytes needed for the characters in the string while | 1600 // Calculate the number of bytes needed for the characters in the string while |
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3292 if (ms.shift() > 0) sar(edx, ms.shift()); | 3296 if (ms.shift() > 0) sar(edx, ms.shift()); |
3293 mov(eax, dividend); | 3297 mov(eax, dividend); |
3294 shr(eax, 31); | 3298 shr(eax, 31); |
3295 add(edx, eax); | 3299 add(edx, eax); |
3296 } | 3300 } |
3297 | 3301 |
3298 | 3302 |
3299 } } // namespace v8::internal | 3303 } } // namespace v8::internal |
3300 | 3304 |
3301 #endif // V8_TARGET_ARCH_X87 | 3305 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |