| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/x64/assembler-x64.h" | 5 #include "src/x64/assembler-x64.h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
| 10 | 10 |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 | 556 |
| 557 void Assembler::immediate_arithmetic_op(byte subcode, | 557 void Assembler::immediate_arithmetic_op(byte subcode, |
| 558 Register dst, | 558 Register dst, |
| 559 Immediate src, | 559 Immediate src, |
| 560 int size) { | 560 int size) { |
| 561 EnsureSpace ensure_space(this); | 561 EnsureSpace ensure_space(this); |
| 562 emit_rex(dst, size); | 562 emit_rex(dst, size); |
| 563 if (is_int8(src.value_)) { | 563 if (is_int8(src.value_)) { |
| 564 emit(0x83); | 564 emit(0x83); |
| 565 emit_modrm(subcode, dst); | 565 emit_modrm(subcode, dst); |
| 566 if (!RelocInfo::IsNone(src.rmode_)) { |
| 567 RecordRelocInfo(src.rmode_); |
| 568 } |
| 566 emit(src.value_); | 569 emit(src.value_); |
| 567 } else if (dst.is(rax)) { | 570 } else if (dst.is(rax)) { |
| 568 emit(0x05 | (subcode << 3)); | 571 emit(0x05 | (subcode << 3)); |
| 569 emitl(src.value_); | 572 emit(src); |
| 570 } else { | 573 } else { |
| 571 emit(0x81); | 574 emit(0x81); |
| 572 emit_modrm(subcode, dst); | 575 emit_modrm(subcode, dst); |
| 573 emitl(src.value_); | 576 emit(src); |
| 574 } | 577 } |
| 575 } | 578 } |
| 576 | 579 |
| 577 void Assembler::immediate_arithmetic_op(byte subcode, | 580 void Assembler::immediate_arithmetic_op(byte subcode, |
| 578 const Operand& dst, | 581 const Operand& dst, |
| 579 Immediate src, | 582 Immediate src, |
| 580 int size) { | 583 int size) { |
| 581 EnsureSpace ensure_space(this); | 584 EnsureSpace ensure_space(this); |
| 582 emit_rex(dst, size); | 585 emit_rex(dst, size); |
| 583 if (is_int8(src.value_)) { | 586 if (is_int8(src.value_)) { |
| 584 emit(0x83); | 587 emit(0x83); |
| 585 emit_operand(subcode, dst); | 588 emit_operand(subcode, dst); |
| 589 if (!RelocInfo::IsNone(src.rmode_)) { |
| 590 RecordRelocInfo(src.rmode_); |
| 591 } |
| 586 emit(src.value_); | 592 emit(src.value_); |
| 587 } else { | 593 } else { |
| 588 emit(0x81); | 594 emit(0x81); |
| 589 emit_operand(subcode, dst); | 595 emit_operand(subcode, dst); |
| 590 emitl(src.value_); | 596 emit(src); |
| 591 } | 597 } |
| 592 } | 598 } |
| 593 | 599 |
| 594 | 600 |
| 595 void Assembler::immediate_arithmetic_op_16(byte subcode, | 601 void Assembler::immediate_arithmetic_op_16(byte subcode, |
| 596 Register dst, | 602 Register dst, |
| 597 Immediate src) { | 603 Immediate src) { |
| 598 EnsureSpace ensure_space(this); | 604 EnsureSpace ensure_space(this); |
| 599 emit(0x66); // Operand size override prefix. | 605 emit(0x66); // Operand size override prefix. |
| 600 emit_optional_rex_32(dst); | 606 emit_optional_rex_32(dst); |
| (...skipping 3593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4194 | 4200 |
| 4195 bool RelocInfo::IsInConstantPool() { | 4201 bool RelocInfo::IsInConstantPool() { |
| 4196 return false; | 4202 return false; |
| 4197 } | 4203 } |
| 4198 | 4204 |
| 4199 | 4205 |
| 4200 } // namespace internal | 4206 } // namespace internal |
| 4201 } // namespace v8 | 4207 } // namespace v8 |
| 4202 | 4208 |
| 4203 #endif // V8_TARGET_ARCH_X64 | 4209 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |