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 3543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3554 // r3: argc | 3554 // r3: argc |
3555 // [sp+0]: argv | 3555 // [sp+0]: argv |
3556 | 3556 |
3557 Label invoke, exit; | 3557 Label invoke, exit; |
3558 | 3558 |
3559 // Called from C, so do not pop argc and args on exit (preserve sp) | 3559 // Called from C, so do not pop argc and args on exit (preserve sp) |
3560 // No need to save register-passed args | 3560 // No need to save register-passed args |
3561 // Save callee-saved registers (incl. cp and fp), sp, and lr | 3561 // Save callee-saved registers (incl. cp and fp), sp, and lr |
3562 __ stm(db_w, sp, kCalleeSaved | lr.bit()); | 3562 __ stm(db_w, sp, kCalleeSaved | lr.bit()); |
3563 | 3563 |
3564 if (CpuFeatures::IsSupported(VFP3)) { | |
3565 CpuFeatures::Scope scope(VFP3); | |
3566 // Save callee-saved vfp registers. | |
3567 __ vstm(db_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg); | |
Søren Thygesen Gjesse
2011/06/16 09:38:07
Oops - isn't this a bug that might have broken the
Alexandre
2011/06/16 12:58:48
Indeed! I'll break it into a separate patch.
If yo
| |
3568 // Set up reserved registers. | |
3569 __ vmov(d12, 255.0); | |
3570 __ vmov(d13, -0.0); | |
3571 __ vmov(d14, 0.0); | |
3572 } | |
3573 | |
3564 // Get address of argv, see stm above. | 3574 // Get address of argv, see stm above. |
3565 // r0: code entry | 3575 // r0: code entry |
3566 // r1: function | 3576 // r1: function |
3567 // r2: receiver | 3577 // r2: receiver |
3568 // r3: argc | 3578 // r3: argc |
3569 __ ldr(r4, MemOperand(sp, (kNumCalleeSaved + 1) * kPointerSize)); // argv | 3579 __ ldr(r4, MemOperand(sp, (kNumCalleeSaved + 1) * kPointerSize + |
3580 kNumDoubleCalleeSaved * kDoubleSize)); // argv | |
3570 | 3581 |
3571 // Push a frame with special values setup to mark it as an entry frame. | 3582 // Push a frame with special values setup to mark it as an entry frame. |
3572 // r0: code entry | 3583 // r0: code entry |
3573 // r1: function | 3584 // r1: function |
3574 // r2: receiver | 3585 // r2: receiver |
3575 // r3: argc | 3586 // r3: argc |
3576 // r4: argv | 3587 // r4: argv |
3577 Isolate* isolate = masm->isolate(); | 3588 Isolate* isolate = masm->isolate(); |
3578 __ mov(r8, Operand(-1)); // Push a bad frame pointer to fail if it is used. | 3589 __ mov(r8, Operand(-1)); // Push a bad frame pointer to fail if it is used. |
3579 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; | 3590 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3684 | 3695 |
3685 // Reset the stack to the callee saved registers. | 3696 // Reset the stack to the callee saved registers. |
3686 __ add(sp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); | 3697 __ add(sp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); |
3687 | 3698 |
3688 // Restore callee-saved registers and return. | 3699 // Restore callee-saved registers and return. |
3689 #ifdef DEBUG | 3700 #ifdef DEBUG |
3690 if (FLAG_debug_code) { | 3701 if (FLAG_debug_code) { |
3691 __ mov(lr, Operand(pc)); | 3702 __ mov(lr, Operand(pc)); |
3692 } | 3703 } |
3693 #endif | 3704 #endif |
3705 | |
3706 if (CpuFeatures::IsSupported(VFP3)) { | |
3707 CpuFeatures::Scope scope(VFP3); | |
3708 // Restore callee-saved vfp registers. | |
3709 __ vldm(ia_w, sp, kFirstCalleeSavedDoubleReg, kLastCalleeSavedDoubleReg); | |
3710 } | |
3711 | |
3694 __ ldm(ia_w, sp, kCalleeSaved | pc.bit()); | 3712 __ ldm(ia_w, sp, kCalleeSaved | pc.bit()); |
3695 } | 3713 } |
3696 | 3714 |
3697 | 3715 |
3698 // Uses registers r0 to r4. | 3716 // Uses registers r0 to r4. |
3699 // Expected input (depending on whether args are in registers or on the stack): | 3717 // Expected input (depending on whether args are in registers or on the stack): |
3700 // * object: r0 or at sp + 1 * kPointerSize. | 3718 // * object: r0 or at sp + 1 * kPointerSize. |
3701 // * function: r1 or at sp. | 3719 // * function: r1 or at sp. |
3702 // | 3720 // |
3703 // An inlined call site may have been generated before calling this stub. | 3721 // An inlined call site may have been generated before calling this stub. |
(...skipping 2698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6402 __ mov(result, Operand(0)); | 6420 __ mov(result, Operand(0)); |
6403 __ Ret(); | 6421 __ Ret(); |
6404 } | 6422 } |
6405 | 6423 |
6406 | 6424 |
6407 #undef __ | 6425 #undef __ |
6408 | 6426 |
6409 } } // namespace v8::internal | 6427 } } // namespace v8::internal |
6410 | 6428 |
6411 #endif // V8_TARGET_ARCH_ARM | 6429 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |