| 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 // Implementation of RelocInfo | 720 // Implementation of RelocInfo |
| 721 | 721 |
| 722 | 722 |
| 723 #ifdef DEBUG | 723 #ifdef DEBUG |
| 724 bool RelocInfo::RequiresRelocation(const CodeDesc& desc) { | 724 bool RelocInfo::RequiresRelocation(const CodeDesc& desc) { |
| 725 // Ensure there are no code targets or embedded objects present in the | 725 // Ensure there are no code targets or embedded objects present in the |
| 726 // deoptimization entries, they would require relocation after code | 726 // deoptimization entries, they would require relocation after code |
| 727 // generation. | 727 // generation. |
| 728 int mode_mask = RelocInfo::kCodeTargetMask | | 728 int mode_mask = RelocInfo::kCodeTargetMask | |
| 729 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | | 729 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
| 730 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | | 730 RelocInfo::ModeMask(RelocInfo::CELL) | |
| 731 RelocInfo::kApplyMask; | 731 RelocInfo::kApplyMask; |
| 732 RelocIterator it(desc, mode_mask); | 732 RelocIterator it(desc, mode_mask); |
| 733 return !it.done(); | 733 return !it.done(); |
| 734 } | 734 } |
| 735 #endif | 735 #endif |
| 736 | 736 |
| 737 | 737 |
| 738 #ifdef ENABLE_DISASSEMBLER | 738 #ifdef ENABLE_DISASSEMBLER |
| 739 const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) { | 739 const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) { |
| 740 switch (rmode) { | 740 switch (rmode) { |
| 741 case RelocInfo::NONE32: | 741 case RelocInfo::NONE32: |
| 742 return "no reloc 32"; | 742 return "no reloc 32"; |
| 743 case RelocInfo::NONE64: | 743 case RelocInfo::NONE64: |
| 744 return "no reloc 64"; | 744 return "no reloc 64"; |
| 745 case RelocInfo::EMBEDDED_OBJECT: | 745 case RelocInfo::EMBEDDED_OBJECT: |
| 746 return "embedded object"; | 746 return "embedded object"; |
| 747 case RelocInfo::CONSTRUCT_CALL: | 747 case RelocInfo::CONSTRUCT_CALL: |
| 748 return "code target (js construct call)"; | 748 return "code target (js construct call)"; |
| 749 case RelocInfo::CODE_TARGET_CONTEXT: | 749 case RelocInfo::CODE_TARGET_CONTEXT: |
| 750 return "code target (context)"; | 750 return "code target (context)"; |
| 751 case RelocInfo::DEBUG_BREAK: | 751 case RelocInfo::DEBUG_BREAK: |
| 752 #ifndef ENABLE_DEBUGGER_SUPPORT | 752 #ifndef ENABLE_DEBUGGER_SUPPORT |
| 753 UNREACHABLE(); | 753 UNREACHABLE(); |
| 754 #endif | 754 #endif |
| 755 return "debug break"; | 755 return "debug break"; |
| 756 case RelocInfo::CODE_TARGET: | 756 case RelocInfo::CODE_TARGET: |
| 757 return "code target"; | 757 return "code target"; |
| 758 case RelocInfo::CODE_TARGET_WITH_ID: | 758 case RelocInfo::CODE_TARGET_WITH_ID: |
| 759 return "code target with id"; | 759 return "code target with id"; |
| 760 case RelocInfo::GLOBAL_PROPERTY_CELL: | 760 case RelocInfo::CELL: |
| 761 return "global property cell"; | 761 return "property cell"; |
| 762 case RelocInfo::RUNTIME_ENTRY: | 762 case RelocInfo::RUNTIME_ENTRY: |
| 763 return "runtime entry"; | 763 return "runtime entry"; |
| 764 case RelocInfo::JS_RETURN: | 764 case RelocInfo::JS_RETURN: |
| 765 return "js return"; | 765 return "js return"; |
| 766 case RelocInfo::COMMENT: | 766 case RelocInfo::COMMENT: |
| 767 return "comment"; | 767 return "comment"; |
| 768 case RelocInfo::POSITION: | 768 case RelocInfo::POSITION: |
| 769 return "position"; | 769 return "position"; |
| 770 case RelocInfo::STATEMENT_POSITION: | 770 case RelocInfo::STATEMENT_POSITION: |
| 771 return "statement position"; | 771 return "statement position"; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 } | 826 } |
| 827 #endif // ENABLE_DISASSEMBLER | 827 #endif // ENABLE_DISASSEMBLER |
| 828 | 828 |
| 829 | 829 |
| 830 #ifdef VERIFY_HEAP | 830 #ifdef VERIFY_HEAP |
| 831 void RelocInfo::Verify() { | 831 void RelocInfo::Verify() { |
| 832 switch (rmode_) { | 832 switch (rmode_) { |
| 833 case EMBEDDED_OBJECT: | 833 case EMBEDDED_OBJECT: |
| 834 Object::VerifyPointer(target_object()); | 834 Object::VerifyPointer(target_object()); |
| 835 break; | 835 break; |
| 836 case GLOBAL_PROPERTY_CELL: | 836 case CELL: |
| 837 Object::VerifyPointer(target_cell()); | 837 Object::VerifyPointer(target_cell()); |
| 838 break; | 838 break; |
| 839 case DEBUG_BREAK: | 839 case DEBUG_BREAK: |
| 840 #ifndef ENABLE_DEBUGGER_SUPPORT | 840 #ifndef ENABLE_DEBUGGER_SUPPORT |
| 841 UNREACHABLE(); | 841 UNREACHABLE(); |
| 842 break; | 842 break; |
| 843 #endif | 843 #endif |
| 844 case CONSTRUCT_CALL: | 844 case CONSTRUCT_CALL: |
| 845 case CODE_TARGET_CONTEXT: | 845 case CODE_TARGET_CONTEXT: |
| 846 case CODE_TARGET_WITH_ID: | 846 case CODE_TARGET_WITH_ID: |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1667 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 1667 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
| 1668 state_.written_position = state_.current_position; | 1668 state_.written_position = state_.current_position; |
| 1669 written = true; | 1669 written = true; |
| 1670 } | 1670 } |
| 1671 | 1671 |
| 1672 // Return whether something was written. | 1672 // Return whether something was written. |
| 1673 return written; | 1673 return written; |
| 1674 } | 1674 } |
| 1675 | 1675 |
| 1676 } } // namespace v8::internal | 1676 } } // namespace v8::internal |
| OLD | NEW |