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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 736 ASSERT(CpuFeatures::IsEnabled(CpuFeatures::CMOV)); | 736 ASSERT(CpuFeatures::IsEnabled(CpuFeatures::CMOV)); |
| 737 EnsureSpace ensure_space(this); | 737 EnsureSpace ensure_space(this); |
| 738 last_pc_ = pc_; | 738 last_pc_ = pc_; |
| 739 UNIMPLEMENTED(); | 739 UNIMPLEMENTED(); |
| 740 USE(cc); | 740 USE(cc); |
| 741 USE(dst); | 741 USE(dst); |
| 742 USE(src); | 742 USE(src); |
| 743 } | 743 } |
| 744 | 744 |
| 745 | 745 |
| 746 void Assembler::xchg(Register dst, Register src) { | |
| 747 EnsureSpace ensure_space(this); | |
| 748 last_pc_ = pc_; | |
| 749 if (src.is(eax) || dst.is(eax)) { // Single-byte encoding | |
| 750 if (dst.is(eax)) { | |
| 751 dst = src; // No need to copy eax to src, we assume src is eax. | |
|
Kevin Millikin (Chromium)
2008/12/29 09:05:38
More straightforward:
EMIT(0x90 | (dst.is(eax) ? s
William Hesse
2008/12/29 11:47:42
Done.
| |
| 752 } | |
| 753 EMIT(0x90 | dst.code()); | |
| 754 } else { | |
| 755 EMIT(0x87); | |
| 756 EMIT(0xC0 | src.code() << 3 | dst.code()); | |
| 757 } | |
| 758 } | |
| 759 | |
| 760 | |
| 746 void Assembler::adc(Register dst, int32_t imm32) { | 761 void Assembler::adc(Register dst, int32_t imm32) { |
| 747 EnsureSpace ensure_space(this); | 762 EnsureSpace ensure_space(this); |
| 748 last_pc_ = pc_; | 763 last_pc_ = pc_; |
| 749 emit_arith(2, Operand(dst), Immediate(imm32)); | 764 emit_arith(2, Operand(dst), Immediate(imm32)); |
| 750 } | 765 } |
| 751 | 766 |
| 752 | 767 |
| 753 void Assembler::adc(Register dst, const Operand& src) { | 768 void Assembler::adc(Register dst, const Operand& src) { |
| 754 EnsureSpace ensure_space(this); | 769 EnsureSpace ensure_space(this); |
| 755 last_pc_ = pc_; | 770 last_pc_ = pc_; |
| (...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2140 ASSERT(bound_label.is_bound()); | 2155 ASSERT(bound_label.is_bound()); |
| 2141 ASSERT(0 <= position); | 2156 ASSERT(0 <= position); |
| 2142 ASSERT(position + static_cast<int>(sizeof(uint32_t)) <= pc_offset()); | 2157 ASSERT(position + static_cast<int>(sizeof(uint32_t)) <= pc_offset()); |
| 2143 ASSERT(long_at(position) == 0); // only initialize once! | 2158 ASSERT(long_at(position) == 0); // only initialize once! |
| 2144 | 2159 |
| 2145 uint32_t label_loc = reinterpret_cast<uint32_t>(addr_at(bound_label.pos())); | 2160 uint32_t label_loc = reinterpret_cast<uint32_t>(addr_at(bound_label.pos())); |
| 2146 long_at_put(position, label_loc); | 2161 long_at_put(position, label_loc); |
| 2147 } | 2162 } |
| 2148 | 2163 |
| 2149 } } // namespace v8::internal | 2164 } } // namespace v8::internal |
| OLD | NEW |