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 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 void RecordComment(const char* msg); | 969 void RecordComment(const char* msg); |
970 | 970 |
971 void RecordPosition(int pos); | 971 void RecordPosition(int pos); |
972 void RecordStatementPosition(int pos); | 972 void RecordStatementPosition(int pos); |
973 void WriteRecordedPositions(); | 973 void WriteRecordedPositions(); |
974 | 974 |
975 int pc_offset() const { return pc_ - buffer_; } | 975 int pc_offset() const { return pc_ - buffer_; } |
976 int current_position() const { return current_position_; } | 976 int current_position() const { return current_position_; } |
977 int current_statement_position() const { return current_statement_position_; } | 977 int current_statement_position() const { return current_statement_position_; } |
978 | 978 |
| 979 bool can_peephole_optimize(int instructions) { |
| 980 if (!FLAG_peephole_optimization) return false; |
| 981 if (last_bound_pos_ > pc_offset() - instructions * kInstrSize) return false; |
| 982 return reloc_info_writer.last_pc() <= pc_ - instructions * kInstrSize; |
| 983 } |
| 984 |
979 // Read/patch instructions | 985 // Read/patch instructions |
980 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } | 986 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } |
981 static void instr_at_put(byte* pc, Instr instr) { | 987 static void instr_at_put(byte* pc, Instr instr) { |
982 *reinterpret_cast<Instr*>(pc) = instr; | 988 *reinterpret_cast<Instr*>(pc) = instr; |
983 } | 989 } |
984 static bool IsNop(Instr instr, int type = 0); | 990 static bool IsNop(Instr instr, int type = 0); |
985 static bool IsBranch(Instr instr); | 991 static bool IsBranch(Instr instr); |
986 static int GetBranchOffset(Instr instr); | 992 static int GetBranchOffset(Instr instr); |
987 static bool IsLdrRegisterImmediate(Instr instr); | 993 static bool IsLdrRegisterImmediate(Instr instr); |
988 static int GetLdrRegisterImmediateOffset(Instr instr); | 994 static int GetLdrRegisterImmediateOffset(Instr instr); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 | 1134 |
1129 friend class RegExpMacroAssemblerARM; | 1135 friend class RegExpMacroAssemblerARM; |
1130 friend class RelocInfo; | 1136 friend class RelocInfo; |
1131 friend class CodePatcher; | 1137 friend class CodePatcher; |
1132 friend class BlockConstPoolScope; | 1138 friend class BlockConstPoolScope; |
1133 }; | 1139 }; |
1134 | 1140 |
1135 } } // namespace v8::internal | 1141 } } // namespace v8::internal |
1136 | 1142 |
1137 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1143 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
OLD | NEW |