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 | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are 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 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 ~BlockConstPoolScope() { | 934 ~BlockConstPoolScope() { |
935 assem_->EndBlockConstPool(); | 935 assem_->EndBlockConstPool(); |
936 } | 936 } |
937 | 937 |
938 private: | 938 private: |
939 Assembler* assem_; | 939 Assembler* assem_; |
940 | 940 |
941 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope); | 941 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope); |
942 }; | 942 }; |
943 | 943 |
| 944 // Postpone the generation of the constant pool for the specified number of |
| 945 // instructions. |
| 946 void BlockConstPoolFor(int instructions); |
| 947 |
944 // Debugging | 948 // Debugging |
945 | 949 |
946 // Mark address of the ExitJSFrame code. | 950 // Mark address of the ExitJSFrame code. |
947 void RecordJSReturn(); | 951 void RecordJSReturn(); |
948 | 952 |
949 // Record a comment relocation entry that can be used by a disassembler. | 953 // Record a comment relocation entry that can be used by a disassembler. |
950 // Use --debug_code to enable. | 954 // Use --debug_code to enable. |
951 void RecordComment(const char* msg); | 955 void RecordComment(const char* msg); |
952 | 956 |
953 void RecordPosition(int pos); | 957 void RecordPosition(int pos); |
954 void RecordStatementPosition(int pos); | 958 void RecordStatementPosition(int pos); |
955 void WriteRecordedPositions(); | 959 void WriteRecordedPositions(); |
956 | 960 |
957 int pc_offset() const { return pc_ - buffer_; } | 961 int pc_offset() const { return pc_ - buffer_; } |
958 int current_position() const { return current_position_; } | 962 int current_position() const { return current_position_; } |
959 int current_statement_position() const { return current_statement_position_; } | 963 int current_statement_position() const { return current_statement_position_; } |
960 | 964 |
961 void StartBlockConstPool() { | |
962 const_pool_blocked_nesting_++; | |
963 } | |
964 void EndBlockConstPool() { | |
965 const_pool_blocked_nesting_--; | |
966 } | |
967 | |
968 // Read/patch instructions | 965 // Read/patch instructions |
969 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } | 966 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } |
970 static void instr_at_put(byte* pc, Instr instr) { | 967 static void instr_at_put(byte* pc, Instr instr) { |
971 *reinterpret_cast<Instr*>(pc) = instr; | 968 *reinterpret_cast<Instr*>(pc) = instr; |
972 } | 969 } |
973 static bool IsNop(Instr instr, int type = 0); | 970 static bool IsNop(Instr instr, int type = 0); |
974 static bool IsBranch(Instr instr); | 971 static bool IsBranch(Instr instr); |
975 static int GetBranchOffset(Instr instr); | 972 static int GetBranchOffset(Instr instr); |
976 static bool IsLdrRegisterImmediate(Instr instr); | 973 static bool IsLdrRegisterImmediate(Instr instr); |
977 static int GetLdrRegisterImmediateOffset(Instr instr); | 974 static int GetLdrRegisterImmediateOffset(Instr instr); |
(...skipping 16 matching lines...) Expand all Loading... |
994 void target_at_put(int pos, int target_pos); | 991 void target_at_put(int pos, int target_pos); |
995 | 992 |
996 // Check if is time to emit a constant pool for pending reloc info entries | 993 // Check if is time to emit a constant pool for pending reloc info entries |
997 void CheckConstPool(bool force_emit, bool require_jump); | 994 void CheckConstPool(bool force_emit, bool require_jump); |
998 | 995 |
999 // Block the emission of the constant pool before pc_offset | 996 // Block the emission of the constant pool before pc_offset |
1000 void BlockConstPoolBefore(int pc_offset) { | 997 void BlockConstPoolBefore(int pc_offset) { |
1001 if (no_const_pool_before_ < pc_offset) no_const_pool_before_ = pc_offset; | 998 if (no_const_pool_before_ < pc_offset) no_const_pool_before_ = pc_offset; |
1002 } | 999 } |
1003 | 1000 |
| 1001 void StartBlockConstPool() { |
| 1002 const_pool_blocked_nesting_++; |
| 1003 } |
| 1004 void EndBlockConstPool() { |
| 1005 const_pool_blocked_nesting_--; |
| 1006 } |
| 1007 |
1004 private: | 1008 private: |
1005 // Code buffer: | 1009 // Code buffer: |
1006 // The buffer into which code and relocation info are generated. | 1010 // The buffer into which code and relocation info are generated. |
1007 byte* buffer_; | 1011 byte* buffer_; |
1008 int buffer_size_; | 1012 int buffer_size_; |
1009 // True if the assembler owns the buffer, false if buffer is external. | 1013 // True if the assembler owns the buffer, false if buffer is external. |
1010 bool own_buffer_; | 1014 bool own_buffer_; |
1011 | 1015 |
1012 // Buffer size and constant pool distance are checked together at regular | 1016 // Buffer size and constant pool distance are checked together at regular |
1013 // intervals of kBufferCheckInterval emitted bytes | 1017 // intervals of kBufferCheckInterval emitted bytes |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 | 1107 |
1104 friend class RegExpMacroAssemblerARM; | 1108 friend class RegExpMacroAssemblerARM; |
1105 friend class RelocInfo; | 1109 friend class RelocInfo; |
1106 friend class CodePatcher; | 1110 friend class CodePatcher; |
1107 friend class BlockConstPoolScope; | 1111 friend class BlockConstPoolScope; |
1108 }; | 1112 }; |
1109 | 1113 |
1110 } } // namespace v8::internal | 1114 } } // namespace v8::internal |
1111 | 1115 |
1112 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1116 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
OLD | NEW |