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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
412 bool AddressUsesRegister(Register reg) const; | 412 bool AddressUsesRegister(Register reg) const; |
413 | 413 |
414 // Queries related to the size of the generated instruction. | 414 // Queries related to the size of the generated instruction. |
415 // Whether the generated instruction will have a REX prefix. | 415 // Whether the generated instruction will have a REX prefix. |
416 bool requires_rex() const { return rex_ != 0; } | 416 bool requires_rex() const { return rex_ != 0; } |
417 // Size of the ModR/M, SIB and displacement parts of the generated | 417 // Size of the ModR/M, SIB and displacement parts of the generated |
418 // instruction. | 418 // instruction. |
419 int operand_size() const { return len_; } | 419 int operand_size() const { return len_; } |
420 | 420 |
421 private: | 421 private: |
422 explicit Operand(Register reg); | |
Jakob Kummerow
2013/01/11 17:43:38
On x64 so far, an Operand always means a memory ac
| |
423 | |
422 byte rex_; | 424 byte rex_; |
423 byte buf_[6]; | 425 byte buf_[6]; |
424 // The number of bytes of buf_ in use. | 426 // The number of bytes of buf_ in use. |
425 byte len_; | 427 byte len_; |
426 | 428 |
427 // Set the ModR/M byte without an encoded 'reg' register. The | 429 // Set the ModR/M byte without an encoded 'reg' register. The |
428 // register is encoded later as part of the emit_operand operation. | 430 // register is encoded later as part of the emit_operand operation. |
429 // set_modrm can be called before or after set_sib and set_disp*. | 431 // set_modrm can be called before or after set_sib and set_disp*. |
430 inline void set_modrm(int mod, Register rm); | 432 inline void set_modrm(int mod, Register rm); |
431 | 433 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
725 void movq(Register dst, Handle<Object> handle, RelocInfo::Mode rmode); | 727 void movq(Register dst, Handle<Object> handle, RelocInfo::Mode rmode); |
726 | 728 |
727 void movsxbq(Register dst, const Operand& src); | 729 void movsxbq(Register dst, const Operand& src); |
728 void movsxwq(Register dst, const Operand& src); | 730 void movsxwq(Register dst, const Operand& src); |
729 void movsxlq(Register dst, Register src); | 731 void movsxlq(Register dst, Register src); |
730 void movsxlq(Register dst, const Operand& src); | 732 void movsxlq(Register dst, const Operand& src); |
731 void movzxbq(Register dst, const Operand& src); | 733 void movzxbq(Register dst, const Operand& src); |
732 void movzxbl(Register dst, const Operand& src); | 734 void movzxbl(Register dst, const Operand& src); |
733 void movzxwq(Register dst, const Operand& src); | 735 void movzxwq(Register dst, const Operand& src); |
734 void movzxwl(Register dst, const Operand& src); | 736 void movzxwl(Register dst, const Operand& src); |
737 void movzxwl(Register dst, Register src) { movzxwl(dst, Operand(src)); } | |
735 | 738 |
736 // Repeated moves. | 739 // Repeated moves. |
737 | 740 |
738 void repmovsb(); | 741 void repmovsb(); |
739 void repmovsw(); | 742 void repmovsw(); |
740 void repmovsl(); | 743 void repmovsl(); |
741 void repmovsq(); | 744 void repmovsq(); |
742 | 745 |
743 // Instruction to load from an immediate 64-bit pointer into RAX. | 746 // Instruction to load from an immediate 64-bit pointer into RAX. |
744 void load_rax(void* ptr, RelocInfo::Mode rmode); | 747 void load_rax(void* ptr, RelocInfo::Mode rmode); |
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1667 private: | 1670 private: |
1668 Assembler* assembler_; | 1671 Assembler* assembler_; |
1669 #ifdef DEBUG | 1672 #ifdef DEBUG |
1670 int space_before_; | 1673 int space_before_; |
1671 #endif | 1674 #endif |
1672 }; | 1675 }; |
1673 | 1676 |
1674 } } // namespace v8::internal | 1677 } } // namespace v8::internal |
1675 | 1678 |
1676 #endif // V8_X64_ASSEMBLER_X64_H_ | 1679 #endif // V8_X64_ASSEMBLER_X64_H_ |
OLD | NEW |