| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 3416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3427 // ----------------------------------- | 3427 // ----------------------------------- |
| 3428 Label miss_force_generic, failed_allocation, slow; | 3428 Label miss_force_generic, failed_allocation, slow; |
| 3429 | 3429 |
| 3430 // This stub is meant to be tail-jumped to, the receiver must already | 3430 // This stub is meant to be tail-jumped to, the receiver must already |
| 3431 // have been verified by the caller to not be a smi. | 3431 // have been verified by the caller to not be a smi. |
| 3432 | 3432 |
| 3433 // Check that the key is a smi. | 3433 // Check that the key is a smi. |
| 3434 __ JumpIfNotSmi(eax, &miss_force_generic); | 3434 __ JumpIfNotSmi(eax, &miss_force_generic); |
| 3435 | 3435 |
| 3436 // Check that the index is in range. | 3436 // Check that the index is in range. |
| 3437 __ mov(ecx, eax); | |
| 3438 __ SmiUntag(ecx); // Untag the index. | |
| 3439 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); | 3437 __ mov(ebx, FieldOperand(edx, JSObject::kElementsOffset)); |
| 3440 __ cmp(ecx, FieldOperand(ebx, ExternalArray::kLengthOffset)); | 3438 __ cmp(eax, FieldOperand(ebx, ExternalArray::kLengthOffset)); |
| 3441 // Unsigned comparison catches both negative and too-large values. | 3439 // Unsigned comparison catches both negative and too-large values. |
| 3442 __ j(above_equal, &miss_force_generic); | 3440 __ j(above_equal, &miss_force_generic); |
| 3443 __ mov(ebx, FieldOperand(ebx, ExternalArray::kExternalPointerOffset)); | 3441 __ mov(ebx, FieldOperand(ebx, ExternalArray::kExternalPointerOffset)); |
| 3444 // ebx: base pointer of external storage | 3442 // ebx: base pointer of external storage |
| 3445 switch (elements_kind) { | 3443 switch (elements_kind) { |
| 3446 case JSObject::EXTERNAL_BYTE_ELEMENTS: | 3444 case JSObject::EXTERNAL_BYTE_ELEMENTS: |
| 3447 __ movsx_b(eax, Operand(ebx, ecx, times_1, 0)); | 3445 __ SmiUntag(eax); // Untag the index. |
| 3446 __ movsx_b(eax, Operand(ebx, eax, times_1, 0)); |
| 3448 break; | 3447 break; |
| 3449 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 3448 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
| 3450 case JSObject::EXTERNAL_PIXEL_ELEMENTS: | 3449 case JSObject::EXTERNAL_PIXEL_ELEMENTS: |
| 3451 __ movzx_b(eax, Operand(ebx, ecx, times_1, 0)); | 3450 __ SmiUntag(eax); // Untag the index. |
| 3451 __ movzx_b(eax, Operand(ebx, eax, times_1, 0)); |
| 3452 break; | 3452 break; |
| 3453 case JSObject::EXTERNAL_SHORT_ELEMENTS: | 3453 case JSObject::EXTERNAL_SHORT_ELEMENTS: |
| 3454 __ movsx_w(eax, Operand(ebx, ecx, times_2, 0)); | 3454 __ movsx_w(eax, Operand(ebx, eax, times_1, 0)); |
| 3455 break; | 3455 break; |
| 3456 case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 3456 case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
| 3457 __ movzx_w(eax, Operand(ebx, ecx, times_2, 0)); | 3457 __ movzx_w(eax, Operand(ebx, eax, times_1, 0)); |
| 3458 break; | 3458 break; |
| 3459 case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS: | 3459 case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS: |
| 3460 case JSObject::EXTERNAL_INT_ELEMENTS: | 3460 case JSObject::EXTERNAL_INT_ELEMENTS: |
| 3461 __ mov(ecx, Operand(ebx, ecx, times_4, 0)); | 3461 __ mov(ecx, Operand(ebx, eax, times_2, 0)); |
| 3462 break; | 3462 break; |
| 3463 case JSObject::EXTERNAL_FLOAT_ELEMENTS: | 3463 case JSObject::EXTERNAL_FLOAT_ELEMENTS: |
| 3464 __ fld_s(Operand(ebx, ecx, times_4, 0)); | 3464 __ fld_s(Operand(ebx, eax, times_2, 0)); |
| 3465 break; | 3465 break; |
| 3466 case JSObject::EXTERNAL_DOUBLE_ELEMENTS: | 3466 case JSObject::EXTERNAL_DOUBLE_ELEMENTS: |
| 3467 __ fld_d(Operand(ebx, ecx, times_8, 0)); | 3467 __ fld_d(Operand(ebx, eax, times_4, 0)); |
| 3468 break; | 3468 break; |
| 3469 default: | 3469 default: |
| 3470 UNREACHABLE(); | 3470 UNREACHABLE(); |
| 3471 break; | 3471 break; |
| 3472 } | 3472 } |
| 3473 | 3473 |
| 3474 // For integer array types: | 3474 // For integer array types: |
| 3475 // ecx: value | 3475 // ecx: value |
| 3476 // For floating-point array type: | 3476 // For floating-point array type: |
| 3477 // FP(0): value | 3477 // FP(0): value |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3583 Label miss_force_generic, slow, check_heap_number; | 3583 Label miss_force_generic, slow, check_heap_number; |
| 3584 | 3584 |
| 3585 // This stub is meant to be tail-jumped to, the receiver must already | 3585 // This stub is meant to be tail-jumped to, the receiver must already |
| 3586 // have been verified by the caller to not be a smi. | 3586 // have been verified by the caller to not be a smi. |
| 3587 | 3587 |
| 3588 // Check that the key is a smi. | 3588 // Check that the key is a smi. |
| 3589 __ JumpIfNotSmi(ecx, &miss_force_generic); | 3589 __ JumpIfNotSmi(ecx, &miss_force_generic); |
| 3590 | 3590 |
| 3591 // Check that the index is in range. | 3591 // Check that the index is in range. |
| 3592 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); | 3592 __ mov(edi, FieldOperand(edx, JSObject::kElementsOffset)); |
| 3593 __ mov(ebx, ecx); | 3593 __ cmp(ecx, FieldOperand(edi, ExternalArray::kLengthOffset)); |
| 3594 __ SmiUntag(ebx); | |
| 3595 __ cmp(ebx, FieldOperand(edi, ExternalArray::kLengthOffset)); | |
| 3596 // Unsigned comparison catches both negative and too-large values. | 3594 // Unsigned comparison catches both negative and too-large values. |
| 3597 __ j(above_equal, &slow); | 3595 __ j(above_equal, &slow); |
| 3598 | 3596 |
| 3599 // Handle both smis and HeapNumbers in the fast path. Go to the | 3597 // Handle both smis and HeapNumbers in the fast path. Go to the |
| 3600 // runtime for all other kinds of values. | 3598 // runtime for all other kinds of values. |
| 3601 // eax: value | 3599 // eax: value |
| 3602 // edx: receiver | 3600 // edx: receiver |
| 3603 // ecx: key | 3601 // ecx: key |
| 3604 // edi: elements array | 3602 // edi: elements array |
| 3605 // ebx: untagged index | |
| 3606 if (elements_kind == JSObject::EXTERNAL_PIXEL_ELEMENTS) { | 3603 if (elements_kind == JSObject::EXTERNAL_PIXEL_ELEMENTS) { |
| 3607 __ JumpIfNotSmi(eax, &slow); | 3604 __ JumpIfNotSmi(eax, &slow); |
| 3608 } else { | 3605 } else { |
| 3609 __ JumpIfNotSmi(eax, &check_heap_number); | 3606 __ JumpIfNotSmi(eax, &check_heap_number); |
| 3610 } | 3607 } |
| 3611 | 3608 |
| 3612 // smi case | 3609 // smi case |
| 3613 __ mov(ecx, eax); // Preserve the value in eax. Key is no longer needed. | 3610 __ mov(ebx, eax); // Preserve the value in eax as the return value. |
| 3614 __ SmiUntag(ecx); | 3611 __ SmiUntag(ebx); |
| 3615 __ mov(edi, FieldOperand(edi, ExternalArray::kExternalPointerOffset)); | 3612 __ mov(edi, FieldOperand(edi, ExternalArray::kExternalPointerOffset)); |
| 3616 // ecx: base pointer of external storage | 3613 // edi: base pointer of external storage |
| 3617 switch (elements_kind) { | 3614 switch (elements_kind) { |
| 3618 case JSObject::EXTERNAL_PIXEL_ELEMENTS: | 3615 case JSObject::EXTERNAL_PIXEL_ELEMENTS: |
| 3619 { // Clamp the value to [0..255]. | 3616 __ ClampUint8(ebx); |
| 3620 Label done; | 3617 __ SmiUntag(ecx); |
| 3621 __ test(ecx, Immediate(0xFFFFFF00)); | 3618 __ mov_b(Operand(edi, ecx, times_1, 0), ebx); |
| 3622 __ j(zero, &done, Label::kNear); | |
| 3623 __ setcc(negative, ecx); // 1 if negative, 0 if positive. | |
| 3624 __ dec_b(ecx); // 0 if negative, 255 if positive. | |
| 3625 __ bind(&done); | |
| 3626 } | |
| 3627 __ mov_b(Operand(edi, ebx, times_1, 0), ecx); | |
| 3628 break; | 3619 break; |
| 3629 case JSObject::EXTERNAL_BYTE_ELEMENTS: | 3620 case JSObject::EXTERNAL_BYTE_ELEMENTS: |
| 3630 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 3621 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
| 3631 __ mov_b(Operand(edi, ebx, times_1, 0), ecx); | 3622 __ SmiUntag(ecx); |
| 3623 __ mov_b(Operand(edi, ecx, times_1, 0), ebx); |
| 3632 break; | 3624 break; |
| 3633 case JSObject::EXTERNAL_SHORT_ELEMENTS: | 3625 case JSObject::EXTERNAL_SHORT_ELEMENTS: |
| 3634 case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 3626 case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
| 3635 __ mov_w(Operand(edi, ebx, times_2, 0), ecx); | 3627 __ mov_w(Operand(edi, ecx, times_1, 0), ebx); |
| 3636 break; | 3628 break; |
| 3637 case JSObject::EXTERNAL_INT_ELEMENTS: | 3629 case JSObject::EXTERNAL_INT_ELEMENTS: |
| 3638 case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS: | 3630 case JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS: |
| 3639 __ mov(Operand(edi, ebx, times_4, 0), ecx); | 3631 __ mov(Operand(edi, ecx, times_2, 0), ebx); |
| 3640 break; | 3632 break; |
| 3641 case JSObject::EXTERNAL_FLOAT_ELEMENTS: | 3633 case JSObject::EXTERNAL_FLOAT_ELEMENTS: |
| 3642 case JSObject::EXTERNAL_DOUBLE_ELEMENTS: | 3634 case JSObject::EXTERNAL_DOUBLE_ELEMENTS: |
| 3643 // Need to perform int-to-float conversion. | 3635 // Need to perform int-to-float conversion. |
| 3644 __ push(ecx); | 3636 __ push(ebx); |
| 3645 __ fild_s(Operand(esp, 0)); | 3637 __ fild_s(Operand(esp, 0)); |
| 3646 __ pop(ecx); | 3638 __ pop(ebx); |
| 3647 if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) { | 3639 if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) { |
| 3648 __ fstp_s(Operand(edi, ebx, times_4, 0)); | 3640 __ fstp_s(Operand(edi, ecx, times_2, 0)); |
| 3649 } else { // elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS. | 3641 } else { // elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS. |
| 3650 __ fstp_d(Operand(edi, ebx, times_8, 0)); | 3642 __ fstp_d(Operand(edi, ecx, times_4, 0)); |
| 3651 } | 3643 } |
| 3652 break; | 3644 break; |
| 3653 default: | 3645 default: |
| 3654 UNREACHABLE(); | 3646 UNREACHABLE(); |
| 3655 break; | 3647 break; |
| 3656 } | 3648 } |
| 3657 __ ret(0); // Return the original value. | 3649 __ ret(0); // Return the original value. |
| 3658 | 3650 |
| 3659 // TODO(danno): handle heap number -> pixel array conversion | 3651 // TODO(danno): handle heap number -> pixel array conversion |
| 3660 if (elements_kind != JSObject::EXTERNAL_PIXEL_ELEMENTS) { | 3652 if (elements_kind != JSObject::EXTERNAL_PIXEL_ELEMENTS) { |
| 3661 __ bind(&check_heap_number); | 3653 __ bind(&check_heap_number); |
| 3662 // eax: value | 3654 // eax: value |
| 3663 // edx: receiver | 3655 // edx: receiver |
| 3664 // ecx: key | 3656 // ecx: key |
| 3665 // edi: elements array | 3657 // edi: elements array |
| 3666 // ebx: untagged index | |
| 3667 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), | 3658 __ cmp(FieldOperand(eax, HeapObject::kMapOffset), |
| 3668 Immediate(masm->isolate()->factory()->heap_number_map())); | 3659 Immediate(masm->isolate()->factory()->heap_number_map())); |
| 3669 __ j(not_equal, &slow); | 3660 __ j(not_equal, &slow); |
| 3670 | 3661 |
| 3671 // The WebGL specification leaves the behavior of storing NaN and | 3662 // The WebGL specification leaves the behavior of storing NaN and |
| 3672 // +/-Infinity into integer arrays basically undefined. For more | 3663 // +/-Infinity into integer arrays basically undefined. For more |
| 3673 // reproducible behavior, convert these to zero. | 3664 // reproducible behavior, convert these to zero. |
| 3674 __ mov(edi, FieldOperand(edi, ExternalArray::kExternalPointerOffset)); | 3665 __ mov(edi, FieldOperand(edi, ExternalArray::kExternalPointerOffset)); |
| 3675 // ebx: untagged index | |
| 3676 // edi: base pointer of external storage | 3666 // edi: base pointer of external storage |
| 3677 if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) { | 3667 if (elements_kind == JSObject::EXTERNAL_FLOAT_ELEMENTS) { |
| 3678 __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset)); | 3668 __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
| 3679 __ fstp_s(Operand(edi, ebx, times_4, 0)); | 3669 __ fstp_s(Operand(edi, ecx, times_2, 0)); |
| 3680 __ ret(0); | 3670 __ ret(0); |
| 3681 } else if (elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS) { | 3671 } else if (elements_kind == JSObject::EXTERNAL_DOUBLE_ELEMENTS) { |
| 3682 __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset)); | 3672 __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
| 3683 __ fstp_d(Operand(edi, ebx, times_8, 0)); | 3673 __ fstp_d(Operand(edi, ecx, times_4, 0)); |
| 3684 __ ret(0); | 3674 __ ret(0); |
| 3685 } else { | 3675 } else { |
| 3686 // Perform float-to-int conversion with truncation (round-to-zero) | 3676 // Perform float-to-int conversion with truncation (round-to-zero) |
| 3687 // behavior. | 3677 // behavior. |
| 3688 | 3678 |
| 3689 // For the moment we make the slow call to the runtime on | 3679 // For the moment we make the slow call to the runtime on |
| 3690 // processors that don't support SSE2. The code in IntegerConvert | 3680 // processors that don't support SSE2. The code in IntegerConvert |
| 3691 // (code-stubs-ia32.cc) is roughly what is needed here though the | 3681 // (code-stubs-ia32.cc) is roughly what is needed here though the |
| 3692 // conversion failure case does not need to be handled. | 3682 // conversion failure case does not need to be handled. |
| 3693 if (CpuFeatures::IsSupported(SSE2)) { | 3683 if (CpuFeatures::IsSupported(SSE2)) { |
| 3694 if (elements_kind != JSObject::EXTERNAL_INT_ELEMENTS && | 3684 if (elements_kind != JSObject::EXTERNAL_INT_ELEMENTS && |
| 3695 elements_kind != JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS) { | 3685 elements_kind != JSObject::EXTERNAL_UNSIGNED_INT_ELEMENTS) { |
| 3696 ASSERT(CpuFeatures::IsSupported(SSE2)); | 3686 ASSERT(CpuFeatures::IsSupported(SSE2)); |
| 3697 CpuFeatures::Scope scope(SSE2); | 3687 CpuFeatures::Scope scope(SSE2); |
| 3698 __ cvttsd2si(ecx, FieldOperand(eax, HeapNumber::kValueOffset)); | 3688 __ cvttsd2si(ebx, FieldOperand(eax, HeapNumber::kValueOffset)); |
| 3699 // ecx: untagged integer value | 3689 // ecx: untagged integer value |
| 3700 switch (elements_kind) { | 3690 switch (elements_kind) { |
| 3701 case JSObject::EXTERNAL_PIXEL_ELEMENTS: | 3691 case JSObject::EXTERNAL_PIXEL_ELEMENTS: |
| 3702 { // Clamp the value to [0..255]. | 3692 __ ClampUint8(ebx); |
| 3703 Label done; | 3693 // Fall through. |
| 3704 __ test(ecx, Immediate(0xFFFFFF00)); | |
| 3705 __ j(zero, &done, Label::kNear); | |
| 3706 __ setcc(negative, ecx); // 1 if negative, 0 if positive. | |
| 3707 __ dec_b(ecx); // 0 if negative, 255 if positive. | |
| 3708 __ bind(&done); | |
| 3709 } | |
| 3710 __ mov_b(Operand(edi, ebx, times_1, 0), ecx); | |
| 3711 break; | |
| 3712 case JSObject::EXTERNAL_BYTE_ELEMENTS: | 3694 case JSObject::EXTERNAL_BYTE_ELEMENTS: |
| 3713 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 3695 case JSObject::EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
| 3714 __ mov_b(Operand(edi, ebx, times_1, 0), ecx); | 3696 __ SmiUntag(ecx); |
| 3697 __ mov_b(Operand(edi, ecx, times_1, 0), ebx); |
| 3715 break; | 3698 break; |
| 3716 case JSObject::EXTERNAL_SHORT_ELEMENTS: | 3699 case JSObject::EXTERNAL_SHORT_ELEMENTS: |
| 3717 case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 3700 case JSObject::EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
| 3718 __ mov_w(Operand(edi, ebx, times_2, 0), ecx); | 3701 __ mov_w(Operand(edi, ecx, times_1, 0), ebx); |
| 3719 break; | 3702 break; |
| 3720 default: | 3703 default: |
| 3721 UNREACHABLE(); | 3704 UNREACHABLE(); |
| 3722 break; | 3705 break; |
| 3723 } | 3706 } |
| 3724 } else { | 3707 } else { |
| 3725 if (CpuFeatures::IsSupported(SSE3)) { | 3708 if (CpuFeatures::IsSupported(SSE3)) { |
| 3726 CpuFeatures::Scope scope(SSE3); | 3709 CpuFeatures::Scope scope(SSE3); |
| 3727 // fisttp stores values as signed integers. To represent the | 3710 // fisttp stores values as signed integers. To represent the |
| 3728 // entire range of int and unsigned int arrays, store as a | 3711 // entire range of int and unsigned int arrays, store as a |
| 3729 // 64-bit int and discard the high 32 bits. | 3712 // 64-bit int and discard the high 32 bits. |
| 3730 // If the value is NaN or +/-infinity, the result is 0x80000000, | 3713 // If the value is NaN or +/-infinity, the result is 0x80000000, |
| 3731 // which is automatically zero when taken mod 2^n, n < 32. | 3714 // which is automatically zero when taken mod 2^n, n < 32. |
| 3732 __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset)); | 3715 __ fld_d(FieldOperand(eax, HeapNumber::kValueOffset)); |
| 3733 __ sub(Operand(esp), Immediate(2 * kPointerSize)); | 3716 __ sub(Operand(esp), Immediate(2 * kPointerSize)); |
| 3734 __ fisttp_d(Operand(esp, 0)); | 3717 __ fisttp_d(Operand(esp, 0)); |
| 3735 __ pop(ecx); | 3718 __ pop(ebx); |
| 3736 __ add(Operand(esp), Immediate(kPointerSize)); | 3719 __ add(Operand(esp), Immediate(kPointerSize)); |
| 3737 } else { | 3720 } else { |
| 3738 ASSERT(CpuFeatures::IsSupported(SSE2)); | 3721 ASSERT(CpuFeatures::IsSupported(SSE2)); |
| 3739 CpuFeatures::Scope scope(SSE2); | 3722 CpuFeatures::Scope scope(SSE2); |
| 3740 // We can easily implement the correct rounding behavior for the | 3723 // We can easily implement the correct rounding behavior for the |
| 3741 // range [0, 2^31-1]. For the time being, to keep this code simple, | 3724 // range [0, 2^31-1]. For the time being, to keep this code simple, |
| 3742 // make the slow runtime call for values outside this range. | 3725 // make the slow runtime call for values outside this range. |
| 3743 // Note: we could do better for signed int arrays. | 3726 // Note: we could do better for signed int arrays. |
| 3744 __ movd(xmm0, FieldOperand(eax, HeapNumber::kValueOffset)); | 3727 __ movd(xmm0, FieldOperand(eax, HeapNumber::kValueOffset)); |
| 3745 // We will need the key if we have to make the slow runtime call. | 3728 // We will need the key if we have to make the slow runtime call. |
| 3746 __ push(ecx); | 3729 __ push(ebx); |
| 3747 __ LoadPowerOf2(xmm1, ecx, 31); | 3730 __ LoadPowerOf2(xmm1, ebx, 31); |
| 3748 __ pop(ecx); | 3731 __ pop(ebx); |
| 3749 __ ucomisd(xmm1, xmm0); | 3732 __ ucomisd(xmm1, xmm0); |
| 3750 __ j(above_equal, &slow); | 3733 __ j(above_equal, &slow); |
| 3751 __ cvttsd2si(ecx, Operand(xmm0)); | 3734 __ cvttsd2si(ebx, Operand(xmm0)); |
| 3752 } | 3735 } |
| 3753 // ecx: untagged integer value | 3736 // ebx: untagged integer value |
| 3754 __ mov(Operand(edi, ebx, times_4, 0), ecx); | 3737 __ mov(Operand(edi, ecx, times_2, 0), ebx); |
| 3755 } | 3738 } |
| 3756 __ ret(0); // Return original value. | 3739 __ ret(0); // Return original value. |
| 3757 } | 3740 } |
| 3758 } | 3741 } |
| 3759 } | 3742 } |
| 3760 | 3743 |
| 3761 // Slow case: call runtime. | 3744 // Slow case: call runtime. |
| 3762 __ bind(&slow); | 3745 __ bind(&slow); |
| 3763 Counters* counters = masm->isolate()->counters(); | 3746 Counters* counters = masm->isolate()->counters(); |
| 3764 __ IncrementCounter(counters->keyed_store_external_array_slow(), 1); | 3747 __ IncrementCounter(counters->keyed_store_external_array_slow(), 1); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4031 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4014 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
| 4032 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); | 4015 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); |
| 4033 } | 4016 } |
| 4034 | 4017 |
| 4035 | 4018 |
| 4036 #undef __ | 4019 #undef __ |
| 4037 | 4020 |
| 4038 } } // namespace v8::internal | 4021 } } // namespace v8::internal |
| 4039 | 4022 |
| 4040 #endif // V8_TARGET_ARCH_IA32 | 4023 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |