| 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 7185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7196 r3, | 7196 r3, |
| 7197 r9, | 7197 r9, |
| 7198 kLRHasNotBeenSaved, | 7198 kLRHasNotBeenSaved, |
| 7199 kDontSaveFPRegs, | 7199 kDontSaveFPRegs, |
| 7200 EMIT_REMEMBERED_SET, | 7200 EMIT_REMEMBERED_SET, |
| 7201 OMIT_SMI_CHECK); | 7201 OMIT_SMI_CHECK); |
| 7202 } | 7202 } |
| 7203 | 7203 |
| 7204 | 7204 |
| 7205 void FastElementsConversionStub::GenerateSmiOnlyToDouble( | 7205 void FastElementsConversionStub::GenerateSmiOnlyToDouble( |
| 7206 MacroAssembler* masm, StrictModeFlag strict_mode) { | 7206 MacroAssembler* masm, Type type, StrictModeFlag strict_mode) { |
| 7207 // ----------- S t a t e ------------- | 7207 // ----------- S t a t e ------------- |
| 7208 // -- r0 : value | 7208 // -- r0 : value |
| 7209 // -- r1 : key | 7209 // -- r1 : key |
| 7210 // -- r2 : receiver | 7210 // -- r2 : receiver |
| 7211 // -- lr : return address | 7211 // -- lr : return address |
| 7212 // -- r3 : target map, scratch for subsequent call | 7212 // -- r3 : target map, scratch for subsequent call |
| 7213 // -- r4 : scratch (elements) | 7213 // -- r4 : scratch (elements) |
| 7214 // ----------------------------------- | 7214 // ----------------------------------- |
| 7215 Label loop, entry, convert_hole, gc_required, fail; | 7215 Label loop, entry, convert_hole, gc_required, fail; |
| 7216 bool vfp3_supported = CpuFeatures::IsSupported(VFP3); | 7216 bool vfp3_supported = CpuFeatures::IsSupported(VFP3); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7263 // r4: kHoleNanLower32 | 7263 // r4: kHoleNanLower32 |
| 7264 // r5: kHoleNanUpper32 | 7264 // r5: kHoleNanUpper32 |
| 7265 // r6: end of destination FixedDoubleArray, not tagged | 7265 // r6: end of destination FixedDoubleArray, not tagged |
| 7266 // r7: begin of FixedDoubleArray element fields, not tagged | 7266 // r7: begin of FixedDoubleArray element fields, not tagged |
| 7267 if (vfp3_supported) __ Push(r1, r0); | 7267 if (vfp3_supported) __ Push(r1, r0); |
| 7268 | 7268 |
| 7269 __ b(&entry); | 7269 __ b(&entry); |
| 7270 | 7270 |
| 7271 // Call into runtime if GC is required. | 7271 // Call into runtime if GC is required. |
| 7272 __ bind(&gc_required); | 7272 __ bind(&gc_required); |
| 7273 KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode); | 7273 if (type == TRANSITION_ONLY) { |
| 7274 __ push(r2); |
| 7275 __ TailCallRuntime(Runtime::kTransitionElementsSmiToDouble, 1, 1); |
| 7276 } else { |
| 7277 ASSERT(type == TRANSITION_AND_STORE); |
| 7278 KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode); |
| 7279 } |
| 7274 | 7280 |
| 7275 // Convert and copy elements. | 7281 // Convert and copy elements. |
| 7276 __ bind(&loop); | 7282 __ bind(&loop); |
| 7277 __ ldr(r9, MemOperand(r3, 4, PostIndex)); | 7283 __ ldr(r9, MemOperand(r3, 4, PostIndex)); |
| 7278 // r9: current element | 7284 // r9: current element |
| 7279 __ JumpIfNotSmi(r9, &convert_hole); | 7285 __ JumpIfNotSmi(r9, &convert_hole); |
| 7280 | 7286 |
| 7281 // Normal smi, convert to double and store. | 7287 // Normal smi, convert to double and store. |
| 7282 __ SmiUntag(r9); | 7288 __ SmiUntag(r9); |
| 7283 if (vfp3_supported) { | 7289 if (vfp3_supported) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 7301 | 7307 |
| 7302 // Hole found, store the-hole NaN. | 7308 // Hole found, store the-hole NaN. |
| 7303 __ bind(&convert_hole); | 7309 __ bind(&convert_hole); |
| 7304 __ Strd(r4, r5, MemOperand(r7, 8, PostIndex)); | 7310 __ Strd(r4, r5, MemOperand(r7, 8, PostIndex)); |
| 7305 | 7311 |
| 7306 __ bind(&entry); | 7312 __ bind(&entry); |
| 7307 __ cmp(r7, r6); | 7313 __ cmp(r7, r6); |
| 7308 __ b(lt, &loop); | 7314 __ b(lt, &loop); |
| 7309 | 7315 |
| 7310 if (vfp3_supported) __ Pop(r1, r0); | 7316 if (vfp3_supported) __ Pop(r1, r0); |
| 7317 |
| 7318 if (type == TRANSITION_ONLY) { |
| 7319 __ mov(r0, r2); |
| 7320 __ Ret(); |
| 7321 } |
| 7311 } | 7322 } |
| 7312 | 7323 |
| 7313 | 7324 |
| 7314 void FastElementsConversionStub::GenerateDoubleToObject( | 7325 void FastElementsConversionStub::GenerateDoubleToObject( |
| 7315 MacroAssembler* masm, StrictModeFlag strict_mode) { | 7326 MacroAssembler* masm, Type type, StrictModeFlag strict_mode) { |
| 7316 // ----------- S t a t e ------------- | 7327 // ----------- S t a t e ------------- |
| 7317 // -- r0 : value | 7328 // -- r0 : value |
| 7318 // -- r1 : key | 7329 // -- r1 : key |
| 7319 // -- r2 : receiver | 7330 // -- r2 : receiver |
| 7320 // -- lr : return address | 7331 // -- lr : return address |
| 7321 // -- r3 : target map, scratch for subsequent call | 7332 // -- r3 : target map, scratch for subsequent call |
| 7322 // -- r4 : scratch (elements) | 7333 // -- r4 : scratch (elements) |
| 7323 // ----------------------------------- | 7334 // ----------------------------------- |
| 7324 Label entry, loop, convert_hole, gc_required; | 7335 Label entry, loop, convert_hole, gc_required; |
| 7325 | 7336 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 7354 // r5: end of destination FixedArray, not tagged | 7365 // r5: end of destination FixedArray, not tagged |
| 7355 // r6: destination FixedArray | 7366 // r6: destination FixedArray |
| 7356 // r7: the-hole pointer | 7367 // r7: the-hole pointer |
| 7357 // r9: heap number map | 7368 // r9: heap number map |
| 7358 __ b(&entry); | 7369 __ b(&entry); |
| 7359 | 7370 |
| 7360 // Call into runtime if GC is required. | 7371 // Call into runtime if GC is required. |
| 7361 __ bind(&gc_required); | 7372 __ bind(&gc_required); |
| 7362 __ Pop(r3, r2, r1, r0); | 7373 __ Pop(r3, r2, r1, r0); |
| 7363 __ pop(lr); | 7374 __ pop(lr); |
| 7364 KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode); | 7375 if (type == TRANSITION_ONLY) { |
| 7376 __ push(r2); |
| 7377 __ TailCallRuntime(Runtime::kTransitionElementsDoubleToObject, 1, 1); |
| 7378 } else { |
| 7379 ASSERT(type == TRANSITION_AND_STORE); |
| 7380 KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode); |
| 7381 } |
| 7365 | 7382 |
| 7366 __ bind(&loop); | 7383 __ bind(&loop); |
| 7367 __ ldr(r1, MemOperand(r4, 8, PostIndex)); | 7384 __ ldr(r1, MemOperand(r4, 8, PostIndex)); |
| 7368 // lr: current element's upper 32 bit | 7385 // lr: current element's upper 32 bit |
| 7369 // r4: address of next element's upper 32 bit | 7386 // r4: address of next element's upper 32 bit |
| 7370 __ cmp(r1, Operand(kHoleNanUpper32)); | 7387 __ cmp(r1, Operand(kHoleNanUpper32)); |
| 7371 __ b(eq, &convert_hole); | 7388 __ b(eq, &convert_hole); |
| 7372 | 7389 |
| 7373 // Non-hole double, copy value into a heap number. | 7390 // Non-hole double, copy value into a heap number. |
| 7374 __ AllocateHeapNumber(r2, r0, lr, r9, &gc_required); | 7391 __ AllocateHeapNumber(r2, r0, lr, r9, &gc_required); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7409 __ str(r6, FieldMemOperand(r2, JSObject::kElementsOffset)); | 7426 __ str(r6, FieldMemOperand(r2, JSObject::kElementsOffset)); |
| 7410 __ RecordWriteField(r2, | 7427 __ RecordWriteField(r2, |
| 7411 JSObject::kElementsOffset, | 7428 JSObject::kElementsOffset, |
| 7412 r6, | 7429 r6, |
| 7413 r9, | 7430 r9, |
| 7414 kLRHasBeenSaved, | 7431 kLRHasBeenSaved, |
| 7415 kDontSaveFPRegs, | 7432 kDontSaveFPRegs, |
| 7416 EMIT_REMEMBERED_SET, | 7433 EMIT_REMEMBERED_SET, |
| 7417 OMIT_SMI_CHECK); | 7434 OMIT_SMI_CHECK); |
| 7418 __ pop(lr); | 7435 __ pop(lr); |
| 7436 |
| 7437 if (type == TRANSITION_ONLY) { |
| 7438 __ mov(r0, r2); |
| 7439 __ Ret(); |
| 7440 } |
| 7419 } | 7441 } |
| 7420 | 7442 |
| 7421 | 7443 |
| 7422 #undef __ | 7444 #undef __ |
| 7423 | 7445 |
| 7424 } } // namespace v8::internal | 7446 } } // namespace v8::internal |
| 7425 | 7447 |
| 7426 #endif // V8_TARGET_ARCH_ARM | 7448 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |