Chromium Code Reviews| 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 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1072 const Condition cond = al); | 1072 const Condition cond = al); |
| 1073 void vmrs(const Register dst, | 1073 void vmrs(const Register dst, |
| 1074 const Condition cond = al); | 1074 const Condition cond = al); |
| 1075 void vmsr(const Register dst, | 1075 void vmsr(const Register dst, |
| 1076 const Condition cond = al); | 1076 const Condition cond = al); |
| 1077 void vsqrt(const DwVfpRegister dst, | 1077 void vsqrt(const DwVfpRegister dst, |
| 1078 const DwVfpRegister src, | 1078 const DwVfpRegister src, |
| 1079 const Condition cond = al); | 1079 const Condition cond = al); |
| 1080 | 1080 |
| 1081 // Pseudo instructions | 1081 // Pseudo instructions |
| 1082 void nop(int type = 0); | 1082 |
| 1083 // Different nop operations are used by the code generator to detect certain | |
| 1084 // states of the generated code. | |
| 1085 enum NopMarkerTypes { | |
|
Søren Thygesen Gjesse
2010/11/19 09:08:47
I think this enum should be moved to the macro-ass
Alexandre
2010/11/23 11:23:21
Left here as discussed.
Moving this to the Masm wa
| |
| 1086 NON_MARKING_NOP = 0, | |
| 1087 PROPERTY_ACCESS_INLINED, | |
| 1088 PROPERTY_ACCESS_INLINED_CONTEXT, | |
| 1089 DEBUG_BREAK_NOP | |
| 1090 }; | |
| 1091 | |
| 1092 void nop(NopMarkerTypes type = NON_MARKING_NOP); | |
| 1083 | 1093 |
| 1084 void push(Register src, Condition cond = al) { | 1094 void push(Register src, Condition cond = al) { |
| 1085 str(src, MemOperand(sp, 4, NegPreIndex), cond); | 1095 str(src, MemOperand(sp, 4, NegPreIndex), cond); |
| 1086 } | 1096 } |
| 1087 | 1097 |
| 1088 void pop(Register dst, Condition cond = al) { | 1098 void pop(Register dst, Condition cond = al) { |
| 1089 ldr(dst, MemOperand(sp, 4, PostIndex), cond); | 1099 ldr(dst, MemOperand(sp, 4, PostIndex), cond); |
| 1090 } | 1100 } |
| 1091 | 1101 |
| 1092 void pop() { | 1102 void pop() { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1144 if (!FLAG_peephole_optimization) return false; | 1154 if (!FLAG_peephole_optimization) return false; |
| 1145 if (last_bound_pos_ > pc_offset() - instructions * kInstrSize) return false; | 1155 if (last_bound_pos_ > pc_offset() - instructions * kInstrSize) return false; |
| 1146 return reloc_info_writer.last_pc() <= pc_ - instructions * kInstrSize; | 1156 return reloc_info_writer.last_pc() <= pc_ - instructions * kInstrSize; |
| 1147 } | 1157 } |
| 1148 | 1158 |
| 1149 // Read/patch instructions | 1159 // Read/patch instructions |
| 1150 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } | 1160 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } |
| 1151 static void instr_at_put(byte* pc, Instr instr) { | 1161 static void instr_at_put(byte* pc, Instr instr) { |
| 1152 *reinterpret_cast<Instr*>(pc) = instr; | 1162 *reinterpret_cast<Instr*>(pc) = instr; |
| 1153 } | 1163 } |
| 1154 static bool IsNop(Instr instr, int type = 0); | 1164 static bool IsNop(Instr instr, NopMarkerTypes = NON_MARKING_NOP); |
| 1155 static bool IsBranch(Instr instr); | 1165 static bool IsBranch(Instr instr); |
| 1156 static int GetBranchOffset(Instr instr); | 1166 static int GetBranchOffset(Instr instr); |
| 1157 static bool IsLdrRegisterImmediate(Instr instr); | 1167 static bool IsLdrRegisterImmediate(Instr instr); |
| 1158 static int GetLdrRegisterImmediateOffset(Instr instr); | 1168 static int GetLdrRegisterImmediateOffset(Instr instr); |
| 1159 static Instr SetLdrRegisterImmediateOffset(Instr instr, int offset); | 1169 static Instr SetLdrRegisterImmediateOffset(Instr instr, int offset); |
| 1160 static bool IsStrRegisterImmediate(Instr instr); | 1170 static bool IsStrRegisterImmediate(Instr instr); |
| 1161 static Instr SetStrRegisterImmediateOffset(Instr instr, int offset); | 1171 static Instr SetStrRegisterImmediateOffset(Instr instr, int offset); |
| 1162 static bool IsAddRegisterImmediate(Instr instr); | 1172 static bool IsAddRegisterImmediate(Instr instr); |
| 1163 static Instr SetAddRegisterImmediateOffset(Instr instr, int offset); | 1173 static Instr SetAddRegisterImmediateOffset(Instr instr, int offset); |
| 1164 static Register GetRd(Instr instr); | 1174 static Register GetRd(Instr instr); |
| 1165 static bool IsPush(Instr instr); | 1175 static bool IsPush(Instr instr); |
| 1166 static bool IsPop(Instr instr); | 1176 static bool IsPop(Instr instr); |
| 1167 static bool IsStrRegFpOffset(Instr instr); | 1177 static bool IsStrRegFpOffset(Instr instr); |
| 1168 static bool IsLdrRegFpOffset(Instr instr); | 1178 static bool IsLdrRegFpOffset(Instr instr); |
| 1169 static bool IsStrRegFpNegOffset(Instr instr); | 1179 static bool IsStrRegFpNegOffset(Instr instr); |
| 1170 static bool IsLdrRegFpNegOffset(Instr instr); | 1180 static bool IsLdrRegFpNegOffset(Instr instr); |
| 1181 static bool IsLdrPcImmediateOffset(Instr instr); | |
| 1171 | 1182 |
| 1172 | 1183 |
| 1173 protected: | 1184 protected: |
| 1174 int buffer_space() const { return reloc_info_writer.pos() - pc_; } | 1185 int buffer_space() const { return reloc_info_writer.pos() - pc_; } |
| 1175 | 1186 |
| 1176 // Read/patch instructions | 1187 // Read/patch instructions |
| 1177 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } | 1188 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } |
| 1178 void instr_at_put(int pos, Instr instr) { | 1189 void instr_at_put(int pos, Instr instr) { |
| 1179 *reinterpret_cast<Instr*>(buffer_ + pos) = instr; | 1190 *reinterpret_cast<Instr*>(buffer_ + pos) = instr; |
| 1180 } | 1191 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1310 public: | 1321 public: |
| 1311 explicit EnsureSpace(Assembler* assembler) { | 1322 explicit EnsureSpace(Assembler* assembler) { |
| 1312 assembler->CheckBuffer(); | 1323 assembler->CheckBuffer(); |
| 1313 } | 1324 } |
| 1314 }; | 1325 }; |
| 1315 | 1326 |
| 1316 | 1327 |
| 1317 } } // namespace v8::internal | 1328 } } // namespace v8::internal |
| 1318 | 1329 |
| 1319 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1330 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
| OLD | NEW |