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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 | 713 |
714 void Assembler::add(Register dst, const Operand& src) { | 714 void Assembler::add(Register dst, const Operand& src) { |
715 EnsureSpace ensure_space(this); | 715 EnsureSpace ensure_space(this); |
716 last_pc_ = pc_; | 716 last_pc_ = pc_; |
717 EMIT(0x03); | 717 EMIT(0x03); |
718 emit_operand(dst, src); | 718 emit_operand(dst, src); |
719 } | 719 } |
720 | 720 |
721 | 721 |
722 void Assembler::add(const Operand& dst, const Immediate& x) { | 722 void Assembler::add(const Operand& dst, const Immediate& x) { |
| 723 ASSERT(reloc_info_writer.last_pc() != NULL); |
| 724 if (FLAG_push_pop_elimination && (reloc_info_writer.last_pc() <= last_pc_)) { |
| 725 byte instr = last_pc_[0]; |
| 726 if ((instr & 0xf8) == 0x50) { |
| 727 // Last instruction was a push. Check whether this is a pop without a |
| 728 // result. |
| 729 if ((dst.is_reg(esp)) && |
| 730 (x.x_ == kPointerSize) && (x.rmode_ == RelocInfo::NONE)) { |
| 731 pc_ = last_pc_; |
| 732 last_pc_ = NULL; |
| 733 if (FLAG_print_push_pop_elimination) { |
| 734 PrintF("%d push/pop(noreg) eliminated\n", pc_offset()); |
| 735 } |
| 736 return; |
| 737 } |
| 738 } |
| 739 } |
723 EnsureSpace ensure_space(this); | 740 EnsureSpace ensure_space(this); |
724 last_pc_ = pc_; | 741 last_pc_ = pc_; |
725 emit_arith(0, dst, x); | 742 emit_arith(0, dst, x); |
726 } | 743 } |
727 | 744 |
728 | 745 |
729 void Assembler::and_(Register dst, int32_t imm32) { | 746 void Assembler::and_(Register dst, int32_t imm32) { |
730 EnsureSpace ensure_space(this); | 747 EnsureSpace ensure_space(this); |
731 last_pc_ = pc_; | 748 last_pc_ = pc_; |
732 emit_arith(4, Operand(dst), Immediate(imm32)); | 749 emit_arith(4, Operand(dst), Immediate(imm32)); |
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2030 ASSERT(bound_label.is_bound()); | 2047 ASSERT(bound_label.is_bound()); |
2031 ASSERT(0 <= position); | 2048 ASSERT(0 <= position); |
2032 ASSERT(position + static_cast<int>(sizeof(uint32_t)) <= pc_offset()); | 2049 ASSERT(position + static_cast<int>(sizeof(uint32_t)) <= pc_offset()); |
2033 ASSERT(long_at(position) == 0); // only initialize once! | 2050 ASSERT(long_at(position) == 0); // only initialize once! |
2034 | 2051 |
2035 uint32_t label_loc = reinterpret_cast<uint32_t>(addr_at(bound_label.pos())); | 2052 uint32_t label_loc = reinterpret_cast<uint32_t>(addr_at(bound_label.pos())); |
2036 long_at_put(position, label_loc); | 2053 long_at_put(position, label_loc); |
2037 } | 2054 } |
2038 | 2055 |
2039 } } // namespace v8::internal | 2056 } } // namespace v8::internal |
OLD | NEW |