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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 for (int i = 0, length = inlined_closures->length(); | 729 for (int i = 0, length = inlined_closures->length(); |
730 i < length; | 730 i < length; |
731 i++) { | 731 i++) { |
732 DefineDeoptimizationLiteral(inlined_closures->at(i)); | 732 DefineDeoptimizationLiteral(inlined_closures->at(i)); |
733 } | 733 } |
734 | 734 |
735 inlined_function_count_ = deoptimization_literals_.length(); | 735 inlined_function_count_ = deoptimization_literals_.length(); |
736 } | 736 } |
737 | 737 |
738 | 738 |
| 739 void LCodeGen::RecordSafepoint( |
| 740 LPointerMap* pointers, |
| 741 Safepoint::Kind kind, |
| 742 int arguments, |
| 743 int deoptimization_index) { |
| 744 const ZoneList<LOperand*>* operands = pointers->operands(); |
| 745 Safepoint safepoint = safepoints_.DefineSafepoint(masm(), |
| 746 kind, arguments, deoptimization_index); |
| 747 for (int i = 0; i < operands->length(); i++) { |
| 748 LOperand* pointer = operands->at(i); |
| 749 if (pointer->IsStackSlot()) { |
| 750 safepoint.DefinePointerSlot(pointer->index()); |
| 751 } else if (pointer->IsRegister() && (kind & Safepoint::kWithRegisters)) { |
| 752 safepoint.DefinePointerRegister(ToRegister(pointer)); |
| 753 } |
| 754 } |
| 755 if (kind & Safepoint::kWithRegisters) { |
| 756 // Register cp always contains a pointer to the context. |
| 757 safepoint.DefinePointerRegister(cp); |
| 758 } |
| 759 } |
| 760 |
| 761 |
739 void LCodeGen::RecordSafepoint(LPointerMap* pointers, | 762 void LCodeGen::RecordSafepoint(LPointerMap* pointers, |
740 int deoptimization_index) { | 763 int deoptimization_index) { |
741 const ZoneList<LOperand*>* operands = pointers->operands(); | 764 RecordSafepoint(pointers, Safepoint::kSimple, 0, deoptimization_index); |
742 Safepoint safepoint = safepoints_.DefineSafepoint(masm(), | |
743 deoptimization_index); | |
744 for (int i = 0; i < operands->length(); i++) { | |
745 LOperand* pointer = operands->at(i); | |
746 if (pointer->IsStackSlot()) { | |
747 safepoint.DefinePointerSlot(pointer->index()); | |
748 } | |
749 } | |
750 } | 765 } |
751 | 766 |
752 | 767 |
753 void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers, | 768 void LCodeGen::RecordSafepointWithRegisters(LPointerMap* pointers, |
754 int arguments, | 769 int arguments, |
755 int deoptimization_index) { | 770 int deoptimization_index) { |
756 const ZoneList<LOperand*>* operands = pointers->operands(); | 771 RecordSafepoint(pointers, Safepoint::kWithRegisters, arguments, |
757 Safepoint safepoint = | 772 deoptimization_index); |
758 safepoints_.DefineSafepointWithRegisters( | |
759 masm(), arguments, deoptimization_index); | |
760 for (int i = 0; i < operands->length(); i++) { | |
761 LOperand* pointer = operands->at(i); | |
762 if (pointer->IsStackSlot()) { | |
763 safepoint.DefinePointerSlot(pointer->index()); | |
764 } else if (pointer->IsRegister()) { | |
765 safepoint.DefinePointerRegister(ToRegister(pointer)); | |
766 } | |
767 } | |
768 // Register cp always contains a pointer to the context. | |
769 safepoint.DefinePointerRegister(cp); | |
770 } | 773 } |
771 | 774 |
772 | 775 |
773 void LCodeGen::RecordSafepointWithRegistersAndDoubles( | 776 void LCodeGen::RecordSafepointWithRegistersAndDoubles( |
774 LPointerMap* pointers, | 777 LPointerMap* pointers, |
775 int arguments, | 778 int arguments, |
776 int deoptimization_index) { | 779 int deoptimization_index) { |
777 const ZoneList<LOperand*>* operands = pointers->operands(); | 780 RecordSafepoint(pointers, Safepoint::kWithRegistersAndDoubles, arguments, |
778 Safepoint safepoint = | 781 deoptimization_index); |
779 safepoints_.DefineSafepointWithRegistersAndDoubles( | |
780 masm(), arguments, deoptimization_index); | |
781 for (int i = 0; i < operands->length(); i++) { | |
782 LOperand* pointer = operands->at(i); | |
783 if (pointer->IsStackSlot()) { | |
784 safepoint.DefinePointerSlot(pointer->index()); | |
785 } else if (pointer->IsRegister()) { | |
786 safepoint.DefinePointerRegister(ToRegister(pointer)); | |
787 } | |
788 } | |
789 // Register cp always contains a pointer to the context. | |
790 safepoint.DefinePointerRegister(cp); | |
791 } | 782 } |
792 | 783 |
793 | 784 |
794 void LCodeGen::RecordPosition(int position) { | 785 void LCodeGen::RecordPosition(int position) { |
795 if (!FLAG_debug_info || position == RelocInfo::kNoPosition) return; | 786 if (!FLAG_debug_info || position == RelocInfo::kNoPosition) return; |
796 masm()->positions_recorder()->RecordPosition(position); | 787 masm()->positions_recorder()->RecordPosition(position); |
797 } | 788 } |
798 | 789 |
799 | 790 |
800 void LCodeGen::DoLabel(LLabel* label) { | 791 void LCodeGen::DoLabel(LLabel* label) { |
(...skipping 2869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3670 | 3661 |
3671 | 3662 |
3672 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 3663 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
3673 Abort("DoOsrEntry unimplemented."); | 3664 Abort("DoOsrEntry unimplemented."); |
3674 } | 3665 } |
3675 | 3666 |
3676 | 3667 |
3677 #undef __ | 3668 #undef __ |
3678 | 3669 |
3679 } } // namespace v8::internal | 3670 } } // namespace v8::internal |
OLD | NEW |