OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 | 646 |
647 | 647 |
648 // ------------------------------------------- | 648 // ------------------------------------------- |
649 // Dont adapt arguments. | 649 // Dont adapt arguments. |
650 // ------------------------------------------- | 650 // ------------------------------------------- |
651 __ bind(&dont_adapt_arguments); | 651 __ bind(&dont_adapt_arguments); |
652 __ mov(pc, r3); | 652 __ mov(pc, r3); |
653 } | 653 } |
654 | 654 |
655 | 655 |
656 static void Generate_DebugBreakCallHelper(MacroAssembler* masm, | |
657 RegList pointer_regs) { | |
658 // Save the content of all general purpose registers in memory. This copy in | |
659 // memory is later pushed onto the JS expression stack for the fake JS frame | |
660 // generated and also to the C frame generated on top of that. In the JS | |
661 // frame ONLY the registers containing pointers will be pushed on the | |
662 // expression stack. This causes the GC to update these pointers so that | |
663 // they will have the correct value when returning from the debugger. | |
664 __ SaveRegistersToMemory(kJSCallerSaved); | |
665 | |
666 __ EnterInternalFrame(); | |
667 | |
668 // Store the registers containing object pointers on the expression stack to | |
669 // make sure that these are correctly updated during GC. | |
670 // Use sp as base to push. | |
671 __ CopyRegistersFromMemoryToStack(sp, pointer_regs); | |
672 | |
673 #ifdef DEBUG | |
674 __ RecordComment("// Calling from debug break to runtime - come in - over"); | |
675 #endif | |
676 __ mov(r0, Operand(0)); // no arguments | |
677 __ mov(r1, Operand(ExternalReference::debug_break())); | |
678 | |
679 CEntryDebugBreakStub ceb; | |
680 __ CallStub(&ceb); | |
681 | |
682 // Restore the register values containing object pointers from the expression | |
683 // stack in the reverse order as they where pushed. | |
684 // Use sp as base to pop. | |
685 __ CopyRegistersFromStackToMemory(sp, r3, pointer_regs); | |
686 | |
687 __ LeaveInternalFrame(); | |
688 | |
689 // Inlined ExitJSFrame ends here. | |
690 | |
691 // Finally restore all registers. | |
692 __ RestoreRegistersFromMemory(kJSCallerSaved); | |
693 | |
694 // Now that the break point has been handled, resume normal execution by | |
695 // jumping to the target address intended by the caller and that was | |
696 // overwritten by the address of DebugBreakXXX. | |
697 __ mov(ip, Operand(ExternalReference(Debug_Address::AfterBreakTarget()))); | |
698 __ ldr(ip, MemOperand(ip)); | |
699 __ Jump(ip); | |
700 } | |
701 | |
702 | |
703 void Builtins::Generate_LoadIC_DebugBreak(MacroAssembler* masm) { | |
704 // Calling convention for IC load (from ic-arm.cc). | |
705 // ----------- S t a t e ------------- | |
706 // -- r0 : receiver | |
707 // -- r2 : name | |
708 // -- lr : return address | |
709 // -- [sp] : receiver | |
710 // ----------------------------------- | |
711 // Registers r0 and r2 contain objects that needs to be pushed on the | |
712 // expression stack of the fake JS frame. | |
713 Generate_DebugBreakCallHelper(masm, r0.bit() | r2.bit()); | |
714 } | |
715 | |
716 | |
717 void Builtins::Generate_StoreIC_DebugBreak(MacroAssembler* masm) { | |
718 // Calling convention for IC store (from ic-arm.cc). | |
719 // ----------- S t a t e ------------- | |
720 // -- r0 : receiver | |
721 // -- r2 : name | |
722 // -- lr : return address | |
723 // -- [sp] : receiver | |
724 // ----------------------------------- | |
725 // Registers r0 and r2 contain objects that needs to be pushed on the | |
726 // expression stack of the fake JS frame. | |
727 Generate_DebugBreakCallHelper(masm, r0.bit() | r2.bit()); | |
728 } | |
729 | |
730 | |
731 void Builtins::Generate_KeyedLoadIC_DebugBreak(MacroAssembler* masm) { | |
732 // Keyed load IC not implemented on ARM. | |
733 } | |
734 | |
735 | |
736 void Builtins::Generate_KeyedStoreIC_DebugBreak(MacroAssembler* masm) { | |
737 // Keyed store IC not implemented on ARM. | |
738 } | |
739 | |
740 | |
741 void Builtins::Generate_CallIC_DebugBreak(MacroAssembler* masm) { | |
742 // Calling convention for IC call (from ic-arm.cc) | |
743 // ----------- S t a t e ------------- | |
744 // -- r0: number of arguments | |
745 // -- r1: receiver | |
746 // -- lr: return address | |
747 // ----------------------------------- | |
748 // Register r1 contains an object that needs to be pushed on the expression | |
749 // stack of the fake JS frame. r0 is the actual number of arguments not | |
750 // encoded as a smi, therefore it cannot be on the expression stack of the | |
751 // fake JS frame as it can easily be an invalid pointer (e.g. 1). r0 will be | |
752 // pushed on the stack of the C frame and restored from there. | |
753 Generate_DebugBreakCallHelper(masm, r1.bit()); | |
754 } | |
755 | |
756 | |
757 void Builtins::Generate_ConstructCall_DebugBreak(MacroAssembler* masm) { | |
758 // In places other than IC call sites it is expected that r0 is TOS which | |
759 // is an object - this is not generally the case so this should be used with | |
760 // care. | |
761 Generate_DebugBreakCallHelper(masm, r0.bit()); | |
762 } | |
763 | |
764 | |
765 void Builtins::Generate_Return_DebugBreak(MacroAssembler* masm) { | |
766 // In places other than IC call sites it is expected that r0 is TOS which | |
767 // is an object - this is not generally the case so this should be used with | |
768 // care. | |
769 Generate_DebugBreakCallHelper(masm, r0.bit()); | |
770 } | |
771 | |
772 | |
773 void Builtins::Generate_Return_DebugBreakEntry(MacroAssembler* masm) { | |
774 // Generate nothing as this handling of debug break return is not done this | |
775 // way on ARM - yet. | |
776 } | |
777 | |
778 void Builtins::Generate_StubNoRegisters_DebugBreak(MacroAssembler* masm) { | |
779 // Generate nothing as CodeStub CallFunction is not used on ARM. | |
780 } | |
781 | |
782 | |
783 #undef __ | 656 #undef __ |
784 | 657 |
785 } } // namespace v8::internal | 658 } } // namespace v8::internal |
OLD | NEW |