Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Side by Side Diff: src/arm/assembler-arm.h

Issue 6697023: Merge 6800:7180 from the bleeding edge branch to the experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/arguments.h ('k') | src/arm/assembler-arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 const SwVfpRegister s23 = { 23 }; 277 const SwVfpRegister s23 = { 23 };
278 const SwVfpRegister s24 = { 24 }; 278 const SwVfpRegister s24 = { 24 };
279 const SwVfpRegister s25 = { 25 }; 279 const SwVfpRegister s25 = { 25 };
280 const SwVfpRegister s26 = { 26 }; 280 const SwVfpRegister s26 = { 26 };
281 const SwVfpRegister s27 = { 27 }; 281 const SwVfpRegister s27 = { 27 };
282 const SwVfpRegister s28 = { 28 }; 282 const SwVfpRegister s28 = { 28 };
283 const SwVfpRegister s29 = { 29 }; 283 const SwVfpRegister s29 = { 29 };
284 const SwVfpRegister s30 = { 30 }; 284 const SwVfpRegister s30 = { 30 };
285 const SwVfpRegister s31 = { 31 }; 285 const SwVfpRegister s31 = { 31 };
286 286
287 const DwVfpRegister no_dreg = { -1 };
287 const DwVfpRegister d0 = { 0 }; 288 const DwVfpRegister d0 = { 0 };
288 const DwVfpRegister d1 = { 1 }; 289 const DwVfpRegister d1 = { 1 };
289 const DwVfpRegister d2 = { 2 }; 290 const DwVfpRegister d2 = { 2 };
290 const DwVfpRegister d3 = { 3 }; 291 const DwVfpRegister d3 = { 3 };
291 const DwVfpRegister d4 = { 4 }; 292 const DwVfpRegister d4 = { 4 };
292 const DwVfpRegister d5 = { 5 }; 293 const DwVfpRegister d5 = { 5 };
293 const DwVfpRegister d6 = { 6 }; 294 const DwVfpRegister d6 = { 6 };
294 const DwVfpRegister d7 = { 7 }; 295 const DwVfpRegister d7 = { 7 };
295 const DwVfpRegister d8 = { 8 }; 296 const DwVfpRegister d8 = { 8 };
296 const DwVfpRegister d9 = { 9 }; 297 const DwVfpRegister d9 = { 9 };
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 381
381 // rm <shift_op> shift_imm 382 // rm <shift_op> shift_imm
382 explicit Operand(Register rm, ShiftOp shift_op, int shift_imm); 383 explicit Operand(Register rm, ShiftOp shift_op, int shift_imm);
383 384
384 // rm <shift_op> rs 385 // rm <shift_op> rs
385 explicit Operand(Register rm, ShiftOp shift_op, Register rs); 386 explicit Operand(Register rm, ShiftOp shift_op, Register rs);
386 387
387 // Return true if this is a register operand. 388 // Return true if this is a register operand.
388 INLINE(bool is_reg() const); 389 INLINE(bool is_reg() const);
389 390
390 // Return true of this operand fits in one instruction so that no 391 // Return true if this operand fits in one instruction so that no
391 // 2-instruction solution with a load into the ip register is necessary. 392 // 2-instruction solution with a load into the ip register is necessary. If
392 bool is_single_instruction() const; 393 // the instruction this operand is used for is a MOV or MVN instruction the
394 // actual instruction to use is required for this calculation. For other
395 // instructions instr is ignored.
396 bool is_single_instruction(Instr instr = 0) const;
393 bool must_use_constant_pool() const; 397 bool must_use_constant_pool() const;
394 398
395 inline int32_t immediate() const { 399 inline int32_t immediate() const {
396 ASSERT(!rm_.is_valid()); 400 ASSERT(!rm_.is_valid());
397 return imm32_; 401 return imm32_;
398 } 402 }
399 403
400 Register rm() const { return rm_; } 404 Register rm() const { return rm_; }
401 Register rs() const { return rs_; } 405 Register rs() const { return rs_; }
402 ShiftOp shift_op() const { return shift_op_; } 406 ShiftOp shift_op() const { return shift_op_; }
(...skipping 29 matching lines...) Expand all
432 // [rn +/- rm <shift_op> shift_imm]! PreIndex/NegPreIndex 436 // [rn +/- rm <shift_op> shift_imm]! PreIndex/NegPreIndex
433 // [rn], +/- rm <shift_op> shift_imm PostIndex/NegPostIndex 437 // [rn], +/- rm <shift_op> shift_imm PostIndex/NegPostIndex
434 explicit MemOperand(Register rn, Register rm, 438 explicit MemOperand(Register rn, Register rm,
435 ShiftOp shift_op, int shift_imm, AddrMode am = Offset); 439 ShiftOp shift_op, int shift_imm, AddrMode am = Offset);
436 440
437 void set_offset(int32_t offset) { 441 void set_offset(int32_t offset) {
438 ASSERT(rm_.is(no_reg)); 442 ASSERT(rm_.is(no_reg));
439 offset_ = offset; 443 offset_ = offset;
440 } 444 }
441 445
442 uint32_t offset() { 446 uint32_t offset() const {
443 ASSERT(rm_.is(no_reg)); 447 ASSERT(rm_.is(no_reg));
444 return offset_; 448 return offset_;
445 } 449 }
446 450
447 Register rn() const { return rn_; } 451 Register rn() const { return rn_; }
448 Register rm() const { return rm_; } 452 Register rm() const { return rm_; }
449 453
454 bool OffsetIsUint12Encodable() const {
455 return offset_ >= 0 ? is_uint12(offset_) : is_uint12(-offset_);
456 }
457
450 private: 458 private:
451 Register rn_; // base 459 Register rn_; // base
452 Register rm_; // register offset 460 Register rm_; // register offset
453 int32_t offset_; // valid if rm_ == no_reg 461 int32_t offset_; // valid if rm_ == no_reg
454 ShiftOp shift_op_; 462 ShiftOp shift_op_;
455 int shift_imm_; // valid if rm_ != no_reg && rs_ == no_reg 463 int shift_imm_; // valid if rm_ != no_reg && rs_ == no_reg
456 AddrMode am_; // bits P, U, and W 464 AddrMode am_; // bits P, U, and W
457 465
458 friend class Assembler; 466 friend class Assembler;
459 }; 467 };
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 // buffer, and buffer_size determines the initial buffer size. The buffer is 547 // buffer, and buffer_size determines the initial buffer size. The buffer is
540 // owned by the assembler and deallocated upon destruction of the assembler. 548 // owned by the assembler and deallocated upon destruction of the assembler.
541 // 549 //
542 // If the provided buffer is not NULL, the assembler uses the provided buffer 550 // If the provided buffer is not NULL, the assembler uses the provided buffer
543 // for code generation and assumes its size to be buffer_size. If the buffer 551 // for code generation and assumes its size to be buffer_size. If the buffer
544 // is too small, a fatal error occurs. No deallocation of the buffer is done 552 // is too small, a fatal error occurs. No deallocation of the buffer is done
545 // upon destruction of the assembler. 553 // upon destruction of the assembler.
546 Assembler(void* buffer, int buffer_size); 554 Assembler(void* buffer, int buffer_size);
547 ~Assembler(); 555 ~Assembler();
548 556
557 // Overrides the default provided by FLAG_debug_code.
558 void set_emit_debug_code(bool value) { emit_debug_code_ = value; }
559
549 // GetCode emits any pending (non-emitted) code and fills the descriptor 560 // GetCode emits any pending (non-emitted) code and fills the descriptor
550 // desc. GetCode() is idempotent; it returns the same result if no other 561 // desc. GetCode() is idempotent; it returns the same result if no other
551 // Assembler functions are invoked in between GetCode() calls. 562 // Assembler functions are invoked in between GetCode() calls.
552 void GetCode(CodeDesc* desc); 563 void GetCode(CodeDesc* desc);
553 564
554 // Label operations & relative jumps (PPUM Appendix D) 565 // Label operations & relative jumps (PPUM Appendix D)
555 // 566 //
556 // Takes a branch opcode (cc) and a label (L) and generates 567 // Takes a branch opcode (cc) and a label (L) and generates
557 // either a backward branch or a forward branch and links it 568 // either a backward branch or a forward branch and links it
558 // to the label fixup chain. Usage: 569 // to the label fixup chain. Usage:
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 LFlag l = Short); // v5 and above 906 LFlag l = Short); // v5 and above
896 907
897 // Support for VFP. 908 // Support for VFP.
898 // All these APIs support S0 to S31 and D0 to D15. 909 // All these APIs support S0 to S31 and D0 to D15.
899 // Currently these APIs do not support extended D registers, i.e, D16 to D31. 910 // Currently these APIs do not support extended D registers, i.e, D16 to D31.
900 // However, some simple modifications can allow 911 // However, some simple modifications can allow
901 // these APIs to support D16 to D31. 912 // these APIs to support D16 to D31.
902 913
903 void vldr(const DwVfpRegister dst, 914 void vldr(const DwVfpRegister dst,
904 const Register base, 915 const Register base,
905 int offset, // Offset must be a multiple of 4. 916 int offset,
917 const Condition cond = al);
918 void vldr(const DwVfpRegister dst,
919 const MemOperand& src,
906 const Condition cond = al); 920 const Condition cond = al);
907 921
908 void vldr(const SwVfpRegister dst, 922 void vldr(const SwVfpRegister dst,
909 const Register base, 923 const Register base,
910 int offset, // Offset must be a multiple of 4. 924 int offset,
925 const Condition cond = al);
926 void vldr(const SwVfpRegister dst,
927 const MemOperand& src,
911 const Condition cond = al); 928 const Condition cond = al);
912 929
913 void vstr(const DwVfpRegister src, 930 void vstr(const DwVfpRegister src,
914 const Register base, 931 const Register base,
915 int offset, // Offset must be a multiple of 4. 932 int offset,
933 const Condition cond = al);
934 void vstr(const DwVfpRegister src,
935 const MemOperand& dst,
916 const Condition cond = al); 936 const Condition cond = al);
917 937
918 void vstr(const SwVfpRegister src, 938 void vstr(const SwVfpRegister src,
919 const Register base, 939 const Register base,
920 int offset, // Offset must be a multiple of 4. 940 int offset,
941 const Condition cond = al);
942 void vstr(const SwVfpRegister src,
943 const MemOperand& dst,
921 const Condition cond = al); 944 const Condition cond = al);
922 945
923 void vmov(const DwVfpRegister dst, 946 void vmov(const DwVfpRegister dst,
924 double imm, 947 double imm,
925 const Condition cond = al); 948 const Condition cond = al);
926 void vmov(const SwVfpRegister dst, 949 void vmov(const SwVfpRegister dst,
927 const SwVfpRegister src, 950 const SwVfpRegister src,
928 const Condition cond = al); 951 const Condition cond = al);
929 void vmov(const DwVfpRegister dst, 952 void vmov(const DwVfpRegister dst,
930 const DwVfpRegister src, 953 const DwVfpRegister src,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 const Condition cond = al); 988 const Condition cond = al);
966 void vcvt_f64_f32(const DwVfpRegister dst, 989 void vcvt_f64_f32(const DwVfpRegister dst,
967 const SwVfpRegister src, 990 const SwVfpRegister src,
968 VFPConversionMode mode = kDefaultRoundToZero, 991 VFPConversionMode mode = kDefaultRoundToZero,
969 const Condition cond = al); 992 const Condition cond = al);
970 void vcvt_f32_f64(const SwVfpRegister dst, 993 void vcvt_f32_f64(const SwVfpRegister dst,
971 const DwVfpRegister src, 994 const DwVfpRegister src,
972 VFPConversionMode mode = kDefaultRoundToZero, 995 VFPConversionMode mode = kDefaultRoundToZero,
973 const Condition cond = al); 996 const Condition cond = al);
974 997
998 void vneg(const DwVfpRegister dst,
999 const DwVfpRegister src,
1000 const Condition cond = al);
975 void vabs(const DwVfpRegister dst, 1001 void vabs(const DwVfpRegister dst,
976 const DwVfpRegister src, 1002 const DwVfpRegister src,
977 const Condition cond = al); 1003 const Condition cond = al);
978 void vadd(const DwVfpRegister dst, 1004 void vadd(const DwVfpRegister dst,
979 const DwVfpRegister src1, 1005 const DwVfpRegister src1,
980 const DwVfpRegister src2, 1006 const DwVfpRegister src2,
981 const Condition cond = al); 1007 const Condition cond = al);
982 void vsub(const DwVfpRegister dst, 1008 void vsub(const DwVfpRegister dst,
983 const DwVfpRegister src1, 1009 const DwVfpRegister src1,
984 const DwVfpRegister src2, 1010 const DwVfpRegister src2,
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 static bool IsCmpRegister(Instr instr); 1150 static bool IsCmpRegister(Instr instr);
1125 static bool IsCmpImmediate(Instr instr); 1151 static bool IsCmpImmediate(Instr instr);
1126 static Register GetCmpImmediateRegister(Instr instr); 1152 static Register GetCmpImmediateRegister(Instr instr);
1127 static int GetCmpImmediateRawImmediate(Instr instr); 1153 static int GetCmpImmediateRawImmediate(Instr instr);
1128 static bool IsNop(Instr instr, int type = NON_MARKING_NOP); 1154 static bool IsNop(Instr instr, int type = NON_MARKING_NOP);
1129 1155
1130 // Check if is time to emit a constant pool for pending reloc info entries 1156 // Check if is time to emit a constant pool for pending reloc info entries
1131 void CheckConstPool(bool force_emit, bool require_jump); 1157 void CheckConstPool(bool force_emit, bool require_jump);
1132 1158
1133 protected: 1159 protected:
1160 bool emit_debug_code() const { return emit_debug_code_; }
1161
1134 int buffer_space() const { return reloc_info_writer.pos() - pc_; } 1162 int buffer_space() const { return reloc_info_writer.pos() - pc_; }
1135 1163
1136 // Read/patch instructions 1164 // Read/patch instructions
1137 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } 1165 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); }
1138 void instr_at_put(int pos, Instr instr) { 1166 void instr_at_put(int pos, Instr instr) {
1139 *reinterpret_cast<Instr*>(buffer_ + pos) = instr; 1167 *reinterpret_cast<Instr*>(buffer_ + pos) = instr;
1140 } 1168 }
1141 1169
1142 // Decode branch instruction at pos and return branch target pos 1170 // Decode branch instruction at pos and return branch target pos
1143 int target_at(int pos); 1171 int target_at(int pos);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 // Record reloc info for current pc_ 1280 // Record reloc info for current pc_
1253 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); 1281 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0);
1254 1282
1255 friend class RegExpMacroAssemblerARM; 1283 friend class RegExpMacroAssemblerARM;
1256 friend class RelocInfo; 1284 friend class RelocInfo;
1257 friend class CodePatcher; 1285 friend class CodePatcher;
1258 friend class BlockConstPoolScope; 1286 friend class BlockConstPoolScope;
1259 1287
1260 PositionsRecorder positions_recorder_; 1288 PositionsRecorder positions_recorder_;
1261 bool allow_peephole_optimization_; 1289 bool allow_peephole_optimization_;
1290 bool emit_debug_code_;
1262 friend class PositionsRecorder; 1291 friend class PositionsRecorder;
1263 friend class EnsureSpace; 1292 friend class EnsureSpace;
1264 }; 1293 };
1265 1294
1266 1295
1267 class EnsureSpace BASE_EMBEDDED { 1296 class EnsureSpace BASE_EMBEDDED {
1268 public: 1297 public:
1269 explicit EnsureSpace(Assembler* assembler) { 1298 explicit EnsureSpace(Assembler* assembler) {
1270 assembler->CheckBuffer(); 1299 assembler->CheckBuffer();
1271 } 1300 }
1272 }; 1301 };
1273 1302
1274 1303
1275 } } // namespace v8::internal 1304 } } // namespace v8::internal
1276 1305
1277 #endif // V8_ARM_ASSEMBLER_ARM_H_ 1306 #endif // V8_ARM_ASSEMBLER_ARM_H_
OLDNEW
« no previous file with comments | « src/arguments.h ('k') | src/arm/assembler-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698