| 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 void pushfd(); | 437 void pushfd(); |
| 438 void popfd(); | 438 void popfd(); |
| 439 | 439 |
| 440 void push(const Immediate& x); | 440 void push(const Immediate& x); |
| 441 void push(Register src); | 441 void push(Register src); |
| 442 void push(const Operand& src); | 442 void push(const Operand& src); |
| 443 | 443 |
| 444 void pop(Register dst); | 444 void pop(Register dst); |
| 445 void pop(const Operand& dst); | 445 void pop(const Operand& dst); |
| 446 | 446 |
| 447 void enter(const Immediate& size); |
| 448 void leave(); |
| 449 |
| 447 // Moves | 450 // Moves |
| 448 void mov_b(Register dst, const Operand& src); | 451 void mov_b(Register dst, const Operand& src); |
| 449 void mov_b(const Operand& dst, int8_t imm8); | 452 void mov_b(const Operand& dst, int8_t imm8); |
| 450 void mov_b(const Operand& dst, Register src); | 453 void mov_b(const Operand& dst, Register src); |
| 451 | 454 |
| 452 void mov_w(Register dst, const Operand& src); | 455 void mov_w(Register dst, const Operand& src); |
| 453 void mov_w(const Operand& dst, Register src); | 456 void mov_w(const Operand& dst, Register src); |
| 454 | 457 |
| 455 void mov(Register dst, int32_t imm32); | 458 void mov(Register dst, int32_t imm32); |
| 456 void mov(Register dst, const Immediate& x); | 459 void mov(Register dst, const Immediate& x); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 484 void and_(Register dst, int32_t imm32); | 487 void and_(Register dst, int32_t imm32); |
| 485 void and_(Register dst, const Operand& src); | 488 void and_(Register dst, const Operand& src); |
| 486 void and_(const Operand& src, Register dst); | 489 void and_(const Operand& src, Register dst); |
| 487 void and_(const Operand& dst, const Immediate& x); | 490 void and_(const Operand& dst, const Immediate& x); |
| 488 | 491 |
| 489 void cmp(Register reg, int32_t imm32); | 492 void cmp(Register reg, int32_t imm32); |
| 490 void cmp(Register reg, Handle<Object> handle); | 493 void cmp(Register reg, Handle<Object> handle); |
| 491 void cmp(Register reg, const Operand& op); | 494 void cmp(Register reg, const Operand& op); |
| 492 void cmp(const Operand& op, const Immediate& imm); | 495 void cmp(const Operand& op, const Immediate& imm); |
| 493 | 496 |
| 497 void rep_cmpsb(); |
| 498 void rep_cmpsw(); |
| 499 |
| 494 void dec_b(Register dst); | 500 void dec_b(Register dst); |
| 495 | 501 |
| 496 void dec(Register dst); | 502 void dec(Register dst); |
| 497 void dec(const Operand& dst); | 503 void dec(const Operand& dst); |
| 498 | 504 |
| 499 void cdq(); | 505 void cdq(); |
| 500 | 506 |
| 501 void idiv(Register src); | 507 void idiv(Register src); |
| 502 | 508 |
| 503 void imul(Register dst, const Operand& src); | 509 void imul(Register dst, const Operand& src); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 void test(Register reg, const Immediate& imm); | 549 void test(Register reg, const Immediate& imm); |
| 544 void test(Register reg, const Operand& op); | 550 void test(Register reg, const Operand& op); |
| 545 void test(const Operand& op, const Immediate& imm); | 551 void test(const Operand& op, const Immediate& imm); |
| 546 | 552 |
| 547 void xor_(Register dst, int32_t imm32); | 553 void xor_(Register dst, int32_t imm32); |
| 548 void xor_(Register dst, const Operand& src); | 554 void xor_(Register dst, const Operand& src); |
| 549 void xor_(const Operand& src, Register dst); | 555 void xor_(const Operand& src, Register dst); |
| 550 void xor_(const Operand& dst, const Immediate& x); | 556 void xor_(const Operand& dst, const Immediate& x); |
| 551 | 557 |
| 552 // Bit operations. | 558 // Bit operations. |
| 559 void bt(const Operand& dst, Register src); |
| 553 void bts(const Operand& dst, Register src); | 560 void bts(const Operand& dst, Register src); |
| 554 | 561 |
| 555 // Miscellaneous | 562 // Miscellaneous |
| 556 void hlt(); | 563 void hlt(); |
| 557 void int3(); | 564 void int3(); |
| 558 void nop(); | 565 void nop(); |
| 559 void rdtsc(); | 566 void rdtsc(); |
| 560 void ret(int imm16); | 567 void ret(int imm16); |
| 561 void leave(); | |
| 562 | 568 |
| 563 // Label operations & relative jumps (PPUM Appendix D) | 569 // Label operations & relative jumps (PPUM Appendix D) |
| 564 // | 570 // |
| 565 // Takes a branch opcode (cc) and a label (L) and generates | 571 // Takes a branch opcode (cc) and a label (L) and generates |
| 566 // either a backward branch or a forward branch and links it | 572 // either a backward branch or a forward branch and links it |
| 567 // to the label fixup chain. Usage: | 573 // to the label fixup chain. Usage: |
| 568 // | 574 // |
| 569 // Label L; // unbound label | 575 // Label L; // unbound label |
| 570 // j(cc, &L); // forward branch to unbound label | 576 // j(cc, &L); // forward branch to unbound label |
| 571 // bind(&L); // bind label to the current pc | 577 // bind(&L); // bind label to the current pc |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 void long_at_put(int pos, uint32_t x) { | 747 void long_at_put(int pos, uint32_t x) { |
| 742 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; | 748 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; |
| 743 } | 749 } |
| 744 | 750 |
| 745 // code emission | 751 // code emission |
| 746 void GrowBuffer(); | 752 void GrowBuffer(); |
| 747 inline void emit(uint32_t x); | 753 inline void emit(uint32_t x); |
| 748 inline void emit(Handle<Object> handle); | 754 inline void emit(Handle<Object> handle); |
| 749 inline void emit(uint32_t x, RelocInfo::Mode rmode); | 755 inline void emit(uint32_t x, RelocInfo::Mode rmode); |
| 750 inline void emit(const Immediate& x); | 756 inline void emit(const Immediate& x); |
| 757 inline void emit_w(const Immediate& x); |
| 751 | 758 |
| 752 // instruction generation | 759 // instruction generation |
| 753 void emit_arith_b(int op1, int op2, Register dst, int imm8); | 760 void emit_arith_b(int op1, int op2, Register dst, int imm8); |
| 754 | 761 |
| 755 // Emit a basic arithmetic instruction (i.e. first byte of the family is 0x81) | 762 // Emit a basic arithmetic instruction (i.e. first byte of the family is 0x81) |
| 756 // with a given destination expression and an immediate operand. It attempts | 763 // with a given destination expression and an immediate operand. It attempts |
| 757 // to use the shortest encoding possible. | 764 // to use the shortest encoding possible. |
| 758 // sel specifies the /n in the modrm byte (see the Intel PRM). | 765 // sel specifies the /n in the modrm byte (see the Intel PRM). |
| 759 void emit_arith(int sel, Operand dst, const Immediate& x); | 766 void emit_arith(int sel, Operand dst, const Immediate& x); |
| 760 | 767 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 private: | 810 private: |
| 804 Assembler* assembler_; | 811 Assembler* assembler_; |
| 805 #ifdef DEBUG | 812 #ifdef DEBUG |
| 806 int space_before_; | 813 int space_before_; |
| 807 #endif | 814 #endif |
| 808 }; | 815 }; |
| 809 | 816 |
| 810 } } // namespace v8::internal | 817 } } // namespace v8::internal |
| 811 | 818 |
| 812 #endif // V8_ASSEMBLER_IA32_H_ | 819 #endif // V8_ASSEMBLER_IA32_H_ |
| OLD | NEW |