| 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 <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_ARM | 9 #if V8_TARGET_ARCH_ARM |
| 10 | 10 |
| (...skipping 3256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3267 } | 3267 } |
| 3268 | 3268 |
| 3269 | 3269 |
| 3270 // Allocates a heap number or jumps to the need_gc label if the young space | 3270 // Allocates a heap number or jumps to the need_gc label if the young space |
| 3271 // is full and a scavenge is needed. | 3271 // is full and a scavenge is needed. |
| 3272 void MacroAssembler::AllocateHeapNumber(Register result, | 3272 void MacroAssembler::AllocateHeapNumber(Register result, |
| 3273 Register scratch1, | 3273 Register scratch1, |
| 3274 Register scratch2, | 3274 Register scratch2, |
| 3275 Register heap_number_map, | 3275 Register heap_number_map, |
| 3276 Label* gc_required, | 3276 Label* gc_required, |
| 3277 TaggingMode tagging_mode, | 3277 TaggingMode tagging_mode) { |
| 3278 MutableMode mode) { | |
| 3279 // Allocate an object in the heap for the heap number and tag it as a heap | 3278 // Allocate an object in the heap for the heap number and tag it as a heap |
| 3280 // object. | 3279 // object. |
| 3281 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, | 3280 Allocate(HeapNumber::kSize, result, scratch1, scratch2, gc_required, |
| 3282 tagging_mode == TAG_RESULT ? TAG_OBJECT : NO_ALLOCATION_FLAGS); | 3281 tagging_mode == TAG_RESULT ? TAG_OBJECT : NO_ALLOCATION_FLAGS); |
| 3283 | 3282 |
| 3284 Heap::RootListIndex map_index = mode == MUTABLE | |
| 3285 ? Heap::kMutableHeapNumberMapRootIndex | |
| 3286 : Heap::kHeapNumberMapRootIndex; | |
| 3287 AssertIsRoot(heap_number_map, map_index); | |
| 3288 | |
| 3289 // Store heap number map in the allocated object. | 3283 // Store heap number map in the allocated object. |
| 3284 AssertIsRoot(heap_number_map, Heap::kHeapNumberMapRootIndex); |
| 3290 if (tagging_mode == TAG_RESULT) { | 3285 if (tagging_mode == TAG_RESULT) { |
| 3291 str(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset)); | 3286 str(heap_number_map, FieldMemOperand(result, HeapObject::kMapOffset)); |
| 3292 } else { | 3287 } else { |
| 3293 str(heap_number_map, MemOperand(result, HeapObject::kMapOffset)); | 3288 str(heap_number_map, MemOperand(result, HeapObject::kMapOffset)); |
| 3294 } | 3289 } |
| 3295 } | 3290 } |
| 3296 | 3291 |
| 3297 | 3292 |
| 3298 void MacroAssembler::AllocateHeapNumberWithValue(Register result, | 3293 void MacroAssembler::AllocateHeapNumberWithValue(Register result, |
| 3299 DwVfpRegister value, | 3294 DwVfpRegister value, |
| (...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4087 sub(result, result, Operand(dividend)); | 4082 sub(result, result, Operand(dividend)); |
| 4088 } | 4083 } |
| 4089 if (ms.shift() > 0) mov(result, Operand(result, ASR, ms.shift())); | 4084 if (ms.shift() > 0) mov(result, Operand(result, ASR, ms.shift())); |
| 4090 add(result, result, Operand(dividend, LSR, 31)); | 4085 add(result, result, Operand(dividend, LSR, 31)); |
| 4091 } | 4086 } |
| 4092 | 4087 |
| 4093 | 4088 |
| 4094 } } // namespace v8::internal | 4089 } } // namespace v8::internal |
| 4095 | 4090 |
| 4096 #endif // V8_TARGET_ARCH_ARM | 4091 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |