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 3908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3919 __ vldr(d0, r5, HeapNumber::kValueOffset); | 3919 __ vldr(d0, r5, HeapNumber::kValueOffset); |
3920 __ add(r5, r3, Operand(r4, LSL, 2)); | 3920 __ add(r5, r3, Operand(r4, LSL, 2)); |
3921 __ vcvt_f32_f64(s0, d0); | 3921 __ vcvt_f32_f64(s0, d0); |
3922 __ vstr(s0, r5, 0); | 3922 __ vstr(s0, r5, 0); |
3923 } else if (array_type == kExternalDoubleArray) { | 3923 } else if (array_type == kExternalDoubleArray) { |
3924 __ sub(r5, r0, Operand(kHeapObjectTag)); | 3924 __ sub(r5, r0, Operand(kHeapObjectTag)); |
3925 __ vldr(d0, r5, HeapNumber::kValueOffset); | 3925 __ vldr(d0, r5, HeapNumber::kValueOffset); |
3926 __ add(r5, r3, Operand(r4, LSL, 3)); | 3926 __ add(r5, r3, Operand(r4, LSL, 3)); |
3927 __ vstr(d0, r5, 0); | 3927 __ vstr(d0, r5, 0); |
3928 } else { | 3928 } else { |
3929 // Need to perform float-to-int conversion. | |
3930 // Test for NaN or infinity (both give zero). | |
3931 __ ldr(r6, FieldMemOperand(value, HeapNumber::kExponentOffset)); | |
3932 | |
3933 // Hoisted load. vldr requires offset to be a multiple of 4 so we can | 3929 // Hoisted load. vldr requires offset to be a multiple of 4 so we can |
3934 // not include -kHeapObjectTag into it. | 3930 // not include -kHeapObjectTag into it. |
3935 __ sub(r5, value, Operand(kHeapObjectTag)); | 3931 __ sub(r5, value, Operand(kHeapObjectTag)); |
3936 __ vldr(d0, r5, HeapNumber::kValueOffset); | 3932 __ vldr(d0, r5, HeapNumber::kValueOffset); |
3937 | 3933 __ EmitECMATruncate(r5, d0, s2, r6, r7, r9); |
3938 __ Sbfx(r6, r6, HeapNumber::kExponentShift, HeapNumber::kExponentBits); | |
3939 // NaNs and Infinities have all-one exponents so they sign extend to -1. | |
3940 __ cmp(r6, Operand(-1)); | |
3941 __ mov(r5, Operand(0), LeaveCC, eq); | |
3942 | |
3943 // Not infinity or NaN simply convert to int. | |
3944 if (IsElementTypeSigned(array_type)) { | |
3945 __ vcvt_s32_f64(s0, d0, kDefaultRoundToZero, ne); | |
3946 } else { | |
3947 __ vcvt_u32_f64(s0, d0, kDefaultRoundToZero, ne); | |
3948 } | |
3949 __ vmov(r5, s0, ne); | |
3950 | 3934 |
3951 switch (array_type) { | 3935 switch (array_type) { |
3952 case kExternalByteArray: | 3936 case kExternalByteArray: |
3953 case kExternalUnsignedByteArray: | 3937 case kExternalUnsignedByteArray: |
3954 __ strb(r5, MemOperand(r3, r4, LSL, 0)); | 3938 __ strb(r5, MemOperand(r3, r4, LSL, 0)); |
3955 break; | 3939 break; |
3956 case kExternalShortArray: | 3940 case kExternalShortArray: |
3957 case kExternalUnsignedShortArray: | 3941 case kExternalUnsignedShortArray: |
3958 __ strh(r5, MemOperand(r3, r4, LSL, 1)); | 3942 __ strh(r5, MemOperand(r3, r4, LSL, 1)); |
3959 break; | 3943 break; |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4234 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4218 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
4235 __ Jump(ic, RelocInfo::CODE_TARGET); | 4219 __ Jump(ic, RelocInfo::CODE_TARGET); |
4236 } | 4220 } |
4237 | 4221 |
4238 | 4222 |
4239 #undef __ | 4223 #undef __ |
4240 | 4224 |
4241 } } // namespace v8::internal | 4225 } } // namespace v8::internal |
4242 | 4226 |
4243 #endif // V8_TARGET_ARCH_ARM | 4227 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |