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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 // emitted before any use of db and dd to ensure that constant pools | 1202 // emitted before any use of db and dd to ensure that constant pools |
1203 // are not emitted as part of the tables generated. | 1203 // are not emitted as part of the tables generated. |
1204 void db(uint8_t data); | 1204 void db(uint8_t data); |
1205 void dd(uint32_t data); | 1205 void dd(uint32_t data); |
1206 | 1206 |
1207 int pc_offset() const { return pc_ - buffer_; } | 1207 int pc_offset() const { return pc_ - buffer_; } |
1208 | 1208 |
1209 PositionsRecorder* positions_recorder() { return &positions_recorder_; } | 1209 PositionsRecorder* positions_recorder() { return &positions_recorder_; } |
1210 | 1210 |
1211 // Read/patch instructions | 1211 // Read/patch instructions |
| 1212 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } |
| 1213 void instr_at_put(int pos, Instr instr) { |
| 1214 *reinterpret_cast<Instr*>(buffer_ + pos) = instr; |
| 1215 } |
1212 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } | 1216 static Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } |
1213 static void instr_at_put(byte* pc, Instr instr) { | 1217 static void instr_at_put(byte* pc, Instr instr) { |
1214 *reinterpret_cast<Instr*>(pc) = instr; | 1218 *reinterpret_cast<Instr*>(pc) = instr; |
1215 } | 1219 } |
1216 static Condition GetCondition(Instr instr); | 1220 static Condition GetCondition(Instr instr); |
1217 static bool IsBranch(Instr instr); | 1221 static bool IsBranch(Instr instr); |
1218 static int GetBranchOffset(Instr instr); | 1222 static int GetBranchOffset(Instr instr); |
1219 static bool IsLdrRegisterImmediate(Instr instr); | 1223 static bool IsLdrRegisterImmediate(Instr instr); |
1220 static int GetLdrRegisterImmediateOffset(Instr instr); | 1224 static int GetLdrRegisterImmediateOffset(Instr instr); |
1221 static Instr SetLdrRegisterImmediateOffset(Instr instr, int offset); | 1225 static Instr SetLdrRegisterImmediateOffset(Instr instr, int offset); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 protected: | 1260 protected: |
1257 // Relocation for a type-recording IC has the AST id added to it. This | 1261 // Relocation for a type-recording IC has the AST id added to it. This |
1258 // member variable is a way to pass the information from the call site to | 1262 // member variable is a way to pass the information from the call site to |
1259 // the relocation info. | 1263 // the relocation info. |
1260 unsigned recorded_ast_id_; | 1264 unsigned recorded_ast_id_; |
1261 | 1265 |
1262 bool emit_debug_code() const { return emit_debug_code_; } | 1266 bool emit_debug_code() const { return emit_debug_code_; } |
1263 | 1267 |
1264 int buffer_space() const { return reloc_info_writer.pos() - pc_; } | 1268 int buffer_space() const { return reloc_info_writer.pos() - pc_; } |
1265 | 1269 |
1266 // Read/patch instructions | |
1267 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } | |
1268 void instr_at_put(int pos, Instr instr) { | |
1269 *reinterpret_cast<Instr*>(buffer_ + pos) = instr; | |
1270 } | |
1271 | |
1272 // Decode branch instruction at pos and return branch target pos | 1270 // Decode branch instruction at pos and return branch target pos |
1273 int target_at(int pos); | 1271 int target_at(int pos); |
1274 | 1272 |
1275 // Patch branch instruction at pos to branch to given branch target pos | 1273 // Patch branch instruction at pos to branch to given branch target pos |
1276 void target_at_put(int pos, int target_pos); | 1274 void target_at_put(int pos, int target_pos); |
1277 | 1275 |
1278 // Prevent contant pool emission until EndBlockConstPool is called. | 1276 // Prevent contant pool emission until EndBlockConstPool is called. |
1279 // Call to this function can be nested but must be followed by an equal | 1277 // Call to this function can be nested but must be followed by an equal |
1280 // number of call to EndBlockConstpool. | 1278 // number of call to EndBlockConstpool. |
1281 void StartBlockConstPool() { | 1279 void StartBlockConstPool() { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1415 public: | 1413 public: |
1416 explicit EnsureSpace(Assembler* assembler) { | 1414 explicit EnsureSpace(Assembler* assembler) { |
1417 assembler->CheckBuffer(); | 1415 assembler->CheckBuffer(); |
1418 } | 1416 } |
1419 }; | 1417 }; |
1420 | 1418 |
1421 | 1419 |
1422 } } // namespace v8::internal | 1420 } } // namespace v8::internal |
1423 | 1421 |
1424 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1422 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
OLD | NEW |