| 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 // buffer, and buffer_size determines the initial buffer size. The buffer is | 560 // buffer, and buffer_size determines the initial buffer size. The buffer is |
| 561 // owned by the assembler and deallocated upon destruction of the assembler. | 561 // owned by the assembler and deallocated upon destruction of the assembler. |
| 562 // | 562 // |
| 563 // If the provided buffer is not NULL, the assembler uses the provided buffer | 563 // If the provided buffer is not NULL, the assembler uses the provided buffer |
| 564 // for code generation and assumes its size to be buffer_size. If the buffer | 564 // for code generation and assumes its size to be buffer_size. If the buffer |
| 565 // is too small, a fatal error occurs. No deallocation of the buffer is done | 565 // is too small, a fatal error occurs. No deallocation of the buffer is done |
| 566 // upon destruction of the assembler. | 566 // upon destruction of the assembler. |
| 567 Assembler(void* buffer, int buffer_size); | 567 Assembler(void* buffer, int buffer_size); |
| 568 ~Assembler(); | 568 ~Assembler(); |
| 569 | 569 |
| 570 // Overrides the default provided by FLAG_debug_code. |
| 571 void set_emit_debug_code(bool value) { emit_debug_code_ = value; } |
| 572 |
| 570 // GetCode emits any pending (non-emitted) code and fills the descriptor | 573 // GetCode emits any pending (non-emitted) code and fills the descriptor |
| 571 // desc. GetCode() is idempotent; it returns the same result if no other | 574 // desc. GetCode() is idempotent; it returns the same result if no other |
| 572 // Assembler functions are invoked in between GetCode() calls. | 575 // Assembler functions are invoked in between GetCode() calls. |
| 573 void GetCode(CodeDesc* desc); | 576 void GetCode(CodeDesc* desc); |
| 574 | 577 |
| 575 // Label operations & relative jumps (PPUM Appendix D) | 578 // Label operations & relative jumps (PPUM Appendix D) |
| 576 // | 579 // |
| 577 // Takes a branch opcode (cc) and a label (L) and generates | 580 // Takes a branch opcode (cc) and a label (L) and generates |
| 578 // either a backward branch or a forward branch and links it | 581 // either a backward branch or a forward branch and links it |
| 579 // to the label fixup chain. Usage: | 582 // to the label fixup chain. Usage: |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 const Condition cond = al); | 1001 const Condition cond = al); |
| 999 void vcvt_f64_f32(const DwVfpRegister dst, | 1002 void vcvt_f64_f32(const DwVfpRegister dst, |
| 1000 const SwVfpRegister src, | 1003 const SwVfpRegister src, |
| 1001 VFPConversionMode mode = kDefaultRoundToZero, | 1004 VFPConversionMode mode = kDefaultRoundToZero, |
| 1002 const Condition cond = al); | 1005 const Condition cond = al); |
| 1003 void vcvt_f32_f64(const SwVfpRegister dst, | 1006 void vcvt_f32_f64(const SwVfpRegister dst, |
| 1004 const DwVfpRegister src, | 1007 const DwVfpRegister src, |
| 1005 VFPConversionMode mode = kDefaultRoundToZero, | 1008 VFPConversionMode mode = kDefaultRoundToZero, |
| 1006 const Condition cond = al); | 1009 const Condition cond = al); |
| 1007 | 1010 |
| 1011 void vneg(const DwVfpRegister dst, |
| 1012 const DwVfpRegister src, |
| 1013 const Condition cond = al); |
| 1008 void vabs(const DwVfpRegister dst, | 1014 void vabs(const DwVfpRegister dst, |
| 1009 const DwVfpRegister src, | 1015 const DwVfpRegister src, |
| 1010 const Condition cond = al); | 1016 const Condition cond = al); |
| 1011 void vadd(const DwVfpRegister dst, | 1017 void vadd(const DwVfpRegister dst, |
| 1012 const DwVfpRegister src1, | 1018 const DwVfpRegister src1, |
| 1013 const DwVfpRegister src2, | 1019 const DwVfpRegister src2, |
| 1014 const Condition cond = al); | 1020 const Condition cond = al); |
| 1015 void vsub(const DwVfpRegister dst, | 1021 void vsub(const DwVfpRegister dst, |
| 1016 const DwVfpRegister src1, | 1022 const DwVfpRegister src1, |
| 1017 const DwVfpRegister src2, | 1023 const DwVfpRegister src2, |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 static bool IsCmpRegister(Instr instr); | 1163 static bool IsCmpRegister(Instr instr); |
| 1158 static bool IsCmpImmediate(Instr instr); | 1164 static bool IsCmpImmediate(Instr instr); |
| 1159 static Register GetCmpImmediateRegister(Instr instr); | 1165 static Register GetCmpImmediateRegister(Instr instr); |
| 1160 static int GetCmpImmediateRawImmediate(Instr instr); | 1166 static int GetCmpImmediateRawImmediate(Instr instr); |
| 1161 static bool IsNop(Instr instr, int type = NON_MARKING_NOP); | 1167 static bool IsNop(Instr instr, int type = NON_MARKING_NOP); |
| 1162 | 1168 |
| 1163 // Check if is time to emit a constant pool for pending reloc info entries | 1169 // Check if is time to emit a constant pool for pending reloc info entries |
| 1164 void CheckConstPool(bool force_emit, bool require_jump); | 1170 void CheckConstPool(bool force_emit, bool require_jump); |
| 1165 | 1171 |
| 1166 protected: | 1172 protected: |
| 1173 bool emit_debug_code() const { return emit_debug_code_; } |
| 1174 |
| 1167 int buffer_space() const { return reloc_info_writer.pos() - pc_; } | 1175 int buffer_space() const { return reloc_info_writer.pos() - pc_; } |
| 1168 | 1176 |
| 1169 // Read/patch instructions | 1177 // Read/patch instructions |
| 1170 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } | 1178 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } |
| 1171 void instr_at_put(int pos, Instr instr) { | 1179 void instr_at_put(int pos, Instr instr) { |
| 1172 *reinterpret_cast<Instr*>(buffer_ + pos) = instr; | 1180 *reinterpret_cast<Instr*>(buffer_ + pos) = instr; |
| 1173 } | 1181 } |
| 1174 | 1182 |
| 1175 // Decode branch instruction at pos and return branch target pos | 1183 // Decode branch instruction at pos and return branch target pos |
| 1176 int target_at(int pos); | 1184 int target_at(int pos); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 // Record reloc info for current pc_ | 1293 // Record reloc info for current pc_ |
| 1286 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); | 1294 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); |
| 1287 | 1295 |
| 1288 friend class RegExpMacroAssemblerARM; | 1296 friend class RegExpMacroAssemblerARM; |
| 1289 friend class RelocInfo; | 1297 friend class RelocInfo; |
| 1290 friend class CodePatcher; | 1298 friend class CodePatcher; |
| 1291 friend class BlockConstPoolScope; | 1299 friend class BlockConstPoolScope; |
| 1292 | 1300 |
| 1293 PositionsRecorder positions_recorder_; | 1301 PositionsRecorder positions_recorder_; |
| 1294 bool allow_peephole_optimization_; | 1302 bool allow_peephole_optimization_; |
| 1303 bool emit_debug_code_; |
| 1295 friend class PositionsRecorder; | 1304 friend class PositionsRecorder; |
| 1296 friend class EnsureSpace; | 1305 friend class EnsureSpace; |
| 1297 }; | 1306 }; |
| 1298 | 1307 |
| 1299 | 1308 |
| 1300 class EnsureSpace BASE_EMBEDDED { | 1309 class EnsureSpace BASE_EMBEDDED { |
| 1301 public: | 1310 public: |
| 1302 explicit EnsureSpace(Assembler* assembler) { | 1311 explicit EnsureSpace(Assembler* assembler) { |
| 1303 assembler->CheckBuffer(); | 1312 assembler->CheckBuffer(); |
| 1304 } | 1313 } |
| 1305 }; | 1314 }; |
| 1306 | 1315 |
| 1307 | 1316 |
| 1308 } } // namespace v8::internal | 1317 } } // namespace v8::internal |
| 1309 | 1318 |
| 1310 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1319 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
| OLD | NEW |