| 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 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 void BlockConstPoolFor(int instructions); | 1159 void BlockConstPoolFor(int instructions); |
| 1160 | 1160 |
| 1161 // Debugging | 1161 // Debugging |
| 1162 | 1162 |
| 1163 // Mark address of the ExitJSFrame code. | 1163 // Mark address of the ExitJSFrame code. |
| 1164 void RecordJSReturn(); | 1164 void RecordJSReturn(); |
| 1165 | 1165 |
| 1166 // Mark address of a debug break slot. | 1166 // Mark address of a debug break slot. |
| 1167 void RecordDebugBreakSlot(); | 1167 void RecordDebugBreakSlot(); |
| 1168 | 1168 |
| 1169 // Record the AST id of the CallIC being compiled, so that it can be placed |
| 1170 // in the relocation information. |
| 1171 void RecordAstId(unsigned ast_id) { ast_id_for_reloc_info_ = ast_id; } |
| 1172 |
| 1169 // Record a comment relocation entry that can be used by a disassembler. | 1173 // Record a comment relocation entry that can be used by a disassembler. |
| 1170 // Use --code-comments to enable. | 1174 // Use --code-comments to enable. |
| 1171 void RecordComment(const char* msg); | 1175 void RecordComment(const char* msg); |
| 1172 | 1176 |
| 1173 // Writes a single byte or word of data in the code stream. Used | 1177 // Writes a single byte or word of data in the code stream. Used |
| 1174 // for inline tables, e.g., jump-tables. The constant pool should be | 1178 // for inline tables, e.g., jump-tables. The constant pool should be |
| 1175 // emitted before any use of db and dd to ensure that constant pools | 1179 // emitted before any use of db and dd to ensure that constant pools |
| 1176 // are not emitted as part of the tables generated. | 1180 // are not emitted as part of the tables generated. |
| 1177 void db(uint8_t data); | 1181 void db(uint8_t data); |
| 1178 void dd(uint32_t data); | 1182 void dd(uint32_t data); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 static bool IsCmpRegister(Instr instr); | 1220 static bool IsCmpRegister(Instr instr); |
| 1217 static bool IsCmpImmediate(Instr instr); | 1221 static bool IsCmpImmediate(Instr instr); |
| 1218 static Register GetCmpImmediateRegister(Instr instr); | 1222 static Register GetCmpImmediateRegister(Instr instr); |
| 1219 static int GetCmpImmediateRawImmediate(Instr instr); | 1223 static int GetCmpImmediateRawImmediate(Instr instr); |
| 1220 static bool IsNop(Instr instr, int type = NON_MARKING_NOP); | 1224 static bool IsNop(Instr instr, int type = NON_MARKING_NOP); |
| 1221 | 1225 |
| 1222 // Check if is time to emit a constant pool for pending reloc info entries | 1226 // Check if is time to emit a constant pool for pending reloc info entries |
| 1223 void CheckConstPool(bool force_emit, bool require_jump); | 1227 void CheckConstPool(bool force_emit, bool require_jump); |
| 1224 | 1228 |
| 1225 protected: | 1229 protected: |
| 1230 // Relocation for a type-recording IC has the AST id added to it. This |
| 1231 // member variable is a way to pass the information from the call site to |
| 1232 // the relocation info. |
| 1233 unsigned ast_id_for_reloc_info_; |
| 1234 |
| 1226 bool emit_debug_code() const { return emit_debug_code_; } | 1235 bool emit_debug_code() const { return emit_debug_code_; } |
| 1227 | 1236 |
| 1228 int buffer_space() const { return reloc_info_writer.pos() - pc_; } | 1237 int buffer_space() const { return reloc_info_writer.pos() - pc_; } |
| 1229 | 1238 |
| 1230 // Read/patch instructions | 1239 // Read/patch instructions |
| 1231 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } | 1240 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } |
| 1232 void instr_at_put(int pos, Instr instr) { | 1241 void instr_at_put(int pos, Instr instr) { |
| 1233 *reinterpret_cast<Instr*>(buffer_ + pos) = instr; | 1242 *reinterpret_cast<Instr*>(buffer_ + pos) = instr; |
| 1234 } | 1243 } |
| 1235 | 1244 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1315 // Relocation info records are also used during code generation as temporary | 1324 // Relocation info records are also used during code generation as temporary |
| 1316 // containers for constants and code target addresses until they are emitted | 1325 // containers for constants and code target addresses until they are emitted |
| 1317 // to the constant pool. These pending relocation info records are temporarily | 1326 // to the constant pool. These pending relocation info records are temporarily |
| 1318 // stored in a separate buffer until a constant pool is emitted. | 1327 // stored in a separate buffer until a constant pool is emitted. |
| 1319 // If every instruction in a long sequence is accessing the pool, we need one | 1328 // If every instruction in a long sequence is accessing the pool, we need one |
| 1320 // pending relocation entry per instruction. | 1329 // pending relocation entry per instruction. |
| 1321 static const int kMaxNumPRInfo = kMaxDistBetweenPools/kInstrSize; | 1330 static const int kMaxNumPRInfo = kMaxDistBetweenPools/kInstrSize; |
| 1322 RelocInfo prinfo_[kMaxNumPRInfo]; // the buffer of pending relocation info | 1331 RelocInfo prinfo_[kMaxNumPRInfo]; // the buffer of pending relocation info |
| 1323 int num_prinfo_; // number of pending reloc info entries in the buffer | 1332 int num_prinfo_; // number of pending reloc info entries in the buffer |
| 1324 | 1333 |
| 1334 |
| 1325 // The bound position, before this we cannot do instruction elimination. | 1335 // The bound position, before this we cannot do instruction elimination. |
| 1326 int last_bound_pos_; | 1336 int last_bound_pos_; |
| 1327 | 1337 |
| 1328 // Code emission | 1338 // Code emission |
| 1329 inline void CheckBuffer(); | 1339 inline void CheckBuffer(); |
| 1330 void GrowBuffer(); | 1340 void GrowBuffer(); |
| 1331 inline void emit(Instr x); | 1341 inline void emit(Instr x); |
| 1332 | 1342 |
| 1333 // Instruction generation | 1343 // Instruction generation |
| 1334 void addrmod1(Instr instr, Register rn, Register rd, const Operand& x); | 1344 void addrmod1(Instr instr, Register rn, Register rd, const Operand& x); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1363 public: | 1373 public: |
| 1364 explicit EnsureSpace(Assembler* assembler) { | 1374 explicit EnsureSpace(Assembler* assembler) { |
| 1365 assembler->CheckBuffer(); | 1375 assembler->CheckBuffer(); |
| 1366 } | 1376 } |
| 1367 }; | 1377 }; |
| 1368 | 1378 |
| 1369 | 1379 |
| 1370 } } // namespace v8::internal | 1380 } } // namespace v8::internal |
| 1371 | 1381 |
| 1372 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1382 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
| OLD | NEW |