OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 | 832 |
833 // Resume constant pool emission. Need to be called as many time as | 833 // Resume constant pool emission. Need to be called as many time as |
834 // StartBlockConstPool to have an effect. | 834 // StartBlockConstPool to have an effect. |
835 void EndBlockConstPool(); | 835 void EndBlockConstPool(); |
836 | 836 |
837 bool is_const_pool_blocked() const; | 837 bool is_const_pool_blocked() const; |
838 static bool IsConstantPoolAt(Instruction* instr); | 838 static bool IsConstantPoolAt(Instruction* instr); |
839 static int ConstantPoolSizeAt(Instruction* instr); | 839 static int ConstantPoolSizeAt(Instruction* instr); |
840 // See Assembler::CheckConstPool for more info. | 840 // See Assembler::CheckConstPool for more info. |
841 void ConstantPoolMarker(uint32_t size); | 841 void ConstantPoolMarker(uint32_t size); |
| 842 void EmitPoolGuard(); |
842 void ConstantPoolGuard(); | 843 void ConstantPoolGuard(); |
843 | 844 |
844 // Prevent veneer pool emission until EndBlockVeneerPool is called. | 845 // Prevent veneer pool emission until EndBlockVeneerPool is called. |
845 // Call to this function can be nested but must be followed by an equal | 846 // Call to this function can be nested but must be followed by an equal |
846 // number of call to EndBlockConstpool. | 847 // number of call to EndBlockConstpool. |
847 void StartBlockVeneerPool(); | 848 void StartBlockVeneerPool(); |
848 | 849 |
849 // Resume constant pool emission. Need to be called as many time as | 850 // Resume constant pool emission. Need to be called as many time as |
850 // StartBlockVeneerPool to have an effect. | 851 // StartBlockVeneerPool to have an effect. |
851 void EndBlockVeneerPool(); | 852 void EndBlockVeneerPool(); |
(...skipping 18 matching lines...) Expand all Loading... |
870 int buffer_space() const; | 871 int buffer_space() const; |
871 | 872 |
872 // Mark address of the ExitJSFrame code. | 873 // Mark address of the ExitJSFrame code. |
873 void RecordJSReturn(); | 874 void RecordJSReturn(); |
874 | 875 |
875 // Mark address of a debug break slot. | 876 // Mark address of a debug break slot. |
876 void RecordDebugBreakSlot(); | 877 void RecordDebugBreakSlot(); |
877 | 878 |
878 // Record the emission of a constant pool. | 879 // Record the emission of a constant pool. |
879 // | 880 // |
880 // The emission of constant pool depends on the size of the code generated and | 881 // The emission of constant and veneer pools depends on the size of the code |
881 // the number of RelocInfo recorded. | 882 // generated and the number of RelocInfo recorded. |
882 // The Debug mechanism needs to map code offsets between two versions of a | 883 // The Debug mechanism needs to map code offsets between two versions of a |
883 // function, compiled with and without debugger support (see for example | 884 // function, compiled with and without debugger support (see for example |
884 // Debug::PrepareForBreakPoints()). | 885 // Debug::PrepareForBreakPoints()). |
885 // Compiling functions with debugger support generates additional code | 886 // Compiling functions with debugger support generates additional code |
886 // (Debug::GenerateSlot()). This may affect the emission of the constant | 887 // (Debug::GenerateSlot()). This may affect the emission of the pools and |
887 // pools and cause the version of the code with debugger support to have | 888 // cause the version of the code with debugger support to have pools generated |
888 // constant pools generated in different places. | 889 // in different places. |
889 // Recording the position and size of emitted constant pools allows to | 890 // Recording the position and size of emitted pools allows to correctly |
890 // correctly compute the offset mappings between the different versions of a | 891 // compute the offset mappings between the different versions of a function in |
891 // function in all situations. | 892 // all situations. |
892 // | 893 // |
893 // The parameter indicates the size of the constant pool (in bytes), including | 894 // The parameter indicates the size of the pool (in bytes), including |
894 // the marker and branch over the data. | 895 // the marker and branch over the data. |
895 void RecordConstPool(int size); | 896 void RecordConstPool(int size); |
896 | 897 |
897 | 898 |
898 // Instruction set functions ------------------------------------------------ | 899 // Instruction set functions ------------------------------------------------ |
899 | 900 |
900 // Branch / Jump instructions. | 901 // Branch / Jump instructions. |
901 // For branches offsets are scaled, i.e. they in instrcutions not in bytes. | 902 // For branches offsets are scaled, i.e. they in instrcutions not in bytes. |
902 // Branch to register. | 903 // Branch to register. |
903 void br(const Register& xn); | 904 void br(const Register& xn); |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1751 | 1752 |
1752 // The maximum code size generated for a veneer. Currently one branch | 1753 // The maximum code size generated for a veneer. Currently one branch |
1753 // instruction. This is for code size checking purposes, and can be extended | 1754 // instruction. This is for code size checking purposes, and can be extended |
1754 // in the future for example if we decide to add nops between the veneers. | 1755 // in the future for example if we decide to add nops between the veneers. |
1755 static const int kMaxVeneerCodeSize = 1 * kInstructionSize; | 1756 static const int kMaxVeneerCodeSize = 1 * kInstructionSize; |
1756 | 1757 |
1757 // Emits veneers for branches that are approaching their maximum range. | 1758 // Emits veneers for branches that are approaching their maximum range. |
1758 // If need_protection is true, the veneers are protected by a branch jumping | 1759 // If need_protection is true, the veneers are protected by a branch jumping |
1759 // over the code. | 1760 // over the code. |
1760 void EmitVeneers(bool need_protection, int margin = kVeneerDistanceMargin); | 1761 void EmitVeneers(bool need_protection, int margin = kVeneerDistanceMargin); |
1761 void EmitVeneersGuard(); | 1762 void EmitVeneersGuard() { EmitPoolGuard(); } |
1762 // Checks whether veneers need to be emitted at this point. | 1763 // Checks whether veneers need to be emitted at this point. |
1763 void CheckVeneerPool(bool require_jump, int margin = kVeneerDistanceMargin); | 1764 void CheckVeneerPool(bool require_jump, int margin = kVeneerDistanceMargin); |
1764 | 1765 |
1765 | 1766 |
1766 class BlockPoolsScope { | 1767 class BlockPoolsScope { |
1767 public: | 1768 public: |
1768 explicit BlockPoolsScope(Assembler* assem) : assem_(assem) { | 1769 explicit BlockPoolsScope(Assembler* assem) : assem_(assem) { |
1769 assem_->StartBlockPools(); | 1770 assem_->StartBlockPools(); |
1770 } | 1771 } |
1771 ~BlockPoolsScope() { | 1772 ~BlockPoolsScope() { |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2152 class EnsureSpace BASE_EMBEDDED { | 2153 class EnsureSpace BASE_EMBEDDED { |
2153 public: | 2154 public: |
2154 explicit EnsureSpace(Assembler* assembler) { | 2155 explicit EnsureSpace(Assembler* assembler) { |
2155 assembler->CheckBuffer(); | 2156 assembler->CheckBuffer(); |
2156 } | 2157 } |
2157 }; | 2158 }; |
2158 | 2159 |
2159 } } // namespace v8::internal | 2160 } } // namespace v8::internal |
2160 | 2161 |
2161 #endif // V8_A64_ASSEMBLER_A64_H_ | 2162 #endif // V8_A64_ASSEMBLER_A64_H_ |
OLD | NEW |