OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 // Implementation of RelocInfo | 717 // Implementation of RelocInfo |
718 | 718 |
719 | 719 |
720 #ifdef DEBUG | 720 #ifdef DEBUG |
721 bool RelocInfo::RequiresRelocation(const CodeDesc& desc) { | 721 bool RelocInfo::RequiresRelocation(const CodeDesc& desc) { |
722 // Ensure there are no code targets or embedded objects present in the | 722 // Ensure there are no code targets or embedded objects present in the |
723 // deoptimization entries, they would require relocation after code | 723 // deoptimization entries, they would require relocation after code |
724 // generation. | 724 // generation. |
725 int mode_mask = RelocInfo::kCodeTargetMask | | 725 int mode_mask = RelocInfo::kCodeTargetMask | |
726 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | | 726 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
727 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | | 727 RelocInfo::ModeMask(RelocInfo::CELL) | |
728 RelocInfo::kApplyMask; | 728 RelocInfo::kApplyMask; |
729 RelocIterator it(desc, mode_mask); | 729 RelocIterator it(desc, mode_mask); |
730 return !it.done(); | 730 return !it.done(); |
731 } | 731 } |
732 #endif | 732 #endif |
733 | 733 |
734 | 734 |
735 #ifdef ENABLE_DISASSEMBLER | 735 #ifdef ENABLE_DISASSEMBLER |
736 const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) { | 736 const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) { |
737 switch (rmode) { | 737 switch (rmode) { |
738 case RelocInfo::NONE32: | 738 case RelocInfo::NONE32: |
739 return "no reloc 32"; | 739 return "no reloc 32"; |
740 case RelocInfo::NONE64: | 740 case RelocInfo::NONE64: |
741 return "no reloc 64"; | 741 return "no reloc 64"; |
742 case RelocInfo::EMBEDDED_OBJECT: | 742 case RelocInfo::EMBEDDED_OBJECT: |
743 return "embedded object"; | 743 return "embedded object"; |
744 case RelocInfo::CONSTRUCT_CALL: | 744 case RelocInfo::CONSTRUCT_CALL: |
745 return "code target (js construct call)"; | 745 return "code target (js construct call)"; |
746 case RelocInfo::CODE_TARGET_CONTEXT: | 746 case RelocInfo::CODE_TARGET_CONTEXT: |
747 return "code target (context)"; | 747 return "code target (context)"; |
748 case RelocInfo::DEBUG_BREAK: | 748 case RelocInfo::DEBUG_BREAK: |
749 #ifndef ENABLE_DEBUGGER_SUPPORT | 749 #ifndef ENABLE_DEBUGGER_SUPPORT |
750 UNREACHABLE(); | 750 UNREACHABLE(); |
751 #endif | 751 #endif |
752 return "debug break"; | 752 return "debug break"; |
753 case RelocInfo::CODE_TARGET: | 753 case RelocInfo::CODE_TARGET: |
754 return "code target"; | 754 return "code target"; |
755 case RelocInfo::CODE_TARGET_WITH_ID: | 755 case RelocInfo::CODE_TARGET_WITH_ID: |
756 return "code target with id"; | 756 return "code target with id"; |
757 case RelocInfo::GLOBAL_PROPERTY_CELL: | 757 case RelocInfo::CELL: |
758 return "global property cell"; | 758 return "property cell"; |
759 case RelocInfo::RUNTIME_ENTRY: | 759 case RelocInfo::RUNTIME_ENTRY: |
760 return "runtime entry"; | 760 return "runtime entry"; |
761 case RelocInfo::JS_RETURN: | 761 case RelocInfo::JS_RETURN: |
762 return "js return"; | 762 return "js return"; |
763 case RelocInfo::COMMENT: | 763 case RelocInfo::COMMENT: |
764 return "comment"; | 764 return "comment"; |
765 case RelocInfo::POSITION: | 765 case RelocInfo::POSITION: |
766 return "position"; | 766 return "position"; |
767 case RelocInfo::STATEMENT_POSITION: | 767 case RelocInfo::STATEMENT_POSITION: |
768 return "statement position"; | 768 return "statement position"; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 } | 823 } |
824 #endif // ENABLE_DISASSEMBLER | 824 #endif // ENABLE_DISASSEMBLER |
825 | 825 |
826 | 826 |
827 #ifdef VERIFY_HEAP | 827 #ifdef VERIFY_HEAP |
828 void RelocInfo::Verify() { | 828 void RelocInfo::Verify() { |
829 switch (rmode_) { | 829 switch (rmode_) { |
830 case EMBEDDED_OBJECT: | 830 case EMBEDDED_OBJECT: |
831 Object::VerifyPointer(target_object()); | 831 Object::VerifyPointer(target_object()); |
832 break; | 832 break; |
833 case GLOBAL_PROPERTY_CELL: | 833 case CELL: |
834 Object::VerifyPointer(target_cell()); | 834 Object::VerifyPointer(target_cell()); |
835 break; | 835 break; |
836 case DEBUG_BREAK: | 836 case DEBUG_BREAK: |
837 #ifndef ENABLE_DEBUGGER_SUPPORT | 837 #ifndef ENABLE_DEBUGGER_SUPPORT |
838 UNREACHABLE(); | 838 UNREACHABLE(); |
839 break; | 839 break; |
840 #endif | 840 #endif |
841 case CONSTRUCT_CALL: | 841 case CONSTRUCT_CALL: |
842 case CODE_TARGET_CONTEXT: | 842 case CODE_TARGET_CONTEXT: |
843 case CODE_TARGET_WITH_ID: | 843 case CODE_TARGET_WITH_ID: |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 1662 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
1663 state_.written_position = state_.current_position; | 1663 state_.written_position = state_.current_position; |
1664 written = true; | 1664 written = true; |
1665 } | 1665 } |
1666 | 1666 |
1667 // Return whether something was written. | 1667 // Return whether something was written. |
1668 return written; | 1668 return written; |
1669 } | 1669 } |
1670 | 1670 |
1671 } } // namespace v8::internal | 1671 } } // namespace v8::internal |
OLD | NEW |