Chromium Code Reviews| 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 |
| 3938 __ Sbfx(r6, r6, HeapNumber::kExponentShift, HeapNumber::kExponentBits); | 3934 __ EmitECMATruncate(r5, |
|
Kevin Millikin (Chromium)
2011/05/26 07:53:37
Might as well put the args all on the same line.
danno
2011/06/01 13:14:41
Done.
| |
| 3939 // NaNs and Infinities have all-one exponents so they sign extend to -1. | 3935 d0, |
| 3940 __ cmp(r6, Operand(-1)); | 3936 s2, |
| 3941 __ mov(r5, Operand(0), LeaveCC, eq); | 3937 r6, |
| 3942 | 3938 r7, |
| 3943 // Not infinity or NaN simply convert to int. | 3939 r9); |
| 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 | 3940 |
| 3951 switch (array_type) { | 3941 switch (array_type) { |
| 3952 case kExternalByteArray: | 3942 case kExternalByteArray: |
| 3953 case kExternalUnsignedByteArray: | 3943 case kExternalUnsignedByteArray: |
| 3954 __ strb(r5, MemOperand(r3, r4, LSL, 0)); | 3944 __ strb(r5, MemOperand(r3, r4, LSL, 0)); |
| 3955 break; | 3945 break; |
| 3956 case kExternalShortArray: | 3946 case kExternalShortArray: |
| 3957 case kExternalUnsignedShortArray: | 3947 case kExternalUnsignedShortArray: |
| 3958 __ strh(r5, MemOperand(r3, r4, LSL, 1)); | 3948 __ strh(r5, MemOperand(r3, r4, LSL, 1)); |
| 3959 break; | 3949 break; |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4234 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); | 4224 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); |
| 4235 __ Jump(ic, RelocInfo::CODE_TARGET); | 4225 __ Jump(ic, RelocInfo::CODE_TARGET); |
| 4236 } | 4226 } |
| 4237 | 4227 |
| 4238 | 4228 |
| 4239 #undef __ | 4229 #undef __ |
| 4240 | 4230 |
| 4241 } } // namespace v8::internal | 4231 } } // namespace v8::internal |
| 4242 | 4232 |
| 4243 #endif // V8_TARGET_ARCH_ARM | 4233 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |