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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 504 static unsigned found_by_runtime_probing_; | 504 static unsigned found_by_runtime_probing_; |
| 505 }; | 505 }; |
| 506 | 506 |
| 507 | 507 |
| 508 typedef int32_t Instr; | 508 typedef int32_t Instr; |
| 509 | 509 |
| 510 | 510 |
| 511 extern const Instr kMovLrPc; | 511 extern const Instr kMovLrPc; |
| 512 extern const Instr kLdrPCMask; | 512 extern const Instr kLdrPCMask; |
| 513 extern const Instr kLdrPCPattern; | 513 extern const Instr kLdrPCPattern; |
| 514 extern const Instr kLdrMask; | |
| 515 extern const Instr kLdrPattern; | |
| 516 extern const Instr kMovwMovtMask; | |
| 517 extern const Instr kMovwPattern; | |
| 518 extern const Instr kMovtPattern; | |
| 514 extern const Instr kBlxRegMask; | 519 extern const Instr kBlxRegMask; |
| 515 extern const Instr kBlxRegPattern; | 520 extern const Instr kBlxRegPattern; |
| 516 | 521 |
| 517 | 522 |
| 518 class Assembler : public Malloced { | 523 class Assembler : public Malloced { |
| 519 public: | 524 public: |
| 520 // Create an assembler. Instructions and relocation information are emitted | 525 // Create an assembler. Instructions and relocation information are emitted |
| 521 // into a buffer, with the instructions starting from the beginning and the | 526 // into a buffer, with the instructions starting from the beginning and the |
| 522 // relocation information starting from the end of the buffer. See CodeDesc | 527 // relocation information starting from the end of the buffer. See CodeDesc |
| 523 // for a detailed comment on the layout (globals.h). | 528 // for a detailed comment on the layout (globals.h). |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 563 // Puts a labels target address at the given position. | 568 // Puts a labels target address at the given position. |
| 564 // The high 8 bits are set to zero. | 569 // The high 8 bits are set to zero. |
| 565 void label_at_put(Label* L, int at_offset); | 570 void label_at_put(Label* L, int at_offset); |
| 566 | 571 |
| 567 // Return the address in the constant pool of the code target address used by | 572 // Return the address in the constant pool of the code target address used by |
| 568 // the branch/call instruction at pc. | 573 // the branch/call instruction at pc. |
| 569 INLINE(static Address target_address_address_at(Address pc)); | 574 INLINE(static Address target_address_address_at(Address pc)); |
| 570 | 575 |
| 571 // Read/Modify the code target address in the branch/call instruction at pc. | 576 // Read/Modify the code target address in the branch/call instruction at pc. |
| 572 INLINE(static Address target_address_at(Address pc)); | 577 INLINE(static Address target_address_at(Address pc)); |
| 573 INLINE(static void set_target_address_at(Address pc, Address target)); | 578 INLINE(static void set_target_address_at(Address pc, Address target, |
| 579 bool need_icache_flush = true)); | |
| 574 | 580 |
| 575 // This sets the branch destination (which is in the constant pool on ARM). | 581 // This sets the branch destination (which is in the constant pool on ARM). |
| 576 // This is for calls and branches within generated code. | 582 // This is for calls and branches within generated code. |
| 577 inline static void set_target_at(Address constant_pool_entry, Address target); | 583 inline static void set_target_at(Address constant_pool_entry, Address target); |
| 578 | 584 |
| 579 // This sets the branch destination (which is in the constant pool on ARM). | 585 // This sets the branch destination (which is in the constant pool on ARM). |
| 580 // This is for calls and branches to runtime code. | 586 // This is for calls and branches to runtime code. |
| 581 inline static void set_external_target_at(Address constant_pool_entry, | 587 inline static void set_external_target_at(Address constant_pool_entry, |
| 582 Address target) { | 588 Address target) { |
| 583 set_target_at(constant_pool_entry, target); | 589 set_target_at(constant_pool_entry, target); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 699 void cmn(Register src1, const Operand& src2, Condition cond = al); | 705 void cmn(Register src1, const Operand& src2, Condition cond = al); |
| 700 | 706 |
| 701 void orr(Register dst, Register src1, const Operand& src2, | 707 void orr(Register dst, Register src1, const Operand& src2, |
| 702 SBit s = LeaveCC, Condition cond = al); | 708 SBit s = LeaveCC, Condition cond = al); |
| 703 void orr(Register dst, Register src1, Register src2, | 709 void orr(Register dst, Register src1, Register src2, |
| 704 SBit s = LeaveCC, Condition cond = al) { | 710 SBit s = LeaveCC, Condition cond = al) { |
| 705 orr(dst, src1, Operand(src2), s, cond); | 711 orr(dst, src1, Operand(src2), s, cond); |
| 706 } | 712 } |
| 707 | 713 |
| 708 void mov(Register dst, const Operand& src, | 714 void mov(Register dst, const Operand& src, |
| 709 SBit s = LeaveCC, Condition cond = al); | 715 SBit s = LeaveCC, Condition cond = al, bool use_movw_movt = true); |
|
Erik Corry
2010/05/03 10:06:28
Having bool arguments makes the code unreadable at
| |
| 710 void mov(Register dst, Register src, SBit s = LeaveCC, Condition cond = al) { | 716 void mov(Register dst, Register src, SBit s = LeaveCC, Condition cond = al) { |
| 711 mov(dst, Operand(src), s, cond); | 717 mov(dst, Operand(src), s, cond); |
| 712 } | 718 } |
| 713 | 719 |
| 720 void movt(Register dst, const Operand& src, Condition cond = al); | |
| 721 void movw(Register dst, const Operand& src, Condition cond = al); | |
| 722 | |
| 714 void bic(Register dst, Register src1, const Operand& src2, | 723 void bic(Register dst, Register src1, const Operand& src2, |
| 715 SBit s = LeaveCC, Condition cond = al); | 724 SBit s = LeaveCC, Condition cond = al); |
| 716 | 725 |
| 717 void mvn(Register dst, const Operand& src, | 726 void mvn(Register dst, const Operand& src, |
| 718 SBit s = LeaveCC, Condition cond = al); | 727 SBit s = LeaveCC, Condition cond = al); |
| 719 | 728 |
| 720 // Multiply instructions | 729 // Multiply instructions |
| 721 | 730 |
| 722 void mla(Register dst, Register src1, Register src2, Register srcA, | 731 void mla(Register dst, Register src1, Register src2, Register srcA, |
| 723 SBit s = LeaveCC, Condition cond = al); | 732 SBit s = LeaveCC, Condition cond = al); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1050 int current_statement_position_; | 1059 int current_statement_position_; |
| 1051 int written_position_; | 1060 int written_position_; |
| 1052 int written_statement_position_; | 1061 int written_statement_position_; |
| 1053 | 1062 |
| 1054 // Code emission | 1063 // Code emission |
| 1055 inline void CheckBuffer(); | 1064 inline void CheckBuffer(); |
| 1056 void GrowBuffer(); | 1065 void GrowBuffer(); |
| 1057 inline void emit(Instr x); | 1066 inline void emit(Instr x); |
| 1058 | 1067 |
| 1059 // Instruction generation | 1068 // Instruction generation |
| 1060 void addrmod1(Instr instr, Register rn, Register rd, const Operand& x); | 1069 void addrmod1(Instr instr, Register rn, Register rd, |
| 1070 const Operand& x, bool use_movw_movt = true); | |
| 1061 void addrmod2(Instr instr, Register rd, const MemOperand& x); | 1071 void addrmod2(Instr instr, Register rd, const MemOperand& x); |
| 1062 void addrmod3(Instr instr, Register rd, const MemOperand& x); | 1072 void addrmod3(Instr instr, Register rd, const MemOperand& x); |
| 1063 void addrmod4(Instr instr, Register rn, RegList rl); | 1073 void addrmod4(Instr instr, Register rn, RegList rl); |
| 1064 void addrmod5(Instr instr, CRegister crd, const MemOperand& x); | 1074 void addrmod5(Instr instr, CRegister crd, const MemOperand& x); |
| 1065 | 1075 |
| 1066 // Labels | 1076 // Labels |
| 1067 void print(Label* L); | 1077 void print(Label* L); |
| 1068 void bind_to(Label* L, int pos); | 1078 void bind_to(Label* L, int pos); |
| 1069 void link_to(Label* L, Label* appendix); | 1079 void link_to(Label* L, Label* appendix); |
| 1070 void next(Label* L); | 1080 void next(Label* L); |
| 1071 | 1081 |
| 1072 // Record reloc info for current pc_ | 1082 // Record reloc info for current pc_ |
| 1073 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); | 1083 void RecordRelocInfo(RelocInfo::Mode rmode, |
| 1084 intptr_t data = 0, | |
| 1085 bool with_const_pool = true); | |
|
Erik Corry
2010/05/03 10:06:28
Also here the bool argument makes code unreadble a
| |
| 1074 | 1086 |
| 1075 friend class RegExpMacroAssemblerARM; | 1087 friend class RegExpMacroAssemblerARM; |
| 1076 friend class RelocInfo; | 1088 friend class RelocInfo; |
| 1077 friend class CodePatcher; | 1089 friend class CodePatcher; |
| 1078 }; | 1090 }; |
| 1079 | 1091 |
| 1080 } } // namespace v8::internal | 1092 } } // namespace v8::internal |
| 1081 | 1093 |
| 1082 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1094 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
| OLD | NEW |