| 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) { | |
| 1581 // Allocate heap number in new space. | 1580 // Allocate heap number in new space. |
| 1582 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, | 1581 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, |
| 1583 TAG_OBJECT); | 1582 TAG_OBJECT); |
| 1584 | 1583 |
| 1585 Handle<Map> map = mode == MUTABLE | |
| 1586 ? isolate()->factory()->mutable_heap_number_map() | |
| 1587 : isolate()->factory()->heap_number_map(); | |
| 1588 | |
| 1589 // Set the map. | 1584 // Set the map. |
| 1590 mov(FieldOperand(result, HeapObject::kMapOffset), Immediate(map)); | 1585 mov(FieldOperand(result, HeapObject::kMapOffset), |
| 1586 Immediate(isolate()->factory()->heap_number_map())); |
| 1591 } | 1587 } |
| 1592 | 1588 |
| 1593 | 1589 |
| 1594 void MacroAssembler::AllocateTwoByteString(Register result, | 1590 void MacroAssembler::AllocateTwoByteString(Register result, |
| 1595 Register length, | 1591 Register length, |
| 1596 Register scratch1, | 1592 Register scratch1, |
| 1597 Register scratch2, | 1593 Register scratch2, |
| 1598 Register scratch3, | 1594 Register scratch3, |
| 1599 Label* gc_required) { | 1595 Label* gc_required) { |
| 1600 // Calculate the number of bytes needed for the characters in the string while | 1596 // 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... |
| 3296 if (ms.shift() > 0) sar(edx, ms.shift()); | 3292 if (ms.shift() > 0) sar(edx, ms.shift()); |
| 3297 mov(eax, dividend); | 3293 mov(eax, dividend); |
| 3298 shr(eax, 31); | 3294 shr(eax, 31); |
| 3299 add(edx, eax); | 3295 add(edx, eax); |
| 3300 } | 3296 } |
| 3301 | 3297 |
| 3302 | 3298 |
| 3303 } } // namespace v8::internal | 3299 } } // namespace v8::internal |
| 3304 | 3300 |
| 3305 #endif // V8_TARGET_ARCH_X87 | 3301 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |