OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2775 } | 2775 } |
2776 | 2776 |
2777 | 2777 |
2778 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { | 2778 void LCodeGen::DoLoadKeyedFastElement(LLoadKeyedFastElement* instr) { |
2779 Register elements = ToRegister(instr->elements()); | 2779 Register elements = ToRegister(instr->elements()); |
2780 Register key = EmitLoadRegister(instr->key(), scratch0()); | 2780 Register key = EmitLoadRegister(instr->key(), scratch0()); |
2781 Register result = ToRegister(instr->result()); | 2781 Register result = ToRegister(instr->result()); |
2782 Register scratch = scratch0(); | 2782 Register scratch = scratch0(); |
2783 | 2783 |
2784 // Load the result. | 2784 // Load the result. |
2785 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2)); | 2785 if (instr->hydrogen()->key()->representation().IsTagged()) { |
2786 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2 - 1)); | |
Michael Starzinger
2012/07/19 21:02:23
Can we use kSmiTagSize here?
danno
2012/07/20 09:51:57
Done.
| |
2787 } else { | |
2788 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2)); | |
2789 } | |
2786 uint32_t offset = FixedArray::kHeaderSize + | 2790 uint32_t offset = FixedArray::kHeaderSize + |
2787 (instr->additional_index() << kPointerSizeLog2); | 2791 (instr->additional_index() << kPointerSizeLog2); |
2788 __ ldr(result, FieldMemOperand(scratch, offset)); | 2792 __ ldr(result, FieldMemOperand(scratch, offset)); |
2789 | 2793 |
2790 // Check for the hole value. | 2794 // Check for the hole value. |
2791 if (instr->hydrogen()->RequiresHoleCheck()) { | 2795 if (instr->hydrogen()->RequiresHoleCheck()) { |
2792 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { | 2796 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
2793 __ tst(result, Operand(kSmiTagMask)); | 2797 __ tst(result, Operand(kSmiTagMask)); |
2794 DeoptimizeIf(ne, instr->environment()); | 2798 DeoptimizeIf(ne, instr->environment()); |
2795 } else { | 2799 } else { |
2796 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); | 2800 __ LoadRoot(scratch, Heap::kTheHoleValueRootIndex); |
2797 __ cmp(result, scratch); | 2801 __ cmp(result, scratch); |
2798 DeoptimizeIf(eq, instr->environment()); | 2802 DeoptimizeIf(eq, instr->environment()); |
2799 } | 2803 } |
2800 } | 2804 } |
2801 } | 2805 } |
2802 | 2806 |
2803 | 2807 |
2804 void LCodeGen::DoLoadKeyedFastDoubleElement( | 2808 void LCodeGen::DoLoadKeyedFastDoubleElement( |
2805 LLoadKeyedFastDoubleElement* instr) { | 2809 LLoadKeyedFastDoubleElement* instr) { |
2806 Register elements = ToRegister(instr->elements()); | 2810 Register elements = ToRegister(instr->elements()); |
2807 bool key_is_constant = instr->key()->IsConstantOperand(); | 2811 bool key_is_constant = instr->key()->IsConstantOperand(); |
2808 Register key = no_reg; | 2812 Register key = no_reg; |
2809 DwVfpRegister result = ToDoubleRegister(instr->result()); | 2813 DwVfpRegister result = ToDoubleRegister(instr->result()); |
2810 Register scratch = scratch0(); | 2814 Register scratch = scratch0(); |
2811 | 2815 |
2812 int shift_size = | 2816 int element_size_shift = ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS); |
2813 ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS); | 2817 int shift_size = (instr->hydrogen()->key()->representation().IsTagged()) |
2818 ? (element_size_shift - 1) : element_size_shift; | |
Michael Starzinger
2012/07/19 21:02:23
Likewise.
danno
2012/07/20 09:51:57
Done.
| |
2814 int constant_key = 0; | 2819 int constant_key = 0; |
2815 if (key_is_constant) { | 2820 if (key_is_constant) { |
2816 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); | 2821 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); |
2817 if (constant_key & 0xF0000000) { | 2822 if (constant_key & 0xF0000000) { |
2818 Abort("array index constant value too big."); | 2823 Abort("array index constant value too big."); |
2819 } | 2824 } |
2820 } else { | 2825 } else { |
2821 key = ToRegister(instr->key()); | 2826 key = ToRegister(instr->key()); |
2822 } | 2827 } |
2823 | 2828 |
2824 Operand operand = key_is_constant | 2829 Operand operand = key_is_constant |
2825 ? Operand(((constant_key + instr->additional_index()) << shift_size) + | 2830 ? Operand(((constant_key + instr->additional_index()) << |
2831 element_size_shift) + | |
2826 FixedDoubleArray::kHeaderSize - kHeapObjectTag) | 2832 FixedDoubleArray::kHeaderSize - kHeapObjectTag) |
2827 : Operand(key, LSL, shift_size); | 2833 : Operand(key, LSL, shift_size); |
2828 __ add(elements, elements, operand); | 2834 __ add(elements, elements, operand); |
2829 if (!key_is_constant) { | 2835 if (!key_is_constant) { |
2830 __ add(elements, elements, | 2836 __ add(elements, elements, |
2831 Operand((FixedDoubleArray::kHeaderSize - kHeapObjectTag) + | 2837 Operand((FixedDoubleArray::kHeaderSize - kHeapObjectTag) + |
2832 (instr->additional_index() << shift_size))); | 2838 (instr->additional_index() << element_size_shift))); |
2833 } | 2839 } |
2834 | 2840 |
2835 if (instr->hydrogen()->RequiresHoleCheck()) { | 2841 if (instr->hydrogen()->RequiresHoleCheck()) { |
2836 __ ldr(scratch, MemOperand(elements, sizeof(kHoleNanLower32))); | 2842 __ ldr(scratch, MemOperand(elements, sizeof(kHoleNanLower32))); |
2837 __ cmp(scratch, Operand(kHoleNanUpper32)); | 2843 __ cmp(scratch, Operand(kHoleNanUpper32)); |
2838 DeoptimizeIf(eq, instr->environment()); | 2844 DeoptimizeIf(eq, instr->environment()); |
2839 } | 2845 } |
2840 | 2846 |
2841 __ vldr(result, elements, 0); | 2847 __ vldr(result, elements, 0); |
2842 } | 2848 } |
2843 | 2849 |
2844 | 2850 |
2851 MemOperand LCodeGen::PrepareKeyedOperand(Register key, | |
2852 Register base, | |
2853 bool key_is_constant, | |
2854 int constant_key, | |
2855 int element_size, | |
2856 int shift_size, | |
2857 int additional_index, | |
2858 int additional_offset) { | |
2859 if (additional_index != 0 && !key_is_constant) { | |
2860 additional_index *= 1 << (element_size - shift_size); | |
2861 __ add(scratch0(), key, Operand(additional_index)); | |
2862 } | |
2863 | |
2864 if (key_is_constant) { | |
2865 return MemOperand(base, | |
2866 (constant_key << element_size) + additional_offset); | |
2867 } | |
2868 | |
2869 if (additional_index == 0) { | |
2870 if (shift_size >= 0) { | |
2871 return MemOperand(base, key, LSL, shift_size); | |
2872 } else { | |
2873 ASSERT_EQ(-1, shift_size); | |
2874 return MemOperand(base, key, LSR, 1); | |
Michael Starzinger
2012/07/19 21:02:23
Likewise.
danno
2012/07/20 09:51:57
Done.
| |
2875 } | |
2876 } | |
2877 | |
2878 if (shift_size >= 0) { | |
2879 return MemOperand(base, scratch0(), LSL, shift_size); | |
2880 } else { | |
2881 ASSERT_EQ(-1, shift_size); | |
2882 return MemOperand(base, scratch0(), LSR, 1); | |
Michael Starzinger
2012/07/19 21:02:23
Likewise.
danno
2012/07/20 09:51:57
Done.
| |
2883 } | |
2884 } | |
2885 | |
2886 | |
2845 void LCodeGen::DoLoadKeyedSpecializedArrayElement( | 2887 void LCodeGen::DoLoadKeyedSpecializedArrayElement( |
2846 LLoadKeyedSpecializedArrayElement* instr) { | 2888 LLoadKeyedSpecializedArrayElement* instr) { |
2847 Register external_pointer = ToRegister(instr->external_pointer()); | 2889 Register external_pointer = ToRegister(instr->external_pointer()); |
2848 Register key = no_reg; | 2890 Register key = no_reg; |
2849 ElementsKind elements_kind = instr->elements_kind(); | 2891 ElementsKind elements_kind = instr->elements_kind(); |
2850 bool key_is_constant = instr->key()->IsConstantOperand(); | 2892 bool key_is_constant = instr->key()->IsConstantOperand(); |
2851 int constant_key = 0; | 2893 int constant_key = 0; |
2852 if (key_is_constant) { | 2894 if (key_is_constant) { |
2853 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); | 2895 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); |
2854 if (constant_key & 0xF0000000) { | 2896 if (constant_key & 0xF0000000) { |
2855 Abort("array index constant value too big."); | 2897 Abort("array index constant value too big."); |
2856 } | 2898 } |
2857 } else { | 2899 } else { |
2858 key = ToRegister(instr->key()); | 2900 key = ToRegister(instr->key()); |
2859 } | 2901 } |
2860 int shift_size = ElementsKindToShiftSize(elements_kind); | 2902 int element_size_shift = ElementsKindToShiftSize(elements_kind); |
2861 int additional_offset = instr->additional_index() << shift_size; | 2903 int shift_size = (instr->hydrogen()->key()->representation().IsTagged()) |
2904 ? (element_size_shift - 1) : element_size_shift; | |
Michael Starzinger
2012/07/19 21:02:23
Likewise.
danno
2012/07/20 09:51:57
Done.
| |
2905 int additional_offset = instr->additional_index() << element_size_shift; | |
2862 | 2906 |
2863 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || | 2907 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || |
2864 elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { | 2908 elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { |
2865 CpuFeatures::Scope scope(VFP3); | 2909 CpuFeatures::Scope scope(VFP3); |
2866 DwVfpRegister result = ToDoubleRegister(instr->result()); | 2910 DwVfpRegister result = ToDoubleRegister(instr->result()); |
2867 Operand operand = key_is_constant | 2911 Operand operand = key_is_constant |
2868 ? Operand(constant_key << shift_size) | 2912 ? Operand(constant_key << element_size_shift) |
2869 : Operand(key, LSL, shift_size); | 2913 : Operand(key, LSL, shift_size); |
2870 __ add(scratch0(), external_pointer, operand); | 2914 __ add(scratch0(), external_pointer, operand); |
2871 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { | 2915 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { |
2872 __ vldr(result.low(), scratch0(), additional_offset); | 2916 __ vldr(result.low(), scratch0(), additional_offset); |
2873 __ vcvt_f64_f32(result, result.low()); | 2917 __ vcvt_f64_f32(result, result.low()); |
2874 } else { // i.e. elements_kind == EXTERNAL_DOUBLE_ELEMENTS | 2918 } else { // i.e. elements_kind == EXTERNAL_DOUBLE_ELEMENTS |
2875 __ vldr(result, scratch0(), additional_offset); | 2919 __ vldr(result, scratch0(), additional_offset); |
2876 } | 2920 } |
2877 } else { | 2921 } else { |
2878 Register result = ToRegister(instr->result()); | 2922 Register result = ToRegister(instr->result()); |
2879 if (instr->additional_index() != 0 && !key_is_constant) { | 2923 MemOperand mem_operand = PrepareKeyedOperand( |
2880 __ add(scratch0(), key, Operand(instr->additional_index())); | 2924 key, external_pointer, key_is_constant, constant_key, |
2881 } | 2925 element_size_shift, shift_size, |
2882 MemOperand mem_operand(key_is_constant | 2926 instr->additional_index(), additional_offset); |
2883 ? MemOperand(external_pointer, | |
2884 (constant_key << shift_size) + additional_offset) | |
2885 : (instr->additional_index() == 0 | |
2886 ? MemOperand(external_pointer, key, LSL, shift_size) | |
2887 : MemOperand(external_pointer, scratch0(), LSL, shift_size))); | |
2888 switch (elements_kind) { | 2927 switch (elements_kind) { |
2889 case EXTERNAL_BYTE_ELEMENTS: | 2928 case EXTERNAL_BYTE_ELEMENTS: |
2890 __ ldrsb(result, mem_operand); | 2929 __ ldrsb(result, mem_operand); |
2891 break; | 2930 break; |
2892 case EXTERNAL_PIXEL_ELEMENTS: | 2931 case EXTERNAL_PIXEL_ELEMENTS: |
2893 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 2932 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
2894 __ ldrb(result, mem_operand); | 2933 __ ldrb(result, mem_operand); |
2895 break; | 2934 break; |
2896 case EXTERNAL_SHORT_ELEMENTS: | 2935 case EXTERNAL_SHORT_ELEMENTS: |
2897 __ ldrsh(result, mem_operand); | 2936 __ ldrsh(result, mem_operand); |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3794 | 3833 |
3795 // Do the store. | 3834 // Do the store. |
3796 if (instr->key()->IsConstantOperand()) { | 3835 if (instr->key()->IsConstantOperand()) { |
3797 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 3836 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
3798 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); | 3837 LConstantOperand* const_operand = LConstantOperand::cast(instr->key()); |
3799 int offset = | 3838 int offset = |
3800 (ToInteger32(const_operand) + instr->additional_index()) * kPointerSize | 3839 (ToInteger32(const_operand) + instr->additional_index()) * kPointerSize |
3801 + FixedArray::kHeaderSize; | 3840 + FixedArray::kHeaderSize; |
3802 __ str(value, FieldMemOperand(elements, offset)); | 3841 __ str(value, FieldMemOperand(elements, offset)); |
3803 } else { | 3842 } else { |
3804 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2)); | 3843 if (instr->hydrogen()->key()->representation().IsTagged()) { |
3844 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2 - 1)); | |
Michael Starzinger
2012/07/19 21:02:23
Likewise.
danno
2012/07/20 09:51:57
Done.
| |
3845 } else { | |
3846 __ add(scratch, elements, Operand(key, LSL, kPointerSizeLog2)); | |
3847 } | |
3805 if (instr->additional_index() != 0) { | 3848 if (instr->additional_index() != 0) { |
3806 __ add(scratch, | 3849 __ add(scratch, |
3807 scratch, | 3850 scratch, |
3808 Operand(instr->additional_index() << kPointerSizeLog2)); | 3851 Operand(instr->additional_index() << kPointerSizeLog2)); |
3809 } | 3852 } |
3810 __ str(value, FieldMemOperand(scratch, FixedArray::kHeaderSize)); | 3853 __ str(value, FieldMemOperand(scratch, FixedArray::kHeaderSize)); |
3811 } | 3854 } |
3812 | 3855 |
3813 if (instr->hydrogen()->NeedsWriteBarrier()) { | 3856 if (instr->hydrogen()->NeedsWriteBarrier()) { |
3814 HType type = instr->hydrogen()->value()->type(); | 3857 HType type = instr->hydrogen()->value()->type(); |
(...skipping 24 matching lines...) Expand all Loading... | |
3839 // Calculate the effective address of the slot in the array to store the | 3882 // Calculate the effective address of the slot in the array to store the |
3840 // double value. | 3883 // double value. |
3841 if (key_is_constant) { | 3884 if (key_is_constant) { |
3842 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); | 3885 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); |
3843 if (constant_key & 0xF0000000) { | 3886 if (constant_key & 0xF0000000) { |
3844 Abort("array index constant value too big."); | 3887 Abort("array index constant value too big."); |
3845 } | 3888 } |
3846 } else { | 3889 } else { |
3847 key = ToRegister(instr->key()); | 3890 key = ToRegister(instr->key()); |
3848 } | 3891 } |
3849 int shift_size = ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS); | 3892 int element_size_shift = ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS); |
3893 int shift_size = (instr->hydrogen()->key()->representation().IsTagged()) | |
3894 ? (element_size_shift - 1) : element_size_shift; | |
3850 Operand operand = key_is_constant | 3895 Operand operand = key_is_constant |
3851 ? Operand((constant_key << shift_size) + | 3896 ? Operand((constant_key << element_size_shift) + |
3852 FixedDoubleArray::kHeaderSize - kHeapObjectTag) | 3897 FixedDoubleArray::kHeaderSize - kHeapObjectTag) |
3853 : Operand(key, LSL, shift_size); | 3898 : Operand(key, LSL, shift_size); |
3854 __ add(scratch, elements, operand); | 3899 __ add(scratch, elements, operand); |
3855 if (!key_is_constant) { | 3900 if (!key_is_constant) { |
3856 __ add(scratch, scratch, | 3901 __ add(scratch, scratch, |
3857 Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag)); | 3902 Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag)); |
3858 } | 3903 } |
3859 | 3904 |
3860 if (instr->NeedsCanonicalization()) { | 3905 if (instr->NeedsCanonicalization()) { |
3861 // Check for NaN. All NaNs must be canonicalized. | 3906 // Check for NaN. All NaNs must be canonicalized. |
3862 __ VFPCompareAndSetFlags(value, value); | 3907 __ VFPCompareAndSetFlags(value, value); |
3863 // Only load canonical NaN if the comparison above set the overflow. | 3908 // Only load canonical NaN if the comparison above set the overflow. |
3864 __ Vmov(value, | 3909 __ Vmov(value, |
3865 FixedDoubleArray::canonical_not_the_hole_nan_as_double(), | 3910 FixedDoubleArray::canonical_not_the_hole_nan_as_double(), |
3866 vs); | 3911 vs); |
3867 } | 3912 } |
3868 | 3913 |
3869 __ vstr(value, scratch, instr->additional_index() << shift_size); | 3914 __ vstr(value, scratch, instr->additional_index() << element_size_shift); |
3870 } | 3915 } |
3871 | 3916 |
3872 | 3917 |
3873 void LCodeGen::DoStoreKeyedSpecializedArrayElement( | 3918 void LCodeGen::DoStoreKeyedSpecializedArrayElement( |
3874 LStoreKeyedSpecializedArrayElement* instr) { | 3919 LStoreKeyedSpecializedArrayElement* instr) { |
3875 | 3920 |
3876 Register external_pointer = ToRegister(instr->external_pointer()); | 3921 Register external_pointer = ToRegister(instr->external_pointer()); |
3877 Register key = no_reg; | 3922 Register key = no_reg; |
3878 ElementsKind elements_kind = instr->elements_kind(); | 3923 ElementsKind elements_kind = instr->elements_kind(); |
3879 bool key_is_constant = instr->key()->IsConstantOperand(); | 3924 bool key_is_constant = instr->key()->IsConstantOperand(); |
3880 int constant_key = 0; | 3925 int constant_key = 0; |
3881 if (key_is_constant) { | 3926 if (key_is_constant) { |
3882 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); | 3927 constant_key = ToInteger32(LConstantOperand::cast(instr->key())); |
3883 if (constant_key & 0xF0000000) { | 3928 if (constant_key & 0xF0000000) { |
3884 Abort("array index constant value too big."); | 3929 Abort("array index constant value too big."); |
3885 } | 3930 } |
3886 } else { | 3931 } else { |
3887 key = ToRegister(instr->key()); | 3932 key = ToRegister(instr->key()); |
3888 } | 3933 } |
3889 int shift_size = ElementsKindToShiftSize(elements_kind); | 3934 int element_size_shift = ElementsKindToShiftSize(elements_kind); |
3890 int additional_offset = instr->additional_index() << shift_size; | 3935 int shift_size = (instr->hydrogen()->key()->representation().IsTagged()) |
3936 ? (element_size_shift - 1) : element_size_shift; | |
3937 int additional_offset = instr->additional_index() << element_size_shift; | |
3891 | 3938 |
3892 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || | 3939 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || |
3893 elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { | 3940 elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { |
3894 CpuFeatures::Scope scope(VFP3); | 3941 CpuFeatures::Scope scope(VFP3); |
3895 DwVfpRegister value(ToDoubleRegister(instr->value())); | 3942 DwVfpRegister value(ToDoubleRegister(instr->value())); |
3896 Operand operand(key_is_constant ? Operand(constant_key << shift_size) | 3943 Operand operand(key_is_constant |
3897 : Operand(key, LSL, shift_size)); | 3944 ? Operand(constant_key << element_size_shift) |
3945 : Operand(key, LSL, shift_size)); | |
3898 __ add(scratch0(), external_pointer, operand); | 3946 __ add(scratch0(), external_pointer, operand); |
3899 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { | 3947 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { |
3900 __ vcvt_f32_f64(double_scratch0().low(), value); | 3948 __ vcvt_f32_f64(double_scratch0().low(), value); |
3901 __ vstr(double_scratch0().low(), scratch0(), additional_offset); | 3949 __ vstr(double_scratch0().low(), scratch0(), additional_offset); |
3902 } else { // i.e. elements_kind == EXTERNAL_DOUBLE_ELEMENTS | 3950 } else { // i.e. elements_kind == EXTERNAL_DOUBLE_ELEMENTS |
3903 __ vstr(value, scratch0(), additional_offset); | 3951 __ vstr(value, scratch0(), additional_offset); |
3904 } | 3952 } |
3905 } else { | 3953 } else { |
3906 Register value(ToRegister(instr->value())); | 3954 Register value(ToRegister(instr->value())); |
3907 if (instr->additional_index() != 0 && !key_is_constant) { | 3955 MemOperand mem_operand = PrepareKeyedOperand( |
3908 __ add(scratch0(), key, Operand(instr->additional_index())); | 3956 key, external_pointer, key_is_constant, constant_key, |
3909 } | 3957 element_size_shift, shift_size, |
3910 MemOperand mem_operand(key_is_constant | 3958 instr->additional_index(), additional_offset); |
3911 ? MemOperand(external_pointer, | |
3912 ((constant_key + instr->additional_index()) | |
3913 << shift_size)) | |
3914 : (instr->additional_index() == 0 | |
3915 ? MemOperand(external_pointer, key, LSL, shift_size) | |
3916 : MemOperand(external_pointer, scratch0(), LSL, shift_size))); | |
3917 switch (elements_kind) { | 3959 switch (elements_kind) { |
3918 case EXTERNAL_PIXEL_ELEMENTS: | 3960 case EXTERNAL_PIXEL_ELEMENTS: |
3919 case EXTERNAL_BYTE_ELEMENTS: | 3961 case EXTERNAL_BYTE_ELEMENTS: |
3920 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 3962 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
3921 __ strb(value, mem_operand); | 3963 __ strb(value, mem_operand); |
3922 break; | 3964 break; |
3923 case EXTERNAL_SHORT_ELEMENTS: | 3965 case EXTERNAL_SHORT_ELEMENTS: |
3924 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 3966 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
3925 __ strh(value, mem_operand); | 3967 __ strh(value, mem_operand); |
3926 break; | 3968 break; |
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5401 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5443 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5402 __ ldr(result, FieldMemOperand(scratch, | 5444 __ ldr(result, FieldMemOperand(scratch, |
5403 FixedArray::kHeaderSize - kPointerSize)); | 5445 FixedArray::kHeaderSize - kPointerSize)); |
5404 __ bind(&done); | 5446 __ bind(&done); |
5405 } | 5447 } |
5406 | 5448 |
5407 | 5449 |
5408 #undef __ | 5450 #undef __ |
5409 | 5451 |
5410 } } // namespace v8::internal | 5452 } } // namespace v8::internal |
OLD | NEW |