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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 if (mode == TRACK_ALLOCATION_SITE) { | 374 if (mode == TRACK_ALLOCATION_SITE) { |
375 __ JumpIfJSArrayHasAllocationMemento(edx, edi, fail); | 375 __ JumpIfJSArrayHasAllocationMemento(edx, edi, fail); |
376 } | 376 } |
377 | 377 |
378 // Check for empty arrays, which only require a map transition and no changes | 378 // Check for empty arrays, which only require a map transition and no changes |
379 // to the backing store. | 379 // to the backing store. |
380 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); | 380 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); |
381 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); | 381 __ cmp(edi, Immediate(masm->isolate()->factory()->empty_fixed_array())); |
382 __ j(equal, &only_change_map); | 382 __ j(equal, &only_change_map); |
383 | 383 |
| 384 __ push(esi); |
384 __ push(eax); | 385 __ push(eax); |
385 __ push(edx); | 386 __ push(edx); |
386 __ push(ebx); | 387 __ push(ebx); |
387 | 388 |
388 __ mov(ebx, FieldOperand(edi, FixedDoubleArray::kLengthOffset)); | 389 __ mov(ebx, FieldOperand(edi, FixedDoubleArray::kLengthOffset)); |
389 | 390 |
390 // Allocate new FixedArray. | 391 // Allocate new FixedArray. |
391 // ebx: length of source FixedDoubleArray (smi-tagged) | 392 // ebx: length of source FixedDoubleArray (smi-tagged) |
392 __ lea(edi, Operand(ebx, times_2, FixedArray::kHeaderSize)); | 393 __ lea(edi, Operand(ebx, times_2, FixedArray::kHeaderSize)); |
393 __ Allocate(edi, eax, esi, no_reg, &gc_required, TAG_OBJECT); | 394 __ Allocate(edi, eax, esi, no_reg, &gc_required, TAG_OBJECT); |
(...skipping 24 matching lines...) Expand all Loading... |
418 // edx: receiver | 419 // edx: receiver |
419 // Set transitioned map. | 420 // Set transitioned map. |
420 __ bind(&only_change_map); | 421 __ bind(&only_change_map); |
421 __ mov(FieldOperand(edx, HeapObject::kMapOffset), ebx); | 422 __ mov(FieldOperand(edx, HeapObject::kMapOffset), ebx); |
422 __ RecordWriteField(edx, HeapObject::kMapOffset, ebx, edi, kDontSaveFPRegs, | 423 __ RecordWriteField(edx, HeapObject::kMapOffset, ebx, edi, kDontSaveFPRegs, |
423 OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 424 OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
424 __ jmp(&success); | 425 __ jmp(&success); |
425 | 426 |
426 // Call into runtime if GC is required. | 427 // Call into runtime if GC is required. |
427 __ bind(&gc_required); | 428 __ bind(&gc_required); |
428 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | |
429 __ pop(ebx); | 429 __ pop(ebx); |
430 __ pop(edx); | 430 __ pop(edx); |
431 __ pop(eax); | 431 __ pop(eax); |
| 432 __ pop(esi); |
432 __ jmp(fail); | 433 __ jmp(fail); |
433 | 434 |
434 // Box doubles into heap numbers. | 435 // Box doubles into heap numbers. |
435 // edi: source FixedDoubleArray | 436 // edi: source FixedDoubleArray |
436 // eax: destination FixedArray | 437 // eax: destination FixedArray |
437 __ bind(&loop); | 438 __ bind(&loop); |
438 // ebx: index of current element (smi-tagged) | 439 // ebx: index of current element (smi-tagged) |
439 uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32); | 440 uint32_t offset = FixedDoubleArray::kHeaderSize + sizeof(kHoleNanLower32); |
440 __ cmp(FieldOperand(edi, ebx, times_4, offset), Immediate(kHoleNanUpper32)); | 441 __ cmp(FieldOperand(edi, ebx, times_4, offset), Immediate(kHoleNanUpper32)); |
441 __ j(equal, &convert_hole); | 442 __ j(equal, &convert_hole); |
(...skipping 28 matching lines...) Expand all Loading... |
470 __ mov(FieldOperand(edx, HeapObject::kMapOffset), ebx); | 471 __ mov(FieldOperand(edx, HeapObject::kMapOffset), ebx); |
471 __ RecordWriteField(edx, HeapObject::kMapOffset, ebx, edi, kDontSaveFPRegs, | 472 __ RecordWriteField(edx, HeapObject::kMapOffset, ebx, edi, kDontSaveFPRegs, |
472 OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 473 OMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
473 // Replace receiver's backing store with newly created and filled FixedArray. | 474 // Replace receiver's backing store with newly created and filled FixedArray. |
474 __ mov(FieldOperand(edx, JSObject::kElementsOffset), eax); | 475 __ mov(FieldOperand(edx, JSObject::kElementsOffset), eax); |
475 __ RecordWriteField(edx, JSObject::kElementsOffset, eax, edi, kDontSaveFPRegs, | 476 __ RecordWriteField(edx, JSObject::kElementsOffset, eax, edi, kDontSaveFPRegs, |
476 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | 477 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); |
477 | 478 |
478 // Restore registers. | 479 // Restore registers. |
479 __ pop(eax); | 480 __ pop(eax); |
480 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | 481 __ pop(esi); |
481 | 482 |
482 __ bind(&success); | 483 __ bind(&success); |
483 } | 484 } |
484 | 485 |
485 | 486 |
486 void StringCharLoadGenerator::Generate(MacroAssembler* masm, | 487 void StringCharLoadGenerator::Generate(MacroAssembler* masm, |
487 Factory* factory, | 488 Factory* factory, |
488 Register string, | 489 Register string, |
489 Register index, | 490 Register index, |
490 Register result, | 491 Register result, |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 CodePatcher patcher(isolate, sequence, young_length); | 645 CodePatcher patcher(isolate, sequence, young_length); |
645 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); | 646 patcher.masm()->call(stub->instruction_start(), RelocInfo::NONE32); |
646 } | 647 } |
647 } | 648 } |
648 | 649 |
649 | 650 |
650 } // namespace internal | 651 } // namespace internal |
651 } // namespace v8 | 652 } // namespace v8 |
652 | 653 |
653 #endif // V8_TARGET_ARCH_X87 | 654 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |