| 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/x87/codegen-x87.h" | 5 #include "src/x87/codegen-x87.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 __ j(equal, &only_change_map); | 268 __ j(equal, &only_change_map); |
| 269 | 269 |
| 270 __ push(eax); | 270 __ push(eax); |
| 271 __ push(ebx); | 271 __ push(ebx); |
| 272 | 272 |
| 273 __ mov(edi, FieldOperand(edi, FixedArray::kLengthOffset)); | 273 __ mov(edi, FieldOperand(edi, FixedArray::kLengthOffset)); |
| 274 | 274 |
| 275 // Allocate new FixedDoubleArray. | 275 // Allocate new FixedDoubleArray. |
| 276 // edx: receiver | 276 // edx: receiver |
| 277 // edi: length of source FixedArray (smi-tagged) | 277 // edi: length of source FixedArray (smi-tagged) |
| 278 AllocationFlags flags = | |
| 279 static_cast<AllocationFlags>(TAG_OBJECT | DOUBLE_ALIGNMENT); | |
| 280 __ Allocate(FixedDoubleArray::kHeaderSize, times_8, edi, | 278 __ Allocate(FixedDoubleArray::kHeaderSize, times_8, edi, |
| 281 REGISTER_VALUE_IS_SMI, eax, ebx, no_reg, &gc_required, flags); | 279 REGISTER_VALUE_IS_SMI, eax, ebx, no_reg, &gc_required, |
| 280 DOUBLE_ALIGNMENT); |
| 282 | 281 |
| 283 // eax: destination FixedDoubleArray | 282 // eax: destination FixedDoubleArray |
| 284 // edi: number of elements | 283 // edi: number of elements |
| 285 // edx: receiver | 284 // edx: receiver |
| 286 __ mov(FieldOperand(eax, HeapObject::kMapOffset), | 285 __ mov(FieldOperand(eax, HeapObject::kMapOffset), |
| 287 Immediate(masm->isolate()->factory()->fixed_double_array_map())); | 286 Immediate(masm->isolate()->factory()->fixed_double_array_map())); |
| 288 __ mov(FieldOperand(eax, FixedDoubleArray::kLengthOffset), edi); | 287 __ mov(FieldOperand(eax, FixedDoubleArray::kLengthOffset), edi); |
| 289 __ mov(esi, FieldOperand(edx, JSObject::kElementsOffset)); | 288 __ mov(esi, FieldOperand(edx, JSObject::kElementsOffset)); |
| 290 // Replace receiver's backing store with newly created FixedDoubleArray. | 289 // Replace receiver's backing store with newly created FixedDoubleArray. |
| 291 __ mov(FieldOperand(edx, JSObject::kElementsOffset), eax); | 290 __ mov(FieldOperand(edx, JSObject::kElementsOffset), eax); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 __ push(esi); | 383 __ push(esi); |
| 385 __ push(eax); | 384 __ push(eax); |
| 386 __ push(edx); | 385 __ push(edx); |
| 387 __ push(ebx); | 386 __ push(ebx); |
| 388 | 387 |
| 389 __ mov(ebx, FieldOperand(edi, FixedDoubleArray::kLengthOffset)); | 388 __ mov(ebx, FieldOperand(edi, FixedDoubleArray::kLengthOffset)); |
| 390 | 389 |
| 391 // Allocate new FixedArray. | 390 // Allocate new FixedArray. |
| 392 // ebx: length of source FixedDoubleArray (smi-tagged) | 391 // ebx: length of source FixedDoubleArray (smi-tagged) |
| 393 __ lea(edi, Operand(ebx, times_2, FixedArray::kHeaderSize)); | 392 __ lea(edi, Operand(ebx, times_2, FixedArray::kHeaderSize)); |
| 394 __ Allocate(edi, eax, esi, no_reg, &gc_required, TAG_OBJECT); | 393 __ Allocate(edi, eax, esi, no_reg, &gc_required, NO_ALLOCATION_FLAGS); |
| 395 | 394 |
| 396 // eax: destination FixedArray | 395 // eax: destination FixedArray |
| 397 // ebx: number of elements | 396 // ebx: number of elements |
| 398 __ mov(FieldOperand(eax, HeapObject::kMapOffset), | 397 __ mov(FieldOperand(eax, HeapObject::kMapOffset), |
| 399 Immediate(masm->isolate()->factory()->fixed_array_map())); | 398 Immediate(masm->isolate()->factory()->fixed_array_map())); |
| 400 __ mov(FieldOperand(eax, FixedArray::kLengthOffset), ebx); | 399 __ mov(FieldOperand(eax, FixedArray::kLengthOffset), ebx); |
| 401 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); | 400 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); |
| 402 | 401 |
| 403 // Allocating heap numbers in the loop below can fail and cause a jump to | 402 // Allocating heap numbers in the loop below can fail and cause a jump to |
| 404 // gc_required. We can't leave a partly initialized FixedArray behind, | 403 // gc_required. We can't leave a partly initialized FixedArray behind, |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 CodePatcher patcher(isolate, sequence, young_length); | 644 CodePatcher patcher(isolate, sequence, young_length); |
| 646 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); | 645 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); |
| 647 } | 646 } |
| 648 } | 647 } |
| 649 | 648 |
| 650 | 649 |
| 651 } // namespace internal | 650 } // namespace internal |
| 652 } // namespace v8 | 651 } // namespace v8 |
| 653 | 652 |
| 654 #endif // V8_TARGET_ARCH_X87 | 653 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |